text:
"""
Link extraction test suite for sudpresse.py
"""

import os
from nose.tools import eq_
from csxj.datasources import sudpresse
from csxj.common.tagging import make_tagged_url

from csxj_test_tools import assert_taggedURLs_equals

DATA_ROOT = os.path.join(os.path.dirname(__file__), 'test_data', 'sudpresse')

class TestSudpresseLinkExtraction(object):
    def test_sidebar_box_tagging(self):
        """ Sudpresse parser correctly tags 'sidebar box' links """
        with open(os.path.join(DATA_ROOT, "sidebar_box_tagging.html")) as f:
            article, raw_html = sudpresse.extract_article_data(f)
            extracted_links = article.links
            tagged_urls = [
                make_tagged_url("/actualite/fil_info/2011-05-10/wouter-weylandt-un-registre-de-condoleances-ouvert-au-centre-du-tour-des-flandres-872031.shtml", u"""Wouter Weylandt : un registre de condoléances ouvert au centre du Tour des Flandres""", set(['internal', 'sidebar box'])),
                make_tagged_url("/sports/cyclisme/2011-05-10/deces-de-weylandt-la-4e-etape-du-giro-neutralisee-872000.shtml", u"""e étape du Giro neutralisée" >Décès de Weylandt: la 4e étape du Giro neutralisée""", set(['internal', 'sidebar box'])),
                make_tagged_url("/sports/cyclisme/2011-05-10/giro-neutralisee-la-4e-etape-prendra-la-forme-d-un-defile-871999.shtml", u"""Giro: neutralisée, la 4e étape prendra la forme d'un défilé""", set(['internal', 'sidebar box'])),
                make_tagged_url("/sports/cyclisme/2011-05-10/andy-schleck-pour-wouter-weylandt-repose-en-paix-mon-ami-871991.shtml", u"""Andy Schleck pour Wouter Weylandt: "Repose en paix, mon ami """", set(['internal', 'sidebar box'])),
                make_tagged_url("/sports/cyclisme/2011-05-10/deces-du-coureur-wouter-weylandt-leopard-trek-reste-sur-le-giro-871934.shtml", u"""Décès de Wouter Weylandt: Leopard-Trek reste sur le Giro""", set(['internal', 'sidebar box'])),
                make_tagged_url("/sports/cyclisme/2011-05-09/giro-terrible-chute-de-wouter-weylandt-dans-une-descente-son-etat-est-inquietant-871804.shtml", u"""Décès de Wouter Weylandt: "Un cas désespéré", explique le médecin de la course""", set(['internal', 'sidebar box'])),
            ]
            expected_links = tagged_urls
            assert_taggedURLs_equals(expected_links, extracted_links)

    def test_plaintext_links_tagging(self):
        """ Sudpresse parser correctly tags 'plaintext' links."""
        with open(os.path.join(DATA_ROOT, "plaintext_links_tagging.html")) as f:
            article, raw_html = sudpresse.extract_article_data(f)
            extracted_links = article.links
            tagged_urls = [
                make_tagged_url("http://expo-guide.com", u"""http://expo-guide.com""", set(['plaintext', 'external', 'in text'])),
            ]
            expected_links = tagged_urls
            assert_taggedURLs_equals(expected_links, extracted_links)

    def test_intext_links_tagging(self):
        """ Sudpresse parser correctly tags 'in text' links."""
        with open(os.path.join(DATA_ROOT, "intext_links_tagging.html")) as f:
            article, raw_html = sudpresse.extract_article_data(f)
            extracted_links = article.links
            tagged_urls = [
                make_tagged_url("http://www.lameuse.be/vervietois2011", u"""www.lameuse.be/vervietois2011""", set(['same owner', 'external', 'in text'])),
                make_tagged_url("http://verviers.lameuse.be", u"""http://verviers.lameuse.be""", set(['same owner', 'external', 'in text'])),
            ]
            expected_links = tagged_urls
            assert_taggedURLs_equals(expected_links, extracted_links)

    def test_same_owner_tagging(self):
        """ Sudpresse parser correctly tags 'same owner' links """
        with open(os.path.join(DATA_ROOT, "same_owner_tagging.html")) as f:
            article, raw_html = sudpresse.extract_article_data(f)
            extracted_links = article.links
            tagged_urls = [
                make_tagged_url("http://www.nordeclair.fr/Actualite/Depeches/2012/02/13/dujardin-a-lille.shtml", u"""Nos confrères de Nord Eclair France """, set(['same owner', 'external', 'in text'])),
                make_tagged_url("http://www.nordeclair.fr/Actualite/Depeches/2012/02/13/dujardin-a-lille.shtml", u"""Voir sur le site nordeclair.fr""", set(['external', 'same owner', 'sidebar box'])),
            ]
            expected_links = tagged_urls
            assert_taggedURLs_equals(expected_links, extracted_links)


text:
package com.yxkang.android.commonparser.sample;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.yxkang.android.xmldom4j.converter.Dom4jConverter;
import com.yxkang.android.xmlparser.Converter;
import com.yxkang.android.xmlparser.Serializer;
import com.yxkang.android.xmlparser.serializer.DefaultSerializer;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    private ExecutorService mExecutor = Executors.newCachedThreadPool();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
    }

    @OnClick(value = R.id.button)
    void xml() {
        mExecutor.submit(new Runnable() {
            @Override
            public void run() {
                /*Serializer converter = new XmlConverter();
                converter.setLogger(new XmlParserLogger());
                UserResponse userResponse = converter.convert(UserResponse.class, XmlConstant.DATA2);
                if (userResponse != null) {
                    Log.i(TAG, "xml: " + userResponse.toString());
                }

                ListSize listSize = converter.convert(ListSize.class, XmlConstant.DATA3);
                Log.i(TAG, "xml: " + listSize.toString());*/
                Converter converter = new Dom4jConverter();
                converter.setLogger(new XmlParserTracer());
                UserResponse userResponse = converter.convert(UserResponse.class, XmlConstant.DATA2);
                if (userResponse != null) {
                    Log.i(TAG, "xml: " + userResponse.toString());
                }

                ListSize listSize = converter.convert(ListSize.class, XmlConstant.DATA3);
                Log.i(TAG, "xml: " + listSize.toString());

                Serializer serializer = new DefaultSerializer();
                serializer.setLogger(new XmlParserTracer());
                serializer.setCRLF("\n");
                serializer.setStandalone(null);

                if (userResponse != null) {
                    Log.i(TAG, serializer.toXmlString(userResponse));
                }
            }
        });
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;
using System.Linq;

using Bumblebee.Interfaces;

namespace Bumblebee.Extensions
{
	public static class Filtering
	{
		public static IEnumerable<TResult> WithText<TResult>(this IEnumerable<TResult> haveText, string text) where TResult : IHasText
		{
			return haveText.Where(hasText => hasText.Text.Trim() == text.Trim());
		}

		public static IEnumerable<TResult> ContainingText<TResult>(this IEnumerable<TResult> haveText, string text) where TResult : IHasText
		{
			return haveText.Where(hasText => hasText.Text.Contains(text.Trim()));
		}

		public static IEnumerable<TSelectable> Unselected<TSelectable>(this IEnumerable<TSelectable> options) where TSelectable : ISelectable
		{
			return options.Where(option => option.Selected == false);
		}

		public static IEnumerable<TSelectable> Selected<TSelectable>(this IEnumerable<TSelectable> options) where TSelectable : ISelectable
		{
			return options.Where(option => option.Selected);
		}
	}
}


text:
@interface SDLGetDTCsResponse : SDLRPCResponse {}

-(id) init;
-(id) initWithDictionary:(NSMutableDictionary*) dict;

@property(strong) NSNumber* ecuHeader;
@property(strong) NSMutableArray* dtc;

@end


text:
using namespace seqan;

SEQAN_DEFINE_TEST(test_my_app_funcs_create_positionsContainers)
{
	unsigned q = 12;
	unsigned lenSeqOne = 200000;
	unsigned lenSeqTwo = 205000;

	typedef seqan::Seed<seqan::Simple> SSeed;
	seqan::String<SSeed> seedChain;
	SSeed seed(0u, 15u, 200u, 215u);
	SSeed seed2(50000u, 55000u, lenSeqOne - 20 * q, lenSeqTwo - 20 * q);

	seqan::append(seedChain, seed);
	seqan::append(seedChain, seed2);

	std::vector<std::pair<unsigned, unsigned> > startPositions;
	std::vector<std::pair<unsigned, unsigned> > endPositions;

	SEQAN_ASSERT_EQ(create_positionsContainers(startPositions,
								endPositions,
								seedChain,
								q, lenSeqOne, lenSeqTwo), 	true);

	SEQAN_ASSERT_EQ(startPositions.front().first, 200u);
	SEQAN_ASSERT_EQ(startPositions.front().second, 215u);
	SEQAN_ASSERT_EQ(endPositions.front().first, 50000u);
	SEQAN_ASSERT_EQ(endPositions.front().second, 55000u);

	SEQAN_ASSERT_EQ(startPositions.back().first, lenSeqOne - 20 * q);
	SEQAN_ASSERT_EQ(startPositions.back().second, lenSeqTwo - 20 * q);
	SEQAN_ASSERT_EQ(endPositions.back().first, lenSeqOne);
	SEQAN_ASSERT_EQ(endPositions.back().second, lenSeqTwo);

	clear(seedChain);

	SEQAN_ASSERT_EQ(create_positionsContainers(startPositions,
								endPositions,
								seedChain,
								q, lenSeqOne, lenSeqTwo), 	false);

	SSeed seed3(lenSeqOne - 15u, lenSeqTwo - 15u, lenSeqOne, lenSeqTwo);

	append(seedChain, seed3);
	startPositions.resize(0);
	endPositions.resize(0);

	SEQAN_ASSERT_EQ(create_positionsContainers(startPositions,
								endPositions,
								seedChain,
								q, lenSeqOne, lenSeqTwo), 	true);

	SEQAN_ASSERT_EQ(startPositions.front().first, 0u);
	SEQAN_ASSERT_EQ(startPositions.front().second, 0u);
	SEQAN_ASSERT_EQ(endPositions.front().first, lenSeqOne - 15u);
	SEQAN_ASSERT_EQ(endPositions.front().second, lenSeqTwo - 15u);
}

SEQAN_DEFINE_TEST(test_my_app_funcs_sortFunction)
{
	typedef seqan::Seed<seqan::Simple> SSeed;

	SSeed seed1(10, 50, 60, 100);
	SSeed seed2(20, 80, 100, 160);

	SEQAN_ASSERT_EQ(sortFunction(seed1, seed2), true);
	SEQAN_ASSERT_EQ(sortFunction(seed2, seed1), false);
}

SEQAN_DEFINE_TEST(test_my_app_funcs_get_qGramArray)
{
	unsigned maxQ = 14;
	unsigned minQ = 4;
	unsigned parts = 1;

	std::vector<unsigned> qGramArray;

	qGramArray = get_qGramArray(maxQ, minQ, parts);

	SEQAN_ASSERT_EQ(qGramArray.size(), parts + 1u);
	SEQAN_ASSERT_EQ(qGramArray.front(), maxQ);
	SEQAN_ASSERT_EQ(qGramArray.back(), minQ);

	parts = 2;
	qGramArray = get_qGramArray(maxQ, minQ, parts);

	SEQAN_ASSERT_EQ(qGramArray.size(), parts + 1u);
	SEQAN_ASSERT_EQ(qGramArray.front(), maxQ);
	SEQAN_ASSERT_EQ(qGramArray[1], 9u);
	SEQAN_ASSERT_EQ(qGramArray.back(), minQ);

	parts = 3;
	qGramArray = get_qGramArray(maxQ, minQ, parts);

	SEQAN_ASSERT_EQ(qGramArray.size(), parts + 1u);
	SEQAN_ASSERT_EQ(qGramArray.front(), maxQ);
	SEQAN_ASSERT_EQ(qGramArray[1], 11u);
	SEQAN_ASSERT_EQ(qGramArray.back(), minQ);

	minQ = maxQ - 1;
	qGramArray = get_qGramArray(maxQ, minQ, parts);

	SEQAN_ASSERT_EQ(qGramArray.size(), 2u);
	SEQAN_ASSERT_EQ(qGramArray.front(), maxQ);
	SEQAN_ASSERT_EQ(qGramArray.back(), minQ);

	minQ = maxQ;
	qGramArray = get_qGramArray(maxQ, minQ, parts);

	SEQAN_ASSERT_EQ(qGramArray.size(), 1u);
	SEQAN_ASSERT_EQ(qGramArray.front(), maxQ);
	SEQAN_ASSERT_EQ(qGramArray.back(), minQ);

	parts = 0;
	qGramArray = get_qGramArray(maxQ, minQ, parts);

	SEQAN_ASSERT_EQ(qGramArray.size(), 1u);
	SEQAN_ASSERT_EQ(qGramArray.front(), maxQ);
	SEQAN_ASSERT_EQ(qGramArray.back(), minQ);
}

SEQAN_DEFINE_TEST(test_my_app_funcs_get_global_seed_Chain)
{
	typedef seqan::Seed<seqan::Simple> SSeed;
	seqan::String<seqan::Seed<seqan::Simple> > seedChain;
	seqan::DnaString seq1 = "";
	seqan::DnaString seq2 = "";
	std::pair<unsigned, unsigned> startPos;
	std::pair<unsigned, unsigned> endPos;
	unsigned q = 8;

	SEQAN_ASSERT_EQ(get_global_seed_chain(seedChain, seq1, seq2, startPos, endPos, q), false);

	seq1 = "AACCGTTAGGTTTAACCGGAGTTCCC";
	seq2 = "CAGGCTCCAACCAATTTGGGAAACTC";

	startPos = std::make_pair(0u, 0u);
	endPos = std::make_pair(9u, 12u);

	SSeed seed(9u, 12u, 10u, 13u);
	append(seedChain, seed);
	SEQAN_ASSERT_EQ(get_global_seed_chain(seedChain, seq1, seq2, startPos, endPos, q), true);
}

SEQAN_DEFINE_TEST(test_my_app_funcs_insert_seeds_in_seedChain)
{
	typedef seqan::Seed<seqan::Simple> SSeed;
	seqan::String<seqan::Seed<seqan::Simple> > seedChain;
	std::vector<std::pair<unsigned, unsigned> > startPositions;
	std::vector<std::pair<unsigned, unsigned> > endPositions;
	seqan::String<seqan::Dna> seqOne = "";
	seqan::String<seqan::Dna> seqTwo = "";
	unsigned q = 8;

	SEQAN_ASSERT_EQ(insert_seeds_in_seedChain(seedChain,  startPositions, endPositions, seqOne, seqTwo, q), false);

	SSeed seed(9u, 12u, 10u, 13u);
	append(seedChain, seed);
	startPositions.push_back(std::make_pair(0u, 0u));
	endPositions.push_back(std::make_pair(9u, 12u));
	seqOne = "AACCGTTAGGTTTAACCGGAGTTCCC";
	seqTwo = "CAGGCTCCAACCAATTTGGGAAACTC";

	SEQAN_ASSERT_EQ(insert_seeds_in_seedChain(seedChain,  startPositions, endPositions, seqOne, seqTwo, q), true);
}

SEQAN_DEFINE_TEST(test_my_app_funcs_create_positionsContainer)
{
	std::vector<std::pair<unsigned, unsigned> > startPos;
	std::vector<std::pair<unsigned, unsigned> > endPos;
	seqan::String<seqan::Seed<seqan::Simple> > seedChain;
	unsigned q = 8;
	unsigned lenSeqOne = 0;
	unsigned lenSeqTwo = 0;

	SEQAN_ASSERT_EQ(create_positionContainer(startPos,  endPos, seedChain, q, lenSeqOne, lenSeqTwo), false);

}

SEQAN_BEGIN_TESTSUITE(test_test_lagan)
{
    // Call tests.
	SEQAN_CALL_TEST(test_my_app_funcs_create_positionsContainers);
	SEQAN_CALL_TEST(test_my_app_funcs_sortFunction);
	SEQAN_CALL_TEST(test_my_app_funcs_get_qGramArray);
	SEQAN_CALL_TEST(test_my_app_funcs_get_global_seed_Chain);
	SEQAN_CALL_TEST(test_my_app_funcs_insert_seeds_in_seedChain);
	SEQAN_CALL_TEST(test_my_app_funcs_create_positionsContainer);
}
SEQAN_END_TESTSUITE


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Phyllosticta arthrophylli Koord.

### Remarks
null


text:
'use strict'

/* global describe, beforeEach, it */

var angular = require('angular')
var expect = require('chai').use(require('chai-as-promised')).use(require('sinon-chai')).expect
var sinon = require('sinon')

require('angular-mocks/ngMock')

describe('angular-q-promisify', function () {
  var promisify
  beforeEach(angular.mock.module(require('./')))
  beforeEach(angular.mock.inject(function (_promisify_) {
    promisify = _promisify_
  }))

  var nodeback
  beforeEach(function () {
    nodeback = sinon.stub()
  })

  describe('#promisify', function () {
    it('promisifes a nodeback', function () {
      nodeback.yieldsAsync(null)
      return promisify(nodeback)()
    })

    it('passes through the arguments', function () {
      nodeback.yieldsAsync(null)
      return promisify(nodeback)('foo', 'bar').then(function () {
        expect(nodeback).to.have.been.calledWith('foo', 'bar')
      })
    })

    it('fulfills with a value', function () {
      nodeback.yieldsAsync(null, 'foo')
      return expect(promisify(nodeback)()).to.eventually.equal('foo')
    })

    it('returns multiple values as an array', function () {
      nodeback.yieldsAsync(null, 'foo', 'bar')
      return expect(promisify(nodeback)()).to.eventually.deep.equal(['foo', 'bar'])
    })

    it('rejects with errors', function () {
      var err = new Error()
      nodeback.yieldsAsync(err)
      return expect(promisify(nodeback)()).to.be.rejectedWith(err)
    })

    it('rejects with errors thrown by the callback', function () {
      var err = new Error()
      nodeback.throws(err)
      return expect(promisify(nodeback)()).to.be.rejectedWith(err)
    })

    it('can set a receiver (this)', function () {
      nodeback.yieldsAsync(null)
      var receiver = {}
      return promisify(nodeback, receiver)().then()
        .then(function () {
          expect(nodeback).to.have.been.calledOn(receiver)
        })
    })

    it('throws if called on a non-function', function () {
      expect(angular.bind(null, promisify, 'foo')).to.throw('function')
    })
  })

  describe('#promisifyAll', function () {
    it('promsifies an object', function () {
      var object = {
        method: nodeback.yieldsAsync(null)
      }
      promisify.promisifyAll(object)
      return expect(object.methodAsync()).to.eventually.be.fulfilled
        .then(function () {
          expect(object.method).to.have.been.calledOn(object)
        })
    })

    it('does not rewrap promisifed methods', function () {
      var object = {
        method: nodeback.yieldsAsync(null)
      }
      promisify.promisifyAll(object)
      var method = object.method
      promisify.promisifyAll(object)
      expect(object.method).to.equal(method)
    })
  })
})


text:
FOUNDATION_EXPORT double FiveUtilsVersionNumber;

//! Project version string for FiveUtils.
FOUNDATION_EXPORT const unsigned char FiveUtilsVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <FiveUtils/PublicHeader.h>


text:
package desmoj.extensions.visualization3d;

import javax.media.j3d.BranchGroup;
import javax.media.j3d.TransformGroup;

/**
 * This class contains all elements needed in a scene graph to describe a
 * static object (i.e. a not movable SpatialObject) in a scene.
 *
 * A StaticObject consists of a 3D-model which is contained in a BranchGroup,
 * a TransformGroup who's responsible for the transformation of the object
 * and a BranchGroup which is the detaching point for this object.
 *
 * @author Fred Sun
 *
 */
public class StaticObject {

	//the name of this object
	private String _name;

	//the type of this object
	private String _type;

	//the TransformGroup who's responsible for the transformation
	private TransformGroup _transform;

	//the BranchGroup which contains the 3D-Model
	private BranchGroup _modelBranch;

	//a BranchGroup for detaching this object
	private BranchGroup _detachBranch;

	/**
	 * Constructs a StaticObject.
	 *
	 * @param name The name of this object.
	 * @param type The type of this object.
	 * @param modelBranch The 3D-model BranchGroup.
	 */
	StaticObject(String name, String type, BranchGroup modelBranch){
		assert (name!=null):"The name of the object must be specified.";
		assert (type!=null):"The type of the object must be specified.";

		_name = name;
		_type = type;
		_modelBranch = modelBranch;
		_transform = new TransformGroup();
		_transform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		_detachBranch = new BranchGroup();
		_detachBranch.setCapability(BranchGroup.ALLOW_DETACH);
		if(modelBranch!=null){
			//initialize the node groups
			_modelBranch.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);

			//link the nodes together
			_transform.addChild(modelBranch);
		}
		_detachBranch.addChild(_transform);
		_detachBranch.compile();
	}

	/**
	 * Gets the name of the StaticObject
	 * @return The name of the StaticObject
	 */
	String getName() {
		return _name;
	}

	/**
	 * Gets the type of the StaticObject.
	 * @return The type of the StaticObject
	 */
	String getType() {
		return _type;
	}

	/**
	 * Gets the TransformGroup which is responsible for the transformation
	 * of this object.
	 * @return the TransformGroup associated to this StaticObject.
	 */
	TransformGroup getTransform() {
		return _transform;
	}

	/**
	 * Gets the BranchGroup which contains the 3D-model.
	 * @return The BranchGroup which contains the 3D-model.
	 */
	BranchGroup getModelBranch() {
		return _modelBranch;
	}

	/**
	 * Gets the BranchGroup for detaching this obejct from scene graph.
	 * @return The detach BranchGroup
	 */
	BranchGroup getDetachBranch(){
		return _detachBranch;
	}
}


text:
package org.jetbrains.plugins.groovy.lang.psi.impl.synthetic;

import com.intellij.navigation.ItemPresentation;
import com.intellij.navigation.NavigationItem;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiFile;
import com.intellij.psi.search.SearchScope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author ilyas
 */
public interface GrDynamicImplicitElement extends ItemPresentation, NavigationItem {
  @Nullable
  public PsiClass getContainingClassElement();

  @NotNull
  public SearchScope getUseScope();

  public PsiFile getContainingFile();

  public String getContainingClassName();
}


text:
package com.netflix.spinnaker.clouddriver.kubernetes.v2.op.handler;

import static org.assertj.core.api.Assertions.assertThat;

import com.netflix.spinnaker.clouddriver.kubernetes.v2.description.manifest.KubernetesManifest;
import com.netflix.spinnaker.clouddriver.kubernetes.v2.model.Manifest.Status;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;

@RunWith(JUnitPlatform.class)
final class KubernetesHorizontalPodAutoscalerHandlerTest {
  private KubernetesHorizontalPodAutoscalerHandler handler =
      new KubernetesHorizontalPodAutoscalerHandler();

  @Test
  void noStatus() {
    KubernetesManifest hpa = ManifestFetcher.getManifest("horizontalpodautoscaler/base.yml");
    Status status = handler.status(hpa);

    assertThat(status.getStable().isState()).isFalse();
    assertThat(status.getStable().getMessage()).isEqualTo("No status reported yet");
    assertThat(status.getAvailable().isState()).isFalse();
    assertThat(status.getPaused().isState()).isFalse();
    assertThat(status.getFailed().isState()).isFalse();
  }

  @Test
  void waitingForScaleup() {
    KubernetesManifest hpa =
        ManifestFetcher.getManifest(
            "horizontalpodautoscaler/base.yml", "horizontalpodautoscaler/waiting-for-scaleup.yml");
    Status status = handler.status(hpa);

    assertThat(status.getStable().isState()).isFalse();
    assertThat(status.getStable().getMessage())
        .isEqualTo("Waiting for HPA to complete a scale up, current: 2 desired: 3");
    assertThat(status.getAvailable().isState()).isTrue();
    assertThat(status.getPaused().isState()).isFalse();
    assertThat(status.getFailed().isState()).isFalse();
  }

  @Test
  void waitingForScaledown() {
    KubernetesManifest hpa =
        ManifestFetcher.getManifest(
            "horizontalpodautoscaler/base.yml",
            "horizontalpodautoscaler/waiting-for-scaledown.yml");
    Status status = handler.status(hpa);

    assertThat(status.getStable().isState()).isFalse();
    assertThat(status.getStable().getMessage())
        .isEqualTo("Waiting for HPA to complete a scale down, current: 5 desired: 2");
    assertThat(status.getAvailable().isState()).isTrue();
    assertThat(status.getPaused().isState()).isFalse();
    assertThat(status.getFailed().isState()).isFalse();
  }

  @Test
  void noReplicas() {
    KubernetesManifest hpa =
        ManifestFetcher.getManifest(
            "horizontalpodautoscaler/base.yml", "horizontalpodautoscaler/no-replicas.yml");
    Status status = handler.status(hpa);

    assertThat(status.getStable().isState()).isTrue();
    assertThat(status.getAvailable().isState()).isTrue();
    assertThat(status.getPaused().isState()).isFalse();
    assertThat(status.getFailed().isState()).isFalse();
  }

  @Test
  void stable() {
    KubernetesManifest hpa =
        ManifestFetcher.getManifest(
            "horizontalpodautoscaler/base.yml", "horizontalpodautoscaler/stable.yml");
    Status status = handler.status(hpa);

    assertThat(status.getStable().isState()).isTrue();
    assertThat(status.getAvailable().isState()).isTrue();
    assertThat(status.getPaused().isState()).isFalse();
    assertThat(status.getFailed().isState()).isFalse();
  }
}


text:
# sswap

> Interchange two single-precision floating-point vectors.

## Usage

```javascript
var sswap = require( '@stdlib/blas/base/sswap' );
```

#### sswap( N, x, strideX, y, strideY )

Interchanges vectors `x` and `y`.

```javascript
var Float32Array = require( '@stdlib/array/float32' );

var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );

sswap( x.length, x, 1, y, 1 );
// x => <Float32Array>[ 6.0, 7.0, 8.0, 9.0, 10.0 ]
// y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]
```

The function has the following parameters:

-   **N**: number of values to swap.
-   **x**: first input [`Float32Array`][mdn-float32array].
-   **strideX**: index increment for `x`.
-   **y**: second input [`Float32Array`][mdn-float32array].
-   **strideY**: index increment for `y`.

The `N` and `stride` parameters determine how values from `x` and `y` are accessed at runtime. For example, to swap in reverse order every other value in `x` with the first `N` elements of `y`,

```javascript
var Float32Array = require( '@stdlib/array/float32' );

var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );

sswap( 3, x, -2, y, 1 );
// x => <Float32Array>[ 9.0, 2.0, 8.0, 4.0, 7.0, 6.0 ]
// y => <Float32Array>[ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]
```

Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.

```javascript
var Float32Array = require( '@stdlib/array/float32' );

// Initial arrays...
var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );

// Create offset views...
var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element

// Swap in reverse order every other value from `x1` with `y1`...
sswap( 3, x1, -2, y1, 1 );
// x0 => <Float32Array>[ 1.0, 12.0, 3.0, 11.0, 5.0, 10.0 ]
// y0 => <Float32Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]
```

#### sswap.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )

Interchanges vectors `x` and `y` using alternative indexing semantics.

```javascript
var Float32Array = require( '@stdlib/array/float32' );

var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );

sswap.ndarray( x.length, x, 1, 0, y, 1, 0 );
// x => <Float32Array>[ 6.0, 7.0, 8.0, 9.0, 10.0 ]
// y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]
```

The function has the following additional parameters:

-   **offsetX**: starting index for `x`.
-   **offsetY**: starting index for `y`.

While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offsetX` and `offsetY` parameters support indexing semantics based on starting indices. For example, to swap every other value in `x` starting from the second value with the last `N` elements in `y` where `x[i] = y[n]`, `x[i+2] = y[n-1]`,...,

```javascript
var Float32Array = require( '@stdlib/array/float32' );

var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );

sswap.ndarray( 3, x, 2, 1, y, -1, y.length-1 );
// x => <Float32Array>[ 1.0, 12.0, 3.0, 11.0, 5.0, 10.0 ]
// y => <Float32Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]
```

## Notes

-   If `N <= 0`, both functions leave `x` and `y` unchanged.
-   `sswap()` corresponds to the [BLAS][blas] level 1 function [`sswap`][sswap].

## Examples

```javascript
var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var Float32Array = require( '@stdlib/array/float32' );
var sswap = require( '@stdlib/blas/base/sswap' );

var x;
var y;
var i;

x = new Float32Array( 10 );
y = new Float32Array( 10 );
for ( i = 0; i < x.length; i++ ) {
    x[ i ] = round( randu()*500.0 );
    y[ i ] = round( randu()*255.0 );
}
console.log( x );
console.log( y );

// Swap elements in `x` and `y` starting from the end of `y`:
sswap( x.length, x, 1, y, -1 );
console.log( x );
console.log( y );
```

* * *

## See Also

-   [`@stdlib/blas/base/dswap`][@stdlib/blas/base/dswap]: interchange two double-precision floating-point vectors.
-   [`@stdlib/blas/base/gswap`][@stdlib/blas/base/gswap]: interchange two vectors.
-   [`@stdlib/blas/base/scopy`][@stdlib/blas/base/scopy]: copy values from x into y.
-   [`@stdlib/blas/sswap`][@stdlib/blas/sswap]: interchange two single-precision floating-point vectors.

[blas]: http://www.netlib.org/blas

[sswap]: http://www.netlib.org/lapack/explore-html/df/d28/group__single__blas__level1.html

[mdn-float32array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array

[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray

[@stdlib/blas/base/dswap]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dswap

[@stdlib/blas/base/gswap]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/gswap

[@stdlib/blas/base/scopy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/scopy

[@stdlib/blas/sswap]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/sswap


text:
require 'faraday_middleware/response_middleware'

module FaradayMiddleware
  # Public: Parse response bodies as YAML.
  class ParseYaml < ResponseMiddleware
    dependency 'yaml'

    define_parser { |body| ::YAML.load body }
  end
end

# deprecated alias
Faraday::Response::ParseYaml = FaradayMiddleware::ParseYaml


text:
@(id: Long, tagForm: Form[Tag])

@import helper._

@implicitFieldConstructor = @{ FieldConstructor(twitterBootstrapInput.f) }

@main() {

Edit tag

    @if(id != 1) {
    @form(routes.Application.update(id)) {

        <fieldset>

			@inputText(tagForm("name"), '_label -> "Tag name")
            @checkbox(tagForm("enabled"), '_label -> "Enabled",  '_help -> "")
            @inputText(tagForm("name"), '_label -> "Tag name")
            @inputText(tagForm("tuid"), '_label -> "Unique ID")
        </fieldset>

            <input type="submit" value="Save this tag" class="btn primary"> or
            Cancel

    }

    @form(routes.Application.delete(id), 'class -> "topRight") {
        <input type="submit" value="Delete this tag" class="btn danger">
    }
    }

}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>demo</title>
  <link rel="stylesheet" href="button.css">

  <input class="box" type="button" value="同意">


text:
'use strict'

module.exports = function (app) {
  /**
   * route handler for /users.
   */

  app.use(function *(next) {
    yield* next
    if (this.path === '/users' && this.method === 'GET') this.body = 'someuser'
  })
}


text:
package services // import "google.golang.org/genproto/googleapis/ads/googleads/v1/services"

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
import common "google.golang.org/genproto/googleapis/ads/googleads/v1/common"
import enums "google.golang.org/genproto/googleapis/ads/googleads/v1/enums"
import _ "google.golang.org/genproto/googleapis/api/annotations"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// Request message for [KeywordIdeaService.GenerateKeywordIdeas][].
type GenerateKeywordIdeasRequest struct {
	// The ID of the customer with the recommendation.
	CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	// The resource name of the language to target.
	// Required
	Language *wrappers.StringValue `protobuf:"bytes,7,opt,name=language,proto3" json:"language,omitempty"`
	// The resource names of the location to target.
	// Max 10
	GeoTargetConstants []*wrappers.StringValue `protobuf:"bytes,8,rep,name=geo_target_constants,json=geoTargetConstants,proto3" json:"geo_target_constants,omitempty"`
	// Targeting network.
	KeywordPlanNetwork enums.KeywordPlanNetworkEnum_KeywordPlanNetwork `protobuf:"varint,9,opt,name=keyword_plan_network,json=keywordPlanNetwork,proto3,enum=google.ads.googleads.v1.enums.KeywordPlanNetworkEnum_KeywordPlanNetwork" json:"keyword_plan_network,omitempty"`
	// The type of seed to generate keyword ideas.
	//
	// Types that are valid to be assigned to Seed:
	//	*GenerateKeywordIdeasRequest_KeywordAndUrlSeed
	//	*GenerateKeywordIdeasRequest_KeywordSeed
	//	*GenerateKeywordIdeasRequest_UrlSeed
	Seed                 isGenerateKeywordIdeasRequest_Seed `protobuf_oneof:"seed"`
	XXX_NoUnkeyedLiteral struct{}                           `json:"-"`
	XXX_unrecognized     []byte                             `json:"-"`
	XXX_sizecache        int32                              `json:"-"`
}

func (m *GenerateKeywordIdeasRequest) Reset()         { *m = GenerateKeywordIdeasRequest{} }
func (m *GenerateKeywordIdeasRequest) String() string { return proto.CompactTextString(m) }
func (*GenerateKeywordIdeasRequest) ProtoMessage()    {}
func (*GenerateKeywordIdeasRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e, []int{0}
}
func (m *GenerateKeywordIdeasRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GenerateKeywordIdeasRequest.Unmarshal(m, b)
}
func (m *GenerateKeywordIdeasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GenerateKeywordIdeasRequest.Marshal(b, m, deterministic)
}
func (dst *GenerateKeywordIdeasRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GenerateKeywordIdeasRequest.Merge(dst, src)
}
func (m *GenerateKeywordIdeasRequest) XXX_Size() int {
	return xxx_messageInfo_GenerateKeywordIdeasRequest.Size(m)
}
func (m *GenerateKeywordIdeasRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GenerateKeywordIdeasRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GenerateKeywordIdeasRequest proto.InternalMessageInfo

func (m *GenerateKeywordIdeasRequest) GetCustomerId() string {
	if m != nil {
		return m.CustomerId
	}
	return ""
}

func (m *GenerateKeywordIdeasRequest) GetLanguage() *wrappers.StringValue {
	if m != nil {
		return m.Language
	}
	return nil
}

func (m *GenerateKeywordIdeasRequest) GetGeoTargetConstants() []*wrappers.StringValue {
	if m != nil {
		return m.GeoTargetConstants
	}
	return nil
}

func (m *GenerateKeywordIdeasRequest) GetKeywordPlanNetwork() enums.KeywordPlanNetworkEnum_KeywordPlanNetwork {
	if m != nil {
		return m.KeywordPlanNetwork
	}
	return enums.KeywordPlanNetworkEnum_UNSPECIFIED
}

type isGenerateKeywordIdeasRequest_Seed interface {
	isGenerateKeywordIdeasRequest_Seed()
}

type GenerateKeywordIdeasRequest_KeywordAndUrlSeed struct {
	KeywordAndUrlSeed *KeywordAndUrlSeed `protobuf:"bytes,2,opt,name=keyword_and_url_seed,json=keywordAndUrlSeed,proto3,oneof"`
}

type GenerateKeywordIdeasRequest_KeywordSeed struct {
	KeywordSeed *KeywordSeed `protobuf:"bytes,3,opt,name=keyword_seed,json=keywordSeed,proto3,oneof"`
}

type GenerateKeywordIdeasRequest_UrlSeed struct {
	UrlSeed *UrlSeed `protobuf:"bytes,5,opt,name=url_seed,json=urlSeed,proto3,oneof"`
}

func (*GenerateKeywordIdeasRequest_KeywordAndUrlSeed) isGenerateKeywordIdeasRequest_Seed() {}

func (*GenerateKeywordIdeasRequest_KeywordSeed) isGenerateKeywordIdeasRequest_Seed() {}

func (*GenerateKeywordIdeasRequest_UrlSeed) isGenerateKeywordIdeasRequest_Seed() {}

func (m *GenerateKeywordIdeasRequest) GetSeed() isGenerateKeywordIdeasRequest_Seed {
	if m != nil {
		return m.Seed
	}
	return nil
}

func (m *GenerateKeywordIdeasRequest) GetKeywordAndUrlSeed() *KeywordAndUrlSeed {
	if x, ok := m.GetSeed().(*GenerateKeywordIdeasRequest_KeywordAndUrlSeed); ok {
		return x.KeywordAndUrlSeed
	}
	return nil
}

func (m *GenerateKeywordIdeasRequest) GetKeywordSeed() *KeywordSeed {
	if x, ok := m.GetSeed().(*GenerateKeywordIdeasRequest_KeywordSeed); ok {
		return x.KeywordSeed
	}
	return nil
}

func (m *GenerateKeywordIdeasRequest) GetUrlSeed() *UrlSeed {
	if x, ok := m.GetSeed().(*GenerateKeywordIdeasRequest_UrlSeed); ok {
		return x.UrlSeed
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*GenerateKeywordIdeasRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _GenerateKeywordIdeasRequest_OneofMarshaler, _GenerateKeywordIdeasRequest_OneofUnmarshaler, _GenerateKeywordIdeasRequest_OneofSizer, []interface{}{
		(*GenerateKeywordIdeasRequest_KeywordAndUrlSeed)(nil),
		(*GenerateKeywordIdeasRequest_KeywordSeed)(nil),
		(*GenerateKeywordIdeasRequest_UrlSeed)(nil),
	}
}

func _GenerateKeywordIdeasRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*GenerateKeywordIdeasRequest)
	// seed
	switch x := m.Seed.(type) {
	case *GenerateKeywordIdeasRequest_KeywordAndUrlSeed:
		b.EncodeVarint(2<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.KeywordAndUrlSeed); err != nil {
			return err
		}
	case *GenerateKeywordIdeasRequest_KeywordSeed:
		b.EncodeVarint(3<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.KeywordSeed); err != nil {
			return err
		}
	case *GenerateKeywordIdeasRequest_UrlSeed:
		b.EncodeVarint(5<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.UrlSeed); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("GenerateKeywordIdeasRequest.Seed has unexpected type %T", x)
	}
	return nil
}

func _GenerateKeywordIdeasRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*GenerateKeywordIdeasRequest)
	switch tag {
	case 2: // seed.keyword_and_url_seed
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(KeywordAndUrlSeed)
		err := b.DecodeMessage(msg)
		m.Seed = &GenerateKeywordIdeasRequest_KeywordAndUrlSeed{msg}
		return true, err
	case 3: // seed.keyword_seed
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(KeywordSeed)
		err := b.DecodeMessage(msg)
		m.Seed = &GenerateKeywordIdeasRequest_KeywordSeed{msg}
		return true, err
	case 5: // seed.url_seed
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(UrlSeed)
		err := b.DecodeMessage(msg)
		m.Seed = &GenerateKeywordIdeasRequest_UrlSeed{msg}
		return true, err
	default:
		return false, nil
	}
}

func _GenerateKeywordIdeasRequest_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*GenerateKeywordIdeasRequest)
	// seed
	switch x := m.Seed.(type) {
	case *GenerateKeywordIdeasRequest_KeywordAndUrlSeed:
		s := proto.Size(x.KeywordAndUrlSeed)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *GenerateKeywordIdeasRequest_KeywordSeed:
		s := proto.Size(x.KeywordSeed)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *GenerateKeywordIdeasRequest_UrlSeed:
		s := proto.Size(x.UrlSeed)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

// Keyword And Url Seed
type KeywordAndUrlSeed struct {
	// The URL to crawl in order to generate keyword ideas.
	Url *wrappers.StringValue `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Requires at least one keyword.
	Keywords             []*wrappers.StringValue `protobuf:"bytes,2,rep,name=keywords,proto3" json:"keywords,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (m *KeywordAndUrlSeed) Reset()         { *m = KeywordAndUrlSeed{} }
func (m *KeywordAndUrlSeed) String() string { return proto.CompactTextString(m) }
func (*KeywordAndUrlSeed) ProtoMessage()    {}
func (*KeywordAndUrlSeed) Descriptor() ([]byte, []int) {
	return fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e, []int{1}
}
func (m *KeywordAndUrlSeed) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_KeywordAndUrlSeed.Unmarshal(m, b)
}
func (m *KeywordAndUrlSeed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_KeywordAndUrlSeed.Marshal(b, m, deterministic)
}
func (dst *KeywordAndUrlSeed) XXX_Merge(src proto.Message) {
	xxx_messageInfo_KeywordAndUrlSeed.Merge(dst, src)
}
func (m *KeywordAndUrlSeed) XXX_Size() int {
	return xxx_messageInfo_KeywordAndUrlSeed.Size(m)
}
func (m *KeywordAndUrlSeed) XXX_DiscardUnknown() {
	xxx_messageInfo_KeywordAndUrlSeed.DiscardUnknown(m)
}

var xxx_messageInfo_KeywordAndUrlSeed proto.InternalMessageInfo

func (m *KeywordAndUrlSeed) GetUrl() *wrappers.StringValue {
	if m != nil {
		return m.Url
	}
	return nil
}

func (m *KeywordAndUrlSeed) GetKeywords() []*wrappers.StringValue {
	if m != nil {
		return m.Keywords
	}
	return nil
}

// Keyword Seed
type KeywordSeed struct {
	// Requires at least one keyword.
	Keywords             []*wrappers.StringValue `protobuf:"bytes,1,rep,name=keywords,proto3" json:"keywords,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (m *KeywordSeed) Reset()         { *m = KeywordSeed{} }
func (m *KeywordSeed) String() string { return proto.CompactTextString(m) }
func (*KeywordSeed) ProtoMessage()    {}
func (*KeywordSeed) Descriptor() ([]byte, []int) {
	return fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e, []int{2}
}
func (m *KeywordSeed) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_KeywordSeed.Unmarshal(m, b)
}
func (m *KeywordSeed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_KeywordSeed.Marshal(b, m, deterministic)
}
func (dst *KeywordSeed) XXX_Merge(src proto.Message) {
	xxx_messageInfo_KeywordSeed.Merge(dst, src)
}
func (m *KeywordSeed) XXX_Size() int {
	return xxx_messageInfo_KeywordSeed.Size(m)
}
func (m *KeywordSeed) XXX_DiscardUnknown() {
	xxx_messageInfo_KeywordSeed.DiscardUnknown(m)
}

var xxx_messageInfo_KeywordSeed proto.InternalMessageInfo

func (m *KeywordSeed) GetKeywords() []*wrappers.StringValue {
	if m != nil {
		return m.Keywords
	}
	return nil
}

// Url Seed
type UrlSeed struct {
	// The URL to crawl in order to generate keyword ideas.
	Url                  *wrappers.StringValue `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

func (m *UrlSeed) Reset()         { *m = UrlSeed{} }
func (m *UrlSeed) String() string { return proto.CompactTextString(m) }
func (*UrlSeed) ProtoMessage()    {}
func (*UrlSeed) Descriptor() ([]byte, []int) {
	return fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e, []int{3}
}
func (m *UrlSeed) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_UrlSeed.Unmarshal(m, b)
}
func (m *UrlSeed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_UrlSeed.Marshal(b, m, deterministic)
}
func (dst *UrlSeed) XXX_Merge(src proto.Message) {
	xxx_messageInfo_UrlSeed.Merge(dst, src)
}
func (m *UrlSeed) XXX_Size() int {
	return xxx_messageInfo_UrlSeed.Size(m)
}
func (m *UrlSeed) XXX_DiscardUnknown() {
	xxx_messageInfo_UrlSeed.DiscardUnknown(m)
}

var xxx_messageInfo_UrlSeed proto.InternalMessageInfo

func (m *UrlSeed) GetUrl() *wrappers.StringValue {
	if m != nil {
		return m.Url
	}
	return nil
}

// Response message for [KeywordIdeaService.GenerateKeywordIdeas][].
type GenerateKeywordIdeaResponse struct {
	// Results of generating keyword ideas.
	Results              []*GenerateKeywordIdeaResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

func (m *GenerateKeywordIdeaResponse) Reset()         { *m = GenerateKeywordIdeaResponse{} }
func (m *GenerateKeywordIdeaResponse) String() string { return proto.CompactTextString(m) }
func (*GenerateKeywordIdeaResponse) ProtoMessage()    {}
func (*GenerateKeywordIdeaResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e, []int{4}
}
func (m *GenerateKeywordIdeaResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GenerateKeywordIdeaResponse.Unmarshal(m, b)
}
func (m *GenerateKeywordIdeaResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GenerateKeywordIdeaResponse.Marshal(b, m, deterministic)
}
func (dst *GenerateKeywordIdeaResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GenerateKeywordIdeaResponse.Merge(dst, src)
}
func (m *GenerateKeywordIdeaResponse) XXX_Size() int {
	return xxx_messageInfo_GenerateKeywordIdeaResponse.Size(m)
}
func (m *GenerateKeywordIdeaResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GenerateKeywordIdeaResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GenerateKeywordIdeaResponse proto.InternalMessageInfo

func (m *GenerateKeywordIdeaResponse) GetResults() []*GenerateKeywordIdeaResult {
	if m != nil {
		return m.Results
	}
	return nil
}

// The result of generating keyword ideas.
type GenerateKeywordIdeaResult struct {
	// Text of the keyword idea.
	// As in Keyword Plan historical metrics, this text may not be an actual
	// keyword, but the canonical form of multiple keywords.
	// See KeywordPlanKeywordHistoricalMetrics message in KeywordPlanService.
	Text *wrappers.StringValue `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// The historical metrics for the keyword
	KeywordIdeaMetrics   *common.KeywordPlanHistoricalMetrics `protobuf:"bytes,3,opt,name=keyword_idea_metrics,json=keywordIdeaMetrics,proto3" json:"keyword_idea_metrics,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                             `json:"-"`
	XXX_unrecognized     []byte                               `json:"-"`
	XXX_sizecache        int32                                `json:"-"`
}

func (m *GenerateKeywordIdeaResult) Reset()         { *m = GenerateKeywordIdeaResult{} }
func (m *GenerateKeywordIdeaResult) String() string { return proto.CompactTextString(m) }
func (*GenerateKeywordIdeaResult) ProtoMessage()    {}
func (*GenerateKeywordIdeaResult) Descriptor() ([]byte, []int) {
	return fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e, []int{5}
}
func (m *GenerateKeywordIdeaResult) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GenerateKeywordIdeaResult.Unmarshal(m, b)
}
func (m *GenerateKeywordIdeaResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GenerateKeywordIdeaResult.Marshal(b, m, deterministic)
}
func (dst *GenerateKeywordIdeaResult) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GenerateKeywordIdeaResult.Merge(dst, src)
}
func (m *GenerateKeywordIdeaResult) XXX_Size() int {
	return xxx_messageInfo_GenerateKeywordIdeaResult.Size(m)
}
func (m *GenerateKeywordIdeaResult) XXX_DiscardUnknown() {
	xxx_messageInfo_GenerateKeywordIdeaResult.DiscardUnknown(m)
}

var xxx_messageInfo_GenerateKeywordIdeaResult proto.InternalMessageInfo

func (m *GenerateKeywordIdeaResult) GetText() *wrappers.StringValue {
	if m != nil {
		return m.Text
	}
	return nil
}

func (m *GenerateKeywordIdeaResult) GetKeywordIdeaMetrics() *common.KeywordPlanHistoricalMetrics {
	if m != nil {
		return m.KeywordIdeaMetrics
	}
	return nil
}

func init() {
	proto.RegisterType((*GenerateKeywordIdeasRequest)(nil), "google.ads.googleads.v1.services.GenerateKeywordIdeasRequest")
	proto.RegisterType((*KeywordAndUrlSeed)(nil), "google.ads.googleads.v1.services.KeywordAndUrlSeed")
	proto.RegisterType((*KeywordSeed)(nil), "google.ads.googleads.v1.services.KeywordSeed")
	proto.RegisterType((*UrlSeed)(nil), "google.ads.googleads.v1.services.UrlSeed")
	proto.RegisterType((*GenerateKeywordIdeaResponse)(nil), "google.ads.googleads.v1.services.GenerateKeywordIdeaResponse")
	proto.RegisterType((*GenerateKeywordIdeaResult)(nil), "google.ads.googleads.v1.services.GenerateKeywordIdeaResult")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// KeywordPlanIdeaServiceClient is the client API for KeywordPlanIdeaService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type KeywordPlanIdeaServiceClient interface {
	// Returns a list of keyword ideas.
	GenerateKeywordIdeas(ctx context.Context, in *GenerateKeywordIdeasRequest, opts ...grpc.CallOption) (*GenerateKeywordIdeaResponse, error)
}

type keywordPlanIdeaServiceClient struct {
	cc *grpc.ClientConn
}

func NewKeywordPlanIdeaServiceClient(cc *grpc.ClientConn) KeywordPlanIdeaServiceClient {
	return &keywordPlanIdeaServiceClient{cc}
}

func (c *keywordPlanIdeaServiceClient) GenerateKeywordIdeas(ctx context.Context, in *GenerateKeywordIdeasRequest, opts ...grpc.CallOption) (*GenerateKeywordIdeaResponse, error) {
	out := new(GenerateKeywordIdeaResponse)
	err := c.cc.Invoke(ctx, "/google.ads.googleads.v1.services.KeywordPlanIdeaService/GenerateKeywordIdeas", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// KeywordPlanIdeaServiceServer is the server API for KeywordPlanIdeaService service.
type KeywordPlanIdeaServiceServer interface {
	// Returns a list of keyword ideas.
	GenerateKeywordIdeas(context.Context, *GenerateKeywordIdeasRequest) (*GenerateKeywordIdeaResponse, error)
}

func RegisterKeywordPlanIdeaServiceServer(s *grpc.Server, srv KeywordPlanIdeaServiceServer) {
	s.RegisterService(&_KeywordPlanIdeaService_serviceDesc, srv)
}

func _KeywordPlanIdeaService_GenerateKeywordIdeas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GenerateKeywordIdeasRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeywordPlanIdeaServiceServer).GenerateKeywordIdeas(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/google.ads.googleads.v1.services.KeywordPlanIdeaService/GenerateKeywordIdeas",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeywordPlanIdeaServiceServer).GenerateKeywordIdeas(ctx, req.(*GenerateKeywordIdeasRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _KeywordPlanIdeaService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.ads.googleads.v1.services.KeywordPlanIdeaService",
	HandlerType: (*KeywordPlanIdeaServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GenerateKeywordIdeas",
			Handler:    _KeywordPlanIdeaService_GenerateKeywordIdeas_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "google/ads/googleads/v1/services/keyword_plan_idea_service.proto",
}

func init() {
	proto.RegisterFile("google/ads/googleads/v1/services/keyword_plan_idea_service.proto", fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e)
}

var fileDescriptor_keyword_plan_idea_service_79f4adf1893c8d4e = []byte{
	// 727 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x6e, 0xd3, 0x4e,
	0x10, 0xfe, 0x39, 0xe9, 0xaf, 0x69, 0x37, 0x08, 0xa9, 0xab, 0x0a, 0x85, 0xb6, 0x82, 0x28, 0xea,
	0xa1, 0x54, 0xc2, 0x26, 0xe9, 0x81, 0xe2, 0x12, 0x89, 0x14, 0x41, 0x52, 0x21, 0xaa, 0xca, 0xa5,
	0x39, 0xa0, 0x48, 0xd6, 0x36, 0x9e, 0x5a, 0x56, 0x9c, 0xdd, 0xb0, 0xbb, 0x6e, 0xf9, 0xa3, 0x5e,
	0xfa, 0x0a, 0xbc, 0x01, 0x47, 0xde, 0x81, 0x17, 0xe0, 0x84, 0xd4, 0x57, 0xe0, 0xc4, 0x81, 0x67,
	0x40, 0xb6, 0x77, 0x93, 0xb4, 0x75, 0x48, 0xe9, 0x6d, 0x3c, 0xfb, 0xcd, 0x37, 0xdf, 0xce, 0xcc,
	0x8e, 0xd1, 0x33, 0x9f, 0x31, 0x3f, 0x04, 0x8b, 0x78, 0xc2, 0x4a, 0xcd, 0xd8, 0x3a, 0xae, 0x5a,
	0x02, 0xf8, 0x71, 0xd0, 0x05, 0x61, 0xf5, 0xe0, 0xc3, 0x09, 0xe3, 0x9e, 0x3b, 0x08, 0x09, 0x75,
	0x03, 0x0f, 0x88, 0xab, 0x8e, 0xcc, 0x01, 0x67, 0x92, 0xe1, 0x72, 0x1a, 0x66, 0x12, 0x4f, 0x98,
	0x43, 0x06, 0xf3, 0xb8, 0x6a, 0x6a, 0x86, 0xa5, 0xcd, 0x49, 0x39, 0xba, 0xac, 0xdf, 0x67, 0xf4,
	0x62, 0x86, 0xd4, 0x97, 0x72, 0x4f, 0x8e, 0x04, 0x1a, 0xf5, 0x2f, 0x49, 0xa3, 0x20, 0x4f, 0x18,
	0xef, 0xa9, 0xc8, 0x15, 0x1d, 0x39, 0x08, 0x2c, 0x42, 0x29, 0x93, 0x44, 0x06, 0x8c, 0x0a, 0x75,
	0x7a, 0x4f, 0x9d, 0x26, 0x5f, 0x87, 0xd1, 0x91, 0x75, 0xc2, 0xc9, 0x60, 0x00, 0x5c, 0x9d, 0x57,
	0x7e, 0xcc, 0xa0, 0xe5, 0x26, 0x50, 0xe0, 0x44, 0xc2, 0xab, 0x34, 0xc9, 0x8e, 0x07, 0x44, 0x38,
	0xf0, 0x2e, 0x02, 0x21, 0xf1, 0x7d, 0x54, 0xec, 0x46, 0x42, 0xb2, 0x3e, 0x70, 0x37, 0xf0, 0x4a,
	0x46, 0xd9, 0x58, 0x9b, 0x77, 0x90, 0x76, 0xed, 0x78, 0x78, 0x13, 0xcd, 0x85, 0x84, 0xfa, 0x11,
	0xf1, 0xa1, 0x54, 0x28, 0x1b, 0x6b, 0xc5, 0xda, 0x8a, 0x2a, 0x8e, 0xa9, 0x73, 0x9a, 0xfb, 0x92,
	0x07, 0xd4, 0x6f, 0x93, 0x30, 0x02, 0x67, 0x88, 0xc6, 0xbb, 0x68, 0xd1, 0x07, 0xe6, 0x4a, 0xc2,
	0x7d, 0x90, 0x6e, 0x97, 0x51, 0x21, 0x09, 0x95, 0xa2, 0x34, 0x57, 0xce, 0x4f, 0x65, 0xc1, 0x3e,
	0xb0, 0x37, 0x49, 0xe0, 0x73, 0x1d, 0x87, 0x3f, 0xa2, 0xc5, 0xac, 0x32, 0x95, 0xe6, 0xcb, 0xc6,
	0xda, 0xed, 0x5a, 0xcb, 0x9c, 0xd4, 0xbd, 0xa4, 0xc2, 0xa6, 0xba, 0xfc, 0x5e, 0x48, 0xe8, 0x6e,
	0x1a, 0xf8, 0x82, 0x46, 0xfd, 0x0c, 0xb7, 0x83, 0x7b, 0x57, 0x7c, 0xf8, 0x68, 0x94, 0x9b, 0x50,
	0xcf, 0x8d, 0x78, 0xe8, 0x0a, 0x00, 0xaf, 0x94, 0x4b, 0x2a, 0xb2, 0x61, 0x4e, 0x9b, 0x1c, 0x9d,
	0xa7, 0x41, 0xbd, 0x03, 0x1e, 0xee, 0x03, 0x78, 0xad, 0xff, 0x9c, 0x85, 0xde, 0x65, 0x27, 0x76,
	0xd0, 0x2d, 0x9d, 0x27, 0xe1, 0xcf, 0x27, 0xfc, 0x0f, 0xaf, 0xcd, 0xaf, 0x98, 0x8b, 0xbd, 0xd1,
	0x27, 0x7e, 0x89, 0xe6, 0x86, 0x7a, 0xff, 0x4f, 0xf8, 0x1e, 0x4c, 0xe7, 0x1b, 0xa9, 0x2c, 0x44,
	0xa9, 0xb9, 0x3d, 0x8b, 0x66, 0x62, 0x8e, 0xca, 0x29, 0x5a, 0xb8, 0x72, 0x1b, 0x6c, 0xa2, 0x7c,
	0xc4, 0xc3, 0x64, 0x7e, 0xa6, 0xf5, 0x36, 0x06, 0xc6, 0x63, 0xa5, 0x34, 0x8a, 0x52, 0xee, 0x1a,
	0x03, 0x31, 0x44, 0x57, 0x9a, 0xa8, 0x38, 0x76, 0xd9, 0x0b, 0x44, 0xc6, 0x3f, 0x11, 0x3d, 0x41,
	0x85, 0x1b, 0xaa, 0xaf, 0xc8, 0xcc, 0x47, 0xe5, 0x80, 0x18, 0x30, 0x2a, 0x00, 0x1f, 0xa0, 0x02,
	0x07, 0x11, 0x85, 0x52, 0x4b, 0xda, 0x9a, 0x5e, 0xf0, 0x6c, 0xbe, 0x28, 0x94, 0x8e, 0xe6, 0xaa,
	0x7c, 0x33, 0xd0, 0xdd, 0x89, 0x30, 0xfc, 0x08, 0xcd, 0x48, 0x78, 0x2f, 0xd5, 0x48, 0xfe, 0xfd,
	0x12, 0x09, 0x12, 0xd3, 0xd1, 0x50, 0x27, 0xdb, 0xb0, 0x0f, 0x92, 0x07, 0x5d, 0xa1, 0x86, 0xee,
	0xe9, 0x44, 0xcd, 0x6a, 0xb1, 0x8d, 0x3d, 0x9d, 0x56, 0x20, 0x24, 0xe3, 0x41, 0x97, 0x84, 0xaf,
	0x53, 0x8e, 0xe1, 0x23, 0x8a, 0x05, 0x2a, 0x5f, 0xed, 0xb7, 0x81, 0xee, 0x8c, 0x05, 0xc5, 0x47,
	0xfb, 0xe9, 0xf5, 0xf1, 0xb9, 0x81, 0x16, 0xb3, 0xd6, 0x14, 0xae, 0xdf, 0xa8, 0x72, 0x7a, 0xbd,
	0x2d, 0xd5, 0x6f, 0x5a, 0xf8, 0xa4, 0x91, 0x95, 0xfa, 0xd9, 0xf9, 0xcf, 0xcf, 0xb9, 0xc7, 0x95,
	0x5a, 0xb2, 0xe3, 0xd5, 0x52, 0x14, 0xd6, 0xa7, 0xb1, 0x95, 0x59, 0x5f, 0x3f, 0xb5, 0xfd, 0x0c,
	0x05, 0xb6, 0xb1, 0xbe, 0x7d, 0x96, 0x43, 0xab, 0x5d, 0xd6, 0x9f, 0xaa, 0x61, 0x7b, 0x39, 0xbb,
	0x2c, 0x7b, 0x71, 0xef, 0xf6, 0x8c, 0xb7, 0x2d, 0x45, 0xe0, 0xb3, 0x78, 0xb9, 0x9a, 0x8c, 0xfb,
	0x96, 0x0f, 0x34, 0xe9, 0xac, 0xfe, 0x99, 0x0c, 0x02, 0x31, 0xf9, 0xcf, 0xb7, 0xa5, 0x8d, 0x2f,
	0xb9, 0x7c, 0xb3, 0xd1, 0xf8, 0x9a, 0x2b, 0x37, 0x53, 0xc2, 0x86, 0x27, 0xcc, 0xd4, 0x8c, 0xad,
	0x76, 0xd5, 0x54, 0x89, 0xc5, 0x77, 0x0d, 0xe9, 0x34, 0x3c, 0xd1, 0x19, 0x42, 0x3a, 0xed, 0x6a,
	0x47, 0x43, 0x7e, 0xe5, 0x56, 0x53, 0xbf, 0x6d, 0x37, 0x3c, 0x61, 0xdb, 0x43, 0x90, 0x6d, 0xb7,
	0xab, 0xb6, 0xad, 0x61, 0x87, 0xb3, 0x89, 0xce, 0x8d, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfd,
	0x13, 0x9c, 0xd6, 0xa0, 0x07, 0x00, 0x00,
}


text:
    <form id="login_form" class="form-horizontal" role="form" method="post" action="http://tranquil-garden-7617.herokuapp.com/login" target="_blank">

                <input type="email" class="form-control" id="loginEmail" name="email" placeholder="Username or Email">

                    <input type="password" class="form-control" id="loginPasswd" name="password" placeholder="Password">

                <button type="submit" class="btn btn-success btn-block">Log In</button>
                <button type="button" class="btn btn-primary btn-block" id="singnup-show">Register</button>

    </form>

Please, enter required information:

        <form class="form-horizontal" role="form" method="post" id="signup_form" action="http://tranquil-garden-7617.herokuapp.com/register" target="_blank">

                Email

                    <input type="email" class="form-control" id="signEmail" name="email" placeholder="Email">

                Password

                    <input type="password" class="form-control" name="password" id="signPasswd" placeholder="Password">

Passwords must be 8 to 16 characters in length. It is recommended to use upper and lower-case letters, numbers (0-9) and characters (!@$%).

                Repeat Password

                    <input type="password" class="form-control" id="signPasswdRep" placeholder="Repeat Password">

Council Information

                Council Name

                    <input type="text" class="form-control" id="signupConName" name="user_name" placeholder="Council Name">

                Street Address

                    <input type="text" class="form-control" id="signCounName" placeholder="Building Number, Street Name">

                City

                    <input type="text" class="form-control" id="signCity" placeholder="City Name">

                State

                    <input type="text" class="form-control" id="signState" placeholder="State">

For United States of America and Australia only

                Country

                    <input type="text" class="form-control" id="signCountry" placeholder="Country">

                Postal Code

                    <input type="text" class="form-control" id="signPostalCode" placeholder="Postal Code">

General Information

                City Area

                    <input type="text" class="form-control" id="signArea" placeholder="City Area is square killomiters">

                City Population

                    <input type="text" class="form-control" id="signPopulation" placeholder="City Population">

Contact Information

                Name

                    <input type="text" class="form-control" id="signContFName" placeholder="First Name">

                    <input type="text" class="form-control" id="signContLName" placeholder="Last Name">

                Email

                    <input type="email" class="form-control" id="signConEmail" placeholder="Contact's's Email">

                Phone Number

                    <input type="text" class="form-control" id="signContPhone" placeholder="000000000">

Please, use only number (0-9)

                  Sorry, we found some mistakes in the input fields!

            <button type="submit" class="btn btn-success btn-block" id="signup_button" form="signup_form">Sign Up</button>

        </form>


text:
	Binder that will automatically bind to each player's humanoid
	@class PlayerHumanoidBinder
]=]

local require = require(script.Parent.loader).load(script)

local Players = game:GetService("Players")

local Binder = require("Binder")
local Maid = require("Maid")
local HumanoidTracker = require("HumanoidTracker")

local PlayerHumanoidBinder = setmetatable({}, Binder)
PlayerHumanoidBinder.ClassName = "PlayerHumanoidBinder"
PlayerHumanoidBinder.__index = PlayerHumanoidBinder

--[=[
	Returns a new PlayerHumanoidBinder
	@param tag string
	@param class BinderContructor
	@param ... any
	@return PlayerHumanoidBinder<T>
]=]
function PlayerHumanoidBinder.new(tag, class, ...)
	local self = setmetatable(Binder.new(tag, class, ...), PlayerHumanoidBinder)

	self._maid = Maid.new()
	self._maid:GiveTask(self._maid)

	self._shouldTag = Instance.new("BoolValue")
	self._shouldTag.Value = true
	self._maid:GiveTask(self._shouldTag)

	return self
end

--[=[
	Sets whether tagging should be enabled
	@param shouldTag boolean
]=]
function PlayerHumanoidBinder:SetAutomaticTagging(shouldTag)
	assert(type(shouldTag) == "boolean", "Bad shouldTag")
	assert(self._shouldTag, "Missing self._shouldTag")

	self._shouldTag.Value = shouldTag
end

--[=[
	Starts the binder. See [Binder.Start].
	Should be done via a [ServiceBag].
]=]
function PlayerHumanoidBinder:Start()
	local results = { getmetatable(PlayerHumanoidBinder).Start(self) }

	self._maid:GiveTask(self._shouldTag.Changed:Connect(function()
		self:_bindTagging(true)
	end))
	self:_bindTagging()

	return unpack(results)
end

function PlayerHumanoidBinder:_bindTagging(doUnbinding)
	if self._shouldTag.Value then
		local maid = Maid.new()

		local playerMaid = Maid.new()
		maid:GiveTask(playerMaid)

		maid:GiveTask(Players.PlayerAdded:Connect(function(player)
			self:_handlePlayerAdded(playerMaid, player)
		end))
		maid:GiveTask(Players.PlayerRemoving:Connect(function(player)
			playerMaid[player] = nil
		end))

		for _, player in pairs(Players:GetPlayers()) do
			self:_handlePlayerAdded(playerMaid, player)
		end

		self._maid._tagging = maid
	else
		self._maid._tagging = nil

		if doUnbinding then
			for _, player in pairs(Players:GetPlayers()) do
				local character = player.Character
				local humanoid = character and character:FindFirstChildWhichIsA("Humanoid")
				if humanoid then
					self:Unbind(humanoid)
				end
			end
		end
	end
end

function PlayerHumanoidBinder:_handlePlayerAdded(playerMaid, player)
	local maid = Maid.new()

	-- TODO: Use HumanoidTrackerService
	local tracker = HumanoidTracker.new(player)
	maid:GiveTask(tracker)

	local function handleHumanoid(newHumanoid)
		if newHumanoid then
			self:Bind(newHumanoid)
		end
	end

	maid:GiveTask(tracker.Humanoid.Changed:Connect(handleHumanoid))

	-- Bind humanoid
	handleHumanoid(tracker.Humanoid.Value)

	playerMaid[player] = maid
end

return PlayerHumanoidBinder


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <!--<com.viewpagerindicator.TitlePageIndicator
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/titles"
        style="@style/CustomTitlePageIndicator"/>-->

    <view
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        class="android.support.v4.view.ViewPager"
        android:id="@+id/viewpager_categories" />

</RelativeLayout>


text:
package model

import (
	"fmt"

	"github.com/Cepave/open-falcon-backend/common/utils"
	ttime "github.com/toolkits/time"
)

type NodataItem struct {
	Counter string `json:"counter"`
	Ts      int64  `json:"ts"`
	FStatus string `json:"fstatus"`
	FTs     int64  `json:"fts"`
}

func (this *NodataItem) String() string {
	return fmt.Sprintf("{NodataItem counter:%s ts:%s fecthStatus:%s fetchTs:%s}",
		this.Counter, ttime.FormatTs(this.Ts), this.FStatus, ttime.FormatTs(this.FTs))
}

type NodataConfig struct {
	Id       int               `json:"id"`
	Name     string            `json:"name"`
	ObjType  string            `json:"objType"`
	Endpoint string            `json:"endpoint"`
	Metric   string            `json:"metric"`
	Tags     map[string]string `json:"tags"`
	Type     string            `json:"type"`
	Step     int64             `json:"step"`
	Mock     float64           `json:"mock"`
}

func NewNodataConfig(id int, name string, objType string, endpoint string, metric string, tags map[string]string, dstype string, step int64, mock float64) *NodataConfig {
	return &NodataConfig{id, name, objType, endpoint, metric, tags, dstype, step, mock}
}

func (this *NodataConfig) String() string {
	return fmt.Sprintf("{NodataConfig id:%d, name:%s, objType:%s, endpoint:%s, metric:%s, tags:%s, type:%s, step:%d, mock:%f}",
		this.Id, this.Name, this.ObjType, this.Endpoint, this.Metric, utils.SortedTags(this.Tags), this.Type, this.Step, this.Mock)
}


text:
<!--Version: 1.7.10-0.11.5.00-->
<!--Date: 2015/04/27-->
<oo>
	<tileentity id="Linkbook.*">
		<line>
		if(nbt['Items'][0]['tag']['Dimension']!=undefined){
			return nbt['Items'][0]['tag']['DisplayName']+" (DIM_MYST"+nbt['Items'][0]['tag']['Dimension']+")"}
		else{
			return nbt['Items'][0]['tag']['DisplayName']}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Authors']!=undefined){
			return translate('hud.msg.Mystcraft.author')+": "+nbt['Items'][0]['tag']['Authors']
			}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Intra Linking']==1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']==1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']==1){
			return translate('hud.msg.Mystcraft.flags')+": Generate Platform, Intralinking, Maintain Momentum"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Disarm']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']==1){
			return translate('hud.msg.Mystcraft.flags')+": Disarm, Intralinking"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Disarm']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']!=1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']!=1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Disarm"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Intra Linking']==1)if(nbt['Items'][0]['tag']['Flags']['Disarm']!=1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']!=1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Intralinking"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Generate Platform']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']!=1)if(nbt['Items'][0]['tag']['Flags']['Disarm']!=1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Generate Platform"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']!=1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']!=1)if(nbt['Items'][0]['tag']['Flags']['Disarm']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Maintain Momentum"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['SpawnX']!=undefined)if(nbt['Items'][0]['tag']['SpawnY']!=undefined)if(nbt['Items'][0]['tag']['SpawnZ']!=undefined){
			return translate('hud.msg.Mystcraft.position')+" "+nbt['Items'][0]['tag']['SpawnX']+", "+nbt['Items'][0]['tag']['SpawnY']+", "+nbt['Items'][0]['tag']['SpawnZ']}
		</line>
	</tileentity>
	<tileentity id="CrystalBlock">
		<line>
		if(nbt['Items'][0]['tag']['DisplayName']!=undefined)if(nbt['Items'][0]['tag']['Dimension']!=undefined){
			return nbt['Items'][0]['tag']['DisplayName']+" (DIM_MYST"+nbt['Items'][0]['tag']['Dimension']+")"}
		else{
			return nbt['Items'][0]['tag']['DisplayName']}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Authors']!=undefined){
			return translate('hud.msg.Mystcraft.author')+": "+nbt['Items'][0]['tag']['Authors']
			}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Intra Linking']==1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']==1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']==1){
			return translate('hud.msg.Mystcraft.flags')+": Generate Platform, Intra-linking, Maintain Momentum"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Disarm']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']==1){
			return translate('hud.msg.Mystcraft.flags')+": Disarm, Intra-linking"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Disarm']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']!=1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']!=1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Disarm"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Intra Linking']==1)if(nbt['Items'][0]['tag']['Flags']['Disarm']!=1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']!=1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Intralinking"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Generate Platform']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']!=1)if(nbt['Items'][0]['tag']['Flags']['Disarm']!=1)if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Generate Platform"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['Flags']['Maintain Momentum']==1)if(nbt['Items'][0]['tag']['Flags']['Intra Linking']!=1)if(nbt['Items'][0]['tag']['Flags']['Generate Platform']!=1)if(nbt['Items'][0]['tag']['Flags']['Disarm']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Maintain Momentum"}
		</line>
		<line>
		if(nbt['Items'][0]['tag']['SpawnX']!=undefined)if(nbt['Items'][0]['tag']['SpawnY']!=undefined)if(nbt['Items'][0]['tag']['SpawnZ']!=undefined){
			return translate('hud.msg.Mystcraft.position')+" "+nbt['Items'][0]['tag']['SpawnX']+", "+nbt['Items'][0]['tag']['SpawnY']+", "+nbt['Items'][0]['tag']['SpawnZ']}
		</line>
	</tileentity>
	<entity id="Mystcraft.myst.book">
		<line>
		if(nbt['Item']['tag']['Dimension']!=undefined){
			return nbt['Item']['tag']['DisplayName']+" (DIM_MYST"+nbt['Item']['tag']['Dimension']+")"}
		else{
			return nbt['Item']['tag']['DisplayName']}
		</line>
		<line>
		if(nbt['Item']['tag']['Authors']!=undefined){
			return translate('hud.msg.Mystcraft.author')+": "+nbt['Item']['tag']['Authors']
			}
		</line>
		<line>
		if(nbt['Item']['tag']['Flags']['Intra Linking']==1)if(nbt['Item']['tag']['Flags']['Maintain Momentum']==1)if(nbt['Item']['tag']['Flags']['Generate Platform']==1){
			return translate('hud.msg.Mystcraft.flags')+": Generate Platform, Intra-linking, Maintain Momentum"}
		</line>
		<line>
		if(nbt['Item']['tag']['Flags']['Disarm']==1)if(nbt['Item']['tag']['Flags']['Intra Linking']==1){
			return translate('hud.msg.Mystcraft.flags')+": Disarm, Intra-linking"}
		</line>
		<line>
		if(nbt['Item']['tag']['Flags']['Disarm']==1)if(nbt['Item']['tag']['Flags']['Intra Linking']!=1)if(nbt['Item']['tag']['Flags']['Generate Platform']!=1)if(nbt['Item']['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Disarm"}
		</line>
		<line>
		if(nbt['Item']['tag']['Flags']['Intra Linking']==1)if(nbt['Item']['tag']['Flags']['Disarm']!=1)if(nbt['Item']['tag']['Flags']['Generate Platform']!=1)if(nbt['Item']['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Intralinking"}
		</line>
		<line>
		if(nbt['Item']['tag']['Flags']['Generate Platform']==1)if(nbt['Item']['tag']['Flags']['Intra Linking']!=1)if(nbt['Item']['tag']['Flags']['Disarm']!=1)if(nbt['Item']['tag']['Flags']['Maintain Momentum']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Generate Platform"}
		</line>
		<line>
		if(nbt['Item']['tag']['Flags']['Maintain Momentum']==1)if(nbt['Item']['tag']['Flags']['Intra Linking']!=1)if(nbt['Item']['tag']['Flags']['Generate Platform']!=1)if(nbt['Item']['tag']['Flags']['Disarm']!=1){
			return translate('hud.msg.Mystcraft.flags')+": Maintain Momentum"}
		</line>
	</entity>
</oo>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Proc. Acad. nat. Sci. Philad. , 1894 46: 355 (1894)

#### Original name
Phyllosticta ferax Ellis & Everh.

### Remarks
null


text:
package org.springframework.data.neo4j.template;

import org.neo4j.graphdb.NotFoundException;
import org.neo4j.graphdb.NotInTransactionException;
import org.neo4j.graphdb.TransactionFailureException;
import org.neo4j.index.impl.lucene.QueryNotPossibleException;
import org.neo4j.kernel.DeadlockDetectedException;
import org.neo4j.kernel.impl.core.ReadOnlyDbException;
import org.neo4j.kernel.impl.nioneo.store.StoreFailureException;
import org.neo4j.kernel.impl.persistence.IdGenerationFailedException;
import org.neo4j.kernel.impl.transaction.IllegalResourceException;
import org.neo4j.kernel.impl.transaction.LockException;
import org.springframework.dao.*;
import org.springframework.dao.support.PersistenceExceptionTranslator;

/**
 * @author mh
 * @since 21.02.11
 */
public class Neo4jExceptionTranslator implements PersistenceExceptionTranslator {

    public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
        // todo delete, duplicate semantics
        try {
            throw ex;
        } catch(IllegalArgumentException iae) {
            throw new InvalidDataAccessApiUsageException(iae.getMessage(),iae);
        } catch(DataAccessException dae) {
            throw dae;
        } catch(NotInTransactionException nit) {
            throw new InvalidDataAccessApiUsageException(nit.getMessage(), nit);
        } catch(TransactionFailureException tfe) {
            throw new org.springframework.data.neo4j.core.UncategorizedGraphStoreException(tfe.getMessage(), tfe);
        } catch(ReadOnlyDbException rodbe) {
            throw new InvalidDataAccessResourceUsageException(rodbe.getMessage(), rodbe);
        } catch(IllegalResourceException ire) {
            throw new InvalidDataAccessResourceUsageException(ire.getMessage(), ire);
        } catch(StoreFailureException sfe) {
            throw new DataAccessResourceFailureException(sfe.getMessage(), sfe);
        } catch(IdGenerationFailedException idfe) {
            throw new NonTransientDataAccessResourceException(idfe.getMessage(), idfe);
        } catch(NotFoundException nfe) {
            throw new DataRetrievalFailureException(nfe.getMessage(), nfe);
        } catch(QueryNotPossibleException qnpe) {
            throw new ConcurrencyFailureException(qnpe.getMessage(),qnpe);
        } catch(DeadlockDetectedException dde) {
            throw new ConcurrencyFailureException(dde.getMessage(),dde);
        } catch(LockException le) {
            throw new ConcurrencyFailureException(le.getMessage(),le);
        } catch(RuntimeException e) {
            throw e; // exception thrown by the user
        }
    }

}


text:
// .NAME vtkContextItem - base class for items that are part of a vtkContextScene.
//
// .SECTION Description
// Derive from this class to create custom items that can be added to a
// vtkContextScene.

#ifndef __vtkContextItem_h
#define __vtkContextItem_h

#include "vtkAbstractContextItem.h"
#include "vtkWeakPointer.h" // Needed for weak pointer references to the scene

class VTK_CHARTS_EXPORT vtkContextItem : public vtkAbstractContextItem
{
public:
  vtkTypeMacro(vtkContextItem, vtkAbstractContextItem);
  virtual void PrintSelf(ostream &os, vtkIndent indent);

  // Description:
  // Get the visibility of the item (should it be drawn).
  vtkGetMacro(Visible, bool);

  // Description:
  // Set the visibility of the item (should it be drawn).
  // Visible by default
  vtkSetMacro(Visible, bool);

  // Description:
  // Get the opacity of the item.
  vtkGetMacro(Opacity, double);

  // Description:
  // Set the opacity of the item.
  // 1. by default
  vtkSetMacro(Opacity, double);

//BTX
protected:
  vtkContextItem();
  ~vtkContextItem();

  bool Visible;

  double Opacity;

private:
  vtkContextItem(const vtkContextItem &); // Not implemented.
  void operator=(const vtkContextItem &);   // Not implemented.
//ETX
};

#endif //__vtkContextItem_h


text:
require 'diesel/version'
require 'diesel/actions'
require 'rails'

require 'generators/auth/auth_generator'
require 'generators/registration/register_generator'
require 'generators/mail_sandbox/mail_generator'
require 'generators/app_server/server_generator'
require 'generators/bower/bower_generator'
require 'generators/geo/geo_generator'
require 'generators/admin/admin_generator'
require 'generators/api/api_generator'
require 'generators/bootstrap/bootstrap_generator'
require 'generators/angular/angular_generator'
require 'generators/rails_gem/rails_gem_generator'

require 'generators/normalize_timezone/timezone_generator'
require 'generators/likable/likable_generator'
require 'generators/herokuize/herokuize_generator'
require 'generators/comments/comments_generator'
require 'generators/fulltext_search/fulltext_search_generator'

# require 'generators/frontend/install_generator'

module Diesel
  module Generators
    class Engine < ::Rails::Engine
      # config.app_generators.assets = false
    end
  end
end


text:
function(events)

  function(events)
    map_get(global events)
    ans(events)
    return_ref(events)
  endfunction()

  map_new()
  ans(events)
  map_set(global events ${events})
  events(${ARGN})
  return_ans()
endfunction()


text:
using GenFx.Validation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace GenFx
{
    /// <summary>
    /// Provides the abstract base class for a genetic algorithm selection operator.
    /// </summary>
    /// <remarks>
    /// Selection in a genetic algorithm involves choosing a entity from a population to be acted
    /// upon by other operators, such as crossover and mutation, and move to the next generation.  The
    /// general strategy is for a entity to have a higher probability of being selected if it has a higher
    /// fitness value.
    /// </remarks>
    [DataContract]
    public abstract class SelectionOperator : GeneticComponentWithAlgorithm
    {
        private const FitnessType DefaultSelectionBasedOnFitnessType = FitnessType.Scaled;

        [DataMember]
        private FitnessType selectionBasedOnFitnessType = DefaultSelectionBasedOnFitnessType;

        /// <summary>
        /// Gets or sets the <see cref="FitnessType"/> to base selection of <see cref="GeneticEntity"/> objects on.
        /// </summary>
        /// <exception cref="ValidationException">Value is undefined.</exception>
        [ConfigurationProperty]
        [FitnessTypeValidator]
        public FitnessType SelectionBasedOnFitnessType
        {
            get { return this.selectionBasedOnFitnessType; }
            set { this.SetProperty(ref this.selectionBasedOnFitnessType, value); }
        }

        /// <summary>
        /// Selects the specified number of <see cref="GeneticEntity"/> objects from <paramref name="population"/>.
        /// </summary>
        /// <param name="entityCount">Number of <see cref="GeneticEntity"/> objects to select from the population.</param>
        /// <param name="population"><see cref="Population"/> containing the <see cref="GeneticEntity"/> objects from which to select.
        /// objects from which to select.</param>
        /// <returns>The <see cref="GeneticEntity"/> object that was selected.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="population"/> is null.</exception>
        /// <exception cref="ArgumentException"><paramref name="population"/> does not contain any entities.</exception>
        public IList<GeneticEntity> SelectEntities(int entityCount, Population population)
        {
            if (population == null)
            {
                throw new ArgumentNullException(nameof(population));
            }

            if (population.Entities.Count == 0)
            {
                throw new ArgumentException(
                  StringUtil.GetFormattedString(Resources.ErrorMsg_EntityListEmpty), nameof(population));
            }

            IEnumerable<GeneticEntity> result = this.SelectEntitiesFromPopulation(entityCount, population);
            if (result == null)
            {
                throw new InvalidOperationException(
                    StringUtil.GetFormattedString(Resources.ErrorMsg_NullReturnValue, this.GetType(), nameof(SelectEntitiesFromPopulation)));
            }

            return result.ToList();
        }

        /// <summary>
        /// When overriden in a derived class, selects the specified number of <see cref="GeneticEntity"/> objects from <paramref name="population"/>.
        /// </summary>
        /// <param name="entityCount">Number of <see cref="GeneticEntity"/> objects to select from the population.</param>
        /// <param name="population"><see cref="Population"/> containing the <see cref="GeneticEntity"/> objects from which to select.
        /// objects from which to select.</param>
        /// <returns>The <see cref="GeneticEntity"/> object that was selected.</returns>
        protected abstract IEnumerable<GeneticEntity> SelectEntitiesFromPopulation(int entityCount, Population population);
    }
}


text:
<!doctype html>

        <title>RAQ - PaulGraham</title>
        <meta name="keywords" content="PaulGraham, Lisp, Spam, Arc, YCombinator">
        <meta name="description" content="PaulGraham personal website">
        <meta charset="UTF-8">
        <link href="css/style.css" type="text/css" rel="stylesheet"/>
        <link href='http://fonts.googleapis.com/css?family=Roboto:400,400italic,700|Roboto+Condensed:400,700|Roboto+Slab:400,700' rel='stylesheet' type='text/css'>

Home

Articles

  Arc

  Lisp

  Spam

  Responses

  Other Essays

Books

  Hackers & Painters

  ANSI Common Lisp

  On Lisp

Questions

  FAQs

  RAQs

  Ask Me

Quotes

Biography

                        <form id="minisearch" action="javascript:window.location.href='search_result.html'; return false;" method="post" autocomplete="off">
                            <input type="image" id="minisubmit" src="images/search.png"  onclick="javascript:window.location.href='search_result.html'; return false;"/>
                            Search a keyword:
                            <input type="minibar" id="minibar" name="minibar" placeholder="Search"/>
                        </form>

 Questions

 FAQs

   General FAQ

   Programming FAQ

   Startup FAQ

   Arc FAQ

   Lisp FAQ

   Viaweb FAQ

   Plan for Spam FAQ

   FFB FAQ

 RAQs

 Ask Me

                                    PG > Questions > RAQ

 Rarely-Asked Questions

These are questions that I've only been asked once or twice, but which seem especially interesting.

Why don't more painters have hacking jobs?

Probably for the same reason that few hackers take up painting. They both seem from the outside like great abstruse mysteries. You can learn great abstruse mysteries as a teenager, because everything is a mystery at that point anyway. And you have the boundless self confidence that comes from ignorance. But unless you learn both as a teenager, which is rare, you'll be afraid of the other later.

What should I read to learn more about history?

The way to do it is piecemeal. You could just sit down and try reading Roberts's History of the World cover to cover, but you'd probably lose interest. I think it's a better plan to read books about specific topics, even if you don't understand everything the first time through.

Here are the most exciting ones I can think of:

Clark, Civilisation

White, Technology and Social Change

McEvedy, Penguin Atlases of Ancient and Medieval History

Laslett, The World We Have Lost

Bernal, The Extension of Man

Franklin, Autobiography

Girouard, Life in the English Country House

Pirenne, Mohammed and Charlemagne

Runciman, The Fall of Constantinople

Cipolla, Guns, Sails and Empires

Hadas, A History of Rome

Oman, The Art of War in the Middle Ages

Vasari, Lives of the Artists

Bovill, The Golden Trade of the Moors

Caesar, Gallic Wars

Kuhn, The Copernican Revolution

Couldn't you add something equivalent to Lisp macros to languages like Perl or Python?

Not without turning them into dialects of Lisp. Real macros need to operate on the parse tree of the program. To allow that in a language with syntax, you have to (a) make public the translation from source code to parse trees, and (b) give the programmer the opportunity to run programs on parse trees before they go on to the compiler.

But it would be hard to do that without creating a notation for parse trees; and once you do, your language has become a skin on Lisp, in much the same way that in OS X, the Mac OS became a skin on Unix.

How can I avoid turning into a pointy-haired boss?

The pointy-haired boss is a manager who doesn't program. So the surest way to avoid becoming him is to stay a programmer. What tempts programmers to become managers are companies with old-fashioned corporate structure, where the only way to advance in salary and prestige is to go into management. So if you want to avoid becoming a PHB, avoid such companies, and work for (or start) startups.

I never had to manage anyone in our startup, even though I was the president. The other hackers were my peers, and would have given me the raspberry if I'd tried to "manage" them. We operated by consensus. And the rest of the company reported to our experienced COO, who was also more of a peer.

Why be a manager when you could be a founder or early employee at a startup?

I'm about to become a teacher. How can I be a good one?

The best teachers I remember from school had three things in common:

(1) They had high standards. Like three year olds testing their parents, students will test teachers to see if they can get away with low-quality work or bad behavior. They won't respect the teachers who don't call them on it.

(2) They liked us. Like dogs, kids can tell very accurately whether or not someone wishes them well. I think a lot of our teachers either never liked kids much, or got burned out and started not to like them. It's hard to be a good teacher once that happens. I can't think of one teacher in all the schools I went to who managed to be good despite disliking students.

(3) They were interested in the subject. Most of the public school teachers I had weren't really interested in what they taught. Enthusiasm is contagious, and so is boredom.

Two startups want to hire me. Which should I choose?

The one with the most determined and smartest founders (in that order) is the more likely to succeed. Pretend you're an investor—which you are, of your time—and ask yourself which of the two you'd buy stock in.

How can I become really good at Lisp programming?

Write an application big enough that you can make the lower levels into a language layer. Embedded languages (or as they now seem to be called, DSLs) are the essence of Lisp hacking.

What philosophy books would you recommend?

I can't think of any I'd recommend. What I learned from trying to study philosophy is that the place to look is in other fields. If you understand math or history or aeronautical engineering very well, the most abstract of the things you know are what philosophy is supposed to be teaching. Books on philosophy per se are either highly technical stuff that doesn't matter much, or vague concatenations of abstractions their own authors didn't fully understand (e.g. Hegel).

It can be interesting to study ancient philosophy, but more as a kind of accident report than to teach you anything useful.

I want to start a startup, but I don't know how to program. How long will it take to learn?

I would guess a smart person can learn to hack sufficiently well in 6 months to a year. The best way to do it would be to find some startup to hire you in an initially menial capacity, and start learning to program on the side. Then gradually work your way up from answering phones through system administration to actual software design. There is always so much to do in a startup that people won't be too picky about your paper qualifications, if you can solve problems for them without screwing up.

Paul Graham

Programmer, writer, and investor

                                Tweets by @paulg

Twitter: @paulg

E-mail: paulgraham@ycombinator.com

© 2015 mmxv pg

Website Last Update: 12-06-2015


text:
package com.ocdsoft.bacta.swg.shared.container;

import com.ocdsoft.bacta.swg.server.game.object.ServerObject;
import com.ocdsoft.bacta.swg.shared.object.GameObject;
import com.ocdsoft.bacta.swg.shared.property.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created by crush on 8/26/2014.
 */
public abstract class Container extends Property {
    protected static final Logger LOGGER = LoggerFactory.getLogger(Container.class);

    public static int getClassPropertyId() {
        return 0x55DC5726;
    }

    private final List<ServerObject> contents = new ArrayList<>();
    private boolean changed = false;

    public Container(final int propertyId, final GameObject owner) {
        super(propertyId, owner);
    }

    public Iterator<ServerObject> iterator() {
        return contents.iterator();
    }

    public boolean hasChanged() {
        return changed;
    }
}


text:
import { DatabaseConfig } from '../../../../config';
import { PLog } from '../modules/nodee';

let driver, database, connection;

export default async () => {
  return new Promise(async (resolve, reject) => {
    if (DatabaseConfig.enable === true) {
      try {
        driver = require('./' + DatabaseConfig.driver).default;
        database = new driver(DatabaseConfig);
      } catch (e) {
        PLog.putException(`[db] selected driver ${DatabaseConfig.driver} could not be loaded`, e);
        reject(e);
      }

      try {
        PLog.put(`[db] connecting to database using driver ${database.driverName}`);
        connection = await database.connect();
        PLog.put(`[db] successfully connected to the database`);

        resolve(connection);
      } catch (e) {
        PLog.putException(`[db] couldn't connect to the database, please check your configurations`, e);
        reject(e);
      }
    } else {
      PLog.put(`[db] the using of database is disabled`);
    }
  });
};


text:
package gpg

import (
	"bytes"
	"context"
	"encoding/hex"
	"fmt"
	"github.com/hashicorp/vault/sdk/helper/locksutil"
	"io"
	"strings"

	"github.com/ProtonMail/go-crypto/openpgp"
	"github.com/ProtonMail/go-crypto/openpgp/packet"
	"github.com/hashicorp/vault/sdk/framework"
	"github.com/hashicorp/vault/sdk/logical"
)

func pathListKeys(b *backend) *framework.Path {
	return &framework.Path{
		Pattern: "keys/?$",
		Operations: map[logical.Operation]framework.OperationHandler{
			logical.ListOperation: &framework.PathOperation{
				Callback: b.pathKeyList,
			},
		},
		HelpSynopsis:    pathPolicyHelpSyn,
		HelpDescription: pathPolicyHelpDesc,
	}
}

func pathKeys(b *backend) *framework.Path {
	return &framework.Path{
		Pattern: "keys/" + framework.GenericNameRegex("name"),
		Fields: map[string]*framework.FieldSchema{
			"name": {
				Type:        framework.TypeString,
				Description: "Name of the key.",
			},
			"real_name": {
				Type:        framework.TypeString,
				Description: "The real name of the identity associated with the generated GPG key. Must not contain any of \"()<>\x00\". Only used if generate is false.",
			},
			"email": {
				Type:        framework.TypeString,
				Description: "The email of the identity associated with the generated GPG key. Must not contain any of \"()<>\x00\". Only used if generate is false.",
			},
			"comment": {
				Type:        framework.TypeString,
				Description: "The comment of the identity associated with the generated GPG key. Must not contain any of \"()<>\x00\". Only used if generate is false.",
			},
			"key_bits": {
				Type:        framework.TypeInt,
				Default:     2048,
				Description: "The number of bits to use. Only used if generate is true.",
			},
			"key": {
				Type:        framework.TypeString,
				Description: "The ASCII-armored GPG key to use. Only used if generate is false.",
			},
			"exportable": {
				Type:        framework.TypeBool,
				Description: "Enables the key to be exportable.",
			},
			"transparency_log_address": {
				Type:        framework.TypeString,
				Description: "Address of a Rekor transparency log to publish the signatures.",
			},
			"generate": {
				Type:        framework.TypeBool,
				Default:     true,
				Description: "Determines if a key should be generated by Vault or if a key is being passed from another service.",
			},
		},
		Operations: map[logical.Operation]framework.OperationHandler{
			logical.ReadOperation: &framework.PathOperation{
				Callback: b.pathKeyRead,
			},
			logical.UpdateOperation: &framework.PathOperation{
				Callback: b.pathKeyCreate,
			},
			logical.DeleteOperation: &framework.PathOperation{
				Callback: b.pathKeyDelete,
			},
		},
		HelpSynopsis:    pathPolicyHelpSyn,
		HelpDescription: pathPolicyHelpDesc,
	}
}

func (b *backend) key(ctx context.Context, s logical.Storage, name string) (*keyEntry, error) {
	entry, err := s.Get(ctx, "key/"+name)
	if err != nil {
		return nil, err
	}
	if entry == nil {
		return nil, nil
	}

	var result keyEntry
	if err := entry.DecodeJSON(&result); err != nil {
		return nil, err
	}

	return &result, nil
}

func (b *backend) entity(entry *keyEntry) (*openpgp.Entity, error) {
	r := bytes.NewReader(entry.SerializedKey)
	el, err := openpgp.ReadKeyRing(r)
	if err != nil {
		return nil, err
	}

	return el[0], nil
}

func serializePrivateWithoutSigning(w io.Writer, e *openpgp.Entity) (err error) {
	foundPrivateKey := false

	if e.PrivateKey != nil {
		foundPrivateKey = true
		err = e.PrivateKey.Serialize(w)
		if err != nil {
			return
		}
	}
	for _, ident := range e.Identities {
		err = ident.UserId.Serialize(w)
		if err != nil {
			return
		}
		err = ident.SelfSignature.Serialize(w)
		if err != nil {
			return
		}
	}
	for _, subkey := range e.Subkeys {
		if subkey.PrivateKey != nil {
			foundPrivateKey = true
			err = subkey.PrivateKey.Serialize(w)
			if err != nil {
				return
			}
		}
		err = subkey.Sig.Serialize(w)
		if err != nil {
			return
		}
	}

	if !foundPrivateKey {
		return fmt.Errorf("no private key has been found")
	}

	return nil
}

func (b *backend) pathKeyRead(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	entry, err := b.key(ctx, req.Storage, data.Get("name").(string))
	if err != nil {
		return nil, err
	}
	if entry == nil {
		return nil, nil
	}
	entity, err := b.entity(entry)
	if err != nil {
		return nil, err
	}

	buf, err := extractPublicKey(entity)
	if err != nil {
		return nil, err
	}

	return &logical.Response{
		Data: map[string]interface{}{
			"fingerprint":              hex.EncodeToString(entity.PrimaryKey.Fingerprint[:]),
			"public_key":               string(buf),
			"exportable":               entry.Exportable,
			"transparency_log_address": entry.TransparencyLogAddress,
		},
	}, nil
}

func (b *backend) pathKeyCreate(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	name := data.Get("name").(string)
	realName := data.Get("real_name").(string)
	email := data.Get("email").(string)
	comment := data.Get("comment").(string)
	keyBits := data.Get("key_bits").(int)
	exportable := data.Get("exportable").(bool)
	transparencyLogAddress := data.Get("transparency_log_address").(string)
	generate := data.Get("generate").(bool)
	key := data.Get("key").(string)

	lock := locksutil.LockForKey(b.keyLocks, name)
	lock.Lock()
	defer lock.Unlock()

	resp, err := b.pathKeyRead(ctx, req, data)
	if err != nil {
		return logical.ErrorResponse(err.Error()), nil
	}
	if resp != nil {
		return logical.ErrorResponse("key already exists"), nil
	}

	var buf bytes.Buffer
	switch generate {
	case true:
		if keyBits < 2048 {
			return logical.ErrorResponse("Keys < 2048 bits are unsafe and not supported"), nil
		}
		config := packet.Config{
			RSABits: keyBits,
		}
		entity, err := openpgp.NewEntity(realName, comment, email, &config)
		if err != nil {
			return nil, err
		}
		err = entity.SerializePrivate(&buf, nil)
		if err != nil {
			return nil, err
		}
	default:
		if key == "" {
			return logical.ErrorResponse("the key value is required for generated keys"), nil
		}
		el, err := openpgp.ReadArmoredKeyRing(strings.NewReader(key))
		if err != nil {
			return logical.ErrorResponse(err.Error()), nil
		}
		err = serializePrivateWithoutSigning(&buf, el[0])
		if err != nil {
			return logical.ErrorResponse("the key could not be serialized, is a private key present?"), nil
		}
	}

	return nil, b.storeKeyEntry(ctx, req.Storage, name, &keyEntry{
		SerializedKey:          buf.Bytes(),
		Exportable:             exportable,
		TransparencyLogAddress: transparencyLogAddress,
	})
}

func (b *backend) storeKeyEntry(ctx context.Context, storage logical.Storage, name string, keyEntry *keyEntry) error {
	entry, err := logical.StorageEntryJSON("key/"+name, keyEntry)
	if err != nil {
		return err
	}
	return storage.Put(ctx, entry)
}

func (b *backend) pathKeyDelete(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	name := data.Get("name").(string)

	lock := locksutil.LockForKey(b.keyLocks, name)
	lock.Lock()
	defer lock.Unlock()

	err := req.Storage.Delete(ctx, "key/"+name)
	if err != nil {
		return nil, err
	}
	return nil, nil
}

func (b *backend) pathKeyList(
	ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
	entries, err := req.Storage.List(ctx, "key/")
	if err != nil {
		return nil, err
	}
	return logical.ListResponse(entries), nil
}

type keyEntry struct {
	SerializedKey          []byte
	Exportable             bool
	TransparencyLogAddress string
}

const pathPolicyHelpSyn = "Managed named GPG keys"
const pathPolicyHelpDesc = `
This path is used to manage the named GPG keys that are available.
Doing a write with no value against a new named key will create
it using a randomly generated key.
`


text:
package org.b3log.solo.repository.impl;

import org.b3log.solo.AbstractTestCase;
import org.b3log.solo.repository.StatisticRepository;
import org.testng.annotations.Test;

/**
 * {@link StatisticRepositoryImpl} test case.
 *
 * @author Liang Ding
 * @version 1.0.0.0, Dec 31, 2011
 */
@Test(suiteName = "repository")
public class StatisticRepositoryImplTestCase extends AbstractTestCase {

    /**
     * Tests.
     *
     * @throws Exception exception
     */
    @Test
    public void test() throws Exception {
        final StatisticRepository statisticRepository =
                getStatisticRepository();
    }
}