text:
define(function(require) {
	// imports
	var Parallax = require("./parallax");
	var inherits = require("../utils/inherits");
	var helpers = require("../utils/helpers");
	var constants = require("../utils/constants");

	// graphics
	var gfx = ["ground1", "ground1", "ground2", "ground3"];

	var Ground = function(game, x, y) {
		Phaser.Sprite.call(this, game, x, y, Phaser.ArrayUtils.getRandomItem(gfx));

		// set physics and game specific stuff
		game.physics.arcade.enable(this);
		game.add.existing(this);

		this.anchor.setTo(0, 0.5);
		this.body.allowGravity = false;
		this.body.allowRotation = false;
		this.body.immovable = true;
		this.body.friction.x = 0;
	};

	inherits(Ground, Phaser.Sprite);

	// groups the aliens together
	var GroundGroup = function(game, parent) {
		Parallax.call(this, game, parent);
	};

	inherits(GroundGroup, Parallax);

	// create a tile of ground objects
	GroundGroup.prototype.set = function() {
		var tilesNeeded = Math.ceil(constants.SCREEN_WIDTH / constants.TILE_WIDTH) + 2;

		for(var i = 0; i < tilesNeeded; ++i) {
			this.add(new Ground(this.game, constants.TILE_WIDTH * i, constants.SCREEN_HEIGHT));
		}
	};

	// return the y position of the tile at x
	GroundGroup.prototype.isChasmAtX = function(x) {
		var tile = null;

		this.forEach(function(child) {
			if(child.x > x && child.x + child.width < x) {
				tile = child;
			}
		}, this, true);

		if(tile) {
			return tile.y > constants.SCREEN_HEIGHT;
		}

		return false;
	};

	// push the next offscreen tile down so it's off screen leaving a gap in the ground
	GroundGroup.prototype.createChasm = function() {
		// this should be offscreen
		var last = this.getLast();

		last.y += constants.TILE_HEIGHT;
	};

	// push the next offscreen tile up a bit
	GroundGroup.prototype.createLedge = function() {
		// this should be offscreen
		var last = this.getLast();

		last.y -= constants.TILE_HEIGHT / 4;
	};

	// override onloop to create seamless ground
	GroundGroup.prototype.onloop = function(child) {
		// get last tile and reposition child based on it
		var last = this.getLast();

		child.x = last.x + constants.TILE_WIDTH;

		// going too fast, start leaving tiles down
		if(this.speed < 400 || Math.random() < 0.5) {
			child.y = constants.SCREEN_HEIGHT;
		}

		if(this.speed > 800 && Math.random() < 0.3) {
			last.y += constants.TILE_HEIGHT;
		}
	};

	return GroundGroup;
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ListSort_Enterprise_Edition
{
    class Program
    {
        /*
         * First of all, let's try to break down the task:
         * 1. Read the numbers
         * 2. Sort them
         * 3. Output the sorted numbers.
         * As "Divide and conquer" is very important strategy when working with software problems, lets tackle them one at a time
         */

        static void Main(string[] args)
        {
            WriteIntro();
            IDoubleArrayReader reader = DoubleArrayInputOutputFactory.CreateDoubleArrayReader(DoubleArrayReaderType.Console);
            IDoubleArrayProcessor processor = DoubleArrayProcessorFactory.CreateDoubleArrayProcessor(DoubleArrayProcessorType.Sorter);
            IDoubleArrayWriter writer = DoubleArrayInputOutputFactory.CreateDoubleArrayWriter(DoubleArrayWriterType.Console);
            var doubles = reader.GetDoubles();
            doubles = processor.ProcessDoubles(doubles);
            writer.WriteDoublesArray(doubles);
            WaitForExit();
        }

        static void WriteIntro()
        {
            Console.WriteLine("ListSort Enterprise Edition");
            Console.WriteLine();
        }

        static void WaitForExit()
        {
            Console.WriteLine();
            Console.Write("Press <ENTER> to exit");
            Console.ReadLine();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright © 2010-2016 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;

namespace CefSharp
{
    /// <summary>
    /// Event arguments to the FrameLoadStart event handler set up in IWebBrowser.
    /// </summary>
    public class FrameLoadStartEventArgs : EventArgs
    {
        /// <summary>
        /// Creates a new FrameLoadStart event args
        /// </summary>
        /// <param name="browser">browser</param>
        /// <param name="frame">frame</param>
        public FrameLoadStartEventArgs(IBrowser browser, IFrame frame)
        {
            Browser = browser;
            Frame = frame;
            Url = frame.Url;
        }

        /// <summary>
        /// The browser object
        /// </summary>
        public IBrowser Browser { get; private set; }

        /// <summary>
        /// The frame that just started loading.
        /// </summary>
        public IFrame Frame { get; private set; }

        /// <summary>
        /// The URL that was loaded.
        /// </summary>
        public string Url { get; private set; }
    }
}


text:
<component name="InspectionProjectProfileManager">
  <profile version="1.0">
    <option name="myName" value="Project Default" />
    <inspection_tool class="PyChainedComparisonsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
      <option name="ignoreConstantInTheMiddle" value="true" />
    </inspection_tool>
    <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
      <option name="ignoredPackages">
        <value>
          <list size="7">
            <item index="0" class="java.lang.String" itemvalue="kornia" />
            <item index="1" class="java.lang.String" itemvalue="tqdm" />
            <item index="2" class="java.lang.String" itemvalue="onnxruntime" />
            <item index="3" class="java.lang.String" itemvalue="tensorboard" />
            <item index="4" class="java.lang.String" itemvalue="opencv-python" />
            <item index="5" class="java.lang.String" itemvalue="torch" />
            <item index="6" class="java.lang.String" itemvalue="torchvision" />
          </list>
        </value>
      </option>
    </inspection_tool>
  </profile>
</component>


text:
<!--
Create tabs with an icon and label, using the tabs-positive style.
Each tab's child <ion-nav-view> directive will have its own
navigation history that also transitions its views in and out.
-->
<ion-tabs class="tabs-icon-top tabs-color-active-positive">

    <!-- Rooms List Tab -->
    <ion-tab title="Rooms" icon-off="ion-ios7-box-outline" icon-on="ion-ios7-box" href="#/tab/rooms">
        <ion-nav-view name="tab-rooms"></ion-nav-view>
    </ion-tab>

    <!-- Current Selected Chat Tab -->
    <ion-tab title="Chat" icon-off="ion-ios7-chatboxes-outline" icon-on="ion-ios7-chatboxes" href="#/tab/chat">
        <ion-nav-view name="tab-chat"></ion-nav-view>
    </ion-tab>

    <!-- Logout Button -->
    <ion-tab title="Logout" icon-off="ion-ios7-gear-outline" icon-on="ion-ios7-gear" ng-click="logout()" href="">
    </ion-tab>

</ion-tabs>


text:
Simple tool for preprocessing files with environment variables. May be useful for Docker containers run scripts for config files preprocessing.

Currently uses all available environment variables.

Usage:

```bash
$ ENV_VAR=value1 skabelon input.envtmpl output.conf
```

For input file like this
```
The variable $ENV_VAR is {{ .ENV_VAR }} and $SHELL is {{ .SHELL }}
```

Will be produced output
```
The variable $ENV_VAR is value1 and $SHELL is /bin/bash
```

## IMPROVEMENTS

 [x] Simple file processing

 [ ] stdin to stdout processing

 [ ] multiple file processing

 [ ] multiple template support, nested templates

 [ ] variables overrdiding and filtering


text:
function Get-Git-Commit
{
	$gitLog = git log --oneline -1
	return $gitLog.Split(' ')[0]
}

function Generate-Assembly-Info
{
param(
	[string]$clsCompliant = "true",
	[string]$title,
	[string]$description,
	[string]$company,
	[string]$product,
	[string]$copyright,
	[string]$version,
	[string]$file = $(throw "file is a required parameter.")
)
  $asmInfo = "using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: CLSCompliantAttribute($clsCompliant )]
[assembly: ComVisibleAttribute(false)]
[assembly: AssemblyTitleAttribute(""$title"")]
[assembly: AssemblyDescriptionAttribute(""$description"")]
[assembly: AssemblyCompanyAttribute(""$company"")]
[assembly: AssemblyProductAttribute(""$product"")]
[assembly: AssemblyCopyrightAttribute(""$copyright"")]
[assembly: AssemblyVersionAttribute(""$version"")]
[assembly: AssemblyInformationalVersionAttribute(""$version"")]
[assembly: AssemblyFileVersionAttribute(""$version"")]
[assembly: AssemblyDelaySignAttribute(false)]
"

	$dir = [System.IO.Path]::GetDirectoryName($file)
	if ([System.IO.Directory]::Exists($dir) -eq $false)
	{
		Write-Host "Creating directory $dir"
		[System.IO.Directory]::CreateDirectory($dir)
	}
	Write-Host "Generating assembly info file: $file"
	Write-Output $asmInfo > $file
}


text:
<?php
namespace Admin\Model;

class File
{
    public $fileId;
    public $filePath;
    public $fileName;
    public $fileWeight;
    public $fileType;
    public $fileInsert;
    public $fileOfferId;

    public function exchangeArray($data)
    {
        $this->fileId         = (!empty($data['fileId'])) ? $data['fileId'] : null;
        $this->filePath       = (!empty($data['filePath'])) ? $data['filePath'] : null;
        $this->fileName       = (!empty($data['fileName'])) ? $data['fileName'] : null;
        $this->fileWeight     = (!empty($data['fileWeight'])) ? $data['fileWeight'] : null;
        $this->fileType       = (!empty($data['fileType'])) ? $data['fileType'] : null;
        $this->fileInsert     = (!empty($data['fileInsert'])) ? $data['fileInsert'] : null;
        $this->fileOfferId    = (!empty($data['fileOfferId'])) ? $data['fileOfferId'] : null;

    }
}


text:
package org.pathwayeditor.metabolic.parser;

import org.pathwayeditor.metabolic.parser.MetabolicReaction;
import org.pathwayeditor.metabolic.parser.MetabolicRelation;

public class ReactionTestDouble extends MetabolicReaction
{

	public ReactionTestDouble(String id, String name, String asciiName) {
		super(id, name, asciiName);
	}

	public boolean addActivator(MetabolicRelation rel) {
		return super.addActivator(rel);
	}

	public boolean addCatalyst(MetabolicRelation rel) {
		return super.addCatalyst(rel);
	}

	public boolean addInhibitor(MetabolicRelation rel) {
		return super.addInhibitor(rel);
	}

	public boolean addProduct(MetabolicRelation rel) {
		return super.addProduct(rel);
	}

	public boolean addSubstrate(MetabolicRelation rel) {
		return super.addSubstrate(rel);
	}
}


text:
layout: post
title: Verunka & Joana lesbian fun
titleinfo: pornvd
desc: Watch Verunka & Joana lesbian fun. Pornhub is the ultimate xxx porn and sex site.
---

Verunka & Joana lesbian fun

Watch Verunka & Joana lesbian fun. Pornhub is the ultimate xxx porn and sex site.


text:
<?php

namespace Fedot\FootballManager\ValueObject;

class CoordinatesTest extends \PHPUnit_Framework_TestCase
{
    public function testCreateNew()
    {
        $coordinates = new Coordinates(400, 300);

        $this->assertInstanceOf(Coordinates::class, $coordinates);
    }

    public function testProperties()
    {
        $coordinates = new Coordinates(400, 300);

        $this->assertEquals(400, $coordinates->getX());
        $this->assertEquals(300, $coordinates->getY());
    }
}


text:
module WebSocket
  module Frame
    class Outgoing
      class Server < Outgoing
        def incoming_masking?
          @handler.masking?
        end

        def outgoing_masking?
          false
        end
      end
    end
  end
end


text:
layout: page
title: "Shi Song"
comments: true
description: "blanks"
keywords: "Shi Song,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: ATOC 1070

#### ATOC 1070: Weather and the Atmosphere Laboratory

**Terms taught**: Fall 2010, Spring 2011

**Instructor rating**: 4.11

**Standard deviation in instructor rating**: 0.44

**Average grade** (4.0 scale): 3.35

**Standard deviation in grades** (4.0 scale): 0.08

**Average workload** (raw): 1.66

**Standard deviation in workload** (raw): 0.04


text:
package ca.uhn.fhir.jpa.provider;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;

import javax.persistence.EntityManager;

import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.transaction.PlatformTransactionManager;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.config.TestDstu1Config;
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
import ca.uhn.fhir.model.dstu.composite.PeriodDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder;
import ca.uhn.fhir.model.dstu.resource.DocumentManifest;
import ca.uhn.fhir.model.dstu.resource.DocumentReference;
import ca.uhn.fhir.model.dstu.resource.Encounter;
import ca.uhn.fhir.model.dstu.resource.ImagingStudy;
import ca.uhn.fhir.model.dstu.resource.Location;
import ca.uhn.fhir.model.dstu.resource.Organization;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum;
import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum;
import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum;
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.client.IGenericClient;
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
import ca.uhn.fhir.rest.gclient.StringClientParam;
import ca.uhn.fhir.rest.gclient.TokenClientParam;
import ca.uhn.fhir.rest.server.FifoMemoryPagingProvider;
import ca.uhn.fhir.rest.server.IResourceProvider;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
import ca.uhn.fhir.util.TestUtil;

public class ResourceProviderDstu1Test  extends BaseJpaTest {

	private static AnnotationConfigApplicationContext ourAppCtx;
	private static IGenericClient ourClient;
	private static DaoConfig ourDaoConfig;
	private static FhirContext ourCtx = FhirContext.forDstu1();
	private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderDstu1Test.class);
	private static IFhirResourceDao<Organization> ourOrganizationDao;
	// private static IFhirResourceDao<Observation> ourObservationDao;
	// private static IFhirResourceDao<Patient> ourPatientDao;
	// private static IFhirResourceDao<Questionnaire> ourQuestionnaireDao;
	private static Server ourServer;
	private static String ourServerBase;
	private static CloseableHttpClient ourHttpClient;
	private static EntityManager ourEntityManager;
	private static PlatformTransactionManager ourTxManager;

	@AfterClass
	public static void afterClassClearContext() throws Exception {
		ourServer.stop();
		ourAppCtx.stop();
		TestUtil.clearAllStaticFieldsForUnitTest();
	}

	@Override
	protected FhirContext getContext() {
		return ourCtx;
	}

	// private static JpaConformanceProvider ourConfProvider;

	private void delete(String theResourceType, String theParamName, String theParamValue) {
		Bundle resources = ourClient.search().forResource(theResourceType).where(new StringClientParam(theParamName).matches().value(theParamValue)).execute();
		for (IResource next : resources.toListOfResources()) {
			ourLog.info("Deleting resource: {}", next.getId());
			ourClient.delete().resource(next).execute();
		}
	}

	private void deleteToken(String theResourceType, String theParamName, String theParamSystem, String theParamValue) {
		Bundle resources = ourClient.search().forResource(theResourceType).where(new TokenClientParam(theParamName).exactly().systemAndCode(theParamSystem, theParamValue)).execute();
		for (IResource next : resources.toListOfResources()) {
			ourLog.info("Deleting resource: {}", next.getId());
			ourClient.delete().resource(next).execute();
		}
	}

	@Test
	public void testCountParam() throws Exception {
		// NB this does not get used- The paging provider has its own limits built in
		ourDaoConfig.setHardSearchLimit(100);

		List<IResource> resources = new ArrayList<IResource>();
		for (int i = 0; i < 100; i++) {
			Organization org = new Organization();
			org.setName("testCountParam_01");
			resources.add(org);
		}
		ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute();

		Bundle found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("testCountParam_01")).count(10).execute();
		assertEquals(100, found.getTotalResults().getValue().intValue());
		assertEquals(10, found.getEntries().size());

		found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("testCountParam_01")).count(999).execute();
		assertEquals(100, found.getTotalResults().getValue().intValue());
		assertEquals(50, found.getEntries().size());

	}

	@Test
	public void testCreateWithClientSuppliedId() throws Exception {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testCreateWithId01");

		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testCreateWithId01");
		IIdType p1Id = ourClient.create().resource(p1).withId("testCreateWithId").execute().getId();

		assertThat(p1Id.getValue(), containsString("Patient/testCreateWithId/_history"));

		Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testCreateWithId01")).encodedJson().prettyPrint().execute();
		assertEquals(1, actual.size());
		assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart());

		/*
		 * ensure that trying to create the same ID again fails appropriately
		 */
		try {
			ourClient.create().resource(p1).withId("testCreateWithId").execute().getId();
			fail();
		} catch (UnprocessableEntityException e) {
			// good
		}

		Bundle history = ourClient.history(null, (String) null, null, null);

		assertEquals("Expected[" + p1Id.getIdPart() + "] but was " + history.getEntries().get(0).getId(), p1Id.getIdPart(), history.getEntries().get(0).getId().getIdPart());
		assertNotNull(history.getEntries().get(0).getResource());
	}

	@Test
	public void testDeepChaining() {
		delete("Location", Location.SP_NAME, "testDeepChainingL1");
		delete("Location", Location.SP_NAME, "testDeepChainingL2");
		deleteToken("Encounter", Encounter.SP_IDENTIFIER, "urn:foo", "testDeepChainingE1");

		Location l1 = new Location();
		l1.getNameElement().setValue("testDeepChainingL1");
		IIdType l1id = ourClient.create().resource(l1).execute().getId();

		Location l2 = new Location();
		l2.getNameElement().setValue("testDeepChainingL2");
		l2.getPartOf().setReference(l1id.toVersionless().toUnqualified());
		IIdType l2id = ourClient.create().resource(l2).execute().getId();

		Encounter e1 = new Encounter();
		e1.addIdentifier().setSystem("urn:foo").setValue("testDeepChainingE1");
		e1.getStatusElement().setValueAsEnum(EncounterStateEnum.IN_PROGRESS);
		e1.getClassElementElement().setValueAsEnum(EncounterClassEnum.HOME);
		ca.uhn.fhir.model.dstu.resource.Encounter.Location location = e1.addLocation();
		location.getLocation().setReference(l2id.toUnqualifiedVersionless());
		location.setPeriod(new PeriodDt().setStartWithSecondsPrecision(new Date()).setEndWithSecondsPrecision(new Date()));
		IIdType e1id = ourClient.create().resource(e1).execute().getId();

		//@formatter:off
		Bundle res = ourClient.search()
			.forResource(Encounter.class)
			.where(Encounter.IDENTIFIER.exactly().systemAndCode("urn:foo", "testDeepChainingE1"))
			.include(Encounter.INCLUDE_LOCATION_LOCATION)
			.include(Location.INCLUDE_PARTOF.asRecursive())
			.execute();
		//@formatter:on

		assertEquals(3, res.size());
		assertEquals(1, res.getResources(Encounter.class).size());
		assertEquals(e1id.toUnqualifiedVersionless(), res.getResources(Encounter.class).get(0).getId().toUnqualifiedVersionless());

	}

	/**
	 * See issue #52
	 */
	@Test
	public void testDiagnosticOrderResources() throws Exception {
		IGenericClient client = ourClient;

		int initialSize = client.search().forResource(DiagnosticOrder.class).execute().size();

		DiagnosticOrder res = new DiagnosticOrder();
		res.addIdentifier().setSystem("urn:foo").setValue( "123");

		client.create().resource(res).execute();

		int newSize = client.search().forResource(DiagnosticOrder.class).execute().size();

		assertEquals(1, newSize - initialSize);

	}

	/**
	 * See issue #52
	 */
	@Test
	public void testDocumentManifestResources() throws Exception {
		IGenericClient client = ourClient;

		int initialSize = client.search().forResource(DocumentManifest.class).execute().size();

		String resBody = IOUtils.toString(ResourceProviderDstu1Test.class.getResource("/documentmanifest.json"));
		client.create().resource(resBody).execute();

		int newSize = client.search().forResource(DocumentManifest.class).execute().size();

		assertEquals(1, newSize - initialSize);

	}

	/**
	 * See issue #52
	 */
	@Test
	public void testDocumentReferenceResources() throws Exception {
		IGenericClient client = ourClient;

		int initialSize = client.search().forResource(DocumentReference.class).execute().size();

		String resBody = IOUtils.toString(ResourceProviderDstu1Test.class.getResource("/documentreference.json"));
		client.create().resource(resBody).execute();

		int newSize = client.search().forResource(DocumentReference.class).execute().size();

		assertEquals(1, newSize - initialSize);

	}

	/**
	 * See issue #52
	 */
	@Test
	public void testImagingStudyResources() throws Exception {
		IGenericClient client = ourClient;

		int initialSize = client.search().forResource(ImagingStudy.class).execute().size();

		String resBody = IOUtils.toString(ResourceProviderDstu1Test.class.getResource("/imagingstudy.json"));
		client.create().resource(resBody).execute();

		int newSize = client.search().forResource(ImagingStudy.class).execute().size();

		assertEquals(1, newSize - initialSize);

	}

	@Test
	public void testSaveAndRetrieveExistingNarrative() {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSaveAndRetrieveExistingNarrative01");

		Patient p1 = new Patient();
		p1.getText().setStatus(NarrativeStatusEnum.GENERATED);
		p1.getText().getDiv().setValueAsString("
HELLO WORLD
");
		p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveExistingNarrative01");

		IIdType newId = ourClient.create().resource(p1).execute().getId();

		Patient actual = ourClient.read(Patient.class, (IdDt)newId);
		assertEquals("
HELLO WORLD
", actual.getText().getDiv().getValueAsString());
	}

	@Test
	public void testSaveAndRetrieveWithContained() {
		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveWithContained01");

		Organization o1 = new Organization();
		o1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveWithContained02");

		p1.getManagingOrganization().setResource(o1);

		IIdType newId = ourClient.create().resource(p1).execute().getId();

		Patient actual = ourClient.read(Patient.class, (IdDt)newId);
		assertEquals(1, actual.getContained().getContainedResources().size());
		assertThat(actual.getText().getDiv().getValueAsString(), containsString("Identifier	testSaveAndRetrieveWithContained01	"));

		Bundle b = ourClient.search().forResource("Patient").where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSaveAndRetrieveWithContained01")).execute();
		assertEquals(1, b.size());

	}

	@Test
	public void testSaveAndRetrieveWithoutNarrative() {
		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01");

		IIdType newId = ourClient.create().resource(p1).execute().getId();

		Patient actual = ourClient.read(Patient.class, (IdDt)newId);
		assertThat(actual.getText().getDiv().getValueAsString(), containsString("Identifier	testSearchByResourceChain01	"));
	}

	@Test
	public void testSearchByIdentifier() {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByIdentifier01");
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByIdentifier02");

		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01");
		p1.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01");
		IIdType p1Id = ourClient.create().resource(p1).execute().getId();

		Patient p2 = new Patient();
		p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02");
		p2.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02");
		ourClient.create().resource(p2).execute().getId();

		Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01")).encodedJson().prettyPrint().execute();
		assertEquals(1, actual.size());
		assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart());
	}

	@Test
	public void testSearchByIdentifierWithoutSystem() {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "", "testSearchByIdentifierWithoutSystem01");

		Patient p1 = new Patient();
		p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01");
		IIdType p1Id = ourClient.create().resource(p1).execute().getId();

		Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01")).encodedJson().prettyPrint().execute();
		assertEquals(1, actual.size());
		assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart());

	}

	@Test
	public void testSearchByResourceChain() {
		delete("Organization", Organization.SP_NAME, "testSearchByResourceChainName01");
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByResourceChain01");

		Organization o1 = new Organization();
		o1.setName("testSearchByResourceChainName01");
		IIdType o1id = ourClient.create().resource(o1).execute().getId().toUnqualifiedVersionless();

		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01");
		p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01");
		p1.setManagingOrganization(new ResourceReferenceDt(o1id.toUnqualifiedVersionless()));
		IIdType p1Id = ourClient.create().resource(p1).execute().getId();

		//@formatter:off
		Bundle actual = ourClient.search()
				.forResource(Patient.class)
				.where(Patient.PROVIDER.hasId(o1id.getIdPart()))
				.encodedJson().prettyPrint().execute();
		//@formatter:on
		assertEquals(1, actual.size());
		assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart());

		//@formatter:off
		actual = ourClient.search()
				.forResource(Patient.class)
				.where(Patient.PROVIDER.hasId(o1id.getValue()))
				.encodedJson().prettyPrint().execute();
		//@formatter:on
		assertEquals(1, actual.size());
		assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart());

	}

	@Test
	public void testSearchWithInclude() throws Exception {
		Organization org = new Organization();
		org.addIdentifier().setSystem("urn:system").setValue( "testSearchWithInclude01");
		IIdType orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId();

		Patient pat = new Patient();
		pat.addIdentifier().setSystem("urn:system").setValue("testSearchWithInclude02");
		pat.getManagingOrganization().setReference(orgId.toUnqualifiedVersionless());
		ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId();

		//@formatter:off
		Bundle found = ourClient
				.search()
				.forResource(Patient.class)
				.where(Patient.IDENTIFIER.exactly().systemAndIdentifier("urn:system","testSearchWithInclude02"))
				.include(Patient.INCLUDE_MANAGINGORGANIZATION)
				.execute();
		//@formatter:on

		assertEquals(2, found.size());
		assertEquals(Patient.class, found.getEntries().get(0).getResource().getClass());
		assertEquals(null, found.getEntries().get(0).getSearchMode().getValueAsEnum());
		assertEquals(null, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE));
		assertEquals(Organization.class, found.getEntries().get(1).getResource().getClass());
		assertEquals(null, found.getEntries().get(1).getSearchMode().getValueAsEnum());
		assertEquals(null, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE));
	}

	/**
	 * Test for issue #60
	 */
	@Test
	public void testStoreUtf8Characters() throws Exception {
		Organization org = new Organization();
		org.setName("測試醫院");
		org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01");
		IIdType orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId();

		// Read back directly from the DAO
		{
			Organization returned = ourOrganizationDao.read(orgId, mySrd);
			String val = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
			ourLog.info(val);
			assertThat(val, containsString("<name value=\"測試醫院\"/>"));
		}
		// Read back through the HTTP API
		{
			Organization returned = ourClient.read(Organization.class, (IdDt)orgId);
			String val = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
			ourLog.info(val);
			assertThat(val, containsString("<name value=\"測試醫院\"/>"));
		}
	}

	@Test
	public void testTryToCreateResourceWithReferenceThatDoesntExist() {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testTryToCreateResourceWithReferenceThatDoesntExist01");

		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testTryToCreateResourceWithReferenceThatDoesntExist01");
		p1.addName().addFamily("testTryToCreateResourceWithReferenceThatDoesntExistFamily01").addGiven("testTryToCreateResourceWithReferenceThatDoesntExistGiven01");
		p1.setManagingOrganization(new ResourceReferenceDt("Organization/99999999999"));

		try {
			ourClient.create().resource(p1).execute().getId();
			fail();
		} catch (InvalidRequestException e) {
			assertThat(e.getMessage(), containsString("Organization/99999999999"));
		}

	}

	@Test
	public void testUpdateRejectsInvalidTypes() throws InterruptedException {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testUpdateRejectsInvalidTypes");

		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes");
		p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes");
		IIdType p1id = ourClient.create().resource(p1).execute().getId();

		Organization p2 = new Organization();
		p2.getNameElement().setValue("testUpdateRejectsInvalidTypes");
		try {
			ourClient.update().resource(p2).withId("Organization/" + p1id.getIdPart()).execute();
			fail();
		} catch (UnprocessableEntityException e) {
			// good
		}

		try {
			ourClient.update().resource(p2).withId("Patient/" + p1id.getIdPart()).execute();
			fail();
		} catch (UnprocessableEntityException e) {
			// good
		}

	}

	@Test
	public void testUpdateWithClientSuppliedIdWhichDoesntExist() {
		deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testUpdateWithClientSuppliedIdWhichDoesntExist");

		Patient p1 = new Patient();
		p1.addIdentifier().setSystem("urn:system").setValue("testUpdateWithClientSuppliedIdWhichDoesntExist");
		MethodOutcome outcome = ourClient.update().resource(p1).withId("testUpdateWithClientSuppliedIdWhichDoesntExist").execute();
		assertEquals(true, outcome.getCreated().booleanValue());
		IIdType p1Id = outcome.getId();

		assertThat(p1Id.getValue(), containsString("Patient/testUpdateWithClientSuppliedIdWhichDoesntExist/_history"));

		Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testUpdateWithClientSuppliedIdWhichDoesntExist")).encodedJson().prettyPrint().execute();
		assertEquals(1, actual.size());
		assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart());

	}

	@Test
	public void testMetadata() throws Exception {
		HttpGet get = new HttpGet(ourServerBase + "/metadata");
		CloseableHttpResponse response = ourHttpClient.execute(get);
		try {
			String resp = IOUtils.toString(response.getEntity().getContent());
			ourLog.info(resp);
			assertEquals(200, response.getStatusLine().getStatusCode());
			assertThat(resp, stringContainsInOrder("THIS IS THE DESC"));
		} finally {
			IOUtils.closeQuietly(response.getEntity().getContent());
			response.close();
		}
	}

	@SuppressWarnings("unchecked")
	@BeforeClass
	public static void beforeClass() throws Exception {
		int port = RandomServerPortProvider.findFreePort();

		RestfulServer restServer = new RestfulServer(ourCtx);

		ourServerBase = "http://localhost:" + port + "/fhir/context";

		ourAppCtx = new AnnotationConfigApplicationContext(TestDstu1Config.class);

		ourDaoConfig = (DaoConfig) ourAppCtx.getBean(DaoConfig.class);
		ourOrganizationDao = (IFhirResourceDao<Organization>) ourAppCtx.getBean("myOrganizationDaoDstu1", IFhirResourceDao.class);
		ourEntityManager = ourAppCtx.getBean(EntityManager.class);
		ourTxManager = ourAppCtx.getBean(PlatformTransactionManager.class);

		List<IResourceProvider> rpsDev = (List<IResourceProvider>) ourAppCtx.getBean("myResourceProvidersDstu1", List.class);
		restServer.setResourceProviders(rpsDev);

		restServer.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());

		JpaSystemProviderDstu1 systemProv = ourAppCtx.getBean(JpaSystemProviderDstu1.class, "mySystemProviderDstu1");
		restServer.setPlainProviders(systemProv);

		restServer.setPagingProvider(new FifoMemoryPagingProvider(10));

		IFhirSystemDao<List<IResource>, MetaDt> systemDao = ourAppCtx.getBean(IFhirSystemDao.class);
		JpaConformanceProviderDstu1 confProvider = new JpaConformanceProviderDstu1(restServer, systemDao);
		confProvider.setImplementationDescription("THIS IS THE DESC");
		restServer.setServerConformanceProvider(confProvider);

		ourServer = new Server(port);

		ServletContextHandler proxyHandler = new ServletContextHandler();
		proxyHandler.setContextPath("/");

		ServletHolder servletHolder = new ServletHolder();
		servletHolder.setServlet(restServer);
		proxyHandler.addServlet(servletHolder, "/fhir/context/*");

		ourServer.setHandler(proxyHandler);
		ourServer.start();

		ourCtx.getRestfulClientFactory().setSocketTimeout(240 * 1000);
		ourClient = ourCtx.newRestfulGenericClient(ourServerBase);
		ourClient.registerInterceptor(new LoggingInterceptor(true));

		PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
		HttpClientBuilder builder = HttpClientBuilder.create();
		builder.setConnectionManager(connectionManager);
		ourHttpClient = builder.build();

	}

	@Before
	public void before() {
		super.purgeDatabase(ourEntityManager, ourTxManager);
	}

}


text:
package jobs_test

import (
	"testing"

	"github.com/golang/mock/gomock"
	"github.com/nanobox-io/nanobox-boxfile"

	dc "github.com/fsouza/go-dockerclient"
	"github.com/nanobox-io/nanobox-server/jobs"
	"github.com/nanobox-io/nanobox-server/util/docker"
	"github.com/nanobox-io/nanobox-server/util/docker/mock_docker"

	"github.com/nanobox-io/nanobox-server/util/fs"
	"github.com/nanobox-io/nanobox-server/util/fs/mock_fs"

	"github.com/nanobox-io/nanobox-server/util/script"
)

func TestDeployRemoveOldContainers(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	mDocker := mock_docker.NewMockDockerDefault(ctrl)
	docker.Default = mDocker

	mDocker.EXPECT().ListContainers("code", "build", "bootstrap", "dev", "tcp", "udp").Return([]*dc.Container{&dc.Container{ID: "1234", NetworkSettings: &dc.NetworkSettings{IPAddress: "1.2.3.4"}}}, nil)
	mDocker.EXPECT().RemoveContainer("1234")

	deploy := jobs.Deploy{}
	deploy.RemoveOldContainers()

}

func TestDeploySetupFs(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	mFs := mock_fs.NewMockFsUtil(ctrl)
	fs.FsDefault = mFs

	mFs.EXPECT().CreateDirs()
	mFs.EXPECT().Clean()

	deploy := jobs.Deploy{Reset: true}
	deploy.SetupFS()

}

func TestCreateBuildContainer(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	mDocker := mock_docker.NewMockDockerDefault(ctrl)
	docker.Default = mDocker

	gomock.InOrder(
		mDocker.EXPECT().ImageExists("nanobox/build").Return(false),
		mDocker.EXPECT().InstallImage("nanobox/build"),
		mDocker.EXPECT().CreateContainer(docker.CreateConfig{Image: "nanobox/build", Category: "build", UID: "build1"}),
	)

	deploy := jobs.Deploy{}
	deploy.CreateBuildContainer(boxfile.Boxfile{})

}

func TestSetupBuild(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	mFs := mock_fs.NewMockFsUtil(ctrl)
	fs.FsDefault = mFs

	mFs.EXPECT().UserPayload()

	names := []string{}
	script.Exec = func(name, container string, payload map[string]interface{}) ([]byte, error) {
		names = append(names, name)
		return []byte{}, nil
	}
	deploy := jobs.Deploy{}
	deploy.SetupBuild()
	expectedNames := []string{
		"default-user",
		"default-configure",
		"default-detect",
		"default-sync",
		"default-setup",
	}
	if len(names) != len(expectedNames) {
		t.Errorf("calls dont match the expected list of calls (%+v)", names)
		return
	}
	for i, name := range expectedNames {
		if names[i] != name {
			t.Errorf("I was expecting %s but got %s", name, names[i])
		}
	}
}

func TestRunBuild(t *testing.T) {
	names := []string{}
	script.Exec = func(name, container string, payload map[string]interface{}) ([]byte, error) {
		names = append(names, name)
		return []byte{}, nil
	}
	deploy := jobs.Deploy{Run: true}
	deploy.RunBuild()
	expectedNames := []string{
		"default-prepare",
		"default-build",
		"default-publish",
		"default-cleanup",
	}
	if len(names) != len(expectedNames) {
		t.Errorf("calls dont match the expected list of calls (%+v)", names)
		return
	}
	for i, name := range expectedNames {
		if names[i] != name {
			t.Errorf("I was expecting %s but got %s", name, names[i])
		}
	}
}

func TestRunDeployScripts(t *testing.T) {
	names := []string{}
	script.Exec = func(name, container string, payload map[string]interface{}) ([]byte, error) {
		names = append(names, name)
		return []byte{}, nil
	}
	deploy := jobs.Deploy{Run: true}
	deploy.RunDeployScripts("before", boxfile.New([]byte(`---
web1:
  before_deploy:
    - "php artisan migrate"
  before_deploy_all:
    - "php scripts/clear_cache.php"
`)))
	expectedNames := []string{
		"default-before_deploy",
	}
	if len(names) != len(expectedNames) {
		t.Errorf("calls dont match the expected list of calls (%+v)", names)
		return
	}
	for i, name := range expectedNames {
		if names[i] != name {
			t.Errorf("I was expecting %s but got %s", name, names[i])
		}
	}
}

func TestDefaultEVars(t *testing.T) {
	box := boxfile.New([]byte(`---
env:
  PORT: 3000
build:
  stability: beta
  engine: '../../../nanobox-engine-golang'
`))
	r := jobs.DefaultEVars(box)
	if r["PORT"] != "3000" {
		t.Error("Numeric ports are not being processed correctly")
	}
}


text:
@if "%_echo%"=="" echo off

::@echo ... Starting msbuild.exe (only) pupdate ...
echo Starting msbuild.exe (only) update...
setlocal

if exist xpupdate.log del xpupdate.log

for /f %%i in ('dir /b /ad /on %windir%\microsoft.net\framework\v4.*') do set fxpath=%windir%\microsoft.net\framework\%%i

call :Doit copy %_NTTREE%\bin\i386\msbuild.??? %fxpath% /y
call :Doit copy %_NTTREE%\bin\i386\msbuild.urt.config %fxpath%\msbuild.exe.config /y

@echo Now kicking off async refresh of native images ...

setlocal
set complus_installroot=
set complus_version=

 start "update native image for msbuildexe" /low /min %fxpath%\ngen install "%_NTTREE%\bin\i386\msbuild.exe"

endlocal

goto :eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:doit
echo %* >> xpupdate.log
%* >> xpupdate.log 2>&1 2>con
if errorlevel 1 echo Error running command "%*" >> xpupdate.log > con
goto :eof


text:
package frameWork;

import java.util.Map;
import java.util.TreeMap;

public class NumericalFeatureSummary  implements java.io.Serializable{
	/**
	 *
	 */
	public int myID=0;
	private static final long serialVersionUID = 1L;
	final int AbsValue=1;
	final int Count=2;
	public int Type=2;

	public TreeMap<Double, Stats> AbsValueMap = new TreeMap<Double, Stats>();
	double [] AbsValueMapFloat;
	public TreeMap<Double, Stats> CountMap = new TreeMap<Double, Stats>();
	double [] CountMapFloat;
	public double[] IDToValue;

	public void ReduceMap(int maxReduce, int goal, int ReduceLimit){
		ReduceMap(maxReduce, goal, ReduceLimit,AbsValueMap,1);
		ReduceMap(maxReduce, goal, ReduceLimit,CountMap,2);
	}

	private void ReduceMap(int maxReduce, int goal, int ReduceLimit,TreeMap<Double, Stats> desSortedMap, int type){
		while(desSortedMap.size()>ReduceLimit){
			ReduceMap(maxReduce, goal,desSortedMap, type);
		}
	}

	public int ValueToPosition(double value){

		if(Type==1){

			return ValueToPosition(value,AbsValueMapFloat);
			//return ValueToPosition(value,AbsValueMap);
		}else if(Type==2){

			return ValueToPosition(value,CountMapFloat);
			//return ValueToPosition(value,CountMap);
		}else{
			System.out.println("Error getting value from NumericalFeatureSummary");
			return -1;
		}
	}

	private int ValueToPosition(double value,double [] DoubleMap){

		int pos=DoubleMap.length/2;

		int diff=pos;
		double currentVal=DoubleMap[pos];
		int mixLimit=100;
		if(diff<mixLimit){
			for(int i=0;i<DoubleMap.length;i++){
				if(value<=DoubleMap[i]){
					return i;
				}
			}
		}

		while(true){
			if(value==currentVal){
				return pos;
			}
			diff/=2;

			if(value<currentVal){
				pos-=diff;

				if(pos-diff<10){
					pos=0;diff=0;
				}
				if(diff<mixLimit){
					for(int i=pos-diff;i<DoubleMap.length;i++){
						if(value<=DoubleMap[i]){
							return i;
						}
						if(i==DoubleMap.length-1){
							return i;
						}
					}
				}
			}else if(value>currentVal){
				if(diff<mixLimit){
					for(int i=pos-(diff/2)-2;i<DoubleMap.length;i++){
						if(value<=DoubleMap[i]){
							return i;
						}
						if(i==DoubleMap.length-1){
							return i;
						}
					}
				}
				pos+=diff;
			}
			currentVal=DoubleMap[pos];
		}

	}

	private int ValueToPosition(double value,TreeMap<Double, Stats> desSortedMap){
		for (Map.Entry<Double, Stats> entry : desSortedMap.entrySet()) {
			//System.out.println(entry.getKey()+"="+entry.getValue().position);
		}
		Double key=desSortedMap.floorKey(value);
		if(key==null){
			return 0;
		}
		return desSortedMap.get(key).position;
	}

	private double PositionToValue(int Position){
		return IDToValue[Position];
	}

	public void AddTargetValue(double value){

		AddTargetValue(value,AbsValueMap);
		AddTargetValue(value,CountMap);
	}

	private void AddTargetValue(double value,TreeMap<Double, Stats> desSortedMap){

		Double fKey=desSortedMap.floorKey(value);
		if(desSortedMap.isEmpty() || fKey==null){
			AddNewValue(value,desSortedMap);
		}else{
			if(desSortedMap.get(fKey).max>=value){

				IncrementValue(value,fKey,desSortedMap);
			}else{
				AddNewValue(value,desSortedMap);
			}
		}
	}

	public void Finalize(){
		AbsValueMapFloat=Finalize(AbsValueMap);
		CountMapFloat=Finalize(CountMap);

	}

	private double [] Finalize(TreeMap<Double, Stats> desSortedMap){
		int count=0;
		double [] DoubleMap=new double[desSortedMap.size()];

		for (Map.Entry<Double, Stats> entry : desSortedMap.entrySet()) {
			entry.getValue().position=count;
			DoubleMap[count]=entry.getKey();
			count++;
		}
		return DoubleMap;
	}

	public void ReduceMap(int maxReduce, int goal){

		ReduceMap(maxReduce,goal,AbsValueMap,1);
		ReduceMap(maxReduce,goal,CountMap,2);
		System.out.println(CountMap.size());
	}

	private void ReduceMap(int maxReduce, int goal,TreeMap<Double, Stats> desSortedMap, int type){
		while(desSortedMap.size()>goal){
			Map<Double, Stats[]> CostMap= getCostMap(desSortedMap,type);

			int count=0;

			count=0;
			int size=desSortedMap.size();
			for (Map.Entry<Double, Stats[]> entry : CostMap.entrySet()) {
				Stats pStats=entry.getValue()[0];
				Stats cStats=entry.getValue()[1];

				if(desSortedMap.containsKey(pStats.min)&& desSortedMap.containsKey(cStats.min)){
					//System.out.println(entry.getKey()+"\t"+prevF+"\t"+currentF);
					desSortedMap.remove(cStats.min);
					desSortedMap.remove(pStats.min);
					pStats.min=Math.min(pStats.min, cStats.min);
					pStats.max=Math.max(pStats.max, cStats.max);
					pStats.count+=cStats.count;
					pStats.sum+=cStats.sum;

					System.out.println(pStats.min);
					desSortedMap.put(pStats.min, pStats);
					count++;
					if(count>=maxReduce || size-count<=goal){
						break;
					}
				}
			}
		}
	}

	private Map<Double, Stats[]> getCostMap(TreeMap<Double, Stats> desSortedMap, int type){
		Map<Double, Stats[]> CostMap = new TreeMap<Double, Stats[]>();

		Stats prevStats=null;

		int count=0;
		for (Map.Entry<Double, Stats> entry : desSortedMap.entrySet()) {
			if(count>0){
				Stats currentStats=entry.getValue();

				double cost=0;
				if(type==1){
					cost=CostFunctionAbsDiff(currentStats,prevStats);
				}else if(type==2){
					cost=CostFunctionCount(currentStats,prevStats);
				}else{
					return null;
				}
				Stats [] TFloat=new Stats[2];
				TFloat[0]=prevStats;
				TFloat[1]=currentStats;
				CostMap.put(cost, TFloat);
			}
			prevStats=entry.getValue();
			count++;
		}
		return CostMap;
	}

	private void mergeStats(Stats s1,Stats s2,TreeMap<Double, Stats> desSortedMap){
		desSortedMap.remove(s1.min);
		desSortedMap.remove(s2.min);
		s1.min=Math.min(s1.min, s2.min);
		s1.max=Math.max(s1.max, s2.max);
		s1.count+=s2.count;
		s1.sum+=s2.sum;

		desSortedMap.put(s1.min, s1);
	}

	private void IncrementValue(double value, double key,TreeMap<Double, Stats> desSortedMap){
		Stats tStats=desSortedMap.get(key);
		tStats.count+=1;
		tStats.sum+=value;

		desSortedMap.put(key, tStats);
	}

	private void AddNewValue(double value,TreeMap<Double, Stats> desSortedMap){
		Stats tStats=new Stats();
		tStats.count=1;
		tStats.max=value;
		tStats.min=value;
		desSortedMap.put(value, tStats);
	}

	private double CostFunctionAbsDiff(Stats prev,Stats curr){
		double currentF=curr.sum/curr.count;
		double currentC=curr.count;
		double prevF=prev.sum/prev.count;
		double prevC=prev.count;
		double avg=currentF*currentC+prevF*prevC;
		avg=avg/(prevC+currentC);
		return (currentF-avg)*currentC+(prevF-avg)*prevC;
	}

	public double CostFunctionCount(Stats prev,Stats curr){
		return Math.min(prev.count, curr.count);
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <link rel="stylesheet" href="styles.css">
    <title>Using $http Service</title>

Using $http Service

List of Menu Categories

          ({{ category.short_name }})
          {{ category.name }}


text:
package org.zendesk.client.v2.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;

/**
 * @author stephenc
 * @since 05/04/2013 12:03
 */
public class Field {
    private Long id;
    private String url;
    private String type;
    private String title;
    private String description;
    private Integer position;
    private Boolean active;
    private Boolean required;
    private Boolean collapsedForAgents;
    private String regexpForValidation;
    private String titleInPortal;
    private Boolean visibleInPortal;
    private Boolean editableInPortal;
    private Boolean requiredInPortal;
    private String tag;
    private Date createdAt;
    private Date updatedAt;
    private List<Option> customFieldOptions;

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    @JsonProperty("collapsed_for_agents")
    public Boolean getCollapsedForAgents() {
        return collapsedForAgents;
    }

    public void setCollapsedForAgents(Boolean collapsedForAgents) {
        this.collapsedForAgents = collapsedForAgents;
    }

    @JsonProperty("created_at")
    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @JsonProperty("custom_field_options")
    public List<Option> getCustomFieldOptions() {
        return customFieldOptions;
    }

    public void setCustomFieldOptions(List<Option> customFieldOptions) {
        this.customFieldOptions = customFieldOptions;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @JsonProperty("editable_in_portal")
    public Boolean getEditableInPortal() {
        return editableInPortal;
    }

    public void setEditableInPortal(Boolean editableInPortal) {
        this.editableInPortal = editableInPortal;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    @JsonProperty("regexp_for_validation")
    public String getRegexpForValidation() {
        return regexpForValidation;
    }

    public void setRegexpForValidation(String regexpForValidation) {
        this.regexpForValidation = regexpForValidation;
    }

    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    @JsonProperty("required_in_portal")
    public Boolean getRequiredInPortal() {
        return requiredInPortal;
    }

    public void setRequiredInPortal(Boolean requiredInPortal) {
        this.requiredInPortal = requiredInPortal;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @JsonProperty("title_in_portal")
    public String getTitleInPortal() {
        return titleInPortal;
    }

    public void setTitleInPortal(String titleInPortal) {
        this.titleInPortal = titleInPortal;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @JsonProperty("updated_at")
    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @JsonProperty("visible_in_portal")
    public Boolean getVisibleInPortal() {
        return visibleInPortal;
    }

    public void setVisibleInPortal(Boolean visibleInPortal) {
        this.visibleInPortal = visibleInPortal;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("Field");
        sb.append("{active=").append(active);
        sb.append(", id=").append(id);
        sb.append(", url='").append(url).append('\'');
        sb.append(", type='").append(type).append('\'');
        sb.append(", title='").append(title).append('\'');
        sb.append(", description='").append(description).append('\'');
        sb.append(", position=").append(position);
        sb.append(", required=").append(required);
        sb.append(", collapsedForAgents=").append(collapsedForAgents);
        sb.append(", regexpForValidation='").append(regexpForValidation).append('\'');
        sb.append(", titleInPortal='").append(titleInPortal).append('\'');
        sb.append(", visibleInPortal=").append(visibleInPortal);
        sb.append(", editableInPortal=").append(editableInPortal);
        sb.append(", requiredInPortal=").append(requiredInPortal);
        sb.append(", tag='").append(tag).append('\'');
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", customFieldOptions=").append(customFieldOptions);
        sb.append('}');
        return sb.toString();
    }

    public static class Option {
        private String name;
        private String value;

        private Option() {
        }

        private Option(String name, String value) {
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder();
            sb.append("Option");
            sb.append("{name='").append(name).append('\'');
            sb.append(", value='").append(value).append('\'');
            sb.append('}');
            return sb.toString();
        }
    }
}


text: Examples of fractals wrtitten in python


text:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>@media and @-moz-document testcases</title>

<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">

  Mozilla Bug 511909

default style

This line should be pink

This line should be green

This line should be blue

@-moz-document {...}

This line should be pink

@media screen {...}

This line should be green

@-moz-document {
   @media screen {...}
}

This line should be blue

@media print {
  @-moz-document regexp("not_this_url"),}
    #mx {
        color: pink;
    }
  }
}

This line should be pink

@-moz-document regexp("not_this_url"){
  @media print ,}
    #mxx {
      color: blue;
    }
  }
}

This line should be blue

@media screen {
  @-moz-documen {...}
}

This line should be green

@media screen {
  @-moz-document {
    @media screen {...}
  }
}

This line should be blue


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.applicationinsights.fluent.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties that define a web test location available to an Application Insights Component. */
@Immutable
public final class ApplicationInsightsComponentWebTestLocationInner {
    /*
     * The display name of the web test location.
     */
    @JsonProperty(value = "DisplayName", access = JsonProperty.Access.WRITE_ONLY)
    private String displayName;

    /*
     * Internally defined geographic location tag.
     */
    @JsonProperty(value = "Tag", access = JsonProperty.Access.WRITE_ONLY)
    private String tag;

    /**
     * Get the displayName property: The display name of the web test location.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Get the tag property: Internally defined geographic location tag.
     *
     * @return the tag value.
     */
    public String tag() {
        return this.tag;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
package com.example.androidannotation;

import android.content.Context;
import org.androidannotations.api.builder.ServiceIntentBuilder;

public final class MyService_
    extends MyService
{

    public static MyService_.IntentBuilder_ intent(Context context) {
        return new MyService_.IntentBuilder_(context);
    }

    public static class IntentBuilder_
        extends ServiceIntentBuilder<MyService_.IntentBuilder_>
    {

        public IntentBuilder_(Context context) {
            super(context, MyService_.class);
        }

    }

}


text:
namespace biosim {
  namespace che {
    // molecule is a graph
    using molecule = boost::undirected_graph<che::atom, che::bond>;
  } // namespace che
} // namespace biosim

#endif // che_molecule_h


text:
package com.pineone.icbms.so.virtualobject;

import com.pineone.icbms.so.util.UtilApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.pineone.icbms.so.device.DeviceApplication;

@Configuration
@ComponentScan
@EnableAutoConfiguration
@Import({DeviceApplication.class, UtilApplication.class})
public class VirtualObjectApplication
{
    public static void main( String[] args )
    {
        SpringApplication.run(VirtualObjectApplication.class, args);
    }
}


text:
<!DOCTYPE html>

                <meta charset="utf-8">
                <title>Nuxeo 7.3 - New and Noteworthy</title>
                <meta name="description" content="Nuxeo on Github">
                <meta name="author" content="nuxeo">

                <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

                <link rel="stylesheet" href="../../stylesheets/base.css">
                <link rel="stylesheet" href="../../stylesheets/skeleton.css">
                <link rel="stylesheet" href="../../stylesheets/layout.css">
                <link rel="stylesheet" href="../../stylesheets/release_notes.css">
                <link rel="stylesheet" href="../../stylesheets/lightbox.css">

                <link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700' rel='stylesheet' type='text/css'>

                    <link rel="shortcut icon" href="images/favicon.ico">
                    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
                    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
                    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">

                        ← Back to Index

                        7.3 Release Notes

For Developers

                            Automation

Class Filter on Automation Scripting

                                It is no longer possible to perform Java imports from an Automation Script, as a class filter has been added to the Nashorn VM. This has been done for security and maintenance reasons.

Platform Functions Available in Automation Scripts

                            You can use Platform Functions under the Fn object like in Automation chains in Automation script, as it has been added to Nashorn context.

Helpers Automation

                            An extension point has been implemented to configure new function helpers to the automation module:

                                   <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent"
                     point="contextHelpers">
                                     <contextHelper id="Fn" class="org.nuxeo.ecm.automation.features.PlatformFunctions"/>
                                     </extension>

HTTP Helper

                                 A new helper for HTTP calls as been added. It can be used to perform external services API calls right from an automation script. See exemples for our documentation.

                            Elasticsearch

Elasticsearch API Passthrough

                                A proxy API has been implemented on the Nuxeo Platform so you can use native Elasticsearch GET queries as documented on the Elasticsearch documentation website. The proxy will ensure that only those documents each end user has the right to view are returned in search query results. Thanks to this feature, Elasticsearch-skilled developers can add the Nuxeo Platform in their architecture and benefit from a secure and modular content store with an extensible content management user interface, while still implementing their front office with JavaScript ES sdk.

                           Elasticsearch Hints

Elasticsearch hints have been added to NXQL and to the page provider object. It allows you to use native Elasticsearch operators in your query when using an Elasticsearch page provider. This will help you build content applications with fuzzy search support, phrase search, using specific tokenizers (arabic, chinese, phonems), as well as run geographical queries against the repository, such as searching for all photos that where taken within a scope of 5 miles around the Brooklyn bridge. It also allows you to hit specific index fields. The Nuxeo Studio Content View feature has been updated to support the declaration of Elasticsearch hints (operator, analyzer and field). Read the following documentation for more information.

 API Evolutions

File Support on Workflow API

                                You can  now upload a file for completing a task using Workflow REST API.

Reassign and Delegate Task Endpoints

                                 Workflow Rest API provides ways to reassign or delegate a given task.

Get Rendition Operation

                                This new operation allows you to fetch a given rendition on a document in input.

Conversion

                                A web adapter has been added on REST API: /@blob/file:content/@convert?format=pdf for getting a conversion of a binary property, given a converter or a target mime type (as parameters).

Workmanager Find Method

                                A Java method has been added on workmanager service for performing an optimized search of a given job.

JSON Export of Layout and Widgets

                                This new API endpoint allows you to get the layout and widgets instances serialization in JSON for helping you build specific front office UIs, while leveraging the forms and data display you have declared in Nuxeo Studio.

 UI

Pluggable File Widget

                                View mode of file widget is pluggable: you can contribute actions to display new links besides the file download link.

JavaScript List Widget

                                  A second implementation of the generic List widget is provided in JavaScript that fixes many bugs encountered on the initial implementation. This is the one used by default on Fast Track and it has been back ported as an option in 6.0.

REST Endpoint for CSS and JS Resources

        A new endpoint is available for serving CSS and REST resources on a web page of Nuxeo Platform Web UI. This is a first step of the refactoring that will lead to the removal of the use of the legacy Theme framework.

OAuth Service Providers Extension Point

                                It is possible to plug new OAuth Service providers with custom logic on parts where the protocol is not precise enough.

Web Components and Polymer

                                We have started to add Polymer dependencies to the build. You will notice a new tab for managing rights on a document now appears, but it is disabled by default, as this is still a work in progress using Polymer.

Removal / Deprecation

OpenSocial and dependencies have been removed from build.

CMF and dependencies have been removed from build.

Faceted Search is deprecated.

Placeful service was removed.


text:
'use strict';

import getCaretsAtTextNodePosition from "./getCaretsAtTextNodePosition.js";

export default function getCaretAtTextNodePosition(textNode, index, isWrapped) {
  if (!textNode) return null;
  const carets = getCaretsAtTextNodePosition(textNode, index);
  if (!isWrapped || carets.length === 1) {
    return carets[0];
  }
  return carets[carets.length - 1];
};


text:
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace SilverlightMappingToolBasic
{
    public class NodeRendererCollection : Dictionary<Guid, NodeRenderer>
    {
        public NodeRendererCollection()
            : base()
        {
        }

        public NodeRendererCollection(int capacity)
            : base(capacity)
        {
        }

        public NodeRendererCollection(IEqualityComparer<Guid> comparer)
            : base(comparer)
        {
        }

        public NodeRendererCollection(IDictionary<Guid, NodeRenderer> dictionary)
            : base(dictionary)
        {
        }

        public NodeRendererCollection(int capacity, IEqualityComparer<Guid> comparer)
            : base(capacity, comparer)
        {
        }

        public NodeRendererCollection(IDictionary<Guid, NodeRenderer> dictionary, IEqualityComparer<Guid> comparer)
            : base(dictionary, comparer)
        {
        }
    }
}


text:
/**
 * Custom styles for the blue swatch.
 */
body {
  background-image: url(../images/top_row_blue.jpg);
}
#account_section {
  background-image: url(../images/account_section_bg_blue.jpg);
}
a:link, a:visited {
	color: #0033cc;
}
a:hover {
  color: #990000;
}
.title {
  color: #555555;
}
.subtitle {
  color: #555555;
}
.main_tabset li.selected a {
  color: #003399;
}
.edit_submission h3 {
  color: #666666;
}
body .sortable div.row_content .system_field li {
  background-color: #d7eaf9;
}
.sortable .rows div.row_content .system_field li .scroll-content li {
  background-color: #e6f4ff;
}
.nav_link a:hover, body .nav_link_submenu a:hover {
  color: #003399;
  background-color: #dddddd;
}
.nav_link_submenu a:link, .nav_link_submenu a:visited {
  color: #789078;
}
.sortable_group_header, .sortable_group_footer {
  background-color: #D7EAF9;
}
tr.selected_row_color {
  background-color: #dbf1ff;
}
body .ui-widget-header {
  background: url(../images/popup_header_bg_grey.png) repeat-x scroll 50% 50%;
}
.inner_tabset .tab_row div.selected {
  color: #770000;
}
.prevnext_links span a:hover {
  background-color: #001d5e;
}
.sortable_group_header .sort:hover {
  background-color: #bad4e8;
}


text:
from .local import Local
from .fs import Fs
from .s3 import S3


text:
package org.elfwerks.sandbox.spel;

import static org.junit.Assert.*;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration // default context:  DemoSpringBeanTest-context.xml
public class DemoSpringBeanTest {

    @Resource
    protected DemoSpringBean testBean;

    @Test
    public void testGetName() {
        assertEquals("Configuration Name", testBean.getName());
    }

    @Test
    public void testGetVersion() {
        assertEquals("1.2.0", testBean.getVersion());
    }

    @Test
    public void testGetPort() {
        assertEquals(2120, testBean.getPort());
    }

    @Test
    public void testToString() {
        String str = testBean.toString();
        System.out.println(str);
        assertNotNull(str);
    }

}


text:
Extrude features based on their attributes.

![Image of feature layer extrusion](feature-layer-extrusion.png)

## Use case

Extrusion is the process of stretching a flat, 2D shape vertically to create a 3D object in a scene. For example, you can extrude building polygons by a height value to create three-dimensional building shapes.

## How to use the sample

Tap the toggle to switch between using population density and total population for extrusion. Higher extrusion directly corresponds to higher attribute values.

## How it works

1. Create a `ServiceFeatureTable` from a URL.
2. Create a feature layer from the service feature table.
   * Make sure to set the rendering mode to dynamic, `statesFeatureLayer.renderingMode = RenderingMode.DYNAMIC`.
3. Apply a `SimpleRenderer` to the feature layer.
4. Set the `ExtrusionMode` of the renderer with `renderer.sceneProperties.extrusionMode = SceneProperties.ExtrusionMode.BASE_HEIGHT`.
5. Set the extrusion expression of the renderer with `renderer.sceneProperties.extrusionExpression = "[POP2007]/ 10"`.

## Relevant API

* FeatureLayer
* Renderer.SceneProperties
* ServiceFeatureTable
* SimpleRenderer

## Tags

3D, extrude, extrusion, extrusion expression, height, renderer, scene


text:
declare function isBig(x: any): x is { big: true };
function bigger(this: {}) {
    if (isBig(this)) {
        this.big; // Expect property to exist
    }
}

function bar(this: string | number) {
    if (typeof this === "string") {
        const x: string = this;
    }
}


text:
package org.apache.axis.deployment.wsdd;

import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.utils.Messages;
import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;

import javax.xml.namespace.QName;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 *
 */
public class WSDDJAXRPCHandlerInfo
    extends WSDDElement
{
    private String _classname;
    private Map _map;
    private QName[] _headers;

    /**
     * Default constructor
     */
    public WSDDJAXRPCHandlerInfo()
    {
    }

    /**
     *
     * @param e (Element) XXX
     * @throws WSDDException XXX
     */
    public WSDDJAXRPCHandlerInfo(Element e)
        throws WSDDException
    {
        super(e);

        String classnameStr = e.getAttribute(ATTR_CLASSNAME);
        if (classnameStr != null && !classnameStr.equals("")) {
            _classname = classnameStr;
        }
        else
            throw new WSDDException(Messages.getMessage("noClassNameAttr00"));

        Element[] elements = getChildElements(e, ELEM_WSDD_PARAM);

        // instanciate an empty Map
        _map = new HashMap();
        if (elements.length != 0) {
            // Load up the map
            for (int i = 0; i < elements.length; i++) {
                Element param = elements[i];
                String pname = param.getAttribute(ATTR_NAME);
                String value = param.getAttribute(ATTR_VALUE);
                _map.put(pname, value);
            }
        }

        elements = getChildElements(e, ELEM_WSDD_JAXRPC_HEADER);
        if (elements.length != 0) {
            java.util.ArrayList headerList = new java.util.ArrayList();
            for (int i = 0; i < elements.length; i++) {
                Element qElem = elements[i];
                String headerStr = qElem.getAttribute(ATTR_QNAME);
                if (headerStr == null ||  headerStr.equals(""))
                    throw new WSDDException(Messages.getMessage("noValidHeader"));

                QName headerQName = XMLUtils.getQNameFromString(headerStr, qElem);
                if (headerQName != null)
                    headerList.add(headerQName);
            }
            QName[] headers = new QName[headerList.size()];
            _headers = (QName[]) headerList.toArray(headers);
        }
    }

    protected QName getElementName()
    {
        return QNAME_JAXRPC_HANDLERINFO;
    }

    public String getHandlerClassName() {
        return _classname;
    }

    public void setHandlerClassName(String classname) {
        _classname = classname;
    }

    public Map getHandlerMap() {
        return _map;
    }

    public void setHandlerMap(Map map) {
        _map = map;
    }

    public QName[] getHeaders() {
        return _headers;
    }

    public void setHeaders(QName[] headers) {
        _headers = headers;
    }

    public void writeToContext(SerializationContext context)
        throws IOException
    {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", ATTR_CLASSNAME, ATTR_CLASSNAME,
                   "CDATA", _classname);
    context.startElement(WSDDConstants.QNAME_JAXRPC_HANDLERINFO, attrs);

    Map ht =  _map;
    if (ht != null) {
        Set keys= ht.keySet();
        Iterator iter = keys.iterator();
        while (iter.hasNext()) {
            String name = (String) iter.next();
            String value = (String) ht.get(name);
            attrs = new AttributesImpl();
            attrs.addAttribute("",ATTR_NAME, ATTR_NAME, "CDATA", name);
            attrs.addAttribute("",ATTR_VALUE, ATTR_VALUE, "CDATA", value);
            context.startElement(WSDDConstants.QNAME_PARAM,attrs);
            context.endElement();
        }
    }

    if (_headers != null) {
        for (int i=0 ; i < _headers.length ; i++) {
        QName qname = _headers[i];
        attrs = new AttributesImpl();
        attrs.addAttribute("",ATTR_QNAME,ATTR_QNAME,"CDATA",context.qName2String(qname));
        context.startElement(WSDDConstants.QNAME_JAXRPC_HEADER,attrs);
        context.endElement();
        }
    }

    context.endElement();
    }

}


text:
// Require
var WebSocketServer = require('ws').Server;

// Config
var DEBUG = true;
var VERBOSE = true;
var PORT = 5500;
var EXPIRATION_MS = 1000 * 60 * 10;  // 10 minutes

/********************************* Helper *************************************/

function logVerbose(message) {
  if(VERBOSE) console.log(message);
}

function logDebug(message) {
  if(DEBUG) console.log(message);
}

function log(message) {
  console.log(message);
}

/********************************* Server *************************************/

var server;
var clients = [];

var clientFromSocket = function(socket) {
  for(var i = 0; i < clients.length; i += 1) {
    if(clients[i].socket == socket) {
      return clients[i];
    }
  }
  return null;
};

function handleTimedOut(client) {
  // Remove timed out client
  var index = clients.indexOf(client);
  if(index > -1) {
    log('Removing inactive client ' + client.id);
    client.socket.close();
    clearTimeout(client.timeoutId);
    clients.splice(index, 1);
    logVerbose('Total clients: ' + clients.length);
  } else {
    logVerbose('Expired client not found!');
  }
}

function refreshClientTimeout(client) {
  logVerbose('Refreshing client ' + client.id);
  clearTimeout(client.timeoutId);

  // Set a new one
  var timeoutId = setTimeout(handleTimedOut, EXPIRATION_MS, client);
  client.timeoutId = timeoutId;
}

function addClient(socket) {
  // Create new client object
  var client = {
    'id': Math.floor(Math.random() * 1000000),
    'socket': socket
  };
  // Set timeout ID
  var timeoutId = setTimeout(handleTimedOut, EXPIRATION_MS, client);
  client.timeoutId = timeoutId;
  clients.push(client);

  // Send back issued ID
  socket.send(JSON.stringify({ 'id': client.id }));
  log('Client ' + client.id + ' connected. Total clients: ' + clients.length);
}

function handleProtocol(socket, data) {
  var json = JSON.parse(data);
  logVerbose('Handing protocol');

  // Refresh this client
  refreshClientTimeout(clientFromSocket(socket));
}

function startServer() {
  server = new WebSocketServer({ 'port': PORT });
  server.on('connection', function (socket) {
    addClient(socket);
    onClientConnected(socket);
    socket.on('message', function(data) {
      logVerbose('onmessage');
      if(data) {
        handleProtocol(this, data);
        onClientMessage(this, data);
      }
    });
    socket.on('error', function() {
      logVerbose('onerror');
    });
    socket.on('close', function() {
      logVerbose('onclose');

      // Find client
      var client = clientFromSocket(this);
      log('Client ' + client.id + ' disconnected.');
      handleTimedOut(client);
      onClientDisconnected(client);
    });
  });
  onStartServer();
  log('Server ready on port ' + PORT);
}
startServer();

/**************************** Developer Implementation ************************/

/**
 * When the server starts
 */
function onStartServer() {

}

/**
 * Set up new client
 * socket - The web socket this client connected on
 */
function onClientConnected(socket) {

}

/**
 * Client has disconnected or timed out
 * client - The disconnected client object
 */
function onClientDisconnected(client) {

}

/**
 * React to message from client
 * socket - Web socket this message came from. Use to reply.
 * data - The data sent from the client in JSON string format
 */
function onClientMessage(socket, data) {

}


text:
<?php

namespace Kreait\Firebase\Exception\Auth;

use Kreait\Firebase\Exception\AuthException;
use Throwable;

class InvalidCustomToken extends AuthException
{
    const IDENTIFER = 'INVALID_CUSTOM_TOKEN';

    public function __construct($code = 0, Throwable $previous = null)
    {
        $message = 'Invalid custom token: The custom token format is incorrect or'
            .' the token is invalid for some reason (e.g. expired, invalid signature, etc.)';

        parent::__construct($message, $code, $previous);
    }
}


text:
from generator.actions import Actions, Variable
from random import choice, randint
from os.path import dirname, abspath, join
import sys

sys.path.append(join(dirname(dirname(dirname(abspath(__file__)))), "support"))
import support as sp
from common import DEBUG, CONFIG
from resort import Resort, Decider, Rider, Trail, Lift

class TemplatePoller(Actions):

    LOAD_DIGRAPH          =   '\xd0\xd1\xd2\xd3'
    LOAD_RIDER_GROUP      =   '\x40\x41\x42\x43'
    LOAD_RIDER_SINGLE     =   '\xe0\xe1\xe2\xe3'
    UNLOAD_RIDERS         =   '\xf0\xf1\xf2\xf3'
    START                 =   '\x10\x11\x12\x13'
    RESET                 =   '\x11\x22\x33\x11'
    LIFT_STATS            =   '\x11\x43\x34\x11'
    TRAIL_STATS           =   '\x77\x11\xee\x55'
    RIDER_STATS           =   '\x44\x11\x33\x55'

    OK      = ''
    ERR     = ''

    def _gen_status_msgs(self):
        ok = [0,0,0,0]
        err = [0,0,0,0]
        for idx in [c for c in range(len(self.magic_page)) if c % 2 == 0]:
            ok[idx % 4] ^= ord(self.magic_page[idx])
            err[(idx+1) % 4] ^= ord(self.magic_page[idx+1])
        self.OK  = ''.join([chr(c) for c in ok])
        self.ERR = ''.join([chr(c) for c in err])

    def _gen_random_rider(self):
        r_id = randint(0, 100000)
        while r_id in self.rider_ids:
            r_id = randint(0, 100000)
        self.rider_ids.add(r_id)
        rider = Rider(r_id)
        rider.gen_stats()
        return rider

    def start(self):
        #self.delay(100)
        if DEBUG:
            print "------- start -----------"
        self._gen_status_msgs()
        self.resort = Resort(flag_page=self.magic_page)
        self.rider_ids = set()

    def load_resort_digraph(self):
        '''
        Load a new resort digraph.
        '''
        if DEBUG:
            print "cmd: load resort digraph -----------"

        self.resort_size = 3
        self.resort_min_altitude = 5000
        self.resort_max_altitude = 15000

        # trash old digraph, but save and reset the riders
        self.resort.resort_reset()
        riders = self.resort.riders
        self.resort = Resort(self.resort_size, self.resort_min_altitude, self.resort_max_altitude, self.magic_page)
        self.resort.riders = riders

        self.resort.generate_random_layout()
        buf = self.LOAD_DIGRAPH + self.resort.generate_load_digraph_buffer()

        self.write(buf)
        self.read(length=len(self.OK), expect=self.OK)
        return 0

    def load_rider_group(self):
        '''
        Load a group of riders.
        '''
        if DEBUG:
            print "cmd: load rider group -----------"

        riders = []
        count = randint(10,200)
        # count = 20
        rider_buf = self.LOAD_RIDER_GROUP + sp.pack_single_uint32(count)
        for _ in range(count):
            r = self._gen_random_rider()
            riders.append(r)
            rider_buf += r.generate_load_buffer()

        self.resort.riders += riders
        self.resort.rider_count += len(riders)

        if DEBUG:
            print "Adding {0} riders".format(len(riders))
            for r in riders:
                print " [r{0}] added".format(r.id)

        self.write(rider_buf)
        self.read(length=len(self.OK), expect=self.OK)

        return 0

    def load_rider_single(self):
        '''
        Load one rider.
        '''
        if DEBUG:
            print "cmd: load rider single -----------"

        riders = []
        count = 1
        rider_buf = self.LOAD_RIDER_SINGLE + sp.pack_single_uint32(count)
        for _ in range(count):
            r = self._gen_random_rider()
            riders.append(r)
            rider_buf += r.generate_load_buffer()

        self.resort.riders += riders
        self.resort.rider_count += len(riders)

        if DEBUG:
            print " [r{0}] added".format(riders[0].id)

        self.write(rider_buf)
        self.read(length=len(self.OK), expect=self.OK)

        return 0

    def unload_riders(self):
        '''
        Reset simulation and delete all riders.
        '''
        if DEBUG:
            print "cmd: unload riders -----------"

        self.resort.resort_reset()
        self.resort.riders = []
        self.resort.rider_count = 0

        buf = self.UNLOAD_RIDERS
        self.write(buf)
        self.read(length=len(self.OK), expect=self.OK)

        return 0

    def start_simulation(self):
        '''
        Run the simulation for steps iterations.
        '''
        if DEBUG:
            print "cmd: start simulation -----------"

        steps = randint(1000, 2000)
        # steps = 10
        self.resort.run_sim(steps)

        self.write(self.START + sp.pack_single_uint32(steps))

        if 0 == self.resort.rider_count:
            self.read(length=len(self.ERR), expect=self.ERR)
            return -1

        self.read(length=len(self.OK), expect=self.OK)
        return 0

    def reset_simulation(self):
        '''
        Reset simulation, but do not delete any riders.
        '''
        if DEBUG:
            print "cmd: reset simulation -----------"

        self.resort.resort_reset()

        self.write(self.RESET)
        self.read(length=len(self.OK), expect=self.OK)

        return 0

    def lift_stats(self):
        '''
        Get the stats from the lifts (ID, rider_total)
        '''
        if DEBUG:
            print "cmd: lift stats -----------"

        self.write(self.LIFT_STATS)
        ls_buf = self.resort.lift_stats_buffer()
        if '' == ls_buf:
            self.read(length=len(self.ERR), expect=self.ERR)
            return -1
        else:
            self.read(length=len(ls_buf + self.OK), expect=ls_buf + self.OK)

        return 0

    def trail_stats(self):
        '''
        Get the stats from the trails (ID, rider_total)
        '''
        if DEBUG:
            print "cmd: trail stats -----------"

        self.write(self.TRAIL_STATS)
        s_buf = self.resort.trail_stats_buffer()
        if '' == s_buf:
            self.read(length=len(self.ERR), expect=self.ERR)
            return -1
        else:
            self.read(length=len(s_buf + self.OK), expect=s_buf + self.OK)

        return 0

    def rider_stats(self):
        '''
        Get the stats from the riders (ID, energy_level)
        '''
        if DEBUG:
            print "cmd: rider stats -----------"

        self.write(self.RIDER_STATS)
        s_buf = self.resort.rider_stats_buffer()
        if '' == s_buf:
            self.read(length=len(self.ERR), expect=self.ERR)
            return -1
        else:
            self.read(length=len(s_buf + self.OK), expect=s_buf + self.OK)

        return 0

    def full_set(self):
        self.load_resort_digraph()
        self.load_rider_group()
        if self.chance(0.7):
            self.start_simulation()
        if self.chance(0.6):
            fn = choice( [self.lift_stats, self.rider_stats, self.trail_stats] )
            fn()

        if self.chance(0.3):
            fn = choice( [self.reset_simulation, self.unload_riders] )
            fn()

            if self.chance(0.5):
                fn = choice( [self.lift_stats, self.rider_stats, self.trail_stats] )
                fn()

        return 0

    def quit(self):
        '''
        Quit cleanly
        '''
        if DEBUG:
            print "cmd: quit -----------"

        return -1

    def broker(self):
        '''
        Branching node for all nodes
        '''
        return 0


text:
module Azure::Compute::Mgmt::V2018_06_01
  module Models
    #
    # The parameters of a managed disk.
    #
    class ManagedDiskParameters < SubResource

      include MsRestAzure

      # @return [StorageAccountTypes] Specifies the storage account type for
      # the managed disk. NOTE: UltraSSD_LRS can only be used with data disks,
      # it cannot be used with OS Disk. Possible values include:
      # 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS'
      attr_accessor :storage_account_type

      #
      # Mapper for ManagedDiskParameters class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ManagedDiskParameters',
          type: {
            name: 'Composite',
            class_name: 'ManagedDiskParameters',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              storage_account_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'storageAccountType',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package com.jakewharton.rxbinding.widget;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.Spinner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public final class RxAdapterViewTestActivity extends Activity {
  Spinner spinner;
  ListView listView;

  List<String> values;
  ArrayAdapter<String> adapter;

  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    values = new ArrayList<>(Arrays.asList("One", "Two", "Three"));
    adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, values);

    spinner = new Spinner(this);
    spinner.setAdapter(adapter);

    listView = new ListView(this);
    listView.setAdapter(adapter);

    FrameLayout layout = new FrameLayout(this);
    layout.addView(spinner);
    layout.addView(listView);
    setContentView(layout);
  }
}


text:
module OCms
  module ExistsHelper
    def stylesheet_exists?(stylesheet)
      stylesheet = "#{Rails.root}/app/assets/stylesheets/#{stylesheet}.scss"
      extensions = %w(.scss .erb .scss.erb) + [""]
      extensions.inject(false) do |truth, extension|
        truth || File.exists?("#{stylesheet}#{extension}")
      end
    end

    def javascript_exists?(script)
      script = "#{Rails.root}/app/assets/javascripts/#{script}.js"
      extensions = %w(.coffee .erb .coffee.erb) + [""]
      extensions.inject(false) do |truth, extension|
        truth || File.exists?("#{script}#{extension}")
      end
    end
  end
end


text:
from __future__ import annotations

from collections.abc import Iterable, Sequence
from http import HTTPStatus
from json import dumps as dumps_json
from typing import Any

from werkzeug.wrappers import Request

from rouver.html import (
    created_at_page,
    see_other_page,
    temporary_redirect_page,
)
from rouver.status import status_line
from rouver.types import Header, StartResponse
from rouver.util import absolute_url

def _location_header(request: Request, url: str) -> Header:
    return "Location", absolute_url(request, url)

def respond(
    start_response: StartResponse,
    *,
    status: HTTPStatus = HTTPStatus.OK,
    content_type: str | None = None,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    """Prepare an empty WSGI response.

    >>> def handler(start_response, request):
    ...     return respond(start_response, status=HTTPStatus.ACCEPTED)

    The return value can be ignored to return an arbitrary response body.

    >>> def handler(start_response, request):
    ...     respond(start_response, content_type="text/plain")
    ...     return [b"My Response"]
    """

    sl = status_line(status)
    all_headers = list(extra_headers)
    if content_type is not None:
        if any(h.lower() == "content-type" for (h, _) in extra_headers):
            raise ValueError("duplicate Content-Type header")
        all_headers += [("Content-Type", content_type)]
    start_response(sl, all_headers)
    return []

def respond_with_content(
    start_response: StartResponse,
    content: bytes,
    *,
    status: HTTPStatus = HTTPStatus.OK,
    content_type: str = "application/octet-stream",
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    """Prepare an WSGI response.

    >>> def handler(start_response, request):
    ...     return respond_with_content(start_response, b"content")

    The response will include a Content-Type and a Content-Length header.

    """

    sl = status_line(status)
    headers = [
        ("Content-Type", content_type),
        ("Content-Length", str(len(content))),
    ] + list(extra_headers)
    start_response(sl, headers)
    return [content]

def respond_with_json(
    start_response: StartResponse,
    json: str | bytes | Any,
    *,
    status: HTTPStatus = HTTPStatus.OK,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    """Prepare a JSON WSGI response.

    >>> def handler(start_response, request):
    ...     return respond_with_json(start_response, {"foo": "bar"})

    The JSON text to return can be supplied as a string, as an UTF-8-encoded
    bytestring, or as any object that can be serialized using json.dumps().

    The default response status of "200 OK" can be overridden with the
    "status" keyword argument.
    """

    if isinstance(json, bytes):
        encoded = json
    elif isinstance(json, str):
        encoded = json.encode("utf-8")
    else:
        encoded = dumps_json(json).encode("utf-8")

    return respond_with_content(
        start_response,
        encoded,
        status=status,
        content_type="application/json; charset=utf-8",
        extra_headers=extra_headers,
    )

def respond_with_html(
    start_response: StartResponse,
    html: str,
    *,
    status: HTTPStatus = HTTPStatus.OK,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    """Prepare an HTML WSGI response.

    >>> def handler(start_response, request):
    ...     return respond_with_html(start_response, "
foo
")

    The default response status of "200 OK" can be overridden with the
    "status" keyword argument.
    """

    encoded = html.encode("utf-8")
    return respond_with_content(
        start_response,
        encoded,
        status=status,
        content_type="text/html; charset=utf-8",
        extra_headers=extra_headers,
    )

def created_at(
    request: Request,
    start_response: StartResponse,
    url_part: str,
    *,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    """Prepare a 201 Created WSGI response with a Location header.

    The default content-type is "text/html" and the return value generates
    a simple HTML body.
    """

    url = absolute_url(request, url_part)
    html = created_at_page(url)
    all_headers = [_location_header(request, url_part)] + list(extra_headers)
    return respond_with_html(
        start_response,
        html,
        status=HTTPStatus.CREATED,
        extra_headers=all_headers,
    )

def created_as_json(
    request: Request,
    start_response: StartResponse,
    url_part: str,
    json: str | bytes | Any,
    *,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    """
    Prepare a 201 Created WSGI response with a Location header and JSON body.
    """

    all_headers = [_location_header(request, url_part)] + list(extra_headers)
    return respond_with_json(
        start_response,
        json,
        status=HTTPStatus.CREATED,
        extra_headers=all_headers,
    )

def temporary_redirect(
    request: Request,
    start_response: StartResponse,
    url_part: str,
    *,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    url = absolute_url(request, url_part)
    html = temporary_redirect_page(url)
    all_headers = [_location_header(request, url_part)] + list(extra_headers)
    return respond_with_html(
        start_response,
        html,
        status=HTTPStatus.TEMPORARY_REDIRECT,
        extra_headers=all_headers,
    )

def see_other(
    request: Request,
    start_response: StartResponse,
    url_part: str,
    *,
    extra_headers: Sequence[Header] = [],
) -> Iterable[bytes]:
    url = absolute_url(request, url_part)
    html = see_other_page(url)
    all_headers = [_location_header(request, url_part)] + list(extra_headers)
    return respond_with_html(
        start_response,
        html,
        status=HTTPStatus.SEE_OTHER,
        extra_headers=all_headers,
    )