text:
module Booker
  module V4
    module Models
      class PreferredStaffGender < Gender; end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
$packageName = 'nsis.portable'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://sourceforge.net/projects/nsis/files/NSIS%203/3.02/nsis-3.02.zip/download'
$checksum = 'b63bf7cb1e2522754ccb5628e54277f553bc6810d6229d0fe7eb1d78b3457206'
$checksumType = 'sha256'

Install-ChocolateyZipPackage -PackageName "$packageName" `
                             -Url "$url" `
                             -UnzipLocation "$toolsDir" `
                             -Checksum "$checksum" `
                             -ChecksumType "$checksumType"


text:
<!DOCTYPE html>

    <title>report-cross-origin-no-cookies</title>


text:
package com.tws;

import com.ib.client.TagValue;

import java.util.Vector;

/**
 * Associated with EWrapper:reqContractDetails
 */

public class ContractDetails {

    public final int                           reqId          ;
    public final com.ib.client.ContractDetails contractDetails;

    public ContractDetails(int reqId, com.ib.client.ContractDetails contractDetails) {
        this.reqId           = reqId          ;
        this.contractDetails = contractDetails;
    }

    @Override
    public String toString() {
        String msg = "conid = "           + this.contractDetails.m_summary.m_conId        + "\n"
                   + "symbol = "          + this.contractDetails.m_summary.m_symbol       + "\n"
                   + "secType = "         + this.contractDetails.m_summary.m_secType      + "\n"
                   + "expiry = "          + this.contractDetails.m_summary.m_expiry       + "\n"
                   + "strike = "          + this.contractDetails.m_summary.m_strike       + "\n"
                   + "right = "           + this.contractDetails.m_summary.m_right        + "\n"
                   + "multiplier = "      + this.contractDetails.m_summary.m_multiplier   + "\n"
                   + "exchange = "        + this.contractDetails.m_summary.m_exchange     + "\n"
                   + "primaryExch = "     + this.contractDetails.m_summary.m_primaryExch  + "\n"
                   + "currency = "        + this.contractDetails.m_summary.m_currency     + "\n"
                   + "localSymbol = "     + this.contractDetails.m_summary.m_localSymbol  + "\n"
                   + "tradingClass = "    + this.contractDetails.m_summary.m_tradingClass + "\n"
                   + "marketName = "      + this.contractDetails.m_marketName             + "\n"
                   + "minTick = "         + this.contractDetails.m_minTick                + "\n"
                   + "price magnifier = " + this.contractDetails.m_priceMagnifier         + "\n"
                   + "orderTypes = "      + this.contractDetails.m_orderTypes             + "\n"
                   + "validExchanges = "  + this.contractDetails.m_validExchanges         + "\n"
                   + "underConId = "      + this.contractDetails.m_underConId             + "\n"
                   + "longName = "        + this.contractDetails.m_longName               + "\n"
                   + "contractMonth = "   + this.contractDetails.m_contractMonth          + "\n"
                   + "industry = "        + this.contractDetails.m_industry               + "\n"
                   + "category = "        + this.contractDetails.m_category               + "\n"
                   + "subcategory = "     + this.contractDetails.m_subcategory            + "\n"
                   + "timeZoneId = "      + this.contractDetails.m_timeZoneId             + "\n"
                   + "tradingHours = "    + this.contractDetails.m_tradingHours           + "\n"
                   + "liquidHours = "     + this.contractDetails.m_liquidHours            + "\n"
                   + "evRule = "          + this.contractDetails.m_evRule                 + "\n"
                   + "evMultiplier = "    + this.contractDetails.m_evMultiplier           + "\n";

        String sec = "secIdList={";
        if (contractDetails.m_secIdList != null) {
            Vector secIdList = contractDetails.m_secIdList;
            for (int i = 0; i < secIdList.size(); ++i) {
                TagValue param = (TagValue)secIdList.elementAt(i);
                if (i > 0) { sec += ","; }
                sec += param.m_tag + "=" + param.m_value;
            }
        }

        return msg+sec+"}\n";
    }
}


text:
(return 0 2>/dev/null) && sourced=1 || sourced=0
if [ $sourced -eq 0 ]; then
    echo "this script should not be run directly but through configure.sh in the kaldi_nl root directory">&2
fi

. contrib/radboud_shared/configure_download.sh

if [ ! -e models/Lang_OH ]; then
    echo "-----------------------------------------------------">&2
    echo "IMPORTANT NOTE: The radboud models for Dutch ASR that are installable through this Kaldi_NL distribution are licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license (4.0)">&2
    echo "-----------------------------------------------------">&2

    if [ ! -e kaldi_nl_model_radboud_OH.tar.gz ]; then
        wget https://applejack.science.ru.nl/downloads/kaldi_nl_radboud/kaldi_nl_model_radboud_OH.tar.gz || fatalerror "Unable to download asr_nl models from applejack.science.ru.nl!"
    fi
    tar -C models --strip-components 1 -xvzf kaldi_nl_model_radboud_OH.tar.gz || fatalerror "Failure during extraction of models"

    rm kaldi_nl_model_radboud_OH.tar.gz

    #correct absolute paths
    find "$modelpack" -name "*.conf" | xargs sed -i "s|=.*/Models|=$modelpack|g"
fi


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

<title>Track</title>
<meta name="date" content="2014-08-31">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.symboltable

Class Track

java.lang.Object

org.symboltable.Track

public class Track
extends java.lang.Object

Stations along a rail track in the Washington DC Metro.

Author:

shivam

Constructor Summary

Constructors

Constructor and Description

Track()

Default constructor.

Track(java.lang.String trackName)

Constructor to trackName.

Track(java.lang.String trackName,
     java.lang.String[] stationNames)

Constructor to trackName along with list of stations of that
 track.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
add(java.lang.String trackName)

Method to add station to track.

static void
main(java.lang.String[] args)

void
setName(java.lang.String trackName)

Method to set name of track.

java.lang.String
toString()

Method to convert node to a string

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

Track

public Track()

Default constructor.

Track

public Track(java.lang.String trackName)

Constructor to trackName.

Parameters:

trackName - Name of the track.

Track

public Track(java.lang.String trackName,
             java.lang.String[] stationNames)

Constructor to trackName along with list of stations of that
 track.

Parameters:

trackName - Name of the track.

stationNames - Name of stations of that track.

Method Detail

setName

public void setName(java.lang.String trackName)

Method to set name of track.

Parameters:

trackName - Name of the track to be set.

add

public void add(java.lang.String trackName)

Method to add station to track.

Parameters:

trackName - Name of the station to be added to the track.

toString

public java.lang.String toString()

Method to convert node to a string

Overrides:

toString in class java.lang.Object

Returns:

Node details in string format.

main

public static void main(java.lang.String[] args)

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
'use strict';
angular
    .module('app.core')
    .controller('stageCtrl', function($scope,$stateParams,letterSrvc) {
    	$scope.letter=letterSrvc.getLetter();
       //console.log(letter);
    });


text:
package de.dhbw_mannheim.cloudraid.core.impl;

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

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

import de.dhbw_mannheim.cloudraid.config.ICloudRAIDConfig;
import de.dhbw_mannheim.cloudraid.config.exceptions.ConfigException;
import de.dhbw_mannheim.cloudraid.config.exceptions.MissingConfigValueException;
import de.dhbw_mannheim.cloudraid.core.ICloudRAIDService;
import de.dhbw_mannheim.cloudraid.core.ICoreAccess;
import de.dhbw_mannheim.cloudraid.core.impl.jni.RaidAccessInterface;
import de.dhbw_mannheim.cloudraid.core.net.connector.IStorageConnector;

/**
 * @author Markus Holtermann
 *
 */
public class CloudRAIDService implements ICloudRAIDService {

	private ICloudRAIDConfig config = null;

	private IStorageConnector[] storageConnectors = { null, null, null };
	private String[] storageConnectorClassnames = { null, null, null };

	private String splitInputDir;

	private String mergeInputDir;

	private String mergeOutputDir;

	private String splitOutputDir;

	@Override
	public String getRAIDName() {
		return RaidAccessInterface.getName();
	}

	@Override
	public String getRAIDVendor() {
		return RaidAccessInterface.getVendor();
	}

	@Override
	public String getRAIDVersion() {
		return RaidAccessInterface.getVersion();
	}

	@Override
	public synchronized ICoreAccess getSlot() throws InstantiationException {
		return new CoreAccess();
	}

	@Override
	public IStorageConnector[] getStorageConnectors() {
		if (this.storageConnectors[0] == null
				|| this.storageConnectors[1] == null
				|| this.storageConnectors[2] == null) {
			throw new IllegalStateException(
					"At least one storage connector missing");
		}
		return this.storageConnectors;
	}

	private void initPaths() throws MissingConfigValueException {
		this.mergeInputDir = this.config.getString("merge.input.dir");
		this.mergeOutputDir = this.config.getString("merge.output.dir");
		this.splitInputDir = this.config.getString("split.input.dir");
		this.splitOutputDir = this.config.getString("split.output.dir");

		if (this.mergeInputDir == null || this.mergeOutputDir == null
				|| this.splitInputDir == null || this.splitOutputDir == null) {
			throw new MissingConfigValueException(
					"Missing split or merge directory definitions.");
		}

		new File(this.mergeInputDir).mkdirs();
		new File(this.mergeOutputDir).mkdirs();
		new File(this.splitInputDir).mkdirs();
		new File(this.splitOutputDir).mkdirs();
	}

	/**
	 * @param config
	 *            The running instance of the {@link ICloudRAIDConfig
	 *            configuration service}.
	 */
	protected synchronized void setConfig(ICloudRAIDConfig config) {
		System.out.println("CloudRAIDService: setConfig: begin");
		this.config = config;
		System.out.println("CloudRAIDService: setConfig: " + this.config);
		System.out.println("CloudRAIDService: setConfig: end");
	}

	/**
	 * This function is called upon shutdown of this service. The
	 * {@link ICloudRAIDConfig} will be saved.
	 */
	protected synchronized void shutdown() {
		System.out.println("CloudRAIDService: shutdown: begin");
		this.config.save();
		System.out.println("CloudRAIDService: shutdown: end");
	}

	/**
	 * During the {@link #startup(BundleContext) startup} this service reads the
	 * three {@link IStorageConnector cloud storage connectors} to be used from
	 * the configuration. The regarding bundles containing these classes are
	 * loaded and hence their services registered.
	 *
	 * @param context
	 *            The {@link BundleContext} for this bundle
	 * @throws ConfigException
	 *             Thrown, if a configuration value is invalid
	 * @throws InstantiationException
	 *             Thrown, if a {@link IStorageConnector} cannot be created /
	 *             initialized.
	 */
	protected synchronized void startup(BundleContext context)
			throws ConfigException, InstantiationException {
		System.out.println("CloudRAIDService: startup: begin");

		initPaths();

		String classname = null;
		for (int i = 0; i < 3; i++) {
			classname = this.config.getString(String.format("connector.%d", i));
			if (classname == null || classname.isEmpty()) {
			} else {
				this.storageConnectorClassnames[i] = classname;
			}
		}

		int connectedServices = 0;

		System.out
				.println("Trying to resolve and start the required bundles and services ...");
		/*
		 * First we iterate over all installed bundles. Second we iterate over
		 * the IStorageConnectors defined in the configuration. We try to load
		 * the given full qualified class name from the current bundle. On
		 * success, the bundle gets started, which will register a service
		 * providing an IStorageConnectors implementation. If the service can
		 * then accessed, we continue with the next required connector. Finally,
		 * the array storageConnectors contains the references to the 3 required
		 * services.
		 */
		Bundle[] bundles = context.getBundles();
		for (Bundle b : bundles) {
			for (int i = 0; i < 3 && connectedServices < 3; i++) {

				try {
					Class<?> klass = b
							.loadClass(this.storageConnectorClassnames[i]);

					IStorageConnector connector = (IStorageConnector) klass
							.newInstance();
					this.storageConnectors[i] = connector;
					connectedServices++;

				} catch (ClassNotFoundException ignore) {
				} catch (Exception e) {
					System.err.println("Cannot start bundle " + b);
					e.printStackTrace();
				}

			}
			if (connectedServices == 3) {
				break;
			}
		}
		if (connectedServices == 3) {
			System.out
					.println("Resolved and started all required cloud connector bundles.");
			System.out.println(Arrays.toString(this.storageConnectors));
		} else {
			System.err
					.println("Couldn't resolve or start all required bundles!");
			return;
		}

		for (int i = 0; i < 3; i++) {
			this.storageConnectors[i].create(i, this.config);
			this.storageConnectors[i].connect();
		}

		System.out.println("CloudRAIDService: startup: end");
	}

	/**
	 * @param config
	 *            Reference to the still existing {@link ICloudRAIDConfig
	 *            configuration} instance
	 */
	protected synchronized void unsetConfig(ICloudRAIDConfig config) {
		System.out.println("CloudRAIDService: unsetConfig: begin");
		System.out.println("CloudRAIDService: unsetConfig: " + config);
		this.config = null;
		System.out.println("CloudRAIDService: unsetConfig: " + this.config);
		System.out.println("CloudRAIDService: unsetConfig: end");
	}

}


text:
'use strict';

var models = require('./index');

/**
 * @class
 * Initializes a new instance of the Bar class.
 * @constructor
 * The URIs that are used to perform a retrieval of a public blob, queue or
 * table object.
 * @member {object} [recursivePoint] Recursive Endpoints
 *
 * @member {string} [recursivePoint.blob] Gets the blob endpoint.
 *
 * @member {string} [recursivePoint.queue] Gets the queue endpoint.
 *
 * @member {string} [recursivePoint.table] Gets the table endpoint.
 *
 * @member {object} [recursivePoint.dummyEndPoint] Dummy EndPoint
 *
 * @member {object} [recursivePoint.fooPoint] Foo point
 *
 * @member {object} [recursivePoint.fooPoint.barPoint] Bar point
 *
 */
function Bar(parameters) {
  if (parameters !== null && parameters !== undefined) {
    if (parameters.recursivePoint) {
      this.recursivePoint = new models['Endpoints'](parameters.recursivePoint);
    }
  }
}

/**
 * Validate the payload against the Bar schema
 *
 * @param {JSON} payload
 *
 */
Bar.prototype.serialize = function () {
  var payload = {};
  if (this['recursivePoint']) {
    payload['RecursivePoint'] = this['recursivePoint'].serialize();
  }

  return payload;
};

/**
 * Deserialize the instance to Bar schema
 *
 * @param {JSON} instance
 *
 */
Bar.prototype.deserialize = function (instance) {
  if (instance) {
    if (instance['RecursivePoint']) {
      this['recursivePoint'] = new models['Endpoints']().deserialize(instance['RecursivePoint']);
    }
  }

  return this;
};

module.exports = Bar;


text:
/*global QUnit, sinon*/
jQuery.sap.require("sap.ui.fl.Cache");
jQuery.sap.require("sap.ui.fl.LrepConnector");
jQuery.sap.require("sap.ui.fl.Utils");

(function(QUnit, sinon, Cache, LrepConnector, Utils) {
	"use strict";
	sinon.config.useFakeTimers = false;

	function createLoadChangesResponse() {
		return Promise.resolve({
			changes: {
				changes: [{something: "1"}],
				settings: {switchedOnBusinessFunctions: ["bFunction1", "bFunction2"]}
			}
		});
	}

	function createLoadChangesErrorResponse() {
		return Promise.reject({
			error: 'error'
		});
	}

	QUnit.module("sap.ui.fl.Cache", {
		beforeEach: function() {
			Cache._entries = {};
			Cache._switches = {};
			Cache.setActive(true);
			this.oLrepConnector = LrepConnector.createConnector();
		},
		afterEach: function() {
			Cache._entries = {};
			Cache._switches = {};
		}
	});

	QUnit.test('getSwitches shall return the list of switched-on business functions', function(assert) {
		var that = this;
		var sComponentName = "test";

		sinon.stub(this.oLrepConnector, 'loadChanges', createLoadChangesResponse);

		return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName}).then(function() {
			var mSwitches = Cache.getSwitches();
			var mSwitchesExp = {"bFunction1": true, "bFunction2": true};
			assert.deepEqual(mSwitchesExp, mSwitches);
		});
	});

	QUnit.test('isActive should ensure, that calls for same component are done only once', function(assert) {
		var that = this;
		var oChangesFromFirstCall;
		var sComponentName = "test";

		sinon.stub(this.oLrepConnector, 'loadChanges', createLoadChangesResponse);

		return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName}).then(function(firstChanges) {
			oChangesFromFirstCall = firstChanges;
			return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName});
		}).then(function(secondChanges) {
			assert.strictEqual(oChangesFromFirstCall, secondChanges);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});
	});

	QUnit.test('if NOT isActive, all calls for same component have their own call', function(assert) {
		var that = this;
		var oChangesFromFirstCall;
		var sComponentName = "test";

		sinon.stub(this.oLrepConnector, 'loadChanges', createLoadChangesResponse);

		Cache.setActive(false);

		return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName}).then(function(firstChanges) {
			oChangesFromFirstCall = firstChanges;
			return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName});
		}).then(function(secondChanges) {
			assert.notStrictEqual(oChangesFromFirstCall, secondChanges);
			sinon.assert.calledTwice(that.oLrepConnector.loadChanges);
		});
	});

	QUnit.test('getEntry shall create an empty entry if it is not initiated', function(assert) {
		var oInitEntry = {
			file: {
				changes: {
					changes: [],
					contexts: []
				}
			}
		};
		assert.deepEqual(Cache.getEntries(), {});
		var oEntry = Cache.getEntry("test", "1.2.3");
		assert.deepEqual(oEntry, oInitEntry);
		assert.deepEqual(Cache.getEntries(), {
			"test" : {
				"1.2.3": oInitEntry
			}
		});
	});

	QUnit.test('clearEntries replaces the whole cache content and clearEntry replace a single cache entry', function(assert) {
		var oEntry1 = {
			mockChanges1: {}
		};
		var oEntry2 = {
			mockChanges1: {}
		};
		Cache._entries = {
			"testComponent1": {
				"1.2.3": oEntry1
			},
			"testComponent2": {
				"1.2.3": oEntry2
			}
		};
		Cache.clearEntry("testComponent1", "1.2.3");
		assert.deepEqual(Cache.getEntry("testComponent1", "1.2.3"), {});
		Cache.clearEntries({});
		assert.deepEqual(Cache.getEntries(), {});
	});

	QUnit.test('deleteEntry deletes a single cache entry', function(assert) {
		var oEntry1 = {
			mockChanges1: {}
		};
		Cache._entries = {
			"testComponent1": {
				"1.2.3": oEntry1
			}
		};
		Cache._deleteEntry("testComponent1", "4.5.6");
		assert.deepEqual(Cache.getEntry("testComponent1", "1.2.3"), oEntry1);
		Cache._deleteEntry("testComponent1", "1.2.3");
		assert.equal(Cache._entries["testComponent1"], undefined);
	});

	QUnit.test('if error occours, subsequent calls in their own execution path should get the chance to make a new request', function(assert) {
		var that = this;
		var oErrorFromFirstCall;
		var sComponentName = "test";

		sinon.stub(this.oLrepConnector, 'loadChanges', createLoadChangesErrorResponse);

		return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName}).then(null, function(firstError) {
			oErrorFromFirstCall = firstError;
			return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName});
		}).then(null, function(secondError) {
			assert.notStrictEqual(oErrorFromFirstCall, secondError);
			sinon.assert.calledTwice(that.oLrepConnector.loadChanges);
		});
	});

	QUnit.test('setActive should enable and disable the cache globally', function(assert) {
		assert.strictEqual(Cache.isActive(), true);
		Cache.setActive(false);
		assert.strictEqual(Cache.isActive(), false);
		Cache.setActive(true);
		assert.strictEqual(Cache.isActive(), true);
	});

	QUnit.test('addChange', function(assert) {
		var that = this;
		var sComponentName = "test";
		var oEntry = {
			changes: {
				changes: [
					{something: "1"}
				]
			}
		};
		var oAddedEntry = {something: "2"};
		var oChangesFromFirstCall;

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, {name: sComponentName}).then(function(firstChanges) {
			oChangesFromFirstCall = firstChanges;
			Cache.addChange({name: sComponentName}, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName});
		}).then(function(changes) {
			assert.strictEqual(oChangesFromFirstCall, changes);
			assert.strictEqual(changes.changes.changes.length, 2);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});

	});

	QUnit.test('addChange with a specific application version', function(assert) {
		var that = this;
		var oComponent = {
			name : "testComponent",
			appVersion : "1.2.3"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1"}
				]
			}
		};
		var oAddedEntry = {something: "2"};
		var oChangesFromFirstCall;

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent).then(function(firstChanges) {
			oChangesFromFirstCall = firstChanges;
			Cache.addChange(oComponent, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, oComponent);
		}).then(function(changes) {
			assert.strictEqual(oChangesFromFirstCall, changes);
			assert.strictEqual(changes.changes.changes.length, 2);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});

	});

	QUnit.test('updateChange', function(assert) {
		var that = this;
		var sComponentName = "test";
		var oEntry = {
			changes: {
				changes: [
					{something: "1", fileName: "A"}
				]
			}
		};
		var oAddedEntry = {something: "2", fileName: "A"};

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, {name: sComponentName}).then(function() {
			Cache.updateChange({name: sComponentName}, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName});
		}).then(function(changes) {
			assert.strictEqual(changes.changes.changes.length, 1);
			assert.strictEqual(changes.changes.changes[0].something, "2");
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});
	});

	QUnit.test('updateChange with a specific application version', function(assert) {
		var that = this;
		var oComponent = {
			name : "testComponent",
			appVersion : "1.2.3"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1", fileName: "A"}
				]
			}
		};
		var oAddedEntry = {something: "2", fileName: "A"};

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent).then(function() {
			Cache.updateChange(oComponent, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, oComponent);
		}).then(function(changes) {
			assert.strictEqual(changes.changes.changes.length, 1);
			assert.strictEqual(changes.changes.changes[0].something, "2");
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});
	});

	QUnit.test('deleteChange', function(assert) {
		var that = this;
		var sComponentName = "test";
		var oEntry = {
			changes: {
				changes: [
					{something: "1", fileName: "A"}
				]
			}
		};

		var oAddedEntry = {something: "1", fileName: "A"};

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, {name: sComponentName}).then(function() {
			Cache.deleteChange({name: sComponentName}, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, {name: sComponentName});
		}).then(function(changes) {
			assert.strictEqual(changes.changes.changes.length, 0);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});

	});

	QUnit.test('deleteChange with a specific version', function(assert) {
		var that = this;
		var oComponent = {
			name : "testComponent",
			appVersion : "1.2.3"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1", fileName: "A"}
				]
			}
		};

		var oAddedEntry = {something: "1", fileName: "A"};

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent).then(function() {
			Cache.deleteChange(oComponent, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, oComponent);
		}).then(function(changes) {
			assert.strictEqual(changes.changes.changes.length, 0);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
		});
	});

	QUnit.test("getChangesFillingCache returns an empty list of changes without sending an request " +
			"if the passed parameter contain already the information that there are no changes", function(assert) {
		var sComponentName = "smartFilterBar.Component";
		var mPropertyBag = {
			cacheKey: "<NO CHANGES>"
		};

		return Cache.getChangesFillingCache(this.oLrepConnector, {name: sComponentName}, mPropertyBag).then(function(oResult) {
			assert.ok(Array.isArray(oResult.changes.changes), "an array of changes was returned");
			assert.ok(Array.isArray(oResult.changes.contexts), "an array of contexts was returned");
			assert.equal(oResult.changes.changes.length, 0, "but no change is present");
			assert.equal(oResult.changes.contexts.length, 0, "but no context is present");
			assert.equal(oResult.componentClassName, sComponentName, "the component class name was returned correctly");
		});
	});

	QUnit.module("sap.ui.fl.Cache when cache of other application versions already exist", {
		beforeEach: function() {
			Cache._entries = {
				"testComponent" : {
					"DEFAULT_APP_VERSION" : {
						file : "defaultContent"
					},
					"oldVersion" : {
						file : "oldContent"
					}
				}
			};
			Cache._switches = {};
			Cache.setActive(true);
			this.oLrepConnector = LrepConnector.createConnector();
		}
	});

	QUnit.test('if cache key equals NO CHANGES, a cache entry is available and no change information is passed by cache key', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var sAppVersion = "oldVersion";
		var oComponent = {
			name : sTestComponentName,
			appVersion : sAppVersion
		};
		var mPropertyBag = {
			cacheKey: "<NO CHANGES>"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1"}
				]
			}
		};
		Cache._entries[sTestComponentName][sAppVersion].promise = Promise.resolve(oEntry);

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent, mPropertyBag).then(function(oResult) {
			sinon.assert.notCalled(that.oLrepConnector.loadChanges);
			assert.deepEqual(oResult, oEntry, "then the available cache entry is returned");
		});
	});

	QUnit.test('if cache key equals NO CHANGES, no cache entry is available and no change information is passed by cache key', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var sAppVersion = "oldVersion";
		var oComponent = {
			name : sTestComponentName,
			appVersion : sAppVersion
		};
		var mPropertyBag = {
			cacheKey: "<NO CHANGES>"
		};
		var oEntry = {
			changes: {
				changes: []
			}
		};
		Cache._entries[sTestComponentName][sAppVersion].promise = Promise.resolve(oEntry);

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent, mPropertyBag).then(function(oResult) {
			sinon.assert.notCalled(that.oLrepConnector.loadChanges);
			assert.deepEqual(oResult, oEntry, "then an empty array is returned");
		});
	});

	QUnit.test('if cache key not equals NO CHANGES, a cache entry is available and no change information is passed by cache key', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var sAppVersion = "oldVersion";
		var oComponent = {
			name : sTestComponentName,
			appVersion : sAppVersion
		};
		var mPropertyBag = {
			cacheKey: "TEST"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1"}
				]
			}
		};
		Cache._entries[sTestComponentName][sAppVersion].promise = Promise.resolve(oEntry);

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent, mPropertyBag).then(function(oResult) {
			sinon.assert.notCalled(that.oLrepConnector.loadChanges);
			assert.deepEqual(oResult, oEntry, "then the available cache entry is returned");
		});
	});

	QUnit.test('if cache key not equals NO CHANGES, a cache entry is not available and no change information is passed by cache key', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var sAppVersion = "oldVersion";
		var oComponent = {
			name : sTestComponentName,
			appVersion : sAppVersion
		};
		var mPropertyBag = {
			cacheKey: "TEST"
		};
		var oChange = {
				changes: {
					changes: [
						{something: "1"}
					]
				}
			};
		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oChange));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent, mPropertyBag).then(function(oResult) {
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
			assert.deepEqual(oResult, oChange, "then a backend request load changes should be executed");
		});
	});

	QUnit.test('addChange with a new application version', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var oComponent = {
			name : sTestComponentName,
			appVersion : "newVersion"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1"}
				]
			}
		};
		var oDefaultEntry = Cache._entries[sTestComponentName][Utils.DEFAULT_APP_VERSION];
		var oOldEntry = Cache._entries[sTestComponentName]["oldVersion"];
		var oAddedEntry = {something: "2"};
		var oChangesFromFirstCall;

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent).then(function(firstChanges) {
			oChangesFromFirstCall = firstChanges;
			Cache.addChange(oComponent, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, oComponent);
		}).then(function(changes) {
			assert.strictEqual(oChangesFromFirstCall, changes);
			assert.strictEqual(changes.changes.changes.length, 2);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
			assert.strictEqual(Cache._entries[sTestComponentName][Utils.DEFAULT_APP_VERSION], oDefaultEntry, "cache of default version was not changed");
			assert.strictEqual(Cache._entries[sTestComponentName]["oldVersion"], oOldEntry, "cache of old version was not changed");
		});
	});

	QUnit.test('updateChange with a specific application version', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var oComponent = {
			name : sTestComponentName,
			appVersion : "newVersion"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1", fileName: "A"}
				]
			}
		};
		var oDefaultEntry = Cache._entries[sTestComponentName][Utils.DEFAULT_APP_VERSION];
		var oOldEntry = Cache._entries[sTestComponentName]["oldVersion"];
		var oAddedEntry = {something: "2", fileName: "A"};

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent).then(function() {
			Cache.updateChange(oComponent, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, oComponent);
		}).then(function(changes) {
			assert.strictEqual(changes.changes.changes.length, 1);
			assert.strictEqual(changes.changes.changes[0].something, "2");
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
			assert.strictEqual(Cache._entries[sTestComponentName][Utils.DEFAULT_APP_VERSION], oDefaultEntry, "cache of default version was not changed");
			assert.strictEqual(Cache._entries[sTestComponentName]["oldVersion"], oOldEntry, "cache of old version was not changed");
		});
	});

	QUnit.test('deleteChange with a specific version', function(assert) {
		var that = this;
		var sTestComponentName = "testComponent";
		var oComponent = {
			name : sTestComponentName,
			appVersion : "newVersion"
		};
		var oEntry = {
			changes: {
				changes: [
					{something: "1", fileName: "A"}
				]
			}
		};
		var oDefaultEntry = Cache._entries[sTestComponentName][Utils.DEFAULT_APP_VERSION];
		var oOldEntry = Cache._entries[sTestComponentName]["oldVersion"];
		var oAddedEntry = {something: "1", fileName: "A"};

		sinon.stub(this.oLrepConnector, 'loadChanges').returns(Promise.resolve(oEntry));

		return Cache.getChangesFillingCache(this.oLrepConnector, oComponent).then(function() {
			Cache.deleteChange(oComponent, oAddedEntry);
		}).then(function() {
			return Cache.getChangesFillingCache(that.oLrepConnector, oComponent);
		}).then(function(changes) {
			assert.strictEqual(changes.changes.changes.length, 0);
			sinon.assert.calledOnce(that.oLrepConnector.loadChanges);
			assert.strictEqual(Cache._entries[sTestComponentName][Utils.DEFAULT_APP_VERSION], oDefaultEntry, "cache of default version was not changed");
			assert.strictEqual(Cache._entries[sTestComponentName]["oldVersion"], oOldEntry, "cache of old version was not changed");
		});
	});
}(QUnit, sinon, sap.ui.fl.Cache, sap.ui.fl.LrepConnector, sap.ui.fl.Utils));


text:
page_type: sample
languages:
  - java
products:
  - azure
  - azure-tables
urlFragment: tables-samples
---

# Azure Tables client library samples for Java

Azure Tables samples are a set of self-contained Java programs that demonstrate interacting with Azure Tables
using the client library. Each sample focuses on a specific scenario and can be executed independently.

## Key concepts
Key concepts are explained in detail [here][sdk_readme_key_concepts].

## Getting started
Please refer to the [Getting Started][sdk_readme_getting_started] section.

### Obtaining a Tables account connection string

Most of the samples authorize with Tables using a connection string generated for that Storage or Cosmos DB Tables API
account. You can obtain your connection string from the Azure Portal (click **Access keys** under **Settings** in the
Portal Storage account blade, or **Connection String** under **Settings** in the Portal Cosmos DB account blade) or
using the Azure CLI:

```bash
# Storage account
az storage account show-connection-string \
    --resource-group <resource-group-name> \
    --name <storage-account-name>

# Cosmos DB Table API account
az cosmosdb list-connection-strings \
    --resource-group <resource-group-name> \
    --name <cosmosdb-account-name>
```

## Examples

- [Interact with the Tables service using the async clients][sample_async_client_code_snippets]
- [Interact with the Tables service using the synchronous clients][sample_sync_client_code_snippets]

## Troubleshooting
See [Troubleshooting][sdk_readme_troubleshooting].

## Next steps
See [Next steps][sdk_readme_next_steps].

## Contributing
This project welcomes contributions and suggestions. See [Contributing][sdk_readme_contributing] for guidelines.

<!-- Links -->
[sdk_readme_key_concepts]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/README.md#key-concepts
[sdk_readme_getting_started]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/README.md#getting-started
[sdk_readme_troubleshooting]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/README.md#troubleshooting
[sdk_readme_next_steps]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/README.md#next-steps
[sdk_readme_contributing]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/README.md#contributing
[sample_async_client_code_snippets]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/src/samples/java/TableServiceAsyncClientCodeSnippets.java
[sample_sync_client_code_snippets]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/src/samples/java/TableServiceClientCodeSnippets.java

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%tables%2Fazure-data-tables%2Fsrc%2Fsamples%2README.png)


text:
using Genus.Migrator.Model.Internal;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;

namespace Genus.Migrator.Model.Builder
{
    public class FieldBuilder
    {
        private readonly TableBuilder _entityBuilder;
        public FieldBuilder(TableBuilder entityBuilder)
        {
            if(entityBuilder == null)
                throw new ArgumentNullException(nameof(entityBuilder));
            _entityBuilder = entityBuilder;
        }

        protected string DbName { get; private set; }

        protected DbType DataType { get; private set; }

        protected bool IsIdentity { get; private set; }

        protected int Length { get; private set; }

        protected bool IsNullable { get; private set; }

        protected Dictionary<ProviderName, string> Collation { get; } = new Dictionary<ProviderName, string>();
        protected Dictionary<ProviderName, string> Default { get; } = new Dictionary<ProviderName, string>();
        protected List<IAssociation> ForeignKeys { get; } = new List<IAssociation>();

        public FieldBuilder HasName(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentException("Name is empty", nameof(name));
            DbName = name;
            return this;
        }

        public FieldBuilder HasType(DbType type, int length=-1)
        {
            DataType = type;
            Length = length;
            return this;
        }

        public FieldBuilder AsIdentity()
        {
            IsIdentity = true;
            IsNullable = false;
            return this;
        }

        public FieldBuilder AsNullable()
        {
            IsNullable = true;
            IsIdentity = false;
            return this;
        }

        public FieldBuilder IsPrimaryKey()
        {
            _entityBuilder.HasKey(this);
            return this;
        }

        public FieldBuilder HasCollation(ProviderName provider, string collation)
        {
            if (Collation.ContainsKey(provider))
                Collation[provider] = collation;
            else
                Collation.Add(provider, collation);
            return this;
        }

        public FieldBuilder HasDefault(ProviderName provider, string @default)
        {
            if (Default.ContainsKey(provider))
                Default[provider] = @default;
            else
                Default.Add(provider, @default);
            return this;
        }

        public void Validate() { }

        internal IField Build(string name, ITable table)
        {
            var res = new Field(
                name,
                table,
                DataType,
                Length,
                new ReadOnlyDictionary<ProviderName, string>(Collation),
                new ReadOnlyDictionary<ProviderName, string>(Default)
                );
            if (!string.IsNullOrWhiteSpace(DbName))
                res.DbName = DbName;

            res.IsIdentity = IsIdentity == true;
            res.IsNullable = IsNullable == true;

            return res;
        }
    }
}


text:
package com.hazelcast.replicatedmap;

import com.hazelcast.config.Config;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.nio.serialization.DataSerializableFactory;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.replicatedmap.impl.ReplicatedMapService;
import com.hazelcast.replicatedmap.impl.operation.PutOperation;
import com.hazelcast.replicatedmap.impl.operation.ReplicateUpdateOperation;
import com.hazelcast.replicatedmap.impl.operation.ReplicatedMapDataSerializerHook;
import com.hazelcast.replicatedmap.impl.operation.VersionResponsePair;
import com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore;
import com.hazelcast.spi.InternalCompletableFuture;
import com.hazelcast.spi.NodeEngine;
import com.hazelcast.spi.exception.RetryableHazelcastException;
import com.hazelcast.spi.impl.NodeEngineImpl;
import com.hazelcast.test.AssertTask;
import com.hazelcast.test.HazelcastSerialClassRunner;
import com.hazelcast.test.HazelcastTestSupport;
import com.hazelcast.test.TestHazelcastInstanceFactory;
import com.hazelcast.test.annotation.SlowTest;
import org.junit.After;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Random;

import static com.hazelcast.util.Preconditions.isNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

@RunWith(HazelcastSerialClassRunner.class)
@Category(SlowTest.class)
public class ReplicatedMapReorderedReplicationTest extends HazelcastTestSupport {

    // if data serializable factory of ReplicatedMapDataSerializerHook is replaced by updateFactory()
    // during a test, this field stores its original value to be restored on test tear down
    private DataSerializableFactory replicatedMapDataSerializableFactory;
    private Field field;

    @After
    public void tearDown() throws Exception {
        // if updateFactory() has been executed, field & replicatedMapDataSerializableFactory are populated
        if (replicatedMapDataSerializableFactory != null && field != null) {
            // restore original value of ReplicatedMapDataSerializerHook.FACTORY
            field.set(null, replicatedMapDataSerializableFactory);
        }
    }

    @Test
    public void testNonConvergingReplicatedMaps() throws Exception {
        final int nodeCount = 4;
        final int keyCount = 10000;
        final int threadCount = 2;

        updateFactory();

        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory();
        final Config config = new Config();
        final HazelcastInstance[] instances = factory
                .newInstances(config, nodeCount);

        warmUpPartitions(instances);

        final int partitionId = randomPartitionOwnedBy(instances[0]).getPartitionId();

        final String mapName = randomMapName();
        final NodeEngineImpl nodeEngine = getNodeEngineImpl(instances[0]);

        final Thread[] threads = new Thread[threadCount];
        for (int i = 0; i < threadCount; i++) {
            final int startIndex = i;
            threads[i] = new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int j = startIndex; j < keyCount; j += threadCount) {
                        put(nodeEngine, mapName, partitionId, j, j);
                    }
                }
            });
        }

        for (Thread thread : threads) {
            thread.start();
        }

        for (Thread thread : threads) {
            thread.join();
        }

        final ReplicatedRecordStore[] stores = new ReplicatedRecordStore[nodeCount];
        for (int i = 0; i < nodeCount; i++) {
            ReplicatedMapService service = getNodeEngineImpl(instances[i]).getService(ReplicatedMapService.SERVICE_NAME);
            service.triggerAntiEntropy();
            stores[i] = service.getReplicatedRecordStore(mapName, false, partitionId);
        }

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                long version = stores[0].getVersion();

                for (ReplicatedRecordStore store : stores) {
                    assertEquals(version, store.getVersion());
                    assertFalse(store.isStale(version));
                }
            }
        });

        for (int i = 0; i < keyCount; i++) {
            for (ReplicatedRecordStore store : stores) {
                assertTrue(store.containsKey(i));
            }
        }
    }

    private <K, V> V put(final NodeEngine nodeEngine, final String mapName, final int partitionId, K key, V value) {
        isNotNull(key, "key must not be null!");
        isNotNull(value, "value must not be null!");
        Data dataKey = nodeEngine.toData(key);
        Data dataValue = nodeEngine.toData(value);

        PutOperation putOperation = new PutOperation(mapName, dataKey, dataValue);
        InternalCompletableFuture<Object> future = nodeEngine.getOperationService()
                .invokeOnPartition(ReplicatedMapService.SERVICE_NAME, putOperation,
                        partitionId);
        VersionResponsePair result = (VersionResponsePair) future.join();
        return nodeEngine.toObject(result.getResponse());
    }

    private void updateFactory() throws Exception {
        field = ReplicatedMapDataSerializerHook.class.getDeclaredField("FACTORY");

        // remove final modifier from field
        Field modifiersField = Field.class.getDeclaredField("modifiers");
        modifiersField.setAccessible(true);
        modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

        field.setAccessible(true);
        final DataSerializableFactory factory = (DataSerializableFactory) field.get(null);
        replicatedMapDataSerializableFactory = factory;
        field.set(null, new TestReplicatedMapDataSerializerFactory(factory));
    }

    private static class TestReplicatedMapDataSerializerFactory implements DataSerializableFactory {

        private final DataSerializableFactory factory;

        TestReplicatedMapDataSerializerFactory(DataSerializableFactory factory) {
            this.factory = factory;
        }

        @Override
        public IdentifiedDataSerializable create(int typeId) {
            if (typeId == ReplicatedMapDataSerializerHook.REPLICATE_UPDATE) {
                return new RetriedReplicateUpdateOperation();
            }
            return factory.create(typeId);
        }
    }

    private static class RetriedReplicateUpdateOperation extends ReplicateUpdateOperation {

        private final Random random = new Random();

        @Override
        public void run() throws Exception {
            if (random.nextInt(10) < 2) {
                throw new RetryableHazelcastException();
            }
            super.run();
        }
    }
}


text:
layout: post
title:  "Toque da Idiotice"
date:   2018-01-01
source: Módulo Básico 206, Módulo Básico Edição Revisada 216.
tags: [nenhum, bardo]
---

**arcana 2 (encantamento)**

**Alcance**: toque

**Teste de Resistência**: nenhum.

**Duração**: 10 minutos

**Alvo**: 1 criatura viva

**Tempo de Execução**: ação padrão

Faça um ataque de toque desarmado.
Se acertar, o alvo sofre uma penalidade de 1d6 na Inteligência, Sabedoria e Carisma.


text:
'use strict';

var Aggregator = require('../aggregator'),
    util = require('../../util/yslowUtil');

module.exports = new Aggregator('cssWeightPerPage', 'CSS File Weight Per Page',
  'Do not download large front-end CSS framework when you only use small parts of it.',
  'pagemetric', 'bytes', 2,
  function(pageData) {
    if (pageData.yslow) {
      // there's a bug in YSlow that calculates the size wrong
      // so it is better to get it per type
      // also YSlow/PhantomJs don't know about compressed size
      this.stats.push(util.getSize(pageData.yslow.comps, 'css'));
    }
  });


text:
package org.ubimon.server.model;

import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;

import org.ubimon.server.ResourceDatabase;

public class UbimonData {
	public static final Dimension refResolution = new Dimension(683, 384);
	public static final float refFontSize = 6;

	private String name;
	private BufferedImage sprite;
	private Ubimon.Type[] types;

	private UbimonData(String name, String icon, Ubimon.Type[] types) {
		this.name = name;
		this.sprite = ResourceDatabase.loadImage(icon);
		this.types = types;
	}

	public static UbimonData byName(String name) {
		return database.get(name);
	}

	public String getName() {
		return name;
	}

	public BufferedImage getSprite() {
		return sprite;
	}

	public Ubimon.Type[] getTypes() {
		return types;
	}

	private static final Map<String, UbimonData> database;
	static {
		database = new HashMap<String, UbimonData>();
		UbimonData data;
		data = new UbimonData("pikachu", "eletric.png", new Ubimon.Type[] { Ubimon.Type.ELETRIC });
		database.put(data.getName(), data);
		data = new UbimonData("vulpix", "fire.png", new Ubimon.Type[] { Ubimon.Type.FIRE });
		database.put(data.getName(), data);
		data = new UbimonData("pidgey", "flying.png", new Ubimon.Type[] { Ubimon.Type.FLYING });
		database.put(data.getName(), data);
		data = new UbimonData("bellsprout", "grass.png", new Ubimon.Type[] { Ubimon.Type.GRASS });
		database.put(data.getName(), data);
		data = new UbimonData("poliwag", "water.png", new Ubimon.Type[] { Ubimon.Type.WATER });
		database.put(data.getName(), data);
	}
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  <title>Paper Plane</title>

  <link href="./Paper Plane_files/icon" rel="stylesheet">
  <link href="./Paper Plane_files/materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
  <link href="./Paper Plane_files/style.css" type="text/css" rel="stylesheet" media="screen,projection">

        How to Craft a Paper Plane

Home

Video

Written Instructions

Home

Video

Written Instructions

        menu

Video Instructions

The video below will step you through the creation of a paper airplane. Feel free to follow along and rewatch the video as often as you'd like.

            <video class="responsive-video" controls="">
              <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4">
            </video>

Computer Cuties

We are a team of college students working on this project like it's our full time job. We hope this website has helped you craft the best paper airplane of your life.

Computer Cuties Team

Michael Snook

Zach Miller

Thomas Moll

Gabby Ortman

      Made by Computer Cuties with ♥.


text:
<?php

namespace Meteor\Configuration\ServiceContainer;

use Meteor\ServiceContainer\ExtensionTestCase;

class ConfigurationExtensionTest extends ExtensionTestCase
{
    public function testServicesCanBeInstantiated()
    {
        $container = $this->loadContainer([]);

        foreach ($this->getServiceIds() as $serviceId) {
            $container->get($serviceId);
        }
    }

    private function getServiceIds()
    {
        return [
            ConfigurationExtension::SERVICE_WRITER,
        ];
    }
}


text:
long long GetNumPlayers() {
  return 1LL;
}

long long GetSubmission(long long playernum) {
  return 1000000000000000000LL;
}


text:
<link rel="stylesheet" href="370525-style.css"/>

rowspan=2 on the cell with the percent-height div,
with specified height on a sibling

     height=75% / ignored

    blah

    height=200px.

   2nd row, 1st column


text:
#include <QObject>
#include "z3drendererbase.h"

class Z3DTriangleList;

class Z3DPrimitiveRenderer : public QObject
{
  Q_OBJECT

  friend class Z3DRendererBase;
public:
  explicit Z3DPrimitiveRenderer(QObject *parent);
  virtual ~Z3DPrimitiveRenderer();
  inline virtual QString getClassName() const {return metaObject()->className();}

  // for opengl mode only, if set, display list will be build in opengl mode.
  // for large amount of objects, display list can render faster but it is expensive to build.
  // not necessary if number of objects is small (can be rendered in a few opengl calls)
  // default is false, subclass should call this function if needed
  void setUseDisplayList(bool v) { m_useDisplayList = v; }
  // If set, lighting will be enabled.
  // default is false, subclass should call this function if needed
  void setNeedLighting(bool v) { m_needLighting = v; }

  //sometimes z scale transfrom is not appropriate, for example: bound box. we need to disable it and
  // precalc the correct location. Default is true
  void setRespectRendererBaseCoordScales(bool v) {m_respectRendererBaseCoordScale = v;}

  inline void setZScale(float s) { m_rendererBase->setZScale(s); }

  Z3DRendererBase* getRendererBase() { return m_rendererBase; }

  inline glm::vec3 getCoordScales() const
  {
    if (m_respectRendererBaseCoordScale)
      return m_rendererBase->getCoordScales();
    else
      return glm::vec3(1.f,1.f,1.f);
  }

signals:
  void openglRendererInvalid();
  void openglPickingRendererInvalid();

public slots:
  virtual void coordScalesChanged();

protected slots:
  void invalidateOpenglRenderer();
  void invalidateOpenglPickingRenderer();
  virtual void compile() = 0;

protected:
  inline float getOpacity()  const {return m_rendererBase->getOpacity();}
  inline float getSizeScale() const {return m_rendererBase->getSizeScale();}
  inline Z3DCamera& getCamera() const {return m_rendererBase->getCamera();}
  inline glm::ivec4 getViewport() const {return m_rendererBase->getViewport();}

  virtual inline bool getNeedLighting() {return m_needLighting;}
  virtual inline bool getUseDisplayList() {return m_useDisplayList;}
  virtual inline void setRendererBase(Z3DRendererBase* base) { m_rendererBase = base;}

//  inline Z3DRendererBase* getRendererBase() const { return m_rendererBase; }

  virtual void initialize();
  virtual void deinitialize();

  virtual void renderUsingOpengl() {}
  virtual void renderPickingUsingOpengl() {}

  virtual void render(Z3DEye) = 0;
  virtual void renderPicking(Z3DEye) = 0;

  void addParameter(ZParameter &para);
  void addParameter(ZParameter *para);
  std::vector<ZParameter*> getParameters();

  inline void setInitialized(bool i) {m_initialized = i;}

  virtual QString generateHeader();

  // commonly used render functions
  // Render a screen-aligned quad (whole screen) with depth func GL_ALWAYS.
  void renderScreenQuad(const Z3DShaderProgram &shader, bool depthAlwaysPass = true);
  // render a trianglelist with whatever it contains
  void renderTriangleList(const Z3DShaderProgram &shader, const Z3DTriangleList &mesh);

  Z3DRendererBase* m_rendererBase;
  bool m_initialized;
  bool m_needLighting;
  bool m_useDisplayList;
  bool m_respectRendererBaseCoordScale;

  std::vector<ZParameter*> m_parameters;

  bool m_hardwareSupportVAO;
  GLuint m_VAO;
  GLuint m_pickingVAO;

private:
  GLuint m_privateVAO;
};

#endif // Z3DPRIMITIVERENDERER_H


text:
OpenTelemetry ASGI Instrumentation
==================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-asgi.svg
   :target: https://pypi.org/project/opentelemetry-instrumentation-asgi/

This library provides a ASGI middleware that can be used on any ASGI framework
(such as Django, Starlette, FastAPI or Quart) to track requests timing through OpenTelemetry.

Installation
------------

::

    pip install opentelemetry-instrumentation-asgi

References
----------

* `OpenTelemetry Project <https://opentelemetry.io/>`_
* `OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>`_


text:
package com.anupcowkur.reservoir;

import com.google.gson.reflect.TypeToken;

import com.anupcowkur.reservoirsample.MainActivity;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import android.test.suitebuilder.annotation.MediumTest;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import rx.Observer;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertThat;

/**
 * The main reservoir class.
 */
public class ReservoirTest {

    MainActivity mainActivity;

    private static final String TEST_STRING = "my test string";
    private static final String KEY = "myKey";
    private static final List<Object> TEST_COLLECTION = new ArrayList<>();
    private int i;

    @Rule
    public final ActivityRule<MainActivity> rule = new ActivityRule<>(MainActivity.class);

    @Rule
    public ExpectedException expectedEx = ExpectedException.none();

    @Before
    public void init() {
        mainActivity = rule.get();
    }

    @Test
    @MediumTest
    public void testSyncShouldPutAndGetObject() throws Exception {

        TestClass testPutObject = new TestClass();

        testPutObject.setTestString(TEST_STRING);

        Reservoir.put(KEY, testPutObject);

        TestClass testResultObject = Reservoir.get(KEY, TestClass.class);

        assertEquals(TEST_STRING, testResultObject.getTestString());

    }

    @Test
    @MediumTest
    public void testSyncShouldPutAndGetCollectionObject() throws Exception {

        Reservoir.put(KEY, TEST_COLLECTION);

        Type testResultType = new TypeToken<List<Object>>() {
        }.getType();

        List<Object> testResultCollection = Reservoir.get(KEY, testResultType);

        assertEquals(TEST_COLLECTION, testResultCollection);

    }

    @Test
    @MediumTest
    public void testAsyncShouldPutAndGetObject() throws Exception {

        TestClass testPutObject = new TestClass();

        testPutObject.setTestString(TEST_STRING);

        Reservoir.putAsync(KEY, testPutObject, new ReservoirPutCallback() {
            @Override
            public void onSuccess() {
                Reservoir.getAsync(KEY, TestClass.class, new ReservoirGetCallback<TestClass>() {
                    @Override
                    public void onSuccess(TestClass testResultObject) {
                        assertEquals(TEST_STRING, testResultObject.getTestString());
                    }

                    @Override
                    public void onFailure(Exception e) {
                        fail();
                    }
                });
            }

            @Override
            public void onFailure(Exception e) {
                fail();
            }
        });

    }

    @Test
    @MediumTest
    public void testAsyncShouldPutAndGetCollectionObject() throws Exception {

        Reservoir.putAsync(KEY, TEST_COLLECTION, new ReservoirPutCallback() {
            @Override
            public void onSuccess() {

                final Type testResultType = new TypeToken<List<Object>>() {
                }.getType();

                Reservoir.getAsync(KEY, testResultType, new ReservoirGetCallback<List<Object>>() {
                    @Override
                    public void onSuccess(List<Object> testResultCollection) {
                        assertEquals(TEST_COLLECTION, testResultCollection);
                    }

                    @Override
                    public void onFailure(Exception e) {
                        fail();
                    }
                });
            }

            @Override
            public void onFailure(Exception e) {
                fail();
            }
        });

    }

    @Test
    @MediumTest
    public void testAsyncRxShouldPutAndGetObject() throws Exception {

        TestClass testPutObject = new TestClass();

        testPutObject.setTestString(TEST_STRING);

        Reservoir.putAsync(KEY, testPutObject).subscribe(new Observer<Boolean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                fail();
            }

            @Override
            public void onNext(Boolean success) {
                Reservoir.getAsync(KEY, TestClass.class).subscribe(new Observer<TestClass>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                        fail();
                    }

                    @Override
                    public void onNext(TestClass testResultObject) {
                        assertEquals(TEST_STRING, testResultObject.getTestString());
                    }
                });
            }
        });
    }

    @Test
    @MediumTest
    public void testAsyncRxShouldPutAndGetCollectionObject() throws Exception {

        final String[] strings = {"one", "two", "three", "four"};

        List<String> testStrings = new ArrayList<>(Arrays.asList(strings));

        i = 0;

        Reservoir.putAsync(KEY, testStrings).subscribe(new Observer<Boolean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                fail();
            }

            @Override
            public void onNext(Boolean success) {

                final Type testResultType = new TypeToken<List<String>>() {
                }.getType();

                Reservoir.getAsync(KEY, String.class, testResultType).subscribe(new Observer<String>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                        fail();
                    }

                    @Override
                    public void onNext(String testResultString) {
                        assertEquals(strings[i++], testResultString);
                    }
                });
            }
        });
    }

    @Test(expected = NullPointerException.class)
    @MediumTest
    public void testSyncShouldThrowNullPointerExceptionWhenObjectDoesNotExist() throws
                                                                                Exception {

        Reservoir.get("non_existent_key", TestClass.class);

    }

    @Test
    @MediumTest
    public void testAsyncShouldCallOnFailureWhenObjectDoesNotExist() throws
                                                                     Exception {

        Reservoir.getAsync("non_existent_key", TestClass.class, new ReservoirGetCallback<TestClass>() {
            @Override
            public void onSuccess(TestClass object) {
                fail();
            }

            @Override
            public void onFailure(Exception e) {
                assertThat(e, instanceOf(NullPointerException.class));
            }
        });
    }

    @Test
    @MediumTest
    public void testAsyncRxShouldCallOnFailureWhenObjectDoesNotExist() throws
                                                                       Exception {

        Reservoir.getAsync("non_existent_key", TestClass.class).subscribe(new Observer<TestClass>() {
            @Override
            public void onCompleted() {
                fail();
            }

            @Override
            public void onError(Throwable e) {
                assertThat(e, instanceOf(NullPointerException.class));
            }

            @Override
            public void onNext(TestClass testClass) {
                fail();
            }
        });
    }

    @Test
    @MediumTest
    public void testSyncShouldThrowIOExceptionWhenObjectSizeGreaterThanCacheSize() throws
                                                                                Exception {

        expectedEx.expect(IOException.class);
        expectedEx.expectMessage(SimpleDiskCache.OBJECT_SIZE_GREATER_THAN_CACHE_SIZE_MESSAGE);

        Reservoir.put(KEY, TestUtils.getLargeString());
    }

    @Test
    @MediumTest
    public void testASyncShouldThrowIOExceptionWhenObjectSizeGreaterThanCacheSize() throws
                                                                                Exception {

        Reservoir.putAsync(KEY, TestUtils.getLargeString(), new ReservoirPutCallback() {
            @Override
            public void onSuccess() {
                fail();
            }

            @Override
            public void onFailure(Exception e) {
                assertThat(e, instanceOf(IOException.class));
                assertEquals(SimpleDiskCache.OBJECT_SIZE_GREATER_THAN_CACHE_SIZE_MESSAGE, e.getMessage());
            }
        });

    }

    @Test
    @MediumTest
    public void testASyncRxShouldThrowIOExceptionWhenObjectSizeGreaterThanCacheSize() throws
                                                                                Exception {

        Reservoir.putAsync(KEY, TestUtils.getLargeString()).subscribe(new Observer<Boolean>() {
            @Override
            public void onCompleted() {
                fail();
            }

            @Override
            public void onError(Throwable e) {
                assertThat(e, instanceOf(IOException.class));
                assertEquals(SimpleDiskCache.OBJECT_SIZE_GREATER_THAN_CACHE_SIZE_MESSAGE, e.getMessage());
            }

            @Override
            public void onNext(Boolean aBoolean) {
                fail();
            }
        });

    }

    @Test
    @MediumTest
    public void testSyncShouldDeleteObject() throws Exception {

        TestClass testPutObject = new TestClass();
        testPutObject.setTestString(TEST_STRING);
        Reservoir.put(KEY, testPutObject);

        Reservoir.delete(KEY);

        assertEquals(false, Reservoir.contains(KEY));

    }

    @Test
    @MediumTest
    public void testAsyncShouldDeleteObject() throws Exception {

        TestClass testPutObject = new TestClass();
        testPutObject.setTestString(TEST_STRING);
        Reservoir.put(KEY, testPutObject);

        Reservoir.deleteAsync(KEY, new ReservoirDeleteCallback() {
            @Override
            public void onSuccess() {
                try {
                    assertEquals(false, Reservoir.contains(KEY));
                } catch (Exception e) {
                    fail();
                }
            }

            @Override
            public void onFailure(Exception e) {
                fail();
            }
        });
    }

    @Test
    @MediumTest
    public void testAsyncRxShouldDeleteObject() throws Exception {

        TestClass testPutObject = new TestClass();
        testPutObject.setTestString(TEST_STRING);
        Reservoir.put(KEY, testPutObject);

        Reservoir.deleteAsync(KEY).subscribe(new Observer<Boolean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                fail();
            }

            @Override
            public void onNext(Boolean success) {
                try {
                    assertEquals(false, Reservoir.contains(KEY));
                } catch (Exception e) {
                    fail();
                }
            }
        });
    }

    @Test
    @MediumTest
    public void testSyncShouldClearCache() throws Exception {

        TestClass testPutObject = new TestClass();
        testPutObject.setTestString(TEST_STRING);
        Reservoir.put(KEY, testPutObject);

        Reservoir.clear();

        assertEquals(0, Reservoir.bytesUsed());

    }

    @Test
    @MediumTest
    public void testAsyncShouldClearCache() throws Exception {

        TestClass testPutObject = new TestClass();
        testPutObject.setTestString(TEST_STRING);
        Reservoir.put(KEY, testPutObject);

        Reservoir.clearAsync(new ReservoirClearCallback() {
            @Override
            public void onSuccess() {
                try {
                    assertEquals(0, Reservoir.bytesUsed());
                } catch (Exception e) {
                    fail();
                }
            }

            @Override
            public void onFailure(Exception e) {
                fail();
            }
        });

    }

    @Test
    @MediumTest
    public void testAsyncRxShouldClearCache() throws Exception {

        TestClass testPutObject = new TestClass();
        testPutObject.setTestString(TEST_STRING);
        Reservoir.put(KEY, testPutObject);

        Reservoir.clearAsync().subscribe(new Observer<Boolean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                fail();
            }

            @Override
            public void onNext(Boolean success) {
                try {
                    assertEquals(0, Reservoir.bytesUsed());
                } catch (Exception e) {
                    fail();
                }
            }
        });
    }

}


text:
This sample Android app demonstrates
file I/O for internal and external storage.

This app is covered in
[the chapter on working with files](https://commonsware.com/Android/previews/assets-files-and-data-parsing)
in [*The Busy Coder's Guide to Android Development*](https://commonsware.com/Android/).


text:
import { WKBrowser } from '../webkit/wkBrowser';
import type { Env } from '../../utils/processLauncher';
import path from 'path';
import { kBrowserCloseMessageId } from './wkConnection';
import { BrowserType, kNoXServerRunningError } from '../browserType';
import type { ConnectionTransport } from '../transport';
import type { BrowserOptions, PlaywrightOptions } from '../browser';
import type * as types from '../types';
import { rewriteErrorMessage } from '../../utils/stackTrace';
import { wrapInASCIIBox } from '../../utils';

export class WebKit extends BrowserType {
  constructor(playwrightOptions: PlaywrightOptions) {
    super('webkit', playwrightOptions);
  }

  _connectToTransport(transport: ConnectionTransport, options: BrowserOptions): Promise<WKBrowser> {
    return WKBrowser.connect(transport, options);
  }

  _amendEnvironment(env: Env, userDataDir: string, executable: string, browserArguments: string[]): Env {
    return { ...env, CURL_COOKIE_JAR_PATH: path.join(userDataDir, 'cookiejar.db') };
  }

  _rewriteStartupError(error: Error): Error {
    if (error.message.includes('cannot open display'))
      return rewriteErrorMessage(error, '\n' + wrapInASCIIBox(kNoXServerRunningError, 1));
    return error;
  }

  _attemptToGracefullyCloseBrowser(transport: ConnectionTransport): void {
    transport.send({ method: 'Playwright.close', params: {}, id: kBrowserCloseMessageId });
  }

  _defaultArgs(options: types.LaunchOptions, isPersistent: boolean, userDataDir: string): string[] {
    const { args = [], proxy, headless } = options;
    const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir'));
    if (userDataDirArg)
      throw new Error('Pass userDataDir parameter to `browserType.launchPersistentContext(userDataDir, ...)` instead of specifying --user-data-dir argument');
    if (args.find(arg => !arg.startsWith('-')))
      throw new Error('Arguments can not specify page to be opened');
    const webkitArguments = ['--inspector-pipe'];
    if (process.platform === 'win32')
      webkitArguments.push('--disable-accelerated-compositing');
    if (headless)
      webkitArguments.push('--headless');
    if (isPersistent)
      webkitArguments.push(`--user-data-dir=${userDataDir}`);
    else
      webkitArguments.push(`--no-startup-window`);
    if (proxy) {
      if (process.platform === 'darwin') {
        webkitArguments.push(`--proxy=${proxy.server}`);
        if (proxy.bypass)
          webkitArguments.push(`--proxy-bypass-list=${proxy.bypass}`);
      } else if (process.platform === 'linux') {
        webkitArguments.push(`--proxy=${proxy.server}`);
        if (proxy.bypass)
          webkitArguments.push(...proxy.bypass.split(',').map(t => `--ignore-host=${t}`));
      } else if (process.platform === 'win32') {
        webkitArguments.push(`--curl-proxy=${proxy.server}`);
        if (proxy.bypass)
          webkitArguments.push(`--curl-noproxy=${proxy.bypass}`);
      }
    }
    webkitArguments.push(...args);
    if (isPersistent)
      webkitArguments.push('about:blank');
    return webkitArguments;
  }
}


text:
<?php

namespace Sonata\DoctrineORMAdminBundle\Filter;

use Doctrine\ORM\QueryBuilder;
use Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

class ChoiceFilter extends Filter
{
    /**
     * {@inheritdoc}
     */
    public function filter(ProxyQueryInterface $queryBuilder, $alias, $field, $data)
    {
        if (!$data || !is_array($data) || !array_key_exists('type', $data) || !array_key_exists('value', $data)) {
            return;
        }

        if (is_array($data['value'])) {
            if (count($data['value']) == 0) {
                return;
            }

            if (in_array('all', $data['value'], true)) {
                return;
            }

            if ($data['type'] == ChoiceType::TYPE_NOT_CONTAINS) {
                $this->applyWhere($queryBuilder, $queryBuilder->expr()->notIn(sprintf('%s.%s', $alias, $field ), $data['value']));
            } else {
                $this->applyWhere($queryBuilder, $queryBuilder->expr()->in(sprintf('%s.%s', $alias, $field ), $data['value']));
            }

        } else {

            if ($data['value'] === '' || $data['value'] === null || $data['value'] === false || $data['value'] === 'all') {
                return;
            }

            $parameterName = $this->getNewParameterName($queryBuilder);

            if ($data['type'] == ChoiceType::TYPE_NOT_CONTAINS) {
                $this->applyWhere($queryBuilder, sprintf('%s.%s <> :%s', $alias, $field, $parameterName));
            } else {
                $this->applyWhere($queryBuilder, sprintf('%s.%s = :%s', $alias, $field, $parameterName));
            }

            $queryBuilder->setParameter($parameterName, $data['value']);
        }
    }

    /**
     * @param string $type
     *
     * @return bool
     */
    private function getOperator($type)
    {
        $choices = array(
            ChoiceType::TYPE_CONTAINS         => 'IN',
            ChoiceType::TYPE_NOT_CONTAINS     => 'NOT IN',
            ChoiceType::TYPE_EQUAL            => '=',
        );

        return isset($choices[$type]) ? $choices[$type] : false;
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultOptions()
    {
        return array();
    }

    /**
     * {@inheritdoc}
     */
    public function getRenderSettings()
    {
        return array('sonata_type_filter_default', array(
            'operator_type' => 'sonata_type_equal',
            'field_type'    => $this->getFieldType(),
            'field_options' => $this->getFieldOptions(),
            'label'         => $this->getLabel()
        ));
    }
}


text:
host = 'test.mosquitto.org';	// hostname or IP address
// host = '172.16.153.110';	// hostname or IP address
port = 8080;
topic = '/bcx16';		// topic to subscribe to
useTLS = false;
username = null;
password = null;
cleansession = true;


text:
using LanguageExt;
using SJP.Schematic.Core;

namespace SJP.Schematic.Oracle;

/// <summary>
/// Defines an Oracle package, which is a collection of functions and procedures.
/// </summary>
/// <seealso cref="IDatabaseRoutine" />
public interface IOracleDatabasePackage : IDatabaseRoutine
{
    /// <summary>
    /// Gets the specification of the package. Roughly equivalent to an interface or headers.
    /// </summary>
    /// <value>The specification.</value>
    string Specification { get; }

    /// <summary>
    /// The body of the package, i.e. the implementation.
    /// </summary>
    /// <value>The package body.</value>
    Option<string> Body { get; }
}


text:
<?php
/**
 * Admin setup for the plugin
 *
 * @since 1.3
 * @function	iaff_add_menu_links()		Add admin menu pages
 * @function	iaff_register_settings()	Register Settings
 * @function	iaff_get_settings()			Set global default values for settings
 * @function	iaff_enqueue_js_and_css()	Load Admin Side Js and CSS
 */

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

/**
 * Add admin menu pages
 *
 * @since 	1.0
 * @refer	https://developer.wordpress.org/plugins/administration-menus/
 */
function iaff_add_menu_links() {

	if ( iaff_is_pro() ) {
		$iaff_plugin_title 	= 'Image Attributes Pro';
		$iaff_menu_title 	= 'Image Attributes Pro';
	} else {
		$iaff_plugin_title 	= 'Auto Image Attributes';
		$iaff_menu_title 	= 'Image Attributes';
	}

	add_options_page( $iaff_plugin_title, $iaff_menu_title, 'manage_options', 'image-attributes-from-filename','iaff_admin_interface_render'  );
}
add_action( 'admin_menu', 'iaff_add_menu_links' );

/**
 * Register Settings
 *
 * @since 	1.0
 */
function iaff_register_settings() {

	// Register Setting
	register_setting(
		'iaff_settings_group', 	// Group Name
		'iaff_settings', 		// Setting Name = HTML form <input> name on settings form
		'iaff_settings_validater_and_sanitizer'
	);

	// Register Basic Settings Section
    add_settings_section(
        'iaff_basic_settings_section_id',			// ID
        __('Basic Settings','auto-image-attributes-from-filename-with-bulk-updater'),			// Title
        '__return_false',							// Callback Function
        'iaff_basic_settings_section'				// Page slug
    );

		// Global Switch
		add_settings_field(
			'iaff_global_switch',						// ID
			__('Global Switch', 'auto-image-attributes-from-filename-with-bulk-updater'),			// Title
			'iaff_global_switch_callback',				// Callback function
			'iaff_basic_settings_section',				// Page slug
			'iaff_basic_settings_section_id'			// Settings Section ID
		);

		// General Settings
		add_settings_field(
			'iaff_general_settings',					// ID
			__('General Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),		// Title
			'iaff_general_settings_callback',			// Callback function
			'iaff_basic_settings_section',				// Page slug
			'iaff_basic_settings_section_id'			// Settings Section ID
		);

		// Filter Settings
		add_settings_field(
			'iaff_filter_settings',						// ID
			__('Filter Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),		// Title
			'iaff_filter_settings_callback',			// Callback function
			'iaff_basic_settings_section',				// Page slug
			'iaff_basic_settings_section_id'			// Settings Section ID
		);

		// Basic SEO Settings
		add_settings_field(
			'iaff_basic_seo_settings',					// ID
			__('Basic SEO Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),	// Title
			'iaff_basic_seo_settings_callback',			// Callback function
			'iaff_basic_settings_section',				// Page slug
			'iaff_basic_settings_section_id'			// Settings Section ID
		);

		// Preview Pro Features
		if ( ! iaff_is_pro() ) {

			add_settings_field(
				'iaff_preview_pro_settings',				// ID
				__('Preview Pro Features', 'auto-image-attributes-from-filename-with-bulk-updater'),	// Title
				'iaff_preview_pro_settings_callback',		// Callback function
				'iaff_basic_settings_section',				// Page slug
				'iaff_basic_settings_section_id'			// Settings Section ID
			);
		}

	// Register Advanced Settings Section
    add_settings_section(
        'iaff_advanced_settings_section_id',		// ID
        __('Advanced Settings','auto-image-attributes-from-filename-with-bulk-updater'),		// Title
        '__return_false',							// Callback Function
        'iaff_advanced_settings_section'			// Page slug
    );

		// Advanced Filter
		add_settings_field(
			'iaff_advanced_filter_settings',			// ID
			__('Advanced Filter', 'auto-image-attributes-from-filename-with-bulk-updater'),		// Title
			'iaff_advanced_filter_callback',			// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Custom Filter
		add_settings_field(
			'iaff_custom_filter_settings',				// ID
			__('Custom Filter', 'auto-image-attributes-from-filename-with-bulk-updater'),			// Title
			'iaff_custom_filter_callback',				// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Capitalization Settings
		add_settings_field(
			'iaff_capitalization_settings',				// ID
			__('Capitalization Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),// Title
			'iaff_capitalization_callback',				// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Image Title Settings
		add_settings_field(
			'iaff_image_title_settings',				// ID
			__('Image Title Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),	// Title
			'iaff_advanced_image_title_callback',		// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Image Alt Text Settings
		add_settings_field(
			'iaff_image_alt_text_settings',				// ID
			__('Image Alt Text Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),// Title
			'iaff_advanced_image_alt_text_callback',	// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Image Caption Settings
		add_settings_field(
			'iaff_image_caption_settings',				// ID
			__('Image Caption Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),// Title
			'iaff_advanced_image_caption_callback',		// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Image Description Settings
		add_settings_field(
			'iaff_image_description_settings',			// ID
			__('Image Description Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),// Title
			'iaff_advanced_image_description_callback',	// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

		// Miscellaneous Settings
		add_settings_field(
			'iaff_miscellaneous_settings',				// ID
			__('Miscellaneous Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),// Title
			'iaff_miscellaneous_callback',				// Callback function
			'iaff_advanced_settings_section',			// Page slug
			'iaff_advanced_settings_section_id'			// Settings Section ID
		);

	// Register Bulk Updater Settings Section
    add_settings_section(
        'iaff_bu_settings_section_id',				// ID
        __('Bulk Updater Settings','auto-image-attributes-from-filename-with-bulk-updater'),	// Title
        '__return_false',							// Callback Function
        'iaff_bu_settings_section'					// Page slug
    );

		// General Settings
		add_settings_field(
			'iaff_bu_general_settings',						// ID
			__('General Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),			// Title
			'iaff_bu_general_settings_callback',			// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Filter Settings
		add_settings_field(
			'iaff_bu_filter_settings',						// ID
			__('Filter Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),			// Title
			'iaff_bu_filter_settings_callback',				// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Custom Filter
		add_settings_field(
			'iaff_bu_custom_filter_settings',				// ID
			__('Custom Filter', 'auto-image-attributes-from-filename-with-bulk-updater'),				// Title
			'iaff_bu_custom_filter_callback',				// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Capitalization Settings
		add_settings_field(
			'iaff_bu_capitalization_settings',				// ID
			__('Capitalization Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),	// Title
			'iaff_bu_capitalization_settings_callback',		// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Image Title Settings
		add_settings_field(
			'iaff_bu_image_title_settings',					// ID
			__('Image Title Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),		// Title
			'iaff_bu_image_title_settings_callback',		// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Image Alt Text Settings
		add_settings_field(
			'iaff_bu_alt_text_settings',					// ID
			__('Image Alt Text Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),	// Title
			'iaff_bu_alt_text_settings_callback',			// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Image Caption Settings
		add_settings_field(
			'iaff_bu_image_caption_settings',				// ID
			__('Image Caption Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),	// Title
			'iaff_bu_image_caption_settings_callback',		// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

		// Image Description Settings
		add_settings_field(
			'iaff_bu_image_description_settings',				// ID
			__('Image Description Settings', 'auto-image-attributes-from-filename-with-bulk-updater'),// Title
			'iaff_bu_image_description_settings_callback',	// Callback function
			'iaff_bu_settings_section',						// Page slug
			'iaff_bu_settings_section_id'					// Settings Section ID
		);

}
add_action( 'admin_init', 'iaff_register_settings' );

/**
 * Input validator and sanitizer
 *
 * @since	1.4
 * @param	Array	$settings	An array that contains all the settings
 * @return	Array	Array containing all the settings
 */
function iaff_settings_validater_and_sanitizer( $settings ) {

	// Sanitize Custom Filter
	$settings['custom_filter'] 		= sanitize_text_field($settings['custom_filter']);
	$settings['bu_custom_filter']	= sanitize_text_field($settings['bu_custom_filter']);

	// Validating Regex
	if( @preg_match($settings['regex_filter'], null) === false ) {
		unset($settings['regex_filter']);
	}

	// Validating Bulk Updater Regex
	if( @preg_match($settings['bu_regex_filter'], null) === false ) {
		unset($settings['bu_regex_filter']);
	}

	return $settings;
}

/**
 * Set global default values for settings
 *
 * @since 	1.4
 * @return	Array	A merged array of default and settings saved in database.
 */
function iaff_get_settings() {

	$iaff_defaults = array(
						'global_switch'			=> '1',
						'image_title' 			=> '1',
						'image_caption' 		=> '1',
						'image_description' 	=> '1',
						'image_alttext' 		=> '1',
						'image_title_to_html' 	=> '1',
						'preview_pro'			=> '0',
						'hyphens' 				=> '1',
						'under_score' 			=> '1',
						'capitalization'		=> '0',
						'title_source'			=> '0',
						'alt_text_source'		=> '0',
						'caption_source'		=> '0',
						'description_source'	=> '0',
						'clean_filename'		=> '1',
						'bu_image_title' 		=> '1',
						'bu_image_caption' 		=> '1',
						'bu_image_description' 	=> '1',
						'bu_image_alttext' 		=> '1',
						'bu_capitalization'		=> '0',
						'bu_title_source'		=> '0',
						'bu_titles_in_post'		=> '0',
						'bu_alt_text_source'	=> '0',
						'bu_alt_text_in_post'	=> '0',
						'bu_caption_source'		=> '0',
						'bu_description_source'	=> '0',
					);

	$settings = get_option('iaff_settings', $iaff_defaults);

	return $settings;
}

/**
 * Load Admin Side Js and CSS
 *
 * Used for styling the plugin pages and bulk updater.
 * @since	1.3
 */
function iaff_enqueue_js_and_css() {

	// Load files only on plugin screens
	$screen = get_current_screen();
	if ( $screen->id !== "settings_page_image-attributes-from-filename" ) {
		return;
	}

	// Custom IAFF Styling
    wp_enqueue_style( 'iaff-style', plugins_url( '/css/iaff-style.css', __FILE__ ), '', IAFF_VERSION_NUM );

	// Custom IAFF JS
	wp_enqueue_script( 'iaff-js', plugins_url('/js/iaff-js.js', __FILE__), array( 'jquery', 'jquery-ui-dialog' ), IAFF_VERSION_NUM, true );

	// jQuery Dialog CSS
	wp_enqueue_style( 'wp-jquery-ui-dialog' );

	// Google Fonts
	wp_enqueue_style('iaff-google-font', 'https://fonts.googleapis.com/css?family=Patua+One', array(), null, 'all');
}
add_action( 'admin_enqueue_scripts', 'iaff_enqueue_js_and_css' );


text:
from django.db import models

class TestDjangoModel(models.Model):
    name = models.CharField(max_length=128)

    # Possible attributes
    first_name = models.CharField(max_length=255)
    last_name = models.CharField(max_length=255)
    email = models.EmailField(max_length=255)
    employeeID = models.CharField(max_length=128)


text:
'use strict';

class Exception extends Error {
    constructor(message, code, parameters, error){
        super(message);
        this.code = code;
        this.parameters = parameters || {};
        this.error = error || new Error('Common error');
    }
}

module.exports = Exception;


text:
"use strict";

class BaseCtrl{

    constructor(ctrlid) {
        this.ctrlid = ctrlid;
    }

    checkParams(res, params) {
        if (arguments.length > 2) {

            for (let i = 2; i < arguments.length; ++i) {
                if (!params.hasOwnProperty(arguments[i])) {
                    res.send(JSON.stringify({err: 'no param ' + arguments[i]}));

                    return false;
                }
            }
        }

        return true;
    }
}

class CtrlMgr{

    constructor() {
        this.mapCtrl = {};
    }

    addCtrl(ctrl) {
        if (!this.mapCtrl.hasOwnProperty(ctrl.ctrlid)) {
            this.mapCtrl[ctrl.ctrlid] = ctrl;
        }
    }

    onReq(req, res, session) {
        let params;

        if (req.method == 'POST') {
            params = req.body;
        }
        else if (req.method == 'GET') {
            params = req.query;
        }

        if (req.params.hasOwnProperty('ctrlid')) {
            params.ctrlid = req.params.ctrlid;

            if (this.mapCtrl.hasOwnProperty(params.ctrlid)) {
                this.mapCtrl[params.ctrlid].onProc(req, res, session, params);

                return ;
            }
        }

        res.send(JSON.stringify({err: 'no ctrl.'}));
    }
}

var singleton = new CtrlMgr();

exports.BaseCtrl = BaseCtrl;

exports.singleton = singleton;


text:
import { AsyncStorage } from 'react-native';
import Config from './models/config';

const ConfigInstance = Config.create({
    storage: AsyncStorage,
});

export default ConfigInstance;


text:
import time
import calendar

class Train:
    """Creates a train object that represents one subway train we have data for. The methods
    contained in this class interpret information we get from the MTA's feed, such as route number,
    direction, arrival time, and upcoming stops.
    """

    def __init__(self, trip_update, stops, position_in_list):
        """Initializes one train object with a 'trip_update' object from the MTA data, a
        dictionary of all the stop IDs and names in the subway system, and the index of the
        train in the master list of train objects.
        """
        self.trip_update = trip_update
        self.stops = stops
        self.routeID = str(self.trip_update.trip.route_id)
        # A minor quirk in the MTA's data is fixed here. S trains were listed as GS for some reason
        if self.routeID == "GS":
            self.routeID = "S"
        self.index = position_in_list

    def showInfo(self, stop_number):
        """Given the stop number (the nth stop on the train's remaining route) as an
        argument, this method prints out a message containing the train's direction,
        route number, station, and arrival time.
        """
        if self.arrivalTime == '': # At origin terminals, there will only be a departure time listed
            if self.getArrivalTime(stop_number) == '00':
                print "There is a", self.getDirection(), self.routeID, "train departing from", self.getStop(stop_number), "now."
            elif self.getArrivalTime(stop_number) == '01':
                print "There is a", self.getDirection(), self.routeID, "train departing from", self.getStop(stop_number), "in 1 minute."
            else:
                print "There is a", self.getDirection(), self.routeID, "train departing from", self.getStop(stop_number), "in", int(self.getArrivalTime(stop_number)), "minutes."
        elif self.getArrivalTime(stop_number) == '01':
            print "There is a", self.getDirection(), self.routeID, "train arriving at", self.getStop(stop_number), "in 1 minute."
        elif self.getArrivalTime(stop_number) == '00':
            print "There is a", self.getDirection(), self.routeID, "train arriving at", self.getStop(stop_number), "now."
        else:
            print "There is a", self.getDirection(), self.routeID, "train arriving at", self.getStop(stop_number), "in", int(self.getArrivalTime(stop_number)), "minutes."

    def getArrivalTime(self, stop_number):
        """This method, given a stop number, returns the number of minutes it will take
        for the train to arrive at the specified station.
        """
        # Get absolute POSIX time from MTA data
        self.arrivalTime = str(self.trip_update.stop_time_update[stop_number].arrival)
        departureTime = str(self.trip_update.stop_time_update[stop_number].departure)
        if self.arrivalTime != '': # Some stops only have a departure time listed
            unix_time = float(self.arrivalTime.strip('time: '))
        else:
            unix_time = int(departureTime.strip('time: '))

        # Calculate difference, in POSIX time, between arrival time and current time
        # There is a 60-second offset here to account for delays in data transmission
        # that would otherwise produce negative differences (i.e. train arriving in
        # -1 minutes)
        difference = unix_time + 60 - calendar.timegm(time.gmtime())

        # Convert POSIX difference to struct_time difference, then return minutes
        utc_difference = time.gmtime(difference)
        readable_difference = time.strftime("%M", utc_difference)
        return readable_difference

    def getAllStops(self):
        """Gets all upcoming stops for the train.
        Returns a list of form [stop number, station name].
        """
        all_stops = []
        # Iterate through all the stop_time_update objects in trip_update
        for i in range(len(self.trip_update.stop_time_update)):
            stop = self.getStop(i)
            if stop not in all_stops:
                all_stops.append([i, stop])
        return all_stops

    def getStop(self, i):
        """Gets the nth stop for the train given the stop number as an argument.
        """
        stopID = self.trip_update.stop_time_update[i].stop_id
        stop = self.stops[stopID]
        return stop

    def getDirection(self):
        """Gets the direction of the train. Returns 'N' or 'S'.
        """
        if 'N' in str(self.trip_update.trip.trip_id):
            direction = 'northbound'
        if 'S' in str(self.trip_update.trip.trip_id):
            direction = 'southbound'
        return direction

    def getIndex(self):
        """Gets the position of the train in the master train list.
        """
        return self.index