text:
import ErrorWithCause from '@uppy/utils/lib/ErrorWithCause'

/**
 * Check that Assembly parameters are present and include all required fields.
 */
function validateParams (params) {
  if (params == null) {
    throw new Error('Transloadit: The `params` option is required.')
  }

  if (typeof params === 'string') {
    try {
      // eslint-disable-next-line no-param-reassign
      params = JSON.parse(params)
    } catch (err) {
      // Tell the user that this is not an Uppy bug!
      throw new ErrorWithCause('Transloadit: The `params` option is a malformed JSON string.', { cause: err })
    }
  }

  if (!params.auth || !params.auth.key) {
    throw new Error('Transloadit: The `params.auth.key` option is required. '
      + 'You can find your Transloadit API key at https://transloadit.com/c/template-credentials')
  }
}

/**
 * Combine Assemblies with the same options into a single Assembly for all the
 * relevant files.
 */
function dedupe (list) {
  const dedupeMap = Object.create(null)
  for (const { fileIDs, options } of list.filter(Boolean)) {
    const id = JSON.stringify(options)
    if (id in dedupeMap) {
      dedupeMap[id].fileIDArrays.push(fileIDs)
    } else {
      dedupeMap[id] = {
        options,
        fileIDArrays: [fileIDs],
      }
    }
  }

  return Object.values(dedupeMap).map(({ options, fileIDArrays }) => ({
    options,
    fileIDs: fileIDArrays.flat(1),
  }))
}

/**
 * Turn Transloadit plugin options and a list of files into a list of Assembly
 * options.
 */
class AssemblyOptions {
  constructor (files, opts) {
    this.files = files
    this.opts = opts
  }

  /**
   * Get Assembly options for a file.
   */
  async #getAssemblyOptions (file) {
    if (file == null) return undefined

    const options = this.opts
    const assemblyOptions = await options.getAssemblyOptions(file, options)

    // We check if the file is present here again, because it could had been
    // removed during the await, e.g. if the user hit cancel while we were
    // waiting for the options.
    if (file == null) return undefined

    if (Array.isArray(assemblyOptions.fields)) {
      assemblyOptions.fields = Object.fromEntries(
        assemblyOptions.fields.map((fieldName) => [fieldName, file.meta[fieldName]]),
      )
    } else if (assemblyOptions.fields == null) {
      assemblyOptions.fields = {}
    }

    validateParams(assemblyOptions.params)

    return {
      fileIDs: [file.id],
      options: assemblyOptions,
    }
  }

  /**
   * Generate a set of Assemblies that will handle the upload.
   * Returns a Promise for an object with keys:
   *  - fileIDs - an array of file IDs to add to this Assembly
   *  - options - Assembly options
   */
  async build () {
    const options = this.opts

    if (this.files.length > 0) {
      return Promise.all(
        this.files.map((file) => this.#getAssemblyOptions(file)),
      ).then(dedupe)
    }

    if (options.alwaysRunAssembly) {
      // No files, just generate one Assembly
      const assemblyOptions = await options.getAssemblyOptions(null, options)

      validateParams(assemblyOptions.params)
      return [{
        fileIDs: this.files.map((file) => file.id),
        options: assemblyOptions,
      }]
    }

    // If there are no files and we do not `alwaysRunAssembly`,
    // don't do anything.
    return []
  }
}

export default AssemblyOptions
export { validateParams }


text:
<?xml version="1.0" encoding="UTF-8"?>
<SpaceSettlersConfig>
	<!-- Height/Width in pixels -->
	<height>1080</height>
	<width>1600</width>

	<!-- Number of steps of simulation -->
	<simulationSteps>20000</simulationSteps>

	<!-- Timestep for a simulation (in seconds for the physics equations) -->
	<simulationTimeStep>0.05</simulationTimeStep>

	<!-- Used to initialize all Random objects in the simulator.  If this is 0, it is set using system time.
	     Set to a non-zero number to make repeatable games. -->
	<randomSeed>0</randomSeed>

	<!-- Scoring mechanism used for this game: Can be Resources, Beacons, ... (more as we add them) -->
	<scoringMethod>Damage</scoringMethod>

	<!-- Specify the number of the beacons.  The locations are initialized randomly -->
	<numBeacons>6</numBeacons>

	<!-- Specify the maximum number of ships in a team -->
	<maximumShipsPerTeam>1</maximumShipsPerTeam>
	<maximumInitialShipsPerTeam>1</maximumInitialShipsPerTeam>

	<!-- Specify any controllable clients in the simulator (this can include heuristics).
	     Note, all clients are teams since eventually all clients can make new ships. -->
	<teams>
		<!-- Each team needs a name (so you know what other items belong to that team) and a pointer
		     to the configuration file for that team.  Also, teams can have initial bounding boxes
		     which bound where the ships and the base will be created. -->
		<HighLevelTeamConfig>
			<teamName>RandomClient</teamName>
			<configFile>random-clientinit.xml</configFile>
		</HighLevelTeamConfig>
		<HighLevelTeamConfig>
			<teamName>BeaconCollectorTeam</teamName>
			<configFile>beacon-clientinit.xml</configFile>
		</HighLevelTeamConfig>
		<!-- Uncomment human to play against it -->
		<!--
		<HighLevelTeamConfig>
			<teamName>HumanTeam</teamName>
			<configFile>human-clientinit.xml</configFile>
		</HighLevelTeamConfig>
 		-->
 		<!-- The competitive ladder will have the aggressive heuristic -->
		<HighLevelTeamConfig>
			<teamName>HeuristicMinerTeam</teamName>
			<configFile>aggressive-heuristic-clientinit.xml</configFile>
		</HighLevelTeamConfig>
		<HighLevelTeamConfig>
			<teamName>DoNothingTeam</teamName>
			<configFile>donothing-clientinit.xml</configFile>
		</HighLevelTeamConfig>
	</teams>

	<!-- Each team needs a base.  Optionally, you can initialize the location of the base -->
	<bases>
		<BaseConfig>
			<teamName>RandomClient</teamName>
		</BaseConfig>
		<BaseConfig>
			<teamName>BeaconCollectorTeam</teamName>
		</BaseConfig>
		<!-- uncomment if you want to play human -->
		<!--
		<BaseConfig>
			<teamName>HumanTeam</teamName>
		</BaseConfig>
		 -->
		<BaseConfig>
			<teamName>HeuristicMinerTeam</teamName>
		</BaseConfig>
		<BaseConfig>
			<teamName>DoNothingTeam</teamName>
		</BaseConfig>
	</bases>

	<!-- Specify the options for creating asteroids.  Their locations are random. -->
	<asteroids>
		<!-- The probability that a newly spawned asteroid will be mineable -->
		<probabilityMineable>0.5</probabilityMineable>

		<!-- The number of asteroids when the game starts -->
		<numberInitialAsteroids>40</numberInitialAsteroids>

		<!-- The maximum number of asteroids in a game -->
		<maximumNumberAsteroids>80</maximumNumberAsteroids>

		<!-- The probability an asteroid is movable -->
		<probabilityMoveable>0.5</probabilityMoveable>

		<!-- The maximum initial velocity of a move-able asteroid -->
		<maxInitialVelocity>15</maxInitialVelocity>

		<!-- The average proportion of each type of resource in an asteroid.  This needs to add to 1. -->
		<probabilityFuelType>0.2</probabilityFuelType>
		<probabilityWaterType>0.5</probabilityWaterType>
		<probabilityMetalsType>0.3</probabilityMetalsType>
	</asteroids>

</SpaceSettlersConfig>

redpajama_set_name: RedPajamaGithub


text:
package controllers;

import play.mvc.Controller;
import play.mvc.Result;

public class Application extends Controller {

    public static Result index() {
        //return ok(index.render("Your new application is ready."));
        return ok("developed by kerr\n" +
                "convert/q=url");
    }

}


text:
The lightest remote monitor for Raspberry Pi, written in C, with no dependencies and fully hackable and customizable.

## How it works

The project has 3 files:
* the server.c file, with all code about create a TCP connection, and send the HTML code with the monitor values through Internet.
* the monitor.html with the user interface, it is fully customizable. The server reads this file and then it send it, but it replaces the variables by the results.
* the vars file with all variables and how to resolve them. It use the following format $var$'TAB'command

Manage shell script is only for developers and people who want to change and test the server

## How to build

You need gcc and other developer tools. I will try to upload the last build for non developers. I think that if you have installed build-essential you won't need any dependencies more.

Compile the file server.c

$ gcc server.c -o server

## How to install and configure

You only have to run server ($ ./server ). You can change de variables and add the information that you want to monitor.

## How to use

When server is running, with a web browser enter yourRaspberryIP:5555 and you can show all the information. Example:
![rpMonitor](https://cloud.githubusercontent.com/assets/4716972/6081377/421a68ec-ae19-11e4-8b12-c003037b207b.png)

## Variables and more

I try do not use third party software because I think that the software should be run without other dependencies, so I hope that others will follow this advice. But this is only an advice.

Help me to increase the vars file with all variables that you think that it would be interesting to monitor!!

## Language

By default monitor.html is in Spanish language, so if you want to use the English version you need to rename monitorEnglish.html to monitor.hmlt or to change in server.c the fopen function.

## Thanks

The code to create the server and manage a TCP connection was obtained from [here](http://www.kumanov.com/docs/prog/Advanced%20Systems%20Programming%20And%20Real%20-%20Time%20Systems%20&%20Real-%20Time%20Operating%20Systems%20And%20Device%20Programming/RTGIF031.HTM)

Icons from [Font Awesome](http://fortawesome.github.io/Font-Awesome/)


text:
Leica Geosystems Code Sprint
----------------------------

Leica Geosystems is sponsoring the development of open source efficient
compression mechanisms for organized and unorganized 3D point cloud data. The
ultimate goal is to achieve as much compression as possible, and process a few
million points per second on a standard laptop. In addition different lossy vs
lossless compression techniques will be analyzed and compared.

.. image:: images/leica.png
   :align: center

For a complete list of all the present and past PCL code sprints please visit http://www.pointclouds.org/blog.

Developers
----------

Click on any of the links below to find out more about our team of PCL
developers that are participating in the sprint:

.. toctree::
   :maxdepth: 1

   nizar/index
   nicolas/index

Latest 15 blog updates
----------------------

.. blogbody::
   :nr_posts: 15


text:
:loop
C:\Python26\python.exe server1.py
C:\Python26\python.exe server2.py
goto loop


text:
extern NSString * const SBHSegueElementPopoverContentViewElementKey;
extern NSString * const SBHSegueElementPopoverContentViewElementDidSelectNotification;
extern NSString * const SBHSegueElementPopoverContentViewDetachButtonDidClickNotification;

@interface SBHSegueElementPopoverContentView : SBHPopoverContentView

@end


text:
package org.fest.assertions.api;

import static junit.framework.Assert.assertSame;
import static org.fest.assertions.test.ByteArrayFactory.emptyArray;
import static org.mockito.Mockito.*;

import org.fest.assertions.internal.ByteArrays;
import org.junit.*;

/**
 * Tests for <code>{@link ByteArrayAssert#hasSize(int)}</code>.
 *
 * @author Alex Ruiz
 */
public class ByteArrayAssert_hasSize_Test {

  private ByteArrays arrays;
  private ByteArrayAssert assertions;

  @Before
  public void setUp() {
    arrays = mock(ByteArrays.class);
    assertions = new ByteArrayAssert(emptyArray());
    assertions.arrays = arrays;
  }

  @Test
  public void should_verify_that_actual_has_expected_size() {
    assertions.hasSize(6);
    verify(arrays).assertHasSize(assertions.info, assertions.actual, 6);
  }

  @Test public void should_return_this() {
    ByteArrayAssert returned = assertions.hasSize(0);
    assertSame(assertions, returned);
  }
}


text:
var createMap = require('../test-utils').createMap;
var d3 = require('d3');
var mockAnimationFrame = require('../test-utils').mockAnimationFrame;
var stepAnimationFrame = require('../test-utils').stepAnimationFrame;
var unmockAnimationFrame = require('../test-utils').unmockAnimationFrame;

describe('svg vector feature', function () {
  'use strict';

  var map, layer, feature1;

  it('Create a map with a svg feature layer', function () {
    mockAnimationFrame();
    map = createMap({
      center: [0, 0],
      zoom: 3,
      width: 100,
      height: 100
    });

    var cl = map.createLayer;
    map.createLayer = function (type, opts) {
      opts = opts || {};
      opts.renderer = 'svg';
      return cl.call(map, type, opts);
    };

    map.displayToGcs = function (pt) {
      return pt;
    };
    map.gcsToDisplay = function (pt) {
      return pt;
    };

    layer = map.createLayer('feature', {renderer: 'svg'});
  });

  it('Add features to a layer', function () {
    var vectorLines, featureGroup, markers;
    feature1 = layer.createFeature('vector')
    .data([{y: 0, x: 0}, {y: 10, x: 0}, {y: 0, x: 10}])
    .origin(function (d) {
      return {
        x: d.x,
        y: d.y
      };
    })
    .delta(function (d) {
      var target = {x: 5, y: 5};
      return {
        x: target.x - d.x,
        y: target.y - d.y
      };
    })
    .style({
      originStyle: 'none',
      endStyle: 'arrow'
    })
    .draw();
    stepAnimationFrame();

    vectorLines = d3.select('#map').selectAll('line');
    expect(vectorLines.size()).toBe(3);

    featureGroup = d3.selectAll('g#' + feature1._svgid());
    expect(featureGroup.size()).toBe(1);

    markers = d3.selectAll('marker');
    expect(markers.size()).toBe(3);

    markers.each(function () {
      var m = d3.select(this);
      var markerClass = m.attr('class');
      var match = markerClass.match(/geo-vector-arrow/);
      expect(match).not.toBeNull();
    });

  });

  it('Remove a feature from a layer', function () {
    var selection, markers;

    layer.deleteFeature(feature1).draw();
    stepAnimationFrame();

    selection = d3.select('#map').selectAll('line');
    expect(selection.size()).toBe(0);

    markers = d3.selectAll('markers');
    expect(markers.size()).toBe(0);
  });

  it('Correctly sets the marker references of the specified style for each vector', function () {
    var vectorLines;
    var options = ['arrow', 'wedge', 'bar'];
    var correspondingClasses = ['geo-vector-arrow', 'geo-vector-wedge', 'geo-vector-bar'];
    feature1 = layer.createFeature('vector')
    .data([{y: 0, x: 0}, {y: 10, x: 0}, {y: 0, x: 10}])
    .origin(function (d) {
      return {
        x: d.x,
        y: d.y
      };
    })
    .delta(function (d) {
      var target = {x: 5, y: 5};
      return {
        x: target.x - d.x,
        y: target.y - d.y
      };
    })
    .style({
      originStyle: function (d, i) {
        return options[i];
      },
      endStyle: 'arrow'
    })
    .draw();
    stepAnimationFrame();

    vectorLines = d3.select('#map').selectAll('line');
    expect(vectorLines.size()).toBe(3);

    vectorLines.each(function (v, i) {
      v = d3.select(this);
      var startId = v.attr('marker-start');
      var endId = v.attr('marker-end');
      //sanity test to make sure head and tail markers get correct prefix in id's.
      expect(startId.search(/tail/)).not.toBe(-1);
      expect(endId.search(/head/)).not.toBe(-1);

      var startMarker = d3.select(startId.match(/url\((.*)\)/)[1]);
      var endMarker = d3.select(endId.match(/url\((.*)\)/)[1]);
      expect(endMarker.classed('geo-vector-arrow')).toBe(true);
      expect(startMarker.classed(correspondingClasses[i])).toBe(true);
    });

  });

  it('Cleanup', function () {
    unmockAnimationFrame();
  });
});


text:
import React from 'react';
import PropTypes from 'prop-types';
import constants from './constants';
import cx from 'classnames';

const Icon = (props) => {
  let classes = {
    'material-icons': true
  };
  constants.PLACEMENTS.forEach(p => {
    classes[p] = props[p];
  });

  constants.ICON_SIZES.forEach(s => {
    classes[s] = props[s];
  });

  return (
    {props.children}
  );
};

Icon.propTypes = {
  /*
   * Classname passed to i tag
   */
  className: PropTypes.string,
  /*
   * Icon type: https://material.io/icons/
   */
  children: PropTypes.string,
  /*
   * Placement for icon if used beside a text ↓
   */
  left: PropTypes.bool,
  center: PropTypes.bool,
  right: PropTypes.bool,
  /*
   * Sizes for icons ↓
   */
  tiny: PropTypes.bool,
  small: PropTypes.bool,
  medium: PropTypes.bool,
  large: PropTypes.bool
};

export default Icon;


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

from ..message_parser import MessageParser

__all__ = ['ClientMessageParser']

class ClientMessageParser(MessageParser):
    pass


text:
var witai_speech = require('../index');

var ACCESS_TOKEN = "6SQV3DEGQWIXW3R2EDFUMPQCVGOEIBCR";

witai_speech.ASR({file: 'demo.wav', developer_key: ACCESS_TOKEN}, function (err, res) {
  console.log(err, res);
});


text:
import areNonNegativeIntegers from "validate.io-nonnegative-integer-array";
import { getFeatureTypes } from "ve-sequence-utils";
import NameUtils from "./NameUtils.js";
import {
  filterAminoAcidSequenceString,
  filterSequenceString,
  guessIfSequenceIsDnaAndNotProtein,
} from "ve-sequence-utils";
import { filter, some, upperFirst } from "lodash";
import pragmasAndTypes from "./pragmasAndTypes.js";

//validation checking
/**
 * validation and sanitizing of our teselagen sequence data type
 * @param  {object} sequence Our teselagen sequence data type
 * @return response         {
    validatedAndCleanedSequence: {},
    messages: [],
  };
 */
export default function validateSequence(sequence, options = {}) {
  let {
    isProtein,
    isOligo,
    guessIfProtein,
    guessIfProteinOptions,
    reformatSeqName,
    inclusive1BasedStart,
    inclusive1BasedEnd,
    additionalValidChars,
    allowOverflowAnnotations,
    coerceFeatureTypes,
  } = options;
  const response = {
    validatedAndCleanedSequence: {},
    messages: [],
  };
  if (!sequence || typeof sequence !== "object") {
    throw new Error("Invalid sequence");
  }
  if (!sequence.name) {
    //we'll handle transferring the file name outside of this function
    //for now just set it to a blank string
    sequence.name = "";
  }
  if (!sequence.extraLines) {
    sequence.extraLines = [];
  }
  if (!sequence.comments) {
    sequence.comments = [];
  }
  const oldName = sequence.name;
  if (reformatSeqName) {
    sequence.name = NameUtils.reformatName(sequence.name);
  }
  if (oldName !== sequence.name) {
    response.messages.push(
      "Name (" + oldName + ") reformatted to " + sequence.name
    );
  }

  if (Array.isArray(sequence.sequence)) {
    sequence.sequence = sequence.sequence.join("");
  }
  if (!sequence.sequence) {
    response.messages.push("No sequence detected");
    sequence.sequence = "";
  }
  let validChars;
  if (isProtein === undefined && guessIfProtein) {
    isProtein = !guessIfSequenceIsDnaAndNotProtein(
      sequence.sequence,
      guessIfProteinOptions
    );
  }
  if (isProtein) {
    //tnr: add code to strip invalid protein data..
    validChars = filterAminoAcidSequenceString(sequence.sequence);
    if (validChars !== sequence.sequence) {
      sequence.sequence = validChars;
      response.messages.push(
        "Import Error: Illegal character(s) detected and removed from amino acid sequence. Allowed characters are: xtgalmfwkqespvicyhrndu"
      );
    }
    sequence.type = "PROTEIN";
    sequence.isProtein = true;
    if (!sequence.proteinSequence) {
      sequence.proteinSequence = sequence.sequence;
    }
    sequence.proteinSize = sequence.proteinSequence.length;
  } else {
    //todo: this logic won't catch every case of RNA, so we should probably handle RNA conversion at another level..
    const temp = sequence.sequence;
    if (!isOligo) {
      sequence.sequence = sequence.sequence.replace(/u/gi, (u) =>
        u === "U" ? "T" : "t"
      );
    }
    if (temp !== sequence.sequence) {
      sequence.type = "RNA";
    } else {
      sequence.type = "DNA";
    }

    validChars = filterSequenceString(sequence.sequence, additionalValidChars);
    if (validChars !== sequence.sequence) {
      sequence.sequence = validChars;
      response.messages.push(
        "Import Error: Illegal character(s) detected and removed from sequence. Allowed characters are: atgcyrswkmbvdhn"
      );
    }
  }

  if (!sequence.size) {
    sequence.size = isProtein
      ? sequence.proteinSequence.length * 3
      : sequence.sequence.length;
  }
  let circularityExplicitlyDefined;
  if (
    sequence.circular === false ||
    sequence.circular === "false" ||
    sequence.circular === -1
  ) {
    sequence.circular = false;
    circularityExplicitlyDefined = true;
  } else if (!sequence.circular) {
    sequence.circular = false;
    circularityExplicitlyDefined = circularityExplicitlyDefined || false;
  } else {
    sequence.circular = true;
  }

  if (!sequence.features || !Array.isArray(sequence.features)) {
    response.messages.push("No valid features detected");
    sequence.features = [];
  }
  //tnr: maybe this should be wrapped in its own function (in case we want to use it elsewhere)
  sequence.features = sequence.features.filter(function (feature) {
    if (!feature || typeof feature !== "object") {
      response.messages.push("Invalid feature detected and removed");
      return false;
    }
    feature.start = parseInt(feature.start, 10);
    feature.end = parseInt(feature.end, 10);

    if (!feature.name || typeof feature.name !== "string") {
      response.messages.push(
        'Unable to detect valid name for feature, setting name to "Untitled Feature"'
      );
      feature.name = "Untitled Feature";
    }
    if (
      !allowOverflowAnnotations &&
      (!areNonNegativeIntegers([feature.start]) ||
        feature.start > sequence.size - (inclusive1BasedStart ? 0 : 1))
    ) {
      response.messages.push(
        "Invalid feature start: " +
          feature.start +
          " detected for " +
          feature.name +
          " and set to 1"
      ); //setting it to 0 internally, but users will see it as 1
      feature.start = 0;
    }
    if (
      !allowOverflowAnnotations &&
      (!areNonNegativeIntegers([feature.end]) ||
        feature.end > sequence.size - (inclusive1BasedEnd ? 0 : 1))
    ) {
      feature.end = Math.max(sequence.size - 1, inclusive1BasedEnd ? 0 : 1);
      response.messages.push(
        "Invalid feature end:  " +
          feature.end +
          " detected for " +
          feature.name +
          " and set to " +
          (feature.end + 1)
      );
    }

    if (
      feature.start - (inclusive1BasedStart ? 0 : 1) >
        feature.end - (inclusive1BasedEnd ? 0 : 1) &&
      sequence.circular === false
    ) {
      if (circularityExplicitlyDefined) {
        response.messages.push(
          "Invalid circular feature detected in explicitly linear sequence. " +
            feature.name +
            ". start set to 1"
        ); //setting it to 0 internally, but users will see it as 1
        feature.start = 0;
      } else {
        response.messages.push(
          "Circular feature detected in implicitly linear sequence. Setting sequence to be circular."
        );
        sequence.circular = true;
      }
    }

    feature.strand = parseInt(feature.strand, 10);
    if (
      feature.strand === -1 ||
      feature.strand === false ||
      feature.strand === "false" ||
      feature.strand === "-"
    ) {
      feature.strand = -1;
    } else {
      feature.strand = 1;
    }
    let invalidFeatureType;
    if (
      feature.type &&
      typeof feature.type === "string" &&
      feature.type.toLowerCase() === "primer"
    ) {
      feature.type = "primer_bind";
    }
    if (
      !feature.type ||
      typeof feature.type !== "string" ||
      !getFeatureTypes({ includeHidden: true }).some(function (featureType) {
        if (featureType.toLowerCase() === feature.type.toLowerCase()) {
          feature.type = featureType; //this makes sure the feature.type is being set to the exact value of the accepted featureType
          return true;
        }
        return false;
      })
    ) {
      //tnr: commenting this logic out
      if (coerceFeatureTypes || !feature.type) {
        response.messages.push(
          'Invalid feature type detected:  "' +
            feature.type +
            '" within ' +
            feature.name +
            ". set type to misc_feature"
        );
        if (typeof feature.type === "string") {
          invalidFeatureType = feature.type;
        }
        feature.type = "misc_feature";
      }
    }
    if (!feature.notes) {
      feature.notes = {};
    }
    //if the original feature type was invalid, push it onto the notes object under featureType
    if (invalidFeatureType) {
      if (!feature.notes.featureType) {
        feature.notes.featureType = [];
      }
      feature.notes.featureType.push(invalidFeatureType);
    }
    if (feature.notes.label) {
      //we've already used the label as the name by default if both gene and label were present
      delete feature.notes.label;
    } else if (feature.notes.gene) {
      //gene was useds for name (if it existed)
      delete feature.notes.gene;
    } else if (feature.notes.name) {
      //name was used for name (if it existed)
      delete feature.notes.name;
    }
    if (feature.notes.color) {
      feature.color = feature.notes.color[0] || feature.color;
      delete feature.notes.color;
    }
    if (feature.notes.labelColor) {
      feature.labelColor = feature.notes.labelColor[0] || feature.labelColor;
      delete feature.notes.labelColor;
    }
    if (
      feature.notes.pragma &&
      some(feature.notes.pragma, (p) => p === "overlapsSelf")
    ) {
      feature.overlapsSelf = true;
      feature.notes.pragma = filter(
        feature.notes.pragma,
        (p) => p !== "overlapsSelf"
      );
    }
    feature.notes.note &&
      some(feature.notes.note, (n) => {
        if (
          n &&
          typeof n === "string" &&
          n.toLowerCase().includes("sequence:")
        ) {
          //remove it after we're parsed it out
          feature.notes.note = filter(
            feature.notes.note,
            (p) => n && !n.toLowerCase().includes("sequence:")
          );
          if (feature.notes.note.length === 0) {
            delete feature.notes.note;
          }
          const match = n.match(/sequence:[ \r\n.]*[a-zA-Z]*/i);
          if (match && match[0])
            feature.bases = match[0]
              .replace(/\s/g, "")
              .replace("sequence:", "");

          return true;
        }
      });

    feature.notes.primerBindsOn &&
      some(feature.notes.primerBindsOn, (n) => {
        if (n) {
          feature.primerBindsOn = n;
          delete feature.notes.primerBindsOn;
        }
      });

    for (const { pragma, type } of pragmasAndTypes) {
      if (
        options[`accept${upperFirst(type)}`] !== false && //acceptParts, acceptWarnings,
        feature.notes.pragma &&
        some(feature.notes.pragma, (p) => p === pragma)
      ) {
        if (!sequence[type]) {
          sequence[type] = []; //initialize an empty array if necessary
        }
        feature.type = type.slice(0, -1); //set the type before pushing it onto the array
        delete feature.notes.pragma;
        sequence[type].push(feature);
        return false; //don't include the features
      }
    }
    return true;
  });
  response.validatedAndCleanedSequence = sequence;
  return response;
}


text:
package com.bankonet.commande;

import java.util.Scanner;

import com.bankonet.metier.BankonetMetierConseiller;

public class CommandeCreerCompte implements CommandeFactory {
	//attributs
	private Integer id;
	private String libelle;
	private Scanner sc;
	private BankonetMetierConseiller bmc;

	//constructeurs
	public CommandeCreerCompte(Integer id, String lib) {
		setId(id);
		setLibelle(lib);
	}

	public CommandeCreerCompte(Integer id, String lib, BankonetMetierConseiller bmc) {
		setId(id);
		setLibelle(lib);
		setConseiller(bmc);
	}

	public CommandeCreerCompte(Integer id, String lib, Scanner sc, BankonetMetierConseiller bmc) {
		setId(id);
		setLibelle(lib);
		setScanner(sc);
		setConseiller(bmc);
	}

	//methodes
	@Override
	public void execute() {
		System.out.println("**** Creation d'un compte ****");
		System.out.println("Veuillez saisir le nom: ");
		String nom = sc.next();
		System.out.println("Veuillez saisir le prénom: ");
		String prenom = sc.next();
		System.out.println("Veuillez saisir le login: ");
		String login = sc.next();

		//ajout du nouveau client dans le programme
		bmc.creerCompte(nom, prenom, nom+prenom, login);

		System.out.println("Compte créé: mdp par defaut: 'secret'");
	}

	//accesseurs
	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setLibelle(String lib) {
		this.libelle = lib;
	}

	@Override
	public String getLibelle() {
		return this.libelle;
	}

	@Override
	public void setScanner(Scanner sc) {
		this.sc = sc;
	}

	@Override
	public Scanner getScanner() {
		return sc;
	}

	@Override
	public void setConseiller(BankonetMetierConseiller bmc) {
		this.bmc = bmc;
	}

	@Override
	public BankonetMetierConseiller getConseiller() {
		return bmc;
	}

}


text:
maintainer       "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license          "Apache 2.0"
description      "Installs logwatch, a nice log analyzer"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version          "0.1"

depends "perl"

%w{ redhat centos debian ubuntu }.each do |os|
  supports os
end


text:
[react-bs-datatable](../README.md) / [components/Filter](../modules/components_Filter.md) / FilterClasses

# Interface: FilterClasses

[components/Filter](../modules/components_Filter.md).FilterClasses

This is an interface for customizing the classes for
the `Filter` component.

## Table of contents

### Properties

- [clearButton](components_Filter.FilterClasses.md#clearbutton)
- [input](components_Filter.FilterClasses.md#input)
- [inputGroup](components_Filter.FilterClasses.md#inputgroup)

## Properties

### clearButton

• `Optional` **clearButton**: `string`

The class for the clear button.

#### Defined in

[components/Filter.tsx:20](https://github.com/imballinst/react-bs-datatable/blob/798f739/src/components/Filter.tsx#L20)

___

### input

• `Optional` **input**: `string`

The class for the text input.

#### Defined in

[components/Filter.tsx:18](https://github.com/imballinst/react-bs-datatable/blob/798f739/src/components/Filter.tsx#L18)

___

### inputGroup

• `Optional` **inputGroup**: `string`

The class for the input group, which covers the
text input and the clear button.

#### Defined in

[components/Filter.tsx:16](https://github.com/imballinst/react-bs-datatable/blob/798f739/src/components/Filter.tsx#L16)


text:
<title>Dragging an image to the end of a content editable div in an iframe</title>

This tests that we can drag an image into the last position of a content editable div in an iframe that already contains an image, without crashing.


text:
/*
Flot plugin for stacking data sets horizontally, i.e. putting them
beside each other instead of overlapping.

Specify multiplebars to enable this plugin:

  $.plot($("#placeholder"), [{ data: [ ... ], multiplebars: true }])

The stacking order is determined by the order of the data series in
the array (later series end up to the right of the previous).

NOTE: This plugin conflicts with the stack plugin

*/

(function ($) {
    function init(plot) {
        var multiple = false;
        var sArray = [];
        var totWidth = 0;

        function procRawData(plot, series, data, datapoints) {
            if(series.bars.show) {
                sArray.push(series);
            }
        }

        function procDatapoints(plot, series, datapoints) {
            //Ensure we only process these once
            if(series.bars.show && series.bars.barLeft==undefined) {
                if(totWidth==0) {
                    for(var j = 0; j < sArray.length; j++) {
                        totWidth+=sArray[j].bars.barWidth;
                    }
                }

                var runWidth=0;
                for(var k = 0; k < sArray.length; k++) {
                    s=sArray[k];
                    if(s==series) {
                        break;
                    }
                    runWidth+=s.bars.barWidth;
                }
                series.bars.barLeft = runWidth-(totWidth/2);
            }
        }

        function checkMultipleBarsEnabled(plot, options) {
            if (options.multiplebars) {
                multiple = options.multiplebars;
                sArray=[];
                totWidth=0;

                plot.hooks.processRawData.push(procRawData);
                plot.hooks.processDatapoints.push(procDatapoints);
            }
        }

        plot.hooks.processOptions.push(checkMultipleBarsEnabled);
    }

    var options = { multiplebars: false };

    $.plot.plugins.push({
        init: init,
        options: options,
        name: "multiplebars",
        version: "0.1"
    });
})(jQuery);


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using CrossQuery.Mapper.Interfaces;
using CrossQuery.Mapper.Internal;

namespace CrossQuery.Mapper
{
    public class Mapper
    {
        private static Mapper _singleMapper;

        private List<IMapperConfiguration> _mapperConfigurations = new List<IMapperConfiguration>();

        public TDest Map<TSource, TDest>(TSource source)
            where TDest : class, new()
            where TSource : class
        {
            if (source == null)
                throw new NullReferenceException("source is null.");

            var mapperConfiguration = GetConfiguration<TSource, TDest>();

            if (mapperConfiguration == null)
                throw new NotImplementedException($"Mapper for {typeof(TSource).Name} and {typeof(TDest).Name} is not implemented");

            return ((IMapperConfiguration<TSource, TDest>)mapperConfiguration).Map(source);
        }

        public IEnumerable<TDest> Map<TSource, TDest>(IEnumerable<TSource> sourceCollection)
            where TDest : class, new()
            where TSource : class
        {
            if (sourceCollection == null)
                throw new NullReferenceException("Source Collection is null.");

            var mapperConfiguration = GetConfiguration<TSource, TDest>();

            if (mapperConfiguration == null)
                throw new NotImplementedException($"Mapper for {typeof(TSource).Name} and {typeof(TDest).Name} is not implemented");

            return sourceCollection
                .Select(s => ((MapperConfiguration<TSource, TDest>)mapperConfiguration).Map(s))
                .AsParallel()
                .ToList();
        }

        public object Map(Type TSource, Type TDest, object source)
        {
            if (TSource == null)
                throw new NullReferenceException("TSource is null");

            if (TDest == null)
                throw new NullReferenceException("TDest is null");

            if (source == null)
                throw new NullReferenceException("source is null");

            Type sourceType = TSource;
            Type destinationType = TDest;
            Type sourceObjectType = source.GetType();

            bool sourceIsArray = false;

            if (typeof(IEnumerable).IsAssignableFrom(sourceObjectType))
            {
                sourceIsArray = true;
                sourceObjectType = sourceObjectType.GetGenericArguments()[0];
            }

            if (!sourceType.IsClass)
                throw new ArgumentException($"{sourceType.Name} is not a class");

            if (!destinationType.IsClass || destinationType.GetConstructor(Type.EmptyTypes) == null)
                throw new ArgumentException($"{destinationType.Name} is not a class or is not inmpemented default constructor");

            if (sourceObjectType != sourceType)
                throw new ArgumentException($"Source object is not a {sourceType.Name}");

            var mapperConfiguration = GetConfiguration(sourceType, destinationType);

            if (mapperConfiguration == null)
                throw new NotImplementedException($"Mapper for {sourceType.Name} and {destinationType.Name} is not implemented");

            if (sourceIsArray)
            {
                var genericListType = typeof(List<>).MakeGenericType(new[] { destinationType });
                var desinationList = Activator.CreateInstance(genericListType);

                foreach (var sourceObj in (IEnumerable)source)
                    genericListType.GetMethod("Add").Invoke(desinationList, new[] { mapperConfiguration.Map(sourceObj) });

                return desinationList;
            }

            return mapperConfiguration.Map(source);
        }

        public IMapperConfiguration<TSource, TDest> CreateConfiguration<TSource, TDest>()
            where TDest : class, new()
            where TSource : class
        {
            var mapperConfiguration = GetConfiguration<TSource, TDest>();

            if (mapperConfiguration == null)
            {
                mapperConfiguration = new MapperConfiguration<TSource, TDest>(this);
                _mapperConfigurations.Add(mapperConfiguration);
            }

            return (IMapperConfiguration<TSource, TDest>)mapperConfiguration;
        }

        private IMapperConfiguration GetConfiguration<TSource, TDest>()
            where TDest : class, new()
            where TSource : class

        {
            return _mapperConfigurations
                .FirstOrDefault(mc => mc.GetDestinationType() == typeof(TDest) && mc.GetSourceType() == typeof(TSource));
        }

        private IMapperConfiguration GetConfiguration(Type TSource, Type TDest)

        {
            return _mapperConfigurations
                .FirstOrDefault(mc => mc.GetDestinationType() == TDest && mc.GetSourceType() == TSource);
        }

        public static Mapper GetSingleMapper()
        {
            if (_singleMapper == null)
                _singleMapper = new Mapper();

            return _singleMapper;
        }

        public static void ClearSingleMapperConfiguration()
        {
            if (_singleMapper == null)
                throw new NullReferenceException("SingleMapper is null. You must first call GetSingleMapper() method.");

            _singleMapper._mapperConfigurations.Clear();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="28dp"
        android:text="@string/lblCurrentPlayer"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/text_foreground" />

	<TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_alignRight="@+id/textView1"
        android:text="@string/lblScore"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/text_foreground" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView2"
        android:layout_alignRight="@+id/textView2"
        android:text="@string/lblWounds"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/text_foreground" />

    <TextView
        android:id="@+id/textViewCurPlayer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/textView1"
        android:layout_marginLeft="15dp"
        android:layout_toRightOf="@+id/textView1"
        android:maxLines="1"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/text_foreground"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/TextViewCurScore"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textViewCurPlayer"
        android:layout_alignLeft="@+id/textViewCurPlayer"
        android:maxLines="1"
        android:text="0"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/text_foreground"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/TextViewCurWounds"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/TextViewCurScore"
        android:layout_alignLeft="@+id/TextViewCurScore"
        android:maxLines="1"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/WoundsColor"
        android:textStyle="bold" />

    <LinearLayout
        android:id="@+id/linearLayoutButtons"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/textView3" >

        <Button
            android:id="@+id/btnRollDice"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:onClick="rollDice"
            android:text="@string/btnRollDice" />

        <Button
            android:id="@+id/btnPass"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:onClick="passTurn"
            android:text="@string/btnPass" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutDicesRow1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/linearLayoutButtons" >

        <ImageView
            android:id="@+id/imageViewDie1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1.00"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie3"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/LinearLayoutDicesRow2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/linearLayoutDicesRow1" >

        <ImageView
            android:id="@+id/imageViewDie4"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie5"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1.00"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie6"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/LinearLayoutDicesRow3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/LinearLayoutDicesRow2" >

        <ImageView
            android:id="@+id/imageViewDie7"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie8"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1.00"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie9"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/LinearLayoutDicesRow4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/LinearLayoutDicesRow3" >

        <ImageView
            android:id="@+id/imageViewDie10"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie11"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1.00"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie12"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <ImageView
            android:id="@+id/imageViewDie13"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

    </LinearLayout>

</RelativeLayout>


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=UTF-8" />
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css" />

Packages

All

trashday

trashday.model

trashday.storage

trashday.ui

trashday.ui.requests

trashday.ui.responses


text:
package org.spiffyui.spsample.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * This is the landing panel
 *
 */
public class LandingPanel extends HTMLPanel
{
    private static final SPSampleStrings STRINGS = (SPSampleStrings) GWT.create(SPSampleStrings.class);

    /**
     * Creates a new panel
     */
    public LandingPanel()
    {
        super("div", STRINGS.LandingPanel_html());

        getElement().setId("landingPanel");

        RootPanel.get("mainContent").add(this);

        addAnchor(Index.getStrings().documentation(), Index.OVERVIEW_NAV_ITEM_ID, "landingDoc");
        addAnchor(Index.getStrings().samples(), Index.SAMPLES_NAV_ITEM_ID, "landingSample");
        addAnchor(Index.getStrings().contact(), Index.HELP_NAV_ITEM_ID, "landingHelp");
        addAnchor(Index.getStrings().download(), Index.GET_STARTED_NAV_ITEM_ID, "landingDownload");
        addAnchor(Index.getStrings().devMode(), Index.HOSTED_MODE_NAV_ITEM_ID, "landingDevMode");
        addAnchor(Index.getStrings().lic(), Index.LICENSE_NAV_ITEM_ID, "landingLic");

        getElementById("mobileCalloutText").setInnerHTML(Index.getStrings().mobileCallout(
            "", ""));
        addAnchor(Index.getStrings().flexibleCSS(), Index.CSS_NAV_ITEM_ID, "mobileCSSLink");
        addAnchor(Index.getStrings().downloadSize(), Index.SPEED_NAV_ITEM_ID, "mobileSpeedLink");

        getElementById("restCalloutText").setInnerHTML(Index.getStrings().restCallout(
            ""));
        addAnchor(Index.getStrings().restility(), Index.REST_NAV_ITEM_ID, "restRestLink");

        getElementById("secCalloutText").setInnerHTML(Index.getStrings().secCallout(
            ""));
        addAnchor(Index.getStrings().secureLink(), Index.AUTH_NAV_ITEM_ID, "secSecLink");

        getElementById("licCalloutText").setInnerHTML(Index.getStrings().licCallout(
            ""));
        addAnchor(Index.getStrings().apacheLic(), Index.LICENSE_NAV_ITEM_ID, "licLicLink");

        /*
         * Add Project Creator
         */
        ProjectCreatorPanel projCreator = new ProjectCreatorPanel("landingPanelForm");
        add(projCreator, "createSpiffy");
    }

    private void addAnchor(final String text, final String id, final String location)
    {
        Anchor link = new Anchor(text, "#");
        link.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event)
            {
                event.preventDefault();
                Index.selectItem(id);
            }
        });
        add(link, location);
    }

}


text:
from electrum.i18n import _

fullname = "BitBox02"
description = (
    "Provides support for the BitBox02 hardware wallet"
)
requires = [
    (
        "bitbox02",
        "https://github.com/digitalbitbox/bitbox02-firmware/tree/master/py/bitbox02",
    )
]
registers_keystore = ("hardware", "bitbox02", _("BitBox02"))
available_for = ["qt"]


text:
package com.dungeonstory.backend.service;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.Collection;

import org.junit.Test;

import com.dungeonstory.backend.TestWithBackend;
import com.dungeonstory.backend.data.Region;
import com.dungeonstory.backend.service.impl.RegionService;
import com.dungeonstory.backend.service.mock.MockRegionService;

public class TestRegionService extends TestWithBackend {

    @Test
    public void testMockRegionService() {
        MockRegionService service = MockRegionService.getInstance();

        Collection<Region> allRegions = service.findAll();
        assertNotNull(allRegions);
        int size = allRegions.size();
        assertTrue(size > 0);

        Region region = allRegions.toArray(new Region[0])[0];
        region.setName("My Test Name");
        service.update(region);

        Region region2 = service.findAll().iterator().next();
        assertEquals("My Test Name", region2.getName());

        service.delete(region2);
        allRegions = service.findAll();
        assertNotNull(allRegions);
        assertEquals(size - 1, allRegions.size());

        System.out.println(allRegions);
    }

    @Test
    public void testRegionService() throws Exception {
        RegionService service = RegionService.getInstance();

        Region newRegion = new Region("My region");
        service.create(newRegion);

        Collection<Region> allRegions = service.findAll();
        assertNotNull(allRegions);
        assertTrue(allRegions.size() > 0);

        Region region = service.read(newRegion.getId());
        region.setName("My Test Name");
        service.update(region);

        Region region2 = service.read(region.getId());
        assertEquals("My Test Name", region2.getName());

        int size = allRegions.size();
        service.delete(region2);
        allRegions = service.findAll();
        assertNotNull(allRegions);
        assertEquals(size - 1, allRegions.size());
    }

}


text:
namespace open_vcdiff {
namespace {  // anonymous

using std::vector;

class VCDiffHeaderParserTest : public testing::Test {
 protected:
  typedef std::string string;

  static const int kTestSize = 1024;

  VCDiffHeaderParserTest() : parser(NULL) { }

  virtual ~VCDiffHeaderParserTest() {
    delete parser;
  }

  virtual void SetUp() {
    srand(1);  // make sure each test uses the same data set
  }

  void StartParsing() {
    parser = new VCDiffHeaderParser(
        encoded_buffer_.data(),
        encoded_buffer_.data() + encoded_buffer_.size());
    EXPECT_EQ(encoded_buffer_.data(), parser->UnparsedData());
  }

  void VerifyByte(unsigned char expected_value) {
    unsigned char decoded_byte = 0;
    const char* prior_position = parser->UnparsedData();
    EXPECT_TRUE(parser->ParseByte(&decoded_byte));
    EXPECT_EQ(expected_value, decoded_byte);
    EXPECT_EQ(RESULT_SUCCESS, parser->GetResult());
    EXPECT_EQ(prior_position + sizeof(unsigned char),
              parser->UnparsedData());
  }

  void VerifyInt32(int32_t expected_value) {
    int32_t decoded_integer = 0;
    const char* prior_position = parser->UnparsedData();
    EXPECT_TRUE(parser->ParseInt32("decoded int32", &decoded_integer));
    EXPECT_EQ(expected_value, decoded_integer);
    EXPECT_EQ(RESULT_SUCCESS, parser->GetResult());
    EXPECT_EQ(prior_position + VarintBE<int32_t>::Length(decoded_integer),
              parser->UnparsedData());
  }

  void VerifyUInt32(uint32_t expected_value) {
    uint32_t decoded_integer = 0;
    const char* prior_position = parser->UnparsedData();
    EXPECT_TRUE(parser->ParseUInt32("decoded uint32", &decoded_integer));
    EXPECT_EQ(expected_value, decoded_integer);
    EXPECT_EQ(RESULT_SUCCESS, parser->GetResult());
    EXPECT_EQ(prior_position + VarintBE<int64_t>::Length(decoded_integer),
              parser->UnparsedData());
  }

  void VerifyChecksum(VCDChecksum expected_value) {
    VCDChecksum decoded_checksum = 0;
    const char* prior_position = parser->UnparsedData();
    EXPECT_TRUE(parser->ParseChecksum("decoded checksum", &decoded_checksum));
    EXPECT_EQ(expected_value, decoded_checksum);
    EXPECT_EQ(RESULT_SUCCESS, parser->GetResult());
    EXPECT_EQ(prior_position + VarintBE<int64_t>::Length(decoded_checksum),
              parser->UnparsedData());
  }

  string encoded_buffer_;
  VCDiffHeaderParser* parser;
};

TEST_F(VCDiffHeaderParserTest, ParseRandomBytes) {
  vector<unsigned char> byte_values;
  for (int i = 0; i < kTestSize; ++i) {
    unsigned char random_byte = PortableRandomInRange<unsigned char>(0xFF);
    encoded_buffer_.push_back(random_byte);
    byte_values.push_back(random_byte);
  }
  StartParsing();
  for (int position = 0; position < kTestSize; ++position) {
    VerifyByte(byte_values[position]);
  }
  unsigned char decoded_byte = 0;
  EXPECT_FALSE(parser->ParseByte(&decoded_byte));
  EXPECT_EQ(RESULT_END_OF_DATA, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data() + encoded_buffer_.size(),
            parser->UnparsedData());
}

TEST_F(VCDiffHeaderParserTest, ParseRandomInt32) {
  vector<int32_t> integer_values;
  for (int i = 0; i < kTestSize; ++i) {
    int32_t random_integer = PortableRandomInRange<int32_t>(0x7FFFFFFF);
    VarintBE<int32_t>::AppendToString(random_integer, &encoded_buffer_);
    integer_values.push_back(random_integer);
  }
  StartParsing();
  for (int i = 0; i < kTestSize; ++i) {
    VerifyInt32(integer_values[i]);
  }
  int32_t decoded_integer = 0;
  EXPECT_FALSE(parser->ParseInt32("decoded integer", &decoded_integer));
  EXPECT_EQ(RESULT_END_OF_DATA, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data() + encoded_buffer_.size(),
            parser->UnparsedData());
}

TEST_F(VCDiffHeaderParserTest, ParseRandomUInt32) {
  vector<uint32_t> integer_values;
  for (int i = 0; i < kTestSize; ++i) {
    uint32_t random_integer = PortableRandomInRange<uint32_t>(0xFFFFFFFF);
    VarintBE<int64_t>::AppendToString(random_integer, &encoded_buffer_);
    integer_values.push_back(random_integer);
  }
  StartParsing();
  uint32_t decoded_integer = 0;
  for (int i = 0; i < kTestSize; ++i) {
    VerifyUInt32(integer_values[i]);
  }
  EXPECT_FALSE(parser->ParseUInt32("decoded integer", &decoded_integer));
  EXPECT_EQ(RESULT_END_OF_DATA, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data() + encoded_buffer_.size(),
            parser->UnparsedData());
}

TEST_F(VCDiffHeaderParserTest, ParseRandomChecksum) {
  vector<VCDChecksum> checksum_values;
  for (int i = 0; i < kTestSize; ++i) {
    VCDChecksum random_checksum =
        PortableRandomInRange<VCDChecksum>(0xFFFFFFFF);
    VarintBE<int64_t>::AppendToString(random_checksum, &encoded_buffer_);
    checksum_values.push_back(random_checksum);
  }
  StartParsing();
  for (int i = 0; i < kTestSize; ++i) {
    VerifyChecksum(checksum_values[i]);
  }
  VCDChecksum decoded_checksum = 0;
  EXPECT_FALSE(parser->ParseChecksum("decoded checksum", &decoded_checksum));
  EXPECT_EQ(RESULT_END_OF_DATA, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data() + encoded_buffer_.size(),
            parser->UnparsedData());
}

TEST_F(VCDiffHeaderParserTest, ParseMixed) {
  VarintBE<int64_t>::AppendToString(0xCAFECAFE, &encoded_buffer_);
  encoded_buffer_.push_back(0xFF);
  VarintBE<int32_t>::AppendToString(0x02020202, &encoded_buffer_);
  VarintBE<int64_t>::AppendToString(0xCAFECAFE, &encoded_buffer_);
  encoded_buffer_.push_back(0xFF);
  encoded_buffer_.push_back(0xFF);
  StartParsing();
  VerifyUInt32(0xCAFECAFE);
  VerifyByte(0xFF);
  VerifyInt32(0x02020202);
  VerifyChecksum(0xCAFECAFE);
  int32_t incomplete_int32 = 0;
  EXPECT_FALSE(parser->ParseInt32("incomplete Varint", &incomplete_int32));
  EXPECT_EQ(0, incomplete_int32);
  EXPECT_EQ(RESULT_END_OF_DATA, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data() + encoded_buffer_.size() - 2,
            parser->UnparsedData());
}

TEST_F(VCDiffHeaderParserTest, ParseInvalidVarint) {
  // Start with a byte that has the continuation bit plus a high-order bit set
  encoded_buffer_.append(1, static_cast<char>(0xC0));
  // Add too many bytes with continuation bits
  encoded_buffer_.append(6, static_cast<char>(0x80));
  StartParsing();
  int32_t invalid_int32 = 0;
  EXPECT_FALSE(parser->ParseInt32("invalid Varint", &invalid_int32));
  EXPECT_EQ(0, invalid_int32);
  EXPECT_EQ(RESULT_ERROR, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data(), parser->UnparsedData());
  // After the parse failure, any other call to Parse... should return an error,
  // even though there is still a byte that could be read as valid.
  unsigned char decoded_byte = 0;
  EXPECT_FALSE(parser->ParseByte(&decoded_byte));
  EXPECT_EQ(0, decoded_byte);
  EXPECT_EQ(RESULT_ERROR, parser->GetResult());
  EXPECT_EQ(encoded_buffer_.data(), parser->UnparsedData());
}

}  //  namespace open_vcdiff
}  //  anonymous namespace


text:
@interface EVAPIRequest ()

@property (nonatomic, strong, readwrite) NSURLConnection* connection;
@property (nonatomic, strong, readwrite) NSMutableData* responseData;

@end

@implementation EVAPIRequest

- (instancetype)initWithURL:(NSURL*)URL timeout:(NSTimeInterval)timeout andDelegate:(id<EVAPIRequestDelegate>)delegate {
    self = [super initWithName:@"APIRequest" andErrorHandler:delegate];
    if (self != nil) {
        NSURLRequest* request = [NSURLRequest requestWithURL:URL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:timeout];
        self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
        [self.connection release];
        self.delegate = delegate;
        self.responseData = [NSMutableData data];
    }
    return self;
}

- (void)dealloc {
    self.connection = nil;
    self.responseData = nil;
    [super dealloc];
}

- (void)start {
    [self.connection start];
}

- (void)cancel {
    [self.connection cancel];
    self.connection = nil;
    [super cancel];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
    self.connection = nil;
    [self.delegate node:self gotAnError:error];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    [self.responseData appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    self.connection = nil;
    NSError* error = nil;
    NSDictionary* json = [NSJSONSerialization JSONObjectWithData:self.responseData options:kNilOptions error:&error];
    if (error != nil) {
        EV_LOG_ERROR("Can't read json: %@", error);
        [self.delegate node:self gotAnError:error];
    } else {
        [self.delegate apiRequest:self gotResponse:json];
    }
}

@end


text:
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;

class ExamResultsModel extends Model
{
    use LogsActivity;
    //
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'tbl_exams';
     protected static $logAttributes = ['APPLICATION_NUMBER', 'SUBJECT','GRADE','SITTING','EXAM_TYPE','INDEX_NO'];
    protected $primaryKey="ID";
    protected $guarded = ['ID'];
    public $timestamps = false;
    public function applicant(){
        return $this->hasMany('App\Models\ApplicantModel', "APPLICATION_NUMBER","APPLICATION_NUMBER");
    }
     public function subject(){
        return $this->belongsTo('App\Models\SubjectModel', "SUBJECT","ID");
    }

}


text:
package rules;
/*
SETTINGS: (please don't move this part)
 PATH=NumberRule5
*/

import it.cavallium.warppi.math.Function;
import it.cavallium.warppi.math.FunctionOperator;
import it.cavallium.warppi.math.MathContext;
import it.cavallium.warppi.math.functions.Multiplication;
import it.cavallium.warppi.math.functions.Number;
import it.cavallium.warppi.math.functions.Subtraction;
import it.cavallium.warppi.math.functions.Sum;
import it.cavallium.warppi.math.functions.SumSubtraction;
import it.cavallium.warppi.math.rules.Rule;
import it.cavallium.warppi.math.rules.RuleType;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;

/**
 * Number rule
 * a + 0 = a
 * 0 + a = a
 * a - 0 = a
 * 0 - a = -a
 * a ± 0 = a
 *
 * @author Andrea Cavalli
 *
 */
public class NumberRule5 implements Rule {
	// Rule name
	@Override
	public String getRuleName() {
		return "NumberRule5";
	}

	// Rule type
	@Override
	public RuleType getRuleType() {
		return RuleType.CALCULATION;
	}

	/* Rule function
	   Returns:
	     - null if it's not executable on the function "f"
	     - An ObjectArrayList<Function> if it did something
	*/

	@Override
	public ObjectArrayList<Function> execute(final Function f) {
		boolean isExecutable = false;
		if (f instanceof Sum || f instanceof Subtraction || f instanceof SumSubtraction) {
			final MathContext root = f.getMathContext();
			final FunctionOperator fnc = (FunctionOperator) f;
			if (fnc.getParameter1().equals(new Number(root, 0)) || fnc.getParameter2().equals(new Number(root, 0)))
				if (!(fnc.getParameter1().equals(new Number(root, 0)) && f instanceof SumSubtraction))
					isExecutable = true;
		}

		if (isExecutable) {
			final MathContext root = f.getMathContext();
			final ObjectArrayList<Function> result = new ObjectArrayList<>();
			final FunctionOperator fnc = (FunctionOperator) f;
			Function a = fnc.getParameter1();
			if (a.equals(new Number(root, 0)))
				if (f instanceof Subtraction)
					a = new Multiplication(root, new Number(root, -1), fnc.getParameter2());
				else
					a = fnc.getParameter2();
			result.add(a);
			return result;
		} else
			return null;
	}
}


text:
FROM jetty:9.4.14-jre11

ADD ./target/ghost.war $TMPDIR/ghost.war
ADD ./src/etc/jetty-realm.properties $JETTY_HOME/etc/jetty-realm.properties
ADD ./src/etc/jetty-ghost-context.xml $JETTY_BASE/webapps/ghost.xml


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

    <title>ExposeTranslationBundle unit tests</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">

    <link rel="stylesheet" href="./libs/qunit/qunit.css" type="text/css" media="screen" charset="utf-8" />

QUnit Test Suite

test markup, will be hidden


text:
package it.neokree.example.mockedActivity;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.ActionBarActivity;

import it.neokree.example.R;

/**
 * Created by neokree on 24/11/14.
 */
public class Settings extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.settings);
    }
}


text:
<?php

namespace s9e\TextFormatter\Tests;

use RuntimeException;
use s9e\TextFormatter\Configurator;

abstract class Test extends \PHPUnit_Framework_TestCase
{
	public function __get($k)
	{
		switch ($k)
		{
			case 'configurator':
				return $this->configurator = new Configurator;

			default:
				throw new RuntimeException("Bad __get('$k')");
		}
	}

	protected function assertArrayMatches(array $expected, array $actual, $removeNull = true)
	{
		$this->reduceAndSortArrays($expected, $actual, $removeNull);
		$this->assertSame($expected, $actual);
	}

	protected function reduceAndSortArrays(array &$expected, array &$actual, $removeNull = true)
	{
		if (empty($expected))
		{
			return;
		}

		ksort($expected);
		ksort($actual);

		$actual = array_intersect_key($actual, $expected);

		foreach ($actual as $k => &$v)
		{
			if (is_array($expected[$k]) && is_array($v))
			{
				$this->reduceAndSortArrays($expected[$k], $v, $removeNull);
			}
		}

		// Remove null values from $expected, they indicate that the key should NOT appear in
		// $actual
		if ($removeNull)
		{
			foreach (array_keys($expected, null, true) as $k)
			{
				unset($expected[$k]);
			}
		}
	}

	protected function assertParsing($original, $expected, $setup = null, $callback = null)
	{
		$configurator = new Configurator;

		if (isset($setup))
		{
			call_user_func($setup, $configurator);
		}

		$parser = $configurator->getParser();
		$parser->registerParser(
			'Test',
			function () use ($callback, $parser)
			{
				if (isset($callback))
				{
					call_user_func($callback, $parser);
				}
			}
		);

		$this->assertSame($expected, $parser->parse($original));
	}
}


text:
package model

import model.pokedex.Pokedex

/**
  * Created by salim on 12/09/2016.
  */
case class Game(world: World, pokedex: Pokedex, snGenerator: () => Int) {
  def spawnPlayer: Player = {
    Player(snGenerator())
  }

}

object Game {
  def boot(): Game = {
    val g = snGenratorFactory()
    Game(World.factory(g), Pokedex.boot, snGenratorFactory())
  }
}


text:
'use strict';

angular.module('ScoutIOApp.admin', [
  'ScoutIOApp.auth',
  'ui.router'
]);


text:
package wherehows.models.table;

public class ColumnComment {

  public int id;
  public Long fieldId;
  public String text;
  public String authorName;
  public String authorUserName;
  public String authorEmail;
  public String created;
  public String modified;
}