text:
function Changes (opts) {
  if (!opts) { opts = {}; }

  this._rev = 0;
  this._items = [];
  this._maxLength = opts.maxLength || 20;
}

/*

  Push a change onto the feed

*/
Changes.prototype.push = function (item) {
  this._items.push(item);

  // drop the tail item when it gets too long
  if (this._items.length > this._maxLength) {
    this._items.shift();
  }

  this._rev += 1;
  return this._rev;
};

/*

  Get the revision id of the last change

*/
Changes.prototype.getHeadRev = function () {
  return this._rev;
};

/*

  Get a list of changes since the given revision id

*/
Changes.prototype.getSince = function (rev) {
  //> if the history we're asking for hasn't happened yet, throw an error
  if (rev > this._rev) {
    throw new Error('history too far forward');
  }

  var size = this._rev - rev;

  //> if the history we're asking for has been erased, throw an error
  if (size > this._items.length) {
    throw new Error('history too far behind');
  }

  return this._items.slice(this._items.length - size);
};

module.exports = Changes;

redpajama_set_name: RedPajamaGithub


text:
import decimal
import os
import random
import urlparse

import bson
import flask
import markdown
import pymongo

MONGO_URL = 'mongodb://localhost:27017/neural-noise'
client = pymongo.MongoClient(MONGO_URL)
db = client.get_default_database()

app = flask.Flask(__name__)

def is_debug():
  return os.environ.get('FLASK_ENV') != 'production'

def random_song(checkpoint, temperature):
  # Taken from http://stackoverflow.com/a/21867984/41060
  query = {
    'checkpoint': { '$eq': checkpoint },
    'random': { '$lte': random.random() },
  }
  if temperature:
    query['temperature'] = { '$eq': temperature }

  cursor = db.songs.find(query).sort('random', pymongo.DESCENDING)
  try:
    doc = next(cursor)
  except StopIteration:
    del query['random']
    cursor = db.songs.find(query).sort('random', pymongo.DESCENDING);
    try:
      doc = next(cursor)
    except StopIteration:
      return None

  doc['random'] = random.random();
  db.songs.update({ '_id': doc['_id'] }, doc);
  return doc

@app.route('/')
def index():
  checkpoints = [cp for cp in db.checkpoints.find({})]
  return flask.render_template('index.html', checkpoints=checkpoints)

@app.route('/query')
def query():
  temperature = flask.request.args.get('temperature')
  checkpoint = flask.request.args.get('checkpoint')
  song = random_song(checkpoint, temperature)
  if not song:
    return 'Error: no songs at checkpoint=%s with temperature=%s found' % (checkpoint, temperature)
  return flask.redirect(flask.url_for(
    'render', checkpoint=checkpoint, id_=str(song['_id'])))

@app.route('/render/<checkpoint>/<id_>')
def render(checkpoint, id_):
  song = db.songs.find_one({
    '_id': { '$eq': bson.objectid.ObjectId(id_) }
  })
  song['abc_rows'] = song['abc'].count('\n') + int(len(song['abc'])/100)
  checkpoint = db.checkpoints.find_one({
    'name': { '$eq': song['checkpoint'] }
  })

  return flask.render_template('render.html', song=song, checkpoint=checkpoint)

@app.route('/2png/<id_>.png')
def png(id_):
  parts = urlparse.urlparse(flask.request.url)
  new_host = flask.request.headers['Host']
  if new_host.find(':') != -1:
    new_host = new_host[:new_host.find(':')]  # Strip out port
  new_path = parts.path.replace('2png', 'png')
  # Replace the /2png/ with just /png/.
  new_parts = [parts.scheme, new_host, new_path, '', '']
  new_url = urlparse.urlunsplit(new_parts)
  return flask.redirect(new_url)

@app.route('/about')
def about():
  md_path = os.path.join(os.path.dirname(__file__), 'templates/_about.md')
  with open(md_path) as f:
    content = flask.Markup(markdown.markdown(f.read().decode('utf-8')))
  return flask.render_template('about.html', content=content)

if __name__ == '__main__':
  app.run(debug=is_debug(), host='0.0.0.0')


text:
Imports SistFoncreagro.BussinessEntities

Public Interface IConveMarcoRepository
    Function GetAllFromConveMarco() As List(Of ConveMarco)
    Function GetFromConveMarcoByIdConveMarco(ByVal _id As Int32) As ConveMarco
    Function GetFromConveMarcoByParameter(ByVal _Texto As String) As List(Of ConveMarco)
    Function SaveConveMarco(ByVal _ConveMarco As ConveMarco) As Int32
    Sub DeleteConveMarco(ByVal _id As Int32)
End Interface


text:
<?php

namespace Sonata\Tests\Component\Delivery;

use Sonata\Component\Delivery\FreeDelivery;

/**
 * Class FreeDeliveryTest
 *
 * @package Sonata\Tests\Component\Delivery
 *
 * @author  Hugo Briand <briand@ekino.com>
 */
class FreeDeliveryTest extends \PHPUnit_Framework_TestCase
{
    public function testConstruct()
    {
        $freeDelivery = new FreeDelivery(false);
        $this->assertFalse($freeDelivery->isAddressRequired());

        $freeDelivery = new FreeDelivery(true);
        $this->assertTrue($freeDelivery->isAddressRequired());
    }

    public function testPriceIsNull()
    {
        $freeDelivery = new FreeDelivery(false);
        $this->assertEquals(0, $freeDelivery->getVatRate());
        $this->assertEquals(0, $freeDelivery->getPrice());
    }

    public function testGetName()
    {
        $freeDelivery = new FreeDelivery(false);
        $this->assertEquals("Free delivery", $freeDelivery->getName());
    }
}


text:
Ext.define('makeWords.controller.Control', {
    extend: 'Ext.app.Controller',
    requires: ['makeWords.util.Globals'],
    config: {
        refs: {
        	Main : 'main',
            CatList: 'CatList',
            'fileLoadBtn': 'main #fileLoadBtn',
            'loadedImage': 'main #loadedImage'
        },
        control: {

        	'CatList' : {
        		itemtap : 'showImage'
        	},

            'main' : {
                hideCommand : 'onHideCommand'
            },

            fileLoadBtn: {
                loadsuccess: 'onFileLoadSuccess',
                loadfailure: 'onFileLoadFailure'
            }

        }
    },

    joomla: '',

    onFileLoadSuccess: function(dataurl, e) {
        console.log('File loaded');
        //alert(dataurl);
        var me = this;
        var image = me.getLoadedImage();
        image.setSrc(dataurl);
    },

    onFileLoadFailure: function(message) {
        /*Ext.device.Notification.show({
            title: 'Loading error',
            message: message,
            buttons: Ext.MessageBox.OK,
            callback: Ext.emptyFn
        });*/
        alert(message);
    },

    /**
     * show image
     */
    showImage: function(list, index, target, record) {
        this.setImageData();
    },

    /**
     * show image
     */
    loadImage: function() {

         // Cordova commands

        // alert("loadImage: "+window.localStorage.getItem("installed"));
        var check = window.localStorage.getItem("installed");

            if ( check ) {

                // alert("in");

                Ext.getStore('Images').load();
                alert(Ext.getStore("Images").getCount());

                var store = Ext.getStore("Images");
                var gallery = Ext.getCmp('img-grid');
                gallery.renderImages(store);

                // alert("out");

            }

    },

    /**
     * set image data
     */
    onHideCommand: function() {

       /* if (Ext.getCmp('catlist').getFlex() == 1) {
            Ext.getCmp('catlist').setFlex(0);
        }
        else{
            Ext.getCmp('catlist').setFlex(1);
        }

            alert("YOLO");
            navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
                 targetWidth: 200,
                 targetHeight: 200,
                 destinationType: destinationType.FILE_URI,
                 sourceType: Camera.PictureSourceType.PHOTOLIBRARY
            });

            function onPhotoURISuccess(imageURI) {
                //var image = document.getElementById('myImage');
                //image.src = imageURI;
                alert(imageURI);
            }

            function onFail(message) {
                alert('Failed because: ' + message);
            }*/

    },

    /**
     * set image data
     */
    setImageData: function(){

        // gallery view
        var gallery = this.getMain().down('image-grid-list-panel');

        // store data
        // var store = Ext.create('makeWords.store.Images');
        // var  urls = [
        //     'resources/images/1.jpg',
        //     'resources/images/2.jpg',
        //     'resources/images/3.jpg',
        //     'resources/images/4.jpg',
        //     'resources/images/5.jpg',
        //     'resources/images/5.jpg',
        //     'resources/images/7.jpg',
        //     'resources/images/8.jpg',
        //     'resources/images/9.jpg',
        //     'resources/images/10.jpg',
        //     'resources/images/11.jpg',
        //     'resources/images/12.jpg',
        //     'resources/images/13.jpg',
        //     'resources/images/14.jpg',
        //     'resources/images/15.jpg',
        //     'resources/images/16.jpg',
        //     'resources/images/17.jpg',
        //     'resources/images/18.jpg',
        //     'resources/images/19.jpg',
        //     'resources/images/20.jpg'
        // ];
        // var model;

        // for(var i = 0, length = urls.length; i < length; i++){
        //     model = Ext.create(makeWords.model.Image);
        //     model.set('url', urls[i]);
        //     model.set('title', 'toto');
        //     store.add(model);
        // }

        var store = Ext.getStore("Images");

        gallery.renderImages(store);

    },

    /**
     * @method launch
     * Launch function
     */
    launch:function() {

         console.log("Launch running");

         // Cordova commands
        document.addEventListener("deviceready", onDeviceReady, false);

         function onDeviceReady() {
            if (window.localStorage.getItem("installed") == undefined) {

                // add a Record
                Ext.getStore('Images').add([
                       {
                        url: "resources/images/urgent/400px/oublier.png",
                        title: "oublier"
                        },
                        {
                        url: "resources/images/urgent/400px/medicaments.png",
                        title: "medicaments"
                        },
                        {
                        url: "resources/images/urgent/400px/partir.png",
                        title: "partir"
                        },
                        {
                        url: "resources/images/urgent/400px/stop.png",
                        title: "stop"
                        },
                        {
                        url: "resources/images/urgent/400px/batterie.png",
                        title: "batterie"
                        },
                        {
                        url: "resources/images/urgent/400px/mouchoir.png",
                        title: "mouchoir"
                        },
                        {
                        url: "resources/images/urgent/400px/fatigue.png",
                        title: "fatigue"
                        },
                        {
                        url: "resources/images/urgent/400px/froid.png",
                        title: "froid"
                        },
                        {
                        url: "resources/images/urgent/400px/chaud.png",
                        title: "chaud"
                        },
                        {
                        url: "resources/images/urgent/400px/gratte.png",
                        title: "gratte"
                        },
                        {
                        url: "resources/images/urgent/400px/angoisse.png",
                        title: "angoisse"
                        },
                        {
                        url: "resources/images/urgent/400px/douleur.png",
                        title: "douleur"
                        },
                        {
                        url: "resources/images/urgent/400px/aide.png",
                        title: "aide"
                        },
                        {
                        url: "resources/images/urgent/400px/argent.png",
                        title: "argent"
                        },
                        {
                        url: "resources/images/urgent/400px/vomir.png",
                        title: "vomir"
                        },
                        {
                        url: "resources/images/urgent/400px/boire.png",
                        title: "boire"
                        },
                        {
                        url: "resources/images/urgent/400px/mixer.png",
                        title: "mixer"
                        },
                        {
                        url: "resources/images/urgent/400px/faim.png",
                        title: "faim"
                        },
                        {
                        url: "resources/images/urgent/400px/urgent.png",
                        title: "urgent"
                        }
                 ]);

                // Write the record to disk
                Ext.getStore('Images').sync();

                // Add recorded data to the image grid component
                var store = Ext.getStore("Images");
                var gallery = Ext.getCmp('img-grid');

                gallery.renderImages(store);

                // makeWords.util.Globals.setInstalled("true");
                window.localStorage.setItem("installed", true);

            }

        }

    }

});


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

package com.google.api.ads.admanager.jaxws.v202208;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for AdUnitCodeError.Reason.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="AdUnitCodeError.Reason">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="INVALID_CHARACTERS"/>
 *     <enumeration value="INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED"/>
 *     <enumeration value="INVALID_CHARACTERS_FOR_LEGACY_AD_EXCHANGE_TAG"/>
 *     <enumeration value="LEADING_FORWARD_SLASH"/>
 *     <enumeration value="RESERVED_CODE"/>
 *     <enumeration value="UNKNOWN"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "AdUnitCodeError.Reason")
@XmlEnum
public enum AdUnitCodeErrorReason {

    /**
     *
     *                 For {@link AdUnit#adUnitCode}, only alpha-numeric characters,
     *                 underscores, hyphens, periods, asterisks, double quotes, back slashes,
     *                 forward slashes, exclamations, left angle brackets, colons and
     *                 parentheses are allowed.
     *
     *
     */
    INVALID_CHARACTERS,

    /**
     *
     *                 For {@link AdUnit#adUnitCode}, only letters, numbers,
     *                 underscores, hyphens, periods, asterisks, double quotes, back slashes,
     *                 forward slashes, exclamations, left angle brackets, colons and
     *                 parentheses are allowed.
     *
     *
     */
    INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED,

    /**
     *
     *                 For {@link AdUnit#adUnitCode} representing slot codes, only alphanumeric characters,
     *                 underscores, hyphens, periods and colons are allowed.
     *
     *
     */
    INVALID_CHARACTERS_FOR_LEGACY_AD_EXCHANGE_TAG,

    /**
     *
     *                 For {@link AdUnit#adUnitCode}, forward slashes are not allowed as
     *                 the first character.
     *
     *
     */
    LEADING_FORWARD_SLASH,

    /**
     *
     *                 Specific codes matching ca-*pub-*-tag are reserved for "Web Property IUs"
     *                 generated as part of the SlotCode migration.
     *
     *
     */
    RESERVED_CODE,

    /**
     *
     *                 The value returned if the actual value is not exposed by the requested API version.
     *
     *
     */
    UNKNOWN;

    public String value() {
        return name();
    }

    public static AdUnitCodeErrorReason fromValue(String v) {
        return valueOf(v);
    }

}


text:
package com.dotosoft.dot4command.impl;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;

import org.junit.Before;
import org.junit.Test;

import com.dotosoft.dot4command.chain.Context;

/**
 * Extension of ContextBaseTestCase to validate property
 * delegation.
 *
 * @version $Id$
 */
public class TestContextTestCase extends ContextBaseTestCase {

    @Override
    @Before
    public void setUp() {
        context = createContext();
    }

    @Override
    @Test
    public void testPristine() {
        super.testPristine();
        assertEquals("readOnly", context.get("readOnly"));
        assertEquals("readWrite", context.get("readWrite"));
        assertEquals("writeOnly", ((TestContext) context).returnWriteOnly());
    }

    @Test
    public void readOnlyIsInstanceOfString() {
        assertThat(context.get("readOnly"), instanceOf(String.class));
    }

    @Test
    public void readOnlyIsProvidedByContext() {
        assertEquals("readOnly", context.get("readOnly"));
    }

    @Test(expected = UnsupportedOperationException.class)
    public void putReadOnlyThrowsException() {
        context.put("readOnly", "new readOnly");
    }

    @Test
    public void writeOnlyIsInstanceOfString() {
        assertThat(((TestContext) context).returnWriteOnly(),
                instanceOf(String.class));
    }

    @Test
    public void writeOnlyIsNotProvidedByContext() {
        assertNull(context.get("writeOnly"));
    }

    @Test
    public void putNewWriteOnlyProperty() {
        context.put("writeOnly", "new writeOnly");
        assertEquals("new writeOnly", ((TestContext) context).returnWriteOnly());
    }

    @Test
    public void readWriteIsInstanceOfString() {
        assertThat(context.get("readWrite"), instanceOf(String.class));
    }

    @Test
    public void readWriteIsProvidedByContext() {
        assertEquals("readWrite", context.get("readWrite"));
    }

    @Test
    public void putNewReadWriteProperty() {
        context.put("readWrite", "new readWrite");
        assertEquals("new readWrite", context.get("readWrite"));
    }

    @Override
    protected Context<String, Object> createContext() {
        return (new TestContext());
    }

}


text:
/***** This code was generated by Yaggo. Do not edit ******/

#ifndef __DUMP_FASTQ_MAIN_ARGS_HPP__
#define __DUMP_FASTQ_MAIN_ARGS_HPP__

#include <jellyfish/yaggo.hpp>

class dump_fastq_main_args {
public:
  bool                           column_flag;
  bool                           tab_flag;
  double                         lower_count_arg;
  bool                           lower_count_given;
  double                         upper_count_arg;
  bool                           upper_count_given;
  bool                           verbose_flag;
  const char *                   output_arg;
  bool                           output_given;
  yaggo::string                  db_arg;

  enum {
    USAGE_OPT = 1000
  };

  dump_fastq_main_args() :
    column_flag(false),
    tab_flag(false),
    lower_count_arg(), lower_count_given(false),
    upper_count_arg(), upper_count_given(false),
    verbose_flag(false),
    output_arg(""), output_given(false)
  { }

  dump_fastq_main_args(int argc, char* argv[]) :
    column_flag(false),
    tab_flag(false),
    lower_count_arg(), lower_count_given(false),
    upper_count_arg(), upper_count_given(false),
    verbose_flag(false),
    output_arg(""), output_given(false)
  { parse(argc, argv); }

  void parse(int argc, char* argv[]) {
    static struct option long_options[] = {
      {"column", 0, 0, 'c'},
      {"tab", 0, 0, 't'},
      {"lower-count", 1, 0, 'L'},
      {"upper-count", 1, 0, 'U'},
      {"verbose", 0, 0, 'v'},
      {"output", 1, 0, 'o'},
      {"help", 0, 0, 'h'},
      {"usage", 0, 0, USAGE_OPT},
      {"version", 0, 0, 'V'},
      {0, 0, 0, 0}
    };
    static const char *short_options = "hVctL:U:vo:";

    std::string err;
#define CHECK_ERR(type,val,which) if(!err.empty()) { std::cerr << "Invalid " #type " '" << val << "' for [" which "]: " << err << "\n"; exit(1); }
    while(true) {
      int index = -1;
      int c = getopt_long(argc, argv, short_options, long_options, &index);
      if(c == -1) break;
      switch(c) {
      case ':':
        std::cerr << "Missing required argument for "
                  << (index == -1 ? std::string(1, (char)optopt) : std::string(long_options[index].name))
                  << std::endl;
        exit(1);
      case 'h':
        std::cout << usage() << "\n\n" << help() << std::endl;
        exit(0);
      case USAGE_OPT:
        std::cout << usage() << "\nUse --help for more information." << std::endl;
        exit(0);
      case 'V':
        print_version();
        exit(0);
      case '?':
        std::cerr << "Use --usage or --help for some help\n";
        exit(1);
      case 'c':
        column_flag = true;
        break;
      case 't':
        tab_flag = true;
        break;
      case 'L':
        lower_count_given = true;
        lower_count_arg = yaggo::conv_double((const char *)optarg, err, false);
        CHECK_ERR(double_t, optarg, "-L, --lower-count=double")
        break;
      case 'U':
        upper_count_given = true;
        upper_count_arg = yaggo::conv_double((const char *)optarg, err, false);
        CHECK_ERR(double_t, optarg, "-U, --upper-count=double")
        break;
      case 'v':
        verbose_flag = true;
        break;
      case 'o':
        output_given = true;
        output_arg = optarg;
        break;
      }
    }

    // Parse arguments
    if(argc - optind != 1)
      error("Requires exactly 1 argument.");
    db_arg = yaggo::string(argv[optind]);
    ++optind;
  }

#define dump_fastq_main_args_USAGE "Usage: jellyfish qdump [options] db:path"
  const char * usage() const { return dump_fastq_main_args_USAGE; }
  void error(const char *msg) {
    std::cerr << "Error: " << msg << "\n" << usage()
              << "\nUse --help for more information"
              << std::endl;
    exit(1);
  }

#define dump_fastq_main_args_HELP "Dump k-mer from a qmer database\n\nBy default, dump in a fasta format where the header is the count and\n" \
  "the sequence is the sequence of the k-mer. The column format is a 2\n" \
  "column output: k-mer count.\n\n" \
  "Options (default value in (), *required):\n" \
  " -c, --column                             Column format (false)\n" \
  " -t, --tab                                Tab separator (false)\n" \
  " -L, --lower-count=double                 Don't output k-mer with count < lower-count\n" \
  " -U, --upper-count=double                 Don't output k-mer with count > upper-count\n" \
  " -v, --verbose                            Be verbose (false)\n" \
  " -o, --output=string                      Output file\n" \
  "     --usage                              Usage\n" \
  " -h, --help                               This message\n" \
  " -V, --version                            Version"

  const char * help() const { return dump_fastq_main_args_HELP; }
#define dump_fastq_main_args_HIDDEN "Hidden options:"

  const char * hidden() const { return dump_fastq_main_args_HIDDEN; }
  void print_version(std::ostream &os = std::cout) const {
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.0.0"
#endif
    os << PACKAGE_VERSION << "\n";
  }
  void dump(std::ostream &os = std::cout) {
    os << "column_flag:" << column_flag << "\n";
    os << "tab_flag:" << tab_flag << "\n";
    os << "lower_count_given:" << lower_count_given << " lower_count_arg:" << lower_count_arg << "\n";
    os << "upper_count_given:" << upper_count_given << " upper_count_arg:" << upper_count_arg << "\n";
    os << "verbose_flag:" << verbose_flag << "\n";
    os << "output_given:" << output_given << " output_arg:" << output_arg << "\n";
    os << "db_arg:" << db_arg << "\n";
  }
private:
};

#endif // __DUMP_FASTQ_MAIN_ARGS_HPP__"


text:
.class public final Landroid/media/midi/MidiDeviceInfo$PortInfo;
.super Ljava/lang/Object;
.source "MidiDeviceInfo.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/media/midi/MidiDeviceInfo;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "PortInfo"
.end annotation

# static fields
.field public static final TYPE_INPUT:I = 0x1

.field public static final TYPE_OUTPUT:I = 0x2

# instance fields
.field private final mName:Ljava/lang/String;

.field private final mPortNumber:I

.field private final mPortType:I

# direct methods
.method constructor <init>(IILjava/lang/String;)V
    .locals 0
    .param p1, "type"    # I
    .param p2, "portNumber"    # I
    .param p3, "name"    # Ljava/lang/String;

    .prologue
    .line 154
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 155
    iput p1, p0, Landroid/media/midi/MidiDeviceInfo$PortInfo;->mPortType:I

    .line 156
    iput p2, p0, Landroid/media/midi/MidiDeviceInfo$PortInfo;->mPortNumber:I

    .line 157
    if-nez p3, :cond_0

    const-string/jumbo p3, ""

    .end local p3    # "name":Ljava/lang/String;
    :cond_0
    iput-object p3, p0, Landroid/media/midi/MidiDeviceInfo$PortInfo;->mName:Ljava/lang/String;

    .line 154
    return-void
.end method

# virtual methods
.method public getName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 181
    iget-object v0, p0, Landroid/media/midi/MidiDeviceInfo$PortInfo;->mName:Ljava/lang/String;

    return-object v0
.end method

.method public getPortNumber()I
    .locals 1

    .prologue
    .line 173
    iget v0, p0, Landroid/media/midi/MidiDeviceInfo$PortInfo;->mPortNumber:I

    return v0
.end method

.method public getType()I
    .locals 1

    .prologue
    .line 165
    iget v0, p0, Landroid/media/midi/MidiDeviceInfo$PortInfo;->mPortType:I

    return v0
.end method


text:
import java.awt.*;
import sun.awt.*;
import java.awt.event.*;
import java.lang.reflect.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;

public class JavaClient {
    ClientContainer cont;
    public static void main(String[] args) {
        if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
            return;
        }

        // Enable testing extensions in XEmbed server
        System.setProperty("sun.awt.xembed.testing", "true");

        boolean xtoolkit = "sun.awt.X11.XToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName());
        final EmbeddedFrame ef = createEmbeddedFrame(xtoolkit, Long.parseLong(args[0]));
        ef.setBackground(new Color(100, 100, 200));
        ef.setLayout(new BorderLayout());
        ef.add(new ClientContainer(ef), BorderLayout.CENTER);
        ef.pack();
        ef.registerListeners();
        ef.setVisible(true);
    }
    private static EmbeddedFrame createEmbeddedFrame(boolean xtoolkit, long window) {
        try {
            Class cl = (xtoolkit?Class.forName("sun.awt.X11.XEmbeddedFrame"):Class.forName("sun.awt.motif.MEmbeddedFrame"));
            Constructor cons = cl.getConstructor(new Class[]{Long.TYPE, Boolean.TYPE});
            return (EmbeddedFrame)cons.newInstance(new Object[] {window, true});
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException("Can't create embedded frame");
        }
    }
}

class ClientContainer extends Container {
    Window parent;
    int width, height;
    public ClientContainer(Window w) {
        parent = w;
        width = 500;
        height = 50;
        final TextField tf = new TextField(30);

        DragSource ds = new DragSource();
        final DragSourceListener dsl = new DragSourceAdapter() {
                public void dragDropEnd(DragSourceDropEvent dsde) {
                }
            };
        final DragGestureListener dgl = new DragGestureListener() {
                public void dragGestureRecognized(DragGestureEvent dge) {
                    dge.startDrag(null, new StringSelection(tf.getText()), dsl);
                }
            };
        ds.createDefaultDragGestureRecognizer(tf, DnDConstants.ACTION_COPY, dgl);

        final DropTargetListener dtl = new DropTargetAdapter() {
                public void drop(DropTargetDropEvent dtde) {
                    dtde.acceptDrop(DnDConstants.ACTION_COPY);
                    try {
                        tf.setText(tf.getText() + (String)dtde.getTransferable().getTransferData(DataFlavor.stringFlavor));
                    } catch (Exception e) {
                    }
                }
            };
        final DropTarget dt = new DropTarget(tf, dtl);

        setLayout(new FlowLayout());
        add(tf);
        Button close = new Button("Close");
        close.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    parent.dispose();
                }
            });
        Button inc = new Button("Increase size");
        inc.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    changeSize(10);
                }
            });
        Button dec = new Button("Decrease size");
        dec.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    changeSize(-10);
                }
            });
        add(close);
        add(inc);
        add(dec);
    }
    void changeSize(int step) {
        width += step;
        height += step;
        parent.pack();
    }
    public Dimension getPreferredSize() {
        return new Dimension(width, height);
    }
}


text:
package org.usfirst.frc.team619.logic;

import java.util.Vector;

/**
 * @author CaRobotics
 */
public class ThreadManager {

    private Vector threadList = new Vector();

    public void addThread(RobotThread thread){
        threadList.addElement(thread);
    }

    public void killAllThreads(){
        for(int i=0;i<threadList.size();i++){
            RobotThread t = (RobotThread) threadList.elementAt(i);
            if(t != null) t.stopRunning();
        }
        for(int i=0;i<threadList.size();i++){
            if(threadList.elementAt(i)==null) threadList.removeElementAt(i);
        }
    }
}


text:
from setuptools import setup, find_packages

from txyam import version

setup(
    name="txyam",
    version=version,
    description="Yet Another Memcached (YAM) client for Twisted.",
    author="Brian Muller",
    author_email="bamuller@gmail.com",
    license="MIT",
    url="http://github.com/bmuller/txyam",
    packages=find_packages(),
    requires=["twisted.protocols.memcache", "hash_ring"],
    install_requires=['twisted>=12.0','hash_ring>=1.3.1']
)


text:
sudo rm /etc/default/go-server
sudo rm /var/log/go-server/
sudo rm /var/log/go-server/ -rf
sudo rm /var/run/go-server/ -rf
sudo rm /etc/go/ -rf


text:
/* eslint-env node */
module.exports = {
  description: 'liquid-fire transitions map blueprint',
  normalizeEntityName: function () {},
};


text:
var numbers = ['one', 'two', 3, 'four', 'wu']

delete numbers[0]
console.log(numbers[0]) //undefined
console.log(numbers.length) //5

numbers.splice(0, 1)
console.log(numbers[0]) //two
console.log(numbers.length) //4

console.log(typeof [1, 2]) //object

console.log(Array.isArray(numbers))

var is_array = function(value) {
    return Object.prototype.toString.apply(value) === '[object Array]'
}
console.log(is_array(numbers)) //true

var matrix = [
    [7, 8, 9],
    [4, 5, 6],
    [1, 2, 3]
]
console.log(matrix[1][2]) //6


text:
layout: kanji
v4: 1410
v6: 1513
kanji: 疑
keyword: doubt
elements: doubt, spoon, sitting on the ground, dart, drop, heavens, chop-seal, hanko, zoo, critters
strokes: 14
image: E79691
on-yomi: ギ
kun-yomi: うたが.う
permalink: /rtk/疑/
prev: 踊
next: 擬
---

1) [Filip] 7-2-2008(337): (Katsuo) You come at the zoo entrance. 'Here sir, a spoon to feed the animals.' cool 'and a dart(gun) in case stuff go wrong' ....' please chop-seal (sign) here for in case of accidents the zoo is not responsible.' 'lion feeding time is. bla bla' You are having serious doubts about if you still want to go into this zoo.

2) [Katsuo] 21-12-2007(100): A very doubtful story: At the entrance to my local zoo they issue you with a special spoon (to feed the animals) and a dart gun (to defend yourself in case of animal attack). You must then hanko (seal) a document to say you've received both these items, only after which will they let you enter the zoo. (Oh, and if you forget your hanko, I doubt they'll let you in).

3) [decamer0n] 9-6-2007(60): Unless they use spoons to feed and darts to subdue the animals, I doubt the new zoo will get the WWF seal of approval.

4) [diracbracket] 9-1-2011(35): In her spare time ( = ヒマ), Gwen Stefani of 'No Doubt' likes to throw darts at the critters in the zoo.

5) [chibimizuno] 16-9-2009(22): Hmm... I doubt he is as busy as he claims to be. Yesterday, he looked like he had plenty of ヒマ (free time) - I saw him shooting darts and going to the zoo!


text:
package com.alibaba.dubbo.remoting.http.tomcat;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.remoting.http.HttpHandler;
import com.alibaba.dubbo.remoting.http.HttpServer;
import com.alibaba.dubbo.remoting.http.TestUtil;
import org.apache.http.client.fluent.Request;
import org.junit.Test;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

public class TomcatHttpBinderTest {
    @Test
    public void shouldAbleHandleRequestForTomcatBinder() throws Exception {
        int port = TestUtil.getFreePort();
        URL url = new URL("http", "localhost", port,
                new String[]{Constants.BIND_PORT_KEY, String.valueOf(port)});

        HttpServer httpServer = new TomcatHttpBinder().bind(url, new HttpHandler() {
            @Override
            public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
                response.getWriter().write("Tomcat");
            }
        });

        String response = Request.Get(url.toJavaURL().toURI()).execute().returnContent().asString();

        assertThat(response, is("Tomcat"));

        httpServer.close();
    }
}


text:
"""
Tests the AccessRights check.
"""

import configobj
import mock

from repoguard.checks import accessrights

class TestAccessRights(object):

    def setup_method(self, _):
        self._transaction = mock.Mock(user_id="me")
        self._transaction.get_files = mock.Mock(return_value={"test.java":"A"})

        self._accessrights = accessrights.AccessRights(self._transaction)

    def test_default_configuration(self):
        config = self._get_config(list())
        assert not self._accessrights.run(config).success

    def test_ignore(self):
        self._transaction.get_files.return_value = dict()
        config = self._get_config(["ignore_files = .*,"])
        assert self._accessrights.run(config).success
        config = self._get_config(
            ["ignore_files = .*,", "allow_users = me,"])
        assert self._accessrights.run(config).success
        config = self._get_config(
            ["ignore_files = .*,", "deny_users = me,"])
        assert self._accessrights.run(config).success
        config = self._get_config(
            ["ignore_files = .*,", "allow_users = me,", "deny_users = me,"])
        assert self._accessrights.run(config).success

    def test_check_without_user(self):
        config = self._get_config(["check_files = test\.java,"])
        assert not self._accessrights.run(config).success

    def test_check_with_allowed_users_only(self):
        config = self._get_config(
            ["check_files = test\.java,", "allow_users = anotheruser,"])
        assert not self._accessrights.run(config).success
        config = self._get_config(
            ["check_files = test\.java,", "allow_users = me,"])
        assert self._accessrights.run(config).success

    def test_check_with_denied_users_only(self):
        config = self._get_config(
            ["check_files = test\.java,", "deny_users = anotheruser,"])
        assert self._accessrights.run(config).success
        config = self._get_config(
            ["check_files = test\.java,", "deny_users = me,"])
        assert not self._accessrights.run(config).success

    def test_check_with_allowed_and_denied_users(self):
        config = self._get_config(
            ["check_files = test\.java,", "allow_users = anotheruser,", "deny_users = me,"])
        assert not self._accessrights.run(config).success
        config = self._get_config(
            ["check_files = test\.java,", "allow_users = me,", "deny_users = anotheruser,"])
        assert self._accessrights.run(config).success
        config = self._get_config(
            ["check_files = test\.java,", "allow_users = me,", "deny_users = me,"])
        assert not self._accessrights.run(config).success

    @staticmethod
    def _get_config(parameters):
        return configobj.ConfigObj(parameters)


text:
@implementation SDPModel

+ (NSDictionary*) JSONKeyPathsByPropertyKey {
    return @{};
}

- (instancetype) initWithSDP:(RTCSessionDescription*)sdp {
    self = [super init];
    _sdpType = sdp.type;
    _sdpDescription = sdp.description;
    return self;
}

- (RTCSessionDescription*) sdp {
    return [[RTCSessionDescription alloc] initWithType:_sdpType sdp:_sdpDescription];
}

@end


text:
<?php
/**
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 */

namespace MediaWiki\Logger\Monolog;

use Kafka\MetaDataFromKafka;
use Kafka\Produce;
use MediaWiki\Logger\LoggerFactory;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Logger;
use Psr\Log\LoggerInterface;

/**
 * Log handler sends log events to a kafka server.
 *
 * Constructor options array arguments:
 * * alias: map from monolog channel to kafka topic name. When no
 *	  alias exists the topic "monolog_$channel" will be used.
 * * swallowExceptions: Swallow exceptions that occur while talking to
 *    kafka. Defaults to false.
 * * logExceptions: Log exceptions talking to kafka here. Either null,
 *    the name of a channel to log to, or an object implementing
 *    FormatterInterface. Defaults to null.
 *
 * Requires the nmred/kafka-php library, version >= 1.3.0
 *
 * @since 1.26
 * @author Erik Bernhardson <ebernhardson@wikimedia.org>
 * @copyright © 2015 Erik Bernhardson and Wikimedia Foundation.
 */
class KafkaHandler extends AbstractProcessingHandler {
	/**
	 * @var Produce Sends requests to kafka
	 */
	protected $produce;

	/**
	 * @var array Optional handler configuration
	 */
	protected $options;

	/**
	 * @var array Map from topic name to partition this request produces to
	 */
	protected $partitions = array();

	/**
	 * @var array defaults for constructor options
	 */
	private static $defaultOptions = array(
		'alias' => array(), // map from monolog channel to kafka topic
		'swallowExceptions' => false, // swallow exceptions sending records
		'logExceptions' => null, // A PSR3 logger to inform about errors
	);

	/**
	 * @param Produce $produce Kafka instance to produce through
	 * @param array $options optional handler configuration
	 * @param int $level The minimum logging level at which this handler will be triggered
	 * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
	 */
	public function __construct( Produce $produce, array $options, $level = Logger::DEBUG, $bubble = true ) {
		parent::__construct( $level, $bubble );
		$this->produce = $produce;
		$this->options = array_merge( self::$defaultOptions, $options );
	}

	/**
	 * Constructs the necessary support objects and returns a KafkaHandler
	 * instance.
	 *
	 * @param string[] $kafkaServers
	 * @param array $options
	 * @param int $level The minimum logging level at which this handle will be triggered
	 * @param bool $bubble Whether the messages that are handled can bubble the stack or not
	 * @return KafkaHandler
	 */
	public static function factory( $kafkaServers, array $options = array(), $level = Logger::DEBUG, $bubble = true ) {
		$metadata = new MetaDataFromKafka( $kafkaServers );
		$produce = new Produce( $metadata );
		if ( isset( $options['logExceptions'] ) && is_string( $options['logExceptions'] ) ) {
			$options['logExceptions'] = LoggerFactory::getInstance( $options['logExceptions'] );
		}
		return new self( $produce, $options, $level, $bubble );
	}

	/**
	 * {@inheritDoc}
	 */
	protected function write( array $record ) {
		if ( $record['formatted'] !== null ) {
			$this->addMessages( $record['channel'], array( $record['formatted'] ) );
			$this->send();
		}
	}

	/**
	 * {@inheritDoc}
	 */
	public function handleBatch( array $batch ) {
		$channels = array();
		foreach ( $batch as $record ) {
			if ( $record['level'] < $this->level ) {
				continue;
			}
			$channels[$record['channel']][] = $this->processRecord( $record );
		}

		$formatter = $this->getFormatter();
		foreach ( $channels as $channel => $records ) {
			$messages = array();
			foreach ( $records as $idx => $record ) {
				$message = $formatter->format( $record );
				if ( $message !== null ) {
					$messages[] = $message;
				}
			}
			if ( $messages ) {
				$this->addMessages($channel, $messages);
			}
		}

		$this->send();
	}

	/**
	 * Send any records in the kafka client internal queue.
	 */
	protected function send() {
		try {
			$this->produce->send();
		} catch ( \Kafka\Exception $e ) {
			$ignore = $this->warning(
				'Error sending records to kafka: {exception}',
				array( 'exception' => $e ) );
			if ( !$ignore ) {
				throw $e;
			}
		}
	}

	/**
	 * @param string $topic Name of topic to get partition for
	 * @return int|null The random partition to produce to for this request,
	 *  or null if a partition could not be determined.
	 */
	protected function getRandomPartition( $topic ) {
		if ( !array_key_exists( $topic, $this->partitions ) ) {
			try {
				$partitions = $this->produce->getAvailablePartitions( $topic );
			} catch ( \Kafka\Exception $e ) {
				$ignore = $this->warning(
					'Error getting metadata for kafka topic {topic}: {exception}',
					array( 'topic' => $topic, 'exception' => $e ) );
				if ( $ignore ) {
					return null;
				}
				throw $e;
			}
			if ( $partitions ) {
				$key = array_rand( $partitions );
				$this->partitions[$topic] = $partitions[$key];
			} else {
				$details = $this->produce->getClient()->getTopicDetail( $topic );
				$ignore = $this->warning(
					'No partitions available for kafka topic {topic}',
					array( 'topic' => $topic, 'kafka' => $details )
				);
				if ( !$ignore ) {
					throw new \RuntimeException( "No partitions available for kafka topic $topic" );
				}
				$this->partitions[$topic] = null;
			}
		}
		return $this->partitions[$topic];
	}

	/**
	 * Adds records for a channel to the Kafka client internal queue.
	 *
	 * @param string $channel Name of Monolog channel records belong to
	 * @param array $records List of records to append
	 */
	protected function addMessages( $channel, array $records ) {
		if ( isset( $this->options['alias'][$channel] ) ) {
			$topic = $this->options['alias'][$channel];
		} else {
			$topic = "monolog_$channel";
		}
		$partition = $this->getRandomPartition( $topic );
		if ( $partition !== null ) {
			$this->produce->setMessages( $topic, $partition, $records );
		}
	}

	/**
	 * @param string $message PSR3 compatible message string
	 * @param array $context PSR3 compatible log context
	 * @return bool true if caller should ignore warning
	 */
	protected function warning( $message, array $context = array() ) {
		if ( $this->options['logExceptions'] instanceof LoggerInterface ) {
			$this->options['logExceptions']->warning( $message, $context );
		}
		return $this->options['swallowExceptions'];
	}
}


text:
require 'gli'
require 'gli/command'
require 'yaml'
require 'fileutils'

module GLI
  # Command that initializes the configuration file for apps that use it.
  class InitConfig < Command # :nodoc:
    COMMANDS_KEY = 'commands'

    def initialize(config_file_name,commands,flags,switches)
      @filename = config_file_name
      super(:names => :initconfig,
            :description => "Initialize the config file using current global options",
            :long_desc => 'Initializes a configuration file where you can set default options for command line flags, both globally and on a per-command basis.  These defaults override the built-in defaults and allow you to omit commonly-used command line flags when invoking this program',
            :skips_pre => true,:skips_post => true, :skips_around => true)

      @app_commands = commands
      @app_flags = flags
      @app_switches = switches

      self.desc 'force overwrite of existing config file'
      self.switch :force

      action do |global_options,options,arguments|
        if options[:force] || !File.exist?(@filename)
          create_config(global_options,options,arguments)
        else
          raise "Not overwriting existing config file #{@filename}, use --force to override"
        end
      end
    end

  private

    def create_config(global_options,options,arguments)
      config = Hash[global_options.map { |option_name,option_value|
        if option_value.kind_of?(String) && option_value.respond_to?(:force_encoding)
          [option_name,option_value.force_encoding("utf-8")]
        else
          [option_name,option_value]
        end
      }]
      config[COMMANDS_KEY] = {}
      @app_commands.each do |name,command|
        if (command != self) && (name != :rdoc) && (name != :help)
          if command != self
            config[COMMANDS_KEY][name.to_sym] = config_for_command(@app_commands,name.to_sym)
          end
        end
      end

      FileUtils.mkdir_p(File.dirname(@filename)) unless File.dirname(@filename) == '.'

      File.open(@filename,'w', 0600) do |file|
        YAML.dump(config,file)
        puts "Configuration file '#{@filename}' written."
      end
    end

    def config_for_command(commands,command_name)
      {}.tap do |hash|
        subcommands = commands[command_name].commands
        subcommands.each do |name,subcommand|
          next unless name.kind_of? Symbol
          hash[COMMANDS_KEY] ||= {}
          puts "#{command_name}:#{name}"
          hash[COMMANDS_KEY][name.to_sym] = config_for_command(subcommands,name)
        end
      end
    end
  end
end


text:
#include <QThread>
#include <QtCore>
#include <QDir>

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/video/tracking.hpp>

class ProcessThread : public QThread
{
    Q_OBJECT
public:
    explicit ProcessThread(QObject *parent = 0);
    void setParameters(int resolutionIdx,
                       QDir directory,
                       QStringList listOfFiles,
                       int frameRate,
                       bool deflicker,
                       int deflickerWindowSize,
                       bool motionDenoiser,
                       bool isGaussian,
                       int bufferSize,
                       bool reduceCameraShake,
                       bool ignorePerspective,
                       int cropSize,
                       bool isFast, QString outputFilename);
    void run();
    bool isGoodHomography(cv::Mat H);
    bool isVideoOpened;

private:
    int imgWidth;
    int imgHeight;
    int progressCounter;
    int frameRate;
    int bufferSize;
    int bufferCounter;
    int deflickerWindowSize;
    cv::Scalar* deflickerBufferMean;
    cv::Scalar* deflickerBufferStd;
    QDir directory;
    QStringList listOfFiles;
    cv::VideoWriter videoWriter;
    cv::VideoCapture videoReader;
    cv::Mat matOriginal;
    cv::Mat* videoBuffer;
    cv::Rect cropSize;
    bool deflicker;
    bool reduceCameraShake;
    bool ignorePerspective;
    bool isGaussian;
    bool motionDenoiser;
    bool isFast;
    QString outputFilename;

    void deflickerCurrentFrame();
    void reduceCameraShakeForCurrentFrame();
    void denoiseMotionforCurrentFrame();

signals:
    void progressBarChanged(int i);
    void progressFinished();

public slots:

};

#endif // PROCESSTHREAD_H


text:
#pragma once

//TODO consider using #define _HAS_EXCEPTIONS 0 to drop exceptions from STL and then turn off c++ expections completely
//with a compiler switch.

//Microsoft compiler only definition
//#define nntl_deprecated(msg) __declspec(deprecated(msg))
//This def should work cross-platform
#define nntl_deprecated(msg) [[deprecated(msg)]]
//use of #pragma deprecated () is more standard, but makes all uses of symbol even in derived classes deprecated
// - clearly not what we need

//if it breaks compilation because of non-standard definition of nntl_deprecated, just make it blank
// (and remove subsequent pragma) and make sure there is no code for protected by this macro definitions
#define nntl_interface nntl_deprecated("is used for an interface definition only. Never call it directly!")

#define nntl_static_warning(msg) nntl_deprecated(msg)

//#pragma warning(error:996)
#pragma warning( default : 996 )

//__forceinline is MS-specific. Should branch on a compiler here
#define nntl_force_inline __forceinline

//this is for testing whether the forceinline actually helps or hurts
#define nntl_probably_force_inline __forceinline

//alignment specifier. C++11 has standard alignas construct, but here is the method to quickly change it to
// something else (like  __declspec(align(#)) ) if needed
#define nntl_align(n) alignas(n)

#ifndef nntl_pragma_macro
#define nntl_pragma_macro __pragma
#endif // !nntl_pragma_macro

//can be used to wrap strings
#define NNTL_STRING(s) s

#define NNTL_STRINGIZE(s) #s

//#define NNTL_UNREF(P)          (P)
#define NNTL_UNREF(P)     (P)

//////////////////////////////////////////////////////////////////////////
// debugging-specific tools
// set to __func__ to conform ANSI C
#define NNTL_FUNCTION __FUNCSIG__
//its helpfull to debug code flow with statements like ::std::cout << "** in " << NNTL_FUNCTION << ::std::endl;

#if defined(_DEBUG) || defined(DEBUG)

#define NNTL_DEBUG
#define NNTL_ASSERT _ASSERTE

#define NNTL_DEBUG_DECLARE(v) v
#define NNTL_DEBUG_ARG(p) ,p

#ifdef NNTL_AGGRESSIVE_NANS_DBG_CHECK
#define NNTL_ASSERT_MTX_NO_NANS(mtx) _ASSERTE(mtx.test_noNaNs())
#else //NNTL_AGGRESSIVE_NANS_DBG_CHECK
#define NNTL_ASSERT_MTX_NO_NANS(mtx) ((void)(0))
#endif //NNTL_AGGRESSIVE_NANS_DBG_CHECK

#else //defined(_DEBUG) || defined(DEBUG)

#ifdef NNTL_RELEASE_WITH_DEBUG
//if you encounter crashes with NNTL_RELEASE_WITH_DEBUG, make sure it is defined _before_ including any other nntl file
// (put it on the top of stdafx.h)

#define NNTL_DEBUG
#define NNTL_ASSERT(a) nntl_pragma_macro(warning(push)) nntl_pragma_macro(warning(disable:4127)) if(!(a)) __debugbreak(); nntl_pragma_macro(warning(pop))
#define NNTL_DEBUG_DECLARE(v) v
#define NNTL_DEBUG_ARG(p) ,p

#ifdef NNTL_AGGRESSIVE_NANS_DBG_CHECK
#define NNTL_ASSERT_MTX_NO_NANS(mtx) nntl_pragma_macro(warning(push)) nntl_pragma_macro(warning(disable:4127)) if(!(mtx.test_noNaNs())) __debugbreak(); nntl_pragma_macro(warning(pop))
#else //NNTL_AGGRESSIVE_NANS_DBG_CHECK
#define NNTL_ASSERT_MTX_NO_NANS(mtx) ((void)(0))
#endif //NNTL_AGGRESSIVE_NANS_DBG_CHECK

#else //NNTL_RELEASE_WITH_DEBUG

#define NNTL_ASSERT(a) ((void)(0))
#define NNTL_DEBUG_ARG(p)
#define NNTL_DEBUG_DECLARE(v)

#define NNTL_ASSERT_MTX_NO_NANS(mtx)

#endif // !NNTL_RELEASE_WITH_DEBUG

#endif // defined(_DEBUG) || defined(DEBUG)

#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

#define NNTL_TYPEDEFS_SELF() typedef self_t& self_ref_t; \
typedef const self_t& self_cref_t;

//shortcuts for get_self() methods
//NB: ensure the self_t is defined and macro is placed under a correct visibility scope
#define NNTL_METHODS_SELF_CHECKED(cond, msg) \
NNTL_TYPEDEFS_SELF() \
self_ref_t get_self() noexcept { \
  static_assert(cond, msg); \
  return static_cast<self_ref_t>(*this); \
} \
self_cref_t get_self() const noexcept { \
  static_assert(cond, msg); \
  return static_cast<self_cref_t>(*this); \
}

#define NNTL_METHODS_SELF() \
NNTL_TYPEDEFS_SELF() \
self_ref_t get_self() noexcept { return static_cast<self_ref_t>(*this); } \
self_cref_t get_self() const noexcept {  return static_cast<self_cref_t>(*this); }

template<typename r> class always_false : public ::std::false_type {};
//helper to show type T
template<typename T> static constexpr int static_show_type() {
	static_assert(always_false<T>::value, "you've requested type of T, see below");
	return 0;
};
//static constexpr int v = static_show_type<TypeToCheck>();

template<typename T> static constexpr int static_show_type(T&& v) {
	static_assert(always_false<T>::value, "you've requested type of T, see below");
	return 0;
};


text:
var express = require('express');
var path = require('path');
var app = express();
var cool = require('cool-ascii-faces');

var routes = require('./routes/index');
var users = require('./routes/users');
var test1 = require('./routes/test1');
var shoppingBag = require('./routes/shopping-bag');

//view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/'));

app.use('/', routes);
app.use('/users', users);

app.use('/api/v1/shoppingBag', shoppingBag);

app.use('/test1', test1);

/*
app.get('/', function(request, response) {
  var result = ''
  var times = process.env.TIMES || 5
  for (i=0; i < times; i++)
    result += cool();
  response.send(result);
});
*/

var pg = require('pg');
var connectionString = "postgres://tvkzjrtaeqyrmh:d97-kAkjMTUiAmJicoQXlSv1Nq@ec2-107-22-170-37.compute-1.amazonaws.com:5432/d7a0pvb05stsae?ssl=true";

app.get('/db', function (request, response) {
  pg.connect(connectionString, function(err, client, done) {
    client.query('SELECT * FROM test_table', function(err, result) {
      done();
      if (err)
       { console.error(err); response.send("Error " + err); }
      else
       { console.log(process.env.DATABASE_URL);

    	  response.send(result.rows); }
    });
  });
});

app.listen(app.get('port'), function() {
  console.log("Node app is running at localhost:" + app.get('port'));
});


text:
"""!weather <zip or place name> return the 5-day forecast"""

try:
    from urllib import quote
except ImportError:
    from urllib.request import quote
import re
import requests
import time

# http://openweathermap.org/weather-conditions
iconmap = {
    "01": ":sunny:",
    "02": ":partly_sunny:",
    "03": ":partly_sunny:",
    "04": ":cloud:",
    "09": ":droplet:",
    "10": ":droplet:",
    "11": ":zap:",
    "13": ":snowflake:",
    "50": ":umbrella:",    # mist?
}

def weather(searchterm):
    searchterm = quote(searchterm)
    url = 'http://api.openweathermap.org/data/2.5/forecast/daily?q={0}&cnt=5&mode=json&units=imperial'
    url = url.format(searchterm)

    dat = requests.get(url).json()

    msg = ["{0}: ".format(dat["city"]["name"])]
    for day in dat["list"]:
        name = time.strftime("%a", time.gmtime(day["dt"]))
        high = str(int(round(float(day["temp"]["max"]))))
        icon = iconmap.get(day["weather"][0]["icon"][:2], ":question:")
        msg.append(u"{0} {1}° {2}".format(name, high, icon))

    return " ".join(msg)

def on_message(msg, server):
    text = msg.get("text", "")
    match = re.findall(r"^!weather (.*)", text)
    if not match:
        return

    searchterm = match[0]
    return weather(searchterm.encode("utf8"))


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Flint: ScatterJob< T, K, dist_key > Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

Flint
    0.02

Main Page

Classes

Files

Class List

Class Hierarchy

Class Members

Public Member Functions

ScatterJob< T, K, dist_key > Class Template Reference

#include <rdd.h>

List of all members.

Public Member Functions

 	ScatterJob (RDD< T > *in, Queue *q)

void 	run ()

Detailed Description

template<class T, class K, void(*)(K &key, T const &record) dist_key>

class ScatterJob< T, K, dist_key >

Scatter RDD data between nodes using provided distribution key and hash function

The documentation for this class was generated from the following file:

rdd.h

<address class="footer">
Generated on Sat Nov 14 2015 20:30:46 for Flint by

 1.7.6.1
</address>


text:
/*
 login_controller.js
 Rutas de manejo de l login
*/

var express = require("express");
var router = express.Router();
var loginDb = require("../login/login_db_mysql");

router.post('/', function(req, res){
    var usuario = req.body.usuario;
    if (!usuario || !usuario.login || ! usuario.password) return res.status(400).send("Petición de login incorrecta");
    loginDb.login(usuario.login, usuario.password, function(err, usuario){
        if (err) return res.status(500).send(err.message);
        res.json(usuario);
    })
});

router.post('/clave', function(req, res){
    var usuario = req.body.usuario;
    if (!usuario || !usuario.login || ! usuario.password) return res.status(400).send("Petición de login incorrecta");
    loginDb.loginConClave(usuario.login, usuario.password, function(err, usuario){
        if (err) return res.status(500).send(err.message);
        res.json(usuario);
    })
});

module.exports = router;


text:
import unittest

from pyparsing import ParseException

from tests.utils.grammar import get_record_grammar

"""
CWR Non-Roman Alphabet Other Writer Name grammar tests.

The following cases are tested:
"""

__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'

class TestNOWGrammar(unittest.TestCase):
    """
    Tests that the NPA grammar decodes correctly formatted strings
    """

    def setUp(self):
        self.grammar = get_record_grammar('nra_other_writer')

    def test_valid_full(self):
        """
        Tests that IPA grammar decodes correctly formatted record prefixes.

        This test contains all the optional fields.
        """
        record = 'NOW0000123400000023NAME                                                                                FIRST NAME                                                                                ES1'

        result = self.grammar.parseString(record)[0]

        self.assertEqual('NOW', result.record_type)
        self.assertEqual(1234, result.transaction_sequence_n)
        self.assertEqual(23, result.record_sequence_n)
        self.assertEqual('NAME', result.writer_name)
        self.assertEqual('FIRST NAME', result.writer_first_name)
        self.assertEqual('ES', result.language_code)
        self.assertEqual(1, result.position)

    def test_extended_character(self):
        """
        Tests that IPA grammar decodes correctly formatted record prefixes.

        This test contains all the optional fields.
        """
        record = 'NOW0000123400000023NAME \xc6\x8f                                                                                FIRST NAME \xc6\x8f                                                                                ES1'

        result = self.grammar.parseString(record)[0]

        self.assertEqual('NOW', result.record_type)
        self.assertEqual(1234, result.transaction_sequence_n)
        self.assertEqual(23, result.record_sequence_n)
        self.assertEqual('NAME \xc6\x8f', result.writer_name)
        self.assertEqual('FIRST NAME \xc6\x8f', result.writer_first_name)
        self.assertEqual('ES', result.language_code)
        self.assertEqual(1, result.position)

class TestNOWGrammarException(unittest.TestCase):
    def setUp(self):
        self.grammar = get_record_grammar('nra_other_writer')

    def test_empty(self):
        """
        Tests that a exception is thrown when the the works number is zero.
        """
        record = ''

        self.assertRaises(ParseException, self.grammar.parseString, record)

    def test_invalid(self):
        record = 'This is an invalid string'

        self.assertRaises(ParseException, self.grammar.parseString, record)


text:
Release Notes Summary:
 - More complete sensor database and better matching as well as explicit status for lens initialization
 - Add support for rig of cameras. This enables to add more contraints if you make acquisition with multiple synchronized devices.
 - Support for reconstruction with projected light patterns and texturing with another images set.
 - Better estimation of the space to reconstruct to limit the reconstruction zone. This avoid to reconstruct low quality and useless areas around the main object/environment.
 - New option to directly mesh the SfM results. This provides a quick solution to get a draft mesh (without cuda requirement).
 - Reduce IO and intermediate files in MVS part of the pipeline.

Full Release Notes:
 - sensorDB: Update the sensors database with much more models
 - sensorDB: Use `FocalLengthIn35mmFilm` metadata as a fallback if available
 - sensorDB: Improve matching of metadata make/model with sensor database
 - CameraInit: New management of intrinsics (serial number, error/warning log) with an explicit InstrinsicInitMode enum
 - CameraInit: Fix intrinsics grouping with serial number as expected and add metadata "AliceVision::SensorWidth"
               (or "AliceVision::SensorWidthEstimated" if estimated from `FocalLength`/`FocalLengthIn35mmFilm`)
 - CameraInit: Explicit warning if serial number is missing
 - SfM: Add support for rig of cameras. This information is used as a new constraint in the SfM. This option can now be combined with localBA.
        You need to use a specific folder hierarchy in the input images files (for instance: "/my/dataset/rig/0/DSLR_0001.JPG", "/my/dataset/rig/1/DSLR_0001.JPG") to provide this information.
 - PrepareDenseScene: New `imagesFolders` option to override input images. This enables to use images with light patterns projected for SfM and MVS parts
                      and do the Texturing with another set of images.
 - Meshing fusion: New option to use SfM landmarks (mesh from sparse point cloud) or combine them with depth maps
 - Meshing: Add option `estimateSpaceFromSfM` to better estimate the bounding box of the reconstruction and avoid useless reconstruction of the environment
 - MVS: Reduce IO and intermediate files. Use sfmData in the MVS pipeline (instead of MVS seeds, ini file) and do not export depthmap files before refine
 - ExportAnimatedCamera: Improved solution to export an SfM result into an animated camera
 - PrepareDenseScene: Remove hackish software `CameraConnection` (now properly done in PrepareDenseScene)
 - PrepareDenseScene: Allow parallelization on renderfarm
 - FeatureExtraction: Add grid filtering in AKAZE (to avoid unmanageable number of keypoints on well textured images)
 - DepthMap: Fix memory leak in SGMVolume
 - Meshing: Fix loading of OBJ with normals
 - System: Improve gpu detection and logging
 - DepthMap: Enable usage of multiple GPUs by default with an option to add a limit
 - DepthMap: Fuse estimate & refine in a single loop (fuse "computeDepthMapsPSSGM" with "refineDepthMaps")  and use the same image cache
 - DepthMap: Remove depthMapInfo files and use image metadata instead
 - DepthMap: Initial refactoring for better readability to prepare the optimization work
 - SfM: Refactoring of localBA (now fused with the standard BA code to avoid redundancy)
 - ConvertSfMFormat: Users can now specify a view whitelist to filter views
 - SfM: The user can provide only one image of the initial pair and it will choose the 2nd image automatically.
        This allows to ensure that the reconstruction start from a specific part of the scene without choosing the image pair manually.
 - SfMTransform: Allow to choose one view as the origin for the coordinate system
 - SfM Augmentation from known poses: When the sfm starts with existing cameras poses but without landmarks, it now does the triangulation first.
 - LightingEstimation: New module with preliminary low-level methods for lighting estimation (spherical harmonics)
 - MeshDenoising: Fix ignored parameter denoising outer iteration
 - Meshing: Bug fix (infinity loop) in Meshing when the BBox is empty
 - SfM LocalBA: reduce minimum number of images to use sparse BA (change threshold from 100 to 20) to speedup large reconstructions when localBA is used.
 - Minor build fix for compatibility with ceres 2.

## Release 2.0.0 (2018.08.09)

Release of the full 3D reconstruction pipeline.

### 2018.07

 - New Docker images for Centos 7 and Ubuntu 18
 - New "make bundle" for packaging
 - Refactor split sfm / sfmData / sfmDataIO
 - New visibility remapping methods: Push, PullPush
 - Improve texturing quality with better image selection
 - SfM support multiple folders for features and matches
 - PopSiftImageDescriber: no initialization if not used
 - Offline camera tracking improvements
 - Export animated camera ABC
 - Export undistorted images and filter option
 - MeshroomMaya script integration Image Plane
 - Minor fixes in cameraSensors DB search
 - New fallback if no sensor width info available but FocalLengthIn35mmFilm metadata is present
 - ImageMatchingMultiSfM: add "a_a+a_b" option

### 2018.06

 - SfM Augmentation: lock cameras from the initial reconstruction
 - SfM: Add option in order to disable the cleaning of tracks forks

### 2018.03

 - Merge the MVS pipeline in the main branch
 - New options for better auto UVs based on geogram (needs reasonable mesh size in input)
 - Use full resolution images in the MVS pipeline: PrepareDenseScene creates full resolution undistorted images, DepthMap computes downscale when loading images and Texturing can be done in full resolution.
 - New depth map fusion with a multi-scale approach (using nanoflann)
 - ImageMatching: Fix conflict if multiple images with the same UID
 - Add SIFT_UPRIGHT as an ImageDescriber

## Release 1.0.0 (2018.03.07)

Release of the Structure-From-Motion pipeline.

### 2018.02

 - Support Raw and Exr input files
 - Texturing: add multithreading / clean iteration over pixels in triangle
 - MVS: use UIDs
 - Major MVS refactoring
 - New Mesh Denoiser and Decimate based on MeshSDFilter
 - Integration of Uncertainty computation step

### 2018.01

 - Meshing: Remove facets with helper points but limit holes creation
 - Texturing: Don't modify the topology
 - Meshing: Add an option to keep only the largest facets group
 - cmake: Geogram as a submodule of cmpmvs
 - Update SfM
 - Modify Image Matching
 - SfM Reorientation software
 - Use OpenMP for featureExtraction with a new imageDescriber memory needs estimation
 - Rewrite "Identify the track to triangulate" in triangulateMultiViews_LORANSAC
 - popSIFT directly on floating point images
 - Use relative path for features and matches in SfM
 - Remove cereal dependency
 - Remove static functions in headers
 - MVS: Add namespace per module
 - MVS: Build as dynamic libraries
 - MVS: Remove unneeded intermediate images

### 2017.12

 - Reduce the amount of storage for intermediate files and improve robustness to kill/restart jobs on renderfarm
 - New software to create simplified versions of the mesh
 - Use OpenImageIO in MVS
 - Use floating point image in texturing

### 2017.11

 - New Local Bundle Adjustment to speedup SfM on large scenes
 - Retexturing on an external user mesh with a retopology (no visibility information and support user UVs) with a first visibilities remapping method.
 - Add new images to a previous SfM reconstruction
 - Use OpenImageIO in SfM

### 2017.10

 - Reduce memory usage on Meshing

### 2017.10

 - SfM: Support for RIG of synchronized cameras/DSLR with a new constraint between rigidly fixed cameras
 - New software utility for 360° cameras

### 2017.08

 - Tetrahedralization scoring with boost maxflow

### 2017.07

 - Meshing tetrahedralization with geogram
 - Texturing speedup
 - Rewrite CUDA layer

### 2017.06

 - SfM: Weighting on image describers to combine them correctly

### 2017.03

 - MVS: Support for multiple image resolutions

### 2017.02

 - MVS: Code comments and documentation
 - MVS: Performance improvements
 - Texturing: Fix UV coords
 - MVS: Split Meshing and Texturing steps
 - Texturing: Rewrite edge padding for performance reasons

### 2017.01

 - MVS: Linux code porting

### 2016

 - Integration of PopSift: a new GPU SIFT implementation
 - SfM: Add LoRansac
 - SfM: New next best view strategy to promote good repartition in images. Same rule in image pair selection.
 - SfM: Optional filtering of the input tracks with a minimal track length
 - SfM: Optional limitation on the number of input matches from an image pair
 - Sort features and matches
 - FeatureExtraction: Limit the number of features per image with grid filtering to ensure good repartition
 - New software to align reconstructions based on common cameras (using UID)

### 2015

 - New Alembic file format to store sparse point cloud and cameras
 - Integration of new CCTag markers with CPU and CPU implementations
 - SfM use UID
 - Support for cameras RIG calibration and localization based on opengv
 - Camera lens calibration based on opencv
 - New camera localization module
 - SfM speedup by precomputing tracks visibilities and adjusting BA thresholds
 - New Image Matching based on vocabulary tree approach
 - Features extraction and features matching parallelization on multiple computers for renderfarm usage

### 2014

 - First public source code release of the SfM pipeline


text:
using Eto.Drawing;
using Eto.Forms;
using Eto.Wpf.Drawing;
using System;

using sw = System.Windows;
namespace Eto.Wpf.Forms
{
	public class FontDialogHandler : WidgetHandler<CustomControls.FontDialog.FontChooser, FontDialog, FontDialog.ICallback>, FontDialog.IHandler
	{
		public FontDialogHandler()
		{
		}

		public override void AttachEvent(string id)
		{
			switch (id)
			{
				case FontDialog.FontChangedEvent:
					// handled during showdialog
					break;
				default:
					base.AttachEvent(id);
					break;
			}
		}

		public Font Font
		{
			get;
			set;
		}

		public DialogResult ShowDialog(Window parent)
		{
			Control = new CustomControls.FontDialog.FontChooser();

			if (parent != null)
			{
				var owner = parent.ControlObject as sw.Window;
				Control.Owner = owner;
				Control.WindowStartupLocation = sw.WindowStartupLocation.CenterOwner;
			}
			if (Font != null)
			{
				var fontHandler = (FontHandler)Font.Handler;
				Control.SelectedFontFamily = fontHandler.WpfFamily;
				Control.SelectedFontPointSize = fontHandler.Size;
				Control.SelectedFontStyle = fontHandler.WpfFontStyle;
				Control.SelectedFontWeight = fontHandler.WpfFontWeight;
			}
			var result = Control.ShowDialog();

			if (result == true)
			{
				var fontHandler = new FontHandler(Control.SelectedFontFamily, Control.SelectedFontPointSize, Control.SelectedFontStyle, Control.SelectedFontWeight);
				Font = new Font(fontHandler);
				Callback.OnFontChanged(Widget, EventArgs.Empty);
			}

			return result != null && result.Value ? DialogResult.Ok : DialogResult.Cancel;
		}
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
edu.wpi.first.wpilibj.parsing (2013 FRC Java API)
</TITLE>

<META NAME="date" CONTENT="2013-01-03">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package edu.wpi.first.wpilibj.parsing

Interface Summary

IDevice
An IDevice is any WPILibJ object which can be used in the creation of the
 robot program

IDeviceController
IDeviceController is implemented by control elements in the robot.

IInputOutput
IInputOutput is implemented by devices which provide the robot with data and
 allow it to react to its environment.

IMechanism
The IMechanism interface is implemented by any class to be classified as a
 mechanism.

ISensor
ISensor is extended by any WPILibJ class to be categorized as a sensor in the
 java program builder.

IUtility
IUtility is an interface implemented by any WPILibJ class which should appear
 in the utility tree of the java program builder.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

"For updated information see the Java FRC site"


text:
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Animated, Easing, TouchableWithoutFeedback, View, Text, Image } from 'react-native'
import Styles from './Styles/RepoStyles'
import Button from './Button'
import { merge } from 'ramda'

const ROTATION = { inputRange: [0, 1], outputRange: ['0deg', '360deg'] }

class Repo extends Component {
  constructor (props) {
    super(props)
    this.state = {
      spinny: new Animated.Value(0)
    }
    this.animate = this.animate.bind(this)
  }

  componentWillReceiveProps (newProps) {
    if (newProps.avatar && newProps.speed) {
      // stop the current running animation
      if (this.animation) {
        this.animation.stop()
        this.animation = null
      }
      setTimeout(this.animate, 10)
    }
  }

  animate () {
    const duration = 100 * this.props.speed
    const easing = Easing.linear
    this.state.spinny.setValue(0)
    this.animation = Animated.sequence([
      Animated.timing(this.state.spinny, { toValue: 1, duration, easing })
      // Animated.timing(this.state.spinny, { toValue: 0, duration: 0 })
    ]).start(({ finished }) => {
      if (finished) {
        this.animate()
      } else {
        this.animation = null
      }
    })
  }

  getAnimationStyle () {
    return {
      transform: [{ rotate: this.state.spinny.interpolate(ROTATION) }]
    }
  }

  render () {
    const { repo, name, avatar, message, size } = this.props
    const avatarSource = avatar && { uri: avatar }

    const avatarStyles = merge(Styles.avatar, {
      width: size,
      height: size,
      borderRadius: size * 0.5
    })
    const centerStyles = merge(Styles.center, this.getAnimationStyle())
    return (
      <View style={Styles.container}>
        <Text style={Styles.repo}>{repo || ' '}</Text>
        <View style={Styles.middle}>
          <View style={Styles.left}>
            <Button text='Bigger' onPress={this.props.bigger} />
            <Button text='Small' onPress={this.props.smaller} />
          </View>
          <Animated.View style={centerStyles}>
            <TouchableWithoutFeedback onPress={this.props.reset}>
              <Image style={avatarStyles} source={avatarSource} />
            </TouchableWithoutFeedback>
          </Animated.View>
          <View style={Styles.right}>
            <Button text='Faster' onPress={this.props.faster} />
            <Button text='Slower' onPress={this.props.slower} />
          </View>
        </View>
        <Text style={Styles.name}>{name || ' '}</Text>
        <Text style={Styles.message}>{message}</Text>
      </View>
    )
  }
}

Repo.propTypes = {
  repo: PropTypes.string,
  name: PropTypes.string,
  avatar: PropTypes.string,
  message: PropTypes.string,
  bigger: PropTypes.func,
  smaller: PropTypes.func,
  faster: PropTypes.func,
  slower: PropTypes.func,
  reset: PropTypes.func,
  size: PropTypes.number,
  speed: PropTypes.number
}

export default Repo


text:
* Replace deprecated `ecstatic` with `st`
* Normalize repository, dropping node <10.13 support (#8)

### Miscellaneous Chores

* Normalize repository, dropping node <10.13 support ([#8](https://www.github.com/gulpjs/undertaker-common-tasks/issues/8)) ([cd51fff](https://www.github.com/gulpjs/undertaker-common-tasks/commit/cd51fffe297316307d627ae9a881f3352b80e3fa))
* Replace deprecated `ecstatic` with `st` ([cd51fff](https://www.github.com/gulpjs/undertaker-common-tasks/commit/cd51fffe297316307d627ae9a881f3352b80e3fa))


text:
package interpreter.evaluator;

import static environment.SymbolTable.primitiveOperations;

import environment.IEnvironment;
import environment.SymbolTable;
import expression.IExpression;
import interpreter.IEvaluable;
import java.util.List;
import java.util.Optional;

public class SimpleEvaluator implements IEvaluator {

  private final IEnvironment environment;

  /**
   * Create a SimpleEvaluator that has the given pre-defined expressions.
   *
   * @param predefined The pre-defined expressions for this evaluator.
   */
  public SimpleEvaluator(SymbolTable predefined) {
    this.environment = predefined;
  }

  public SimpleEvaluator() {
    this(primitiveOperations);
  }

  @Override
  public void evaluateProgram(List<IEvaluable> toEval) throws Exception {
    for (IEvaluable eval : toEval) {
      Optional<IExpression> result = eval.evaluate(this.environment);
      if (result.isPresent()) {
        System.out.println(result.get());
      }
    }
  }
}


text:
// Code generated by client-gen. DO NOT EDIT.

package fake

import (
	"context"

	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	labels "k8s.io/apimachinery/pkg/labels"
	schema "k8s.io/apimachinery/pkg/runtime/schema"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	testing "k8s.io/client-go/testing"
	v1alpha1 "knative.dev/networking/pkg/apis/networking/v1alpha1"
)

// FakeRealms implements RealmInterface
type FakeRealms struct {
	Fake *FakeNetworkingV1alpha1
}

var realmsResource = schema.GroupVersionResource{Group: "networking.internal.knative.dev", Version: "v1alpha1", Resource: "realms"}

var realmsKind = schema.GroupVersionKind{Group: "networking.internal.knative.dev", Version: "v1alpha1", Kind: "Realm"}

// Get takes name of the realm, and returns the corresponding realm object, and an error if there is any.
func (c *FakeRealms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Realm, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootGetAction(realmsResource, name), &v1alpha1.Realm{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Realm), err
}

// List takes label and field selectors, and returns the list of Realms that match those selectors.
func (c *FakeRealms) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RealmList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootListAction(realmsResource, realmsKind, opts), &v1alpha1.RealmList{})
	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &v1alpha1.RealmList{ListMeta: obj.(*v1alpha1.RealmList).ListMeta}
	for _, item := range obj.(*v1alpha1.RealmList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}

// Watch returns a watch.Interface that watches the requested realms.
func (c *FakeRealms) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
	return c.Fake.
		InvokesWatch(testing.NewRootWatchAction(realmsResource, opts))
}

// Create takes the representation of a realm and creates it.  Returns the server's representation of the realm, and an error, if there is any.
func (c *FakeRealms) Create(ctx context.Context, realm *v1alpha1.Realm, opts v1.CreateOptions) (result *v1alpha1.Realm, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(realmsResource, realm), &v1alpha1.Realm{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Realm), err
}

// Update takes the representation of a realm and updates it. Returns the server's representation of the realm, and an error, if there is any.
func (c *FakeRealms) Update(ctx context.Context, realm *v1alpha1.Realm, opts v1.UpdateOptions) (result *v1alpha1.Realm, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(realmsResource, realm), &v1alpha1.Realm{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Realm), err
}

// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeRealms) UpdateStatus(ctx context.Context, realm *v1alpha1.Realm, opts v1.UpdateOptions) (*v1alpha1.Realm, error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateSubresourceAction(realmsResource, "status", realm), &v1alpha1.Realm{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Realm), err
}

// Delete takes name of the realm and deletes it. Returns an error if one occurs.
func (c *FakeRealms) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteActionWithOptions(realmsResource, name, opts), &v1alpha1.Realm{})
	return err
}

// DeleteCollection deletes a collection of objects.
func (c *FakeRealms) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(realmsResource, listOpts)

	_, err := c.Fake.Invokes(action, &v1alpha1.RealmList{})
	return err
}

// Patch applies the patch and returns the patched realm.
func (c *FakeRealms) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Realm, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(realmsResource, name, pt, data, subresources...), &v1alpha1.Realm{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Realm), err
}


text:
This guide refers to Swift Development Snapshots. These can be downloaded from [swift.org/download](https://swift.org/download/#snapshots).
If you are seeing issues, it is generally a good idea to re-try with the latest Swift Development Snapshot.

## Building

The easiest option to build SwiftSyntax it to open it in Xcode.

Alternatively you can also build it from the command line using `build-script.py`. To do this, perform the following steps

1. Check `swift-syntax` and `swift-argument-parser` out side by side:
     ```
     - (enclosing directory)
       - swift-argument-parser
       - swift-syntax
2. Execute the following command
    ```bash
    swift-syntax/build-script.py build --toolchain /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-<recent date>.xctoolchain/usr
    ```

## Testing

Because of SwiftSyntax's integration with the Swift compiler project, testing certain parts of the project is a little bit more involved than others.

The `SwiftParser` tests have no dependencies, other `XCTests` require you to use a matching Swift Development Snapshot, `lit`-based test require a compiler build.

Run the tests that you believe are necessary locally. CI will always run all test before allowing the PR to be merged.

### SwiftParser

If you are only modifying the `SwiftParser` module, you can just run the tests using Xcode by testing the `SwiftParserTest` target.

If you can't find it in your Schemes, you need to manually add it using Product -> Scheme -> New Scheme…

### XCTests

The `SwiftSyntaxParser` module (the legacy parser) of this repository depends on the C++ parser library (`_InternalSwiftSyntaxParser.dylib`) to parse source code.
The syntax node definitions of that parser library need to match those used by your SwiftSyntax checkout.
Most of the time, the parser library included in the latest Swift Development Snapshot will fulfill this requirement.

To run the tests in Xcode, select the latest Swift Development Snapshot in Xcode -> Toolchains, select the SwiftSyntax-Package scheme and hit Product -> Test.

You can also run the tests from the command line using
```bash
./build-script.py test --toolchain /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-<recent date>.xctoolchain/usr --skip-lit-tests
```

If you are seeing issues regarding a mismatched parser library, try the following
1. Update your Swift Development Snapshot
2. Revert your swift-syntax checkout to the date of your Swift Development Snapshot
3. Wait for a new Swift Development Snapshot
4. If the above options are not possible, build your own Swift toolchain locally and use that toolchain as the `--toolchain` parameter for SwiftSyntax's `build-script.py` invocations
  - Note: Building your own toolchain will take more than 1 hour and even longer if you are running into any issues. We do not recommend building your own Swift toolchain unless you are familiar with Swift compiler development.

Tip: Running SwiftSyntax's self-parse tests takes the majority of testing time. If you want to iterate quickly, you can skip these tests using the following steps:
1. Product -> Scheme -> Edit Scheme…
2. Select the Arguments tab in the Run section
3. Add a `SKIP_SELF_PARSE` environment variable with value `1`

### `lit`-based tests

A few tests of the `SwiftSyntaxParser` module (the legacy parser), which test the interaction between SwiftSyntax and the C++ parser library (`_InternalSwiftSyntaxParser.dylib`) are based LLVM's `lit` and `FileCheck` tools.
To run these, build `FileCheck`, e.g. by building the Swift compiler and run the tests using the following command:
```bash
./build-script.py test --toolchain /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-<recent date>.xctoolchain/usr --skip-lit-tests --filecheck-exec /path/to/build/Release+Asserts/llvm-macosx-x86_64/bin/FileCheck
```

## Generating source code

If you want to modify the code-generated files, perform the following steps:

1. Check out `swift` next to `swift-syntax`
    ```
    - (enclosing directory)
      - swift
      - swift-argument-parser
      - swift-syntax
    ```
2. Run the following command
    ```bash
    swift-syntax/build-script.py generate-source-code --toolchain /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-<recent date>.xctoolchain/usr
    ```
3. The new source-generated file will be written into your `Sources` directory.


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

@Component({
  selector: 'app-comp-4001',
  templateUrl: './comp-4001.component.html',
  styleUrls: ['./comp-4001.component.css']
})
export class Comp4001Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
using ES.Common.Extend;
using ES.Framework.Core;
using ES.Framework.Ninject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Topshelf;
using Topshelf.Logging;

namespace ES.Service
{
    class Program
    {
        static void Main(string[] args)
        {
            HostFactory.New(c =>
            {
                c.UseLog4Net("log4net.config", true);
                var log = HostLogger.Get("Default");
                log.Info("[Service] 已读取log4net配置");
                c.StartManually();
                c.StartAutomaticallyDelayed();
                c.UseNinject();
                c.RunAsNetworkService();
                log.Info("[Service] 开始生成服务");
                c.Service<CoreService>(s =>
                {
                    s.ConstructUsingNinject();
                    s.WhenStarted((cs, hc) => cs.Start(hc));
                    s.WhenStopped((cs, hc) => cs.Stop(hc));
                });
                c.SetDescription("ServiceDescription".GetConfig() ?? "简单服务框架");
                c.SetDisplayName("ServiceDisplayName".GetConfig() ?? "简单服务框架");
                c.SetServiceName("ServiceName".GetConfig() ?? "简单服务框架");
            }).Run();
        }
    }
}


text:
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const core_1 = require('@nestjs/core');
const fastify_platform_1 = require('@nestjs/platform-fastify');
const app_module_1 = require('./nest/app.module');
core_1.NestFactory.create(
  app_module_1.AppModule,
  new fastify_platform_1.FastifyAdapter(),
  {
    logger: false,
    bodyParser: false,
  },
).then(app => app.listen(3000));
//# sourceMappingURL=main.js.map