text:
<!DOCTYPE html>

  <meta charset="UTF-8" />
  <title>A page | A Pelican Blog</title>
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
  <link rel="stylesheet" href="static/m-dark.css" />
  <link rel="canonical" href="page.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="description" content="Page description for the fake SEO believers." />
  <meta property="og:site_name" content="A Pelican Blog" />
  <meta property="og:title" content="A page" />
  <meta name="twitter:title" content="A page" />
  <meta property="og:url" content="page.html" />
  <meta property="og:description" content="Page description for the social people." />
  <meta name="twitter:description" content="Page description for the social people." />
  <meta name="twitter:card" content="summary" />
  <meta property="og:type" content="page" />

      A Pelican Blog

A page

Page content for those who actually read.


text:
if [ -d training-monolingual.tokenized ]
then
  rm -rf training-monolingual.tokenized/*
else
  mkdir training-monolingual.tokenized
fi

# Unique sort of the sentences in the corpus. Quite a few sentences are replicated,
# dropping the number of words from about 2.9B to about 0.8B.  Use binary/C ordering.
export LC_ALL=C
for year in 2007 2008 2009 2010 2011; do
  cat training-monolingual/news.${year}.en.shuffled
done | sort -u --output=training-monolingual.tokenized/news.20XX.en.shuffled.sorted
echo "Done sorting corpus."

# Set environemnt vars LANG and LANGUAGE to make sure all users have the same
# locale settings.
export LANG=en_US.UTF-8
export LANGUAGE=en_US:
export LC_ALL=en_US.UTF-8

echo "Working on training-monolingual/news.20XX.en.shuffled.sorted"
time cat training-monolingual.tokenized/news.20XX.en.shuffled.sorted | \
  ./scripts/normalize-punctuation.perl -l en | \
  ./scripts/tokenizer.perl -l en > \
  training-monolingual.tokenized/news.20XX.en.shuffled.sorted.tokenized
echo "Done working on training-monolingual/news.20XX.en.shuffled."

# Split the data in 100 shards
if [ -d training-monolingual.tokenized.shuffled ]
then
  rm -rf training-monolingual.tokenized.shuffled/*
else
  mkdir training-monolingual.tokenized.shuffled
fi
./scripts/split-input-data.perl \
  --output_file_base="$PWD/training-monolingual.tokenized.shuffled/news.en" \
  --num_shards=100 \
  --input_file=training-monolingual.tokenized/news.20XX.en.shuffled.sorted.tokenized
echo "Done splitting/shuffling corpus into 100 shards news.en-000??-of-00100."

# Hold 00000 shard out, and split it 50 way.
if [ -d heldout-monolingual.tokenized.shuffled ]
then
  rm -rf heldout-monolingual.tokenized.shuffled/*
else
  mkdir heldout-monolingual.tokenized.shuffled
fi

mv ./training-monolingual.tokenized.shuffled/news.en-00000-of-00100 \
  heldout-monolingual.tokenized.shuffled/
echo "Set aside shard 00000 of news.en-000??-of-00100 as held-out data."

./scripts/split-input-data.perl \
  --output_file_base="$PWD/heldout-monolingual.tokenized.shuffled/news.en.heldout" \
  --num_shards=50 \
  --input_file=heldout-monolingual.tokenized.shuffled/news.en-00000-of-00100
echo "Done splitting/shuffling held-out data into 50 shards."

redpajama_set_name: RedPajamaGithub


text:
class constants{

private:

public:

	static const int nSections = 7;
	static const int nTrays = 120;

};

#endif


text:
package org.jetbrains.idea.maven.project;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
import org.jetbrains.idea.maven.execution.MavenExecutionOptions;
import org.junit.Assert;

import java.util.Collections;

public class MavenGeneralSettingsTest extends CodeInsightFixtureTestCase {

  public void testUpdateFromMavenConfigDisabled() {
    VirtualFile virtualFile = myFixture
      .addFileToProject(".mvn/maven.config", "-o -U -N -T3 -q -X -e -C -ff -s user-settings.xml -gs global-settings.xml")
      .getVirtualFile().getParent();

    MavenGeneralSettings settings = new MavenGeneralSettings(getProject());
    settings.updateFromMavenConfig(Collections.singletonList(virtualFile));

    Assert.assertEquals(MavenExecutionOptions.ChecksumPolicy.NOT_SET, settings.getChecksumPolicy());
    Assert.assertEquals(MavenExecutionOptions.FailureMode.NOT_SET, settings.getFailureBehavior());
    Assert.assertEquals(MavenExecutionOptions.LoggingLevel.INFO, settings.getOutputLevel());
    Assert.assertFalse(settings.isAlwaysUpdateSnapshots());
    Assert.assertFalse(settings.isWorkOffline());
    Assert.assertFalse(settings.isPrintErrorStackTraces());
    Assert.assertFalse(settings.isNonRecursive());
    Assert.assertTrue(StringUtil.isEmpty(settings.getThreads()));
  }

  public void testUpdateFromMavenConfig() {
    VirtualFile virtualFile = myFixture.addFileToProject("user-settings.xml", "<settings/>").getVirtualFile();
    myFixture.addFileToProject("global-settings.xml", "<settings/>");
    myFixture.addFileToProject(".mvn/maven.config", "-o -U -N -T3 -q -X -e -C -ff -s user-settings.xml -gs global-settings.xml");

    MavenGeneralSettings settings = new MavenGeneralSettings(getProject());
    settings.setUseMavenConfig(true);
    settings.updateFromMavenConfig(Collections.singletonList(virtualFile));
    Assert.assertEquals(MavenExecutionOptions.ChecksumPolicy.FAIL, settings.getChecksumPolicy());
    Assert.assertEquals(MavenExecutionOptions.FailureMode.FAST, settings.getFailureBehavior());
    Assert.assertEquals(MavenExecutionOptions.LoggingLevel.DISABLED, settings.getOutputLevel());
    Assert.assertTrue(settings.isAlwaysUpdateSnapshots());
    Assert.assertTrue(settings.isWorkOffline());
    Assert.assertTrue(settings.isPrintErrorStackTraces());
    Assert.assertTrue(settings.isNonRecursive());
    Assert.assertEquals("3", settings.getThreads());
  }
}


text:
package com.google.javascript.jscomp;

import com.google.javascript.jscomp.AnalyzePrototypeProperties.NameInfo;
import com.google.javascript.jscomp.AnalyzePrototypeProperties.Property;
import com.google.javascript.jscomp.AnalyzePrototypeProperties.Symbol;
import com.google.javascript.rhino.IR;
import com.google.javascript.rhino.Node;
import java.util.Collection;
import java.util.Iterator;

/**
 * Move prototype methods into later modules.
 *
 * @author nicksantos@google.com (Nick Santos)
 */
class CrossModuleMethodMotion implements CompilerPass {

  // Internal errors
  static final DiagnosticType NULL_COMMON_MODULE_ERROR = DiagnosticType.error(
      "JSC_INTERNAL_ERROR_MODULE_DEPEND",
      "null deepest common module");

  private final AbstractCompiler compiler;
  private final IdGenerator idGenerator;
  private final AnalyzePrototypeProperties analyzer;
  private final JSModuleGraph moduleGraph;
  private final boolean noStubFunctions;

  static final String STUB_METHOD_NAME = "JSCompiler_stubMethod";
  static final String UNSTUB_METHOD_NAME = "JSCompiler_unstubMethod";

  // Visible for testing
  static final String STUB_DECLARATIONS =
      "var JSCompiler_stubMap = [];" +
      "function JSCompiler_stubMethod(JSCompiler_stubMethod_id) {" +
      "  return function() {" +
      "    return JSCompiler_stubMap[JSCompiler_stubMethod_id].apply(" +
      "        this, arguments);" +
      "  };" +
      "}" +
      "function JSCompiler_unstubMethod(" +
      "    JSCompiler_unstubMethod_id, JSCompiler_unstubMethod_body) {" +
      "  return JSCompiler_stubMap[JSCompiler_unstubMethod_id] = " +
      "      JSCompiler_unstubMethod_body;" +
      "}";

  /**
   * Creates a new pass for moving prototype properties.
   * @param compiler The compiler.
   * @param idGenerator An id generator for method stubs.
   * @param canModifyExterns If true, then we can move prototype
   *     properties that are declared in the externs file.
   * @param noStubFunctions if true, we can move methods without
   *     stub functions in the parent module.
   */
  CrossModuleMethodMotion(AbstractCompiler compiler, IdGenerator idGenerator,
      boolean canModifyExterns, boolean noStubFunctions) {
    this.compiler = compiler;
    this.idGenerator = idGenerator;
    this.moduleGraph = compiler.getModuleGraph();
    this.analyzer =
        new AnalyzePrototypeProperties(
            compiler, moduleGraph, canModifyExterns, false /* anchorUnusedVars */, noStubFunctions);
    this.noStubFunctions = noStubFunctions;
  }

  @Override
  public void process(Node externRoot, Node root) {
    // If there are < 2 modules, then we will never move anything,
    // so we're done.
    if (moduleGraph != null && moduleGraph.getModuleCount() > 1) {
      analyzer.process(externRoot, root);
      moveMethods(analyzer.getAllNameInfo());
    }
  }

  /**
   * Move methods deeper in the module graph when possible.
   */
  private void moveMethods(Collection<NameInfo> allNameInfo) {
    boolean hasStubDeclaration = idGenerator.hasGeneratedAnyIds();
    for (NameInfo nameInfo : allNameInfo) {
      if (!nameInfo.isReferenced()) {
        // The code below can't do anything with unreferenced name
        // infos.  They should be skipped to avoid NPE since their
        // deepestCommonModuleRef is null.
        continue;
      }

      if (nameInfo.readsClosureVariables()) {
        continue;
      }

      JSModule deepestCommonModuleRef = nameInfo.getDeepestCommonModuleRef();
      if (deepestCommonModuleRef == null) {
        compiler.report(JSError.make(NULL_COMMON_MODULE_ERROR));
        continue;
      }

      Iterator<Symbol> declarations =
          nameInfo.getDeclarations().descendingIterator();
      while (declarations.hasNext()) {
        Symbol symbol = declarations.next();
        if (!(symbol instanceof Property)) {
          continue;
        }
        Property prop = (Property) symbol;

        // We should only move a property across modules if:
        // 1) We can move it deeper in the module graph, and
        // 2) it's a function, and
        // 3) it is not a GETTER_DEF or a SETTER_DEF, and
        // 4) the class is available in the global scope.
        //
        // #1 should be obvious. #2 is more subtle. It's possible
        // to copy off of a prototype, as in the code:
        // for (var k in Foo.prototype) {
        //   doSomethingWith(Foo.prototype[k]);
        // }
        // This is a common way to implement pseudo-multiple inheritance in JS.
        //
        // So if we move a prototype method into a deeper module, we must
        // replace it with a stub function so that it preserves its original
        // behavior.
        if (prop.getRootVar() == null || !prop.getRootVar().isGlobal()) {
          continue;
        }

        Node value = prop.getValue();
        // Only attempt to move normal functions.
        if (!value.isFunction()
            // A GET or SET can't be deferred like a normal
            // FUNCTION property definition as a mix-in would get the result
            // of a GET instead of the function itself.
            || value.getParent().isGetterDef()
            || value.getParent().isSetterDef()) {
          continue;
        }

        if (moduleGraph.dependsOn(deepestCommonModuleRef, prop.getModule())) {
          if (hasUnmovableRedeclaration(nameInfo, prop)) {
            // If it has been redeclared on the same object, skip it.
            continue;
          }

          Node valueParent = value.getParent();
          /**
           * The logic here moves methods from some starting script node to some other script node.
           * Both scripts need to be marked as changed. Locally the removal point in the starting
           * script node is called 'valueParent' and the insertion point in the destination script
           * is sometimes called 'unstubParent' and sometimes 'destParent'. The change on
           * 'valueParent' is being reported before the change occurs since the change is guaranteed
           * to occur and since after the change the 'valueParent' node has sometimes already been
           * detached.
           */
          compiler.reportChangeToEnclosingScope(valueParent);
          Node proto = prop.getPrototype();
          int stubId = idGenerator.newId();

          if (!noStubFunctions) {
            // example: JSCompiler_stubMethod(id);
            Node stubCall = IR.call(
                IR.name(STUB_METHOD_NAME),
                IR.number(stubId))
                .useSourceInfoIfMissingFromForTree(value);
            stubCall.putBooleanProp(Node.FREE_CALL, true);

            // stub out the method in the original module
            // A.prototype.b = JSCompiler_stubMethod(id);
            valueParent.replaceChild(value, stubCall);

            // unstub the function body in the deeper module
            Node unstubParent = compiler.getNodeForCodeInsertion(
                deepestCommonModuleRef);
            Node unstubCall = IR.call(
                IR.name(UNSTUB_METHOD_NAME),
                IR.number(stubId),
                value);
            unstubCall.putBooleanProp(Node.FREE_CALL, true);
            unstubParent.addChildToFront(
                // A.prototype.b = JSCompiler_unstubMethod(id, body);
                IR.exprResult(
                    IR.assign(
                        IR.getprop(
                            proto.cloneTree(),
                            IR.string(nameInfo.name)),
                        unstubCall))
                    .useSourceInfoIfMissingFromForTree(value));

            compiler.reportChangeToEnclosingScope(unstubParent);
          } else {
            Node assignmentParent = valueParent.getParent();
            valueParent.removeChild(value);
            // remove Foo.prototype.bar = value
            assignmentParent.detach();

            Node destParent = compiler.getNodeForCodeInsertion(
                deepestCommonModuleRef);
            destParent.addChildToFront(
                // A.prototype.b = value;
                IR.exprResult(
                    IR.assign(
                        IR.getprop(
                            proto.cloneTree(),
                            IR.string(nameInfo.name)),
                        value))
                    .useSourceInfoIfMissingFromForTree(value));
            compiler.reportChangeToEnclosingScope(destParent);
          }
        }
      }
    }

    if (!noStubFunctions && !hasStubDeclaration && idGenerator
        .hasGeneratedAnyIds()) {
      // Declare stub functions in the top-most module.
      Node declarations = compiler.parseSyntheticCode(STUB_DECLARATIONS);
      NodeUtil.markNewScopesChanged(declarations, compiler);
      Node firstScript = compiler.getNodeForCodeInsertion(null);
      firstScript.addChildrenToFront(declarations.removeChildren());
      compiler.reportChangeToEnclosingScope(firstScript);
    }
  }

  static boolean hasUnmovableRedeclaration(NameInfo nameInfo, Property prop) {
    for (Symbol symbol : nameInfo.getDeclarations()) {
      if (!(symbol instanceof Property)) {
        continue;
      }
      Property otherProp = (Property) symbol;
      // It is possible to do better here if the dependencies are well defined
      // but redefinitions are usually in optional modules so it isn't likely
      // worth the effort to check.
      if (prop != otherProp
          && prop.getRootVar() == otherProp.getRootVar()
          && prop.getModule() != otherProp.getModule()) {
        return true;
      }
    }
    return false;
  }
}


text:
<record><header><identifier>froac:199</identifier><datestamp>2013-04-15T03:33:50Z</datestamp><setSpec>notImplemented</setSpec></header><metadata><lom:lom xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM http://ltsc.ieee.org/xsd/lomv1.0/lom.xsd">
<lom:general>
	<lom:identifier>
		<lom:catalog>NBC</lom:catalog>
		<lom:entry>03.01.05</lom:entry>
	</lom:identifier>
	<lom:title>Moths of the Year.</lom:title>
	<lom:language>en</lom:language>
	<lom:description>En esta presentación se muestra  cada mes del año con su respectivo nombre en ingles y con el día que se conmemora en ese mes, dándole el nombre en ingles.</lom:description>
	<lom:keyword>Months</lom:keyword>
	<lom:keyword>Year</lom:keyword>
	<lom:coverage>Primaria/Secundaria</lom:coverage>
	<lom:structure>atomic</lom:structure>
	<lom:aggregationlevel>1</lom:aggregationlevel>
</lom:general>

<lom:lifecycle>
	<lom:version>1.0</lom:version>
	<lom:status>final</lom:status>
	<lom:contribute>
		<lom:role>author</lom:role>
		<lom:date>2013-04-15</lom:date>
		<lom:entity>GAIA- Grupo de Ambientes Inteligentes Adaptativos.</lom:entity>
	</lom:contribute>
</lom:lifecycle>

<lom:metametadata>
	<lom:contribute>
		<lom:role>creator</lom:role>
		<lom:date>2013-04-15</lom:date>
		<lom:entity>GAIA- Grupo de Ambientes Inteligentes Adaptativos.</lom:entity>
	</lom:contribute>
	<lom:metadataschema>LOMv1.0</lom:metadataschema>
	<lom:language>es</lom:language>
</lom:metametadata>

<lom:technical>
	<lom:format>ppsx</lom:format>
	<lom:size>5922962</lom:size>
	<lom:location>http://froac.manizales.unal.edu.co/roap/control/download.php?id=215</lom:location>
	<lom:installationremarks>Abra la presentacion Moths of the Year en su computador</lom:installationremarks>
	<lom:otherplatformrequirements> </lom:otherplatformrequirements>
	<lom:duration>PT20M</lom:duration>
	<lom:requirements>
		<lom:type>operating system</lom:type>
		<lom:name>Windows</lom:name>
		<lom:minimumversion>Windows XP</lom:minimumversion>
		<lom:maximumversion>Windows 8</lom:maximumversion>
	</lom:requirements>
</lom:technical>

<lom:educational>
	<lom:interactivitytype>2</lom:interactivitytype>
	<lom:learningresourcetype>slide</lom:learningresourcetype>
	<lom:interactivitylevel>low</lom:interactivitylevel>
	<lom:semanticdensity>medium</lom:semanticdensity>
	<lom:intendedenduserrole>teacher</lom:intendedenduserrole>
	<lom:intendedenduserrole>learner</lom:intendedenduserrole>
	<lom:context>school</lom:context>
	<lom:typicalagerange>8-11 años</lom:typicalagerange>
	<lom:difficulty>medium</lom:difficulty>
	<lom:typicallearningtime>PT40M</lom:typicallearningtime>
	<lom:description>VARK{Visual:50%; Auditivo:0%; Lector:50%; Kinestético:0%}</lom:description>
	<lom:language>es</lom:language>
</lom:educational>

<lom:rights>
	<lom:cost>no</lom:cost>
	<lom:copyrightandotherrestrictions>no</lom:copyrightandotherrestrictions>
	<lom:description> </lom:description>
</lom:rights>

<lom:relation>
	<lom:kind> </lom:kind>
</lom:relation>

<lom:annotation>
	<lom:entity> </lom:entity>
	<lom:date> </lom:date>
	<lom:description> </lom:description>
</lom:annotation>

<lom:classification>
	<lom:purpose> </lom:purpose>
	<lom:description> </lom:description>
</lom:classification>
</lom:lom></metadata></record>


text:
package model;

/**
 * The different types of water conditions
 */
public enum OverallConditionEnum {
    SAFE("Safe"), TREATABLE("Treatable"), UNSAFE("Unsafe");

    private final String stringRep;

    OverallConditionEnum(String stringRep) {
        this.stringRep  = stringRep;
    }

    @Override
    public String toString() {
        return stringRep;
    }
}


text:
"""
mail.py
For email functions

Created by Shane O'Connor 2013
"""

from string import join
import email.Message
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText

from klab.fs.fsio import read_file

class MailServer(object):

    def __init__(self, host = None, port = None):
        self.host = host
        self.port = port

    def sendmail(self, subject, sender, recipients, plaintext, htmltext=None, cc=None, debug=False, useMIMEMultipart=True):
        if recipients:
            if type(recipients) == type(""):
                recipients = [recipients]
            elif type(recipients) != type([]):
                raise Exception("Unexpected type for recipients.")
            if cc:
                if type(cc) == type(""):
                    recipients.append(cc)
                elif type(cc) == type([]):
                    recipients.extend(cc)
                else:
                    raise Exception("Unexpected type for cc.")
            recipients = join(recipients, ";")

            if plaintext and htmltext and useMIMEMultipart:
                msg = MIMEMultipart('alternative')
            else:
                msg = email.Message.Message()

            msg['Subject'] = subject
            msg['From'] = sender
            msg['To'] = recipients
            msg['Reply-To'] = sender
            if plaintext and htmltext and useMIMEMultipart:
                part1 = MIMEText(plaintext, 'plain')
                part2 = MIMEText(htmltext, 'html')
                msg.attach(part1)
                msg.attach(part2)
            else:
                msg.set_type("text/plain")
                msg.set_payload(plaintext)

            if debug:
                print(msg)
            else:
                if self.host and self.port:
                    s = smtplib.SMTP(self.host, self.port)
                elif self.host:
                    s = smtplib.SMTP(self.host)
                else:
                    s = smtplib.SMTP()
                s.connect()
                s.sendmail(msg['From'], recipients, msg.as_string())
                s.close()
            return True
        return False

    def sendgmail(self, subject, recipients, plaintext, htmltext=None, cc=None, debug=False, useMIMEMultipart=True, gmail_account = 'kortemmelab@gmail.com', pw_filepath = None):
        '''For this function to work, the password for the gmail user must be colocated with this file or passed in.'''
        smtpserver = smtplib.SMTP("smtp.gmail.com", 587)
        smtpserver.ehlo()
        smtpserver.starttls()
        smtpserver.ehlo
        gmail_account = 'kortemmelab@gmail.com'
        if pw_filepath:
            smtpserver.login(gmail_account, read_file(pw_filepath))
        else:
            smtpserver.login(gmail_account, read_file('pw'))
        for recipient in recipients:

            if htmltext:
                msg = MIMEText(htmltext, 'html')
                msg['From'] = gmail_account
                msg['To'] = recipient
                msg['Subject'] = subject
                smtpserver.sendmail(gmail_account, recipient, msg.as_string())
            else:
                header = 'To:' + recipient + '\n' + 'From: ' + gmail_account + '\n' + 'Subject:' + subject + '\n'
                msg = header + '\n ' + plaintext + '\n\n'
                smtpserver.sendmail(gmail_account, recipient, msg)
        smtpserver.close()

    def sendgmail2(self, subject, recipients, plaintext, htmltext=None, cc=None, debug=False, useMIMEMultipart=True, gmail_account = 'kortemmelab@gmail.com', pw_filepath = None):
        '''For this function to work, the password for the gmail user must be colocated with this file or passed in.'''
        smtpserver = smtplib.SMTP("smtp.gmail.com", 587)
        smtpserver.ehlo()
        smtpserver.starttls()
        smtpserver.ehlo
        gmail_account = 'kortemmelab@gmail.com'
        if pw_filepath:
            smtpserver.login(gmail_account, read_file(pw_filepath))
        else:
            smtpserver.login(gmail_account, read_file('pw'))
        for recipient in recipients:
            header = 'To:' + recipient + '\n' + 'From: ' + gmail_account + '\n' + 'Subject:' + subject + '\n'
            if htmltext:
                msg = header + '\n ' + htmltext + '\n\n'
            else:
                msg = header + '\n ' + plaintext + '\n\n'
            smtpserver.sendmail(gmail_account, recipient, msg)
        smtpserver.close()


text:
@echo off
if exist cloud\main.js goto backup
:continue
for %%f in (Source\*.js) do type %%f >> cloud\main.js
goto next
:backup
copy cloud\main.js cloud\main.js.bak
del cloud\main.js
goto continue
:next
parse deploy


text:
<?php
namespace App\Model\Table;

use Cake\ORM\Table;
use Cake\ORM\TableRegistry;
use Cake\Validation\Validator;

class GeoCityCorporationsTable extends Table
{
//    public  function initialize()
//    {
//
//    }
}


text:
CREATE TABLE cr_co_table_gist_index (
 id INTEGER,
 property BOX,
 filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time.  Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground.  How can you listen when you know?'
 ) WITH (appendonly=true,orientation=column)
 DISTRIBUTED BY (id);

INSERT INTO cr_co_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT INTO cr_co_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT INTO cr_co_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT INTO cr_co_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT INTO cr_co_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
CREATE INDEX cr_co_gist_idx1 ON cr_co_table_gist_index USING GiST (property);


text:
void libera_los_matrices(void);
void imprime_matrices(void);
void imprime_matriz_resultado(void);
void multiplica_matrices(void);
void libera_espacio(void);


text:
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data

'-------------------------------------------------------------------------------------------'
' Inicio de clase "fFacturas_Compras_Requisitos"
'-------------------------------------------------------------------------------------------'
Partial Class fFacturas_Compras_Requisitos
    Inherits vis2formularios.frmReporte

    Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try

            Dim loComandoSeleccionar As New StringBuilder()

            loComandoSeleccionar.AppendLine("")
            loComandoSeleccionar.AppendLine("SELECT  Compras.Documento                               AS Documento,")
            loComandoSeleccionar.AppendLine("        Compras.Factura                                 AS Factura, ")
            loComandoSeleccionar.AppendLine("        Compras.Control                                 AS Control, ")
            loComandoSeleccionar.AppendLine("        Compras.Status                                  AS Status, ")
            loComandoSeleccionar.AppendLine("        Compras.Cod_Pro                                 AS Cod_Pro,")
            loComandoSeleccionar.AppendLine("        (CASE WHEN Compras.Nom_Pro = ''")
            loComandoSeleccionar.AppendLine("            THEN Proveedores.Nom_Pro ")
            loComandoSeleccionar.AppendLine("            ELSE Compras.Nom_Pro")
            loComandoSeleccionar.AppendLine("        END)                                            AS Nom_Pro,")
            loComandoSeleccionar.AppendLine("        (CASE WHEN Compras.Rif = ''")
            loComandoSeleccionar.AppendLine("            THEN Proveedores.Rif ")
            loComandoSeleccionar.AppendLine("            ELSE Compras.Rif")
            loComandoSeleccionar.AppendLine("        END)                                            AS Rif,")
            loComandoSeleccionar.AppendLine("        (CASE WHEN Compras.Dir_Fis = ''")
            loComandoSeleccionar.AppendLine("            THEN Proveedores.Dir_Fis ")
            loComandoSeleccionar.AppendLine("            ELSE Compras.Dir_Fis")
            loComandoSeleccionar.AppendLine("        END)                                            AS Dir_Fis,")
            loComandoSeleccionar.AppendLine("        (CASE WHEN Compras.Telefonos = ''")
            loComandoSeleccionar.AppendLine("            THEN Proveedores.Telefonos ")
            loComandoSeleccionar.AppendLine("            ELSE Compras.Telefonos")
            loComandoSeleccionar.AppendLine("        END)                                            AS Telefonos,")
            loComandoSeleccionar.AppendLine("        Proveedores.Fax                                 AS Fax, ")
            loComandoSeleccionar.AppendLine("        Compras.Fec_Ini                                 AS Fec_Ini, ")
            loComandoSeleccionar.AppendLine("        Compras.Fec_Fin                                 AS Fec_Fin, ")
            loComandoSeleccionar.AppendLine("        Compras.Mon_Bru                                 AS Mon_Bru, ")
            loComandoSeleccionar.AppendLine("        Compras.Mon_Imp1                                AS Mon_Imp1, ")
            loComandoSeleccionar.AppendLine("        Compras.Por_Des1                                AS Por_Des1, ")
            loComandoSeleccionar.AppendLine("        Compras.Mon_Des1                                AS Mon_Des1, ")
            loComandoSeleccionar.AppendLine("        Compras.Por_Rec1                                AS Por_Rec1, ")
            loComandoSeleccionar.AppendLine("        Compras.Mon_Rec1                                AS Mon_Rec1, ")
            loComandoSeleccionar.AppendLine("        Compras.Mon_Net                                 AS Mon_Net, ")
            loComandoSeleccionar.AppendLine("        Compras.Mon_Sal                                 AS Mon_Sal, ")
            loComandoSeleccionar.AppendLine("        Compras.Cod_For                                 AS Cod_For, ")
            loComandoSeleccionar.AppendLine("        Compras.Cod_Mon                                 AS Cod_Mon, ")
            loComandoSeleccionar.AppendLine("        Compras.Por_Imp1                                AS Por_Imp1, ")
            loComandoSeleccionar.AppendLine("        Compras.Comentario                              AS Comentario, ")
            loComandoSeleccionar.AppendLine("        Formas_Pagos.Nom_For                            AS Nom_For, ")
            loComandoSeleccionar.AppendLine("        Compras.Cod_Ven                                 AS Cod_Ven, ")
            loComandoSeleccionar.AppendLine("        Vendedores.Nom_Ven                              AS Nom_Ven,")
            loComandoSeleccionar.AppendLine("        Requerimientos.Cod_Req                          AS Cod_Req,")
            loComandoSeleccionar.AppendLine("        Requerimientos.Nom_Req                          AS Nom_Req,")
            loComandoSeleccionar.AppendLine("        Requerimientos.Opcional                         AS Opcional,")
            loComandoSeleccionar.AppendLine("        Requerimientos.Peso                             AS Peso,")
            loComandoSeleccionar.AppendLine("        Requerimientos.Tip_Pro                          AS Tip_Pro,")
            loComandoSeleccionar.AppendLine("        COALESCE(Movimientos_Requerimientos.Val_Num, 0)                 AS Val_Num,")
            loComandoSeleccionar.AppendLine("        CAST(COALESCE(Movimientos_Requerimientos.Val_Log, 0) AS BIT)    AS Val_Log,")
            loComandoSeleccionar.AppendLine("        COALESCE(Movimientos_Requerimientos.Val_Car, '')                AS Val_Car,")
            loComandoSeleccionar.AppendLine("        COALESCE(Movimientos_Requerimientos.Val_Fec, ")
            loComandoSeleccionar.AppendLine("            CAST('19000101' AS DATE))                                   AS Val_Fec,")
            loComandoSeleccionar.AppendLine("        COALESCE(Movimientos_Requerimientos.Val_Mem, '')                AS Val_Mem,")
            loComandoSeleccionar.AppendLine("        COALESCE(Movimientos_Requerimientos.Comentario,'')              AS Comentario_Requerimientos")
            loComandoSeleccionar.AppendLine("FROM    Compras")
            loComandoSeleccionar.AppendLine("    JOIN Proveedores ON Proveedores.Cod_Pro = Compras.Cod_Pro ")
            loComandoSeleccionar.AppendLine("    JOIN Formas_Pagos ON Formas_Pagos.Cod_For = Compras.Cod_For ")
            loComandoSeleccionar.AppendLine("    JOIN Vendedores ON Vendedores.Cod_Ven = Compras.Cod_Ven ")
            loComandoSeleccionar.AppendLine("    LEFT JOIN Requerimientos ")
            loComandoSeleccionar.AppendLine("        ON Requerimientos.Opcion = 'FacturasCompra' ")
            loComandoSeleccionar.AppendLine("        AND Requerimientos.Status = 'A'")
            loComandoSeleccionar.AppendLine("    LEFT JOIN Movimientos_Requerimientos ")
            loComandoSeleccionar.AppendLine("        ON  Movimientos_Requerimientos.Origen = 'Compras'")
            loComandoSeleccionar.AppendLine("        AND Movimientos_Requerimientos.Adicional = ''")
            loComandoSeleccionar.AppendLine("        AND Movimientos_Requerimientos.Cod_Reg = Compras.Documento")
            loComandoSeleccionar.AppendLine("        AND Movimientos_Requerimientos.Cod_Req = Requerimientos.Cod_Req")
            loComandoSeleccionar.AppendLine("WHERE  " & cusAplicacion.goFormatos.pcCondicionPrincipal)
            loComandoSeleccionar.AppendLine("ORDER BY Requerimientos.Orden, Requerimientos.Cod_Req")
            loComandoSeleccionar.AppendLine("")

            Dim loServicios As New cusDatos.goDatos

            Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString, "curReportes")

            '--------------------------------------------------'
			' Carga la imagen del logo en cusReportes          '
			'--------------------------------------------------'
			Me.mCargarLogoEmpresa(laDatosReporte.Tables(0), "LogoEmpresa")

			'-------------------------------------------------------------------------------------------------------
            ' Verificando si el select (tabla nº0) trae registros
            '-------------------------------------------------------------------------------------------------------

            If (laDatosReporte.Tables(0).Rows.Count <= 0) Then
                Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _
                                          "No se Encontraron Registros para los Parámetros Especificados. ", _
                                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _
                                           "350px", _
                                           "200px")
            End If

            loObjetoReporte = cusAplicacion.goFormatos.mCargarInforme("fFacturas_Compras_Requisitos", laDatosReporte)

            Me.mTraducirReporte(loObjetoReporte)

            Me.mFormatearCamposReporte(loObjetoReporte)

            Me.crvfFacturas_Compras_Requisitos.ReportSource = loObjetoReporte

        Catch loExcepcion As Exception

            Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
                          "No se pudo Completar el Proceso: " & loExcepcion.Message, _
                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
                           "auto", _
                           "auto")

        End Try

    End Sub

    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

        Try

            loObjetoReporte.Close()

        Catch loExcepcion As Exception

        End Try

    End Sub

End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo
'-------------------------------------------------------------------------------------------'
' RJG: 15/01/15: Codigo inicial
'-------------------------------------------------------------------------------------------'


text:
namespace brave {

namespace {

bool WebContentsDestroyed(int render_process_id, int render_frame_id) {
  if (render_process_id == MSG_ROUTING_NONE)
    return false;

  auto host = content::RenderProcessHost::FromID(render_process_id);
  if (!host)
    return true;

  auto rfh =
      content::RenderFrameHost::FromID(render_process_id, render_frame_id);
  if (!rfh)
    return true;

  auto contents =
      content::WebContents::FromRenderFrameHost(rfh);
  if (!contents)
    return true;

  return contents->IsBeingDestroyed();
}

void PermissionStatusCallbackWrapper(const base::Callback<void(
                    blink::mojom::PermissionStatus)>& callback,
                    const std::vector<blink::mojom::PermissionStatus>& status) {
  callback.Run(status.front());
}

}  // namespace

BravePermissionManager::BravePermissionManager()
    : request_id_(0) {
}

BravePermissionManager::~BravePermissionManager() {
}

void BravePermissionManager::SetPermissionRequestHandler(
    const RequestHandler& handler) {
  if (handler.is_null() && !pending_requests_.empty()) {
    for (const auto& request : pending_requests_)
      CancelPermissionRequest(request.first);
    pending_requests_.clear();
  }
  request_handler_ = handler;
}

int BravePermissionManager::RequestPermission(
    content::PermissionType permission,
    content::RenderFrameHost* render_frame_host,
    const GURL& requesting_origin,
    bool user_gesture,
    const base::Callback<void(
          blink::mojom::PermissionStatus)>& response_callback) {
  auto callback =
      base::Bind(PermissionStatusCallbackWrapper, response_callback);
  return RequestPermissions({ permission }, render_frame_host,
      requesting_origin, user_gesture, callback);
}

int BravePermissionManager::RequestPermissions(
    const std::vector<content::PermissionType>& permissions,
    content::RenderFrameHost* render_frame_host,
    const GURL& requesting_origin,
    bool user_gesture,
    const base::Callback<void(
    const std::vector<blink::mojom::PermissionStatus>&)>& response_callback) {
  int render_frame_id = MSG_ROUTING_NONE;
  int render_process_id = MSG_ROUTING_NONE;
  GURL current_origin;
  // web notifications do not currently have an available render_frame_host
  if (render_frame_host) {
    render_process_id = render_frame_host->GetProcess()->GetID();

    content::WebContents* web_contents =
        content::WebContents::FromRenderFrameHost(render_frame_host);

    if (web_contents) {
      render_frame_id = render_frame_host->GetRoutingID();
      current_origin = web_contents->GetLastCommittedURL();
    }
  }
  std::vector<blink::mojom::PermissionStatus> permissionStatuses;
  for (auto permission : permissions) {
    if (permission == content::PermissionType::MIDI_SYSEX) {
      content::ChildProcessSecurityPolicy::GetInstance()->
          GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
    }
    permissionStatuses.push_back(blink::mojom::PermissionStatus::GRANTED);
  }

  if (!request_handler_.is_null()) {
    ++request_id_;
    auto callback = base::Bind(&BravePermissionManager::OnPermissionResponse,
                               base::Unretained(this),
                               request_id_,
                               requesting_origin,
                               response_callback,
                               permissions);
    pending_requests_[request_id_] =
        { render_process_id, render_frame_id, callback, permissions.size() };
    request_handler_.Run(current_origin, requesting_origin, permissions,
      callback);
    return request_id_;
  }

  response_callback.Run(permissionStatuses);
  return kNoPendingOperation;
}

device::mojom::GeolocationControl*
BravePermissionManager::GetGeolocationControl() {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  if (geolocation_control_)
    return geolocation_control_.get();

  auto request = mojo::MakeRequest(&geolocation_control_);
  if (!content::ServiceManagerConnection::GetForProcess())
    return geolocation_control_.get();

  service_manager::Connector* connector =
      content::ServiceManagerConnection::GetForProcess()->GetConnector();
  connector->BindInterface(device::mojom::kServiceName, std::move(request));
  return geolocation_control_.get();
}

void BravePermissionManager::OnPermissionResponse(
    int request_id,
    const GURL& origin,
    const ResponseCallback& callback,
    const std::vector<content::PermissionType>& permissions,
    const std::vector<blink::mojom::PermissionStatus>& status) {
  auto request = pending_requests_.find(request_id);
  if (request != pending_requests_.end()) {
    if (!WebContentsDestroyed(
        request->second.render_process_id, request->second.render_frame_id)) {
      for (int i = 0; i < permissions.size(); i++) {
        if (permissions[i] == content::PermissionType::GEOLOCATION) {
          if (status[i] == blink::mojom::PermissionStatus::GRANTED) {
            GetGeolocationControl()->UserDidOptIntoLocationServices();
          }
        }
      }
      callback.Run(status);
    }
    pending_requests_.erase(request);
  }
}

void BravePermissionManager::CancelPermissionRequest(int request_id) {
  auto request = pending_requests_.find(request_id);
  if (request != pending_requests_.end()) {
    if (!WebContentsDestroyed(
        request->second.render_process_id, request->second.render_frame_id)) {
      std::vector<blink::mojom::PermissionStatus> permissionStatuses;
      for (size_t i = 0; i < request->second.size; i++) {
        permissionStatuses.push_back(blink::mojom::PermissionStatus::DENIED);
      }
      request->second.callback.Run(permissionStatuses);
      // We should not erase from the map here because the callback which calls
      // BravePermissionManager::OnPermissionResponse will remove.
    } else {
      pending_requests_.erase(request);
    }
  }
}

void BravePermissionManager::ResetPermission(
    content::PermissionType permission,
    const GURL& requesting_origin,
    const GURL& embedding_origin) {
}

blink::mojom::PermissionStatus BravePermissionManager::GetPermissionStatus(
    content::PermissionType permission,
    const GURL& requesting_origin,
    const GURL& embedding_origin) {
  return blink::mojom::PermissionStatus::GRANTED;
}

blink::mojom::PermissionStatus
BravePermissionManager::GetPermissionStatusForFrame(
    content::PermissionType permission,
    content::RenderFrameHost* render_frame_host,
    const GURL& requesting_origin) {
  LOG(INFO) << __FUNCTION__ << ": " << static_cast<int>(permission);
  return blink::mojom::PermissionStatus::GRANTED;
}

int BravePermissionManager::SubscribePermissionStatusChange(
    content::PermissionType permission,
    const GURL& requesting_origin,
    const GURL& embedding_origin,
    const base::Callback<void(blink::mojom::PermissionStatus)>& callback) {
  return -1;
}

void BravePermissionManager::UnsubscribePermissionStatusChange(
    int subscription_id) {
}

}  // namespace brave


text:
package com.atg.openssp.core.exchange.channel.rtb;

import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;

import com.atg.openssp.common.configuration.GlobalContext;
import com.atg.openssp.common.demand.ResponseContainer;
import com.google.common.util.concurrent.ThreadFactoryBuilder;

/**
 * ServiceFacade to create a Executor Service {@link ExecutorService} and invoke a collection of callables which performing the rtb calls to the demand-side.
 *
 * @author André Schmer
 */
public final class DemandExecutorServiceFacade {

	public static final DemandExecutorServiceFacade instance = new DemandExecutorServiceFacade();

	private final ExecutorService service;

	private DemandExecutorServiceFacade() {
		final ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("DemandConnector-%d").setDaemon(true).build();
		service = Executors.newCachedThreadPool(namedThreadFactory);
	}

	/**
	 * This method invokes the given list of {@link DemandBroker} by using a {@link ExecutorService}.
	 *
	 * @param {@code demandConnectors} a list of callable DemandBrokers which must implement the {@link Callable} interface.
	 * @return a List of {@link Future}s containing {@link ResponseContainer}
	 * @throws InterruptedException
	 */
	List<Future<ResponseContainer>> invokeAll(final List<DemandBroker> demandConnectors) throws InterruptedException {
		final long execTO = (long) (GlobalContext.getExecutionTimeout() - (GlobalContext.getExecutionTimeout() * 0.2));
		return service.invokeAll(demandConnectors, execTO, TimeUnit.MILLISECONDS);
	}

	/**
	 * ExecutorService shutdown.
	 */
	public void shutdown() {
		if (service != null && !service.isShutdown()) {
			service.shutdown();
		}
	}
}


text:
//
//  etpushsdk.h
//  etpushsdk
//
//  Created by Eddie Roger on 9/7/12.
//  Copyright (c) 2012 ExactTarget, Inc. All rights reserved.
//

// SDK Version
#define ETPushSDKVersionString @"3.3.0"
#define ETPushSDKVersionNumber 3300

/**
 Helpers.
 */
#define ETNotify(notification) \
    [[NSNotificationCenter defaultCenter] postNotificationName:notification object:nil];

/**
 Notification that is sent when a push fails for some reason.
 */
/** @constant ETPush Notifications Sent when the data request process has started */
#define ETRequestStarted                @"ETRequestStarted"
#define ETRequestNoData                 @"ETRequestNoData"
#define ETRequestFailed                 @"ETRequestFailed"
#define ETRequestComplete               @"ETRequestComplete"
#define ETRequestFailedOnLoadingResult  @"ETRequestFailedOnLoadingResult"
#define ETRequestServiceReturnedError   @"ETRequestServiceReturnedError"
#define ETRequestServiceResponseSuccess @"ETRequestServiceResponseSuccess"
#define ETRequestFinishedWithFailure    @"ETRequestFinishedWithFailure"

/**
  Constants for dealing with other stuff
  */
#define AppLifecycleForeground              @"AppLifecycleForeground"
#define AppLifecycleBackground              @"AppLifecycleBackground"

/**
 Notifications around Messages
 */
#define RichMessagesNowAvailable        @"RichMessagesNowAvailable"

/**
 Geofence Constants
 */
#define ETLargeGeofence                 433 // Get it? 433 North Capitol. It's been a long journey getting here.
#define ETLargeGeofenceIdentifier       @"ExactTargetMagicGlobalFence"

/**
 Caches
 */
#define ET_TAG_CACHE                    @"ET_TAG_CACHE"
#define ET_SUBKEY_CACHE                 @"ET_SUBKEY_CACHE"
#define ET_ATTR_CACHE                   @"ET_ATTR_CACHE"

/**
 Deprecation warning declaration
 */
#define __DEPRECATED_WARNING(message) __attribute((deprecated(message)))

// Tracks the BOOL for each in NSUserDefaults
static NSString * const ETLocationServicesActive    = @"ETLocationServicesActive";
static NSString * const ETCloudPagesActive          = @"ETCloudPagesActive";
static NSString * const ETAnalyticsActive           = @"ETAnalyticsActive";

typedef enum {
    PushOriginationStateBackground = 0,
    PushOriginationStateForeground
} PushOriginationState;


text:
package generator

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestAppRenderRouterPackage(t *testing.T) {
	const expectedRouter = `package routers
import (
	"github.com/astaxie/beego"
	"github.com/ericpai/morphling_test/controllers"
)

func init() {
	apiNs := beego.NewNamespace("/api",
		beego.NSNamespace("/test_users",
			beego.NSRouter("/:test_user_id([0-9]+|all)", &controllers.TestUserController{}, "get:Get"),
			beego.NSRouter("/", &controllers.TestUserController{}, "post:Post"),
			beego.NSRouter("/:test_user_id([0-9]+)", &controllers.TestUserController{}, "put:Put"),
			beego.NSRouter("/:test_user_id([0-9]+)", &controllers.TestUserController{}, "delete:Delete"),
		),
		beego.NSNamespace("/departments",
			beego.NSRouter("/:department_id([0-9]+|all)", &controllers.DepartmentController{}, "get:Get"),
			beego.NSRouter("/", &controllers.DepartmentController{}, "post:Post"),
			beego.NSRouter("/:department_id([0-9]+)", &controllers.DepartmentController{}, "put:Put"),
			beego.NSRouter("/:department_id([0-9]+)", &controllers.DepartmentController{}, "delete:Delete"),
		),
	)
	beego.AddNamespace(apiNs)
}
`
	app := getMockApp()
	assert.NoError(t, app.generate())
	assert.Equal(t, expectedRouter, app.renderRouterPackage())
}


text:
 Controls hosted in this section

**Namespace:** [OfficeDevPnP.Core.Pages](OfficeDevPnP.Core.Pages.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public List<CanvasControl> Controls { get; }
```

### Property Value
Type: System.Collections.Generic.List<OfficeDevPnP.Core.Pages.CanvasControl>

## See also
- [CanvasSection](OfficeDevPnP.Core.Pages.CanvasSection.md)
- [OfficeDevPnP.Core.Pages.CanvasColumn](OfficeDevPnP.Core.Pages.CanvasColumn.md)
- [OfficeDevPnP.Core.Pages](OfficeDevPnP.Core.Pages.md)


text:
var metresToMiles = function(metres) {
  var metresPerMile = 1609.34;
  return Math.round(metres / metresPerMile);
};

var milesToTime = function(miles) {
  var planeSpeed = 500;
  return Math.round(miles / planeSpeed);
};

var milesToPrice = function(miles) {
  return Math.round(50 + miles * 0.11) * 2;
};

var kelvinToCelcius = function(kelvin) {
  var offset = 273.15;
  return Math.round(kelvin - offset);
};

module.exports = function(city) {
  var url = 'http://api.openweathermap.org/data/2.5/weather?q=';
  url = url + encodeURIComponent(city);

  $.getJSON(url, function(data) {
    var celcius = kelvinToCelcius(data.main.temp);
    var description = data.weather[0].description;

    $('.degrees').text(celcius);
    $('.weather').text(description);

    var end = {
      latitude: data.coord.lat,
      longitude: data.coord.lon
    };

    var href = "http://forecast.io/#/f/" + end.latitude + "," + end.longitude;

    $('#weather-link').attr('href', href);

    if (!navigator.geolocation) {
      console.error('Geolocation is not supported by this browser.');
      return;
    }

    navigator.geolocation.getCurrentPosition(function(position) {
      var start = position.coords;
      var metres = geolib.getDistance(start, end);
      var miles = metresToMiles(metres);
      var travelTime = milesToTime(miles);
      var price = milesToPrice(miles);

      $('.distance').text(miles);
      $('.travel-time').text(travelTime);
      $('.flight-price').text(price);
    });
  });
};


text:
package com.ce.game.myapplication.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Movie;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;

import com.ce.game.myapplication.R;

/**
 * Created by KyleCe on 2016/8/30.
 *
 * @author: KyleCe
 */
public class GifView extends View {

    private static final int DEFAULT_MOVIE_VIEW_DURATION = 1000;

    private int mMovieResourceId;
    private Movie movie;

    private long mMovieStart;
    private int mCurrentAnimationTime;

    /**
     * Position for drawing animation frames in the center of the mCarrierHeight.
     */
    private float mLeft;
    private float mTop;

    /**
     * Scaling factor to fit the animation within mCarrierHeight bounds.
     */
    private float mScaleX;
    private float mScaleY;

    /**
     * Scaled movie frames width and height.
     */
    private int mMeasuredMovieWidth;
    private int mMeasuredMovieHeight;

    private volatile boolean mPaused;
    private boolean mVisible = true;

    public GifView(Context context) {
        this(context, null);
    }

    public GifView(Context context, AttributeSet attrs) {
        this(context, attrs, R.styleable.CustomTheme_gifViewStyle);
    }

    public GifView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        setViewAttributes(context, attrs, defStyle);
    }

    @SuppressLint("NewApi")
    private void setViewAttributes(Context context, AttributeSet attrs, int defStyle) {

        /**
         * Starting from HONEYCOMB(Api Level:11) have to turn off HW acceleration to draw
         * Movie on Canvas.
         */
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        }

        final TypedArray array = context.obtainStyledAttributes(attrs,
                R.styleable.GifView, defStyle, R.style.Widget_GifView);

        //-1 is default value
        mMovieResourceId = array.getResourceId(R.styleable.GifView_gif, -1);
        mPaused = array.getBoolean(R.styleable.GifView_paused, false);

        array.recycle();

        if (mMovieResourceId != -1) {
            movie = Movie.decodeStream(getResources().openRawResource(mMovieResourceId));
        }
    }

    public void setGifResource(int movieResourceId) {
        this.mMovieResourceId = movieResourceId;
        movie = Movie.decodeStream(getResources().openRawResource(mMovieResourceId));
        requestLayout();
    }

    public int getGifResource() {

        return this.mMovieResourceId;
    }

    public void play() {
        if (this.mPaused) {
            this.mPaused = false;

            /**
             * Calculate new movie start time, so that it resumes from the same
             * frame.
             */
            mMovieStart = android.os.SystemClock.uptimeMillis() - mCurrentAnimationTime;

            invalidate();
        }
    }

    public void pause() {
        if (!this.mPaused) {
            this.mPaused = true;

            invalidate();
        }

    }

    public boolean isPaused() {
        return this.mPaused;
    }

    public boolean isPlaying() {
        return !this.mPaused;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        if (movie != null) {
            int movieWidth = movie.width();
            int movieHeight = movie.height();

			/*
             * Calculate horizontal scaling
			 */
            float scaleH = 1f;
            int measureModeWidth = MeasureSpec.getMode(widthMeasureSpec);

            if (measureModeWidth != MeasureSpec.UNSPECIFIED) {
                int maximumWidth = MeasureSpec.getSize(widthMeasureSpec);
//                if (movieWidth > maximumWidth) {
                    scaleH = (float) movieWidth / (float) maximumWidth;
//                }
            }

			/*
             * calculate vertical scaling
			 */
            float scaleW = 1f;
            int measureModeHeight = MeasureSpec.getMode(heightMeasureSpec);

            if (measureModeHeight != MeasureSpec.UNSPECIFIED) {
                int maximumHeight = MeasureSpec.getSize(heightMeasureSpec);
//                if (movieHeight > maximumHeight) {
                    scaleW = (float) movieHeight / (float) maximumHeight;
//                }
            }

			/*
             * calculate overall scale
			 */
            mScaleX = 1f /scaleW;
            mScaleY = 1f /scaleH;

            mMeasuredMovieWidth = (int) (movieWidth * mScaleX);
            mMeasuredMovieHeight = (int) (movieHeight * mScaleY);

            setMeasuredDimension(mMeasuredMovieWidth, mMeasuredMovieHeight);

        } else {
			/*
			 * No movie set, just set minimum available size.
			 */
            setMeasuredDimension(getSuggestedMinimumWidth(), getSuggestedMinimumHeight());
        }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
		/*
		 * Calculate mLeft / mTop for drawing in center
		 */
        mLeft = (getWidth() - mMeasuredMovieWidth) / 2f;
        mTop = (getHeight() - mMeasuredMovieHeight) / 2f;

        mVisible = getVisibility() == View.VISIBLE;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (movie != null) {
            if (!mPaused) {
                updateAnimationTime();
                drawMovieFrame(canvas);
                invalidateView();
            } else {
                drawMovieFrame(canvas);
            }
        }
    }

    /**
     * Invalidates mCarrierHeight only if it is mVisible.
     * <br>
     * {@link #postInvalidateOnAnimation()} is used for Jelly Bean and higher.
     */
    @SuppressLint("NewApi")
    private void invalidateView() {
        if (mVisible) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                postInvalidateOnAnimation();
            } else {
                invalidate();
            }
        }
    }

    /**
     * Calculate current animation time
     */
    private void updateAnimationTime() {
        long now = android.os.SystemClock.uptimeMillis();

        if (mMovieStart == 0) {
            mMovieStart = now;
        }

        int dur = movie.duration();

        if (dur == 0) {
            dur = DEFAULT_MOVIE_VIEW_DURATION;
        }

        mCurrentAnimationTime = (int) ((now - mMovieStart) % dur);
    }

    /**
     * Draw current GIF frame
     */
    private void drawMovieFrame(Canvas canvas) {

        movie.setTime(mCurrentAnimationTime);

        canvas.save(Canvas.MATRIX_SAVE_FLAG);
        canvas.scale(mScaleX, mScaleY);
        movie.draw(canvas, mLeft / mScaleX, mTop / mScaleY);
        canvas.restore();
    }

    @SuppressLint("NewApi")
    @Override
    public void onScreenStateChanged(int screenState) {
        super.onScreenStateChanged(screenState);
        mVisible = screenState == SCREEN_STATE_ON;
        invalidateView();
    }

    @SuppressLint("NewApi")
    @Override
    protected void onVisibilityChanged(View changedView, int visibility) {
        super.onVisibilityChanged(changedView, visibility);
        mVisible = visibility == View.VISIBLE;
        invalidateView();
    }

    @Override
    protected void onWindowVisibilityChanged(int visibility) {
        super.onWindowVisibilityChanged(visibility);
        mVisible = visibility == View.VISIBLE;
        invalidateView();
    }
}


text:
<?php
namespace Light\ObjectService\Resource;

use Light\ObjectService\Resource\Selection\NestedCollectionSelection;
use Light\ObjectService\Resource\Selection\NestedComplexSelection;
use Light\ObjectService\Resource\Selection\Selection;
use Light\ObjectService\TestData\Author;
use Light\ObjectService\TestData\Setup;

class SelectionTest extends \PHPUnit_Framework_TestCase
{
	/** @var Setup */
	private $setup;

	protected function setUp()
	{
		parent::setUp();

		$this->setup = Setup::create();
	}

	public function testNestedSelections()
	{
		$typeRegistry = $this->setup->getTypeRegistry();

		$select = Selection::create($typeRegistry->getTypeHelperByName(Author::class));
		$subselect = $select->subselect("posts");

		$this->assertInstanceOf(NestedCollectionSelection::class, $subselect);
		$subselect->fields("id, text");

		$subsubselect = $subselect->subselect("author");
		$this->assertInstanceOf(NestedComplexSelection::class, $subsubselect);

		$this->assertInstanceOf(NestedCollectionSelection::class, $select->getSubSelection("posts"));
		$this->assertInstanceOf(NestedComplexSelection::class, $subselect->getSubSelection("author"));
	}

	/**
	 * @expectedException 			\Light\ObjectAccess\Exception\TypeException
	 * @expectedExceptionMessage	Property invalid does not exist
	 */
	public function testSelectInvalidField()
	{
		$typeRegistry = $this->setup->getTypeRegistry();

		$select = Selection::create($typeRegistry->getTypeHelperByName(Author::class));
		$select->fields("id, invalid");
	}

	public function testSelectAllFields()
	{
		$typeRegistry = $this->setup->getTypeRegistry();

		$select = Selection::create($typeRegistry->getTypeHelperByName(Author::class));
		$select->fields("*");

		$this->assertEquals(array("id", "name", "age", "posts"), $select->getFields());
	}

	public function testSelectAllFieldsMinusSome()
	{
		$typeRegistry = $this->setup->getTypeRegistry();

		$select = Selection::create($typeRegistry->getTypeHelperByName(Author::class));
		$select->fields("*, -age");

		$this->assertEquals(array("id", "name", "posts"), $select->getFields());
	}

}


text:
const ApiContext = require('../../../../modules/ApiContext');
const MongoAdapter = require('../../../../modules/MongoAdapter');
const v = require('validator');
const $ = require('cafy').default;

/** @param {ApiContext} apiContext */
exports.get = async (apiContext) => {
	await apiContext.proceed({
		query: {
			limit: { cafy: $().string().pipe(i => v.isInt(i, { min: 0, max: 100 })), default: '30' },
			next: { cafy: $().string().pipe(i => MongoAdapter.validateId(i)), default: null }
		},
		scopes: ['user.read']
	});
	if (apiContext.responsed) return;

	// convert query value
	const limit = v.toInt(apiContext.query.limit);
	const next = apiContext.query.next != null ? MongoAdapter.buildId(apiContext.query.next) : null;

	// user
	const user = await apiContext.repository.findById('users', apiContext.params.id);
	if (user == null) {
		apiContext.response(404, 'user as premise not found');
		return;
	}

	// このユーザーを対象とするフォロー関係をすべて取得
	const userFollowings = await apiContext.userFollowingsService.findTargets(user._id, { limit, since: next });
	if (userFollowings.length == 0) {
		apiContext.response(204);
		return;
	}

	// fetch and serialize users
	const promises = userFollowings.map(async following => {
		const user = await apiContext.repository.findById('users', following.target);
		if (user == null) {
			console.log(`notfound following target userId: ${following.target.toString()}`);
			return;
		}
		return apiContext.usersService.serialize(user);
	});

	apiContext.response(200, {
		users: await Promise.all(promises),
		next: userFollowings[userFollowings.length-1]._id
	});
};


text:
/* Generated code */

interface UserGroupManagerResource {

	uri?: string;

	id?: string;

	extensionNumber?: string;

	firstName?: string;

	lastName?: string;
}

export default UserGroupManagerResource;


text:
<?php
namespace Postmark\Models\Webhooks;

/**
 * Settings for Delivery webhooks.
 */
class WebhookConfigurationDeliveryTrigger implements \JsonSerializable {

    private $enabled;

    /**
     * Create a new WebhookConfigurationDeliveryTrigger.
     *
     * @param boolean $enabled Specifies whether or not webhooks will be triggered by Delivery events.
     */
    public function __construct($enabled = false) {
        $this->enabled = $enabled;
    }

    public function jsonSerialize() {
        $retval = array(
            "Enabled" => $this->enabled
        );

        return $retval;
    }

    public function getEnabled() {
        return $this->enabled;
    }
}

?>


text:
use boxed::Box;
use convert::Into;
use error;
use fmt;
use marker::Send;
use option::Option::{self, Some, None};
use result;
use sys;

/// A type for results generated by I/O related functions where the `Err` type
/// is hard-wired to `io::Error`.
///
/// This typedef is generally used to avoid writing out `io::Error` directly and
/// is otherwise a direct mapping to `std::result::Result`.
#[stable(feature = "rust1", since = "1.0.0")]
pub type Result<T> = result::Result<T, Error>;

/// The error type for I/O operations of the `Read`, `Write`, `Seek`, and
/// associated traits.
///
/// Errors mostly originate from the underlying OS, but custom instances of
/// `Error` can be created with crafted error messages and a particular value of
/// `ErrorKind`.
#[derive(Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Error {
    repr: Repr,
}

#[derive(Debug)]
enum Repr {
    Os(i32),
    Custom(Box<Custom>),
}

#[derive(Debug)]
struct Custom {
    kind: ErrorKind,
    error: Box<error::Error+Send>,
}

/// A list specifying general categories of I/O error.
///
/// This list is intended to grow over time and it is not recommended to
/// exhaustively match against it.
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub enum ErrorKind {
    /// An entity was not found, often a file.
    #[stable(feature = "rust1", since = "1.0.0")]
    NotFound,
    /// The operation lacked the necessary privileges to complete.
    #[stable(feature = "rust1", since = "1.0.0")]
    PermissionDenied,
    /// The connection was refused by the remote server.
    #[stable(feature = "rust1", since = "1.0.0")]
    ConnectionRefused,
    /// The connection was reset by the remote server.
    #[stable(feature = "rust1", since = "1.0.0")]
    ConnectionReset,
    /// The connection was aborted (terminated) by the remote server.
    #[stable(feature = "rust1", since = "1.0.0")]
    ConnectionAborted,
    /// The network operation failed because it was not connected yet.
    #[stable(feature = "rust1", since = "1.0.0")]
    NotConnected,
    /// A socket address could not be bound because the address is already in
    /// use elsewhere.
    #[stable(feature = "rust1", since = "1.0.0")]
    AddrInUse,
    /// A nonexistent interface was requested or the requested address was not
    /// local.
    #[stable(feature = "rust1", since = "1.0.0")]
    AddrNotAvailable,
    /// The operation failed because a pipe was closed.
    #[stable(feature = "rust1", since = "1.0.0")]
    BrokenPipe,
    /// An entity already exists, often a file.
    #[stable(feature = "rust1", since = "1.0.0")]
    AlreadyExists,
    /// The operation needs to block to complete, but the blocking operation was
    /// requested to not occur.
    #[stable(feature = "rust1", since = "1.0.0")]
    WouldBlock,
    /// A parameter was incorrect.
    #[stable(feature = "rust1", since = "1.0.0")]
    InvalidInput,
    /// The I/O operation's timeout expired, causing it to be canceled.
    #[stable(feature = "rust1", since = "1.0.0")]
    TimedOut,
    /// An error returned when an operation could not be completed because a
    /// call to `write` returned `Ok(0)`.
    ///
    /// This typically means that an operation could only succeed if it wrote a
    /// particular number of bytes but only a smaller number of bytes could be
    /// written.
    #[stable(feature = "rust1", since = "1.0.0")]
    WriteZero,
    /// This operation was interrupted.
    ///
    /// Interrupted operations can typically be retried.
    #[stable(feature = "rust1", since = "1.0.0")]
    Interrupted,
    /// Any I/O error not part of this list.
    #[stable(feature = "rust1", since = "1.0.0")]
    Other,

    /// Any I/O error not part of this list.
    #[unstable(feature = "std_misc",
               reason = "better expressed through extensible enums that this \
                         enum cannot be exhaustively matched against")]
    #[doc(hidden)]
    __Nonexhaustive,
}

impl Error {
    /// Creates a new I/O error from a known kind of error as well as an
    /// arbitrary error payload.
    ///
    /// This function is used to generically create I/O errors which do not
    /// originate from the OS itself. The `error` argument is an arbitrary
    /// payload which will be contained in this `Error`. Accessors as well as
    /// downcasting will soon be added to this type as well to access the custom
    /// information.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::io::{Error, ErrorKind};
    ///
    /// // errors can be created from strings
    /// let custom_error = Error::new(ErrorKind::Other, "oh no!");
    ///
    /// // errors can also be created from other errors
    /// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
    /// ```
    #[stable(feature = "rust1", since = "1.0.0")]
    pub fn new<E>(kind: ErrorKind, error: E) -> Error
        where E: Into<Box<error::Error+Send>>
    {
        Error {
            repr: Repr::Custom(Box::new(Custom {
                kind: kind,
                error: error.into(),
            }))
        }
    }

    /// Returns an error representing the last OS error which occurred.
    ///
    /// This function reads the value of `errno` for the target platform (e.g.
    /// `GetLastError` on Windows) and will return a corresponding instance of
    /// `Error` for the error code.
    #[stable(feature = "rust1", since = "1.0.0")]
    pub fn last_os_error() -> Error {
        Error::from_raw_os_error(sys::os::errno() as i32)
    }

    /// Creates a new instance of an `Error` from a particular OS error code.
    #[stable(feature = "rust1", since = "1.0.0")]
    pub fn from_raw_os_error(code: i32) -> Error {
        Error { repr: Repr::Os(code) }
    }

    /// Creates a new instance of an `Error` from a particular OS error code.
    #[unstable(feature = "io", reason = "deprecated")]
    #[deprecated(since = "1.0.0", reason = "renamed to from_raw_os_error")]
    pub fn from_os_error(code: i32) -> Error {
        Error { repr: Repr::Os(code) }
    }

    /// Returns the OS error that this error represents (if any).
    ///
    /// If this `Error` was constructed via `last_os_error` then this function
    /// will return `Some`, otherwise it will return `None`.
    #[stable(feature = "rust1", since = "1.0.0")]
    pub fn raw_os_error(&self) -> Option<i32> {
        match self.repr {
            Repr::Os(i) => Some(i),
            Repr::Custom(..) => None,
        }
    }

    /// Return the corresponding `ErrorKind` for this error.
    #[stable(feature = "rust1", since = "1.0.0")]
    pub fn kind(&self) -> ErrorKind {
        match self.repr {
            Repr::Os(code) => sys::decode_error_kind(code),
            Repr::Custom(ref c) => c.kind,
        }
    }
}

#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Display for Error {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        match self.repr {
            Repr::Os(code) => {
                let detail = sys::os::error_string(code);
                write!(fmt, "{} (os error {})", detail, code)
            }
            Repr::Custom(ref c) => c.error.fmt(fmt),
        }
    }
}

#[stable(feature = "rust1", since = "1.0.0")]
impl error::Error for Error {
    fn description(&self) -> &str {
        match self.repr {
            Repr::Os(..) => "os error",
            Repr::Custom(ref c) => c.error.description(),
        }
    }
}


text:
package tty

import (
	"fmt"
)

// ECode is an ANSI escape code
type ECode int

// Ansi escape code constants. See
// http://ascii-table.com/ansi-escape-sequences.php

// General text attributes
const (
	OFF  ECode = iota
	BOLD       // 1
	_
	_
	UNDERLINE // 4
	BLINK     // 5
	_
	REVERSE   // 7
	CONCEALED // 8
)

// Foreground text attributes
const (
	BLACK   ECode = iota + 30
	RED           // 31
	GREEN         // 32
	YELLOW        // 33
	BLUE          // 34
	MAGENTA       // 35
	CYAN          // 36
	WHITE         // 37
)

// Background text attributes
const (
	BG_GREY    ECode = iota + 40
	BG_RED           // 41
	BG_GREEN         // 42
	BG_YELLOW        // 43
	BG_BLUE          // 44
	BG_MAGENTA       // 45
	BG_CYAN          // 46
	BG_WHITE         // 47
)

// AnsiEscape accepts ANSI escape codes and strings to form escape sequences.
// For example, to create a string with a colorized prefix,
//
//      AnsiEscape(BOLD, GREEN, "[DEBUG] ", OFF, "Here is the debug output")
//
// and a nicely escaped string for terminal output will be returned.
func AnsiEscape(c ...interface{}) (out string) {
	for _, val := range c {
		switch t := val.(type) {
		case ECode:
			out += fmt.Sprintf("\x1b[%dm", val)
		case string:
			out += fmt.Sprintf("%s", val)
		default:
			fmt.Printf("unexpected type: %T\n", t)
		}
	}
	if c[len(c)-1] != OFF {
		out += "\x1b[0m"
	}
	return
}

// AnsiEscapeS is like AnsiEscape, but takes only one escape code, and wrap the given
// text using that code and OFF
func AnsiEscapeS(code ECode, msg string) string {
	return fmt.Sprintf("\x1b[%dm%s\x1b[0m", code, msg)
}