text:
package org.zv.activlog;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.zv.activlog.model.dao.ActivityAttributeDAO;
import org.zv.activlog.model.dao.ActivityAttributeLogDAO;
import org.zv.activlog.model.dao.ActivityDAO;
import org.zv.activlog.model.dao.ActivityLogDAO;
import org.zv.activlog.model.dao.StatisticsDAO;
import org.zv.activlog.model.entity.ActivityAttribute;
import org.zv.activlog.model.entity.ActivityAttributeLog;
import org.zv.activlog.model.entity.ActivityLog;
import org.zv.activlog.util.Utils;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class ListActivity extends Activity {
	private ListView listView;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.list);

	    Button activities_button = (Button)findViewById(R.id.statistics_activities_button);
	    activities_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				ArrayList<String> list = new ArrayList<String>();

				ActivityDAO activityDAO = new ActivityDAO();
				ActivityAttributeDAO activityAttributeDAO = new ActivityAttributeDAO();

				List<org.zv.activlog.model.entity.Activity> activities = activityDAO.findAll();
				for (org.zv.activlog.model.entity.Activity activity : activities) {
					if (list.size() > 0) {
						list.add("");
					}
					list.add("* " + activity.name + ": " + activity.activityId);

					List<ActivityAttribute> activityAttributes = activityAttributeDAO.findByActivityId(activity.activityId);
					for (ActivityAttribute activityAttribute : activityAttributes) {
						list.add("- " + activityAttribute.name + ": " + activityAttribute.activityAttributeId);
					}
				}

				listView.setAdapter(new ArrayAdapter<String>(ListActivity.this.getApplicationContext(), R.layout.list_item, list.toArray(new String[0])));
			}
	    });

	    Button plain_button = (Button)findViewById(R.id.statistics_plain_button);
	    plain_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				ArrayList<String> list = new ArrayList<String>();

				ActivityDAO activityDAO = new ActivityDAO();
				ActivityAttributeDAO activityAttributeDAO = new ActivityAttributeDAO();
				ActivityLogDAO activityLogDAO = new ActivityLogDAO();
				ActivityAttributeLogDAO activityAttributeLogDAO = new ActivityAttributeLogDAO();

				List<ActivityLog> activityLogs = activityLogDAO.findAll();
				for (ActivityLog activityLog : activityLogs) {
					if (list.size() > 0) {
						list.add("");
					}
					org.zv.activlog.model.entity.Activity activity = activityDAO.find(activityLog.activityId);
					list.add("* " + activity.name + ": " + activityLog.createDate);

					List<ActivityAttributeLog> activityAttributeLogs = activityAttributeLogDAO.findByActivityLogId(activityLog.activityLogId);
					for (ActivityAttributeLog activityAttributeLog : activityAttributeLogs) {
						ActivityAttribute activityAttribute = activityAttributeDAO.find(activityAttributeLog.activityAttributeId);
						list.add("- " + activityAttribute.name + ": " + activityAttributeLog.value);
					}
				}

				listView.setAdapter(new ArrayAdapter<String>(ListActivity.this.getApplicationContext(), R.layout.list_item, list.toArray(new String[0])));
			}
	    });

	    Button group_button = (Button)findViewById(R.id.statistics_group_button);
	    group_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				ArrayList<String> list = new ArrayList<String>();

				StatisticsDAO statisticsDAO = new StatisticsDAO();

				List<Date> dates = new ArrayList<Date>();
				Map<String, Double []> values = new HashMap<String, Double []>();

				int count = statisticsDAO.groupByDate(false, "2012-01-01", "2012-03-30", 2, 7, dates, values);
				Double [] cnt = values.get("cnt");
				Double [] sum = values.get("sum");
				Double [] min = values.get("min");
				Double [] max = values.get("max");
				Double [] avg = values.get("avg");

				for (int i = 0; i < count; i++) {
					if (i > 0) {
						list.add("");
					}
					list.add("* " + Utils.dateToString(dates.get(i)));
					list.add("- cnt: " + cnt[i]);
					list.add("- sum: " + sum[i]);
					list.add("- min: " + min[i]);
					list.add("- max: " + max[i]);
					list.add("- avg: " + avg[i]);
				}

				listView.setAdapter(new ArrayAdapter<String>(ListActivity.this.getApplicationContext(), R.layout.list_item, list.toArray(new String[0])));
			}
	    });

	    listView = (ListView)findViewById(R.id.statistics_listView);
	}
}


text:
var http = require('http.min')

const osmEndpoint = 'https://nominatim.openstreetmap.org/'
const osmUserAgent = 'Homey Tesla App - https://github.com/irritanterik/homey-tesla.com'
const defaultLanguage = 'en'
const debuglog = false

exports.geocodeLatLng = function (lat, lon, language) {
  if (debuglog) console.log('geocode osm', lat, lon)
  if (!language) language = defaultLanguage
  var options = {
    protocol: 'http:',
    uri: `${osmEndpoint}reverse`,
    query: {format: 'json', lat: lat, lon: lon},
    headers: {
      'User-Agent': osmUserAgent, 'Accept-Language': language.toLowerCase()
    }
  }
  return http.json(options).then(function (result) {
    if (result.error || !result.address) return ({place: 'Unknown', city: 'Unknown'})
    return {
      place: result.address.cycleway || result.address.road || result.address.retail || result.address.footway || result.address.address29 || result.address.path || result.address.pedestrian || result.address[Object.keys(result.address)[0]],
      city: result.address.city || result.address.town || result.address.village || result.address[Object.keys(result.address)[1]]
    }
  })
}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import

from subprocess import *

def check_output(*popenargs, **kwargs):
    r"""Run command with arguments and return its output as a byte
    string.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the
    returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example::

    >>> check_output(["ls", "-l", "/dev/null"])
    'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.::

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    'ls: non_existent_file: No such file or directory\n'
    """
    if 'stdout' in kwargs:
        raise ValueError('stdout argument not allowed, it will be overridden.')
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
    output, unused_err = process.communicate()
    retcode = process.poll()
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
        raise CalledProcessError(retcode, cmd)
    return output


text:
/*global Modules:true*/

// define module
var accountModule = Modules.register('accountModule', ['app']);

// config routes
accountModule.config(function ($stateProvider, $urlRouterProvider) {

  $urlRouterProvider.otherwise("/account/login");

  $stateProvider
    .state('account', {
      url: '/account',
      "abstract": true,
      template: "

"
    })
    .state('account.login', {
      url: '/login',
      templateUrl: "modules/account/templates/login.html",
      controller: 'loginController'
    })
    .state('account.logout', {
      url: '/logout',
      template: '

正在登出...

',
      controller: 'logoutController'
    })
    .state('account.settings', {
      url: '/settings',
      templateUrl: "modules/account/templates/settings.html",
      controller: 'settingsController'
    })
    .state('account.member', {
      url: '/member',
      templateUrl: "modules/account/templates/member.html",
      controller: 'memberController'
    })
    .state('account.role', {
      url: '/role',
      templateUrl: "modules/account/templates/role.html",
      controller: 'roleController'
    });
});


text:
package com.amazonaws.services.redshift.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.redshift.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * DescribeClusterSecurityGroupsRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeClusterSecurityGroupsRequestMarshaller implements
        Marshaller<Request<DescribeClusterSecurityGroupsRequest>, DescribeClusterSecurityGroupsRequest> {

    public Request<DescribeClusterSecurityGroupsRequest> marshall(DescribeClusterSecurityGroupsRequest describeClusterSecurityGroupsRequest) {

        if (describeClusterSecurityGroupsRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<DescribeClusterSecurityGroupsRequest> request = new DefaultRequest<DescribeClusterSecurityGroupsRequest>(describeClusterSecurityGroupsRequest,
                "AmazonRedshift");
        request.addParameter("Action", "DescribeClusterSecurityGroups");
        request.addParameter("Version", "2012-12-01");
        request.setHttpMethod(HttpMethodName.POST);

        if (describeClusterSecurityGroupsRequest.getClusterSecurityGroupName() != null) {
            request.addParameter("ClusterSecurityGroupName", StringUtils.fromString(describeClusterSecurityGroupsRequest.getClusterSecurityGroupName()));
        }

        if (describeClusterSecurityGroupsRequest.getMaxRecords() != null) {
            request.addParameter("MaxRecords", StringUtils.fromInteger(describeClusterSecurityGroupsRequest.getMaxRecords()));
        }

        if (describeClusterSecurityGroupsRequest.getMarker() != null) {
            request.addParameter("Marker", StringUtils.fromString(describeClusterSecurityGroupsRequest.getMarker()));
        }

        if (!describeClusterSecurityGroupsRequest.getTagKeys().isEmpty()
                || !((com.amazonaws.internal.SdkInternalList<String>) describeClusterSecurityGroupsRequest.getTagKeys()).isAutoConstruct()) {
            com.amazonaws.internal.SdkInternalList<String> tagKeysList = (com.amazonaws.internal.SdkInternalList<String>) describeClusterSecurityGroupsRequest
                    .getTagKeys();
            int tagKeysListIndex = 1;

            for (String tagKeysListValue : tagKeysList) {
                if (tagKeysListValue != null) {
                    request.addParameter("TagKeys.TagKey." + tagKeysListIndex, StringUtils.fromString(tagKeysListValue));
                }
                tagKeysListIndex++;
            }
        }

        if (!describeClusterSecurityGroupsRequest.getTagValues().isEmpty()
                || !((com.amazonaws.internal.SdkInternalList<String>) describeClusterSecurityGroupsRequest.getTagValues()).isAutoConstruct()) {
            com.amazonaws.internal.SdkInternalList<String> tagValuesList = (com.amazonaws.internal.SdkInternalList<String>) describeClusterSecurityGroupsRequest
                    .getTagValues();
            int tagValuesListIndex = 1;

            for (String tagValuesListValue : tagValuesList) {
                if (tagValuesListValue != null) {
                    request.addParameter("TagValues.TagValue." + tagValuesListIndex, StringUtils.fromString(tagValuesListValue));
                }
                tagValuesListIndex++;
            }
        }

        return request;
    }

}


text:
var models = require('../models'),
    _ = require('lodash');

var instanceCollection = function(){
    this.instances = [];
};

/*
 Todo: document this.
 */
instanceCollection.prototype.parseResponse = function(data, config){
    var self = this;

    if(!data || _.size(data.droplets) < 1) return {};

    _.each(data.droplets, function(droplet){
        var instance = new models.instance();
        /*Searching networks*/
        var networks = droplet.networks.v4;
        instance.private_ip_address = _.get(_.filter(networks, {type:"private"}), '[0].ip_address') || 'unknown';
        instance.public_ip_address = _.get(_.filter(networks, {type:"public"}), '[0].ip_address') || 'unknown';
        instance.name = droplet.name;
        instance.id = droplet.id;
        instance.imageId = _.get(droplet, 'image.slug') || 'unknown';
        instance.architecture  = _.get(droplet, 'image.name') || 'unknown';
        instance.type = _.get(droplet, 'size_slug') || 'unknown';
        instance.zone = _.get(droplet, 'region.slug') || 'unknown';
        instance.os = _.get(droplet, 'image.distribution') || 'unknown';
        instance.state = droplet.status;
        instance.cloudProvider = {provider: config.provider, keyName: config.keyName};
        self.instances.push(instance);
    });
};

module.exports = instanceCollection;


text:
<?php
/**
 * DO NOT EDIT THIS FILE!
 *
 * This file was automatically generated from external sources.
 *
 * Any manual change here will be lost the next time the SDK
 * is updated. You've been warned!
 */

namespace DTS\eBaySDK\PostOrder\Types;

/**
 *
 * @property \DTS\eBaySDK\PostOrder\Types\RuleActionInputType $actionDetail
 * @property \DTS\eBaySDK\PostOrder\Types\RuleConditionInputType[] $condition
 * @property integer $priority
 */
class RuleDetailInputType extends \DTS\eBaySDK\Types\BaseType
{
    /**
     * @var array Properties belonging to objects of this class.
     */
    private static $propertyTypes = [
        'actionDetail' => [
            'type' => 'DTS\eBaySDK\PostOrder\Types\RuleActionInputType',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'actionDetail'
        ],
        'condition' => [
            'type' => 'DTS\eBaySDK\PostOrder\Types\RuleConditionInputType',
            'repeatable' => true,
            'attribute' => false,
            'elementName' => 'condition'
        ],
        'priority' => [
            'type' => 'integer',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'priority'
        ]
    ];

    /**
     * @param array $values Optional properties and values to assign to the object.
     */
    public function __construct(array $values = [])
    {
        list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

        parent::__construct($parentValues);

        if (!array_key_exists(__CLASS__, self::$properties)) {
            self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
        }

        $this->setValues(__CLASS__, $childValues);
    }
}


text:
/*
 * compute_solution.h
 *
 *  Created on: Oct 21, 2012
 *      Author: petkovve
 */

#ifndef COMPUTE_SOLUTION_H_
#define COMPUTE_SOLUTION_H_

int compute_solution(const int max_iters, int nintci, int nintcf, int nextcf, int** lcc, double* bp,
                     double* bs, double* bw, double* bl, double* bn, double* be, double* bh,
                     double* cnorm, double* var, double *su, double* cgup, double* residual_ratio);

#endif /* COMPUTE_SOLUTION_H_ */


text:
require 'spec_helper'
require 'extlib/object'

module HactiveSupport
  class MemoizeConsideredUseless
  end
end

class SymbolicDuck
  def quack
  end
end

class ClassyDuck
end

module Foo
  class Bar
  end
end

class Oi
  attr_accessor :foo
end

describe Object do

  describe "#full_const_get" do
    it 'returns constant by FQ name in receiver namespace' do
      Object.full_const_get("Oi").should == Oi
      Object.full_const_get("Foo::Bar").should == Foo::Bar
    end
  end

  describe "#full_const_set" do
    it 'sets constant value by FQ name in receiver namespace' do
      Object.full_const_set("HactiveSupport::MCU", HactiveSupport::MemoizeConsideredUseless)

      Object.full_const_get("HactiveSupport::MCU").should == HactiveSupport::MemoizeConsideredUseless
      HactiveSupport.full_const_get("MCU").should == HactiveSupport::MemoizeConsideredUseless
    end
  end

  describe "#make_module" do
    it 'creates a module from string FQ name' do
      Object.make_module("Milano")
      Object.make_module("Norway::Oslo")

      Object.const_defined?("Milano").should == true
      Norway.const_defined?("Oslo").should == true
    end

    it "handles the case where we already have a class in the heirarchy" do
      Object.make_module("Foo::Bar::Baz")
      Object.const_defined?("Foo").should == true
      Foo.const_defined?("Bar").should == true
      Foo::Bar.const_defined?("Baz").should == true
      Foo::Bar::Baz.should be_kind_of(Module)
    end
  end

  describe "#quacks_like?" do
    it 'returns true if duck is a Symbol and receiver responds to it' do
      SymbolicDuck.new.quacks_like?(:quack).should be(true)
    end

    it 'returns false if duck is a Symbol and receiver DOES NOT respond to it' do
      SymbolicDuck.new.quacks_like?(:wtf).should be(false)
    end

    it 'returns true if duck is a class and receiver is its instance' do
      receiver = ClassyDuck.new
      receiver.quacks_like?(ClassyDuck).should be(true)
    end

    it 'returns false if duck is a class and receiver IS NOT its instance' do
      receiver = ClassyDuck.new
      receiver.quacks_like?(SymbolicDuck).should be(false)
    end

    it 'returns true if duck is an array and at least one of its members quacks like this duck' do
      receiver = ClassyDuck.new
      ary      = [ClassyDuck, SymbolicDuck]

      receiver.quacks_like?(ary).should be(true)
    end

    it 'returns false if duck is an array and none of its members quacks like this duck' do
      receiver = ClassyDuck.new
      ary      = [SymbolicDuck.new, SymbolicDuck]

      receiver.quacks_like?(ary).should be(false)
    end
  end

  describe "#in?" do
    it 'returns true if object is included in collection' do
      @ary = [1, 2, 3]
      @set = Set.new([2, 3, 5])

      1.in?(@ary).should be(true)
      2.in?(@ary).should be(true)
      3.in?(@ary).should be(true)
      4.in?(@ary).should be(false)

      1.in?(@set).should be(false)
      2.in?(@set).should be(true)
      3.in?(@set).should be(true)
      4.in?(@set).should be(false)
      5.in?(@set).should be(true)
    end
  end
end


text:
/**
 * Created by dragos on 02/07/2017.
 */

'use strict';

/**
 * Created by dragos on 06/06/2017.
 */

'use strict';

require("babel-polyfill");
const Koa = require('koa');
const logger = require('koa-logger');
const serve = require('koa-static');
const bodyParser = require('koa-bodyparser');
const config = require('./config/default');
const mongoose = require('mongoose');
const cors = require('koa2-cors');

//const errorHandling = require('./src/middlewares/handleErrors');
//load the routes defined in separate file in src folder
const routes = require('./routes');

//const passport = require('./src/auth');

const isInProduction = process.env.NODE_ENV === "production";

const app = new Koa();

if (isInProduction) {
    app.use(serve('/'));
}

//logger
app.use(logger());

//use cors
app.use(cors());

//custom error handling
//app.use(errorHandling());

//body parser
app.use(bodyParser());

//routes, from separate file
app.use(routes.routes());

//initilize passport
//app.use(passport.initialize());

//start the app with mongoose

app.listen(config.port, () => {
    console.info(`Application started on port ${config.port}`);
});
/**
 mongoose.Promise = global.Promise;
 mongoose
 .connect(config.db.url)
 .then(() => {
        app.listen(config.port, () => {
            console.info(`Application started on port ${config.port}`);
        });
    })
 .catch((err) => {
        console.error('Error:', err);
    });
 **/


text:
This is a sample application that demonstrates the use of [ex_abnf](https://github.com/marcelog/ex_abnf) to
implement [ABNF](https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form) grammar parsers in
[Elixir](http://elixir-lang.org). The original article/tutorial for this application is located at [http://marcelog.github.io/articles/abnf_grammars_in_elixir.html](http://marcelog.github.io/articles/abnf_grammars_in_elixir.html).

The [sample grammar](https://github.com/marcelog/ex_abnf_example/blob/master/priv/postal_code.abnf) is
taken from the [ABNF wiki](https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form#Example) and
a [simple test](https://github.com/marcelog/ex_abnf_example/blob/master/test/ex_abnf_example_test.exs) demonstrates how it works.

# LICENSE
The source code is released under Apache 2 License.

Check [LICENSE](https://github.com/marcelog/ex_abnf_example/blob/master/LICENSE) file for more information.


text:
package org.apache.derby.iapi.types;

import org.apache.derby.iapi.services.io.ArrayInputStream;

import org.apache.derby.iapi.error.StandardException;

import org.apache.derby.iapi.types.DataTypeDescriptor;
import org.apache.derby.iapi.types.DataValueDescriptor;
import org.apache.derby.iapi.types.TypeId;
import org.apache.derby.iapi.reference.SQLState;

import org.apache.derby.iapi.types.DataValueDescriptor;

import org.apache.derby.iapi.types.RowLocation;
import org.apache.derby.iapi.types.Orderable;

import org.apache.derby.iapi.services.io.StoredFormatIds;

import org.apache.derby.iapi.services.sanity.SanityManager;

import org.apache.derby.catalog.TypeDescriptor;

import org.apache.derby.iapi.types.DataType;
import org.apache.derby.iapi.types.RefDataValue;
import org.apache.derby.iapi.services.cache.ClassSize;

import java.io.ObjectOutput;
import java.io.ObjectInput;
import java.io.IOException;

import java.sql.ResultSet;
import java.sql.PreparedStatement;

public class SQLRef extends DataType implements RefDataValue
{
	protected RowLocation	value;

    private static final int BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLRef.class);

    public int estimateMemoryUsage()
    {
        int sz = BASE_MEMORY_USAGE;
        if( null != value)
            sz += value.estimateMemoryUsage();
        return sz;
    } // end of estimateMemoryUsage

	/*
	** DataValueDescriptor interface
	** (mostly implemented in DataType)
	*/

	public String getString()
	{
		if (value != null)
		{
			return value.toString();
		}
		else
		{
			return null;
		}
	}

	public Object getObject()
	{
		return value;
	}

	protected void setFrom(DataValueDescriptor theValue) throws StandardException {

		if (theValue.isNull())
			setToNull();
		else
			value = (RowLocation) theValue.getObject();
	}

	public int getLength()
	{
		return TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN;
	}

	/* this is for DataType's error generator */
	public String getTypeName()
	{
		return TypeId.REF_NAME;
	}

	/*
	 * Storable interface, implies Externalizable, TypedFormat
	 */

	/**
		Return my format identifier.

		@see org.apache.derby.iapi.services.io.TypedFormat#getTypeFormatId
	*/
	public int getTypeFormatId() {
		return StoredFormatIds.SQL_REF_ID;
	}

	public boolean isNull()
	{
		return (value == null);
	}

	public void writeExternal(ObjectOutput out) throws IOException {

		if (SanityManager.DEBUG)
			SanityManager.ASSERT(value != null, "writeExternal() is not supposed to be called for null values.");

		out.writeObject(value);
	}

	/**
	 * @see java.io.Externalizable#readExternal
	 *
	 * @exception IOException	Thrown on error reading the object
	 * @exception ClassNotFoundException	Thrown if the class of the object
	 *										read from the stream can't be found
	 *										(not likely, since it's supposed to
	 *										be SQLRef).
	 */
	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
	{
		value = (RowLocation) in.readObject();
	}
	public void readExternalFromArray(ArrayInputStream in) throws IOException, ClassNotFoundException
	{
		value = (RowLocation) in.readObject();
	}

	/**
	 * @see org.apache.derby.iapi.services.io.Storable#restoreToNull
	 */

	public void restoreToNull()
	{
		value = null;
	}

	/*
	** Orderable interface
	*/

	/** @exception StandardException	Thrown on error */
	public boolean compare(int op,
						   DataValueDescriptor other,
						   boolean orderedNulls,
						   boolean unknownRV)
					throws StandardException
	{
		return value.compare(op,
							((SQLRef) other).value,
							orderedNulls,
							unknownRV);
	}

	/** @exception StandardException	Thrown on error */
	public int compare(DataValueDescriptor other) throws StandardException
	{
		return value.compare(((SQLRef) other).value);
	}

	/*
	 * DataValueDescriptor interface
	 */

	/** @see DataValueDescriptor#getClone */
	public DataValueDescriptor getClone()
	{
		/* In order to avoid a throws clause nightmare, we only call
		 * the constructors which do not have a throws clause.
		 *
		 * Clone the underlying RowLocation, if possible, so that we
		 * don't clobber the value in the clone.
		 */
		if (value == null)
			return new SQLRef();
		else
			return new SQLRef((RowLocation) value.cloneObject());
	}

	/**
	 * @see DataValueDescriptor#getNewNull
	 */
	public DataValueDescriptor getNewNull()
	{
		return new SQLRef();
	}

	/**
	 * @see DataValueDescriptor#setValueFromResultSet
	 *
	 */
	public void setValueFromResultSet(ResultSet resultSet, int colNumber,
									  boolean isNullable)
	{
		if (SanityManager.DEBUG)
			SanityManager.THROWASSERT(
				"setValueFromResultSet() is not supposed to be called for SQLRef.");
	}
	public void setInto(PreparedStatement ps, int position)  {
		if (SanityManager.DEBUG)
			SanityManager.THROWASSERT(
				"setValueInto(PreparedStatement) is not supposed to be called for SQLRef.");
	}

	/*
	** Class interface
	*/

	/*
	** Constructors
	*/

	public SQLRef()
	{
	}

	public SQLRef(RowLocation rowLocation)
	{
		value = rowLocation;
	}

	public void setValue(RowLocation rowLocation)
	{
		value = rowLocation;
	}

	/*
	** String display of value
	*/

	public String toString()
	{
		if (value == null)
			return "NULL";
		else
			return value.toString();
	}
}


text:
package cgeo.geocaching.maps.mapsforge.v6;

import cgeo.geocaching.R;
import cgeo.geocaching.settings.Settings;

import android.app.ActionBar;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;

import java.util.Locale;
import java.util.Map;

import org.mapsforge.map.rendertheme.XmlRenderThemeStyleLayer;
import org.mapsforge.map.rendertheme.XmlRenderThemeStyleMenu;

public class RenderThemeSettings extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
    public static final String RENDERTHEME_MENU = "renderthememenu";

    ListPreference baseLayerPreference;
    SharedPreferences prefs;
    XmlRenderThemeStyleMenu renderthemeOptions;
    PreferenceCategory renderthemeMenu;

    @Override
    public boolean onCreateOptionsMenu(final Menu menu) {
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(final MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }
        return false;
    }
    @Override
    public void onSharedPreferenceChanged(final SharedPreferences preferences,
                                          final String key) {
        if (this.renderthemeOptions != null && this.renderthemeOptions.getId().equals(key)) {
            createRenderthemeMenu();
        }
    }

    @SuppressWarnings("deprecation")
    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        setTheme(Settings.isLightSkin() ? R.style.settings_light : R.style.settings);
        super.onCreate(savedInstanceState);

        final ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            // Show the Up button in the action bar.
            actionBar.setDisplayHomeAsUpEnabled(true);
        }

        this.prefs = PreferenceManager.getDefaultSharedPreferences(this);

        addPreferencesFromResource(R.xml.theme_prefs);

        // if the render theme has a style menu, its data is delivered via the intent
        renderthemeOptions = (XmlRenderThemeStyleMenu) getIntent().getSerializableExtra(RENDERTHEME_MENU);
        if (renderthemeOptions != null) {

            // the preference category serves as the hook to add a list preference to allow users to select a style
            this.renderthemeMenu = (PreferenceCategory) findPreference(getString(R.string.pref_theme_menu));

            createRenderthemeMenu();
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        this.prefs.unregisterOnSharedPreferenceChangeListener(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        this.prefs.registerOnSharedPreferenceChangeListener(this);
    }

    @SuppressWarnings("deprecation")
    private void createRenderthemeMenu() {
        this.renderthemeMenu.removeAll();

        this.baseLayerPreference = new ListPreference(this);

        // the id of the setting is the id of the stylemenu, that allows this
        // app to store different settings for different render themes.
        baseLayerPreference.setKey(this.renderthemeOptions.getId());

        baseLayerPreference.setTitle("Map style");

        // this is the user language for the app, in 'en', 'de' etc format
        // no dialects are supported at the moment
        final String language = Locale.getDefault().getLanguage();

        // build data structure for the ListPreference
        final Map<String, XmlRenderThemeStyleLayer> baseLayers = renderthemeOptions.getLayers();

        int visibleStyles = 0;
        for (final XmlRenderThemeStyleLayer baseLayer : baseLayers.values()) {
            if (baseLayer.isVisible()) {
                ++visibleStyles;
            }
        }

        final CharSequence[] entries = new CharSequence[visibleStyles];
        final CharSequence[] values = new CharSequence[visibleStyles];
        int i = 0;
        for (final XmlRenderThemeStyleLayer baseLayer : baseLayers.values()) {
            if (baseLayer.isVisible()) {
                // build up the entries in the list
                entries[i] = baseLayer.getTitle(language);
                values[i] = baseLayer.getId();
                ++i;
            }
        }

        baseLayerPreference.setEntries(entries);
        baseLayerPreference.setEntryValues(values);
        baseLayerPreference.setEnabled(true);
        baseLayerPreference.setPersistent(true);
        baseLayerPreference.setDefaultValue(renderthemeOptions.getDefaultValue());

        renderthemeMenu.addPreference(baseLayerPreference);

        String selection = baseLayerPreference.getValue();
        // need to check that the selection stored is actually a valid getLayer in the current
        // rendertheme.
        if (selection == null || !renderthemeOptions.getLayers().containsKey(selection)) {
            selection = renderthemeOptions.getLayer(renderthemeOptions.getDefaultValue()).getId();
        }
        // the new Android style is to display information here, not instruction
        baseLayerPreference.setSummary(renderthemeOptions.getLayer(selection).getTitle(language));

        for (final XmlRenderThemeStyleLayer overlay : this.renderthemeOptions.getLayer(selection).getOverlays()) {
            final CheckBoxPreference checkbox = new CheckBoxPreference(this);
            checkbox.setKey(overlay.getId());
            checkbox.setPersistent(true);
            checkbox.setTitle(overlay.getTitle(language));
            if (findPreference(overlay.getId()) == null) {
                // value has never been set, so set from default
                checkbox.setChecked(overlay.isEnabled());
            }
            this.renderthemeMenu.addPreference(checkbox);
        }
    }
}


text:
[Data URL](https://nl.wikipedia.org/wiki/Arnhem)

[Meta Data URL]()

####Research goal
We will be researching and visualising sister-cities starting at
Arnhem, NL, and collecting for each of its sister-cities their
respective sister-cities, creating a large index of connecting cities
in the world.

####Contents
A list of cities that through their sister-cities can all be traced back to Arnhem. 14 city connections until you get to Arnhem is the furthest away.

[Arnhem's Sister-Cities and All Theirs](arnhemscrape/arnhem_tree_Wed-Apr-13-2016-221406-GMT0200-CEST.txt)

[All cities found](arnhemscrape/arnhem_tree_Thu-Apr-14-2016-100114-GMT0200-CESTunique.txt)

A recursive node.js code that scrapes cities and their respective sister-cities, continuing until it can only find cities it has already found. Starting at Arnhem.

[Scraping File](arnhemscrape/arnhemscrape.js)

[json File](arnhemscrape/arnhemtree_Wed-Apr-20-2016-193817-GMT0200-CEST.json)

[json File with coordinates](arnhemtree_Wed-Jun-08-2016-231820-GMT0200-CEST)

####Structure
Cities (text) and geographical data.
####Tools:
**Node.js**

modules installed: request, cheerio, geocoder, fs

####How to install tools
[Install Node](https://nodejs.org/en/)

####Contributors
Luc, Noa, Heike

####Source data

[Arnhem's Sister-Cities and All Theirs](arnhemscrape/arnhem_tree_Wed-Apr-13-2016-221406-GMT0200-CEST.txt)

[All cities found](arnhemscrape/arnhem_tree_Thu-Apr-14-2016-100114-GMT0200-CESTunique.txt)

[Scraping File](arnhemscrape/arnhemscrape1.js)


text:
@class iCocosSettingItem;
@interface iCocosSettingCell : UITableViewCell
@property (nonatomic, strong) iCocosSettingItem *item;

+ (id)settingCellWithTableView:(UITableView *)tableView;
@end


text:
namespace rc {
namespace seq {
namespace detail {

template <typename T>
class DropSeq {
public:
  DropSeq(std::size_t n, Seq<T> seq)
      : m_drop(n)
      , m_seq(std::move(seq)) {}

  Maybe<T> operator()() {
    while (m_drop > 0) {
      if (!m_seq.next()) {
        m_seq = Seq<T>();
        m_drop = 0;
        return Nothing;
      }
      m_drop--;
    }

    return m_seq.next();
  }

private:
  std::size_t m_drop;
  Seq<T> m_seq;
};

template <typename T>
class TakeSeq {
public:
  TakeSeq(std::size_t n, Seq<T> seq)
      : m_take(n)
      , m_seq(std::move(seq)) {}

  Maybe<T> operator()() {
    if (m_take == 0) {
      return Nothing;
    }

    m_take--;
    return m_seq.next();
  }

private:
  std::size_t m_take;
  Seq<T> m_seq;
};

template <typename Predicate, typename T>
class DropWhileSeq {
public:
  template <typename PredArg>
  DropWhileSeq(Seq<T> seq, PredArg &&pred)
      : m_pred(std::forward<PredArg>(pred))
      , m_dropped(false)
      , m_seq(std::move(seq)) {}

  Maybe<T> operator()() {
    while (!m_dropped) {
      auto value = m_seq.next();

      if (!value) {
        m_dropped = true;
        m_seq = Seq<T>();
        return Nothing;
      }

      if (!m_pred(*value)) {
        m_dropped = true;
        return value;
      }
    }

    return m_seq.next();
  }

private:
  Predicate m_pred;
  bool m_dropped;
  Seq<T> m_seq;
};

template <typename Predicate, typename T>
class TakeWhileSeq {
public:
  template <typename PredArg>
  TakeWhileSeq(Seq<T> seq, PredArg &&pred)
      : m_pred(std::forward<PredArg>(pred))
      , m_seq(std::move(seq)) {}

  Maybe<T> operator()() {
    auto value = m_seq.next();
    if (!value) {
      return Nothing;
    }

    if (!m_pred(*value)) {
      m_seq = Seq<T>();
      return Nothing;
    }

    return value;
  }

private:
  Predicate m_pred;
  Seq<T> m_seq;
};

template <typename Mapper, typename T>
class MapSeq {
public:
  using U = Decay<typename rc::compat::return_type<Mapper,T>::type>;

  template <typename MapperArg>
  MapSeq(Seq<T> seq, MapperArg &&mapper)
      : m_mapper(std::forward<MapperArg>(mapper))
      , m_seq(std::move(seq)) {}

  Maybe<U> operator()() {
    auto value = m_seq.next();
    if (!value) {
      m_seq = Seq<T>();
      return Nothing;
    }

    return m_mapper(std::move(*value));
  }

private:
  Mapper m_mapper;
  Seq<T> m_seq;
};

template <typename Zipper, typename... Ts>
class ZipWithSeq {
public:
  using U = Decay<typename rc::compat::return_type<Zipper,Ts...>::type>;

  template <typename ZipperArg>
  ZipWithSeq(ZipperArg &&zipper, Seq<Ts>... seqs)
      : m_zipper(std::forward<ZipperArg>(zipper))
      , m_seqs(std::move(seqs)...) {}

  Maybe<U> operator()() {
    return rc::detail::applyTuple(
        m_seqs,
        [this](Seq<Ts> &... seqs) { return mapMaybes(seqs.next()...); });
  }

private:
  Maybe<U> mapMaybes(Maybe<Ts> &&... maybes) {
    if (!allTrue(maybes...)) {
      m_seqs = std::tuple<Seq<Ts>...>();
      return Nothing;
    }

    return m_zipper(std::move(*maybes)...);
  }

  static bool allTrue() { return true; }

  template <typename MaybeT, typename... MaybeTs>
  static bool allTrue(const MaybeT &arg, const MaybeTs &... args) {
    return arg && allTrue(args...);
  }

  Zipper m_zipper;
  std::tuple<Seq<Ts>...> m_seqs;
};

template <typename Predicate, typename T>
class FilterSeq {
public:
  template <typename PredArg>
  FilterSeq(Seq<T> seq, PredArg predicate)
      : m_predicate(std::forward<PredArg>(predicate))
      , m_seq(std::move(seq)) {}

  Maybe<T> operator()() {
    while (true) {
      auto value = m_seq.next();

      if (!value) {
        m_seq = Seq<T>();
        return Nothing;
      }

      if (m_predicate(*value)) {
        return value;
      }
    }
  }

private:
  Predicate m_predicate;
  Seq<T> m_seq;
};

template <typename T>
class JoinSeq {
public:
  JoinSeq(Seq<Seq<T>> seqs)
      : m_seqs(std::move(seqs)) {}

  Maybe<T> operator()() {
    while (true) {
      auto value = m_seq.next();
      if (value) {
        return value;
      }

      // Otherwise, next Seq
      auto seq = m_seqs.next();
      if (!seq) {
        m_seq = Seq<T>();
        m_seqs = Seq<Seq<T>>();
        return Nothing;
      }

      m_seq = std::move(*seq);
    }
  }

private:
  Seq<T> m_seq;
  Seq<Seq<T>> m_seqs;
};

template <typename T, std::size_t N>
class ConcatSeq {
public:
  template <typename... Ts>
  ConcatSeq(Seq<Ts>... seqs)
      : m_seqs{std::move(seqs)...}
      , m_i(0) {}

  Maybe<T> operator()() {
    while (m_i < N) {
      auto value = m_seqs[m_i].next();
      if (value) {
        return value;
      }

      m_i++;
    }

    return Nothing;
  }

private:
  Seq<T> m_seqs[N];
  std::size_t m_i;
};

template <typename Mapper, typename T>
class MapcatSeq {
public:
  using U = typename rc::compat::return_type<Mapper,T>::type::ValueType;

  template <typename MapperArg>
  MapcatSeq(Seq<T> seq, MapperArg &&mapper)
      : m_mapper(std::forward<MapperArg>(mapper))
      , m_seqT(std::move(seq)) {}

  Maybe<U> operator()() {
    while (true) {
      auto valueU = m_seqU.next();
      if (valueU) {
        return valueU;
      }

      auto valueT = m_seqT.next();
      if (!valueT) {
        m_seqT = Seq<T>();
        m_seqU = Seq<U>();
        return Nothing;
      }

      m_seqU = m_mapper(std::move(*valueT));
    }
  }

private:
  Mapper m_mapper;
  Seq<T> m_seqT;
  Seq<U> m_seqU;
};

} // namespace detail

template <typename T>
Seq<T> drop(std::size_t n, Seq<T> seq) {
  if (n == 0) {
    return seq;
  }
  return makeSeq<detail::DropSeq<T>>(n, std::move(seq));
}

template <typename T>
Seq<T> take(std::size_t n, Seq<T> seq) {
  if (n == 0) {
    return Seq<T>();
  }
  return makeSeq<detail::TakeSeq<T>>(n, std::move(seq));
}

template <typename T, typename Predicate>
Seq<T> dropWhile(Seq<T> seq, Predicate &&pred) {
  return makeSeq<detail::DropWhileSeq<Decay<Predicate>, T>>(
      std::move(seq), std::forward<Predicate>(pred));
}

template <typename T, typename Predicate>
Seq<T> takeWhile(Seq<T> seq, Predicate &&pred) {
  return makeSeq<detail::TakeWhileSeq<Decay<Predicate>, T>>(
      std::move(seq), std::forward<Predicate>(pred));
}

template <typename T, typename Mapper>
Seq<Decay<typename rc::compat::return_type<Mapper,T>::type>> map(Seq<T> seq,
                                                         Mapper &&mapper) {
  return makeSeq<detail::MapSeq<Decay<Mapper>, T>>(
      std::move(seq), std::forward<Mapper>(mapper));
}

template <typename... Ts, typename Zipper>
Seq<Decay<typename rc::compat::return_type<Zipper,Ts...>::type>>
zipWith(Zipper &&zipper, Seq<Ts>... seqs) {
  return makeSeq<detail::ZipWithSeq<Decay<Zipper>, Ts...>>(
      std::forward<Zipper>(zipper), std::move(seqs)...);
}

template <typename T, typename Predicate>
Seq<T> filter(Seq<T> seq, Predicate &&pred) {
  return makeSeq<detail::FilterSeq<Decay<Predicate>, T>>(
      std::move(seq), std::forward<Predicate>(pred));
}

template <typename T>
Seq<T> join(Seq<Seq<T>> seqs) {
  return makeSeq<detail::JoinSeq<T>>(std::move(seqs));
}

template <typename T, typename... Ts>
Seq<T> concat(Seq<T> seq, Seq<Ts>... seqs) {
  return makeSeq<detail::ConcatSeq<T, sizeof...(Ts) + 1>>(std::move(seq),
                                                          std::move(seqs)...);
}

template <typename T, typename Mapper>
Seq<typename rc::compat::return_type<Mapper,T>::type::ValueType>
mapcat(Seq<T> seq, Mapper &&mapper) {
  return makeSeq<detail::MapcatSeq<Decay<Mapper>, T>>(
      std::move(seq), std::forward<Mapper>(mapper));
}

template <typename T, typename Mapper>
Seq<typename rc::compat::return_type<Mapper,T>::type::ValueType>
mapMaybe(Seq<T> seq, Mapper &&mapper) {
  using U = typename rc::compat::return_type<Mapper,T>::type::ValueType;
  return seq::map(
      seq::filter(seq::map(std::move(seq), std::forward<Mapper>(mapper)),
                  [](const Maybe<U> &x) { return !!x; }),
      [](Maybe<U> &&x) { return std::move(*x); });
}

template <typename T>
Seq<T> cycle(Seq<T> seq) {
  return seq::join(seq::repeat(std::move(seq)));
}

template <typename T, typename U>
Seq<T> cast(Seq<U> seq) {
  return seq::map(std::move(seq),
                  [](U &&x) { return static_cast<T>(std::move(x)); });
}

} // namespace seq
} // namespace rc


text:
#ifndef FS_INFO_SECTOR_H_
#define FS_INFO_SECTOR_H_

#pragma pack(push, 1)
struct fs_info_sector
{
    unsigned char signature[4];
    unsigned char reserved[480];
    unsigned char signature2[4];
    unsigned int num_free_clusters;
    unsigned int most_recent_cluster_alloc;
    unsigned char reserved2[12];

    unsigned char end_signature[4];
};
#pragma pack(pop)

#endif


text:
//
//  SDTextFooterButtonView.h
//  SDKit
//
//  Created by Stephen Derico on 1/7/12.
//  Copyright (c) 2012 Bixby Apps. All rights reserved.
//

#import <UIKit/UIKit.h>
/**
 Options for the background color of the footer button.
 */
typedef enum {
    /** Green background color with white text*/
    SDFooterButtonStyleGreen,
    /** Gray background color with black text*/
    SDFooterButtonStyleGray,
    /** Red background color with white text*/
    SDFooterButtonStyleRed,
} SDFooterButtonStyle;

/**
 SDFooterButtonView

 Provides a UIButton inside a UIView, accessable through the `button` property.

 This is best used in the tandem with the tableView:viewForFooterInSection UITableViewDelegate method.

 - (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section

 Button Title Text also includes a inverse shadow color.
 */

@interface SDTextFooterButtonView : UIView
///--------------------------------
/// @name Accessing the Footer Button
///--------------------------------

/**
 The footer button.
 */
@property (nonatomic, retain) UIButton *button;
@property (nonatomic, strong) UITextView *textView;

///---------------
/// @name Initialize With Style
///---------------

/**
 Initialize instance with specific SDFooterButtonStyle

 @return an instance of SDFooterButton
 */

- (id)initWithStyle:(SDFooterButtonStyle)style;
@end


text:
<?php

namespace ickx\fw2\mvc\app\traits;

/**
 * AppRouterTrait
 *
 * @category	Flywheel2
 * @package		mvc
 * @author		wakaba <wakabadou@gmail.com>
 * @license		http://opensource.org/licenses/MIT The MIT License MIT
 * @varsion		2.0.0
 */
trait AppRouterTrait {
	public static function MakeUrl ($controller_name, $action_name = 'index', $parameters = [], $var_parameters = [], $encoding = null) {
		return \ickx\fw2\router\Router::GetUrl((is_string($controller_name) ? $controller_name : $controller_name->controller), $action_name, $parameters, $var_parameters, $encoding);
	}
}


text:
package com.opengamma.analytics.financial.provider.calculator.normalstirfutures;

import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter;
import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginTransaction;
import com.opengamma.analytics.financial.interestrate.future.provider.InterestRateFutureOptionMarginTransactionNormalSmileMethod;
import com.opengamma.analytics.financial.provider.description.interestrate.NormalSTIRFuturesProviderInterface;

/**
 * Calculates the present value vega (first derivative of the present value with respect to the normal volatility) for interest rate
 * future options.
 */
public final class PositionVegaNormalSTIRFutureOptionCalculator extends
    InstrumentDerivativeVisitorAdapter<NormalSTIRFuturesProviderInterface, Double> {
  /**
   * The unique instance of the calculator.
   */
  private static final PositionVegaNormalSTIRFutureOptionCalculator INSTANCE = new PositionVegaNormalSTIRFutureOptionCalculator();

  /**
   * Gets the calculator instance.
   * @return The calculator.
   */
  public static PositionVegaNormalSTIRFutureOptionCalculator getInstance() {
    return INSTANCE;
  }

  /**
   * Constructor.
   */
  private PositionVegaNormalSTIRFutureOptionCalculator() {
  }

  /**
   * Pricing methods.
   */
  private static final InterestRateFutureOptionMarginTransactionNormalSmileMethod METHOD_STIR = InterestRateFutureOptionMarginTransactionNormalSmileMethod
      .getInstance();

  @Override
  public Double visitInterestRateFutureOptionMarginTransaction(InterestRateFutureOptionMarginTransaction futures,
      NormalSTIRFuturesProviderInterface normal) {
    return METHOD_STIR.presentValueVega(futures, normal);
  }
}


text:
DELIMITER //
DROP FUNCTION IF EXISTS `university`.`dept_count`;
CREATE FUNCTION dept_count (dept_name VARCHAR(20)) RETURNS INTEGER
BEGIN
DECLARE cnt INTEGER DEFAULT 0;
SELECT COUNT(*)
INTO cnt
FROM instructor
WHERE instructor.dept_name = dept_name ;
RETURN cnt;
END
//
DELIMITER ;