text:
describe("Plots", () => {
  describe("RectanglePlot", () => {
    let SVG_WIDTH = 300;
    let SVG_HEIGHT = 300;
    let DATA = [
      { x: 0, y: 0, x2: 1, y2: 1 },
      { x: 1, y: 1, x2: 2, y2: 2 },
      { x: 2, y: 2, x2: 3, y2: 3 },
      { x: 3, y: 3, x2: 4, y2: 4 },
      { x: 4, y: 4, x2: 5, y2: 5 }
    ];
    let VERIFY_CELLS = (cells: d3.Selection<any>) => {
      assert.strictEqual(cells[0].length, 5);
      cells.each(function(d: any, i: number) {
        let cell = d3.select(this);
        assert.closeTo(+cell.attr("height"), 50, 0.5, "Cell height is correct");
        assert.closeTo(+cell.attr("width"), 50, 0.5, "Cell width is correct");
        assert.closeTo(+cell.attr("x"), 25 + 50 * i, 0.5, "Cell x coordinate is correct");
        assert.closeTo(+cell.attr("y"), 25 + 50 * (cells[0].length - i - 1), 0.5, "Cell y coordinate is correct");
      });
    };

    it("renders correctly", () => {
      let xScale = new Plottable.Scales.Linear();
      let yScale = new Plottable.Scales.Linear();
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let rectanglePlot = new Plottable.Plots.Rectangle();
      rectanglePlot.addDataset(new Plottable.Dataset(DATA));
      rectanglePlot.x((d) => d.x, xScale)
                   .y((d) => d.y, yScale)
                   .x2((d) => d.x2)
                   .y2((d) => d.y2)
                   .renderTo(svg);
      VERIFY_CELLS((<any> rectanglePlot)._renderArea.selectAll("rect"));
      svg.remove();
    });

    it("retrieves the correct entity under a point", () => {
      let xScale = new Plottable.Scales.Linear();
      let yScale = new Plottable.Scales.Linear();
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let dataset = new Plottable.Dataset(DATA);
      let plot = new Plottable.Plots.Rectangle()
        .x((d) => d.x, xScale).x2((d) => d.x2)
        .y((d) => d.y, yScale).y2((d) => d.y2);
      plot.addDataset(dataset).renderTo(svg);
      let entities = plot.entitiesAt({ x: xScale.scale(2.5), y: yScale.scale(2.5) });
      assert.lengthOf(entities, 1, "found only one entity when querying a point inside the third rectangle");
      assert.strictEqual(entities[0].index, 2, "entity retrieved is at index 2");
      svg.remove();
    });

    it("retrieves correct entities under a point", () => {
      let xScale = new Plottable.Scales.Linear();
      let yScale = new Plottable.Scales.Linear();
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let dataset = new Plottable.Dataset([
        { x: 1, y: 1, x2: 3, y2: 3 },
        { x: 4, y: 2, x2: 2, y2: 4 }
      ]);
      let plot = new Plottable.Plots.Rectangle()
        .x((d) => d.x, xScale).x2((d) => d.x2)
        .y((d) => d.y, yScale).y2((d) => d.y2);
      plot.addDataset(dataset).renderTo(svg);
      let entities = plot.entitiesAt({ x: xScale.scale(2), y: xScale.scale(2) });
      assert.lengthOf(entities, 2, "two entities when querying a point in both");
      assert.strictEqual(entities[0].index, 0, "entity retrieved is at index 0");
      assert.strictEqual(entities[1].index, 1, "entity retrieved is at index 1");
      entities = plot.entitiesAt({ x: xScale.scale(4), y: yScale.scale(4) });
      assert.lengthOf(entities, 1, "found only one entity when querying a point inside the second rectangle");
      assert.strictEqual(entities[0].index, 1, "entity retrieved is at index 1");
      entities = plot.entitiesAt({ x: xScale.scale(1), y: yScale.scale(1) });
      assert.lengthOf(entities, 1, "found only one entity when querying a point inside the first rectangle");
      assert.strictEqual(entities[0].index, 0, "entity retrieved is at index 0");
      svg.remove();
    });

    it("autorangeMode(\"x\")", () => {
      let staggeredData = [
        { y: "A", x: 0, x2: 1 },
        { y: "B", x: 1, x2: 2 }
      ];

      let xScale = new Plottable.Scales.Linear();
      let yScale = new Plottable.Scales.Category();
      xScale.padProportion(0);

      let plot = new Plottable.Plots.Rectangle();
      plot.x(function(d) { return d.x; }, xScale);
      plot.x2(function(d) { return d.x2; });
      plot.y(function(d) { return d.y; }, yScale);
      plot.addDataset(new Plottable.Dataset(staggeredData));
      plot.autorangeMode("x");
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      plot.renderTo(svg);

      assert.deepEqual(xScale.domain(), [0, 2], "y domain includes both visible segments");

      yScale.domain(["A"]);
      assert.deepEqual(xScale.domain(), [0, 1], "y domain includes only the visible segment (first)");

      yScale.domain(["B"]);
      assert.deepEqual(xScale.domain(), [1, 2], "y domain includes only the visible segment (second)");

      svg.remove();
    });

    it("autorangeMode(\"y\")", () => {
      let staggeredData = [
        { x: "A", y: 0, y2: 1 },
        { x: "B", y: 1, y2: 2 }
      ];

      let xScale = new Plottable.Scales.Category();
      let yScale = new Plottable.Scales.Linear();
      yScale.padProportion(0);

      let plot = new Plottable.Plots.Rectangle();
      plot.x(function(d) { return d.x; }, xScale);
      plot.y(function(d) { return d.y; }, yScale);
      plot.y2(function(d) { return d.y2; });
      plot.addDataset(new Plottable.Dataset(staggeredData));
      plot.autorangeMode("y");
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      plot.renderTo(svg);

      assert.deepEqual(yScale.domain(), [0, 2], "y domain includes both visible segments");

      xScale.domain(["A"]);
      assert.deepEqual(yScale.domain(), [0, 1], "y domain includes only the visible segment (first)");

      xScale.domain(["B"]);
      assert.deepEqual(yScale.domain(), [1, 2], "y domain includes only the visible segment (second)");

      svg.remove();
    });

  });

  describe("fail safe tests", () => {
    it("illegal rectangles don't get displayed", () => {
      let svg = TestMethods.generateSVG();

      let data1 = [
        { x: "A", y: 1, y2: 2, v: 1 },
        { x: "B", y: 2, y2: 3, v: 2 },
        { x: "C", y: 3, y2: NaN, v: 3 },
        { x: "D", y: 4, y2: 5, v: 4 },
        { x: "E", y: 5, y2: 6, v: 5 },
        { x: "F", y: 6, y2: 7, v: 6 }
      ];

      let xScale = new Plottable.Scales.Category();
      let yScale = new Plottable.Scales.Linear();

      let plot = new Plottable.Plots.Rectangle();
      plot
        .x((d: any) => d.x, xScale)
        .y((d: any) => d.y, yScale)
        .y2((d: any) => d.y2);
      plot.addDataset(new Plottable.Dataset(data1));

      plot.renderTo(svg);

      let rectanglesSelection = plot.selections();

      assert.strictEqual(rectanglesSelection.size(), 5,
        "only 5 rectangles should be displayed");

      rectanglesSelection.each(function(d: any, i: number) {
        let sel = d3.select(this);
        assert.isFalse(Plottable.Utils.Math.isNaN(+sel.attr("x")),
          "x attribute should be valid for rectangle # " + i + ". Currently " + sel.attr("x"));
        assert.isFalse(Plottable.Utils.Math.isNaN(+sel.attr("y")),
          "y attribute should be valid for rectangle # " + i + ". Currently " + sel.attr("y"));
        assert.isFalse(Plottable.Utils.Math.isNaN(+sel.attr("height")),
          "height attribute should be valid for rectangle # " + i + ". Currently " + sel.attr("height"));
        assert.isFalse(Plottable.Utils.Math.isNaN(+sel.attr("width")),
          "width attribute should be valid for rectangle # " + i + ". Currently " + sel.attr("width"));
      });

      svg.remove();
    });
  });

  describe("RectanglePlot - Grids", () => {
    let SVG_WIDTH = 400;
    let SVG_HEIGHT = 200;
    let DATA = [
      {x: "A", y: "U", magnitude: 0},
      {x: "B", y: "U", magnitude: 2},
      {x: "A", y: "V", magnitude: 16},
      {x: "B", y: "V", magnitude: 8},
    ];

    let VERIFY_CELLS = (cells: any[]) => {
      assert.strictEqual(cells.length, 4);

      let cellAU = d3.select(cells[0]);
      let cellBU = d3.select(cells[1]);
      let cellAV = d3.select(cells[2]);
      let cellBV = d3.select(cells[3]);

      assert.strictEqual(cellAU.attr("height"), "100", "cell 'AU' height is correct");
      assert.strictEqual(cellAU.attr("width"), "200", "cell 'AU' width is correct");
      assert.strictEqual(cellAU.attr("x"), "0", "cell 'AU' x coord is correct");
      assert.strictEqual(cellAU.attr("y"), "0", "cell 'AU' y coord is correct");
      assert.strictEqual(cellAU.attr("fill"), "#000000", "cell 'AU' color is correct");

      assert.strictEqual(cellBU.attr("height"), "100", "cell 'BU' height is correct");
      assert.strictEqual(cellBU.attr("width"), "200", "cell 'BU' width is correct");
      assert.strictEqual(cellBU.attr("x"), "200", "cell 'BU' x coord is correct");
      assert.strictEqual(cellBU.attr("y"), "0", "cell 'BU' y coord is correct");
      assert.strictEqual(cellBU.attr("fill"), "#212121", "cell 'BU' color is correct");

      assert.strictEqual(cellAV.attr("height"), "100", "cell 'AV' height is correct");
      assert.strictEqual(cellAV.attr("width"), "200", "cell 'AV' width is correct");
      assert.strictEqual(cellAV.attr("x"), "0", "cell 'AV' x coord is correct");
      assert.strictEqual(cellAV.attr("y"), "100", "cell 'AV' y coord is correct");
      assert.strictEqual(cellAV.attr("fill"), "#ffffff", "cell 'AV' color is correct");

      assert.strictEqual(cellBV.attr("height"), "100", "cell 'BV' height is correct");
      assert.strictEqual(cellBV.attr("width"), "200", "cell 'BV' width is correct");
      assert.strictEqual(cellBV.attr("x"), "200", "cell 'BV' x coord is correct");
      assert.strictEqual(cellBV.attr("y"), "100", "cell 'BV' y coord is correct");
      assert.strictEqual(cellBV.attr("fill"), "#777777", "cell 'BV' color is correct");
    };

    it("renders correctly", () => {
      let xScale = new Plottable.Scales.Category();
      let yScale = new Plottable.Scales.Category();
      let colorScale = new Plottable.Scales.InterpolatedColor();
      colorScale.range(["black", "white"]);
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let gridPlot = new Plottable.Plots.Rectangle();
      gridPlot.addDataset(new Plottable.Dataset(DATA))
              .attr("fill", (d) => d.magnitude, colorScale);
      gridPlot.x((d: any) => d.x, xScale)
              .y((d: any) => d.y, yScale);
      gridPlot.renderTo(svg);
      VERIFY_CELLS((<any> gridPlot)._renderArea.selectAll("rect")[0]);
      svg.remove();
    });

    it("renders correctly when data is set after construction", () => {
      let xScale = new Plottable.Scales.Category();
      let yScale = new Plottable.Scales.Category();
      let colorScale = new Plottable.Scales.InterpolatedColor();
      colorScale.range(["black", "white"]);
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let dataset = new Plottable.Dataset();
      let gridPlot = new Plottable.Plots.Rectangle();
      gridPlot.addDataset(dataset)
              .attr("fill", (d) => d.magnitude, colorScale);
      gridPlot.x((d: any) => d.x, xScale)
              .y((d: any) => d.y, yScale)
              .renderTo(svg);
      dataset.data(DATA);
      VERIFY_CELLS((<any> gridPlot)._renderArea.selectAll("rect")[0]);
      svg.remove();
    });

    it("renders correctly when there isn't data for every spot", () => {
      let CELL_HEIGHT = 50;
      let CELL_WIDTH = 100;
      let xScale = new Plottable.Scales.Category();
      let yScale = new Plottable.Scales.Category();
      let colorScale = new Plottable.Scales.InterpolatedColor();
      colorScale.range(["black", "white"]);
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let dataset = new Plottable.Dataset();
      let gridPlot = new Plottable.Plots.Rectangle();
      gridPlot.addDataset(dataset)
              .attr("fill", (d) => d.magnitude, colorScale);
      gridPlot.x((d: any) => d.x, xScale)
              .y((d: any) => d.y, yScale)
              .renderTo(svg);
      let data = [
        {x: "A", y: "W", magnitude: 0},
        {x: "B", y: "X", magnitude: 8},
        {x: "C", y: "Y", magnitude: 16},
        {x: "D", y: "Z", magnitude: 24}
      ];
      dataset.data(data);
      let cells = (<any> gridPlot)._renderArea.selectAll("rect")[0];
      assert.strictEqual(cells.length, data.length);
      for (let i = 0; i < cells.length; i++) {
        let cell = d3.select(cells[i]);
        assert.strictEqual(cell.attr("x"), String(i * CELL_WIDTH), "Cell x coord is correct");
        assert.strictEqual(cell.attr("y"), String(i * CELL_HEIGHT), "Cell y coord is correct");
        assert.strictEqual(cell.attr("width"), String(CELL_WIDTH), "Cell width is correct");
        assert.strictEqual(cell.attr("height"), String(CELL_HEIGHT), "Cell height is correct");
      }
      svg.remove();
    });

    it("can invert y axis correctly", () => {
      let xScale = new Plottable.Scales.Category();
      let yScale = new Plottable.Scales.Category();
      let colorScale = new Plottable.Scales.InterpolatedColor();
      colorScale.range(["black", "white"]);
      let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
      let gridPlot = new Plottable.Plots.Rectangle();
      gridPlot.addDataset(new Plottable.Dataset(DATA))
              .attr("fill", (d) => d.magnitude, colorScale);
      gridPlot.x((d: any) => d.x, xScale)
              .y((d: any) => d.y, yScale)
              .renderTo(svg);

      yScale.domain(["U", "V"]);

      let cells = (<any> gridPlot)._renderArea.selectAll("rect")[0];
      let cellAU = d3.select(cells[0]);
      let cellAV = d3.select(cells[2]);
      cellAU.attr("fill", "#000000");
      cellAU.attr("x", "0");
      cellAU.attr("y", "100");

      cellAV.attr("fill", "#ffffff");
      cellAV.attr("x", "0");
      cellAV.attr("y", "0");

      yScale.domain(["V", "U"]);
      cells = (<any> gridPlot)._renderArea.selectAll("rect")[0];
      cellAU = d3.select(cells[0]);
      cellAV = d3.select(cells[2]);
      cellAU.attr("fill", "#000000");
      cellAU.attr("x", "0");
      cellAU.attr("y", "0");

      cellAV.attr("fill", "#ffffff");
      cellAV.attr("x", "0");
      cellAV.attr("y", "100");

      svg.remove();
    });

    describe("selections()", () => {

      it("retrieves all selections with no args", () => {
        let xScale = new Plottable.Scales.Category();
        let yScale = new Plottable.Scales.Category();
        let colorScale = new Plottable.Scales.InterpolatedColor();
        colorScale.range(["black", "white"]);
        let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
        let gridPlot = new Plottable.Plots.Rectangle();
        let dataset = new Plottable.Dataset(DATA);
        gridPlot.addDataset(dataset)
                .attr("fill", (d) => d.magnitude, colorScale);
        gridPlot.x((d: any) => d.x, xScale)
                .y((d: any) => d.y, yScale);
        gridPlot.renderTo(svg);

        let allCells = gridPlot.selections();
        assert.strictEqual(allCells.size(), 4, "all cells retrieved");

        svg.remove();
      });

      it("retrieves correct selections", () => {
        let xScale = new Plottable.Scales.Category();
        let yScale = new Plottable.Scales.Category();
        let colorScale = new Plottable.Scales.InterpolatedColor();
        colorScale.range(["black", "white"]);
        let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
        let gridPlot = new Plottable.Plots.Rectangle();
        let dataset = new Plottable.Dataset(DATA);
        gridPlot.addDataset(dataset)
                .attr("fill", (d) => d.magnitude, colorScale);
        gridPlot.x((d: any) => d.x, xScale)
                .y((d: any) => d.y, yScale);
        gridPlot.renderTo(svg);

        let allCells = gridPlot.selections([dataset]);
        assert.strictEqual(allCells.size(), 4, "all cells retrieved");
        let selectionData = allCells.data();
        assert.includeMembers(selectionData, DATA, "data in selection data");

        svg.remove();
      });

      it("skips invalid Datasets", () => {
        let xScale = new Plottable.Scales.Category();
        let yScale = new Plottable.Scales.Category();
        let colorScale = new Plottable.Scales.InterpolatedColor();
        colorScale.range(["black", "white"]);
        let svg = TestMethods.generateSVG(SVG_WIDTH, SVG_HEIGHT);
        let gridPlot = new Plottable.Plots.Rectangle();
        let dataset = new Plottable.Dataset(DATA);
        gridPlot.addDataset(dataset)
          .attr("fill", (d) => d.magnitude, colorScale);
         gridPlot.x((d: any) => d.x, xScale)
          .y((d: any) => d.y, yScale);
        gridPlot.renderTo(svg);

        let dummyDataset = new Plottable.Dataset([]);
        let allCells = gridPlot.selections([dataset, dummyDataset]);
        assert.strictEqual(allCells.size(), 4, "all cells retrieved");
        let selectionData = allCells.data();
        assert.includeMembers(selectionData, DATA, "data in selection data");

        svg.remove();
      });
    });
  });
});


text:
module DT {
	'use strict';

	var Promise: typeof Promise = require('bluebird');
	var nodeExec = require('child_process').exec;

	export class ExecResult {
		error;
		stdout = '';
		stderr = '';
		exitCode: number;
	}

	export function exec(filename: string, cmdLineArgs: string[]): Promise<ExecResult> {
		return new Promise((resolve) => {
			var result = new ExecResult();
			result.exitCode = null;

			var cmdLine = filename + ' ' + cmdLineArgs.join(' ');

			nodeExec(cmdLine, {maxBuffer: 1 * 1024 * 1024}, (error, stdout, stderr) => {
				result.error = error;
				result.stdout = stdout;
				result.stderr = stderr;
				result.exitCode = error ? error.code : 0;
				resolve(result);
			});
		});
	}
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

describe SimplecovSample do
  subject { SimplecovSample::Sample.new("hoge") }

  describe "#test1" do
    it "" do
      expect(subject.test1()).to eq "test1"
    end
  end

  describe "#test_proc1" do
    it "" do
      expect(subject.test_proc1()).to eq "test_proc1"
    end
  end

  describe "#test4" do
    it "" do
      expect(subject.test4()).to eq "test4"
    end
  end

  describe "#name" do
    it "" do
      expect(subject.name).to eq "hoge"
    end
  end

  describe "#name2" do
    it "" do
      expect(subject.name2(true)).to eq "HOGE"
    end
  end

  describe "#name3" do
    it "" do
      expect(subject.name3(false)).to eq "hoge"
    end
  end

  describe "#name4" do
    it "" do
      expect(subject.name4(2)).to eq "hogehoge"
    end
  end

  describe "#mapped" do
    it "" do
      expect(subject.mapped([])).to eq []
    end
  end

  describe "#mapped2" do
    it "" do
      expect(subject.mapped2([])).to eq []
    end
  end
end


text:
package com.delidishes.validate.spring.test;

import com.delidishes.validate.spring.filter.ValidateFilter;
import com.delidishes.validate.spring.interceptor.PojoValidationInterceptor;
import com.delidishes.validate.spring.test.controller.TestControllerWithErrorHandler;
import com.delidishes.validate.spring.test.dto.TestPojo;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import java.io.StringWriter;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath*:applicationContextForTest.xml")
public class MockTest {

	@Autowired
	private TestControllerWithErrorHandler testController;

	@Autowired
	private PojoValidationInterceptor interceptor;

	@Test
	public void initValidateFilterWithValidateWrapperTest() throws Exception {
		TestPojo testPojo = new TestPojo();
		ObjectMapper mapper = new ObjectMapper();
		StringWriter writer = new StringWriter();
		mapper.writeValue(writer, testPojo);

		ValidateFilter validateFilter = new ValidateFilter();
		MockMvc mockMvc = MockMvcBuilders.standaloneSetup(testController)
				.addFilter(validateFilter, "/**")
				.addInterceptors(interceptor)
				.build();
		mockMvc.perform(
				MockMvcRequestBuilders.post("/test")
						.contentType(MediaType.APPLICATION_JSON)
						.content(writer.toString().getBytes())
		).andExpect(MockMvcResultMatchers.status().is4xxClientError());
	}

}


text:
package com.amazonaws.services.ecr.model;

import javax.annotation.Generated;

/**
 * <p>
 * The image requested does not exist in the specified repository.
 * </p>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImageNotFoundException extends com.amazonaws.services.ecr.model.AmazonECRException {
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new ImageNotFoundException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public ImageNotFoundException(String message) {
        super(message);
    }

}


text:
/*
 * This file is generated by jOOQ.
*/
package com.rpkit.classes.bukkit.database.jooq.rpkit.tables;

import com.rpkit.classes.bukkit.database.jooq.rpkit.Indexes;
import com.rpkit.classes.bukkit.database.jooq.rpkit.Keys;
import com.rpkit.classes.bukkit.database.jooq.rpkit.Rpkit;
import com.rpkit.classes.bukkit.database.jooq.rpkit.tables.records.RpkitCharacterClassRecord;

import java.util.Arrays;
import java.util.List;

import javax.annotation.Generated;

import org.jooq.Field;
import org.jooq.Identity;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;

/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org",
        "jOOQ version:3.10.2"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RpkitCharacterClass extends TableImpl<RpkitCharacterClassRecord> {

    private static final long serialVersionUID = -779590619;

    /**
     * The reference instance of rpkit.rpkit_character_class
     */
    public static final RpkitCharacterClass RPKIT_CHARACTER_CLASS = new RpkitCharacterClass();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<RpkitCharacterClassRecord> getRecordType() {
        return RpkitCharacterClassRecord.class;
    }

    /**
     * The column rpkit.rpkit_character_class.id.
     */
    public final TableField<RpkitCharacterClassRecord, Integer> ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false).identity(true), this, "");

    /**
     * The column rpkit.rpkit_character_class.character_id.
     */
    public final TableField<RpkitCharacterClassRecord, Integer> CHARACTER_ID = createField("character_id", org.jooq.impl.SQLDataType.INTEGER, this, "");

    /**
     * The column rpkit.rpkit_character_class.class_name.
     */
    public final TableField<RpkitCharacterClassRecord, String> CLASS_NAME = createField("class_name", org.jooq.impl.SQLDataType.VARCHAR(256), this, "");

    /**
     * Create a rpkit.rpkit_character_class table reference
     */
    public RpkitCharacterClass() {
        this(DSL.name("rpkit_character_class"), null);
    }

    /**
     * Create an aliased rpkit.rpkit_character_class table reference
     */
    public RpkitCharacterClass(String alias) {
        this(DSL.name(alias), RPKIT_CHARACTER_CLASS);
    }

    /**
     * Create an aliased rpkit.rpkit_character_class table reference
     */
    public RpkitCharacterClass(Name alias) {
        this(alias, RPKIT_CHARACTER_CLASS);
    }

    private RpkitCharacterClass(Name alias, Table<RpkitCharacterClassRecord> aliased) {
        this(alias, aliased, null);
    }

    private RpkitCharacterClass(Name alias, Table<RpkitCharacterClassRecord> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, "");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Schema getSchema() {
        return Rpkit.RPKIT;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Index> getIndexes() {
        return Arrays.<Index>asList(Indexes.RPKIT_CHARACTER_CLASS_PRIMARY);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Identity<RpkitCharacterClassRecord, Integer> getIdentity() {
        return Keys.IDENTITY_RPKIT_CHARACTER_CLASS;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public UniqueKey<RpkitCharacterClassRecord> getPrimaryKey() {
        return Keys.KEY_RPKIT_CHARACTER_CLASS_PRIMARY;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<UniqueKey<RpkitCharacterClassRecord>> getKeys() {
        return Arrays.<UniqueKey<RpkitCharacterClassRecord>>asList(Keys.KEY_RPKIT_CHARACTER_CLASS_PRIMARY);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public RpkitCharacterClass as(String alias) {
        return new RpkitCharacterClass(DSL.name(alias), this);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public RpkitCharacterClass as(Name alias) {
        return new RpkitCharacterClass(alias, this);
    }

    /**
     * Rename this table
     */
    @Override
    public RpkitCharacterClass rename(String name) {
        return new RpkitCharacterClass(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public RpkitCharacterClass rename(Name name) {
        return new RpkitCharacterClass(name, null);
    }
}


text:
require 'oauth_assist/commands/session_command'

class DeleteServiceCommand < SessionCommand
  action do
    # remove an authentication service linked to the current user
    delete? ? current_user_service.destroy : notify(:cant_delete_current_account)
  end

  protected

  def delete?
    !matching_service_account?(current_user_service.id)
  end
end


text:
/* original parser id follows */
/* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define YYCHECK "yyyymmdd"

#define YYEMPTY        (-1)
#define yyclearin      (yychar = YYEMPTY)
#define yyerrok        (yyerrflag = 0)
#define YYRECOVERING() (yyerrflag != 0)
#define YYENOMEM       (-2)
#define YYEOF          0


text:
/* Copyright (c) 2006, Sun Microsystems, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
	  disclaimer in the documentation and/or other materials provided with the distribution.
    * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived
	  from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

*/

// os defines the interface to operating system

typedef void (*dll_func)(...);

class Thread;
class Event;
class DLL;

class os {
 private:
  static int _vm_page_size;
  static void initialize_system_info();
  friend void os_init();
 public:
  static int    argc();
  static char** argv();
  static void   set_args(int argc, char* argv[]);
  static int    getenv(char* name,char* buffer,int len);
  static void   add_exception_handler(void handler(void* fp, void* sp, void* pc));

  // We must call updateTimes before calling userTime or currentTime.
  static int    updateTimes();
  static double userTime();
  static double systemTime();

  static double currentTime();

  // Timing opertaions for threads
  static double user_time_for(Thread* thread);
  static double system_time_for(Thread* thread);

  // Returns the elapsed time in seconds since the vm started.
  static double elapsedTime();

  // Interface to the win32 performance counter
  static long_int elapsed_counter();
  static long_int elapsed_frequency();

  static void timerStart();
  static void timerStop();
  static void timerPrintBuffer();

  static void* get_hInstance();
  static void* get_prevInstance();
  static int   get_nCmdShow();

  // OS interface to Virtual Memory - used for object memory allocations
  static int   vm_page_size() { return _vm_page_size; }
  static char* reserve_memory(int size);
  static bool  commit_memory(char* addr, int size);
  static bool  uncommit_memory(char* addr, int size);
  static bool  release_memory(char* addr, int size);
  static bool  guard_memory(char* addr, int size);
  static char* exec_memory(int size);

  // OS interface to C memory routines - used for small allocations
  static void* malloc(int size);
  static void* calloc(int size, char filler);
  static void  free(void* p);

  // threads
  static Thread* starting_thread(int* id_addr);
  static Thread* create_thread(int main(void* parameter), void* parameter, int* id_addr);
  static Event*  create_event(bool initial_state);
  static void*   stack_limit(Thread* thread);

  static int  current_thread_id();
  static void wait_for_event(Event* event);
  static void transfer(Thread* from_thread, Event* from_event, Thread* to_thread, Event* to_event);
  static void transfer_and_continue(Thread* from_thread, Event* from_event, Thread* to_thread, Event* to_event);
  static void terminate_thread(Thread* thread);
  static void delete_event(Event* event);

  static void reset_event(Event* event);
  static void signal_event(Event* event);
  static bool wait_for_event_or_timer(Event* event, int timeout_in_ms);

  static void sleep(int ms);

  // thread support for profiling
  static void suspend_thread(Thread* thread);
  static void resume_thread(Thread* thread);
  static void fetch_top_frame(Thread* thread, int** sp, int** fp, char** pc);

  static void breakpoint();

  static int message_box(char* title, char* message);

  static void     fatalExit(int num);

  static bool move_file(char* from, char* to);
  static bool check_directory(char* dir_name);

  // DLL support
  static dll_func dll_lookup(char* name, DLL* library);
  static DLL*     dll_load(char* name);
  static bool     dll_unload(DLL* library);
  static char*    dll_extension();

  // Platform
  static char*	  platform_class_name();
  static int      error_code();
};

// A critial region for controling thread transfer at
// interrupts
class ThreadCritical {
 private:
  static bool _initialized;
  friend void os_init();
  friend void os_exit();
  static void intialize();
  static void release();
 public:
  static bool initialized() { return _initialized; }
  ThreadCritical();
  ~ThreadCritical();
};


text:
package org.usb4java.javax;

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

import javax.usb.UsbHub;

/**
 * A list of USB ports.
 *
 * @author Klaus Reimer (k@ailis.de)
 */
final class Ports
    implements UsbPorts<Port, AbstractDevice>
{
    /** The hub ports. */
    private final List<Port> ports = new ArrayList<Port>();

    /** The hub these ports belong to. */
    private final UsbHub hub;

    /**
     * Constructor.
     *
     * @param hub
     *            The hub the port belongs to.
     */
    Ports(final UsbHub hub)
    {
        this.hub = hub;
        addPort();
    }

    /**
     * Adds a new port and returns it.
     *
     * @return The added port.
     */
    private Port addPort()
    {
        final byte portNo = (byte) (this.ports.size() + 1);
        final Port port = new Port(this.hub, portNo);
        this.ports.add(port);
        return port;
    }

    /**
     * Returns the first free port or adds a new one if no free port was found.
     *
     * @return The first free port.
     */
    private Port getFreePort()
    {
        for (final Port port: this.ports)
        {
            if (!port.isUsbDeviceAttached()) return port;
        }
        return addPort();
    }

    @Override
    public byte getNumberOfPorts()
    {
        return (byte) this.ports.size();
    }

    @Override
    public List<Port> getUsbPorts()
    {
        return Collections.unmodifiableList(this.ports);
    }

    @Override
    public Port getUsbPort(final byte number)
    {
        final int index = (number & 0xff) - 1;
        if (index < 0 || index >= this.ports.size()) return null;
        return this.ports.get(index);
    }

    @Override
    public List<AbstractDevice> getAttachedUsbDevices()
    {
        final List<AbstractDevice> devices = new ArrayList<AbstractDevice>();
        synchronized (this.ports)
        {
            for (final Port port: this.ports)
            {
                if (port.isUsbDeviceAttached())
                {
                    devices.add(port.getUsbDevice());
                }
            }
        }
        return Collections.unmodifiableList(devices);
    }

    @Override
    public boolean isUsbDeviceAttached(final AbstractDevice device)
    {
        synchronized (this.ports)
        {
            for (final Port port: this.ports)
            {
                if (device.equals(port.getUsbDevice())) return true;
            }
        }
        return false;
    }

    @Override
    public void connectUsbDevice(final AbstractDevice device)
    {
        synchronized (this.ports)
        {
            final Port port = getFreePort();
            port.connectUsbDevice(device);
        }
    }

    @Override
    public void disconnectUsbDevice(final AbstractDevice device)
    {
        synchronized (this.ports)
        {
            for (final Port port: this.ports)
            {
                if (device.equals(port.getUsbDevice()))
                {
                    port.disconnectUsbDevice();
                }
            }
        }
    }
}


text:
#ifndef N_PRIORITYARRAY_H
#define N_PRIORITYARRAY_H
//------------------------------------------------------------------------------
/**
    @class nPriorityArray
    @ingroup NebulaDataTypes

    @brief A fixed size priority array. Elements are associated with a priority.

    New Elements are added to the end of the array until the array is full.
    In a full array, new elements replace the current lowest priority element
    (if the priority of the new element is greater of course).

    NOTE: The current implementation uses linear search and thus is slow
    for large arrays.

    (C) 2003 RadonLabs GmbH
*/
#include "kernel/ntypes.h"

//------------------------------------------------------------------------------
template<class TYPE> class nPriorityArray
{
public:
    /// constructor
    nPriorityArray(int size);
    /// copy constructor
    nPriorityArray(const nPriorityArray<TYPE>& rhs);
    /// destructor
    ~nPriorityArray();
    /// assignment operator
    nPriorityArray<TYPE>& operator=(const nPriorityArray<TYPE>& rhs);
    /// [] operator
    TYPE& operator[](int index) const;
    /// clear the array
    void Clear();
    /// add element to array
    void Add(const TYPE& elm, float pri);
    /// get number of elements in array
    int Size() const;
    /// return n'th array element
    TYPE& At(int index);
    /// return true if empty
    bool IsEmpty() const;

private:
    /// update the min pri element index
    void UpdateMinPriElementIndex();
    /// copy content
    void Copy(const nPriorityArray<TYPE>& src);
    /// delete content
    void Delete();
    /// destroy an element (call destructor without freeing memory)
    void Destroy(TYPE* elm);

    /// an element class
    struct Element
    {
        TYPE element;
        float priority;
    };

    int numElements;
    int maxElements;
    int minPriElementIndex;
    Element* elements;
};

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
nPriorityArray<TYPE>::nPriorityArray(int size) :
    numElements(0),
    maxElements(size),
    minPriElementIndex(0)
{
    n_assert(size > 0);
    this->elements = n_new_array(Element, size);
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
void
nPriorityArray<TYPE>::Copy(const nPriorityArray<TYPE>& src)
{
    this->numElements = src.numElements;
    this->maxElements = src.maxElements;
    this->minPriElementIndex = src.minPriElementIndex;
    n_assert(0 == this->elements);
    this->elements = n_new_array(Element, this->maxElements);
    int i;
    for (i = 0; i < this->numElements; i++)
    {
        this->elements[i] = src.elements[i];
    }
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
void
nPriorityArray<TYPE>::Delete()
{
    this->numElements = 0;
    this->maxElements = 0;
    this->minPriElementIndex = 0;
    if (this->elements)
    {
        n_delete_array(this->elements);
        this->elements = 0;
    }
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
nPriorityArray<TYPE>::nPriorityArray(const nPriorityArray<TYPE>& rhs) :
    numElements(0),
    maxElements(0),
    minPriElementIndex(0),
    elements(0)
{
    this->Copy(rhs);
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
nPriorityArray<TYPE>::~nPriorityArray()
{
    this->Delete();
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
void
nPriorityArray<TYPE>::Destroy(TYPE* elm)
{
    elm->~TYPE();
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
void
nPriorityArray<TYPE>::Clear()
{
    n_assert(this->elements);

    // call element destructors
    int i;
    for (i = 0; i < this->numElements; i++)
    {
        this->Destroy(&(this->elements[i].element));
    }
    this->numElements = 0;
    this->minPriElementIndex = 0;
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
void
nPriorityArray<TYPE>::UpdateMinPriElementIndex()
{
    int i;
    this->minPriElementIndex = 0;
    float minPri = this->elements[0].priority;
    for (i = 1; i < this->numElements; i++)
    {
        if (this->elements[i].priority < minPri)
        {
            minPri = this->elements[i].priority;
            this->minPriElementIndex = i;
        }
    }
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
void
nPriorityArray<TYPE>::Add(const TYPE& elm, float pri)
{
    if (this->numElements < this->maxElements)
    {
        this->elements[this->numElements].element = elm;
        this->elements[this->numElements].priority = pri;
        this->numElements++;
        if (this->numElements == this->maxElements)
        {
            this->UpdateMinPriElementIndex();
        }
    }
    else
    {
        if (pri > this->elements[this->minPriElementIndex].priority)
        {
            this->elements[this->minPriElementIndex].element = elm;
            this->elements[this->minPriElementIndex].priority = pri;
            this->UpdateMinPriElementIndex();
        }
    }
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
int
nPriorityArray<TYPE>::Size() const
{
    return this->numElements;
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
TYPE&
nPriorityArray<TYPE>::At(int index)
{
    n_assert((index >= 0) && (index < this->numElements));
    return this->elements[index].element;
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
TYPE&
nPriorityArray<TYPE>::operator[](int index) const
{
    n_assert((index >= 0) && (index < this->numElements));
    return this->elements[index].element;
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
nPriorityArray<TYPE>&
nPriorityArray<TYPE>::operator=(const nPriorityArray<TYPE>& rhs)
{
    this->Delete();
    this->Copy(rhs);
    return *this;
}

//------------------------------------------------------------------------------
/**
*/
template<class TYPE>
bool
nPriorityArray<TYPE>::IsEmpty() const
{
    return (0 == this->numElements);
}

//------------------------------------------------------------------------------
#endif


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Flora, Jena 58: 441 (1875)

#### Original name
Calicium elassosporum Nyl.

### Remarks
null


text:
@interface NSDate (ZMExtension)

- (NSUInteger)numberOfDaysInCurrentMonth;

- (NSUInteger)numberOfWeeksInCurrentMonth;

- (NSUInteger)weeklyOrdinality;

- (NSDate *)firstDayOfCurrentMonth;

- (NSDate *)lastDayOfCurrentMonth;

- (NSDate *)dayInThePreviousMonth;

- (NSDate *)dayInTheFollowingMonth;

- (NSDate *)dayInTheFollowingMonth:(int)month;//获取当前日期之后的几个月

- (NSDate *)dayInTheFollowingDay:(int)day;//获取当前日期之后的几个天

- (NSDateComponents *)YMDComponents;

- (NSDateComponents *)HMSComponents;

- (NSDate *)dateFromString:(NSString *)dateString;//NSString转NSDate

- (NSString *)stringFromDate:(NSDate *)date;//NSDate转NSString

- (long)getWeekIntValueWithDate;

+ (long)getDayNumbertoDay:(NSDate *)today beforDay:(NSDate *)beforday;

+ (BOOL)date:(NSDate *)dateA isTheSameMonthThan:(NSDate *)dateB;
+ (BOOL)date:(NSDate *)dateA isTheSameWeekThan:(NSDate *)dateB;
+ (BOOL)date:(NSDate *)dateA isTheSameDayThan:(NSDate *)dateB;

+ (BOOL)date:(NSDate *)dateA isEqualOrBefore:(NSDate *)dateB;
+ (BOOL)date:(NSDate *)dateA isEqualOrAfter:(NSDate *)dateB;
+ (BOOL)date:(NSDate *)date isEqualOrAfter:(NSDate *)startDate andEqualOrBefore:(NSDate *)endDate;

@end


text:
package org.unitils.mock.core;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Tests the mock object functionality.
 *
 * @author Tim Ducheyne
 * @author Filip Neven
 */
public class MockObjectMatchingBehaviorTest {

    /* Class under test */
    private MockObject<TestClass> mockObject;

    @Before
    public void setUp() {
        mockObject = new MockObject<TestClass>("testMock", TestClass.class, this);
    }

    @Test
    public void betterMatchBySpecifyingValue() {
        mockObject.returns(1).testMethod1(null, null, null);
        mockObject.returns(2).testMethod1("arg1", null, null);

        int result = mockObject.getMock().testMethod1("arg1", "arg2", "arg3");
        assertEquals(2, result);
    }

    @Test
    public void betterMatchBySpecifyingValue_oneTimeMatching() {
        mockObject.onceReturns(1).testMethod1(null, null, null);
        mockObject.onceReturns(2).testMethod1("arg1", null, null);

        int result = mockObject.getMock().testMethod1("arg1", "arg2", "arg3");
        assertEquals(2, result);
    }

    @Test
    public void firstMatchWhenMultipleBestMatches() {
        mockObject.returns(1).testMethod1("arg1", null, null);
        mockObject.returns(2).testMethod1("arg1", null, null);

        int result = mockObject.getMock().testMethod1("arg1", "arg2", "arg3");
        assertEquals(1, result);
    }

    @Test
    public void betterMatchIfMoreSpecific() {
        mockObject.returns(1).testMethod1("arg1", null, null);
        mockObject.returns(2).testMethod1("arg1", "arg2", null);

        int result = mockObject.getMock().testMethod1("arg1", "arg2", "arg3");
        assertEquals(2, result);
    }

    @Test
    public void oneTimeMatchingPrecedesAlwaysMatching() {
        mockObject.onceReturns(1).testMethod1("arg1", null, null);
        mockObject.returns(2).testMethod1("arg1", "arg2", null);

        int result = mockObject.getMock().testMethod1("arg1", "arg2", "arg3");
        assertEquals(1, result);
    }

    @Test
    public void noMatchFound() {
        mockObject.returns(1).testMethod1("arg1", null, null);
        mockObject.returns(2).testMethod1("arg1", "arg2", null);

        int result = mockObject.getMock().testMethod1("xxx", "arg2", "arg3");
        assertEquals(0, result);
    }

    @Test
    public void useIdentityWhenEqualObjects() {
        Value value1 = new Value();
        Value value2 = new Value();
        mockObject.returns(1).testMethod2(value1);
        mockObject.returns(2).testMethod2(value2);

        int result1 = mockObject.getMock().testMethod2(value1);
        assertEquals(1, result1);
        int result2 = mockObject.getMock().testMethod2(value2);
        assertEquals(2, result2);
    }

    private static interface TestClass {

        int testMethod1(String arg1, String arg2, String arg3);

        int testMethod2(Value value);

    }

    private static class Value {
        @Override
        public boolean equals(Object obj) {
            return true;
        }
    }

}


text:
"use strict";

var _parseFilepath = require("parse-filepath");

var _parseFilepath2 = _interopRequireDefault(_parseFilepath);

var _path = require("path");

var _path2 = _interopRequireDefault(_path);

var _slash = require("slash");

var _slash2 = _interopRequireDefault(_slash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (basePath, filePath) {
  var relativePath = _path2.default.posix.relative((0, _slash2.default)(basePath), (0, _slash2.default)(filePath));

  var _parsePath = (0, _parseFilepath2.default)(relativePath),
      dirname = _parsePath.dirname,
      name = _parsePath.name;

  var parsedName = name === `index` ? `` : name;

  return _path2.default.posix.join(`/`, dirname, parsedName, `/`);
};
//# sourceMappingURL=create-path.js.map


text:
extern zend_class_entry *test_11__closure_ce;

ZEPHIR_INIT_CLASS(test_11__closure);

PHP_METHOD(test_11__closure, __invoke);

ZEPHIR_INIT_FUNCS(test_11__closure_method_entry) {
	PHP_ME(test_11__closure, __invoke, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
	PHP_FE_END
};


text:
typedef long blip_time_t;

// Output samples are 16-bit signed, with a range of -32768 to 32767
typedef short blip_sample_t;
enum { blip_sample_max = 32767 };

class Blip_Buffer {
public:
	typedef const char* blargg_err_t;

	// Set output sample rate and buffer length in milliseconds (1/1000 sec, defaults
	// to 1/4 second), then clear buffer. Returns NULL on success, otherwise if there
	// isn't enough memory, returns error without affecting current buffer setup.
	blargg_err_t set_sample_rate( long samples_per_sec, int msec_length = 1000 / 4 );

	// Set number of source time units per second
	void clock_rate( long );

	// End current time frame of specified duration and make its samples available
	// (along with any still-unread samples) for reading with read_samples(). Begins
	// a new time frame at the end of the current frame.
	void end_frame( blip_time_t time );

	// Read at most 'max_samples' out of buffer into 'dest', removing them from from
	// the buffer. Returns number of samples actually read and removed. If stereo is
	// true, increments 'dest' one extra time after writing each sample, to allow
	// easy interleving of two channels into a stereo output buffer.
	long read_samples( blip_sample_t* dest, long max_samples, int stereo = 0 );

// Additional optional features

	// Current output sample rate
	long sample_rate() const;

	// Length of buffer, in milliseconds
	int length() const;

	// Number of source time units per second
	long clock_rate() const;

	// Set frequency high-pass filter frequency, where higher values reduce bass more
	void bass_freq( int frequency );

	// Number of samples delay from synthesis to samples read out
	int output_latency() const;

	// Remove all available samples and clear buffer to silence. If 'entire_buffer' is
	// false, just clears out any samples waiting rather than the entire buffer.
	void clear( int entire_buffer = 1 );

	// Number of samples available for reading with read_samples()
	long samples_avail() const;

	// Remove 'count' samples from those waiting to be read
	void remove_samples( long count );

// Experimental features

	// Number of raw samples that can be mixed within frame of specified duration.
	long count_samples( blip_time_t duration ) const;

	// Mix 'count' samples from 'buf' into buffer.
	void mix_samples( blip_sample_t const* buf, long count );

	// Count number of clocks needed until 'count' samples will be available.
	// If buffer can't even hold 'count' samples, returns number of clocks until
	// buffer becomes full.
	blip_time_t count_clocks( long count ) const;

	// not documented yet
	typedef unsigned long blip_resampled_time_t;
	void remove_silence( long count );
	blip_resampled_time_t resampled_duration( int t ) const     { return t * factor_; }
	blip_resampled_time_t resampled_time( blip_time_t t ) const { return t * factor_ + offset_; }
	blip_resampled_time_t clock_rate_factor( long clock_rate ) const;
public:
	Blip_Buffer();
	~Blip_Buffer();

	// Deprecated
	typedef blip_resampled_time_t resampled_time_t;
	blargg_err_t sample_rate( long r ) { return set_sample_rate( r ); }
	blargg_err_t sample_rate( long r, int msec ) { return set_sample_rate( r, msec ); }
private:
	// noncopyable
	Blip_Buffer( const Blip_Buffer& );
	Blip_Buffer& operator = ( const Blip_Buffer& );
public:
	typedef long buf_t_;
	unsigned long factor_;
	blip_resampled_time_t offset_;
	buf_t_* buffer_;
	long buffer_size_;
private:
	long reader_accum;
	int bass_shift;
	long sample_rate_;
	long clock_rate_;
	int bass_freq_;
	int length_;
	friend class Blip_Reader;
};

#ifdef HAVE_CONFIG_H
	#include "config.h"
#endif

// Number of bits in resample ratio fraction. Higher values give a more accurate ratio
// but reduce maximum buffer size.
#ifndef BLIP_BUFFER_ACCURACY
	#define BLIP_BUFFER_ACCURACY 16
#endif

// Number bits in phase offset. Fewer than 6 bits (64 phase offsets) results in
// noticeable broadband noise when synthesizing high frequency square waves.
// Affects size of Blip_Synth objects since they store the waveform directly.
#ifndef BLIP_PHASE_BITS
	#define BLIP_PHASE_BITS 6
#endif

	// Internal
	typedef unsigned long blip_resampled_time_t;
	int const blip_widest_impulse_ = 16;
	int const blip_res = 1 << BLIP_PHASE_BITS;
	class blip_eq_t;

	class Blip_Synth_ {
		double volume_unit_;
		short* const impulses;
		int const width;
		long kernel_unit;
		int impulses_size() const { return blip_res / 2 * width + 1; }
		void adjust_impulse();
	public:
		Blip_Buffer* buf;
		int last_amp;
		int delta_factor;

		Blip_Synth_( short* impulses, int width );
		void treble_eq( blip_eq_t const& );
		void volume_unit( double );
	};

// Quality level. Start with blip_good_quality.
const int blip_med_quality  = 8;
const int blip_good_quality = 12;
const int blip_high_quality = 16;

// Range specifies the greatest expected change in amplitude. Calculate it
// by finding the difference between the maximum and minimum expected
// amplitudes (max - min).
template<int quality,int range>
class Blip_Synth {
public:
	// Set overall volume of waveform
	void volume( double v ) { impl.volume_unit( v * (1.0 / (range < 0 ? -range : range)) ); }

	// Configure low-pass filter (see notes.txt)
	void treble_eq( blip_eq_t const& eq )       { impl.treble_eq( eq ); }

	// Get/set Blip_Buffer used for output
	Blip_Buffer* output() const                 { return impl.buf; }
	void output( Blip_Buffer* b )               { impl.buf = b; impl.last_amp = 0; }

	// Update amplitude of waveform at given time. Using this requires a separate
	// Blip_Synth for each waveform.
	void update( blip_time_t time, int amplitude );

// Low-level interface

	// Add an amplitude transition of specified delta, optionally into specified buffer
	// rather than the one set with output(). Delta can be positive or negative.
	// The actual change in amplitude is delta * (volume / range)
	void offset( blip_time_t, int delta, Blip_Buffer* ) const;
	void offset( blip_time_t t, int delta ) const { offset( t, delta, impl.buf ); }

	// Works directly in terms of fractional output samples. Contact author for more.
	void offset_resampled( blip_resampled_time_t, int delta, Blip_Buffer* ) const;

	// Same as offset(), except code is inlined for higher performance
	void offset_inline( blip_time_t t, int delta, Blip_Buffer* buf ) const {
		offset_resampled( t * buf->factor_ + buf->offset_, delta, buf );
	}
	void offset_inline( blip_time_t t, int delta ) const {
		offset_resampled( t * impl.buf->factor_ + impl.buf->offset_, delta, impl.buf );
	}

public:
	Blip_Synth() : impl( impulses, quality ) { }
private:
	typedef short imp_t;
	imp_t impulses [blip_res * (quality / 2) + 1];
	Blip_Synth_ impl;
};

// Low-pass equalization parameters
class blip_eq_t {
public:
	// Logarithmic rolloff to treble dB at half sampling rate. Negative values reduce
	// treble, small positive values (0 to 5.0) increase treble.
	blip_eq_t( double treble_db = 0 );

	// See notes.txt
	blip_eq_t( double treble, long rolloff_freq, long sample_rate, long cutoff_freq = 0 );

private:
	double treble;
	long rolloff_freq;
	long sample_rate;
	long cutoff_freq;
	void generate( float* out, int count ) const;
	friend class Blip_Synth_;
};

int const blip_sample_bits = 30;

// Optimized inline sample reader for custom sample formats and mixing of Blip_Buffer samples
class Blip_Reader {
public:
	// Begin reading samples from buffer. Returns value to pass to next() (can
	// be ignored if default bass_freq is acceptable).
	int begin( Blip_Buffer& );

	// Current sample
	long read() const               { return accum >> (blip_sample_bits - 16); }

	// Current raw sample in full internal resolution
	long read_raw() const           { return accum; }

	// Advance to next sample
	void next( int bass_shift = 9 )         { accum += *buf++ - (accum >> bass_shift); }

	// End reading samples from buffer. The number of samples read must now be removed
	// using Blip_Buffer::remove_samples().
	void end( Blip_Buffer& b )              { b.reader_accum = accum; }

private:
	const Blip_Buffer::buf_t_* buf;
	long accum;
};

// End of public interface

#include <assert.h>

// Compatibility with older version
const long blip_unscaled = 65535;
const int blip_low_quality  = blip_med_quality;
const int blip_best_quality = blip_high_quality;

#define BLIP_FWD( i ) {                     \
	long t0 = i0 * delta + buf [fwd + i];   \
	long t1 = imp [blip_res * (i + 1)] * delta + buf [fwd + 1 + i]; \
	i0 = imp [blip_res * (i + 2)];          \
	buf [fwd + i] = t0;                     \
	buf [fwd + 1 + i] = t1; }

#define BLIP_REV( r ) {                     \
	long t0 = i0 * delta + buf [rev - r];   \
	long t1 = imp [blip_res * r] * delta + buf [rev + 1 - r];   \
	i0 = imp [blip_res * (r - 1)];          \
	buf [rev - r] = t0;                     \
	buf [rev + 1 - r] = t1; }

template<int quality,int range>
inline void Blip_Synth<quality,range>::offset_resampled( blip_resampled_time_t time,
		int delta, Blip_Buffer* blip_buf ) const
{
	// Fails if time is beyond end of Blip_Buffer, due to a bug in caller code or the
	// need for a longer buffer as set by set_sample_rate().
	assert( (long) (time >> BLIP_BUFFER_ACCURACY) < blip_buf->buffer_size_ );
	delta *= impl.delta_factor;
	int phase = (int) (time >> (BLIP_BUFFER_ACCURACY - BLIP_PHASE_BITS) & (blip_res - 1));
	imp_t const* imp = impulses + blip_res - phase;
	long* buf = blip_buf->buffer_ + (time >> BLIP_BUFFER_ACCURACY);
	long i0 = *imp;

	int const fwd = (blip_widest_impulse_ - quality) / 2;
	int const rev = fwd + quality - 2;

	BLIP_FWD( 0 )
	if ( quality > 8  ) BLIP_FWD( 2 )
	if ( quality > 12 ) BLIP_FWD( 4 )
	{
		int const mid = quality / 2 - 1;
		long t0 = i0 * delta + buf [fwd + mid - 1];
		long t1 = imp [blip_res * mid] * delta + buf [fwd + mid];
		imp = impulses + phase;
		i0 = imp [blip_res * mid];
		buf [fwd + mid - 1] = t0;
		buf [fwd + mid] = t1;
	}
	if ( quality > 12 ) BLIP_REV( 6 )
	if ( quality > 8  ) BLIP_REV( 4 )
	BLIP_REV( 2 )

	long t0 = i0 * delta + buf [rev];
	long t1 = *imp * delta + buf [rev + 1];
	buf [rev] = t0;
	buf [rev + 1] = t1;
}

#undef BLIP_FWD
#undef BLIP_REV

template<int quality,int range>
void Blip_Synth<quality,range>::offset( blip_time_t t, int delta, Blip_Buffer* buf ) const
{
	offset_resampled( t * buf->factor_ + buf->offset_, delta, buf );
}

template<int quality,int range>
void Blip_Synth<quality,range>::update( blip_time_t t, int amp )
{
	int delta = amp - impl.last_amp;
	impl.last_amp = amp;
	offset_resampled( t * impl.buf->factor_ + impl.buf->offset_, delta, impl.buf );
}

inline blip_eq_t::blip_eq_t( double t ) :
		treble( t ), rolloff_freq( 0 ), sample_rate( 44100 ), cutoff_freq( 0 ) { }
inline blip_eq_t::blip_eq_t( double t, long rf, long sr, long cf ) :
		treble( t ), rolloff_freq( rf ), sample_rate( sr ), cutoff_freq( cf ) { }

inline int  Blip_Buffer::length() const         { return length_; }
inline long Blip_Buffer::samples_avail() const  { return (long) (offset_ >> BLIP_BUFFER_ACCURACY); }
inline long Blip_Buffer::sample_rate() const    { return sample_rate_; }
inline int  Blip_Buffer::output_latency() const { return blip_widest_impulse_ / 2; }
inline long Blip_Buffer::clock_rate() const     { return clock_rate_; }
inline void Blip_Buffer::clock_rate( long cps ) { factor_ = clock_rate_factor( clock_rate_ = cps ); }

inline int Blip_Reader::begin( Blip_Buffer& blip_buf )
{
	buf = blip_buf.buffer_;
	accum = blip_buf.reader_accum;
	return blip_buf.bass_shift;
}

int const blip_max_length = 0;
int const blip_default_length = 250;

#endif


text:
import uwsgi

uwsgi.log("I am uWSGI %s" % uwsgi.version)

def application(env, start_response):
	start_response('200 OK', [('Content-Type','text/html')])
	uwsgi.log(str(env))

	if env['PATH_INFO'] == '/logme':
		uwsgi.log_this_request()
	return "log written"


text:
namespace network {
class SimpleURLLoader;
class SharedURLLoaderFactory;
}

namespace net {
class HttpRequestHeaders;
}

// Base class for all classes that implement a flow to call OAuth2 enabled APIs,
// given an access token to the service.  This class abstracts the basic steps
// and exposes template methods for sub-classes to implement for API specific
// details.
class OAuth2ApiCallFlow {
 public:
  OAuth2ApiCallFlow();

  OAuth2ApiCallFlow(const OAuth2ApiCallFlow&) = delete;
  OAuth2ApiCallFlow& operator=(const OAuth2ApiCallFlow&) = delete;

  virtual ~OAuth2ApiCallFlow();

  // Start the flow.
  virtual void Start(
      scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
      const std::string& access_token);

 protected:
  // Template methods for sub-classes.

  // Methods to help create the API request.
  virtual GURL CreateApiCallUrl() = 0;
  virtual net::HttpRequestHeaders CreateApiCallHeaders();
  virtual std::string CreateApiCallBody() = 0;
  virtual std::string CreateApiCallBodyContentType();

  // Returns the request type (e.g. GET, POST) for the |body| that will be sent
  // with the request.
  virtual std::string GetRequestTypeForBody(const std::string& body);

  // Called when the API call ends without network error to check whether the
  // request succeeded, to decide which of the following 2 process functions to
  // call. Should be overriden by subclasses if the expected success response
  // code is not 200 or 204.
  virtual bool IsExpectedSuccessCode(int code) const;

  // Sub-classes can expose an appropriate observer interface by implementing
  // these template methods.
  // Called when there is no network error and IsExpectedSuccessCode() returns
  // true. |body| may be null.
  virtual void ProcessApiCallSuccess(
      const network::mojom::URLResponseHead* head,
      std::unique_ptr<std::string> body) = 0;

  // Called when there is a network error or IsExpectedSuccessCode() returns
  // false. |head| or |body| might be null.
  virtual void ProcessApiCallFailure(
      int net_error,
      const network::mojom::URLResponseHead* head,
      std::unique_ptr<std::string> body) = 0;

  virtual net::PartialNetworkTrafficAnnotationTag
  GetNetworkTrafficAnnotationTag() = 0;

 private:
  enum State {
    INITIAL,
    API_CALL_STARTED,
    API_CALL_DONE,
    ERROR_STATE
  };

  // Called when loading has finished.
  void OnURLLoadComplete(std::unique_ptr<std::string> body);

  // Creates an instance of SimpleURLLoader that does not send or save cookies.
  // Template method CreateApiCallUrl is used to get the URL.
  // Template method CreateApiCallBody is used to get the body.
  // The http method will be GET if body is empty, POST otherwise.
  std::unique_ptr<network::SimpleURLLoader> CreateURLLoader(
      const std::string& access_token);

  // Helper methods to implement the state machine for the flow.
  void BeginApiCall();
  void EndApiCall(std::unique_ptr<std::string> body);

  State state_;
  std::unique_ptr<network::SimpleURLLoader> url_loader_;
};

#endif  // GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_


text:
<#
 .SYNOPSIS
    Upload files in a new folder on an existing file share.

 .DESCRIPTION
    Upload files in a new folder on an existing file share.

 .PARAMETER subscriptionId
    The subscription id the script will be run against.

 .PARAMETER resourceGroupName
    The resource group the script will be run against.

 .PARAMETER storageAccountName
    The name of the storage account the files shall be uploaded to.

 .PARAMETER nameOfFileShare
    The name of the file share the files shall be uploaded to.

 .PARAMETER pathToFolderWithFiles
    The path to the folder with the files to be uploaded.

 .PARAMETER destinationFolderInFileShare
    The folder that shall be created and where the files shall be uploaded to.
#>

param(
 [Parameter(Mandatory=$True)]
 [string]
 # show all subscriptions via Get-AzureRmSubscription
 # get current subscription via Get-AzureRmContext
 $subscriptionId,

 [Parameter(Mandatory=$True)]
 [string]
 # show all resource groups via Get-AzureRmResourceGroup
 $resourceGroupName,

 [Parameter(Mandatory=$True)]
 [string]
 # show all storage accounts via Get-AzureRmStorageAccount
 $storageAccountName,

 [Parameter(Mandatory=$True)]
 [string]
 $nameOfFileShare,

 [Parameter(Mandatory=$True)]
 [string]
 # E.g. 'C:\Temp\...'
 $pathToFolderWithFiles,

 [Parameter(Mandatory=$True)]
 [string]
 # E.g. 'data'
 $destinationFolderInFileShare
)

# Login to Azure Account
#Login-AzureRmAccount

# Select subscription
Set-AzureRmContext -SubscriptionID $subscriptionId

# get primary storage account key
$StorageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -AccountName $storageAccountName).Value[0]

# define context
$ctx = New-AzureStorageContext -StorageAccountName $storageAccountName `
	-StorageAccountKey $storageAccountKey

$fileShareCTX = Get-AzureStorageShare -Name $nameOfFileShare -Context $ctx

# create new directory
New-AzureStorageDirectory -Share $fileShareCTX -Path $destinationFolderInFileShare

# get and upload each file of the folder
$files = Get-ChildItem $pathToFolderWithFiles
foreach($file in $files)
{
    $fileName = "$pathToFolderWithFiles\$file"
    $fileSharePath = "$destinationFolderInFileShare/$file"
    Set-AzureStorageFileContent -Share $fileShareCTX `
        -Source $fileName `
        -Path $destinationFolderInFileShare
};

# list files in the new directory
Get-AzureStorageFile -Share $fileShareCTX -Path $destinationFolderInFileShare | Get-AzureStorageFile


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

from .package import Package

# Module API

def infer(pattern, base_path=None):
    """https://github.com/frictionlessdata/datapackage-py#infer
    """
    package = Package({}, base_path=base_path)
    descriptor = package.infer(pattern)
    return descriptor


text:
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
 *
 *
 */

?>

My Flown Routes Map


text:
import { Dict } from 'ash';
import { ContactStoreItem } from 'ash/contact';

export const contacts: Dict<ContactStoreItem> = {
  'jean-pierre-gautier': {
    content: '- Architecte -',
    email: 'jpiergautier-architecte@wanadoo.fr',
    gsm: '0692866136',
    id: 'jean-pierre-gautier',
    image: 'contact',
    name: 'Jean-Pierre Gautier',
    phone: '0262545391',
  },
};


text: create table t (x timestamp not null);


text:
package org.jreversepro.ast.evaluator;

import java.util.Arrays;
import java.util.logging.Logger;

import org.jreversepro.CustomLoggerFactory;
import org.jreversepro.ast.expression.Assignment;
import org.jreversepro.ast.expression.Expression;
import org.jreversepro.ast.expression.Variable;
import org.jreversepro.ast.intermediate.CompleteLine;
import org.jreversepro.reflect.instruction.Instruction;

/**
 * @author akkumar
 *
 */
public class IStoreEvaluator extends AbstractInstructionEvaluator {

  /**
   * @param context
   */
  public IStoreEvaluator(EvaluatorContext context) {
    super(context);
  }

  /*
   * (non-Javadoc)
   *
   * @see net.sf.jrevpro.decompile.instructioneval.AbstractInstructionEvaluator
   * #evaluate(net.sf.jrevpro.reflect.instruction.Instruction)
   */
  @Override
  void evaluate(Instruction ins) {
    Expression exp = evalMachine.pop();
    switch (ins.opcode) {
    case OPCODE_ISTORE:
      logger.info("Processing Instruction " + ins.currentPc + " istore "
          + ins.getArgUnsignedWide());
      operateStoreInstruction(ins, ins.getArgUnsignedWide(), exp);
      break;
    case OPCODE_ISTORE_0:
    case OPCODE_ISTORE_1:
    case OPCODE_ISTORE_2:
    case OPCODE_ISTORE_3:
      operateStoreInstruction(ins, ins.opcode - OPCODE_ISTORE_0, exp);
      break;

    }

  }

  protected void operateStoreInstruction(Instruction ins,
      int variableIndexToSymbolTable, Expression expr) {
    Variable lhs = new Variable(varTable, expr.getType(),
        variableIndexToSymbolTable, ins.currentPc);
    statements.append(new CompleteLine(ins, new Assignment(lhs, expr)));

    // Hint to the symbol table about the type.
    varTable.recordLocalDatatypeReference(variableIndexToSymbolTable, expr
        .getType(), ins.currentPc);

  }

  /*
   * (non-Javadoc)
   *
   * @see net.sf.jrevpro.decompile.instructioneval.AbstractInstructionEvaluator
   * #getProcessingOpcodes()
   */
  @Override
  Iterable<Integer> getProcessingOpcodes() {
    return Arrays.asList(OPCODE_ISTORE, OPCODE_ISTORE_0, OPCODE_ISTORE_1,
        OPCODE_ISTORE_2, OPCODE_ISTORE_3);
  }

  private static final Logger logger = CustomLoggerFactory.createLogger();
}


text:
#pragma once
#include <Gui/MainWindowInterface.hpp>
#include <Gui/RaGui.hpp>
#include <Gui/TreeModel/EntityTreeModel.hpp>

namespace Ra {
namespace Gui {

/**
 * Definition of a minimal Radium Window.
 * This minimal window allows to display radium Engine entities.
 */

class RA_GUI_API SimpleWindow : public Ra::Gui::MainWindowInterface
{
    Q_OBJECT

  public:
    /** Constructors and destructor.
     *  https://en.cppreference.com/w/cpp/language/rule_of_three
     */
    /** @{ */
    explicit SimpleWindow( uint w = 800, uint h = 640, QWidget* parent = nullptr );
    SimpleWindow( const SimpleWindow& ) = delete;
    SimpleWindow& operator=( const SimpleWindow& ) = delete;
    SimpleWindow( SimpleWindow&& )                 = delete;
    SimpleWindow& operator=( SimpleWindow&& ) = delete;
    ~SimpleWindow() override;
    /**@}*/

    /// Access the viewer, i.e. the rendering widget.
    Ra::Gui::Viewer* getViewer() override;

    /// Access the selection manager.
    Ra::Gui::SelectionManager* getSelectionManager() override;

    /// Access the timeline.
    Ra::Gui::Timeline* getTimeline() override;

    /// Update the ui from the plugins loaded.
    void updateUi( Ra::Plugins::RadiumPluginInterface* plugin ) override;

    /// Update the UI ( most importantly gizmos ) to the modifications of the
    /// engine/
    void onFrameComplete() override;

    /// Add render in the application: UI, viewer - this method does not associate a control panel.
    void addRenderer( const std::string& name,
                      std::shared_ptr<Ra::Engine::Rendering::Renderer> e ) override;

  public slots:
    /**
     * Called when a scene is ready to display to parameterize the application window and the
     * viewer.
     */
    void prepareDisplay() override;

    /// Cleanup resources.
    void cleanup() override;

    // Display help dialog about Viewer key-bindings
    void displayHelpDialog() override;

  signals:
    /// Emitted when frame must be updated
    void frameUpdate();

  private:
    /// create the UI connections
    void createConnections();

    /// viewer widget
    std::unique_ptr<Ra::Gui::Viewer> m_viewer;

    /// Stores and manages the current selection.
    /// Even if no selection is provided by this application, used plugins require this
    std::unique_ptr<Ra::Gui::SelectionManager> m_selectionManager;

    /// Stores the internal model of engine objects for selection and visibility.
    std::unique_ptr<Ra::Gui::ItemModel> m_sceneModel;
};

} // namespace Gui
} // namespace Ra


text:
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview
 * 'cr-camera' is a Polymer element used to take a picture from the
 * user webcam to use as a Chrome OS profile picture.
 */
import '//resources/cr_elements/cr_shared_style.css.js';
import '//resources/cr_elements/cr_icon_button/cr_icon_button.js';
import '//resources/polymer/v3_0/iron-a11y-keys/iron-a11y-keys.js';
import '//resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js';
import './icons.html.js';

import {html, Polymer} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';

import {getTemplate} from './cr_camera.html.js';
import * as webcamUtils from './webcam_utils.js';

Polymer({
  is: 'cr-camera',

  _template: getTemplate(),

  properties: {
    /** Strings provided by host */
    takePhotoLabel: String,
    captureVideoLabel: String,
    switchModeToCameraLabel: String,
    switchModeToVideoLabel: String,

    /** True if video mode is enabled. */
    videoModeEnabled: {
      type: Boolean,
      value: false,
    },

    /**
     * True if currently in video mode.
     * @private {boolean}
     */
    videomode: {
      type: Boolean,
      value: false,
      reflectToAttribute: true,
    },

    /**
     * True when the camera is actually streaming video. May be false even when
     * the camera is present and shown, but still initializing.
     * @private {boolean}
     */
    cameraOnline_: {
      type: Boolean,
      value: false,
    },
  },

  /** @private {boolean} */
  cameraStartInProgress_: false,

  /** @private {boolean} */
  cameraCaptureInProgress_: false,

  /** @override */
  attached() {
    this.$.cameraVideo.addEventListener('canplay', function() {
      this.$.userImageStreamCrop.classList.add('preview');
      this.cameraOnline_ = true;
      this.focusTakePhotoButton();
    }.bind(this));
    this.startCamera();
  },

  /** @override */
  detached() {
    this.stopCamera();
  },

  /** Only focuses the button if it's not disabled. */
  focusTakePhotoButton() {
    if (this.cameraOnline_) {
      this.$.takePhoto.focus();
    }
  },

  /**
   * Performs photo capture from the live camera stream. A 'photo-taken' event
   * will be fired as soon as captured photo is available, with the
   * 'photoDataURL' property containing the photo encoded as a data URL.
   */
  async takePhoto() {
    if (!this.cameraOnline_ || this.cameraCaptureInProgress_) {
      return;
    }
    this.cameraCaptureInProgress_ = true;
    this.$.userImageStreamCrop.classList.remove('preview');
    this.$.userImageStreamCrop.classList.add('capture');

    const numFrames = this.videomode ?
        webcamUtils.CAPTURE_DURATION_MS / webcamUtils.CAPTURE_INTERVAL_MS :
        1;

    try {
      const frames = await webcamUtils.captureFrames(
          /** @type {!HTMLVideoElement} */ (this.$.cameraVideo),
          this.getCaptureSize_(), webcamUtils.CAPTURE_INTERVAL_MS, numFrames);

      const photoDataUrl = webcamUtils.convertFramesToPng(frames);
      this.fire('photo-taken', {photoDataUrl});
    } catch (e) {
      console.error(e);
    }
    this.$.userImageStreamCrop.classList.remove('capture');
    this.cameraCaptureInProgress_ = false;
  },

  /** Tries to start the camera stream capture. */
  startCamera() {
    this.stopCamera();
    this.cameraStartInProgress_ = true;

    const successCallback = function(stream) {
      if (this.cameraStartInProgress_) {
        this.$.cameraVideo.srcObject = stream;
        this.cameraStream_ = stream;
      } else {
        webcamUtils.stopMediaTracks(stream);
      }
      this.cameraStartInProgress_ = false;
    }.bind(this);

    const errorCallback = function() {
      this.cameraOnline_ = false;
      this.cameraStartInProgress_ = false;
    }.bind(this);

    navigator.webkitGetUserMedia(
        {video: webcamUtils.kDefaultVideoConstraints}, successCallback,
        errorCallback);
  },

  /** Stops the camera stream capture if it's currently active. */
  stopCamera() {
    this.$.userImageStreamCrop.classList.remove('preview');
    this.cameraOnline_ = false;
    this.$.cameraVideo.srcObject = null;
    webcamUtils.stopMediaTracks(this.cameraStream_);
    this.cameraStream_ = null;
    // Cancel any pending getUserMedia() checks.
    this.cameraStartInProgress_ = false;
  },

  /**
   * Get the correct capture size for single photo or video mode.
   * @return {{height: number, width: number}}
   * @private
   */
  getCaptureSize_() {
    if (this.videomode) {
      /** Reduce capture size when in video mode. */
      return {
        width: webcamUtils.CAPTURE_SIZE.width / 2,
        height: webcamUtils.CAPTURE_SIZE.height / 2,
      };
    }
    return webcamUtils.CAPTURE_SIZE;
  },

  /**
   * Switch between photo and video mode.
   * @private
   */
  onTapSwitchMode_() {
    this.videomode = !this.videomode;
    this.fire('switch-mode', this.videomode);
  },

  /**
   * @return {string}
   * @private
   */
  getTakePhotoIcon_() {
    return this.videomode ? 'cr-picture:videocam-shutter-icon' :
                            'cr-picture:camera-shutter-icon';
  },

  /**
   * Returns the label to use for take photo button.
   * @return {string}
   * @private
   */
  getTakePhotoLabel_(videomode, photoLabel, videoLabel) {
    return videomode ? videoLabel : photoLabel;
  },

  /**
   * @return {string}
   * @private
   */
  getSwitchModeIcon_() {
    return this.videomode ? 'cr-picture:camera-alt-icon' :
                            'cr-picture:videocam-icon';
  },

  /**
   * Returns the label to use for switch mode button.
   * @return {string}
   * @private
   */
  getSwitchModeLabel_(videomode, cameraLabel, videoLabel) {
    return videomode ? cameraLabel : videoLabel;
  },
});


text:
/*
filedrag.js - HTML5 File Drag & Drop demonstration
Featured on SitePoint.com
Developed by Craig Buckler (@craigbuckler) of OptimalWorks.net
*/
(function() {

	// getElementById
	function $id(id) {
		return document.getElementById(id);
	}

	// output information
	function Output(msg) {
		var m = $id("messages");
		m.innerHTML = msg + m.innerHTML;
	}

	// file drag hover
	function FileDragHover(e) {
		e.stopPropagation();
		e.preventDefault();
		e.target.className = (e.type == "dragover" ? "hover" : "");
	}

	// file selection
	function FileSelectHandler(e) {

		// cancel event and hover styling
		FileDragHover(e);

		// fetch FileList object
		var files = e.target.files || e.dataTransfer.files;

		// process all File objects
		for (var i = 0, f; f = files[i]; i++) {
			ParseFile(f);
		}

	}

	// output file information
	function ParseFile(file) {

		Output(
			"
File information: " + file.name +
			" type: " + file.type +
			" size: " + file.size +
			" bytes
"
		);

	}

	// initialize
	function Init() {

		var fileselect = $id("fileselect"),
			filedrag = $id("filedrag"),
			submitbutton = $id("submitbutton");

		// file select
		fileselect.addEventListener("change", FileSelectHandler, false);

		// is XHR2 available?
		var xhr = new XMLHttpRequest();
		if (xhr.upload) {

			// file drop
			filedrag.addEventListener("dragover", FileDragHover, false);
			filedrag.addEventListener("dragleave", FileDragHover, false);
			filedrag.addEventListener("drop", FileSelectHandler, false);
			filedrag.style.display = "block";

			// remove submit button
			//submitbutton.style.display = "none";
		}

	}

	// call initialization file
	if (window.File && window.FileList && window.FileReader) {
		Init();
	}

})();


text:
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!

#include "config.h"
#include "KeyframeEffectOptions.h"

namespace blink {

KeyframeEffectOptions::KeyframeEffectOptions()
{
    setDelay(0);
    setDirection(String("normal"));
    setDuration(UnrestrictedDoubleOrString::fromString(String("auto")));
    setEasing(String("linear"));
    setEndDelay(0);
    setFill(String("auto"));
    setIterationStart(0);
    setIterations(1);
    setPlaybackRate(1);
}

DEFINE_TRACE(KeyframeEffectOptions)
{
    visitor->trace(m_duration);
}

} // namespace blink


text:
layout: post
title: 404 - We Couldn't Find It.
type: 404
---

  The address you were trying to reach may have been moved or deleted. Be sure
  to double-check spelling as well.

  Please head back to the
  Main Page
  or try entering a search above to find the information you seek!


text:
name: cljs.core/ES6Iterator
see also:
---

## Summary

## Details

## Examples


text:
import * as React from 'react';
import { EFilterOptions, IVisConfig, Scales, IScatterConfig, VisColumn } from '../interfaces';
export declare function ScatterVis({ config, optionsConfig, extensions, columns, shapes, filterCallback, selectionCallback, selectedMap, selectedList, setConfig, hideSidebar, showCloseButton, closeButtonCallback, scales, }: {
    config: IScatterConfig;
    optionsConfig?: {
        color?: {
            enable?: boolean;
            customComponent?: React.ReactNode;
        };
        shape?: {
            enable?: boolean;
            customComponent?: React.ReactNode;
        };
        filter?: {
            enable?: boolean;
            customComponent?: React.ReactNode;
        };
    };
    extensions?: {
        prePlot?: React.ReactNode;
        postPlot?: React.ReactNode;
        preSidebar?: React.ReactNode;
        postSidebar?: React.ReactNode;
    };
    shapes?: string[];
    columns: VisColumn[];
    filterCallback?: (s: EFilterOptions) => void;
    selectionCallback?: (ids: string[]) => void;
    closeButtonCallback?: () => void;
    selectedMap?: {
        [key: string]: boolean;
    };
    selectedList: string[];
    setConfig: (config: IVisConfig) => void;
    scales: Scales;
    hideSidebar?: boolean;
    showCloseButton?: boolean;
}): JSX.Element;
//# sourceMappingURL=ScatterVis.d.ts.map


text:
Jarvis.ConfigurationService <img src="http://demo.prxm.it:8811/app/rest/builds/buildType:Jarvis_JarvisConfigurationService_Build/statusIcon" alt="build status">
===========================

##Wiki

1. [General Documentation](/wiki/general.MD)
1. [Simple Api Calls](/wiki/sampleApiCall.MD)
1. [Installing](/wiki/install.MD)


text:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;

import org.apache.http.client.utils.URIBuilder;

import com.google.gson.Gson;

public abstract class TwitterSearch {

	public TwitterSearch() {

	}

	public abstract boolean saveTweets(List<Tweet> tweets);

	public void search(final String query, final long rateDelay)
			throws InvalidQueryException {
		TwitterResponse response;
		URL url = constructURL(query, null);
		boolean continueSearch = true;
		String minTweet = null;
		while ((response = executeSearch(url)) != null && continueSearch
				&& !response.getTweets().isEmpty()) {
			if (minTweet == null) {
				minTweet = response.getTweets().get(0).getId();
			}
			continueSearch = saveTweets(response.getTweets());
			String maxTweet = response.getTweets()
					.get(response.getTweets().size() - 1).getId();
			if (!minTweet.equals(maxTweet)) {
				try {
					Thread.sleep(rateDelay);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				String maxPosition = "TWEET-" + maxTweet + "-" + minTweet;
				url = constructURL(query, maxPosition);
			}

		}
	}

	public static TwitterResponse executeSearch(final URL url) {
		BufferedReader reader = null;
		try {
			reader = new BufferedReader(new InputStreamReader(url
					.openConnection().getInputStream()));
			Gson gson = new Gson();
			return gson.fromJson(reader, TwitterResponse.class);
		} catch (IOException e) {
			// If we get an IOException, sleep for 5 seconds and retry.
			System.err
					.println("Could not connect to Twitter. Retrying in 5 seconds.");
			try {
				Thread.sleep(5000);
				return executeSearch(url);
			} catch (InterruptedException e2) {
				e.printStackTrace();
			}
		} finally {
			try {
				if (reader != null) {
					reader.close();
				}
			} catch (NullPointerException | IOException e) {
				e.printStackTrace();
			}
		}
		return null;
	}

	public final static String TYPE_PARAM = "f";
	public final static String QUERY_PARAM = "q";
	public final static String SCROLL_CURSOR_PARAM = "max_position";
	public final static String TWITTER_SEARCH_URL = "https://twitter.com/i/search/timeline";

	public static URL constructURL(final String query, final String maxPosition)
			throws InvalidQueryException {
		if (query == null || query.isEmpty()) {
			throw new InvalidQueryException(query);
		}
		try {
			URIBuilder uriBuilder;
			uriBuilder = new URIBuilder(TWITTER_SEARCH_URL);
			uriBuilder.addParameter(QUERY_PARAM, query);
			uriBuilder.addParameter(TYPE_PARAM, "tweets");
			if (maxPosition != null) {
				uriBuilder.addParameter(SCROLL_CURSOR_PARAM, maxPosition);
			}
			return uriBuilder.build().toURL();
		} catch (MalformedURLException | URISyntaxException e) {
			e.printStackTrace();
			throw new InvalidQueryException(query);
		}
	}
}


text:
package mcjty.gui.events;

import mcjty.gui.widgets.Widget;

public interface ColorChoiceEvent {
    void choiceChanged(Widget parent, Integer newColor);
}