text:
package com.voxeo.moho.common.event;

import com.voxeo.moho.event.EventSource;
import com.voxeo.moho.event.MediaResourceDisconnectEvent;

public class MohoMediaResourceDisconnectEvent<T extends EventSource> extends MohoMediaEvent<T> implements MediaResourceDisconnectEvent<T> {

  public MohoMediaResourceDisconnectEvent(T source) {
    super(source);
  }

}

redpajama_set_name: RedPajamaGithub


text:
require 'uri'
require 'openssl'
require 'cgi'
require 'puppet/util/network_device/transport_powerconnect'
require 'puppet/util/network_device/transport_powerconnect/base_powerconnect'
require '/etc/puppetlabs/puppet/modules/asm_lib/lib/security/encode'

# Base class which provides transport initialization
# based on the information provided in device.conf file
#
class Puppet::Util::NetworkDevice::Base_powerconnect
  attr_accessor :url, :transport, :crypt
  def initialize(url)
    @url = URI.parse(url)
    @query = Hash.new([])
    @query = CGI.parse(@url.query) if @url.query

    require "puppet/util/network_device/transport_powerconnect/#{@url.scheme}"

    unless @transport
      @transport = Puppet::Util::NetworkDevice::Transport_powerconnect.const_get(@url.scheme.capitalize).new
      @transport.host = @url.host
      @transport.port = case @url.scheme ; when "ssh" ; 22 ; when "telnet" ; 23 ; else "Invalid protocol" end || @url.port
      if @query && @query['crypt'] && @query['crypt'] == ['true']
        self.crypt = true
        # FIXME: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/application/device.rb#L181
        master = File.read(File.join('/etc/puppet', 'networkdevice-secret'))
        master = master.strip
        @transport.user = decrypt(master, [@url.user].pack('h*'))
        @transport.password = decrypt(master, [@url.password].pack('h*'))
      else
        @transport.user = URI.decode(@url.user)
        @transport.password = URI.decode(asm_decrypt(@url.password))
      end
    end

    override_using_credential_id
  end

  def override_using_credential_id
    if id = @query.fetch('credential_id', []).first
      require 'asm/cipher'
      cred = ASM::Cipher.decrypt_credential(id)
      @transport.user = cred.username
      @transport.password = cred.password
    end
  end

  def decrypt(master, str)
    cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
    cipher.decrypt
    cipher.key = key = OpenSSL::Digest::SHA512.new(master).digest
    out = cipher.update(str)
    out << cipher.final
    return out
  end
end


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.activiti.engine.test.bpmn.parse;

import java.util.List;

import org.activiti.bpmn.exceptions.XMLException;
import org.activiti.bpmn.model.BpmnModel;
import org.activiti.bpmn.model.GraphicInfo;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.SequenceFlow;
import org.activiti.engine.impl.test.PluggableActivitiTestCase;
import org.activiti.engine.impl.test.TestHelper;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.test.Deployment;

/**
 *
 * @author Joram Barrez
 */
public class BpmnParseTest extends PluggableActivitiTestCase {

  public void testInvalidProcessDefinition() {
    try {
      String resource = TestHelper.getBpmnProcessDefinitionResource(getClass(), "testInvalidProcessDefinition");
      repositoryService.createDeployment().name(resource).addClasspathResource(resource).deploy();
      fail();
    } catch (XMLException e) {
      // expected exception
    }
  }

  public void testParseWithBpmnNamespacePrefix() {
    repositoryService.createDeployment().addClasspathResource("org/activiti/engine/test/bpmn/parse/BpmnParseTest.testParseWithBpmnNamespacePrefix.bpmn20.xml").deploy();
    assertEquals(1, repositoryService.createProcessDefinitionQuery().count());

    repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
  }

  public void testParseWithMultipleDocumentation() {
    repositoryService.createDeployment().addClasspathResource("org/activiti/engine/test/bpmn/parse/BpmnParseTest.testParseWithMultipleDocumentation.bpmn20.xml").deploy();
    assertEquals(1, repositoryService.createProcessDefinitionQuery().count());

    repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
  }

  @Deployment
  public void testParseDiagramInterchangeElements() {

    // Graphical information is not yet exposed publicly, so we need to do some plumbing

    BpmnModel bpmnModel = repositoryService.getBpmnModel(repositoryService.createProcessDefinitionQuery().singleResult().getId());
    Process process = bpmnModel.getMainProcess();

    // Check if diagram has been created based on Diagram Interchange when  it's not a headless instance
    List<String> resourceNames = repositoryService.getDeploymentResourceNames(repositoryService.createProcessDefinitionQuery().singleResult().getDeploymentId());
    assertEquals(2, resourceNames.size());

    assertActivityBounds(bpmnModel, "theStart", 70, 255, 30, 30);
    assertActivityBounds(bpmnModel, "task1", 176, 230, 100, 80);
    assertActivityBounds(bpmnModel, "gateway1", 340, 250, 40, 40);
    assertActivityBounds(bpmnModel, "task2", 445, 138, 100, 80);
    assertActivityBounds(bpmnModel, "gateway2", 620, 250, 40, 40);
    assertActivityBounds(bpmnModel, "task3", 453, 304, 100, 80);
    assertActivityBounds(bpmnModel, "theEnd", 713, 256, 28, 28);

    assertSequenceFlowWayPoints(bpmnModel, "flowStartToTask1", 100, 270, 176, 270);
    assertSequenceFlowWayPoints(bpmnModel, "flowTask1ToGateway1", 276, 270, 340, 270);
    assertSequenceFlowWayPoints(bpmnModel, "flowGateway1ToTask2", 360, 250, 360, 178, 445, 178);
    assertSequenceFlowWayPoints(bpmnModel, "flowGateway1ToTask3", 360, 290, 360, 344, 453, 344);
    assertSequenceFlowWayPoints(bpmnModel, "flowTask2ToGateway2", 545, 178, 640, 178, 640, 250);
    assertSequenceFlowWayPoints(bpmnModel, "flowTask3ToGateway2", 553, 344, 640, 344, 640, 290);
    assertSequenceFlowWayPoints(bpmnModel, "flowGateway2ToEnd", 660, 270, 713, 270);

  }

  @Deployment
  public void testParseNamespaceInConditionExpressionType() {

    BpmnModel bpmnModel = repositoryService.getBpmnModel(repositoryService.createProcessDefinitionQuery().singleResult().getId());
    Process process = bpmnModel.getProcesses().get(0);
    assertNotNull(process);

    SequenceFlow sequenceFlow = (SequenceFlow) process.getFlowElement("SequenceFlow_3");
    assertEquals("#{approved}", sequenceFlow.getConditionExpression());

    sequenceFlow = (SequenceFlow) process.getFlowElement("SequenceFlow_4");
    assertEquals("#{!approved}", sequenceFlow.getConditionExpression());

  }

  @Deployment
  public void testParseDiagramInterchangeElementsForUnknownModelElements() {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("TestAnnotation").singleResult();
    BpmnModel model = repositoryService.getBpmnModel(processDefinition.getId());
    Process mainProcess = model.getMainProcess();
    assertEquals(0, mainProcess.getExtensionElements().size());
  }

  public void testParseSwitchedSourceAndTargetRefsForAssociations() {
    repositoryService.createDeployment().addClasspathResource("org/activiti/engine/test/bpmn/parse/BpmnParseTest.testParseSwitchedSourceAndTargetRefsForAssociations.bpmn20.xml").deploy();

    assertEquals(1, repositoryService.createProcessDefinitionQuery().count());

    repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true);
  }

  protected void assertActivityBounds(BpmnModel bpmnModel, String activityId, Integer x, Integer y, Integer width, Integer height) {
    assertEquals(x.doubleValue(), bpmnModel.getGraphicInfo(activityId).getX());
    assertEquals(y.doubleValue(), bpmnModel.getGraphicInfo(activityId).getY());
    assertEquals(width.doubleValue(), bpmnModel.getGraphicInfo(activityId).getWidth());
    assertEquals(height.doubleValue(), bpmnModel.getGraphicInfo(activityId).getHeight());
  }

  protected void assertSequenceFlowWayPoints(BpmnModel bpmnModel, String sequenceFlowId, Integer... waypoints) {
    List<GraphicInfo> graphicInfos = bpmnModel.getFlowLocationGraphicInfo(sequenceFlowId);
    assertEquals(waypoints.length / 2, graphicInfos.size());
    for (int i = 0; i < waypoints.length; i += 2) {
      Integer x = waypoints[i];
      Integer y = waypoints[i+1];
      assertEquals(x.doubleValue(), graphicInfos.get(i/2).getX());
      assertEquals(y.doubleValue(), graphicInfos.get(i/2).getY());
    }
  }

}


text:
<?php

namespace AppBundle\Form\Registration;

use AppBundle\Utils\RegexUtils;
use FOS\UserBundle\Form\Type\RegistrationFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;

class UserRegistrationType extends AbstractType {

	/**
	 *
	 * @var RegexUtils
	 */
	protected $regexUtils;

	public function __construct(RegexUtils $regexUtils) {
		$this->regexUtils = $regexUtils;
	}

	// TODO check if can be BaseType'd
	public function buildForm(FormBuilderInterface $builder, array $options) {
		$builder->add('forename', TextType::class, array('required' => true));
		$builder->add('surname', TextType::class, array('required' => true));

		$builder->add('street', TextType::class,
				array('required' => true, 'constraints' => $this->getStreetConstraints()));
		$builder->add('zipCode', TextType::class,
				array('required' => true, 'constraints' => $this->getZipCodeConstraints()));
		$builder->add('city', TextType::class,
				array('required' => true, 'constraints' => $this->getCityConstraints()));

		$builder->add('digitalSubscription', CheckboxType::class, array('required' => false));
		$builder->add('physicalSubscription', CheckboxType::class, array('required' => false));
		$builder->add('dataProcessingAgreement', CheckboxType::class, array('required' => true));
	}

	protected function getStreetConstraints() {
		return array(new NotBlank());
	}

	protected function getZipCodeConstraints() {
		return array(new NotBlank(), $this->regexUtils->getZipCodeRegex());
	}

	protected function getCityConstraints() {
		return array(new NotBlank(), $this->regexUtils->getPlainStringRegex());
	}

	public function getParent() {
		return RegistrationFormType::class;
	}

	public function getBlockPrefix() {
		return 'app_user_registration';
	}
}


text:
import datetime
import re
import urlparse

import scrapy

from corpus_builder.templates.spider import CommonSpider

# different sets of categories are available on date-based and page-based crawling
#
# scrapy crawl ittefaq -a start_page=1
# scrapy crawl ittefaq -a start_page=1 -a end_page=5
# scrapy crawl ittefaq -a start_page=1 -a end_page=5 -a category=sports
# scrapy crawl ittefaq -a start_date='2016-06-05'
# scrapy crawl ittefaq -a start_date='2016-06-05' -a end_date='2016-06-05'
# scrapy crawl ittefaq -a start_date='2016-06-05' -a end_date='2016-06-05' -a category=sports-news

class IttefaqSpider(CommonSpider):
    name = "ittefaq"
    allowed_domains = ["ittefaq.com.bd"]
    base_url = 'http://www.ittefaq.com.bd'
    start_request_url = base_url

    content_body = {
        'css': 'div.details *::text'
    }

    allowed_configurations = [
        ['start_page', 'end_page'],
        ['start_page'],
        ['category', 'start_page'],
        ['category', 'start_page', 'end_page'],
        ['start_date', 'end_date'],
        ['start_date'],
        ['category', 'start_date'],
        ['category', 'start_date', 'end_date']
    ]

    def request_index(self, response):
        if self.start_page:
            all_categories = response.css('#menu a::attr("href")').extract()
            print_categories = response.css('#menu a::attr("href")').re('.*print-edition.*')
            categories = [urlparse.urlparse(x.strip()).path.split('/')[-1] \
                          for x in list(set(all_categories) - set(print_categories))]
        elif self.start_date:
            categories = list(set(response.css('#menu a::attr("href")').re('.*/print-edition/.*')))
            categories = [re.match('.*\/(.*)\/\d{4}\/\d{2}\/\d{2}', x).groups()[0] for x in categories \
                          if (not x == "" and not x == "#")]

        if self.category:
            if self.category in categories:
                categories = [self.category]
            else:
                raise ValueError('invalid category slug. available slugs: %s' % str(categories))

        if self.start_page:
            for category in categories:
                for page_number in range(self.start_page, self.end_page + 1):
                    # http://www.ittefaq.com.bd/sports/10
                    url = self.base_url + '/{0}/{1}'.format(
                        category,
                        page_number
                    )
                    yield scrapy.Request(url, callback=self.start_news_requests)

        elif self.start_date:
            date_processing = self.start_date
            while date_processing <= self.end_date:
                for category in categories:
                    # http://www.ittefaq.com.bd/print-edition/sports-news/2016/06/30
                    url = self.base_url + '/print-edition/{0}/{1}'.format(
                        category,
                        date_processing.strftime('%Y/%m/%d')
                    )
                    yield scrapy.Request(url, callback=self.start_news_requests)
                date_processing += datetime.timedelta(days=1)
        else:
            raise ValueError("either dates or page numbers must be provided")

    def start_news_requests(self, response):
        news_links = list(set(response.css('div.headline a::attr("href")').extract()))

        for link in news_links:
            yield scrapy.Request(link, callback=self.parse_content)


text:
using System.Collections.Generic;

namespace PenguinSdk
{
    /// <summary>
    /// Selection requirements for different selections
    /// </summary>
    public interface ISelection
    {
        /// <summary>
        /// Calculates if location is within selection bounds
        /// </summary>
        /// <param name="loc">Location to calculate</param>
        bool Contains(PenguinVector loc);

        /// <summary>
        /// Gets the selection area
        /// </summary>
        List<PenguinVector> GetSelectionArea();

        /// <summary>
        /// Gets the everybody edits map
        /// </summary>
        /// <returns></returns>
        PenguinMap GetMap();
    }
}


text:
cd Bot/JhinBot
dotnet build -c Release
dotnet restore

cd bin/Release/netcoreapp2.0
dotnet JhinBot.dll


text:
<?php

declare(strict_types=1);

namespace Fresh\FirebaseCloudMessaging\Response\MessageResult;

/**
 * Class SuccessfulMessageResult.
 *
 * @author Artem Henvald <genvaldartem@gmail.com>
 */
class SuccessfulMessageResult extends AbstractSuccessfulMessageResult
{
}


text:
var MongoClient = require('mongodb').MongoClient,
	_ = require('underscore'),
	async = require('async'),
	jsonGenerator = require('./lib/generator-json'),
	path = require('path'),
	mkdirp = require('mkdirp'),
	fs = require('fs'),
	program = require('commander');

var mongoConnectionString = process.env.RESTBUGS_DB || 'mongodb://127.0.0.1/restbugs',
	mongoConnectionOptions = {
		db: { native_parser: true }
	},
	bugsCollection = 'bugs';

program
.version('0.1.0')
.option('-h --host <address>', 'DNS host used for generating links')
.option('-o --output <path>', 'Output directory for placing generated files. Default is \'output\'')
.parse(process.argv);

// defaults
var outputDirectory = program.output || './output';

var _fileResourceWriter = function(resource){
	var outputPath = path.join(outputDirectory, resource.identifier),
		dirname = path.dirname(outputPath);

	mkdirp(dirname, function(err){
		if(err) return console.error('Error creating directory ' + dirname);
		fs.writeFile(outputPath, resource.data, function(err){
			if(err) return console.error('Error creating file ' + outputPath);
			else console.info('Succesfully created file ' + outputPath);
		});
	});
};

MongoClient.connect(mongoConnectionString, mongoConnectionOptions, function(err, db){
	if(err) return callback(err, null);
	var cursor = db.collection(bugsCollection).find();

	jsonGenerator.render(cursor, program.host)
	.on('resource', _fileResourceWriter)
	.on('end', function(count){
		console.info('Finished generating ' + count + ' resources.');
	});
});


text:
. ~/Virtual-Gallery/install/virtual-gallery-config.sh

GREEN="\\033[1;32m"
NORMAL="\\033[0m"
BOLD="\\033[1m"
RED="\\033[1;31m"
spin="-\|/"

developmentProject=false
logLocation="/var/log"

if [ ! -d ${volumeUploadsLocation} ]; then
    mkdir -p ${volumeUploadsLocation}
fi;

if [ ! -z "$(getent passwd www-data)" ]; then
    useradd -u 33 -g 33 www-data
fi;

chown www-data:www-data ${volumeUploadsLocation};

clear
if [ -n ${dockerInstall+x} ]; then
    if [ "${dockerInstall}" = "1" ]; then echo -e "Exécution du script d'installation de Docker... "${GREEN}"fait"${NORMAL};
    elif [ "${dockerInstall}" = "-1" ]; then echo -e "Exécution du script d'installation de Docker... "${RED}"a échoué"${NORMAL}; fi
fi

if [ -n ${iptablesConfig+x} ]; then
    if [ "${iptablesConfig}" = "1" ]; then echo -e "Exécution du script de configuration du pare-feu... "${GREEN}"fait"${NORMAL};
    elif [ "${iptablesConfig}" = "-1" ]; then echo -e "Exécution du script de configuration du pare-feu... "${RED}"a échoué !"${NORMAL}; fi
fi

if [ -n ${nginxInstall+x} ]; then
    if [ "${nginxInstall}" = "1" ]; then echo -e "Exécution du script d'installation de nginx-proxy et let's encrypt... "${GREEN}"fait"${NORMAL};
    elif [ "${nginxInstall}" = "-1" ]; then echo -e "Exécution du script d'installation de nginx-proxy et let's encrypt... "${RED}"a échoué"${NORMAL}; fi
fi

if [ -n ${projectConfig+x} ]; then
    if [ "${projectConfig}" = "1" ]; then echo -e "Exécution du script de configuration de votre projet... "${GREEN}"fait"${NORMAL};
    elif [ "${projectConfig}" = "-1" ]; then echo -e "Exécution du script de configuration de votre projet... "${RED}"a échoué !"${NORMAL}; fi
fi

echo ""
echo -e ${BOLD}"------------------------------------------------------------"
echo "          Installation et exécution de votre projet"
echo -e "------------------------------------------------------------"${NORMAL}

# Download docker images
printf "\rTéléchargement de superitman/virtual-gallery:mysql..."
docker pull superitman/virtual-gallery:mysql > /dev/null &
pid=$! # Process Id of the previous running command
i=0
while kill -0 $pid 2>/dev/null
do
  i=$(( (i+1) %4 ))
  printf "\rTéléchargement de superitman/virtual-gallery:mysql... "${spin:$i:1}
  sleep .1
done
printf "\rTéléchargement de superitman/virtual-gallery:mysql... "${GREEN}"fait"${NORMAL}
echo ""

printf "\rTéléchargement de superitman/virtual-gallery:client..."
docker pull superitman/virtual-gallery:client > /dev/null &
pid=$! # Process Id of the previous running command
i=0
while kill -0 $pid 2>/dev/null
do
  i=$(( (i+1) %4 ))
  printf "\rTéléchargement de superitman/virtual-gallery:client... "${spin:$i:1}
  sleep .1
done
printf "\rTéléchargement de superitman/virtual-gallery:client... "${GREEN}"fait"${NORMAL}
echo ""

printf "\rTéléchargement de superitman/virtual-gallery:api..."
docker pull superitman/virtual-gallery:api > /dev/null &
pid=$! # Process Id of the previous running command
i=0
while kill -0 $pid 2>/dev/null
do
  i=$(( (i+1) %4 ))
  printf "\rTéléchargement de superitman/virtual-gallery:api... "${spin:$i:1}
  sleep .1
done
printf "\rTéléchargement de superitman/virtual-gallery:api... "${GREEN}"fait"${NORMAL}
echo ""

printf "\rTéléchargement de superitman/virtual-gallery:admin..."
docker pull superitman/virtual-gallery:admin > /dev/null &
pid=$! # Process Id of the previous running command
i=0
while kill -0 $pid 2>/dev/null
do
  i=$(( (i+1) %4 ))
  printf "\rTéléchargement de superitman/virtual-gallery:admin... "${spin:$i:1}
  sleep .1
done
printf "\rTéléchargement de superitman/virtual-gallery:admin... "${GREEN}"fait"${NORMAL}
echo ""

printf "\rTéléchargement de phpmyadmin/phpmyadmin..."
docker pull phpmyadmin/phpmyadmin > /dev/null &
pid=$! # Process Id of the previous running command
i=0
while kill -0 $pid 2>/dev/null
do
  i=$(( (i+1) %4 ))
  printf "\rTéléchargement de phpmyadmin/phpmyadmin... "${spin:$i:1}
  sleep .1
done
printf "\rTéléchargement de phpmyadmin/phpmyadmin... "${GREEN}"fait"${NORMAL}
echo ""

###############################################################################
################################ Docker MySQL #################################
###############################################################################

# TODO Analyze how to get logs from mysql
#if [ ! -d "${logLocation}/${containerNamePrefix}-database" ]; then
#    echo "Création du dossier de logs pour \"Base de données\""
#    mkdir -p ${logLocation}/${containerNamePrefix}-database
#
#fi
printf "\rDémarrage du container \"Base de données\"..."

isRunningDocker=$(/usr/bin/docker ps -q -a -f name=${containerNamePrefix}-database)
if [ ${#isRunningDocker} -gt 0 ]; then
    docker rm -f ${containerNamePrefix}-database > /dev/null
fi

docker run -it -d \
--name ${containerNamePrefix}-database \
-v ${volumeMySQLLocation}:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD="${passwordMySQL}" \
--restart="always" \
superitman/virtual-gallery:mysql  > /dev/null

printf "\rDémarrage du container \"Base de données\"... "${GREEN}"fait"${NORMAL}
echo ""

# Wait until docker database initialised
# Because dockers API and Admin have a link to the database
printf "\rAttente de l'initialisation complète du container \"Base de données\"..."
until [ "`/usr/bin/docker inspect -f {{.State.Running}} ${containerNamePrefix}-database`" == "true" ]; do
    i=$(( (i+1) %4 ))
    printf "\rAttente de l'initialisation complète du container \"Base de données\"... "${spin:$i:1}
    sleep 0.1;
done;
printf "\rAttente de l'initialisation complète du container \"Base de données\"... "${GREEN}"fait"${NORMAL}
echo ""

###############################################################################
################################# Docker API ##################################
###############################################################################

if [ ! -d "${logLocation}/${containerNamePrefix}-API" ]; then
    printf "Création du dossier de logs pour \"API\""
    echo ""
    mkdir -p ${logLocation}/${containerNamePrefix}-API
fi

printf "\rDémarrage du container \"API\"..."

isRunningDocker=$(/usr/bin/docker ps -q -a -f name=${containerNamePrefix}-API)
if [ ${#isRunningDocker} -gt 0 ]; then
    docker rm -f ${containerNamePrefix}-API > /dev/null
fi

docker run -it -d \
--name ${containerNamePrefix}-API \
-v ${volumeUploadsLocation}:/var/www/public/uploads \
-v ${volumeConfigLocation}:/var/www/config \
-v ${logLocation}/${containerNamePrefix}-API:/var/log/apache2 \
--link ${containerNamePrefix}-database:db \
-e "VIRTUAL_HOST="${APIDomain} \
-e "LETSENCRYPT_TEST="${developmentProject} \
-e "LETSENCRYPT_HOST="${APIDomain} \
-e "LETSENCRYPT_EMAIL="${emailAddress} \
--restart="always" \
superitman/virtual-gallery:api > /dev/null

printf "\rDémarrage du container \"API\"... "${GREEN}"fait"${NORMAL}
echo ""

# Wait until API has generated the certificate for the JWT
# JWT: Json Web Token. Go on https://jwt.io/ for more informations

until [ -f "${volumeConfigLocation}/ssl/jwt.key" ]; do
    sleep 0.1;
done;
# TODO mettre un condition de fin pour quitter la boucle en cas d'échec

###############################################################################
################################ Docker Client ################################
###############################################################################

printf "\rDémarrage du container \"Client\"..."

isRunningDocker=$(/usr/bin/docker ps -q -a -f name=${containerNamePrefix}-client)
if [ ${#isRunningDocker} -gt 0 ]; then
    docker rm -f ${containerNamePrefix}-client > /dev/null
fi

docker run -it -d \
--name ${containerNamePrefix}-client \
-v ${volumeUploadsLocation}:/usr/src/app/dist/uploads:ro \
-v ${volumeFileManifestClient}:/tmp/manifest.json \
-e "VIRTUAL_HOST=$websiteDomain" \
-e "LETSENCRYPT_TEST="${developmentProject} \
-e "LETSENCRYPT_HOST="${websiteDomain} \
-e "LETSENCRYPT_EMAIL="${emailAddress} \
--restart="always" \
superitman/virtual-gallery:client > /dev/null

printf "\rDémarrage du container \"Client\"... "${GREEN}"fait"${NORMAL}
echo ""

###############################################################################
################################ Docker Admin #################################
###############################################################################

if [ ! -d "${logLocation}/${containerNamePrefix}-admin" ]; then
    echo "Création du dossier de logs pour \"Administration\""
    mkdir -p ${logLocation}/${containerNamePrefix}-admin
fi

printf "\rDémarrage du container \"Administration\"..."

isRunningDocker=$(/usr/bin/docker ps -q -a -f name=${containerNamePrefix}-admin)
if [ ${#isRunningDocker} -gt 0 ]; then
    docker rm -f ${containerNamePrefix}-admin > /dev/null
fi

docker run -it -d \
--name ${containerNamePrefix}-admin \
-v ${volumeUploadsLocation}:/var/www/public/uploads:rw \
-v ${volumeConfigLocation}:/var/www/config \
-v ${logLocation}/${containerNamePrefix}-admin:/var/log/apache2 \
--link ${containerNamePrefix}-database:db \
-e "VIRTUAL_HOST="${adminDomain} \
-e "LETSENCRYPT_TEST="${developmentProject} \
-e "LETSENCRYPT_HOST="${adminDomain} \
-e "LETSENCRYPT_EMAIL="${emailAddress} \
--restart="always" \
superitman/virtual-gallery:admin > /dev/null

printf "\rDémarrage du container \"Administration\"... "${GREEN}"fait"${NORMAL}
echo ""

###############################################################################
############################# Docker phpMyAdmin ###############################
###############################################################################

printf "\rDémarrage du container \"phpMyAdmin\"..."

isRunningDocker=$(/usr/bin/docker ps -q -a -f name=${containerNamePrefix}-phpmyadmin)
if [ ${#isRunningDocker} -gt 0 ]; then
    docker rm -f ${containerNamePrefix}-phpmyadmin > /dev/null
fi

docker run -it -d \
--name ${containerNamePrefix}-phpmyadmin \
--link ${containerNamePrefix}-database:db \
-e "VIRTUAL_HOST="${phpmyadminDomain} \
-e "LETSENCRYPT_TEST="${developmentProject} \
-e "LETSENCRYPT_HOST="${phpmyadminDomain} \
-e "LETSENCRYPT_EMAIL="${emailAddress} \
--restart="always" \
phpmyadmin/phpmyadmin > /dev/null

printf "\rDémarrage du container \"phpMyAdmin\"... "${GREEN}"fait"${NORMAL}
echo ""

sleep 2
projectInstall=1


text:
* inspiration in immediate GUIs (what I see is exactly how the document is structured)
* CSDDM allows to ensure, that no data are removed (just check, that no permissions contain `rem`)
* OLAP support?

# Sources

document DB modelling https://docs.mongodb.org/manual/core/data-modeling-introduction/
document referencing versus embedding https://docs.mongodb.org/manual/core/data-model-design/#data-modeling-referencing
documents have metadata and can contain arbitrary number (0..N) of items (and non-uniformly among the "same" records) https://en.wikipedia.org/wiki/Document-oriented_database#Documents
production-ready pure relational database SIRA_PRISE in Java http://shark.armchair.mb.ca/~erwin/ (uses prefix notation and doesn't have the flaws of SQL)
DataScript in-memory DB (based on Datomic/Datalog) https://github.com/tonsky/datascript
Datomic proprietary DB (based on Datalog) http://docs.datomic.com/query.html
Datalog Education System (has ODBC backend and thus can be used with SQLite locally or any other remote ODBC service) http://sourceforge.net/projects/des/
Datalog to SQL using Jelly Views http://home.agh.edu.pl/~wojnicki/phd/node1.html

# KONTROLA KVALITY DOKUMENTU

40 normostran (kazda 1800 znaku) => 72000; zcela vlastni obrazek nahrazuje text se srovnatelnou plochou
Citace: ČSN 01 0197
Počet znaku na radek max. 75
Vetsi bile místo na vnejsim hrbetu a dole
Pouzivat hlavicky a paticky
Pismo Antiqua/Palation/… 12pt, proklad 120%
Kontrola:
* Uvozovky
* Pomlcka – , spojovnik - , rozdelovnik ???
* Zalamovani radku a stranek (vdovy a sirotci)
* Mezery u interpunkcnich znaku a citaci
* Nejednotnost interpunkce ve vyctech a popisech obrazku a tabulek
* Nepouzivat "marketingove" nazvy (technologie, reseni)


text:
/*
              Inverted Theme
=============================================
 * Color Scheme:
 *     background-color     : #393536
 *     color     : #e9e9e9
 */
/*
 * General Styling
 */
.fl-theme-prefsEditor-inverted, .fl-theme-prefsEditor-inverted *, .fl-preview-theme.fl-theme-prefsEditor-inverted, .fl-theme-prefsEditor-yb.fl-inverted-color, .fl-theme-prefsEditor-yb .fl-inverted-color, .fl-theme-prefsEditor-yb.fl-inverted-color *, .fl-theme-prefsEditor-yb .fl-inverted-color *, .fl-preview-theme.fl-theme-prefsEditor-yb.fl-inverted-color {
    color: #e9e9e9 !important;
    background-color: #393536 !important;
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
}
/* Divs, inputs */
.fl-theme-prefsEditor-inverted div, .fl-theme-prefsEditor-inverted input, .fl-theme-prefsEditor-yb .fl-inverted-color div, .fl-theme-prefsEditor-yb .fl-inverted-color input {
    color: #e9e9e9 !important;
    background-color: #393536 !important;
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
}
/* iframes */
.fl-theme-prefsEditor-inverted iframe, .fl-theme-prefsEditor-yb .fl-inverted-color iframe {
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
}
/* Links */
.fl-theme-prefsEditor-inverted a, .fl-theme-prefsEditor-yb .fl-inverted-color a {
    color: #e9e9e9 !important;
    font-weight: bold !important;
    background-color: #393536 !important;
}
/* Headers */
.fl-theme-prefsEditor-inverted h1, .fl-theme-prefsEditor-inverted h2, .fl-theme-prefsEditor-inverted h3, .fl-theme-prefsEditor-inverted h4, .fl-theme-prefsEditor-inverted h5, .fl-theme-prefsEditor-inverted h6, .fl-theme-prefsEditor-yb .fl-inverted-color h1, .fl-theme-prefsEditor-yb .fl-inverted-color h2, .fl-theme-prefsEditor-yb .fl-inverted-color h3, .fl-theme-prefsEditor-yb .fl-inverted-color h4, .fl-theme-prefsEditor-yb .fl-inverted-color h5, .fl-theme-prefsEditor-yb .fl-inverted-color h6 {
    color: #e9e9e9 !important;
    background-color: #393536 !important;
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
}
/* Tables */
.fl-theme-prefsEditor-inverted th, .fl-theme-prefsEditor-yb .fl-inverted-color th {
    border-top-width: 0.1em;
    border-top-style: solid;
    border-top-color: #e9e9e9 !important;
    border-right-width: 0.1em;
    border-right-style: solid;
    border-right-color: #e9e9e9 !important;
    border-bottom-width: 0.1em;
    border-bottom-style: solid;
    border-bottom-color: #e9e9e9 !important;
    border-left-width: 0.1em;
    border-left-style: solid;
    border-left-color: #e9e9e9 !important;
    background-color: #e9e9e9 !important;
    color: #393536 !important;
}
.fl-theme-prefsEditor-inverted td, .fl-theme-prefsEditor-yb .fl-inverted-color td {
    border-top-width: 0.1em;
    border-top-style: solid;
    border-top-color: #e9e9e9 !important;
    border-right-width: 0.1em;
    border-right-style: solid;
    border-right-color: #e9e9e9 !important;
    border-bottom-width: 0.1em;
    border-bottom-style: solid;
    border-bottom-color: #e9e9e9 !important;
    border-left-width: 0.1em;
    border-left-style: solid;
    border-left-color: #e9e9e9 !important;
}
/*
 * FSS Elements
 */
/* Focus */
.fl-theme-prefsEditor-inverted .fl-focus:focus, .fl-theme-prefsEditor-inverted .fl-focus :focus, .fl-theme-prefsEditor-inverted.fl-focus :focus, .fl-theme-prefsEditor-inverted .selectable, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-focus:focus, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-focus :focus, .fl-theme-prefsEditor-yb.fl-inverted-color.fl-focus :focus, .fl-theme-prefsEditor-yb .fl-inverted-color .selectable {
    outline-width: 0.2em;
    outline-style: solid;
    outline-color: #e9e9e9;
}
.fl-theme-prefsEditor-inverted .fl-knockout, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-knockout {
    background-color: transparent !important;
    background-image: none !important;
    background-repeat: repeat !important;
    background-attachment: scroll !important;
    background-position: top left !important;
    color: #e9e9e9 !important;
}
/* Deprecated: use .fl-noBackgroundImages */
/* Icons */
.fl-theme-prefsEditor-inverted .fl-icon, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-icon {
    background-color: #393536 !important;
}
/* Tabs */
.fl-theme-prefsEditor-inverted .fl-tabs, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs {
    border-bottom-color: #e9e9e9 !important;
}
.fl-theme-prefsEditor-inverted .fl-tabs li, .fl-theme-prefsEditor-inverted .fl-tabs li *, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li * {
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
}
.fl-theme-prefsEditor-inverted .fl-tabs li, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li {
    background-color: #e9e9e9 !important;
}
.fl-theme-prefsEditor-inverted .fl-tabs li *, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li * {
    color: #393536 !important;
    font-weight: bold !important;
    background-color: #e9e9e9 !important;
    text-decoration: none !important;
}
.fl-theme-prefsEditor-inverted .fl-tabs li:hover, .fl-theme-prefsEditor-inverted .fl-tabs li:hover *, .fl-theme-prefsEditor-inverted .fl-tabs li a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li:hover *, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li a:hover {
    color: #e9e9e9 !important;
    background-color: #393536 !important;
}
.fl-theme-prefsEditor-inverted .fl-tabs li.fl-tabs-active, .fl-theme-prefsEditor-inverted .fl-tabs li.fl-tabs-active a, .fl-theme-prefsEditor-inverted .fl-tabs li.fl-tabs-active a:hover, .fl-theme-prefsEditor-inverted .fl-tabs li.fl-activeTab, .fl-theme-prefsEditor-inverted .fl-tabs li.fl-activeTab:hover, .fl-theme-prefsEditor-inverted .fl-tabs li.fl-activeTab a, .fl-theme-prefsEditor-inverted .fl-tabs li.fl-activeTab a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-tabs-active, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-tabs-active a, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-tabs-active a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-activeTab, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-activeTab:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-activeTab a, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tabs li.fl-activeTab a:hover {
    background-color: #393536 !important;
    border-bottom-color: #393536 !important;
    color: #e9e9e9 !important;
}
.fl-theme-prefsEditor-inverted .fl-tab-content, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-tab-content {
    background-color: #393536 !important;
    color: #e9e9e9 !important;
}
/* Menu */
.fl-theme-prefsEditor-inverted .fl-listmenu, .fl-theme-prefsEditor-inverted .fl-list-menu, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-listmenu, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-list-menu {
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #e9e9e9 !important;
    border-right-width: 1px;
    border-right-style: solid;
    border-right-color: #e9e9e9 !important;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e9e9e9 !important;
    border-left-width: 1px;
    border-left-style: solid;
    border-left-color: #e9e9e9 !important;
    border-bottom-width: 2px;
    background-color: #393536 !important;
}
.fl-theme-prefsEditor-inverted .fl-listmenu li, .fl-theme-prefsEditor-inverted .fl-list-menu li, .fl-theme-prefsEditor-inverted .fl-listmenu li a, .fl-theme-prefsEditor-inverted .fl-list-menu li a .fl-theme-prefsEditor-yb .fl-inverted-color .fl-listmenu li, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-list-menu li, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-listmenu li a, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-list-menu li a {
    font-weight: bold !important;
    color: #e9e9e9 !important;
    background-color: #393536 !important;
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
    text-decoration: none !important;
}
.fl-theme-prefsEditor-inverted .fl-listmenu a:hover, .fl-theme-prefsEditor-inverted .fl-list-menu a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-listmenu a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-list-menu a:hover {
    background-color: #e9e9e9 !important;
    color: #393536 !important;
}
.fl-theme-prefsEditor-inverted .fl-listmenu .fl-activemenu a, .fl-theme-prefsEditor-inverted .fl-list-menu .fl-activemenu a, .fl-theme-prefsEditor-inverted .fl-listmenu .fl-activemenu a:hover, .fl-theme-prefsEditor-inverted .fl-list-menu .fl-activemenu a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-listmenu .fl-activemenu a, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-list-menu .fl-activemenu a, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-listmenu .fl-activemenu a:hover, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-list-menu .fl-activemenu a:hover {
    background-color: #e9e9e9 !important;
    border-bottom-color: #393536 !important;
    color: #393536 !important;
}
/* Buttons */
.fl-theme-prefsEditor-inverted .fl-button-left, .fl-theme-prefsEditor-inverted .fl-button-right, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-button-left, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-button-right {
    background-image: url('../../../../framework/fss/css/../images/themes/by/buttons-med-cap.png') !important;
}
.fl-theme-prefsEditor-inverted .fl-button-inner, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-button-inner {
    background-image: url('../../../../framework/fss/css/../images/themes/by/buttons-med-bg.png') !important;
}
/* Widget core */
.fl-theme-prefsEditor-inverted .fl-widget, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget {
    background-color: #e9e9e9 !important;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #393536 !important;
    border-right-width: 1px;
    border-right-style: solid;
    border-right-color: #393536 !important;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #393536 !important;
    border-left-width: 1px;
    border-left-style: solid;
    border-left-color: #393536 !important;
}
.fl-theme-prefsEditor-inverted .fl-widget h2, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget h2 {
    color: #e9e9e9 !important;
}
.fl-theme-prefsEditor-inverted .fl-widget a, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget a {
    color: #e9e9e9 !important;
}
.fl-theme-prefsEditor-inverted .fl-widget .fl-icon-more, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget .fl-icon-more {
    background-image: url('../../../../framework/fss/css/../images/themes/by/icon-widget-More.png') !important;
    margin-left: 0px;
}
.fl-theme-prefsEditor-inverted .fl-widget .fl-icon-close, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget .fl-icon-close {
    background-image: url('../../../../framework/fss/css/../images/themes/by/icon-widget-Close.png') !important;
    margin-right: 0px;
}
/* Widget titlebar */
.fl-theme-prefsEditor-inverted .fl-widget .fl-widget-titlebar, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget .fl-widget-titlebar {
    margin-bottom: 3px;
}
.fl-theme-prefsEditor-inverted .fl-grabbable .fl-widget-titlebar, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-grabbable .fl-widget-titlebar {
    background-image: url('../../../../framework/fss/css/../images/themes/by/icon-widget-gripper.png') !important;
}
.fl-theme-prefsEditor-inverted .fl-grabbable .fl-widget-titlebar h2, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-grabbable .fl-widget-titlebar h2 {
    display: inline;
}
.fl-theme-prefsEditor-inverted .fl-widget-titlebar .icon, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget-titlebar .icon {
    background-position: center center;
}
.fl-theme-prefsEditor-inverted .fl-widget-titlebar .fl-button-right, .fl-theme-prefsEditor-inverted .fl-widget-titlebar .fl-button-left, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget-titlebar .fl-button-right, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget-titlebar .fl-button-left {
    color: #e9e9e9 !important;
    background-image: url('../../../../framework/fss/css/../images/themes/by/buttons-titlebar-cap.png') !important;
    text-decoration: none !important;
}
.fl-theme-prefsEditor-inverted .fl-widget-titlebar .fl-button-inner, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget-titlebar .fl-button-inner {
    background-image: url('../../../../framework/fss/css/../images/themes/by/buttons-titlebar-bg.png') !important;
}
/* Widget options */
.fl-theme-prefsEditor-inverted .fl-widget .fl-widget-options, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget .fl-widget-options {
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
}
.fl-theme-prefsEditor-inverted .fl-widget .fl-widget-options li, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget .fl-widget-options li {
    border-left-width: 1px;
    border-left-style: solid;
    border-left-color: #393536 !important;
}
/* Widget content */
.fl-theme-prefsEditor-inverted .fl-widget .fl-widget-content, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-widget .fl-widget-content {
    background-color: #393536 !important;
}
/*
 * Infusion Components
 */
/* Progress */
.fl-theme-prefsEditor-inverted .fl-progress-bounds, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-progress-bounds {
    border-top-color: #e9e9e9 !important;
    border-right-color: #e9e9e9 !important;
    border-bottom-color: #e9e9e9 !important;
    border-left-color: #e9e9e9 !important;
    background-color: #393536 !important;
}
.fl-theme-prefsEditor-inverted .fl-progress-fill, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-progress-fill {
    color: #393536 !important;
    background-color: #e9e9e9 !important;
}
/* Reorderer */
.fl-theme-prefsEditor-inverted .fl-reorderer-dropMarker, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-reorderer-dropMarker {
    background-color: #f00 !important;
}
/* Inline Edit */
.fl-theme-prefsEditor-inverted .fl-inlineEdit-edit, .fl-theme-prefsEditor-yb .fl-inverted-color .fl-inlineEdit-edit {
    background-color: #e9e9e9 !important;
    color: #393536 !important;
    border-top-width: 0.1em;
    border-top-style: solid;
    border-top-color: #393536 !important;
    border-right-width: 0.1em;
    border-right-style: solid;
    border-right-color: #393536 !important;
    border-bottom-width: 0.1em;
    border-bottom-style: solid;
    border-bottom-color: #393536 !important;
    border-left-width: 0.1em;
    border-left-style: solid;
    border-left-color: #393536 !important;
    padding-top: 0.1em;
    padding-right: 0.1em;
    padding-bottom: 0.1em;
    padding-left: 0.1em;
    margin-top: -0.1em;
    margin-right: -0.1em;
    margin-bottom: -0.1em;
    margin-left: -0.1em;
}


text:
namespace WTManager.Controls
{
    [System.ComponentModel.DesignerCategory("")]
    public class WtManagerMainForm : WtManagerForm
    {
        protected override void SetVisibleCore(bool value)
        {
            base.SetVisibleCore(false);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>io.spring.initializr</groupId>
	<artifactId>initializr</artifactId>
	<version>0.6.0.BUILD-SNAPSHOT</version>
	<packaging>pom</packaging>
	<name>Spring Initializr</name>
	<description>A web-based quickstart generator for Spring projects</description>
	<url>https://github.com/spring-io/initializr</url>
	<organization>
		<name>Pivotal Software, Inc.</name>
		<url>http://www.spring.io</url>
	</organization>
	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
		</license>
	</licenses>
	<scm>
		<connection>scm:git:https://github.com/spring-io/initializr</connection>
		<url>https://github.com/spring-io/initializr</url>
	</scm>
	<developers>
		<developer>
			<id>snicoll</id>
			<name>Stephane Nicoll</name>
			<email>snicoll at pivotal.io</email>
			<organization>Pivotal Software, Inc.</organization>
			<organizationUrl>http://www.spring.io</organizationUrl>
			<roles>
				<role>Project lead</role>
			</roles>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<spring.boot.version>2.0.1.RELEASE</spring.boot.version>
		<java.version>1.8</java.version>
	</properties>

	<modules>
		<module>initializr-actuator</module>
		<module>initializr-docs</module>
		<module>initializr-generator</module>
		<module>initializr-web</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.spring.initializr</groupId>
				<artifactId>initializr-actuator</artifactId>
				<version>0.6.0.BUILD-SNAPSHOT</version>
			</dependency>
			<dependency>
				<groupId>io.spring.initializr</groupId>
				<artifactId>initializr-generator</artifactId>
				<version>0.6.0.BUILD-SNAPSHOT</version>
			</dependency>
			<dependency>
				<groupId>io.spring.initializr</groupId>
				<artifactId>initializr-generator</artifactId>
				<version>0.6.0.BUILD-SNAPSHOT</version>
				<type>test-jar</type>
			</dependency>
			<dependency>
				<groupId>io.spring.initializr</groupId>
				<artifactId>initializr-web</artifactId>
				<version>0.6.0.BUILD-SNAPSHOT</version>
			</dependency>
			<dependency>
				<groupId>io.spring.initializr</groupId>
				<artifactId>initializr-web</artifactId>
				<version>0.6.0.BUILD-SNAPSHOT</version>
				<type>test-jar</type>
			</dependency>

			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${spring.boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-contract-dependencies</artifactId>
				<version>1.2.1.RELEASE</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>com.vaadin.external.google</groupId>
				<artifactId>android-json</artifactId>
				<version>0.0.20131108.vaadin1</version>
			</dependency>
			<dependency>
				<groupId>xmlunit</groupId>
				<artifactId>xmlunit</artifactId>
				<version>1.5</version>
			</dependency>
			<dependency>
				<groupId>org.apache.ant</groupId>
				<artifactId>ant</artifactId>
				<version>1.10.2</version>
				<exclusions>
					<exclusion>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant-launcher</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.agilejava.docbkx</groupId>
					<artifactId>docbkx-maven-plugin</artifactId>
					<version>2.0.17</version>
				</plugin>
				<plugin>
					<groupId>org.asciidoctor</groupId>
					<artifactId>asciidoctor-maven-plugin</artifactId>
					<version>1.5.5</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.8</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.7.0</version>
					<configuration>
						<source>${java.version}</source>
						<target>${java.version}</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.0.2</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.20.1</version>
					<configuration>
						<includes>
							<include>**/*Tests.java</include>
						</includes>
						<excludes>
							<exclude>**/Abstract*.java</exclude>
							<exclude>**/*SmokeTests.java</exclude>
						</excludes>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${spring.boot.version}</version>
				</plugin>
				<plugin>
					<groupId>pl.project13.maven</groupId>
					<artifactId>git-commit-id-plugin</artifactId>
					<version>2.2.3</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>full</id>
			<modules>
				<module>initializr-service</module>
			</modules>
		</profile>
	</profiles>

</project>


text:
package de.adesso.wickedcharts.highcharts.options;

import de.adesso.wickedcharts.highcharts.options.color.ColorReference;

import java.io.Serializable;

/**
 * Configuration of a single crosshair (x or y).
 *
 * @see <a
 *      href="http://api.highcharts.com/highcharts#tooltip.crosshairs">http://api.highcharts.com/highcharts#tooltip.crosshairs</a>
 * @author Tom Hombergs (tom.hombergs@gmail.com)
 *
 */
public class Crosshair implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer width;

	private ColorReference color;

	private GridLineDashStyle dashStyle;

	private Integer zIndex;

	public ColorReference getColor() {
		return this.color;
	}

	public GridLineDashStyle getDashStyle() {
		return this.dashStyle;
	}

	public Integer getWidth() {
		return this.width;
	}

	public Integer getzIndex() {
		return this.zIndex;
	}

	public Crosshair setColor(final ColorReference color) {
		this.color = color;
		return this;
	}

	public Crosshair setDashStyle(final GridLineDashStyle dashStyle) {
		this.dashStyle = dashStyle;
		return this;
	}

	public Crosshair setWidth(final Integer width) {
		this.width = width;
		return this;
	}

	public Crosshair setzIndex(final Integer zIndex) {
		this.zIndex = zIndex;
		return this;
	}

}


text:
package org.springframework.cloud.dataflow.core;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

/**
 * The {@code ArtifactCoordinates} class contains
 * Maven coordinates for a jar file containing a module/library, or a Bill of Materials pom.
 *

 * To create a new instance, either use {@link Builder} to set the individual fields:
 *

 * new ArtifactCoordinates.Builder()
 *     .setGroupId("org.springframework.cloud.stream.module")
 *     .setArtifactId("time-source")
 *     .setExtension("jar") //optional
 *     .setClassifier("exec") //optional
 *     .setVersion("2.0.0")
 *     .build()
 *

 * ...or use {@link #parse(String)} to parse the coordinates as a colon delimited string:
 * <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
 *

 * ArtifactCoordinates.parse("org.springframework.cloud.stream.module:some-module:2.0.0);
 * ArtifactCoordinates.parse("org.springframework.cloud.stream.module:time-source:jar:exec:2.0.0);
 *

 *

 * @author David Turanski
 * @author Mark Fisher
 * @author Patrick Peralta
 */
public class ArtifactCoordinates {

	/**
	 * The default extension for the artifact.
	 */
	final static String DEFAULT_EXTENSION = "jar";

	/**
	 * String representing an empty classifier.
	 */
	final static String EMPTY_CLASSIFIER = "";

	/**
	 * Group ID for artifact; generally this includes the name of the
	 * organization that generated the artifact.
	 */
	private final String groupId;

	/**
	 * Artifact ID; generally this includes the name of the module.
	 */
	private final String artifactId;

	/**
	 * Extension of the artifact.
	 */
	private final String extension;

	/**
	 * Classifier of the artifact.
	 */
	private final String classifier;

	/**
	 * Version of the artifact.
	 */
	private final String version;

	/**
	 * Construct a {@code ArtifactCoordinates} object.
	 * @param groupId group ID for artifact
	 * @param artifactId artifact ID
	 * @param extension the file extension
	 * @param classifier artifact classifier - can be null
	 * @param version artifact version
	 */
	private ArtifactCoordinates(String groupId, String artifactId, String extension, String classifier, String version) {
		Assert.hasText(groupId, "'groupId' cannot be blank");
		Assert.hasText(artifactId, "'artifactId' cannot be blank");
		Assert.hasText(extension, "'extension' cannot be blank");
		Assert.hasText(version, "'version' cannot be blank");

		this.groupId = groupId;
		this.artifactId = artifactId;
		this.extension = extension;
		this.classifier = classifier == null ? EMPTY_CLASSIFIER : classifier;
		this.version = version;
	}

	/**
	 * @see #groupId
	 */
	public String getGroupId() {
		return groupId;
	}

	/**
	 * @see #artifactId
	 */
	public String getArtifactId() {
		return artifactId;
	}

	/**
	 * @see #extension
	 */
	public String getExtension() {
		return extension;
	}

	/**
	 * @see #version
	 */
	public String getClassifier() {
		return classifier;
	}

	/**
	 * @see #version
	 */
	public String getVersion() {
		return version;
	}

	@Override
	public final boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof ArtifactCoordinates)) {
			return false;
		}

		ArtifactCoordinates that = (ArtifactCoordinates) o;

		return this.groupId.equals(that.groupId) &&
				this.artifactId.equals(that.artifactId) &&
				this.extension.equals(that.extension) &&
				this.classifier.equals(that.classifier) &&
				this.version.equals(that.version);
	}

	@Override
	public int hashCode() {
		int result = groupId.hashCode();
		result = 31 * result + artifactId.hashCode();
		result = 31 * result + extension.hashCode();
		if (StringUtils.hasLength(classifier)) {
			result = 31 * result + classifier.hashCode();
		}
		result = 31 * result + version.hashCode();
		return result;
	}

	/**
	 * Returns the coordinates encoded as
	 * <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>,
	 * conforming to the Aether convention.
	 */
	@Override
	public String toString() {
		return StringUtils.hasLength(classifier) ?
				String.format("%s:%s:%s:%s:%s", groupId, artifactId, extension, classifier, version) :
				String.format("%s:%s:%s:%s", groupId, artifactId, extension, version);
	}

	/**
	 * Parse coordinates given as a colon delimited string.
	 *
	 * @param coordinates coordinates encoded as <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>,
	 * conforming to the Aether convention.
	 * @return the instance
	 */
	public static ArtifactCoordinates parse(String coordinates) {
		Assert.hasText(coordinates);

		Pattern p = Pattern.compile("([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)");
		Matcher m = p.matcher(coordinates);
		Assert.isTrue(m.matches(), "Bad artifact coordinates " + coordinates
				+ ", expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>");

		String groupId = m.group(1);
		String artifactId = m.group(2);
		String extension = StringUtils.hasLength(m.group(4)) ? m.group(4) : DEFAULT_EXTENSION;
		String classifier = StringUtils.hasLength(m.group(6)) ? m.group(6) : EMPTY_CLASSIFIER;
		String version = m.group(7);

		return new ArtifactCoordinates(groupId, artifactId, extension, classifier, version);
	}

	public static class Builder {

		private String groupId;

		private String artifactId;

		private String extension = DEFAULT_EXTENSION;

		private String classifier = EMPTY_CLASSIFIER;

		private String version;

		public Builder setGroupId(String groupId) {
			this.groupId = groupId;
			return this;
		}

		public Builder setArtifactId(String artifactId) {
			this.artifactId = artifactId;
			return this;
		}

		public Builder setExtension(String extension) {
			this.extension = extension;
			return this;
		}

		public Builder setClassifier(String classifier) {
			this.classifier = classifier;
			return this;
		}

		public Builder setVersion(String version) {
			this.version = version;
			return this;
		}

		public ArtifactCoordinates build() {
			return new ArtifactCoordinates(groupId, artifactId, extension, classifier, version);
		}
	}

}


text:
package influxql_test

import (
	"reflect"
	"strings"
	"testing"
	"time"

	"github.com/influxdb/influxdb/influxql"
)

// Ensure the parser can parse a multi-statement query.
func TestParser_ParseQuery(t *testing.T) {
	s := `SELECT a FROM b; SELECT c FROM d`
	q, err := influxql.NewParser(strings.NewReader(s)).ParseQuery()
	if err != nil {
		t.Fatalf("unexpected error: %s", err)
	} else if len(q.Statements) != 2 {
		t.Fatalf("unexpected statement count: %d", len(q.Statements))
	}
}

// Ensure the parser can parse an empty query.
func TestParser_ParseQuery_Empty(t *testing.T) {
	q, err := influxql.NewParser(strings.NewReader(``)).ParseQuery()
	if err != nil {
		t.Fatalf("unexpected error: %s", err)
	} else if len(q.Statements) != 0 {
		t.Fatalf("unexpected statement count: %d", len(q.Statements))
	}
}

// Ensure the parser can return an error from an malformed statement.
func TestParser_ParseQuery_ParseError(t *testing.T) {
	_, err := influxql.NewParser(strings.NewReader(`SELECT`)).ParseQuery()
	if err == nil || err.Error() != `found EOF, expected identifier, string, number, bool at line 1, char 8` {
		t.Fatalf("unexpected error: %s", err)
	}
}

// Ensure the parser can parse strings into Statement ASTs.
func TestParser_ParseStatement(t *testing.T) {
	var tests = []struct {
		s    string
		stmt influxql.Statement
		err  string
	}{
		// SELECT * statement
		{
			s: `SELECT * FROM myseries`,
			stmt: &influxql.SelectStatement{
				Fields: influxql.Fields{
					&influxql.Field{Expr: &influxql.Wildcard{}},
				},
				Source: &influxql.Measurement{Name: "myseries"},
			},
		},

		// SELECT statement
		{
			s: `SELECT field1, field2 ,field3 AS field_x FROM myseries WHERE host = 'hosta.influxdb.org' GROUP BY 10h ORDER BY ASC LIMIT 20;`,
			stmt: &influxql.SelectStatement{
				Fields: influxql.Fields{
					&influxql.Field{Expr: &influxql.VarRef{Val: "field1"}},
					&influxql.Field{Expr: &influxql.VarRef{Val: "field2"}},
					&influxql.Field{Expr: &influxql.VarRef{Val: "field3"}, Alias: "field_x"},
				},
				Source: &influxql.Measurement{Name: "myseries"},
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "host"},
					RHS: &influxql.StringLiteral{Val: "hosta.influxdb.org"},
				},
				Dimensions: influxql.Dimensions{
					&influxql.Dimension{Expr: &influxql.DurationLiteral{Val: 10 * time.Hour}},
				},
				Limit: 20,
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
				},
			},
		},

		// SELECT statement with JOIN
		{
			s: `SELECT field1 FROM join(aa,"bb", cc) JOIN cc`,
			stmt: &influxql.SelectStatement{
				Fields: influxql.Fields{&influxql.Field{Expr: &influxql.VarRef{Val: "field1"}}},
				Source: &influxql.Join{
					Measurements: influxql.Measurements{
						{Name: "aa"},
						{Name: "bb"},
						{Name: "cc"},
					},
				},
			},
		},

		// SELECT statement with MERGE
		{
			s: `SELECT field1 FROM merge(aa,b.b)`,
			stmt: &influxql.SelectStatement{
				Fields: influxql.Fields{&influxql.Field{Expr: &influxql.VarRef{Val: "field1"}}},
				Source: &influxql.Merge{
					Measurements: influxql.Measurements{
						{Name: "aa"},
						{Name: "b.b"},
					},
				},
			},
		},

		// SELECT statement (lowercase)
		{
			s: `select my_field from myseries`,
			stmt: &influxql.SelectStatement{
				Fields: influxql.Fields{&influxql.Field{Expr: &influxql.VarRef{Val: "my_field"}}},
				Source: &influxql.Measurement{Name: "myseries"},
			},
		},

		// SELECT statement with multiple ORDER BY fields
		{
			s: `SELECT field1 FROM myseries ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.SelectStatement{
				Fields: influxql.Fields{&influxql.Field{Expr: &influxql.VarRef{Val: "field1"}}},
				Source: &influxql.Measurement{Name: "myseries"},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// DELETE statement
		{
			s: `DELETE FROM myseries WHERE host = 'hosta.influxdb.org'`,
			stmt: &influxql.DeleteStatement{
				Source: &influxql.Measurement{Name: "myseries"},
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "host"},
					RHS: &influxql.StringLiteral{Val: "hosta.influxdb.org"},
				},
			},
		},

		// LIST SERIES statement
		{
			s:    `LIST SERIES`,
			stmt: &influxql.ListSeriesStatement{},
		},

		// LIST SERIES WHERE with ORDER BY and LIMIT
		{
			s: `LIST SERIES WHERE region = 'uswest' ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.ListSeriesStatement{
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "region"},
					RHS: &influxql.StringLiteral{Val: "uswest"},
				},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// LIST MEASUREMENTS WHERE with ORDER BY and LIMIT
		{
			s: `LIST MEASUREMENTS WHERE region = 'uswest' ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.ListMeasurementsStatement{
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "region"},
					RHS: &influxql.StringLiteral{Val: "uswest"},
				},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// LIST TAG KEYS
		{
			s: `LIST TAG KEYS FROM src WHERE region = 'uswest' ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.ListTagKeysStatement{
				Source: &influxql.Measurement{Name: "src"},
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "region"},
					RHS: &influxql.StringLiteral{Val: "uswest"},
				},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// LIST TAG VALUES
		{
			s: `LIST TAG VALUES FROM src WHERE region = 'uswest' ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.ListTagValuesStatement{
				Source: &influxql.Measurement{Name: "src"},
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "region"},
					RHS: &influxql.StringLiteral{Val: "uswest"},
				},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// LIST FIELD KEYS
		{
			s: `LIST FIELD KEYS FROM src WHERE region = 'uswest' ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.ListFieldKeysStatement{
				Source: &influxql.Measurement{Name: "src"},
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "region"},
					RHS: &influxql.StringLiteral{Val: "uswest"},
				},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// LIST FIELD VALUES
		{
			s: `LIST FIELD VALUES FROM src WHERE region = 'uswest' ORDER BY ASC, field1, field2 DESC LIMIT 10`,
			stmt: &influxql.ListFieldValuesStatement{
				Source: &influxql.Measurement{Name: "src"},
				Condition: &influxql.BinaryExpr{
					Op:  influxql.EQ,
					LHS: &influxql.VarRef{Val: "region"},
					RHS: &influxql.StringLiteral{Val: "uswest"},
				},
				SortFields: influxql.SortFields{
					&influxql.SortField{Ascending: true},
					&influxql.SortField{Name: "field1"},
					&influxql.SortField{Name: "field2"},
				},
				Limit: 10,
			},
		},

		// DROP SERIES statement
		{
			s:    `DROP SERIES myseries`,
			stmt: &influxql.DropSeriesStatement{Name: "myseries"},
		},

		// LIST CONTINUOUS QUERIES statement
		{
			s:    `LIST CONTINUOUS QUERIES`,
			stmt: &influxql.ListContinuousQueriesStatement{},
		},

		// CREATE CONTINUOUS QUERY statement
		{
			s: `CREATE CONTINUOUS QUERY myquery AS SELECT count() FROM myseries INTO foo`,
			stmt: &influxql.CreateContinuousQueryStatement{
				Name: "myquery",
				Source: &influxql.SelectStatement{
					Fields: influxql.Fields{&influxql.Field{Expr: &influxql.Call{Name: "count"}}},
					Source: &influxql.Measurement{Name: "myseries"},
				},
				Target: "foo",
			},
		},

		// DROP CONTINUOUS QUERY statement
		{
			s:    `DROP CONTINUOUS QUERY myquery`,
			stmt: &influxql.DropContinuousQueryStatement{Name: "myquery"},
		},

		// Errors
		{s: ``, err: `found EOF, expected SELECT at line 1, char 1`},
		{s: `SELECT`, err: `found EOF, expected identifier, string, number, bool at line 1, char 8`},
		{s: `blah blah`, err: `found blah, expected SELECT at line 1, char 1`},
		{s: `SELECT field1 X`, err: `found X, expected FROM at line 1, char 15`},
		{s: `SELECT field1 FROM "series" WHERE X +;`, err: `found ;, expected identifier, string, number, bool at line 1, char 38`},
		{s: `SELECT field1 FROM myseries GROUP`, err: `found EOF, expected BY at line 1, char 35`},
		{s: `SELECT field1 FROM myseries LIMIT`, err: `found EOF, expected number at line 1, char 35`},
		{s: `SELECT field1 FROM myseries LIMIT 10.5`, err: `fractional parts not allowed in limit at line 1, char 35`},
		{s: `SELECT field1 FROM myseries LIMIT 0`, err: `LIMIT must be > 0 at line 1, char 35`},
		{s: `SELECT field1 FROM myseries ORDER`, err: `found EOF, expected BY at line 1, char 35`},
		{s: `SELECT field1 FROM myseries ORDER BY /`, err: `found /, expected identifier, ASC, or DESC at line 1, char 38`},
		{s: `SELECT field1 FROM myseries ORDER BY 1`, err: `found 1, expected identifier, ASC, or DESC at line 1, char 38`},
		{s: `SELECT field1 AS`, err: `found EOF, expected identifier, string at line 1, char 18`},
		{s: `SELECT field1 FROM 12`, err: `found 12, expected identifier, string at line 1, char 20`},
		{s: `SELECT field1 FROM myseries GROUP BY *`, err: `found *, expected identifier, string, number, bool at line 1, char 38`},
		{s: `SELECT 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 FROM myseries`, err: `unable to parse number at line 1, char 8`},
		{s: `SELECT 10.5h FROM myseries`, err: `found h, expected FROM at line 1, char 12`},
		{s: `DELETE`, err: `found EOF, expected FROM at line 1, char 8`},
		{s: `DELETE FROM`, err: `found EOF, expected identifier, string at line 1, char 13`},
		{s: `DELETE FROM myseries WHERE`, err: `found EOF, expected identifier, string, number, bool at line 1, char 28`},
		{s: `DROP SERIES`, err: `found EOF, expected identifier, string at line 1, char 13`},
		{s: `LIST CONTINUOUS`, err: `found EOF, expected QUERIES at line 1, char 17`},
		{s: `LIST FOO`, err: `found FOO, expected SERIES, CONTINUOUS at line 1, char 6`},
		{s: `DROP CONTINUOUS`, err: `found EOF, expected QUERY at line 1, char 17`},
		{s: `DROP CONTINUOUS QUERY`, err: `found EOF, expected identifier, string at line 1, char 23`},
		{s: `DROP FOO`, err: `found FOO, expected SERIES, CONTINUOUS at line 1, char 6`},
	}

	for i, tt := range tests {
		stmt, err := influxql.NewParser(strings.NewReader(tt.s)).ParseStatement()
		if !reflect.DeepEqual(tt.err, errstring(err)) {
			t.Errorf("%d. %q: error mismatch:\n  exp=%s\n  got=%s\n\n", i, tt.s, tt.err, err)
		} else if tt.err == "" && !reflect.DeepEqual(tt.stmt, stmt) {
			t.Errorf("%d. %q\n\nstmt mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", i, tt.s, tt.stmt, stmt)
		}
	}
}

// Ensure the parser can parse expressions into an AST.
func TestParser_ParseExpr(t *testing.T) {
	var tests = []struct {
		s    string
		expr influxql.Expr
		err  string
	}{
		// Primitives
		{s: `100`, expr: &influxql.NumberLiteral{Val: 100}},
		{s: `"foo bar"`, expr: &influxql.StringLiteral{Val: "foo bar"}},
		{s: `true`, expr: &influxql.BooleanLiteral{Val: true}},
		{s: `false`, expr: &influxql.BooleanLiteral{Val: false}},
		{s: `my_ident`, expr: &influxql.VarRef{Val: "my_ident"}},
		{s: `"2000-01-01 00:00:00"`, expr: &influxql.TimeLiteral{Val: mustParseTime("2000-01-01T00:00:00Z")}},
		{s: `"2000-01-32 00:00:00"`, err: `unable to parse datetime at line 1, char 1`},
		{s: `"2000-01-01"`, expr: &influxql.TimeLiteral{Val: mustParseTime("2000-01-01T00:00:00Z")}},
		{s: `"2000-01-99"`, err: `unable to parse date at line 1, char 1`},

		// Simple binary expression
		{
			s: `1 + 2`,
			expr: &influxql.BinaryExpr{
				Op:  influxql.ADD,
				LHS: &influxql.NumberLiteral{Val: 1},
				RHS: &influxql.NumberLiteral{Val: 2},
			},
		},

		// Binary expression with LHS precedence
		{
			s: `1 * 2 + 3`,
			expr: &influxql.BinaryExpr{
				Op: influxql.ADD,
				LHS: &influxql.BinaryExpr{
					Op:  influxql.MUL,
					LHS: &influxql.NumberLiteral{Val: 1},
					RHS: &influxql.NumberLiteral{Val: 2},
				},
				RHS: &influxql.NumberLiteral{Val: 3},
			},
		},

		// Binary expression with RHS precedence
		{
			s: `1 + 2 * 3`,
			expr: &influxql.BinaryExpr{
				Op:  influxql.ADD,
				LHS: &influxql.NumberLiteral{Val: 1},
				RHS: &influxql.BinaryExpr{
					Op:  influxql.MUL,
					LHS: &influxql.NumberLiteral{Val: 2},
					RHS: &influxql.NumberLiteral{Val: 3},
				},
			},
		},

		// Binary expression with LHS paren group.
		{
			s: `(1 + 2) * 3`,
			expr: &influxql.BinaryExpr{
				Op: influxql.MUL,
				LHS: &influxql.ParenExpr{
					Expr: &influxql.BinaryExpr{
						Op:  influxql.ADD,
						LHS: &influxql.NumberLiteral{Val: 1},
						RHS: &influxql.NumberLiteral{Val: 2},
					},
				},
				RHS: &influxql.NumberLiteral{Val: 3},
			},
		},

		// Binary expression with no precedence, tests left associativity.
		{
			s: `1 * 2 * 3`,
			expr: &influxql.BinaryExpr{
				Op: influxql.MUL,
				LHS: &influxql.BinaryExpr{
					Op:  influxql.MUL,
					LHS: &influxql.NumberLiteral{Val: 1},
					RHS: &influxql.NumberLiteral{Val: 2},
				},
				RHS: &influxql.NumberLiteral{Val: 3},
			},
		},

		// Complex binary expression.
		{
			s: `value + 3 < 30 AND 1 + 2 OR true`,
			expr: &influxql.BinaryExpr{
				Op: influxql.OR,
				LHS: &influxql.BinaryExpr{
					Op: influxql.AND,
					LHS: &influxql.BinaryExpr{
						Op: influxql.LT,
						LHS: &influxql.BinaryExpr{
							Op:  influxql.ADD,
							LHS: &influxql.VarRef{Val: "value"},
							RHS: &influxql.NumberLiteral{Val: 3},
						},
						RHS: &influxql.NumberLiteral{Val: 30},
					},
					RHS: &influxql.BinaryExpr{
						Op:  influxql.ADD,
						LHS: &influxql.NumberLiteral{Val: 1},
						RHS: &influxql.NumberLiteral{Val: 2},
					},
				},
				RHS: &influxql.BooleanLiteral{Val: true},
			},
		},

		// Function call (empty)
		{
			s: `my_func()`,
			expr: &influxql.Call{
				Name: "my_func",
			},
		},

		// Function call (multi-arg)
		{
			s: `my_func(1, 2 + 3)`,
			expr: &influxql.Call{
				Name: "my_func",
				Args: []influxql.Expr{
					&influxql.NumberLiteral{Val: 1},
					&influxql.BinaryExpr{
						Op:  influxql.ADD,
						LHS: &influxql.NumberLiteral{Val: 2},
						RHS: &influxql.NumberLiteral{Val: 3},
					},
				},
			},
		},
	}

	for i, tt := range tests {
		expr, err := influxql.NewParser(strings.NewReader(tt.s)).ParseExpr()
		if !reflect.DeepEqual(tt.err, errstring(err)) {
			t.Errorf("%d. %q: error mismatch:\n  exp=%s\n  got=%s\n\n", i, tt.s, tt.err, err)
		} else if tt.err == "" && !reflect.DeepEqual(tt.expr, expr) {
			t.Errorf("%d. %q\n\nexpr mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", i, tt.s, tt.expr, expr)
		}
	}
}

// Ensure a time duration can be parsed.
func TestParseDuration(t *testing.T) {
	var tests = []struct {
		s   string
		d   time.Duration
		err string
	}{
		{s: `3`, d: 3 * time.Microsecond},
		{s: `1000`, d: 1000 * time.Microsecond},
		{s: `10u`, d: 10 * time.Microsecond},
		{s: `10µ`, d: 10 * time.Microsecond},
		{s: `15ms`, d: 15 * time.Millisecond},
		{s: `100s`, d: 100 * time.Second},
		{s: `2m`, d: 2 * time.Minute},
		{s: `2h`, d: 2 * time.Hour},
		{s: `2d`, d: 2 * 24 * time.Hour},
		{s: `2w`, d: 2 * 7 * 24 * time.Hour},

		{s: ``, err: "invalid duration"},
		{s: `w`, err: "invalid duration"},
		{s: `1.2w`, err: "invalid duration"},
		{s: `10x`, err: "invalid duration"},
	}

	for i, tt := range tests {
		d, err := influxql.ParseDuration(tt.s)
		if !reflect.DeepEqual(tt.err, errstring(err)) {
			t.Errorf("%d. %q: error mismatch:\n  exp=%s\n  got=%s\n\n", i, tt.s, tt.err, err)
		} else if tt.d != d {
			t.Errorf("%d. %q\n\nduration mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", i, tt.s, tt.d, d)
		}
	}
}

// Ensure a time duration can be formatted.
func TestFormatDuration(t *testing.T) {
	var tests = []struct {
		d time.Duration
		s string
	}{
		{d: 3 * time.Microsecond, s: `3`},
		{d: 1001 * time.Microsecond, s: `1001`},
		{d: 15 * time.Millisecond, s: `15ms`},
		{d: 100 * time.Second, s: `100s`},
		{d: 2 * time.Minute, s: `2m`},
		{d: 2 * time.Hour, s: `2h`},
		{d: 2 * 24 * time.Hour, s: `2d`},
		{d: 2 * 7 * 24 * time.Hour, s: `2w`},
	}

	for i, tt := range tests {
		s := influxql.FormatDuration(tt.d)
		if tt.s != s {
			t.Errorf("%d. %v: mismatch: %s != %s", i, tt.d, tt.s, s)
		}
	}
}

// Ensure a string can be quoted.
func TestQuote(t *testing.T) {
	for i, tt := range []struct {
		in  string
		out string
	}{
		{``, `""`},
		{`foo`, `"foo"`},
		{"foo\nbar", `"foo\nbar"`},
		{`foo bar\\`, `"foo bar\\\\"`},
		{`"foo"`, `"\"foo\""`},
	} {
		if out := influxql.Quote(tt.in); tt.out != out {
			t.Errorf("%d. %s: mismatch: %s != %s", i, tt.in, tt.out, out)
		}
	}
}

// Ensure an identifier can be quoted when appropriate.
func TestQuoteIdent(t *testing.T) {
	for i, tt := range []struct {
		ident string
		s     string
	}{
		{``, `""`},
		{`foo`, `foo`},
		{`foo.bar.baz`, `foo.bar.baz`},
		{`my var`, `"my var"`},
		{`my-var`, `"my-var"`},
		{`my_var`, `my_var`},
	} {
		if s := influxql.QuoteIdent(tt.ident); tt.s != s {
			t.Errorf("%d. %s: mismatch: %s != %s", i, tt.ident, tt.s, s)
		}
	}
}

func BenchmarkParserParseStatement(b *testing.B) {
	b.ReportAllocs()
	s := `SELECT field FROM "series" WHERE value > 10`
	for i := 0; i < b.N; i++ {
		if stmt, err := influxql.NewParser(strings.NewReader(s)).ParseStatement(); err != nil {
			b.Fatalf("unexpected error: %s", err)
		} else if stmt == nil {
			b.Fatalf("expected statement", stmt)
		}
	}
	b.SetBytes(int64(len(s)))
}

// MustParseSelectStatement parses a select statement. Panic on error.
func MustParseSelectStatement(s string) *influxql.SelectStatement {
	stmt, err := influxql.NewParser(strings.NewReader(s)).ParseStatement()
	if err != nil {
		panic(err.Error())
	}
	return stmt.(*influxql.SelectStatement)
}

// MustParseExpr parses an expression. Panic on error.
func MustParseExpr(s string) influxql.Expr {
	expr, err := influxql.NewParser(strings.NewReader(s)).ParseExpr()
	if err != nil {
		panic(err.Error())
	}
	return expr
}

// errstring converts an error to its string representation.
func errstring(err error) string {
	if err != nil {
		return err.Error()
	}
	return ""
}


text:
const React = require('react');
const ReactDOM = require('react-dom');

var Dialog = React.createClass({
  render(){
    var width = this.props.width||'50%';
    var height = this.props.height||'500px';
    var marginTop= this.props.marginTop||'5%';
    return (

              {this.props.title}

              {this.props.children}

    )
  }
});

module.exports = Dialog;


text:
    {{day.dayFriendlyName}} :
    {{day.date | date:'dd/MM/yyyy'}}
    {{currentOrder.orderDay.date}}

    <ng-template [ngIf]="requestedDishes && requestedDishes.length">

            <ng-template ngFor let-dish [ngForOf]="requestedDishes">
                fiber_manual_record
            </ng-template>

    </ng-template>


text:
/**
 * JavaScript behaviors for the front-end display of webforms.
 */

(function ($) {

Backdrop.behaviors.webform = Backdrop.behaviors.webform || {};

Backdrop.behaviors.webform.attach = function(context) {
  // Calendar datepicker behavior.
  Backdrop.webform.datepicker(context);

  // Conditional logic.
  if (Backdrop.settings.webform && Backdrop.settings.webform.conditionals) {
    Backdrop.webform.conditional(context);
  }
};

Backdrop.webform = Backdrop.webform || {};

Backdrop.webform.datepicker = function(context) {
  $('div.webform-datepicker').each(function() {
    var $webformDatepicker = $(this);
    var $calendar = $webformDatepicker.find('input.webform-calendar');

    // Ensure the page we're on actually contains a datepicker.
    if ($calendar.length == 0) {
      return;
    }

    var startDate = $calendar[0].className.replace(/.*webform-calendar-start-(\d{4}-\d{2}-\d{2}).*/, '$1').split('-');
    var endDate = $calendar[0].className.replace(/.*webform-calendar-end-(\d{4}-\d{2}-\d{2}).*/, '$1').split('-');
    var firstDay = $calendar[0].className.replace(/.*webform-calendar-day-(\d).*/, '$1');
    // Convert date strings into actual Date objects.
    startDate = new Date(startDate[0], startDate[1] - 1, startDate[2]);
    endDate = new Date(endDate[0], endDate[1] - 1, endDate[2]);

    // Ensure that start comes before end for datepicker.
    if (startDate > endDate) {
      var laterDate = startDate;
      startDate = endDate;
      endDate = laterDate;
    }

    var startYear = startDate.getFullYear();
    var endYear = endDate.getFullYear();

    // Set up the jQuery datepicker element.
    $calendar.datepicker({
      dateFormat: 'yy-mm-dd',
      yearRange: startYear + ':' + endYear,
      firstDay: parseInt(firstDay),
      minDate: startDate,
      maxDate: endDate,
      onSelect: function(dateText, inst) {
        var date = dateText.split('-');
        $webformDatepicker.find('select.year, input.year').val(+date[0]).trigger('change');
        $webformDatepicker.find('select.month').val(+date[1]).trigger('change');
        $webformDatepicker.find('select.day').val(+date[2]).trigger('change');
      },
      beforeShow: function(input, inst) {
        // Get the select list values.
        var year = $webformDatepicker.find('select.year, input.year').val();
        var month = $webformDatepicker.find('select.month').val();
        var day = $webformDatepicker.find('select.day').val();

        // If empty, default to the current year/month/day in the popup.
        var today = new Date();
        year = year ? year : today.getFullYear();
        month = month ? month : today.getMonth() + 1;
        day = day ? day : today.getDate();

        // Make sure that the default year fits in the available options.
        year = (year < startYear || year > endYear) ? startYear : year;

        // jQuery UI Datepicker will read the input field and base its date off
        // of that, even though in our case the input field is a button.
        $(input).val(year + '-' + month + '-' + day);
      }
    });

    // Prevent the calendar button from submitting the form.
    $calendar.click(function(event) {
      $(this).focus();
      event.preventDefault();
    });
  });
};

Backdrop.webform.conditional = function(context) {
  // Add the bindings to each webform on the page.
  $.each(Backdrop.settings.webform.conditionals, function(formKey, settings) {
    var $form = $('.' + formKey + ':not(.webform-conditional-processed)');
    $form.each(function(index, currentForm) {
      var $currentForm = $(currentForm);
      $currentForm.addClass('webform-conditional-processed');
      $currentForm.bind('change', { 'settings': settings }, Backdrop.webform.conditionalCheck);

      // Trigger all the elements that cause conditionals on this form.
      $.each(Backdrop.settings.webform.conditionals[formKey]['sourceMap'], function(elementKey) {
        $currentForm.find('.' + elementKey).find('input,select,textarea').filter(':first').trigger('change');
      });
    })
  });
};

/**
 * Event handler to respond to field changes in a form.
 *
 * This event is bound to the entire form, not individual fields.
 */
Backdrop.webform.conditionalCheck = function(e) {
  var $triggerElement = $(e.target).closest('.webform-component');
  var $form = $triggerElement.closest('form');
  var triggerElementKey = $triggerElement.attr('class').match(/webform-component--[^ ]+/)[0];
  var settings = e.data.settings;

  if (settings.sourceMap[triggerElementKey]) {
    $.each(settings.sourceMap[triggerElementKey], function(n, rgid) {
      var ruleGroup = settings.ruleGroups[rgid];

      // Perform the comparison callback and build the results for this group.
      var conditionalResult = true;
      var conditionalResults = [];
      $.each(ruleGroup['rules'], function(m, rule) {
        var elementKey = rule['source'];
        var element = $form.find('.' + elementKey)[0];
        var existingValue = settings.values[elementKey] ? settings.values[elementKey] : null;
        conditionalResults.push(window['Backdrop']['webform'][rule.callback](element, existingValue, rule['value'] ));
      });

      // Filter out false values.
      var filteredResults = [];
      for (var i = 0; i < conditionalResults.length; i++) {
        if (conditionalResults[i]) {
          filteredResults.push(conditionalResults[i]);
        }
      }

      // Calculate the and/or result.
      if (ruleGroup['andor'] === 'or') {
        conditionalResult = filteredResults.length > 0;
      }
      else {
        conditionalResult = filteredResults.length === conditionalResults.length;
      }

      // Flip the result of the action is to hide.
      var showComponent;
      if (ruleGroup['action'] == 'hide') {
        showComponent = !conditionalResult;
      }
      else {
        showComponent = conditionalResult;
      }

      var $target = $form.find('.' + ruleGroup['target']);
      var $targetElements;
      if (showComponent) {
        $targetElements = $target.find('.webform-conditional-disabled').removeClass('webform-conditional-disabled');
        $.fn.prop ? $targetElements.prop('disabled', false) : $targetElements.removeAttr('disabled');
        $target.show();
      }
      else {
        $targetElements = $target.find(':input').addClass('webform-conditional-disabled');
        $.fn.prop ? $targetElements.prop('disabled', true) : $targetElements.attr('disabled', true);
        $target.hide();
      }
    });
  }

};

Backdrop.webform.conditionalOperatorStringEqual = function(element, existingValue, ruleValue) {
  var returnValue = false;
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  $.each(currentValue, function(n, value) {
    if (value.toLowerCase() === ruleValue.toLowerCase()) {
      returnValue = true;
      return false; // break.
    }
  });
  return returnValue;
};

Backdrop.webform.conditionalOperatorStringNotEqual = function(element, existingValue, ruleValue) {
  var found = false;
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  $.each(currentValue, function(n, value) {
    if (value.toLowerCase() === ruleValue.toLowerCase()) {
      found = true;
    }
  });
  return !found;
};

Backdrop.webform.conditionalOperatorStringContains = function(element, existingValue, ruleValue) {
  var returnValue = false;
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  $.each(currentValue, function(n, value) {
    if (value.toLowerCase().indexOf(ruleValue.toLowerCase()) > -1) {
      returnValue = true;
      return false; // break.
    }
  });
  return returnValue;
};

Backdrop.webform.conditionalOperatorStringDoesNotContain = function(element, existingValue, ruleValue) {
  var found = false;
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  $.each(currentValue, function(n, value) {
    if (value.toLowerCase().indexOf(ruleValue.toLowerCase()) > -1) {
      found = true;
    }
  });
  return !found;
};

Backdrop.webform.conditionalOperatorStringBeginsWith = function(element, existingValue, ruleValue) {
  var returnValue = false;
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  $.each(currentValue, function(n, value) {
    if (value.toLowerCase().indexOf(ruleValue.toLowerCase()) === 0) {
      returnValue = true;
      return false; // break.
    }
  });
  return returnValue;
};

Backdrop.webform.conditionalOperatorStringEndsWith = function(element, existingValue, ruleValue) {
  var returnValue = false;
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  $.each(currentValue, function(n, value) {
    if (value.toLowerCase().lastIndexOf(ruleValue.toLowerCase()) === value.length - ruleValue.length) {
      returnValue = true;
      return false; // break.
    }
  });
  return returnValue;
};

Backdrop.webform.conditionalOperatorStringEmpty = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  var returnValue = true;
  $.each(currentValue, function(n, value) {
    if (value !== '') {
      returnValue = false;
      return false; // break.
    }
  });
  return returnValue;
};

Backdrop.webform.conditionalOperatorStringNotEmpty = function(element, existingValue, ruleValue) {
  return !Backdrop.webform.conditionalOperatorStringEmpty(element, existingValue, ruleValue);
};

Backdrop.webform.conditionalOperatorNumericEqual = function(element, existingValue, ruleValue) {
  // See float comparison: http://php.net/manual/en/language.types.float.php
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  var epsilon = 0.000001;
  // An empty string does not match any number.
  return currentValue[0] === '' ? false : (Math.abs(parseFloat(currentValue[0]) - parseFloat(ruleValue)) < epsilon);
};

Backdrop.webform.conditionalOperatorNumericNotEqual = function(element, existingValue, ruleValue) {
  // See float comparison: http://php.net/manual/en/language.types.float.php
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  var epsilon = 0.000001;
  // An empty string does not match any number.
  return currentValue[0] === '' ? true : (Math.abs(parseFloat(currentValue[0]) - parseFloat(ruleValue)) >= epsilon);
};

Backdrop.webform.conditionalOperatorNumericGreaterThan = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  return parseFloat(currentValue[0]) > parseFloat(ruleValue);
};

Backdrop.webform.conditionalOperatorNumericLessThan = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.stringValue(element, existingValue);
  return parseFloat(currentValue[0]) < parseFloat(ruleValue);
};

Backdrop.webform.conditionalOperatorDateEqual = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.dateValue(element, existingValue);
  return currentValue === ruleValue;
};

Backdrop.webform.conditionalOperatorDateBefore = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.dateValue(element, existingValue);
  return (currentValue !== false) && currentValue < ruleValue;
};

Backdrop.webform.conditionalOperatorDateAfter = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.dateValue(element, existingValue);
  return (currentValue !== false) && currentValue > ruleValue;
};

Backdrop.webform.conditionalOperatorTimeEqual = function(element, existingValue, ruleValue) {
  var currentValue = Backdrop.webform.timeValue(element, existingValue);
  return currentValue === ruleValue;
};

Backdrop.webform.conditionalOperatorTimeBefore = function(element, existingValue, ruleValue) {
  // Date and time operators intentionally exclusive for "before".
  var currentValue = Backdrop.webform.timeValue(element, existingValue);
  return (currentValue !== false) && (currentValue < ruleValue);
};

Backdrop.webform.conditionalOperatorTimeAfter = function(element, existingValue, ruleValue) {
  // Date and time operators intentionally inclusive for "after".
  var currentValue = Backdrop.webform.timeValue(element, existingValue);
  return (currentValue !== false) && (currentValue >= ruleValue);
};

/**
 * Utility function to get a string value from a select/radios/text/etc. field.
 */
Backdrop.webform.stringValue = function(element, existingValue) {
  var value = [];

  if (element) {
    // Checkboxes and radios.
    $(element).find('input[type=checkbox]:checked,input[type=radio]:checked').each(function() {
      value.push(this.value);
    });
    // Select lists.
    if (!value.length) {
      var selectValue = $(element).find('select').val();
      if (selectValue) {
        value.push(selectValue);
      }
    }
    // Simple text fields. This check is done last so that the select list in
    // select-or-other fields comes before the "other" text field.
    if (!value.length) {
      $(element).find('input:not([type=checkbox],[type=radio]),textarea').each(function() {
        value.push(this.value);
      });
    }
  }
  else if (existingValue) {
    value = existingValue;
  }

  return value;
};

/**
 * Utility function to calculate a millisecond timestamp from a time field.
 */
Backdrop.webform.dateValue = function(element, existingValue) {
  if (element) {
    var day = $(element).find('[name*=day]').val();
    var month = $(element).find('[name*=month]').val();
    var year = $(element).find('[name*=year]').val();
    // Months are 0 indexed in JavaScript.
    if (month) {
      month--;
    }
    return (year !== '' && month !== '' && day !== '') ? Date.UTC(year, month, day) / 1000 : false;
  }
  else {
    var existingValue = existingValue.length ? existingValue[0].split('-') : existingValue;
    return existingValue.length ? Date.UTC(existingValue[0], existingValue[1], existingValue[2]) / 1000 : false;
  }
};

/**
 * Utility function to calculate a millisecond timestamp from a time field.
 */
Backdrop.webform.timeValue = function(element, existingValue) {
  if (element) {
    var hour = $(element).find('[name*=hour]').val();
    var minute = $(element).find('[name*=minute]').val();
    var ampm = $(element).find('[name*=ampm]:checked').val();

    // Convert to integers if set.
    hour = (hour === '') ? hour : parseInt(hour);
    minute = (minute === '') ? minute : parseInt(minute);

    if (hour !== '') {
      hour = (hour < 12 && ampm == 'pm') ? hour + 12 : hour;
      hour = (hour === 12 && ampm == 'am') ? 0 : hour;
    }
    return (hour !== '' && minute !== '') ? Date.UTC(1970, 0, 1, hour, minute) / 1000 : false;
  }
  else {
    var existingValue = existingValue.length ? existingValue[0].split(':') : existingValue;
    return existingValue.length ? Date.UTC(1970, 0, 1, existingValue[0], existingValue[1]) / 1000 : false;
  }
};

})(jQuery);


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-video-options-button',
  templateUrl: './video-options-button.component.html',
  styleUrls: ['./video-options-button.component.css']
})
export class VideoOptionsButtonComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
import fetch from 'isomorphic-fetch';
import tree from '../state';

export default function (user,branch) {
  fetch('https://api.github.com/repos/' + user + '/' + branch + '/issues').then(
    (response) => response.json()
  ).then(
    (issues) => {
      tree.set('issues', issues);
      tree.set('url', '/list/' + user + '/' + branch);
      tree.set('currentPage', 'list');
    }
  );
}


text:
import json
import codecs
from apiclient.discovery import build

API_KEY = "AIzaSyAdHnvmBSL6k0vY_qJQcnAuqagSZ3LjoSM"
cx_key  = '011033102363583886669:avf3hux4mn4'
# first it is created a google custom search service at http://www.google.com/cse/
# -then configure it to search the entire web
# -obtain cx_key from code snippet
# -finally obtain API_KEY from API ACCESS in the API control panel

class Google(object):

	def __init__(self, license=None, geolocation='mx'):
	    """ license     : license key for the API
	    geolocation : default country of search is defined as Mexico
	    """
	    self.license = license or API_KEY
	    self.geolocation = geolocation

	def search(self, query, num_results=10, starting_at=1):
	    """ Returns a list (json) of results from Google for the given query.
	    - num_results: number of displayed results (from 1 to 10)
	    - starting_at: number of starting point,
	    - there is a daily limit of 100 free queries. Google Custom Search is a paid service if more queries are needed.
	    """
	    service = build("customsearch", "v1", developerKey=self.license)
	    result  = service.cse().list( q     = query,
					  gl    = self.geolocation,
					  num   = num_results,
					  start = starting_at,
					  cx	= cx_key,).execute()
	    return result

	def write_txt(self, result_search, file_name="google.txt"):
	    dictionary  = {}
	    result_json = json.dumps(result_search)
	    dictionary  = json.loads(result_json.encode('utf-8'))
	    try:
		try:
		    #create or open existing file
		    googleFile = codecs.open(file_name, "a", "utf-8")
                    try:
                            for res in dictionary['items']:
                                #for element in res:
                                file_line  = dictionary['queries']['request'][0]['searchTerms']+"/|/"+res['title']+"/|/"+res['snippet']+"/|/"+res['link']+"\n"
                                file_line.replace("\n","")
                                googleFile.write(file_line)
                                print file_line
                    except KeyError, e:
                        value = 'default'
		finally:
			# closing file
			googleFile.close()
	    except IOError:
		print("IOError")

	def result_list(self, result_search):
	    dictionary  = {}
            list = []
	    result_json = json.dumps(result_search)
	    dictionary  = json.loads(result_json.encode('utf-8'))
	    try:
                for res in dictionary['items']:
                    line  = res['title']+", "+res['link']
                    line.replace("\n","")
                    list.append(line)
                return list
	    except KeyError, e:
		value = 'default'


text:
#region License

#endregion

using System;
using System.Globalization;

using Spring.Json;

namespace Spring.Social.Facebook.Api.Impl.Json
{
	/// <summary>
	/// JSON deserializer for LinkPost.
	/// </summary>
	/// <author>Craig Walls</author>
	/// <author>SplendidCRM (.NET)</author>
	class LinkPostDeserializer : IJsonDeserializer
	{
		public object Deserialize(JsonValue json, JsonMapper mapper)
		{
			LinkPost post = null;
			if ( json != null && !json.IsNull )
			{
				post = new LinkPost();
				post.ID          = json.ContainsName("id"          ) ? json.GetValue<string>("id"       ) : String.Empty;
				post.ObjectId    = json.ContainsName("object_id"   ) ? json.GetValue<string>("object_id") : String.Empty;
				post.CreatedTime = json.ContainsName("created_time") ? JsonUtils.ToDateTime(json.GetValue<string>("created_time"), "yyyy-MM-ddTHH:mm:ss") : DateTime.MinValue;
				post.UpdatedTime = json.ContainsName("updated_time") ? JsonUtils.ToDateTime(json.GetValue<string>("updated_time"), "yyyy-MM-ddTHH:mm:ss") : DateTime.MinValue;

				post.From        = mapper.Deserialize<Reference>(json.GetValue("from"));
			}
			return post;
		}
	}
}


text:
PROJECT = annex

include erlang.mk

bin/start:
	@mkdir -p bin
	@curl https://gist.githubusercontent.com/camshaft/372cc332241ac95ae335/raw/start -o $@
	@chmod a+x $@

.PHONY: repl


text:
import getLuminance from 'polished/lib/color/getLuminance'
import shade from 'polished/lib/color/shade'
import tint from 'polished/lib/color/tint'
import { scaleMixAmount } from './scaleMixAmount'

/**
 * Tints or shades a color based on the luminosity of the color
 *
 * Used for generating our UI colors based on the background color
 *
 * If the color has a higher luminosity, a light background for example,
 * the color is shaded, returning a color mixed with black
 *
 * For colors with lower luminosity, dark background colors for example,
 * the colors is tinted,returning a color mixed with white
 *
 * @param mixAmount 0 - 100
 * @param color
 */
export const tintOrShadeUiColor = (mixAmount: number, color: string) => {
  const isBright = getLuminance(color) > 0.5
  const mixAdjustment = isBright ? mixAmount : scaleMixAmount(mixAmount, 1.5)

  /* shade & tint functions cannot exceed 100% */
  const mixPercent = mixAdjustment > 100 ? 1 : mixAdjustment / 100

  return (isBright ? shade : tint)(mixPercent, color)
}