text:
package rajawali.materials.textures;

import android.opengl.GLES20;

public class FrameBufferTexture extends ATexture {
	public FrameBufferTexture(FrameBufferTexture other)
	{
		super(other);
	}

	public FrameBufferTexture(String textureName)
	{
		super(TextureType.FRAME_BUFFER, textureName);
	}

	@Override
	public FrameBufferTexture clone() {
		return new FrameBufferTexture(this);
	}

	public void setFrom(FrameBufferTexture other)
	{
		super.setFrom(other);
	}

	@Override
	void add() throws TextureException {
		if(mWidth == 0 || mHeight == 0)
			throw new TextureException("FrameBufferTexture could not be added because the width and/or height weren't specified.");

		int[] textures = new int[1];
		GLES20.glGenTextures(1, textures, 0);
		int textureId = textures[0];
		if(textureId > 0) {
			GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId);
			GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
			GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
			GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT);
        	GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);
			GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, mWidth, mHeight, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
			GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
			setTextureId(textureId);
		}
	}

	@Override
	void remove() throws TextureException {
		GLES20.glDeleteTextures(1, new int[] { mTextureId }, 0);
	}

	@Override
	void replace() throws TextureException {
		return;
	}

	void reset() throws TextureException
	{
		return;
	}
}


text:
PebFUTÁR
========

Pebble watchapp for tracking public transport in Budapest, Hungary.

Not actively maintained anymore.

redpajama_set_name: RedPajamaGithub


text:
'use strict'; // eslint-disable-line strict
const fs = require('fs'); // eslint-disable-line no-unused-vars
const path = require('path');
const express = require('express');

const app = express();
const http = require('http').Server(app); // eslint-disable-line new-cap
const io = require('socket.io')(http);

app.use(express.static('client'));

app.get('/', (req, res) => {
  res.sendFile(path.join(`${__dirname}./../client/index.html`));
});

app.get('/client/bundle.js', (req, res) => {
  res.sendFile(path.join(`${__dirname}./../client/bundle.js`));
});

io.on('connection', socket => {
  socket.on('viewerAnswer', data => {
    io.emit('serverResponse', data);
  });
});

app.get('/api/questions', (req, res) => {
  res.json(database);
});

var database = {
  questions:
  [
    { cType: 'bar',
      question: 'Who has the coolest scratch project?',
      choices: [{ Alex: 0, Daniel: 0, Dave: 0, Carlos: 0 }],
      qType: 'multiple'
    },
    { cType: 'pie',
      question: 'What is your favorite beer?',
      choices: [{ 'Stone IPA': 0, 'Corona Light': 0, 'Guiness': 0, 'Sierra Nevada': 0, 'Blue Moon': 0, "I don't drink beer, I drink bourbon": 0}],
      qType: 'multiple'
    },
    {
      cType: 'bar',
      question: 'What was your favorite company that came to hiring day?',
      choices: [{ 'Dog Vacay': 0, 'Dollar Shave Club': 0, 'LA Body Points': 0, Whisper: 0, Procore: 0, ESPN: 0, Ticketmaster: 0 }],
      qType: 'multiple'
    },
    { cType: 'pie',
      question: 'Thumbs Up or Thumbs Down on drinks last Thursday?',
      choices: [{ Up: 0, Down: 0 }],
      qType: 'thumbs'
    }
  ]
};

http.listen(3000);


text:
var React = require('react');

var SuspiciousStore = require('../stores/SuspiciousStore');
var NotebookStore = require('../stores/NotebookStore');
var EdInActions = require('../../../js/actions/EdInActions');
var SelectInput = require('../../../js/components/scoring/SelectInput.react');
var FilterSelectInput = require('../../../js/components/scoring/FilterSelectInput.react');
var ButtonsScoring = require('../../../js/components/scoring/ButtonsScoring.react');
var RatingInput = require('../../../js/components/scoring/RatingInput.react');
var SearchGlobalInput = require('../../../js/components/scoring/SearchGlobalInput.react');
var ScoreMessage = require('../../../js/components/scoring/ScoreMessage.react');

var SpotUtils = require('../../../js/utils/SpotUtils');

var ScoreNotebook = React.createClass({
  // mixins: [GridPanelMixin],
  emptySetMessage: 'There is no data available for selected date.',
  propTypes: {
    date: React.PropTypes.string.isRequired,
  },
  getInitialState: function () {
    return {
      scoredEmelents: []
    };
  },
  componentDidMount: function() {
    SuspiciousStore.addChangeDataListener(this._onChange);
    NotebookStore.addChangeDataListener(this._onChange);
    this.setState({size: NotebookStore.completeClass})
  },
  componentWillUnmount: function () {
    SuspiciousStore.removeChangeDataListener(this._onChange);
    NotebookStore.addChangeDataListener(this._onChange);
  },
  render: function () {
    var content, state, data, cssCls, uriArr = [];
    state = this.state || {};

    if (state.error)
    {
      content = (

          {state.error}

      );
    }
    else if (state.loading)
    {
      content = (

          Loading

      );
    }
    else if (!state.data || state.data.length === 0)
    {
      content = (

          {this.emptySetMessage || ''}

      );
    }
    else
    {
      state.data.map((obj) => {
        if(uriArr.indexOf(obj.fulluri) === -1) {
          uriArr.push(obj.fulluri);
        }
      });

      data = [
              {value: 1, name: 'High', radioName: 'optradio', selected: true},
              {value: 2, name: 'Medium', radioName: 'optradio', selected: false},
              {value: 3, name: 'Low', radioName: 'optradio', selected: false}
            ];

      content = (

              <SearchGlobalInput col="6" maxlength="255"/>
              <RatingInput data={data} col="6"/>

              <ButtonsScoring name="Score" action="score" onChange={this.score.bind(this)} col="3"/>
              <ButtonsScoring name="Save" action="save" onChange={this.save.bind(this)} col="3"/>
              <ButtonsScoring name="Reset Scoring" action="reset" onChange={this.reset.bind(this)} col="3"/>

              <FilterSelectInput nameBox="URI..." idSelect="#fullUri" idInput="fullUriIn" col="9"/>

              <SelectInput title="Source IP" who="fullUri" options={uriArr} col="9"/>

              <ScoreMessage who="scoreMsg"/>

        );
    }
    cssCls = this.state.size ? 'col-md-6 col-lg-6 col-xs-12' : 'col-md-offset-3 col-lg-offset-3 col-md-6 col-lg-6 col-xs-12';

    return(

        {content}

    )
  },
  _onChange: function() {
    const data = SuspiciousStore.getData();
    this.setState(data);
  },
  reset: function() {
    swal({
      title: 'Are you sure?',
      text: "You won't be able to revert this!",
      type: 'warning',
      showCancelButton: true,
      confirmButtonColor: '#3085d6',
      cancelButtonColor: '#d33',
      confirmButtonText: 'Yes, reset all!'
    }).then(() => {
      EdInActions.resetScoring(SpotUtils.getCurrentDate());
      swal({
        title: 'Done!',
        text: "All scores have been reset.",
        type: 'success',
        showCancelButton: false,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Ok!'
      }).then(() => {
        this.setState({loading: true});
      });
    });
  },
  save: function() {
    let variables = [];

    if (this.state.scoredEmelents.length === 0) {
      swal('Warning.','You should score at least 1 threat.','warning');
    } else {
      this.state.scoredEmelents.map((row) => {
        variables.push({
          'date': SpotUtils.getCurrentDate(),
          'uri':  row[0] || "None",
          'score': row[1],
        });
      });

      EdInActions.saveScoring(variables);
      $('#scoreMsg').addClass("hidden");
      this.setState({scoredEmelents: [], loading: true});
    }
  },
  score: function() {
    //this should be changed to take all data at the time, time needed.
    let dataScored = this.state.scoredEmelents || [];
    let quickIpScoring = document.getElementById('globalTxt').value;
    let fullUri = document.getElementById('fullUri').value;
    let rating  = $('input[name="optradio"]:checked').val();

    //callback from the father
    if(quickIpScoring !== '') {
      dataScored.push([quickIpScoring, rating]);
    } else {
      dataScored.push([fullUri, rating]);
    }

    this.removeSelected([fullUri, quickIpScoring]);
    $('#scoreMsg').removeClass("hidden");
    this.setState({scoredEmelents: dataScored});
  },
  removeSelected: function(data) {
    //when an user score, all elements selected need to be removed.
    data.map((element) => data.map((e) => e !== '' ? $(`option[value="${e}"]`).remove() : ''));
    $(".select-picker, #globalTxt").val('');
  }

});

module.exports = ScoreNotebook;


text:
set(WIN32 1)

set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
set(CMAKE_SHARED_LIBRARY_PREFIX "")          # lib
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")          # .so
set(CMAKE_IMPORT_LIBRARY_PREFIX "")
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
set(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
set(CMAKE_DL_LIBS "")

set(CMAKE_FIND_LIBRARY_PREFIXES "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")

# for borland make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
if(CMAKE_GENERATOR MATCHES "Borland")
  set(CMAKE_START_TEMP_FILE "@&&|\n")
  set(CMAKE_END_TEMP_FILE "\n|")
endif()

# for nmake make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
if(CMAKE_GENERATOR MATCHES "NMake")
  set(CMAKE_START_TEMP_FILE "@<<\n")
  set(CMAKE_END_TEMP_FILE "\n<<")
endif()

include(Platform/WindowsPaths)

# uncomment these out to debug nmake and borland makefiles
#set(CMAKE_START_TEMP_FILE "")
#set(CMAKE_END_TEMP_FILE "")
#set(CMAKE_VERBOSE_MAKEFILE 1)


text:
class AddErrorMessageToPatronImportFile < ActiveRecord::Migration
  def change
    add_column :patron_import_files, :error_message, :text
  end
end


text:
using Internal.Cryptography;
using Internal.Cryptography.Pal;

namespace System.Security.Cryptography.X509Certificates
{
    /// <summary>
    /// Provides extension methods for retrieving <see cref="ECDsa" /> implementations for the
    /// public and private keys of a <see cref="X509Certificate2" />.
    /// </summary>
    public static class ECDsaCertificateExtensions
    {
        /// <summary>
        /// Gets the <see cref="ECDsa" /> public key from the certificate or null if the certificate does not have an ECDsa public key.
        /// </summary>
        [SecuritySafeCritical]
        public static ECDsa GetECDsaPublicKey(this X509Certificate2 certificate)
        {
            return certificate.GetPublicKey<ECDsa>(cert => HasECDsaKeyUsage(cert));
        }

        /// <summary>
        /// Gets the <see cref="ECDsa" /> private key from the certificate or null if the certificate does not have an ECDsa private key.
        /// </summary>
        [SecuritySafeCritical]
        public static ECDsa GetECDsaPrivateKey(this X509Certificate2 certificate)
        {
            return certificate.GetPrivateKey<ECDsa>(cert => HasECDsaKeyUsage(cert));
        }

        private static bool HasECDsaKeyUsage(X509Certificate2 certificate)
        {
            foreach (X509Extension extension in certificate.Extensions)
            {
                if (extension.Oid.Value == Oids.KeyUsage)
                {
                    X509KeyUsageExtension ext = (X509KeyUsageExtension)extension;

                    if ((ext.KeyUsages & X509KeyUsageFlags.KeyAgreement) == 0)
                    {
                        // If this does not have KeyAgreement flag present, it cannot be ECDH
                        // or ECMQV key as KeyAgreement is mandatory flag for ECDH or ECMQV (RFC 5480 Section 3).
                        //
                        // In that case, at this point, it is safe to assume it is ECDSA
                        return true;
                    }

                    // Even if KeyAgreement was specified, if any of the signature uses was
                    // specified then ECDSA is a valid usage.
                    const X509KeyUsageFlags ecdsaFlags =
                        X509KeyUsageFlags.DigitalSignature |
                        X509KeyUsageFlags.NonRepudiation |
                        X509KeyUsageFlags.KeyCertSign |
                        X509KeyUsageFlags.CrlSign;

                    return ((ext.KeyUsages & ecdsaFlags) != 0);
                }
            }

            // If the key usage extension is not present in the certificate it is
            // considered valid for all usages, so we can use it for ECDSA.
            return true;
        }
    }
}


text:
package io.reactivesocket.reactivestreams.extensions.internal.subscribers;

import io.reactivesocket.reactivestreams.extensions.internal.Cancellable;
import org.reactivestreams.Subscriber;

public interface CancellableSubscriber<T> extends Subscriber<T>, Cancellable {
    void request(long n);
}


text:
package configgen.define;

import configgen.view.DefineView;

import java.util.Arrays;

public class Ref {
    public final String table;
    public String[] cols;

    Ref(String self) {
        if (!self.isEmpty()) {
            String[] r = self.split(",");
            table = r[0];
            cols = Arrays.copyOfRange(r, 1, r.length);
        } else {
            table = "";
            cols = new String[0];
        }
    }

    public boolean refToPrimaryKey() {
        return cols.length == 0;
    }

    public void autoFixDefine(Bean parentBean, AllDefine defineToFix) {
        String fullRefTableName = resolveTableFullName(parentBean, table);
        Table refTable = defineToFix.getTable(fullRefTableName);
        if (refTable == null) {
            throw new AssertionError(String.format("[%s]要求索引到表=[%s],不存在", parentBean.fullName(), table));
        }
        if (Arrays.equals(refTable.primaryKey, cols)) {
            System.out.printf("[%s]索引到表=[%s]的主键=\"%s\",默认就到主键,只配表就行了,不用明确配主键字段\n",
                              parentBean.fullName(), table, String.join(",", cols));
            cols = new String[0]; // 只要是索引到table主键,就不要填cols, 所以也用cols.length == 0来判断是否主键。
        }
    }

    @Override
    public String toString() {
        if (cols.length == 0)
            return table;

        return table + "," + String.join(",", cols);
    }

    boolean valid(Bean parent, DefineView defineView) {
        String resolvedTable = resolveTableFullName(parent, table);
        Table t = defineView.tables.get(resolvedTable);
        return t != null && t.bean.columns.keySet().containsAll(Arrays.asList(cols));
    }

    public static String resolveBeanFullName(Bean parentBean, String refName) {
        if (refName.contains(".")) {
            return refName.startsWith(".") ? refName.substring(1) : refName;
        }

        String pkgName = parentBean.getPkgName();
        if (pkgName.isEmpty()) {
            return refName;
        }

        String fullName = pkgName + "." + refName;
        if (parentBean.getDefine().allDefine.getBean(fullName) != null) {
            return fullName;
        }

        return refName;
    }

    public static String resolveTableFullName(Bean parentBean, String refName) {
        if (refName.contains(".")) {
            return refName.startsWith(".") ? refName.substring(1) : refName;
        }

        String pkgName = parentBean.getPkgName();
        if (pkgName.isEmpty()) {
            return refName;
        }

        String fullName = pkgName + "." + refName;
        if (parentBean.getDefine().allDefine.getTable(fullName) != null) {
            return fullName;
        }

        return refName;
    }

}


text:
CREATE TABLE IF NOT EXISTS `buxgiftreceipts` (
  `buxgiftreceipts` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `buxgiftid` int(10) unsigned NOT NULL,
  `uuid` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
  `amount` int(10) unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`buxgiftreceipts`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `buxgifts` (
  `buxgiftid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `owner_uuid` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
  `creator_uuid` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
  `uses` bigint(20) unsigned NOT NULL DEFAULT '0',
  `world` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'world',
  `x` int(10) NOT NULL,
  `y` int(10) NOT NULL,
  `z` int(10) NOT NULL,
  `amount` int(10) unsigned NOT NULL DEFAULT '1',
  `duration` int(10) unsigned NOT NULL DEFAULT '1',
  `duration_type` enum('minute','hour','day') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'day',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`buxgiftid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;


text:
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_SYS_RESOURCE_H)
#include <sys/time.h>
#include <sys/resource.h>

void updateTimers Args((void));
long millisecs  Args((long));
long userElapsed, systElapsed;

void updateTimers() {
    static long lastUser = 0;
    static long lastSyst = 0;
    long curr;
    struct rusage ruse;
    getrusage(RUSAGE_SELF,&ruse);

    curr        = ruse.ru_utime.tv_sec*1000000L + ruse.ru_utime.tv_usec;
    userElapsed = curr - lastUser;
    lastUser    = curr;

    curr        = ruse.ru_stime.tv_sec*1000000L + ruse.ru_stime.tv_usec;
    systElapsed = curr - lastSyst;
    lastSyst    = curr;
}

long millisecs(t)
long t; {
    return (t+500)/1000;
}
#else
#include <time.h>

void updateTimers Args((void));
long millisecs    Args((clock_t));
clock_t userElapsed=0, systElapsed=0;

void updateTimers() {
    static clock_t lastUser = 0;
    clock_t curr;
    curr        = clock();
    userElapsed = curr - lastUser;
    lastUser    = curr;
}

long millisecs(t)
clock_t t; {
    return (long)((t * 1000)/CLK_TCK);
}
#endif

/*-------------------------------------------------------------------------*/


text:
<?php namespace Octommerce\Octommerce\Updates;

use Schema;
use October\Rain\Database\Updates\Migration;

class CreateTaxesTable extends Migration
{

    public function up()
    {
        Schema::create('octommerce_octommerce_taxes', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id');

            $table->string('name');
            $table->text('description')->nullable();
            $table->decimal('amount', 12, 2)->default(0);
            $table->string('type')->default('percentage');

            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('octommerce_octommerce_taxes');
    }

}


text:
<?php

/**
 * Doctrine_Sequence_Oracle_TestCase
 *
 * @package     Doctrine
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @category    Object Relational Mapping
 * @link        www.phpdoctrine.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Sequence_Oracle_TestCase extends Doctrine_UnitTestCase
{
     public function testCurrIdExecutesSql()
     {
        $this->sequence->currId('user');
        $q = "SELECT (last_number-1) FROM user_sequences WHERE sequence_name='user_seq' OR sequence_name='USER_SEQ'";

        $this->assertEqual($this->adapter->pop(), $q);
    }
    public function testNextIdExecutesSql()
    {
        $id = $this->sequence->nextId('user');

        $this->assertEqual($this->adapter->pop(), 'SELECT user_seq.nextval FROM DUAL');

    }
    public function testLastInsertIdExecutesSql()
    {
        $this->sequence->lastInsertId('user');

        $this->assertEqual($this->adapter->pop(), 'SELECT user_seq.currval');
    }
}


text:
package barendpoint

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"runtime/debug"
	"time"

	"github.com/opentracing/opentracing-go"
	"github.com/pkg/errors"
	zanzibar "github.com/uber/zanzibar/runtime"
	"go.uber.org/thriftrw/ptr"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"

	workflow "github.com/uber/zanzibar/examples/example-gateway/build/endpoints/bar/workflow"
	endpointsIDlEndpointsBarBar "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar"

	defaultExample "github.com/uber/zanzibar/examples/example-gateway/middlewares/default/default_example"
	defaultExample2 "github.com/uber/zanzibar/examples/example-gateway/middlewares/default/default_example2"

	module "github.com/uber/zanzibar/examples/example-gateway/build/endpoints/bar/module"
)

// BarArgWithNestedQueryParamsHandler is the handler for "/bar/argWithNestedQueryParams"
type BarArgWithNestedQueryParamsHandler struct {
	Dependencies *module.Dependencies
	endpoint     *zanzibar.RouterEndpoint
}

// NewBarArgWithNestedQueryParamsHandler creates a handler
func NewBarArgWithNestedQueryParamsHandler(deps *module.Dependencies) *BarArgWithNestedQueryParamsHandler {
	handler := &BarArgWithNestedQueryParamsHandler{
		Dependencies: deps,
	}
	handler.endpoint = zanzibar.NewRouterEndpoint(
		deps.Default.ContextExtractor, deps.Default,
		"bar", "argWithNestedQueryParams",
		zanzibar.NewStack([]zanzibar.MiddlewareHandle{
			deps.Middleware.DefaultExample2.NewMiddlewareHandle(
				defaultExample2.Options{},
			),
			deps.Middleware.DefaultExample.NewMiddlewareHandle(
				defaultExample.Options{},
			),
		}, handler.HandleRequest).Handle,
	)

	return handler
}

// Register adds the http handler to the gateway's http router
func (h *BarArgWithNestedQueryParamsHandler) Register(g *zanzibar.Gateway) error {
	return g.HTTPRouter.Handle(
		"GET", "/bar/argWithNestedQueryParams",
		http.HandlerFunc(h.endpoint.HandleRequest),
	)
}

// HandleRequest handles "/bar/argWithNestedQueryParams".
func (h *BarArgWithNestedQueryParamsHandler) HandleRequest(
	ctx context.Context,
	req *zanzibar.ServerHTTPRequest,
	res *zanzibar.ServerHTTPResponse,
) context.Context {
	defer func() {
		if r := recover(); r != nil {
			stacktrace := string(debug.Stack())
			e := errors.Errorf("enpoint panic: %v, stacktrace: %v", r, stacktrace)
			ctx = h.Dependencies.Default.ContextLogger.ErrorZ(
				ctx,
				"Endpoint failure: endpoint panic",
				zap.Error(e),
				zap.String("stacktrace", stacktrace),
				zap.String("endpoint", h.endpoint.EndpointName))

			h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1)
			res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil)
		}
	}()

	var requestBody endpointsIDlEndpointsBarBar.Bar_ArgWithNestedQueryParams_Args

	if requestBody.Request == nil {
		requestBody.Request = &endpointsIDlEndpointsBarBar.QueryParamsStruct{}
	}
	xUUIDValue, xUUIDValueExists := req.Header.Get("x-uuid")
	if xUUIDValueExists {
		requestBody.Request.AuthUUID = ptr.String(xUUIDValue)
	}
	xUUID2Value, xUUID2ValueExists := req.Header.Get("x-uuid2")
	if xUUID2ValueExists {
		requestBody.Request.AuthUUID2 = ptr.String(xUUID2Value)
	}

	if requestBody.Request == nil {
		requestBody.Request = &endpointsIDlEndpointsBarBar.QueryParamsStruct{}
	}
	requestNameOk := req.CheckQueryValue("request.name")
	if !requestNameOk {
		return ctx
	}
	requestNameQuery, ok := req.GetQueryValue("request.name")
	if !ok {
		return ctx
	}
	requestBody.Request.Name = requestNameQuery

	requestUserUUIDOk := req.HasQueryValue("request.userUUID")
	if requestUserUUIDOk {
		requestUserUUIDQuery, ok := req.GetQueryValue("request.userUUID")
		if !ok {
			return ctx
		}
		requestBody.Request.UserUUID = ptr.String(requestUserUUIDQuery)
	}

	requestFooOk := req.CheckQueryValue("request.foo")
	if !requestFooOk {
		return ctx
	}
	requestFooQuery, ok := req.GetQueryValueList("request.foo")
	if !ok {
		return ctx
	}
	requestBody.Request.Foo = requestFooQuery

	var _queryNeeded bool
	for _, _pfx := range []string{"opt", "opt.name", "opt.useruuid", "opt.authuuid", "opt.authuuid2"} {
		if _queryNeeded = req.HasQueryPrefix(_pfx); _queryNeeded {
			break
		}
	}
	if _queryNeeded {
		if requestBody.Opt == nil {
			requestBody.Opt = &endpointsIDlEndpointsBarBar.QueryParamsOptsStruct{}
		}
		optNameOk := req.CheckQueryValue("opt.name")
		if !optNameOk {
			return ctx
		}
		optNameQuery, ok := req.GetQueryValue("opt.name")
		if !ok {
			return ctx
		}
		requestBody.Opt.Name = optNameQuery

		optUserUUIDOk := req.HasQueryValue("opt.userUUID")
		if optUserUUIDOk {
			optUserUUIDQuery, ok := req.GetQueryValue("opt.userUUID")
			if !ok {
				return ctx
			}
			requestBody.Opt.UserUUID = ptr.String(optUserUUIDQuery)
		}

		optAuthUUIDOk := req.HasQueryValue("opt.authUUID")
		if optAuthUUIDOk {
			optAuthUUIDQuery, ok := req.GetQueryValue("opt.authUUID")
			if !ok {
				return ctx
			}
			requestBody.Opt.AuthUUID = ptr.String(optAuthUUIDQuery)
		}

		optAuthUUID2Ok := req.HasQueryValue("opt.authUUID2")
		if optAuthUUID2Ok {
			optAuthUUID2Query, ok := req.GetQueryValue("opt.authUUID2")
			if !ok {
				return ctx
			}
			requestBody.Opt.AuthUUID2 = ptr.String(optAuthUUID2Query)
		}

	}

	// log endpoint request to downstream services
	if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil {
		zfields := []zapcore.Field{
			zap.String("endpoint", h.endpoint.EndpointName),
		}
		zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody())))
		for _, k := range req.Header.Keys() {
			if val, ok := req.Header.Get(k); ok {
				zfields = append(zfields, zap.String(k, val))
			}
		}
		ctx = h.Dependencies.Default.ContextLogger.DebugZ(ctx, "endpoint request to downstream", zfields...)
	}

	w := workflow.NewBarArgWithNestedQueryParamsWorkflow(h.Dependencies)
	if span := req.GetSpan(); span != nil {
		ctx = opentracing.ContextWithSpan(ctx, span)
	}

	ctx, response, cliRespHeaders, err := w.Handle(ctx, req.Header, &requestBody)

	// log downstream response to endpoint
	if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil {
		zfields := []zapcore.Field{
			zap.String("endpoint", h.endpoint.EndpointName),
		}
		if body, err := json.Marshal(response); err == nil {
			zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body)))
		}
		if cliRespHeaders != nil {
			for _, k := range cliRespHeaders.Keys() {
				if val, ok := cliRespHeaders.Get(k); ok {
					zfields = append(zfields, zap.String(k, val))
				}
			}
		}
		if traceKey, ok := req.Header.Get("x-trace-id"); ok {
			zfields = append(zfields, zap.String("x-trace-id", traceKey))
		}
		ctx = h.Dependencies.Default.ContextLogger.DebugZ(ctx, "downstream service response", zfields...)
	}
	// map useful client response headers to server response
	if cliRespHeaders != nil {
		if val, ok := cliRespHeaders.Get(zanzibar.ClientResponseDurationKey); ok {
			if duration, err := time.ParseDuration(val); err == nil {
				res.DownstreamFinishTime = duration
			}
			cliRespHeaders.Unset(zanzibar.ClientResponseDurationKey)
		}
		if val, ok := cliRespHeaders.Get(zanzibar.ClientTypeKey); ok {
			res.ClientType = val
			cliRespHeaders.Unset(zanzibar.ClientTypeKey)
		}
	}

	if err != nil {
		res.SendError(500, "Unexpected server error", err)
		return ctx

	}

	res.WriteJSON(200, cliRespHeaders, response)
	return ctx
}


text:
cd parcel4me-woo

echo
echo "About to remove the current version of the P4M widgets ..."
echo "Press any key to proceed"
read -n1 -r

rm -rf ./lib

echo
echo "Installing the P4M widgets from https://github.com/ParcelForMe/p4m-widgets/ into ./lib/"
echo "Press any key to proceed"
read -n1 -r

mkdir ./lib
cd lib
git clone https://github.com/ParcelForMe/p4m-widgets/
cd p4m-widgets

echo " Use api_refactor branch, until such a time as that is merged back into master !!!"
git checkout api_refactor

bower install
mv bower_components/* ..
rmdir bower_components
rm -rf .git*


text:
//
//  ========================================================================
//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
//  ------------------------------------------------------------------------
//  All rights reserved. This program and the accompanying materials
//  are made available under the terms of the Eclipse Public License v1.0
//  and Apache License v2.0 which accompanies this distribution.
//
//      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================
//

package org.eclipse.jetty.rhttp.gateway;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.rhttp.client.RHTTPRequest;
import org.eclipse.jetty.rhttp.client.RHTTPResponse;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;

/**
 * The servlet that handles the communication with the gateway clients.
 * @version $Revision$ $Date$
 */
public class ConnectorServlet extends HttpServlet
{
    private final Logger logger = Log.getLogger(getClass().toString());
    private final TargetIdRetriever targetIdRetriever = new StandardTargetIdRetriever();
    private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
    private final ConcurrentMap<String, Future<?>> expirations = new ConcurrentHashMap<String, Future<?>>();
    private final Gateway gateway;
    private long clientTimeout=15000;

    public ConnectorServlet(Gateway gateway)
    {
        this.gateway = gateway;
    }

    @Override
    public void init() throws ServletException
    {
        String t = getInitParameter("clientTimeout");
        if (t!=null && !"".equals(t))
            clientTimeout=Long.parseLong(t);
    }

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        String targetId = targetIdRetriever.retrieveTargetId(request);

        String uri = request.getRequestURI();
        String path = uri.substring(request.getServletPath().length());
        String[] segments = path.split("/");
        if (segments.length < 3)
            throw new ServletException("Invalid request to " + getClass().getSimpleName() + ": " + uri);

        String action = segments[2];
        if ("handshake".equals(action))
            serviceHandshake(targetId, request, response);
        else if ("connect".equals(action))
            serviceConnect(targetId, request, response);
        else if ("deliver".equals(action))
            serviceDeliver(targetId, request, response);
        else if ("disconnect".equals(action))
            serviceDisconnect(targetId, request, response);
        else
            throw new ServletException("Invalid request to " + getClass().getSimpleName() + ": " + uri);
    }

    private void serviceHandshake(String targetId, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException
    {
        ClientDelegate client = gateway.getClientDelegate(targetId);
        if (client != null)
            throw new IOException("Client with targetId " + targetId + " is already connected");

        client = gateway.newClientDelegate(targetId);
        ClientDelegate existing = gateway.addClientDelegate(targetId, client);
        if (existing != null)
            throw new IOException("Client with targetId " + targetId + " is already connected");

        flush(client, httpRequest, httpResponse);
    }

    private void flush(ClientDelegate client, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException
    {
        List<RHTTPRequest> requests = client.process(httpRequest);
        if (requests != null)
        {
            // Schedule before sending the requests, to avoid that the remote client
            // reconnects before we have scheduled the expiration timeout.
            if (!client.isClosed())
                schedule(client);

            ServletOutputStream output = httpResponse.getOutputStream();
            for (RHTTPRequest request : requests)
                output.write(request.getFrameBytes());
            // I could count the framed bytes of all requests and set a Content-Length header,
            // but the implementation of ServletOutputStream takes care of everything:
            // if the request was HTTP/1.1, then flushing result in a chunked response, but the
            // client know how to handle it; if the request was HTTP/1.0, then no chunking.
            // To avoid chunking in HTTP/1.1 I must set the Content-Length header.
            output.flush();
            logger.debug("Delivered to device {} requests {} ", client.getTargetId(), requests);
        }
    }

    private void schedule(ClientDelegate client)
    {
        Future<?> task = scheduler.schedule(new ClientExpirationTask(client), clientTimeout, TimeUnit.MILLISECONDS);
        Future<?> existing = expirations.put(client.getTargetId(), task);
        assert existing == null;
    }

    private void unschedule(String targetId)
    {
        Future<?> task = expirations.remove(targetId);
        if (task != null)
            task.cancel(false);
    }

    private void serviceConnect(String targetId, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException
    {
        unschedule(targetId);

        ClientDelegate client = gateway.getClientDelegate(targetId);
        if (client == null)
        {
            // Expired client tries to connect without handshake
            httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
            return;
        }

        flush(client, httpRequest, httpResponse);

        if (client.isClosed())
            gateway.removeClientDelegate(targetId);
    }

    private void expireConnect(ClientDelegate client, long time)
    {
        String targetId = client.getTargetId();
        logger.info("Client with targetId {} missing, last seen {} ms ago, closing it", targetId, System.currentTimeMillis() - time);
        client.close();
        // If the client expired, means that it did not connect,
        // so there no request to resume, and we cleanup here
        // (while normally this cleanup is done in serviceConnect())
        unschedule(targetId);
        gateway.removeClientDelegate(targetId);
    }

    private void serviceDeliver(String targetId, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException
    {
        if (gateway.getClientDelegate(targetId) == null)
        {
            // Expired client tries to deliver without handshake
            httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
            return;
        }

        byte[] body = Utils.read(httpRequest.getInputStream());

        RHTTPResponse response = RHTTPResponse.fromFrameBytes(body);

        ExternalRequest externalRequest = gateway.removeExternalRequest(response.getId());
        if (externalRequest != null)
        {
            externalRequest.respond(response);
            logger.debug("Deliver request from device {}, gateway request {}, response {}", new Object[] {targetId, externalRequest, response});
        }
        else
        {
            // We can arrive here for a race with the continuation expiration, which expired just before
            // the gateway client responded with a valid response; log this case ignore it.
            logger.debug("Deliver request from device {}, missing gateway request, response {}", targetId, response);
        }
    }

    private void serviceDisconnect(String targetId, HttpServletRequest request, HttpServletResponse response)
    {
        // Do not remove the ClientDelegate from the gateway here,
        // since closing the ClientDelegate will resume the connect request
        // and we remove the ClientDelegate from the gateway there
        ClientDelegate client = gateway.getClientDelegate(targetId);
        if (client != null)
            client.close();
    }

    private class ClientExpirationTask implements Runnable
    {
        private final long time = System.currentTimeMillis();
        private final ClientDelegate client;

        public ClientExpirationTask(ClientDelegate client)
        {
            this.client = client;
        }

        public void run()
        {
            expireConnect(client, time);
        }
    }
}


text:
from itertools import chain
import requests

_HEADERS = {'Accept': 'application/json'}

class ScopusResponse(object):

    def __init__(self, data):
        self._data = data

    def __getitem__(self, key):
        return self._data['search-results'][key]

    def __len__(self):
        return int(self['opensearch:totalResults'])

    def __iter__(self):
        while True:
            yield self
            self = self.next()

    def entries(self):
        return self['entry'] if self else []

    def next_page_url(self):
        try: return next(l['@href'] for l in self['link'] if l['@ref']=='next')
        except: return None

    def next(self):
        url = self.next_page_url()
        if not url: raise StopIteration
        return ScopusResponse(requests.get(url, headers=_HEADERS).json())

    def all_entries(self):
        return list(chain.from_iterable(page.entries() for page in self))

class ScopusClient(object):

    _AUTHOR_API = 'http://api.elsevier.com/content/search/author'
    _SCOPUS_API = 'http://api.elsevier.com/content/search/scopus'

    def __init__(self, apiKey):
        self.apiKey = apiKey

    def _api(self, endpoint, query, extra_params=None):
        params = extra_params.copy() if extra_params else {}
        params.update({'apiKey': self.apiKey, 'query': query})
        resp = requests.get(endpoint, headers=_HEADERS, params=params)
        return ScopusResponse(resp.json())

    def authorSearch(self, query, extra_params=None):
        return self._api(self._AUTHOR_API, query, extra_params)

    def scopusSearch(self, query, complete=False, extra_params=None):
        extra_params = extra_params.copy() if extra_params else {}
        if 'view' not in extra_params:
            extra_params['view'] = 'COMPLETE' if complete else 'STANDARD'
        return self._api(self._SCOPUS_API, query, extra_params)

    def get_scopus_entries(self, author_ids, complete):
        query = ' OR '.join('AU-ID(%s)' % ID for ID in author_ids)
        return self.scopusSearch(query, complete).all_entries()

    def get_authors(self, **kwargs):
        query = ' AND '.join('%s(%s)' % item for item in kwargs.items())
        return self.authorSearch(query).all_entries()


text:
namespace Rewtek.GameLibrary.Game.Scenes
{
    using System;
    using System.Linq;
    using System.Collections.Generic;

    using Rewtek.GameLibrary.Components;
    using Rewtek.GameLibrary.Input;
    using Rewtek.GameLibrary.Rendering;

    public abstract class SceneContainer : Component
    {
        // Properties
        /// <summary>
        /// Gets the <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>s.
        /// </summary>
        protected List<Scene> Scenes { get; private set; }
        /// <summary>
        /// Gets the <see cref="Rewtek.GameLibrary.Rendering.GraphicsDevice"/>.
        /// </summary>
        protected GraphicsDevice GraphicsDevice
        {
            get { return Core.Components.Require<GraphicsDevice>(); }
        }
        /// <summary>
        /// Gets the <see cref="Rewtek.GameLibrary.Input.Mouse"/>.
        /// </summary>
        protected Mouse Mouse
        {
            get { return Core.Components.Require<Mouse>(); }
        }

        // Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="Rewtek.GameLibrary.Game.Scenes.SceneContainer"/> class.
        /// </summary>
        protected SceneContainer()
        {
            Scenes = new List<Scene>();
        }

        // Methods
        #region Implementation of SceneContainer

        /// <summary>
        /// Adds the specified <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>.
        /// </summary>
        /// <param name="scene">The <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>.</param>
        public void Add(Scene scene)
        {
            scene.Parent = this;
            Logger.Log("Adding scene {0}.", scene.GetType().Name);

            scene.OnEnter();

            Scenes.Add(scene);
        }

        /// <summary>
        /// Removes the specified <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>.
        /// </summary>
        /// <param name="scene">The <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>.</param>
        public void Remove(Scene scene)
        {
            scene.Parent = null;
            Logger.Log("Removing scene {0}.", scene.GetType().Name);

            scene.OnLeave();

            Scenes.Remove(scene);
        }

        #endregion

        #region Private Methods

        /// <summary>
        /// Orders the <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>s for game tick processing.
        /// </summary>
        private IEnumerable<Scene> OrderedTickScenes()
        {
            return Scenes.Where(scene => !scene.IsPaused)
                         .OrderBy(scene => scene.TickIndex);
        }

        /// <summary>
        /// Orders the <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>s for the rendering process.
        /// </summary>
        private IEnumerable<Scene> OrderedRenderScenes()
        {
            return Scenes.Where(scene => scene.IsLoaded && scene.IsVisible)
                         .OrderBy(scene => scene.RenderIndex);
        }

        #endregion

        #region Methods

        /// <summary>
        /// Gets a <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>.
        /// </summary>
        public T GetScene<T>() where T : Scene
        {
            return (T)GetScene(scene => scene is T);
        }

        /// <summary>
        /// Gets a <see cref="Rewtek.GameLibrary.Game.Scenes.Scene"/>.
        /// </summary>
        /// <param name="predicate">The <see cref="System.Predicate"/>.</param>
        public Scene GetScene(Predicate<Scene> predicate)
        {
            return this.Scenes.FirstOrDefault(scene => predicate(scene));
        }

        /// <summary>
        /// Handles a game tick.
        /// </summary>
        /// <param name="elapsed">The elapsed.</param>
        public virtual void Tick(float elapsed)
        {
            //using (Scenes.Protect())
            {
                foreach (Scene scene in OrderedTickScenes())
                {
                    scene.LoadContentIfNeeded();
                    if (scene.IsLoaded)
                    {
                        scene.Tick(elapsed);
                    }
                }
            }
        }

        /// <summary>
        /// Handles a game render.
        /// </summary>
        public virtual void Render()
        {
            //using (Scenes.Protect())
            {
                foreach (Scene scene in OrderedRenderScenes())
                {
                    scene.Render();
                }
            }
        }

        #endregion
    }
}


text:
class TemplatesController < ApplicationController
  layout 'workspace'

  before_filter :secure_only, :only => [:enable, :reset]
  before_filter :login_required, :except => [:enable, :reset, :logged_in]
  before_filter :bouncer, :only => [:enable, :reset] if Rails.env.staging?

  #The index is a simple listing of templates.
  def index
    respond_to do |format|
      format.html do
        if logged_in?
          if current_account.real?
            return render :layout => 'workspace'
          else
            return redirect_to '/public/search'
          end
        end
        redirect_to '/home'
      end

      format.json do
        if params[:subtemplates] == 'true'
          #Include subtemplates
          json GroupTemplate.all(:include => :subtemplates).to_json(:include => :subtemplates)
        else
          json GroupTemplate.all()
        end
      end
    end
  end

  # Does the current request come from a logged-in account?
  def logged_in
    return bad_request unless request.format.json? or request.format.js?
    @response = {:logged_in => logged_in?}
    json_response
  end

  # Pull a specific template
  def show
    json GroupTemplate.find(params[:id])
  end

  # Create new template
  def create
    template_attributes = pick(params, :name)
    json GroupTemplate.create(template_attributes)
  end

  # Update template
  def update
    template = GroupTemplate.find(params[:id])
    unless template.update_attributes pick(params, :name)
      return json({ "errors" => template.errors.to_a.map{ |field, error| "#{field} #{error}" } }, 409)
    end

    json({"success" => true})
  end

  # Delete template
  def destroy
    template = GroupTemplate.find(params[:id])
    template.destroy()
    json({"success" => true})
  end

end


text:
<bill session="115" type="s" number="416" updated="2017-09-28T15:45:12Z">
  <state datetime="2017-09-11">PASS_OVER:SENATE</state>
  <status>
    <unknown datetime="2017-09-11"/>
  </status>
  <introduced datetime="2017-02-16"/>
  <titles>
    <title type="short" as="introduced">Small Business Capital Formation Enhancement Act</title>
    <title type="short" as="introduced">Small Business Capital Formation Enhancement Act</title>
    <title type="short" as="passed senate">Small Business Capital Formation Enhancement Act</title>
    <title type="short" as="passed senate">Small Business Capital Formation Enhancement Act</title>
    <title type="official" as="introduced">A bill to amend the Small Business Investment Incentive Act of 1980 to require an annual review by the Securities and Exchange Commission of the annual government-business forum on capital formation.</title>
    <title type="display">Small Business Capital Formation Enhancement Act</title>
  </titles>
  <sponsor bioguide_id="D000607"/>
  <cosponsors>
    <cosponsor bioguide_id="T000476" joined="2017-02-16"/>
  </cosponsors>
  <actions>
    <action datetime="2017-02-16">
      <text>Introduced in Senate</text>
    </action>
    <action datetime="2017-02-16" state="REFERRED">
      <text>Read twice and referred to the Committee on Small Business and Entrepreneurship.</text>
    </action>
    <action datetime="2017-03-07">
      <text>Senate Committee on Small Business and Entrepreneurship discharged by Unanimous Consent.</text>
    </action>
    <action datetime="2017-03-07">
      <text>Referred to the Committee on Banking, Housing, and Urban Affairs.</text>
    </action>
    <action datetime="2017-09-11">
      <text>Senate Committee on Banking, Housing, and Urban Affairs discharged by Unanimous Consent.</text>
      <reference ref="CR S5166" label="consideration"/>
    </action>
    <vote how="by Unanimous Consent" type="vote" datetime="2017-09-11" where="s" result="pass" state="PASS_OVER:SENATE">
      <text>Passed Senate without amendment by Unanimous Consent.</text>
      <reference ref="CR S 5166" label="text"/>
    </vote>
    <action datetime="2017-09-12T17:06:15-04:00">
      <text>Received in the House.</text>
    </action>
    <action datetime="2017-09-12">
      <text>Message on Senate action sent to the House.</text>
    </action>
    <action datetime="2017-09-12T19:59:28-04:00">
      <text>Held at the desk.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="SSBK" name="Senate Banking, Housing, and Urban Affairs" activity="Discharged, Referral"/>
    <committee subcommittee="" code="SSSB" name="Senate Small Business and Entrepreneurship" activity="Discharged, Referral"/>
  </committees>
  <relatedbills>
    <bill type="h" session="115" relation="unknown" number="3280"/>
    <bill type="h" session="115" relation="unknown" number="10"/>
    <bill type="h" session="115" relation="identical" number="3354"/>
    <bill type="h" session="115" relation="identical" number="1312"/>
  </relatedbills>
  <subjects>
    <term name="Commerce"/>
    <term name="Business investment and capital"/>
    <term name="Government studies and investigations"/>
    <term name="Securities and Exchange Commission (SEC)"/>
    <term name="Small business"/>
  </subjects>
  <amendments/>
  <summary date="2017-09-11T12:27:14Z" status="Passed Senate without amendment">(This measure has not been amended since it was introduced. The summary has been expanded because action occurred on the measure.)

Small Business Capital Formation Enhancement Act

(Sec. 2) This bill amends the Small Business Investment Incentive Act of 1980 with respect to the annual government-business forum of the Securities and Exchange Commission (SEC) to review the current status of problems and programs relating to small business capital formation.

The SEC shall review each of the forum's findings and recommendations and issue a public statement promptly assessing it and disclosing the action, if any, the SEC intends to take with respect to it.</summary>
  <committee-reports/>
</bill>


text:
namespace BitArray64
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    public class BitArray64Main
    {
        public static void Main()
        {
            BitArray64Class first = new BitArray64Class(4444);
            BitArray64Class second = new BitArray64Class(3333);

            Console.WriteLine("First number in bits is:");

            foreach (var bit in first)
            {
                Console.Write(bit + " ");
            }
            Console.WriteLine();
            Console.WriteLine("Second number in bits is:");

            foreach (var bit in second)
            {
                Console.Write(bit + " ");
            }
            Console.WriteLine();

            Console.WriteLine("Bit from number {0} in position 15 is {1}",first.Number, first[15]);

            Console.WriteLine("Is {0} == {1} -> {2}", first.Number, second.Number, first == second);
            Console.WriteLine("Is {0} != {1} -> {2}", first.Number, second.Number, first != second);
            Console.WriteLine("Is {0} equals {1} -> {2}", first.Number, second.Number, first.Equals(second));
        }
    }
}


text:
package org.apache.http.util;

/**
 * @since 4.3
 */
public final class TextUtils {

    /**
     * Returns true if the parameter is null or of zero length
     */
    public static boolean isEmpty(final CharSequence s) {
        if (s == null) {
            return true;
        }
        return s.length() == 0;
    }

    /**
     * Returns true if the parameter is null or contains only whitespace
     */
    public static boolean isBlank(final CharSequence s) {
        if (s == null) {
            return true;
        }
        for (int i = 0; i < s.length(); i++) {
            if (!Character.isWhitespace(s.charAt(i))) {
                return false;
            }
        }
        return true;
    }

    /**
     * @since 4.4
     */
    public static boolean containsBlanks(final CharSequence s) {
        if (s == null) {
            return false;
        }
        for (int i = 0; i < s.length(); i++) {
            if (Character.isWhitespace(s.charAt(i))) {
                return true;
            }
        }
        return false;
    }

}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Routes;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Routes.Model;
using Microsoft.WindowsAzure.Management;
using Microsoft.WindowsAzure.Management.Compute;
using Microsoft.WindowsAzure.Management.Network;
using Moq;
using Xunit;
using Models = Microsoft.WindowsAzure.Management.Network.Models;

namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.Routes
{
    public class GetSubnetRouteTableTests
    {
        private const string RouteTableName = "routeTableName";
        private const string VirtualNetworkName = "virtualNetworkName";
        private const string SubnetName = "subnetName";
        private const string RouteTableLocation = "usnorth";
        private const string RouteTableLabel = "My Route Table label";

        private IList<Models.Route> Routes = new List<Models.Route>()
        {
            new Models.Route()
            {
                Name = "rule1",
                AddressPrefix = "0.0.0.0/0",
                NextHop = new Models.NextHop()
                {
                    Type = "VPNGateway"
                },
                State = Models.RouteState.Created
            },
        };

        private MockCommandRuntime mockCommandRuntime;

        private GetAzureSubnetRouteTable cmdlet;

        private NetworkClient client;
        private Mock<INetworkManagementClient> networkingClientMock;
        private Mock<IComputeManagementClient> computeClientMock;
        private Mock<IManagementClient> managementClientMock;

        public GetSubnetRouteTableTests()
        {
            this.networkingClientMock = new Mock<INetworkManagementClient>();
            this.computeClientMock = new Mock<IComputeManagementClient>();
            this.managementClientMock = new Mock<IManagementClient>();
            this.mockCommandRuntime = new MockCommandRuntime();
            this.client = new NetworkClient(
                networkingClientMock.Object,
                computeClientMock.Object,
                managementClientMock.Object,
                mockCommandRuntime);

            this.networkingClientMock
                .Setup(c => c.Routes.GetRouteTableForSubnetAsync(
                    VirtualNetworkName,
                    SubnetName,
                    It.IsAny<CancellationToken>()))
                .Returns(Task.Factory.StartNew(() =>
                    new Models.GetRouteTableForSubnetResponse()
                    {
                        RouteTableName = RouteTableName
                    }));

            this.networkingClientMock
                .Setup(c => c.Routes.GetRouteTableWithDetailsAsync(
                    RouteTableName,
                    NetworkClient.WithoutRoutesDetailLevel,
                    It.IsAny<CancellationToken>()))
                .Returns(Task.Factory.StartNew(() =>
                    new Models.GetRouteTableResponse()
                    {
                        RouteTable = new Models.RouteTable()
                        {
                            Name = RouteTableName,
                            Location = RouteTableLocation,
                            Label = RouteTableLabel,
                        }
                    }));

            this.networkingClientMock
                .Setup(c => c.Routes.GetRouteTableWithDetailsAsync(
                    RouteTableName,
                    NetworkClient.WithRoutesDetailLevel,
                    It.IsAny<CancellationToken>()))
                .Returns(Task.Factory.StartNew(() =>
                    new Models.GetRouteTableResponse()
                    {
                        RouteTable = new Models.RouteTable()
                        {
                            Name = RouteTableName,
                            Location = RouteTableLocation,
                            Label = RouteTableLabel,
                            RouteList = Routes
                        }
                    }));
        }

        [Fact]
        [Trait(Category.Service, Category.Network)]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void GetRouteTableForSubnetNoDetails()
        {
            // Setup
            cmdlet = new GetAzureSubnetRouteTable
            {
                VirtualNetworkName = VirtualNetworkName,
                SubnetName = SubnetName,
                CommandRuntime = mockCommandRuntime,
                Client = this.client
            };

            // Action
            cmdlet.ExecuteCmdlet();

            // Assert
            networkingClientMock.Verify(
                c => c.Routes.GetRouteTableForSubnetAsync(
                    VirtualNetworkName,
                    SubnetName,
                    It.IsAny<CancellationToken>()),
                Times.Once());

            networkingClientMock.Verify(
                c => c.Routes.GetRouteTableWithDetailsAsync(
                    RouteTableName,
                    NetworkClient.WithoutRoutesDetailLevel,
                    It.IsAny<CancellationToken>()),
                Times.Once);

            Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
            Assert.IsType<SimpleRouteTable>(mockCommandRuntime.OutputPipeline.Single());
            var routeTable = (SimpleRouteTable)(mockCommandRuntime.OutputPipeline.Single());
            Assert.Equal(RouteTableName, routeTable.Name);
            Assert.Equal(RouteTableLabel, routeTable.Label);
            Assert.Equal(RouteTableLocation, routeTable.Location);
        }

        [Fact]
        [Trait(Category.Service, Category.Network)]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void GetRouteTableForSubnetDetails()
        {
            // Setup
            cmdlet = new GetAzureSubnetRouteTable
            {
                VirtualNetworkName = VirtualNetworkName,
                SubnetName = SubnetName,
                CommandRuntime = mockCommandRuntime,
                Client = this.client,
                Detailed = new SwitchParameter(true)
            };

            // Action
            cmdlet.ExecuteCmdlet();

            // Assert
            networkingClientMock.Verify(
                c => c.Routes.GetRouteTableForSubnetAsync(
                    VirtualNetworkName,
                    SubnetName,
                    It.IsAny<CancellationToken>()),
                Times.Once());

            networkingClientMock.Verify(
                c => c.Routes.GetRouteTableWithDetailsAsync(
                    RouteTableName,
                    NetworkClient.WithRoutesDetailLevel,
                    It.IsAny<CancellationToken>()),
                Times.Once);

            Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
            Assert.IsType<RouteTableWithRoutes>(mockCommandRuntime.OutputPipeline.Single());
            var routeTable = (RouteTableWithRoutes)(mockCommandRuntime.OutputPipeline.Single());
            Assert.Equal(RouteTableName, routeTable.Name);
            Assert.Equal(RouteTableLabel, routeTable.Label);
            Assert.Equal(RouteTableLocation, routeTable.Location);
            Assert.NotEmpty(routeTable.Routes);
            Assert.Equal(Routes.First().Name, routeTable.Routes.First().Name);
            Assert.Equal(Routes.First().AddressPrefix, routeTable.Routes.First().AddressPrefix);
            Assert.Equal(Routes.First().NextHop.IpAddress, routeTable.Routes.First().NextHop.IpAddress);
            Assert.Equal(Routes.First().NextHop.Type, routeTable.Routes.First().NextHop.Type);
        }
    }
}


text:
Wrapper for [Cheerio](http://cheeriojs.github.io/cheerio/) that provides a simplified constructor and changes the context of callbacks to a `Cheerio` object instead of raw element.

## Installation

```
npm install bauer-dom
```

## Usage

```js
var dom = require("bauer-dom");

// extract all link urls in the document
var urls = dom("<html>...</html>")
  .find("a[href]")
  .map(function() {
    return this.attr("href");
  });
```

## License

[MIT](./LICENSE)


text:
package com.couchbase.lite.internal.database.util;

/**
 * Container to ease passing around a tuple of two objects. This object provides a sensible
 * implementation of equals(), returning true if equals() is true on each of the contained
 * objects.
 */
public class Pair<F, S> {
    public final F first;
    public final S second;

    /**
     * Constructor for a Pair.
     *
     * @param first the first object in the Pair
     * @param second the second object in the pair
     */
    public Pair(F first, S second) {
        this.first = first;
        this.second = second;
    }

    /**
     * Checks the two objects for equality by delegating to their respective
     * {@link Object#equals(Object)} methods.
     *
     * @param o the {@link Pair} to which this one is to be checked for equality
     * @return true if the underlying objects of the Pair are both considered
     *         equal
     */
    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Pair)) {
            return false;
        }
        Pair<?, ?> p = (Pair<?, ?>) o;
        return ((p.first != null && p.first.equals(first)) || (p.first == null && first == null)) &&
                (p.second != null && p.second.equals(second) || (p.second == null && second == null));
    }

    /**
     * Compute a hash code using the hash codes of the underlying objects
     *
     * @return a hashcode of the Pair
     */
    @Override
    public int hashCode() {
        return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
    }

    /**
     * Convenience method for creating an appropriately typed pair.
     * @param a the first object in the Pair
     * @param b the second object in the pair
     * @return a Pair that is templatized with the types of a and b
     */
    public static <A, B> Pair <A, B> create(A a, B b) {
        return new Pair<A, B>(a, b);
    }
}


text:
package picard.analysis;

import htsjdk.samtools.SAMFileHeader;
import htsjdk.samtools.SAMFileHeader.SortOrder;
import htsjdk.samtools.SAMRecord;
import htsjdk.samtools.SamReader;
import htsjdk.samtools.SamReaderFactory;
import htsjdk.samtools.reference.ReferenceSequence;
import htsjdk.samtools.reference.ReferenceSequenceFileWalker;
import htsjdk.samtools.util.CloserUtil;
import htsjdk.samtools.util.IOUtil;
import htsjdk.samtools.util.Log;
import htsjdk.samtools.util.ProgressLogger;
import htsjdk.samtools.util.SequenceUtil;
import org.broadinstitute.barclay.argparser.Argument;
import org.broadinstitute.barclay.argparser.ArgumentCollection;
import picard.PicardException;
import picard.cmdline.CommandLineProgram;
import picard.cmdline.StandardOptionDefinitions;
import picard.cmdline.argumentcollections.OutputArgumentCollection;
import picard.cmdline.argumentcollections.RequiredOutputArgumentCollection;

import java.io.File;
import java.util.Arrays;
import java.util.Collection;

/**
 * Super class that is designed to provide some consistent structure between subclasses that
 * simply iterate once over a coordinate sorted BAM and collect information from the records
 * as the go in order to produce some kind of output.
 *
 * @author Tim Fennell
 */
public abstract class SinglePassSamProgram extends CommandLineProgram {
    @Argument(shortName = StandardOptionDefinitions.INPUT_SHORT_NAME, doc = "Input SAM/BAM/CRAM file.")
    public File INPUT;

    @ArgumentCollection
    public OutputArgumentCollection output = getOutputArgumentCollection();

    protected OutputArgumentCollection getOutputArgumentCollection(){
        return new RequiredOutputArgumentCollection();
    }

    protected File OUTPUT;

    @Argument(doc = "If true (default), then the sort order in the header file will be ignored.",
            shortName = StandardOptionDefinitions.ASSUME_SORTED_SHORT_NAME)
    public boolean ASSUME_SORTED = true;

    @Argument(doc = "Stop after processing N reads, mainly for debugging.")
    public long STOP_AFTER = 0;

    private static final Log log = Log.getInstance(SinglePassSamProgram.class);

    /**
     * Set the reference File.
     */
    public void setReferenceSequence(final File referenceFile) {
        REFERENCE_SEQUENCE = referenceFile;
    };

    /**
     * Final implementation of doWork() that checks and loads the input and optionally reference
     * sequence files and the runs the sublcass through the setup() acceptRead() and finish() steps.
     */
    @Override
    protected final int doWork() {

        makeItSo(INPUT, REFERENCE_SEQUENCE, ASSUME_SORTED, STOP_AFTER, Arrays.asList(this));
        return 0;
    }

    public static void makeItSo(final File input,
                                final File referenceSequence,
                                final boolean assumeSorted,
                                final long stopAfter,
                                final Collection<SinglePassSamProgram> programs) {

        // Setup the standard inputs
        IOUtil.assertFileIsReadable(input);
        final SamReader in = SamReaderFactory.makeDefault().referenceSequence(referenceSequence).open(input);

        // Optionally load up the reference sequence and double check sequence dictionaries
        final ReferenceSequenceFileWalker walker;
        if (referenceSequence == null) {
            walker = null;
        } else {
            IOUtil.assertFileIsReadable(referenceSequence);
            walker = new ReferenceSequenceFileWalker(referenceSequence);

            if (!in.getFileHeader().getSequenceDictionary().isEmpty()) {
                SequenceUtil.assertSequenceDictionariesEqual(in.getFileHeader().getSequenceDictionary(),
                        walker.getSequenceDictionary());
            }
        }

        // Check on the sort order of the BAM file
        {
            final SortOrder sort = in.getFileHeader().getSortOrder();
            if (sort != SortOrder.coordinate) {
                if (assumeSorted) {
                    log.warn("File reports sort order '" + sort + "', assuming it's coordinate sorted anyway.");
                } else {
                    throw new PicardException("File " + input.getAbsolutePath() + " should be coordinate sorted but " +
                            "the header says the sort order is " + sort + ". If you believe the file " +
                            "to be coordinate sorted you may pass ASSUME_SORTED=true");
                }
            }
        }

        // Call the abstract setup method!
        boolean anyUseNoRefReads = false;
        for (final SinglePassSamProgram program : programs) {
            if (program.OUTPUT == null) {
                program.OUTPUT = program.output.getOutputFile();
            }
            program.setup(in.getFileHeader(), input);
            anyUseNoRefReads = anyUseNoRefReads || program.usesNoRefReads();
        }

        final ProgressLogger progress = new ProgressLogger(log);

        for (final SAMRecord rec : in) {
            final ReferenceSequence ref;
            if (walker == null || rec.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) {
                ref = null;
            } else {
                ref = walker.get(rec.getReferenceIndex());
            }

            for (final SinglePassSamProgram program : programs) {
                program.acceptRead(rec, ref);
            }

            progress.record(rec);

            // See if we need to terminate early?
            if (stopAfter > 0 && progress.getCount() >= stopAfter) {
                break;
            }

            // And see if we're into the unmapped reads at the end
            if (!anyUseNoRefReads && rec.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) {
                break;
            }
        }

        CloserUtil.close(in);

        for (final SinglePassSamProgram program : programs) {
            program.finish();
        }
    }

    /** Can be overridden and set to false if the section of unmapped reads at the end of the file isn't needed. */
    protected boolean usesNoRefReads() { return true; }

    /** Should be implemented by subclasses to do one-time initialization work. */
    protected abstract void setup(final SAMFileHeader header, final File samFile);

    /**
     * Should be implemented by subclasses to accept SAMRecords one at a time.
     * If the read has a reference sequence and a reference sequence file was supplied to the program
     * it will be passed as 'ref'. Otherwise 'ref' may be null.
     */
    protected abstract void acceptRead(final SAMRecord rec, final ReferenceSequence ref);

    /** Should be implemented by subclasses to do one-time finalization work. */
    protected abstract void finish();

}


text:
<?php
/**
 * Edit address form
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $woocommerce, $current_user;

get_currentuserinfo();
?>

<?php $woocommerce->show_messages(); ?>

<?php if (!$load_address) : ?>

	<?php woocommerce_get_template('myaccount/my-address.php'); ?>

<?php else : ?>

	<form action="<?php echo esc_url( add_query_arg( 'address', $load_address, get_permalink( woocommerce_get_page_id('edit_address') ) ) ); ?>" method="post" class="edit-address">

<?php if ($load_address=='billing') _e( 'Billing Address', 'woocommerce' ); else _e( 'Shipping Address', 'woocommerce' ); ?>

		<?php
		foreach ($address as $key => $field) :
			$value = (isset($_POST[$key])) ? $_POST[$key] : get_user_meta( get_current_user_id(), $key, true );

			// Default values
			if (!$value && ($key=='billing_email' || $key=='shipping_email')) $value = $current_user->user_email;
			if (!$value && ($key=='billing_country' || $key=='shipping_country')) $value = $woocommerce->countries->get_base_country();
			if (!$value && ($key=='billing_state' || $key=='shipping_state')) $value = $woocommerce->countries->get_base_state();

			woocommerce_form_field( $key, $field, $value );
		endforeach;
		?>

		<input type="submit" class="button" name="save_address" value="<?php _e( 'Save Address', 'woocommerce' ); ?>">
		<?php $woocommerce->nonce_field('edit_address') ?>
		<input type="hidden" name="action" value="edit_address">

	</form>

<?php endif; ?>


text:
import { CompilerOptions } from 'typescript';
export default function runTsDiagnostics(filePath: string, compilerOptions: CompilerOptions): void;


text:
describe("lpeg_patterns.http.sts", function()
	local http_sts = require "lpeg_patterns.http.sts"
	local lpeg = require "lpeg"
	local EOF = lpeg.P(-1)
	it("Parses a Strict-Transport-Security header", function()
		local sts_patt = http_sts.Strict_Transport_Security * EOF
		assert.same({["max-age"] = "0"}, sts_patt:match("max-age=0"))
		assert.same({["max-age"] = "0"}, sts_patt:match("max-age = 0"))
		assert.same({["max-age"] = "0"}, sts_patt:match("Max-Age=0"))
		assert.same({["max-age"] = "0"; includesubdomains = true}, sts_patt:match("max-age=0;includeSubdomains"))
		assert.same({["max-age"] = "0"; includesubdomains = true}, sts_patt:match("max-age=0 ; includeSubdomains"))
		-- max-age is required
		assert.same(nil, sts_patt:match("foo=0"))
		-- Should fail to parse when duplicate field given.
		assert.same(nil, sts_patt:match("max-age=42; foo=0; foo=1"))
	end)
end)


text:
import React, { Component } from 'react'
import {push} from 'react-router-redux'
import {createSelector} from 'reselect'
import { connect } from 'react-redux'
import Player from 'components/Player'
import Header from 'components/Header'
import menuActions from 'actions/menus'
import playerActions from 'actions/player'
import searchActions from 'actions/search'

@connect(
	state => ({
		...state.menus,
		...state.player,
		currentPath: createSelector(
			state => state.menus.list,
			state => state.routing.locationBeforeTransitions.pathname,
			(list = [], pathname) => list.length === 0 ? '' : list.filter(item => item.path === pathname).length > 0 ? pathname : list[0].path
		)(state)
	}), {
		actionGoHome: () => push('/music'),
		queryMenuList: menuActions.queryMenuList,
		getPlayerlist: playerActions.getPlayerlist,
		setlist: playerActions.setlist,
		setindex: playerActions.setindex,
		setmodel: playerActions.setmodel,
		getlyric: playerActions.getlyric,
		songdetail: playerActions.songdetail,
		getSongLyric: playerActions.getSongLyric,
		getJsondata: playerActions.getJsondata,
		getSonginfo: playerActions.getSonginfo,
		getSearchResult: searchActions.getSearchResult,
		searchKw: searchActions.searchKw
	}
)
class Index extends Component {
	componentWillMount() {
		this.props.queryMenuList()
		this.props.getPlayerlist("/musiclist/77149051/")
	}

	render() {
		const menuList = this.props.list
		return (
			<div className='body'>
				<Header
					navItem={menuList}
					path={this.props.currentPath}
					onlogoClickAction={this.props.actionGoHome}
					router={this.props.route}
					push={this.props.history.push}
					getSearchResult={this.props.getSearchResult}
				/>
				{this.props.children}
				<Player {...this.props} />
			</div>
		)
	}
}

export default Index


text:
layout: page
title: Dark Guardian International Seminar
date: 2016-05-24
author: Dylan Flowers
tags: weekly links, java
status: published
summary: Aenean suscipit, augue non pretium.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 04/15/2016
  endDate: 04/19/2016
  ctyhocn: SATPLHX
  groupCode: DGIS
published: true
---
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nunc mauris magna, rhoncus vitae gravida sit amet, finibus non ante. Suspendisse a metus tellus. Aliquam et ipsum ac mauris sodales porta sed eget nibh. Proin ut orci pulvinar, imperdiet risus id, maximus quam. Praesent viverra lacus vitae nisi imperdiet placerat. Integer congue urna eros, pulvinar hendrerit urna sagittis et. Ut viverra ut sem porta hendrerit. Vestibulum lobortis, tellus at cursus lacinia, eros ligula tincidunt ipsum, nec malesuada nunc lectus quis arcu. Nam dignissim mi fringilla est interdum, eget convallis odio porta. Maecenas dictum cursus tellus, sed gravida est ultricies ac. Nam vitae dui ac est tincidunt blandit.

* In id turpis tristique, pharetra ante ut, ullamcorper lacus
* Integer at augue interdum libero sodales tempus in ac felis.

Duis at sodales sapien, nec hendrerit libero. Vestibulum hendrerit eu nulla non eleifend. Sed lobortis neque nunc, et pulvinar dolor tristique quis. Duis consectetur, diam sed pharetra porttitor, ligula augue placerat velit, a hendrerit tellus diam id lacus. Phasellus lectus urna, viverra vel nisl eu, sodales porttitor arcu. Quisque eu metus convallis, placerat nulla ut, vestibulum mi. Vestibulum nec dui at ipsum consectetur dictum vitae sed dolor.


text:
/**
    File Name:          12.2-1.js
    ECMA Section:       The variable statement
    Description:

    If the variable statement occurs inside a FunctionDeclaration, the
    variables are defined with function-local scope in that function, as
    described in section 10.1.3. Otherwise, they are defined with global
    scope, that is, they are created as members of the global object, as
    described in section 0. Variables are created when the execution scope
    is entered. A Block does not define a new execution scope. Only Program and
    FunctionDeclaration produce a new scope. Variables are initialized to the
    undefined value when created. A variable with an Initializer is assigned
    the value of its AssignmentExpression when the VariableStatement is executed,
    not when the variable is created.

    Author:             christine@netscape.com
    Date:               12 november 1997
*/

    var SECTION = "12.2-1";
    var VERSION = "ECMA_1";
    startTest();
    var TITLE   = "The variable statement";

    writeHeaderToLog( SECTION +" "+ TITLE);

    var testcases = new Array();

    testcases[tc] = new TestCase(    "SECTION",
                                    "var x = 3; function f() { var a = x; var x = 23; return a; }; f()",
                                    void 0,
                                    eval("var x = 3; function f() { var a = x; var x = 23; return a; }; f()") );

    test();

function test() {
    for ( tc=0; tc < testcases.length; tc++ ) {
        testcases[tc].passed = writeTestCaseResult(
                            testcases[tc].expect,
                            testcases[tc].actual,
                            testcases[tc].description +" = "+
                            testcases[tc].actual );

        testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
    }
    stopTest();
    return ( testcases );
}


text:
<?php

namespace app\commands;

use jones\wschat\components\Chat;
use jones\wschat\components\ChatManager;
use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;

class ServerController extends \yii\console\Controller
{
    public function actionRun()
    {
        $server = IoServer::factory(new HttpServer(new WsServer(new Chat(new ChatManager()))), 8080);
        $server->run();
    }
}


text:
#ifndef POLYGRAPH__XPARSER_GPARSER_H
#define POLYGRAPH__XPARSER_GPARSER_H

#include "xstd/Array.h"
#include "xparser/SynSym.h"
#include "xparser/Lexer.h"

struct ReduceInfo;

// The GParser class is the base class from which generated parser classes
// are derived from.

// The GParser class provides the general bottom-up driver routine
// for LR(1) parsing.  It includes two stacks: the first is the
// push-down stack for parsing, while the second is for semantic
// attributes.

// It also continues hooks for 3 other tables: the actionTable
// merges parsing action and transition information.  A position
// value indicates a shift to a destination state.  A negative
// value indicates a reduction whose details are found in the
// reduceTable.  Conditionals are indicated by the condTable
// pointer.

class GParser {
	public:
		GParser(Lexer *);
		virtual ~GParser();

		const SynSym *parse();

	protected:
		virtual int actionTable(int, int) = 0;
		virtual ReduceInfo *reduceTable(int) = 0;

		int top() { return theParseStack.last(); }
		void push(int x) { theParseStack.push(x); }
		void throwAway(int x) { theParseStack.pop(x); }

		SynSym **sem_top(int len) { return &theSemStack.last(len); }
		void sem_push(SynSym *x);
		void sem_throwAway(int x);
		void peek();
		const TokenLoc &tokenLoc() const { return lexer->token().loc(); }

	protected:
		Lexer *lexer;

		int maxState;
		int acceptState;
		int *condTable;

		Array<SynSym*> theSemStack;
		Array<int> theParseStack;
};

struct ReduceInfo {
	int head;
	int parseItems;
	int semItems;
	SynSym *(*action)(SynSym **);
	int   (*conditional)(SynSym **);
};

#endif


text:
<?php

namespace Application\AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Application\AppBundle\Entity\Currencies
 */
class Currencies
{
    /**
     * @var integer $id
     */
    private $id;

    /**
     * @var string $currencyname
     */
    private $currencyname;

    /**
     * @var string $currencycode
     */
    private $currencycode;

    /**
     * @var string $currencysymbolleft
     */
    private $currencysymbolleft;

    /**
     * @var string $currencysymbolright
     */
    private $currencysymbolright;

    /**
     * @var integer $currencydecimalplaces
     */
    private $currencydecimalplaces;

    /**
     * @var float $currencyvalue
     */
    private $currencyvalue;

    /**
     * @var string $currencydefault
     */
    private $currencydefault;

    /**
     * @var string $currencytype
     */
    private $currencytype;

    /**
     * @var string $currencyactive
     */
    private $currencyactive;

    /**
     * @var string $currencystatus
     */
    private $currencystatus;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set currencyname
     *
     * @param string $currencyname
     * @return Currencies
     */
    public function setCurrencyname($currencyname)
    {
        $this->currencyname = $currencyname;

        return $this;
    }

    /**
     * Get currencyname
     *
     * @return string
     */
    public function getCurrencyname()
    {
        return $this->currencyname;
    }

    /**
     * Set currencycode
     *
     * @param string $currencycode
     * @return Currencies
     */
    public function setCurrencycode($currencycode)
    {
        $this->currencycode = $currencycode;

        return $this;
    }

    /**
     * Get currencycode
     *
     * @return string
     */
    public function getCurrencycode()
    {
        return $this->currencycode;
    }

    /**
     * Set currencysymbolleft
     *
     * @param string $currencysymbolleft
     * @return Currencies
     */
    public function setCurrencysymbolleft($currencysymbolleft)
    {
        $this->currencysymbolleft = $currencysymbolleft;

        return $this;
    }

    /**
     * Get currencysymbolleft
     *
     * @return string
     */
    public function getCurrencysymbolleft()
    {
        return $this->currencysymbolleft;
    }

    /**
     * Set currencysymbolright
     *
     * @param string $currencysymbolright
     * @return Currencies
     */
    public function setCurrencysymbolright($currencysymbolright)
    {
        $this->currencysymbolright = $currencysymbolright;

        return $this;
    }

    /**
     * Get currencysymbolright
     *
     * @return string
     */
    public function getCurrencysymbolright()
    {
        return $this->currencysymbolright;
    }

    /**
     * Set currencydecimalplaces
     *
     * @param integer $currencydecimalplaces
     * @return Currencies
     */
    public function setCurrencydecimalplaces($currencydecimalplaces)
    {
        $this->currencydecimalplaces = $currencydecimalplaces;

        return $this;
    }

    /**
     * Get currencydecimalplaces
     *
     * @return integer
     */
    public function getCurrencydecimalplaces()
    {
        return $this->currencydecimalplaces;
    }

    /**
     * Set currencyvalue
     *
     * @param float $currencyvalue
     * @return Currencies
     */
    public function setCurrencyvalue($currencyvalue)
    {
        $this->currencyvalue = $currencyvalue;

        return $this;
    }

    /**
     * Get currencyvalue
     *
     * @return float
     */
    public function getCurrencyvalue()
    {
        return $this->currencyvalue;
    }

    /**
     * Set currencydefault
     *
     * @param string $currencydefault
     * @return Currencies
     */
    public function setCurrencydefault($currencydefault)
    {
        $this->currencydefault = $currencydefault;

        return $this;
    }

    /**
     * Get currencydefault
     *
     * @return string
     */
    public function getCurrencydefault()
    {
        return $this->currencydefault;
    }

    /**
     * Set currencytype
     *
     * @param string $currencytype
     * @return Currencies
     */
    public function setCurrencytype($currencytype)
    {
        $this->currencytype = $currencytype;

        return $this;
    }

    /**
     * Get currencytype
     *
     * @return string
     */
    public function getCurrencytype()
    {
        return $this->currencytype;
    }

    /**
     * Set currencyactive
     *
     * @param string $currencyactive
     * @return Currencies
     */
    public function setCurrencyactive($currencyactive)
    {
        $this->currencyactive = $currencyactive;

        return $this;
    }

    /**
     * Get currencyactive
     *
     * @return string
     */
    public function getCurrencyactive()
    {
        return $this->currencyactive;
    }

    /**
     * Set currencystatus
     *
     * @param string $currencystatus
     * @return Currencies
     */
    public function setCurrencystatus($currencystatus)
    {
        $this->currencystatus = $currencystatus;

        return $this;
    }

    /**
     * Get currencystatus
     *
     * @return string
     */
    public function getCurrencystatus()
    {
        return $this->currencystatus;
    }
}


text:
angular.module("EmmetBlue")

.controller('humanResourcesDepartmentRootsController', function($scope, utils){
	$scope.tempHolder = {};

	$scope.dtInstance = {};
	$scope.dtOptions = utils.DT.optionsBuilder
	.fromFnPromise(function(){
		var departmentRoots = utils.serverRequest('/human-resources/department/view-root-url', 'GET');
		return departmentRoots;
	})
	.withPaginationType('full_numbers')
	.withDisplayLength(10)
	.withFixedHeader()
	.withOption('createdRow', function(row, data, dataIndex){
		utils.compile(angular.element(row).contents())($scope);
	})
	.withOption('headerCallback', function(header) {
        if (!$scope.headerCompiled) {
            $scope.headerCompiled = true;
            utils.compile(angular.element(header).contents())($scope);
        }
    })
	.withButtons([
		{
			text: '  New URL',
			action: function(){
				$("#new_department_root").modal("show");
			},
			key: {
        		key: 'n',
        		ctrlKey: false,
        		altKey: true
        	}
		},
        {
        	extend: 'print',
        	text: ' Print this data page',
        	key: {
        		key: 'p',
        		ctrlKey: false,
        		altKey: true
        	}
        },
        {
        	extend: 'copy',
        	text: ' Copy this data',
        	key: {
        		key: 'c',
        		ctrlKey: false,
        		altKey: true
        	}
        }
	]);

	$scope.dtColumns = [
		utils.DT.columnBuilder.newColumn(null).withTitle("S/N").renderWith(function(data, type, full, meta){
			return meta.row + 1;
		}),
		utils.DT.columnBuilder.newColumn('Name').withTitle("Department"),
		utils.DT.columnBuilder.newColumn('Url').withTitle("Root URL"),
	];

	$scope.reloadDepartmentRootsTable = function(){
		$scope.dtInstance.reloadData();
	}

	$scope.saveNewDepartmentRoot = function(){
		$('.loader').addClass('show');
		var newDepartmentRoot = $scope.newDepartmentRoot;
		var saveNewDepartmentRoot = utils.serverRequest('/human-resources/department/new-root-url', 'POST', newDepartmentRoot);

		saveNewDepartmentRoot.then(function(response){
			$('.loader').removeClass('show');
			utils.notify("Operation successful", "url registered successfully", "success");
			$("#new_department_root").modal("hide");
			$scope.reloadDepartmentRootsTable();
			$scope.newDepartmentRoot = {};
		}, function(response){
			$('.loader').removeClass('show');
			utils.errorHandler(response);
		});
	}

	$scope.saveEditDepartmentRoot = function(){
		var edits = {
			resourceId: $scope.tempHolder.groupId,
			RootName: $scope.tempHolder.groupName
		}
			$('.loader').addClass('show');
		var saveEdits = utils.serverRequest('/human-resources/department/edit', 'PUT', edits);
		saveEdits.then(function(response){
			$('.loader').removeClass('show');
			functions.departmentRootEdited();
		}, function(responseObject){
			$('.loader').removeClass('show');
			utils.errorHandler(responseObject);
		})

	}

	$scope.manageDepartmentRoot = function(manageRoot, groupId){
		switch(manageRoot.toLowerCase()){
			case "edit":{
				functions.manageDepartmentRoot.editDepartmentRoot(groupId);
				break;
			}
			case "delete":{
				functions.manageDepartmentRoot.deleteDepartmentRoot(groupId);
				break;
			}
		}
	}
});


text:
using Microsoft.Win32.SafeHandles;
using System.Runtime.ConstrainedExecution;

namespace Ndapi.Core.Handles
{
    internal abstract class SafeHandleBase : SafeHandleZeroOrMinusOneIsInvalid
    {
        protected SafeHandleBase() : base(true)
        {
        }

        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
        protected abstract bool ReleaseHandleImpl();

        protected override sealed bool ReleaseHandle() => ReleaseHandleImpl();
    }
}


text:
using OpenQA.Selenium;
using TestStack.Seleno.PageObjects;

namespace MvcMusicStore.FunctionalTests.Step3.Pages
{
    public class AlbumBrowsePage : Page
    {
        public AlbumDetailPage SelectAlbumByName(string name)
        {
            string selector = string.Format("img[alt=\"{0}\"]", name);
            return Navigate.To<AlbumDetailPage>(By.CssSelector(selector));
        }
    }
}


text:
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {RouterModule} from '@angular/router';
import {
  BlockScrollStrategyE2eModule
} from './block-scroll-strategy/block-scroll-strategy-e2e-module';
import {ButtonToggleE2eModule} from './button-toggle/button-toggle-e2e-module';
import {ButtonE2eModule} from './button/button-e2e-module';
import {CardE2eModule} from './card/card-e2e-module';
import {CheckboxE2eModule} from './checkbox/checkbox-e2e-module';
import {ComponentHarnessE2eModule} from './component-harness/component-harness-e2e-module';
import {DialogE2eModule} from './dialog/dialog-e2e-module';
import {E2eApp} from './e2e-app';
import {E2eAppModule} from './e2e-app/e2e-app-module';
import {E2E_APP_ROUTES} from './e2e-app/routes';
import {ExpansionE2eModule} from './expansion/expansion-e2e-module';
import {GridListE2eModule} from './grid-list/grid-list-e2e-module';
import {IconE2eModule} from './icon/icon-e2e-module';
import {InputE2eModule} from './input/input-e2e-module';
import {ListE2eModule} from './list/list-e2e-module';
import {MdcButtonE2eModule} from './mdc-button/mdc-button-e2e-module';
import {MdcCardE2eModule} from './mdc-card/mdc-card-e2e-module';
import {MdcCheckboxE2eModule} from './mdc-checkbox/mdc-checkbox-e2e-module';
import {MdcChipsE2eModule} from './mdc-chips/mdc-chips-e2e-module';
import {MdcMenuE2eModule} from './mdc-menu/mdc-menu-e2e-module';
import {MdcRadioE2eModule} from './mdc-radio/mdc-radio-e2e-module';
import {MdcSlideToggleE2eModule} from './mdc-slide-toggle/mdc-slide-toggle-e2e-module';
import {MdcSliderE2eModule} from './mdc-slider/mdc-slider-e2e-module';
import {MdcTableE2eModule} from './mdc-table/mdc-table-e2e-module';
import {MdcTabsE2eModule} from './mdc-tabs/mdc-tabs-e2e-module';
import {MenuE2eModule} from './menu/menu-e2e-module';
import {ProgressBarE2eModule} from './progress-bar/progress-bar-e2e-module';
import {ProgressSpinnerE2eModule} from './progress-spinner/progress-spinner-e2e-module';
import {RadioE2eModule} from './radio/radio-e2e-module';
import {SidenavE2eModule} from './sidenav/sidenav-e2e-module';
import {SlideToggleE2eModule} from './slide-toggle/slide-toggle-e2e-module';
import {StepperE2eModule} from './stepper/stepper-e2e-module';
import {TabsE2eModule} from './tabs/tabs-e2e-module';
import {ToolbarE2eModule} from './toolbar/toolbar-e2e-module';
import {VirtualScrollE2eModule} from './virtual-scroll/virtual-scroll-e2e-module';
import {MdcProgressBarE2eModule} from './mdc-progress-bar/mdc-progress-bar-e2e-module';

@NgModule({
  imports: [
    BrowserModule,
    E2eAppModule,
    NoopAnimationsModule,
    RouterModule.forRoot(E2E_APP_ROUTES),

    // E2E demos
    BlockScrollStrategyE2eModule,
    ButtonE2eModule,
    ButtonToggleE2eModule,
    CardE2eModule,
    CheckboxE2eModule,
    ComponentHarnessE2eModule,
    DialogE2eModule,
    ExpansionE2eModule,
    GridListE2eModule,
    IconE2eModule,
    InputE2eModule,
    ListE2eModule,
    MdcButtonE2eModule,
    MdcCardE2eModule,
    MdcCheckboxE2eModule,
    MdcChipsE2eModule,
    MdcMenuE2eModule,
    MdcRadioE2eModule,
    MdcSliderE2eModule,
    MdcSlideToggleE2eModule,
    MdcTableE2eModule,
    MdcTabsE2eModule,
    MdcProgressBarE2eModule,
    MenuE2eModule,
    ProgressBarE2eModule,
    ProgressSpinnerE2eModule,
    RadioE2eModule,
    SidenavE2eModule,
    SlideToggleE2eModule,
    StepperE2eModule,
    TabsE2eModule,
    ToolbarE2eModule,
    VirtualScrollE2eModule,
  ],
  declarations: [
    E2eApp,
  ],
  bootstrap: [E2eApp],
})
export class MainModule {
}