text:
package sorcer.pml.modeling;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sorcer.test.ProjectContext;
import org.sorcer.test.SorcerTestRunner;
import sorcer.core.context.model.ent.Proc;
import sorcer.core.context.model.ent.ProcModel;
import sorcer.service.Context;

import java.net.URL;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static sorcer.co.operator.*;
import static sorcer.co.operator.persistent;
import static sorcer.eo.operator.add;
import static sorcer.eo.operator.*;
import static sorcer.po.operator.add;
import static sorcer.po.operator.*;
import static sorcer.mo.operator.*;

/**
 * @author Mike Sobolewski
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
@RunWith(SorcerTestRunner.class)
@ProjectContext("examples/pml")
public class Procedures {
	private final static Logger logger = LoggerFactory.getLogger(Procedures.class.getName());

	@Test
	public void procScope() throws Exception {
		// a proc is a variable (entry) evaluated with its own scope (context)
		Context<Double> cxt = context(proc("x", 20.0), proc("y", 30.0));

		// proc with its context scope
		Proc add = proc("add", invoker("x + y", args("x", "y")), cxt);
		logger.info("proc eval: " + eval(add));
		assertTrue(eval(add).equals(50.0));
	}

	@Test
	public void contextScope() throws Exception {

		Context<Double> cxt = context(proc("x", 20.0), proc("y", 30.0));
		Proc add = proc("add", invoker("x + y", args("x", "y")), cxt);

		// adding a proc to the context updates proc's scope
		add(cxt, add);

		// evaluate the entry of the context
		logger.info("context add eval: " + value(cxt, "add"));
		assertTrue(value(cxt, "add").equals(50.0));

	}

	@Test
	public void closingParWihEntries() throws Exception {
		Proc y = proc("y",
				invoker("(x1 * x2) - (x3 + x4)", args("x1", "x2", "x3", "x4")));
		Object val = eval(y, val("x1", 10.0), val("x2", 50.0), val("x3", 20.0), val("x4", 80.0));
		// logger.info("y eval: " + val);
		assertEquals(val, 400.0);
	}

	@Test
	public void closingProcWitScope() throws Exception {

		// invokers use contextual scope of args
		Proc<?> add = proc("add", invoker("x + y", args("x", "y")));

		Context<Double> cxt = context(val("x", 10.0), val("y", 20.0));
		logger.info("proc eval: " + eval(add, cxt));
		// evaluate a proc
		assertTrue(eval(add, cxt).equals(30.0));

	}

	@Test
	public void dbParOperator() throws Exception {

		Proc<Double> dbp1 = persistent(proc("design/in", 25.0));
		Proc<String> dbp2 = dbEnt("url/sobol", "http://sorcersoft.org/sobol");

		assertTrue(asis(dbp1).equals(25.0));
		assertEquals(asis(dbp2).getClass(), URL.class);

		URL dbp1Url = storeArg(dbp1);
		URL dbp2Url = storeArg(dbp2);

		assertTrue(content(dbp1Url).equals(25.0));
		assertEquals(content(dbp2Url), "http://sorcersoft.org/sobol");

		assertTrue(eval(dbp1).equals(25.0));
		assertEquals(eval(dbp2), "http://sorcersoft.org/sobol");

		// update persistent values
		setValue(dbp1, 30.0);
		setValue(dbp2, "http://sorcersoft.org");

		assertTrue(content(storeArg(dbp1)).equals(30.0));
		assertEquals(content(storeArg(dbp2)), "http://sorcersoft.org");

		assertEquals(asis(dbp1).getClass(), URL.class);
		assertEquals(asis(dbp2).getClass(), URL.class);

	}

	@Test
	public void procFidelities() throws Exception {

		Proc<Double> dbp = dbEnt("shared/eval", 25.0);

		Proc multi = proc("multi",
				pFi(ent("init/eval"),
				dbp,
				proc("invoke", invoker("x + y", args("x", "y")))));

		Context<Double> cxt = context(proc("x", 10.0),
				proc("y", 20.0), proc("init/eval", 49.0));

		setValue(dbp, 50.0);

		assertTrue(eval(multi, cxt, pFi("shared/eval")).equals(50.0));

		assertTrue(eval(multi, cxt, pFi("init/eval")).equals(49.0));

		assertTrue(eval(multi, cxt, pFi("invoke")).equals(30.0));

	}

	@Test
	public void procModelOperator() throws Exception {

		ProcModel pm = procModel("proc-model", proc("v1", 1.0), proc("v2", 2.0));
		add(pm, proc("x", 10.0), proc("y", 20.0));
		// add an active proc, no scope
		add(pm, invoker("add1", "x + y", args("x", "y")));
		// add a proc with own scope
		add(pm, proc(invoker("add2", "x + y", args("x", "y")), context(proc("x", 30), proc("y", 40.0))
		));

		assertEquals(value(pm, "add1"), 30.0);
		// change the scope of add1
		setValue(pm, "x", 20.0);
		assertEquals(value(pm, "add1"), 40.0);

		assertEquals(value(pm, "add2"), 70.0);
		// x is changed but add2 eval is the same, has its own scope
		setValue(pm, "x", 20.0);
		assertEquals(value(pm, "add2"), 70.0);

	}
}


text:
package weixin.popular.bean.pay;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class PayWarn {

	@XmlElement(name="AppId")
	private String appid;

	@XmlElement(name="ErrorType")
	private String errortype;

	@XmlElement(name="Description")
	private String description;

	@XmlElement(name="AlarmContent")
	private String alarmcontent;

	@XmlElement(name="TimeStamp")
	private String timestamp;

	@XmlElement(name="AppSignature")
	private String appsignature;

	@XmlElement(name="SignMethod")
	private String signmethod;

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getErrortype() {
		return errortype;
	}

	public void setErrortype(String errortype) {
		this.errortype = errortype;
	}

	public String getDescription() {
		return description;
	}

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

	public String getAlarmcontent() {
		return alarmcontent;
	}

	public void setAlarmcontent(String alarmcontent) {
		this.alarmcontent = alarmcontent;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public String getAppsignature() {
		return appsignature;
	}

	public void setAppsignature(String appsignature) {
		this.appsignature = appsignature;
	}

	public String getSignmethod() {
		return signmethod;
	}

	public void setSignmethod(String signmethod) {
		this.signmethod = signmethod;
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.opengamma.integration.tool.portfolio.xml.v1_0.conversion;

import org.threeten.bp.ZoneOffset;

import com.opengamma.financial.security.option.EquityIndexOptionSecurity;
import com.opengamma.financial.security.option.ExerciseType;
import com.opengamma.id.ExternalId;
import com.opengamma.integration.tool.portfolio.xml.v1_0.jaxb.OptionSecurityDefinition;
import com.opengamma.master.security.ManageableSecurity;
import com.opengamma.util.time.Expiry;
import com.opengamma.util.time.ExpiryAccuracy;

/**
 * Extractor for option securities.
 */
public class ListedOptionSecurityExtractor extends AbstractListedSecurityExtractor<OptionSecurityDefinition> {

  /**
   * Creates an instance.
   *
   * @param securityDefinition  the definition, not null
   */
  public ListedOptionSecurityExtractor(OptionSecurityDefinition securityDefinition) {
    super(securityDefinition);
  }

  //-------------------------------------------------------------------------
  @Override
  protected ManageableSecurity createSecurity() {
    OptionSecurityDefinition defn = getSecurityDefinition();
    switch (defn.getListedOptionType()) {
      case EQUITY_DIVIDEND_OPTION:
        throw new PortfolioParsingException("EquityIndexDividendOption is not yet supported");
      case EQUITY_INDEX_OPTION:
        ExternalId underlyingId = defn.getUnderlyingId().toExternalId();
        ExerciseType exerciseType = defn.getExerciseType().convert();

        // We are only give month/year (e.g. MAR13) so arbitrarily use the first day of
        // the month but set the accuracy to reflect that
        Expiry expiry = new Expiry(defn.getOptionExpiry().atDay(1).atStartOfDay(ZoneOffset.UTC),
                                   ExpiryAccuracy.MONTH_YEAR);

        return new EquityIndexOptionSecurity(defn.getOptionType(),
                                             defn.getStrike().doubleValue(),
                                             defn.getCurrency(),
                                             underlyingId,
                                             exerciseType,
                                             expiry,
                                             defn.getPointValue(),
                                             defn.getExchange());
      default:
        // Should be prevented by XML parsing
        throw new PortfolioParsingException("Unrecognised listed option type: " + defn.getListedOptionType());
    }
  }

}


text:
[![Latest Stable Version](https://poser.pugx.org/phrlog/geofixer/v/stable)](https://packagist.org/packages/phrlog/geofixer)
[![Build Status](https://travis-ci.org/Phrlog/GeoFixer.svg?branch=master)](https://travis-ci.org/Phrlog/GeoFixer)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Phrlog/GeoFixer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Phrlog/GeoFixer/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/Phrlog/GeoFixer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Phrlog/GeoFixer/?branch=master)
[![License](https://poser.pugx.org/phrlog/geofixer/license)](https://packagist.org/packages/phrlog/geofixer)

## Description | Описание

Geofixer is a helper for fuzzy string search of words on the available arrays or the FIAS database

Geofixer — помощник для нечеткого поиска слов по имеющимся массивам или базе ФИАС

## Docs | Документация
* [Documentation](docs/EN.md)
* [Документация](docs/RU.md)

## License | Лицензия

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details


text:
export const scale = {
    header: `uniform vec2 uScale;`,
    body: `gl_Position.xy = gl_Position.xy * uScale;`
};

export const translate = {
    header: `uniform vec2 uTranslate;`,
    body: `gl_Position.xy = gl_Position.xy + uTranslate;`
};

export const multiColor = {
    header: `attribute vec4 aColor;
             varying vec4 vColor;`,
    body: `vColor = aColor;`
};

export const fillColor = {
    header: `attribute vec4 aFillColor;
             varying vec4 vFillColor;`,
    body: `vFillColor = aFillColor;`
};

export const strokeColor = {
    header: `attribute vec4 aStrokeColor;
             varying vec4 vStrokeColor;`,
    body: `vStrokeColor = aStrokeColor;`
};

export const circle = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = 2.0 * sqrt(aSize / 3.14159);
        gl_PointSize = vSize + uStrokeWidth + 1.0;
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const star = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = 4.0 * sqrt(aSize / 3.14159);
        gl_PointSize = vSize + uStrokeWidth + 1.0;
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const wye = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = 3.0 * sqrt(aSize / 3.14159);
        gl_PointSize = vSize + uStrokeWidth + 1.0;
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const square = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = sqrt(aSize);
        gl_PointSize = vSize + uStrokeWidth + 1.0;
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const diamond = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = sqrt(aSize);
        gl_PointSize = 2.0 * (vSize + uStrokeWidth + 1.0);
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const triangle = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = sqrt((16.0 * aSize) / (3.0 * sqrt(3.0)));
        gl_PointSize = vSize + uStrokeWidth + 1.0;
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const cross = {
    header: `
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aSize;
        attribute float aDefined;

        uniform float uStrokeWidth;

        varying float vSize;
        varying float vStrokeWidthRatio;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vSize = 3.0 * sqrt(aSize / 5.0);
        vStrokeWidthRatio = uStrokeWidth / (vSize + uStrokeWidth + 1.0);
        gl_PointSize = vSize + uStrokeWidth + 1.0;
        gl_Position = vec4(aCrossValue, aMainValue, 0, 1);`
};

export const candlestick = {
    header: `
        attribute float aCrossValue;
        attribute float aBandwidth;
        attribute float aHighValue;
        attribute float aOpenValue;
        attribute float aCloseValue;
        attribute float aLowValue;
        attribute vec3 aCorner;
        attribute float aDefined;

        uniform vec2 uScreen;
        uniform float uStrokeWidth;

        varying float vColorIndicator;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vColorIndicator = sign(aCloseValue - aOpenValue);

        float isPositiveY = (sign(aCorner.y) + 1.0) / 2.0;
        float isNotPositiveY = 1.0 - isPositiveY;
        float isExtremeY = abs(aCorner.y) - 1.0;
        float isNotExtremeY = 1.0 - isExtremeY;
        float yValue =
         (isPositiveY * isExtremeY * aLowValue) +
         (isPositiveY * isNotExtremeY * aCloseValue) +
         (isNotPositiveY * isNotExtremeY * aOpenValue) +
         (isNotPositiveY * isExtremeY * aHighValue);

        float lineWidthXDirection = (isNotExtremeY * aCorner.x) + (isExtremeY * aCorner.z);
        float lineWidthYDirection = isNotExtremeY * sign(aCloseValue - aOpenValue) * aCorner.y;

        float bandwidthModifier = aBandwidth * aCorner.x / 2.0;

        float xModifier = (uStrokeWidth * lineWidthXDirection / 2.0) + bandwidthModifier;
        float yModifier = uStrokeWidth * lineWidthYDirection / 2.0;

        gl_Position = vec4(aCrossValue, yValue, 0, 1);`
};

export const ohlc = {
    header: `
        attribute float aCrossValue;
        attribute float aBandwidth;
        attribute float aHighValue;
        attribute float aOpenValue;
        attribute float aCloseValue;
        attribute float aLowValue;
        attribute vec3 aCorner;
        attribute float aDefined;

        uniform vec2 uScreen;
        uniform float uStrokeWidth;

        varying float vColorIndicator;
        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        vColorIndicator = sign(aCloseValue - aOpenValue);

        float isPositiveY = (sign(aCorner.y) + 1.0) / 2.0;
        float isNotPositiveY = 1.0 - isPositiveY;
        float isExtremeY = abs(aCorner.y) - 1.0;
        float isNotExtremeY = 1.0 - isExtremeY;
        float yValue =
            (isPositiveY * isExtremeY * aLowValue) +
            (isPositiveY * isNotExtremeY * aCloseValue) +
            (isNotPositiveY * isNotExtremeY * aOpenValue) +
            (isNotPositiveY * isExtremeY * aHighValue);

        float lineWidthXDirection = isExtremeY * aCorner.z;
        float lineWidthYDirection = isNotExtremeY * aCorner.z;

        float bandwidthModifier = isNotExtremeY * aCorner.x * aBandwidth / 2.0;

        float xModifier = (uStrokeWidth * lineWidthXDirection / 2.0) + bandwidthModifier;
        float yModifier = uStrokeWidth * lineWidthYDirection / 2.0;

        gl_Position = vec4(aCrossValue, yValue, 0, 1);`
};

export const bar = {
    header: `
        attribute float aCrossValue;
        attribute float aBandwidth;
        attribute float aMainValue;
        attribute float aBaseValue;
        attribute vec2 aCorner;
        attribute float aDefined;

        uniform vec2 uScreen;
        uniform float uStrokeWidth;

        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        float isBaseline = (1.0 - aCorner.y) / 2.0;
        float yValue = (isBaseline * aBaseValue) + ((1.0 - isBaseline) * aMainValue);

        float xModifier = aCorner.x * (aBandwidth) / 2.0;

        gl_Position = vec4(aCrossValue, yValue, 0, 1);`
};

export const preScaleLine = {
    header: `
        attribute vec3 aCorner;
        attribute float aCrossNextNextValue;
        attribute float aMainNextNextValue;
        attribute float aCrossNextValue;
        attribute float aMainNextValue;
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aCrossPrevValue;
        attribute float aMainPrevValue;
        attribute float aDefined;
        attribute float aDefinedNext;

        uniform float uStrokeWidth;
        uniform vec2 uScreen;

        varying float vDefined;`,
    body: `
        vDefined = aDefined * aDefinedNext;
        vec4 prev = vec4(aCrossPrevValue, aMainPrevValue, 0, 0);
        vec4 curr = vec4(aCrossValue, aMainValue, 0, 0);
        gl_Position = vec4(aCrossNextValue, aMainNextValue, 0, 1);
        vec4 nextNext = vec4(aCrossNextNextValue, aMainNextNextValue, 0, 0);`
};

export const postScaleLine = {
    body: `
        vec4 currVertexPosition = gl_Position;
        vec4 nextVertexPosition = gl_Position;

        if (all(equal(curr.xy, prev.xy))) {
            prev.xy = curr.xy + normalize(curr.xy - currVertexPosition.xy);
        }
        if (all(equal(curr.xy, currVertexPosition.xy))) {
            currVertexPosition.xy = curr.xy + normalize(curr.xy - prev.xy);
        }
        vec2 A = normalize(normalize(curr.xy - prev.xy) * uScreen);
        vec2 B = normalize(normalize(currVertexPosition.xy - curr.xy) * uScreen);
        vec2 tangent = normalize(A + B);
        vec2 miter = vec2(-tangent.y, tangent.x);
        vec2 normalA = vec2(-A.y, A.x);
        float miterLength = 1.0 / dot(miter, normalA);
        vec2 point = normalize(A - B);
        if (miterLength > 10.0 && sign(aCorner.x * dot(miter, point)) > 0.0) {
            currVertexPosition.xy = curr.xy - (aCorner.x * aCorner.y * uStrokeWidth * normalA) / uScreen.xy;
        } else {
            currVertexPosition.xy = curr.xy + (aCorner.x * miter * uStrokeWidth * miterLength) / uScreen.xy;
        }

        if (all(equal(nextVertexPosition.xy, curr.xy))) {
            curr.xy = nextVertexPosition.xy + normalize(nextVertexPosition.xy - nextNext.xy);
        }
        if (all(equal(nextVertexPosition.xy, nextNext.xy))) {
            nextNext.xy = nextVertexPosition.xy + normalize(nextVertexPosition.xy - curr.xy);
        }
        vec2 C = normalize(normalize(nextVertexPosition.xy - curr.xy) * uScreen);
        vec2 D = normalize(normalize(nextNext.xy - nextVertexPosition.xy) * uScreen);
        vec2 tangentCD = normalize(C + D);
        vec2 miterCD = vec2(-tangentCD.y, tangentCD.x);
        vec2 normalC = vec2(-C.y, C.x);
        float miterCDLength = 1.0 / dot(miterCD, normalC);
        vec2 pointCD = normalize(C - D);
        if (miterCDLength > 10.0 && sign(aCorner.x * dot(miterCD, pointCD)) > 0.0) {
            nextVertexPosition.xy = nextVertexPosition.xy - (aCorner.x * aCorner.y * uStrokeWidth * normalC) / uScreen.xy;
        } else {
            nextVertexPosition.xy = nextVertexPosition.xy + (aCorner.x * miterCD * uStrokeWidth * miterCDLength) / uScreen.xy;
        }

        gl_Position.xy = ((1.0 - aCorner.z) * currVertexPosition.xy) + (aCorner.z * nextVertexPosition.xy);`
};

export const errorBar = {
    header: `
        attribute vec3 aCorner;
        attribute float aCrossValue;
        attribute float aBandwidth;
        attribute float aHighValue;
        attribute float aLowValue;
        attribute float aDefined;

        uniform vec2 uScreen;
        uniform float uStrokeWidth;

        varying float vDefined;`,
    body: `
        vDefined = aDefined;
        float isLow = (aCorner.y + 1.0) / 2.0;
        float yValue = isLow * aLowValue + (1.0 - isLow) * aHighValue;

        float isEdgeCorner = abs(aCorner.x);
        float lineWidthXDirection = (1.0 - isEdgeCorner) * aCorner.z;
        float lineWidthYDirection = isEdgeCorner * aCorner.z;

        gl_Position = vec4(aCrossValue, yValue, 0, 1);

        float xModifier = (uStrokeWidth * lineWidthXDirection) + (aBandwidth * aCorner.x / 2.0);
        float yModifier = (uStrokeWidth * lineWidthYDirection);`
};

export const area = {
    header: `
        attribute vec3 aCorner;
        attribute float aCrossValue;
        attribute float aMainValue;
        attribute float aCrossNextValue;
        attribute float aMainNextValue;
        attribute float aBaseValue;
        attribute float aBaseNextValue;
        attribute float aDefined;
        attribute float aDefinedNext;

        varying float vDefined;

        float when_lt(float a, float b) {
            return max(sign(b - a), 0.0);
        }

        float and(float a, float b) {
            return a * b;
        }`,
    body: `
        vDefined = aDefined * aDefinedNext;
        gl_Position = vec4(0, 0, 0, 1);

        float hasIntercepted = when_lt((aMainNextValue - aBaseNextValue) * (aMainValue - aBaseValue), 0.0);
        float useIntercept = and(aCorner.z, hasIntercepted);

        float yGradient = (aMainNextValue - aMainValue) / (aCrossNextValue - aCrossValue);
        float yConstant = aMainNextValue - (yGradient * aCrossNextValue);

        float y0Gradient = (aBaseNextValue - aBaseValue) / (aCrossNextValue - aCrossValue);
        float y0Constant = aBaseNextValue - (y0Gradient * aCrossNextValue);

        float denominator = (yGradient - y0Gradient) + step(abs(yGradient - y0Gradient), 0.0);
        float interceptXValue = (y0Constant - yConstant) / denominator;
        float interceptYValue = (yGradient * interceptXValue) + yConstant;

        gl_Position = vec4(interceptXValue * useIntercept, interceptYValue * useIntercept, 0, 1);

        gl_Position.x += (1.0 - useIntercept) * ((aCorner.x * aCrossNextValue) + ((1.0 - aCorner.x) * aCrossValue));
        gl_Position.y += (1.0 - useIntercept) * (1.0 - aCorner.y) * ((aCorner.x * aMainNextValue) + ((1.0 - aCorner.x) * aMainValue));
        gl_Position.y += (1.0 - useIntercept) * aCorner.y * ((aCorner.x * aBaseNextValue) + ((1.0 - aCorner.x) * aBaseValue));`
};

export const boxPlot = {
    header: `
        attribute vec4 aCorner;
        attribute float aCrossValue;
        attribute float aBandwidth;
        attribute float aCapWidth;
        attribute float aHighValue;
        attribute float aUpperQuartileValue;
        attribute float aMedianValue;
        attribute float aLowerQuartileValue;
        attribute float aLowValue;
        attribute float aDefined;

        uniform vec2 uScreen;
        uniform float uStrokeWidth;

        varying float vDefined;
    `,
    body: `
        vDefined = aDefined;
        float isExtremeY = sign(abs(aCorner.y) - 2.0) + 1.0;
        float isNotExtremeY = 1.0 - isExtremeY;

        float isNonZeroY = abs(sign(aCorner.y));
        float isZeroY = 1.0 - isNonZeroY;

        float isQuartileY = isNotExtremeY * isNonZeroY;

        float isPositiveY = (sign(aCorner.y + 0.5) + 1.0) / 2.0;
        float isNegativeY = 1.0 - isPositiveY;

        float yValue =
          (isExtremeY * isNegativeY) * aHighValue +
          (isQuartileY * isNegativeY) * aUpperQuartileValue +
          isZeroY * aMedianValue +
          (isQuartileY * isPositiveY) * aLowerQuartileValue +
          (isExtremeY * isPositiveY) * aLowValue;

        gl_Position = vec4(aCrossValue, yValue, 0, 1);

        float isHorizontal = aCorner.w;
        float isVertical = 1.0 - isHorizontal;

        float xDisplacement = aCorner.x * (isExtremeY * aCapWidth + isNotExtremeY * aBandwidth) / 2.0;

        float xModifier = (isVertical * uStrokeWidth * aCorner.z / 2.0) + xDisplacement;
        float yModifier = isHorizontal * uStrokeWidth * aCorner.z / 2.0;`
};


text:
@interface XXTestViewController : UIViewController

@end


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;

class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return User::all();
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        $user = User::find($id);
        $user->name = $request->name;
        $user->email = $request->email;
        $user->role = $request->role;
        $user->phone = $request->phone;
        $user->save();

        return "success";
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
      User::find($id)->delete();

      return "success";
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="description" />
<meta name="keywords" content="keywords" />
<meta name="author" content="author" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="description" />
<meta name="keywords" content="keywords" />
<meta name="author" content="author" />

<link rel="Stylesheet" href="css/style.css" type="text/css" media="screen" />

<title>Center of Excellence for Media, Nets and Mobile Computing</title>

				Home
				Our Activities
				Projects
				Publications and Lectures
				The Team
				Legal Information

Update

Legal Information

Center of Excellence for Media, Nets and Mobile Computing

					at the FHTW Berlin

				Center of Excellence

				Media, Nets and Mobile Computing

				at the FHTW Berlin,

				Allee der Kosmonauten 20-22

				10315 Berlin

				Spokesman:

				Prof. Dr. Horst Schwetlick

				Webdesign:

				Martin Becker

FHTW Berlin, Allee der Kosmonauten 20-22, 10315 Berlin - Legal Information


text:
// Copyright (c) 2019+ lriki. Distributed under the MIT license.
#pragma once
#include "GraphicsResource.hpp"

namespace ln {
namespace detail {
class ICommandList;
}

/**  */
class GraphicsCommandBuffer
    : public GraphicsResource
{
public:

protected:
    virtual void onDispose(bool explicitDisposing) override;
    virtual void onChangeDevice(detail::IGraphicsDevice* device) override;

LN_CONSTRUCT_ACCESS:
	GraphicsCommandBuffer();
    virtual ~GraphicsCommandBuffer();

    /** @copydoc create(int, int) */
    void init();

private:
    detail::ICommandList* resolveRHIObject(GraphicsContext* context, bool* outModified);

    Ref<detail::ICommandList> m_rhiObject;

    friend class detail::GraphicsResourceInternal;
};

} // namespace ln


text:
import shipyard2.rules.pythons

shipyard2.rules.pythons.define_package(
    build_time_deps=[
        '//python/g1/devtools/buildtools:build',
    ],
    deps=[
        '//python/g1/bases:build',
    ],
)


text:
import sbt._

object Modules extends Build {

  lazy val root = RootModule.project

  lazy val api = ApiModule.project

  lazy val web = WebModule.project
}


text:
<?php

/**
 * The date-time migration utility layer.
 *
 * @author     Time.ly Network Inc.
 * @since      2.0
 *
 * @package    AI1EC
 * @subpackage AI1EC.Database
 */
class Ai1ecdm_Datetime_Migration {

	/**
	 * @var wpdb Instance of wpdb or it's extension.
	 */
	protected $_dbi           = null;

	/**
	 * @var array List of tables to be processed.
	 */
	protected $_tables        = array();

	/**
	 * @var array Map of indices on selected tables.
	 */
	protected $_indices       = array();

	/**
	 * @var string Table suffix used in migration process.
	 */
	protected $_table_suffix  = '_dt_ui_mig';

	/**
	 * @var string Column suffix used in data transformation.
	 */
	protected $_column_suffix = '_transformation';

	/**
	 * Output debug statements.
	 *
	 * @var mixed $arg1 Number of arguments to output.
	 *
	 * @return bool True when debug is in action.
	 */
	static public function debug( /** polymorphic arg list **/ ) {
		if ( ! defined( 'AI1EC_DEBUG' ) || ! AI1EC_DEBUG ) {
			return false;
		}
		$argv = func_get_args();
		foreach ( $argv as $value ) {
			echo '
',
				'', microtime( true ), '', "\n";
			var_export( $value );
			echo '
';
		}
		return true;
	}

	/**
	 * Acquire references of global variables and define non-scalar values.
	 *
	 * @return void
	 */
	public function __construct( Ai1ec_Registry_Object $registry ) {
		$this->_dbi = $registry->get( 'dbi.dbi' );
		$this->_tables = array(
			$this->_dbi->get_table_name( 'ai1ec_events' )                => array(
				'start',
				'end',
			),
			$this->_dbi->get_table_name( 'ai1ec_event_instances' )       => array(
				'start',
				'end',
			),
			$this->_dbi->get_table_name( 'ai1ec_facebook_users_events' ) => array(
				'start',
			),
		);
		$this->_indices = array(
			$this->_dbi->get_table_name( 'ai1ec_event_instances' ) => array(
				'evt_instance' => array(
					'unique'  => true,
					'columns' => array( 'post_id', 'start' ),
					'name'	  => 'evt_instance',
				),
			),
		);
	}

	/**
	 * Interface to underlying methods to use as a filter callback.
	 *
	 * @wp_hook ai1ec_perform_scheme_update
	 *
	 * @return bool True when database is up to date.
	 */
	public function filter_scheme_update() {
		return ( ! $this->is_change_required() || $this->execute() );
	}

	/**
	 * Retrieve columns for a given table.
	 *
	 * Checks if table exists before attempting to retrieve it.
	 *
	 * @param string $table Name of table to retrieve columns for.
	 *
	 * @return array Map of column names and their types.
	 */
	public function get_columns( $table ) {
		if ( ! $this->_is_table( $table ) ) {
			return array();
		}
		$list = $this->_dbi->get_results(
			'SHOW COLUMNS FROM `' . $table . '`'
		);
		$columns = array();
		foreach ( $list as $column ) {
			$columns[$column->Field] = strtolower( $column->Type );
		}
		return $columns;
	}

	/**
	 * Retrieve list of indices for a given table.
	 *
	 * Checks if table exists before attempting to retrieve it.
	 *
	 * @param string $table Name of table to retrieve indices for.
	 *
	 * @return array Map of index names.
	 */
	public function get_indices( $table ) {
		if ( ! $this->_is_table( $table ) ) {
			return array();
		}
		$list = $this->_dbi->get_results(
			'SHOW INDEX FROM `' . $table . '`'
		);
		$columns = array();
		foreach ( $list as $column ) {
			$columns[ strtolower( $column->Key_name ) ] = $column->Key_name;
		}
		return $columns;
	}

	/**
	 * Check if database change is required.
	 *
	 * @return bool True if any changes are required.
	 */
	public function is_change_required() {
		foreach ( $this->_tables as $table => $columns ) {
			$existing = $this->get_columns( $table );
			foreach ( $existing as $column => $type ) {
				if (
					false === array_search( $column, $columns ) ||
					0 !== stripos( $type, 'datetime' )
				) {
					unset( $existing[$column] );
				}
			}
			if ( empty( $existing ) ) {
				unset( $this->_tables[$table] );
			}
		}
		if ( ! empty( $this->_tables ) ) {
			return true;
		}
		return false;
	}

	/**
	 * Single stop for executing database changes.
	 *
	 * @return bool Success.
	 */
	public function execute() {
		return $this->create_copies()
			&& $this->apply_changes_to_copies()
			&& $this->swap_tables();
	}

	/**
	 * Create copies of tables to be transformed.
	 *
	 * @return bool Success.
	 */
	public function create_copies() {
		$tables = array_keys( $this->_tables );
		foreach ( $tables as $table ) {
			$suffixed = $table . $this->_table_suffix;
			if (
				! $this->drop( $suffixed ) ||
				! $this->copy( $table, $suffixed )
			) {
				return false;
			}
		}
		self::debug(
			'Copies of following tables created successfully:',
			$tables
		);
		return true;
	}

	/**
	 * Transform columns on copied tables.
	 *
	 * @return bool Success.
	 */
	public function apply_changes_to_copies() {
		foreach ( $this->_tables as $table => $columns ) {
			$name = $table . $this->_table_suffix;
			if (
				! (
					$this->drop_indices( $table, $name )
					&& $this->out_of_bounds_fix( $table, $name )
					&& $this->add_columns( $name, $columns )
					&& $this->transform_dates( $name, $columns )
					&& $this->replace_columns( $name, $columns )
					&& $this->restore_indices( $table, $name )
				)
			) {
				return false;
			}
		}
		self::debug(
			'Table copies successfully modified:',
			$this->_tables
		);
		return true;
	}

	/**
	 * Keep old table under unique name and move modified into it's place.
	 *
	 * @return bool Success.
	 */
	public function swap_tables() {
		$tables  = array_keys( $this->_tables );
		$renames = array();
		foreach ( $tables as $table ) {
			$modified  = $table . $this->_table_suffix;
			$backup    = $table . '_' . date( 'Y_m_d' ) . '_' . getmypid();
			$renames[] = '`' . $table    . '` TO `' . $backup . '`';
			$renames[] = '`' . $modified . '` TO `' . $table  . '`';
		}
		$sql_query = 'RENAME TABLE ' . implode( ', ', $renames );
		if ( false === $this->_dbi->query( $sql_query ) ) {
			return false;
		}
		self::debug(
			'Tables successfully swaped:',
			$this->_tables
		);
		return true;
	}

	/**
	 * Drop given table indices.
	 *
	 * @param string $name  Original table name.
	 * @param string $table Table to actually perform changes upon.
	 *
	 * @return bool Success.
	 */
	public function drop_indices( $name, $table ) {
		self::debug( __METHOD__ );
		if ( ! isset( $this->_indices[$name] ) ) {
			return true;
		}
		$existing = $this->get_indices( $table );
		foreach ( $this->_indices[$name] as $index => $options ) {
			if ( isset( $existing[$index] ) ) {
				$sql_query = 'ALTER TABLE `' . $table . '` DROP INDEX `' .
					$index . '`';
				if ( false === $this->_dbi->query( $sql_query ) ) {
					return false;
				}
			}
		}
		return true;
	}

	/**
	 * Add intermediate columns to a table.
	 *
	 * @param string $table   Name of table to modify.
	 * @param array  $columns List of column names to be added.
	 *
	 * @return bool Success.
	 */
	public function add_columns( $table, $columns ) {
		self::debug( __METHOD__ );
		$column_particles = array();
		foreach ( $columns as $column ) {
			$name = $column . $this->_column_suffix;
			$column_particles[] = 'ADD COLUMN ' . $name .
				' INT(10) UNSIGNED NOT NULL';
		}
		$sql_query = 'ALTER TABLE `' . $table . '` ' .
			implode( ', ', $column_particles );
		return ( false !== $this->_dbi->query( $sql_query ) );
	}

	/**
	 * Copy date values from `DATETIME` to `INT(10)` columns.
	 *
	 * @param string $table   Name of table to modify.
	 * @param array  $columns List of column names to be copied.
	 *
	 * @return bool Success.
	 */
	public function transform_dates( $table, $columns ) {
		self::debug( __METHOD__ );
		$update_particles = array();
		foreach ( $columns as $column ) {
			$name      = $column . $this->_column_suffix;
			$new_value = '\'1970-01-01 00:00:00\'';
			if ( 'end' === $column && in_array( 'start', $columns ) ) {
				$new_value = 'IFNULL(`start`, ' . $new_value . ')';
			}
			$update_particles[] = '`' . $name .
				'` = UNIX_TIMESTAMP( IFNULL(`' . $column . '`, ' . $new_value . ' ))';
		}
		$sql_query = 'UPDATE `' . $table . '` SET ' .
			implode( ', ', $update_particles );
		return ( false !== $this->_dbi->query( $sql_query ) );
	}

	/**
	 * Drop old columns and move intermediate columns into their place.
	 *
	 * @param string $table   Name of table to modify.
	 * @param array  $columns List of column names to be replaced.
	 *
	 * @return bool Success.
	 */
	public function replace_columns( $table, $columns ) {
		self::debug( __METHOD__ );
		$snippets = array();
		foreach ( $columns as $column ) {
			$snippets[] = 'DROP COLUMN `' . $column . '`';
			$snippets[] = 'CHANGE COLUMN `' . $column . $this->_column_suffix .
				'` `' . $column . '` INT(10) UNSIGNED NOT NULL';
		}
		$sql_query = 'ALTER TABLE `' . $table . '` ' .
			implode( ', ', $snippets );
		return ( false !== $this->_dbi->query( $sql_query ) );
	}

	/**
	 * Restore indices for table processed.
	 *
	 * @param string $name  Original table name.
	 * @param string $table Table to actually perform changes upon.
	 *
	 * @return bool Success.
	 */
	public function restore_indices( $name, $table ) {
		self::debug( __METHOD__ );
		if ( ! isset( $this->_indices[$name] ) ) {
			return true;
		}
		foreach ( $this->_indices[$name] as $index => $options ) {
			$sql_query = 'ALTER TABLE `' . $table . '` ADD';
			if ( $options['unique'] ) {
				$sql_query .= ' UNIQUE';
			}
			$sql_query .= ' INDEX `' .
				$index . '` (`' .
				implode( '`, `', $options['columns'] ) .
				'`)';
			if ( false === $this->_dbi->query( $sql_query ) ) {
				return false;
			}
		}
		return true;
	}

	/**
	 * Drop table.
	 *
	 * @param string $table Name of table to drop.
	 *
	 * @return bool Success.
	 */
	public function drop( $table ) {
		$sql_query = 'DROP TABLE IF EXISTS ' . $table;
		return ( false !== $this->_dbi->query( $sql_query ) );
	}

	/**
	 * Create table copy with full data set.
	 *
	 * @param string $existing  Name of table to copy.
	 * @param string $new_table Name of table to create.
	 *
	 * @return bool Success.
	 */
	public function copy( $existing, $new_table ) {
		$queries = array(
			'CREATE TABLE ' . $new_table . ' LIKE '          . $existing,
			'INSERT INTO '  . $new_table . ' SELECT * FROM ' . $existing,
		);
		foreach ( $queries as $query ) {
			self::debug( $query );
			if ( false === $this->_dbi->query( $query ) ) {
				return false;
			}
		}
		$count_new = $this->_dbi->get_var(
			'SELECT COUNT(*) FROM ' . $new_table
		);
		$count_old = $this->_dbi->get_var(
			'SELECT COUNT(*) FROM ' . $existing
		);
		// check if difference between tables records doesn't exceed
		// several least significant bits of old table entries count
		if ( absint( $count_new - $count_old ) > ( $count_old >> 4 ) ) {
			return false;
		}
		return true;
	}

	/**
	 * Return list of tables to be processed
	 *
	 * @return array List of tables to be processed
	 */
	public function get_tables() {
		return $this->_tables;
	}

	/**
	 * Delete events dated before or at `1970-01-01 00:00:00`.
	 *
	 * @param string $table Original table.
	 * @param string $name  Temporary table to replay changes onto.
	 *
	 * @return bool Success.
	 */
	public function out_of_bounds_fix( $table, $name ) {
		static $instances = null;
		if ( null === $instances ) {
			$instances = $this->_dbi->get_table_name( 'ai1ec_event_instances' );
		}
		if ( $instances !== $table ) {
			return true;
		}
		$query = 'DELETE FROM `' .
			$this->_dbi->get_table_name( $name ) .
			'` WHERE `start` <= \'1970-01-01 00:00:00\'';
		return ( false !== $this->_dbi->query( $query ) );
	}

	/**
	 * Check if given table exists.
	 *
	 * @param string $table Name of table to check.
	 *
	 * @return bool Existence.
	 */
	protected function _is_table( $table ) {
		$name = $this->_dbi->get_var(
			$this->_dbi->prepare( 'SHOW TABLES LIKE %s', $table )
		);
		return ( (string)$table === (string)$name );
	}

}


text:
my $usage = "Usage:\n>perl transnorm.pl [-map-from-col n1] [-map-to-col n2] [-trans_start_col m1] [-trans_end_col m2] train.trans phoneset1_to_phoneset2.map
This script normalizes phonetic transcriptions given in train.trans,
by mapping the existing phone set to a new phone set given in the map file
phoneset1_to_phoneset2.map. Existing phone set is the set of phones given in
column n1 (-map-from-col n1, default 1) and the new phone set is the set of phones
given in column n2 (-map-to-col n2, default 2) of the map file.
The phonetic transcription are assumed to contain phones in the columns
from m1 (-trans_start_col m1, default 2) to
m2 (-trans_end_col m2, default to last column) on the same line.

Example:
>perl transnorm.pl -map-from-col 2 -map-to-col 3 -start-col-trans 2 train.trans timit2worldmap.txt
This will convert all phones appearing from col 2 (-start-col-trans 2)
to the last col (default value of -trans_end_col option)
of the transcription file (train.trans) to a new set of phones.
The current phone set used in the transcription must be present in
col 2 of the map file (-map-from-col 2) and the new phone set is taken
from the col 3 of the map file (-map-to-col 3).\n";

#use strict;
use Getopt::Long;
die "$usage" unless(@ARGV >= 2);
my $map_from_col = 1; # default, column 1 of the map file
my $map_to_col = 2;   # default, column 2 of the map file
my $trans_start_col = 2; # default, phoneme transcriptions begin from column 2 of the transcription file
my $trans_end_col = undef; # default, phoneme transcriptions end at the last column of the transcription file
GetOptions ("map-from-col=i" => \$map_from_col, "map-to-col=i" => \$map_to_col, "trans-start-col=i" => \$trans_start_col,"trans-end-col=i" => \$trans_end_col);

my ($transfile1, $dictxformfile) = @ARGV;

( $trans_start_col > 0 ) || die "start col of phones in $transfile1 must be positive. Current value is $trans_start_col: $!";
( $map_from_col > 0 ) || die "col from map in $dictxformfile must be positive. Current value is $map_from_col: $!";
( $map_to_col > 0 ) || die "col to map in $dictxformfile must be positive. Current value is $map_to_col: $!";
if ( defined ($trans_end_col) ) {
( $trans_end_col >= $trans_start_col ) || die "start col of phones in $transfile1 cannot be greater than end col. Current start col=$trans_start_col, end col=$trans_end_col: $!";
}

# Read the xform file to populate the transform	in a hash
$map_from_col--;
$map_to_col--;
open(XFORM,"<$dictxformfile") || die "Unable to read from $dictxformfile: $!";
foreach $line (<XFORM>) {
	($line =~ /^\;/) && next;
	my(@recs) = split(/\s+/,$line);
	#print "line-> $recs[0..$#recs]\n";
	if (!defined $TRANSFORM{$recs[$map_from_col]}) {
	#$TRANSFORM{$recs[0]} = $recs[1];
	$TRANSFORM{$recs[$map_from_col]} = $recs[$map_to_col];
	}
}
#$TRANSFORM{"SIL"} = "sil";
close(XFORM);
#print "$_ $TRANSFORM{$_}\n" for sort keys %TRANSFORM;

# Apply xform to phone transcriptions, and write the xformed phonemes to stdout
$trans_start_col--;
#if ( !defined ($trans_end_col) ) { 	print "undefined\n"; }
#else { 	print "defined\n"; }
open(TR1, "<$transfile1")   || die "Unable to read from $transfile1: $!";
while ($line = <TR1>) {
	($line =~ /^\s+$/) && next;
	chomp ($line);
	my(@recs) = split(/\s+/,$line);
	#print "@recs[1..$#recs]\n";
	if ( !defined ($trans_end_col) ) {
		@xphonemes = map { exists $TRANSFORM{$_} ? $TRANSFORM{$_} : () } @recs[$trans_start_col..$#recs];
		print "@recs[0..$trans_start_col-1] @xphonemes[0..$#xphonemes]\n";
	}
	else {
		@xphonemes = map { exists $TRANSFORM{$_} ? $TRANSFORM{$_} : () } @recs[$trans_start_col..$trans_end_col-1];
		print "@recs[0..$trans_start_col-1] @xphonemes[0..$#xphonemes] @recs[$trans_end_col..$#recs] \n";
	}
}
close(TR1);


text:
namespace Microsoft.Azure.Management.Security.Models
{

    /// <summary>
    /// Defines values for ControlType.
    /// </summary>
    public static class ControlType
    {
        /// <summary>
        /// Azure Security Center managed assessments
        /// </summary>
        public const string BuiltIn = "BuiltIn";
        /// <summary>
        /// Non Azure Security Center managed assessments
        /// </summary>
        public const string Custom = "Custom";
    }
}


text:
// Compressed version of core/ckeditor_base.js. See original for instructions.
/*jsl:ignore*/
if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.6',revision:'6902',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
/*jsl:end*/

// Uncomment the following line to have a new timestamp generated for each
// request, having clear cache load of the editor code.
// CKEDITOR.timestamp = ( new Date() ).valueOf();

if ( CKEDITOR.loader )
	CKEDITOR.loader.load( 'core/ckeditor' );
else
{
	// Set the script name to be loaded by the loader.
	CKEDITOR._autoLoad = 'core/ckeditor';

	// Include the loader script.
	document.write(
		'<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
}


text:
'use strict';
/**
 * @ngInject
 */
 //Filter on recorded_by to get unique values -not currently used by observers
var uniqueFilter = function () {
	var o = [];
	return function (arr) {
		console.log(arr);
        for (var l=0; l<arr.length; l++) {
        	if (arr[l].hasOwnProperty("recorded_by")) {
            	 o.push((arr[l].recorded_by));
            }
        }

    console.log(o);
    return o;
};
};

module.exports = uniqueFilter;


text:
namespace mojo {

ExampleClientApplication::ExampleClientApplication() {}

ExampleClientApplication::~ExampleClientApplication() {}

void ExampleClientApplication::Initialize(ApplicationImpl* app) {}

}  // namespace mojo


text:
package oshi.hardware.platform.windows;

import java.util.ArrayList;
import java.util.List;

import com.sun.jna.platform.win32.VersionHelpers;
import com.sun.jna.platform.win32.COM.WbemcliUtil.WmiResult;

import oshi.annotation.concurrent.Immutable;
import oshi.driver.windows.wmi.Win32VideoController;
import oshi.driver.windows.wmi.Win32VideoController.VideoControllerProperty;
import oshi.hardware.GraphicsCard;
import oshi.hardware.common.AbstractGraphicsCard;
import oshi.util.Constants;
import oshi.util.ParseUtil;
import oshi.util.Util;
import oshi.util.platform.windows.WmiUtil;
import oshi.util.tuples.Triplet;

/**
 * Graphics Card obtained from WMI
 */
@Immutable
final class WindowsGraphicsCard extends AbstractGraphicsCard {

    private static final boolean IS_VISTA_OR_GREATER = VersionHelpers.IsWindowsVistaOrGreater();

    /**
     * Constructor for WindowsGraphicsCard
     *
     * @param name
     *            The name
     * @param deviceId
     *            The device ID
     * @param vendor
     *            The vendor
     * @param versionInfo
     *            The version info
     * @param vram
     *            The VRAM
     */
    WindowsGraphicsCard(String name, String deviceId, String vendor, String versionInfo, long vram) {
        super(name, deviceId, vendor, versionInfo, vram);
    }

    /**
     * public method used by
     * {@link oshi.hardware.common.AbstractHardwareAbstractionLayer} to access the
     * graphics cards.
     *
     * @return List of {@link oshi.hardware.platform.windows.WindowsGraphicsCard}
     *         objects.
     */
    public static List<GraphicsCard> getGraphicsCards() {
        List<GraphicsCard> cardList = new ArrayList<>();
        if (IS_VISTA_OR_GREATER) {
            WmiResult<VideoControllerProperty> cards = Win32VideoController.queryVideoController();
            for (int index = 0; index < cards.getResultCount(); index++) {
                String name = WmiUtil.getString(cards, VideoControllerProperty.NAME, index);
                Triplet<String, String, String> idPair = ParseUtil.parseDeviceIdToVendorProductSerial(
                        WmiUtil.getString(cards, VideoControllerProperty.PNPDEVICEID, index));
                String deviceId = idPair == null ? Constants.UNKNOWN : idPair.getB();
                String vendor = WmiUtil.getString(cards, VideoControllerProperty.ADAPTERCOMPATIBILITY, index);
                if (idPair != null) {
                    if (Util.isBlank(vendor)) {
                        deviceId = idPair.getA();
                    } else {
                        vendor = vendor + " (" + idPair.getA() + ")";
                    }
                }
                String versionInfo = WmiUtil.getString(cards, VideoControllerProperty.DRIVERVERSION, index);
                if (!Util.isBlank(versionInfo)) {
                    versionInfo = "DriverVersion=" + versionInfo;
                } else {
                    versionInfo = Constants.UNKNOWN;
                }
                long vram = WmiUtil.getUint32asLong(cards, VideoControllerProperty.ADAPTERRAM, index);
                cardList.add(new WindowsGraphicsCard(Util.isBlank(name) ? Constants.UNKNOWN : name, deviceId,
                        Util.isBlank(vendor) ? Constants.UNKNOWN : vendor, versionInfo, vram));
            }
        }
        return cardList;
    }
}


text:
@interface DLMKPlayerStats ()

// Private interface goes here.

@end

@implementation DLMKPlayerStats

// Custom logic goes here.

#pragma mark - Class methods
+(instancetype) playerStatsWithTeamStats:(DLMKTeamStats*) teamStats  playerDescriptor:(DLMKPlayerDescriptor*)aPlayerDescriptor context: (NSManagedObjectContext*) aContext{

    DLMKPlayerStats* playerStats = [self insertInManagedObjectContext:aContext];
    playerStats.teamStats = teamStats;
    playerStats.playerDescriptor = aPlayerDescriptor;
    [playerStats resetValues];
    return playerStats;

}
+(instancetype) playerStatsWithTeamStats:(DLMKTeamStats*) teamStats context: (NSManagedObjectContext*) aContext{
    return [self playerStatsWithTeamStats:teamStats playerDescriptor:nil context:aContext];
}

#pragma mark - Properties

-(NSString*) name{
    if (self.playerDescriptor)
        return self.playerDescriptor.name;
    else
        return @"Unamed";
}
-(NSUInteger) number{
    if (self.playerDescriptor)
        return self.playerDescriptor.numberValue;
    else
        return 0;
}

#pragma mark - Instance methods
-(void)resetValues{

    self.assistances = 0;
    self.goals = 0;
    self.faults_done = 0;
    self.faults_received = 0;
    self.shots = 0;
    self.seconds_played = 0;
    self.notes = nil;
}

@end


text:
require "rack/test"

require "sidekiq/throttled/web"

require "support/capybara"
require "support/working_class_hero"

RSpec.describe Sidekiq::Throttled::Web, :sidekiq => :enabled do
  before do
    Sidekiq::Throttled.setup!

    Sidekiq::Client.push({
      "class" => WorkingClassHero,
      "queue" => "xxx",
      "args"  => [[]]
    })

    Sidekiq::Client.push({
      "class" => WorkingClassHero,
      "queue" => "yyy",
      "args"  => [[]]
    })

    pauser.pause! "xxx"
  end

  let(:pauser) { Sidekiq::Throttled::QueuesPauser.instance }

  describe "mounted app" do
    include Rack::Test::Methods

    def app
      Sidekiq::Web
    end

    describe "GET /" do
      before { get "/" }

      specify { expect(last_response.status).to eq 200 }
      specify { expect(last_response.body).to include "Enhanced Queues" }
    end

    describe "GET /enhanced-queues" do
      before { get "/enhanced-queues" }

      specify { expect(last_response.status).to eq 200 }

      specify { expect(last_response.body).to include "xxx" }
      specify { expect(last_response.body).to include "yyy" }
    end

    describe "POST /enhanced-queues/:queue" do
      let(:csrf_token) { SecureRandom.base64(32) }

      before do
        env "rack.session", :csrf => csrf_token
      end

      it "allows pausing the queue" do
        expect(pauser).to receive(:pause!).with("xxx")
        post "/enhanced-queues/xxx", :action => "pause", :authenticity_token => csrf_token
      end

      it "allows resuming the queue" do
        expect(pauser).to receive(:resume!).with("xxx")
        post "/enhanced-queues/xxx", :action => "resume", :authenticity_token => csrf_token
      end

      it "allows deleting the queue" do
        expect(::Sidekiq::Queue.new("xxx").size).to be >= 1
        post "/enhanced-queues/xxx", :action => "delete", :authenticity_token => csrf_token
        expect(::Sidekiq::Queue.new("xxx").size).to eq 0
      end
    end
  end

  describe "Enhanced Queues UI", :type => :feature do
    it "allows resuming paused queues" do
      visit "/enhanced-queues"

      expect(pauser).to receive(:resume!).with("xxx").and_call_original

      find_link(:href => "/queues/xxx").find(:xpath, "../..")
        .click_button("Resume")

      expect(find_link(:href => "/queues/xxx").find(:xpath, "../.."))
        .to have_button("Pause")
    end

    it "allows pausing queues" do
      visit "/enhanced-queues"

      expect(pauser).to receive(:pause!).with("yyy").and_call_original

      find_link(:href => "/queues/yyy").find(:xpath, "../..")
        .click_button("Pause")

      expect(find_link(:href => "/queues/yyy").find(:xpath, "../.."))
        .to have_button("Resume")
    end

    it "allows deleting queues" do
      visit "/enhanced-queues"

      find_link(:href => "/queues/xxx").find(:xpath, "../..")
        .click_button("Delete")

      expect(page).not_to have_link(:href => "/queues/xxx")
    end
  end
end


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import importlib

import numpy as np

from tensorflow.python.eager import backprop
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import test_util
from tensorflow.python.ops import nn_ops
from tensorflow.python.ops.distributions import laplace as laplace_lib
from tensorflow.python.platform import test

from tensorflow.python.platform import tf_logging

def try_import(name):  # pylint: disable=invalid-name
  module = None
  try:
    module = importlib.import_module(name)
  except ImportError as e:
    tf_logging.warning("Could not import %s: %s" % (name, str(e)))
  return module

stats = try_import("scipy.stats")

@test_util.run_all_in_graph_and_eager_modes
class LaplaceTest(test.TestCase):

  def testLaplaceShape(self):
    loc = constant_op.constant([3.0] * 5)
    scale = constant_op.constant(11.0)
    laplace = laplace_lib.Laplace(loc=loc, scale=scale)

    self.assertEqual(self.evaluate(laplace.batch_shape_tensor()), (5,))
    self.assertEqual(laplace.batch_shape, tensor_shape.TensorShape([5]))
    self.assertAllEqual(self.evaluate(laplace.event_shape_tensor()), [])
    self.assertEqual(laplace.event_shape, tensor_shape.TensorShape([]))

  def testLaplaceLogPDF(self):
    batch_size = 6
    loc = constant_op.constant([2.0] * batch_size)
    scale = constant_op.constant([3.0] * batch_size)
    loc_v = 2.0
    scale_v = 3.0
    x = np.array([2.5, 2.5, 4.0, 0.1, 1.0, 2.0], dtype=np.float32)
    laplace = laplace_lib.Laplace(loc=loc, scale=scale)
    log_pdf = laplace.log_prob(x)
    self.assertEqual(log_pdf.get_shape(), (6,))
    if not stats:
      return
    expected_log_pdf = stats.laplace.logpdf(x, loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(log_pdf), expected_log_pdf)

    pdf = laplace.prob(x)
    self.assertEqual(pdf.get_shape(), (6,))
    self.assertAllClose(self.evaluate(pdf), np.exp(expected_log_pdf))

  def testLaplaceLogPDFMultidimensional(self):
    batch_size = 6
    loc = constant_op.constant([[2.0, 4.0]] * batch_size)
    scale = constant_op.constant([[3.0, 4.0]] * batch_size)
    loc_v = np.array([2.0, 4.0])
    scale_v = np.array([3.0, 4.0])
    x = np.array([[2.5, 2.5, 4.0, 0.1, 1.0, 2.0]], dtype=np.float32).T
    laplace = laplace_lib.Laplace(loc=loc, scale=scale)
    log_pdf = laplace.log_prob(x)
    log_pdf_values = self.evaluate(log_pdf)
    self.assertEqual(log_pdf.get_shape(), (6, 2))

    pdf = laplace.prob(x)
    pdf_values = self.evaluate(pdf)
    self.assertEqual(pdf.get_shape(), (6, 2))
    if not stats:
      return
    expected_log_pdf = stats.laplace.logpdf(x, loc_v, scale=scale_v)
    self.assertAllClose(log_pdf_values, expected_log_pdf)
    self.assertAllClose(pdf_values, np.exp(expected_log_pdf))

  def testLaplaceLogPDFMultidimensionalBroadcasting(self):
    batch_size = 6
    loc = constant_op.constant([[2.0, 4.0]] * batch_size)
    scale = constant_op.constant(3.0)
    loc_v = np.array([2.0, 4.0])
    scale_v = 3.0
    x = np.array([[2.5, 2.5, 4.0, 0.1, 1.0, 2.0]], dtype=np.float32).T
    laplace = laplace_lib.Laplace(loc=loc, scale=scale)
    log_pdf = laplace.log_prob(x)
    log_pdf_values = self.evaluate(log_pdf)
    self.assertEqual(log_pdf.get_shape(), (6, 2))

    pdf = laplace.prob(x)
    pdf_values = self.evaluate(pdf)
    self.assertEqual(pdf.get_shape(), (6, 2))
    if not stats:
      return
    expected_log_pdf = stats.laplace.logpdf(x, loc_v, scale=scale_v)
    self.assertAllClose(log_pdf_values, expected_log_pdf)
    self.assertAllClose(pdf_values, np.exp(expected_log_pdf))

  def testLaplaceCDF(self):
    batch_size = 6
    loc = constant_op.constant([2.0] * batch_size)
    scale = constant_op.constant([3.0] * batch_size)
    loc_v = 2.0
    scale_v = 3.0
    x = np.array([2.5, 2.5, 4.0, 0.1, 1.0, 2.0], dtype=np.float32)

    laplace = laplace_lib.Laplace(loc=loc, scale=scale)

    cdf = laplace.cdf(x)
    self.assertEqual(cdf.get_shape(), (6,))
    if not stats:
      return
    expected_cdf = stats.laplace.cdf(x, loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(cdf), expected_cdf)

  def testLaplaceLogCDF(self):
    batch_size = 6
    loc = constant_op.constant([2.0] * batch_size)
    scale = constant_op.constant([3.0] * batch_size)
    loc_v = 2.0
    scale_v = 3.0
    x = np.array([-2.5, 2.5, -4.0, 0.1, 1.0, 2.0], dtype=np.float32)

    laplace = laplace_lib.Laplace(loc=loc, scale=scale)

    cdf = laplace.log_cdf(x)
    self.assertEqual(cdf.get_shape(), (6,))
    if not stats:
      return
    expected_cdf = stats.laplace.logcdf(x, loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(cdf), expected_cdf)

  def testLaplaceLogSurvivalFunction(self):
    batch_size = 6
    loc = constant_op.constant([2.0] * batch_size)
    scale = constant_op.constant([3.0] * batch_size)
    loc_v = 2.0
    scale_v = 3.0
    x = np.array([-2.5, 2.5, -4.0, 0.1, 1.0, 2.0], dtype=np.float32)

    laplace = laplace_lib.Laplace(loc=loc, scale=scale)

    sf = laplace.log_survival_function(x)
    self.assertEqual(sf.get_shape(), (6,))
    if not stats:
      return
    expected_sf = stats.laplace.logsf(x, loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(sf), expected_sf)

  def testLaplaceMean(self):
    loc_v = np.array([1.0, 3.0, 2.5])
    scale_v = np.array([1.0, 4.0, 5.0])
    laplace = laplace_lib.Laplace(loc=loc_v, scale=scale_v)
    self.assertEqual(laplace.mean().get_shape(), (3,))
    if not stats:
      return
    expected_means = stats.laplace.mean(loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(laplace.mean()), expected_means)

  def testLaplaceMode(self):
    loc_v = np.array([0.5, 3.0, 2.5])
    scale_v = np.array([1.0, 4.0, 5.0])
    laplace = laplace_lib.Laplace(loc=loc_v, scale=scale_v)
    self.assertEqual(laplace.mode().get_shape(), (3,))
    self.assertAllClose(self.evaluate(laplace.mode()), loc_v)

  def testLaplaceVariance(self):
    loc_v = np.array([1.0, 3.0, 2.5])
    scale_v = np.array([1.0, 4.0, 5.0])
    laplace = laplace_lib.Laplace(loc=loc_v, scale=scale_v)
    self.assertEqual(laplace.variance().get_shape(), (3,))
    if not stats:
      return
    expected_variances = stats.laplace.var(loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(laplace.variance()), expected_variances)

  def testLaplaceStd(self):
    loc_v = np.array([1.0, 3.0, 2.5])
    scale_v = np.array([1.0, 4.0, 5.0])
    laplace = laplace_lib.Laplace(loc=loc_v, scale=scale_v)
    self.assertEqual(laplace.stddev().get_shape(), (3,))
    if not stats:
      return
    expected_stddev = stats.laplace.std(loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(laplace.stddev()), expected_stddev)

  def testLaplaceEntropy(self):
    loc_v = np.array([1.0, 3.0, 2.5])
    scale_v = np.array([1.0, 4.0, 5.0])
    laplace = laplace_lib.Laplace(loc=loc_v, scale=scale_v)
    self.assertEqual(laplace.entropy().get_shape(), (3,))
    if not stats:
      return
    expected_entropy = stats.laplace.entropy(loc_v, scale=scale_v)
    self.assertAllClose(self.evaluate(laplace.entropy()), expected_entropy)

  def testLaplaceSample(self):
    loc_v = 4.0
    scale_v = 3.0
    loc = constant_op.constant(loc_v)
    scale = constant_op.constant(scale_v)
    n = 100000
    laplace = laplace_lib.Laplace(loc=loc, scale=scale)
    samples = laplace.sample(n, seed=137)
    sample_values = self.evaluate(samples)
    self.assertEqual(samples.get_shape(), (n,))
    self.assertEqual(sample_values.shape, (n,))
    if not stats:
      return
    self.assertAllClose(
        sample_values.mean(),
        stats.laplace.mean(loc_v, scale=scale_v),
        rtol=0.05,
        atol=0.)
    self.assertAllClose(
        sample_values.var(),
        stats.laplace.var(loc_v, scale=scale_v),
        rtol=0.05,
        atol=0.)
    self.assertTrue(self._kstest(loc_v, scale_v, sample_values))

  def testLaplaceFullyReparameterized(self):
    loc = constant_op.constant(4.0)
    scale = constant_op.constant(3.0)
    with backprop.GradientTape() as tape:
      tape.watch(loc)
      tape.watch(scale)
      laplace = laplace_lib.Laplace(loc=loc, scale=scale)
      samples = laplace.sample(100)
    grad_loc, grad_scale = tape.gradient(samples, [loc, scale])
    self.assertIsNotNone(grad_loc)
    self.assertIsNotNone(grad_scale)

  def testLaplaceSampleMultiDimensional(self):
    loc_v = np.array([np.arange(1, 101, dtype=np.float32)])  # 1 x 100
    scale_v = np.array([np.arange(1, 11, dtype=np.float32)]).T  # 10 x 1
    laplace = laplace_lib.Laplace(loc=loc_v, scale=scale_v)
    n = 10000
    samples = laplace.sample(n, seed=137)
    sample_values = self.evaluate(samples)
    self.assertEqual(samples.get_shape(), (n, 10, 100))
    self.assertEqual(sample_values.shape, (n, 10, 100))
    zeros = np.zeros_like(loc_v + scale_v)  # 10 x 100
    loc_bc = loc_v + zeros
    scale_bc = scale_v + zeros
    if not stats:
      return
    self.assertAllClose(
        sample_values.mean(axis=0),
        stats.laplace.mean(loc_bc, scale=scale_bc),
        rtol=0.35,
        atol=0.)
    self.assertAllClose(
        sample_values.var(axis=0),
        stats.laplace.var(loc_bc, scale=scale_bc),
        rtol=0.105,
        atol=0.0)
    fails = 0
    trials = 0
    for ai, a in enumerate(np.reshape(loc_v, [-1])):
      for bi, b in enumerate(np.reshape(scale_v, [-1])):
        s = sample_values[:, bi, ai]
        trials += 1
        fails += 0 if self._kstest(a, b, s) else 1
    self.assertLess(fails, trials * 0.03)

  def _kstest(self, loc, scale, samples):
    # Uses the Kolmogorov-Smirnov test for goodness of fit.
    if not stats:
      return True  # If scipy isn't available, return "True" for passing
    ks, _ = stats.kstest(samples, stats.laplace(loc, scale=scale).cdf)
    # Return True when the test passes.
    return ks < 0.02

  def testLaplacePdfOfSampleMultiDims(self):
    laplace = laplace_lib.Laplace(loc=[7., 11.], scale=[[5.], [6.]])
    num = 50000
    samples = laplace.sample(num, seed=137)
    pdfs = laplace.prob(samples)
    sample_vals, pdf_vals = self.evaluate([samples, pdfs])
    self.assertEqual(samples.get_shape(), (num, 2, 2))
    self.assertEqual(pdfs.get_shape(), (num, 2, 2))
    self._assertIntegral(sample_vals[:, 0, 0], pdf_vals[:, 0, 0], err=0.02)
    self._assertIntegral(sample_vals[:, 0, 1], pdf_vals[:, 0, 1], err=0.02)
    self._assertIntegral(sample_vals[:, 1, 0], pdf_vals[:, 1, 0], err=0.02)
    self._assertIntegral(sample_vals[:, 1, 1], pdf_vals[:, 1, 1], err=0.02)
    if not stats:
      return
    self.assertAllClose(
        stats.laplace.mean(
            [[7., 11.], [7., 11.]], scale=np.array([[5., 5.], [6., 6.]])),
        sample_vals.mean(axis=0),
        rtol=0.05,
        atol=0.)
    self.assertAllClose(
        stats.laplace.var([[7., 11.], [7., 11.]],
                          scale=np.array([[5., 5.], [6., 6.]])),
        sample_vals.var(axis=0),
        rtol=0.05,
        atol=0.)

  def _assertIntegral(self, sample_vals, pdf_vals, err=1e-3):
    s_p = zip(sample_vals, pdf_vals)
    prev = (0, 0)
    total = 0
    for k in sorted(s_p, key=lambda x: x[0]):
      pair_pdf = (k[1] + prev[1]) / 2
      total += (k[0] - prev[0]) * pair_pdf
      prev = k
    self.assertNear(1., total, err=err)

  def testLaplaceNonPositiveInitializationParamsRaises(self):
    loc_v = constant_op.constant(0.0, name="loc")
    scale_v = constant_op.constant(-1.0, name="scale")
    with self.assertRaisesOpError("Condition x > 0 did not hold element-wise"):
      laplace = laplace_lib.Laplace(
          loc=loc_v, scale=scale_v, validate_args=True)
      self.evaluate(laplace.mean())
    loc_v = constant_op.constant(1.0, name="loc")
    scale_v = constant_op.constant(0.0, name="scale")
    with self.assertRaisesOpError("Condition x > 0 did not hold element-wise"):
      laplace = laplace_lib.Laplace(
          loc=loc_v, scale=scale_v, validate_args=True)
      self.evaluate(laplace.mean())

  def testLaplaceWithSoftplusScale(self):
    loc_v = constant_op.constant([0.0, 1.0], name="loc")
    scale_v = constant_op.constant([-1.0, 2.0], name="scale")
    laplace = laplace_lib.LaplaceWithSoftplusScale(loc=loc_v, scale=scale_v)
    self.assertAllClose(
        self.evaluate(nn_ops.softplus(scale_v)), self.evaluate(laplace.scale))
    self.assertAllClose(self.evaluate(loc_v), self.evaluate(laplace.loc))

if __name__ == "__main__":
  test.main()


text:
require "spec_helper"

describe FarmwareEnv do
  it 'has a length limit' do
    p = {
      device: FactoryBot.create(:device),
      key: Faker::Games::Pokemon.name,
      value:  "===" * 300
    }
    expect { FarmwareEnv.create!(p) }
      .to raise_error(ActiveRecord::ValueTooLong)
  end
end


text:
package com.upcrob.springsecurity.otp;

import java.security.SecureRandom;
import java.util.Random;

/**
 * Generates random OTP tokens using the letters A-Z and digits 0-9.
 */
public class DefaultOtpGenerator implements OtpGenerator {
	private static final char[] CHARS = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
		'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3',
		'4', '5', '6', '7', '8', '9'};

	private Random rand;
	private int length;

	/**
	 * Creates a new generator.
	 * @param length String length of tokens that will be generated.
	 */
	public DefaultOtpGenerator(int length) {
		this.length = length;
		this.rand = new SecureRandom();
	}

	@Override
	public String generateToken() {
		StringBuilder sb = new StringBuilder(length);
		for (int i = 0; i < length; i++) {
			sb.append(CHARS[rand.nextInt(CHARS.length)]);
		}
		return sb.toString();
	}
}


text:
require 'test_helper'

module Spyke
  class OrmTest < MiniTest::Test
    def test_find
      stub_request(:get, 'http://sushi.com/recipes/1').to_return_json(result: { id: 1, title: 'Sushi' })
      stub_request(:get, 'http://sushi.com/users/1').to_return_json(result: { id: 1, name: 'Bob' })

      recipe = Recipe.find(1)
      user = User.find(1)

      assert_equal 1, recipe.id
      assert_equal 'Sushi', recipe.title
      assert_equal 'Bob', user.name
    end

    def test_reload
      stub_request(:get, 'http://sushi.com/recipes/1').to_return_json(result: { id: 1, title: 'Sushi' })

      recipe = Recipe.find(1)
      assert_equal 'Sushi', recipe.title

      stub_request(:get, 'http://sushi.com/recipes/1').to_return_json(result: { id: 1, title: 'Sashimi' })
      recipe.reload
      assert_equal 'Sashimi', recipe.title
    end

    def test_find_with_slug
      endpoint = stub_request(:get, 'http://sushi.com/recipes/1').to_return_json(result: { id: 1 })
      Recipe.find('1-delicious-soup')
      assert_requested endpoint
    end

    def test_404
      stub_request(:get, 'http://sushi.com/recipes/1').to_return(status: 404, body: { message: 'Not found' }.to_json)

      assert_raises(ResourceNotFound) { Recipe.find(1) }
      assert_raises(ResourceNotFound) { Recipe.find(nil) }
      assert_raises(ResourceNotFound) { Recipe.find('') }
    end

    def test_save_new_record
      endpoint = stub_request(:post, 'http://sushi.com/recipes').with(body: { recipe: { title: 'Sushi' } }).to_return_json(result: { id: 1, title: 'Sushi (created)' })

      recipe = Recipe.new(title: 'Sushi')
      recipe.save

      assert_equal 'Sushi (created)', recipe.title
      assert_requested endpoint
    end

    def test_save_persisted_record
      endpoint = stub_request(:put, 'http://sushi.com/recipes/1').with(body: { recipe: { title: 'Sushi' } }).to_return_json(result: { id: 1, title: 'Sushi (saved)' })

      recipe = Recipe.new(id: 1, title: 'Sashimi')
      recipe.title = 'Sushi'
      recipe.save

      assert_equal 'Sushi (saved)', recipe.title
      assert_requested endpoint
    end

    def test_update_attributes
      endpoint = stub_request(:put, 'http://sushi.com/recipes/1').with(body: { recipe: { title: 'Sushi' } }).to_return_json(result: { id: 1, title: 'Sushi (saved)' })

      recipe = Recipe.new(id: 1, title: 'Sashimi')
      recipe.update_attributes(title: 'Sushi')

      assert_equal 'Sushi (saved)', recipe.title
      assert_requested endpoint
    end

    def test_create
      endpoint = stub_request(:post, 'http://sushi.com/recipes').with(body: { recipe: { title: 'Sushi' } }).to_return_json(result: { id: 1, title: 'Sushi' })

      recipe = Recipe.create(title: 'Sushi')

      assert_equal 'Sushi', recipe.title
      assert_requested endpoint
    end

    def test_create_with_server_failure
      endpoint = stub_request(:put, 'http://sushi.com/recipes/1').to_return_json(id: 'write_error:400', message: 'Unable to save recipe')

      recipe = Recipe.create(id: 1, title: 'Sushi')

      assert_equal 'Sushi', recipe.title
      assert_equal ['Unable to save recipe'], recipe.errors[:base]
      assert_requested endpoint
    end

    def test_find_using_custom_uri_template
      endpoint = stub_request(:get, 'http://sushi.com/images/photos/1').to_return_json(result: { id: 1 })
      Photo.find(1)
      assert_requested endpoint
    end

    def test_create_using_custom_uri_template
      endpoint = stub_request(:post, 'http://sushi.com/images/photos')
      Photo.create
      assert_requested endpoint
    end

    def test_create_using_nested_custom_uri_template
      endpoint = stub_request(:post, 'http://sushi.com/recipes/1/ingredients')
      Ingredient.new(recipe_id: 1).save
      assert_requested endpoint
    end

    def test_create_using_custom_method
      endpoint = stub_request(:put, 'http://sushi.com/images')
      Image.create
      assert_requested endpoint
    end

    def test_inheritance_using_custom_method
      endpoint = stub_request(:put, 'http://sushi.com/step_images')
      StepImage.create
      assert_requested endpoint
    end

    def test_non_nested_params
      assert_equal({ 'url' => 'bob.jpg' }, RecipeImage.new(url: 'bob.jpg').to_params)
    end

    def test_destroy
      endpoint = stub_request(:delete, 'http://sushi.com/recipes/1')
      Recipe.new(id: 1).destroy
      assert_requested endpoint
    end

    def test_destroy_class_method
      endpoint = stub_request(:delete, 'http://sushi.com/recipes/1')
      Recipe.destroy(1)
      assert_requested endpoint
    end

    def test_scoped_destroy_class_method
      endpoint = stub_request(:delete, 'http://sushi.com/recipes/1/ingredients/2')
      Ingredient.where(recipe_id: 1).destroy(2)
      assert_requested endpoint
    end

    def test_scoped_destroy_class_method_without_param
      endpoint = stub_request(:delete, 'http://sushi.com/recipes/1/image')
      RecipeImage.where(recipe_id: 1).destroy
      assert_requested endpoint
    end

    def test_validations
      assert_equal false, RecipeImage.new.valid?
      assert_equal true, RecipeImage.new(url: 'bob.jpg').valid?
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:drawable="@drawable/titlebar_item_bg_pressed" />
    <item android:state_focused="true" android:drawable="@drawable/titlebar_item_bg_focused" />
    <item android:drawable="@android:color/transparent" />
</selector>


text:
<?php

namespace Copyleaks;

class SubmissionScanning
{
  /**
   * Compare your content with online sources.
   */
  public ?bool $internet;
  /**
   * Check inner properties for more details.
   */
  public ?SubmissionScanningExclude $exclude;
  /**
   * SubmissionScanningRepository[] - Check inner properties of SubmissionScanningRepository for more details.
   */
  public ?array $repositories;
  /**
   * Check inner properties for more details.
   */
  public ?SubmissionScanningCopyleaksDB $copyleaksDb;

  /**
   *@param bool $internet Compare your content with online sources.
   *@param SubmissionScanningExclude $exclude Check inner properties of SubmissionScanningExclude for more details.
   *@param array $repositories SubmissionScanningRepository[] - Check inner properties of SubmissionScanningRepository for more details.
   *@param SubmissionScanningCopyleaksDB $copyleaksDb Check inner properties for more details.
   */
  public function __construct(
    bool $internet = false,
    SubmissionScanningExclude $exclude = null,
    array $repositories = null,
    SubmissionScanningCopyleaksDB $copyleaksDb = null
  ) {
    $this->internet = $internet;
    $this->exclude = $exclude;
    $this->repositories = $repositories;
    $this->copyleaksDb = $copyleaksDb;
  }
}


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        private.h
// Purpose:     Private declarations: as this header is only included by
//              wxWidgets itself, it may contain identifiers which don't start
//              with "wx".
// Author:      Julian Smart
// Modified by:
// Created:     01/02/97
// RCS-ID:      $Id: private.h,v 1.36.2.1 2006/01/03 17:02:42 SN Exp $
// Copyright:   (c) Julian Smart
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_OS2_PRIVATE_H_
#define _WX_OS2_PRIVATE_H_

#define INCL_BASE
#define INCL_PM
#define INCL_GPI
#define INCL_WINSYS
#define INCL_SHLERRORS
#define INCL_DOS
#include <os2.h>

#if defined (__EMX__) && !defined(USE_OS2_TOOLKIT_HEADERS) && !defined(HAVE_SPBCDATA)

    typedef struct _SPBCDATA {
        ULONG     cbSize;       /*  Size of control block. */
        ULONG     ulTextLimit;  /*  Entryfield text limit. */
        LONG      lLowerLimit;  /*  Spin lower limit (numeric only). */
        LONG      lUpperLimit;  /*  Spin upper limit (numeric only). */
        ULONG     idMasterSpb;  /*  ID of the servant's master spinbutton. */
        PVOID     pHWXCtlData;  /*  Handwriting control data structure flag. */
    } SPBCDATA;

    typedef SPBCDATA *PSPBCDATA;

#endif

#include "wx/fontenc.h"

class WXDLLEXPORT wxFont;
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxString;
class WXDLLEXPORT wxBitmap;

// ---------------------------------------------------------------------------
// private constants
// ---------------------------------------------------------------------------

//
// Constant strings for control names and classes
//

//
// Controls
//
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxCanvasNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBoxNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxListBoxNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticTextNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBitmapNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxMultiTextNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioBoxNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioButtonNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxBitmapRadioButtonNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxScrollBarNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlWindowNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxVirtListBoxNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonBarNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxEnhDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxMessageBoxCaptionStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorPromptStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorDefaultWildcardStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxInternalErrorStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxFatalErrorStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxTreeCtrlNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr;

//
// Class names
//
WXDLLEXPORT_DATA(extern const wxChar*)  wxFrameClassName;
WXDLLEXPORT_DATA(extern const wxChar*)  wxFrameClassNameNoRedraw;
WXDLLEXPORT_DATA(extern const wxChar*)  wxMDIFrameClassName;
WXDLLEXPORT_DATA(extern const wxChar*)  wxMDIFrameClassNameNoRedraw;
WXDLLEXPORT_DATA(extern const wxChar*)  wxMDIChildFrameClassName;
WXDLLEXPORT_DATA(extern const wxChar*)  wxMDIChildFrameClassNameNoRedraw;
WXDLLEXPORT_DATA(extern const wxChar*)  wxPanelClassName;
WXDLLEXPORT_DATA(extern const wxChar*)  wxPanelClassNameNR;
WXDLLEXPORT_DATA(extern const wxChar*)  wxCanvasClassName;
WXDLLEXPORT_DATA(extern const wxChar*)  wxCanvasClassNameNR;

// ---------------------------------------------------------------------------
// standard icons from the resources
// ---------------------------------------------------------------------------

#ifdef __WXPM__

WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDICHILDFRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_FRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;

#endif

// ---------------------------------------------------------------------------
// this defines a CASTWNDPROC macro which casts a pointer to the type of a
// window proc for PM.
// MPARAM is a void * but is really a 32-bit value
// ---------------------------------------------------------------------------

typedef MRESULT (APIENTRY * WndProcCast) (HWND, ULONG, MPARAM, MPARAM);
#define CASTWNDPROC (WndProcCast)

/*
 * Decide what window classes we're going to use
 * for this combination of CTl3D/FAFA settings
 */

#define STATIC_CLASS     _T("STATIC")
#define STATIC_FLAGS     (SS_TEXT|DT_LEFT|SS_LEFT|WS_VISIBLE)
#define CHECK_CLASS      _T("BUTTON")
#define CHECK_FLAGS      (BS_AUTOCHECKBOX|WS_TABSTOP)
#define CHECK_IS_FAFA    FALSE
#define RADIO_CLASS      _T("BUTTON" )
#define RADIO_FLAGS      (BS_AUTORADIOBUTTON|WS_VISIBLE)
#define RADIO_SIZE       20
#define RADIO_IS_FAFA    FALSE
#define PURE_WINDOWS
/*  PM has no group box button style
#define GROUP_CLASS      "BUTTON"
#define GROUP_FLAGS      (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
*/

/*
#define BITCHECK_FLAGS   (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE)
#define BITRADIO_FLAGS   (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE)
*/

// ---------------------------------------------------------------------------
// misc macros
// ---------------------------------------------------------------------------

#define MEANING_CHARACTER '0'
#define DEFAULT_ITEM_WIDTH  200
#define DEFAULT_ITEM_HEIGHT 80

// Scale font to get edit control height
#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)    (3*(cy)/2)

#ifdef __WXPM__

// Generic subclass proc, for panel item moving/sizing and intercept
// EDIT control VK_RETURN messages
extern LONG APIENTRY wxSubclassedGenericControlProc(WXHWND hWnd, WXDWORD message, WXWPARAM wParam, WXLPARAM lParam);

#endif

// ---------------------------------------------------------------------------
// constants which might miss from some compilers' headers
// ---------------------------------------------------------------------------

#if !defined(WS_EX_CLIENTEDGE)
    #define WS_EX_CLIENTEDGE 0x00000200L
#endif

#ifndef ENDSESSION_LOGOFF
    #define ENDSESSION_LOGOFF    0x80000000
#endif

#ifndef PMERR_INVALID_PARM
    #define PMERR_INVALID_PARM 0x1303
#endif

#ifndef PMERR_INVALID_PARAMETERS
    #define PMERR_INVALID_PARAMETERS 0x1208
#endif

#ifndef BOOKERR_INVALID_PARAMETERS
    #define BOOKERR_INVALID_PARAMETERS -1
#endif

#ifndef DLGC_ENTRYFIELD
    #define DLGC_ENTRYFIELD  0x0001
#endif

#ifndef DLGC_BUTTON
    #define DLGC_BUTTON      0x0002
#endif

#ifndef DLGC_MLE
    #define DLGC_MLE         0x0400
#endif

#ifndef DP_NORMAL
    #define DP_NORMAL 0
#endif

// ---------------------------------------------------------------------------
// debug messages -- OS/2 has no native debug output system
// ---------------------------------------------------------------------------

// ---------------------------------------------------------------------------
// macros to make casting between WXFOO and FOO a bit easier: the GetFoo()
// returns Foo cast to the Windows type for oruselves, while GetFooOf() takes
// an argument which should be a pointer or reference to the object of the
// corresponding class (this depends on the macro)
// ---------------------------------------------------------------------------

#define GetHwnd()               ((HWND)GetHWND())
#define GetHwndOf(win)          ((HWND)((win)->GetHWND()))
// old name
#define GetWinHwnd              GetHwndOf

#define GetHdc()                ((HDC)GetHDC())
#define GetHdcOf(dc)            ((HDC)(dc).GetHDC())

#define GetHbitmap()            ((HBITMAP)GetHBITMAP())
#define GetHbitmapOf(bmp)       ((HBITMAP)(bmp).GetHBITMAP())

#define GetHicon()              ((HICON)GetHICON())
#define GetHiconOf(icon)        ((HICON)(icon).GetHICON())

#define GetHaccel()             ((HACCEL)GetHACCEL())
#define GetHaccelOf(table)      ((HACCEL)((table).GetHACCEL()))

#define GetHmenu()              ((HMENU)GetHMenu())
#define GetHmenuOf(menu)        ((HMENU)menu->GetHMenu())

#define GetHcursor()            ((HCURSOR)GetHCURSOR())
#define GetHcursorOf(cursor)    ((HCURSOR)(cursor).GetHCURSOR())

#define GetHfont()              ((HFONT)GetHFONT())
#define GetHfontOf(font)        ((HFONT)(font).GetHFONT())

// OS/2 convention of the mask is opposed to the wxWidgets one, so we need
// to invert the mask each time we pass one/get one to/from Windows
extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w = 0, int h = 0);
extern HBITMAP wxFlipBmp(HBITMAP hbmp, int w = 0, int h = 0);

// ---------------------------------------------------------------------------
// global data
// ---------------------------------------------------------------------------

#ifdef __WXPM__
// The MakeProcInstance version of the function wxSubclassedGenericControlProc
WXDLLEXPORT_DATA(extern int) wxGenericControlSubClassProc;
WXDLLEXPORT_DATA(extern wxChar*) wxBuffer;
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
#endif

// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------

#ifdef __WXPM__
extern "C"
{
WXDLLEXPORT HINSTANCE wxGetInstance();
}

WXDLLEXPORT void wxSetInstance(HINSTANCE hInst);
#endif

#include "wx/thread.h"
static inline MRESULT MySendMsg(HWND hwnd, ULONG ulMsgid,
                                MPARAM mpParam1, MPARAM mpParam2)
{
    MRESULT vRes;
    vRes = ::WinSendMsg(hwnd, ulMsgid, mpParam1, mpParam2);
#if wxUSE_THREADS
    if (!wxThread::IsMain())
        ::WinPostMsg(hwnd, ulMsgid, mpParam1, mpParam2);
#endif
    return vRes;
}
#define WinSendMsg MySendMsg

#ifdef __WXPM__

WXDLLEXPORT void wxDrawBorder( HPS     hPS
                              ,RECTL&  rRect
                              ,WXDWORD dwStyle
                             );

WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);

WXDLLEXPORT void   wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);

WXDLLEXPORT void   wxConvertVectorFontSize( FIXED   fxPointSize
                                           ,PFATTRS pFattrs
                                          );
WXDLLEXPORT void   wxFillLogFont( LOGFONT*      pLogFont
                                 ,PFACENAMEDESC pFaceName
                                 ,HPS*          phPS
                                 ,bool*         pbInternalPS
                                 ,long*         pflId
                                 ,wxString&     sFaceName
                                 ,wxFont*       pFont
                                );
WXDLLEXPORT wxFontEncoding wxGetFontEncFromCharSet(int nCharSet);
WXDLLEXPORT void   wxOS2SelectMatchingFontByName( PFATTRS       vFattrs
                                                 ,PFACENAMEDESC pFaceName
                                                 ,PFONTMETRICS  pFM
                                                 ,int           nNumFonts
                                                 ,const wxFont* pFont
                                                );
WXDLLEXPORT wxFont wxCreateFontFromLogFont( LOGFONT*      pLogFont
                                           ,PFONTMETRICS  pFM
                                           ,PFACENAMEDESC pFace
                                          );
WXDLLEXPORT int    wxGpiStrcmp(wxChar* s0, wxChar* s1);

WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);

// Find maximum size of window/rectangle
WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect);

WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd);
WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item);

// Safely get the window text (i.e. without using fixed size buffer)
WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);

// get the window class name
WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);

// get the window id (should be unsigned, hence this is not wxWindowID which
// is, for mainly historical reasons, signed)
WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);

// Convert a PM Error code to a string
WXDLLEXPORT extern wxString wxPMErrorToStr(ERRORID vError);

// Does this window style specify any border?
inline bool wxStyleHasBorder(long style)
{
  return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
                   wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
}

inline RECTL wxGetWindowRect(HWND hWnd)
{
    RECTL                           vRect;

    ::WinQueryWindowRect(hWnd, &vRect);
    return vRect;
} // end of wxGetWindowRect

WXDLLEXPORT extern void wxOS2SetFont( HWND          hWnd
                                     ,const wxFont& rFont
                                    );

WXDLLEXPORT extern bool wxCheckWindowWndProc( WXHWND    hWnd
                                             ,WXFARPROC fnWndProc
                                            );
WXDLLEXPORT extern wxBitmap wxDisableBitmap( const wxBitmap& rBmp
                                            ,long            lColor
                                           );

#include "wx/colour.h"

WXDLLEXPORT extern COLORREF wxColourToRGB(const wxColour& rColor);

#endif // __WXPM__

#endif // _WX_PRIVATE_H_


text:
BOOL CoditFilelstPrepAPI( void )
{
	// Currently nothing to do here
	return TRUE;
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root.

package com.microsoft.alm.plugin.external.commands;

import com.microsoft.alm.plugin.context.ServerContext;
import com.microsoft.alm.plugin.external.exceptions.ToolMemoryException;
import com.microsoft.alm.plugin.external.tools.TfTool;
import com.microsoft.alm.plugin.external.utils.ProcessHelper;
import org.apache.commons.lang.StringUtils;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.io.IOException;
import java.io.InputStream;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyList;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
@PrepareForTest({ProcessHelper.class, TfTool.class})
public class CommandTest extends AbstractCommandTest {

    /**
     * This test makes sure that output from a command is flushed before the completion event is fired.
     *
     * @throws Exception
     */
    @Test
    public void testRaceCondition() throws Exception {
        // Fake the tool location so this works on any machine
        PowerMockito.mockStatic(TfTool.class);
        when(TfTool.getValidLocation()).thenReturn("/path/tf_home");

        Process proc = Mockito.mock(Process.class);
        PowerMockito.mockStatic(ProcessHelper.class);
        when(ProcessHelper.startProcess(anyString(), anyList())).thenReturn(proc);
        when(proc.getErrorStream()).thenReturn(new InputStream() {
            @Override
            public int read() throws IOException {
                return -1;
            }
        });
        when(proc.getInputStream()).thenReturn(new InputStream() {
            private String result = "12345";
            private int index = 0;

            @Override
            public int read() throws IOException {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                if (index < result.length()) {
                    return result.charAt(index++);
                } else {
                    return -1;
                }
            }
        });
        when(proc.waitFor()).thenAnswer(new Answer<Integer>() {
            @Override
            public Integer answer(InvocationOnMock invocation) throws Throwable {
                return 0;
            }
        });
        when(proc.exitValue()).thenReturn(0);

        final MyCommand cmd = new MyCommand(null);
        final String output = cmd.runSynchronously();
        Assert.assertEquals("12345", StringUtils.strip(output));
    }

    private class MyCommand extends Command<String> {

        public MyCommand(ServerContext context) {
            super("mycommand", context);
        }

        @Override
        public String parseOutput(String stdout, String stderr) {
            return stdout;
        }
    }

    @Test
    public void testIsMemoryException_TrueWindows() {
        MyCommand command = new MyCommand(null);
        assertTrue(ToolMemoryException.getErrorMsg(), command.isMemoryException("Error occurred during initialization of VM\r\nCould not reserve enough space for"));
    }

    @Test
    public void testIsMemoryException_TrueLinux() {
        MyCommand command = new MyCommand(null);
        assertTrue(ToolMemoryException.getErrorMsg(), command.isMemoryException("Error occurred during initialization of VM\nCould not reserve enough space for"));
    }

    @Test
    public void testIsMemoryException_False() {
        MyCommand command = new MyCommand(null);
        assertFalse(ToolMemoryException.getErrorMsg(), command.isMemoryException("Other error"));
    }
}


text:
<?php

final class PhabricatorAuthWaitForApprovalMessageType
  extends PhabricatorAuthMessageType {

  const MESSAGEKEY = 'auth.wait-for-approval';

  public function getDisplayName() {
    return pht('Wait For Approval Instructions');
  }

  public function getShortDescription() {
    return pht(
      'Instructions on the "Wait For Approval" screen, shown to users who '.
      'have registered an account that has not yet been approved by an '.
      'administrator.');
  }

}


text:
#ifndef FILENAME_H
#define FILENAME_H

#include <QFlags>
#include <QList>
#include <QMap>
#include <QSharedPointer>
#include <QString>
#include <QStringList>

class AstFilename;
class Image;
class Profile;
class QSettings;
class QVariant;
class Site;
class Token;

class Filename
{
	public:
		enum PathFlag
		{
			None = 0,
			ConditionalFilenames = 1, // complex (true)
			ExpandConditionals = 2, // complex (true)
			CapLength = 4, // maxLength (true)
			Fix = 8, // shouldFixFilename (true)
			IncludeFolder = 16, // getFull (false)
			KeepInvalidTokens = 32, // keepInvalidTokens (false)

			Complex = ConditionalFilenames | ExpandConditionals,
			File = CapLength | Fix,
			Path = File | IncludeFolder,
			Default = Complex | File,
			Full = Complex | Path,
		};
		Q_DECLARE_FLAGS(PathFlags, PathFlag)

		/**
		 * Creates an empty filename.
		 */
		Filename();

		/**
		 * Creates a Filename based off the passed format.
		 * @param format The format to use when generating paths with this filename.
		 */
		explicit Filename(QString format);

		/**
		 * @return The format to use when generating paths with this filename.
		 */
		QString format() const;

		/**
		 * @param format The format to use when generating paths with this filename.
		 */
		void setFormat(const QString &format);

		/**
		 * The method to use when using the "escape" option on variables.
		 * Useful for SQL-escaping variables, for example.
		 */
		void setEscapeMethod(QString (*)(const QVariant &));

		QStringList path(const Image &img, Profile *profile, const QString &pth = "", int counter = 0, PathFlags flags = Default) const;
		QStringList path(QMap<QString, Token> tokens, Profile *profile, QString folder = "", int counter = 0, PathFlags flags = Default) const;

		/**
		 * Check whether the filename is valid or not.
		 * Note that even a filename that compiles might not be valid, for example if it's not unique or does not have an extension.
		 *
		 * @param profile [int] The profile object to use for various filename settings.
		 * @param error [out] The error message, if there is one.
		 * @return Whether the filename is valid.
		 */
		bool isValid(Profile *profile = nullptr, QString *error = nullptr) const;

		/**
		 * Check whether the filename requires to first save images before being generated.
		 * This can be necessary when using %md5% or %filesize% for example, when the information is not yet known and will be compiled once saved.
		 *
		 * @param tokens The tokens of the media to save.
		 * @return Whether the filename requires to first save images before being generated.
		 */
		bool needTemporaryFile(const QMap<QString, Token> &tokens) const;

		int needExactTags(Site *site, QSettings *settings, const QString &api = "") const;

		QList<QMap<QString, Token>> expandTokens(QMap<QString, Token> tokens, QSettings *settings) const;
		int needExactTags(const QStringList &forcedTokens = {}, const QStringList &customTokens = {}) const;

	protected:
		static QList<Token> getReplace(const QString &key, const Token &token, QSettings *settings);
		static bool returnError(const QString &msg, QString *error);

	private:
		QString m_format;
		QSharedPointer<AstFilename> m_ast;
		QString (*m_escapeMethod)(const QVariant &) = nullptr;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(Filename::PathFlags)

#endif // FILENAME_H


text:
ALTER TABLE structural_variation_feature ADD COLUMN allele_freq FLOAT DEFAULT NULL;
ALTER TABLE structural_variation_feature ADD COLUMN allele_count INT(10) UNSIGNED DEFAULT NULL;

# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_99_100_b.sql|add frequency to structural variation');