text:
#ifndef JUCE_TEXTPROPERTYCOMPONENT_H_INCLUDED
#define JUCE_TEXTPROPERTYCOMPONENT_H_INCLUDED

//==============================================================================
/**
    A PropertyComponent that shows its value as editable text.

    @see PropertyComponent
*/
class JUCE_API  TextPropertyComponent  : public PropertyComponent
{
protected:
    //==============================================================================
    /** Creates a text property component.

        @param propertyName  The name of the property
        @param maxNumChars   If not zero, then this specifies the maximum allowable length of
                             the string. If zero, then the string will have no length limit.
        @param isMultiLine   isMultiLine sets whether the text editor allows carriage returns.

        @see TextEditor
    */
    TextPropertyComponent (const String& propertyName,
                           int maxNumChars,
                           bool isMultiLine);

public:
    /** Creates a text property component.

        @param valueToControl The Value that is controlled by the TextPropertyCOmponent
        @param propertyName   The name of the property
        @param maxNumChars    If not zero, then this specifies the maximum allowable length of
                              the string. If zero, then the string will have no length limit.
        @param isMultiLine    isMultiLine sets whether the text editor allows carriage returns.

        @see TextEditor
    */
    TextPropertyComponent (const Value& valueToControl,
                           const String& propertyName,
                           int maxNumChars,
                           bool isMultiLine);

    /** Destructor. */
    ~TextPropertyComponent();

    //==============================================================================
    /** Called when the user edits the text.

        Your subclass must use this callback to change the value of whatever item
        this property component represents.
    */
    virtual void setText (const String& newText);

    /** Returns the text that should be shown in the text editor. */
    virtual String getText() const;

    /** Returns the text that should be shown in the text editor as a Value object. */
    Value& getValue() const;

    //==============================================================================
    /** A set of colour IDs to use to change the colour of various aspects of the component.

        These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
        methods.

        @see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
    */
    enum ColourIds
    {
        backgroundColourId          = 0x100e401,    /**< The colour to fill the background of the text area. */
        textColourId                = 0x100e402,    /**< The colour to use for the editable text. */
        outlineColourId             = 0x100e403,    /**< The colour to use to draw an outline around the text area. */
    };

    void colourChanged() override;

    //==============================================================================
    class JUCE_API Listener
    {
    public:
        /** Destructor. */
        virtual ~Listener() {}

        /** Called when text has finished being entered (i.e. not per keypress) has changed. */
        virtual void textPropertyComponentChanged (TextPropertyComponent*) = 0;
    };

    /** Registers a listener to receive events when this button's state changes.
        If the listener is already registered, this will not register it again.
        @see removeListener
    */
    void addListener (Listener* newListener);

    /** Removes a previously-registered button listener
        @see addListener
    */
    void removeListener (Listener* listener);

    //==============================================================================
    /** @internal */
    void refresh() override;
    /** @internal */
    virtual void textWasEdited();

private:
    class LabelComp;
    friend class LabelComp;

    ScopedPointer<LabelComp> textEditor;
    ListenerList<Listener> listenerList;

    void callListeners();
    void createEditor (int maxNumChars, bool isMultiLine);

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextPropertyComponent)
};

#ifndef DOXYGEN
 /** This typedef is just for compatibility with old code and VC6 - newer code should use TextPropertyComponent::Listener instead. */
 typedef TextPropertyComponent::Listener TextPropertyComponentListener;
#endif

#endif   // JUCE_TEXTPROPERTYCOMPONENT_H_INCLUDED


text:
import {Dispatcher} from './CarbonFlux';

import LayoutStore from './layout/LayoutStore';

import RichPanelConfig from "./RichPanelConfig";
import LibraryProgressStore from './library/LibraryProgressStore';

import WorkspaceStore from "./workspace/WorkspaceStore";
// import ManageStylesDialogStore from "./properties/dialogs/ManageStylesDialogStore"

export class Application {
    dispatch(action) {
        if (action.async) {
            this.Dispatcher.dispatchAsync(action);
        } else {
            this.Dispatcher.dispatch(action);
        }
    }

    constructor(options) {
        this.Dispatcher = Dispatcher;
        window.richApp = this;

        this.layoutStore = LayoutStore;

        this.libraryProgressStore = new LibraryProgressStore(this.Dispatcher);

        this.layoutStore.setLayout("edit", RichPanelConfig.edit);

        this.workspaceStore = new WorkspaceStore(this.Dispatcher);

        // this.manageStylesDialogStore = new ManageStylesDialogStore(this.Dispatcher);
    }
}

export const app = new Application({});
export const richApp = app;
export const dispatcher = app.Dispatcher;

redpajama_set_name: RedPajamaGithub


text:
{% extends "base.html" %}
{% import "macros.html" as macros %}

{% macro request_header(attr, title, class=None) -%}
{{ title }}
{% if attr != None and attr in filters.get('sort', 'submit_timestamp') %}
{% if filters.get('sort', 'submit_timestamp')[0] == '-' %}

{% else %}

{% endif %}
{% else %}

{% endif %}

{%- endmacro %}

{% macro request_cell(attr, content, filterable=True) -%}
{% if (filterable == None and attr not in ['id', 'submit_timestamp', 'payout']) or filterable == True %}
{{ content }}
{% else %}
{{ content }}
{% endif %}
{%- endmacro %}

{% block head %}
{{ super() }}
<link rel="alternate" type="application/rss+xml" href="{{ url_for(request.endpoint, division_id=request.view_args.get('division_id'), _external=True) ~ 'rss.xml' }}">
{% endblock head %}

{% block content %}

      {# TRANS: This is a label for a text box that allow people to search for requests meeting certain criteria, like what system the loss occured in, what ship type it was, who the pilot was, or what corporation they're in. #}
      {% trans %}Filters{% endtrans %}
      <input type="text" class="form-control filter-tokenfield">

    {% block table %}

        {% block table_headers %}
        {# TRANS: A table column header for the ID number of a request. #}
        {{ request_header("id", gettext("Request ID")) }}
        {# TRANS: A table column header for the pilot of a request. #}
        {{ request_header("pilot", gettext("Pilot")) }}
        {# TRANS: A table column header for the ship from a request. #}
        {{ request_header("ship", gettext("Ship")) }}
        {# TRANS: A table column header for the pilot of a request. #}
        {{ request_header("system", gettext("System")) }}
        {# TRANS: A table column header for the status of a request (like evaluating, incomplete, approved, rejected). #}
        {{ request_header("status", gettext("Status")) }}
        {# TRANS: A table column header for the current payout of a request. #}
        {{ request_header("payout", gettext("Payout")) }}
        {# TRANS: A table column header for the date and time a request was submitted. #}
        {{ request_header("submit_timestamp", gettext("Submit Time")) }}
        {# TRANS: A table column header for the of the division a request was submitted to. #}
        {{ request_header("division", gettext("Division")) }}
        {% endblock table_headers %}

      {% for request in pager.items %}

        {% block table_row scoped %}
        {{ request.id }}
        {{ request_cell('pilot', request.pilot.name) }}
        {{ request_cell('ship', request.ship_type) }}
        {{ request_cell('system', request.system) }}
        {{ request_cell('status', request.status) }}
        {{ request_cell('payout', request.payout|currencyfmt, False) }}
        {{ request_cell('submit_timestamp', request.timestamp|datetimeformat(format='short'), False) }}
        {{ request_cell('division', request.division.name) }}
        {% endblock table_row %}

      {% endfor %}

    {% endblock table %}
    {% block pagination %}

      {% if pager.pages > 1 %}

      {% else %}

      {% endif %}
        {% if pager.has_prev %}

«

        {% else %}

«

        {% endif %}
        {% for page in pager.iter_pages() %}
          {% if page %}
            {% if page != pager.page %}

{{ page }}

            {% else %}

{{ page }} (current)

            {% endif %}
          {% else %}

…

          {% endif %}
        {% endfor %}
        {% if pager.has_next %}

»

        {% else %}

»

        {% endif %}

      {# TRANS: A small line showing how many total requests there are. #}
      {{ ngettext('%(num)s request', '%(num)s requests', pager.total)|format(num=(pager.total|numberfmt)) }} • {{ total_payouts|currencyfmt }} ISK

    {% endblock pagination %}

{% endblock content %}


text:
  Melin est
       un village
       géographiquement positionné dans le département de Haute-Saône en Franche-Comté. Elle totalisait 68 habitants en 2008.

Si vous envisagez de emmenager à Melin, vous pourrez aisément trouver une maison à acheter.

À proximité de Melin sont localisées les villes de
Combeaufontaine située à 5 km, 538 habitants,
Lavigney à 3 km, 123 habitants,
La Barre située à 2 km, 96 habitants,
Malvillers située à 3 km, 74 habitants,
Gourgeon située à 2 km, 234 habitants,
Semmadon située à 3 km, 121 habitants,
 entre autres. De plus, Melin est située à seulement 27 km de Vesoul.

Le nombre de logements, à Melin, se décomposait en 2011 en quatre appartements et 33 maisons soit
 un marché plutôt équilibré.


text:
'use strict';

var eslint = require('eslint/lib/cli');
var gulp = require('gulp');
var globby = require('globby');
var config = require('../../config');

// run eslint without an additional plugin
gulp.task('lint', function(done) {

  // patterns with the same form as gulp.src(patterns)
  var patterns = config.lint.src;

  globby(patterns).then(function(paths) {
    var code = eslint.execute(paths.join(' '));

    if (err) {
      done(err);
      return;
    }

    // additional CLI options can be added here
    if (code) {
      // eslint output already written, wrap up with a short message
      done(new gutil.PluginError('lint', new Error('ESLint error')));
      return;
    }
    done();
  });
});


text:
import {Company} from "./company";
import {Product, Area} from "./product";
import {Skill} from "./employee";

export enum ProjectType {Startup, Upgrade, Outsource};
export enum ProjectStatus {Active, Cancelled, Closed};

export class Project {
    public _id: any;
    public name: string = '';
    public hours: number = 0;
    public hoursCompleted: number = 0;
    public startDate: number = 0;  // timestamp
    public lastActivityDate: number = 0;  // timestamp
    public endDate: number = 0;  // timestamp
    public area: Area = Area.Client;
    public type: ProjectType = ProjectType.Startup;
    public status: ProjectStatus = ProjectStatus.Active;
    public description: string = '';
    public skills: [Skill] = [] as [Skill];

    public reward: ProjectReward = <ProjectReward>{};

    /**
     *  Some object that may be processed and applied to Company or Product, or Employees ???... anyhow the soil of the
     *  game seems...
     */
    // public completitionBonus: Company;

    // Refs
    public company: Company = new Company;
    public product: Product = new Product;
}

export class ProjectReward {
    company?: {
        funds: number,
        net:number
    };
    product?: {
        net: number,
        monthly: number;
    }
}


text:
package com.ninja.animated;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;

// Since this is an object collection, use a FragmentStatePagerAdapter,
// and NOT a FragmentPagerAdapter.
public class MovieSwipeAdapter extends FragmentStatePagerAdapter {
    public MovieSwipeAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
        Fragment fragment = new SuggestionFragment();
        Bundle args = new Bundle();
        args.putInt(SuggestionFragment.ARG_OBJECT, i + 1);
        // Fragment returns a movie suggestion based on the argument.
        fragment.setArguments(args);
        return fragment;
    }

    // Must override, use some large number for now.
    @Override
    public int getCount() {
        return 100;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return "OBJECT " + (position + 1);
    }
}


text:
OmniAuth.config.logger = Rails.logger

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :google_oauth2, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"]
end


text:
name: "\U0001F4DA Documentation/Examples"
about: Describe this issue template's purpose here.
title: "[Docs]"
labels: documentation
assignees: ''

---

# 📚 Documentation/Examples

** Is there documentation missing? **
<!-- Let us know what modules have missing or incomplete documentation -->

** Is documentation wrong? **
<!-- Let us know if you find a mistake in the documentation! -->

** Is there a feature that needs some example code? **
<!-- Let us know if we're missing any example notebooks -->

** Think you know how to fix the docs? ** (If so, we'd love a pull request from you!)

- Link to [GPyTorch documentation](https://gpytorch.readthedocs.io)
- Link to [GPyTorch examples](https://github.com/cornellius-gp/gpytorch/tree/master/examples)


text:
import pytest

from pants.util.eval import parse_expression

class TestParseLiteral:
    def test_success_simple(self) -> None:
        literal = parse_expression("'42'", acceptable_types=str)
        assert "42" == literal

    def test_success_mixed(self) -> None:
        literal = parse_expression("42", acceptable_types=(float, int))
        assert 42 == literal

    def test_success_complex_syntax(self) -> None:
        assert 3 == parse_expression("1+2", acceptable_types=int)

    def test_success_list_concat(self) -> None:
        # This is actually useful in config files.
        assert [1, 2, 3] == parse_expression("[1, 2] + [3]", acceptable_types=list)

    def test_failure_type(self) -> None:
        # Prove there is no syntax error in the raw value.
        literal = parse_expression("1.0", acceptable_types=float)
        assert 1.0 == literal

        # Now we can safely assume the ValueError is raise due to type checking.
        with pytest.raises(ValueError):
            parse_expression("1.0", acceptable_types=int)


text:
require 'ads_common/savon_service'
require 'dfp_api/v201502/report_service_registry'

module DfpApi; module V201502; module ReportService
  class ReportService < AdsCommon::SavonService
    def initialize(config, endpoint)
      namespace = 'https://www.google.com/apis/ads/publisher/v201502'
      super(config, endpoint, namespace, :v201502)
    end

    def get_report_download_url(*args, &block)
      return execute_action('get_report_download_url', args, &block)
    end

    def get_report_download_url_to_xml(*args)
      return get_soap_xml('get_report_download_url', args)
    end

    def get_report_download_url_with_options(*args, &block)
      return execute_action('get_report_download_url_with_options', args, &block)
    end

    def get_report_download_url_with_options_to_xml(*args)
      return get_soap_xml('get_report_download_url_with_options', args)
    end

    def get_report_job(*args, &block)
      return execute_action('get_report_job', args, &block)
    end

    def get_report_job_to_xml(*args)
      return get_soap_xml('get_report_job', args)
    end

    def run_report_job(*args, &block)
      return execute_action('run_report_job', args, &block)
    end

    def run_report_job_to_xml(*args)
      return get_soap_xml('run_report_job', args)
    end

    private

    def get_service_registry()
      return ReportServiceRegistry
    end

    def get_module()
      return DfpApi::V201502::ReportService
    end
  end
end; end; end


text:
<?xml version="1.0"?>
<!-- "Bug299819 -->
<test>
<setup arch="i686">
	<system file="Bug299819-2-system.xml.gz"/>
	<channel file="Bug299819-2-package.xml.gz" name="1" />
	<locale name="de" />
	<locale name="de_DE" />
</setup>
<trial>
<install channel="1" kind="package" name="autoconf" arch="i586" version="2.60" release="21"/>
<install channel="1" kind="package" name="automake" arch="i586" version="1.9.6" release="35"/>
<install channel="1" kind="package" name="bzip2" arch="i586" version="1.0.3" release="36"/>
<install channel="1" kind="package" name="yast2-devel" arch="i586" version="2.14.15" release="3"/>
<install channel="1" kind="package" name="autoyast2" arch="noarch" version="2.14.15" release="9"/>
<install channel="1" kind="package" name="autoyast2-installation" arch="noarch" version="2.14.15" release="9"/>
<install channel="1" kind="package" name="bitstream-vera" arch="noarch" version="1.10" release="199"/>
<install channel="1" kind="package" name="yast2-cd-creator" arch="noarch" version="2.14.0" release="20"/>
<install channel="1" kind="package" name="yast2-iscsi-server" arch="noarch" version="2.14.0" release="15"/>
<install channel="1" kind="package" name="yast2-slp-server" arch="noarch"
version="2.14.1" release="3"/>
<reportproblems/>
<showpool all="yes" prefix=">!> pool:"/>
</trial>
</test>


text:
<?php

namespace UniMapper\Query;

use UniMapper\Exception,
    UniMapper\Entity\Reflection;

class UpdateOne extends \UniMapper\Query
{

    /** @var \UniMapper\Entity */
    protected $entity;

    /** @var mixed */
    protected $primaryValue;

    public function __construct(
        Reflection $reflection,
        $primaryValue,
        array $data
    ) {
        parent::__construct($reflection);

        $this->primaryValue = $primaryValue;

        // Primary value update is not allowed
        if (!$reflection->hasPrimary()) {
            throw new Exception\QueryException(
                "Entity '" . $reflection->getClassName() . "' has no "
                . "primary property!"
            );
        }

        // Do not change primary value
        unset($data[$reflection->getPrimaryProperty()->getName()]);

        $this->entity = $reflection->createEntity($data);
    }

    protected function onExecute(\UniMapper\Connection $connection)
    {
        $adapter = $connection->getAdapter($this->reflection->getAdapterName());
        $mapper = $connection->getMapper();

        $values = $mapper->unmapEntity($this->entity);

        // Values can not be empty
        if (empty($values)) {
            throw new Exception\QueryException("Nothing to update!");
        }

        $query = $adapter->createUpdateOne(
            $this->reflection->getAdapterResource(),
            $this->reflection->getPrimaryProperty()->getUnmapped(),
            $mapper->unmapValue(
                $this->reflection->getPrimaryProperty(),
                $this->primaryValue
            ),
            $values
        );

        return (bool) $adapter->execute($query);
    }

}


text:
const fs = require('fs');
const sinon = require('sinon');
const os = require('os');
const rimraf = require('rimraf');
const Dumper = require('../../../services/dumper');
const context = require('../../../context');
const initContext = require('../../../context/init');

initContext(context);
const injectedContext = context.inject();

const DOCKER_COMPOSE_FILE_LOCATION = './test-output/Linux/docker-compose.yml';
const DOT_ENV_FILE_LOCATION = './test-output/Linux/.env';

function cleanOutput() {
  rimraf.sync('./test-output/Linux');
}

/**
 * @param {{
 *   dbConnectionUrl?: string;
 *   appHostname?: string;
 *   appPort?: number;
 * }} [overrides]
 */
async function createLinuxDump(optionsOverrides = {}, injectedContextOverrides = {}) {
  const config = {
    appName: 'test-output/Linux',
    dbDialect: 'mysql',
    dbConnectionUrl: 'mysql://localhost:8999',
    ssl: false,
    dbSchema: 'public',
    appHostname: 'localhost',
    appPort: 1654,
    ...optionsOverrides,
  };

  const dumper = new Dumper({ ...injectedContext, ...injectedContextOverrides });
  await dumper.dump({}, config);
}

describe('services > dumper', () => {
  describe('on a linux based OS', () => {
    describe('when the database is on the local machine', () => {
      let osStub;

      // eslint-disable-next-line jest/no-hooks
      beforeAll(() => {
        osStub = sinon.stub(os, 'platform');
        osStub.returns('linux');
      });

      // eslint-disable-next-line jest/no-hooks
      afterAll(() => {
        osStub.restore();
      });

      it('should not make use of `host.docker.internal`', async () => {
        expect.assertions(2);

        await createLinuxDump();

        const dockerComposeFile = fs.readFileSync(DOCKER_COMPOSE_FILE_LOCATION, 'utf-8');
        const dotEnvFile = fs.readFileSync(DOT_ENV_FILE_LOCATION, 'utf-8');

        expect(dockerComposeFile).not.toContain('host.docker.internal');
        expect(dotEnvFile).not.toContain('host.docker.internal');

        cleanOutput();
      });

      describe('when the database is local on the system', () => {
        it('should use `network` option set to `host` in the docker-compose file', async () => {
          expect.assertions(1);

          await createLinuxDump();

          const dockerComposeFile = fs.readFileSync(DOCKER_COMPOSE_FILE_LOCATION, 'utf-8');
          expect(dockerComposeFile).toContain('network: host');

          cleanOutput();
        });
      });

      describe('when the database is not local on the system', () => {
        it('should not use `network` option in the docker-compose file', async () => {
          expect.assertions(1);

          await createLinuxDump({ dbConnectionUrl: 'mysql://example.com:8999' });

          const dockerComposeFile = fs.readFileSync(DOCKER_COMPOSE_FILE_LOCATION, 'utf-8');
          expect(dockerComposeFile).not.toContain('network');

          cleanOutput();
        });
      });
    });
  });

  describe('generation of APPLICATION_URL', () => {
    /**
     * @param {{appHostname?: string; appPort?: number}} overrides
     */
    async function generateEnvFile(overrides) {
      await createLinuxDump(overrides);

      return fs.readFileSync(DOT_ENV_FILE_LOCATION, 'utf-8');
    }

    describe('with an external application url', () => {
      it('should generate an APPLICATION_URL without the port number', async () => {
        expect.assertions(1);
        try {
          const dotEnvFile = await generateEnvFile({
            appHostname: 'agent.forestadmin.com',
          });

          expect(dotEnvFile).toContain('APPLICATION_URL=http://agent.forestadmin.com');
        } finally {
          cleanOutput();
        }
      });

      it('should generate an APPLICATION_URL with the right protocol and without the port number', async () => {
        expect.assertions(1);

        try {
          const dotEnvFile = await generateEnvFile({
            appHostname: 'https://agent.forestadmin.com',
          });

          expect(dotEnvFile).toContain('APPLICATION_URL=https://agent.forestadmin.com');
        } finally {
          cleanOutput();
        }
      });
    });

    describe('with a local url', () => {
      it('should append the port number to the url', async () => {
        expect.assertions(1);

        try {
          const dotEnvFile = await generateEnvFile({
            appHostname: 'http://localhost',
            appPort: 3333,
          });

          expect(dotEnvFile).toContain('APPLICATION_URL=http://localhost:3333');
        } finally {
          cleanOutput();
        }
      });

      it('should add the protocol and append the port number', async () => {
        expect.assertions(1);

        try {
          const dotEnvFile = await generateEnvFile({
            appHostname: 'localhost',
            appPort: 3333,
          });

          expect(dotEnvFile).toContain('APPLICATION_URL=http://localhost:3333');
        } finally {
          cleanOutput();
        }
      });
    });

    describe('using an environment variable FOREST_URL', () => {
      async function generateDockerComposeFile(contextOverrides) {
        await createLinuxDump({}, contextOverrides);

        return fs.readFileSync(DOCKER_COMPOSE_FILE_LOCATION, 'utf-8');
      }

      describe('when the variable is defined', () => {
        it('should add the FOREST_URL definition in docker-compose file', async () => {
          expect.assertions(1);

          try {
            const dockerComposeFile = await generateDockerComposeFile({
              env: {
                FOREST_URL: 'https://api.something.com',
              },
            });

            // eslint-disable-next-line no-template-curly-in-string
            expect(dockerComposeFile).toContain('FOREST_URL=${FOREST_URL-https://api.something.com}');
          } finally {
            cleanOutput();
          }
        });
      });

      describe('when the variable is not defined', () => {
        it('should not add the FOREST_URL definition in docker-compose file', async () => {
          expect.assertions(1);

          try {
            const dockerComposeFile = await generateDockerComposeFile();

            expect(dockerComposeFile).not.toContain('FOREST_URL');
          } finally {
            cleanOutput();
          }
        });
      });
    });
  });
});


text:
<app-nav-bar></app-nav-bar>

No Page Exists with that name. Please Try again!


text:
import sys

from zeus.constants import Result, Status, RESULT_PRIORITY, STATUS_PRIORITY

def safe_agg(func, sequence, default=None):
    m = None
    for item in sequence:
        if item is None:
            continue

        elif m is None:
            m = item
        else:
            m = func(m, item)
    if m is None:
        m = default
    return m

def _aggregate_constant(item_list, priority_list, default):
    value = default
    priority = sys.maxsize
    for item_value in item_list:
        if item_value == default:
            continue

        idx = priority_list.index(item_value)
        if idx < priority:
            value = item_value
            priority = idx

    return value

def _aggregate_constant_result(item_list, priority_list, default):
    value = default
    priority = sys.maxsize
    for item_value in item_list:
        idx = priority_list.index(item_value)
        if idx < priority:
            value = item_value
            priority = idx

    return value

def aggregate_status(status_list):
    return _aggregate_constant(status_list, STATUS_PRIORITY, Status.unknown)

def aggregate_result(result_list):
    return _aggregate_constant_result(result_list, RESULT_PRIORITY, Result.unknown)


text:
package net.mentalarray.doozie.Internal.RPC

import java.util.UUID

import scala.util.{Failure, Success}

/**
 * Created by kdivincenzo on 2/4/15.
 */
sealed trait IpcMessage {

  /**
   * Get the byte array representation of the message
   * @return A Byte array containing the bytes necessary to rebuild the message across IPC boundaries
   */
  def toBytes : Array[Byte]

}

/**
 * All the messages that the stub and the parent process can exchange
 */
object Messages extends Logging
{

  private final val TrueByte  = 1 : Byte
  private final val FalseByte = 0 : Byte

  abstract class MessageBase protected() extends IpcMessage {

    val messageCode : Byte

    def toBytes : Array[Byte] = {
      val internalBytes = serialize()
      Seq(Array(messageCode), internalBytes).flatten.toArray
    }

    protected def serialize() : Array[Byte]

  }

  def deserialize(bytes: Array[Byte]) : IpcMessage = {

    // Setup the ByteStream
    val stream = new ByteStream(bytes)

    // Get the header byte and the length
    val hByte = stream.readByte

    // Depending on the message type
    hByte match {
      // Is Online
      case 0 => IsOnline()
      // CheckOnline
      case 1 => CheckOnline()
      // PigTaskData
      case 2 => {
        // Read the contents
        val payloadBytes = stream.readToEnd
        // Convert to a string
        val payload = Serializer.stringFromBytes(payloadBytes)
        // Debug
        Log debug s"PigTask XML: $payload"
        // Convert to XML
        val pigXml = scala.xml.XML.loadString(payload)
        // Produce -> PigTask
        PigTaskData(PigTask.fromXml(pigXml))
      }
      // PigResult
      case 3 => {
        // Get the next (final) byte
        val bloatedBool = stream.readByte
        // Check
        if (bloatedBool == TrueByte) PigResult(true)
        else if (bloatedBool == FalseByte) PigResult(false)
        else throw new Exception(s"Unknown PigResult: $bloatedBool")
      }
      // RemoteException
      case 4 => {
        // Read the exception data
        val exData = stream.readToEnd
        // Deserialize into an exception
        val ex = Serializer.deserialize[Exception](exData)
        // Produce -> StubException or error
        ex match {
          case Success(e) => RemoteException(e)
          case Failure(t) => throw t
        }
      }
       // StubOnline
      case 5 => {
        // Read the UUID
        val uuid = stream.readUUID
        // Produce -> StubOnline
        StubOnline(uuid)
      }
      // All others
      case _ => throw new Exception(s"Unknown Message Code: $hByte")
    }

  }

  // Message code is one byte, this one will be (Byte)0
  case class IsOnline() extends MessageBase {
    override val messageCode: Byte = 0
    override def serialize(): Array[Byte] = Array()
  }

  case class CheckOnline() extends MessageBase {
    override val messageCode: Byte = 1
    override def serialize(): Array[Byte] = Array()
  }

  case class PigTaskData(pigTask: PigTask) extends MessageBase {
    private lazy val bytes = {
      val taskXml = pigTask.toXml.toString
      taskXml.getBytes
    }
    override val messageCode: Byte = 2
    override def serialize() : Array[Byte] = bytes
  }

  case class PigResult(didPass: Boolean) extends MessageBase {
    override val messageCode: Byte = 3
    override def serialize(): Array[Byte] = {
      val bloatedBool: Byte = if (didPass == true) TrueByte else FalseByte
      Array(bloatedBool)
    }
  }

  case class RemoteException(e: Exception) extends MessageBase {
    private lazy val maybeBytes = Serializer.serialize(e)
    override val messageCode: Byte = 4
    override def serialize() : Array[Byte] = maybeBytes match {
      case Success(arr) => arr
      case Failure(e) => throw e
    }
  }

  case class StubOnline(id: UUID) extends MessageBase {
    private lazy val bytes = Serializer.getBytes(id)
    override val messageCode: Byte = 5
    override def serialize() : Array[Byte] = bytes
  }
}


text:
package lib

import (
	"encoding/xml"
	"os"
	"time"

	oss "github.com/aliyun/aliyun-oss-go-sdk/oss"
	. "gopkg.in/check.v1"
)

func (s *OssutilCommandSuite) TestBucketLogPutSuccess(c *C) {
	// put logging
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	bucketLog := bucketName + "-log"
	s.putBucket(bucketLog, c)

	// cors command test
	var str string
	strMethod := "put"
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	logArgs := []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, "")}
	_, err := cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)
	time.Sleep(time.Second * 3)

	// check,get logging
	logDownName := randLowStr(12) + "-log-down"
	strMethod = "get"
	options = OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	logArgs = []string{CloudURLToString(bucketName, ""), logDownName}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check logging
	_, err = os.Stat(logDownName)
	c.Assert(err, IsNil)

	logBody := s.readFile(logDownName, c)

	logXml := oss.LoggingXML{}
	err = xml.Unmarshal([]byte(logBody), &logXml)
	c.Assert(err, IsNil)
	c.Assert(logXml.LoggingEnabled.TargetBucket, Equals, bucketLog)

	os.Remove(logDownName)
	s.removeBucket(bucketName, true, c)
	s.removeBucket(bucketLog, true, c)
}

func (s *OssutilCommandSuite) TestBucketLogDeleteSuccess(c *C) {
	// put logging
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	bucketLog := bucketName + "-log"
	s.putBucket(bucketLog, c)

	// cors command test
	var str string
	strMethod := "put"
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	prefixName := "test"
	logArgs := []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, prefixName)}
	_, err := cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check,get logging
	logDownName := randLowStr(12) + "-log-down"
	strMethod = "get"
	logArgs = []string{CloudURLToString(bucketName, ""), logDownName}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check logging
	_, err = os.Stat(logDownName)
	c.Assert(err, IsNil)

	logBody := s.readFile(logDownName, c)
	logXml := oss.LoggingXML{}
	err = xml.Unmarshal([]byte(logBody), &logXml)
	c.Assert(err, IsNil)
	c.Assert(logXml.LoggingEnabled.TargetBucket, Equals, bucketLog)
	c.Assert(logXml.LoggingEnabled.TargetPrefix, Equals, prefixName)

	// then delete logging
	strMethod = "delete"
	logArgs = []string{CloudURLToString(bucketName, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check again
	strMethod = "get"
	os.Remove(logDownName)
	logArgs = []string{CloudURLToString(bucketName, ""), logDownName}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check logging
	_, err = os.Stat(logDownName)
	c.Assert(err, IsNil)

	logBody = s.readFile(logDownName, c)

	logXml = oss.LoggingXML{}
	err = xml.Unmarshal([]byte(logBody), &logXml)
	c.Assert(err, IsNil)
	c.Assert(logXml.LoggingEnabled.TargetBucket, Equals, "")
	c.Assert(logXml.LoggingEnabled.TargetPrefix, Equals, "")

	os.Remove(logDownName)
	s.removeBucket(bucketName, true, c)
	s.removeBucket(bucketLog, true, c)
}

func (s *OssutilCommandSuite) TestBucketLogGetToStdout(c *C) {
	// put logging
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	bucketLog := bucketName + "-log"
	s.putBucket(bucketLog, c)

	// cors command test
	var str string
	strMethod := "put"
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	prefixName := "test"
	logArgs := []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, prefixName)}
	_, err := cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check,get logging
	strMethod = "get"
	logArgs = []string{CloudURLToString(bucketName, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	s.removeBucket(bucketName, true, c)
	s.removeBucket(bucketLog, true, c)
}

func (s *OssutilCommandSuite) TestBucketLogGetConfirm(c *C) {
	// put logging
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	bucketLog := bucketName + "-log"
	s.putBucket(bucketLog, c)

	// cors command test
	var str string
	strMethod := "put"
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	logArgs := []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, "")}
	_, err := cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check,get logging
	logDownName := randLowStr(12) + "-log-down"
	strMethod = "get"
	options = OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	logArgs = []string{CloudURLToString(bucketName, ""), logDownName}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	// check logging
	_, err = os.Stat(logDownName)
	c.Assert(err, IsNil)

	logBody := s.readFile(logDownName, c)

	logXml := oss.LoggingXML{}
	err = xml.Unmarshal([]byte(logBody), &logXml)
	c.Assert(err, IsNil)
	c.Assert(logXml.LoggingEnabled.TargetBucket, Equals, bucketLog)

	// get again,test confirm
	logArgs = []string{CloudURLToString(bucketName, ""), logDownName}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, IsNil)

	os.Remove(logDownName)
	s.removeBucket(bucketName, true, c)
	s.removeBucket(bucketLog, true, c)
}

func (s *OssutilCommandSuite) TestBucketLogPutError(c *C) {
	// put logging
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	bucketLog := bucketName + "-log"
	s.putBucket(bucketLog, c)

	// method is empty
	var str string
	strMethod := ""
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}

	logArgs := []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, "")}
	_, err := cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	// method is invalid
	strMethod = "head"
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	// cloud url is error
	strMethod = "put"
	logArgs = []string{"http:///", CloudURLToString(bucketLog, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	// put log missing parameter
	logArgs = []string{CloudURLToString(bucketName, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	// dest cloud url is error
	logArgs = []string{CloudURLToString(bucketName, ""), "http:////"}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	// src bucket is not exist
	logArgs = []string{CloudURLToString(bucketName+"test", ""), CloudURLToString(bucketLog, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	//accessKeySecret error
	strKey := "aaa"
	options["accessKeySecret"] = &strKey
	logArgs = []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	// delete accessKeySecret
	delete(bucketLogCommand.command.options, OptionAccessKeySecret)
	logArgs = []string{CloudURLToString(bucketName, ""), CloudURLToString(bucketLog, "")}
	_, err = cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	s.removeBucket(bucketName, true, c)
	s.removeBucket(bucketLog, true, c)
}

func (s *OssutilCommandSuite) TestBucketLogDeleteError(c *C) {
	// put logging
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	bucketLog := bucketName + "-log"
	s.putBucket(bucketLog, c)

	// accessKeySecret error
	var str string
	strMethod := "delete"
	strKey := "aaa"
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &strKey,
		"stsToken":        &str,
		"configFile":      &configFile,
		"method":          &strMethod,
	}
	logArgs := []string{CloudURLToString(bucketName, "")}
	_, err := cm.RunCommand("logging", logArgs, options)
	c.Assert(err, NotNil)

	s.removeBucket(bucketName, true, c)
	s.removeBucket(bucketLog, true, c)
}

func (s *OssutilCommandSuite) TestBucketLogHelpInfo(c *C) {
	// mkdir command test
	options := OptionMapType{}

	mkArgs := []string{"logging"}
	_, err := cm.RunCommand("help", mkArgs, options)
	c.Assert(err, IsNil)

	mkArgs = []string{}
	_, err = cm.RunCommand("help", mkArgs, options)
	c.Assert(err, IsNil)

}


text:
/* $Id$ */

#ifndef ZEND_SCANNER_H
#define ZEND_SCANNER_H

typedef struct _zend_lex_state {
	unsigned int yy_leng;
	unsigned char *yy_start;
	unsigned char *yy_text;
	unsigned char *yy_cursor;
	unsigned char *yy_marker;
	unsigned char *yy_limit;
	int yy_state;
	zend_stack state_stack;
	zend_ptr_stack heredoc_label_stack;

	zend_file_handle *in;
	uint lineno;
	char *filename;

	/* original (unfiltered) script */
	unsigned char *script_org;
	size_t script_org_size;

	/* filtered script */
	unsigned char *script_filtered;
	size_t script_filtered_size;

	/* input/output filters */
	zend_encoding_filter input_filter;
	zend_encoding_filter output_filter;
	const zend_encoding *script_encoding;
} zend_lex_state;

typedef struct _zend_heredoc_label {
	char *label;
	int length;
} zend_heredoc_label;

BEGIN_EXTERN_C()
int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC);
ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC);
ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC);

END_EXTERN_C()

#endif

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * indent-tabs-mode: t
 * End:
 */


text:
<?xml version="1.0" encoding="UTF-8"?>
<project name="ice-framework" default="build">
 <!-- By default, we assume all tools to be on the $PATH -->
 <property name="toolsdir" value=""/>
 <property name="destination" value="${basedir}/build/app"/>
 <property name="origin" value="${basedir}/src"/>
 <property environment="env"/>

 <!-- Uncomment the following when the tools are in ${basedir}/vendor/bin -->
 <!-- <property name="toolsdir" value="${basedir}/vendor/bin/"/> -->
<!--
 <target name="build"
         depends="prepare,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci,phpunit,phpdox"
         description=""/>
-->

 <target name="build"
         depends="prepare,lint,phpunit,copyapp,release"
         description=""/>

 <target name="clean"
         unless="clean.done"
         description="Cleanup build artifacts">
  <delete dir="${basedir}/build/api"/>
  <delete dir="${basedir}/build/coverage"/>
  <delete dir="${basedir}/build/logs"/>
  <delete dir="${basedir}/build/pdepend"/>
  <delete dir="${basedir}/build/phpdox"/>
  <delete dir="${basedir}/build/test"/>
  <delete dir="${basedir}/build/app"/>
  <delete dir="${basedir}/build/release"/>
  <property name="clean.done" value="true"/>
 </target>

 <target name="prepare"
         unless="prepare.done"
         depends="clean"
         description="Prepare for build">
  <mkdir dir="${basedir}/build/api"/>
  <mkdir dir="${basedir}/build/coverage"/>
  <mkdir dir="${basedir}/build/logs"/>
  <mkdir dir="${basedir}/build/pdepend"/>
  <mkdir dir="${basedir}/build/phpdox"/>
  <mkdir dir="${basedir}/build/test"/>
  <mkdir dir="${basedir}/build/app"/>
  <mkdir dir="${basedir}/build/release/data"/>
  <mkdir dir="${basedir}/build/release/data/${env.appname}_${env.Version}"/>
  <mkdir dir="${basedir}/src/lib"/>

 	<copy todir="${basedir}/src/lib" overwrite="true">
	  <fileset dir="${basedir}/lib">
	    <include name="**/*"/>
	  </fileset>
	</copy>

 	<copy todir="${basedir}/src" overwrite="true">
	  <fileset dir="${basedir}/core-ext">
	    <include name="**/*"/>
	  </fileset>
	</copy>

 	<copy todir="${basedir}/src">
	  <fileset dir="${basedir}/ext">
	    <include name="**/*"/>
	  </fileset>
	</copy>

 	<copy todir="${basedir}/src">
	  <fileset dir="${basedir}/tp">
	    <include name="**/*"/>
	  </fileset>
	</copy>

  <property name="prepare.done" value="true"/>
 </target>

 <target name="lint" description="Perform syntax check of sourcecode files">
  <apply executable="php" failonerror="true">
   <arg value="-l" />

   <fileset dir="${basedir}/src">
    <include name="**/*.php" />
    <modified />
   </fileset>

   <fileset dir="${basedir}/test">
    <include name="**/*.php" />
    <modified />
   </fileset>
  </apply>
 </target>

 <target name="phploc"
         description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
  <exec executable="${toolsdir}phploc">
   <arg value="--count-tests" />
   <arg path="${basedir}/src" />
   <arg path="${basedir}/tests" />
  </exec>
 </target>

 <target name="phploc-ci"
         depends="prepare"
         description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">
  <exec executable="${toolsdir}phploc">
   <arg value="--count-tests" />
   <arg value="--log-csv" />
   <arg path="${basedir}/build/logs/phploc.csv" />
   <arg value="--log-xml" />
   <arg path="${basedir}/build/logs/phploc.xml" />
   <arg path="${basedir}/src" />
   <arg path="${basedir}/tests" />
  </exec>
 </target>

 <target name="pdepend"
         depends="prepare"
         description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
  <exec executable="${toolsdir}pdepend">
   <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
   <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
   <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
   <arg path="${basedir}/src" />
  </exec>
 </target>

 <target name="phpmd"
         description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
  <exec executable="${toolsdir}phpmd">
   <arg path="${basedir}/src" />
   <arg value="text" />
   <arg path="${basedir}/build/phpmd.xml" />
  </exec>
 </target>

 <target name="phpmd-ci"
         depends="prepare"
         description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">
  <exec executable="${toolsdir}phpmd">
   <arg path="${basedir}/src" />
   <arg value="xml" />
   <arg path="${basedir}/build/phpmd.xml" />
   <arg value="--reportfile" />
   <arg path="${basedir}/build/logs/pmd.xml" />
  </exec>
 </target>

 <target name="phpcs"
         description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
  <exec executable="${toolsdir}phpcs">
   <arg value="--standard=PSR2" />
   <arg value="--extensions=php" />
   <arg value="--ignore=autoload.php" />
   <arg path="${basedir}/src" />
   <arg path="${basedir}/tests" />
  </exec>
 </target>

 <target name="phpcs-ci"
         depends="prepare"
         description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
  <exec executable="${toolsdir}phpcs" output="/dev/null">
   <arg value="--report=checkstyle" />
   <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
   <arg value="--standard=PSR2" />
   <arg value="--extensions=php" />
   <arg value="--ignore=autoload.php" />
   <arg path="${basedir}/src" />
  </exec>
 </target>

 <target name="phpcpd"
         description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
  <exec executable="${toolsdir}phpcpd">
   <arg path="${basedir}/src" />
  </exec>
 </target>

 <target name="phpcpd-ci"
         depends="prepare"
         description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">
  <exec executable="${toolsdir}phpcpd">
   <arg value="--log-pmd" />
   <arg path="${basedir}/build/logs/pmd-cpd.xml" />
   <arg path="${basedir}/src" />
  </exec>
 </target>

 <target name="phpunit"
         depends="prepare"
         description="Run unit tests with PHPUnit">
  <exec executable="${toolsdir}phpunit" failonerror="true">
   <arg value="--configuration"/>
   <arg path="${basedir}/phpunit.xml"/>
  </exec>
 </target>

<target name="phpdox"
         depends=""
         description="Generate project documentation using phpDox">
  <exec executable="${toolsdir}phpdox"/>
 </target>

<target name="copyapp"
     depends="phpunit"
     description="Copy generated files to QA app">

	<delete includeemptydirs="true">
	    <fileset dir="${destination}">
	        <include name="**/*"/>
	    </fileset>
	</delete>

	<copy todir="${destination}">
	  <fileset dir="${origin}">
	    <include name="**/*"/>
	  </fileset>
	</copy>

</target>

<target name="release"
     depends="copyapp"
     description="Create a release">

	<copy todir="${basedir}/build/release/data/${env.appname}_${env.Version}">
	  <fileset dir="${destination}">
	    <include name="**/*"/>
	  	<exclude name="test/**"/>
	  </fileset>
	</copy>

	<zip destfile="${basedir}/build/release/${env.appname}_${env.Version}.zip"
	       basedir="${basedir}/build/release/data"
	  />

	<tar destfile="${basedir}/build/release/${env.appname}_${env.Version}.tar"
		       basedir="${basedir}/build/release/data"
		  />

	<gzip destfile="${basedir}/build/release/${env.appname}_${env.Version}.tar.gz" src="${basedir}/build/release/${env.appname}_${env.Version}.tar"/>

</target>

</project>


text:
package uva.tomo5;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Locale;
import java.util.StringTokenizer;

public class BinomialShowdown {

	static BufferedReader input;
	static StringTokenizer _stk;
	static String readln() throws IOException{
		String l=input.readLine();
		if(l!=null) _stk=new StringTokenizer(l," ");
		return l;
	}

	static String next(){return _stk.nextToken();}
	static int nextInt(){return Integer.parseInt(next());}

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
//		input=new BufferedReader(new InputStreamReader(System.in));
		input=new BufferedReader(new FileReader("Combinations"));

		for (int casesId = 1; ; casesId++) {
			readln();
			int N, M;
			N=nextInt();
			M=nextInt();
			if(N==0&&M==0) return;
			System.out.println(C(N,M));
		}

	}

	static int gcd(int a,int b) {
		while (b > 0) {
			a = a % b;
			a ^= b; b ^= a; a ^= b; } return a;
	}

	static int C(int n,int k){
		if(n<k)return 0;
		int numerator=1,denominator=1,toMul,toDiv,i, tmpGcd=1;/*si no es long no se puede mandar por referencia*/
		if (k>n/2) k=n-k; /* use smaller k */
		for (i=k;i>0;i--) {
			toMul=n-k+i;
			toDiv=i;

			tmpGcd=gcd(toMul,toDiv); /* always divide before multiply */
			toMul/=tmpGcd; toDiv/=tmpGcd;

			tmpGcd=gcd(numerator,toDiv); /* always divide before multiply */
			numerator/=tmpGcd; toDiv/=tmpGcd;

			tmpGcd=gcd(toMul,denominator); /* always divide before multiply */
			toMul/=tmpGcd; denominator/=tmpGcd;

			numerator*=toMul;
			denominator*=toDiv;
		}
		return numerator/denominator;
	}
}


text:
socket = "/var/run/criu_service.socket"
images = "/var/cache/criu_dump"
log = "dump.log"
# need iij/mruby-env
pid = ENV["PID"].to_i

c = CRIU.new
p c.set_pid pid
p c.set_images_dir images
p c.set_service_address socket
#p c.set_ext_unix_sk true
#p c.set_tcp_established true
p c.set_log_file log

p c.dump


text:
#include "plbWrapper/block/dataInitializerFunctional2D.h"
#include "plbWrapper/block/dataInitializerFunctional2D.hh"

namespace plb {

template class IniConstNTensorFunctional2D<PRECOMP_T>;
template class SetToNCoordinateFunctional2D<PRECOMP_T>;
template class SetToNCoordinatesFunctional2D<PRECOMP_T>;
template class SetNTensorComponentFunctional2D<PRECOMP_T>;
template class AssignNTensorFunctional2D<PRECOMP_T>;

template class MaskedIniConstNTensorFunctional2D<PRECOMP_T>;
template class MaskedSetToNCoordinateFunctional2D<PRECOMP_T>;
template class MaskedSetToNCoordinatesFunctional2D<PRECOMP_T>;
template class MaskedSetNTensorComponentFunctional2D<PRECOMP_T>;
template class MaskedAssignNTensorFunctional2D<PRECOMP_T>;

}  // namespace plb


text:
<demo title="Alert">

        Provide contextual feedback messages for typical user actions.

Colors

        <fox-alert [settings]="{color: 'info'}">Info! Info alert message.</fox-alert>
        <fox-alert [settings]="{color: 'success'}">Success! Success alert message.</fox-alert>
        <fox-alert [settings]="{color: 'danger'}">Danger! Danger alert message.</fox-alert>
        <fox-alert [settings]="{color: 'warning'}">Warning! Warning alert message.</fox-alert>

Closeble alert

        <fox-alert [settings]="{closable: true, color: 'success'}">Success! Success alert message.</fox-alert>

        <highlight language="markup">
            <![CDATA[

Colors

<fox-alert [settings]="{color: 'info'}">Info! Info alert message.</fox-alert>
<fox-alert [settings]="{color: 'success'}">Success! Success alert message.</fox-alert>
<fox-alert [settings]="{color: 'danger'}">Danger! Danger alert message.</fox-alert>
<fox-alert [settings]="{color: 'warning'}">Warning! Warning alert message.</fox-alert>

Closeble alert

<fox-alert [settings]="{closable: true, color: 'success'}">Success! Success alert message.</fox-alert>
            ]]>
        </highlight>

        <highlight language="javascript">
            <![CDATA[
import { Component, OnInit } from '@angular/core';

import { AlertSettings } from '../../components/alert/alert.model'

@Component({
	moduleId: module.id,
	selector: 'alert-demo',
    templateUrl: 'alert.demo.html'
})
export class AlertDemoComponent implements OnInit {
	public settings: AlertSettings = {

    };

	constructor() { }

    ngOnInit() { }
}
            ]]>
        </highlight>

        <highlight language="javascript">
            <![CDATA[
import { AlertModule } from 'prettyfox-ui/ui';
            ]]>
        </highlight>

                fox-alert - base class

                fox-alert__close - close button

                fox-alert__content - alert message content

        <highlight language="javascript">
            <![CDATA[
AlertSettings {
    color?: string;
    closable?: boolean;
}
            ]]>
        </highlight>

                color (string) - alert color. Used bootstrap color classes: success ,info, warning, danger, secondary

                closable (boolean) - add close button to alert

        <highlight language="javascript">
            <![CDATA[
settings: {
    color: 'secondary',
    closable: false
};
            ]]>
        </highlight>

                closed - alert is closed. Returned {{ '{' }}originalEvent: event{{ '}' }}

</demo>


text:
module Salesforce
  class Resource

    def initialize attrs={}
      update_attributes attrs
    end

    def update_attributes attrs={}
      attrs.each do |k,v|
        attr = "#{k}=".underscore
        if respond_to? attr
          send attr, v
        end
      end
      self
    end
  end
end


text:
{{ pageTitle }} {{ pageSubTitle }}

            Enter a session ID which has been used in accessing the API to view your requests.

            <input type="text" name="sessionSearch" id="sessionSearch" class="form-control" placeholder="session id..." ng-model="searchText" />

            <button type="button" class="btn btn-info" ng-click="searchClick()">Search</button>

 0">

# Requests

                            {{ totalSessions() }}

Session Id

                            {{ currentSession }}

# Errors

                            {{ totalErrors() }}

        Validate Session

                            {{ session.ApiRequest.HttpMethod }}

                        {{ urlPath(session.ApiResponse.UriAccessed) }}

                    {{ formatDate(session.LogDate) }}

                                REQUEST

                                            Uri Accessed

                                        {{ session.ApiRequest.UriAccessed }}

                                            Headers

                                                {{ header.Key }}: {{ header.Value }}

                                            Body

{{ session.ApiRequest.BodyContent }}

                                RESPONSE

                                            Uri Accessed

                                        {{ session.ApiResponse.UriAccessed }}

                                            Headers

                                                {{ header.Key }}: {{ header.Value }}

                                            Body

{{ session.ApiResponse.BodyContent }}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity">

    <!--<android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_height="500dp"
        android:layout_width="fill_parent">
    </android.support.v4.view.ViewPager>-->

    <com.google.android.gms.common.SignInButton
        android:id="@+id/btn_sign_in"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="60dp"
        android:layout_marginBottom="10dp"/>

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_height="match_parent"
        android:layout_width="fill_parent"
        android:layout_alignParentEnd="true"
        android:layout_alignParentStart="true"
        android:layout_above="@+id/sign_in_button">
    </android.support.v4.view.ViewPager>

</RelativeLayout>


text:
<?php
namespace core;
use eftec\bladeone, mod;

class Blade {

	/**
	 * construct
	 *
	 * @param string $path_view
	 * @param string $path_cache
	 */
	function __construct($path_view=BLADE_VIEW, $path_cache=BLADE_CACHE)
	{
		// check blade class
		self::checkBladeOne();

		// make blade instance
		$this->blade = new bladeone\BladeOne($path_view, $path_cache);
	}

	/**
	 * check is blade file
	 *
	 * @param string $prefix
	 * @param string $filename
	 * @param array $paths
	 * @return array
	 */
	public static function isFile($prefix, $filename, $paths)
	{
		foreach ($paths as $k=>$v)
		{
			if (!$v) continue;

			$addrsPath = str_replace('.', '/', $v);
			$fullPath = $prefix . '/' . $addrsPath . '/' . $filename . '.blade.php';

			if (file_exists($fullPath))
			{
				return [ 'path' => $addrsPath, 'address' => $v ];
			}
		}
		return [ 'path' => null, 'address' => null ];
	}

	/**
	 * check BladeOne class
	 */
	private static function checkBladeOne()
	{
		if (!class_exists('eftec\bladeone\BladeOne'))
		{
			include __GOOSE_PWD__ . 'vendor/BladeOne/BladeOne.php';
		}
		if (!class_exists('eftec\bladeone\BladeOne'))
		{
			Goose::error(101, 'can not load blade class');
		}
	}

	/**
	 * render
	 *
	 * @param string $path
	 * @param array $data
	 */
	public function render($path, $data)
	{
		// set layout
		$layout = new mod\Layout\Layout();
		$data['layout'] = $layout;
		$data['root'] = __GOOSE_ROOT__;
		$data['pwd'] = __GOOSE_PWD__;
		$data['url'] = __GOOSE_URL__;

		// render page
		echo $this->blade->run($path, $data);
	}

}


text:
package org.deephacks.confit.internal.core.property.typesafe.impl;

import org.deephacks.confit.internal.core.property.typesafe.ConfigMergeable;
import org.deephacks.confit.internal.core.property.typesafe.ConfigValue;

interface MergeableValue extends ConfigMergeable {
    // converts a Config to its root object and a ConfigValue to itself
    ConfigValue toFallbackValue();
}


text:
package net.ericschrag.ud_demo;

import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import net.ericschrag.ud_demo.data.model.GithubUser;

import java.util.List;

public class UserListRecyclerAdapter extends RecyclerView.Adapter<UserListRecyclerAdapter.UserHolder> {

    private final List<GithubUser> users;
    private int itemLayoutResource;
    private final GithubUserSelectedCallback userSelectedCallback;
    private final Picasso picasso;

    public UserListRecyclerAdapter(List<GithubUser> users, int itemLayoutResource, GithubUserSelectedCallback userSelectedCallback, Picasso picasso) {
        this.users = users;
        this.itemLayoutResource = itemLayoutResource;
        this.userSelectedCallback = userSelectedCallback;
        this.picasso = picasso;
    }

    @Override
    public UserHolder onCreateViewHolder(ViewGroup parentViewGroup, int type) {
        final View view = LayoutInflater.from(parentViewGroup.getContext()).inflate(itemLayoutResource, parentViewGroup, false);
        return new UserHolder(view);
    }

    @Override
    public void onBindViewHolder(UserHolder userHolder, int position) {
        final GithubUser user = users.get(position);
        userHolder.nameText.setText(user.login);
        picasso.load(Uri.parse(user.avatar_url)).placeholder(R.color.material_blue_grey_800).into(userHolder.userAvatar);
        userHolder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                userSelectedCallback.userSelected(user);
            }
        });
    }

    @Override
    public int getItemCount() {
        return users.size();
    }

    public static class UserHolder extends RecyclerView.ViewHolder {

        public final TextView nameText;
        public final ImageView userAvatar;

        public UserHolder(View itemView) {
            super(itemView);
            nameText = (TextView) itemView.findViewById(R.id.user_name);
            userAvatar = (ImageView) itemView.findViewById(R.id.user_avatar);
        }
    }
}


text:
using UnityEngine;
using System.Collections.Generic;

namespace EA4S.Egg
{
    public class EggRunLettersBox : MonoBehaviour
    {
        public Transform[] leftOutPositions;
        public Transform[] rightOutPositions;

        List<EggRunLetter> runLetters = new List<EggRunLetter>();

        GameObject letterObjectPrefab;
        GameObject shadowPrefab;

        public void Initialize(GameObject letterObjectPrefab, GameObject shadowPrefab)
        {
            this.letterObjectPrefab = letterObjectPrefab;
            this.shadowPrefab = shadowPrefab;
        }

        public void AddRunLetter(ILivingLetterData letterData)
        {
            Vector3 leftOutPosition = leftOutPositions[runLetters.Count].position;
            Vector3 rightOutPosition = rightOutPositions[runLetters.Count].position;

            EggRunLetter runLetter = new EggRunLetter(letterObjectPrefab, shadowPrefab, letterData, transform, leftOutPosition, rightOutPosition);

            runLetter.Run();

            runLetters.Add(runLetter);
        }

        public void RemoveAllRunLetters()
        {
            for (int i = 0; i < runLetters.Count; i++)
            {
                runLetters[i].DestroyRunLetter();
            }

            runLetters.Clear();
        }
    }
}


text:
package np.com.axhixh.agent.metric;

import javassist.*;

import javax.ws.rs.*;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;
import java.util.Optional;

/**
 * Created by ashish on 11/03/15.
 */
public class RestApiTransformer implements ClassFileTransformer {

    private ClassPool classPool;

    public RestApiTransformer() {
        classPool = new ClassPool();
        classPool.appendSystemPath();
        try {
            classPool.appendPathList(System.getProperty("java.class.path"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
                            ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {

        if (isBoringName(className)) {
            return null;
        }

        CtClass cc = null;
        try {
            String fqName = className.replace('/', '.');
            classPool.appendClassPath(new ByteArrayClassPath(fqName, classfileBuffer));
            cc = classPool.get(fqName);
            Optional<String> baseUrlOption = getRestUrl(cc);
            if (baseUrlOption.isPresent()) {
                String basePath = baseUrlOption.get();
                for (CtMethod m : cc.getDeclaredMethods()) {
                    Optional<CtMethod> annotatedMethod = getAnnotatedMethod(m);
                    if (annotatedMethod.isPresent()) {
                        String httpMethod = getHttpMethod(annotatedMethod.get());
                        String url = basePath;
                        if (annotatedMethod.get().hasAnnotation(Path.class)) {
                            url += ((Path) annotatedMethod.get().getAnnotation(Path.class)).value();
                        }

                        String metric = httpMethod + '.' + url;
                        m.addLocalVariable("__elapsedTime", CtClass.longType);
                        m.insertBefore("__elapsedTime = System.currentTimeMillis();");
                        m.insertAfter("{__elapsedTime = System.currentTimeMillis() - __elapsedTime;"
                                + " np.com.axhixh.agent.metric.Agent.report(\"" + metric + "\",  __elapsedTime);}");
                    }
                }

                byte[] byteCode = cc.toBytecode();
                return byteCode;
            }
        } catch (Exception ignoring) {
            ignoring.printStackTrace(System.err);
        } finally {
            if (cc != null) {
                cc.detach();
            }
        }
        return null;
    }

    private Optional<CtMethod> getAnnotatedMethod(CtMethod method) {
        if (method.hasAnnotation(GET.class) || method.hasAnnotation(POST.class) ||
                method.hasAnnotation(PUT.class) || method.hasAnnotation(DELETE.class) ||
                method.hasAnnotation(HttpMethod.class)) {
            return Optional.of(method);
        }

        // annotation on interface?
        final CtClass declaringClass = method.getDeclaringClass();
        try {
            for (CtClass classInterface : declaringClass.getInterfaces()) {
               if (classInterface.hasAnnotation(Path.class)) {
                    return Optional.of(classInterface.getDeclaredMethod(method.getName(), method.getParameterTypes()));
               }
            }
        } catch (NotFoundException e) {

        }

        return Optional.empty();
    }
    private String getHttpMethod(CtMethod method) {
        if (method.hasAnnotation(GET.class)) {
            return "GET";
        }

        if (method.hasAnnotation(POST.class)) {
            return "POST";
        }

        if (method.hasAnnotation(PUT.class)) {
            return "PUT";
        }

        if (method.hasAnnotation(DELETE.class)) {
            return "DELETE";
        }

        try {
            if (method.hasAnnotation(HttpMethod.class)) {
                return ((HttpMethod) method.getAnnotation(HttpMethod.class)).value();
            }
        } catch (ClassNotFoundException err) {
        }
        return "NONE";
    }

    private Optional<String> getRestUrl(CtClass classToCheck) throws ClassNotFoundException {
        if (classToCheck == null) {
            return Optional.empty();
        }
        if (classToCheck.isFrozen() || classToCheck.isInterface() || classToCheck.isAnnotation() ||
                classToCheck.isEnum() || classToCheck.isArray()) {
            return Optional.empty();
        }

        for (Object annotation: classToCheck.getAvailableAnnotations()) {
            if (annotation instanceof Path) {
                final String path = ((Path) annotation).value();
                return Optional.of(path);
            }
        }

        try {
            // interface has the annotations?
            for (CtClass ctInterface : classToCheck.getInterfaces()) {
                for (Object annotation : ctInterface.getAvailableAnnotations()) {
                    if (annotation instanceof Path) {
                        final String path = ((Path) annotation).value();
                        return Optional.of(path);
                    }
                }
            }
        } catch (NotFoundException ignored) {

        }

        return Optional.empty();
    }

    private boolean isBoringName(String name) {
        return name == null || // framework/jvm issue?
            name.startsWith("java") ||
                name.startsWith("sun/");

    }
}


text:
package nginx.clojure;

import static nginx.clojure.MiniConstants.CORE_VARS;
import static nginx.clojure.MiniConstants.NGX_HTTP_CLOJURE_REQ_POOL_OFFSET;
import static nginx.clojure.MiniConstants.NGX_HTTP_CLOJURE_UINT_SIZE;
import static nginx.clojure.NginxClojureRT.UNSAFE;
import static nginx.clojure.NginxClojureRT.fetchNGXInt;
import static nginx.clojure.NginxClojureRT.fetchString;
import static nginx.clojure.NginxClojureRT.ngx_http_clojure_mem_get_variable;
import static nginx.clojure.NginxClojureRT.ngx_palloc;

import java.io.InputStream;
import java.nio.charset.Charset;

public  class RequestKnownNameVarFetcher implements RequestVarFetcher {

	protected long nameNgxStrPtr;

	public RequestKnownNameVarFetcher() {
	}

	public RequestKnownNameVarFetcher(String name) {
		Long l = CORE_VARS.get(name);
		if (l == null){
			throw new IllegalArgumentException(name + " is not a known variable");
		}else {
			nameNgxStrPtr = l.longValue();
		}
	}

	@Override
	public Object fetch(long r, Charset encoding) {
		long varLenPtr = ngx_palloc(UNSAFE.getAddress(r + NGX_HTTP_CLOJURE_REQ_POOL_OFFSET), NGX_HTTP_CLOJURE_UINT_SIZE);
		if (varLenPtr == 0) {
			throw new OutOfMemoryError("nginx OutOfMemoryError");
		}
		long varValPtr = ngx_http_clojure_mem_get_variable(r, nameNgxStrPtr, varLenPtr);
		if (varValPtr == 0) {
			return null;
		}
		int len = fetchNGXInt(varLenPtr);
//		for (Map.Entry<String, Long> entry : CORE_VARS.entrySet()) {
//			if (entry.getValue() == nameNgxStrPtr) {
//				System.out.println("name:" + entry.getKey() + ", len:" + len);
//			}
//		}
		return fetchString(varValPtr + NGX_HTTP_CLOJURE_UINT_SIZE, len, encoding);
	}

	public InputStream fetchAsStream(long r) {
		long varLenPtr = ngx_palloc(UNSAFE.getAddress(r + NGX_HTTP_CLOJURE_REQ_POOL_OFFSET), NGX_HTTP_CLOJURE_UINT_SIZE);
		if (varLenPtr == 0) {
			throw new OutOfMemoryError("nginx OutOfMemoryError");
		}
		long varValPtr = ngx_http_clojure_mem_get_variable(r, nameNgxStrPtr, varLenPtr);
		if (varValPtr == 0) {
			return null;
		}
		int len = fetchNGXInt(varLenPtr);
		return new NativeInputStream(UNSAFE.getAddress(varValPtr + NGX_HTTP_CLOJURE_UINT_SIZE), len);
	}

}


text:
package no.stelar7.api.r4j.basic.exceptions;

public enum APIHTTPErrorReason
{
    ERROR_400(400, "Generic Client Error"),
    ERROR_401(401, "Missing API key"),
    ERROR_403(403, "Invalid API key"),
    ERROR_404(404, "Not Found"),
    ERROR_429(429, "Rate Limit Exceeded"),
    ERROR_500(500, "Generic Server Error"),
    ERROR_599(599, "Read Timed Out");

    private int    code;
    private String reason;

    APIHTTPErrorReason(int code, String reason)
    {
        this.code = code;
        this.reason = reason;
    }

    public int getCode()
    {
        return code;
    }

    public String getReason()
    {
        return reason;
    }

    @Override
    public String toString()
    {
        return "APIHTTPErrorReason{" +
               "code=" + code +
               ", reason='" + reason + '\'' +
               '}';
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'>
    <endpoint
        name="member_s12"
        implementation="wsa.submission.fromwsdl.crinterop.s12.server.WsaTestImpl"
        wsdl="WEB-INF/wsdl/wsaTestService.wsdl"
        service='{http://example.org/wsaTestService}wsaTestService'
        port='{http://example.org/wsaTestService}wsaTestPort'
        binding="http://www.w3.org/2003/05/soap/bindings/HTTP/"
        url-pattern="/member"/>
    <endpoint
        name="member_s12_provider"
        implementation="wsa.submission.fromwsdl.crinterop.s12.server.NonAnonymousProvider"
        binding="http://www.w3.org/2003/05/soap/bindings/HTTP/"
        url-pattern="/nonanonymous"/>
</endpoints>


text:
import profile from './profile';

export default function equipitem(item) {
  return profile({
    subcmd: 'equipitem',
    inventory_id: item,
  });
}


text:
A3D.Actor = function(options){
  options = options || {};
    options.type = 'Actor';
    this._init(options);

};

A3D.Actor.prototype = Object.create(A3D.MeshObject.prototype);

A3D.extend(A3D.Actor.prototype, {
    _init: function(options){
      options = options || {};
      this.id = options.id || A3D.uuid();
      this.position = options.position || new BABYLON.Vector3(0,0,0);
      this.resources = {};
      this.skeletons = {};
      this.meshesHaveSameOrigin = true;//for actors the default should be tru
      this._newBoundingBlocksIntersect = {};
      this._boundingBlocksIntersect = {};
      this._newEllipsoidColliding = {};
      this._ellipsoidColliding = {};
      A3D.MeshObject.prototype._init.call(this,options);
    },

    _afterImport : function(){
      //A3D.MeshObject.prototype._afterImport.call(this);
      if(this.importSkeletons){
        this.addImportedSkeletons();
      }
      if(this.animationsSetup){
        for(var i = 0; i < this.animationsSetup.length; i++){
          var n = this.animationsSetup[i];
          this.addAnimation(n.name,n.start,n.end,n.options);
        }
      }
      //moved here
      this.setLocation(this.position);
      A3D.MeshObject.prototype._afterImport.call(this);
    },

    _setupCollisionArray : function(){

      //TODO if the collider told me everythign that it is currently colliding with
      var intAct = new A3D.Action({
        name:'checkIntersecting_'+this.id,
        id : 'checkIntersecting_'+this.id,
        func : this._checkIntersecting.bind(this)
      });

      A3D.ActiveGame.addAction(intAct);

      A3D.ActiveGame.createPostRenderAction({
        name : 'emptyCollidingWith_'+this.id,
        id :  'emptyCollidingWith_'+this.id,
        func : this._emptyCollidingWith.bind(this),
        dontAdd : true
      });
    },

    _checkIntersecting : function(){
      for(var i = 0; i < A3D._static.actorIntTypes.length; i++){
        if(A3D.ActiveGame.mainScene[A3D._static.actorIntTypes[i]]){
          var t = A3D.ActiveGame.mainScene[A3D._static.actorIntTypes[i]];
          for(var l in t){
            if(this.intersectsWithObject(t[l])){
              this._newBoundingBlocksIntersect[t[l].id] = t[l];
              var o = {
                collider: this,
                collide:t[l]
              };
              A3D.ActiveGame._newCollisions.push(o);
            }
          }
        }
      }
    },

    _emptyCollidingWith : function(){
        this._boundingBlocksIntersect = {};
        this._ellipsoidColliding = {};

        var c = 0;
        var l;

        c = 0;
        for(l in this._newBoundingBlocksIntersect[l]){
          c++;
          this._boundingBlocksIntersect[l] = this._newBoundingBlocksIntersect[l];
        }

        c = 0;
        for(l in this._newEllipsoidColliding[l]){
          c++;
          this._ellipsoidColliding[l] = this._newEllipsoidColliding[l];
        }

        this._newEllipsoidColliding = {};
        this._newBoundingBlocksIntersect = {};

    },

    _applySkeletons : function(){
        for(var i = 0; i < this.b3Dmeshes.length; i++){
          if(this.b3Dmeshes[i].skeleton){
            this.addSkeleton(this.b3Dmeshes[i].skeleton,null,this.scene);
          }
        }
    },

    addImportedSkeletons : function(){
      for(var i = 0; i < this.importSkeletons.length; i++){
        this.addSkeleton(this.importSkeletons[i]);
      }
    },
    //sc is scene
    addSkeleton : function(skeleton,frames,sc){
      if(!sc){
        sc = this.scene;
      }
      this.skeletons[skeleton.name] = skeleton;
      if(!this._animations){
        this._animations = {};
      }

      this._animations[skeleton.name] = new A3D.SkeletonAnimations({
        skeleton : skeleton,
        scene : sc,
        frames : frames || 100
      });

    },

    addAnimation : function(name,s,e,options,skeleton){

      if(!skeleton){
        for(var sk in this.skeletons){
          this._animations[sk].addAnimation(name,s,e,options);
        }
      } else {
        this._animations[skeleton].addAnimation(name,s,e,options);
      }
    },

  addResource : function(name,options){
        if(name){
            options.name = name;
        }
        var r = new A3D.Resource(options);
        this.resources[r.id] = r;
        r.owner = this;
    },

    runAnimation : function(name){
      for(var s in this._animations){
        this._animations[s].run(name);
      }
      this.activeAnimation = name;
    },

    stopAnimation : function(skeleton){
      if(skeleton){
        this._animations[skeleton].stop();
      } else {
        for(var s in this._animations){
          this._animations[s].stop();
        }
      }
    },

    turnTo : function(v){
      if(typeof v !== BABYLON.Vector3){
        v = new BABYLON.Vector3(v.x,v.y,v.z);
      }

      for(var i = 0; i < this.b3Dmeshes.length; i++){
        this.b3Dmeshes[i].lookAt(v);
      }
    },

    turnToActor : function(actor){
        this.turnTo(actor.position);
    },

    moveTo : function(dest,speed,options){

      var nd = dest;
      if(typeof dest !== BABYLON.Vector3){
        if(dest.position){
          if(typeof dest.position === BABYLON.Vector3){
            nd = dest.position;
          } else {
            nd = new BABYLON.Vector3(nd.position.x,nd.position.y,nd.position.z);
          }
        } else {
          nd = new BABYLON.Vector3(nd.x,nd.y,nd.z);
        }
      }
      var moveVector = nd.subtract(this.position);

      moveVector = moveVector.normalize();
      moveVector = moveVector.scale(speed);

      this._move(moveVector);
    },

    _move : function(v){
    //
      for(var i = 0; i < this.b3Dmeshes.length; i++){
        this.b3Dmeshes[i].moveWithCollisions(v);
      }
      this.position = this.b3Dmeshes[0].position;
    },

    /**
      *Creates the Patrol for this actor
      @param {Object} patObj required Paremeters for the new patrol
      @param {Number} patObj.speed required the speed at which the player moves by default
      @param {Array of Patrol Points} patObj.patrolPoints required  see example below
      Sample patrolPoint
      {
          speed : 2,
          gotoPoint : {
            x:2,
            y:4,
            z:1
          },
          lookTo : true //can be true or another point obj with x y and x,
          distance: 1 // the distance that it will switch targets
          wait : 0 //the number in millsecions to wait if null or 0 it just goes strait to it
        }
    */
    makePatrol : function(patObj){

      this.patrol = {
        speed: patObj.speed || 0.03,
        patrolPoints : patObj.patrolPoints,
        distance : patObj.distance || 1
      };

      //TODO create a patrol action
      this.patrol.patrolAction =
      new A3D.Action({name : 'move'+this.id, func:this.runPatrol.bind(this),active : false});
      var fs = false;
      if(!this.patrol.onPoint){
        this.patrol.onPoint = 0;
      }

      A3D.ActiveGame.addAction(this.patrol.patrolAction);

      if(patObj.autostart){
        this.startPatrol();
      }
    },

    /**
      *Starts the patrol
    */
    startPatrol : function(){
      this.patrol.patrolAction.activate();
    },

    /**
      Stops the patrol
    */
    stopPatrol : function(){
      this.patrol.patrolAction.deactivate();
    },

    /**
    * Runs the patrol
    */
    //TODO add action and animations
    runPatrol : function(){
      var p = this.patrol.patrolPoints[this.patrol.onPoint];
      if(p.lookTo){
        if(p.lookTo === true){
          this.turnTo(p.gotoPoint);
        } else {
          this.turnTo(p.lookTo);
        }
      }
      var speed = p.speed || this.patrol.speed;

      if(p.wait){
        if(!this.patrol.waiting && !this.patrol.doneWaiting){
          this.patrol._waitStart = Date.now();
          this.patrol.waiting = true;
        } else if(!this.patrol.doneWaiting){
          if(p.wait <= (Date.now()-this.patrol._waitStart)){
            this.patrol.waiting = false;
            this.patrol.doneWaiting = true;
          }
        }
      }

      if(!this.patrol.waiting){
        this.moveTo(p.gotoPoint,speed);
      }

      var dist = p.distance || this.patrol.distance;
      if(BABYLON.Vector3.Distance(p.gotoPoint,this.position) < dist){
        this.patrol.waiting = false;
        this.patrol.doneWaiting = false;
        this.patrol.onPoint += 1;
        if(this.patrol.onPoint+1 > this.patrol.patrolPoints.length){
          this.patrol.onPoint = 0;
        }
      }
    },

        _onCollide : function(mesh){
          //the ""
          if(mesh.A3Dparent){
            this.A3Dparent._newEllipsoidColliding[mesh.A3Dparent.id] = mesh.A3Dparent;
            //this._newCollidingWith = {};
            var o = {
              collider: this.A3Dparent,
              collide:mesh.A3Dparent
            };
            A3D.ActiveGame._newCollisions.push(o);
          } //if not then it simply isn't anything other than a non worrisum obsticle
        },
});

A3D.Actor.constructor = A3D.Actor;
A3D._Actor = A3D.Actor;
/*
So a few notes on this. Actors will have some with bones and some without. What we need to do is to determine what the parent object of the whole actor weither bone, or something else
for now it will be mesh or bone. and this will determine movement.
*/


text:
<?php

final class PhabricatorPhameConfigOptions
  extends PhabricatorApplicationConfigOptions {

  public function getName() {
    return pht('Phame');
  }

  public function getDescription() {
    return pht('Configure Phame blogs.');
  }

  public function getOptions() {
    return array(
      $this->newOption(
        'phame.skins',
        'list<string>',
        array(
          'externals/skins/',
        ))
        ->setLocked(true)
        ->setDescription(
          pht('List of directories where Phame will look for skins.')),
    );
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 2010-2013 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    http://glassfish.java.net/public/CDDL+GPL_1_1.html
    or packager/legal/LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at packager/legal/LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-project</artifactId>
        <version>1.17.1</version>
    </parent>
    <artifactId>jersey-core</artifactId>
    <packaging>jar</packaging>
    <name>jersey-core</name>
    <dependencies>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <links>
                                <link>http://jsr311.java.net/nonav/releases/1.1</link>
                            </links>
                            <excludePackageNames>com.sun.jersey.core.impl:com.sun.jersey.impl</excludePackageNames>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>

        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${basedir}/src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/rsrc-gen</source>
                                <source>${project.build.directory}/generated-sources/jsr311</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin> <!-- unpack sources from jsr311-api.jar -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax.ws.rs</groupId>
                                    <artifactId>jsr311-api</artifactId>
                                    <version>1.1.1</version>
                                    <type>jar</type>
                                    <classifier>sources</classifier>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${project.build.directory}/generated-sources/jsr311</outputDirectory>
                                    <!--excludes>
                                        **/CacheControl.java,
                                        **/Cookie.java,
                                        **/EntityTag.java,
                                        **/MediaType.java,
                                        **/NewCookie.java,
                                        **/Variant.java,
                                        **/Response.java,
                                        **/UriBuilder.java
                                    </excludes-->
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.sun.istack</groupId>
                <artifactId>maven-istack-commons-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <resources>
                                <directory>${basedir}/src/main/resources</directory>
                                <includes>
                                    <include>**/*.properties</include>
                                </includes>
                            </resources>
                            <destDir>${project.build.directory}/generated-sources/rsrc-gen</destDir>
                            <localizationUtilitiesPkgName>com.sun.jersey.localization</localizationUtilitiesPkgName>
                        </configuration>
                        <goals>
                            <goal>rs-gen</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>javax.ws.rs.*;-split-package:=merge-first,com.sun.jersey.*;-split-package:=merge-first</Export-Package>
                        <Import-Package>!javax.ws.rs.*,javax.mail.*;resolution:=optional, *</Import-Package>
                        <Bundle-Activator>com.sun.jersey.core.osgi.Activator</Bundle-Activator>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Private-Package>com.sun.jersey.core.osgi;-split-package:=merge-first</Private-Package>
                        <Implementation-Title>jersey-core osgi</Implementation-Title>
                        <Implementation-Version>${project.version}</Implementation-Version>
                    </instructions>
                    <unpackBundle>true</unpackBundle>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>

</project>


text:
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/HobLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Library/Tpm2DeviceLib.h>

EFI_GUID mInternalTpm2DeviceInterfaceGuid = {
  0x349cf818, 0xc0ba, 0x4c43, { 0x92, 0x9a, 0xc8, 0xa1, 0xb1, 0xb3, 0xd2, 0x55 }
};

/**
  This function get TPM2.0 interface.

  @retval TPM2.0 interface.
**/
TPM2_DEVICE_INTERFACE *
InternalGetTpm2DeviceInterface (
  VOID
  )
{
  EFI_HOB_GUID_TYPE *Hob;

  Hob = GetFirstGuidHob (&mInternalTpm2DeviceInterfaceGuid);
  if (Hob == NULL) {
    return NULL;
  }
  return (TPM2_DEVICE_INTERFACE *)(Hob + 1);
}

/**
  This service enables the sending of commands to the TPM2.

  @param[in]      InputParameterBlockSize  Size of the TPM2 input parameter block.
  @param[in]      InputParameterBlock      Pointer to the TPM2 input parameter block.
  @param[in,out]  OutputParameterBlockSize Size of the TPM2 output parameter block.
  @param[in]      OutputParameterBlock     Pointer to the TPM2 output parameter block.

  @retval EFI_SUCCESS            The command byte stream was successfully sent to the device and a response was successfully received.
  @retval EFI_DEVICE_ERROR       The command was not successfully sent to the device or a response was not successfully received from the device.
  @retval EFI_BUFFER_TOO_SMALL   The output parameter block is too small.
**/
EFI_STATUS
EFIAPI
Tpm2SubmitCommand (
  IN UINT32            InputParameterBlockSize,
  IN UINT8             *InputParameterBlock,
  IN OUT UINT32        *OutputParameterBlockSize,
  IN UINT8             *OutputParameterBlock
  )
{
  TPM2_DEVICE_INTERFACE *Tpm2DeviceInterface;

  Tpm2DeviceInterface = InternalGetTpm2DeviceInterface ();
  if (Tpm2DeviceInterface == NULL) {
    return EFI_UNSUPPORTED;
  }

  return Tpm2DeviceInterface->Tpm2SubmitCommand (
                                InputParameterBlockSize,
                                InputParameterBlock,
                                OutputParameterBlockSize,
                                OutputParameterBlock
                                );
}

/**
  This service requests use TPM2.

  @retval EFI_SUCCESS      Get the control of TPM2 chip.
  @retval EFI_NOT_FOUND    TPM2 not found.
  @retval EFI_DEVICE_ERROR Unexpected device behavior.
**/
EFI_STATUS
EFIAPI
Tpm2RequestUseTpm (
  VOID
  )
{
  TPM2_DEVICE_INTERFACE *Tpm2DeviceInterface;

  Tpm2DeviceInterface = InternalGetTpm2DeviceInterface ();
  if (Tpm2DeviceInterface == NULL) {
    return EFI_UNSUPPORTED;
  }
  return Tpm2DeviceInterface->Tpm2RequestUseTpm ();
}

/**
  This service register TPM2 device.

  @param Tpm2Device  TPM2 device

  @retval EFI_SUCCESS          This TPM2 device is registered successfully.
  @retval EFI_UNSUPPORTED      System does not support register this TPM2 device.
  @retval EFI_ALREADY_STARTED  System already register this TPM2 device.
**/
EFI_STATUS
EFIAPI
Tpm2RegisterTpm2DeviceLib (
  IN TPM2_DEVICE_INTERFACE   *Tpm2Device
  )
{
  TPM2_DEVICE_INTERFACE *Tpm2DeviceInterface;

  if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &Tpm2Device->ProviderGuid)){
    DEBUG ((DEBUG_WARN, "WARNING: Tpm2RegisterTpm2DeviceLib - does not support %g registration\n", &Tpm2Device->ProviderGuid));
    return EFI_UNSUPPORTED;
  }

  Tpm2DeviceInterface = InternalGetTpm2DeviceInterface ();
  if (Tpm2DeviceInterface != NULL) {
    //
    // In PEI phase, there will be shadow driver dispatched again.
    //
    DEBUG ((EFI_D_INFO, "Tpm2RegisterTpm2DeviceLib - Override\n"));
    CopyMem (Tpm2DeviceInterface, Tpm2Device, sizeof(*Tpm2Device));
    return EFI_SUCCESS;
  } else {
    Tpm2Device = BuildGuidDataHob (&mInternalTpm2DeviceInterfaceGuid, Tpm2Device, sizeof(*Tpm2Device));
    if (Tpm2Device != NULL) {
      return EFI_SUCCESS;
    } else {
      return EFI_OUT_OF_RESOURCES;
    }
  }
}