text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'fileutils'
require 'yaml'

include HP::Cloud

describe "Accounts default directory" do
  it "should assemble properly" do
    Accounts.new.directory.should eq(ENV['HOME'] + '/.hpcloud/accounts/')
  end
end

describe "Accounts getting credentials" do
  before(:all) do
    AccountsHelper.use_fixtures()
  end

  context "when default account exists" do
    it "should provide credentials for account from file" do
      accounts = Accounts.new()
      acct = accounts.read('hp')
      acct[:credentials][:account_id].should eq('foo')
      acct[:credentials][:secret_key].should eq('bar')
      acct[:credentials][:auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      acct[:credentials][:tenant_id].should eq('111111')
    end
  end

  context "when alternate account exists" do
    it "should provide credentials for account from file" do
      accounts = Accounts.new()
      acct = accounts.read('pro')
      acct[:credentials][:account_id].should eq('DrDog')
      acct[:credentials][:secret_key].should eq('BeTheVoid')
      acct[:credentials][:auth_uri].should eq('http://TurningTheCentury/')
      acct[:credentials][:tenant_id].should eq('350')
    end
  end

  context "when unknown account" do
    it "should return raise exception" do
      accounts = Accounts.new()
      lambda {accounts.read('bogus')}.should raise_error(Exception) {|e|
        e.to_s.should eq("Could not find account file: #{accounts.directory}bogus")
      }
    end
  end

  context "when bad account file" do
    it "should return raise exception" do
      accounts = Accounts.new()
      lambda {accounts.read('bad')}.should raise_error(Exception) {|e|
        e.to_s.should eq("Error reading account file: #{accounts.directory}bad")
      }
    end
  end
  after(:all) {reset_all()}
end

describe "Accounts setting credentials" do
  before(:each) do
    AccountsHelper.use_fixtures()
  end

  context "when existing account file" do
    it "should change the settings" do
      accounts = Accounts.new()
      cred = { :account_id => 'LisaHannigan',
               :secret_key => 'Passenger',
               :auth_uri => 'http://ASail/',
               :tenant_id => '336'
             }

      accounts.set_cred('pro', cred)

      acct = accounts.read('pro')
      acct[:credentials][:account_id].should eq('LisaHannigan')
      acct[:credentials][:secret_key].should eq('Passenger')
      acct[:credentials][:auth_uri].should eq('http://ASail/')
      acct[:credentials][:tenant_id].should eq('336')
    end
  end

  context "when new account" do
    it "should change the settings" do
      accounts = Accounts.new()
      cred = { :account_id => 'SleeperAgent',
               :secret_key => 'Celabrasion',
               :auth_uri => 'http://ThatsMyBaby/',
               :tenant_id => '335'
             }

      accounts.set_cred('noob', cred)

      acct = accounts.read('noob')
      acct[:credentials][:account_id].should eq('SleeperAgent')
      acct[:credentials][:secret_key].should eq('Celabrasion')
      acct[:credentials][:auth_uri].should eq('http://ThatsMyBaby/')
      acct[:credentials][:tenant_id].should eq('335')
    end
  end
  after(:all) {reset_all()}
end

describe "Account write" do
  before(:each) do
    AccountsHelper.use_tmp()
  end

  context "when there ain't nothin" do
    it "should report error" do
      AccountsHelper.use_tmp()
      accounts = Accounts.new()
      tmp_dir = AccountsHelper.tmp_dir + "/.hpcloud/accounts/"
      AccountsHelper.reset()
      accounts.list.should eq("No such file or directory - #{tmp_dir}\nRun account:setup to create accounts.")
    end
  end

  context "when new account file" do
    it "should change the settings" do
      accounts = Accounts.new()
      cred = { :account_id => 'FionaApple',
               :secret_key => 'IdlerWheel',
               :auth_uri => 'http://Daredevil/',
               :tenant_id => '328'
             }
      accounts.set_cred('nub', cred)

      accounts.write('nub')

      accounts = Accounts.new()
      acct = accounts.read('nub')
      acct[:credentials][:account_id].should eq('FionaApple')
      acct[:credentials][:secret_key].should eq('IdlerWheel')
      acct[:credentials][:auth_uri].should eq('http://Daredevil/')
      acct[:credentials][:tenant_id].should eq('328')
    end
  end

  context "when existing account file" do
    it "should change the settings" do
      accounts = Accounts.new()
      cred = { :account_id => 'Ceremony',
               :secret_key => 'Zoo',
               :auth_uri => 'http://Quarantine/',
               :tenant_id => '306'
             }
      accounts.set_cred('indy', cred)
      accounts.write('indy')
      cred = { :account_id => 'TheHives',
               :secret_key => 'LexHives',
               :auth_uri => 'http://GoRightAhead/',
               :tenant_id => '307'
             }
      accounts.set_cred('indy', cred)

      accounts.write('indy')

      accounts = Accounts.new()
      acct = accounts.read('indy')
      acct[:credentials][:account_id].should eq('TheHives')
      acct[:credentials][:secret_key].should eq('LexHives')
      acct[:credentials][:auth_uri].should eq('http://GoRightAhead/')
      acct[:credentials][:tenant_id].should eq('307')
    end
  end

  after(:each) do
    AccountsHelper.reset()
  end
end

describe "Account get" do
  before(:each) do
    AccountsHelper.use_fixtures()
    ConfigHelper.use_tmp()
  end

  context "when getting account" do
    it "should include full default settings settings" do
      accounts = Accounts.new()

      acct = accounts.get('hp')

      acct[:credentials][:account_id].should eq('foo')
      acct[:credentials][:secret_key].should eq('bar')
      acct[:credentials][:auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      acct[:credentials][:tenant_id].should eq('111111')
      acct[:regions][:compute].should be_nil
      acct[:regions][:"object storage"].should be_nil
      acct[:regions][:cdn].should be_nil
      acct[:regions][:"block storage"].should be_nil
      acct[:options][:connect_timeout].should eq(30)
      acct[:options][:read_timeout].should eq(240)
      acct[:options][:write_timeout].should eq(240)
      acct[:options][:ssl_verify_peer].should be_true
      acct[:options][:ssl_ca_path].should be_nil
      acct[:options][:ssl_ca_file].should be_nil
    end
  end
  after(:all) {reset_all()}
end

describe "Accounts create" do
  before(:each) do
    AccountsHelper.use_fixtures()
  end

  context "when create called" do
    it "should have basic settings" do
      accounts = Accounts.new()
      acct = accounts.create('mumford')
      uri = HP::Cloud::Config.new.get(:default_auth_uri)

      acct[:credentials].should eq({:auth_uri=>uri})
      acct[:regions].should eq({})
      acct[:options].should eq({})
    end
  end
  after(:all) {reset_all()}
end

describe "Accounts set" do
  before(:each) do
    AccountsHelper.use_tmp()
  end

  context "when we use set" do
    it "should set the right setting" do
      accounts = Accounts.new()
      accounts.create('Hives')
      accounts.set('Hives', :account_id, "C1").should be_true
      accounts.set('Hives', :secret_key, "C2").should be_true
      accounts.set('Hives', :auth_uri, "C3").should be_true
      accounts.set('Hives', :tenant_id, "C4").should be_true
      accounts.set('Hives', :compute, "Z1").should be_true
      accounts.set('Hives', :"object storage", "Z2").should be_true
      accounts.set('Hives', :cdn, "Z3").should be_true
      accounts.set('Hives', :"block storage", "Z4").should be_true
      accounts.set('Hives', :connect_timeout, "1").should be_true
      accounts.set('Hives', :read_timeout, "2").should be_true
      accounts.set('Hives', :write_timeout, "3").should be_true
      accounts.set('Hives', :ssl_verify_peer, "O4").should be_true
      accounts.set('Hives', :ssl_ca_path, "O5").should be_true
      accounts.set('Hives', :ssl_ca_file, "O6").should be_true
      accounts.set('Hives', :preferred_flavor, "O8").should be_true
      accounts.set('Hives', :preferred_image, "O9").should be_true
      accounts.set('Hives', :bogus, "What").should be_false
      accounts.set('bogus', :ssl_ca_file, "10").should be_false

      acct = accounts.get('Hives')
      acct[:credentials][:account_id].should eq("C1")
      acct[:credentials][:secret_key].should eq("C2")
      acct[:credentials][:auth_uri].should eq("C3")
      acct[:credentials][:tenant_id].should eq("C4")
      acct[:regions][:compute].should eq("Z1")
      acct[:regions][:"object storage"].should eq("Z2")
      acct[:regions][:cdn].should eq("Z3")
      acct[:regions][:"block storage"].should eq("Z4")
      acct[:options][:connect_timeout].should eq(1)
      acct[:options][:read_timeout].should eq(2)
      acct[:options][:write_timeout].should eq(3)
      acct[:options][:ssl_verify_peer].should eq(true)
      acct[:options][:ssl_ca_path].should eq("O5")
      acct[:options][:ssl_ca_file].should eq("O6")
      acct[:options][:preferred_flavor].should eq("O8")
      acct[:options][:preferred_image].should eq("O9")
    end
  end
  after(:all) {reset_all()}
end

describe "Accounts migrate" do
  before(:each) do
    AccountsHelper.use_tmp()
    ConfigHelper.use_tmp()
    config = HP::Cloud::Config.new(true)
    config.set(:default_account, 'default')
    config.write()
  end

  context "when we have nothing" do
    it "should do nothing" do
      accounts = Accounts.new()

      accounts.migrate.should be_false
    end
  end

  context "when we have default" do
    it "should migrate" do
      accounts = Accounts.new()
      acct = accounts.create('default')
      acct[:username] = 'default@example.com'
      accounts.write('default')

      accounts.migrate.should be_true

      accounts = Accounts.new()
      accounts.list.should eq("hp")
      acct = accounts.read('hp')
      acct[:username].should eq('default@example.com')
      config = HP::Cloud::Config.new(true)
      config.get(:default_account).should eq('hp')
    end
  end

  context "when we have default and hp" do
    it "should not migrate" do
      accounts = Accounts.new()
      acct = accounts.create('default')
      acct[:username] = 'default@example.com'
      accounts.write('default')
      hp = accounts.create('hp')
      hp[:username] = 'hp@example.com'
      accounts.write('hp')

      accounts.migrate.should be_false

    end
  end

  after(:all) {reset_all()}
end

describe "Connection options" do
  context "when we create" do
    before(:each) do
      AccountsHelper.use_fixtures()
      ConfigHelper.use_tmp()
      Connection.instance.set_options({})
    end

    def expected_options()
      eopts = HP::Cloud::Config.default_options.clone
      eopts.delete_if{ |k,v| v.nil? }
      eopts.delete(:preferred_flavor)
      eopts.delete(:default_account)
      eopts.delete(:checker_url)
      eopts.delete(:checker_deferment)
      return eopts
    end

    it "should have expected values with avail zone" do
      options = Accounts.new.create_options('hp', 'Object Storage', 'somethingelse')

      options[:provider].should eq('hp')
      options[:connection_options].should eq(expected_options)
      options[:hp_access_key].should eq('foo')
      options[:hp_secret_key].should eq('bar')
      options[:hp_auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      options[:hp_tenant_id].should eq('111111')
      options[:hp_avl_zone].should eq('somethingelse')
      options[:user_agent].should eq("HPCloud-UnixCLI/#{HP::Cloud::VERSION}")
    end

    it "should have expected values" do
      options = Accounts.new.create_options('hp', 'Compute')

      options[:provider].should eq('hp')
      options[:connection_options].should eq(expected_options())
      options[:hp_access_key].should eq('foo')
      options[:hp_secret_key].should eq('bar')
      options[:hp_auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      options[:hp_tenant_id].should eq('111111')
      options[:hp_avl_zone].should be_nil
      options[:user_agent].should eq("HPCloud-UnixCLI/#{HP::Cloud::VERSION}")
    end

    it "should have expected values" do
      options = Accounts.new.create_options('hp', 'Object Storage')

      options[:provider].should eq('hp')
      options[:connection_options].should eq(expected_options())
      options[:hp_access_key].should eq('foo')
      options[:hp_secret_key].should eq('bar')
      options[:hp_auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      options[:hp_tenant_id].should eq('111111')
      options[:hp_avl_zone].should be_nil
      options[:user_agent].should eq("HPCloud-UnixCLI/#{HP::Cloud::VERSION}")
    end

    it "should have expected values" do
      options = Accounts.new.create_options('hp', 'CDN')

      options[:provider].should eq('hp')
      options[:connection_options].should eq(expected_options())
      options[:hp_access_key].should eq('foo')
      options[:hp_secret_key].should eq('bar')
      options[:hp_auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      options[:hp_tenant_id].should eq('111111')
      options[:hp_avl_zone].should be_nil
      options[:user_agent].should eq("HPCloud-UnixCLI/#{HP::Cloud::VERSION}")
    end

    it "should have expected values" do
      options = Accounts.new.create_options('hp', 'Block Storage')

      options[:provider].should eq('hp')
      options[:connection_options].should eq(expected_options())
      options[:hp_access_key].should eq('foo')
      options[:hp_secret_key].should eq('bar')
      options[:hp_auth_uri].should eq('http://192.168.1.1:8888/v2.0')
      options[:hp_tenant_id].should eq('111111')
      options[:hp_avl_zone].should be_nil
      options[:user_agent].should eq("HPCloud-UnixCLI/#{HP::Cloud::VERSION}")
    end

    it "should throw exception" do
      directory = Accounts.new.directory
      lambda {
        Accounts.new.create_options('bogus', 'Object Storage')
      }.should raise_error(Exception, "Could not find account file: #{directory}bogus")
    end
  end
  after(:all) {reset_all()}
end


text:
@interface CTProfileQuestionStatusCellAdapter : AKTableViewCellAdapter

@end

redpajama_set_name: RedPajamaGithub


text:
package org.jimsey.projects.turbine.condenser.domain.indicators.trackers;

import org.jimsey.projects.turbine.condenser.domain.indicators.BaseIndicator;
import org.jimsey.projects.turbine.condenser.domain.indicators.IndicatorInstance;

import eu.verdelhan.ta4j.TimeSeries;
import eu.verdelhan.ta4j.indicators.simple.ClosePriceIndicator;
import eu.verdelhan.ta4j.indicators.trackers.TripleEMAIndicator;

/**
 * @author the-james-burton
 */
public class TripleEMA extends BaseIndicator {

  public TripleEMA(IndicatorInstance instance, TimeSeries series, ClosePriceIndicator closePriceIndicator) {
    super(instance, series, closePriceIndicator);
  }

  @Override
  protected void init() {
    validateOne();
    indicator = new TripleEMAIndicator(closePriceIndicator, instance.getTimeframe1());
  }

}


text:
from __future__ import unicode_literals

from django.conf.urls import url
from django.contrib import admin

from .views import (
    BaseTypeList, BaseTypeCreate, BaseTypeUpdate, BaseTypeDelete,
    ItemDetail, ItemList, ItemCreate, ItemUpdate, ItemDelete,
    ItemCategoryList, ImageUpdate, ImageDetail, ItemSupplierList,
    SupplierItemCreate, BaseItemCreate, ItemAddDamaged, ItemAdd
)

app_name = 'product'
urlpatterns = [
    # Product Categories
    url(r'^base/$', BaseTypeList.as_view(),
        name="base_product_list"),
    url(r'^base/create/$', BaseTypeCreate.as_view(),
        name="base_product_create"),
    url(r'^base/(?P<slug>[-\w]+)/update/$', BaseTypeUpdate.as_view(),
        name="base_product_update"),
    url(r'^base/(?P<slug>[-\w]+)/delete/$', BaseTypeDelete.as_view(),
        name="base_product_delete"),
    # Products
    url(r'^item/$', ItemList.as_view(),
        name="item_list"),
    url(r'^item/create/$', ItemCreate.as_view(),
        name="item_create"),
    url(r'^item/create/supplier/([\w-]+)/$', SupplierItemCreate.as_view(),
        name="supplier_item_create"),
    url(r'^item/create/base/([\w-]+)/$', BaseItemCreate.as_view(),
        name="base_item_create"),
    url(r'^item/(?P<slug>[-\w]+)/$', ItemDetail.as_view(),
        name="item_detail"),
    url(r'^item/(?P<slug>[-\w]+)/update/$', ItemUpdate.as_view(),
        name="item_update"),
    url(r'^item/(?P<slug>[-\w]+)/delete/$', ItemDelete.as_view(),
        name="item_delete"),
    url(r'^item/([-\w]+)/add_damaged/$', ItemAddDamaged.as_view(),
        name="item_add_damaged"),
    url(r'^item/([-\w]+)/add/$', ItemAdd.as_view(),
        name="item_add"),
    # Product Images
    url(r'^image_for_item/(?P<slug>[-\w]+)/update/$', ImageUpdate.as_view(),
        name="image_update"),
    url(r'^image/(?P<slug>[-\w]+)/$', ImageDetail.as_view(),
        name="image_detail"),
    # Products by Categories
    url(r'^category_items/([\w-]+)/$', ItemCategoryList.as_view(),
        name="category_item_list"),
    # Product by Supplier
    url(r'^supplier_items/([\w-]+)/$', ItemSupplierList.as_view(),
        name="supplier_item_list"),
]


text:
/**
 * Liquibase specific code.
 */
package com.enginemobi.bssuite.config.liquibase;


text:
#include "core/html/HTMLImageLoader.h"

#include "core/HTMLNames.h"
#include "core/dom/Element.h"
#include "core/events/Event.h"
#include "core/fetch/ImageResource.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLObjectElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "platform/Logging.h"

namespace blink {

using namespace HTMLNames;

HTMLImageLoader::HTMLImageLoader(Element* element)
    : ImageLoader(element)
{
}

HTMLImageLoader::~HTMLImageLoader()
{
}

void HTMLImageLoader::dispatchLoadEvent()
{
    WTF_LOG(Timers, "HTMLImageLoader::dispatchLoadEvent %p", this);

    // HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure.
    if (isHTMLVideoElement(*element()))
        return;

    bool errorOccurred = image()->errorOccurred();
    if (isHTMLObjectElement(*element()) && !errorOccurred)
        errorOccurred = (image()->response().httpStatusCode() >= 400); // An <object> considers a 404 to be an error and should fire onerror.
    element()->dispatchEvent(Event::create(errorOccurred ? EventTypeNames::error : EventTypeNames::load));
}

static void loadFallbackContentForElement(Element* element)
{
    if (isHTMLImageElement(element))
        toHTMLImageElement(element)->ensureFallbackContent();
    else if (isHTMLInputElement(element))
        toHTMLInputElement(element)->ensureFallbackContent();
}

void HTMLImageLoader::noImageResourceToLoad()
{
    // FIXME: Use fallback content even when there is no alt-text. The only blocker is the large amount of rebaselining it requires.
    if (!toHTMLElement(element())->altText().isEmpty())
        loadFallbackContentForElement(element());
}

void HTMLImageLoader::imageNotifyFinished(ImageResource*)
{
    ImageResource* cachedImage = image();
    RawPtr<Element> element = this->element();
    ImageLoader::imageNotifyFinished(cachedImage);

    bool loadError = cachedImage->errorOccurred();
    if (isHTMLImageElement(*element)) {
        if (loadError)
            ensureFallbackContent();
        else
            toHTMLImageElement(element)->ensurePrimaryContent();
    }

    if (isHTMLInputElement(*element)) {
        if (loadError)
            ensureFallbackContent();
        else
            toHTMLInputElement(element)->ensurePrimaryContent();
    }

    if ((loadError || cachedImage->response().httpStatusCode() >= 400) && isHTMLObjectElement(*element))
        toHTMLObjectElement(element)->renderFallbackContent();
}

void HTMLImageLoader::ensureFallbackContent()
{
    loadFallbackContentForElement(element());
}

} // namespace blink


text:
using Holidays;
using NUnit.Framework;

namespace HolidaysTests {
    [TestFixture]
    public class ChristianHolidaysLocaleTests
    {
        [TestCase("br", "Carnival", "Carnaval")]
        [TestCase("br", "ChristmasDay", "Natal")]
        [TestCase("br", "CorpusChristi", "Corpus Christi")]
        [TestCase("br", "GoodFriday", "Sexta-feira Santa")]
        [TestCase("br", "Easter", "Páscoa")]
        public void WhenLocaleIsBrThenDescriptionsMustBeAsExpected(string country, string inputText, string expectedText)
        {
            var locale = new Locale(typeof(ChristianHolidays), country);

            Assert.That(locale.GetLocalizedStringFor(inputText), Is.EqualTo(expectedText));
        }

        [TestCase("pt", "Carnival", "Carnaval")]
        [TestCase("pt", "ChristmasDay", "Natal")]
        [TestCase("pt", "CorpusChristi", "Corpo de Deus")]
        [TestCase("pt", "GoodFriday", "Sexta-feira Santa")]
        [TestCase("pt", "Easter", "Páscoa")]
        public void WhenLocaleIsPtThenDescriptionsMustBeAsExpected(string country, string inputText, string expectedText)
        {
            var locale = new Locale(typeof(ChristianHolidays), country);
            Assert.That(locale.GetLocalizedStringFor(inputText), Is.EqualTo(expectedText));
        }
    }
}


text:
<!DOCTYPE html>

    <title>Something went wrong...</title>
    <link rel="stylesheet" href="test.css" />

Oh no!  Something went wrong...

Sorry for the inconvenience, we're looking into the problem right away.

In the meantime, here's some light reading:

      Once upon a midnight dreary, while I pondered, weak and weary,

      Over many a quaint and curious volume of forgotten lore—

      While I nodded, nearly napping, suddenly there came a tapping,

      As of some one gently rapping, rapping at my chamber door.

      "'Tis some visitor," I muttered, "tapping at my chamber door—

      Only this and nothing more."

      Ah, distinctly I remember it was in the bleak December,

      And each separate dying ember wrought its ghost upon the floor.

      Eagerly I wished the morrow;—vainly I had sought to borrow

      From my books surcease of sorrow—sorrow for the lost Lenore—

      For the rare and radiant maiden whom the angels name Lenore—

      Nameless here for evermore.

      And the silken sad uncertain rustling of each purple curtain

      Thrilled me—filled me with fantastic terrors never felt before;

      So that now, to still the beating of my heart, I stood repeating

      "'Tis some visiter entreating entrance at my chamber door—

      Some late visiter entreating entrance at my chamber door;

      This it is and nothing more."

      Presently my soul grew stronger; hesitating then no longer,

      "Sir," said I, "or Madam, truly your forgiveness I implore;

      But the fact is I was napping, and so gently you came rapping,

      And so faintly you came tapping, tapping at my chamber door,

      That I scarce was sure I heard you"—here I opened wide the door—

      Darkness there and nothing more.

      Deep into that darkness peering, long I stood there wondering, fearing,

      Doubting, dreaming dreams no mortals ever dared to dream before;

      But the silence was unbroken, and the stillness gave no token,

      And the only word there spoken was the whispered word, "Lenore?"

      This I whispered, and an echo murmured back the word, "Lenore!"—

      Merely this and nothing more.

      Back into the chamber turning, all my soul within me burning,

      Soon again I heard a tapping something louder than before.

      "Surely," said I, "surely that is something at my window lattice;

      Let me see, then, what thereat is and this mystery explore—

      Let my heart be still a moment and this mystery explore;—

      'Tis the wind and nothing more.

      Open here I flung the shutter, when, with many a flirt and flutter,

      In there stepped a stately Raven of the saintly days of yore.

      Not the least obeisance made he; not a minute stopped or stayed he,

      But, with mien of lord or lady, perched above my chamber door—

      Perched upon a bust of Pallas just above my chamber door—

      Perched, and sat, and nothing more.

      Then the ebony bird beguiling my sad fancy into smiling,

      By the grave and stern decorum of the countenance it wore,

      "Though thy crest be shorn and shaven, thou," I said, "art sure no craven,

      Ghastly grim and ancient Raven wandering from the Nightly shore—

      Tell me what thy lordly name is on the Night's Plutonian shore!"

      Quoth the Raven, "Nevermore."

      Much I marvelled this ungainly fowl to hear discourse so plainly,

      Though its answer little meaning—little relevancy bore;

      For we cannot help agreeing that no living human being

      Ever yet was blessed with seeing bird above his chamber door—

      Bird or beast upon the sculptured bust above his chamber door,

      With such name as "Nevermore."

      But the Raven, sitting lonely on that placid bust, spoke only

      That one word, as if its soul in that one word he did outpour

      Nothing farther then he uttered; not a feather then he fluttered—

      Till I scarcely more than muttered: "Other friends have flown before—

      On the morrow he will leave me, as my Hopes have flown before."

      Then the bird said "Nevermore."

      Startled at the stillness broken by reply so aptly spoken,

      "Doubtless," said I, "what it utters is its only stock and store,

      Caught from some unhappy master whom unmerciful Disaster

      Followed fast and followed faster till his songs one burden bore—

      Till the dirges of his Hope that melancholy burden bore

      Of 'Never—nevermore.'"

      But the Raven still beguiling all my sad soul into smiling,

      Straight I wheeled a cushioned seat in front of bird and bust and door;

      Then, upon the velvet sinking, I betook myself to linking

      Fancy unto fancy, thinking what this ominous bird of yore—

      What this grim, ungainly, ghastly, gaunt, and ominous bird of yore

      Meant in croaking "Nevermore."

      This I sat engaged in guessing, but no syllable expressing

      To the fowl whose fiery eyes now burned into my bosom's core;

      This and more I sat divining, with my head at ease reclining

      On the cushion's velvet lining that the lamp-light gloated o'er,

      But whose velvet violet lining with the lamp-light gloating o'er

      She shall press, ah, nevermore!

      Then, methought, the air grew denser, perfumed from an unseen censer

      Swung by Seraphim whose foot-falls tinkled on the tufted floor.

      "Wretch," I cried, "thy God hath lent thee—by these angels he hath sent thee

      Respite—respite and nepenthe from thy memories of Lenore!

      Quaff, oh quaff this kind nepenthe and forget this lost Lenore!"

      Quoth the Raven, "Nevermore."

      "Prophet!" said I, "thing of evil!—prophet still, if bird or devil!—

      Whether Tempter sent, or whether tempest tossed thee here ashore,

      Desolate, yet all undaunted, on this desert land enchanted—

      On this home by Horror haunted—tell me truly, I implore—

      Is there—is there balm in Gilead?—tell me—tell me, I implore!"

      Quoth the Raven, "Nevermore."

      "Prophet!" said I, "thing of evil!—prophet still, if bird or devil!

      By that Heaven that bends above us—by that God we both adore—

      Tell this soul with sorrow laden if, within the distant Aidenn,

      It shall clasp a sainted maiden whom the angels name Lenore—

      Clasp a rare and radiant maiden whom the angels name Lenore."

      Quoth the Raven, "Nevermore."

      "Be that our sign of parting, bird or fiend!" I shrieked, upstarting—

      "Get thee back into the tempest and the Night's Plutonian shore!

      Leave no black plume as a token of that lie thy soul has spoken!

      Leave my loneliness unbroken!—quit the bust above my door!

      Take thy beak from out my heart, and take thy form from off my door!"

      Quoth the Raven, "Nevermore."

      And the Raven, never flitting, still is sitting, still is sitting

      On the pallid bust of Pallas just above my chamber door;

      And his eyes have all the seeming of a demon's that is dreaming

      And the lamp-light o'er him streaming throws his shadows on the floor;

      And my soul from out that shadow that lies floating on the floor

      Shall be lifted—nevermore!

The Raven, by Edgar Allan Poe


text:
/**
 *
 */
package crypt;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

/**
 * @author caterina
 * Class with tools to get rid of redundancies
 */
public class Tools {

	/**
	 *
	 * @param key
	 * @param alpha
	 * @return keynum (Schluessel als integer)
	 */
	public static int string2int(String key, String alpha)
	{
		key = key.toLowerCase();
		int keynum = alpha.indexOf(key.charAt(0));
		return keynum;
	}

	public static String int2string(int index, String alpha){

		return Character.toString(alpha.charAt(index)) ;
	}

	public static int getArrayIndex(int[] arr,int value) {

        int k=0;
        for(int i=0;i<arr.length;i++){

            if(arr[i]==value){
                k=i;
                break;
            }
        }
    return k;
	}

	public static int ggT(int a, int b){
	    if (a == 0){
	    	 return b;
	    }
	    return ggT(b%a, a);
	}

//	private int kgV(int a, int b){
//		return (a*b)/ggT(a,b);
//	}

	public static List<Integer> phi(int n)
	{
		List<Integer> coprimes = new ArrayList<Integer>();
	    coprimes.add(1);
		for (int i=2; i < n; i++)
	        if (ggT(i, n) == 1){

	        	coprimes.add(i);
	        }
	    return coprimes;

	}
	/**
	 *
	 * @param list
	 * @param alpha
	 * @return text
	 */
	public static String list2String(List<Integer> list, String alpha, boolean addCommas){
		String text = "";
		for (int i = 0; i<list.size(); i++)
		{
			for (int n = 0; n<alpha.length(); n++)
			{
				if(n==list.get(i)){
					text += alpha.charAt(n);
					if (addCommas){
						text += ", ";
					}
				}
			}
		}
		text = text.substring(0,text.length()-2);
		return text;
	}

	/**
	 *
	 * @param länge
	 * @param alpha
	 * @return random String
	 */
	public static String generieren(int länge, String alpha){
		Random rand = new Random();
		String randString = "";
		for (int i=0; i<länge; i++){
			randString += alpha.charAt(rand.nextInt(alpha.length()));
		}
		//randString += "!";
		return randString;
	}
	/*
	public static boolean contains(String text, String alpha){
		boolean contains = true;
		for (int n = 0; n<text.length(); n++){
			String currentchar = "";
			currentchar += text.charAt(n);
			if (alpha.contains(currentchar) == false){
				contains = false;
			}
		}
		return contains;

	}
	*/

	public static int [][] makeMatrix(String text, int rows, int columns, String alpha){
		char [] cArray = text.toCharArray();
		int counter = 0;
		int[][] newMatrix = new int[rows][columns];
		for(int r = 0; r <= rows-1; r++){
			for(int c = 0; c <= columns-1; c++){
				if (counter < text.length()){

					int currentNum = Tools.string2int(String.valueOf(cArray[counter]), alpha);
					//System.out.println(currentNum);
					if (currentNum != -1){
						newMatrix[r][c] = currentNum;
					}
					else{
						newMatrix[r][c] = 0;
					}
					counter++;
				}
			}

		}
		return newMatrix;
	}

	/**
	 * @param text
	 * @param rows
	 * @param columns
	 * @param alpha
	 * @return
	 */
	public static int[] string2intList(String text, String alpha) {
		text = text.toLowerCase();
		int [] whole = new int[text.length()];
		for (int n = 0; n<text.length(); n++){
			int newint = string2int(String.valueOf(text.charAt(n)), alpha);
			whole [(n)] = newint;
		}
		return whole;
	}

	 public static String matrix2string (int [][] matrix, String alpha){

		 int rows = matrix.length;
		 int columns = matrix[0].length;
		 String newString = "";
		 for (int i = 0; i < rows; i++){
			 for (int n = 0; n < columns; n++){
				 int field = (matrix[i][n])%(alpha.length());
				 String letter = int2string(field, alpha);
				 newString += letter;
			 }
		 }
		 return newString;
	 }
	 public static String array2string (String [][] matrix, String alpha){

		 int rows = matrix.length;
		 int columns = matrix[0].length;
		 String newString = "";
		 for (int i = 0; i < rows; i++){
			 for (int n = 0; n < columns; n++){
				 String field = matrix[i][n];
				 String letter = field;
				 newString += letter;
			 }
		 }
		 return newString;
	 }
	 public static String removeDoubles(String text){
		 String newString = "";
		 for (int i = 0; i < text.length(); i++){
			 if (!newString.contains(String.valueOf(text.charAt(i)))){
				 newString += text.charAt(i);
			 }
		 }
		 return newString;
	 }
	 public static int findinArray(int [] array, int value) {
		    for(int i=0; i<array.length; i++)
		         if(array[i] == value)
		             return i;
		    return -1;
	}
	public static String [][] flipMatrix(String [][] array){
			String [][] newArray = new String [array[0].length][array.length];
			for(int c = 0; c < array[0].length; c++){
				newArray[c] = getColumn(array, c);
			}
			return newArray;
	}

	public static String [] getColumn(String [][] array, int i){
		String [] colArray = new String[array.length];
		for(int row = 0; row < array.length; row++)
		{
		    colArray[row] = array[row][i];
		}
			return colArray;
		}

	public static boolean checkCharacter(String text, String alpha){
	 text = text.toLowerCase();
		boolean contains = true;
		for (int i = 0; i<text.length(); i++){
			if (!alpha.contains(String.valueOf(text.charAt(i)))){
				contains = false;
			}
		}
		return contains;
	}

	 public static int maxIndex(int[] array) {
		    int max = array[0];
		    int index = 0;
		    for (int i = 0; i < array.length; i++) {
		        if (array[i] >= max) {
		            max = array[i];
		            index = i;
		        }
		    }
		    return index;
	}

	 public static int modInverse(int key, String alpha){
		 int n = 1;
		 boolean negative = key < 0;
		 if (negative){
			 key = -key;
		 }
		 while(true){
			 if ((key*n)%alpha.length() == 1){
				 if (negative){
					 return alpha.length() - n;
				 }
				 else{
					 return n;
				 }

			 }
			 else if ((key*n)%alpha.length() == 0){
				 return 0;
			 }
			 n++;

		 }
	 }

	 public static String onlyAlphabet(String text, String alpha){
		 String newText = "";
		 text = text.toLowerCase();
		 for (int i = 0; i < text.length(); i++){
			 if(alpha.contains(String.valueOf(text.charAt(i)))){
				 newText += text.charAt(i);
			 }
		 }
		 return newText;
	 }

	 public static String removeChars(String text, String exclude){
		 String newText = "";
		 for (int i = 0; i < text.length(); i++){
			 if(!exclude.contains(String.valueOf(text.charAt(i)))){
				 newText += text.charAt(i);
			 }
		 }
		 return newText;
	 }
	 /*private String cleanup(String text, String newText, String alpha){
			String correctText = "";
			for (int i = 0; i<newText.length(); i++  ){
				if (!alpha.contains(String.valueOf(text.charAt(i)).toLowerCase())){
					correctText += text.charAt(i);
				}
				else if(Character.isUpperCase(text.charAt(i))){
					correctText += Character.toUpperCase(newText.charAt(i));
				}
				else{
					correctText += newText.charAt(i);
				}
			}
			return correctText;
		}*/
}


text:
describe('uiUploader', function() {
    'use strict';

    var uiUploader;

    beforeEach(module('ui.uploader'));
    beforeEach(inject(function(_uiUploader_) {
        uiUploader = _uiUploader_;
    }));

    describe('#addFiles', function() {
        it('adds files to the file array', function() {
            var file = new File([''], 'testFile');
            uiUploader.addFiles([file]);

            expect(uiUploader.files).toEqual([file]);
        });
    });

    describe('#removeFile', function() {
        it('removes the specified file from the file array', function() {
            var fileToDelete = new File([''], 'fileToDelete');
            var fileToKeep = new File([''], 'fileToKeep');
            uiUploader.addFiles([fileToKeep, fileToDelete]);

            uiUploader.removeFile(fileToDelete);

            expect(uiUploader.files).toEqual([fileToKeep]);
        });
    });

    describe('#removeAll', function() {
        it('removes all files from the file array', function() {
            var files = [1,2,3,4,5].map(function() {
                return new File([''], 'testFile');
            });
            uiUploader.addFiles(files);

            uiUploader.removeAll();

            expect(uiUploader.files).toEqual([]);
        });
    });

    describe('#files / #getFiles', function() {
        it('returns the added files', function() {
            var files = [1,2,3,4,5].map(function() {
                return new File([''], 'testFile');
            });
            uiUploader.addFiles(files);

            expect(uiUploader.getFiles()).toEqual(files);
            expect(uiUploader.files).toEqual(files);
        });
    });
});


text:
class Mover(object):

    def __init__(self):
        self.location = PVector(width/2, height/2)
        self.velocity = PVector(0, 0)
        self.topspeed = 10
        self.r = 15

    def update(self):
        self.acceleration = PVector.random2D()
        # self.acceleration.mult(0.5)
        self.acceleration.mult(random(2))
        self.velocity.add(self.acceleration)
        self.velocity.limit(self.topspeed)
        self.location.add(self.velocity)

    def display(self):
        stroke(0)
        fill(255, 100, 255)
        ellipse(self.location.x, self.location.y, 2*self.r, 2*self.r)

    def checkBoundaries(self):
        if (self.location.x > width + self.r):
            self.location.x = -self.r
        elif (self.location.x < -self.r):
            self.location.x = width + self.r

        if (self.location.y > height + self.r):
            self.location.y = -self.r
        elif (self.location.y < -self.r):
            self.location.y = height + self.r


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

public class TDManager : MonoBehaviour
{
    public GameObject start;
    public GameObject end;
    public GameObject tower;
    public GameObject ghostTower;
    public GameObject enemy;

    private List<GameObject> towers = new List<GameObject>();

    void Start()
    {
       StartCoroutine(SpawnEnemy());
    }

	void Update ()
    {
        StartCoroutine(PlaceTowers());
	}

    private RaycastHit CheckPosition()
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit = new RaycastHit();

        if (Physics.Raycast(ray, out hit, Mathf.Infinity))
        {
            //Make sure to set towers in a grid, by rounding position to an int
            Vector3 newPos = hit.point;
            newPos.Set(Mathf.RoundToInt(newPos.x) - 0.5F, 0.4F, Mathf.RoundToInt(newPos.z) + 0.5F);
            ghostTower.transform.position = newPos;

            //Set color of "show" tower based on the spot being available
            if (hit.transform.tag == "Ground")
            {
                ghostTower.GetComponent<Renderer>().material.color = Color.green;
            }
            else
            {
                ghostTower.GetComponent<Renderer>().material.color = Color.red;
            }
        }
        else
        {
            ghostTower.GetComponent<Renderer>().material.color = Color.red;
        }

        //Return all hit information which we use later
        return hit;
    }

    private IEnumerator PlaceTowers()
    {
        RaycastHit hit = CheckPosition();
        bool canPlace = false;
        //Make sure that we did hit something
        if (hit.transform != null)
        {
            canPlace = (hit.transform.tag == "Ground") ? true : false;
        }

        if (Input.GetButtonDown("Fire1") && canPlace)
        {
            GameObject newTower = Instantiate(tower, new Vector3(Mathf.RoundToInt(hit.point.x) - 0.5F, 0.3F, Mathf.RoundToInt(hit.point.z) + 0.5F), Quaternion.identity) as GameObject;
            towers.Add(newTower);
            yield return new WaitForEndOfFrame();
            Pathfinder.Instance.InsertInQueue(start.transform.position, end.transform.position, CheckRoute);
        }
    }

    private void CheckRoute(List<Vector3> list)
    {
        //If we get a list that is empty there is no path, and we blocked the road
        //Then remove the last added tower!
        if (list.Count < 1 || list == null)
        {
            if (towers.Count > 0)
            {
                GameObject g = towers[towers.Count - 1];
                towers.RemoveAt(towers.Count - 1);
                Destroy(g);
            }
        }
    }

    IEnumerator SpawnEnemy()
    {
        yield return new WaitForSeconds(1.5F);
        GameObject e = Instantiate(enemy, start.transform.position, Quaternion.identity) as GameObject;
        e.GetComponent<TDEnemy>().start = start.transform.position;
        e.GetComponent<TDEnemy>().end = end.transform.position;
        StartCoroutine(SpawnEnemy());
    }
}


text:
import { config, list } from '@keystone-next/keystone/schema'
import { text } from '@keystone-next/fields'

const Post = list({
  fields: {
    title: text({ isRequired: true }),
    slug: text(),
    content: text(),
  },
})

export default config({
  db: { provider: 'sqlite', url: 'file:./app.db' },
  experimental: {
    generateNextGraphqlAPI: true,
    generateNodeAPI: true,
  },
  lists: { Post },
})


text:
"""A setuptools based setup module.

See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

## Get the long description from the README file
#with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
#    long_description = f.read()
# https://stackoverflow.com/questions/26737222/pypi-description-markdown-doesnt-work
try:
    import pypandoc
    long_description = pypandoc.convert('README.md', 'rst').decode()
except(IOError, ImportError):
    long_description = open('README.md').read()
    if type(long_description) is bytes:
      long_description = long_description.decode()

setup(
    name='FBpyGIF',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='1.0.5',

    description='Frame Buffer drawing libray with GIF support for Python3',
    long_description=long_description,

    # The project's main homepage.
    url='https://github.com/chidea/FBpyGIF',

    # Author details
    author='Ch.Idea',
    author_email='sbw228@gmail.com',

    # Choose your license
    license='MIT',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 4 - Beta',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Environment :: Console :: Framebuffer',

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        #'Programming Language :: Python :: 2',
        #'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',

        'Natural Language :: English',
    ],

    # What does your project relate to?
    keywords='GIF animation raspberry pi rpi frame buffer fb',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['contrib', 'docs', 'tests']),

    # Alternatively, if you want to distribute just a my_module.py, uncomment
    # this:
    #   py_modules=["my_module"],

    # List run-time dependencies here.  These will be installed by pip when
    # your project is installed. For an analysis of "install_requires" vs pip's
    # requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['pillow'],

    # List additional groups of dependencies here (e.g. development
    # dependencies). You can install these using the following syntax,
    # for example:
    # $ pip install -e .[dev,test]
    extras_require={
        #'dev': ['check-manifest'],
        #'test': ['coverage'],
    },

    # If there are data files included in your packages that need to be
    # installed, specify them here.  If using Python 2.6 or less, then these
    # have to be included in MANIFEST.in as well.
    package_data={
        #'sample': ['package_data.dat'],
    },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages. See:
    # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    #data_files=[('my_data', ['data/data_file'])],

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    entry_points={
        'console_scripts': [
            #'FBpyGIF=FBpyGIF.__main__:main',
            'FBpyGIF=FBpyGIF.__main__:main',
        ],
    },
)


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as _ from 'lodash';
import {
  Component,
  ElementRef,
  EventEmitter,
  Injector,
  Input,
  OnDestroy,
  OnInit,
  Output,
  ViewChild
} from '@angular/core';
import {Alert} from '@common/util/alert.util';
import {CommonUtil} from '@common/util/common.util';
import {StringUtil} from '@common/util/string.util';
import {Modal} from '@common/domain/modal';
import {CookieConstant} from '@common/constant/cookie.constant';
import {CommonConstant} from '@common/constant/common.constant';
import {AbstractPopupComponent} from '@common/component/abstract-popup.component';
import {ConfirmModalComponent} from '@common/component/modal/confirm/confirm.component';
import {DatasourceInfo, Field, FieldFormatType, IngestionRuleType} from '@domain/datasource/datasource';
import {DatasourceService} from '../../../../../datasource/service/datasource.service';
import {GranularityService} from '../../../../service/granularity.service';
import {CreateSourceCompleteData} from '../../../../service/data-source-create.service';
import {DataStorageConstant} from '../../../../constant/data-storage-constant';

/**
 * Creating datasource with Stream - complete step
 */
@Component({
  selector: 'stream-complete',
  templateUrl: './stream-complete.component.html'
})
export class StreamCompleteComponent extends AbstractPopupComponent implements OnInit, OnDestroy {

  // datasource data
  @Input('sourceData')
  private _sourceData: DatasourceInfo;

  @ViewChild(ConfirmModalComponent)
  private confirmModal: ConfirmModalComponent;

  @Input()
  public step: string;

  @Output()
  public stepChange: EventEmitter<string> = new EventEmitter();

  // create complete data
  public createCompleteData: CreateSourceCompleteData;

  @Output()
  public readonly onComplete: EventEmitter<any> = new EventEmitter();

  // Constructor
  constructor(private datasourceService: DatasourceService,
              private _granularityService: GranularityService,
              protected element: ElementRef,
              protected injector: Injector) {
    super(element, injector);
  }

  /**
   * ngOnInit
   */
  public ngOnInit() {
    // Init
    super.ngOnInit();
    // set create complete data
    this.createCompleteData = this._sourceData.completeData ? _.cloneDeep(this._sourceData.completeData) : new CreateSourceCompleteData();
  }

  /**
   * ngOnDestroy
   */
  public ngOnDestroy() {
    super.ngOnDestroy();
  }

  /**
   * Prev button click event
   */
  public prev(): void {
    // set create complete data in source data
    this._sourceData.completeData = this.createCompleteData;
    // move to previous step
    this.step = 'stream-ingestion';
    this.stepChange.emit(this.step);
  }

  /**
   * Done button click event
   */
  public done(): void {
    // datasource name is empty
    if (StringUtil.isEmpty(this.createCompleteData.sourceName)) {
      this.createCompleteData.isInvalidName = true;
      this.createCompleteData.nameInvalidMessage = this.translateService.instant('msg.alert.edit.name.empty');
      return;
    } else if (CommonUtil.getByte(this.createCompleteData.sourceName.trim()) > 150) { // check datasource name length
      this.createCompleteData.isInvalidName = true;
      this.createCompleteData.nameInvalidMessage = this.translateService.instant('msg.alert.edit.name.len');
      return;
    }
    // check datasource description length
    if (StringUtil.isNotEmpty(this.createCompleteData.sourceDescription)
      && CommonUtil.getByte(this.createCompleteData.sourceDescription.trim()) > 450) {
      this.createCompleteData.isInvalidDesc = true;
      this.createCompleteData.descInvalidMessage = this.translateService.instant('msg.alert.edit.description.len');
      return;
    }

    this._createDatasource();
  }

  /**
   * Getter schemaData
   * @returns {any}
   */
  public get getSchemaData() {
    return this._sourceData.schemaData;
  }

  /**
   * Getter IngestionData
   * @returns {any}
   */
  public get getIngestionData() {
    return this._sourceData.ingestionData;
  }

  public get getKafkaData() {
    return this._sourceData.kafkaData;
  }

  /**
   * Create datasource
   * @private
   */
  private _createDatasource(): void {
    // loading show
    this.loadingShow();
    // create datasource
    this.datasourceService.createDatasource(this._getCreateDatasourceParams())
      .then((result) => {
        // complete alert
        Alert.success(`'${this.createCompleteData.sourceName.trim()}' ` + this.translateService.instant('msg.storage.alert.source.create.success'));
        // 개인 워크스페이스
        const workspace = JSON.parse(this.cookieService.get(CookieConstant.KEY.MY_WORKSPACE));
        // 워크스페이스 매핑
        this.datasourceService.addDatasourceWorkspaces(result.id, [workspace['id']])
          .then(() => {
            // link datasource detail (#505)
            this.router.navigate(['/management/storage/datasource', result.id]);
            // close
            this.close();
          })
          .catch(() => {
            // link datasource detail (#505)
            this.router.navigate(['/management/storage/datasource', result.id]);
            // close
            this.close();
          });
      })
      .catch(() => {
        // loading hide
        this.loadingHide();
        // modal
        const modal: Modal = new Modal();
        // show cancel disable
        modal.isShowCancel = false;
        // title
        modal.name = this.translateService.instant('msg.storage.ui.source.create.fail.title');
        // desc
        modal.description = this.translateService.instant('msg.storage.ui.source.create.fail.description');
        // show error modal
        this.confirmModal.init(modal);
      });
  }

  /**
   * Create current column
   * @param {number} seq
   * @returns {Object}
   * @private
   */
  private _createCurrentColumn(seq: number): object {
    return {
      seq: seq,
      name: CommonConstant.COL_NAME_CURRENT_DATETIME,
      type: 'TIMESTAMP',
      role: 'TIMESTAMP',
      derived: true,
      format: {
        type: FieldFormatType.TEMPORARY_TIME,
        format: 'yyyy-MM-dd HH:mm:ss'
      }
    };
  }

  /**
   * Delete unnecessary property in column
   * @param column
   * @private
   */
  private _deleteColumnProperty(column): void {
    delete column.biType;
    // if disable originalName
    if (Field.isDisableOriginalName(column)) {
      Field.removeOriginalNameProperty(column);
    }
    // if unloaded property is false, delete unloaded property
    if (column.unloaded === false) {
      delete column.unloaded;
    }
    // delete used UI
    delete column.checked;
    if (!Field.isEmptyIngestionRule(column)) {
      delete column.ingestionRule.isValidReplaceValue;
      delete column.ingestionRule.replaceValidationMessage;
    }
    if (!Field.isEmptyFormat(column)) {
      delete column.format.isValidFormat;
      delete column.format.formatValidMessage;
    }
    // if not GEO types
    if (!Field.isGeoType(column)) {
      if (!Field.isTimestampTypeField(column) && column.format) {
        delete column.format;
      } else if (Field.isTimestampTypeField(column) && column.format.type === FieldFormatType.UNIX_TIME) {
        // remove format
        delete column.format.format;
        // remove timezone
        delete column.format.timeZone;
        delete column.format.locale;
      } else if (Field.isTimestampTypeField(column) && column.format.type === FieldFormatType.DATE_TIME) {
        delete column.format.unit;
      }
    } else {  // if GEO types
      delete column.format.unit;
    }
  }

  /**
   * Set ingestion rule in column
   * @param column
   * @private
   */
  private _setColumnIngestionRule(column): void {
    // if exist ingestion rule property
    if (column.hasOwnProperty('ingestionRule')) {
      // ingestion type
      const type = column.ingestionRule.type;
      // if type is default
      if (type === IngestionRuleType.DEFAULT) {
        delete column.ingestionRule;
      } else if (type === IngestionRuleType.DISCARD) {
        delete column.ingestionRule.value;
      }
    }
  }

  /**
   * Convert array to object
   * @param array
   * @returns {Object}
   * @private
   */
  private _toObject(array: any): object {
    const result = {};
    array.forEach((item) => {
      result[item.key] = item.value;
    });
    return result;
  }

  /**
   * Get parameters required for datasource creation
   * @returns {Object}
   * @private
   */
  private _getCreateDatasourceParams(): object {
    return {
      dsType: 'MASTER',
      srcType: 'REALTIME',
      connType: 'ENGINE',
      granularity: this.getIngestionData.selectedQueryGranularity.value,
      segGranularity: this.getIngestionData.selectedSegmentGranularity.value,
      name: this.createCompleteData.sourceName.trim(),
      description: this.createCompleteData.sourceDescription ? this.createCompleteData.sourceDescription.trim() : '',
      ingestion: this._getIngestionParams(),
      fields: this._getFieldsParams()
    };
  }

  /**
   * Get fields parameter
   * @returns {any[]}
   * @private
   */
  private _getFieldsParams(): any[] {
    // timestamp enable
    const isCreateTimestamp = this.getSchemaData.selectedTimestampType === DataStorageConstant.Datasource.TimestampType.CURRENT;
    // fields param
    const fields = _.cloneDeep(this.getSchemaData.fieldList);
    // seq number
    let seq = 0;
    // field setting
    fields.forEach((column) => {
      // set seq num and increase seq
      column['seq'] = seq++;
      // set ingestion rule
      this._setColumnIngestionRule(column);
      // if you don't want to create a timestamp column
      if (!isCreateTimestamp) {
        // if specified as a timestamp column
        if (column.name === this.getSchemaData.selectedTimestampField.name) {
          column.role = 'TIMESTAMP';
        } else if (column.name !== this.getSchemaData.selectedTimestampField.name
          && column.role === 'TIMESTAMP') {
          // this column is not timestamp column, but column role is timestamp, specified as Dimension
          column.role = 'DIMENSION';
        }
      }
      // delete unnecessary property
      this._deleteColumnProperty(column);
    });
    // if no column is specified as timestamp
    if (isCreateTimestamp) {
      fields.push(this._createCurrentColumn(seq));
    }
    return fields;
  }

  /**
   * Get ingestion parameter
   * @returns {Object}
   * @private
   */
  private _getIngestionParams(): object {
    // ingestion param
    const ingestion = {
      type: 'realtime',
      topic: this._sourceData.kafkaData.topic,
      consumerType: 'KAFKA',
      consumerProperties: {
        'bootstrap.servers': this._sourceData.kafkaData.bootstrapServer
      },
      format: {
        type: 'json'
      }
    };
    // advanced
    if (this.getIngestionData.tuningConfig.filter(item => StringUtil.isNotEmpty(item.key) && StringUtil.isNotEmpty(item.value)).length > 0) {
      ingestion['tuningOptions'] = this._toObject(this.getIngestionData.tuningConfig.filter(item => StringUtil.isNotEmpty(item.key) && StringUtil.isNotEmpty(item.value)));
    }
    // if not used current_time TIMESTAMP, set intervals
    if (this.getSchemaData.selectedTimestampType !== DataStorageConstant.Datasource.TimestampType.CURRENT) {
      ingestion['intervals'] = [this._granularityService.getIntervalUsedParam(this.getIngestionData.startIntervalText, this.getIngestionData.selectedSegmentGranularity) + '/' + this._granularityService.getIntervalUsedParam(this.getIngestionData.endIntervalText, this.getIngestionData.selectedSegmentGranularity)];
    }
    return ingestion;
  }
}


text:
package edu.ptu.androidtest.android.act;

import android.os.Bundle;

import androidx.annotation.Nullable;

public class LauchmodeStandardUIDialogActivity extends LauchmodeUIActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

}


text:
=====================
agate-stats |release|
=====================

.. include:: ../README.rst

Install
=======

To install:

.. code-block:: bash

    pip install agate-stats

For details on development or supported platforms see the `agate documentation <http://agate.readthedocs.org>`_.

Usage
=====

agate-stats uses a monkey patching pattern to add additional statistical methods to all :class:`agate.Table <agate.table.Table>` instances.

.. code-block:: python

    import agate
    import agatestats

Importing agate-stats adds methods to :class:`agate.Table <agate.table.Table>`. For example, to filter a table to only those rows whose ``cost`` value is an outliers by more than 3 standard deviations you would use :meth:`.TableStats.stdev_outliers`:

.. code-block:: python

    outliers = table.stdev_outliers('price')

In addition to Table methods agatestats also includes a variety of additional aggregations and computations. See the API section of the docs for a complete list of all the added features.

===
API
===

.. autofunction:: agatestats.table.stdev_outliers

.. autofunction:: agatestats.table.mad_outliers

.. autofunction:: agatestats.tableset.stdev_outliers

.. autofunction:: agatestats.tableset.mad_outliers

.. autoclass:: agatestats.aggregations.PearsonCorrelation
    :members:

.. autoclass:: agatestats.computations.ZScores
    :members:

Authors
=======

.. include:: ../AUTHORS.rst

Changelog
=========

.. include:: ../CHANGELOG.rst

License
=======

.. include:: ../COPYING

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
package cz.metacentrum.perun.core.implApi.modules.attributes;

import cz.metacentrum.perun.core.api.Attribute;
import cz.metacentrum.perun.core.api.AttributeDefinition;
import cz.metacentrum.perun.core.api.Host;
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException;
import cz.metacentrum.perun.core.impl.PerunSessionImpl;

/**
 * Abstract class for Host Attributes modules.
 * -----------------------------------------------------------------------------
 * Implements methods for modules to perform default function.
 * In the function that the method in the module does nothing, it is not necessary to implement it, simply extend this abstract class.
 *
 * @author Peter Balcirak <peter.balcirak@gmail.com>
 *
 */
public abstract class HostAttributesModuleAbstract implements HostAttributesModuleImplApi {

	public void checkAttributeSyntax(PerunSessionImpl session, Host host, Attribute attribute) throws WrongAttributeValueException {

	}

	public void checkAttributeSemantics(PerunSessionImpl session, Host host, Attribute attribute) {

	}

	public Attribute fillAttribute(PerunSessionImpl session, Host host, AttributeDefinition attribute) {
		return new Attribute(attribute);
	}

	public void changedAttributeHook(PerunSessionImpl session, Host host, Attribute attribute) {

	}
}


text:
// Code generated by counterfeiter. DO NOT EDIT.
package binaryfakes

import (
	"sync"
)

type FakeBinaryImplementation struct {
	ArchStub        func() string
	archMutex       sync.RWMutex
	archArgsForCall []struct {
	}
	archReturns struct {
		result1 string
	}
	archReturnsOnCall map[int]struct {
		result1 string
	}
	OSStub        func() string
	oSMutex       sync.RWMutex
	oSArgsForCall []struct {
	}
	oSReturns struct {
		result1 string
	}
	oSReturnsOnCall map[int]struct {
		result1 string
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeBinaryImplementation) Arch() string {
	fake.archMutex.Lock()
	ret, specificReturn := fake.archReturnsOnCall[len(fake.archArgsForCall)]
	fake.archArgsForCall = append(fake.archArgsForCall, struct {
	}{})
	stub := fake.ArchStub
	fakeReturns := fake.archReturns
	fake.recordInvocation("Arch", []interface{}{})
	fake.archMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeBinaryImplementation) ArchCallCount() int {
	fake.archMutex.RLock()
	defer fake.archMutex.RUnlock()
	return len(fake.archArgsForCall)
}

func (fake *FakeBinaryImplementation) ArchCalls(stub func() string) {
	fake.archMutex.Lock()
	defer fake.archMutex.Unlock()
	fake.ArchStub = stub
}

func (fake *FakeBinaryImplementation) ArchReturns(result1 string) {
	fake.archMutex.Lock()
	defer fake.archMutex.Unlock()
	fake.ArchStub = nil
	fake.archReturns = struct {
		result1 string
	}{result1}
}

func (fake *FakeBinaryImplementation) ArchReturnsOnCall(i int, result1 string) {
	fake.archMutex.Lock()
	defer fake.archMutex.Unlock()
	fake.ArchStub = nil
	if fake.archReturnsOnCall == nil {
		fake.archReturnsOnCall = make(map[int]struct {
			result1 string
		})
	}
	fake.archReturnsOnCall[i] = struct {
		result1 string
	}{result1}
}

func (fake *FakeBinaryImplementation) OS() string {
	fake.oSMutex.Lock()
	ret, specificReturn := fake.oSReturnsOnCall[len(fake.oSArgsForCall)]
	fake.oSArgsForCall = append(fake.oSArgsForCall, struct {
	}{})
	stub := fake.OSStub
	fakeReturns := fake.oSReturns
	fake.recordInvocation("OS", []interface{}{})
	fake.oSMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeBinaryImplementation) OSCallCount() int {
	fake.oSMutex.RLock()
	defer fake.oSMutex.RUnlock()
	return len(fake.oSArgsForCall)
}

func (fake *FakeBinaryImplementation) OSCalls(stub func() string) {
	fake.oSMutex.Lock()
	defer fake.oSMutex.Unlock()
	fake.OSStub = stub
}

func (fake *FakeBinaryImplementation) OSReturns(result1 string) {
	fake.oSMutex.Lock()
	defer fake.oSMutex.Unlock()
	fake.OSStub = nil
	fake.oSReturns = struct {
		result1 string
	}{result1}
}

func (fake *FakeBinaryImplementation) OSReturnsOnCall(i int, result1 string) {
	fake.oSMutex.Lock()
	defer fake.oSMutex.Unlock()
	fake.OSStub = nil
	if fake.oSReturnsOnCall == nil {
		fake.oSReturnsOnCall = make(map[int]struct {
			result1 string
		})
	}
	fake.oSReturnsOnCall[i] = struct {
		result1 string
	}{result1}
}

func (fake *FakeBinaryImplementation) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.archMutex.RLock()
	defer fake.archMutex.RUnlock()
	fake.oSMutex.RLock()
	defer fake.oSMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeBinaryImplementation) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}


text:
package org.estatio.module.budgetassignment.contributions;

import java.util.List;

import javax.inject.Inject;

import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.ActionLayout;
import org.apache.isis.applib.annotation.Contributed;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Mixin;
import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.value.Blob;

import org.isisaddons.module.excel.dom.ExcelService;

import org.estatio.module.budget.dom.keytable.DirectCostTable;
import org.estatio.module.budgetassignment.imports.DirectCostLine;
import org.estatio.module.budgetassignment.imports.PartitioningTableItemImportExportService;

@Mixin(method="act")
public class DirectCostTable_import {

    private final DirectCostTable directCostTable;

    public DirectCostTable_import(DirectCostTable directCostTable) {
        this.directCostTable = directCostTable;
    }

    @Action(
            semantics = SemanticsOf.NON_IDEMPOTENT
    )
    @ActionLayout(contributed = Contributed.AS_ACTION)
    @MemberOrder(name = "items", sequence = "5")
    public DirectCostTable act(final Blob filename) {
        final List<DirectCostLine> lines = excelService
                .fromExcel(filename, DirectCostLine.class, "directCosts");
        return partitioningTableItemImportExportService.importDirectCostLines(lines);
    }

    @Inject ExcelService excelService;

    @Inject PartitioningTableItemImportExportService partitioningTableItemImportExportService;

}


text:
title: On Quitting Google, WhatsApp, BuzzFeed, HuffPost
date: 2014-08-21 18:23:02 +0200
last_modified_at: 2014-08-25 12:00:00 +0200
excerpt: I stopped using a couple of very popular services for a variety of reasons, mainly ethical ones, because I want to be in charge of my own digital life.
categories: Web
tags: [Ethics, Privacy]
permalink: /quitting-google-whatsapp-buzzfeed-huffpost
redirect_from:
  - /quitting-google-whatsapp-buzzfeed-huffpost/
layout: post
---
I stopped using a couple of very popular services for a variety of reasons, mainly ethical ones, because I want to be in charge of my own digital life.

## Quitting Google

I quit Google because the collection of data is getting too pervasive. I have no issues with publishing information about myself or storing sensitive data in the cloud, but I like to know what is stored and being able to delete it. And Google doesn't let me know or delete it. So I don't use Gmail or Google search anymore. Instead it's [FastMail](https://www.fastmail.com/?STKI=12165361 "FastMail E-Mail Service") and [DuckDuckGo](https://duckduckgo.com/ "DuckDuckGo Search Engine").

I never used Google+ in the first place.

## Quitting WhatsApp

WhatsApp had too many security and privacy issues and also technical problems. At first I was unsure if I should really delete my account. Then being bought by Facebook didn't make me feel better about the whole thing. So I deleted all my data and my account even though 38% of Germans have an account which is _huge_.

## Quitting Huffington Post

I never used the Huffington Post and the likes in the first place. They just scrape content from the Internet and republish it as fast and as much as possible but under their own name. More content is better for getting lots of people via search engines or because of the greater exposure on social media.  Also most of the articles they publish don't add any value to the original article they are using as the source.

## Quitting BuzzFeed

BuzzFeed and the likes are even worse. They use the same tactics like HuffPost but in a more deceiving way. All headlines are click-bait like <q>[Famous person] got into trouble. You won't believe what happened.</q> Which means you have to click on the link because a) you are interested in the person but don't know what happened and b) it sounds mysterious and pushes your buttons. Which means you are tricked into it.

Better headlines would be "[Famous person] got into trouble for unpaid parking tickets." Then you are able to decide if it's worth to spend your time reading the article.

I never used these sites which use these means of getting readers (or more appropriately eyeballs to display ads to).

## The Takeaway

You can shape the world out there if you decide what kind of services you want to consume and pay for.

- Don't use services which employ business ethics which you don't agree with.
- Vote with your money. "If you don't pay for the product you are the product."
- Don't click on links if you don't know what the linked article is all about.
- Don't click on links for headlines which end with a question mark. The question mark just means the author can freely speculate as much as he/she likes.

At least keep your private accounts on services which value your privacy. You can change jobs but not your life.

#### Update 2014-08-25

[Facebook started fighting click-baiting today](https://newsroom.fb.com/news/2014/08/news-feed-fyi-click-baiting/ "Facebook started fighting click-baiting today").


text:
var express = require('express');
var MongoClient = require('mongodb').MongoClient;
var router = express.Router();
var performanceSchema = require('../models/performanceSchema');
var connectionString = "mongodb://dishant:123456@ds053196.mlab.com:53196/coursegame";
var ObjectId = require('mongodb').ObjectID;

// localhost:3000/performances
router.get('/', function(req, res, next) {
  MongoClient.connect(connectionString, function(err, db) {
    if(err) throw err;
    else {
      var collection = db.collection('Performance');
      collection.find().toArray(function(err, performances) {
        if (err) throw err;
        else {
          res.send({"Status":true,"Result":performances});
        }
      });
    }
  });
});

// localhost:3000/performances/getById/:id
router.get('/getById/:id',function(req, res, next){
  MongoClient.connect(connectionString, function(err, db) {
    if(err) throw err;
    else {
      var collection = db.collection('Performance');
      var id = req.params.id;

      collection.findOne({"_id": new ObjectId(id)}, function(err, performance) {
        if (err) throw err;
        else {
          res.send({"Status":true,"Result":performance});
        }
      });
    }
  });
});

// localhost:3000/performances/insert
router.post('/insert',function(req, res, next){
  MongoClient.connect(connectionString, function(err, db) {
    if(err) throw err;
    else {
      var collection = db.collection('Performance');
      var performance = req.body;

    	collection.insert({
        attempts: req.body.attempts,
        score: req.body.score,
        startTime: req.body.startTime,
        endTime: req.body.endTime,
        hintsUsed: req.body.hintsUsed,
        accuracy: req.body.accuracy,
        userId: ObjectId(req.body.userId),
        gameId: ObjectId(req.body.gameId)
    }, function(err, performance) {
    		if (err) throw err;
        else {
          res.send({"Status":true,"Result":"Record inserted successfully.", "insertedUser": performance.ops[0]});
        }
      });
    }
  });
});

// localhost:3000/performances/update/:id
router.post('/update', function(req, res, next){
  MongoClient.connect(connectionString, function(err, db) {
    if(err) throw err;
    else {
      var collection = db.collection('performance');
      var id = req.body._id;
      var updatedPerformance = {
        attempts: req.body.attempts,
        score: req.body.score,
        startTime: req.body.startTime,
        endTime: req.body.endTime,
        hintsUsed: req.body.hintsUsed,
        accuracy: req.body.accuracy,
        userId: ObjectId(req.body.userId),
        gameId: ObjectId(req.body.gameId)
      };

      collection.update(
        {_id: ObjectId(id)},
        {$set: updatedPerformance},
        function(err, object) {
            if (err) throw err;
            else {
                res.json({"Status":true, "Result":"Record updated successfully."});
            }
        });
    }
  });
});

// localhost:3000/performances/delete/:id
router.delete('/delete/:id', function(req,res, next){
  MongoClient.connect(connectionString, function(err, db) {
    if(err) throw err;
    else {
      var collection = db.collection('Performance');
      var id = req.params.id;

      console.log(id);
      collection.remove({_id: ObjectId(id)},
        function(err, object) {
            if (err) throw err;
            else {
                res.json({"Status":true, "Result":"Record deleted successfully."});
            }
        });
    }
  });
});

module.exports = router;


text:
{% load i18n %}
{% load content_helper %}

{% if comment_list %}

    {% for comment in comment_list|slice:":3" %}
      {% include "foirequest/alpha/body/message/comments/comment.html" %}
    {% endfor %}

    {% if comment_list|length > 3 %}

        {% for comment in comment_list|slice:"3:" %}
          {% include "foirequest/alpha/body/message/comments/comment.html" %}
        {% endfor %}

          {% blocktrans with count=comment_list|length|add:"-3" %}
            Show {{ count }} other comments
          {% endblocktrans %}

    {% endif %}

{% endif %}


text:
<?php
/*
Plugin Name: Twig Plugin
Description: Include Twig Engine for make simple themes
Version: 1.4
Author: Sergio Guastaferro
Author URI: https://www.linkedin.com/in/sergio-guastaferro/
*/

//loading other dependencies
require_once dirname(__FILE__).'/twig_plugin/vendor/autoload.php';

//loading model class of the page
require_once dirname(__FILE__).'/twig_plugin/PageModel.class.php';

$thisfile=basename(__FILE__, ".php");

register_plugin(
	$thisfile,
	'Twig Plugin',
	'1.3',
	'Sergio Guastaferro',
	'https://www.linkedin.com/in/sergio-guastaferro-5826a171',
	'Include Twig Engine for make simple themes',
	'',
	''
);

// functions
// get an initialized twig instance
function getTwig(){
	$dbWebsite = GSDATAOTHERPATH . 'website.xml';
	$dataWebsite = getXML($dbWebsite);
	$currThemePath = dirname(__FILE__) . '/../theme/' . $dataWebsite->TEMPLATE;

    $loader = new \Twig\Loader\FilesystemLoader($currThemePath . '/views');
	$twig = new \Twig\Environment($loader);

	$getSimpleWrapFunc = new \Twig\TwigFunction("_gs", function ($function_name, array $params = [] ){
        return call_user_func_array($function_name, $params);
    }, ['is_variadic' => true]);
    $twig->addFunction($getSimpleWrapFunc);

	return $twig;
}

// get the page-model of the current page, this is the 'context' to pass to twig
function getPageModel(){
	return new Labgua\Twig_Plugin\Page();
}

// shortcut to render a specific template ( defined in 'theme/MYTHEME/view/' ) with the current page-model
function render( $template_name ){
	$template = getTwig()->loadTemplate( $template_name );
	$pageModel = getPageModel();
	return $template->render( $pageModel->export() );
}

?>


text:
package com.jme.math;

import java.io.IOException;
import java.io.Serializable;
import java.nio.FloatBuffer;

import com.jme.util.export.InputCapsule;
import com.jme.util.export.JMEExporter;
import com.jme.util.export.JMEImporter;
import com.jme.util.export.OutputCapsule;
import com.jme.util.export.Savable;
import com.jme.util.geom.BufferUtils;

/**
 * Line defines a line. Where a line is defined as infinite along
 * two points. The two points of the line are defined as the origin and direction.
 *
 * @author Mark Powell
 * @author Joshua Slack
 */
public class Line implements Serializable, Savable, Cloneable {
    //todo: merge with Ray?
    private static final long serialVersionUID = 1L;

    private Vector3f origin;
    private Vector3f direction;

    private static final Vector3f compVec1 = new Vector3f();
	private static final Vector3f compVec2 = new Vector3f();
	private static final Matrix3f compMat1 = new Matrix3f();
	private static final Eigen3f compEigen1 = new Eigen3f();

    /**
     * Constructor instantiates a new Line object. The origin and
     * direction are set to defaults (0,0,0).
     *
     */
    public Line() {
        origin = new Vector3f();
        direction = new Vector3f();
    }

    /**
     * Constructor instantiates a new Line object. The origin
     * and direction are set via the parameters.
     * @param origin the origin of the line.
     * @param direction the direction of the line.
     */
    public Line(Vector3f origin, Vector3f direction) {
        this.origin = origin;
        this.direction = direction;
    }

    /**
     *
     * getOrigin returns the origin of the line.
     * @return the origin of the line.
     */
    public Vector3f getOrigin() {
        return origin;
    }

    /**
     *
     * setOrigin sets the origin of the line.
     * @param origin the origin of the line.
     */
    public void setOrigin(Vector3f origin) {
        this.origin = origin;
    }

    /**
     *
     * getDirection returns the direction of the line.
     * @return the direction of the line.
     */
    public Vector3f getDirection() {
        return direction;
    }

    /**
     *
     * setDirection sets the direction of the line.
     * @param direction the direction of the line.
     */
    public void setDirection(Vector3f direction) {
        this.direction = direction;
    }

    public float distanceSquared(Vector3f point) {
       point.subtract(origin, compVec1);
       float lineParameter = direction.dot(compVec1);
       origin.add(direction.mult(lineParameter, compVec2), compVec2);
       compVec2.subtract(point, compVec1);
       return compVec1.lengthSquared();
    }

    public float distance(Vector3f point) {
    	return FastMath.sqrt(distanceSquared(point));
    }

    public void orthogonalLineFit(FloatBuffer points) {
		if (points == null) {
			return;
		}

		points.rewind();

		// compute average of points
		int length = points.remaining() / 3;

		BufferUtils.populateFromBuffer(origin, points, 0);
		for (int i = 1; i < length; i++) {
			BufferUtils.populateFromBuffer(compVec1, points, i);
			origin.addLocal(compVec1);
		}

		origin.multLocal(1f / (float) length);

		// compute sums of products
		float sumXX = 0.0f, sumXY = 0.0f, sumXZ = 0.0f;
		float sumYY = 0.0f, sumYZ = 0.0f, sumZZ = 0.0f;

		points.rewind();
		for (int i = 0; i < length; i++) {
			BufferUtils.populateFromBuffer(compVec1, points, i);
			compVec1.subtract(origin, compVec2);
			sumXX += compVec2.x * compVec2.x;
			sumXY += compVec2.x * compVec2.y;
			sumXZ += compVec2.x * compVec2.z;
			sumYY += compVec2.y * compVec2.y;
			sumYZ += compVec2.y * compVec2.z;
			sumZZ += compVec2.z * compVec2.z;
		}

		//find the smallest eigen vector for the direction vector
		compMat1.m00 = sumYY + sumZZ;
		compMat1.m01 = -sumXY;
		compMat1.m02 = -sumXZ;
		compMat1.m10 = -sumXY;
		compMat1.m11 = sumXX + sumZZ;
		compMat1.m12 = -sumYZ;
		compMat1.m20 = -sumXZ;
		compMat1.m21 = -sumYZ;
		compMat1.m22 = sumXX + sumYY;

		compEigen1.calculateEigen(compMat1);
		direction = compEigen1.getEigenVector(0);
	}

    /**
     *
     * random determines a random point along the line.
     * @return a random point on the line.
     */
    public Vector3f random() {
        return random(null);
    }

    /**
     * random determines a random point along the line.
     *
     * @param result Vector to store result in
     * @return a random point on the line.
     */
    public Vector3f random(Vector3f result) {
        if (result == null) {
            result = new Vector3f();
        }
        float rand = (float) Math.random();

        result.x = (origin.x * (1 - rand)) + (direction.x * rand);
        result.y = (origin.y * (1 - rand)) + (direction.y * rand);
        result.z = (origin.z * (1 - rand)) + (direction.z * rand);

        return result;
    }

    public void write(JMEExporter e) throws IOException {
        OutputCapsule capsule = e.getCapsule(this);
        capsule.write(origin, "origin", Vector3f.ZERO);
        capsule.write(direction, "direction", Vector3f.ZERO);
    }

    public void read(JMEImporter e) throws IOException {
        InputCapsule capsule = e.getCapsule(this);
        origin = (Vector3f)capsule.readSavable("origin", Vector3f.ZERO.clone());
        direction = (Vector3f)capsule.readSavable("direction", Vector3f.ZERO.clone());
    }

    public Class<? extends Line> getClassTag() {
        return this.getClass();
    }

    @Override
    public Line clone() {
        try {
            Line line = (Line) super.clone();
            line.direction = direction.clone();
            line.origin = origin.clone();
            return line;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}


text:
var gulp = require("gulp");
var gutil = require("gulp-util");
var webpack = require("webpack");
var webpackConfig = require("./webpack.production.config.js");
var del = require('del');

gulp.task('clean', function () {
  return del([
    'dist/**/*.*'
  ]);
});
gulp.task('copy', function(){
  // the base option sets the relative root for the set of files,
  // preserving the folder structure
  gulp.src(['**/*.*', '!**/*.js', '!**/*.scss'], { base: './app' })
  .pipe(gulp.dest('www'));
});

gulp.task("build", ['clean', 'copy']);


text:
#region S# License

#endregion S# License
namespace StockSharp.Messages
{
	using System;
	using System.ComponentModel;
	using System.Runtime.Serialization;

	using Ecng.Common;
	using Ecng.Serialization;

	using StockSharp.Localization;

	/// <summary>
	/// The types of data that contain information in <see cref="ExecutionMessage"/>.
	/// </summary>
	[System.Runtime.Serialization.DataContract]
	[Serializable]
	public enum ExecutionTypes
	{
		/// <summary>
		/// Tick trade.
		/// </summary>
		[EnumMember]
		Tick,

		/// <summary>
		/// Transaction.
		/// </summary>
		[EnumMember]
		Transaction,

		/// <summary>
		/// Obsolete.
		/// </summary>
		[EnumMember]
		[Obsolete]
		Obsolete,

		/// <summary>
		/// Order log.
		/// </summary>
		[EnumMember]
		OrderLog,
	}

	/// <summary>
	/// The message contains information about the execution.
	/// </summary>
	[Serializable]
	[System.Runtime.Serialization.DataContract]
	public sealed class ExecutionMessage : Message
	{
		/// <summary>
		/// Security ID.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.SecurityIdKey)]
		[DescriptionLoc(LocalizedStrings.SecurityIdKey, true)]
		[MainCategory]
		public SecurityId SecurityId { get; set; }

		/// <summary>
		/// Portfolio name.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.PortfolioKey)]
		[DescriptionLoc(LocalizedStrings.PortfolioNameKey)]
		[MainCategory]
		public string PortfolioName { get; set; }

		/// <summary>
		/// Client code assigned by the broker.
		/// </summary>
		[DataMember]
		[MainCategory]
		[DisplayNameLoc(LocalizedStrings.ClientCodeKey)]
		[DescriptionLoc(LocalizedStrings.ClientCodeDescKey)]
		public string ClientCode { get; set; }

		/// <summary>
		/// Broker firm code.
		/// </summary>
		[DataMember]
		[MainCategory]
		[CategoryLoc(LocalizedStrings.Str2593Key)]
		[DisplayNameLoc(LocalizedStrings.BrokerKey)]
		[DescriptionLoc(LocalizedStrings.Str2619Key)]
		public string BrokerCode { get; set; }

		/// <summary>
		/// The depositary where the physical security.
		/// </summary>
		[DisplayNameLoc(LocalizedStrings.DepoKey)]
		[DescriptionLoc(LocalizedStrings.DepoNameKey)]
		[MainCategory]
		public string DepoName { get; set; }

		/// <summary>
		/// Server time.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.ServerTimeKey)]
		[DescriptionLoc(LocalizedStrings.ServerTimeKey, true)]
		[MainCategory]
		public DateTimeOffset ServerTime { get; set; }

		/// <summary>
		/// Transaction ID.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.TransactionKey)]
		[DescriptionLoc(LocalizedStrings.TransactionIdKey, true)]
		[MainCategory]
		public long TransactionId { get; set; }

		/// <summary>
		/// ID of original transaction, for which this message is the answer.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.OriginalTrasactionKey)]
		[DescriptionLoc(LocalizedStrings.OriginalTrasactionIdKey)]
		[MainCategory]
		public long OriginalTransactionId { get; set; }

		/// <summary>
		/// Data type, information about which is contained in the <see cref="ExecutionMessage"/>.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.DataTypeKey)]
		[DescriptionLoc(LocalizedStrings.Str110Key)]
		[MainCategory]
		[Nullable]
		public ExecutionTypes? ExecutionType { get; set; }

		/// <summary>
		/// Is the action an order cancellation.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.CancelKey)]
		[DescriptionLoc(LocalizedStrings.IsActionOrderCancellationKey)]
		[MainCategory]
		public bool IsCancelled { get; set; }

		/// <summary>
		/// Order ID.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.OrderIdKey)]
		[DescriptionLoc(LocalizedStrings.OrderIdKey, true)]
		[MainCategory]
		[Nullable]
		public long? OrderId { get; set; }

		/// <summary>
		/// Order ID (as string, if electronic board does not use numeric order ID representation).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.OrderIdStringKey)]
		[DescriptionLoc(LocalizedStrings.OrderIdStringDescKey)]
		[MainCategory]
		public string OrderStringId { get; set; }

		/// <summary>
		/// Board order id. Uses in case of <see cref="ExecutionMessage.OrderId"/> and <see cref="ExecutionMessage.OrderStringId"/> is a brokerage system ids.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str117Key)]
		[DescriptionLoc(LocalizedStrings.Str118Key)]
		[MainCategory]
		public string OrderBoardId { get; set; }

		/// <summary>
		/// Derived order ID (e.g., conditional order generated a real exchange order).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.DerivedKey)]
		[DescriptionLoc(LocalizedStrings.DerivedOrderIdKey)]
		[MainCategory]
		[Nullable]
		public long? DerivedOrderId { get; set; }

		/// <summary>
		/// Derived order ID (e.g., conditional order generated a real exchange order).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.DerivedStringKey)]
		[DescriptionLoc(LocalizedStrings.DerivedStringDescKey)]
		[MainCategory]
		public string DerivedOrderStringId { get; set; }

		/// <summary>
		/// Is the message contains order info.
		/// </summary>
		public bool HasOrderInfo { get; set; }

		/// <summary>
		/// Is the message contains trade info.
		/// </summary>
		public bool HasTradeInfo { get; set; }

		/// <summary>
		/// Order price.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.PriceKey)]
		[DescriptionLoc(LocalizedStrings.OrderPriceKey)]
		[MainCategory]
		public decimal OrderPrice { get; set; }

		/// <summary>
		/// Number of contracts in an order.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.VolumeOrderKey)]
		[DescriptionLoc(LocalizedStrings.OrderVolumeKey)]
		[MainCategory]
		[Nullable]
		public decimal? OrderVolume { get; set; }

		/// <summary>
		/// Number of contracts in an trade.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.VolumeTradeKey)]
		[DescriptionLoc(LocalizedStrings.TradeVolumeKey)]
		[MainCategory]
		[Nullable]
		public decimal? TradeVolume { get; set; }

		/// <summary>
		/// Visible quantity of contracts in order.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.VisibleVolumeKey)]
		[DescriptionLoc(LocalizedStrings.Str127Key)]
		[MainCategory]
		[Nullable]
		public decimal? VisibleVolume { get; set; }

		/// <summary>
		/// Order side (buy or sell).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str128Key)]
		[DescriptionLoc(LocalizedStrings.Str129Key)]
		[MainCategory]
		public Sides Side { get; set; }

		/// <summary>
		/// Order contracts remainder.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str130Key)]
		[DescriptionLoc(LocalizedStrings.Str131Key)]
		[MainCategory]
		[Nullable]
		public decimal? Balance { get; set; }

		/// <summary>
		/// Order type.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str132Key)]
		[DescriptionLoc(LocalizedStrings.Str133Key)]
		[MainCategory]
		public OrderTypes? OrderType { get; set; }

		/// <summary>
		/// System order status.
		/// </summary>
		[DataMember]
		[Browsable(false)]
		[Nullable]
		public OrderStatus? OrderStatus { get; set; }

		/// <summary>
		/// Order state.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.StateKey)]
		[DescriptionLoc(LocalizedStrings.Str134Key)]
		[MainCategory]
		[Nullable]
		public OrderStates? OrderState { get; set; }

		/// <summary>
		/// Placed order comment.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str135Key)]
		[DescriptionLoc(LocalizedStrings.Str136Key)]
		[MainCategory]
		public string Comment { get; set; }

		/// <summary>
		/// Message for order (created by the trading system when registered, changed or cancelled).
		/// </summary>
		[DisplayNameLoc(LocalizedStrings.Str137Key)]
		[DescriptionLoc(LocalizedStrings.Str138Key)]
		[MainCategory]
		public string SystemComment { get; set; }

		/// <summary>
		/// Is a system trade.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str139Key)]
		[DescriptionLoc(LocalizedStrings.Str140Key)]
		[MainCategory]
		[Nullable]
		public bool? IsSystem { get; set; }

		/// <summary>
		/// Order expiry time. The default is <see langword="null" />, which mean (GTC).
		/// </summary>
		/// <remarks>
		/// If the value is equal <see langword="null" /> or <see cref="DateTimeOffset.MaxValue"/>, order will be GTC (good til cancel). Or uses exact date.
		/// </remarks>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str141Key)]
		[DescriptionLoc(LocalizedStrings.Str142Key)]
		[MainCategory]
		public DateTimeOffset? ExpiryDate { get; set; }

		/// <summary>
		/// Limit order execution condition.
		/// </summary>
		[DisplayNameLoc(LocalizedStrings.Str143Key)]
		[DescriptionLoc(LocalizedStrings.Str144Key)]
		[MainCategory]
		[Nullable]
		public TimeInForce? TimeInForce { get; set; }

		/// <summary>
		/// Trade ID.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.OrderIdKey)]
		[DescriptionLoc(LocalizedStrings.Str145Key)]
		[MainCategory]
		[Nullable]
		public long? TradeId { get; set; }

		/// <summary>
		/// Trade ID (as string, if electronic board does not use numeric order ID representation).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.OrderIdStringKey)]
		[DescriptionLoc(LocalizedStrings.Str146Key)]
		[MainCategory]
		public string TradeStringId { get; set; }

		/// <summary>
		/// Trade price.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.PriceKey)]
		[DescriptionLoc(LocalizedStrings.Str147Key)]
		[MainCategory]
		[Nullable]
		public decimal? TradePrice { get; set; }

		/// <summary>
		/// System trade status.
		/// </summary>
		[DataMember]
		[Browsable(false)]
		[Nullable]
		public int? TradeStatus { get; set; }

		/// <summary>
		/// Deal initiator (seller or buyer).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str148Key)]
		[DescriptionLoc(LocalizedStrings.Str149Key)]
		[MainCategory]
		[Nullable]
		public Sides? OriginSide { get; set; }

		/// <summary>
		/// Number of open positions (open interest).
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str150Key)]
		[DescriptionLoc(LocalizedStrings.Str151Key)]
		[MainCategory]
		[Nullable]
		public decimal? OpenInterest { get; set; }

		/// <summary>
		/// Error registering/cancelling order.
		/// </summary>
		[DisplayNameLoc(LocalizedStrings.Str152Key)]
		[DescriptionLoc(LocalizedStrings.Str153Key)]
		[MainCategory]
		public Exception Error { get; set; }

		/// <summary>
		/// Order condition (e.g., stop- and algo- orders parameters).
		/// </summary>
		[DisplayNameLoc(LocalizedStrings.Str154Key)]
		[DescriptionLoc(LocalizedStrings.Str155Key)]
		[CategoryLoc(LocalizedStrings.Str156Key)]
		public OrderCondition Condition { get; set; }

		///// <summary>
		///// Является ли сообщение последним в запрашиваемом пакете (только для исторических сделок).
		///// </summary>
		//[DataMember]
		//[DisplayName("Последний")]
		//[Description("Является ли сообщение последним в запрашиваемом пакете (только для исторических сделок).")]
		//[MainCategory]
		//public bool IsFinished { get; set; }

		/// <summary>
		/// Is tick uptrend or downtrend in price. Uses only <see cref="ExecutionType"/> for <see cref="ExecutionTypes.Tick"/>.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str157Key)]
		[DescriptionLoc(LocalizedStrings.Str158Key)]
		[MainCategory]
		[Nullable]
		public bool? IsUpTick { get; set; }

		/// <summary>
		/// Commission (broker, exchange etc.).  Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str159Key)]
		[DescriptionLoc(LocalizedStrings.Str160Key)]
		[MainCategory]
		[Nullable]
		public decimal? Commission { get; set; }

		/// <summary>
		/// Network latency. Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str161Key)]
		[DescriptionLoc(LocalizedStrings.Str162Key)]
		[MainCategory]
		[Nullable]
		public TimeSpan? Latency { get; set; }

		/// <summary>
		/// Slippage in trade price. Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str163Key)]
		[DescriptionLoc(LocalizedStrings.Str164Key)]
		[MainCategory]
		[Nullable]
		public decimal? Slippage { get; set; }

		/// <summary>
		/// User order id. Uses when <see cref="ExecutionType"/> set to <see cref="ExecutionTypes.Transaction"/>.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str165Key)]
		[DescriptionLoc(LocalizedStrings.Str166Key)]
		[MainCategory]
		public string UserOrderId { get; set; }

		/// <summary>
		/// Trading security currency.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.CurrencyKey)]
		[DescriptionLoc(LocalizedStrings.Str382Key)]
		[MainCategory]
		[Nullable]
		public CurrencyTypes? Currency { get; set; }

		/// <summary>
		/// The profit, realized by trade.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.PnLKey)]
		[DescriptionLoc(LocalizedStrings.PnLKey, true)]
		[MainCategory]
		[Nullable]
		public decimal? PnL { get; set; }

		/// <summary>
		/// The position, generated by order or trade.
		/// </summary>
		[DataMember]
		[DisplayNameLoc(LocalizedStrings.Str862Key)]
		[DescriptionLoc(LocalizedStrings.Str862Key, true)]
		[MainCategory]
		[Nullable]
		public decimal? Position { get; set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="ExecutionMessage"/>.
		/// </summary>
		public ExecutionMessage()
			: base(MessageTypes.Execution)
		{
		}

		/// <summary>
		/// Returns a string that represents the current object.
		/// </summary>
		/// <returns>A string that represents the current object.</returns>
		public override string ToString()
		{
			return base.ToString() + ",T(S)={0:yyyy/MM/dd HH:mm:ss.fff},({1}),Sec={2},Ord={3}/{4}/{5},Fail={6},Price={7},OrdVol={8},TrVol={9},Bal={10},TId={11},Pf={12},TPrice={13},UId={14},State={15}"
				.Put(ServerTime, ExecutionType, SecurityId, OrderId, TransactionId, OriginalTransactionId,
					Error, OrderPrice, OrderVolume, TradeVolume, Balance, TradeId, PortfolioName, TradePrice, UserOrderId, OrderState);
		}

		/// <summary>
		/// Create a copy of <see cref="ExecutionMessage"/>.
		/// </summary>
		/// <returns>Copy.</returns>
		public override Message Clone()
		{
			var clone = new ExecutionMessage
			{
				Balance = Balance,
				Comment = Comment,
				Condition = Condition.CloneNullable(),
				ClientCode = ClientCode,
				BrokerCode = BrokerCode,
				Currency = Currency,
				ServerTime = ServerTime,
				DepoName = DepoName,
				Error = Error,
				ExpiryDate = ExpiryDate,
				IsSystem = IsSystem,
				LocalTime = LocalTime,
				OpenInterest = OpenInterest,
				OrderId = OrderId,
				OrderStringId = OrderStringId,
				OrderBoardId = OrderBoardId,
				ExecutionType = ExecutionType,
				IsCancelled = IsCancelled,
				//Action = Action,
				OrderState = OrderState,
				OrderStatus = OrderStatus,
				OrderType = OrderType,
				OriginSide = OriginSide,
				PortfolioName = PortfolioName,
				OrderPrice = OrderPrice,
				SecurityId = SecurityId,
				Side = Side,
				SystemComment = SystemComment,
				TimeInForce = TimeInForce,
				TradeId = TradeId,
				TradeStringId = TradeStringId,
				TradePrice = TradePrice,
				TradeStatus = TradeStatus,
				TransactionId = TransactionId,
				OriginalTransactionId = OriginalTransactionId,
				OrderVolume = OrderVolume,
				TradeVolume = TradeVolume,
				//IsFinished = IsFinished,
				VisibleVolume = VisibleVolume,
				IsUpTick = IsUpTick,
				Commission = Commission,
				Latency = Latency,
				Slippage = Slippage,
				UserOrderId = UserOrderId,

				DerivedOrderId = DerivedOrderId,
				DerivedOrderStringId = DerivedOrderStringId,

				PnL = PnL,
				Position = Position,

				HasTradeInfo = HasTradeInfo,
				HasOrderInfo = HasOrderInfo
			};

			this.CopyExtensionInfo(clone);

			return clone;
		}
	}
}