text:
<?php

namespace Jstewmc\Url;

use Jstewmc\Path\Path;

class Url
{
	/* !Protected properties */

	/**
	 * @var  string  the url's fragment
	 * @since  0.1.0
	 */
	protected $fragment;

	/**
	 * @var  string  the url's host
	 * @since  0.1.0
	 */
	protected $host;

	/**
	 * @var  string  the url's password
	 * @since  0.1.0
	 */
	protected $password;

	/**
	 * @var  Jstewmc\Path\Path  the url's Path
	 * @since  0.1.0
	 */
	protected $path;

	/**
	 * @var  string  the url's port
	 * @since  0.1.0
	 */
	protected $port;

	/**
	 * @var  Query  the url's Query string
	 * @since  0.1.0
	 */
	protected $query;

	/**
	 * @var  string  the url's scheme
	 * @since  0.1.0
	 */
	protected $scheme;

	/**
	 * @var  string  the url's username
	 * @since  0.1.0
	 */
	protected $username;

	/* !Get methods */

	/**
	 * @since  0.1.0
	 */
	public function getFragment()
	{
		return $this->fragment;
	}

	/**
	 * @since  0.1.0
	 */
	public function getHost()
	{
		return $this->host;
	}

	/**
	 * @since  0.1.0
	 */
	public function getPassword()
	{
		return $this->password;
	}

	/**
	 * @since  0.1.0
	 */
	public function getPath()
	{
		return $this->path;
	}

	/**
	 * @since  0.1.0
	 */
	public function getPort()
	{
		return $this->port;
	}

	/**
	 * @since  0.1.0
	 */
	public function getQuery()
	{
		return $this->query;
	}

	/**
	 * @since  0.1.0
	 */
	public function getScheme()
	{
		return $this->scheme;
	}

	/**
	 * @since  0.1.0
	 */
	public function getUsername()
	{
		return $this->username;
	}

	/* !Set methods */

	/**
	 * @since  0.1.0
	 */
	public function setFragment($fragment)
	{
		$this->fragment = $fragment;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setHost($host)
	{
		$this->host = $host;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setPassword($password)
	{
		$this->password = $password;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setPath($path)
	{
		if (is_string($path)) {
			$path = new Path($path);
		}

		$this->path = $path;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setPort($port)
	{
		$this->port = $port;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setQuery($query)
	{
		if (is_string($query)) {
			$query = new Query($query);
		}

		$this->query = $query;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setScheme($scheme)
	{
		$this->scheme = $scheme;

		return $this;
	}

	/**
	 * @since  0.1.0
	 */
	public function setUsername($username)
	{
		$this->username = $username;

		return $this;
	}

	/* !Magic methods */

	/**
	 * Constructs the object
	 *
	 * If a string url is given, I'll parse it. Keep in mind, I can only auto-magically
	 * parse well-formed URL's that follow convention (i.e., forward-slash ("/") path
	 * separator, ampersand ("&") argument separator, etc.).
	 *
	 * @param  string  $url  a string url to parse (optional; if omitted, defaults
	 *     to null, and this object is empty)
	 * @return  self
	 * @since  0.1.0
	 */
	public function __construct($url = null)
	{
		if (is_string($url)) {
			$this->parse($url);
		}

		// if the path and query haven't already been instantiated in the parse() method,
		//     instantiate them now as empty objects; otherwise, they will be null, and
		//     if the user attempts to set query params or path segments PHP will raise
		//     an non-object exception...
		//
		if (empty($this->path)) {
			$this->path = new Path();
		}

		if (empty($this->query)) {
			$this->query = new Query();
		}

		return;
	}

	/**
	 * Called when this url is treated like a string
	 *
	 * @return  string
	 * @since   0.1.0
	 */
	public function __toString()
	{
		return $this->format();
	}

	/* !Public methods */

	/**
	 * Formats the URL as a string
	 *
	 * For example:
	 *
	 *     $url = new Url();
	 *     $url->setScheme('http')->setHost('example.com')->setPath('foo/bar');
	 *     $url->format('absolute');  // prints "http://example.com/foo/bar"
	 *     $url->format('relative');  // prints "/foo/bar"
	 *
	 * @param  string  $format  the format to output (possible values: 'absolute',
	 *      include all non-empty-parts; 'relative', includes path, query, and
	 *      fragment) (optional; if omitted, defaults to 'absolute') (case-insensitive)
	 * @return  string
	 * @throws  InvalidArgumentException  if $format is not a string
	 * @throws  InvalidArgumentException  if $format is not 'absolute' or 'relative'
	 * @since   0.1.0
	 */
	public function format($format = 'absolute')
	{
		if (is_string($format)) {
			switch (strtolower($format)) {

				case 'absolute':
					$string = '';
					$string = $this->appendScheme($string);
					$string = $this->appendCredentials($string);
					$string = $this->appendHost($string);
					$string = $this->appendPort($string);
					$string = $this->appendPath($string);
					$string = $this->appendQuery($string);
					$string = $this->appendFragment($string);
					break;

				case 'relative':
					$string = '/';
					$string = $this->appendPath($string);
					$string = $this->appendQuery($string);
					$string = $this->appendFragment($string);
					break;

				default:
					throw new \InvalidArgumentException(
						__METHOD__."() expects parameter one, format, to be the string 'absolute' "
							. "or 'relative'; '$format' given"
					);
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, format, to be a string"
			);
		}

		return $string;
	}

	/**
	 * Parses a string url
	 *
	 * I break the parsing of a url into smaller functions which are easier to extend
	 * in child-classes.
	 *
	 * Keep in mind, I'll only function correctly if the URL is well-formed and follows
	 * convention (i.e., forward-slash ("/") path separator, ampersand ("&") argument
	 * separator, etc). If not, results will be wonky and you should parse the URL by
	 * hand instead.
	 *
	 * @param  string  $url  the url to parse
	 * @return  self
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @throws  InvalidArgumentException  if $url is not a well-formed url
	 * @since   0.1.0
	 */
	public function parse($url)
	{
		// if $url is a string
		if (is_string($url)) {
			// if PHP can parse the url into its constituent parts...
			// parse_url() will return false if the url is mal-formed, and if a part is missing,
			//     its key-value will be omitted from the result array
			//
			$parts = parse_url($url);
			if ($parts !== false) {
				if (isset($parts['scheme'])) {
					$this->parseScheme($parts['scheme']);
				}

				if (isset($parts['user'])) {
					$this->parseUsername($parts['user']);
				}

				if (isset($parts['pass'])) {
					$this->parsePassword($parts['pass']);
				}

				if (isset($parts['host'])) {
					$this->parseHost($parts['host']);
				}

				if (isset($parts['port'])) {
					$this->parsePort($parts['port']);
				}

				if (isset($parts['path'])) {
					$this->parsePath($parts['path']);
				}

				if (isset($parts['query'])) {
					$this->parseQuery($parts['query']);
				}

				if (isset($parts['fragment'])) {
					$this->parseFragment($parts['fragment']);
				}
			} else {
				throw new \InvalidArgumentException(
					__METHOD__."() expects parameter one, url, to be a well-formed url"
				);
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string url"
			);
		}

		return $this;
	}

	/* !Protected methods */

	/**
	 * Appends the user's credentials to the url
	 *
	 * @param  string  $url  the url to append the credentials to
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendCredentials($url)
	{
		if (is_string($url)) {
			if ( ! empty($this->username)) {
				$url .= $this->username;
				if ( ! empty($this->password)) {
					$url .= ':'.$this->password;
				}
				$url .= '@';
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Appends the fragment to the url
	 *
	 * @param  string  $url  the url to append the fragment to
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendFragment($url)
	{
		if (is_string($url)) {
			if ( ! empty($this->fragment)) {
				$url .= '#'.$this->fragment;
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Appends the host to the url
	 *
	 * @param  string  $url  the url to append the host to
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendHost($url)
	{
		if (is_string($url)) {
			if ( ! empty($this->host)) {
				$url .= $this->host;
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Appends the path to the url
	 *
	 * @param  string  $url  the url to append
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendPath($url)
	{
		if (is_string($url)) {
			// don't forget that path is a Path object
			// type-cast it to string to check if it's empty
			//
			if ( ! empty((string) $this->path)) {
				// if the url doesn't have a separator, add it
				if (substr($url, -1, 1) !== '/') {
					$url .= '/';
				}
				$url .= $this->path;
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Appends the port to the url
	 *
	 * @param  string  $url  the url to append the port to
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendPort($url)
	{
		if (is_string($url)) {
			if ( ! empty($this->port)) {
				$url .= ':'.$this->port;
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Appends the query to $url
	 *
	 * @param  string  $url  the url to append the query to
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendQuery($url)
	{
		if (is_string($url)) {
			// don't forget that query is a Query object
			// type-cast it to string to check if it's empty
			//
			if ( ! empty((string) $this->query)) {
				$url .= '?'.$this->query;
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Appends the scheme to the url
	 *
	 * @param  string  $url  the url to append the scheme to
	 * @return  string
	 * @throws  InvalidArgumentException  if $url is not a string
	 * @since   0.1.0
	 */
	protected function appendScheme($url)
	{
		if (is_string($url)) {
			if ( ! empty($this->scheme)) {
				$url .= $this->scheme.'://';
			}
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, url, to be a string"
			);
		}

		return $url;
	}

	/**
	 * Parses the url's fragment
	 *
	 * @param  string  $fragment  the url fragment to parse
	 * @return  self
	 * @throws  InvalidArgumentException  if $fragment is not a string
	 * @since   0.1.0
	 */
	protected function parseFragment($fragment)
	{
		if (is_string($fragment)) {
			if (substr($fragment, 0, 1) === '#') {
				$fragment = substr($fragment, 1);
			}
			$this->fragment = $fragment;
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, fragment, to be a string"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's host
	 *
	 * @param  string  $host  the url's host
	 * @return  self
	 * @throws  InvalidArgumentException  if $host is not a string
	 * @since   0.1.0
	 */
	protected function parseHost($host)
	{
		if (is_string($host)) {
			$this->host = $host;
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, host, to be a string"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's password
	 *
	 * @param  string  $password  the url's password
	 * @return  self
	 * @throws  InvalidArgumentException  if $password is not a string
	 * @since   0.1.0
	 */
	protected function parsePassword($password)
	{
		if (is_string($password)) {
			$this->password = $password;
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, password, to be a string url password"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's path
	 *
	 * @param  string  $path  the url's path
	 * @return  self
	 * @throws  InvalidArgumentException  if $path is not a string
	 * @since   0.1.0
	 */
	protected function parsePath($path)
	{
		if (is_string($path)) {
			$this->path = new Path($path);
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, path, to be a string url path"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's port
	 *
	 * @return  string|int  $port  the url's port
	 * @return  self
	 * @throws  InvalidArgumentException  if $port is not a string or int
	 * @since   0.1.0
	 */
	protected function parsePort($port)
	{
		if (is_string($port) || (is_numeric($port) && is_int(+$port) && $port > 0)) {
			$this->port = (int) $port;
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, port, to be a string or integer"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's query string
	 *
	 * @param  string  $query  the url's query string
	 * @return  self
	 * @throws  InvalidArgumentException  if $query is not a string
	 * @throws  InvalidArgumentException  if $query is a string, but its key-value
	 *     pairs contain multiple assignment operators ("=") (i.e., the query's
	 *     separator is not the default ampersand "&")
	 * @since   0.1.0
	 */
	protected function parseQuery($query)
	{
		if (is_string($query)) {
			$this->query = new Query($query);
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, query, to be a string"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's scheme
	 *
	 * @param  string  $scheme  the url's scheme
	 * @return  self
	 * @throws  InvalidArgumentException  if $scheme is not a string
	 * @since   0.1.0
	 */
	protected function parseScheme($scheme)
	{
		if (is_string($scheme)) {
			$this->scheme = $scheme;
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, scheme, to be a string"
			);
		}

		return $this;
	}

	/**
	 * Parses the url's username
	 *
	 * @param  string  $username  the url's username
	 * @return  self
	 * @throws  InvalidArgumentException  if $username is not a string
	 * @since   0.1.0
	 */
	protected function parseUsername($username)
	{
		if (is_string($username)) {
			$this->username = $username;
		} else {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, username, to be a string"
			);
		}

		return $this;
	}
}


text:
layout: post
title:  SAS Forum UK The Launch of Viya
author: Lewis Gavin
comments: true
tags:
- conference
- machinelearning
- sas
---

![SAS Forum UK 2016 Birmingham](https://www.lewisgavin.co.uk/images/sas-uk.jpg)
*Image taken from [twitter](https://pbs.twimg.com/media/CtckOlzXYAkiwCz.jpg:large)*

This post will share my thoughts from the UK SAS Forum!

The day opened with an introduction into Viya and its capabilities before moving onto SAS customers discussing use cases. In the afternoon the conference hosted a number of 30 minute sessions across a number of streams including customer stories, SAS hosted talks and Technical talks.

This post will share my thoughts on each of the sessions I attended as a Data Engineer and budding Data Scientist that has heard of, but never used SAS. I will be focusing on the capabilities that SAS tools can leverage and what they mean to Data Engineers and Scientists.

## Keynote: SAS Viya - Hugo D'Ulisse

The event comes a few days after the first release of SAS Viya: The new SAS open analytics platform. Viya has been the talk of the conference as it promotes not only a new platform but also a new direction for SAS. The main point being stressed around Viya is that it is **open**. This means that analytics capabilities will be opened up through API's that can be used in Python and Java. **Open** also refers to the platforms that Viya can be deployed on, including **Cloud based** infrastructures.

![SAS Viya](https://pbs.twimg.com/media/CtWYG3GXgAAALGA.jpg:large)
*Image taken from Twitter*

## Keynote: Royal Bank of Scotland Use Case - Paul Hollands

Paul Hollands from RBS gave a very impressive presentation named "Are your wheels rounder than mine?" reffering to how well RBS have used SAS (the same tools that everyone else has access to) to gain great insight. What he was getting at was that the way you use the tools is just as important as the tools themselves.

There was a live demo that focussed on a use case where RBS were trying to decide how many offices they needed based on where their employees live. By using SAS Visual Analytics (that they rebranded as Genie) they could plot on a map where their employees live and use SAS to flex the number of office buildings and in real time show how that affects the number of employees that live within 40 miles of an office.

![RBS are your wheels rounder than mine](https://pbs.twimg.com/media/CtWwErAWYAA1OO_.jpg:large)
*Image taken from Twitter*

RBS have also built something named Next Best Action. This tried to solve the problem of tracking customers across all channels and also how to resolve customer complaints. By tracking customer events before a complaint was made, the complaint itself and the resolution method, they could then use a feedback loop to learn and use the insights from this to instigate better actions in the future, or avoid the complaint altogether.

## Customer Stories: Nationwide - Katy Cook

Nationwide use Business Objects, Qlikview and SAS for their analytics and reporting. They hold 16TB of data and are currently using v9.2 of SAS. They have to process 380 million records a day and have 350 users and 650 data consumers on their "SASO" server (high performance SAS server).

They have used SAS for many years moving through the ecosystem however the majority of the talk was around business processes. The key points to take away are that they are also looking at how to better put the customer first and quicker understand their intentions to improve the customer experience.

Their development teams also take 30 minutes every 2 weeks to do some "housekeeping". This includes things like finishing up documentation, code refactoring or task management - a really good idea!

## Machine Learning in SAS - John Spooner

Yes - Machine Learning is possible in SAS. They have rebranded these capabilities in SAS Viya as Visual Data Mining and Machine Learning (VDMML). The way they defined Machine Learnin was that its a process that looks to convert raw data into decisions. The idea being that you train a machine with no human interaction where possible and re-inforce the learning to improve the accuracy of the results.

![SAS Machine Learning and Data Mining](https://www.lewisgavin.co.uk/images/sas_ml.jpg)

VDMML supports both structured and unstructured data. By unstructured data this means not only text, but images, sound or videos too. The 3 mains areas that are covered are Data Prep, Machine Learning Algorithms and Model Scoring (how do you deploy your model).

As I mentioned earlier, SAS can now be deployed on a number of different infrastructures: including Hadoop. Machine Learning algorithms are naturally computationally heavy so being able to distribute this processing on a big data platform like Hadoop is very useful - similar to the concept applied by Spark MLLib. This makes SAS desireable for Data Scientists as they can now run their models on large data sets very quickly and get to analysing the results faster.

## SAS on Hadoop

As I just mentioned, SAS can now be deployed on a Hadoop cluster. I was curious as to how this would work and how it performs. There are 3 ways to run SAS code in conjunction with Hadoop:

1. From Hadoop - bring the data out of Hadoop and process it on a SAS server. This works for small amounts of data and testing but wouldn't be optimal for using the power of the cluster for large computations.
2. Move SAS workload into Hadoop to the data using Map Reduce and Spark - this would convert SAS code into Map Reduce or Spark code and run that on the cluster.
3. Move SAS Application to Hadoop through Yarn - this requires SAS kernals to be running on Hadoop data nodes that can accept and run SAS code directly on the cluster and obtain its resources via YARN.

## Cloud Directions - David Annis

One of the main focus points of the conference was around the new Cloud direction. SAS are entering the market to give you all the benefits you would expect from a Cloud platform. There will be a number of different deployment methods with the new SAS Viya platform including having the whole cloud platform and infrastructure hosted by SAS or using your own cloud vendor and deploying Viya on top of that.

The main challenges will be around their licensing model. Most cloud vendors follow the pay for what you use model. SAS want to follow this however traditionally this isn't how they license their products. It will be interesting to see how they overcome this.

## Number Crush with Hannah Fry

The final session of the day was presented by Hannah Fry who has done a number of shows for the **BBC**. Hannah talked through a number of interesting use cases for data and analytics including figuring out where mass murderers live in relation to the location of their crimes and calculating pain points in the London travel network.

![Hannah Fry Number Crush](https://pbs.twimg.com/media/CtX1qlMXYAAb7MK.jpg:large)
*Image taken from Twitter*

The biggest thing I took away from this was probably the opposite of what SAS would have wanted. Most of the day was positioned around automating data science capabilities and abstracting the complexities that come along with analytics. However Hannah's experiments and findings proved that regardless of how good the tools are, people that have the right brains to think analytically are still going to be required in order to answer the really interesting and difficult questions.

redpajama_set_name: RedPajamaGithub


text:
#include <stdio.h>
#include <string.h>
#include <string>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
#include <array>
#include <iostream>
#include "ocstack.h"
#include "logger.h"
#include "ocpayload.h"

using namespace std;

#define TAG "ocrouting"

int gQuitFlag = 0;

/* SIGINT handler: set gQuitFlag to 1 for graceful termination */
void handleSigInt(int signum)
{
    if (signum == SIGINT)
    {
        gQuitFlag = 1;
    }
}

int main()
{
    cout << "\nOCRouting sample is starting...";

    if (OCInit(NULL, 0, OC_GATEWAY) != OC_STACK_OK)
    {
        cout << "\nOCStack init error";
        return 0;
    }

    // Break from loop with Ctrl-C
    cout << "\nEntering ocrouting main loop...";

    signal(SIGINT, handleSigInt);

    while (!gQuitFlag)
    {
        if (OCProcess() != OC_STACK_OK)
        {
            cout << "\nOCStack process error";
            return 0;
        }
    }

    cout << "\nExiting ocrouting main loop...";

    if (OCStop() != OC_STACK_OK)
    {
        cout << "\nOCStack process error";
    }

    return 0;
}


text:
package pro.projo.generation.dtd.model;

public enum Occurrence
{
    ZERO_OR_MORE,
    ONE_OR_MORE,
    ZERO_OR_ONE,
    ONCE;
}


text:
<?php
/**
 * Post Types
 *
 * Registers post types and taxonomies.
 *
 * @class     WC_Post_types
 * @version   2.5.0
 * @package   WooCommerce/Classes/Products
 * @category  Class
 * @author    WooThemes
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * WC_Post_types Class.
 */
class WC_Post_types {

	/**
	 * Hook in methods.
	 */
	public static function init() {
		add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 5 );
		add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
		add_action( 'init', array( __CLASS__, 'register_post_status' ), 9 );
		add_action( 'init', array( __CLASS__, 'support_jetpack_omnisearch' ) );
		add_filter( 'rest_api_allowed_post_types', array( __CLASS__, 'rest_api_allowed_post_types' ) );
		add_action( 'woocommerce_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) );
	}

	/**
	 * Register core taxonomies.
	 */
	public static function register_taxonomies() {

		if ( ! is_blog_installed() ) {
			return;
		}

		if ( taxonomy_exists( 'product_type' ) ) {
			return;
		}

		do_action( 'woocommerce_register_taxonomy' );

		$permalinks = wc_get_permalink_structure();

		register_taxonomy( 'product_type',
			apply_filters( 'woocommerce_taxonomy_objects_product_type', array( 'product' ) ),
			apply_filters( 'woocommerce_taxonomy_args_product_type', array(
				'hierarchical'      => false,
				'show_ui'           => false,
				'show_in_nav_menus' => false,
				'query_var'         => is_admin(),
				'rewrite'           => false,
				'public'            => false,
			) )
		);

		register_taxonomy( 'product_visibility',
			apply_filters( 'woocommerce_taxonomy_objects_product_visibility', array( 'product', 'product_variation' ) ),
			apply_filters( 'woocommerce_taxonomy_args_product_visibility', array(
				'hierarchical'      => false,
				'show_ui'           => false,
				'show_in_nav_menus' => false,
				'query_var'         => is_admin(),
				'rewrite'           => false,
				'public'            => false,
			) )
		);

		register_taxonomy( 'product_cat',
			apply_filters( 'woocommerce_taxonomy_objects_product_cat', array( 'product' ) ),
			apply_filters( 'woocommerce_taxonomy_args_product_cat', array(
				'hierarchical'          => true,
				'update_count_callback' => '_wc_term_recount',
				'label'                 => __( 'Categories', 'woocommerce' ),
				'labels' => array(
						'name'              => __( 'Product categories', 'woocommerce' ),
						'singular_name'     => __( 'Category', 'woocommerce' ),
						'menu_name'         => _x( 'Categories', 'Admin menu name', 'woocommerce' ),
						'search_items'      => __( 'Search categories', 'woocommerce' ),
						'all_items'         => __( 'All categories', 'woocommerce' ),
						'parent_item'       => __( 'Parent category', 'woocommerce' ),
						'parent_item_colon' => __( 'Parent category:', 'woocommerce' ),
						'edit_item'         => __( 'Edit category', 'woocommerce' ),
						'update_item'       => __( 'Update category', 'woocommerce' ),
						'add_new_item'      => __( 'Add new category', 'woocommerce' ),
						'new_item_name'     => __( 'New category name', 'woocommerce' ),
						'not_found'         => __( 'No categories found', 'woocommerce' ),
					),
				'show_ui'               => true,
				'query_var'             => true,
				'capabilities'          => array(
					'manage_terms' => 'manage_product_terms',
					'edit_terms'   => 'edit_product_terms',
					'delete_terms' => 'delete_product_terms',
					'assign_terms' => 'assign_product_terms',
				),
				'rewrite'          => array(
					'slug'         => $permalinks['category_rewrite_slug'],
					'with_front'   => false,
					'hierarchical' => true,
				),
			) )
		);

		register_taxonomy( 'product_tag',
			apply_filters( 'woocommerce_taxonomy_objects_product_tag', array( 'product' ) ),
			apply_filters( 'woocommerce_taxonomy_args_product_tag', array(
				'hierarchical'          => false,
				'update_count_callback' => '_wc_term_recount',
				'label'                 => __( 'Product tags', 'woocommerce' ),
				'labels'                => array(
						'name'                       => __( 'Product tags', 'woocommerce' ),
						'singular_name'              => __( 'Tag', 'woocommerce' ),
						'menu_name'                  => _x( 'Tags', 'Admin menu name', 'woocommerce' ),
						'search_items'               => __( 'Search tags', 'woocommerce' ),
						'all_items'                  => __( 'All tags', 'woocommerce' ),
						'edit_item'                  => __( 'Edit tag', 'woocommerce' ),
						'update_item'                => __( 'Update tag', 'woocommerce' ),
						'add_new_item'               => __( 'Add new tag', 'woocommerce' ),
						'new_item_name'              => __( 'New tag name', 'woocommerce' ),
						'popular_items'              => __( 'Popular tags', 'woocommerce' ),
						'separate_items_with_commas' => __( 'Separate tags with commas', 'woocommerce' ),
						'add_or_remove_items'        => __( 'Add or remove tags', 'woocommerce' ),
						'choose_from_most_used'      => __( 'Choose from the most used tags', 'woocommerce' ),
						'not_found'                  => __( 'No tags found', 'woocommerce' ),
					),
				'show_ui'               => true,
				'query_var'             => true,
				'capabilities'          => array(
					'manage_terms' => 'manage_product_terms',
					'edit_terms'   => 'edit_product_terms',
					'delete_terms' => 'delete_product_terms',
					'assign_terms' => 'assign_product_terms',
				),
				'rewrite'               => array(
					'slug'       => $permalinks['tag_rewrite_slug'],
					'with_front' => false,
				),
			) )
		);

		register_taxonomy( 'product_shipping_class',
			apply_filters( 'woocommerce_taxonomy_objects_product_shipping_class', array( 'product', 'product_variation' ) ),
			apply_filters( 'woocommerce_taxonomy_args_product_shipping_class', array(
				'hierarchical'          => false,
				'update_count_callback' => '_update_post_term_count',
				'label'                 => __( 'Shipping classes', 'woocommerce' ),
				'labels' => array(
						'name'              => __( 'Product shipping classes', 'woocommerce' ),
						'singular_name'     => __( 'Shipping class', 'woocommerce' ),
						'menu_name'         => _x( 'Shipping classes', 'Admin menu name', 'woocommerce' ),
						'search_items'      => __( 'Search shipping classes', 'woocommerce' ),
						'all_items'         => __( 'All shipping classes', 'woocommerce' ),
						'parent_item'       => __( 'Parent shipping class', 'woocommerce' ),
						'parent_item_colon' => __( 'Parent shipping class:', 'woocommerce' ),
						'edit_item'         => __( 'Edit shipping class', 'woocommerce' ),
						'update_item'       => __( 'Update shipping class', 'woocommerce' ),
						'add_new_item'      => __( 'Add new shipping class', 'woocommerce' ),
						'new_item_name'     => __( 'New shipping class Name', 'woocommerce' ),
					),
				'show_ui'               => false,
				'show_in_quick_edit'    => false,
				'show_in_nav_menus'     => false,
				'query_var'             => is_admin(),
				'capabilities'          => array(
					'manage_terms' => 'manage_product_terms',
					'edit_terms'   => 'edit_product_terms',
					'delete_terms' => 'delete_product_terms',
					'assign_terms' => 'assign_product_terms',
				),
				'rewrite'               => false,
			) )
		);

		global $wc_product_attributes;

		$wc_product_attributes = array();

		if ( $attribute_taxonomies = wc_get_attribute_taxonomies() ) {
			foreach ( $attribute_taxonomies as $tax ) {
				if ( $name = wc_attribute_taxonomy_name( $tax->attribute_name ) ) {
					$tax->attribute_public          = absint( isset( $tax->attribute_public ) ? $tax->attribute_public : 1 );
					$label                          = ! empty( $tax->attribute_label ) ? $tax->attribute_label : $tax->attribute_name;
					$wc_product_attributes[ $name ] = $tax;
					$taxonomy_data                  = array(
						'hierarchical'          => false,
						'update_count_callback' => '_update_post_term_count',
						'labels'                => array(
								'name'              => sprintf( _x( 'Product %s', 'Product Attribute', 'woocommerce' ), $label ),
								'singular_name'     => $label,
								'search_items'      => sprintf( __( 'Search %s', 'woocommerce' ), $label ),
								'all_items'         => sprintf( __( 'All %s', 'woocommerce' ), $label ),
								'parent_item'       => sprintf( __( 'Parent %s', 'woocommerce' ), $label ),
								'parent_item_colon' => sprintf( __( 'Parent %s:', 'woocommerce' ), $label ),
								'edit_item'         => sprintf( __( 'Edit %s', 'woocommerce' ), $label ),
								'update_item'       => sprintf( __( 'Update %s', 'woocommerce' ), $label ),
								'add_new_item'      => sprintf( __( 'Add new %s', 'woocommerce' ), $label ),
								'new_item_name'     => sprintf( __( 'New %s', 'woocommerce' ), $label ),
								'not_found'         => sprintf( __( 'No "%s" found', 'woocommerce' ), $label ),
							),
						'show_ui'            => true,
						'show_in_quick_edit' => false,
						'show_in_menu'       => false,
						'meta_box_cb'        => false,
						'query_var'          => 1 === $tax->attribute_public,
						'rewrite'            => false,
						'sort'               => false,
						'public'             => 1 === $tax->attribute_public,
						'show_in_nav_menus'  => 1 === $tax->attribute_public && apply_filters( 'woocommerce_attribute_show_in_nav_menus', false, $name ),
						'capabilities'       => array(
							'manage_terms' => 'manage_product_terms',
							'edit_terms'   => 'edit_product_terms',
							'delete_terms' => 'delete_product_terms',
							'assign_terms' => 'assign_product_terms',
						),
					);

					if ( 1 === $tax->attribute_public && sanitize_title( $tax->attribute_name ) ) {
						$taxonomy_data['rewrite'] = array(
							'slug'         => trailingslashit( $permalinks['attribute_rewrite_slug'] ) . sanitize_title( $tax->attribute_name ),
							'with_front'   => false,
							'hierarchical' => true,
						);
					}

					register_taxonomy( $name, apply_filters( "woocommerce_taxonomy_objects_{$name}", array( 'product' ) ), apply_filters( "woocommerce_taxonomy_args_{$name}", $taxonomy_data ) );
				}
			}
		}

		do_action( 'woocommerce_after_register_taxonomy' );
	}

	/**
	 * Register core post types.
	 */
	public static function register_post_types() {
		if ( ! is_blog_installed() || post_type_exists( 'product' ) ) {
			return;
		}

		do_action( 'woocommerce_register_post_type' );

		$permalinks = wc_get_permalink_structure();
		$supports = array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields', 'publicize', 'wpcom-markdown' );

		if ( 'yes' === get_option( 'woocommerce_enable_reviews', 'yes' ) ) {
			$supports[] = 'comments';
		}

		register_post_type( 'product',
			apply_filters( 'woocommerce_register_post_type_product',
				array(
					'labels'              => array(
							'name'                  => __( 'Products', 'woocommerce' ),
							'singular_name'         => __( 'Product', 'woocommerce' ),
							'all_items'             => __( 'All Products', 'woocommerce' ),
							'menu_name'             => _x( 'Products', 'Admin menu name', 'woocommerce' ),
							'add_new'               => __( 'Add New', 'woocommerce' ),
							'add_new_item'          => __( 'Add new product', 'woocommerce' ),
							'edit'                  => __( 'Edit', 'woocommerce' ),
							'edit_item'             => __( 'Edit product', 'woocommerce' ),
							'new_item'              => __( 'New product', 'woocommerce' ),
							'view'                  => __( 'View product', 'woocommerce' ),
							'view_item'             => __( 'View product', 'woocommerce' ),
							'search_items'          => __( 'Search products', 'woocommerce' ),
							'not_found'             => __( 'No products found', 'woocommerce' ),
							'not_found_in_trash'    => __( 'No products found in trash', 'woocommerce' ),
							'parent'                => __( 'Parent product', 'woocommerce' ),
							'featured_image'        => __( 'Product image', 'woocommerce' ),
							'set_featured_image'    => __( 'Set product image', 'woocommerce' ),
							'remove_featured_image' => __( 'Remove product image', 'woocommerce' ),
							'use_featured_image'    => __( 'Use as product image', 'woocommerce' ),
							'insert_into_item'      => __( 'Insert into product', 'woocommerce' ),
							'uploaded_to_this_item' => __( 'Uploaded to this product', 'woocommerce' ),
							'filter_items_list'     => __( 'Filter products', 'woocommerce' ),
							'items_list_navigation' => __( 'Products navigation', 'woocommerce' ),
							'items_list'            => __( 'Products list', 'woocommerce' ),
						),
					'description'         => __( 'This is where you can add new products to your store.', 'woocommerce' ),
					'public'              => true,
					'show_ui'             => true,
					'capability_type'     => 'product',
					'map_meta_cap'        => true,
					'publicly_queryable'  => true,
					'exclude_from_search' => false,
					'hierarchical'        => false, // Hierarchical causes memory issues - WP loads all records!
					'rewrite'             => $permalinks['product_rewrite_slug'] ? array( 'slug' => $permalinks['product_rewrite_slug'], 'with_front' => false, 'feeds' => true ) : false,
					'query_var'           => true,
					'supports'            => $supports,
					'has_archive'         => ( $shop_page_id = wc_get_page_id( 'shop' ) ) && get_post( $shop_page_id ) ? urldecode( get_page_uri( $shop_page_id ) ) : 'shop',
					'show_in_nav_menus'   => true,
					'show_in_rest'        => true,
				)
			)
		);

		register_post_type( 'product_variation',
			apply_filters( 'woocommerce_register_post_type_product_variation',
				array(
					'label'           => __( 'Variations', 'woocommerce' ),
					'public'          => false,
					'hierarchical'    => false,
					'supports'        => false,
					'capability_type' => 'product',
					'rewrite'         => false,
				)
			)
		);

		wc_register_order_type(
			'shop_order',
			apply_filters( 'woocommerce_register_post_type_shop_order',
				array(
					'labels'              => array(
							'name'                  => __( 'Orders', 'woocommerce' ),
							'singular_name'         => _x( 'Order', 'shop_order post type singular name', 'woocommerce' ),
							'add_new'               => __( 'Add order', 'woocommerce' ),
							'add_new_item'          => __( 'Add new order', 'woocommerce' ),
							'edit'                  => __( 'Edit', 'woocommerce' ),
							'edit_item'             => __( 'Edit order', 'woocommerce' ),
							'new_item'              => __( 'New order', 'woocommerce' ),
							'view'                  => __( 'View order', 'woocommerce' ),
							'view_item'             => __( 'View order', 'woocommerce' ),
							'search_items'          => __( 'Search orders', 'woocommerce' ),
							'not_found'             => __( 'No orders found', 'woocommerce' ),
							'not_found_in_trash'    => __( 'No orders found in trash', 'woocommerce' ),
							'parent'                => __( 'Parent orders', 'woocommerce' ),
							'menu_name'             => _x( 'Orders', 'Admin menu name', 'woocommerce' ),
							'filter_items_list'     => __( 'Filter orders', 'woocommerce' ),
							'items_list_navigation' => __( 'Orders navigation', 'woocommerce' ),
							'items_list'            => __( 'Orders list', 'woocommerce' ),
						),
					'description'         => __( 'This is where store orders are stored.', 'woocommerce' ),
					'public'              => false,
					'show_ui'             => true,
					'capability_type'     => 'shop_order',
					'map_meta_cap'        => true,
					'publicly_queryable'  => false,
					'exclude_from_search' => true,
					'show_in_menu'        => current_user_can( 'manage_woocommerce' ) ? 'woocommerce' : true,
					'hierarchical'        => false,
					'show_in_nav_menus'   => false,
					'rewrite'             => false,
					'query_var'           => false,
					'supports'            => array( 'title', 'comments', 'custom-fields' ),
					'has_archive'         => false,
				)
			)
		);

		wc_register_order_type(
			'shop_order_refund',
			apply_filters( 'woocommerce_register_post_type_shop_order_refund',
				array(
					'label'                            => __( 'Refunds', 'woocommerce' ),
					'capability_type'                  => 'shop_order',
					'public'                           => false,
					'hierarchical'                     => false,
					'supports'                         => false,
					'exclude_from_orders_screen'       => false,
					'add_order_meta_boxes'             => false,
					'exclude_from_order_count'         => true,
					'exclude_from_order_views'         => false,
					'exclude_from_order_reports'       => false,
					'exclude_from_order_sales_reports' => true,
					'class_name'                       => 'WC_Order_Refund',
					'rewrite'                          => false,
				)
			)
		);

		if ( 'yes' == get_option( 'woocommerce_enable_coupons' ) ) {
			register_post_type( 'shop_coupon',
				apply_filters( 'woocommerce_register_post_type_shop_coupon',
					array(
						'labels'              => array(
								'name'                  => __( 'Coupons', 'woocommerce' ),
								'singular_name'         => __( 'Coupon', 'woocommerce' ),
								'menu_name'             => _x( 'Coupons', 'Admin menu name', 'woocommerce' ),
								'add_new'               => __( 'Add coupon', 'woocommerce' ),
								'add_new_item'          => __( 'Add new coupon', 'woocommerce' ),
								'edit'                  => __( 'Edit', 'woocommerce' ),
								'edit_item'             => __( 'Edit coupon', 'woocommerce' ),
								'new_item'              => __( 'New coupon', 'woocommerce' ),
								'view'                  => __( 'View coupons', 'woocommerce' ),
								'view_item'             => __( 'View coupon', 'woocommerce' ),
								'search_items'          => __( 'Search coupons', 'woocommerce' ),
								'not_found'             => __( 'No coupons found', 'woocommerce' ),
								'not_found_in_trash'    => __( 'No coupons found in trash', 'woocommerce' ),
								'parent'                => __( 'Parent coupon', 'woocommerce' ),
								'filter_items_list'     => __( 'Filter coupons', 'woocommerce' ),
								'items_list_navigation' => __( 'Coupons navigation', 'woocommerce' ),
								'items_list'            => __( 'Coupons list', 'woocommerce' ),
							),
						'description'         => __( 'This is where you can add new coupons that customers can use in your store.', 'woocommerce' ),
						'public'              => false,
						'show_ui'             => true,
						'capability_type'     => 'shop_coupon',
						'map_meta_cap'        => true,
						'publicly_queryable'  => false,
						'exclude_from_search' => true,
						'show_in_menu'        => current_user_can( 'manage_woocommerce' ) ? 'woocommerce' : true,
						'hierarchical'        => false,
						'rewrite'             => false,
						'query_var'           => false,
						'supports'            => array( 'title' ),
						'show_in_nav_menus'   => false,
						'show_in_admin_bar'   => true,
					)
				)
			);
		}

		register_post_type( 'shop_webhook',
			apply_filters( 'woocommerce_register_post_type_shop_webhook',
				array(
					'labels'              => array(
						'name'               => __( 'Webhooks', 'woocommerce' ),
						'singular_name'      => __( 'Webhook', 'woocommerce' ),
						'menu_name'          => _x( 'Webhooks', 'Admin menu name', 'woocommerce' ),
						'add_new'            => __( 'Add webhook', 'woocommerce' ),
						'add_new_item'       => __( 'Add new webhook', 'woocommerce' ),
						'edit'               => __( 'Edit', 'woocommerce' ),
						'edit_item'          => __( 'Edit webhook', 'woocommerce' ),
						'new_item'           => __( 'New webhook', 'woocommerce' ),
						'view'               => __( 'View webhooks', 'woocommerce' ),
						'view_item'          => __( 'View webhook', 'woocommerce' ),
						'search_items'       => __( 'Search webhooks', 'woocommerce' ),
						'not_found'          => __( 'No webhooks found', 'woocommerce' ),
						'not_found_in_trash' => __( 'No webhooks found in trash', 'woocommerce' ),
						'parent'             => __( 'Parent webhook', 'woocommerce' ),
					),
					'public'              => false,
					'show_ui'             => true,
					'capability_type'     => 'shop_webhook',
					'map_meta_cap'        => true,
					'publicly_queryable'  => false,
					'exclude_from_search' => true,
					'show_in_menu'        => false,
					'hierarchical'        => false,
					'rewrite'             => false,
					'query_var'           => false,
					'supports'            => false,
					'show_in_nav_menus'   => false,
					'show_in_admin_bar'   => false,
				)
			)
		);

		do_action( 'woocommerce_after_register_post_type' );
	}

	/**
	 * Register our custom post statuses, used for order status.
	 */
	public static function register_post_status() {

		$order_statuses = apply_filters( 'woocommerce_register_shop_order_post_statuses',
			array(
				'wc-pending'    => array(
					'label'                     => _x( 'Pending payment', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'Pending payment <span class="count">(%s)</span>', 'Pending payment <span class="count">(%s)</span>', 'woocommerce' ),
				),
				'wc-processing' => array(
					'label'                     => _x( 'Processing', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'woocommerce' ),
				),
				'wc-on-hold'    => array(
					'label'                     => _x( 'On hold', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'On hold <span class="count">(%s)</span>', 'On hold <span class="count">(%s)</span>', 'woocommerce' ),
				),
				'wc-completed'  => array(
					'label'                     => _x( 'Completed', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>', 'woocommerce' ),
				),
				'wc-cancelled'  => array(
					'label'                     => _x( 'Cancelled', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'woocommerce' ),
				),
				'wc-refunded'   => array(
					'label'                     => _x( 'Refunded', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'woocommerce' ),
				),
				'wc-failed'     => array(
					'label'                     => _x( 'Failed', 'Order status', 'woocommerce' ),
					'public'                    => false,
					'exclude_from_search'       => false,
					'show_in_admin_all_list'    => true,
					'show_in_admin_status_list' => true,
					'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'woocommerce' ),
				),
			)
		);

		foreach ( $order_statuses as $order_status => $values ) {
			register_post_status( $order_status, $values );
		}
	}

	/**
	 * Flush rewrite rules.
	 */
	public static function flush_rewrite_rules() {
		flush_rewrite_rules();
	}

	/**
	 * Add Product Support to Jetpack Omnisearch.
	 */
	public static function support_jetpack_omnisearch() {
		if ( class_exists( 'Jetpack_Omnisearch_Posts' ) ) {
			new Jetpack_Omnisearch_Posts( 'product' );
		}
	}

	/**
	 * Added product for Jetpack related posts.
	 *
	 * @param  array $post_types
	 * @return array
	 */
	public static function rest_api_allowed_post_types( $post_types ) {
		$post_types[] = 'product';

		return $post_types;
	}
}

WC_Post_types::init();


text:
CREATE TABLE "audit" (
  "action" char(1) NOT NULL COLLATE "default",
  "pkg" json NOT NULL,
  "created_at" timestamp(6) WITH TIME ZONE NOT NULL DEFAULT now()
)
WITH (OIDS=FALSE);


text:
import numpy as np

def _summarize_peaks(peaks):
    """
    merge peaks position if closer than 10
    """
    previous = peaks[0]
    new_peaks = [previous]
    for pos in peaks:
        if pos > previous + 10:
            new_peaks.add(pos)
        previous = pos
    return new_peaks

def find_mature(x, y, win=10):
    """
    Window apprach to find hills in the expression profile
    """
    previous = min(y)
    peaks = []
    intervals = range(x, y, win)
    for pos in intervals:
        if y[pos] > previous * 10:
            previous = y[pos]
            peaks.add(pos)
    peaks = _summarize_peaks(peaks)


text:
@implementation Topic

@end


text:
"""add is default to qos policies

Revision ID: 62c781cb6192
Revises: 2b42d90729da
Create Date: 2017-02-07 13:28:35.894357

"""

# revision identifiers, used by Alembic.
revision = '62c781cb6192'
down_revision = '2b42d90729da'

from alembic import op
import sqlalchemy as sa

def upgrade():
    op.create_table(
        'qos_policies_default',
        sa.Column('qos_policy_id',
                  sa.String(length=36),
                  sa.ForeignKey('qos_policies.id', ondelete='CASCADE'),
                  nullable=False),
        sa.Column('project_id',
                  sa.String(length=255),
                  nullable=False,
                  index=True,
                  primary_key=True),
    )


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  NEGATIVE
  LCD.h

  noAutoscroll
  LCD

  noBacklight
  LCD

  noBlink
  LCD

  noCursor
  LCD

  noDisplay
  LCD

Searching...

No Matches


text:
Puppet::Type.newtype(:network_trunk) do
  @doc = 'Ethernet logical (switch-port) interface.  Configures VLAN trunking.'

  apply_to_all
  ensurable

  newparam(:name, namevar: true) do
    desc 'The switch interface name, e.g. "Ethernet1"'

    validate do |value|
      case value
      when String then super(value)
      else fail "value #{value.inspect} is invalid, must be a String."
      end
    end
  end

  newproperty(:encapsulation) do
    desc 'The vlan-tagging encapsulation protocol, usually dot1q'
    newvalues(:dot1q, :isl, :negotiate, :none)
  end

  newproperty(:mode) do
    desc 'The L2 interface mode, enables or disables trunking'
    newvalues(:access, :trunk, :dynamic_auto, :dynamic_desirable)
  end

  newproperty(:untagged_vlan) do
    desc 'VLAN used for untagged VLAN traffic. a.k.a Native VLAN'

    validate do |value|
      unless value.between?(1, 4095)
        fail "value #{value.inspect} is not between 1 and 4095"
      end
    end
  end

  newproperty(:tagged_vlans, array_matching: :all) do
    desc 'Array of VLAN names used for tagged packets'

    validate do |value|
      unless value.between?(1, 4095)
        fail "value #{value.inspect} is not between 1 and 4095"
      end
    end

    def insync?(is)
      is.sort == @should.sort.map(&:to_s)
    end

    def should_to_s(val)
      "[#{[*val].join(',')}]"
    end

    def is_to_s(val)
      "[#{[*val].join(',')}]"
    end
  end

  newproperty(:pruned_vlans, array_matching: :all) do
    desc 'Array of VLAN ID numbers used for VLAN pruning'

    validate do |value|
      unless value.between?(1, 4095)
        fail "value #{value.inspect} is not between 1 and 4095"
      end
    end

    def insync?(is)
      is.sort == @should.sort.map(&:to_s)
    end

    def should_to_s(val)
      "[#{[*val].join(',')}]"
    end

    def is_to_s(val)
      "[#{[*val].join(',')}]"
    end
  end
end


text:
package gl

type (
	Attrib uint
	Enum   uint
)

const (
	ALL_BARRIER_BITS                      = 0xffffffff
	ARRAY_BUFFER                          = 0x8892
	BLEND                                 = 0xbe2
	CLAMP_TO_EDGE                         = 0x812f
	COLOR_ATTACHMENT0                     = 0x8ce0
	COLOR_BUFFER_BIT                      = 0x4000
	COMPILE_STATUS                        = 0x8b81
	COMPUTE_SHADER                        = 0x91B9
	DEPTH_BUFFER_BIT                      = 0x100
	DEPTH_ATTACHMENT                      = 0x8d00
	DEPTH_COMPONENT16                     = 0x81a5
	DEPTH_COMPONENT24                     = 0x81A6
	DEPTH_COMPONENT32F                    = 0x8CAC
	DEPTH_TEST                            = 0xb71
	DRAW_FRAMEBUFFER                      = 0x8CA9
	DST_COLOR                             = 0x306
	DYNAMIC_DRAW                          = 0x88E8
	DYNAMIC_READ                          = 0x88E9
	ELEMENT_ARRAY_BUFFER                  = 0x8893
	EXTENSIONS                            = 0x1f03
	FALSE                                 = 0
	FLOAT                                 = 0x1406
	FRAGMENT_SHADER                       = 0x8b30
	FRAMEBUFFER                           = 0x8d40
	FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210
	FRAMEBUFFER_BINDING                   = 0x8ca6
	FRAMEBUFFER_COMPLETE                  = 0x8cd5
	HALF_FLOAT                            = 0x140b
	HALF_FLOAT_OES                        = 0x8d61
	INFO_LOG_LENGTH                       = 0x8B84
	INVALID_INDEX                         = ^uint(0)
	GREATER                               = 0x204
	GEQUAL                                = 0x206
	LINEAR                                = 0x2601
	LINK_STATUS                           = 0x8b82
	LUMINANCE                             = 0x1909
	MAP_READ_BIT                          = 0x0001
	MAX_TEXTURE_SIZE                      = 0xd33
	NEAREST                               = 0x2600
	NO_ERROR                              = 0x0
	NUM_EXTENSIONS                        = 0x821D
	ONE                                   = 0x1
	ONE_MINUS_SRC_ALPHA                   = 0x303
	QUERY_RESULT                          = 0x8866
	QUERY_RESULT_AVAILABLE                = 0x8867
	R16F                                  = 0x822d
	R8                                    = 0x8229
	READ_FRAMEBUFFER                      = 0x8ca8
	READ_ONLY                             = 0x88B8
	READ_WRITE                            = 0x88BA
	RED                                   = 0x1903
	RENDERER                              = 0x1F01
	RENDERBUFFER                          = 0x8d41
	RENDERBUFFER_BINDING                  = 0x8ca7
	RENDERBUFFER_HEIGHT                   = 0x8d43
	RENDERBUFFER_WIDTH                    = 0x8d42
	RGB                                   = 0x1907
	RGBA                                  = 0x1908
	RGBA8                                 = 0x8058
	SHADER_STORAGE_BUFFER                 = 0x90D2
	SHORT                                 = 0x1402
	SRGB                                  = 0x8c40
	SRGB_ALPHA_EXT                        = 0x8c42
	SRGB8                                 = 0x8c41
	SRGB8_ALPHA8                          = 0x8c43
	STATIC_DRAW                           = 0x88e4
	STENCIL_BUFFER_BIT                    = 0x00000400
	TEXTURE_2D                            = 0xde1
	TEXTURE_MAG_FILTER                    = 0x2800
	TEXTURE_MIN_FILTER                    = 0x2801
	TEXTURE_WRAP_S                        = 0x2802
	TEXTURE_WRAP_T                        = 0x2803
	TEXTURE0                              = 0x84c0
	TEXTURE1                              = 0x84c1
	TRIANGLE_STRIP                        = 0x5
	TRIANGLES                             = 0x4
	TRUE                                  = 1
	UNIFORM_BUFFER                        = 0x8A11
	UNPACK_ALIGNMENT                      = 0xcf5
	UNSIGNED_BYTE                         = 0x1401
	UNSIGNED_SHORT                        = 0x1403
	VERSION                               = 0x1f02
	VERTEX_SHADER                         = 0x8b31
	WRITE_ONLY                            = 0x88B9
	ZERO                                  = 0x0

	// EXT_disjoint_timer_query
	TIME_ELAPSED_EXT = 0x88BF
	GPU_DISJOINT_EXT = 0x8FBB
)

var _ interface {
	ActiveTexture(texture Enum)
	AttachShader(p Program, s Shader)
	BeginQuery(target Enum, query Query)
	BindAttribLocation(p Program, a Attrib, name string)
	BindBuffer(target Enum, b Buffer)
	BindBufferBase(target Enum, index int, buffer Buffer)
	BindFramebuffer(target Enum, fb Framebuffer)
	BindImageTexture(unit int, t Texture, level int, layered bool, layer int, access, format Enum)
	BindRenderbuffer(target Enum, fb Renderbuffer)
	BindTexture(target Enum, t Texture)
	BlendEquation(mode Enum)
	BlendFunc(sfactor, dfactor Enum)
	BlitFramebuffer(sx0, sy0, sx1, sy1, dx0, dy0, dx1, dy1 int, mask Enum, filter Enum)
	BufferData(target Enum, size int, usage Enum)
	BufferSubData(target Enum, offset int, src []byte)
	CheckFramebufferStatus(target Enum) Enum
	Clear(mask Enum)
	ClearColor(red, green, blue, alpha float32)
	ClearDepthf(d float32)
	CompileShader(s Shader)
	CreateBuffer() Buffer
	CreateFramebuffer() Framebuffer
	CreateProgram() Program
	CreateQuery() Query
	CreateRenderbuffer() Renderbuffer
	CreateShader(ty Enum) Shader
	CreateTexture() Texture
	DeleteBuffer(v Buffer)
	DeleteFramebuffer(v Framebuffer)
	DeleteProgram(p Program)
	DeleteQuery(query Query)
	DeleteRenderbuffer(r Renderbuffer)
	DeleteShader(s Shader)
	DeleteTexture(v Texture)
	DepthFunc(f Enum)
	DepthMask(mask bool)
	DisableVertexAttribArray(a Attrib)
	Disable(cap Enum)
	DispatchCompute(x, y, z int)
	DrawArrays(mode Enum, first, count int)
	DrawElements(mode Enum, count int, ty Enum, offset int)
	Enable(cap Enum)
	EnableVertexAttribArray(a Attrib)
	EndQuery(target Enum)
	FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int)
	FramebufferRenderbuffer(target, attachment, renderbuffertarget Enum, renderbuffer Renderbuffer)
	GetBinding(pname Enum) Object
	GetError() Enum
	GetInteger(pname Enum) int
	GetProgrami(p Program, pname Enum) int
	GetProgramInfoLog(p Program) string
	GetQueryObjectuiv(query Query, pname Enum) uint
	GetShaderi(s Shader, pname Enum) int
	GetShaderInfoLog(s Shader) string
	GetString(pname Enum) string
	GetUniformBlockIndex(p Program, name string) uint
	GetUniformLocation(p Program, name string) Uniform
	InvalidateFramebuffer(target, attachment Enum)
	LinkProgram(p Program)
	MapBufferRange(target Enum, offset, length int, access Enum) []byte
	MemoryBarrier(barriers Enum)
	ReadPixels(x, y, width, height int, format, ty Enum, data []byte)
	RenderbufferStorage(target, internalformat Enum, width, height int)
	ShaderSource(s Shader, src string)
	TexImage2D(target Enum, level int, internalFormat Enum, width, height int, format, ty Enum)
	TexParameteri(target, pname Enum, param int)
	TexStorage2D(target Enum, levels int, internalFormat Enum, width, height int)
	TexSubImage2D(target Enum, level, xoff, yoff int, width, height int, format, ty Enum, data []byte)
	UniformBlockBinding(p Program, uniformBlockIndex uint, uniformBlockBinding uint)
	Uniform1f(dst Uniform, v float32)
	Uniform1i(dst Uniform, v int)
	Uniform2f(dst Uniform, v0, v1 float32)
	Uniform3f(dst Uniform, v0, v1, v2 float32)
	Uniform4f(dst Uniform, v0, v1, v2, v3 float32)
	UseProgram(p Program)
	UnmapBuffer(target Enum) bool
	VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int)
	Viewport(x, y, width, height int)
} = (*Functions)(nil)


text:
package org.elasticsearch.cloud.azure.classic;

public class AzureServiceRemoteException extends IllegalStateException {
    public AzureServiceRemoteException(String msg) {
        super(msg);
    }

    public AzureServiceRemoteException(String msg, Throwable cause) {
        super(msg, cause);
    }
}


text:
from __future__ import unicode_literals

from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect

from .forms import SavedUploadForm

@login_required
def home(request):
    if request.method == 'POST':
        form = SavedUploadForm(request.POST, request.FILES)
        if form.is_valid():
            upload = form.save()
            messages.success(request, 'You have successfully uploaded %s' % upload)
            return redirect('home')
    else:
        form = SavedUploadForm()
    return render(request, 'index.html', {'form': form})


text:
"""Light conftest."""

from unittest.mock import AsyncMock, patch

import pytest

from homeassistant.components.light import Profiles

@pytest.fixture(autouse=True)
def mock_light_profiles():
    """Mock loading of profiles."""
    data = {}

    def mock_profiles_class(hass):
        profiles = Profiles(hass)
        profiles.data = data
        profiles.async_initialize = AsyncMock()
        return profiles

    with patch(
        "homeassistant.components.light.Profiles",
        side_effect=mock_profiles_class,
    ):
        yield data


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
    <file url="file://$PROJECT_DIR$/example/src/main/java/com/livae/android/loading/test/ConcreteFragment.java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/example/src/main/java/com/livae/android/loading/test/MainActivity.java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/example/src/main/res/layout" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/example/src/main/res/layout/activity_main.xml" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/example/src/main/res/layout/fragment_loading.xml" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/example/src/main/res/values" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/library" charset="UTF-8" />
  </component>
</project>


text:
require 'spec_helper'
require 'pry'

describe AdLeads::Client do
  let(:client) { AdLeads::Client.new }
  let(:connection) { double(:faraday_connection) }
  let(:token) { '2f7622c3-da63-42e9-a3d8-4275f70f1f79' }
  let(:status) { 200 }
  let(:response) { double(:http_response, status: status, body: {}, headers: {}) }

  before { client.stub(:token) { token } }

  it { should respond_to(:last_response) }

  describe '#connection' do
    let(:config_keys) { AdLeads::Configuration::VALID_CONFIG_KEYS }

    it 'inherits config' do
      expect(client).to respond_to(config_keys.sample)
    end

    it 'calls token' do
      expect(client).to receive(:token).and_return('xyz')
      client.send(:connection)
    end
  end

  describe '#request' do
    before do
      Faraday.stub(:new) { connection }
      connection.stub(:post) { response }
    end

    context 'status: 200' do
      let(:status) { 200 }
      it 'sets @last_response' do
        client.post('foo')
        expect(client.instance_variable_get(:@last_response)).to eq response
      end
    end

    context 'status: 412' do
      let(:status) { 412 }
      it 'raises AdLeads::EtagMismatchError' do
        expect {
          client.post('foo')
        }.to raise_error AdLeads::EtagMismatchError
      end
    end

    context 'status: 500' do
      let(:status) { 500 }
      it 'raises AdLeads::ApiError' do
        expect {
          client.post('foo')
        }.to raise_error AdLeads::ApiError
      end
    end
    context 'status: 401' do
      let(:status) { 401 }
      it 'raises AdLeads::ApiError' do
        expect {
          client.post('foo')
        }.to raise_error AdLeads::AuthError
      end
    end
  end

  describe '#last_response_id' do
    let(:last_response) { double :response, body: {'data' => [88]}.to_json }

    it 'retrieves id from @last_response' do
      client.stub(:last_response) { last_response }
      expect(client.last_response_id).to eq 88
    end
  end
end


text:
{% extends "base.html" %}

{% block content %}

The poll was created:

{{ poll.question }}

    {% for response in poll.responses.all %}

{{ response.answer }}

    {% endfor %}

This poll can be embedded in any page on the site with the following tag:

    {{ poll.get_script_tag }}
{% endblock %}


text:
const program = require('commander');
const path = require('path');
const chalk = require('chalk');
const config = require('../config');
const inquirer = require('inquirer');

/**
 * Usage.
 */
program.on('--help', function () {
    console.log('  Examples:');
    console.log();
    console.log(chalk.yellow('    $ wt config -s[--show]'));
    console.log();
    console.log();
});

program
    .option('-i, --init', 'init set config')
    .option('-s, --show', 'show config')
    .option('-p, --path', 'show config file path')
    .parse(process.argv);

if (program.init) {
    const _config = config.getConfig();
    const questions = [
        {
            type    : 'input',
            name    : 'version',
            message : 'What\'s current version',
            validate: function (value) {
                if (/^\d+\.\d+\.\d+$/i.test(value)) {
                    return true;
                }
                return 'Please enter a valid version';
            },
            default : function () {
                return _config.version;
            }
        },
        {
            type   : 'input',
            name   : 'rootDir',
            message: 'What\'s bash root dir',
            default: function () {
                return _config.scriptsRootDir.indexOf('/') === 0
                    ? _config.scriptsRootDir
                    : path.resolve(__dirname, _config.scriptsRootDir);
            }
        },
        {
            type   : 'input',
            name   : 'token',
            message: 'What\'s your customer token',
            default: function () {
                return _config.token;
            }
        },
        {
            type   : 'input',
            name   : 'dockerBaseHost',
            message: 'What\'s your worktile docker host',
            default: function () {
                return _config.dockerBaseHost;
            }
        }
    ];

    inquirer.prompt(questions).then(function (answers) {
        console.log(JSON.stringify(answers, null, '  '));
        inquirer.prompt([{
            type    : 'input',
            name    : 'sure',
            message : 'Is this ok? yes or no',
            validate: function (value) {
                if (value === 'yes' || value === 'no') {
                    return true;
                }
                return 'Please enter yes or not';
            }
        }]).then(function (sureAnswer) {
            if (sureAnswer.sure === 'yes') {
                _config.version = answers.version;
                _config.scriptsRootDir = answers.rootDir;
                _config.token = answers.token;
                _config.dockerBaseHost = answers.dockerBaseHost;
                config.save(_config);
            }
        });
    });
    return;
}

if (program.path) {
    console.log(chalk.yellow(path.resolve(__dirname, '../config/config.json')));
}
if (program.show) {
    console.log(chalk.yellow(JSON.stringify(config.getConfig(), null, 2)));
}


text:
title: A better throttler?
date: 2014-11-06 00:16 IST
tags: golang, go, rate-limit, throttle, performance, concurrency, improved, mutex
---

In a previous post I wrote a [simple throttler using channels](http://code.websrvr.in/2014/11/04/simple-function-throttler-in-golang/).
On [karlseguin's suggestion](http://www.reddit.com/r/golang/comments/2l6ujc/simple_function_throttler_in_go/clsbvox),
I reimplemented it using `sync.Cond`. [You can check it out at https://bitbucket.org/utils/sync2](https://bitbucket.org/utils/sync2/src/master/throttler.go).

Throttler allows you to restrict a goroutine to a max number of concurrent executions. Think of
it as a mutex which allows 'n' number of locks to be acquired.

~~~go
package sync2

import (
	"sync"
)

//Throttler allows you to restrict a goroutine to a max
//number of concurrent executions. Think of it as a mutex
//which allows 'n' number of locks to be acquired.
type Throttler interface {
	//Lock stops execution and waits if the number of goroutines
	//running has reached the max level of the throttler.
	//It returns the throttler on which it is being called to allow chaining
	//    e.g.
	//    var t= sync2.NewThrottler(10)
	//    func throttledFunc(){
	//      defer t.Lock().Unlock()
	//      ..
	//     }
	Lock() Throttler
	//Unlock releases the throttle on the function/goroutine
	//so other goroutines can continue execution if they were waiting.
	Unlock()
}

type throttler struct {
	l       sync.Locker
	c       *sync.Cond
	running int
	max     int
}

//make sure throttler implements the interface
var _ Throttler = &throttler{}

//NewThrottler creates a throttler which allows you to limit
//the number of concurrent executions of a goroutine or function
func NewThrottler(max int) Throttler {
	l := &sync.Mutex{}
	c := sync.NewCond(l)
	return &throttler{c: c, max: max, l: l}
}

//Unlock releases the throttle on the function/goroutine
//so other goroutines can continue execution if they were waiting.
func (t *throttler) Unlock() {
	t.l.Lock()
	defer t.l.Unlock()
	t.running--
	//signal one of the waiting goroutines to start executing
	t.c.Signal()
}

//Lock stops execution and waits if the number of goroutines
//running has reached the max level of the throttler.
func (t *throttler) Lock() Throttler {
	t.l.Lock()
	defer t.l.Unlock()

	//wait till we have an empty slot
	for (t.max - t.running) < 1 {
		t.c.Wait() //suspends execution of the calling goroutine
	}

	//now we are running
	t.running++
	return t
}
~~~


text:
ARNOVICH CORE
==============

This is a simple library for holding some of the common functionality used across my various projects.
It consists mainly of a few simple types and helpers.

Since anything you put up on Github(or anywhere else) is by default copyrighted I have added a BSD-3 license, just in case.

There is some auto-generated documentation at http://arnovich.github.io/core/.

Features
--------

Things that you will find here:

* Variant type that can easily be shared and interfaced across C/C++/Python libraries
* A very simple debug outputter that works across C/C++/Python
* An even simpler push-pop-notification server for C/Python

TODOs
------

Things I should really get done

* fix debug call: should move out of header
* move XML serialisation of variant here from LCL
* server could be variant-based

HOW TO BUILD
-------------

For a clean build go to the root of the checkout and do
    [sudo] ./mk clean all BUILD=[ARCH]
where ARCH=LINUX64/OSX/CYGWIN/MINGW

To do a normal build leave out 'clean'.

To build docs do
    ./mk docs

[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/9f544152c9bcee0bca43ee9a96ea72e8 "githalytics.com")](http://githalytics.com/arnovich/core)


text:
package org.webrtc;

/**
 * Class for representing size of an object. Very similar to android.util.Size but available on all
 * devices.
 */
public class Size {
  public int width;
  public int height;

  public Size(int width, int height) {
    this.width = width;
    this.height = height;
  }

  @Override
  public String toString() {
    return width + "x" + height;
  }

  @Override
  public boolean equals(Object other) {
    if (!(other instanceof Size)) {
      return false;
    }
    final Size otherSize = (Size) other;
    return width == otherSize.width && height == otherSize.height;
  }

  @Override
  public int hashCode() {
    // Use prime close to 2^16 to avoid collisions for normal values less than 2^16.
    return 1 + 65537 * width + height;
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="5cb8b0b9-4a89-45fa-b3cd-5bdf4e09605a" name="Default" comment="" />
    <ignored path="10.SPA-Applications-and-App-Architecture.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="10.SPA-Applications-and-App-Architecture" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="control.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/scripts/control.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="1474" max-vertical-offset="2516">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="crowd-chat.js" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/scripts/crowd-chat.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.1576507" vertical-offset="0" max-vertical-offset="867">
              <caret line="6" column="34" selection-start-line="6" selection-start-column="34" selection-end-line="6" selection-end-column="34" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="true" />
    </FindUsagesManager>
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/CrowdChat.html" />
        <option value="$PROJECT_DIR$/scripts/control.js" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="54" />
    <option name="y" value="-8" />
    <option name="width" value="1320" />
    <option name="height" value="784" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="scripts" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="10.SPA-Applications-and-App-Architecture" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="scripts" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="libs" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="options.lastSelected" value="JavaScript.Libraries" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="options.searchVisible" value="true" />
    <property name="LayoutCode.rearrangeEntriesJavaScript" value="false" />
    <property name="FullScreen" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="scope" value="ALL" />
      <option name="testName" />
      <method />
    </configuration>
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="name" value="Dart" />
      <option name="saveOutputToFile" value="false" />
      <option name="showConsoleOnStdErr" value="false" />
      <option name="showConsoleOnStdOut" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="CucumberJavaScriptRunConfigurationType" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver">
      <setting name="configLocationType" value="CONFIG_FILE" />
      <setting name="settingsFile" value="" />
      <setting name="serverType" value="INTERNAL" />
      <setting name="preferredDebugBrowser" value="Chrome" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="5cb8b0b9-4a89-45fa-b3cd-5bdf4e09605a" name="Default" comment="" />
      <created>1406560026288</created>
      <updated>1406560026288</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="54" y="-8" width="1320" height="784" extended-state="7" />
    <editor active="false" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.1756135" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/scripts/control.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2516">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/crowd-chat.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="220" max-vertical-offset="867">
          <caret line="40" column="15" selection-start-line="40" selection-start-column="15" selection-end-line="40" selection-end-column="15" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/control.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2516">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/crowd-chat.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="289" max-vertical-offset="867">
          <caret line="17" column="23" selection-start-line="17" selection-start-column="23" selection-end-line="17" selection-end-column="23" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/CrowdChat.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.24637681" vertical-offset="0" max-vertical-offset="621">
          <caret line="9" column="40" selection-start-line="9" selection-start-column="40" selection-end-line="9" selection-end-column="40" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/model.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="647">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/view.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="799">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/control.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="1474" max-vertical-offset="2516">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/scripts/crowd-chat.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.1576507" vertical-offset="0" max-vertical-offset="867">
          <caret line="6" column="34" selection-start-line="6" selection-start-column="34" selection-end-line="6" selection-end-column="34" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>