text:
require "helper"
require "json"

describe Google::Cloud::Storage::Project, :mock_storage do
  let(:bucket_name) { "new-bucket-#{Time.now.to_i}" }
  let(:bucket_url_root) { "https://www.googleapis.com/storage/v1" }
  let(:bucket_url) { "#{bucket_url_root}/b/#{bucket_name}" }
  let(:bucket_location) { "EU" }
  let(:bucket_storage_class) { "DURABLE_REDUCED_AVAILABILITY" }
  let(:bucket_logging_bucket) { "bucket-name-logging" }
  let(:bucket_logging_prefix) { "AccessLog" }
  let(:bucket_website_main) { "index.html" }
  let(:bucket_website_404) { "404.html" }
  let(:bucket_cors) { [{ max_age_seconds: 300,
                         origin: ["http://example.org", "https://example.org"],
                         http_method: ["*"],
                         response_header: ["X-My-Custom-Header"] }] }
  let(:bucket_cors_gapi) { bucket_cors.map { |c| Google::Apis::StorageV1::Bucket::CorsConfiguration.new c } }

  it "creates a bucket" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
  end

  it "creates a bucket with location" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name, location: bucket_location
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, location: bucket_location

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
    bucket.location.must_equal bucket_location
  end

  it "creates a bucket with storage_class" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name, storage_class: bucket_storage_class
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, storage_class: bucket_storage_class

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
    bucket.storage_class.must_equal bucket_storage_class
  end

  it "creates a bucket with versioning" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name, versioning: Google::Apis::StorageV1::Bucket::Versioning.new(enabled: true)
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, versioning: true

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
    bucket.versioning?.must_equal true
  end

  it "creates a bucket with logging bucket and prefix" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name, logging: Google::Apis::StorageV1::Bucket::Logging.new(log_bucket: bucket_logging_bucket, log_object_prefix: bucket_logging_prefix)
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, logging_bucket: bucket_logging_bucket, logging_prefix: bucket_logging_prefix

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
    bucket.logging_bucket.must_equal bucket_logging_bucket
    bucket.logging_prefix.must_equal bucket_logging_prefix
  end

  it "creates a bucket with website main and 404" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name, website: Google::Apis::StorageV1::Bucket::Website.new(main_page_suffix: bucket_website_main, not_found_page: bucket_website_404)
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, website_main: bucket_website_main, website_404: bucket_website_404

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
    bucket.website_main.must_equal bucket_website_main
    bucket.website_404.must_equal bucket_website_404
  end

  it "creates a bucket with block CORS" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name, cors: bucket_cors_gapi
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: nil]

    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name do |b|
      b.cors.add_rule ["http://example.org", "https://example.org"],
                       "*",
                       headers: "X-My-Custom-Header",
                       max_age: 300
    end

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
    bucket.cors.class.must_equal Google::Cloud::Storage::Bucket::Cors
  end

  it "creates a bucket with predefined acl" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: "private", predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, acl: "private"

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
  end

  it "creates a bucket with predefined acl alias" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: "publicRead", predefined_default_object_acl: nil]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, acl: :public

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
  end

  it "creates a bucket with predefined default acl" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: "private"]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, default_acl: :private

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
  end

  it "creates a bucket with predefined default acl alias" do
    mock = Minitest::Mock.new
    created_bucket = create_bucket_gapi bucket_name
    mock.expect :insert_bucket, created_bucket, [project, created_bucket, predefined_acl: nil, predefined_default_object_acl: "publicRead"]
    storage.service.mocked_service = mock

    bucket = storage.create_bucket bucket_name, default_acl: "public"

    mock.verify

    bucket.must_be_kind_of Google::Cloud::Storage::Bucket
    bucket.name.must_equal bucket_name
  end

  it "raises when creating a bucket with a blank name" do
    bucket_name = ""

    stub = Object.new
    def stub.insert_bucket *args
      raise Google::Apis::ClientError.new("invalid argument", status_code: 400)
    end
    storage.service.mocked_service = stub

    assert_raises Google::Cloud::InvalidArgumentError do
      storage.create_bucket bucket_name
    end
  end

  it "lists buckets" do
    num_buckets = 3

    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(num_buckets), [project, prefix: nil, page_token: nil, max_results: nil]

    storage.service.mocked_service = mock

    buckets = storage.buckets

    mock.verify

    buckets.size.must_equal num_buckets
  end

  it "lists buckets with find_buckets alias" do
    num_buckets = 3

    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(num_buckets), [project, prefix: nil, page_token: nil, max_results: nil]

    storage.service.mocked_service = mock

    buckets = storage.find_buckets

    mock.verify

    buckets.size.must_equal num_buckets
  end

  it "paginates buckets" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: nil]
    mock.expect :list_buckets, list_buckets_gapi(2), [project, prefix: nil, page_token: "next_page_token", max_results: nil]

    storage.service.mocked_service = mock

    first_buckets = storage.buckets
    second_buckets = storage.buckets token: first_buckets.token

    mock.verify

    first_buckets.count.must_equal 3
    first_buckets.token.wont_be :nil?
    first_buckets.token.must_equal "next_page_token"

    second_buckets.count.must_equal 2
    second_buckets.token.must_be :nil?
  end

  it "paginates buckets with max set" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: 3]
    mock.expect :list_buckets, list_buckets_gapi(2), [project, prefix: nil, page_token: "next_page_token", max_results: 3]

    storage.service.mocked_service = mock

    first_buckets = storage.buckets max: 3
    second_buckets = storage.buckets token: first_buckets.token,  max: 3

    mock.verify

    first_buckets.count.must_equal 3
    first_buckets.token.wont_be :nil?
    first_buckets.token.must_equal "next_page_token"

    second_buckets.count.must_equal 2
    second_buckets.token.must_be :nil?
  end

  it "paginates buckets without max set" do
    num_buckets = 3

    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: nil]

    storage.service.mocked_service = mock

    buckets = storage.buckets

    mock.verify

    buckets.size.must_equal num_buckets

    buckets.count.must_equal 3
    buckets.token.wont_be :nil?
    buckets.token.must_equal "next_page_token"
  end

  it "paginates buckets with next? and next" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: nil]
    mock.expect :list_buckets, list_buckets_gapi(2), [project, prefix: nil, page_token: "next_page_token", max_results: nil]

    storage.service.mocked_service = mock

    first_buckets = storage.buckets
    second_buckets = first_buckets.next

    mock.verify

    first_buckets.count.must_equal 3
    first_buckets.next?.must_equal true

    second_buckets.count.must_equal 2
    second_buckets.next?.must_equal false
  end

  it "paginates buckets with next? and next and max set" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: 3]
    mock.expect :list_buckets, list_buckets_gapi(2), [project, prefix: nil, page_token: "next_page_token", max_results: 3]

    storage.service.mocked_service = mock

    first_buckets = storage.buckets max: 3
    second_buckets = first_buckets.next

    mock.verify

    first_buckets.count.must_equal 3
    first_buckets.next?.must_equal true

    second_buckets.count.must_equal 2
    second_buckets.next?.must_equal false
  end

  it "paginates buckets with all" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: nil]
    mock.expect :list_buckets, list_buckets_gapi(2), [project, prefix: nil, page_token: "next_page_token", max_results: nil]

    storage.service.mocked_service = mock

    buckets = storage.buckets.all.to_a

    mock.verify

    buckets.count.must_equal 5
  end

  it "paginates buckets with all and max set" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: 3]
    mock.expect :list_buckets, list_buckets_gapi(2), [project, prefix: nil, page_token: "next_page_token", max_results: 3]

    storage.service.mocked_service = mock

    buckets = storage.buckets(max: 3).all.to_a

    mock.verify

    buckets.count.must_equal 5
  end

  it "iterates buckets with all using Enumerator" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: nil]
    mock.expect :list_buckets, list_buckets_gapi(3, "second_page_token"), [project, prefix: nil, page_token: "next_page_token", max_results: nil]

    storage.service.mocked_service = mock

    buckets = storage.buckets.all.take(5)

    mock.verify

    buckets.count.must_equal 5
  end

  it "iterates buckets with all and request_limit set" do
    mock = Minitest::Mock.new
    mock.expect :list_buckets, list_buckets_gapi(3, "next_page_token"), [project, prefix: nil, page_token: nil, max_results: nil]
    mock.expect :list_buckets, list_buckets_gapi(3, "second_page_token"), [project, prefix: nil, page_token: "next_page_token", max_results: nil]

    storage.service.mocked_service = mock

    buckets = storage.buckets.all(request_limit: 1).to_a

    mock.verify

    buckets.count.must_equal 6
  end

  it "finds a bucket" do
    bucket_name = "found-bucket"

    mock = Minitest::Mock.new
    mock.expect :get_bucket, find_bucket_gapi(bucket_name), [bucket_name]

    storage.service.mocked_service = mock

    bucket = storage.bucket bucket_name

    mock.verify

    bucket.name.must_equal bucket_name
  end

  it "finds a bucket with find_bucket alias" do
    bucket_name = "found-bucket"

    mock = Minitest::Mock.new
    mock.expect :get_bucket, find_bucket_gapi(bucket_name), [bucket_name]

    storage.service.mocked_service = mock

    bucket = storage.find_bucket bucket_name

    mock.verify

    bucket.name.must_equal bucket_name
  end

  def create_bucket_gapi name = nil, location: nil, storage_class: nil,
                         versioning: nil, logging: nil, website: nil, cors: nil
    options = {
      name: name, location: location, storage_class: storage_class,
      versioning: versioning, logging: logging, website: website,
      cors_configurations: cors
    }.delete_if { |_, v| v.nil? }
    Google::Apis::StorageV1::Bucket.new options
  end

  def find_bucket_gapi name = nil
    Google::Apis::StorageV1::Bucket.from_json random_bucket_hash(name).to_json
  end

  def list_buckets_gapi count = 2, token = nil
    buckets = count.times.map { random_bucket_hash }
    Google::Apis::StorageV1::Buckets.new(
      kind: "storage#buckets", items: buckets, next_page_token: token
    )
  end
end


text:
from __future__ import absolute_import, unicode_literals

class EmbedException(Exception):
    pass

class EmbedNotFoundException(EmbedException):
    pass

redpajama_set_name: RedPajamaGithub


text:
package org.waveprotocol.wave.model.document.parser;

/**
 * The class indicates an error is encountered while parsing XML. This can be
 * due to any number of reasons, including malformed xml.
 *
 */
public class XmlParseException extends Exception {
  public XmlParseException() {
  }

  public XmlParseException(Throwable t) {
    super(t);
  }

  public XmlParseException(String message, Throwable t) {
    super(message, t);
  }

  public XmlParseException(String message) {
    super(message);
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Schlechtendalia 2: 22 (1999)

#### Original name
Cercospora penstemonis Ellis & Kellerm.

### Remarks
null


text:
Reports uses of java.lang.ProcessBuilder,
which might be unportable between operating systems because
paths to executables, environment variables, command-line arguments and
their escaping might vary depending on the OS.


text:
from Structure import Structure;

# http://www.stdlib.com/art6-1-Shortcut-File-Format-lnk.html
KNOWN_LOCATIONS = {
  0: 'Local volume',
  1: 'Network share',
};

class LNK_FILE_LOCATION_INFO(Structure):
  type_name = 'LNK_FILE_LOCATION_INFO';
  def __init__(self, stream, offset, max_size, parent, name):
    import C;
    Structure.__init__(self, stream, offset, max_size, parent, name);

    self._size = self.Member(C.DWORD, 'size');
    if self._size.value != 0:
      self._data = self.Member(C.STRING, 'data', self._size.value);
      self.ContainStream('data', 'data', self._data.value, self._data.size);
      self._EndOffset = self.ContainMember(C.DWORD, 'EndOffset');
      if self._EndOffset.value != 0x1C:
        self._EndOffset.warnings.append('Expected value to be 0x1C');
      self._Location = self.ContainMember(C.DWORD, 'Location');
      if self._Location.value in KNOWN_LOCATIONS:
        self._Location.notes.append(KNOWN_LOCATIONS[self._Location.value]);
      else:
        self._Location.warnings.append('Expected value to be 0 or 1');
      self._OffsetLocalVolumeTable = self.ContainMember(C.DWORD, 'OffsetLocalVolumeTable');
      self._OffsetBasePath = self.Member(C.DWORD, 'OffsetBasePath');
      self._OffsetNetworkVolumeTable = self.ContainMember(C.DWORD, 'OffsetNetworkVolumeTable');
      self._OffsetFinalPart = self.Member(C.DWORD, 'OffsetFinalPart');
      # TO BE CONTINUED...


text:
import application from "../application";
import apply from "../apply";
import applyTo from "../applyTo";
import { nonArrayLikes, nonFunctions } from "../../__tests__/commons";

describe("application / apply / applyTo", () => {
    function Foo (value) {
        this.value = value;
    }

    Foo.prototype = {
        value: 0,
        bar: function (a, b) {
            return (this.value + a) / b;
        }
    };

    it("should apply the desired function to the given arguments", () => {
        expect(application(Math.max, [-1, 3, 2, 15, 7])).toBe(15);
        expect(apply(Math.max)([-1, 3, 2, 15, 7])).toBe(15);
        expect(applyTo([-1, 3, 2, 15, 7])(Math.max)).toBe(15);
    });

    it("should accept an array-like object as arguments for the function", () => {
        expect(application(Math.max, "3412")).toBe(4);
        expect(apply(Math.max)("3412")).toBe(4);
        expect(applyTo("3412")(Math.max)).toBe(4);
    });

    it("should not alter the function's context", () => {
        const obj = {
            value: 4,
            application: application,
            applyBar: apply(Foo.prototype.bar),
            baz: applyTo([1, 2])
        };

        expect(obj.application(Foo.prototype.bar, [1, 2])).toBe(2.5);
        expect(obj.applyBar([1, 2])).toBe(2.5);
        expect(obj.baz(Foo.prototype.bar)).toBe(2.5);
    });

    it("should treat non-array-like values for the `args` parameter as empty arrays", () => {
        const dummyFn = jest.fn();
        let ofs = 0;

        for (let i = 0; i < nonArrayLikes.length; i++, ofs += 3) {
            application(dummyFn, nonArrayLikes[i]);
            apply(dummyFn)(nonArrayLikes[i]);
            applyTo(nonArrayLikes[i])(dummyFn);

            expect(dummyFn.mock.calls[ofs].length).toBe(0);
            expect(dummyFn.mock.calls[ofs + 1].length).toBe(0);
            expect(dummyFn.mock.calls[ofs + 2].length).toBe(0);
        }

        application(dummyFn);
        apply(dummyFn)();
        applyTo()(dummyFn);

        expect(dummyFn.mock.calls[ofs].length).toBe(0);
        expect(dummyFn.mock.calls[ofs + 1].length).toBe(0);
        expect(dummyFn.mock.calls[ofs + 2].length).toBe(0);
        expect(dummyFn).toHaveBeenCalledTimes(ofs + 3);
    });

    it("should throw an exception if `fn` isn't a function", () => {
        nonFunctions.forEach(value => {
            expect(() => { application(value, []); }).toThrow();
            expect(apply(value)).toThrow();
            expect(() => { applyTo([])(value); }).toThrow();
        });
    });
});


text:
$(function(){

    var path = [];

    $(".img-drag").draggable({
        helper: 'clone'
    });

    $(".direction-pad").droppable({
        drop: function(ev, ui) {
            $(this).html(ui.draggable.clone(true));
            var direction = $(ui.helper).data("direction");
            var position = $(this).data("position");
            path[position] = direction;
        }
    });

    $("#btn_start").on('click', function(){
       alert(path);
    });

})


text:
#ifndef BABYLON_RENDERING_IRENDERING_MANAGER_AUTO_CLEAR_SETUP_H
#define BABYLON_RENDERING_IRENDERING_MANAGER_AUTO_CLEAR_SETUP_H

#include <babylon/babylon_api.h>

namespace BABYLON {

/**
 * @brief Interface describing the different options available in the rendering manager regarding
 * Auto Clear between groups.
 */
struct BABYLON_SHARED_EXPORT IRenderingManagerAutoClearSetup {
  /**
   * Defines whether or not autoclear is enable.
   */
  bool autoClear;
  /**
   * Defines whether or not to autoclear the depth buffer.
   */
  bool depth;
  /**
   * Defines whether or not to autoclear the stencil buffer.
   */
  bool stencil;
}; // end of struct IRenderingManagerAutoClearSetup

} // end of namespace BABYLON

#endif // end of BABYLON_RENDERING_IRENDERING_MANAGER_AUTO_CLEAR_SETUP_H


text:
import time
import logging
from functools import partial
from PyQt5.QtWidgets import QMainWindow, QWidget, QVBoxLayout, QAction
from PyQt5.QtCore import QTimer, Qt
from PyQt5.QtGui import QKeySequence
from .. import get_app_icon, get_icon
from .plot_areas import PLOT_AREAS
from .plot_container import PlotContainerWidget

logger = logging.getLogger(__name__)

class PlotterWindow(QMainWindow):
    def __init__(self, get_transfer_callback):
        super(PlotterWindow, self).__init__()
        self.setWindowTitle('UAVCAN Plotter')
        self.setWindowIcon(get_app_icon())

        self._active_data_types = set()

        self._get_transfer = get_transfer_callback

        self._update_timer = QTimer(self)
        self._update_timer.setSingleShot(False)
        self._update_timer.timeout.connect(self._update)
        self._update_timer.start(50)

        self._base_time = time.monotonic()

        self._plot_containers = []

        #
        # Control menu
        #
        control_menu = self.menuBar().addMenu('&Control')

        self._stop_action = QAction(get_icon('stop'), '&Stop Updates', self)
        self._stop_action.setStatusTip('While stopped, all new data will be discarded')
        self._stop_action.setShortcut(QKeySequence('Ctrl+Shift+S'))
        self._stop_action.setCheckable(True)
        self._stop_action.toggled.connect(self._on_stop_toggled)
        control_menu.addAction(self._stop_action)

        self._pause_action = QAction(get_icon('pause'), '&Pause Updates', self)
        self._pause_action.setStatusTip('While paused, new data will be accumulated in memory '
                                        'to be processed once un-paused')
        self._pause_action.setShortcut(QKeySequence('Ctrl+Shift+P'))
        self._pause_action.setCheckable(True)
        self._pause_action.toggled.connect(self._on_pause_toggled)
        control_menu.addAction(self._pause_action)

        control_menu.addSeparator()

        self._reset_time_action = QAction(get_icon('history'), '&Reset', self)
        self._reset_time_action.setStatusTip('Base time will be reset; all plots will be reset')
        self._reset_time_action.setShortcut(QKeySequence('Ctrl+Shift+R'))
        self._reset_time_action.triggered.connect(self._do_reset)
        control_menu.addAction(self._reset_time_action)

        #
        # New Plot menu
        #
        plot_menu = self.menuBar().addMenu('&New Plot')
        for idx, pl_name in enumerate(PLOT_AREAS.keys()):
            new_plot_action = QAction('Add ' + pl_name, self)
            new_plot_action.setStatusTip('Add new plot window')
            new_plot_action.setShortcut(QKeySequence('Ctrl+Alt+' + str(idx)))
            new_plot_action.triggered.connect(partial(self._do_add_new_plot, pl_name))
            plot_menu.addAction(new_plot_action)

        #
        # Window stuff
        #
        self.statusBar().showMessage('Use the "New Plot" menu to add plots')
        self.setCentralWidget(None)
        self.resize(600, 400)

    def _on_stop_toggled(self, checked):
        self._pause_action.setChecked(False)
        self.statusBar().showMessage('Stopped' if checked else 'Un-stopped')

    def _on_pause_toggled(self, checked):
        self.statusBar().showMessage('Paused' if checked else 'Un-paused')

    def _do_add_new_plot(self, plot_area_name):
        def remove():
            self._plot_containers.remove(plc)

        plc = PlotContainerWidget(self, PLOT_AREAS[plot_area_name], self._active_data_types)
        plc.on_close = remove
        self._plot_containers.append(plc)

        docks = [
            Qt.LeftDockWidgetArea,
            Qt.LeftDockWidgetArea,
            Qt.RightDockWidgetArea,
            Qt.RightDockWidgetArea,
        ]
        dock_to = docks[(len(self._plot_containers) - 1) % len(docks)]
        self.addDockWidget(dock_to, plc)

        if len(self._plot_containers) > 1:
            self.statusBar().showMessage('Drag plots by the header to rearrange or detach them')

    def _do_reset(self):
        self._base_time = time.monotonic()

        for plc in self._plot_containers:
            try:
                plc.reset()
            except Exception:
                logger.error('Failed to reset plot container', exc_info=True)

        logger.info('Reset done, new time base %r', self._base_time)

    def _update(self):
        if self._stop_action.isChecked():
            while self._get_transfer() is not None:     # Discarding everything
                pass
            return

        if not self._pause_action.isChecked():
            while True:
                tr = self._get_transfer()
                if not tr:
                    break

                self._active_data_types.add(tr.data_type_name)

                for plc in self._plot_containers:
                    try:
                        plc.process_transfer(tr.ts_mono - self._base_time, tr)
                    except Exception:
                        logger.error('Plot container failed to process a transfer', exc_info=True)

        for plc in self._plot_containers:
            try:
                plc.update()
            except Exception:
                logger.error('Plot container failed to update', exc_info=True)


text:
package co.edu.uniandes.csw.artwork.tests.selenium.pages.artist;

import co.edu.uniandes.csw.artwork.dtos.minimum.ArtistDTO;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class ArtistDetailPage {

    @FindBy(id = "delete-artist")
    private WebElement deleteBtn;

    @FindBy(id = "edit-artist")
    private WebElement editBtn;

    @FindBy(id = "list-artist")
    private WebElement listBtn;

    @FindBy(id = "name")
    private WebElement name;

    public void list() {
        listBtn.click();
    }

    public void edit() {
        editBtn.click();
    }

    public void delete() {
        deleteBtn.click();
    }

    public ArtistDTO getData() {
        ArtistDTO artist = new ArtistDTO();
        artist.setName(name.getText());
        return artist;
    }
}


text:
<!-- GENERATED FROM SOURCE -->

# player.ima

---

## INDEX

- [METHODS](#methods)
  - [addContentEndedListener](#addcontentendedlistener-listener-)
  - [addEventListener](#addeventlistener-event-callback-)
  - [getAdsManager](#getadsmanager)
  - [initializeAdDisplayContainer](#initializeaddisplaycontainer)
  - [pauseAd](#pausead)
  - [requestAds](#requestads)
  - [resumeAd](#resumead)
  - [setShowCountdown](#setshowcountdown-showcountdownin-)
  - [start](#start)
  - [updateCurrentTime](#updatecurrenttime)

---

## METHODS

### addContentEndedListener( listener )
> Adds a listener for the 'ended' event of the video player. This should be
> used instead of setting an 'ended' listener directly to ensure that the
> ima can do proper cleanup of the SDK before other event listeners
> are called.

##### PARAMETERS:
* __listener__ `function` The listener to be called when content completes.

_defined in_: [src/videojs.ima.js#L634](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L634)

---

### addEventListener( event, callback )
> Ads an EventListener to the AdsManager. For a list of available events,
> see
> https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type

##### PARAMETERS:
* __event__ `google.ima.AdEvent.Type` The AdEvent.Type for which to listen.
* __callback__ `function` The method to call when the event is fired.

_defined in_: [src/videojs.ima.js#L584](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L584)

---

### getAdsManager()
> Returns the instance of the AdsManager.

##### RETURNS:
* `google.ima.AdsManager` The AdsManager being used by the plugin.

_defined in_: [src/videojs.ima.js#L594](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L594)

---

### initializeAdDisplayContainer()
> Initializes the AdDisplayContainer. On mobile, this must be done as a
> result of user action.

_defined in_: [src/videojs.ima.js#L145](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L145)

---

### pauseAd()
> Pauses the ad.

_defined in_: [src/videojs.ima.js#L641](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L641)

---

### requestAds()
> Creates the AdsRequest and request ads through the AdsLoader.

_defined in_: [src/videojs.ima.js#L153](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L153)

---

### resumeAd()
> Resumes the ad.

_defined in_: [src/videojs.ima.js#L652](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L652)

---

### setShowCountdown( showCountdownIn )
> Changes the flag to show or hide the ad countdown timer.

##### PARAMETERS:
* __showCountdownIn__ `boolean` Show or hide the countdown timer.

_defined in_: [src/videojs.ima.js#L706](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L706)

---

### start()
> Start ad playback, or content video playback in the absence of a
> pre-roll.

_defined in_: [src/videojs.ima.js#L213](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L213)

---

### updateCurrentTime()
> Updates the current time of the video

_defined in_: [src/videojs.ima.js#L674](https://github.com/googleads/videojs-ima/blob/mastersrc/videojs.ima.js#L674)

---


text:
using Windows.UI.Xaml.Controls;

namespace IIUWr.Controls
{
    public sealed partial class LoginControl : UserControl
    {
        public LoginControl()
        {
            this.InitializeComponent();
        }
    }
}


text:
package org.devgateway.toolkit.persistence.mongo;

import org.devgateway.toolkit.persistence.mongo.spring.MongoPersistenceApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@ActiveProfiles("integration")
@SpringBootTest(classes = { MongoPersistenceApplication.class })
@TestPropertySource("classpath:test.properties")
/**
 * Superclass for all integration tests that use MongoDB. Adding this as a
 * superclass will ensure the tests are run with the "integration" spring
 * profile. This will enable a special embedded mongodb server that can be used
 * just during the test.
 *
 * @author mihai
 *
 */
public abstract class AbstractMongoTest {

}


text:
{-|
Module      : Graphics.Shine
Description : Short description
Copyright   : (c) Francesco Gazzetta, 2016
License     : MIT
Maintainer  : francygazz@gmail.com
Stability   : experimental

The main module. Here are defined all the functions needed to get
an animation on the screen.

If you want to render a single 'Picture' only once,
use 'render' from 'Graphics.Shine.Render'
-}
module Graphics.Shine (
  -- * Getting a rendering context
  toContext,
  fullScreenCanvas,
  fixedSizeCanvas,
  -- * Drawing
  animate,
  animateIO,
  play,
  playIO
) where

import GHCJS.DOM.Document (getBody)
import GHCJS.DOM.NonElementParentNode (getElementById)
import GHCJS.DOM.EventM (on, mouseButton, mouseCtrlKey, mouseAltKey, mouseShiftKey, mouseMetaKey, mouseOffsetXY, uiKeyCode, event)
import GHCJS.DOM.GlobalEventHandlers (mouseDown, mouseUp, mouseMove, wheel, keyUp, keyDown)
import GHCJS.DOM.EventTarget (IsEventTarget)
import GHCJS.DOM.WheelEvent (getDeltaX, getDeltaY)
import GHCJS.DOM.KeyboardEvent (KeyboardEvent, getCtrlKey, getShiftKey, getAltKey, getMetaKey)
import GHCJS.DOM.Element (setInnerHTML)
import GHCJS.DOM.HTMLCanvasElement (getContext)
import GHCJS.DOM.CanvasRenderingContext2D
import GHCJS.DOM.Types (JSM, Element, MouseEvent, IsDocument, Document)

import Web.KeyCode (keyCodeLookup)
import Unsafe.Coerce (unsafeCoerce)
import Control.Concurrent (threadDelay)
import Control.Concurrent.MVar (newMVar, modifyMVar, modifyMVar_)
import Control.Monad (when)
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.Reader (ReaderT)
import Data.Foldable (foldrM)
import Data.Time.Clock (getCurrentTime, diffUTCTime)
import Data.Maybe (isJust, fromJust)

import Graphics.Shine.Input
import Graphics.Shine.Picture
import Graphics.Shine.Render

-- | Get a context from a canvas element.
toContext :: Element -- ^ this __must__ be a canvas
          -> JSM CanvasRenderingContext2D
toContext c = do
    Just ctx <- getContext (unsafeCoerce c) "2d" ["2d"]
    return $ unsafeCoerce ctx --how do i get a 2dcontext properly? This works for now.

customAttributesCanvas :: Document -> String -> JSM CanvasRenderingContext2D
customAttributesCanvas doc attrs = do
    Just body <- getBody doc
    setInnerHTML body canvasHtml
    Just c <- getElementById doc "canvas"
    toContext c
  where canvasHtml :: String
        canvasHtml = "<canvas id=\"canvas\" " ++ attrs ++ " </canvas> "

-- | Create a full screen canvas
fullScreenCanvas :: Document -> JSM CanvasRenderingContext2D
fullScreenCanvas doc = customAttributesCanvas doc attributes
  where attributes :: String
        attributes = "style=\"border:1px \
                     \solid #000000; \
                     \top:0px;bottom:0px;left:0px;right:0px;\""

-- | Create a fixed size canvas given the dimensions
fixedSizeCanvas :: Document -> Int -> Int -> JSM CanvasRenderingContext2D
fixedSizeCanvas doc x y = customAttributesCanvas doc $ attributes x y
  where attributes :: Int -> Int -> String
        attributes x' y' = "width=\""++ show x' ++ "\" \
                           \height=\""++ show y' ++ "\" \
                           \style=\"border:1px \
                           \solid #000000;\""

-- | Draws a picture which depends only on the time
animate :: CanvasRenderingContext2D -- ^ the context to draw on
        -> Double -- ^ FPS
        -> (Double -> Picture) -- ^ Your drawing function
        -> JSM ()
animate ctx fps f = animateIO ctx fps $ return . f

-- | Draws a picture which depends only on the time... and everything else,
-- since you can do I/O.
animateIO :: CanvasRenderingContext2D -- ^ the context to draw on
          -> Double -- ^ FPS
          -> (Double -> IO Picture) -- ^ Your drawing function
          -> JSM ()
animateIO ctx fps f = do
    initialTime <- getCurrentTime
    let loop = do
        stamp <- getCurrentTime
        -- empty the canvas before drawing
        -- MAYBE we need a buffer canvas on which to draw before copying it
        -- on the main canvas (using the bitmaprenderer attribute and
        -- an OffscreenCanvas for efficiency) to avoid blinking
        clearRect ctx (-10000) (-10000) 20000 20000 --FIXME
        setTransform ctx 1 0 0 1 0 0 -- reset transforms (and accumulated errors!).
        -- get the Picture and draw it
        let t = realToFrac $ diffUTCTime stamp initialTime
        pic <- f t
        render ctx pic
        -- delay to match the target fps
        now <- getCurrentTime
        let td = diffUTCTime now stamp
        when (realToFrac td <= 1 / fps) $
          threadDelay $ floor $ (*1000000) (1 / fps - realToFrac td)
        loop
      in
        loop

getModifiersMouse :: ReaderT MouseEvent JSM Modifiers
getModifiersMouse = Modifiers
                   <$> fmap toKeyState mouseCtrlKey
                   <*> fmap toKeyState mouseAltKey
                   <*> fmap toKeyState mouseShiftKey
                   <*> fmap toKeyState mouseMetaKey

getModifiersKeyboard :: ReaderT KeyboardEvent JSM Modifiers
getModifiersKeyboard = Modifiers
                   <$> fmap toKeyState (event >>= getCtrlKey)
                   <*> fmap toKeyState (event >>= getAltKey)
                   <*> fmap toKeyState (event >>= getShiftKey)
                   <*> fmap toKeyState (event >>= getMetaKey)

-- | Lets you manage the input.
play :: (IsEventTarget eventElement, IsDocument eventElement)
     => CanvasRenderingContext2D -- ^ the context to draw on
     -> eventElement
     -> Double -- ^ FPS
     -> state -- ^ Initial state
     -> (state -> Picture) -- ^ Drawing function
     -> (Input -> state -> state) -- ^ Input handling function
     -> (Double -> state -> state) -- ^ Stepping function
     -> JSM ()
play ctx doc fps initialState draw handleInput step =
  playIO
    ctx
    doc
    fps
    initialState
    (return . draw)
    (\s i -> return $ handleInput s i)
    (\s t -> return $ step s t)

-- | Same thing with I/O
playIO :: (IsEventTarget eventElement, IsDocument eventElement)
       => CanvasRenderingContext2D -- ^ the context to draw on
       -> eventElement
       -> Double -- ^ FPS
       -> state -- ^ Initial state
       -> (state -> IO Picture) -- ^ Drawing function
       -> (Input -> state -> IO state) -- ^ Input handling function
       -> (Double -> state -> IO state) -- ^ Stepping function
       -> JSM ()
playIO ctx doc fps initialState draw handleInput step = do
    inputM <- newMVar [] -- this will accumulate the inputs
    -- setting up event listeners for mouse and keyboard
    _ <- on doc mouseDown $ do
        btn <- fmap toMouseBtn mouseButton
        modifiers <- getModifiersMouse
        when (isJust btn) $
          liftIO $ modifyMVar_ inputM $ fmap return (MouseBtn (fromJust btn) Down modifiers :) -- :-) :D XD
    _ <- on doc mouseUp $ do
        btn <- fmap toMouseBtn mouseButton
        modifiers <- getModifiersMouse
        when (isJust btn) $
          liftIO $ modifyMVar_ inputM $ fmap return (MouseBtn (fromJust btn) Up modifiers :) -- :-) :D XD
    _ <- on doc mouseMove $ do
        coords <- mouseOffsetXY -- experimental!
        liftIO $ modifyMVar_ inputM $ fmap return (MouseMove coords :) -- :-) :D XD
    _ <- on doc wheel $ do
        delta <- (,) <$> (event >>= getDeltaX) <*> (event >>= getDeltaY)
        liftIO $ modifyMVar_ inputM $ fmap return (MouseWheel delta :) -- :-) :D XD
    _ <- on doc keyDown $ do
        key <- uiKeyCode
        modifiers <- getModifiersKeyboard
        liftIO $ modifyMVar_ inputM $ fmap return (Keyboard (keyCodeLookup $ fromIntegral key) Down modifiers :) -- :-) :D XD
    _ <- on doc keyUp $ do
        key <- uiKeyCode
        modifiers <- getModifiersKeyboard
        liftIO $ modifyMVar_ inputM $ fmap return (Keyboard (keyCodeLookup $ fromIntegral key) Up modifiers :) -- :-) :D XD
    initialTime <- getCurrentTime
    -- main loop
    let loop state previousTime = do
        -- retrieve inputs and empty inputM
        inputs <- modifyMVar inputM $ \xs -> return ([], xs)
        -- handle inputs
        state' <- foldrM handleInput state inputs
        -- state stepping
        beforeRendering <- getCurrentTime
        let td = diffUTCTime beforeRendering previousTime
        state'' <- step (realToFrac td) state'
        -- actual rendering begins
        clearRect ctx (-10000) (-10000) 20000 20000 --FIXME
        setTransform ctx 1 0 0 1 0 0 -- reset transforms (and accumulated errors!).
        pic <- draw state''
        render ctx pic
        afterRendering <- getCurrentTime --do we really need two timestamps?
        -- delay to match the target fps
        let renderingTime = diffUTCTime afterRendering beforeRendering
        when (realToFrac renderingTime <= 1 / fps) $
          threadDelay $ floor $ (*1000000) (1 / fps - realToFrac renderingTime)
        loop state'' beforeRendering
      in
        loop initialState initialTime


text:
package com.example.maguoqing.androiddemo.fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.example.maguoqing.androiddemo.R;
import com.example.maguoqing.androiddemo.adapter.CalendarAdapter;

import java.util.Date;

public class CalendarFragment extends Fragment {

    private RecyclerView recyclerView;
    private CalendarAdapter adapter;

    private int mPageNumber;
    private OnDayClickListener onDayClickListener;

    public static Fragment create(int pageNumber, OnDayClickListener onDayClickListener) {
        CalendarFragment fragment = new CalendarFragment();
        fragment.mPageNumber = pageNumber;
        fragment.onDayClickListener = onDayClickListener;
        return fragment;
    }

    public CalendarFragment() {
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        LinearLayout rootView = (LinearLayout) inflater.inflate(R.layout.fragment_calendar_month, container, false);

        recyclerView = (RecyclerView) rootView.findViewById(R.id.rv_calendar_month);
        GridLayoutManager mgr=new GridLayoutManager(getActivity(), 7);
        recyclerView.setLayoutManager(mgr);
        adapter = new CalendarAdapter(onDayClickListener);
        adapter.setPageNumber(mPageNumber);
        recyclerView.setAdapter(adapter);
        return rootView;
    }

    public interface OnDayClickListener {
        void onClick();
    }
}


text:
#include <tinyara/config.h>
#include <stdio.h>
#include <errno.h>
#include <wifi_manager/wifi_manager.h>
#include <netdb.h>
#include "connect_test.h"
#include "connect_test_log.h"

#define TAG "[CT_HOSTNAMES]"
#define HOSTNAME_BUFSIZE 128

static int _wm_store_file(char *buf, unsigned int buf_size, char *file_name)
{
	FILE *fp;
	fp = fopen(file_name, "a+");
	if (!fp) {
		CT_LOGE(TAG, "file open error(%d)", errno);
		return -1;
	}

	int ret = fputs(buf, fp);
	if (ret < 0) {
		CT_LOGE(TAG, "file write error(%d)", errno);
		fclose(fp);
		return -1;
	}

	fclose(fp);
	return 0;
}

static int _wm_save_hostname(struct ct_options *hostname_info)
{
	char buf[HOSTNAME_BUFSIZE];
	int ret = -1;
	char *file_name = NULL;
	if (hostname_info == NULL) {
		CT_LOGE(TAG, "AP Info is NULL");
		return -1;
	}

	snprintf(buf, HOSTNAME_BUFSIZE, "%s\n", hostname_info->hostname);
	file_name = hostname_info->path;

	ret = _wm_store_file(buf, HOSTNAME_BUFSIZE, file_name);
	if (ret < 0) {
		CT_LOGE(TAG, "store file failed");
		return -2;
	}
	return 0;
}

void connect_test_add_hostname(void *arg)
{
	struct ct_options *hostname_info = (struct ct_options *)arg;
	int ret = -1;
	CT_LOG(TAG, "Hostname[%s]", hostname_info->hostname);
	ret = _wm_save_hostname(hostname_info);
	if (ret < 0) {
		CT_LOGE(TAG, "Save AP configuration failed");
		return;
	}
}

static void hostname_to_ip4(char *hostname)
{
        if (hostname == NULL) {
                CT_LOGE(TAG, "Hostname not present");
		return;
        }

        struct hostent *shost;
        shost = (struct hostent*)gethostbyname((const char *)hostname);
        if (shost == NULL) {
                CT_LOGE(TAG, "gethostbyname fail %d", shost);
                return;
        }
        CT_LOG(TAG, "Hostname: %s IPAddress: %s", hostname,
		inet_ntoa(*((struct in_addr *)shost->h_addr_list[0])));
}

static void default_dns_service(void) {
	CT_LOG(TAG, "Running default DNS service");
	char hostname[30];
	char hostnames[3][20] = {"www.google.com", "www.samsung.com", "www.facebook.com"};
	for (int hname = 0; hname < 3; hname++) {
		strcpy(hostname, hostnames[hname]);
		hostname_to_ip4(hostname);
	}
}

void dns_service(char *hostname_file) {
	if (!hostname_file) {
		default_dns_service();
	} else {
		char *file_name = hostname_file;
		FILE* file = fopen(file_name, "r");
		if(!file) {
			CT_LOG(TAG, "Unable to open : %s", file_name);
			default_dns_service();
		} else {
			char hostname[30];
			while (fgets(hostname, sizeof(hostname), file)) {
				hostname[strlen(hostname) - 1] = '\0';
				hostname_to_ip4(hostname);
			}
			fclose(file);
		}
	}
	return 0;
}


text:
class PasswordsController < Devise::PasswordsController

  # determine which layout to use based on the current user state
  layout :layout_by_resource

  # Determine which layout to use based on the authorized state
  def layout_by_resource
    if user_signed_in?
      "application"
    else
      "password"
    end
  end

end


text:
import { BinaryWriter } from '../io/binarywriter.js';
import { Utf8StringToArrayBuffer } from '../io/bufferutils.js';
import { FileFormat, GetFileExtension, GetFileName } from '../io/fileutils.js';
import { RGBColor, SRGBToLinear } from '../model/color.js';
import { MaterialType } from '../model/material.js';
import { ConvertMeshToMeshBuffer } from '../model/meshbuffer.js';
import { ExportedFile, ExporterBase } from './exporterbase.js';

export class ExporterGltf extends ExporterBase
{
	constructor ()
	{
		super ();
        this.components = {
            index : {
                type : 5125, // unsigned int 32
                size : 4
            },
            number : {
                type : 5126, // float 32
                size : 4
            }
        };
	}

    CanExport (format, extension)
    {
        return (format === FileFormat.Text && extension === 'gltf') || (format === FileFormat.Binary && extension === 'glb');
    }

	ExportContent (exporterModel, format, files, onFinish)
	{
        if (format === FileFormat.Text) {
            this.ExportAsciiContent (exporterModel, files);
        } else if (format === FileFormat.Binary) {
            this.ExportBinaryContent (exporterModel, files);
        }
        onFinish ();
	}

	ExportAsciiContent (exporterModel, files)
	{
        let gltfFile = new ExportedFile ('model.gltf');
        let binFile = new ExportedFile ('model.bin');
        files.push (gltfFile);
        files.push (binFile);

        let meshDataArr = this.GetMeshData (exporterModel);
        let mainBuffer = this.GetMainBuffer (meshDataArr);
        let mainJson = this.GetMainJson (meshDataArr);
        mainJson.buffers.push ({
            uri : binFile.GetName (),
            byteLength : mainBuffer.byteLength
        });

        let fileNameToIndex = new Map ();
        this.ExportMaterials (exporterModel, mainJson, (texture) => {
            let fileName = GetFileName (texture.name);
            if (fileNameToIndex.has (fileName)) {
                return fileNameToIndex.get (fileName);
            } else {
                let textureFile = new ExportedFile (fileName);
                textureFile.SetBufferContent (texture.buffer);
                files.push (textureFile);

                let textureIndex = mainJson.textures.length;
                fileNameToIndex.set (fileName, textureIndex);

                mainJson.images.push ({
                    uri : fileName
                });

                mainJson.textures.push ({
                    source : textureIndex
                });

                return textureIndex;
            }
        });

        gltfFile.SetTextContent (JSON.stringify (mainJson, null, 4));
        binFile.SetBufferContent (mainBuffer);
    }

    ExportBinaryContent (exporterModel, files)
    {
        function AlignToBoundary (size)
        {
            let remainder = size % 4;
            if (remainder === 0) {
                return size;
            }
            return size + (4 - remainder);
        }

        function WriteCharacters (writer, char, count)
        {
            for (let i = 0; i < count; i++) {
                writer.WriteUnsignedCharacter8 (char);
            }
        }

        let glbFile = new ExportedFile ('model.glb');
        files.push (glbFile);

        let meshDataArr = this.GetMeshData (exporterModel);
        let mainBuffer = this.GetMainBuffer (meshDataArr);
        let mainJson = this.GetMainJson (meshDataArr);

        let textureBuffers = [];
        let textureOffset = mainBuffer.byteLength;

        let fileNameToIndex = new Map ();
        this.ExportMaterials (exporterModel, mainJson, (texture) => {
            let fileName = GetFileName (texture.name);
            let extension = GetFileExtension (texture.name);
            if (fileNameToIndex.has (fileName)) {
                return fileNameToIndex.get (fileName);
            } else {
                let bufferViewIndex = mainJson.bufferViews.length;
                let textureIndex = mainJson.textures.length;
                fileNameToIndex.set (fileName, textureIndex);
                let textureBuffer = texture.buffer;
                textureBuffers.push (textureBuffer);
                mainJson.bufferViews.push ({
                    buffer : 0,
                    byteOffset : textureOffset,
                    byteLength : textureBuffer.byteLength
                });
                textureOffset += textureBuffer.byteLength;
                mainJson.images.push ({
                    bufferView : bufferViewIndex,
                    mimeType : 'image/' + extension
                });
                mainJson.textures.push ({
                    source : textureIndex
                });

                return textureIndex;
            }
        });

        let mainBinaryBufferLength = mainBuffer.byteLength;
        for (let i = 0; i < textureBuffers.length; i++) {
            let textureBuffer = textureBuffers[i];
            mainBinaryBufferLength += textureBuffer.byteLength;
        }
        let mainBinaryBufferAlignedLength = AlignToBoundary (mainBinaryBufferLength);
        mainJson.buffers.push ({
            byteLength : mainBinaryBufferAlignedLength
        });

        let mainJsonString = JSON.stringify (mainJson);
        let mainJsonBuffer = Utf8StringToArrayBuffer (mainJsonString);
        let mainJsonBufferLength = mainJsonBuffer.byteLength;
        let mainJsonBufferAlignedLength = AlignToBoundary (mainJsonBufferLength);

        let glbSize = 12 + 8 + mainJsonBufferAlignedLength + 8 + mainBinaryBufferAlignedLength;
        let glbWriter = new BinaryWriter (glbSize, true);

        glbWriter.WriteUnsignedInteger32 (0x46546C67);
        glbWriter.WriteUnsignedInteger32 (2);
        glbWriter.WriteUnsignedInteger32 (glbSize);

        glbWriter.WriteUnsignedInteger32 (mainJsonBufferAlignedLength);
        glbWriter.WriteUnsignedInteger32 (0x4E4F534A);
        glbWriter.WriteArrayBuffer (mainJsonBuffer);
        WriteCharacters (glbWriter, 32, mainJsonBufferAlignedLength - mainJsonBufferLength);

        glbWriter.WriteUnsignedInteger32 (mainBinaryBufferAlignedLength);
        glbWriter.WriteUnsignedInteger32 (0x004E4942);
        glbWriter.WriteArrayBuffer (mainBuffer);

        for (let i = 0; i < textureBuffers.length; i++) {
            let textureBuffer = textureBuffers[i];
            glbWriter.WriteArrayBuffer (textureBuffer);
        }
        WriteCharacters (glbWriter, 0, mainBinaryBufferAlignedLength - mainBinaryBufferLength);

        glbFile.SetBufferContent (glbWriter.GetBuffer ());
    }

    GetMeshData (exporterModel)
    {
        let meshDataArr = [];

        exporterModel.EnumerateTransformedMeshes ((mesh) => {
            let buffer = ConvertMeshToMeshBuffer (mesh);
            meshDataArr.push ({
                name : mesh.GetName (),
                buffer : buffer,
                offsets : [],
                sizes : []
            });
        });

        return meshDataArr;
    }

    GetMainBuffer (meshDataArr)
    {
        let mainBufferSize = 0;
        for (let meshIndex = 0; meshIndex < meshDataArr.length; meshIndex++) {
            let meshData = meshDataArr[meshIndex];
            mainBufferSize += meshData.buffer.GetByteLength (this.components.index.size, this.components.number.size);
        }

        let writer = new BinaryWriter (mainBufferSize, true);
        for (let meshIndex = 0; meshIndex < meshDataArr.length; meshIndex++) {
            let meshData = meshDataArr[meshIndex];
            for (let primitiveIndex = 0; primitiveIndex < meshData.buffer.PrimitiveCount (); primitiveIndex++) {
                let primitive = meshData.buffer.GetPrimitive (primitiveIndex);
                let offset = writer.GetPosition ();
                for (let i = 0; i < primitive.indices.length; i++) {
                    writer.WriteUnsignedInteger32 (primitive.indices[i]);
                }
                for (let i = 0; i < primitive.vertices.length; i++) {
                    writer.WriteFloat32 (primitive.vertices[i]);
                }
                for (let i = 0; i < primitive.colors.length; i++) {
                    writer.WriteFloat32 (SRGBToLinear (primitive.colors[i]));
                }
                for (let i = 0; i < primitive.normals.length; i++) {
                    writer.WriteFloat32 (primitive.normals[i]);
                }
                for (let i = 0; i < primitive.uvs.length; i++) {
                    let texCoord = primitive.uvs[i];
                    if (i % 2 === 1) {
                        texCoord *= -1.0;
                    }
                    writer.WriteFloat32 (texCoord);
                }
                meshData.offsets.push (offset);
                meshData.sizes.push (writer.GetPosition () - offset);
            }
        }

        return writer.GetBuffer ();
    }

    GetMainJson (meshDataArr)
    {
        class BufferViewCreator
        {
            constructor (mainJson, byteOffset)
            {
                this.mainJson = mainJson;
                this.byteOffset = byteOffset;
            }

            AddBufferView (byteLength)
            {
                this.mainJson.bufferViews.push ({
                    buffer : 0,
                    byteOffset : this.byteOffset,
                    byteLength : byteLength,
                });
                this.byteOffset += byteLength;
                return this.mainJson.bufferViews.length - 1;
            }
        }

        let mainJson = {
            asset : {
                generator : 'https://3dviewer.net',
                version : '2.0'
            },
            scene : 0,
            scenes : [
                {
                    nodes : []
                }
            ],
            nodes : [],
            materials : [],
            meshes : [],
            buffers : [],
            bufferViews : [],
            accessors : []
        };

        for (let meshIndex = 0; meshIndex < meshDataArr.length; meshIndex++) {
            let meshData = meshDataArr[meshIndex];
            mainJson.scenes[0].nodes.push (meshIndex);
            mainJson.nodes.push ({
                mesh : meshIndex
            });
            let jsonMesh = {
                name : this.GetExportedMeshName (meshData.name),
                primitives : []
            };

            let primitives = meshData.buffer.primitives;
            for (let primitiveIndex = 0; primitiveIndex < primitives.length; primitiveIndex++) {
                let primitive = primitives[primitiveIndex];

                let bufferViewCreator = new BufferViewCreator (mainJson, meshData.offsets[primitiveIndex]);
                let indicesBufferView = bufferViewCreator.AddBufferView (primitive.indices.length * this.components.index.size);
                let verticesBufferView = bufferViewCreator.AddBufferView (primitive.vertices.length * this.components.number.size);
                let colorsBufferView = null;
                if (primitive.colors.length > 0) {
                    colorsBufferView = bufferViewCreator.AddBufferView (primitive.colors.length * this.components.number.size);
                }
                let normalsBufferView = bufferViewCreator.AddBufferView (primitive.normals.length * this.components.number.size);
                let uvsBufferView = null;
                if (primitive.uvs.length > 0) {
                    uvsBufferView = bufferViewCreator.AddBufferView (primitive.uvs.length * this.components.number.size);
                }

                let jsonPrimitive = {
                    attributes : {},
                    mode : 4,
                    material : primitive.material
                };

                let bounds = primitive.GetBounds ();

                mainJson.accessors.push ({
                    bufferView : indicesBufferView,
                    byteOffset : 0,
                    componentType : this.components.index.type,
                    count : primitive.indices.length,
                    type : 'SCALAR'
                });
                jsonPrimitive.indices = mainJson.accessors.length - 1;

                mainJson.accessors.push ({
                    bufferView : verticesBufferView,
                    byteOffset : 0,
                    componentType : this.components.number.type,
                    count : primitive.vertices.length / 3,
                    min : bounds.min,
                    max : bounds.max,
                    type : 'VEC3'
                });
                jsonPrimitive.attributes.POSITION = mainJson.accessors.length - 1;

                if (colorsBufferView !== null) {
                    mainJson.accessors.push ({
                        bufferView : colorsBufferView,
                        byteOffset : 0,
                        componentType : this.components.number.type,
                        count : primitive.colors.length / 3,
                        type : 'VEC3'
                    });
                    jsonPrimitive.attributes.COLOR_0 = mainJson.accessors.length - 1;
                }

                mainJson.accessors.push ({
                    bufferView : normalsBufferView,
                    byteOffset : 0,
                    componentType : this.components.number.type,
                    count : primitive.normals.length / 3,
                    type : 'VEC3'
                });
                jsonPrimitive.attributes.NORMAL = mainJson.accessors.length - 1;

                if (uvsBufferView !== null) {
                    mainJson.accessors.push ({
                        bufferView : uvsBufferView,
                        byteOffset : 0,
                        componentType : this.components.number.type,
                        count : primitive.uvs.length / 2,
                        type : 'VEC2'
                    });
                    jsonPrimitive.attributes.TEXCOORD_0 = mainJson.accessors.length - 1;
                }

                jsonMesh.primitives.push (jsonPrimitive);
            }
            mainJson.meshes.push (jsonMesh);
        }

        return mainJson;
    }

    ExportMaterials (exporterModel, mainJson, addTexture)
    {
        function ExportMaterial (obj, mainJson, material, addTexture)
        {
            function ColorToRGBA (color, opacity)
            {
                return [
                    SRGBToLinear (color.r / 255.0),
                    SRGBToLinear (color.g / 255.0),
                    SRGBToLinear (color.b / 255.0),
                    opacity
                ];
            }

            function ColorToRGB (color)
            {
                return [
                    SRGBToLinear (color.r / 255.0),
                    SRGBToLinear (color.g / 255.0),
                    SRGBToLinear (color.b / 255.0)
                ];
            }

            function GetTextureParams (mainJson, texture, addTexture)
            {
                if (texture === null || !texture.IsValid ()) {
                    return null;
                }

                if (mainJson.images === undefined) {
                    mainJson.images = [];
                }
                if (mainJson.textures === undefined) {
                    mainJson.textures = [];
                }

                let textureIndex = addTexture (texture);
                let textureParams = {
                    index : textureIndex
                };

                if (texture.HasTransformation ()) {
                    let extensionName = 'KHR_texture_transform';
                    if (mainJson.extensionsUsed === undefined) {
                        mainJson.extensionsUsed = [];
                    }
                    if (mainJson.extensionsUsed.indexOf (extensionName) === -1) {
                        mainJson.extensionsUsed.push (extensionName);
                    }
                    textureParams.extensions = {
                        KHR_texture_transform : {
                            offset : [texture.offset.x, -texture.offset.y],
                            scale : [texture.scale.x, texture.scale.y],
                            rotation : -texture.rotation
                        }
                    };
                }

                return textureParams;
            }

            let jsonMaterial = {
                name : obj.GetExportedMaterialName (material.name),
                pbrMetallicRoughness : {
                    baseColorFactor : ColorToRGBA (material.color, material.opacity)
                },
                emissiveFactor : ColorToRGB (material.emissive),
                doubleSided : true,
                alphaMode : 'OPAQUE'
            };

            if (material.transparent) {
                // TODO: mask, alphaCutoff?
                jsonMaterial.alphaMode = 'BLEND';
            }

            let baseColorTexture = GetTextureParams (mainJson, material.diffuseMap, addTexture);
            if (baseColorTexture !== null) {
                if (!material.multiplyDiffuseMap) {
                    jsonMaterial.pbrMetallicRoughness.baseColorFactor = ColorToRGBA (new RGBColor (255, 255, 255), material.opacity);
                }
                jsonMaterial.pbrMetallicRoughness.baseColorTexture = baseColorTexture;
            }
            if (material.type === MaterialType.Physical) {
                let metallicTexture = GetTextureParams (mainJson, material.metalnessMap, addTexture);
                if (metallicTexture !== null) {
                    jsonMaterial.pbrMetallicRoughness.metallicRoughnessTexture = metallicTexture;
                } else {
                    jsonMaterial.pbrMetallicRoughness.metallicFactor = material.metalness;
                    jsonMaterial.pbrMetallicRoughness.roughnessFactor = material.roughness;
                }
            }
            let normalTexture = GetTextureParams (mainJson, material.normalMap, addTexture);
            if (normalTexture !== null) {
                jsonMaterial.normalTexture = normalTexture;
            }
            let emissiveTexture = GetTextureParams (mainJson, material.emissiveMap, addTexture);
            if (emissiveTexture !== null) {
                jsonMaterial.emissiveTexture = emissiveTexture;
            }

            mainJson.materials.push (jsonMaterial);
        }

        for (let materialIndex = 0; materialIndex < exporterModel.MaterialCount (); materialIndex++) {
            let material = exporterModel.GetMaterial (materialIndex);
            ExportMaterial (this, mainJson, material, addTexture);
        }
    }
}


text:
package com.tianyu.jty.junit;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import com.tianyu.jty.system.service.UserService;

@ContextConfiguration(locations = { "/applicationContext.xml" })
public class JTYTest extends AbstractJUnit4SpringContextTests {

	@Autowired
	private UserService userService;

	@Test
	public void quartzTest() throws Exception {
		/*String[] names=applicationContext.getBeanDefinitionNames();
		for(String s:names){
			System.out.println(s);
		}*/
		System.out.println(userService.getAll().size());
	}
}


text:
<?php

/**
 * Message translations.
 *
 * This file is automatically generated by 'yii message/extract' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * Message string can be used with plural forms format. Check i18n section
 * of the guide for details.
 *
 * NOTE: this file must be saved in UTF-8 encoding.
 */
return [
    ' and ' => ' и ',
    '"{attribute}" does not support operator "{operator}".' => '"{attribute}" не поддържа оператор "{operator}".',
    '(not set)' => '(не е попълнено)',
    'An internal server error occurred.' => 'Възникна вътрешна грешка в сървъра.',
    'Are you sure you want to delete this item?' => 'Сигурни ли сте, че искате да изтриете записа?',
    'Condition for "{attribute}" should be either a value or valid operator specification.' => 'Условието за "{attribute}" трябва да е валидна стойност или оператор.',
    'Delete' => 'Изтрий',
    'Error' => 'Грешка',
    'File upload failed.' => 'Грешка при качване на файл.',
    'Home' => 'Начало',
    'Invalid data received for parameter "{param}".' => 'Невалидни данни за параметъра "{param}".',
    'Login Required' => 'Трябва да влезете в системата.',
    'Missing required arguments: {params}' => 'Липсват задължителните аргументи: {params}',
    'Missing required parameters: {params}' => 'Липсват задължителните параметри: {params}',
    'No' => 'Не',
    'No results found.' => 'Няма намерени резултати.',
    'Only files with these MIME types are allowed: {mimeTypes}.' => 'Допускат се файлове са от типове: {mimeTypes}.',
    'Only files with these extensions are allowed: {extensions}.' => 'Допускат се файлове със следните разширения: {extensions}.',
    'Operator "{operator}" must be used with a search attribute.' => 'Операторът "{operator}" трябва да се използва с атрибут за търсене.',
    'Operator "{operator}" requires multiple operands.' => 'Операторът "{operator}" изисква множество елементи.',
    'Page not found.' => 'Страницата не беше намерена.',
    'Please fix the following errors:' => 'Моля, коригирайте следните грешки:',
    'Please upload a file.' => 'Моля, прикачете файл.',
    'Powered by {yii}' => 'Задвижвано от {yii}',
    'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.' => 'Показване на {begin, number}-{end, number} от {totalCount, number} {totalCount, plural, one{запис} other{записа}}.',
    'The combination {values} of {attributes} has already been taken.' => 'Комбинацията от {values} от {attributes} е вече заета.',
    'The file "{file}" is not an image.' => 'Файлът "{file}" не е изображение.',
    'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' => 'Фйлът "{file}" е твърде голям. Размерът на файла не трябва да превишава {formattedLimit}.',
    'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' => 'Файлът "{file}" е твърде малък. Размерът на файла трябва да е поне {formattedLimit}.',
    'The format of {attribute} is invalid.' => 'Невалиден формат за "{attribute}".',
    'The format of {filter} is invalid.' => 'Форматът на филтъра {filter} е невалиден.',
    'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Изображението "{file}" е твърде голямо. Височината не трябва да е по-голяма от {limit, number} {limit, plural, one{пиксел} other{пиксела}}.',
    'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Изображението "{file}" е твърде голямо. Широчината не трябва да е по-голяма от {limit, number} {limit, plural, one{пиксел} other{пиксела}}.',
    'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Изображението "{file}" е твърде малко. Височината трябва да е поне {limit, number} {limit, plural, one{пиксел} other{пиксела}}.',
    'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Изображението "{file}" е твърде малко. Широчината трябва да е поне {limit, number} {limit, plural, one{пиксел} other{пиксела}}.',
    'The requested view "{name}" was not found.' => 'Завения view файл "{name}" не беше открит',
    'The verification code is incorrect.' => 'Неправилен код за проверка.',
    'Total {count, number} {count, plural, one{item} other{items}}.' => '{count, number} {count, plural, one{запис} other{записа}}.',
    'Unable to verify your data submission.' => 'Не може да се валидират подадените данни.',
    'Unknown alias: -{name}' => 'Неизвестен псевдоним: -{name}',
    'Unknown filter attribute "{attribute}"' => 'Неизвестен филтърен атрибут "{attribute}"',
    'Unknown option: --{name}' => 'Несъществуваща опция : --{name}',
    'Update' => 'Обнови',
    'View' => 'Виж',
    'Yes' => 'Да',
    'Yii Framework' => 'Yii Framework',
    'You are not allowed to perform this action.' => 'Нямате права да изпълните тази операция.',
    'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'Може да прикачите най-много {limit, number} {limit, plural, one{файл} other{файла}}.',
    'You should upload at least {limit, number} {limit, plural, one{file} other{files}}.' => 'Трябва да качите поне {limit, number} {limit, plural, one{файл} other{файлове}}.',
    'in {delta, plural, =1{a day} other{# days}}' => 'след {delta, plural, =1{ден} other{# дни}}',
    'in {delta, plural, =1{a minute} other{# minutes}}' => 'след {delta, plural, =1{минута} other{# минути}}',
    'in {delta, plural, =1{a month} other{# months}}' => 'след {delta, plural, =1{месец} other{# месеца}}',
    'in {delta, plural, =1{a second} other{# seconds}}' => 'след {delta, plural, =1{секунда} other{# секунди}}',
    'in {delta, plural, =1{a year} other{# years}}' => 'след {delta, plural, =1{година} other{# години}}',
    'in {delta, plural, =1{an hour} other{# hours}}' => 'след {delta, plural, =1{час} other{# часа}}',
    'just now' => 'току що',
    'the input value' => 'стойността',
    '{attribute} "{value}" has already been taken.' => '{attribute} "{value}" вече е зает.',
    '{attribute} cannot be blank.' => 'Попълнете полето "{attribute}".',
    '{attribute} contains wrong subnet mask.' => '{attribute} съдържа грешен subnet mask.',
    '{attribute} is invalid.' => 'Полето "{attribute}" е некоректно попълнено.',
    '{attribute} is not a valid URL.' => 'Полето "{attribute}" съдържа невалиден УЕБ адрес.',
    '{attribute} is not a valid email address.' => 'Полето "{attribute}" съдържа невалиден email адрес.',
    '{attribute} is not in the allowed range.' => '{attribute} не е в позволения интервал.',
    '{attribute} must be "{requiredValue}".' => 'Полето "{attribute}" трябва да съдържа "{requiredValue}".',
    '{attribute} must be a number.' => 'Полето "{attribute}" съдържа невалиден номер.',
    '{attribute} must be a string.' => 'Полето "{attribute}" трябва да съдържа текст.',
    '{attribute} must be a valid IP address.' => '{attribute} трябва да е валиден IP адрес.',
    '{attribute} must be an IP address with specified subnet.' => '{attribute} трябва да бъде IP адрес в позволения subnet интервал.',
    '{attribute} must be an integer.' => 'Полето "{attribute}" трябва да съдържа цяло число.',
    '{attribute} must be either "{true}" or "{false}".' => 'Полето "{attribute}"  трябва да бъде "{true}" или "{false}".',
    '{attribute} must be equal to "{compareValueOrAttribute}".' => '"{attribute}" трябва да е равно на "{compareValueOrAttribute}".',
    '{attribute} must be greater than "{compareValueOrAttribute}".' => '{attribute} трябва да е по-голямо от "{compareValueOrAttribute}".',
    '{attribute} must be greater than or equal to "{compareValueOrAttribute}".' => '{attribute} трябва да е по-голямо или равно на "{compareValueOrAttribute}".',
    '{attribute} must be less than "{compareValueOrAttribute}".' => '{attribute} трябва да е по-малко от "{compareValueOrAttribute}".',
    '{attribute} must be less than or equal to "{compareValueOrAttribute}".' => '{attribute} трябва да е по-малко или равно на "{compareValueOrAttribute}".',
    '{attribute} must be no greater than {max}.' => 'Полето "{attribute}" не трябва да е по-голямо от {max}.',
    '{attribute} must be no less than {min}.' => 'Полето "{attribute}" не трябва да е по-малко от {min}.',
    '{attribute} must not be a subnet.' => '{attribute} не трябва да бъде subnet.',
    '{attribute} must not be an IPv4 address.' => '{attribute} не трябва да бъде IPv4 адрес.',
    '{attribute} must not be an IPv6 address.' => '{attribute} не трябва дабъде IPv6 адрес.',
    '{attribute} must not be equal to "{compareValueOrAttribute}".' => '{attribute} не трябва да бъде равно на "{compareValueOrAttribute}".',
    '{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => 'Полето {attribute} трябва да съдържа поне {min, number} {min, plural, one{символ} other{символа}}.',
    '{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => 'Полето "{attribute}" трябва да съдържа най-много {max, number} {max, plural, one{символ} other{символа}}.',
    '{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => 'Полето "{attribute}" трябва да съдържа точно {length, number} {length, plural, one{символ} other{символа}}.',
    '{delta, plural, =1{1 day} other{# days}}' => '{delta, plural, =1{1 ден} other{# дни}}',
    '{delta, plural, =1{1 hour} other{# hours}}' => '{delta, plural, =1{1 час} other{# часа}}',
    '{delta, plural, =1{1 minute} other{# minutes}}' => '{delta, plural, =1{1 минута} other{# минути}}',
    '{delta, plural, =1{1 month} other{# months}}' => '{delta, plural, =1{1 месец} other{# месеца}}',
    '{delta, plural, =1{1 second} other{# seconds}}' => '{delta, plural, =1{1 секунда} other{# секунди}}',
    '{delta, plural, =1{1 year} other{# years}}' => '{delta, plural, =1{1 година} other{# години}}',
    '{delta, plural, =1{a day} other{# days}} ago' => 'преди {delta, plural, =1{ден} other{# дни}}',
    '{delta, plural, =1{a minute} other{# minutes}} ago' => 'преди {delta, plural, =1{минута} other{# минути}}',
    '{delta, plural, =1{a month} other{# months}} ago' => 'преди {delta, plural, =1{месец} other{# месеца}}',
    '{delta, plural, =1{a second} other{# seconds}} ago' => 'преди {delta, plural, =1{секунда} other{# секунди}}',
    '{delta, plural, =1{a year} other{# years}} ago' => 'преди {delta, plural, =1{година} other{# години}}',
    '{delta, plural, =1{an hour} other{# hours}} ago' => '{delta, plural, =1{час} other{# часа}}',
    '{nFormatted} B' => '{nFormatted} B',
    '{nFormatted} GB' => '{nFormatted} GB',
    '{nFormatted} GiB' => '{nFormatted} GiB',
    '{nFormatted} KB' => '{nFormatted} KB',
    '{nFormatted} KiB' => '{nFormatted} KiB',
    '{nFormatted} MB' => '{nFormatted} MB',
    '{nFormatted} MiB' => '{nFormatted} MiB',
    '{nFormatted} PB' => '{nFormatted} PB',
    '{nFormatted} PiB' => '{nFormatted} PiB',
    '{nFormatted} TB' => '{nFormatted} TB',
    '{nFormatted} TiB' => '{nFormatted} TiB',
    '{nFormatted} {n, plural, =1{byte} other{bytes}}' => '{nFormatted} {n, plural, =1{байта} other{байта}}',
    '{nFormatted} {n, plural, =1{gibibyte} other{gibibytes}}' => '{nFormatted} {n, plural, =1{гибибайт} other{гибибайта}}',
    '{nFormatted} {n, plural, =1{gigabyte} other{gigabytes}}' => '{nFormatted} {n, plural, =1{гигабайт} other{гигабайта}}',
    '{nFormatted} {n, plural, =1{kibibyte} other{kibibytes}}' => '{nFormatted} {n, plural, =1{кибибайт} other{кибибайта}}',
    '{nFormatted} {n, plural, =1{kilobyte} other{kilobytes}}' => '{nFormatted} {n, plural, =1{килобайт} other{килобайта}}',
    '{nFormatted} {n, plural, =1{mebibyte} other{mebibytes}}' => '{nFormatted} {n, plural, =1{мебибайт} other{мебибайта}}',
    '{nFormatted} {n, plural, =1{megabyte} other{megabytes}}' => '{nFormatted} {n, plural, =1{мегабайт} other{мегабайта}}',
    '{nFormatted} {n, plural, =1{pebibyte} other{pebibytes}}' => '{nFormatted} {n, plural, =1{пебибайт} other{пебибайта}}',
    '{nFormatted} {n, plural, =1{petabyte} other{petabytes}}' => '{nFormatted} {n, plural, =1{петабайт} other{петабайта}}',
    '{nFormatted} {n, plural, =1{tebibyte} other{tebibytes}}' => '{nFormatted} {n, plural, =1{тебибайт} other{тебибайта}}',
    '{nFormatted} {n, plural, =1{terabyte} other{terabytes}}' => '{nFormatted} {n, plural, =1{терабайт} other{терабайта}}',
];


text:
/* @flow */
'use strict';

import type {Strand} from '../Alignment';

import _ from 'underscore';
import Q from 'q';
import {Events} from 'backbone';

import ContigInterval from '../ContigInterval';
import Interval from '../Interval';
import BigBed from '../data/BigBed';

export type Gene = {
  position: ContigInterval<string>;
  id: string;  // transcript ID, e.g. "ENST00000269305"
  strand: Strand;
  codingRegion: Interval;  // locus of coding start
  exons: Array<Interval>;
  geneId: string;  // ensembl gene ID
  name: string;  // human-readable name, e.g. "TP53"
}

// Flow type for export.
export type BigBedSource = {
  rangeChanged: (newRange: GenomeRange) => void;
  getGenesInRange: (range: ContigInterval<string>) => Gene[];
  on: (event: string, handler: Function) => void;
  off: (event: string) => void;
  trigger: (event: string, ...args:any) => void;
}

// The fields are described at http://genome.ucsc.edu/FAQ/FAQformat#format1
function parseBedFeature(f): Gene {
  var position = new ContigInterval(f.contig, f.start, f.stop),
      x = f.rest.split('\t'),
      // exons arrays sometimes have trailing commas
      exonLengths = x[7].replace(/,*$/, '').split(',').map(Number),
      exonStarts = x[8].replace(/,*$/, '').split(',').map(Number),
      exons = _.zip(exonStarts, exonLengths)
               .map(function([start, length]) {
                 return new Interval(f.start + start, f.start + start + length);
               });

  return {
    position,
    id: x[0],  // e.g. ENST00000359597
    strand: x[2],  // either + or -
    codingRegion: new Interval(Number(x[3]), Number(x[4])),
    geneId: x[9],
    name: x[10],
    exons
  };
}

function createFromBigBedFile(remoteSource: BigBed): BigBedSource {
  // Collection of genes that have already been loaded.
  var genes: {[key:string]: Gene} = {};

  // Ranges for which we have complete information -- no need to hit network.
  var coveredRanges: Array<ContigInterval<string>> = [];

  function addGene(newGene) {
    if (!genes[newGene.id]) {
      genes[newGene.id] = newGene;
    }
  }

  function getGenesInRange(range: ContigInterval<string>): Gene[] {
    if (!range) return [];
    var results = [];
    _.each(genes, gene => {
      if (range.intersects(gene.position)) {
        results.push(gene);
      }
    });
    return results;
  }

  function fetch(range: GenomeRange) {
    var interval = new ContigInterval(range.contig, range.start, range.stop);

    // Check if this interval is already in the cache.
    if (interval.isCoveredBy(coveredRanges)) {
      return Q.when();
    }

    coveredRanges.push(interval);
    coveredRanges = ContigInterval.coalesce(coveredRanges);

    return remoteSource.getFeatureBlocksOverlapping(interval).then(featureBlocks => {
      featureBlocks.forEach(fb => {
        coveredRanges.push(fb.range);
        coveredRanges = ContigInterval.coalesce(coveredRanges);
        var genes = fb.rows.map(parseBedFeature);
        genes.forEach(gene => addGene(gene));
        //we have new data from our internal block range
        o.trigger('newdata', fb.range);
      });
    });
  }

  var o = {
    rangeChanged: function(newRange: GenomeRange) {
      fetch(newRange).done();
    },
    getGenesInRange,

    // These are here to make Flow happy.
    on: () => {},
    off: () => {},
    trigger: () => {}
  };
  _.extend(o, Events);  // Make this an event emitter

  return o;
}

function create(data: {url:string}): BigBedSource {
  var url = data.url;
  if (!url) {
    throw new Error(`Missing URL from track: ${JSON.stringify(data)}`);
  }

  return createFromBigBedFile(new BigBed(url));
}

module.exports = {
  create,
  createFromBigBedFile
};


text:
package org.apache.lucene.search;

import org.apache.lucene.index.FieldInvertState;

/** Expert: Delegating scoring implementation.  Useful in {@link
 * Query#getSimilarity(Searcher)} implementations, to override only certain
 * methods of a Searcher's Similarity implementation..
 * @deprecated this class will be removed in 4.0.  Please
 * subclass {@link Similarity} or {@link DefaultSimilarity} instead. */
@Deprecated
public class SimilarityDelegator extends Similarity {

  private Similarity delegee;

  /** Construct a {@link Similarity} that delegates all methods to another.
   *
   * @param delegee the Similarity implementation to delegate to
   */
  public SimilarityDelegator(Similarity delegee) {
    this.delegee = delegee;
  }

  @Override
  public float computeNorm(String fieldName, FieldInvertState state) {
    return delegee.computeNorm(fieldName, state);
  }

  @Override
  public float queryNorm(float sumOfSquaredWeights) {
    return delegee.queryNorm(sumOfSquaredWeights);
  }

  @Override
  public float tf(float freq) {
    return delegee.tf(freq);
  }

  @Override
  public float sloppyFreq(int distance) {
    return delegee.sloppyFreq(distance);
  }

  @Override
  public float idf(int docFreq, int numDocs) {
    return delegee.idf(docFreq, numDocs);
  }

  @Override
  public float coord(int overlap, int maxOverlap) {
    return delegee.coord(overlap, maxOverlap);
  }

  @Override
  public float scorePayload(int docId, String fieldName, int start, int end, byte [] payload, int offset, int length) {
    return delegee.scorePayload(docId, fieldName, start, end, payload, offset, length);
  }
}


text:
package pod

import (
	"github.com/kubernetes/dashboard/resource/common"
	"k8s.io/kubernetes/pkg/api"
)

// Gets restart count of given pod (total number of its containers restarts).
func getRestartCount(pod api.Pod) int {
	restartCount := 0
	for _, containerStatus := range pod.Status.ContainerStatuses {
		restartCount += containerStatus.RestartCount
	}
	return restartCount
}

func ToPod(pod *api.Pod, metrics *MetricsByPod) Pod {
	podDetail := Pod{
		ObjectMeta:   common.NewObjectMeta(pod.ObjectMeta),
		TypeMeta:     common.NewTypeMeta(common.ResourceKindPod),
		PodPhase:     pod.Status.Phase,
		PodIP:        pod.Status.PodIP,
		RestartCount: getRestartCount(*pod),
	}

	if metrics != nil && metrics.MetricsMap[pod.Namespace] != nil {
		metric := metrics.MetricsMap[pod.Namespace][pod.Name]
		podDetail.Metrics = &metric
	}

	return podDetail
}

func ToPodDetail(pod *api.Pod, metrics *MetricsByPod) PodDetail {
	podDetail := PodDetail{
		ObjectMeta:      common.NewObjectMeta(pod.ObjectMeta),
		TypeMeta:        common.NewTypeMeta(common.ResourceKindPod),
		PodPhase:        pod.Status.Phase,
		PodIP:           pod.Status.PodIP,
		RestartCount:    getRestartCount(*pod),
		ContainerImages: GetContainerImages(&pod.Spec),
		NodeName:        pod.Spec.NodeName,
	}

	if metrics != nil && metrics.MetricsMap[pod.Namespace] != nil {
		metric := metrics.MetricsMap[pod.Namespace][pod.Name]
		podDetail.Metrics = &metric
	}

	return podDetail
}

// GetContainerImages returns container image strings from the given pod spec.
func GetContainerImages(podTemplate *api.PodSpec) []string {
	var containerImages []string
	for _, container := range podTemplate.Containers {
		containerImages = append(containerImages, container.Image)
	}
	return containerImages
}


text:
package commons.util;

/**
 * Array creation methods that can be used without qualifiers, using Java SE5
 * static imports:
 */
public class Range {
	// Produce a sequence [0..n)
	public static int[] range(int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++)
			result[i] = i;
		return result;
	}

	// Produce a sequence [start..end)
	public static int[] range(int start, int end) {
		int sz = end - start;
		int[] result = new int[sz];
		for (int i = 0; i < sz; i++)
			result[i] = start + i;
		return result;
	}

	// Produce a sequence [start..end) incrementing by step
	public static int[] range(int start, int end, int step) {
		int sz = (end - start) / step;
		int[] result = new int[sz];
		for (int i = 0; i < sz; i++)
			result[i] = start + (i * step);
		return result;
	}
}


text:
package org.optaplanner.core.api.score.buildin.simplebigdecimal;

import java.math.BigDecimal;

import org.kie.api.runtime.rule.RuleContext;
import org.optaplanner.core.api.score.Score;
import org.optaplanner.core.api.score.buildin.simpledouble.SimpleDoubleScore;
import org.optaplanner.core.api.score.holder.AbstractScoreHolder;

/**
 * @see SimpleBigDecimalScore
 */
public class SimpleBigDecimalScoreHolder extends AbstractScoreHolder {

    protected BigDecimal score = null;

    public SimpleBigDecimalScoreHolder(boolean constraintMatchEnabled) {
        super(constraintMatchEnabled, SimpleBigDecimalScore.ZERO);
    }

    public BigDecimal getScore() {
        return score;
    }

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    /**
     * @param kcontext never null, the magic variable in DRL
     * @param weight never null, higher is better, negative for a penalty, positive for a reward
     */
    public void addConstraintMatch(RuleContext kcontext, BigDecimal weight) {
        score = (score == null) ? weight : score.add(weight);
        registerConstraintMatch(kcontext,
                () -> score = score.subtract(weight),
                () -> SimpleBigDecimalScore.valueOf(weight));
    }

    @Override
    public Score extractScore(int initScore) {
        return SimpleBigDecimalScore.valueOfUninitialized(initScore,
                score == null ? BigDecimal.ZERO : score);
    }

}


text:
from msrest.serialization import Model

class IotHubProperties(Model):
    """The properties of an IoT hub.

    Variables are only populated by the server, and will be ignored when
    sending a request.

    :param authorization_policies: The shared access policies you can use to
     secure a connection to the IoT hub.
    :type authorization_policies: list of
     :class:`SharedAccessSignatureAuthorizationRule
     <azure.mgmt.iothub.models.SharedAccessSignatureAuthorizationRule>`
    :param ip_filter_rules: The IP filter rules.
    :type ip_filter_rules: list of :class:`IpFilterRule
     <azure.mgmt.iothub.models.IpFilterRule>`
    :ivar provisioning_state: The provisioning state.
    :vartype provisioning_state: str
    :ivar host_name: The name of the host.
    :vartype host_name: str
    :param event_hub_endpoints: The Event Hub-compatible endpoint properties.
     The possible keys to this dictionary are events and
     operationsMonitoringEvents. Both of these keys have to be present in the
     dictionary while making create or update calls for the IoT hub.
    :type event_hub_endpoints: dict
    :param routing:
    :type routing: :class:`RoutingProperties
     <azure.mgmt.iothub.models.RoutingProperties>`
    :param storage_endpoints: The list of Azure Storage endpoints where you
     can upload files. Currently you can configure only one Azure Storage
     account and that MUST have its key as $default. Specifying more than one
     storage account causes an error to be thrown. Not specifying a value for
     this property when the enableFileUploadNotifications property is set to
     True, causes an error to be thrown.
    :type storage_endpoints: dict
    :param messaging_endpoints: The messaging endpoint properties for the file
     upload notification queue.
    :type messaging_endpoints: dict
    :param enable_file_upload_notifications: If True, file upload
     notifications are enabled.
    :type enable_file_upload_notifications: bool
    :param cloud_to_device:
    :type cloud_to_device: :class:`CloudToDeviceProperties
     <azure.mgmt.iothub.models.CloudToDeviceProperties>`
    :param comments: IoT hub comments.
    :type comments: str
    :param operations_monitoring_properties:
    :type operations_monitoring_properties:
     :class:`OperationsMonitoringProperties
     <azure.mgmt.iothub.models.OperationsMonitoringProperties>`
    :param features: The capabilities and features enabled for the IoT hub.
     Possible values include: 'None', 'DeviceManagement'
    :type features: str or :class:`Capabilities
     <azure.mgmt.iothub.models.Capabilities>`
    """

    _validation = {
        'provisioning_state': {'readonly': True},
        'host_name': {'readonly': True},
    }

    _attribute_map = {
        'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRule]'},
        'ip_filter_rules': {'key': 'ipFilterRules', 'type': '[IpFilterRule]'},
        'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
        'host_name': {'key': 'hostName', 'type': 'str'},
        'event_hub_endpoints': {'key': 'eventHubEndpoints', 'type': '{EventHubProperties}'},
        'routing': {'key': 'routing', 'type': 'RoutingProperties'},
        'storage_endpoints': {'key': 'storageEndpoints', 'type': '{StorageEndpointProperties}'},
        'messaging_endpoints': {'key': 'messagingEndpoints', 'type': '{MessagingEndpointProperties}'},
        'enable_file_upload_notifications': {'key': 'enableFileUploadNotifications', 'type': 'bool'},
        'cloud_to_device': {'key': 'cloudToDevice', 'type': 'CloudToDeviceProperties'},
        'comments': {'key': 'comments', 'type': 'str'},
        'operations_monitoring_properties': {'key': 'operationsMonitoringProperties', 'type': 'OperationsMonitoringProperties'},
        'features': {'key': 'features', 'type': 'str'},
    }

    def __init__(self, authorization_policies=None, ip_filter_rules=None, event_hub_endpoints=None, routing=None, storage_endpoints=None, messaging_endpoints=None, enable_file_upload_notifications=None, cloud_to_device=None, comments=None, operations_monitoring_properties=None, features=None):
        self.authorization_policies = authorization_policies
        self.ip_filter_rules = ip_filter_rules
        self.provisioning_state = None
        self.host_name = None
        self.event_hub_endpoints = event_hub_endpoints
        self.routing = routing
        self.storage_endpoints = storage_endpoints
        self.messaging_endpoints = messaging_endpoints
        self.enable_file_upload_notifications = enable_file_upload_notifications
        self.cloud_to_device = cloud_to_device
        self.comments = comments
        self.operations_monitoring_properties = operations_monitoring_properties
        self.features = features


text:
package org.zstack.header.vm.hooks;

public interface VmInstanceRebootHook {
}


text:
<!DOCTYPE html>

  {% include head.html %}

      {% include header.html %}

{{ page.title | capitalize}}

          {% for post in page.posts %}
            {% include article.html %}
          {% endfor %}

      {% include footer.html %}


text:
/* protocol_tcp.c
 * 2014-04-21
 * Robin Duda
 *  TCP Tracker protocol.
 */

#ifndef _protocol_tcp_
#define _protocol_tcp_

 #include <pthread.h>
 #include <netdb.h>
 #include <unistd.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include "urlparse.h"
 #include "protocol_meta.h"
 #include "netstat.h"

void tcp_announce(announce_t* announce); //announce to a tcp tracker.
void tcp_scrape(scrape_t* scrape);		 //scrape tcp tracker.

#endif


text:
namespace ARDUINOJSON_NAMESPACE {

template <typename T>
T declval();

}  // namespace ARDUINOJSON_NAMESPACE


text:
package org.code.pomelo.concurrent.morden.traditional.queue.operation.blog;

import org.code.pomelo.concurrent.morden.traditional.Author;
import org.code.pomelo.concurrent.morden.traditional.Update;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * Created by ruyin on 2017/7/5.
 *
 * 测试相连线程池,当上游的线程池生产速度高于下游消费速度就会导致上游的线程处于阻塞等待状态,如果下游的线程池消费速度高于上游生产速度就会导致下游的线程处于空闲等待状态
 */
public abstract class BlockingMicroBlog extends Thread{

    protected final BlockingQueue<Update> updates;
    protected String text = "";
    protected final int pauseTime;
    private boolean shutdown = false;

    public BlockingMicroBlog(BlockingQueue<Update> bq, int pauseTime){
        this.updates = bq;
        this.pauseTime = pauseTime;
    }

    @Override
    public void run() {
        while (!shutdown){
            doAction();
            try {
                Thread.sleep(pauseTime);
            }catch (InterruptedException e){
                shutdown = true;
            }
        }
    }

    public abstract void doAction();

    public static void main(String[] args) {
        final Update.Builder ub = new Update.Builder();
        //final BlockingQueue<Update> lbq = new LinkedBlockingDeque<>(100);
        final BlockingQueue<Update> lbq = new ArrayBlockingQueue<>(100);

        BlockingMicroBlog b1 = new BlockingMicroBlog(lbq,10) {

            @Override
            public void doAction() {
                text = text + "x";
                Update u = ub.author(new Author("lksd")).updateText("poision").build();
                boolean handed = false;
                try {
                    handed = updates.offer(u,100, TimeUnit.MILLISECONDS);
                }catch (InterruptedException e){}

                if (!handed)
                    System.out.println("Unable to hand off Update to Queue due to timeout!");
            }
        };

        BlockingMicroBlog b2 = new BlockingMicroBlog(lbq,1000) {

            @Override
            public void doAction() {
                Update u = null;
                try {
                    u = updates.take();
                    System.out.println("Consume Update about:" + u.getAuthor().getName() + ":" + u.getUpdateText());
                }catch (InterruptedException e){
                    return;
                }
            }
        };

        b1.start();
        b2.start();
    }
}


text:
import java.util.Properties

import kafka.consumer.ConsumerConfig
import org.I0Itec.zkclient.ZkClient
import org.apache.log4j.{Level, Logger}
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.streaming.StreamSQLContext
import org.apache.spark.sql.streaming.sources.MessageDelimiter
import org.apache.spark.streaming.dstream.ConstantInputDStream
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.{SparkConf, SparkContext}
import redis.RedisManager

import scala.util.parsing.json.JSON

class TabDelimiter extends MessageDelimiter {
  override val delimiter = "\t"
}

object StreamDDL {
  def main(args: Array[String]): Unit = {
    Logger.getRootLogger.setLevel(Level.WARN)
    val query = args(0)
    val sc = new SparkContext(new SparkConf())
    val ssc = new StreamingContext(sc, Seconds(1))
    val streamSqlContext = new StreamSQLContext(ssc, new HiveContext(sc))
    streamSqlContext.command(query)
    new ConstantInputDStream[Int](ssc, sc.parallelize(Seq(1))).print
    ssc.start()
    ssc.awaitTerminationOrTimeout(100)
    ssc.stop()
  }
}

object StreamHQL {

  object Redis {
    var initialized = false
    var manager: RedisManager = _
    def init(confMap: Map[String, String]) {
      if (initialized == false) {
        manager = new RedisManager(
          confMap("redis.shards"),
          confMap("redis.sentinels"),
          confMap("redis.database").toInt)
        manager.init
        initialized = true
      }
    }
  }

  def removeConsumerGroup(zkQuorum: String, groupId: String) {
    val properties = new Properties()
    properties.put("zookeeper.connect", zkQuorum)
    properties.put("group.id", groupId)
    val conf = new ConsumerConfig(properties)
    val zkClient = new ZkClient(conf.zkConnect)
    zkClient.deleteRecursive(s"/consumers/${conf.groupId}")
    zkClient.close()
  }

  def main(args: Array[String]): Unit = {
    Logger.getRootLogger.setLevel(Level.WARN)
    val confMap = JSON.parseFull(args(0)).get.asInstanceOf[Map[String, String]]
    val qid = args(1)
    val query = args(2)
    val sc = new SparkContext(new SparkConf())
    val ssc = new StreamingContext(sc, Seconds(1))
    val hc = new HiveContext(sc)
    val streamSqlContext = new StreamSQLContext(ssc, hc)
    val redisExpireSec = confMap("redis.expire.sec").toInt
    ssc.checkpoint(s"checkpoint/$qid")
    hc.setConf("spark.streaming.query.id", qid)
    hc.setConf("spark.sql.shuffle.partitions", confMap("spark.sql.shuffle.partitions"))

    removeConsumerGroup(confMap("kafka.zookeeper.quorum"), qid)
    val result = streamSqlContext.sql(query)
    val schema = result.schema

    result.foreachRDD((rdd, time) => {
      rdd.foreachPartition(partition => {
        Redis.init(confMap)
        val jedis = Redis.manager.getResource
        val pipe = jedis.pipelined
        partition.foreach(record => {
          val seq = record.toSeq(schema)
          val ts = time.milliseconds / 1000
          val hkey = seq.take(seq.size - 1).mkString(".")
          pipe.hset(qid + "." + ts, hkey, seq(seq.size - 1).toString)
          pipe.expire(qid + "." + ts, redisExpireSec)
        })
        pipe.sync
        Redis.manager.returnResource(jedis)
      })
    })

    ssc.start()
    ssc.awaitTermination()
    ssc.stop()
  }
}