text:
""" Converts between chromosome names. """
import sys
import argparse
from argparse import RawDescriptionHelpFormatter as Raw
import pkg_resources
import gzip

import pandas as pd
import pysam
import pybedtools
from Bio import SeqIO

def arguments():
    """ Function to pull command line arguments """

    DESCRIPTION = """\
    Converts between chromosome names.

    In D. melanogaster there are four common varieties of chromosomes names
    that are used.

    * FlyBase style: 2L, 2R, 3L, etc.
    * UCSC style: chr2L, chr2R, chr3L, etc.
    * RefSeq style: NT_033779.5, NT_033778.4, NT_037436.4, etc.
    * GenBank style: AE014134.6, AE013599.5, AE014296.5, etc.

    Each style has its benefits: FlyBase is the standard, UCSC is compatible
    with the genome browser, and RefSeq and GenBank are the most explicit. It
    is common to come across files that use these different styles of
    chromosome name, this tool aims to easily convert chromosome names in a
    variety of file format.

    """

    parser = argparse.ArgumentParser(description=DESCRIPTION,
                                     formatter_class=Raw)

    parser.add_argument("--from", dest="orig", action='store', required=True,
                        choices=['FlyBase', 'UCSC', 'RefSeq', 'GenBank'],
                        help="Current type of chromosome name.")

    parser.add_argument("--to", dest="new", action='store', required=True,
                        choices=['FlyBase', 'UCSC', 'RefSeq', 'GenBank'],
                        help="The type of chromosome name wanted.")

    parser.add_argument("--fileType", dest="type", action='store',
                        required=True,
                        choices=['SAM', 'BAM', 'BED', 'GFF', 'GTF', 'FASTA'],
                        help="What is the input format.")

    parser.add_argument("-i", "--input", dest="input", action='store',
                        required=True,
                        help="""Input file to convert. If `-i -`, STDIN is
                        used. Note if using SAM/BAM with STDIN, you must
                        include headrs.""")

    parser.add_argument("-o", "--output", dest="output", action='store',
                        required=False, default='-',
                        help="Output file, if none given or `-o -` "
                        "then STDOUT.")

    parser.add_argument("--debug", dest="debug", action='store_true',
                        required=False, help="Enable debug output.")

    return parser.parse_args()

def import_conversion(f, t):
    """
    Import NCBI conversion table.

    Parameters
    ----------
    f: str {FlyBase, UCSC, NCBI}
        The current chromosome format.
    t: str {FlyBase, UCSC, NCBI}
        The desired chromosome format.

    Returns
    -------
    dict: Mapping {f: t}

    """

    # Get location of the file
    gz = pkg_resources.resource_filename(
        'lcdblib',
        'data/GCF_000001215.4.assembly.txt.gz'
    )

    # Import file
    df = pd.read_csv(gz, compression='gzip', comment='#', sep='\t',
                     header=None)

    # Make mapping from keyword to column number
    # col#   Header
    # 0      Sequence-Name
    # 1      Sequence-Role
    # 2      Assigned-Molecule
    # 3      Assigned-Molecule-Location/Type
    # 4      GenBank-Accn
    # 5      Relationship
    # 6      RefSeq-Accn
    # 7      Assembly-Unit
    # 8      Sequence-Length
    # 9      UCSC-style-name
    mapping = {'FlyBase': 0, 'UCSC': 9, 'GenBank': 4, 'RefSeq': 6}

    # This table has a small error were FlyBase mitochondrion_genome is MT
    df.replace('MT', 'mitochondrion_genome', inplace=True)

    return {k: v for k, v in df[[mapping[f], mapping[t]]].values}

def pysam_convert(input, output, kind, mapper):
    """
    Use pysam to convert chromosomes in BAM and SAM files.

    pysam uses a header to define chromosomes, then each read is just mapped
    back to this header. Only the header needs to be modified, and reads
    need to be written to the new output file which uses this header.

    """
    # Determine SAM or BAM flags
    if kind == 'BAM':
        flag_in = 'rb'
        flag_out = 'wb'
    elif kind == 'SAM':
        flag_in = 'r'
        flag_out = 'wh'

    curr = pysam.AlignmentFile(input, flag_in)

    # Change chromosome in the header
    header = curr.header
    for chrom in header['SQ']:
        chrom['SN'] = mapper[chrom['SN']]

    with pysam.AlignmentFile(output, flag_out, header=header) as OUT:
        for read in curr:
            OUT.write(read)

def convertFeature(f, mapper):
    f.chrom = mapper[f.chrom]
    return f

def pybedtools_convert(input, output, mapper):
    """ Use pybedtools to convert chromosomes in BED, GTF, or GFF. """
    if input == '-':
        # Use STDIN
        bt = pybedtools.BedTool(sys.stdin)
    else:
        bt = pybedtools.BedTool(input)

    if output == '-':
        # Use STDOUT
        print(bt.each(convertFeature, mapper))
    else:
        bt.each(convertFeature, mapper).saveas(output)

def fasta_convert(input, output, mapper):
    """ Uses Biopython.SeqIO to convert FASTA headers. """

    if input == '-':
        # Use STDIN
        fh = sys.stdin
    elif input.endswith('.gz'):
        fh = gzip.open(input, 'rt')
    else:
        fh = open(input, 'r')

    if output == '-':
        # Use STDOUT
        oh = sys.stdout
    elif output.endswith('.gz'):
        oh = gzip.open(input, 'wb')
    else:
        oh = open(output, 'w')

    for seq in SeqIO.parse(fh, 'fasta'):
        seq.description = seq.description.replace(seq.id, mapper[seq.id])
        seq.name = mapper[seq.name]
        seq.id = mapper[seq.id]
        SeqIO.write(seq, oh, 'fasta')

    # close file handlers
    fh.close()
    oh.close()

def main():
    # Import commandline arguments.
    args = arguments()

    # Get mapping dict
    mapper = import_conversion(args.orig, args.new)

    if (args.type == 'BAM') | (args.type == 'SAM'):
        pysam_convert(args.input, args.output, args.type, mapper)
    elif (args.type == 'BED') | (args.type == 'GFF') | (args.type == 'GTF'):
        pybedtools_convert(args.input, args.output, mapper)
    elif (args.type == 'FASTA'):
        fasta_convert(args.input, args.output, mapper)


text:
<?php
/*
Template Name: Onestop Index Page
*/

use Timber as Timber;
use TimberMenu as TimberMenu;
use TimberPost as TimberPost;
use TimberLoader as TimberLoader;

$pageObj = new Biosciences\Base();

$menus = array('primary', 'footer_left', 'footer_center', 'footer_right');
$pageObj->find_menus($menus);

$pageObj->get_current_page();

$pageObj->render_page('onestop/index.twig');

redpajama_set_name: RedPajamaGithub


text:
if (process.env.NODE_ENV !== 'production') {
  (function() {
    const loadError = err => {
      throw new URIError(`The script ${err.target.src} is not accessible.`);
    };

    const importScript = (src, loadFunc) => {
      let debugElem = document.createElement('script');
      debugElem.type = 'text/javascript';
      debugElem.onerror = loadError;
      if (loadFunc) {
        debugElem.onload = loadFunc;
      }
      document.body.appendChild(debugElem);
      debugElem.src = src;
    };

    const loadStats = () => {
      let stats = new window.MemoryStats();

      stats.domElement.style.position = 'fixed';
      stats.domElement.style.right = '0px';
      stats.domElement.style.bottom = '0px';

      document.body.appendChild(stats.domElement);

      requestAnimationFrame(function rAFloop() {
        stats.update();
        requestAnimationFrame(rAFloop);
      });
    };

    importScript('/lib/debug.js', loadStats);
  }());
}


text:
from django.contrib import admin
from .models import Profile

class ProfileAdmin(admin.ModelAdmin):
    list_display = ['user', 'date_of_birth', 'photo']

admin.site.register(Profile, ProfileAdmin)


text:
import Articles, { getServerSideProps } from '@blog/client/web/components/articles';
export { getServerSideProps };
export default Articles;


text:
package test;

import org.testng.annotations.Test;

/**
 * This used to create a StackOverflowError.
 */
public class StaticTest {
  @Test
  public void test() {
  }

  @Test
  public static class InnerStaticClass extends StaticTest {
  }
}


text:
"""
BitBake 'Fetch' implementation for mercurial DRCS (hg).

"""

# Copyright (C) 2003, 2004  Chris Larson
# Copyright (C) 2004        Marcin Juszkiewicz
# Copyright (C) 2007        Robert Schuster
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig

import os
import sys
import logging
import bb
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
from bb.fetch2 import MissingParameterError
from bb.fetch2 import runfetchcmd
from bb.fetch2 import logger

class Hg(FetchMethod):
    """Class to fetch from mercurial repositories"""
    def supports(self, url, ud, d):
        """
        Check to see if a given url can be fetched with mercurial.
        """
        return ud.type in ['hg']

    def urldata_init(self, ud, d):
        """
        init hg specific variable within url data
        """
        if not "module" in ud.parm:
            raise MissingParameterError('module', ud.url)

        ud.module = ud.parm["module"]

        # Create paths to mercurial checkouts
        relpath = self._strip_leading_slashes(ud.path)
        ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
        ud.moddir = os.path.join(ud.pkgdir, ud.module)

        ud.setup_revisons(d)

        if 'rev' in ud.parm:
            ud.revision = ud.parm['rev']
        elif not ud.revision:
            ud.revision = self.latest_revision(ud.url, ud, d)

        ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)

    def need_update(self, url, ud, d):
        revTag = ud.parm.get('rev', 'tip')
        if revTag == "tip":
            return True
        if not os.path.exists(ud.localpath):
            return True
        return False

    def _buildhgcommand(self, ud, d, command):
        """
        Build up an hg commandline based on ud
        command is "fetch", "update", "info"
        """

        basecmd = data.expand('${FETCHCMD_hg}', d)

        proto = ud.parm.get('protocol', 'http')

        host = ud.host
        if proto == "file":
            host = "/"
            ud.host = "localhost"

        if not ud.user:
            hgroot = host + ud.path
        else:
            hgroot = ud.user + "@" + host + ud.path

        if command == "info":
            return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)

        options = [];

        # Don't specify revision for the fetch; clone the entire repo.
        # This avoids an issue if the specified revision is a tag, because
        # the tag actually exists in the specified revision + 1, so it won't
        # be available when used in any successive commands.
        if ud.revision and command != "fetch":
            options.append("-r %s" % ud.revision)

        if command == "fetch":
            cmd = "%s clone %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
        elif command == "pull":
            # do not pass options list; limiting pull to rev causes the local
            # repo not to contain it and immediately following "update" command
            # will crash
            cmd = "%s pull" % (basecmd)
        elif command == "update":
            cmd = "%s update -C %s" % (basecmd, " ".join(options))
        else:
            raise FetchError("Invalid hg command %s" % command, ud.url)

        return cmd

    def download(self, loc, ud, d):
        """Fetch url"""

        logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")

        if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
            updatecmd = self._buildhgcommand(ud, d, "pull")
            logger.info("Update " + loc)
            # update sources there
            os.chdir(ud.moddir)
            logger.debug(1, "Running %s", updatecmd)
            bb.fetch2.check_network_access(d, updatecmd, ud.url)
            runfetchcmd(updatecmd, d)

        else:
            fetchcmd = self._buildhgcommand(ud, d, "fetch")
            logger.info("Fetch " + loc)
            # check out sources there
            bb.utils.mkdirhier(ud.pkgdir)
            os.chdir(ud.pkgdir)
            logger.debug(1, "Running %s", fetchcmd)
            bb.fetch2.check_network_access(d, fetchcmd, ud.url)
            runfetchcmd(fetchcmd, d)

        # Even when we clone (fetch), we still need to update as hg's clone
        # won't checkout the specified revision if its on a branch
        updatecmd = self._buildhgcommand(ud, d, "update")
        os.chdir(ud.moddir)
        logger.debug(1, "Running %s", updatecmd)
        runfetchcmd(updatecmd, d)

        scmdata = ud.parm.get("scmdata", "")
        if scmdata == "keep":
            tar_flags = ""
        else:
            tar_flags = "--exclude '.hg' --exclude '.hgrags'"

        os.chdir(ud.pkgdir)
        runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.module), d, cleanup = [ud.localpath])

    def supports_srcrev(self):
        return True

    def _latest_revision(self, url, ud, d, name):
        """
        Compute tip revision for the url
        """
        bb.fetch2.check_network_access(d, self._buildhgcommand(ud, d, "info"))
        output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
        return output.strip()

    def _build_revision(self, url, ud, d, name):
        return ud.revision

    def _revision_key(self, url, ud, d, name):
        """
        Return a unique key for the url
        """
        return "hg:" + ud.moddir


text:
package org.apache.atlas.authorize.simple;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import org.apache.log4j.Logger;

public class FileReaderUtil {
    private static Logger LOG = Logger.getLogger(FileReaderUtil.class);
    private static boolean isDebugEnabled = LOG.isDebugEnabled();

    public static List<String> readFile(String path) throws IOException {
        if (isDebugEnabled) {
            LOG.debug("==> FileReaderUtil readFile");
        }
        List<String> list = new ArrayList<String>();
        LOG.info("reading the file" + path);
        List<String> fileLines = Files.readAllLines(Paths.get(path), Charset.forName("UTF-8"));
        if (fileLines != null) {
            for (String line : fileLines) {
                if ((!line.startsWith("#")) && Pattern.matches(".+;;.*;;.*;;.+", line))
                    list.add(line);
            }
        }

        if (isDebugEnabled) {
            LOG.debug("<== FileReaderUtil readFile");
            LOG.debug("Policies read :: " + list);
        }

        return list;
    }
}


text:
<?php

namespace Dataphant\Migrations\Sql;

/**
 * This interface provides methods for operating on the database schema.
 * One Schema manipulation is linked to one table.
 *
 */
interface SqlSchemaManipulationInterface
{

	/**
	 * Set fields to be dropped of the table.
	 *
	 * @param array $fields List of Property objects.
	 *
	 * @return void
	 */
	public function setColumnsToDrop($fields);

	/**
	 * Get the fields to be dropped of the table.
	 *
	 * @return array List of Property objets
	 */
	public function getColumnsToDrop();

	/**
	 * Set properties to be created in the table.
	 *
	 * @param array $fields List of Property objects.
	 *
	 * @return void
	 */
	public function setColumnsToCreate($fields);

	/**
	 * Get a list of fields to be created in the table.
	 *
	 * @return array List of Property objects
	 */
	public function getColumnsToCreate();

	/**
	 * Set the name the table should be renamed to.
	 *
	 * @param string $name The new name.
	 *
	 * @return void
	 */
	public function setTableName($name);

	/**
	 * Get the name the table should be renamed to.
	 * Returns NULL if the table should not be renamed.
	 *
	 * @return string the new name
	 */
	public function getNewTableName();

	/**
	 * Get the old table's name.
	 * Returns NULL if the table did not exist before.
	 *
	 * @return strings The old tables name.
	 */
	public function getOldTableName();

	/**
	 * Set the table to be dropped.
	 *
	 * @return void
	 */
	public function dropTable();

	/**
	 * Check if the table to be dropped.
	 *
	 * @return void
	 */
	public function isSetToDropTable();

	/**
	 * Get a new schema manipulation to undo the current one.
	 *
	 * @return void
	 */
	public function reverse();

}


text:
package istic.gla.groupb.nivimoju.drone.client;

import istic.gla.groupb.nivimoju.drone.latlong.LocalCoordinate;

/**
 * Container of infos about a single drone
 * contain the name and position of the drone
 */
public class DroneInfo {
    private String label;
    private LocalCoordinate position;

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public LocalCoordinate getPosition() {
        return position;
    }

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

    @Override
    public String toString() {
        return "DroneInfo{" +
                "label='" + label + '\'' +
                ", position=" + position +
                '}';
    }
}


text:
Before you can build this project, you must install and configure the following dependencies on your machine:

1. [Node.js][]: We use Node to run a development web server and build the project.
   Depending on your system, you can install Node either from source or as a pre-packaged bundle.
2. [Yarn][]: We use Yarn to manage Node dependencies.
   Depending on your system, you can install Yarn either from source or as a pre-packaged bundle.

After installing Node, you should be able to run the following command to install development tools.
You will only need to run this command when dependencies change in [package.json](package.json).

    yarn install

We use [Gulp][] as our build system. Install the Gulp command-line tool globally with:

    yarn global add gulp-cli

Run the following commands in two separate terminals to create a blissful development experience where your browser
auto-refreshes when files change on your hard drive.

    ./gradlew
    gulp

[Bower][] is used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in [bower.json](bower.json). You can also run `bower update` and `bower install` to manage dependencies.
Add the `-h` flag on any command to see how you can use it. For example, `bower update -h`.

## Building for production

To optimize the woodstock24 application for production, run:

    ./gradlew -Pprod clean bootRepackage

This will concatenate and minify the client CSS and JavaScript files. It will also modify `index.html` so it references these new files.
To ensure everything worked, run:

    java -jar build/libs/*.war

Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.

## Testing

To launch your application's tests, run:

    ./gradlew test

### Client tests

Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with:

    gulp test

For more information, refer to the [Running tests page][].

## Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services.
For example, to start a postgresql database in a docker container, run:

    docker-compose -f src/main/docker/postgresql.yml up -d

To stop it and remove the container, run:

    docker-compose -f src/main/docker/postgresql.yml down

You can also fully dockerize your application and all the services that it depends on.
To achieve this, first build a docker image of your app by running:

    ./gradlew bootRepackage -Pprod buildDocker

Then run:

    docker-compose -f src/main/docker/app.yml up -d


text:
var {
	GraphQLList,
	GraphQLObjectType,
	GraphQLString,
	GraphQLInt,
	GraphQLFloat
} = require('graphql');
var getField = require('../../../API/fbAPI').getField;
var getEdge = require('../../../API/fbAPI').getEdge;

const fbPageType = module.exports = new GraphQLObjectType({
	name:'fbPage',
	description: 'return a facebook page',
	fields: ()=>({
		/*-----------------------------------fields--------------------------*/
		id: 					{ type: GraphQLString },
		name: 					{ type: GraphQLString },
		about: 					{ type: GraphQLString,
									resolve: ({id}) => getField({id},'about')},
		affiliation: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'affiliation')},
		artists_we_like: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'artists_we_like')},
		attire: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'attire')},
		awards: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'awards')},
		band_interests: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'band_interests')},
		band_members: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'band_members')},
		bio:					{ type: GraphQLString,
									resolve: ({id}) => getField({id},'bio')},
		birthday: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'birthday')},
		booking_agent: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'booking_agent')},
		built: 					{ type: GraphQLString,
									resolve: ({id}) => getField({id},'built')},
		category:				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'category')},
		checkins: 				{ type: GraphQLInt,
									resolve: ({id}) => getField({id},'checkins')},
		culinary_team: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'culinary_team')},
		current_location: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'current_location')},
		description: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'description')},
		description_html: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'description_html')},
		directed_by: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'directed_by')},
		display_subtext: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'display_subtext')},
		emails: 				{ type: new GraphQLList(GraphQLString),
									resolve: ({id}) => getField({id},'emails')},
		features: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'features')},
		food_styles: 			{ type: new GraphQLList(GraphQLString),
									resolve: ({id}) => getField({id},'food_styles')},
		founded: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'founded')},
		general_info: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'general_info')},
		general_manager: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'general_manager')},
		genre: 					{ type: GraphQLString,
									resolve: ({id}) => getField({id},'genre')},
		hometown: 				{ type: GraphQLString ,
									resolve: ({id}) => getField({id},'hometown')},
		influences: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'influences')},
		link: 					{ type: GraphQLString,
									resolve: ({id}) => getField({id},'link')},
		location: 				{ type: fbLocationType,
									resolve: ({id}) => getField({id},'location')},
		members: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'members')},
		mission: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'mission')},
		company_overview: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'company_overview')},
		network: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'network')},
		overall_star_rating: 	{ type: GraphQLFloat,
									resolve: ({id}) => getField({id},'overall_star_rating')},
		personal_info: 			{ type: GraphQLString ,
									resolve: ({id}) => getField({id},'personal_info')},
		personal_interests: 	{ type: GraphQLString,
									resolve: ({id}) => getField({id},'personal_interests')},
		pharma_safety_info: 	{ type: GraphQLString,
									resolve: ({id}) => getField({id},'pharma_safety_info')},
		phone: 					{ type: GraphQLString,
									resolve: ({id}) => getField({id},'phone')},
		plot_outline: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'plot_outline')},
		press_contact: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'press_contact')},
		price_range: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'price_range')},
		produced_by: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'produced_by')},
		products: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'products')},
		public_transit: 		{ type: GraphQLString,
									resolve: ({id}) => getField({id},'public_transit')},
		rating_count: 			{ type: GraphQLInt,
									resolve: ({id}) => getField({id},'rating_count')},
		record_label: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'record_label')},
		release_date: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'release_date')},
		schedule: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'schedule')},
		screenplay_by: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'screenplay_by')},
		season: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'season')},
		single_line_address: 	{ type: GraphQLString,
									resolve: ({id}) => getField({id},'single_line_address')},
		starring: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'starring')},
		store_number: 			{ type: GraphQLInt,
									resolve: ({id}) => getField({id},'store_number')},
		studio: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'studio')},
		talking_about_count: 	{ type: GraphQLInt,
									resolve: ({id}) => getField({id},'talking_about_count')},
		username: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'username')},
		website: 				{ type: GraphQLString,
									resolve: ({id}) => getField({id},'website')},
		written_by: 			{ type: GraphQLString,
									resolve: ({id}) => getField({id},'written_by')},

		best_page:				{ type: fbPageType,
									resolve: ({id}) => getField({id},'best_page')},
		category_list: 			{ type: new GraphQLList(fbPageCategoryType),
									resolve: ({id}) => getField({id},'category_list')},
		contact_address: 		{ type: fbMailingAddressType,
									resolve: ({id}) => getField({id},'contact_address')},
		cover:					{ type: fbCoverPhotoType,
									resolve: ({id}) => getField({id},'cover')},
		parent_page: 			{ type: fbPageType,
									resolve: ({id}) => getField({id},'parent_page')},
		restaurant_services: 	{ type: fbPageRestaurantServicesType,
									resolve: ({id}) => getField({id},'restaurant_services')},
		restaurant_specialties: { type: fbPageRestaurantSpecialtiesType,
									resolve: ({id}) => getField({id},'restaurant_specialties')},

		/*---------------------------------edges----------------------*/
		albums:					{ type: new GraphQLList(fbAlbumType),
									resolve: ({id}) => getEdge({id},'albums')},
		photos:					{ type: new GraphQLList(fbPhotoType),
									resolve: ({id}) => getEdge({id},'photos')},
		events:					{ type: new GraphQLList(fbEventType),
									resolve: ({id}) => getEdge({id},'events')},
		locations:				{ type: new GraphQLList(fbLocationType),
									resolve: ({id}) => getEdge({id},'locations')},
		likes:					{ type: new GraphQLList(fbLikeType),
									resolve: ({id}) => getEdge({id},'likes')},
		videos:					{ type: new GraphQLList(fbVideoType),
									resolve: ({id}) => getEdge({id},'videos')},
		feed:					{ type: new GraphQLList(fbPostType),
									resolve: ({id}) => getEdge({id},'feed')},
		picture:				{ type: fbProfilePictureType,
									resolve: ({id}) => getEdge({id},'picture')},
		tagged:					{ type: new GraphQLList(fbPostType),
									resolve: ({id}) => getEdge({id},'tagged')}
	})
});

const fbPageCategoryType = new GraphQLObjectType({
	name:'fbPageCategory',
	description:'The Page\'s sub-categories',
	fields: ()=>({
		id: 	{ type: GraphQLString },
		name: 	{ type: GraphQLString }
	})
})

const fbMailingAddressType = new GraphQLObjectType({
	name: 'fbMailingAddress',
	description: 'The mailing or contact address for this page. This field will be blank if the contact address is the same as the physical address',
	fields: ()=>({
		id: 	{ type: GraphQLString },
		city:	{ type: GraphQLString },
		city_page:	{type: fbPageType },
		country: 	{ type: GraphQLString },
		postal_code:{ type: GraphQLString },
		region:		{ type: GraphQLString },
		street1:	{ type: GraphQLString },
		street2:	{ type: GraphQLString }
	})
});

const fbPageRestaurantServicesType = new GraphQLObjectType({
	name: 'fbPageRestaurantServices',
	description: '',
	fields: ()=>({
		catering: 	{ type:GraphQLInt },
		delivery: 	{ type:GraphQLInt },
		groups: 	{ type:GraphQLInt },
		kids: 		{ type:GraphQLInt },
		outdoor: 	{ type:GraphQLInt },
		pickup: 	{ type:GraphQLInt },
		reserve: 	{ type:GraphQLInt },
		takeout: 	{ type:GraphQLInt },
		waiter:		{ type:GraphQLInt },
		walkins:	{ type:GraphQLInt }
	})
});

const fbPageRestaurantSpecialtiesType = new GraphQLObjectType({
	name: 'fbPageRestaurantSpecialties',
	description: '',
	fields: ()=>({
		breakfast: 	{ type:GraphQLInt },
		coffee: { type:GraphQLInt },
		dinner: { type:GraphQLInt },
		drinks: { type:GraphQLInt },
		lunch: 	{ type:GraphQLInt }
	})
});

const fbCoverPhotoType = require('./fbCoverPhotoType');
const fbUserType = require('./fbUserType');
const fbAlbumType = require('./fbAlbumType');
const fbPhotoType = require('./fbPhotoType');
const fbEventType = require('./fbEventType');
const fbLocationType = require('./fbLocationType');
const fbPostType = require('./fbPostType');
const fbLikeType = require('./fbLikeType');
const fbVideoType = require('./fbVideoType');
const fbProfilePictureType = require('./fbProfilePicType');


text:
package org.nd4j.linalg.cpu.nativecpu;

import com.google.flatbuffers.FlatBufferBuilder;
import lombok.extern.slf4j.Slf4j;
import org.nd4j.linalg.api.blas.params.MMulTranspose;
import org.nd4j.linalg.api.buffer.DataBuffer;
import org.nd4j.linalg.api.ndarray.*;

/**
 * @author Audrey Loeffel
 */
@Slf4j
public class SparseNDArrayCSR extends BaseSparseNDArrayCSR {

/**
 *
 *
 * The length of the values and columns arrays is equal to the number of non-zero elements in A.
 * The length of the pointerB and pointerE arrays is equal to the number of rows in A.
 * @param data a double array that contains the non-zero element of the sparse matrix A
 * @param columns Element i of the integer array columns is the number of the column in A that contains the i-th value
 *                in the values array.
 * @param pointerB Element j of this integer array gives the index of the element in the values array that is first
 *                 non-zero element in a row j of A. Note that this index is equal to pointerB(j) - pointerB(1)+1 .
 * @param pointerE An integer array that contains row indices, such that pointerE(j)-pointerB(1) is the index of the
 *                 element in the values array that is last non-zero element in a row j of A.
 * @param shape Shape of the matrix A
*/
    public SparseNDArrayCSR(double[] data, int[] columns, int[] pointerB, int[] pointerE, int[] shape) {

        super(data, columns, pointerB, pointerE, shape);
    }
    public SparseNDArrayCSR(float[] data, int[] columns, int[] pointerB, int[] pointerE, int[] shape) {

        super(data, columns, pointerB, pointerE, shape);
    }

    public SparseNDArrayCSR(DataBuffer data, int[] columns, int[] pointerB, int[] pointerE, int[] shape) {

        super(data, columns, pointerB, pointerE, shape);
    }

    @Override
    public INDArray repeat(int dimension, long... repeats) {
        return null;
    }

    @Override
    public INDArray mmul(INDArray other, MMulTranspose mMulTranspose) {
        return null;
    }

    /**
     * Perform an copy matrix multiplication
     *
     * @param other         the other matrix to perform matrix multiply with
     * @param result        the result ndarray
     * @param mMulTranspose the transpose status of each array
     * @return the result of the matrix multiplication
     */
    @Override
    public INDArray mmul(INDArray other, INDArray result, MMulTranspose mMulTranspose) {
        return null;
    }

    @Override
    public INDArray mmuli(INDArray other, MMulTranspose transpose) {
        return null;
    }

    @Override
    public INDArray mmuli(INDArray other, INDArray result, MMulTranspose transpose) {
        return null;
    }

    @Override
    public INDArray reshape(char order, int... newShape) {
        return null;
    }

    @Override
    public INDArray reshape(int[] shape) {
        return null;
    }

    @Override
    public int toFlatArray(FlatBufferBuilder builder) {
        throw new UnsupportedOperationException();
    }

    @Override
    public INDArray convertToFloats() {
        return null;
    }

    @Override
    public INDArray convertToDoubles() {
        return null;
    }
}


text:
/*
  Youtube Player with Playlist (v2.22)
  https://github.com/carloscabo/responsive-youtube-player-with-playlist
  by Carlos Cabo (@putuko)
*/

var RYPP = (function($, undefined) {
  'use strict';

  function Rypp(el, api_key, options) {

    if (typeof api_key === 'undefined') {
      console.log("Youtube API V3 requires a valid API KEY.\nFollow the instructions at: https://developers.google.com/youtube/v3/getting-started");
      return false;
    }

    // DOM Elements container
    this.DOM = {};

    // Default settings container
    this.options = {};

    // Data / urls
    this.data = {
      // Playlist url
      ytapi: {
        playlist_info: 'https://www.googleapis.com/youtube/v3/playlists?part=snippet&id={{RESOURCES_ID}}&key={{YOUR_API_KEY}}',
        playlist: 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId={{RESOURCES_ID}}&key={{YOUR_API_KEY}}',
        pl_ID: '',
        videolist: 'https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,status&maxResults=50&id={{RESOURCES_ID}}&key={{YOUR_API_KEY}}',
      },
      temp_vl: [], // Temporary videolist
      firsttime: true,
      ismobile: (typeof window.orientation !== 'undefined'),
      ispopulated: false
    };

    // Initialize
    this.init(el, api_key, options);
  }

  // Prototype for the instance
  Rypp.prototype = {

    init: function(el, api_key, options) {

      // Api key
      this.api_key = api_key;

      // Default options
      this.options = {
        update_title_desc: false,
        autoplay: true,
        autonext: true,
        loop: true,
        mute: false,
        playable_region: false,
        debug: false
      };

      // Merge initial options
      if (typeof options !== 'undefined') {
        $.extend(this.options, options);
      }

      // DOM elements
      this.DOM = {};
      this.DOM.$el = $(el);
      this.DOM.$playlc = this.DOM.$el.find('.RYPP-playlist');
      this.DOM.$items =  this.DOM.$el.find('.RYPP-items');
      this.DOM.$videoc = this.DOM.$el.find('.RYPP-video');
      this.DOM.$title  = this.DOM.$el.find('.RYPP-title');
      this.DOM.$desc   = this.DOM.$el.find('.RYPP-desc');

      // YT Player object
      this.DOM.$el[0].ytplayer = null;

      // Unique player ID
      this.data.player_uid = (Math.random().toString(16).substr(2,8));
      this.DOM.$el.attr('data-rypp',this.data.player_uid).find('.RYPP-video-player').attr('id','RYPP-vp-'+this.data.player_uid).attr('name','RYPP-vp-'+this.data.player_uid);
      if (this.options.debug) console.log('Unique ID: RYPP-vp-'+this.data.player_uid);

      // Link JS only once
      if (typeof window.YT === 'undefined') {
        var
          tag = document.createElement('script'),
          hID = document.getElementsByTagName('head')[0];
        // Add youtube API in HEAD
        // tag.src = "https://www.youtube.com/iframe_api";
        tag.src = 'https://www.youtube.com/iframe_api?version=3';
        hID.appendChild(tag);
      } else {
        this.addAPIPlayer();
      }

    },

    onYTIframeAPIReadyCallback: function() {
      this.addAPIPlayer();
    },

    updateTitleDesc: function() {
      var
        that = this,
        resources_id = this.DOM.$el.attr('data-playlist'),
        url  = this.data.ytapi.playlist_info.replace('{{RESOURCES_ID}}', resources_id).replace('{{YOUR_API_KEY}}', this.api_key);

      $.ajaxSetup ({cache: false});
      $.ajax(url, {
        context: this,
        dataType: 'json',
        crossDomain: true,
        error: function(){
          // Not successful
        },
        success: function(data){
          // console.log(data);
          this.DOM.$title.html( data.items[0].snippet.title );
          this.DOM.$desc.html( data.items[0].snippet.description );
        }
      });
    },

    populatePlaylist: function() {

      if( this.options.update_title_desc ) {
        if (this.options.debug) console.log(this.data.player_uid+': Updating playlist title / desc');
        this.updateTitleDesc();
      }

      // Empty playlist
      if (this.options.debug) console.log(this.data.player_uid+': Populating playlist');
      this.DOM.$items.html('').append($('
'));

      // Now we read the video list from playlist data or from IDs...
      if (this.DOM.$el.attr('data-playlist')) {
        this.data.pl_ID = this.DOM.$el.attr('data-playlist');
        this.getVideosFrom(
          'playlist',
          this.data.pl_ID
        );
      } else if (this.DOM.$el.attr('data-ids')) {
        var vl = this.DOM.$el.attr('data-ids');
        // Clean spaces
        vl = ($.map(vl.split(','),$.trim)).join(',');
        this.getVideosFrom(
          'videolist',
          vl
        );
      }
    },

    addAPIPlayer: function() {
      var that = this;

      window.YTConfig = { 'host': 'https://www.youtube.com' };
      this.DOM.$el[0].ytplayer = new YT.Player('RYPP-vp-'+that.data.player_uid, {
        // height: '390',
        // width: '640',
        playerVars: {
          // controls: 0,
          // showinfo: 0 ,
          // autoplay: 0,
          // html5: 1,
          enablejsapi: 1,
          rel: 0,
          modestbranding: 1,
          wmode: 'transparent'
        },
        events: {
          'onReady': function(){
            if (that.options.debug)console.log(that.data.player_uid+': ytplayer ready');
            that.onPlayerReady();
          },
          'onStateChange': function(e){
            that.onPlayerStateChange(e);
          },
          'onError': function(e) {
            console.log(e);
          }
        }
      });
    },

    // Ready to play
    onPlayerReady: function() {
      if (this.options.debug) console.log(this.data.player_uid+': ytplayer ready callback');
      this.populatePlaylist();
      // this.startPlayList();
    },

    // When video finish
    onPlayerStateChange: function(e){
      var
        that = this;

      if (typeof e !== 'undefined') {

        // On video loaded?
        if(e.data === -1 && this.data.firsttime) {
          if(!this.options.autoplay && !this.data.ismobile) { // Is desktop
            this.DOM.$el[0].ytplayer.stopVideo();
            this.data.firsttime = false;
          }
          if(this.options.mute) {
            this.DOM.$el[0].ytplayer.mute();
          }
        }

        // If mobile and stored in buffer we STOP the video in mobile devices
        if(e.data === 3 && this.data.ismobile && this.data.firsttime) {
          setTimeout(function(){
            that.DOM.$el[0].ytplayer.stopVideo();
            that.data.firsttime = false;
          }, 500);
        }

        // Play next only if not mobile
        var next = null;
        if(e.data === 0 && !this.data.ismobile && this.options.autonext) {
          next = this.DOM.$items.find('li.selected').next();
          if (next.length === 0 && this.options.loop) {
            next = this.DOM.$items.find('li').first();
          }
          next.trigger('click');
        }

      }

    },

    // Get video from data-ids or playlist
    // It's impossible to know if a video in a playlist its available or currently deleted. So we do 2 request, first we get all the video IDs an then we ask for info about them.
    getVideosFrom: function(kind, resources_id, page_token) {
      var
        that = this,
        url  = this.data.ytapi[kind].replace('{{RESOURCES_ID}}', resources_id).replace('{{YOUR_API_KEY}}', this.api_key);

      if (typeof page_token !== 'undefined') {
        url += '&pageToken=' + page_token;
      }

      $.ajaxSetup ({cache: false});
      $.ajax(url, {
        context: this,
        dataType: 'json',
        crossDomain: true,
        error: function(){
          // Not successful
        },
        success: function(data){

          // We queried for a playlist
          if (data.kind === 'youtube#playlistItemListResponse') {

            var video_set = [];

            // We get the video IDs and query gain, its the only way to be sure that all the videos are available, and not were deleted :(
            $.map(data.items, function(val,idx) {
              if (typeof val.snippet.resourceId.videoId !== 'undefined') {
                // Add video to temporary list
                video_set.push( val.snippet.resourceId.videoId );
                // return val.snippet.resourceId.videoId;
              }
            });
            that.data.temp_vl.push( video_set );

            // If there are several pages we ask for next
            if (typeof data.nextPageToken !== 'undefined' && data.nextPageToken !== '') {
              that.getVideosFrom(
                'playlist',
                that.data.pl_ID,
                data.nextPageToken
              );
            } else {
              // No more pages... we process the videos
              for (var j = 0, len_pl = that.data.temp_vl.length; j < len_pl; j++) {
                video_set = that.data.temp_vl.shift();
                that.getVideosFrom('videolist', video_set.join(','));
              }
            }

          } else if (data.kind === 'youtube#videoListResponse') {

            // Videos from  Videolist
            for (var i = 0, len = data.items.length; i < len; i++) {
              var item = data.items[i];

              // Videos without thumbnail, deleted or rejected are not included in the player!
              if (
                $.inArray(item.status.uploadStatus, ['rejected', 'deleted', 'failed']) === -1 &&
                typeof item.snippet.thumbnails !== 'undefined'
              ) {
                // Videos disallowed by regionRestrictions are not included in the player
                if ( typeof this.options.playable_region === false ||
                  ( typeof item.contentDetails.regionRestriction !== 'undefined' &&
                    (
                      (
                        // The specified playable_region is allowed
                        typeof item.contentDetails.regionRestriction.allowed !== 'undefined' &&
                        $.inArray(this.options.playable_region, item.contentDetails.regionRestriction.allowed)
                      ) || (
                        // The specified playable_region is not blocked
                        typeof item.contentDetails.regionRestriction.blocked !== 'undefined' &&
                        $.inArray(this.options.playable_region, item.contentDetails.regionRestriction.blocked) === -1
                      )
                    )
                  )
                ) {
                    var
                      vid = item.id,
                      tit = item.snippet.title,
                      aut = item.snippet.channelTitle,
                      thu = item.snippet.thumbnails.default.url;
                    that.addVideo2Playlist(vid, tit, aut, thu);
                }
              }
              if ( $.isEmptyObject( that.data.temp_vl ) ) {
                this.startPlayList();
              }
            }
          }
        }
      });
    },

    // All videos are supossed to be loaded
    // lets start the playlist
    startPlayList: function() {

      var
        D = this.DOM,
        vid = null,
        that = this;

      // Click on playlist elemnts
      D.$items.on('click', 'li', function(e) {
        e.preventDefault();
        D.$items.find('li').removeClass('selected');
        $(this).addClass('selected');
        vid = $(this).data('video-id');
        // Call YT API function
        that.DOM.$el[0].ytplayer.loadVideoById(vid);
        // If we are in mobile we must stop
        if (that.data.ismobile) {
          that.data.firsttime = true;
        }
      });

      // Select first if none
      if (D.$items.find('li.selected').length === 0) {
        if ( this.options.autoplay ) {
          D.$items.find('li').first().click();
        }
      }
    },

    // Add video block to playlist
    addVideo2Playlist: function(vid, tit, aut, thu) {
      var
        D  = this.DOM;
      $('

'+tit+'
'+aut+'

').appendTo(D.$items.find('ol'));
    },

  }; // prototypes

  return Rypp;

}(jQuery));

// YOUTUBE API CALLBACK
function onYouTubeIframeAPIReady() {
  // console.log( 'Youtube API script loaded. Start players.' );
  $('[data-rypp]').each(function(idx, el) {
    $(el)[0].rypp_data_obj.onYTIframeAPIReadyCallback();
  });
}

// JQuery hook
$.fn.rypp = function(api_key, options) {
  return this.each(function() {
    // Store object in DOM element
    this.rypp_data_obj = new RYPP(this, api_key, options);
  });
};


text:
package ticketline.dao.interfaces;

import ticketline.db.Bestellung;
import ticketline.db.BestellungKey;

/**
 * @author geezmo
 */
public interface BestellungDAO extends DAO {

	/**
	 * @param bestellungKey
	 * @return Bestellung
	 * @throws RuntimeException
	 */
	public Bestellung get(BestellungKey bestellungKey) throws RuntimeException;

	/**
	 * saves or updates the bestellung.
	 */
	public void save(Bestellung bestellung) throws RuntimeException;

	/**
	 * deletes the bestellung.
	 *
	 * @param bestellung
	 * @throws RuntimeException
	 */
	public void remove(Bestellung bestellung) throws RuntimeException;
}


text:
<?php

namespace Acme\ChampionatBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\ChampionatBundle\Entity\Joueur;
use Acme\ChampionatBundle\Form\JoueurType;

/**
 * Joueur controller.
 *
 * @Route("/joueur")
 */
class JoueurController extends Controller
{

    /**
     * Lists all Joueur entities.
     *
     * @Route("/", name="joueur")
     * @Method("GET")
     * @Template()
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('AcmeChampionatBundle:Joueur')->findAll();

        return array(
            'entities' => $entities,
        );
    }
    /**
     * Creates a new Joueur entity.
     *
     * @Route("/", name="joueur_create")
     * @Method("POST")
     * @Template("AcmeChampionatBundle:Joueur:new.html.twig")
     */
    public function createAction(Request $request)
    {
        $entity = new Joueur();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('joueur_show', array('id' => $entity->getId())));
        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Creates a form to create a Joueur entity.
     *
     * @param Joueur $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(Joueur $entity)
    {
        $form = $this->createForm(new JoueurType(), $entity, array(
            'action' => $this->generateUrl('joueur_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }

    /**
     * Displays a form to create a new Joueur entity.
     *
     * @Route("/new", name="joueur_new")
     * @Method("GET")
     * @Template()
     */
    public function newAction()
    {
        $entity = new Joueur();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Finds and displays a Joueur entity.
     *
     * @Route("/{id}", name="joueur_show")
     * @Method("GET")
     * @Template()
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AcmeChampionatBundle:Joueur')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Joueur entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Displays a form to edit an existing Joueur entity.
     *
     * @Route("/{id}/edit", name="joueur_edit")
     * @Method("GET")
     * @Template()
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AcmeChampionatBundle:Joueur')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Joueur entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
    * Creates a form to edit a Joueur entity.
    *
    * @param Joueur $entity The entity
    *
    * @return \Symfony\Component\Form\Form The form
    */
    private function createEditForm(Joueur $entity)
    {
        $form = $this->createForm(new JoueurType(), $entity, array(
            'action' => $this->generateUrl('joueur_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
    /**
     * Edits an existing Joueur entity.
     *
     * @Route("/{id}", name="joueur_update")
     * @Method("PUT")
     * @Template("AcmeChampionatBundle:Joueur:edit.html.twig")
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AcmeChampionatBundle:Joueur')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Joueur entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            return $this->redirect($this->generateUrl('joueur_edit', array('id' => $id)));
        }

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
    /**
     * Deletes a Joueur entity.
     *
     * @Route("/{id}", name="joueur_delete")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('AcmeChampionatBundle:Joueur')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Joueur entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('joueur'));
    }

    /**
     * Creates a form to delete a Joueur entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('joueur_delete', array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', 'submit', array('label' => 'Delete'))
            ->getForm()
        ;
    }
}


text:
package com.skf.mokao.dao;

import com.skf.mokao.pojo.Proxyips;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProxyipsMapper {

    //随机选取一个代理
    @Select("SELECT * FROM proxyips " +
            " AS t1 JOIN (SELECT ROUND(RAND() * (SELECT MAX(id) FROM proxyips)) AS id) AS t2"+
            " WHERE t1.Flag='M' AND t1.Score>0 AND t1.IsAvailable=1 AND t1.Id >= t2.id LIMIT 1")
    @ResultType(Proxyips.class)
    Proxyips selectByRandom();

    @Select("SELECT * FROM proxyips ORDER BY proxyips.Score DESC,proxyips.Speed ASC")
    List<Proxyips> selectAll();

    @Select(" select * from proxyips where Id = #{id,jdbcType=INTEGER}")
    @ResultType(Proxyips.class)
    Proxyips selectById(int id);

    //查询可用记录数
    @Select("select count(*) from proxyips where Flag='M' AND Score>0 AND IsAvailable=1")
    @ResultType(Integer.class)
    Integer selectCount();

    @Insert("insert into proxyips (IP, Port, Types, \n" +
            "      Protocol, Country, Area, \n" +
            "      IsAvailable, Speed, Score, \n" +
            "      Flag, CreatorId, CreateTime, \n" +
            "      CreateIP, UpdateTime, UpdateIP\n" +
            "      )\n" +
            "    values (#{ip,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}, #{types,jdbcType=INTEGER}, \n" +
            "      #{protocol,jdbcType=INTEGER}, #{country,jdbcType=INTEGER}, #{area,jdbcType=VARCHAR}, \n" +
            "      #{isavailable,jdbcType=INTEGER}, #{speed,jdbcType=INTEGER}, #{score,jdbcType=INTEGER}, \n" +
            "      #{flag,jdbcType=VARCHAR}, #{creatorid,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, \n" +
            "      #{createip,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{updateip,jdbcType=VARCHAR}\n" +
            "      )")
    int insert(Proxyips proxyips);

    @Update("update proxyips " +
            "    set IP = #{ip,jdbcType=VARCHAR},\n" +
            "      Port = #{port,jdbcType=VARCHAR},\n" +
            "      Types = #{types,jdbcType=INTEGER},\n" +
            "      Protocol = #{protocol,jdbcType=INTEGER},\n" +
            "      Country = #{country,jdbcType=INTEGER},\n" +
            "      Area = #{area,jdbcType=VARCHAR},\n" +
            "      IsAvailable = #{isavailable,jdbcType=INTEGER},\n" +
            "      Speed = #{speed,jdbcType=INTEGER},\n" +
            "      Score = #{score,jdbcType=INTEGER},\n" +
            "      Flag = #{flag,jdbcType=VARCHAR},\n" +
            "      CreatorId = #{creatorid,jdbcType=INTEGER},\n" +
            "      CreateTime = #{createtime,jdbcType=TIMESTAMP},\n" +
            "      CreateIP = #{createip,jdbcType=VARCHAR},\n" +
            "      UpdateTime = #{updatetime,jdbcType=TIMESTAMP},\n" +
            "      UpdateIP = #{updateip,jdbcType=VARCHAR}\n" +
            "    where Id = #{id,jdbcType=INTEGER}")
    int update(Proxyips proxyips);

    @Delete("update proxyips \n" +
            "    set Flag='D'\n"+
            "    where Id = #{id,jdbcType=INTEGER}")

    int deleteById(int id);
}


text:
import React from 'react'
import ReactDOM from 'react-dom'

class World extends React.Component {
  render() {
    return (

world

      )
  }
}
ReactDOM.render(<World />, document.getElementById('world'))


text:
HashMap = function() {
    HashMap.prototype.keys = new Array();
    HashMap.prototype.values = new Array();
}
/* HashMap get function */
HashMap.prototype.get = function(key) {
    for (var index=0; index < this.keys.length; index++) {
        if (key==this.keys[index]) {
            return(this.values[index]);
        }
    }
    return(null);
}

/* HashMap put function */
HashMap.prototype.put = function(key, value){
    this.keys[this.keys.length] = key;
    this.values[this.values.length] = value;
}
/* HashMap containsKey function */
HashMap.prototype.containsKey= function(key){
    for (var index=0; index < this.keys.length; index++){
        if (key==this.keys[index]){
            return(true);
        }
    }
    return(false);
}
/* HashMap debug function */
HashMap.prototype.debug = function(){
    var debug = "";
    for (var index=0; index < this.keys.length; index++){
        var key = this.keys[index];
        var value = this.values[index];
        debug+=key + "->" + value + "\n";
    }
    return(debug);
}
/* HashMap size function */
HashMap.prototype.size = function(){
    return(this.keys.length);
}
/* HashMap containsKey function */
HashMap.prototype.containsValue= function(values){
    for (var index=0; index < this.values.length; index++){
        if (values==this.values[index]){
            return(true);
        }
    }
    return(false);
}


text:
<?php

namespace Eulogix\Cool\Lib\DataSource;

use Eulogix\Cool\Lib\Cool;

/**
 * @author Pietro Baricco <pietro@eulogix.com>
 */

class DataSourceManager {

    /**
     * this method maps an Id, or a string, to a datasource instance.
     *
     * @param string $id
     * @throws \Exception
     * @return DataSourceInterface
     */
    public function getDataSource($id) {

        $container = Cool::getInstance()->getContainer();
        $serviceName = "ds.$id";

        if($container->has($serviceName)) {
            $serviceObj = $container->get($serviceName);
            if($serviceObj instanceof DataSourceInterface)
                return $serviceObj;
            throw new \Exception("service $serviceName does not implement DataSourceInterface");
        }

        if(class_exists($id)) {
            $ds = new $id();
            if($ds instanceof DataSourceInterface)
                return $ds;
            else throw new \Exception("namespace $id does not implement DataSourceInterface");
        }

        throw new \Exception("DataSource $id not registered");
    }

}


text:
<?xml version="1.0" encoding="utf-8" ?>
<authors>
  <author name="Ludwig" surname="Wittgenstein">
    <book title="Tractatus Logico-Philosophicus" />
    <book title="Philosophical Investigations" />
    <manuscript title="Notes on Logic" />
  </author>
  <author name="Rene" surname="Descartes" birth="1596">
    <book title="Discourse on Method and the Meditations" />
    <book title="Meditations and Other Metaphysical Writings" />
  </author>
</authors>


text:
**Please note: this extension is currently in beta. Any feedback is greatly appreciated**

Ever been in a situation where you had a section where one entry only needs one textarea, but another needs three or four?
Don't want to create a bunch of textareas where not every one is going to be used?
Meet Tabbed Textarea!

## Features: ##

* Create pre-defined tabs
* Allow authors to create tabs or only let developers create them
* Create plain textareas or use a textformatter (currently, only CKEditor is tested / supported).


text:
namespace content {

// Interface that all users of ChildProcessHost need to provide.
class ChildProcessHostDelegate : public IPC::Listener {
 public:
  virtual ~ChildProcessHostDelegate() {}

  // Delegates return true if it's ok to shut down the child process (which is
  // the default return value). The exception is if the host is in the middle of
  // sending a request to the process, in which case the other side might think
  // it's ok to shutdown, when really it's not.
  CONTENT_EXPORT virtual bool CanShutdown();

  // Called when the child process unexpected closes the IPC channel. Delegates
  // would normally delete the object in this case.
  virtual void OnChildDisconnected() {}

  // Returns the handle of the child process. This can be called only after
  // OnProcessLaunched is called or it will be invalid and may crash.
  virtual base::ProcessHandle GetHandle() const = 0;
};

};  // namespace content

#endif  // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_DELEGATE_H_


text:
OC_NS_BG;

class IndexBuffer
{
public:
    IndexBuffer();

    void Initialize(ID3D11Device* device, const uint32* indices, uint64 numIndices);
    void Initialize(ID3D11Device* device, const std::vector<uint32> indices);

    operator ID3D11Buffer* () { return m_buffer.Get(); }

private:
    ComPtr<ID3D11Buffer> m_buffer;
};

OC_NS_END;


text:
<?php

declare(strict_types=1);

namespace Latitude\QueryBuilder\Builder;

use Latitude\QueryBuilder\CriteriaInterface;
use Latitude\QueryBuilder\Partial\LikeBegins;
use Latitude\QueryBuilder\Partial\LikeContains;
use Latitude\QueryBuilder\Partial\LikeEnds;
use Latitude\QueryBuilder\StatementInterface;

use function Latitude\QueryBuilder\criteria;

class LikeBuilder
{
    private StatementInterface $statement;

    public function __construct(StatementInterface $statement)
    {
        $this->statement = $statement;
    }

    public function begins(string $value): CriteriaInterface
    {
        return $this->like(new LikeBegins($value));
    }

    public function notBegins(string $value): CriteriaInterface
    {
        return $this->notLike(new LikeBegins($value));
    }

    public function contains(string $value): CriteriaInterface
    {
        return $this->like(new LikeContains($value));
    }

    public function notContains(string $value): CriteriaInterface
    {
        return $this->notLike(new LikeContains($value));
    }

    public function ends(string $value): CriteriaInterface
    {
        return $this->like(new LikeEnds($value));
    }

    public function notEnds(string $value): CriteriaInterface
    {
        return $this->notLike(new LikeEnds($value));
    }

    protected function like(StatementInterface $value): CriteriaInterface
    {
        return criteria('%s LIKE %s', $this->statement, $value);
    }

    protected function notLike(StatementInterface $value): CriteriaInterface
    {
        return criteria('%s NOT LIKE %s', $this->statement, $value);
    }
}


text:
import json
import sys
from scapy.all import *

def summary(packet):
    summary_str = str(packet)
    paramList = summary_str.split(' ')
    summaryMap = {}
    for i in paramList:
        if 'TCP' in i:
            tmp = i.split(':')
            summaryMap.get(tmp[0], )

if __name__ == "__main__":
    # sys.argv[0] is a name of python code
    input_timeout = sys.argv[1]
    packet = sniff(timeout = int(input_timeout))


text:
<?php
/**
 * Creator: Ivo Stefanov
 * Date: 16.12.2015 г.
 * Type:
 */
namespace Blog\Domain\Common;

interface Identical {
	/**
	 * Returns true if the given object is equal to the one invoked on
	 * @param $object mixed the compared object
	 * @return boolean
	 */
	public function equals($object);
}


text:
This module is not released or complete and should not be used until this message isn't here. It will be available via GitHub and NPM when it reaches v1.0.0 release status.

# FedEx Cross Border API

This node module acts as a wrapper for the FedEx Cross Border API, allowing your node applications to consume v4.4 of the SOAP API and perform tasks for fulfilling international shipping for FedEx Cross Border customers.

It features client that functions with traditional node style callbacks, and client that uses ECMA 6 style promises. All of the Connect API methods are supported as of release v1.0.0, and details (as well as where objects differ in structure from official FECB docs) are listed below.

## Purpose

Traditionally, FECB is integrated entirely on the ecommerce platform it is supporting as a fulfillment method. If your cart platform is running on node already, great! This software will provide a quick integration for you.

However, most common ecommerce platforms run on PHP, .net, or Java. Leaving aside the issues with these languages, of these three, only .net provides a suitably performant XML parser, and all three languages have their own issues about sharing server resources with external SOAP APIs. To avoid adding overhead that can nick your server response times or scalability, you may wish to use an external application to handle the majority of the FECB API work, and node is pretty performant in handling an XML workflow, and even *\*shudder\** SOAP.

This wrapper will allow you to build an application to do all the FECB dirty work and interact with your ecommerce platform in a native, hopefully more performant manner than acting as a SOAP client on your server.

## Installation

v.1.0.0 is available as an NPM package:

```bash
npm install fedex-cross-border-api
```

## Basic Usage

Once installed locally or globally, require the module:

```javascript
var FedExCrossBorder = require('fedex-cross-border-api');
```

To instantiate a client, you'll need a minimum of two arguments passed to the args object of either clients' constructor: a two letter language code (only english and spanish are currently supported by FECB API v4.4) and the merchant key for your FECB account:

```javascript
var language = 'en';
var merchantKey = 'yourMerchantKeyForFECB';
var args = {
	"language": language,
	"merchantKey": merchantKey
};
```

Then you may create either a callback-based client:

```javascript
var fecbClientCallbacks = new FedExCrossBorder.client(args);
```

Or a promise-based client:

```javascript
var fecbClientPromises = new FedExCrossBorder.clientPromise(args);
```

Calling a method on the client is pretty straightforward; client methods match the method names in the FECB docs and WSDL file, and your request data is passed in an object as the first argument for each (details for each method/object below). Callback client methods return values via node 'standard' two argument callbacks, and Promise client methods, when assigned to a variable, are promises that return data from the API on success. Here's an example of each using the 'ConnectProductInfo':

```javascript
// lets assume we've already created objects for each product here...
var productInfoArray = [
	productObject1,
	productObject2
];

// call to method using callback client
// we'll log the results to console
fecbClientCallbacks.productInfo(productInfoArray, function(error, result) {

	if (error) {
		console.log("Oh no! \n" + error.message);
	}

	else {
		console.log("Yay, we got stuff! \n" + JSON.stringify(result));
	}

});

// call to method using promise client
// we'll log results to console when promise is resolved or rejected
var sendProductInfo = fecbClientPromises.productInfo(productInfoArray);
sendProductInfo.then(function(result) {

	console.log("Yay, we got stuff! \n" + JSON.stringify(result));

}).catch((error) => {

	console.log("Oh no! \n" + error.message);

});
```

## Client Constructors

Each constructor's first argument is an object containing properties that define the behavior of the client during method calls. The synchronous client also requires a second argument, the callback function. The 'args' object, as mentioned in the previous section, always requires a 'merchantKey' and a 'language' property. Both are ECMA 6 compliant 'classes' (basically prototypes with class-like syntax), so they are instantiated using the 'new' keyword, with constructor arguments after the class name. Full explanation of the usage for each constructor:

### Client Constructor - Callbacks

##### Usage

new FedExCrossBorder.client(args(object))

##### Returns

FedExCBClientCallback Object

##### Valid Properties for 'args'

property | valueType | notes
:--- | :--- | :---
language | string(2) | v4.4 supports 'en' or 'es'
merchantKey | string(45) | value provided by FECB
stripWrapper | boolean | default false
returnRaw | boolean | default false; only acknowledged if stripWrapper is false
returnSoapHeader | boolean | default false; only acknowledged if stripWrapper is false
returnFullResponse | boolean | default false; only acknowledged if stripWrapper is false

### Client Constructor - Promises

##### Usage

new FedExCrossBorder.clientPromise(args(object))

##### Returns

FedExCBClientPromise Object

##### Valid Properties for 'args'

property | valueType | notes
:--- | :--- | :---
language | string(2) | required, v4.4 supports 'en' or 'es'
merchantKey | string(45) | required, value provided by FECB
stripWrapper | boolean | default false
returnRaw | boolean | default false; only acknowledged if stripWrapper is false
returnSoapHeader | boolean | default false; only acknowledged if stripWrapper is false
returnFullResponse | boolean | default false; only acknowledged if stripWrapper is false

### Optional Arguments of 'args' for both Constructors

In addition to the the required 'language' and 'merchantKey' properties, the argument object for the client constructors also accepts some optional properties, noted above. These affect how the client's methods return the successful response.

By default, methods return a result object that contain three properties: body, request, and statusCode. This body is an object parsed from the server's response body to the API call, statusCode is the http status for the response, and request echoes the request JS object sent to the API server.

For debugging or other logical purposes, the soapHeader (as JSON), the raw response string, and/or the full response JS object can be added to the result object of all methods by setting the 'returnSoapHeader', 'returnRaw' and/or 'returnFullResponse arguments to true, respctively. Setting 'returnSoapHeader' to true adds the 'soapHeader' property to the result object, which contains a JSON encoded soapHeader of the API response. Setting 'returnRaw' to true adds the 'raw' property to the result object, which contains the raw XML string of the API response body. Setting 'returnFullResponse' adds the 'response' property, a JS object containing the full response from the server as a [Node.js http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage). Each of these are IN ADDITION to the 'body', 'statusCode', and 'request' properties, which are always returned if 'stripWrapper' is false.

But, if you'd like to go in the opposite direction and return ONLY the body object, without a wrapper, setting the 'stripWrapper' property of 'args' to true will return the 'body' object without another object wrapping it, and WILL NOT return statusCode or request. This option also disables the effects of 'returnFullResponse', 'returnRaw' and 'returnSoapHeader'.

Examples focus on the callback based client, but the same rules apply for the promise client as well... except the result is an argument of your promise success handler rather than of the callback.

##### Examples

```javascript
var FedExCrossBorder = require('fedex-cross-border-api');
var args1 = {
	"language": "en",
	"merchantKey": "***myMerchantKeyValue***"
};
var args2 = {
	"language": "en",
	"merchantKey": "***myMerchantKeyValue***",
	"stripWrapper": true
	// if returnRaw, returnSoapHeader, and/or returnFullResponse
	// are set to true here,
	// they will be ignored
};
var args3 = {
	"language": "en",
	"merchantKey": "***myMerchantKeyValue***",
	// stripWrapper defaults to false
	"returnRaw": true
};
var args4 = {
	"language": "en",
	"merchantKey": "***myMerchantKeyValue***",
	// stripWrapper defaults to false
	"returnSoapHeader": true
};
var args5 = {
	"language": "en",
	"merchantKey": "***myMerchantKeyValue***",
	// stripWrapper defaults to false
	"returnFullResponse": true
}

var fecbClientDefault = new FedExCrossBorder.client(args1);
// methods for this client will return a result object like this:
// {
// 	   body: {
//			property1: 'result1',
//			etc: etc...
//     },
//		request: {
//			requestprop1: 'prop1',
//			etc: etc...
//		},
//		statusCode: 200
// }

var fecbClientLean = new FedExCrossBorder.client(args2);
// methods for this client will only return the body object AS the result:
// {
//		property1: 'result1',
//		etc: etc...
// }

var fecbClientRaw = new FedExCrossBorder.client(args3);
// methods for this client will return a result object with both raw and response values:
// {
// 	   body: {
//			property1: 'result1',
//			etc: etc...
//     },
//		request: {
//			requestprop1: 'prop1',
//			etc: etc...
//		},
//		statusCode: 200,
//		raw:	'<ns1:ConnectProductInfoResponse><return xsi:type="ns1:ConnectProductInfoResponse">
//				<error xsi:type="xsd:int">0</error><errorMessage xsi:type="xsd:string"></errorMessage>
//				<errorMessageDetail xsi:type="xsd:string"></errorMessageDetail></return</ns1:ConnectProductInfoResponse>'
// }

var fecbClientHeaders = new FedExCrossBorder.client(args4);
// methods for this client will return a result object with both soapHeader and response values:
// {
// 	   body: {
//			property1: 'result1',
//			etc: etc...
//     },
//		request: {
//			requestprop1: 'prop1',
//			etc: etc...
//		},
//		statusCode: 200,
//		soapHeader:	'{"xmlns:SOAP-ENV": "http://schemas.xmlsoap.org/soap/envelope/",
//					"xmlns:ns1": "https://api.crossborder.fedex.com/services/v44",
//					"xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
//					"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
//					"xmlns:SOAP-ENC": "http://schemas.xmlsoap.org/soap/encoding/",
//					"SOAP-ENV:encodingStyle": "http://schemas.xmlsoap.org/soap/encoding/"}'
// }

// IN CASE IT WASN'T OBVIOUS... these are not the actual values the API returns...
// Just illustrating the effects of the constructor args...

```

# BOILERPLATE FOR EACH METHOD

##### Arguments Passed to Callback

argument | valueType | notes
:--- | :--- | :---
error | object(JS Error or subclass thereof) | false if no error occurs
result | object | by default contains 'body'(JS Object), 'request'(JS Object), and 'statusCode'(number)

##### Arguments Passed to Promise resolution function

argument | valueType | notes
:--- | :--- | :---
result | object | by default contains 'body'(JS Object), 'request'(JS Object), and 'statusCode'(number)

##### Arguments Passed to Promise rejection function

argument | valueType | notes
:--- | :--- | :---
error | object(JS Error or subclass thereof) |

## Methods

Methods for each client are 1:1 matches for the SOAP API methods [documented by FECB](http://crossborder.fedex.com/us/ecommerce/api/index.shtml), but the function names and arguments have changed from the SOAP equivalents. Operations for both clients are identical, but there's an extra argument for the callback client (for the callback, of course!).

### ConnectProductInfo

##### Purpose

Sends product data to FECB to create or update product details in their database.

##### Usage

Callback - client.productInfo(request, callback)

Promise - client.productInfo(request)

##### Request Object Parameters

The 'request' argument for this method is an array of objects, one per product:

```json
[
	{
		"id": "string(255)",
		"description": "string(250)",
		"price": "float",
		"currency": "string(3)",
		"exportHub": "string(3)",
		"origin": "string(2)",
		"itemInformation": {
			"w": "float",
			"h": "float",
			"l": "float",
			"wt": "float"
		},
		"optionalArgs": {
			"productName": "string(255)",
			"url": "string(255)",
			"imageUrl": "string(255)",
			"hsCode": "string(15)",
			"eccn": "string(15)",
			"hazFlag": "boolean",
			"licenseFlag": "array -OR- comma-separated string (limited to ~84 country codes)",
			"importFlag": "array -OR- comma-separated string (limited to ~84 country codes)",
			"productType": "string(255)"
		}
	},
	{
	(additional objects, if any)
	}
]
```

The array must contain at least ONE product object. All object parameters are required except 'optionalArgs', which can, as the name suggests, contain any number of the optional parameters or be omitted entirely. Also, if w, l, and h are defined in the 'itemInformation' object, wt is optional, and vice versa.

##### Arguments Passed to Callback

argument | valueType | notes
:--- | :--- | :---
error | object(JS Error or subclass thereof) | false if no error occurs
result | object | by default contains 'body'(JS Object), 'request'(JS Object), and 'statusCode'(number)

##### Arguments Passed to Promise resolution function

argument | valueType | notes
:--- | :--- | :---
result | object | by default contains 'body'(JS Object), 'request'(JS Object), and 'statusCode'(number)

##### Arguments Passed to Promise rejection function

argument | valueType | notes
:--- | :--- | :---
error | object(JS Error or subclass thereof) |

### ConnectLandedCost

### ConnectOrder

### ConnectOrderTrackingUpdate

### ConnectOrderRemove

### ConnectSkuStatus

## Objects

Several classes are available to use, with built in validation and some santization as part of the constructor. These are used by the client methods internally, but are exposed for your use as well, if you need them.

### cartonsDat

##### Purpose

Contains dimensions and/or weight for a carton or item

##### Constructor Usage

new FedExCrossBorder.cartonsDat(lengthIn, widthIn, heightIn, weightLb);

##### Constructor Arguments

arguments | valueType | notes
:--- | :--- | :---
lengthIn | float(4) | item length in inches
widthIn | float(4) | item width in inches
heightIn | float(4) | item height in inches
weightLb | float(4) | item weight in pounds

##### Methods

getXmlString() - no arguments, returns SOAP formatted XML string of object

### productInfoDat

##### Purpose

Contains product details for updating FECB product database

##### Constructor Usage

new FedExCrossBorder.productInfoDat(id, description, price, currency, exportHub, origin, itemInformation, optionalArgs)

##### Constructor Arguments

arguments | valueType | notes
:--- | :--- | :---
id | string | unique product identifier
description | string | human readable product description
price | float(13,4) | sales price for item
currency | string(3) | three letter identifier for item price currency
exportHub | string(3) | three letter identifier for FECB distribution hub
origin | string(2) | two letter identifier for product country of origin
iteminformation | object cartonsDat | physical data for item
optionalArgs | object | optional; may contain properties matching any of the optionalArgs in the below table.

##### optionalArgs Properties

All properties, like the optionalArgs argument itself, are optional.

property | valueType | notes
:--- | :--- | :---
productName | string | human readable identifier for product
url | string | URL that points to product on ecommerce site
imageUrl | string | URL that points to product image
hsCode | string(10) | code that allows the calculation of tax payable in the destination country of the shipment
eccn | string(15) | eccn code for product
hazFlag | boolean | whether product is flagged as hazardous; default false, set to true if product is flagged as hazardous
importFlag | string -OR- array | comma separated string or array of two letter strings indicating countries product is forbidden to enter
licenseFlag | string -OR- array | comma separated string or array of two letter strings indicating countries product requires license to enter
productType | string | merchant category associated with this item

##### Methods

getXmlString() - no arguments, returns SOAP formatted XML string of object

### productInfo

##### Purpose

Contains basic product details for landedCost interface

##### Constructor Usage

new FedExCrossBorder.productInfo(id, quantity, price, exportHub);

##### Constructor Arguments

arguments | valueType | notes
:--- | :--- | :---
id | string | unique product identifier
quantity | int | quantity of items in shipment
price | float(13,4) | sales price for item
exportHub | string(3) | three letter identifier for FECB distribution hub

##### Methods

getXmlString() - no arguments, returns SOAP formatted XML string of object

### orderInformation

##### Purpose

Contains line item detail for an FECB order

##### Constructor Usage

new FedExCrossBorder.orderInformation(id, quantity, price, currency, optionalArgs);

##### Constructor Arguments

arguments | valueType | notes
:--- | :--- | :---
id | string | unique product identifier
quantity | int | quantity of items in shipment
price | float(13,4) | sales price for item
currency | string(2) | two letter identifier for currency of line item's price
optionalArgs | object | optional; may contain properties matching any of the optionalArgs in the below table.

##### optionalArgs Properties

All properties, like the optionalArgs argument itself, are optional.

property | valueType | notes
:--- | :--- | :---
exportHub | string(3) | three letter identifier for FECB distribution hub
carrier | string -OR- int | identifier for shipping agent; integers 1-6 or a valid carrier value are accepted (assigns to 6, 'other', by default or if invalid value passed)
trackingNumber | string(100) | carrier tracking code for order

##### Methods

getXmlString() - no arguments, returns SOAP formatted XML string of object

### trackingList

##### Purpose

Contains tracking details for orderTrackingUpdate interface

##### Constructor Usage

new FedExCrossBorder.trackingList(id, quantity, trackingNumber, carrier);

##### Constructor Arguments

arguments | valueType | notes
:--- | :--- | :---
id | string | unique product identifier
quantity | int | quantity of items in shipment
trackingNumber | string(100) | carrier tracking code for order
carrier | string -OR- int | identifier for shipping agent; integers 1-6 or a valid carrier value are accepted (assigns to 6, 'other', by default or if invalid value passed)

##### Methods

getXmlString() - no arguments, returns SOAP formatted XML string of object

### productsIdDat

##### Purpose

Contains product id for skuStatus interface

##### Constructor Usage

new FedExCrossBorder.productsIdDat(id);

##### Constructor Arguments

arguments | valueType | notes
:--- | :--- | :---
id | string | unique product identifier

##### Methods

getXmlString() - no arguments, returns SOAP formatted XML string of object

## Functions

Utility functions used by the clients are also exposed for your use, should you need them.

### validateLanguage

##### Purpose

Determine whether a string is a valid FECB supported language identifier

##### Usage

FedExCrossBorder.validateLanguage(languageCode);

##### Arguments

arguments | valueType | notes
:--- | :--- | :---
languageCode | string(2) | language identifier

##### Returns

(boolean)

true = valid language code
false = invalid language code

### validateCountry

##### Purpose

Determine whether a string is a valid FECB supported country identifier

##### Usage

FedExCrossBorder.validateCountry(countryCode);

##### Arguments

arguments | valueType | notes
:--- | :--- | :---
countryCode | string(2) | country identifier

##### Returns

(boolean)

true = valid country code
false = invalid country code

### validateCurrency

##### Purpose

Determine whether a string is a valid FECB supported currency identifier

##### Usage

FedExCrossBorder.validateCurrency(currencyCode);

##### Arguments

arguments | valueType | notes
:--- | :--- | :---
currencyCode | string(3) | currency identifier

##### Returns

(boolean)

true = valid currency code
false = invalid currency code

### getCountryForHub

##### Purpose

Given a valid three character facility code string, returns the two character country code the hub facility is located in.

##### Usage

FedExCrossBorder.getCountryForHub(facilityCode);

##### Arguments

arguments | valueType | notes
:--- | :--- | :---
facilityCode | string(3) | FECB hub facility identifier

##### Returns

(string(2))

Two letter country code for the given FECB hub facility

### getCarrierCode

##### Purpose

Given a valid three character facility code string, returns the two character country code the hub facility is located in.

##### Usage

FedExCrossBorder.getCarrierCode(carrierString);

##### Arguments

arguments | valueType | notes
:--- | :--- | :---
carrierString | string | String identifying FECB carrier; one of ['UPS', 'FedEx', 'DHL', 'USPS', 'EMS']; case-sensitive

##### Returns

(int(1))

integer between 1-6 inclusive that is related to the given carrierString; returns 6 if string is not matched (for 'Other')

## Constants

If the objects and functions aren't enough, the constants containing various FECB provided tables, as of API v4.4, (also listed in CSV format in the /csv directory of this package) are exposed for direct access, should you need them.

### exportHubs

##### Purpose

Array of objects, each containing a FECB hub facility code and the related country code

##### Structure

[
	{
		facility: string(3),
		country: string(2)
	},
	...
]

### countryCodes

##### Purpose

Array of objects, each containing a country name, the related country code, and the related currency code

##### Structure

[
	{
		name: string,
		code: string(2),
		currency: string(3)
	},
	...
]

### languages

##### Purpose

Array of strings, each containing a FECB supported language identifier

##### Structure

[
	'languageCode',
	...
]

### carriers

##### Purpose

Object containing a carrier string property that contains the integer identifier for it

##### Structure

{
	carrier: id,
	...
}


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>SyncRoot Property</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            log4net SDK Reference

EmptyDictionary.SyncRoot Property

 Gets an object that can be used to synchronize access to the ICollection.

        [Visual Basic]

NotOverridable Public ReadOnly Property SyncRoot As Object _
    Implements ICollection.SyncRoot

        [C#]

public object SyncRoot {get;}

Property Value

 An object that can be used to synchronize access to the ICollection.

Implements

        ICollection.SyncRoot

Remarks

 As the collection is empty and thread safe and synchronized this instance is also the SyncRoot object.

See Also

EmptyDictionary Class | log4net.Util Namespace

Copyright 2001-2006 The Apache Software Foundation.

Generated from assembly log4net [1.2.10.0]


text:
//
//  IBCollectionItemView.m
//  IBCollectionView
//
//  Created by Kevin on 15/12/14.
//  Copyright (c) 2014 Icyblaze. All rights reserved.
//  https://github.com/icyblazek/IBCollectionView

#import "IBCollectionItemView.h"

@implementation IBCollectionItemView

- (void)drawRect:(NSRect)dirtyRect
{
    [[NSColor blueColor] setFill];

    if (self.selected){
        //draw selected status code
        [[NSColor yellowColor] setFill];
    }

    NSRectFill(self.bounds);
}

- (void)setFrame:(NSRect)frameRect
{
    [super setFrame:frameRect];
}

/**
 *  Click Test is used when the item view has it's own click event shape.
 *  Subclass and implement this method with custome shape.
 *
 *  @param p NSPoint relative to self
 *
 *  @return YES if did click on the item.
 */
- (BOOL)clickTest:(NSPoint)p;
{
    return YES;
}

-(void)setSelected:(BOOL)value
{
    if (_selected != value){
        _selected = value;
        [self setNeedsDisplay: YES];
    }
}

-(BOOL)accpetMouseEventWithEvent:(NSEvent*)theEvent
{
    return YES;
}

-(BOOL)accpetSelectWithRect:(NSRect)rect
{
    if (NSIntersectsRect(self.bounds, rect))
        return YES;
    return NO;
}

-(BOOL)accpetSelectWithPoint:(NSPoint)point
{
    if (NSPointInRect(point, self.bounds))
        return YES;
    return NO;
}

-(void)mouseEntered:(NSEvent *)theEvent
{
    //mouse enter here
}

-(void)mouseExited:(NSEvent *)theEvent
{
    //"mouse exit here"
}

-(void)mouseMoved:(NSEvent *)theEvent
{
    //@"mouse move here"
}

-(BOOL)trackMouseEvent:(NSEvent *)theEvent
{
    return NO;
}

- (BOOL)isFlipped
{
    return YES;
}

@end


text:
package org.oscm.build.ant;

import static org.junit.Assert.assertNull;
import org.junit.Assert;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.junit.Before;
import org.junit.Test;

public class TimestampTaskTest {

    private Project project;
    private TimestampTask task;

    @Before
    public void setup() {
        project = new Project();
        task = new TimestampTask();
        task.setProject(project);
    }

    @Test(expected = BuildException.class)
    public void testTimestampNameNotSet() {
        task.execute();
    }

    @Test
    public void testTimestamp() {
        final String stampPropertyName = "timestamp";

        assertNull(project.getProperty(stampPropertyName));

        task.setName(stampPropertyName);
        task.execute();

        final String tstamp1 = project.getProperty(stampPropertyName);

        try {
            // Wait at least 1ms to get different timestamp
            Thread.sleep(1);
        } catch (Throwable t) {
            // Ignore
        }
        task.setName(stampPropertyName);
        task.execute();

        final String tstamp2 = project.getProperty(stampPropertyName);

        Assert.assertNotNull(tstamp1);
        Assert.assertNotNull(tstamp2);

        // Value must be different
        Assert.assertFalse(tstamp1.equals(tstamp2));
    }

}


text:
package com.model.bitbucket;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.model.Owner;

public class BitBucketOwner implements Owner {

    @SerializedName("username")
    @Expose
    private String username;
    @SerializedName("display_name")
    @Expose
    private String displayName;
    @SerializedName("type")
    @Expose
    private String type;
    @SerializedName("uuid")
    @Expose
    private String uuid;
    @SerializedName("links")
    @Expose
    private Links links;

    public BitBucketOwner() {
    }

    /**
     *
     * @return
     * The displayName
     */
    public String getDisplayName() {
        return displayName;
    }

    /**
     *
     * @param displayName
     * The display_name
     */
    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    /**
     *
     * @return
     * The type
     */
    public String getType() {
        return type;
    }

    /**
     *
     * @param type
     * The type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     *
     * @return
     * The uuid
     */
    public String getUuid() {
        return uuid;
    }

    /**
     *
     * @param uuid
     * The uuid
     */
    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Override
    public String getLogin() {
        return username;
    }

    @Override
    public String getAvatarUrl() {
        return links.avatar.href;
    }

    @Override
    public void setLogin(String login) {
        this.username = login;
    }

    protected BitBucketOwner(Parcel in) {
        username = in.readString();
        displayName = in.readString();
        type = in.readString();
        uuid = in.readString();
        links = (Links) in.readValue(Links.class.getClassLoader());
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(username);
        dest.writeString(displayName);
        dest.writeString(type);
        dest.writeString(uuid);
        dest.writeValue(links);
    }

    @SuppressWarnings("unused")
    public static final Parcelable.Creator<BitBucketOwner> CREATOR = new Parcelable.Creator<BitBucketOwner>() {
        @Override
        public BitBucketOwner createFromParcel(Parcel in) {
            return new BitBucketOwner(in);
        }

        @Override
        public BitBucketOwner[] newArray(int size) {
            return new BitBucketOwner[size];
        }
    };
}


text:
using NLog;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Windows.Forms;

namespace AutoDeploy
{
    public partial class FormServer : Form
    {
        private static Logger logger = NLog.LogManager.GetCurrentClassLogger();
        public db db = new db();

        public FormServer()
        {
            InitializeComponent();
            ShowGroupData();
            ShowDetailData();
        }
        #region FTP群組相關操作

        //新增群組按鈕點擊
        private void btnAddGroup_Click(object sender, EventArgs e)
        {
            string name = dialog.ShowInputGroupNameForm();
            if (!string.IsNullOrEmpty(name)) {
                int? newID = db.AddFtpGroup(name);
            }
            ShowGroupData();
        }

        //按下delete鍵 刪除群組
        private void lbGroup_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                if (MessageBox.Show("確定刪除此FTP群組及底下的FTP列表?", "關閉", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    new ListBoxUtility().LoopListBoxItem<model.FTP_M>(lbGroup, db.DeleteFtpMasterAndDetail);
                    //重新整理master和detail
                    ShowGroupData();
                    ShowDetailData();
                }

            }
        }
        //點擊兩下伺服器群組item 修改名稱
        private void lbGroup_DoubleClick(object sender, EventArgs e)
        {
            if (lbGroup.SelectedItem != null)
            {
                //取得修改後的名稱
                string name = dialog.ShowInputGroupNameForm("重新命名");
                if (!string.IsNullOrEmpty(name))
                {
                    model.FTP_M item = (lbGroup.SelectedItem as model.FTP_M);
                    item.Name = name;
                    db.UpdateDataToDB(item);
                }
            }
            ShowGroupData();
        }
        //當選擇伺服器群組時 refresh detail view
        private void lbGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            ShowDetailData();
        }

        //取得伺服器群組資料  用來Refresh或一開始的init
        private void ShowGroupData()
        {
            lbGroup.DataSource = db.GetDataFromDB<model.FTP_M>();
            lbGroup.DisplayMember = "Name";
            lbGroup.ValueMember = "ID";
        }

        #endregion

        #region FTP列表相關
        //新增按鈕點擊
        private void btnAddList_Click(object sender, EventArgs e)
        {
            if (lbGroup.SelectedItem == null)
            {
                MessageBox.Show("請選擇一個伺服器群組!");
                return;
            }
            else
            {
                model.FTP_D form = dialog.ShowFtpDetailDialog();

                if (form != null)
                {
                    form.GroupID = (lbGroup.SelectedItem as model.FTP_M).ID;
                    db.AddFtpDetail(form);
                    ShowDetailData();
                }
            }
        }
        //按下delete鍵 刪除row
        private void gridList_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                if (MessageBox.Show("確定刪除此筆資料?", "關閉", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    foreach (DataGridViewRow item in this.gridList.SelectedRows)
                    {
                        model.FTP_D obj = (model.FTP_D)item.DataBoundItem;
                        db.DeleteDataFromDB(obj);
                    }
                    ShowDetailData();
                }

            }
        }
        //當編輯單元格時 存檔至資料庫
        private void gridList_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                bool isValid = true;
                //驗證欄位
                //存在資料庫的Port是string 但存進去時要驗證是否為數字 這樣取出時才不會轉換錯誤
                int port = 21;
                var cellPort = gridList.Rows[e.RowIndex].Cells[(int)columnIndex.FTP_D.Port].Value;
                if (!int.TryParse(cellPort.ToString(), out port))
                {
                    gridList.Rows[e.RowIndex].ErrorText = "Port必須為數字";
                    throw new ArgumentException("Port必須為數字,此次異動未存檔");
                }
                if (isValid)
                {
                    model.FTP_D item = new model.FTP_D();
                    item.ID = (int)gridList.Rows[e.RowIndex].Cells[(int)columnIndex.FTP_D.ID].Value;
                    item.Port = (string)gridList.Rows[e.RowIndex].Cells[(int)columnIndex.FTP_D.Port].Value;
                    item.ClientIP = (string)gridList.Rows[e.RowIndex].Cells[(int)columnIndex.FTP_D.ClientIP].Value;
                    item.UserName = (string)gridList.Rows[e.RowIndex].Cells[(int)columnIndex.FTP_D.UserName].Value;
                    item.Password = (string)gridList.Rows[e.RowIndex].Cells[(int)columnIndex.FTP_D.Password].Value;
                    db.UpdateDataToDB(item);
                    gridList.Rows[e.RowIndex].ErrorText = "";
                    this.BeginInvoke(new MethodInvoker(ShowDetailData));
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }

        //重整detail view的資料 依據選擇的FTP群組
        private void ShowDetailData() {
            if (lbGroup.SelectedItem != null)
            {
                gridList.AutoGenerateColumns = false;
                gridList.DataSource = db.
                    GetDataFromDBByCondition<model.FTP_D>(new { GroupID = (lbGroup.SelectedItem as model.FTP_M).ID });
            }
            else {
                gridList.DataSource = null;
            }
        }

        #endregion

        //點擊menu時跳出操作說明
        private void 說明ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show(@"
FTP群組操作說明:
直接按delete可刪除群組及底下的FTP站台列表

FTP站台列表操作說明:
選中一列按delete可刪除單筆資料
選中一個單元格直接輸入文字能編輯該單元格資料

如果使用者名稱和密碼為空 代表是匿名登入
",
"程式說明");
        }

    }
}