text:
<?php
/**
 * Created by PhpStorm.
 * Author: Victor Diditskiy <victor.diditskiy@yandex.ru>
 * Date: 18.03.17
 * Time: 21:02
 */

declare(strict_types = 1);

namespace GhostSt\CoreBundle\Form\Type;

use GhostSt\CoreBundle\Document\GameBestMove;
use GhostSt\CoreBundle\Helper\PositionHelper;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * Game best move type
 */
class GameBestMoveType extends AbstractType
{
    /**
     * Initializes form
     *
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('position', ChoiceType::class, [
                'label' => 'form.type.game_best_move.position',
                'choices' => PositionHelper::getPositions(1, 10)
            ])
            ->add('guess', ChoiceType::class, [
                'label' => 'form.type.game_best_move.guess',
                'multiple' => true,
                'choices' => PositionHelper::getPositions(1, 10)
            ]);
    }

    /**
     * Configures form
     *
     * @param OptionsResolver $resolver
     *
     * @throws AccessException
     */
    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => GameBestMove::class,
        ]);
    }
}


text:
namespace IsoPixel
{
    partial class IsoEdit
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.label1 = new System.Windows.Forms.Label();
            this.cmsSpriteList = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.tsmiNewSprite = new System.Windows.Forms.ToolStripMenuItem();
            this.tsmiImportSprite = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.tsmiDeleteSprite = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.tsmiLoad = new System.Windows.Forms.ToolStripMenuItem();
            this.tsmiSave = new System.Windows.Forms.ToolStripMenuItem();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.statusStrip = new System.Windows.Forms.StatusStrip();
            this.tsslMode = new System.Windows.Forms.ToolStripStatusLabel();
            this.tsslInfo = new System.Windows.Forms.ToolStripStatusLabel();
            this.spriteEditor = new IsoPixel.DepthSpriteEditor();
            this.listContainedIn = new IsoPixel.BitmapList();
            this.listSubSprites = new IsoPixel.BitmapList();
            this.listSprites = new IsoPixel.BitmapList();
            this.cmsSpriteList.SuspendLayout();
            this.statusStrip.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(9, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(39, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Sprites";
            //
            // cmsSpriteList
            //
            this.cmsSpriteList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsmiNewSprite,
            this.tsmiImportSprite,
            this.toolStripSeparator1,
            this.tsmiDeleteSprite,
            this.toolStripSeparator2,
            this.tsmiLoad,
            this.tsmiSave});
            this.cmsSpriteList.Name = "cmsSpriteList";
            this.cmsSpriteList.Size = new System.Drawing.Size(152, 126);
            //
            // tsmiNewSprite
            //
            this.tsmiNewSprite.Name = "tsmiNewSprite";
            this.tsmiNewSprite.Size = new System.Drawing.Size(151, 22);
            this.tsmiNewSprite.Text = "New sprite...";
            //
            // tsmiImportSprite
            //
            this.tsmiImportSprite.Name = "tsmiImportSprite";
            this.tsmiImportSprite.Size = new System.Drawing.Size(151, 22);
            this.tsmiImportSprite.Text = "Import sprite...";
            this.tsmiImportSprite.Click += new System.EventHandler(this.tsmiImportSprite_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(148, 6);
            //
            // tsmiDeleteSprite
            //
            this.tsmiDeleteSprite.Name = "tsmiDeleteSprite";
            this.tsmiDeleteSprite.Size = new System.Drawing.Size(151, 22);
            this.tsmiDeleteSprite.Text = "Delete sprite...";
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);
            //
            // tsmiLoad
            //
            this.tsmiLoad.Name = "tsmiLoad";
            this.tsmiLoad.Size = new System.Drawing.Size(151, 22);
            this.tsmiLoad.Text = "Load...";
            this.tsmiLoad.Click += new System.EventHandler(this.tsmiLoad_Click);
            //
            // tsmiSave
            //
            this.tsmiSave.Name = "tsmiSave";
            this.tsmiSave.Size = new System.Drawing.Size(151, 22);
            this.tsmiSave.Text = "Save...";
            this.tsmiSave.Click += new System.EventHandler(this.tsmiSave_Click);
            //
            // label2
            //
            this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(568, 9);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(69, 13);
            this.label2.TabIndex = 5;
            this.label2.Text = "Contained in:";
            //
            // label3
            //
            this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(482, 9);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(51, 13);
            this.label3.TabIndex = 7;
            this.label3.Text = "Contains:";
            //
            // statusStrip
            //
            this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsslMode,
            this.tsslInfo});
            this.statusStrip.Location = new System.Drawing.Point(0, 395);
            this.statusStrip.Name = "statusStrip";
            this.statusStrip.Size = new System.Drawing.Size(663, 24);
            this.statusStrip.TabIndex = 9;
            this.statusStrip.Text = "statusStrip1";
            //
            // tsslMode
            //
            this.tsslMode.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
            this.tsslMode.Name = "tsslMode";
            this.tsslMode.Size = new System.Drawing.Size(57, 19);
            this.tsslMode.Text = "mode: ...";
            //
            // tsslInfo
            //
            this.tsslInfo.ForeColor = System.Drawing.Color.Black;
            this.tsslInfo.Name = "tsslInfo";
            this.tsslInfo.Size = new System.Drawing.Size(0, 19);
            //
            // spriteEditor
            //
            this.spriteEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.spriteEditor.Location = new System.Drawing.Point(98, 25);
            this.spriteEditor.Name = "spriteEditor";
            this.spriteEditor.Size = new System.Drawing.Size(381, 367);
            this.spriteEditor.Sprite = null;
            this.spriteEditor.TabIndex = 8;
            this.spriteEditor.Text = "depthSpriteEditor1";
            //
            // listContainedIn
            //
            this.listContainedIn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.listContainedIn.Location = new System.Drawing.Point(571, 25);
            this.listContainedIn.Name = "listContainedIn";
            this.listContainedIn.SelectedId = null;
            this.listContainedIn.Size = new System.Drawing.Size(80, 367);
            this.listContainedIn.TabIndex = 6;
            this.listContainedIn.Text = "bitmapList2";
            this.listContainedIn.OnGetItemImage += new IsoPixel.BitmapList.OnGetItemImageEvent(this.listSprites_OnGetItemImage);
            //
            // listSubSprites
            //
            this.listSubSprites.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.listSubSprites.Location = new System.Drawing.Point(485, 25);
            this.listSubSprites.Name = "listSubSprites";
            this.listSubSprites.SelectedId = null;
            this.listSubSprites.Size = new System.Drawing.Size(80, 367);
            this.listSubSprites.TabIndex = 4;
            this.listSubSprites.OnGetItemImage += new IsoPixel.BitmapList.OnGetItemImageEvent(this.listSprites_OnGetItemImage);
            //
            // listSprites
            //
            this.listSprites.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)));
            this.listSprites.ContextMenuStrip = this.cmsSpriteList;
            this.listSprites.Location = new System.Drawing.Point(12, 25);
            this.listSprites.Name = "listSprites";
            this.listSprites.SelectedId = null;
            this.listSprites.Size = new System.Drawing.Size(80, 367);
            this.listSprites.TabIndex = 3;
            this.listSprites.OnSelectItem += new IsoPixel.BitmapList.OnSelectItemEvent(this.listSprites_OnSelectItem);
            this.listSprites.OnGetItemImage += new IsoPixel.BitmapList.OnGetItemImageEvent(this.listSprites_OnGetItemImage);
            //
            // IsoEdit
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.Control;
            this.ClientSize = new System.Drawing.Size(663, 419);
            this.Controls.Add(this.statusStrip);
            this.Controls.Add(this.spriteEditor);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.listContainedIn);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.listSubSprites);
            this.Controls.Add(this.listSprites);
            this.Controls.Add(this.label1);
            this.MinimumSize = new System.Drawing.Size(400, 300);
            this.Name = "IsoEdit";
            this.Text = "IsoEdit";
            this.cmsSpriteList.ResumeLayout(false);
            this.statusStrip.ResumeLayout(false);
            this.statusStrip.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ContextMenuStrip cmsSpriteList;
        private System.Windows.Forms.ToolStripMenuItem tsmiNewSprite;
        private System.Windows.Forms.ToolStripMenuItem tsmiImportSprite;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripMenuItem tsmiDeleteSprite;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
        private System.Windows.Forms.ToolStripMenuItem tsmiLoad;
        private System.Windows.Forms.ToolStripMenuItem tsmiSave;
        private BitmapList listSprites;
        private BitmapList listSubSprites;
        private System.Windows.Forms.Label label2;
        private BitmapList listContainedIn;
        private System.Windows.Forms.Label label3;
        private DepthSpriteEditor spriteEditor;
        private System.Windows.Forms.StatusStrip statusStrip;
        private System.Windows.Forms.ToolStripStatusLabel tsslMode;
        private System.Windows.Forms.ToolStripStatusLabel tsslInfo;

    }
}

redpajama_set_name: RedPajamaGithub


text:
package io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.v1;

import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConsumerId;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.BooleanStream;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.OpenWireFormat;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ActiveMQDestination;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.Message;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.MessageDispatch;
import org.fusesource.hawtbuf.DataByteArrayInputStream;
import org.fusesource.hawtbuf.DataByteArrayOutputStream;
import java.io.IOException;

/**
 * Marshalling code for Open Wire Format for MessageDispatchMarshaller
 *
 *
 * NOTE!: This file is auto generated - do not modify!
 *        Modify the 'apollo-openwire-generator' module instead.
 *
 */
public class MessageDispatchMarshaller extends BaseCommandMarshaller {

    /**
     * Return the type of Data Structure we marshal
     * @return short representation of the type data structure
     */
    public byte getDataStructureType() {
        return MessageDispatch.DATA_STRUCTURE_TYPE;
    }

    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new MessageDispatch();
    }

    /**
     * Un-marshal an object instance from the data input stream
     *
     * @param o the object to un-marshal
     * @param dataIn the data input stream to build the object from
     * @throws IOException
     */
    public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn, BooleanStream bs) throws IOException {
        super.tightUnmarshal(wireFormat, o, dataIn, bs);

        MessageDispatch info = (MessageDispatch)o;
        info.setConsumerId((ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
        info.setDestination((ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
        info.setMessage((Message)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
        info.setRedeliveryCounter(dataIn.readInt());

    }

    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {

        MessageDispatch info = (MessageDispatch)o;

        int rc = super.tightMarshal1(wireFormat, o, bs);
        rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
        rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
        rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessage(), bs);

        return rc + 4;
    }

    /**
     * Write a object instance to data output stream
     *
     * @param o the instance to be marshaled
     * @param dataOut the output stream
     * @throws IOException thrown if an error occurs
     */
    public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException {
        super.tightMarshal2(wireFormat, o, dataOut, bs);

        MessageDispatch info = (MessageDispatch)o;
        tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
        tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
        tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessage(), dataOut, bs);
        dataOut.writeInt(info.getRedeliveryCounter());

    }

    /**
     * Un-marshal an object instance from the data input stream
     *
     * @param o the object to un-marshal
     * @param dataIn the data input stream to build the object from
     * @throws IOException
     */
    public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException {
        super.looseUnmarshal(wireFormat, o, dataIn);

        MessageDispatch info = (MessageDispatch)o;
        info.setConsumerId((ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
        info.setDestination((ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
        info.setMessage((Message)looseUnmarsalNestedObject(wireFormat, dataIn));
        info.setRedeliveryCounter(dataIn.readInt());

    }

    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public void looseMarshal(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut) throws IOException {

        MessageDispatch info = (MessageDispatch)o;

        super.looseMarshal(wireFormat, o, dataOut);
        looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
        looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
        looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessage(), dataOut);
        dataOut.writeInt(info.getRedeliveryCounter());

    }
}


text:
var CLI = require("../src/cli"),
    Q = require('q'),
    cordova = require("../cordova");

describe("cordova cli", function () {

    describe("options", function () {
        describe("version", function () {
            var version = require("../package").version;
            beforeEach(function () {
                spyOn(console, "log");
            });

            it("will spit out the version with -v", function () {
                new CLI(["node", "cordova", "-v"]);
                expect(console.log).toHaveBeenCalledWith(version);
            });

            it("will spit out the version with --version", function () {
                new CLI(["node", "cordova", "--version"]);
                expect(console.log).toHaveBeenCalledWith(version);
            });

            it("will spit out the version with -v anywher", function () {
                new CLI(["node", "cordova", "one", "-v", "three"]);
                expect(console.log).toHaveBeenCalledWith(version);
            });
        });
    });

    describe("project commands other than plugin and platform", function () {
        beforeEach(function () {
            spyOn(cordova.raw, "build").andReturn(Q());
        });

        afterEach(function () {
            cordova.removeAllListeners();
        });

        it("will call command with all arguments passed through", function () {
            new CLI(["node", "cordova", "build", "blackberry10", "-k", "abcd1234"]);
            expect(cordova.raw.build).toHaveBeenCalledWith({verbose: false, silent: false, platforms: ["blackberry10"], options: ["-k", "abcd1234"]});
        });

        it("will consume the first instance of -d", function () {
            new CLI(["node", "cordova", "-d", "build", "blackberry10", "-k", "abcd1234", "-d"]);
            expect(cordova.raw.build).toHaveBeenCalledWith({verbose: true, silent: false, platforms: ["blackberry10"], options: ["-k", "abcd1234", "-d"]});
        });

        it("will consume the first instance of --verbose", function () {
            new CLI(["node", "cordova", "--verbose", "build", "blackberry10", "-k", "abcd1234", "--verbose"]);
            expect(cordova.raw.build).toHaveBeenCalledWith({verbose: true, silent: false, platforms: ["blackberry10"], options: ["-k", "abcd1234", "--verbose"]});
        });

        it("will consume the first instance of either --verbose of -d", function () {
            new CLI(["node", "cordova", "--verbose", "build", "blackberry10", "-k", "abcd1234", "-d"]);
            expect(cordova.raw.build).toHaveBeenCalledWith({verbose: true, silent: false, platforms: ["blackberry10"], options: ["-k", "abcd1234", "-d"]});
        });

        it("will consume the first instance of either --verbose of -d", function () {
            new CLI(["node", "cordova", "-d", "build", "blackberry10", "-k", "abcd1234", "--verbose"]);
            expect(cordova.raw.build).toHaveBeenCalledWith({verbose: true, silent: false, platforms: ["blackberry10"], options: ["-k", "abcd1234", "--verbose"]});
        });

        it("will consume the first instance of --silent", function () {
            new CLI(["node", "cordova", "--silent", "build", "blackberry10", "-k", "abcd1234", "--silent"]);
            expect(cordova.raw.build).toHaveBeenCalledWith({verbose: false, silent: true, platforms: ["blackberry10"], options: ["-k", "abcd1234", "--silent"]});
        });
    });

    describe("plugin", function () {
        beforeEach(function () {
            spyOn(cordova.raw, "plugin").andReturn(Q());
        });

        afterEach(function () {
            cordova.removeAllListeners();
        });

        it("will call command with all arguments passed through", function () {
            new CLI(["node", "cordova", "plugin", "add", "facebook", "--variable", "FOO=foo"]);
            expect(cordova.raw.plugin).toHaveBeenCalledWith("add", ["facebook", "--variable", "FOO=foo"], {searchpath: undefined});
        });
    });
});


text:
package com.licenta.page.ui;

import com.licenta.page.Verifier;
import com.licenta.page.WebElement;

/**
 * Created by Lucian CONDESCU
 */
public class FileUpload extends WebElement {

    public FileUpload(String name, Verifier verifier) {
        super(name, verifier, null);
    }

    public FileUpload(String name, String description) {
        super(name, null, description);
    }

    public FileUpload(String name, Verifier verifier, String description) {
        super(name, verifier, description);
    }
    @Override
    public StringBuilder buildElement(StringBuilder builder) {
        String elementID = this.name.replace(" ","");
        builder.append("
\n");
        builder.append("");
        builder.append("Choose File...");
        builder.append("<input type=\"file\" class=\"btn-file\" name=\"file_source_").append(super.name).append("\" size=\"40\"  onchange='$(\"#upload-file").append(elementID).append("\").html($(this).val());'>");
        builder.append("\n");
        builder.append(" \n");
        builder.append("\n");
        builder.append("
");
        if(this.description != null) builder.append(description);

        return builder;
    }
}


text:
package reforest.rf.split

import reforest.TypeInfo
import reforest.rf._
import reforest.rf.feature._

import scala.collection.Map
import scala.util.Random
import collection.JavaConverters._

/**
  * It contains the split to discretize the raw data in working data
  *
  * @tparam T raw data type
  * @tparam U working data type
  */
trait RFSplitter[T, U] extends Serializable {

  /**
    * The number of bin for the given feature
    *
    * @param idFeature the feature identifier
    * @return the number of bin for the given feature
    */
  def getBinNumber(idFeature: Int): U

  /**
    * Discretize a value to the correct bin number
    *
    * @param idFeature the feature identifier
    * @param value     the raw value
    * @return the discretized value
    */
  def getBin(idFeature: Int, value: T): U

  /**
    * Retrieve the raw value from a bin number
    *
    * @param idFeature the feature identifier
    * @param cut       the bin number of the cut
    * @return the raw value
    */
  def getRealCut(idFeature: Int, cut: U): T

  /**
    * It generates a RFFeatureSizer to know how large a data structure must be to contain all the contributions
    *
    * @param numClasses the number of classes in the dataset
    * @return a specialized RFFeatureSizer
    */
  def generateRFSizer(numClasses: Int): RFFeatureSizer

  /**
    * It generates a RFFeatureSizer to know how large a data structure must be to contain all the contributions.
    * This must be used during the model selection when requesting a RFFeatureSizer for less number of bin
    * with respect to the number of bins in the working data
    *
    * @param numClasses        the number of classes in the dataset
    * @param binNumberShrinked the maximum number of bin used
    * @return
    */
  def generateRFSizer(numClasses: Int, binNumberShrinked: Int): RFFeatureSizer
}

/**
  * The implementation of RFSplitter when each feature may have a different number of bin (until a max configured value)
  *
  * @param split                  a map which contains the splits for each feature
  * @param typeInfo               the type information for the raw data
  * @param typeInfoWorking        the type information for the working data
  * @param categoricalFeatureInfo the information about the categorical features
  * @param binNumber              the number of bin in the working data
  * @tparam T raw data type
  * @tparam U working data type
  */
class RFSplitterSpecialized[T, U](split: Map[Int, Array[T]],
                                  typeInfo: TypeInfo[T],
                                  typeInfoWorking: TypeInfo[U],
                                  categoricalFeatureInfo: RFCategoryInfo,
                                  binNumber: Int) extends RFSplitter[T, U] {

  def this(split: java.util.HashMap[Int, Array[T]],
           typeInfo: TypeInfo[T],
           typeInfoWorking: TypeInfo[U],
           categoricalFeatureInfo: RFCategoryInfo,
           binNumber: Int) = this(split.asScala, typeInfo, typeInfoWorking, categoricalFeatureInfo, binNumber)

  override def getBinNumber(idFeature: Int): U = {
    if (categoricalFeatureInfo.isCategorical(idFeature))
      typeInfoWorking.fromInt(categoricalFeatureInfo.getArity(idFeature))
    else
      typeInfoWorking.fromInt(split(idFeature).length + 2)
  }

  override def getBin(index: Int, value: T): U = {
    if (typeInfo.isNOTvalidDefined && !typeInfo.isValidForBIN(value)) {
      typeInfoWorking.zero
    } else {
      if (categoricalFeatureInfo.isCategorical(index)) {
        typeInfoWorking.fromInt(typeInfo.toInt(value) + 1)
      } else {
        val split2 = split(index)

        val idx = typeInfo.getIndex(split2, value)
        val idx2 = -idx - 1
        typeInfoWorking.fromInt((Math.min(Math.max(idx, idx2), split2.length) + 1))
      }
    }
  }

  override def getRealCut(index: Int, cut: U): T = {
    typeInfo.getRealCut(typeInfoWorking.toInt(cut), split(index))
  }

  override def generateRFSizer(numClasses: Int): RFFeatureSizer = {
    new RFFeatureSizerSpecialized(split.map(t => (t._1, t._2.length)), numClasses, categoricalFeatureInfo)
  }

  override def generateRFSizer(numClasses: Int, binNumberShrinked: Int): RFFeatureSizer = {
    if (binNumberShrinked != binNumber) {
      new RFFeatureSizerSpecializedModelSelection(split.map(t => (t._1, t._2.length)), numClasses, categoricalFeatureInfo, binNumberShrinked, binNumber)
    } else {
      generateRFSizer(numClasses)
    }
  }
}

/**
  * The implementation of RFSplitter when the same splits are used for all the features
  *
  * @param minT                   the minimum value in the dataset
  * @param maxT                   the maximum value in the dataset
  * @param typeInfo               the type information for the raw data
  * @param typeInfoWorking        the type information for the working data
  * @param numberBin              the number of bin in the working data
  * @param categoricalFeatureInfo the information about the categorical features
  * @tparam T raw data type
  * @tparam U working data type
  */
class RFSplitterSimpleRandom[T, U](minT: T,
                                   maxT: T,
                                   typeInfo: TypeInfo[T],
                                   typeInfoWorking: TypeInfo[U],
                                   numberBin: Int,
                                   categoricalFeatureInfo: RFCategoryInfo) extends RFSplitter[T, U] {

  private val min = typeInfo.toDouble(minT)
  private val max = typeInfo.toDouble(maxT)
  private val range = max - min

  private val randomSplit = Array.fill(numberBin - 1)(Random.nextDouble()).toList.sorted.toArray
  private val splitValue = randomSplit.map(t => (range * t) + min)

  override def getBinNumber(idFeature: Int): U = {
    typeInfoWorking.fromInt(numberBin + 1)
  }

  override def getBin(index: Int, value: T): U = {
    val idx = java.util.Arrays.binarySearch(splitValue, typeInfo.toDouble(value))
    val idx2 = -idx - 1
    typeInfoWorking.fromInt((Math.min(Math.max(idx, idx2), splitValue.length) + 1))
  }

  override def getRealCut(index: Int, cut: U): T = {
    val cutDouble = typeInfoWorking.toInt(cut)
    if (cutDouble < 0)
      typeInfo.fromDouble(0d)
    else if ((cutDouble - 1) >= splitValue.length)
      typeInfo.maxValue
    else {
      typeInfo.fromDouble(splitValue(cutDouble - 1))
    }
  }

  override def generateRFSizer(numClasses: Int): RFFeatureSizer = {
    new RFFeatureSizerSimple(numberBin, numClasses, categoricalFeatureInfo)
  }

  override def generateRFSizer(numClasses: Int, binNumberShrinked: Int): RFFeatureSizer = {
    if (binNumberShrinked != numberBin) {
      new RFFeatureSizerSimpleModelSelection(numberBin, numClasses, categoricalFeatureInfo, binNumberShrinked)
    } else {
      generateRFSizer(numClasses)
    }
  }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace DotNetNuke.Modules.TokenPlayer {

    public partial class Settings {

        /// <summary>
        /// lblFlowplayerKey control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UserControl lblFlowplayerKey;

        /// <summary>
        /// FlowplayerKey control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox FlowplayerKey;

        /// <summary>
        /// lblSecretCode control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UserControl lblSecretCode;

        /// <summary>
        /// SecretCode control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox SecretCode;

        /// <summary>
        /// lblPrimaryDNS control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UserControl lblPrimaryDNS;

        /// <summary>
        /// PrimaryDNS control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox PrimaryDNS;

        /// <summary>
        /// lblPublishingPoint control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UserControl lblPublishingPoint;

        /// <summary>
        /// PublishingPoint control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox PublishingPoint;

        /// <summary>
        /// lblStreamName control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UserControl lblStreamName;

        /// <summary>
        /// StreamName control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox StreamName;
    }
}


text:
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Test Your Knowledge: Saturn</title>
		<link rel="stylesheet" type="text/css" href="css/quiz.css">
	</head>
	<body>

		<!-- markup goes here -->

	</body>
</html>


text:
angular.module('MiChat', [ 'btford.socket-io'])
.factory('mySocket', function (socketFactory) {
  return socketFactory()
})
.controller('ctrlChat', function($scope, $http, mySocket ) {

  $scope.mensajes = []
  $scope.nuevo_mensaje = {
    usuario : '',
    mensaje : ''
  }
  $scope.alguien_escribiendo = 'Node.js + MongoDB + Angular.js + Socket.io'

  $scope.enviarMensaje = function () {
    mySocket.emit('nuevo_mensaje', $scope.nuevo_mensaje)
    $scope.nuevo_mensaje.mensaje = ''
  }
  $scope.escribiendo = function (usuario) {
    mySocket.emit('escribiendo_msj', usuario)
  }

  function scroll(){
    var element = document.getElementById('lista')
    element.scrollTop = element.scrollHeight
  }

  mySocket.on('mensajes', function (mensajes){
     $scope.mensajes = mensajes
     $scope.alguien_escribiendo = 'Node.js + MongoDB + Angular.js + Socket.io'
     setTimeout(scroll,300);
  })
  mySocket.on('escribiendo', function (usuario){
    $scope.alguien_escribiendo = usuario + ' esta escribiendo ...'
  })

})


text:
<?php

require_once 'PHP/PMD/AbstractRule.php';
require_once 'PHP/PMD/Rule/IClassAware.php';

/**
 * This rule checks a given class against a configured weighted method count
 * threshold.
 *
 * @category   PHP
 * @package    PHP_PMD
 * @subpackage Rule_Design
 * @author     Manuel Pichler <mapi@phpmd.org>
 * @copyright  2008-2012 Manuel Pichler. All rights reserved.
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: 1.4.1
 * @link       http://phpmd.org
 * @since      0.2.5
 */
class PHP_PMD_Rule_Design_WeightedMethodCount
       extends PHP_PMD_AbstractRule
    implements PHP_PMD_Rule_IClassAware
{
    /**
     * This method checks the weighted method count for the given class against
     * a configured threshold.
     *
     * @param PHP_PMD_AbstractNode $node The context class node.
     *
     * @return void
     */
    public function apply(PHP_PMD_AbstractNode $node)
    {
        $threshold = $this->getIntProperty('maximum');
        $actual    = $node->getMetric('wmc');

        if ($actual >= $threshold) {
            $this->addViolation($node, array($node->getName(), $actual, $threshold));
        }
    }
}


text:
[![Version](https://img.shields.io/cocoapods/v/GFDeviceExtension.svg?style=flat)](http://cocoapods.org/pods/GTDeviceExtension)
[![License](https://img.shields.io/cocoapods/l/GFDeviceExtension.svg?style=flat)](http://cocoapods.org/pods/GTDeviceExtension)
[![Platform](https://img.shields.io/cocoapods/p/GFDeviceExtension.svg?style=flat)](http://cocoapods.org/pods/GTDeviceExtension)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

GTDeviceExtension is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "GTDeviceExtension"
```

## Author

Guglielmo Faglioni, guglielmo@gorillatech.io

## License

GTDeviceExtension is available under the MIT license. See the LICENSE file for more info.


text:
package org.apache.drill.exec.physical.impl.rangepartitioner;

import java.util.List;

import org.apache.drill.common.expression.FieldReference;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.types.TypeProtos;
import org.apache.drill.common.types.Types;
import org.apache.drill.exec.exception.OutOfMemoryException;
import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.expr.TypeHelper;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.physical.config.RangePartitionSender;
import org.apache.drill.exec.record.AbstractSingleRecordBatch;
import org.apache.drill.exec.record.MaterializedField;
import org.apache.drill.exec.record.RecordBatch;
import org.apache.drill.exec.record.TransferPair;
import org.apache.drill.exec.record.VectorAccessible;
import org.apache.drill.exec.record.VectorWrapper;
import org.apache.drill.exec.vector.IntVector;
import org.apache.drill.exec.vector.ValueVector;

import org.apache.drill.shaded.guava.com.google.common.collect.Lists;

/**
 * A RangePartitionRecordBatch is a run-time operator that provides the ability to divide up the input rows
 * into a fixed number of separate ranges or 'buckets' based on the values of a set of columns (the range
 * partitioning columns).
 */
public class RangePartitionRecordBatch extends AbstractSingleRecordBatch<RangePartitionSender> {
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(RangePartitionRecordBatch.class);

  private int numPartitions;
  private int recordCount;
  private final IntVector partitionIdVector;
  private final List<TransferPair> transfers;

  public RangePartitionRecordBatch(RangePartitionSender popConfig, RecordBatch incoming, FragmentContext context) throws OutOfMemoryException {
    super(popConfig, context, incoming);
    this.numPartitions = popConfig.getDestinations().size();

    SchemaPath outputPath = popConfig.getPartitionFunction().getPartitionFieldRef();
    MaterializedField outputField = MaterializedField.create(outputPath.getAsNamePart().getName(), Types.required(TypeProtos.MinorType.INT));
    this.partitionIdVector = (IntVector) TypeHelper.getNewVector(outputField, oContext.getAllocator());
    this.transfers = Lists.newArrayList();
  }

  @Override
  public void close() {
    super.close();
    partitionIdVector.clear();
  }

  @Override
  protected void killIncoming(boolean sendUpstream) {
    incoming.kill(sendUpstream);
  }

  @Override
  public int getRecordCount() {
    return recordCount;
  }

  @Override
  protected IterOutcome doWork() {
    int num = incoming.getRecordCount();
    if (num > 0) {
      // first setup the partition columns.  This needs to be done whenever we have
      // a new batch (not just a new schema) because the partitioning function needs
      // access to the correct value vector.
      setupPartitionCols(incoming);

      partitionIdVector.allocateNew(num);

      recordCount = projectRecords(num, 0);
      for (VectorWrapper<?> v : container) {
        ValueVector.Mutator m = v.getValueVector().getMutator();
        m.setValueCount(recordCount);
      }
    }
    // returning OK here is fine because the base class AbstractSingleRecordBatch
    // is handling the actual return status; thus if there was a new schema, the
    // parent will get an OK_NEW_SCHEMA based on innerNext() in base class.
    return IterOutcome.OK;
  }

  /**
   * Sets up projection that will transfer all of the columns in batch, and also setup
   * the partition column based on which partition a record falls into
   *
   * @param batch
   * @throws SchemaChangeException
   * @return True if the new schema differs from old schema, False otherwise
   */
  @Override
  protected boolean setupNewSchema() throws SchemaChangeException {
    container.clear();

    for (VectorWrapper<?> vw : incoming) {
      TransferPair tp = vw.getValueVector().getTransferPair(oContext.getAllocator());
      transfers.add(tp);
      container.add(tp.getTo());
    }

    container.add(this.partitionIdVector);
    container.buildSchema(incoming.getSchema().getSelectionVectorMode());
    /*
     * Always return true because we transfer incoming. If upstream sent OK_NEW_SCHEMA,
     * it would also generate new VVs. Since we get them via transfer, we should send
     * OK_NEW_SCHEMA to downstream for it to re-init to the new VVs.
     */
    return true;
  }

  /**
   *  Provide the partition function with the appropriate value vector(s) that
   *  are involved in the range partitioning
   *  @param batch
   */
  private void setupPartitionCols(VectorAccessible batch) {
    List<VectorWrapper<?>> partitionCols = Lists.newArrayList();

    for (VectorWrapper<?> vw : batch) {
      if (isPartitioningColumn(vw.getField().getName())) {
        partitionCols.add(vw);
      }
    }

    popConfig.getPartitionFunction().setup(partitionCols);
  }

  private boolean isPartitioningColumn(String name) {
    List<FieldReference> refList = popConfig.getPartitionFunction().getPartitionRefList();
    for (FieldReference f : refList) {
      if (f.getRootSegment().getPath().equals(name)) {
        return true;
      }
    }
    return false;
  }

  private int getPartition(int index) {
    return popConfig.getPartitionFunction().eval(index, numPartitions);
  }

  /**
   * For each incoming record, get the partition id it belongs to by invoking the
   * partitioning function. Set this id in the output partitionIdVector.  For all other
   * incoming value vectors, just do a transfer.
   * @param recordCount
   * @param firstOutputIndex
   * @return the number of records projected
   */
  private final int projectRecords(final int recordCount, int firstOutputIndex) {
    final int countN = recordCount;
    int counter = 0;
    for (int i = 0; i < countN; i++, firstOutputIndex++) {
      int partition = getPartition(i);
      partitionIdVector.getMutator().setSafe(i, partition);
      counter++;
    }
    for(TransferPair t : transfers){
        t.transfer();
    }
    return counter;
  }

  @Override
  public void dump() {
    logger.error("RangePartitionRecordBatch[container={}, numPartitions={}, recordCount={}, partitionIdVector={}]",
        container, numPartitions, recordCount, partitionIdVector);
  }

}


text:
<!DOCTYPE html >

          <title>OptAnalysisUnits - nounou documentation - nounou.analysis.spikes.OptAnalysisUnits</title>
          <meta name="description" content="OptAnalysisUnits - nounou documentation - nounou.analysis.spikes.OptAnalysisUnits" />
          <meta name="keywords" content="OptAnalysisUnits nounou documentation nounou.analysis.spikes.OptAnalysisUnits" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

nounou.analysis.spikes

OptAnalysisUnits

        abstract
        class

        OptAnalysisUnits extends Opt

          Linear Supertypes

Opt, breeze.util.Opt, AnyRef, Any

            Known Subclasses

OptBlackoutFr, OptPeakHalfWidthMaxFr, OptPeakHalfWidthMinFr, OptThresholdPeakDetectWindow

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

OptAnalysisUnits

Opt

Opt

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Instance Constructors

        new

        OptAnalysisUnits()

Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

AnyRef → Any

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from Opt

Inherited from breeze.util.Opt

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
package org.apache.usergrid.batch;

import org.junit.Ignore;

import org.apache.usergrid.batch.repository.JobDescriptor;

/** @author zznate */
public class BulkTestUtils {

    public static JobFactory getBulkJobFactory() {
        return new MyBulkJobFactory();
    }

    private static class MyBulkJobFactory implements JobFactory {
        /* (non-Javadoc)
         * @see org.apache.usergrid.batch.JobFactory#jobsFrom(org.apache.usergrid.batch.repository.JobDescriptor)
         */
        @Override
        public Job jobsFrom( JobDescriptor descriptor ) {
            return  new MyBulkJob();
        }
    }

    private static class MyBulkJob implements Job {
        @Override
        public void execute( JobExecution execution ) throws Exception {
            // do some stuff

        }

        @Override
        public void dead( final JobExecution execution ) throws Exception {
            //To change body of implemented methods use File | Settings | File Templates.
        }
    }
}


text:
from django import forms
from django.db import models
from django.test import SimpleTestCase, TestCase

from .models import Post

class TextFieldTests(TestCase):

    def test_max_length_passed_to_formfield(self):
        """
        TextField passes its max_length attribute to form fields created using
        their formfield() method.
        """
        tf1 = models.TextField()
        tf2 = models.TextField(max_length=2345)
        self.assertIsNone(tf1.formfield().max_length)
        self.assertEqual(2345, tf2.formfield().max_length)

    def test_choices_generates_select_widget(self):
        """A TextField with choices uses a Select widget."""
        f = models.TextField(choices=[('A', 'A'), ('B', 'B')])
        self.assertIsInstance(f.formfield().widget, forms.Select)

    def test_to_python(self):
        """TextField.to_python() should return a string."""
        f = models.TextField()
        self.assertEqual(f.to_python(1), '1')

    def test_lookup_integer_in_textfield(self):
        self.assertEqual(Post.objects.filter(body=24).count(), 0)

    def test_emoji(self):
        p = Post.objects.create(title='Whatever', body='Smile 😀.')
        p.refresh_from_db()
        self.assertEqual(p.body, 'Smile 😀.')

class TestMethods(SimpleTestCase):
    def test_deconstruct(self):
        field = models.TextField()
        *_, kwargs = field.deconstruct()
        self.assertEqual(kwargs, {})
        field = models.TextField(db_collation='utf8_esperanto_ci')
        *_, kwargs = field.deconstruct()
        self.assertEqual(kwargs, {'db_collation': 'utf8_esperanto_ci'})


text:
@implementation GEDirection

- (instancetype)initWithFromLocation:(NSString*)fromLocation toLocation:(NSString*)toLocation date:(NSDate*)date {
    self = [super init];
    if (self) {
        _fromLocation = fromLocation;
        _toLocation = toLocation;
        _date = date;
    }
    return self;
}

@end


text:
describe('toggleDragModeOnDblclick (option)', () => {
  it('should toggle drag mode on double click', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {

      ready() {
        const { dragBox } = cropper;

        expect(dragBox.className).include('cropper-crop');
        expect(dragBox.dataset.cropperAction).to.equal('crop');
        dragBox.dispatchEvent(window.createEvent('dblclick'));
        expect(dragBox.className).include('cropper-move');
        expect(dragBox.dataset.cropperAction).to.equal('move');
        done();
      },
    });

    expect(cropper.options.toggleDragModeOnDblclick).to.be.true;
  });

  it('should not toggle drag mode on double click', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      toggleDragModeOnDblclick: false,

      ready() {
        const { dragBox } = cropper;

        expect(dragBox.className).include('cropper-crop');
        expect(dragBox.dataset.cropperAction).to.equal('crop');
        dragBox.dispatchEvent(window.createEvent('dblclick'));
        expect(dragBox.className).include('cropper-crop');
        expect(dragBox.dataset.cropperAction).to.equal('crop');
        done();
      },
    });

    expect(cropper.options.toggleDragModeOnDblclick).to.be.false;
  });
});


text:
import numpy as np

import pandas as pd

class BooleanArray:
    def setup(self):
        self.values_bool = np.array([True, False, True, False])
        self.values_float = np.array([1.0, 0.0, 1.0, 0.0])
        self.values_integer = np.array([1, 0, 1, 0])
        self.values_integer_like = [1, 0, 1, 0]
        self.data = np.array([True, False, True, False])
        self.mask = np.array([False, False, True, False])

    def time_constructor(self):
        pd.arrays.BooleanArray(self.data, self.mask)

    def time_from_bool_array(self):
        pd.array(self.values_bool, dtype="boolean")

    def time_from_integer_array(self):
        pd.array(self.values_integer, dtype="boolean")

    def time_from_integer_like(self):
        pd.array(self.values_integer_like, dtype="boolean")

    def time_from_float_array(self):
        pd.array(self.values_float, dtype="boolean")

class IntegerArray:
    def setup(self):
        self.values_integer = np.array([1, 0, 1, 0])
        self.data = np.array([1, 2, 3, 4], dtype="int64")
        self.mask = np.array([False, False, True, False])

    def time_constructor(self):
        pd.arrays.IntegerArray(self.data, self.mask)

    def time_from_integer_array(self):
        pd.array(self.values_integer, dtype="Int64")


text:
package org.fusesource.process.fabric.child;

import com.google.common.collect.Maps;
import org.fusesource.common.util.Objects;
import org.fusesource.fabric.agent.download.DownloadManager;
import org.fusesource.fabric.agent.download.DownloadManagers;
import org.fusesource.fabric.api.Container;
import org.fusesource.fabric.api.FabricService;
import org.fusesource.fabric.api.Profile;
import org.fusesource.fabric.internal.ProfileOverlayImpl;
import org.fusesource.process.fabric.child.support.ByteToStringValues;
import org.fusesource.process.fabric.child.support.LayOutPredicate;
import org.fusesource.process.fabric.child.tasks.ApplyConfigurationTask;
import org.fusesource.process.fabric.child.tasks.CompositeTask;
import org.fusesource.process.fabric.child.tasks.DeploymentTask;
import org.fusesource.process.manager.InstallOptions;
import org.fusesource.process.manager.InstallTask;
import org.fusesource.process.manager.Installation;
import org.fusesource.process.manager.ProcessController;
import org.fusesource.process.manager.ProcessManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 */
public class ChildProcessManager {
    private static final transient Logger LOG = LoggerFactory.getLogger(ChildProcessManager.class);

    private final ExecutorService executorService = Executors.newSingleThreadExecutor();
    private FabricService fabricService;
    private ProcessManager processManager;

    public void destroy() {
        executorService.shutdown();
    }

    public FabricService getFabricService() {
        return fabricService;
    }

    public void setFabricService(FabricService fabricService) {
        this.fabricService = fabricService;
    }

    public ProcessManager getProcessManager() {
        return processManager;
    }

    public void setProcessManager(ProcessManager processManager) {
        this.processManager = processManager;
    }

    Installation provisionProcess(ProcessRequirements requirements) throws Exception {
        // TODO check that the installation is the same
        uninstallProcess(requirements);

        String id = requirements.getId();
        InstallOptions installOptions = requirements.createInstallOptions();
        Profile processProfile = getProcessProfile(requirements, true);
        Profile deployProcessProfile = getProcessProfile(requirements, false);
        Map<String, String> configuration = getProcessLayout(processProfile, requirements.getLayout());

        DownloadManager downloadManager = DownloadManagers
                .createDownloadManager(fabricService, processProfile, executorService);
        InstallTask applyConfiguration = new ApplyConfigurationTask(configuration, installOptions.getProperties());
        InstallTask applyProfile = new DeploymentTask(downloadManager, deployProcessProfile);
        InstallTask compositeTask = new CompositeTask(applyConfiguration, applyProfile);
        Installation installation = processManager.install(installOptions, compositeTask);
        if (installation != null) {
            installation.getController().start();
        }
        return installation;
    }

    void uninstallProcess(ProcessRequirements requirements) throws Exception {
        String id = requirements.getId();

        Installation installation = findProcessInstallation(id);
        // for now lets remove it just in case! :)
        if (installation != null) {
            ProcessController controller = installation.getController();
            try {
                controller.stop();
            } catch (Exception e) {
                LOG.warn("Ignored exception while trying to stop process " + installation + " " + e);
            }
            controller.uninstall();
            controller = null;
        }
    }

    protected Profile getProcessProfile(ProcessRequirements requirements, boolean includeController) {
        Container container = fabricService.getCurrentContainer();
        Profile processProfile = new ProfileOverlayImpl(new ProcessProfile(container, requirements, fabricService, includeController), true,
                                fabricService.getDataStore(), fabricService.getEnvironment());
        return processProfile;
    }

    protected Map<String, String> getProcessLayout(Profile profile, String layoutPath) {
        return ByteToStringValues.INSTANCE.apply(Maps.filterKeys(profile.getFileConfigurations(), new LayOutPredicate(layoutPath)));
    }

    protected Installation findProcessInstallation(String id) {
        List<Installation> installations = processManager.listInstallations();
        for (Installation installation : installations) {
            String name = installation.getName();
            if (Objects.equal(id, name)) {
                return installation;
            }
        }
        return null;
    }

}


text:
package petablox.project.analyses.parallelizer;

public enum Mode {
	MASTER,
	WORKER
}


text:
package scouter.javassist.bytecode;

/**
 * A collection of static methods for reading and writing a byte array.
 */
public class ByteArray {
    /**
     * Reads an unsigned 16bit integer at the index.
     */
    public static int readU16bit(byte[] code, int index) {
        return ((code[index] & 0xff) << 8) | (code[index + 1] & 0xff);
    }

    /**
     * Reads a signed 16bit integer at the index.
     */
    public static int readS16bit(byte[] code, int index) {
        return (code[index] << 8) | (code[index + 1] & 0xff);
    }

    /**
     * Writes a 16bit integer at the index.
     */
    public static void write16bit(int value, byte[] code, int index) {
        code[index] = (byte)(value >>> 8);
        code[index + 1] = (byte)value;
    }

    /**
     * Reads a 32bit integer at the index.
     */
    public static int read32bit(byte[] code, int index) {
        return (code[index] << 24) | ((code[index + 1] & 0xff) << 16)
               | ((code[index + 2] & 0xff) << 8) | (code[index + 3] & 0xff);
    }

    /**
     * Writes a 32bit integer at the index.
     */
    public static void write32bit(int value, byte[] code, int index) {
        code[index] = (byte)(value >>> 24);
        code[index + 1] = (byte)(value >>> 16);
        code[index + 2] = (byte)(value >>> 8);
        code[index + 3] = (byte)value;
    }

    /**
     * Copies a 32bit integer.
     *
     * @param src       the source byte array.
     * @param isrc      the index into the source byte array.
     * @param dest      the destination byte array.
     * @param idest     the index into the destination byte array.
     */
    static void copy32bit(byte[] src, int isrc, byte[] dest, int idest) {
        dest[idest] = src[isrc];
        dest[idest + 1] = src[isrc + 1];
        dest[idest + 2] = src[isrc + 2];
        dest[idest + 3] = src[isrc + 3];
    }
}


text:
define( [ 'Renderer' ], function( Renderer ) {

    function epsilon( v ){
        return Math.abs( v ) < 0.000001 ? 0 : v;
    }

    function cameraCSSMatrix( matrix ){

        return 'matrix3d(' +
            epsilon(   matrix[ 0 ]  ) + ',' +
            epsilon( - matrix[ 1 ]  ) + ',' +
            epsilon(   matrix[ 2 ]  ) + ',' +
            epsilon(   matrix[ 3 ]  ) + ',' +
            epsilon(   matrix[ 4 ]  ) + ',' +
            epsilon( - matrix[ 5 ]  ) + ',' +
            epsilon(   matrix[ 6 ]  ) + ',' +
            epsilon(   matrix[ 7 ]  ) + ',' +
            epsilon(   matrix[ 8 ]  ) + ',' +
            epsilon( - matrix[ 9 ]  ) + ',' +
            epsilon(   matrix[ 10 ] ) + ',' +
            epsilon(   matrix[ 11 ] ) + ',' +
            epsilon(   matrix[ 12 ] ) + ',' +
            epsilon( - matrix[ 13 ] ) + ',' +
            epsilon(   matrix[ 14 ] ) + ',' +
            epsilon(   matrix[ 15 ] ) +
        ')';

    }

    function nodeMatrix( matrix ) {

        return 'translate3d(-50%,-50%,0) matrix3d(' +
            epsilon(   matrix[ 0 ]  ) + ',' +
            epsilon(   matrix[ 1 ]  ) + ',' +
            epsilon(   matrix[ 2 ]  ) + ',' +
            epsilon(   matrix[ 3 ]  ) + ',' +
            epsilon( - matrix[ 4 ]  ) + ',' +
            epsilon( - matrix[ 5 ]  ) + ',' +
            epsilon( - matrix[ 6 ]  ) + ',' +
            epsilon( - matrix[ 7 ]  ) + ',' +
            epsilon(   matrix[ 8 ]  ) + ',' +
            epsilon(   matrix[ 9 ]  ) + ',' +
            epsilon(   matrix[ 10 ] ) + ',' +
            epsilon(   matrix[ 11 ] ) + ',' +
            epsilon(   matrix[ 12 ] ) + ',' +
            epsilon(   matrix[ 13 ] ) + ',' +
            epsilon(   matrix[ 14 ] ) + ',' +
            epsilon(   matrix[ 15 ] ) +
        ')';

    };

    var CSS3DRenderer = Renderer.extend( {

        initialize: function( element ){

            CSS3DRenderer.super.initialize.call( this, element || document.createElement( 'div' ) );

            this.cameraElement = document.createElement( 'div' );

            this.cameraElement.style.WebkitTransformStyle = 'preserve-3d';
            this.cameraElement.style.MozTransformStyle = 'preserve-3d';
            this.cameraElement.style.oTransformStyle = 'preserve-3d';
            this.cameraElement.style.transformStyle = 'preserve-3d';

            element = this.element;
            element.style.overflow = 'hidden';

            element.style.WebkitTransformStyle = 'preserve-3d';
            element.style.MozTransformStyle = 'preserve-3d';
            element.style.oTransformStyle = 'preserve-3d';
            element.style.transformStyle = 'preserve-3d';

            element.appendChild( this.cameraElement );

            this.__defineSetter__( 'width', function( w ){
                var element = this.element;
                this.__width = w;
                element.style.width = w + 'px';
                element.tagName.toLowerCase( ) === 'canvas' && ( element.width = w );
                this.cameraElement.style.width = w + 'px';
            } );
            this.__defineSetter__( 'height', function( h ){
                var element = this.element;
                this.__height = h;
                element.style.height = h + 'px';
                element.tagName.toLowerCase( ) === 'canvas' && ( element.height = h );
                this.cameraElement.style.height = h + 'px';
            } );

        },

        render: function( scene, camera ){

            var fov = 0.5 / Math.tan( camera.fov * 0.5 * ( Math.PI / 180 ) ) * this.height;

            var element = this.element;

            element.style.WebkitPerspective = fov + 'px';
            element.style.MozPerspective = fov + 'px';
            element.style.oPerspective = fov + 'px';
            element.style.perspective = fov + 'px';

            var projector = this.projector;

            var objects = projector.projectScene( scene, camera ).css3DObjects;

            var style = 'translate3d(0,0,' + fov + 'px)' + cameraCSSMatrix( projector.cameraViewMatrix ) +
                ' translate3d(' + this.width * 0.5 + 'px,' + this.height * 0.5 + 'px, 0)';

            var cameraElement = this.cameraElement;

            cameraElement.style.WebkitTransform = style;
            cameraElement.style.MozTransform = style;
            cameraElement.style.oTransform = style;
            cameraElement.style.transform = style;

            for ( var i = 0, il = objects.length; i < il; i ++ ) {

                var object = objects[ i ];

                var element = object.element;

                style = nodeMatrix( object.worldMatrix );

                element.style.WebkitTransform = style;
                element.style.MozTransform = style;
                element.style.oTransform = style;
                element.style.transform = style;

                if ( !element.parentNode || element.parentNode !== this.cameraElement ) {

                    this.cameraElement.appendChild( element );

                }

            }

        }

    } );

    return CSS3DRenderer;

} );


text:
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Text,
  StatusBar,
} from 'react-native';

import AppleHealthKit from 'rn-apple-healthkit';
const PERMS = AppleHealthKit.Constants.Permissions;

export class App extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      Weight: false,
      Height: false,
      DateOfBirth: false,
    };
  }

  componentDidMount() {
    const healthKitOptions = {
        permissions: {
            read:  [
                PERMS.DateOfBirth,
                PERMS.Weight,
            ]
        }
    };

    AppleHealthKit.initHealthKit(healthKitOptions, (err, results) => {
      if (err) {
        console.log("error initializing Healthkit: ", err);
        return;
      }

      // Date of Birth Example
      AppleHealthKit.getDateOfBirth(null, (err, results) => {
        this.setState({
          DateOfBirth: results
        })
      });

      // Get Latest Weight
      AppleHealthKit.getLatestWeight(null, (err: string, results: Object) => {
        this.setState({
          Weight: results
        })
      });

    });

  }

  render() {
    const {
      DateOfBirth,
      Weight
    } = this.state;

    return (
      <View>
        <StatusBar barStyle="dark-content" />
        <SafeAreaView>
          <ScrollView
            contentInsetAdjustmentBehavior="automatic"
            style={styles.scrollView}>
            <View style={styles.body}>
              <View style={styles.sectionContainer}>
                <Text style={styles.sectionTitle}>Weight</Text>
                {(Weight) &&
                  <Text style={styles.sectionDescription}>
                  {Weight.value}
                  </Text>
                }
                {(!Weight) &&
                  <Text style={styles.sectionDescriptionError}>
                  Add your Weight to Health App!
                  </Text>
                }
              </View>
              <View style={styles.sectionContainer}>
                <Text style={styles.sectionTitle}>Age</Text>
                {(DateOfBirth) &&
                  <Text style={styles.sectionDescription}>
                  {DateOfBirth.age}
                  </Text>
                }
                {(!DateOfBirth) &&
                  <Text style={styles.sectionDescriptionError}>
                  Add your Birthday to Health App!
                  </Text>
                }
              </View>
            </View>
          </ScrollView>
        </SafeAreaView>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: '#FFF',
  },
  body: {
    backgroundColor: '#FFF',
  },
  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: '600',
    color: '#000',
  },
  sectionDescription: {
    marginTop: 8,
    fontSize: 18,
    fontWeight: '400',
    color: '#555',
  },
  sectionDescriptionError: {
    marginTop: 8,
    fontSize: 18,
    fontWeight: '400',
    color: '#A00000'
  },
});

export default App;


text:
/* eslint-disable */

'use strict';

/*::
import type { ConcreteRequest, Mutation } from 'relay-runtime';
export type ActorNameChangeInput = {|
  clientMutationId?: ?string,
  newName?: ?string,
|};
export type validateMutationTest2ChangeNameMutation$variables = {|
  input: ActorNameChangeInput,
|};
export type validateMutationTest2ChangeNameMutation$data = {|
  +actorNameChange: ?{|
    +actor: ?{|
      +name: ?string,
    |},
  |},
|};
export type validateMutationTest2ChangeNameMutation = {|
  variables: validateMutationTest2ChangeNameMutation$variables,
  response: validateMutationTest2ChangeNameMutation$data,
|};
*/

var node/*: ConcreteRequest*/ = (function(){
var v0 = [
  {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "input"
  }
],
v1 = [
  {
    "kind": "Variable",
    "name": "input",
    "variableName": "input"
  }
],
v2 = {
  "alias": null,
  "args": null,
  "kind": "ScalarField",
  "name": "name",
  "storageKey": null
};
return {
  "fragment": {
    "argumentDefinitions": (v0/*: any*/),
    "kind": "Fragment",
    "metadata": null,
    "name": "validateMutationTest2ChangeNameMutation",
    "selections": [
      {
        "alias": null,
        "args": (v1/*: any*/),
        "concreteType": "ActorNameChangePayload",
        "kind": "LinkedField",
        "name": "actorNameChange",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": null,
            "kind": "LinkedField",
            "name": "actor",
            "plural": false,
            "selections": [
              (v2/*: any*/)
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Mutation",
    "abstractKey": null
  },
  "kind": "Request",
  "operation": {
    "argumentDefinitions": (v0/*: any*/),
    "kind": "Operation",
    "name": "validateMutationTest2ChangeNameMutation",
    "selections": [
      {
        "alias": null,
        "args": (v1/*: any*/),
        "concreteType": "ActorNameChangePayload",
        "kind": "LinkedField",
        "name": "actorNameChange",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": null,
            "kind": "LinkedField",
            "name": "actor",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "__typename",
                "storageKey": null
              },
              (v2/*: any*/),
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "id",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ]
  },
  "params": {
    "cacheID": "2d953f7584501927922c57165679b5e3",
    "id": null,
    "metadata": {},
    "name": "validateMutationTest2ChangeNameMutation",
    "operationKind": "mutation",
    "text": "mutation validateMutationTest2ChangeNameMutation(\n  $input: ActorNameChangeInput!\n) {\n  actorNameChange(input: $input) {\n    actor {\n      __typename\n      name\n      id\n    }\n  }\n}\n"
  }
};
})();

if (__DEV__) {
  (node/*: any*/).hash = "b253eaee773f43048515e1ded4ee72aa";
}

module.exports = ((node/*: any*/)/*: Mutation<
  validateMutationTest2ChangeNameMutation$variables,
  validateMutationTest2ChangeNameMutation$data,
>*/);


text:
/**
 *

 * marcosnr
 * 30/03/2012
 */
package au.org.aurin.wif.demand;

import java.util.HashSet;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import au.org.aurin.wif.exception.config.ParsingException;
import au.org.aurin.wif.exception.config.WifInvalidConfigException;
import au.org.aurin.wif.exception.validate.WifInvalidInputException;
import au.org.aurin.wif.impl.demand.DemandConfigurator;
import au.org.aurin.wif.model.demand.DemandConfig;
import au.org.aurin.wif.model.demand.DemographicData;
import au.org.aurin.wif.model.demand.DemographicTrend;
import au.org.aurin.wif.model.demand.EmploymentSector;
import au.org.aurin.wif.repo.WifProjectDao;
import au.org.aurin.wif.svc.WifKeys;
import au.org.aurin.wif.svc.suitability.DemandConfigService;

/**
 * The Class CreateTrendIT.
 */
@ContextConfiguration(locations = { "/test-integration-context.xml" })
public class CreateTrendIT extends AbstractTestNGSpringContextTests {

  /**
   * logger.
   */
  private static final Logger LOGGER = LoggerFactory
      .getLogger(CreateTrendIT.class);

  /** The demand analyzer. */
  @Autowired
  private DemandConfigurator demandConfigurator;

  /** The wif project dao. */
  @Autowired
  private WifProjectDao wifProjectDao;

  @Resource
  private DemandConfigService demandConfigService;

  private DemandConfig demandConfig;

  /**
   * Load wif project.
   *
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   * @throws ParsingException
   * @throws WifInvalidInputException
   */
  @BeforeClass(enabled = true)
  public void loadWifProject() throws WifInvalidConfigException,
      WifInvalidInputException, ParsingException {

    demandConfig = demandConfigService.getDemandConfig(WifKeys.TEST_PROJECT_ID);
    Assert.assertNotNull(demandConfig.getId());
    Assert.assertNotNull(demandConfig.getCurrentDemographic()
        .getResidentialCurrentData().iterator().next().getResidentialLU());
    Assert.assertNotNull(demandConfig.getCurrentDemographic()
        .getEmploymentCurrentDatas().iterator().next().getSector());
    Assert.assertNotNull(demandConfig.getSectors().iterator().next()
        .getAssociatedLUs().size());
    Assert.assertNotNull(demandConfig.getEmploymentPastTrendInfos().iterator()
        .next().getEmploymentEntries().iterator().next().getSector());
  }

  /**
   * Creates the residential test.
   *
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *           the wif invalid config exception
   */
  @Test(enabled = true, groups = { "demand" })
  public void createResidentialTest() throws Exception,
      WifInvalidConfigException {
    LOGGER.debug("Creating residential trend Test");
    DemographicTrend dt = new DemographicTrend();
    dt.setLabel("Growth Trend");
    dt.setDemographicData(new HashSet<DemographicData>());
    dt = demandConfigurator
        .createResidentialTrendFromPastData(demandConfig, dt);

    Double populationGrowthRate = demandConfig.getPopulationGrowthRate();
    Assert.assertEquals(populationGrowthRate, 0.08775606478849363);
  }

  /**
   * Creates the employment test.
   *
   * @throws WifInvalidInputException
   *           the wif invalid input exception
   * @throws WifInvalidConfigException
   *
   *           the wif invalid config exception
   */
  @Test(enabled = true, groups = { "demand" })
  public void createEmploymentTest() throws Exception,
      WifInvalidConfigException {
    LOGGER.debug("Creating employment trend Test");
    DemographicTrend dt = new DemographicTrend();
    dt.setLabel("Growth Trend");
    dt.setDemographicData(new HashSet<DemographicData>());
    dt = demandConfigurator.createEmploymentTrendFromPastData(demandConfig, dt);

    EmploymentSector sectorAgricultureHunting = demandConfig
        .getSectorByLabel("Ag/Forest/Fish/Hunt");
    Double employeeGrowthRate = demandConfig
        .getEmploymentGrowthRate(sectorAgricultureHunting);
    Assert.assertEquals(employeeGrowthRate, -0.05882352941176472);
  }
}


text:
package org.spanna.event.entity;

import org.spanna.entity.Entity;
import org.spanna.entity.LivingEntity;
import org.spanna.entity.Projectile;
import org.spanna.event.Cancellable;
import org.spanna.event.HandlerList;
import org.spanna.inventory.ItemStack;

/**
 * Called when a LivingEntity shoots a bow firing an arrow
 */
public class EntityShootBowEvent extends EntityEvent implements Cancellable {
    private static final HandlerList handlers = new HandlerList();
    private final ItemStack bow;
    private Entity projectile;
    private final float force;
    private boolean cancelled;

    public EntityShootBowEvent(final LivingEntity shooter, final ItemStack bow, final Projectile projectile, final float force) {
        super(shooter);
        this.bow = bow;
        this.projectile = projectile;
        this.force = force;
    }

    @Override
    public LivingEntity getEntity() {
        return (LivingEntity) entity;
    }

    /**
     * Gets the bow ItemStack used to fire the arrow.
     *
     * @return the bow involved in this event
     */
    public ItemStack getBow() {
        return bow;
    }

    /**
     * Gets the projectile which will be launched by this event
     *
     * @return the launched projectile
     */
    public Entity getProjectile() {
        return projectile;
    }

    /**
     * Replaces the projectile which will be launched
     *
     * @param projectile the new projectile
     */
    public void setProjectile(Entity projectile) {
        this.projectile = projectile;
    }

    /**
     * Gets the force the arrow was launched with
     *
     * @return bow shooting force, up to 1.0
     */
    public float getForce() {
        return force;
    }

    public boolean isCancelled() {
        return cancelled;
    }

    public void setCancelled(boolean cancel) {
        cancelled = cancel;
    }

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }
}


text:
/*Registration picture*/
#reg_picture_upload{
    width:27%;
    min-width:100px;
    min-height:100px;
    float:left;
}

#reg_picture
{
    width: 155px;
    height: 155px;
    margin:auto;

    margin-right:10px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    border:1px solid #bcbcbc;
    padding-top:3px;
    padding-left:3px;
}

#reg_picture #image-add-right {
    width: 100%;
    height: 165px;
}
#reg_picture #image-add-right iframe {
    width: 100%;
    height: 195px;
    overflow: hidden;
}

#under_button_text
{
    margin-top: 48px;
    margin-bottom:5px;
    text-align: right;
    margin-right:10px;
    padding-right:10px;
    font-size:10px;
}

/*Registration account details*/
#reg_form{
    width:60%;
    float:left;
    margin-left:25px;
}

#content form table
{
    margin:0px;
}

.loginbox form table tr td .create_account{
    font-size:18px;
    margin-bottom:10px;
}

#content .loginbox{
    border:0px;
}

#content form table td:first-child{
    padding-top: 10px;
    font-size:20px;
    width:170px;
    font-weight:bold;
    color:#464646;
}

#content form table td:last-child{
    width:240px;
}

#reg_upload_button
{
    cursor:pointer;
    padding:5px;
    margin:auto;
    margin-top:10px;
    margin-right:10px;
    border:1px solid #bcbcbc;
    display:none;
    width:140px;
    text-align:center;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

#reg_upload_button:hover{
    background: #eeeeee
}

.reg_terms
{
    margin-top:25px;
    margin-bottom:10px;
    margin-left: 0px;
    font-size:16px;
    font-weight: normal;
    color:#464646;
}

#content .loginbox .login{
    margin-right:25px;
}

.login a{
    color:black;
}

.error ul{
    list-style: none;
    margin: 5px;
}
.error{
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    width: 51%;
}

#addressDataRegisterForm {
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 20px;
    width: 100%;
}
#map_reg{
    float:right;
}

#map_reg .button{
    width:40%;
    padding-bottom:15px;
}

#map_reg #location_info {
    float: right;
    margin-top: 10px;
    font-size: 12px;
    font-family: MYRIADPRO-REGULAR, sans-serif;
    margin-bottom: 30px;
}

#content #addressDataRegisterForm #map_canvas {
    margin-top: 5px;
    height:400px;
    width:550px;
    top:0px;
    border: 1px solid black;
}

#content #map_reg input[type='submit']{
   float:right;
   margin:0px;
   width: 177px;
   height: 66px;
   font-size: 26px;
   font-family: MYRIADPRO-BOLDCOND, sans-serif;
}

#content form table#fenchy_regularuserbundle_userregular_locationtype {
    margin-left: auto;
    margin-right: auto;
    width: 40%;
}

#content form table#fenchy_regularuserbundle_userregular_locationtype .pin, #content form table#fenchy_userbundle_twitter .pin {
    color: #464646;;
}

#content form table#fenchy_userbundle_facebook .pin {
    color: #464646;
}

#content form table#fenchy_regularuserbundle_userregular_locationtype input, #content form table#fenchy_userbundle_twitter input {
    margin: 0;
}
#content form table#fenchy_regularuserbundle_userregular_locationtype td:last-child {
    text-align: left;
}

#content form table#fenchy_regularuserbundle_userregular_locationtype td:last-child input{
  /*  width: 60%;*/
}

#content form table#fenchy_regularuserbundle_userregular_locationtype td #not_shown, #content form table#fenchy_userbundle_twitter td #not_shown{
    color: #cacaca;
    font-size:11px;
    width: 100%;
    float:left;
    text-align: right;
}

#content form table#fenchy_regularuserbundle_userregular_locationtype tr:last-child td input[type='submit']{
    text-align:center;
    width:20%;
    float:right;
}

#addressDataRegisterMsg {
    margin-left: 255px;
    margin-bottom: 30px;
}

#addressDataRegisterMsg p {
    font-size:22px;
    font-family: MYRIADPRO-BOLDCOND, sans-serif;
}

#content form table#fenchy_regularuserbundle_userregular_locationtype td:first-child {
    padding-top: 0;
    width: 80px;
}
#content form table#fenchy_regularuserbundle_userregular_locationtype td ul {
    margin: 0;
    margin-bottom: 15px;
    padding: 5px;
    list-style: none;
    color: red;
    text-align: left;
    font-size: 18px;
}

/*Preregister  */

#content #preregister{
    padding:10px;
    width:50%;
    margin:auto;
}

#content #preregister hr{
    margin-top: 30px;
    margin-bottom: 30px;
    border:1px solid #e8e8e8;
}

#content #preregister .pre_reg_sign
{
    text-align: center;
    margin-bottom:20px;
}

#content #preregister .bold_link{
    color: #464646;
    font-weight: bold;
    cursor: pointer;
}

#content #preregister .new_at_fenchy{
    margin-top:20px;
    text-align: center;
    font-size:22px;
    font-family: MYRIADPRO-BOLD, serif;
    color: #464646;
}

#content #preregister .tw_fb_logins
{
   width:100%;
   margin-top:25px;
   margin-bottom: 30px;
}

#content #preregister .tw_fb_logins a
{
    padding:20px;
    padding-right:50px;
    padding-left:50px;
    font-size:24px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
}

#content #preregister .tw_fb_logins a.facebook
{
    margin:0px;

}

#content #preregister .tw_fb_logins .firstletter{
    font-weight:bold;
    font-size:48px;
    margin-right:0px;
    position: relative;
    top:8px;
    left:-5px;
}

#content #preregister .tw_fb_logins .separator{
    margin-right:10px;
    margin-left:10px;
    font-size:30px;
}

a#registration-terms, a#registration-privacy {
    color: #464646;
}


text:
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

describe "IO.foreach" do
  before :each do
    @name = fixture __FILE__, "lines.txt"
    @count = 0
    ScratchPad.record []
  end

  ruby_version_is "1.9" do
    before :each do
      Encoding.default_external = Encoding::UTF_8
      @orig_exteenc = Encoding.default_external
    end

    after :each do
      Encoding.default_external = @orig_exteenc
    end
  end

  it "raises TypeError if the first parameter is nil" do
    lambda { IO.foreach(nil) {} }.should raise_error(TypeError)
  end

  it "raises Errno::ENOENT if the file does not exist" do
    lambda { IO.foreach(tmp("nonexistent.txt")) {} }.should raise_error(Errno::ENOENT)
  end

  it "converts first parameter to string and uses as file name" do
    obj = mock('lines.txt fixture')
    obj.should_receive(:to_str).and_return(@name)
    IO.foreach(obj) { |l| ScratchPad << l }
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
    ScratchPad.recorded.should == IOSpecs.lines
end
  end

  ruby_version_is "1.8.7" do
    it "returns an Enumerator when called without a block" do
      IO.foreach(@name).should be_an_instance_of(enumerator_class)
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
      IO.foreach(@name).to_a.should == IOSpecs.lines
end
    end
  end

  describe "with no separator argument" do
    it "yields a sequence of Strings that were separated by $/" do
      IO.foreach(@name) { |l| ScratchPad << l }
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
      ScratchPad.recorded.should == IOSpecs.lines
end
    end

    it "updates $. with each yield" do
      IO.foreach(@name) { $..should == @count += 1 }
    end
  end

  ruby_version_is "1.9.2" do
    it "accepts an optional options argument" do
      IO.foreach(@name, :mode => 'r') {|l| ScratchPad << l}
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
      ScratchPad.recorded.should == IOSpecs.lines
end
    end
  end

  describe "with nil as the separator argument" do
    it "yields a single string with entire content" do
      IO.foreach(@name, nil) { |l| ScratchPad << l }
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
      ScratchPad.recorded.should == [IOSpecs.lines.join]
end
    end

    it "updates $. with each yield" do
      IO.foreach(@name, nil) { $..should == @count += 1 }
    end
  end

  describe "with an empty String as the separator argument" do
    it "yields a sequence of paragraphs when the separator is an empty string" do
      IO.foreach(@name, "") { |l| ScratchPad << l }
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
      ScratchPad.recorded.should == IOSpecs.lines_empty_separator
end
    end

    it "updates $. with each yield" do
      IO.foreach(@name, "") { $..should == @count += 1 }
    end
  end

  describe "with an arbitrary String as the separator argument" do
    it "yields a sequence of Strings that were separated by r" do
      IO.foreach(@name, "r") { |l| ScratchPad << l }
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
      ScratchPad.recorded.should == IOSpecs.lines_r_separator
end
    end

    it "updates $. with each yield" do
      IO.foreach(@name, "la") { $..should == @count += 1 }
    end

if System.get_property('platform') != 'ANDROID'
    it "accepts non-ASCII data as separator" do
      IO.foreach(@name, "\303\250") { |l| ScratchPad << l }
      ScratchPad.recorded.should == IOSpecs.lines_arbitrary_separator
    end
end
  end

  describe "with an object as the separator argument" do
    ruby_version_is "" ... "1.9" do
      it "calls #to_str once to convert it to a String" do
        obj = mock("IO.foreach separator 'r'")
        obj.should_receive(:to_str).once.and_return("r")
        IO.foreach(@name, obj) { |l| ScratchPad << l }
if System.get_property('platform') == 'WINDOWS' || System.get_property('platform') == 'WINDOWS_DESKTOP'
        ScratchPad.recorded.should == IOSpecs.lines_r_separator
end
      end
    end

    ruby_version_is "1.9" do
if System.get_property('platform') != 'ANDROID'
      it "calls #to_str once for each line read to convert it to a String" do
        obj = mock("IO.foreach separator 'r'")
        obj.should_receive(:to_str).exactly(6).times.and_return("r")
        IO.foreach(@name, obj) { |l| ScratchPad << l }
        ScratchPad.recorded.should == IOSpecs.lines_r_separator
      end

      it "calls #to_path on non-String arguments" do
        path = mock("IO.foreach path")
        path.should_receive(:to_path).and_return(@name)
        IO.foreach(path).to_a.should == IOSpecs.lines
      end
end
    end
  end

  describe "when the filename starts with |" do
    #it "gets data from the standard out of the subprocess" do
    #  IO.foreach("|sh -c 'echo hello;echo line2'") { |l| ScratchPad << l }
    #  ScratchPad.recorded.should == ["hello\n", "line2\n"]
    #end

    #it "gets data from a fork when passed -" do
    #  parent_pid = $$
    #
    #  ret = IO.foreach("|-") { |l| ScratchPad << l; true }
    #
    #  if $$ == parent_pid
    #    ScratchPad.recorded.should == ["hello\n", "from a fork\n"]
    #  else # child
    #    puts "hello"
    #    puts "from a fork"
    #    exit!
    #  end
    #end
  end

end


text:
/*
 *  utils/stdinc.h
 *
 *  Copyleft (C) 2015  Geo-X Team
 *
 * Standart includes.
 */

/* C includes */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <signal.h>
#include <limits.h>
#include <fcntl.h>
#include <netdb.h>
#include <errno.h>
#include <time.h>

/* Linux includes */
#include <sys/utsname.h>


text:
package org.apache.oodt.cas.filemgr.browser.model;

import org.apache.oodt.cas.filemgr.structs.Element;
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.ProductType;
import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
import org.apache.oodt.cas.filemgr.structs.exceptions.ValidationLayerException;
import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.cas.metadata.Metadata;

import java.net.URL;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

import org.apache.lucene.analysis.standard.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.Query;

public class CasDB {

  URL filemgrUrl;
  XmlRpcFileManagerClient client;
  public Results results;

  private static String freeTextBlock = "__FREE__";

  public CasDB() {
    filemgrUrl = null;
  }

  public boolean connect(String cas) {
    try {
      filemgrUrl = new URL(cas);
      client = new XmlRpcFileManagerClient(filemgrUrl);
    } catch (Exception e) {
      filemgrUrl = null;
      return false;
    }
    return true;
  }

  public boolean disconnect() {
    filemgrUrl = null;
    return true;
  }

  public boolean isConnected() {
    if (filemgrUrl == null) {
      return false;
    } else
      return true;
  }

  public String[] getAvailableTypes() {
    String[] types = null;
    if (filemgrUrl != null) {
      try {
        Vector<ProductType> v = (Vector<ProductType>) client.getProductTypes();
        Vector<String> names = new Vector<String>();
        types = new String[v.size()];

        for (int i = 0; i < v.size(); i++)
          names.add(v.get(i).getName());

        Collections.sort(names);
        names.toArray(types);

      } catch (RepositoryManagerException e) {
        // e.printStackTrace();
      }

    } else {
      types = new String[1];
      types[0] = "";
    }

    return types;
  }

  public String[] getAvailableElements(String productTypeName) {
    String[] elements = null;
    if (filemgrUrl != null) {
      try {
        ProductType pt = client.getProductTypeByName(productTypeName);
        Vector<Element> v = (Vector<Element>) client
            .getElementsByProductType(pt);
        Vector<String> names = new Vector<String>();
        elements = new String[v.size()];

        for (int i = 0; i < v.size(); i++)
          names.add(v.get(i).getElementName());

        Collections.sort(names);
        names.toArray(elements);

      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      elements = new String[1];
      elements[0] = "";
    }
    return elements;
  }

  public String getElementID(String elementName) {
    String elementID = new String();
    Element e;
    try {
      e = client.getElementByName(elementName);
      elementID = e.getElementId();
    } catch (ValidationLayerException e1) {
    }
    return elementID;
  }

  public boolean issueQuery(org.apache.oodt.cas.filemgr.structs.Query query,
      String productType) {
    results = new Results();
    try {
      ProductType type = client.getProductTypeByName(productType);
      Vector<Product> products = (Vector<Product>) client.query(query, type);
      int maxVal = 20;
      if (products.size() < maxVal)
        maxVal = products.size();
      for (int i = 0; i < maxVal; i++) {
        Vector<Element> elements = (Vector<Element>) client
            .getElementsByProductType(type);
        Metadata m = client.getMetadata(products.get(i));
        Hashtable hash = m.getHashtable();
        results.addProduct(m);
      }
    } catch (Exception e) {
      return false;
    }

    return true;
  }

  public boolean createQuery(String queryText, String productType) {

    results = new Results();
    if (queryText.trim().equals("*")) {
      ProductType type;
      try {
        type = client.getProductTypeByName(productType);
        Vector<Product> products = (Vector<Product>) client
            .getProductsByProductType(type);
        // for(int i=0;i<products.size();i++){
        int maxVal = 20;
        if (products.size() < maxVal)
          maxVal = products.size();
        for (int i = 0; i < maxVal; i++) {
          Vector<Element> elements = (Vector<Element>) client
              .getElementsByProductType(type);
          Metadata m = client.getMetadata(products.get(i));
          Hashtable hash = m.getHashtable();
          results.addProduct(m);
        }
      } catch (Exception e) {
        return false;
      }

    } else {

      QueryBuilder qb = new QueryBuilder(this);
      org.apache.oodt.cas.filemgr.structs.Query casQ = qb.ParseQuery(queryText);
      ProductType type = null;
      try {
        type = client.getProductTypeByName(productType);
        Vector<Product> products = (Vector<Product>) client.query(casQ, type);
        int maxVal = 20;
        if (products.size() < maxVal)
          maxVal = products.size();
        for (int i = 0; i < maxVal; i++) {
          Vector<Element> elements = (Vector<Element>) client
              .getElementsByProductType(type);
          Metadata m = client.getMetadata(products.get(i));
          Hashtable hash = m.getHashtable();
          results.addProduct(m);
        }
      } catch (Exception e) {
        return false;
      }

    }

    return true;
  }

  public boolean clearQuery() {
    results = null;
    return true;
  }

}