text:
package com.haringeymobile.ukweather.database;

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.provider.BaseColumns;

import com.haringeymobile.ukweather.data.InitialCity;
import com.haringeymobile.ukweather.utils.MiscMethods;

/**
 * The database table to hold city current weather and weather forecast records.
 */
public final class CityTable implements BaseColumns {

    public static final long CITY_NEVER_QUERIED = -1;
    public static final int CITY_ID_DOES_NOT_EXIST = -1;

    public static final String TABLE_CITIES = "Cities";
    public static final String COLUMN_CITY_ID = "Id";
    public static final String COLUMN_NAME = "Name";

    public static final String COLUMN_LAST_QUERY_TIME_FOR_CURRENT_WEATHER = "TimeCurrent";
    public static final String COLUMN_CACHED_JSON_CURRENT = "JsonCurrent";
    public static final String COLUMN_LAST_QUERY_TIME_FOR_DAILY_WEATHER_FORECAST =
            "TimeDailyForecast";
    public static final String COLUMN_CACHED_JSON_DAILY_FORECAST = "JsonDailyForecast";
    public static final String COLUMN_LAST_QUERY_TIME_FOR_THREE_HOURLY_WEATHER_FORECAST =
            "TimeThreeHourlyForecast";
    public static final String COLUMN_CACHED_JSON_THREE_HOURLY_FORECAST = "JsonThreeHourlyForecast";
    public static final String COLUMN_ORDERING_VALUE = "LastQueryTime";

    private static final String TABLE_TEMP = "tempTable";
    private static final String COLUMN_LAST_QUERY_TIME_FOR_CURRENT_WEATHER_VERSION_1 = "Date";
    private static final String COLUMN_CACHED_JSON_CURRENT_VERSION_1 = "Current";
    // Not used in version 1:
    // private static final String COLUMN_LAST_QUERY_TIME_FOR_WEATHER_FORECAST_VERSION_1 =
    // "DateForecast";
    // private static final String COLUMN_CACHED_JSON_FORECAST_VERSION_1 = "Forecast";

    private static final String TABLE_CREATE = "CREATE TABLE "
            + TABLE_CITIES
            + "("
            + _ID + " integer primary key autoincrement, "
            + COLUMN_CITY_ID + " integer, "
            + COLUMN_NAME + " text not null, "
            + COLUMN_LAST_QUERY_TIME_FOR_CURRENT_WEATHER + " integer, "
            + COLUMN_CACHED_JSON_CURRENT + " text, "
            + COLUMN_LAST_QUERY_TIME_FOR_DAILY_WEATHER_FORECAST + " integer, "
            + COLUMN_CACHED_JSON_DAILY_FORECAST + " text, "
            + COLUMN_LAST_QUERY_TIME_FOR_THREE_HOURLY_WEATHER_FORECAST + " integer, "
            + COLUMN_CACHED_JSON_THREE_HOURLY_FORECAST + " text, "
            + COLUMN_ORDERING_VALUE + " integer"
            + ");";

    public static void onCreate(SQLiteDatabase database) {
        database.execSQL(TABLE_CREATE);
        insertInitialData(database);
    }

    /**
     * Inserts initial cities with their default values into the database.
     *
     * @see com.haringeymobile.ukweather.data.InitialCity
     */
    private static void insertInitialData(SQLiteDatabase database) {
        for (InitialCity city : InitialCity.values()) {
            ContentValues newValues = new ContentValues();
            newValues.put(COLUMN_CITY_ID, city.getOpenWeatherMapId());
            newValues.put(COLUMN_NAME, city.getDisplayName());
            newValues.put(COLUMN_LAST_QUERY_TIME_FOR_CURRENT_WEATHER,
                    CITY_NEVER_QUERIED);
            newValues.putNull(COLUMN_CACHED_JSON_CURRENT);
            putInitialDataForVersion2(newValues);
            database.insert(TABLE_CITIES, null, newValues);
        }
    }

    /**
     * Puts default values for the new columns in databse version 2 into the
     * provided {@link android.content.ContentValues}.
     *
     * @param newValues values for the new record to be inserted into the database
     */
    private static void putInitialDataForVersion2(ContentValues newValues) {
        newValues.put(COLUMN_LAST_QUERY_TIME_FOR_DAILY_WEATHER_FORECAST,
                CITY_NEVER_QUERIED);
        newValues.putNull(COLUMN_CACHED_JSON_DAILY_FORECAST);
        newValues.put(COLUMN_LAST_QUERY_TIME_FOR_THREE_HOURLY_WEATHER_FORECAST,
                CITY_NEVER_QUERIED);
        newValues.putNull(COLUMN_CACHED_JSON_THREE_HOURLY_FORECAST);
        newValues.put(COLUMN_ORDERING_VALUE, CITY_NEVER_QUERIED);
    }

    public static void onUpgrade(SQLiteDatabase database, int oldVersion,
                                 int newVersion) {
        MiscMethods.log("Upgrading database from version " + oldVersion
                + " to version " + newVersion);
        if (oldVersion == 1 && newVersion > 1) {
            alterDatabaseVersion_1(database);
        } else {
            database.execSQL("DROP TABLE IF EXISTS " + TABLE_CITIES);
            onCreate(database);
        }
    }

    /**
     * Performs transactions required to upgrade the database from version 1.
     */
    private static void alterDatabaseVersion_1(SQLiteDatabase database) {
        database.beginTransaction();
        try {
            alterCityTable(database);
            database.setTransactionSuccessful();
        } catch (Exception e) {
            throw new RuntimeException(
                    "Error upgrading database from version 1");
        } finally {
            database.endTransaction();
        }
    }

    /**
     * Prepares the "Cities" table for alteration, and inserts the new columns;
     * this is required to upgrade the database from version 1.
     */
    private static void alterCityTable(SQLiteDatabase database) {
        String RENAME_ORIGINAL_TABLE = "ALTER TABLE " + TABLE_CITIES
                + " RENAME TO " + TABLE_TEMP;
        String COPY_OLD_TABLE_TO_NEW_TABLE = "INSERT INTO " + TABLE_CITIES
                + "(" + COLUMN_CITY_ID + ", " + COLUMN_NAME + ", "
                + COLUMN_LAST_QUERY_TIME_FOR_CURRENT_WEATHER + ", "
                + COLUMN_CACHED_JSON_CURRENT + ") SELECT " + COLUMN_CITY_ID
                + ", " + COLUMN_NAME + ", "
                + COLUMN_LAST_QUERY_TIME_FOR_CURRENT_WEATHER_VERSION_1 + ", "
                + COLUMN_CACHED_JSON_CURRENT_VERSION_1 + " FROM " + TABLE_TEMP
                + ";";

        database.execSQL(RENAME_ORIGINAL_TABLE);
        database.execSQL(TABLE_CREATE);
        database.execSQL(COPY_OLD_TABLE_TO_NEW_TABLE);
        database.execSQL("DROP TABLE " + TABLE_TEMP);

        insertInitialWeatherForecastValues(database);
    }

    /**
     * Inserts new columns into the "Cities" table.
     */
    private static void insertInitialWeatherForecastValues(
            SQLiteDatabase database) {
        ContentValues initialForecastValues = new ContentValues();
        putInitialDataForVersion2(initialForecastValues);
        database.insert(TABLE_CITIES, null, initialForecastValues);
    }
}


text:
from flask import Flask
from flask_cors import CORS, cross_origin

app = Flask(__name__)
CORS(app)

# Import the Blueprint object as blueprint
from servmon.api import api_blueprint as api_blueprint
# Import the actual APIs, has to be imported BEFORE blueprint registration
from servmon.api import *

# Register the blueprint, APIs accessable at /api/*
app.register_blueprint(api_blueprint, url_prefix='/api')

redpajama_set_name: RedPajamaGithub


text:
package au.com.noojee.acceloapi.filter;

class Or extends Expression
{

	private Expression parent;
	private Expression child;

	public Or(Expression parent, Expression child)
	{
		super();
		this.parent = parent;
		this.child = child;
	}

	@Override
	public Expression copy()
	{
		Or exp = new Or(this.parent, this.child);

		return exp;
	}

	@Override
	public String toJson()
	{
		String expression = "\"_OR\": {\n" + parent.toJson() + "," + child.toJson() + "\n}";

		return expression;

	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((child == null) ? 0 : child.hashCode());
		result = prime * result + ((parent == null) ? 0 : parent.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Or other = (Or) obj;
		if (child == null)
		{
			if (other.child != null)
				return false;
		}
		else if (!child.equals(other.child))
			return false;
		if (parent == null)
		{
			if (other.parent != null)
				return false;
		}
		else if (!parent.equals(other.parent))
			return false;
		return true;
	}

}


text:
from __future__ import print_function
from collections import OrderedDict
import re

regexes = {
    'nf-core/smrnaseq': ['v_nfcore_smrnaseq.txt', r"(\S+)"],
    'Nextflow': ['v_nextflow.txt', r"(\S+)"],
    'FastQC': ['v_fastqc.txt', r"FastQC v(\S+)"],
    'Trim Galore!': ['v_trim_galore.txt', r"version (\S+)"],
    'Bowtie': ['v_bowtie.txt', r"version (\S+)"],
    'Samtools': ['v_samtools.txt', r"samtools (\S+)"],
    'FASTX': ['v_fastx.txt', r"Toolkit (\S+)"],
    'miRTrace': ['v_mirtrace.txt', r"mirtrace, version (\S+)"],
    'MultiQC': ['v_multiqc.txt', r"multiqc, version (\S+)"],
}
results = OrderedDict()
results['nf-core/smrnaseq'] = 'N/A'
results['Nextflow'] = 'N/A'
results['FastQC'] = 'N/A'
results['Trim Galore!'] = 'N/A'
results['Bowtie'] = 'N/A'
results['Samtools'] = 'N/A'
results['FASTX'] = 'N/A'
results['miRTrace'] = 'N/A'
results['MultiQC'] = 'N/A'

# Search each file using its regex
for k, v in regexes.items():
    with open(v[0]) as x:
        versions = x.read()
        match = re.search(v[1], versions)
        if match:
            results[k] = "v{}".format(match.group(1))

# Dump to YAML
print ('''
id: 'software_versions'
section_name: 'nf-core/smrnaseq Software Versions'
section_href: 'https://github.com/nf-core/smrnaseq'
plot_type: 'html'
description: 'are collected at run time from the software output.'
data: |

''')
for k,v in results.items():
    print("
{}

{}
".format(k,v))
print ("
")


text:
package storage

import (
	"testing"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/fields"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/util/intstr"
	genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
	"k8s.io/apiserver/pkg/registry/generic"
	"k8s.io/apiserver/pkg/registry/rest"
	etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing"
	"k8s.io/kubernetes/pkg/apis/policy"
	"k8s.io/kubernetes/pkg/registry/registrytest"
)

func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
	etcdStorage, server := registrytest.NewEtcdStorage(t, policy.GroupName)
	restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, ResourcePrefix: "poddisruptionbudgets"}
	podDisruptionBudgetStorage, statusStorage := NewREST(restOptions)
	return podDisruptionBudgetStorage, statusStorage, server
}

// createPodDisruptionBudget is a helper function that returns a PodDisruptionBudget with the updated resource version.
func createPodDisruptionBudget(storage *REST, pdb policy.PodDisruptionBudget, t *testing.T) (policy.PodDisruptionBudget, error) {
	ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), pdb.Namespace)
	obj, err := storage.Create(ctx, &pdb, rest.ValidateAllObjectFunc, false)
	if err != nil {
		t.Errorf("Failed to create PodDisruptionBudget, %v", err)
	}
	newPS := obj.(*policy.PodDisruptionBudget)
	return *newPS, nil
}

func validNewPodDisruptionBudget() *policy.PodDisruptionBudget {
	minAvailable := intstr.FromInt(7)
	return &policy.PodDisruptionBudget{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "foo",
			Namespace: metav1.NamespaceDefault,
			Labels:    map[string]string{"a": "b"},
		},
		Spec: policy.PodDisruptionBudgetSpec{
			Selector:     &metav1.LabelSelector{MatchLabels: map[string]string{"a": "b"}},
			MinAvailable: &minAvailable,
		},
		Status: policy.PodDisruptionBudgetStatus{},
	}
}

func TestCreate(t *testing.T) {
	storage, _, server := newStorage(t)
	defer server.Terminate(t)
	defer storage.Store.DestroyFunc()
	test := registrytest.New(t, storage.Store)
	pdb := validNewPodDisruptionBudget()
	pdb.ObjectMeta = metav1.ObjectMeta{}
	test.TestCreate(
		// valid
		pdb,
		// TODO: Add an invalid case when we have validation.
	)
}

// TODO: Test updates to spec when we allow them.

func TestStatusUpdate(t *testing.T) {
	storage, statusStorage, server := newStorage(t)
	defer server.Terminate(t)
	defer storage.Store.DestroyFunc()
	ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault)
	key := "/poddisruptionbudgets/" + metav1.NamespaceDefault + "/foo"
	validPodDisruptionBudget := validNewPodDisruptionBudget()
	if err := storage.Storage.Create(ctx, key, validPodDisruptionBudget, nil, 0); err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	obj, err := storage.Get(ctx, "foo", &metav1.GetOptions{})
	if err != nil {
		t.Fatalf("failed to get pdb: %v", err)
	}
	obtainedPdb := obj.(*policy.PodDisruptionBudget)

	minAvailable := intstr.FromInt(8)
	update := policy.PodDisruptionBudget{
		ObjectMeta: obtainedPdb.ObjectMeta,
		Spec: policy.PodDisruptionBudgetSpec{
			MinAvailable: &minAvailable,
		},
		Status: policy.PodDisruptionBudgetStatus{
			ExpectedPods: 8,
		},
	}

	if _, _, err := statusStorage.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc); err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	obj, err = storage.Get(ctx, "foo", &metav1.GetOptions{})
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	pdb := obj.(*policy.PodDisruptionBudget)
	if pdb.Spec.MinAvailable.IntValue() != 7 {
		t.Errorf("we expected .spec.replicas to not be updated but it was updated to %v", pdb.Spec.MinAvailable)
	}
	if pdb.Status.ExpectedPods != 8 {
		t.Errorf("we expected .status.replicas to be updated to %d but it was %v", 7, pdb.Status.ExpectedPods)
	}
}

func TestGet(t *testing.T) {
	storage, _, server := newStorage(t)
	defer server.Terminate(t)
	defer storage.Store.DestroyFunc()
	test := registrytest.New(t, storage.Store)
	test.TestGet(validNewPodDisruptionBudget())
}

func TestList(t *testing.T) {
	storage, _, server := newStorage(t)
	defer server.Terminate(t)
	defer storage.Store.DestroyFunc()
	test := registrytest.New(t, storage.Store)
	test.TestList(validNewPodDisruptionBudget())
}

func TestDelete(t *testing.T) {
	storage, _, server := newStorage(t)
	defer server.Terminate(t)
	defer storage.Store.DestroyFunc()
	test := registrytest.New(t, storage.Store)
	test.TestDelete(validNewPodDisruptionBudget())
}

func TestWatch(t *testing.T) {
	storage, _, server := newStorage(t)
	defer server.Terminate(t)
	defer storage.Store.DestroyFunc()
	test := registrytest.New(t, storage.Store)
	test.TestWatch(
		validNewPodDisruptionBudget(),
		// matching labels
		[]labels.Set{
			{"a": "b"},
		},
		// not matching labels
		[]labels.Set{
			{"a": "c"},
			{"foo": "bar"},
		},

		// matching fields
		[]fields.Set{
			{"metadata.name": "foo"},
		},
		// not matching fields
		[]fields.Set{
			{"metadata.name": "bar"},
		},
	)
}

// TODO: Test generation number.


text: sudo java -Xmx128m -cp `sh getclasspath.sh`:classes $@


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/JSBridgeTest.iml" filepath="$PROJECT_DIR$/JSBridgeTest.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/jsbridge/jsbridge.iml" filepath="$PROJECT_DIR$/jsbridge/jsbridge.iml" />
    </modules>
  </component>
</project>


text:
var React = require('react');
var Bootstrap = require('react-bootstrap');
var ListGroup = Bootstrap.ListGroup;
var TalkingPointListItem = require('./TalkingPointListItem.js');
var TalkingPointList = React.createClass({
  render: function() {
    var makeTalkingPoint = function(id, i) {
      return <TalkingPointListItem key={id} id={id}/>;
    };
    return (
      <ListGroup>
	{this.props.talkingPoints.map(makeTalkingPoint)}
      </ListGroup>
    );
  }
});
module.exports = TalkingPointList;


text:
import numpy as np
import batoid
from test_helpers import timer, do_pickle, all_obj_diff

@timer
def test_params():
    rng = np.random.default_rng(5)
    for _ in range(30):
        origin = rng.uniform(size=3)
        rot = (
            batoid.RotX(rng.uniform())
            @batoid.RotY(rng.uniform())
            @batoid.RotZ(rng.uniform())
        )
        coordSys = batoid.CoordSys(origin, rot)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

        coordSys = batoid.CoordSys(origin=origin)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, np.eye(3))
        np.testing.assert_equal(coordSys.xhat, [1,0,0])
        np.testing.assert_equal(coordSys.yhat, [0,1,0])
        np.testing.assert_equal(coordSys.zhat, [0,0,1])

        coordSys = batoid.CoordSys(rot=rot)
        np.testing.assert_equal(coordSys.origin, np.zeros(3))
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

        coordSys = batoid.CoordSys()
        np.testing.assert_equal(coordSys.origin, np.zeros(3))
        np.testing.assert_equal(coordSys.rot, np.eye(3))
        np.testing.assert_equal(coordSys.xhat, [1,0,0])
        np.testing.assert_equal(coordSys.yhat, [0,1,0])
        np.testing.assert_equal(coordSys.zhat, [0,0,1])

        coordSys = batoid.CoordSys()
        coordSys = coordSys.rotateGlobal(rot).shiftGlobal(origin)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

        coordSys = batoid.CoordSys()
        coordSys = coordSys.rotateLocal(rot).shiftGlobal(origin)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

        coordSys = batoid.CoordSys()
        coordSys = coordSys.shiftLocal(origin).rotateLocal(rot)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

        coordSys = batoid.CoordSys()
        coordSys = coordSys.shiftGlobal(origin).rotateLocal(rot)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

        # Can't simply do a global rotation after a shift, since that will
        # change the origin too.  Works if we manually specify the rotation
        # center though
        coordSys = batoid.CoordSys()
        coordSys1 = coordSys.shiftGlobal(origin)
        coordSys = coordSys1.rotateGlobal(rot, origin, coordSys)
        np.testing.assert_equal(coordSys.origin, origin)
        np.testing.assert_equal(coordSys.rot, rot)
        np.testing.assert_equal(coordSys.xhat, rot[:,0])
        np.testing.assert_equal(coordSys.yhat, rot[:,1])
        np.testing.assert_equal(coordSys.zhat, rot[:,2])

@timer
def test_shift():
    rng = np.random.default_rng(57)
    globalCoordSys = batoid.CoordSys()
    for i in range(30):
        x, y, z = rng.normal(0.1, 2.3, size=3)
        newCoordSys = globalCoordSys.shiftGlobal([x, y, z])
        do_pickle(newCoordSys)
        np.testing.assert_array_equal(newCoordSys.xhat, [1,0,0])
        np.testing.assert_array_equal(newCoordSys.yhat, [0,1,0])
        np.testing.assert_array_equal(newCoordSys.zhat, [0,0,1])
        np.testing.assert_array_equal(newCoordSys.origin, [x,y,z])
        np.testing.assert_array_equal(newCoordSys.rot, np.eye(3))

        for j in range(30):
            x2, y2, z2 = rng.normal(0.1, 2.3, size=3)
            newNewCoordSys = newCoordSys.shiftGlobal([x2, y2, z2])
            np.testing.assert_array_equal(newNewCoordSys.xhat, [1,0,0])
            np.testing.assert_array_equal(newNewCoordSys.yhat, [0,1,0])
            np.testing.assert_array_equal(newNewCoordSys.zhat, [0,0,1])
            np.testing.assert_array_equal(
                newNewCoordSys.origin,
                [x+x2, y+y2, z+z2]
            )
            np.testing.assert_array_equal(newNewCoordSys.rot, np.eye(3))

            newNewCoordSys = newCoordSys.shiftLocal([x2, y2, z2])
            np.testing.assert_array_equal(newNewCoordSys.xhat, [1,0,0])
            np.testing.assert_array_equal(newNewCoordSys.yhat, [0,1,0])
            np.testing.assert_array_equal(newNewCoordSys.zhat, [0,0,1])
            np.testing.assert_array_equal(
                newNewCoordSys.origin,
                [x+x2, y+y2, z+z2]
            )
            np.testing.assert_array_equal(newNewCoordSys.rot, np.eye(3))

def randomCoordSys(rng):
    return batoid.CoordSys(
        rng.uniform(size=3),
        (batoid.RotX(rng.uniform())
         @batoid.RotY(rng.uniform())
         @batoid.RotZ(rng.uniform()))
    )

@timer
def test_rotate_identity():
    rng = np.random.default_rng(577)
    coordSys = randomCoordSys(rng)
    otherCoordSys = randomCoordSys(rng)
    rotOrigin = rng.uniform(size=3)

    newCoordSys = coordSys.rotateGlobal(np.eye(3))
    assert coordSys == newCoordSys

    newCoordSys = coordSys.rotateLocal(np.eye(3))
    assert coordSys == newCoordSys

    newCoordSys = coordSys.rotateGlobal(np.eye(3), rotOrigin, otherCoordSys)
    np.testing.assert_allclose(
        coordSys.origin, newCoordSys.origin, rtol=0, atol=1e-15
    )
    np.testing.assert_array_equal(coordSys.rot, newCoordSys.rot)

    newCoordSys = coordSys.rotateLocal(np.eye(3), rotOrigin, otherCoordSys)
    np.testing.assert_allclose(
        coordSys.origin, newCoordSys.origin, rtol=0, atol=1e-15
    )
    np.testing.assert_array_equal(coordSys.rot, newCoordSys.rot)

@timer
def test_rotate():
    rng = np.random.default_rng(57)
    for _ in range(10):
        r1 = batoid.RotX(rng.uniform())
        r2 = batoid.RotY(rng.uniform())
        r3 = batoid.RotZ(rng.uniform())
        r4 = batoid.RotX(rng.uniform())
        r5 = batoid.RotY(rng.uniform())
        r6 = batoid.RotZ(rng.uniform())

        rot = r6@r5@r4@r3@r2@r1
        coordSys = batoid.CoordSys().rotateGlobal(rot)
        np.testing.assert_equal(coordSys.xhat, rot[:, 0])
        np.testing.assert_equal(coordSys.yhat, rot[:, 1])
        np.testing.assert_equal(coordSys.zhat, rot[:, 2])
        np.testing.assert_equal(coordSys.origin, 0)

        rot1 = r3@r2@r1
        rot2 = r6@r5@r4

        coordSys = batoid.CoordSys().rotateGlobal(rot1).rotateGlobal(rot2)
        np.testing.assert_allclose(coordSys.xhat, rot[:, 0])
        np.testing.assert_allclose(coordSys.yhat, rot[:, 1])
        np.testing.assert_allclose(coordSys.zhat, rot[:, 2])
        np.testing.assert_equal(coordSys.origin, 0)

        coordSys = batoid.CoordSys(rot=rot1)
        coordSys2 = coordSys.rotateLocal(batoid.RotX(np.pi/2))
        # Since second rotation was about the local X, both should have same
        # xhat
        np.testing.assert_allclose(coordSys.xhat, coordSys2.xhat)
        # 90 degree positive rotation then means y -> -z, z -> y
        np.testing.assert_allclose(coordSys.yhat, -coordSys2.zhat)
        np.testing.assert_allclose(coordSys.zhat, coordSys2.yhat)

        # Try a loop
        coordSys = batoid.CoordSys(rot=rot)
        coordSys = coordSys.rotateGlobal(batoid.RotX(0.1))
        coordSys = coordSys.rotateGlobal(batoid.RotZ(np.pi))
        coordSys = coordSys.rotateGlobal(batoid.RotX(0.1))
        coordSys = coordSys.rotateGlobal(batoid.RotZ(np.pi))
        # Should be back where we started...
        np.testing.assert_allclose(coordSys.rot, rot)

        # Miscentered origins
        origin = rng.uniform(size=3)
        coordSys = batoid.CoordSys(origin=origin, rot=rot)
        np.testing.assert_equal(origin, coordSys.origin)
        coordSys2 = coordSys.rotateGlobal(rot)
        np.testing.assert_equal(rot@origin, coordSys2.origin)
        coordSys3 = coordSys.rotateLocal(rot)
        np.testing.assert_equal(origin, coordSys3.origin)

        # Miscentered rotation axes
        # Global with center specified is same as local
        coordSys = batoid.CoordSys(origin=origin, rot=rot)
        coordSys2 = coordSys.rotateLocal(rot)
        coordSys3 = coordSys.rotateGlobal(rot, origin, batoid.CoordSys())
        np.testing.assert_allclose(coordSys2.origin, origin)
        np.testing.assert_allclose(coordSys2.origin, coordSys3.origin)
        np.testing.assert_allclose(coordSys2.rot, coordSys3.rot)

@timer
def test_combinations():
    # Test some particular combinations of coord sys transformations

    # +90 around x, followed by shift to (1, 0, 0)
    # equivalent to shift first, and then rotation +90 about x
    # latter rotation can be either global or local, since origin is unaffected
    # (1, 0, 0) -> (1, 0, 0)
    # by convention for local rotation
    # and by coincidence (origin is on xaxis) for global rotation
    coordSys = batoid.CoordSys()
    coordSys1 = coordSys.rotateGlobal(batoid.RotX(np.pi/2)).shiftGlobal([1,0,0])
    coordSys2 = coordSys.shiftGlobal([1,0,0]).rotateLocal(batoid.RotX(np.pi/2))
    coordSys3 = coordSys.shiftGlobal([1,0,0]).rotateGlobal(batoid.RotX(np.pi/2))
    np.testing.assert_allclose(coordSys1.origin, coordSys2.origin)
    np.testing.assert_allclose(coordSys1.rot, coordSys2.rot)
    np.testing.assert_allclose(coordSys1.origin, coordSys3.origin)
    np.testing.assert_allclose(coordSys1.rot, coordSys3.rot)

    # +45 around x, followed by sqrt(2) in new y direction, which is the (0, 1, 1)
    # direction in global coords, followed by -45 about x.
    # Should be parallel to global coords, but origin at (0, 1, 1)
    coordSys1 = (
        batoid.CoordSys()
        .rotateGlobal(batoid.RotX(np.pi/4))
        .shiftLocal([0,np.sqrt(2),0])
        .rotateLocal(batoid.RotX(-np.pi/4))
    )
    coordSys2 = batoid.CoordSys().shiftLocal([0,1,1])
    np.testing.assert_allclose(
        coordSys1.origin, coordSys2.origin,
        rtol=0, atol=1e-15
    )
    np.testing.assert_allclose(
        coordSys1.rot, coordSys2.rot,
        rtol=0, atol=1e-15
    )

    # rotate +90 around point (1, 0, 0) with rot axis parallel to y axis.
    # moves origin from (0, 0, 0) to (1, 0, 1)
    coordSys = batoid.CoordSys()
    coordSys1 = coordSys.rotateGlobal(batoid.RotY(np.pi/2), [1,0,0])
    coordSys2 = coordSys.rotateGlobal(batoid.RotY(np.pi/2)).shiftGlobal([1,0,1])
    # local coords of global (1, 0, 1) are (-1, 0, 1)
    coordSys3 = coordSys.rotateGlobal(batoid.RotY(np.pi/2)).shiftLocal([-1,0,1])
    np.testing.assert_allclose(coordSys1.origin, coordSys2.origin)
    np.testing.assert_allclose(coordSys1.rot, coordSys2.rot)
    np.testing.assert_allclose(coordSys1.origin, coordSys3.origin)
    np.testing.assert_allclose(coordSys1.rot, coordSys3.rot)

@timer
def test_ne():
    objs = [
        batoid.CoordTransform(batoid.CoordSys(), batoid.CoordSys()),
        batoid.CoordSys(),
        batoid.CoordSys([0,0,1]),
        batoid.CoordSys([0,1,0]),
        batoid.CoordSys([0,0,1], batoid.RotX(0.1)),
        batoid.CoordSys(rot=batoid.RotX(0.1)),
        batoid.CoordSys(rot=batoid.RotX(0.2)),
    ]
    all_obj_diff(objs)

if __name__ == '__main__':
    test_params()
    test_shift()
    test_rotate_identity()
    test_rotate()
    test_combinations()
    test_ne()


text:
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you 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.
  -->
<action name='succeeded-post-processing' xmlns="uri:oozie:workflow:0.3">
    <java>
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <configuration>
            <property>
                <name>mapred.job.queue.name</name>
                <value>${queueName}</value>
            </property>
            <property>
                <name>oozie.launcher.mapred.job.priority</name>
                <value>${jobPriority}</value>
            </property>
            <property>
                <name>oozie.launcher.oozie.libpath</name>
                <value>${wf:conf("falcon.libpath")}</value>
            </property>
        </configuration>
        <main-class>org.apache.falcon.workflow.FalconPostProcessing</main-class>
        <arg>-cluster</arg>
        <arg>${cluster}</arg>
        <arg>-entityType</arg>
        <arg>${entityType}</arg>
        <arg>-entityName</arg>
        <arg>${entityName}</arg>
        <arg>-nominalTime</arg>
        <arg>${nominalTime}</arg>
        <arg>-operation</arg>
        <arg>${falconDataOperation}</arg>
        <arg>-workflowId</arg>
        <arg>${wf:id()}</arg>
        <arg>-runId</arg>
        <arg>${wf:run()}</arg>
        <arg>-status</arg>
        <arg>${wf:lastErrorNode() == null ? 'SUCCEEDED' : 'FAILED'}</arg>
        <arg>-timeStamp</arg>
        <arg>${timeStamp}</arg>
        <arg>-brokerImplClass</arg>
        <arg>${wf:conf("broker.impl.class")}</arg>
        <arg>-brokerUrl</arg>
        <arg>${wf:conf("broker.url")}</arg>
        <arg>-userBrokerImplClass</arg>
        <arg>${userBrokerImplClass}</arg>
        <arg>-userBrokerUrl</arg>
        <arg>${userBrokerUrl}</arg>
        <arg>-brokerTTL</arg>
        <arg>${wf:conf("broker.ttlInMins")}</arg>
        <arg>-feedNames</arg>
        <arg>${feedNames}</arg>
        <arg>-feedInstancePaths</arg>
        <arg>${feedInstancePaths}</arg>
        <arg>-logFile</arg>
        <arg>${logDir}/instancePaths-${nominalTime}.csv</arg>
        <arg>-workflowEngineUrl</arg>
        <arg>${workflowEngineUrl}</arg>
        <arg>-subflowId</arg>
        <arg>${wf:id()}${userWorkflowEngine == "oozie" ? "@user-action" : ""}</arg>
        <arg>-userWorkflowEngine</arg>
        <arg>${userWorkflowEngine}</arg>
        <arg>-userWorkflowName</arg>
        <arg>${userWorkflowName}</arg>
        <arg>-userWorkflowVersion</arg>
        <arg>${userWorkflowVersion}</arg>
        <arg>-logDir</arg>
        <arg>${logDir}/job-${nominalTime}/${srcClusterName == 'NA' ? '' : srcClusterName}/</arg>
        <arg>-workflowUser</arg>
        <arg>${wf:user()}</arg>
        <arg>-falconInputFeeds</arg>
        <arg>${falconInputFeeds}</arg>
        <arg>-falconInputPaths</arg>
        <arg>${falconInPaths}</arg>
    </java>
    <ok to="end"/>
    <error to="fail"/>
</action>


text:
namespace Teference.Zoho.Api
{
    #region Namespace

    using System.Threading.Tasks;

    #endregion

    public interface IZsCardApi
    {
        Task<ZsCard> GetAsync(string customerId, string cardId);
        Task<ZsCard> GetAsync(string apiBaseUrl, string authToken, string organizationId, string customerId, string cardId);

        Task<ZsCard> CreateAsync(string customerId, ZsCardCreate createInput);
        Task<ZsCard> CreateAsync(string apiBaseUrl, string authToken, string organizationId, string customerId, ZsCardCreate createInput);

        Task<ZsCard> UpdateAsync(string customerId, string cardId, ZsCardUpdate updateInput);
        Task<ZsCard> UpdateAsync(string apiBaseUrl, string authToken, string organizationId, string customerId, string cardId, ZsCardUpdate updateInput);

        Task<bool> DeleteAsync(string customerId, string cardId);
        Task<bool> DeleteAsync(string apiBaseUrl, string authToken, string organizationId, string customerId, string cardId);
    }
}


text:
<?php include("../../includes/layouts/header.php"); ?>
<?php include("../../includes/layouts/topnavbar.php"); ?>
<?php include("../../includes/layouts/leftnavbar.php"); ?>

 Our Staff!

Jay Ball

Jay Ball moved to Dayton from Walla Walla x year ago. He was quickly welcome in the friendly community. After years of fixing up verticals for fun side projects, he quickly saw the need for a well experienced Auto Garage in Dayton.

Daniel Harrington

Daniel Harrington is the step son of Jay. For x years Daniel gotextensive experiance at a major mechanic show in downtown Seattle. He quickly became the ranking mechanic.

Responsive Test Row

 This is a responsive rest row. This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.

This is a responsive rest row. This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.

 This is a responsive rest row. This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.

This is a responsive rest row. This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.This is a responsive rest row.

<?php include("../../includes/layouts/footer.php"); ?>


text:
const webpack = require('webpack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = () => {
    return {
        entry: { 'create-hint': './src/index' },
        mode: 'production',
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    use: [{
                        loader: 'ts-loader',
                        options: { configFile: 'tsconfig-webpack.json' }
                    }]
                }
            ]
        },
        node: {
            __dirname: false,
            __filename: false,
            path: true,
            process: false
        },
        output: { filename: 'src/[name].js' },
        plugins: [
            new ForkTsCheckerWebpackPlugin(),
            new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
            // We set process.env.webpack becase there are different code paths if we are bundling around loading resources
            new webpack.DefinePlugin({ 'process.env.webpack': JSON.stringify(true) }),
            new webpack.ProgressPlugin()
        ],
        resolve: {
            alias: { handlebars: 'handlebars/dist/handlebars.min.js' },
            extensions: ['.ts', '.js', '.json']
        },
        target: 'node'
    };
};


text:
local lua = "lua"
local i = -1

while arg[i] do
   lua = arg[i]
   i = i - 1
end

if package.loaded["luacov.runner"] then
   lua = lua .. " -lluacov"
   local runner = require "luacov.runner"
   setup(runner.pause)
   teardown(runner.resume)
end

local function run(cmd)
   local handler = io.popen(("%s bin/luadepgraph.lua %s 2>&1"):format(lua, cmd))
   local output = handler:read("*a")
   handler:close()
   return output
end

local function dedent(src)
   local indentation = src:match("^(%s*)")
   local lines = {}

   for line in src:gmatch("[^\n]+") do
      table.insert(lines, line:sub(#indentation + 1))
   end

   return table.concat(lines, "\n")
end

describe("cli", function()
   describe("list", function()
      it("lists", function()
         assert.equal(dedent([[
            1 module, 1 external file.
            Modules:
               rock in spec/samples/rock.lua
            External files:
               spec/samples/bin/rock.lua in spec/samples/bin/rock.lua
         ]]), run("-m spec/samples/rock.lua -e spec/samples/bin -p spec/samples"))

         assert.equal(dedent([[
            1 module, 0 external files.
            Modules:
               rock in spec/samples/rock.lua
         ]]), run("-m spec/samples/rock.lua -p spec/samples --list"))

         assert.equal(dedent([[
            0 modules, 1 external file.
            External files:
               spec/samples/bin/rock.lua in spec/samples/bin/rock.lua
         ]]), run("-e spec/samples/bin/rock.lua --list"))

         assert.equal(dedent([[
            3 modules, 1 external file.
            Modules:
               rock in spec/samples/rock.lua
               rock.bar in spec/samples/rock/bar.lua
               rock.foo in spec/samples/rock/foo.lua
            External files:
               rock in spec/samples/bin/rock.lua
         ]]), run("-m spec/samples/rock-1-1.rockspec --list"))

         assert.equal(dedent([[
            7 modules, 1 external file.
            Modules:
               depgraph in src/depgraph/init.lua
               depgraph.cli in src/depgraph/cli.lua
               depgraph.luacheck.lexer in src/depgraph/luacheck/lexer.lua
               depgraph.luacheck.linearize in src/depgraph/luacheck/linearize.lua
               depgraph.luacheck.parser in src/depgraph/luacheck/parser.lua
               depgraph.luacheck.utils in src/depgraph/luacheck/utils.lua
               depgraph.scan in src/depgraph/scan.lua
            External files:
               luadepgraph in bin/luadepgraph.lua
         ]]), run("--list"))
      end)

      it("handles errors", function()
         assert.equal(dedent([[
            Error: Could not open missing.lua: No such file or directory
         ]]), run("-m missing.lua --list"))
      end)
   end)

   describe("show", function()
      it("shows", function()
         assert.equal(dedent([[
            Module rock in spec/samples/rock.lua
            Dependencies:
               dep.* on line 2, column 7 (protected)
               rock.bar on line 9, column 10 (conditional, protected)
               rock.foo (2 times)
                  on line 1, column 1
                  on line 3, column 8 (protected)
               that on line 8, column 4 (conditional)
               this on line 6, column 4 (conditional)
            Depended on by:
               rock.bar on line 1, column 1
               rock.foo on line 2, column 4 (lazy)
               rock in spec/samples/bin/rock.lua on line 1, column 1
         ]]), run("-m spec/samples/rock-1-1.rockspec --show rock"))

         assert.equal(dedent([[
            Module rock.foo in spec/samples/rock/foo.lua
            Dependencies:
               rock on line 2, column 4 (lazy)
               rock.* on line 3, column 10 (lazy, protected)
            Depended on by:
               rock (2 times)
                  on line 1, column 1
                  on line 3, column 8 (protected)
               rock.foo as rock.* on line 3, column 10 (lazy, protected)
         ]]), run("-m spec/samples/rock-1-1.rockspec --show rock.foo"))

         assert.equal(dedent([[
            External file rock in spec/samples/bin/rock.lua
            Dependencies:
               rock on line 1, column 1
         ]]), run("-m spec/samples/rock-1-1.rockspec --show spec/samples/bin/rock.lua"))
      end)

      it("prints error on missing module", function()
         assert.equal(dedent([[
            Error: rock.baz is not a module or an external file.
         ]]), run("-m spec/samples/rock-1-1.rockspec --show rock.baz"))
      end)
   end)

   describe("deps", function()
      it("shows external deps", function()
         assert.equal(dedent([[
            3 external dependencies.
            dep.* required by:
               rock on line 2, column 7 (protected)
            that required by:
               rock on line 8, column 4 (conditional)
            this required by:
               rock on line 6, column 4 (conditional)
         ]]), run("-m spec/samples/rock-1-1.rockspec --deps"))
      end)
   end)

   describe("cycles", function()
      it("shows cycles", function()
         assert.equal(dedent([[
            2 circular dependencies found.
            The shortest circular dependency has length 2:
               rock depends on rock.bar on line 9, column 10 (conditional, protected)
               rock.bar depends on rock on line 1, column 1
            The next shortest circular dependency has length 2:
               rock depends on rock.foo (2 times)
                  on line 1, column 1
                  on line 3, column 8 (protected)
               rock.foo depends on rock on line 2, column 4 (lazy)
         ]]), run("-m spec/samples/rock-1-1.rockspec --cycles"))

         assert.equal(dedent([[
            No circular dependencies found.
         ]]), run("-m spec/samples/rock.lua -p spec/samples --cycles"))
      end)

      it("shows cycles without lazy deps with --strict", function()
         assert.equal(dedent([[
            1 circular dependency found.
            The shortest circular dependency has length 2:
               rock depends on rock.bar on line 9, column 10 (conditional, protected)
               rock.bar depends on rock on line 1, column 1
         ]]), run("-m spec/samples/rock-1-1.rockspec --cycles --strict"))
      end)
   end)

   describe("dot", function()
      it("exports graph into .dot format", function()
         assert.equal(dedent([[
            digraph "depgraph" {
            1 [color = blue label = "rock"]
            2 [color = black label = "rock"]
            1 -> 2 [color = black style = solid]
            3 [color = yellow label = "dep.*"]
            2 -> 3 [color = green style = solid]
            4 [color = black label = "rock.bar"]
            2 -> 4 [color = green style = dashed]
            5 [color = black label = "rock.foo"]
            2 -> 5 [color = black style = solid]
            6 [color = yellow label = "that"]
            2 -> 6 [color = black style = dashed]
            7 [color = yellow label = "this"]
            2 -> 7 [color = black style = dashed]
            4 -> 2 [color = black style = solid]
            5 -> 2 [color = black style = dotted]
            8 [color = yellow label = "rock.*"]
            5 -> 8 [color = green style = dotted]
            }
         ]]), run("-m spec/samples/rock-1-1.rockspec --dot"))
      end)

      it("allows setting graph title", function()
         assert.equal(dedent([[
            digraph "hey" {
            1 [color = blue label = "rock"]
            2 [color = black label = "rock"]
            1 -> 2 [color = black style = solid]
            3 [color = yellow label = "dep.*"]
            2 -> 3 [color = green style = solid]
            4 [color = black label = "rock.bar"]
            2 -> 4 [color = green style = dashed]
            5 [color = black label = "rock.foo"]
            2 -> 5 [color = black style = solid]
            6 [color = yellow label = "that"]
            2 -> 6 [color = black style = dashed]
            7 [color = yellow label = "this"]
            2 -> 7 [color = black style = dashed]
            4 -> 2 [color = black style = solid]
            5 -> 2 [color = black style = dotted]
            8 [color = yellow label = "rock.*"]
            5 -> 8 [color = green style = dotted]
            }
         ]]), run("-m spec/samples/rock-1-1.rockspec --dot hey"))
      end)

      it("exports a subtree using --root", function()
         assert.equal(dedent([[
            digraph "depgraph" {
            1 [color = black label = "rock"]
            2 [color = yellow label = "dep.*"]
            1 -> 2 [color = green style = solid]
            3 [color = black label = "rock.bar"]
            1 -> 3 [color = green style = dashed]
            4 [color = black label = "rock.foo"]
            1 -> 4 [color = black style = solid]
            5 [color = yellow label = "that"]
            1 -> 5 [color = black style = dashed]
            6 [color = yellow label = "this"]
            1 -> 6 [color = black style = dashed]
            3 -> 1 [color = black style = solid]
            4 -> 1 [color = black style = dotted]
            7 [color = yellow label = "rock.*"]
            4 -> 7 [color = green style = dotted]
            }
         ]]), run("-m spec/samples/rock-1-1.rockspec --dot --root rock.foo"))
      end)
   end)
end)


text:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
	<ShortName>Antra Mahadkar</ShortName>
	<Description>Search Antra Mahadkar - Be a Web Developer </Description>
	<Contact>help@wordpress.com</Contact>
	<Url type="application/atom+xml" template="https://antramahadkar.wordpress.com/?s={searchTerms}&feed=atom"/>
	<Url type="application/rss+xml"  template="https://antramahadkar.wordpress.com/?s={searchTerms}&feed=rss2"/>
	<Url type="text/html"            template="https://antramahadkar.wordpress.com/?s={searchTerms}" method="GET" />
	<Url type="application/opensearchdescription+xml" rel="self" template="/osd.xml" />
	<LongName>Antra Mahadkar</LongName>
	<Image height="16" width="16" type="image/vnd.microsoft.icon">https://antramahadkar.wordpress.com/favicon.ico</Image>
	<Image height="64" width="64" type="image/png">https://s-ssl.wordpress.com/i/logo/gray-white-transparent-64.png</Image>
	<Query role="example" searchTerms="photography" />
	<Tags>blog</Tags>
	<Developer>Automattic</Developer>
	<SyndicationRight>open</SyndicationRight>
	<AdultContent>false</AdultContent>
	<Language>en</Language>
	<OutputEncoding>UTF-8</OutputEncoding>
	<InputEncoding>UTF-8</InputEncoding>
	<moz:SearchForm>https://antramahadkar.wordpress.com</moz:SearchForm>
</OpenSearchDescription>


text:
using System;
using System.Collections.Generic;
using MvvmCross.Binding.BindingContext;
using MvvmCross.Binding.iOS.Views;
using MvvmCross.iOS.Views;
using MvvmCross.iOS.Views.Presenters.Attributes;
using MvvmCross.Platform;
using TwilightImperiumMasterCompanion.Core;
using UIKit;

namespace TwilightImperiumMasterCompanion.iOS
{
    [MvxTabPresentation(WrapInNavigationController = true)]
	public partial class UnitReferenceView : MvxViewController
	{
        private readonly INavigationBar navigationBar;

        public UnitReferenceView()
			: base("UnitReferenceView", null)
		{
            this.Title = UnitReferenceViewModel.Title;
			navigationBar = Mvx.Resolve<INavigationBar>();
		}

		public override void ViewDidLoad()
		{
			base.ViewDidLoad();

            navigationBar.Initialize(this);

            var source = new MvxSimpleTableViewSource(tableView, "UnitReferenceTableViewCell", "UnitReferenceTableViewCell");
			tableView.Source = source;

			var set = this.CreateBindingSet<UnitReferenceView, UnitReferenceViewModel>();
            set.Bind(source).For(v => v.ItemsSource).To(vm => vm.Units);
            set.Bind(NavigationItem.LeftBarButtonItem).To(vm => vm.ShowHexMainMenu);
            set.Bind(source).For(v => v.SelectionChangedCommand).To(vm => vm.ShowDetailView);
			set.Apply();
		}
	}
}


text:
namespace OCIO_NAMESPACE
{

void bindPyColorSpaceTransform(py::module & m)
{
    ColorSpaceTransformRcPtr DEFAULT = ColorSpaceTransform::Create();

    auto clsColorSpaceTransform =
        py::class_<ColorSpaceTransform, ColorSpaceTransformRcPtr, Transform>(
            m.attr("ColorSpaceTransform"))

        .def(py::init(&ColorSpaceTransform::Create),
             DOC(ColorSpaceTransform, Create))
        .def(py::init([](const std::string & src,
                         const std::string & dst,
                         TransformDirection dir,
                         bool dataBypass)
            {
                ColorSpaceTransformRcPtr p = ColorSpaceTransform::Create();
                if (!src.empty()) { p->setSrc(src.c_str()); }
                if (!dst.empty()) { p->setDst(dst.c_str()); }
                p->setDirection(dir);
                p->setDataBypass(dataBypass);
                p->validate();
                return p;
            }),
             "src"_a        = DEFAULT->getSrc(),
             "dst"_a        = DEFAULT->getDst(),
             "direction"_a  = DEFAULT->getDirection(),
             "dataBypass"_a = DEFAULT->getDataBypass(),
             DOC(ColorSpaceTransform, Create))

        .def("getSrc", &ColorSpaceTransform::getSrc,
             DOC(ColorSpaceTransform, getSrc))
        .def("setSrc", &ColorSpaceTransform::setSrc, "src"_a.none(false),
             DOC(ColorSpaceTransform, setSrc))
        .def("getDst", &ColorSpaceTransform::getDst,
             DOC(ColorSpaceTransform, getDst))
        .def("setDst", &ColorSpaceTransform::setDst, "dst"_a.none(false),
             DOC(ColorSpaceTransform, setDst))
        .def("getDataBypass", &ColorSpaceTransform::getDataBypass,
             DOC(ColorSpaceTransform, getDataBypass))
        .def("setDataBypass", &ColorSpaceTransform::setDataBypass, "dataBypass"_a,
             DOC(ColorSpaceTransform, setDataBypass));

    defRepr(clsColorSpaceTransform);
}

} // namespace OCIO_NAMESPACE


text:
import rospy
from wait_action.msg import WaitAction
from wait_action.msg import WaitFeedback
from datetime import *
from std_srvs.srv import Empty, EmptyResponse
from strands_executive_msgs import task_utils
from strands_executive_msgs.abstract_task_server import AbstractTaskServer

class WaitServer(AbstractTaskServer):
    def __init__(self, interruptible=True, name='wait_action'):
        super(WaitServer, self).__init__(name, action_type=WaitAction,
                                         interruptible=interruptible)
        self.maximise_duration_delta = rospy.Duration(rospy.get_param('~maximise_duration_delta', 0))

    def end_wait(self, req):

        if self.server.is_active():
            rospy.loginfo("Preempting sleep")
            self.server.preempt_request = True
            self.server.set_preempted()
        return EmptyResponse()

    def create(self, req):
        t = super(WaitServer, self).create(req)
        task_utils.add_time_argument(t, rospy.Time())
        if self.maximise_duration_delta > rospy.Duration(0):
            d = (t.end_before - t.start_after) - self.maximise_duration_delta
            task_utils.add_duration_argument(t, d)
            t.max_duration = d
        else:
            task_utils.add_duration_argument(t, t.max_duration)
        return t

    def execute(self, goal):
        end_wait_srv = rospy.Service('/wait_action/end_wait',
                                     Empty, self.end_wait)
        try:
            now = rospy.get_rostime()
            target = goal.wait_until
            if target.secs == 0:
                target = now + goal.wait_duration

            if target == now:
                # 72 hours
                a_really_long_time = rospy.Duration(60 * 60 * 24 * 3)
                target = now + a_really_long_time
                # rospy.loginfo("waiting a really long time")

            # for testing overruns
            # if True:
            #     a_really_long_time = rospy.Duration(60 * 60 * 24 * 3)
            #     target = now + a_really_long_time

            rospy.loginfo("target wait time: %s"
                          % datetime.fromtimestamp(target.secs))

            # how often to provide feedback
            feedback_secs = 5.0
            feedback = WaitFeedback()
            # how long to wait
            wait_duration_secs = target.secs - now.secs

            # the rate to publish feedback at/check time at
            r = rospy.Rate(1.0/feedback_secs)

            count = 1.0
            feedback_steps = wait_duration_secs/feedback_secs
            while not rospy.is_shutdown() and not self.server.is_preempt_requested() and rospy.get_rostime() < target:
                feedback.percent_complete = count/feedback_steps
                self.server.publish_feedback(feedback)
                count += 1
                r.sleep()

            rospy.loginfo("waited until: %s"
                          % datetime.fromtimestamp(rospy.get_rostime().secs))
        finally:
            end_wait_srv.shutdown()

        if self.server.is_preempt_requested():
            self.server.set_preempted()
        else:
            self.server.set_succeeded()

if __name__ == '__main__':

    rospy.init_node("wait_node")

    interruptible = rospy.get_param("~interruptible", True)
    # wait for simulated time to kick in as rospy.get_rostime() is 0 until first clock message received
    while not rospy.is_shutdown() and rospy.get_rostime().secs == 0:
        pass

    waiter = WaitServer(interruptible=interruptible, name=rospy.get_name())

    rospy.spin()


text:
import java.awt.Dimension;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import sodium.*;

public class characters {
    static <A> Cell<List<A>> sequence(Collection<Cell<A>> in) {
        Cell<List<A>> out = new Cell<>(new ArrayList<A>());
        for (Cell<A> c : in)
            out = Cell.lift(
                (l0, a) -> {
                    List<A> l = new ArrayList<A>(l0);
                    l.add(a);
                    return l;
                }, out, c);
        return out;
    }
    static Cell<List<Character>> createCharacters(
            Cell<Double> time, Stream<Unit> sTick, World world,
            Cell<List<Character>> scene) {
        List<Cell<Character>> chars = new ArrayList<>();
        int id = 0;
        for (int x = 100; x < world.windowSize.width; x += 100)
            for (int y = 150; y < world.windowSize.height; y += 150) {
                Point pos0 = new Point(x, y);
                if (id != 3 && id != 6 && id != 7) {
                    HomoSapiens h = new HomoSapiens(world, id, pos0,
                        time, sTick);
                    chars.add(h.character);
                }
                else {
                    HomoZombicus z = new HomoZombicus(id, pos0,
                        time, sTick, scene);
                    chars.add(z.character);
                }
                id++;
            }
        return sequence(chars);
    }
    public static void main(String[] args)
    {
        Animate.animate(
            "Zombicus characters",
            (Cell<Double> time, Stream<Unit> sTick,
                                            Dimension windowSize) -> {
                World world = new World(windowSize);
                CellLoop<List<Character>> scene = new CellLoop<>();
                Cell<List<Character>> scene_ = createCharacters(
                    time, sTick, world, scene);
                scene.loop(scene_);
                return scene;
            }
        );
    }
}


text:
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
const dates = {
  short(dateStr) {
      const date = new Date(dateStr)
      if (date === "Invalid Date" || isNaN(date)) {
        return dateStr;
      }
      return months[date.getMonth()] + ' ' + date.getFullYear()
  },
  range(fromStr, toStr) {
    const from = this.short(fromStr)
    const to = this.short(toStr)
    if (from == to) {
      return from
    }
    return from + ' - ' + to
  }
}

const filtering = () => {

}

export {dates, filtering}


text:
function readPoints() {
	readAndSaveSimpleInt("yougovus",".logins-box-points");
}

setTimeout(function() { readPoints(); }, 5000);


text:
using Host.Config;
using Owin;
using System.Collections.Generic;
using Thinktecture.IdentityServer.Core.Configuration;
using Thinktecture.IdentityServer.Core.Logging;
using Thinktecture.IdentityServer.Host.Config;
using Thinktecture.IdentityServer.WsFederation.Configuration;
using Thinktecture.IdentityServer.WsFederation.Models;
using Thinktecture.IdentityServer.WsFederation.Services;

namespace Host
{
    internal class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            LogProvider.SetCurrentLogProvider(new DiagnosticsTraceLogProvider());

            app.Map("/core", coreApp =>
            {
                var factory = InMemoryFactory.Create(
                    users: Users.Get(),
                    clients: Clients.Get(),
                    scopes: Scopes.Get());

                var options = new IdentityServerOptions
                {
                    SiteName = "IdentityServer3 with WS-Federation",

                    SigningCertificate = Certificate.Get(),
                    Factory = factory,
                    PluginConfiguration = ConfigurePlugins,
                };

                coreApp.UseIdentityServer(options);
            });
        }

        private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options)
        {
            var wsFedOptions = new WsFederationPluginOptions(options);

            // data sources for in-memory services
            wsFedOptions.Factory.Register(new Registration<IEnumerable<RelyingParty>>(RelyingParties.Get()));
            wsFedOptions.Factory.RelyingPartyService = new Registration<IRelyingPartyService>(typeof(InMemoryRelyingPartyService));

            pluginApp.UseWsFederationPlugin(wsFedOptions);
        }
    }
}


text:
package allow

import (
	clibazil "bazil.org/bazil/cli"
	"bazil.org/bazil/cliutil/subcommands"
	"bazil.org/bazil/peer"
	"bazil.org/bazil/server/control/wire"
	"golang.org/x/net/context"
)

type allowCommand struct {
	subcommands.Description
	Arguments struct {
		PubKey  peer.PublicKey
		Storage string
	}
}

func (cmd *allowCommand) Run() error {
	req := &wire.PeerStorageAllowRequest{
		Pub:     cmd.Arguments.PubKey[:],
		Backend: cmd.Arguments.Storage,
	}
	ctx := context.Background()
	client, err := clibazil.Bazil.Control()
	if err != nil {
		return err
	}
	if _, err := client.PeerStorageAllow(ctx, req); err != nil {
		// TODO unwrap error
		return err
	}
	return nil
}

var allow = allowCommand{
	Description: "allow a peer",
}

func init() {
	subcommands.Register(&allow)
}


text:
Marionette.Renderer = {

  // Render a template with data. The `template` parameter is
  // passed to the `TemplateCache` object to retrieve the
  // template function. Override this method to provide your own
  // custom rendering and template handling for all of Marionette.
  render: function(template, data){

    if (!template) {
      throwError("Cannot render the template since it's false, null or undefined.", "TemplateNotFoundError");
    }

    var templateFunc;
    if (typeof template === "function"){
      templateFunc = template;
    } else {
      templateFunc = Marionette.TemplateCache.get(template);
    }

    return templateFunc(data);
  }
};


text:
[Gray Matter](https://github.com/jonschlinkert/gray-matter) support for [JSTransformers](http://github.com/jstransformers).

[![Build Status](https://img.shields.io/travis/jstransformers/jstransformer-gray-matter/master.svg)](https://travis-ci.org/jstransformers/jstransformer-gray-matter)
[![Coverage Status](https://img.shields.io/codecov/c/github/jstransformers/jstransformer-gray-matter/master.svg)](https://codecov.io/gh/jstransformers/jstransformer-gray-matter)
[![Dependency Status](https://img.shields.io/david/jstransformers/jstransformer-gray-matter/master.svg)](http://david-dm.org/jstransformers/jstransformer-gray-matter)
[![NPM version](https://img.shields.io/npm/v/jstransformer-gray-matter.svg)](https://www.npmjs.org/package/jstransformer-gray-matter)

## Installation

    npm install jstransformer-gray-matter

## API

```js
var matter = require('jstransformer')(require('jstransformer-gray-matter'))
var options = {
  delims: ['~~~', '~~~']
}

var res = matter.render('~~~\ntitle: gray-matter\n~~~\nbar', options)

console.log(JSON.parse(res.body))
//=> {data: {title: 'gray-matter'}, content: 'bar', orig: '~~~\ntitle: gray-matter\n~~~\nbar'}
```

## License

MIT


text:
  <fieldset>
    <legend>Branches</legend>

Configure which branches will be watched on this project.

A '*' may be used as a wildcard e.g 'release/*' will match all branches that start with 'release/'.

A '*' may be used on its own to signify that you want every branch to be watched.

      When using wildcards, the order which branches are listed is very important. '*' must be last.
      If '*' is first, then all other branches will be ignored.

        <form name="branchForm" class="control-group form-inline">

              <input ng-model="branchName"
                     autocomplete="off"
                     typeahead="branch for branch in allBranches | filter:$viewValue"
                     typeahead-template-url="/ui-bootstrap/template/typeahead/typeahead-popup.html"
                     type="text" required
                     name="name" placeholder="branch name"
                     class="span4 inline-input"/>
              <button class="btn" ng-disabled="!branchForm.$valid" ng-click="add()">Add</button>

        </form>

            [[branch.name]]

  </fieldset>


text:
SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = .
topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
hdrdir = $(topdir)
VPATH = $(srcdir):$(topdir):$(hdrdir)
prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
exec_prefix = $(prefix)
sitedir = $(DESTDIR)/Library/Ruby/Site
rubylibdir = $(libdir)/ruby/$(ruby_version)
docdir = $(datarootdir)/doc/$(PACKAGE)
dvidir = $(docdir)
datarootdir = $(prefix)/share
archdir = $(rubylibdir)/$(arch)
sbindir = $(exec_prefix)/sbin
psdir = $(docdir)
localedir = $(datarootdir)/locale
htmldir = $(docdir)
datadir = $(datarootdir)
includedir = $(prefix)/include
infodir = $(DESTDIR)/usr/share/info
sysconfdir = $(prefix)/etc
mandir = $(DESTDIR)/usr/share/man
libdir = $(exec_prefix)/lib
sharedstatedir = $(prefix)/com
oldincludedir = $(DESTDIR)/usr/include
pdfdir = $(docdir)
sitearchdir = $(sitelibdir)/$(sitearch)
bindir = $(exec_prefix)/bin
localstatedir = $(prefix)/var
sitelibdir = $(sitedir)/$(ruby_version)
libexecdir = $(exec_prefix)/libexec

CC = gcc
LIBRUBY = $(LIBRUBY_SO)
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)

RUBY_EXTCONF_H = extconf.h
CFLAGS   =  -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -I/usr/include/libxml2 -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/include
INCFLAGS = -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/include
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\"
CXXFLAGS = $(CFLAGS)
DLDFLAGS = -L. -arch ppc -arch i386
LDSHARED = cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup
AR = ar
EXEEXT =

RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = ruby
arch = universal-darwin9.0
sitearch = universal-darwin9.0
ruby_version = 1.8
ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
RUBY = $(ruby)
RM = rm -f
MAKEDIRS = mkdir -p
INSTALL = /usr/bin/install -c
INSTALL_PROG = $(INSTALL) -m 0755
INSTALL_DATA = $(INSTALL) -m 644
COPY = cp

#### End of system configuration section. ####

preload =

libpath = . $(libdir) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
LIBPATH =  -L"." -L"$(libdir)" -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib"
DEFFILE =

CLEANFILES = mkmf.log
DISTCLEANFILES =

extout =
extout_prefix =
target_prefix =
LOCAL_LIBS =
LIBS = $(LIBRUBYARG_SHARED) -L/usr/lib -lxml2 -lz -lpthread -licucore -lm -liconv -lz -lm  -lpthread -ldl -lm
SRCS = libxml.c ruby_xml.c ruby_xml_attr.c ruby_xml_attr_decl.c ruby_xml_attributes.c ruby_xml_cbg.c ruby_xml_document.c ruby_xml_dtd.c ruby_xml_encoding.c ruby_xml_error.c ruby_xml_html_parser.c ruby_xml_html_parser_context.c ruby_xml_html_parser_options.c ruby_xml_input_cbg.c ruby_xml_io.c ruby_xml_namespace.c ruby_xml_namespaces.c ruby_xml_node.c ruby_xml_parser.c ruby_xml_parser_context.c ruby_xml_parser_options.c ruby_xml_reader.c ruby_xml_relaxng.c ruby_xml_sax2_handler.c ruby_xml_sax_parser.c ruby_xml_schema.c ruby_xml_xinclude.c ruby_xml_xpath.c ruby_xml_xpath_context.c ruby_xml_xpath_expression.c ruby_xml_xpath_object.c ruby_xml_xpointer.c
OBJS = libxml.o ruby_xml.o ruby_xml_attr.o ruby_xml_attr_decl.o ruby_xml_attributes.o ruby_xml_cbg.o ruby_xml_document.o ruby_xml_dtd.o ruby_xml_encoding.o ruby_xml_error.o ruby_xml_html_parser.o ruby_xml_html_parser_context.o ruby_xml_html_parser_options.o ruby_xml_input_cbg.o ruby_xml_io.o ruby_xml_namespace.o ruby_xml_namespaces.o ruby_xml_node.o ruby_xml_parser.o ruby_xml_parser_context.o ruby_xml_parser_options.o ruby_xml_reader.o ruby_xml_relaxng.o ruby_xml_sax2_handler.o ruby_xml_sax_parser.o ruby_xml_schema.o ruby_xml_xinclude.o ruby_xml_xpath.o ruby_xml_xpath_context.o ruby_xml_xpath_expression.o ruby_xml_xpath_object.o ruby_xml_xpointer.o
TARGET = libxml_ruby
DLLIB = $(TARGET).bundle
EXTSTATIC =
STATIC_LIB =

RUBYCOMMONDIR = $(sitedir)$(target_prefix)
RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
RUBYARCHDIR   = $(sitearchdir)$(target_prefix)

TARGET_SO     = $(DLLIB)
CLEANLIBS     = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
CLEANOBJS     = *.o *.a *.s[ol] *.pdb *.exp *.bak

all:		$(DLLIB)
static:		$(STATIC_LIB)

clean:
		@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)

distclean:	clean
		@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
		@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)

realclean:	distclean
install: install-so install-rb

install-so: $(RUBYARCHDIR)
install-so: $(RUBYARCHDIR)/$(DLLIB)
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
	$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
install-rb: pre-install-rb install-rb-default
install-rb-default: pre-install-rb-default
pre-install-rb: Makefile
pre-install-rb-default: Makefile
$(RUBYARCHDIR):
	$(MAKEDIRS) $@

site-install: site-install-so site-install-rb
site-install-so: install-so
site-install-rb: install-rb

.SUFFIXES: .c .m .cc .cxx .cpp .C .o

.cc.o:
	$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<

.cxx.o:
	$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<

.cpp.o:
	$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<

.C.o:
	$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<

.c.o:
	$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<

$(DLLIB): $(OBJS)
	@-$(RM) $@
	$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)

$(OBJS): ruby.h defines.h $(RUBY_EXTCONF_H)


text:
package de.tudarmstadt.ukp.clarin.webanno.agreement;

public enum AgreementReportExportFormat
{
    CSV(".csv"), DEBUG(".txt");

    private final String extension;

    AgreementReportExportFormat(String aExtension)
    {
        extension = aExtension;
    }

    public String getExtension()
    {
        return extension;
    }
}


text:
module Azure::Network::Mgmt::V2019_04_01
  module Models
    #
    # Outbound rule of the load balancer.
    #
    class OutboundRule < SubResource

      include MsRestAzure

      # @return [Integer] The number of outbound ports to be used for NAT.
      attr_accessor :allocated_outbound_ports

      # @return [Array<SubResource>] The Frontend IP addresses of the load
      # balancer.
      attr_accessor :frontend_ipconfigurations

      # @return [SubResource] A reference to a pool of DIPs. Outbound traffic
      # is randomly load balanced across IPs in the backend IPs.
      attr_accessor :backend_address_pool

      # @return [String] Gets the provisioning state of the PublicIP resource.
      # Possible values are: 'Updating', 'Deleting', and 'Failed'.
      attr_accessor :provisioning_state

      # @return [LoadBalancerOutboundRuleProtocol] The protocol for the
      # outbound rule in load balancer. Possible values include: 'Tcp', 'Udp',
      # 'All'
      attr_accessor :protocol

      # @return [Boolean] Receive bidirectional TCP Reset on TCP flow idle
      # timeout or unexpected connection termination. This element is only used
      # when the protocol is set to TCP.
      attr_accessor :enable_tcp_reset

      # @return [Integer] The timeout for the TCP idle connection.
      attr_accessor :idle_timeout_in_minutes

      # @return [String] The name of the resource that is unique within a
      # resource group. This name can be used to access the resource.
      attr_accessor :name

      # @return [String] A unique read-only string that changes whenever the
      # resource is updated.
      attr_accessor :etag

      #
      # Mapper for OutboundRule class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'OutboundRule',
          type: {
            name: 'Composite',
            class_name: 'OutboundRule',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              allocated_outbound_ports: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.allocatedOutboundPorts',
                type: {
                  name: 'Number'
                }
              },
              frontend_ipconfigurations: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.frontendIPConfigurations',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'SubResourceElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'SubResource'
                      }
                  }
                }
              },
              backend_address_pool: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.backendAddressPool',
                type: {
                  name: 'Composite',
                  class_name: 'SubResource'
                }
              },
              provisioning_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.provisioningState',
                type: {
                  name: 'String'
                }
              },
              protocol: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.protocol',
                type: {
                  name: 'String'
                }
              },
              enable_tcp_reset: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.enableTcpReset',
                type: {
                  name: 'Boolean'
                }
              },
              idle_timeout_in_minutes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.idleTimeoutInMinutes',
                type: {
                  name: 'Number'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              etag: {
                client_side_validation: true,
                required: false,
                serialized_name: 'etag',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
/DataStructures
===============

Each module contains a class implementing a data structure indicated by the name of the module. The usage of each implementation is specific to that implementation, and hence each one contains documentation regarding its usage.

What's Included (so far)
========================

* Binary Search tree
* Binary tree
* Linked list
* Queue
* Stack
* Van Emde Boas tree

Tests
=====

Unit tests for all of the data structures are included in `tests.py`, implemented using the standard Python unittest framework.


text:
package org.jboss.arquillian.container.test.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Defines how Arquillian should communicate with and prepare the @{@link Deployment} for in container testing.
 *

 * Arquillian will use what the container has defined as it's default protocol unless you specify other wise. You can
 * override this behavior
 * by using @OverProtocol on the @Deployment method.
 *

 *

 * Usage Example:

 *

 * @Deployment @OverProtocol("MyCustomProtocol")
 * public static WebArchive create() {
 *      return ShrinkWrap.create(WebArchive.class);
 * }
 *

 *

 * You can also override the default behavior on a global level using arquillian.xml. This will apply to
 * all containers and all deployments in your test suite.
 *

 *

 * Usage Example:

 *

 * <?xml version="1.0" encoding="UTF-8"?>
 * <arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 *   xmlns="http://jboss.org/schema/arquillian"
 *   xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
 *
 *      <defaultProtocol type="Servlet 3.0" />
 * </arquillian>
 *

 *
 * @author Aslak Knutsen
 * @version $Revision: $
 */
@Documented
@Retention(RUNTIME)
@Target(ElementType.METHOD)
public @interface OverProtocol {
    /**
     * A String reference to the protocol name
     */
    String value();
}


text:
package io.sentry;

import io.sentry.util.Objects;
import java.io.File;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/** Sends cached events over when your App. is starting. */
public final class SendCachedEnvelopeFireAndForgetIntegration implements Integration {

  private final @NotNull SendFireAndForgetFactory factory;

  public interface SendFireAndForget {
    void send();
  }

  public interface SendFireAndForgetDirPath {
    @Nullable
    String getDirPath();
  }

  public interface SendFireAndForgetFactory {
    @Nullable
    SendFireAndForget create(@NotNull IHub hub, @NotNull SentryOptions options);

    default boolean hasValidPath(final @Nullable String dirPath, final @NotNull ILogger logger) {
      if (dirPath == null || dirPath.isEmpty()) {
        logger.log(SentryLevel.INFO, "No cached dir path is defined in options.");
        return false;
      }
      return true;
    }

    default @NotNull SendFireAndForget processDir(
        final @NotNull DirectoryProcessor directoryProcessor,
        final @NotNull String dirPath,
        final @NotNull ILogger logger) {
      final File dirFile = new File(dirPath);
      return () -> {
        logger.log(SentryLevel.DEBUG, "Started processing cached files from %s", dirPath);

        directoryProcessor.processDirectory(dirFile);

        logger.log(SentryLevel.DEBUG, "Finished processing cached files from %s", dirPath);
      };
    }
  }

  public SendCachedEnvelopeFireAndForgetIntegration(
      final @NotNull SendFireAndForgetFactory factory) {
    this.factory = Objects.requireNonNull(factory, "SendFireAndForgetFactory is required");
  }

  @SuppressWarnings("FutureReturnValueIgnored")
  @Override
  public final void register(final @NotNull IHub hub, final @NotNull SentryOptions options) {
    Objects.requireNonNull(hub, "Hub is required");
    Objects.requireNonNull(options, "SentryOptions is required");

    final String cachedDir = options.getCacheDirPath();
    if (!factory.hasValidPath(cachedDir, options.getLogger())) {
      options.getLogger().log(SentryLevel.ERROR, "No cache dir path is defined in options.");
      return;
    }

    final SendFireAndForget sender = factory.create(hub, options);

    if (sender == null) {
      options.getLogger().log(SentryLevel.ERROR, "SendFireAndForget factory is null.");
      return;
    }

    try {
      options
          .getExecutorService()
          .submit(
              () -> {
                try {
                  sender.send();
                } catch (Exception e) {
                  options
                      .getLogger()
                      .log(SentryLevel.ERROR, "Failed trying to send cached events.", e);
                }
              });

      options
          .getLogger()
          .log(SentryLevel.DEBUG, "SendCachedEventFireAndForgetIntegration installed.");
    } catch (Exception e) {
      options
          .getLogger()
          .log(SentryLevel.ERROR, "Failed to call the executor. Cached events will not be sent", e);
    }
  }
}


text:
Repository for ISTE 422 -- Application Development Practices

You will be using this repository for several exercises.  Start by creating a fork of this in your own GitHub account.


text:
#include <activemq/commands/ConnectionError.h>
#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/state/CommandVisitor.h>
#include <decaf/lang/exceptions/NullPointerException.h>

using namespace std;
using namespace activemq;
using namespace activemq::exceptions;
using namespace activemq::commands;
using namespace decaf::lang;
using namespace decaf::lang::exceptions;

/*
 *
 *  Command code for OpenWire format for ConnectionError
 *
 *  NOTE!: This file is auto generated - do not modify!
 *         if you need to make a change, please see the Java Classes in the
 *         activemq-cpp-openwire-generator module
 *
 */

////////////////////////////////////////////////////////////////////////////////
ConnectionError::ConnectionError() :
    BaseCommand(), exception(NULL), connectionId(NULL) {

}

////////////////////////////////////////////////////////////////////////////////
ConnectionError::~ConnectionError() {
}

////////////////////////////////////////////////////////////////////////////////
ConnectionError* ConnectionError::cloneDataStructure() const {
    std::auto_ptr<ConnectionError> connectionError(new ConnectionError());

    // Copy the data from the base class or classes
    connectionError->copyDataStructure(this);

    return connectionError.release();
}

////////////////////////////////////////////////////////////////////////////////
void ConnectionError::copyDataStructure(const DataStructure* src) {

    // Protect against invalid self assignment.
    if (this == src) {
        return;
    }

    const ConnectionError* srcPtr = dynamic_cast<const ConnectionError*>(src);

    if (srcPtr == NULL || src == NULL) {
        throw decaf::lang::exceptions::NullPointerException(
            __FILE__, __LINE__,
            "ConnectionError::copyDataStructure - src is NULL or invalid");
    }

    // Copy the data of the base class or classes
    BaseCommand::copyDataStructure(src);

    this->setException(srcPtr->getException());
    this->setConnectionId(srcPtr->getConnectionId());
}

////////////////////////////////////////////////////////////////////////////////
unsigned char ConnectionError::getDataStructureType() const {
    return ConnectionError::ID_CONNECTIONERROR;
}

////////////////////////////////////////////////////////////////////////////////
std::string ConnectionError::toString() const {

    ostringstream stream;

    stream << "ConnectionError { "
           << "commandId = " << this->getCommandId() << ", "
           << "responseRequired = " << boolalpha << this->isResponseRequired();
    stream << ", ";
    stream << "Exception = ";
    if (this->getException() != NULL) {
        stream << this->getException()->toString();
    } else {
        stream << "NULL";
    }
    stream << ", ";
    stream << "ConnectionId = ";
    if (this->getConnectionId() != NULL) {
        stream << this->getConnectionId()->toString();
    } else {
        stream << "NULL";
    }
    stream << " }";

    return stream.str();
}

////////////////////////////////////////////////////////////////////////////////
bool ConnectionError::equals(const DataStructure* value) const {

    if (this == value) {
        return true;
    }

    const ConnectionError* valuePtr = dynamic_cast<const ConnectionError*>(value);

    if (valuePtr == NULL || value == NULL) {
        return false;
    }

    if (this->getException() != NULL) {
        if (!this->getException()->equals( valuePtr->getException().get())) {
            return false;
        }
    } else if (valuePtr->getException() != NULL) {
        return false;
    }
    if (this->getConnectionId() != NULL) {
        if (!this->getConnectionId()->equals( valuePtr->getConnectionId().get())) {
            return false;
        }
    } else if (valuePtr->getConnectionId() != NULL) {
        return false;
    }
    if (!BaseCommand::equals(value)) {
        return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////////////////
const decaf::lang::Pointer<BrokerError>& ConnectionError::getException() const {
    return exception;
}

////////////////////////////////////////////////////////////////////////////////
decaf::lang::Pointer<BrokerError>& ConnectionError::getException() {
    return exception;
}

////////////////////////////////////////////////////////////////////////////////
void ConnectionError::setException(const decaf::lang::Pointer<BrokerError>& exception) {
    this->exception = exception;
}

////////////////////////////////////////////////////////////////////////////////
const decaf::lang::Pointer<ConnectionId>& ConnectionError::getConnectionId() const {
    return connectionId;
}

////////////////////////////////////////////////////////////////////////////////
decaf::lang::Pointer<ConnectionId>& ConnectionError::getConnectionId() {
    return connectionId;
}

////////////////////////////////////////////////////////////////////////////////
void ConnectionError::setConnectionId(const decaf::lang::Pointer<ConnectionId>& connectionId) {
    this->connectionId = connectionId;
}

////////////////////////////////////////////////////////////////////////////////
decaf::lang::Pointer<commands::Command> ConnectionError::visit(activemq::state::CommandVisitor* visitor) {
    return visitor->processConnectionError(this);
}


text:
package org.apache.lucene.collation;

import com.ibm.icu.text.Collator;
import com.ibm.icu.text.RawCollationKey;

import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.analysis.tokenattributes.TermAttribute;
import org.apache.lucene.util.IndexableBinaryStringTools;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;

/**
 *

 *   Converts each token into its {@link com.ibm.icu.text.CollationKey}, and
 *   then encodes the CollationKey with {@link IndexableBinaryStringTools}, to
 *   allow it to be stored as an index term.
 *

 *

 *   WARNING: Make sure you use exactly the same Collator at
 *   index and query time -- CollationKeys are only comparable when produced by
 *   the same Collator.  {@link com.ibm.icu.text.RuleBasedCollator}s are
 *   independently versioned, so it is safe to search against stored
 *   CollationKeys if the following are exactly the same (best practice is
 *   to store this information with the index and check that they remain the
 *   same at query time):
 *

 *

 *

 *     Collator version - see {@link Collator#getVersion()}
 *

 *

 *     The collation strength used - see {@link Collator#setStrength(int)}
 *

 *

 *

 *   CollationKeys generated by ICU Collators are not compatible with those
 *   generated by java.text.Collators.  Specifically, if you use
 *   ICUCollationKeyFilter to generate index terms, do not use
 *   {@link CollationKeyFilter} on the query side, or vice versa.
 *

 *

 *   ICUCollationKeyFilter is significantly faster and generates significantly
 *   shorter keys than CollationKeyFilter.  See
 *   http://site.icu-project.org/charts/collation-icu4j-sun for key
 *   generation timing and key length comparisons between ICU4J and
 *   java.text.Collator over several languages.
 *

 */
public final class ICUCollationKeyFilter extends TokenFilter {
  private Collator collator = null;
  private RawCollationKey reusableKey = new RawCollationKey();
  private TermAttribute termAtt;

  /**
   *
   * @param input Source token stream
   * @param collator CollationKey generator
   */
  public ICUCollationKeyFilter(TokenStream input, Collator collator) {
    super(input);
    this.collator = collator;
    termAtt = addAttribute(TermAttribute.class);
  }

  @Override
  public boolean incrementToken() throws IOException {
    if (input.incrementToken()) {
      char[] termBuffer = termAtt.termBuffer();
      String termText = new String(termBuffer, 0, termAtt.termLength());
      collator.getRawCollationKey(termText, reusableKey);
      ByteBuffer collationKeyBuf = ByteBuffer.wrap(reusableKey.bytes, 0, reusableKey.size);
      int encodedLength
        = IndexableBinaryStringTools.getEncodedLength(collationKeyBuf);
      if (encodedLength > termBuffer.length) {
        termAtt.resizeTermBuffer(encodedLength);
      }
      termAtt.setTermLength(encodedLength);
      CharBuffer wrappedTermBuffer = CharBuffer.wrap(termAtt.termBuffer());
      IndexableBinaryStringTools.encode(collationKeyBuf, wrappedTermBuffer);
      return true;
    } else {
      return false;
    }
  }
}


text:
package main

import (
	"encoding/json"
	"errors"
	"io/ioutil"
	"path/filepath"
)

var errUnsupportedConfig = errors.New("unsupported config file type")

func loadJSON(path string, v interface{}) error {
	b, err := ioutil.ReadFile(path)
	if err != nil {
		return err
	}
	return json.Unmarshal(b, v)
}

func loadFile(path string, v interface{}) error {
	var err error
	switch ext := filepath.Ext(path); ext {
	case ".json":
		err = loadJSON(path, v)
	}
	return err
}

type configuration struct {
	HTTP struct {
		Enabled    bool   `json:"enabled"`
		ListenAddr string `json:"listen"`
	} `json:"http"`
	LogDirectory string `json:"log_directory"`
}

func loadConfig(path string) (*configuration, error) {
	var c configuration
	err := loadFile(path, &c)
	return &c, err
}


text:
import {TypeManager} from "../../../src/common/types/type-manager";
import {ServerContext} from "../../../src/server/app/server-context";
import {ServerBundle} from "../../../src/server/bundles/server-bundle";
import {ServerBundleGroup} from "../../../src/server/bundles/server-bundle-group";
import {Entity} from "../../../src/server/entity/entity";
import {EntityDb} from "../../../src/server/orm/entity-db";
import {createFixtureDb} from "./fixture-db";

export function createFixtureServerContext(bundleList: ServerBundle[],
                                           types: TypeManager,
                                           fixtures: Entity[]): ServerContext {
    const db: EntityDb = createFixtureDb(types, fixtures);

    const bundles: ServerBundleGroup = new ServerBundleGroup(bundleList);

    return {types, db, bundles};
}


text:
[![Greenkeeper badge](https://badges.greenkeeper.io/rohmanhm/vaper.svg)](https://greenkeeper.io/)
 [![Build Status](https://travis-ci.org/rohmanhm/vaper.svg?branch=master)](https://travis-ci.org/rohmanhm/vaper)

Convert from `x` value from any type of value to `z` value.

## Install
Using **NPM**
```bash
npm install --save vaper
```
or you may consider using **Yarn**
```bash
yarn add vaper
```

## Usage
```javascript
vaper(defaultValue, newValue)(source)
```

## Example
```javascript
// es6
import vaper from 'vaper';

vaper('foo', 'bar')('foo') // return 'bar'
```

> it also support object and array recursively

## Related

* [Nullfined](https://github.com/rohmanhm/nullfined) - Convert any null value to undefined

## License
MIT © [Roman Masyhar](https://github.com/rohmanhm)


text:
//===----------------------------------------------------------------------===//
//
//                         Peloton
//
// limit_translator.cpp
//
// Identification: src/codegen/operator/limit_translator.cpp
//
// Copyright (c) 2015-2018, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#include "codegen/operator/limit_translator.h"

#include "codegen/compilation_context.h"
#include "codegen/lang/if.h"
#include "planner/limit_plan.h"

namespace peloton {
namespace codegen {

/**
 * We implement the LIMIT operator by maintaining a counter in the query state.
 * We increment the counter for each tuple we see, and we use the counter to
 * determine whether a given tuple should be pushed to a parent operator. We
 * push a tuple to the parent if it is in the valid counter range, that is:
 *
 *   offset < count <= offset + limit
 *
 * In non-parallel mode this counter maintenance is simple. In parallel-mode,
 * we need to worry about concurrent modification of the counter. We ensure
 * correctness by generating an atomic-read-modify-write addition.
 */

LimitTranslator::LimitTranslator(const planner::LimitPlan &plan,
                                 CompilationContext &context,
                                 Pipeline &pipeline)
    : OperatorTranslator(plan, context, pipeline) {
  PELOTON_ASSERT(plan.GetChildrenSize() == 1);
  context.Prepare(*plan.GetChild(0), pipeline);

  auto &codegen = GetCodeGen();
  auto &query_state = context.GetQueryState();
  limit_count_id_ =
      query_state.RegisterState("limitCount", codegen.Int64Type());
}

void LimitTranslator::InitializeQueryState() {
  auto &codegen = GetCodeGen();

  // Initialize the counter to 0
  auto *limit_ptr = LoadStatePtr(limit_count_id_);
  codegen->CreateStore(codegen.Const64(0), limit_ptr);
}

void LimitTranslator::Produce() const {
  GetCompilationContext().Produce(*GetPlan().GetChild(0));
}

void LimitTranslator::Consume(ConsumerContext &context,
                              RowBatch::Row &row) const {
  auto &codegen = GetCodeGen();

  // Get the pointer to the current count
  auto *limit_count_ptr = LoadStatePtr(limit_count_id_);

  llvm::Value *next_limit = nullptr;
  if (!context.GetPipeline().IsParallel()) {
    // Serial mode. Just add increment the count.
    next_limit = codegen->CreateLoad(limit_count_ptr);
    next_limit = codegen->CreateAdd(next_limit, codegen.Const64(1));
    codegen->CreateStore(next_limit, limit_count_ptr);
  } else {
    // Parallel mode. Atomically increment the count.
    next_limit = codegen->CreateAtomicRMW(
        llvm::AtomicRMWInst::BinOp::Add, limit_count_ptr, codegen.Const64(1),
        llvm::AtomicOrdering::SequentiallyConsistent);
  }

  // Pass the tuple only if in valid range
  auto &plan = GetPlanAs<planner::LimitPlan>();
  uint64_t offset = plan.GetOffset();
  uint64_t bound = offset + plan.GetLimit();

  // First, check if we're past the defined "offset"

  llvm::Value *past_offset =
      codegen->CreateICmpUGT(next_limit, codegen.Const64(offset));
  lang::If after_offset(codegen, past_offset, "pastOffset");
  {
    // Now, check if we've reached the limit
    llvm::Value *before_limit =
        codegen->CreateICmpULE(next_limit, codegen.Const64(bound));
    lang::If within_limit(codegen, before_limit, "beforeLimit", nullptr,
                          context.GetExitBlock());
    {
      // In window, send along
      context.Consume(row);
    }
    within_limit.EndIf();
  }
  after_offset.EndIf();
}

}  // namespace codegen
}  // namespace peloton