text:
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  skip_before_action :verify_authenticity_token, raise: false, if: ->{ !protect_csrf? }

  # before_action -> { FileUtils.touch "#{Rails.root}/Gemfile" } if Rails.env.to_s == "development"
  before_action :set_cache_buster

  before_action :clear_secure_option_of_session_on_ie11

  class CloseableChunkedBody < Rack::Chunked::Body
    def initialize(*args)
      super
      @closed = false
    end

    def each(&block)
      super
    ensure
      unless @closed
        close
        @closed = true
      end
    end

    def close
      return unless @body.respond_to?(:close)

      if @body.method(:close).arity == 0
        @body.close
      else
        # Tempfile support
        @body.close(true)
      end
    end
  end

  def new_agent(controller_name)
    agent = SS::Agent.new controller_name
    agent.controller.params  = params
    agent.controller.request = request
    agent.controller.instance_variable_set :@controller, self
    agent
  end

  def render_agent(controller_name, action)
    new_agent(controller_name).render(action)
  end

  def invoke_agent(controller_name, action)
    new_agent(controller_name).invoke(action)
  end

  def send_enum(enum, options = {})
    content_type = options.fetch(:type, DEFAULT_SEND_FILE_TYPE)
    self.content_type = content_type

    disposition = options.fetch(:disposition, DEFAULT_SEND_FILE_DISPOSITION)
    unless disposition.nil?
      disposition  = disposition.to_s
      disposition += "; filename=\"#{options[:filename]}\"" if options[:filename]
      headers['Content-Disposition'] = disposition
    end

    # nginx doc: Setting this to "no" will allow unbuffered responses suitable for Comet and HTTP streaming applications
    headers['X-Accel-Buffering'] = 'no'
    headers['Cache-Control'] = 'no-store'
    headers['Transfer-Encoding'] = 'chunked'
    headers.delete('Content-Length')

    # Unfortunately Rack::ETag (https://github.com/rack/rack/blob/master/lib/rack/etag.rb#L54) above 2.2
    # forcibly calculate etag even though the response is streaming. So, streaming response doesn't work properly.
    # To fix this issue, you must set "Last-Modified" header explicitly
    #
    # see: https://qiita.com/snaka/items/133edf3e1a4cabd9ce45
    headers['Last-Modified'] = Time.zone.now.rfc2822

    # output csv by streaming
    self.response_body = CloseableChunkedBody.new(enum)
  end

  def send_file_headers!(options)
    if browser.ie?("<= 11") && ie11_attachment_mime_types.include?(options[:type])
      options[:disposition] = "attachment"
    end
    super(options)
  end

  def ie11_attachment_mime_types
    @_ie11_attachment_mime_types ||= begin
      mime_types = SS.config.ie11.dig("content_disposition", "attachment", "mime_type_map")
      mime_types ? mime_types.values.flatten : []
    end
  end

  def ss_send_file_file(file_or_path, opts = {})
    opts[:x_sendfile] = true unless opts.key?(:x_sendfile)
    if file_or_path.respond_to?(:path)
      path = file_or_path.path
    else
      path = file_or_path
    end
    send_file path, opts
  end

  def ss_send_file_grid_fs(file_or_path, opts = {})
    if file_or_path.respond_to?(:to_io)
      io = file_or_path.to_io
    else
      io = Fs.to_io(file_or_path)
    end
    send_enum io, opts
  end

  if Rails.env.test?
    def ss_send_file(*args)
      if Fs.mode == :file
        ss_send_file_file(*args)
      else
        ss_send_file_grid_fs(*args)
      end
    end
  elsif Fs.mode == :file
    alias ss_send_file ss_send_file_file
  else
    alias ss_send_file ss_send_file_grid_fs
  end

  def json_content_type
    (browser.ie? && browser.version.to_i <= 9) ? "text/plain" : "application/json"
  end

  private

  def request_host
    request.env["HTTP_X_FORWARDED_HOST"] || request.env["HTTP_HOST"] || request.host_with_port
  end

  def request_path
    request.env["REQUEST_PATH"] || request.path
  end

  def protect_csrf?
    SS.config.env.protect_csrf
  end

  def remote_addr
    request.env["HTTP_X_REAL_IP"].presence || request.remote_addr
  end

  def pc_browser?
    return @is_pc_browser if !@is_pc_browser.nil?

    platform = browser.platform
    @is_pc_browser = platform.windows? || platform.mac? || platform.linux?
  end
  helper_method :pc_browser?

  # Accepts the request for Cross-Origin Resource Sharing.
  # @return boolean
  def accept_cors_request
    if request.env["HTTP_ORIGIN"].present?
      headers["Access-Control-Allow-Origin"] = request.env["HTTP_ORIGIN"]
      headers["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS"
      headers["Access-Control-Allow-Headers"] = "Content-Type, Origin, Accept"
    end

    if request.request_method == "OPTIONS"
      headers["Access-Control-Max-Age"] = "86400"
      headers["Content-Length"] = "0"
      headers["Content-Type"] = "text/plain"
      render plain: ""
    end
  end

  def set_cache_buster
    if request.xhr?
      response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
      response.headers["Pragma"] = "no-cache"
      response.headers["Expires"] = "-1"
    end
  end

  def trusted_url?(url)
    url = ::Addressable::URI.parse(url.to_s)

    known_trusted_urls = []
    if @cur_site.present? && @cur_site.respond_to?(:domain_with_subdir)
      domain_with_subdir = @cur_site.domain_with_subdir
      if domain_with_subdir.present?
        known_trusted_urls << "//#{domain_with_subdir}"
      end
    end

    Sys::TrustedUrlValidator.valid_url?(url, known_trusted_urls)
  end
  helper_method :trusted_url?

  def trusted_url!(url)
    raise "untrusted url" unless trusted_url?(url)
    url
  end
  helper_method :trusted_url!

  def clear_secure_option_of_session_on_ie11
    return unless browser.ie?("<= 11")

    # IE11 利用時、CMS のページのプレビュー表示での印刷時に画像が表示されないという障害がある。
    # その障害は Set-Cookie レスポンスの SameSite=Lax が原因。
    # Set-Cookie レスポンスに SameSite=Lax がついていない場合、Firefox などの一部のブラウザの開発者ツールで警告が表示されるし、
    # SameSite=Lax は付いておいた方がよいので、IE11 の場合だけ無効にする。
    request.session_options[:same_site] = nil if request.session_options[:same_site].present?
  end
end


text:
/* Welcome to Compass.
 * In this file you should write your main styles. (or centralize your imports)
 * Import this file using the following HTML or equivalent:
 * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
/* line 5, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline;
}

/* line 22, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
html {
  line-height: 1;
}

/* line 24, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
ol, ul {
  list-style: none;
}

/* line 26, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* line 28, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
caption, th, td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle;
}

/* line 30, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
q, blockquote {
  quotes: none;
}
/* line 103, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
q:before, q:after, blockquote:before, blockquote:after {
  content: "";
  content: none;
}

/* line 32, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
a img {
  border: none;
}

/* line 116, ../../../../../../../usr/local/lib/ruby/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
  display: block;
}

/* line 11, ../sass/screen.scss */
body {
  background: #000;
  font-family: "Roboto Mono", monospaced;
  font-weight: 300;
  font-size: 16px;
  line-height: 180%;
  color: #fff;
}

/* line 20, ../sass/screen.scss */
h3 {
  font-weight: 700;
}

/* line 24, ../sass/screen.scss */
input {
  outline: none;
}

/* line 28, ../sass/screen.scss */
.full {
  line-height: auto;
}

/* line 34, ../sass/screen.scss */
.directions {
  background: #fff;
  width: 500px;
  position: absolute;
  top: 25%;
  left: 25%;
  color: #000;
  -webkit-box-shadow: 0px 0px 18px 2px white;
  -moz-box-shadow: 0px 0px 18px 2px white;
  box-shadow: 0px 0px 18px 2px white;
}
/* line 45, ../sass/screen.scss */
.directions .content {
  width: 85%;
  padding: 1em;
}

/* line 55, ../sass/screen.scss */
.row {
  padding: 0.75em 0;
}
/* line 59, ../sass/screen.scss */
.row .content {
  width: 50%;
  margin: 0 auto;
}
/* line 62, ../sass/screen.scss */
.row .content p {
  padding: 0.75em 0;
}
/* line 65, ../sass/screen.scss */
.row .content code {
  color: red;
  font-style: italic;
}
/* line 71, ../sass/screen.scss */
.row .story {
  height: 50%;
  overflow: hidden;
  font-size: 2em;
  line-height: 150%;
  background: black;
  background: -moz-linear-gradient(top, black 0%, black 93%, #3b3b3b 100%);
  background: -webkit-gradient(left top, left bottom, color-stop(0%, black), color-stop(93%, black), color-stop(100%, #3b3b3b));
  background: -webkit-linear-gradient(top, black 0%, black 93%, #3b3b3b 100%);
}
/* line 82, ../sass/screen.scss */
.row .exposition {
  height: 100%;
  overflow: hidden;
}
/* line 88, ../sass/screen.scss */
.row .terminal {
  background: #474747;
  background: black;
  background: -moz-linear-gradient(top, black 0%, #292929 100%);
  background: -webkit-gradient(left top, left bottom, color-stop(0%, black), color-stop(100%, #292929));
  background: -webkit-linear-gradient(top, black 0%, #292929 100%);
  color: #fff;
  width: 100%;
  height: 50%;
}
/* line 99, ../sass/screen.scss */
.row .terminal .content {
  width: 85%;
  padding: 1em;
}
/* line 103, ../sass/screen.scss */
.row .terminal .content input {
  background: transparent;
  border: none;
  font-family: "Roboto Mono", monospaced;
  color: white;
}

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * Stub implementation for the intl_is_failure function of the intl extension
 *
 * @author Bernhard Schussek <bernhard.schussek@symfony.com>
 * @param  integer $errorCode  The error code returned by intl_get_error_code()
 * @return Boolean Whether the error code indicates an error
 * @see    Symfony\Component\Locale\Stub\StubIntl::isFailure
 */
function intl_is_failure($errorCode) {
    return \Symfony\Component\Locale\Stub\StubIntl::isFailure($errorCode);
}

/**
 * Stub implementation for the intl_get_error_code function of the intl extension
 *
 * @author Bernhard Schussek <bernhard.schussek@symfony.com>
 * @return Boolean The error code of the last intl function call or
 *                 StubIntl::U_ZERO_ERROR if no error occurred
 * @see    Symfony\Component\Locale\Stub\StubIntl::getErrorCode
 */
function intl_get_error_code() {
    return \Symfony\Component\Locale\Stub\StubIntl::getErrorCode();
}
/**
 * Stub implementation for the intl_get_error_code function of the intl extension
 *
 * @author Bernhard Schussek <bernhard.schussek@symfony.com>
 * @return Boolean The error message of the last intl function call or
 *                 "U_ZERO_ERROR" if no error occurred
 * @see    Symfony\Component\Locale\Stub\StubIntl::getErrorMessage
 */
function intl_get_error_message() {
    return \Symfony\Component\Locale\Stub\StubIntl::getErrorMessage();
}


text:
const actions = require("../../../actions");

module.exports = (action, store, parent) => {
	switch (action) {
	case "OPEN_INPUT_BAR":
		parent.showTextInputBar();
		parent.textInputBar.setValue("search ");
		break;

	case "PLAY_NEXT_TRACK":
		store.dispatch(actions.player.skipTracks(1));
		break;
	}
};


text:
package org.jasig.portlet.widget.links;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import javax.portlet.PortletRequest;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.portlet.bind.annotation.RenderMapping;

@Controller
@RequestMapping("VIEW")
@Slf4j
public class ResourceLinksController extends ResourceLinksBaseController {

    @RenderMapping
    public String view(final PortletRequest req) throws Exception {
        Set<String> groups = getGroups();
        return "links/links";
    }

    @ModelAttribute("links")
    public List<ResourceLink> getResourceLinks(PortletRequest req) {
        final List<ResourceLink> filteredLinks = new ArrayList<>();
        final List<ResourceLink> allLinks = super.getResourceLinks(req);
        for (ResourceLink link : allLinks) {
            if (link.getGroups().isEmpty()) {
                filteredLinks.add(link);
            } else {
                boolean inGroup = link.getGroups().stream().anyMatch(req::isUserInRole);
                if (inGroup) {
                    filteredLinks.add(link);
                }
            }
        }
        return filteredLinks;
    }

    @ModelAttribute("iconSizePixels")
    public String getIconSizePixels(PortletRequest req) {
        return super.getIconSizePixels(req);
    }
}


text:
namespace chromeos {
namespace input_method {

InputMethodDescriptor::InputMethodDescriptor(
    const std::string& id,
    const std::string& name,
    const std::vector<std::string>& keyboard_layouts,
    const std::string& language_code,
    const GURL& options_page_url)
    : id_(id),
      name_(name),
      keyboard_layouts_(keyboard_layouts),
      language_code_(language_code),
      options_page_url_(options_page_url) {
}

std::string InputMethodDescriptor::GetPreferredKeyboardLayout() const {
  // TODO(nona): Investigate better way to guess the preferred layout
  //             http://crbug.com/170601.
  return keyboard_layouts_.empty() ? "us" : keyboard_layouts_[0];
}

InputMethodDescriptor::InputMethodDescriptor() {
}

InputMethodDescriptor::~InputMethodDescriptor() {
}

}  // namespace input_method
}  // namespace chromeos


text: search_result['369']=["topic_00000000000000BB.html","Inprogress Field",""];


text:
<!--
  Copyright The Ohio State University Research Foundation, The University of Chicago -
Argonne National Laboratory, Emory University, SemanticBits LLC, and Ekagra Software Technologies Ltd.

  Distributed under the OSI-approved BSD 3-Clause License.
  See http://ncip.github.com/cagrid-core/LICENSE.txt for details.
-->
<!-- ======================================================================= -->
<!-- caGrid Utilities build file                                             -->
<!-- ======================================================================= -->
<project name="caGrid-transfer_tests_harness" basedir=".">
	<property name="test.log.dir" value="log" />
	<property name="junit.results.dir" value="${test.log.dir}/junit" />
	<property name="force.config.replace" value="false" />

	<!-- call the test target for each project and aggregates the log resutls  -->
	<target name="systemTest" depends="checkGlobus">
		<echo message="Test results dir: ${junit.results.dir}" />
		<mkdir dir="${junit.results.dir}" />
		<junit dir="${introduce.dir}" printsummary="yes" errorproperty="test.failed" failureproperty="test.failed" showoutput="true" forkmode="once">
			<sysproperty key="basedir" value="${introduce.dir}" />
			<jvmarg value="-Dbuild.dir=build" />
			<classpath>
				<path refid="test.run.classpath" />
				<pathelement location="${test.dir}/resources" />
			</classpath>
			<formatter type="xml" />
			<test if="testcase" name="${testcase}" fork="yes" todir="${junit.results.dir}" />
			<batchtest unless="testcase" fork="yes" todir="${junit.results.dir}">
				<fileset dir="${test.src.dir}">
					<include name="**/*StoryBook.java" />
				</fileset>
			</batchtest>
		</junit>
		<fail message="Tests failed! Check test reports." if="test.failed" />
	</target>
</project>


text:
import {
  registerPlugin,
  compile,
  removePlugin,
  packageName,
  engineName
} from './utils/helpers';

function TestPlugin() {
  ok(true, 'TestPlugin instantiated');
}

TestPlugin.prototype.transform = function(ast) {
  ok(true, 'transform was called');

  return ast;
};

QUnit.module(`ember-${packageName}: Registering AST Plugins`, {
  setup(assert) {
  },

  teardown() {
    removePlugin('ast', TestPlugin);
  }
});

QUnit.test('registering a plugin adds it to compiler options', function() {
  expect(2);

  registerPlugin('ast', TestPlugin);

  compile('some random template', { plugins: { ast: [] } });
});

QUnit.test('registering an unknown type throws an error', function() {
  throws(() => {
    registerPlugin('asdf', 'whatever');
  }, `Attempting to register whatever as "asdf" which is not a valid ${engineName} plugin type.`);
});

QUnit.test('can register AST plugins through the options', function() {
  expect(2);

  compile('some random template', { plugins: { ast: [TestPlugin] } });
});


text:
import {
  LOADING_MEASUREMENTS,
  LOADING_MEASUREMENTS_FAILED,
  LOADING_MEASUREMENTS_SUCCEEDED
} from '../actions/measurement'

const ACTION_HANDLERS = {
  [LOADING_MEASUREMENTS_FAILED]: (state, action) => {
    return ({ ...state, failed: true, loading: false, failure: action.ex })
  },
  [LOADING_MEASUREMENTS_SUCCEEDED]: (state, action) => {
    return ({ ...state, loading: false, failed: false, measurements: action.measurements })
  },
  [LOADING_MEASUREMENTS]: (state) => {
    return ({ ...state, loading: true, failed: false, failure: null })
  }
}

const initialState = {
  failed: false,
  failure: null,
  loading: false,
  measurements: []
}
export function measurementReducer (state = initialState, action) {
  const handler = ACTION_HANDLERS[action.type]

  return handler ? handler(state, action) : state
}


text:
package com.projectvalis.compUtils.util.fileIO;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * utilities to ingest data for compression processing.
 *
 * @author funktapuss
 *
 */
public class Ingest {
	static Logger logger = LoggerFactory.getLogger(Ingest.class);

	/**
	 * loads a file as a byte array. requires full pathname of file.
	 *
	 * @param fName
	 * 		the name of the file you want to load.
	 * @return
	 * 		byte array containing loaded file.
	 */
	public static byte[] loadFile(String fName) {

		try {
			DataInputStream dis =
					new DataInputStream(new FileInputStream(fName));
			byte[] byteArr = new byte[dis.available()];
			dis.readFully(byteArr);
			dis.close();
			return byteArr;
		} catch (IOException e) {
			System.out.println("error loading file! " + e);
		}

		return null;
	}

	/**
	 * loads a file as an ArrayList<Character>, where each char represents
	 * a Hex nibble.
	 *
	 * @param fName
	 * 		the name of the file you want to load.
	 *
	 * @return
	 * 		list of chars representing ingested file in hex.
	 */
	public static ArrayList<Character> loadFileAsHex(String fName) {
		// load file
		byte[] byteArr = loadFile(fName);
		logger.info("file size is: " + byteArr.length + " bytes");

		// stage some variables
		ArrayList<Character> inHexAL = new ArrayList<Character>();

		// process each byte
		for (int i = 0; i < byteArr.length; i ++) {
			String hexS = Integer.toHexString(byteArr[i] & 0xFF).toUpperCase();
			if (hexS.length() == 1) hexS = "0" + hexS;
			inHexAL.add(hexS.charAt(0));
			inHexAL.add(hexS.charAt(1));
		}

		//return to caller
		return inHexAL;
	}

	/**
	 * load file as an ArrayList<Character>, where each char represents three
	 * bits of data. each digit gets its own indice, each set of three
	 * represents one byte in the file.
	 *
	 * @param fName
	 * 		the name of the file you want to load.
	 * @return
	 * 		list of chars representing ingested file as octal.
	 */
	public static ArrayList<Character> loadFileAsOctal(String fName) {
		// load file
		byte[] byteArr = loadFile(fName);
		logger.info("file size is: " + byteArr.length + " bytes");

		// stage some variables. using stringbuffer to reduce resource
		// footprint
		ArrayList<Character> inOctalAL = new ArrayList<Character>();
		StringBuffer sb1 = new StringBuffer();
		StringBuffer sb2 = new StringBuffer();

		// process each byte
		for (int i = 0; i < byteArr.length; i ++) {
			//get unsigned int representation of byte
			int unsignedByteI = byteArr[i] & 0xFF;

			// append it to the buffer
			sb1.append(unsignedByteI);

			// normally don't like to pack things in like this - hoping
			// to avoid generating a lot of string objects that hang around
			// by having this all be in one statement.
			sb2.append(
					Integer.toOctalString(
							Integer.parseInt(sb1.toString())));

			while (sb2.length() < 3) {
				sb2.insert(0, '0');
			}

			// add chars to the octal array
			for (int k = 0; k < sb2.length(); k ++) {
				inOctalAL.add(sb2.charAt(k));
			}

			// flush the buffers and iterate
			sb1.delete(0, sb1.length());
			sb2.delete(0, sb2.length());
		}

		// report to caller
		// three bits per octal symbol
		// effectively it's now nine bits/byte now instead of eight
		int newSizeI = (inOctalAL.size() * 3) / 8;
		logger.info("file size encoded in octal is: " + newSizeI + " bytes\n");

		//return to caller
		return inOctalAL;
	}

	/**
	 * assumes the file being read is comprised only of ASCII 48/49 ("0", "1").
	 * reads each as a nibble and returns an ArrayList<Character>, where each
	 * char represents a nibble of data.
	 *
	 * @param fName
	 * 		the name of the file you want to load.
	 * @return
	 * 		list of chars representing ingested file as hex
	 */
	public static ArrayList<Character> loadFileAsStringHex(String fName) {
		// load file
		byte[] byteArr = loadFile(fName);
		logger.info("file size is: " + byteArr.length + " bytes");

		// stage some variables
		ArrayList<Character> inHexAL = new ArrayList<Character>();

		// process each byte
		for (int i = 0; i < byteArr.length; i ++) {

			if ((int)byteArr[i] == 48) {
				inHexAL.add('0');
				inHexAL.add('0');
			}
			else if ((int)byteArr[i] == 49) {
				inHexAL.add('0');
				inHexAL.add('1');
			}
			else {
				logger.info("found something I can't parse, yo!");
				logger.info(byteArr[i] + " " + i);
				System.exit(8);
			}

		}

		//return to caller
		return inHexAL;
	}

}


text:
require 'rails/generators'
require 'rails/generators/migration'

module Dynabute
  class InstallGenerator < Rails::Generators::Base
    include Rails::Generators::Migration
    source_root File.expand_path("../templates", __FILE__)
    desc "This generator installs migrations for Dynabute"
    # argument :stylesheets_type, :type => :string, :default => 'less', :banner => '*less or static'
    # class_option :'no-coffeescript', :type => :boolean, :default => false, :desc => 'Skips coffeescript replacement into app generators'

    def self.next_migration_number(path)
      next_migration_number = current_migration_number(path) + 1
      ActiveRecord::Migration.next_migration_number(next_migration_number)
    end

    def copy_migrations
      migration_template 'migration.rb', "db/migrate/create_dynabutes.rb"
    end
  end
end


text:
'use strict';

angular.module('bssuiteApp')
    .directive('hasAnyAuthority', ['Principal', function (Principal) {
        return {
            restrict: 'A',
            link: function (scope, element, attrs) {
                var setVisible = function () {
                        element.removeClass('hidden');
                    },
                    setHidden = function () {
                        element.addClass('hidden');
                    },
                    defineVisibility = function (reset) {
                        var result;
                        if (reset) {
                            setVisible();
                        }

                        result = Principal.hasAnyAuthority(authorities);
                        if (result) {
                            setVisible();
                        } else {
                            setHidden();
                        }
                    },
                    authorities = attrs.hasAnyAuthority.replace(/\s+/g, '').split(',');

                if (authorities.length > 0) {
                    defineVisibility(true);
                }
            }
        };
    }])
    .directive('hasAuthority', ['Principal', function (Principal) {
        return {
            restrict: 'A',
            link: function (scope, element, attrs) {
                var setVisible = function () {
                        element.removeClass('hidden');
                    },
                    setHidden = function () {
                        element.addClass('hidden');
                    },
                    defineVisibility = function (reset) {

                        if (reset) {
                            setVisible();
                        }

                        Principal.hasAuthority(authority)
                            .then(function (result) {
                                if (result) {
                                    setVisible();
                                } else {
                                    setHidden();
                                }
                            });
                    },
                    authority = attrs.hasAuthority.replace(/\s+/g, '');

                if (authority.length > 0) {
                    defineVisibility(true);
                }
            }
        };
    }]);


text:
@if not defined _echo @echo off
setlocal EnableDelayedExpansion

set __ThisScriptShort=%0

if /i "%1" == "/?"    goto HelpVarCall
if /i "%1" == "-?"    goto HelpVarCall
if /i "%1" == "/h"    goto HelpVarCall
if /i "%1" == "-h"    goto HelpVarCall
if /i "%1" == "/help" goto HelpVarCall
if /i "%1" == "-help" goto HelpVarCall

if defined BUILDVARS_DONE goto :AfterVarSetup

goto :NormalVarCall

:HelpVarCall
call %~dp0buildvars-setup.cmd -help
exit /b 1

:NormalVarCall
call %~dp0buildvars-setup.cmd %*

IF NOT ERRORLEVEL 1 goto AfterVarSetup
echo Setting build variables failed.
exit /b %ERRORLEVEL%

:AfterVarSetup

echo Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.

:: Set the environment for the native build
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)

:: VS2017 changed the location of vcvarsall.bat.
if /i "%__VSVersion%" == "vs2017" (
    call "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%
) else (
    call "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\vcvarsall.bat" %__VCBuildArch%
)

:: Regenerate the VS solution
pushd "%__IntermediatesDir%"
call "%__SourceDir%\Native\gen-buildsys-win.bat" "%__ProjectDir%\src\Native" %__VSVersion% %__BuildArch%
popd

if exist "%__IntermediatesDir%\install.vcxproj" goto BuildNative
echo Failed to generate native component build project!
exit /b 1

:BuildNative
%_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "%__IntermediatesDir%\install.vcxproj" %__ExtraMsBuildParams% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__NativeBuildLog%"
IF NOT ERRORLEVEL 1 goto AfterNativeBuild
echo Native component build failed. Refer !__NativeBuildLog! for details.
exit /b 1

:AfterNativeBuild
endlocal


text:
require 'spec_helper'

klass = OneviewSDK::API600::Synergy::LogicalEnclosure
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
  let(:current_client) { $client_600_synergy }
  let(:encl_group_class) { OneviewSDK::API600::Synergy::EnclosureGroup }
  let(:enclosure_class) { OneviewSDK::API600::Synergy::Enclosure }

  include_examples 'LogicalEnclosureCreateExample', 'integration api600 context', 'Synergy'
end


text:
#ifndef STREAM_H
#define STREAM_H

#include "StreamSep.h"

namespace Hpipe {

extern StreamSepMaker coutn;
extern StreamSepMaker cerrn;

typedef std::string String; // HUM

#define P( A ) Hpipe::coutn << #A << " -> " << ( A )
#define PE( A ) Hpipe::cerrn << #A << " -> " << ( A )

}

#endif // STREAM_H


text:
set -x

KUBECTL='docker exec hyperkube /hyperkube kubectl'

PWD=`pwd`
cd `readlink -e $(dirname ${0})`

create_namespaces() {
	for n in ${NAMESPACES};
	do
		echo "Creating namespace: ${n}"
		${KUBECTL} get namespaces --no-headers 2>/dev/null | grep -q ${n}
		if [ "${?}" != "0" ]; then
			${KUBECTL} create namespace ${n}
		fi
	done

	echo "kubernetes namespaces:"
	${KUBECTL} get namespaces
}

# run_and_expose_service <servicename> <namespace> <image> <port>
run_and_expose_service() {
	if [ "${#}" != "4" ]; then
		return -1
	fi

	service="${1}"
	namespace="${2}"
	image="${3}"
	port="${4}"

	echo "   starting service '${service}' in namespace '${namespace}'"

	${KUBECTL} get deployment --namespace=${namespace} --no-headers 2>/dev/null | grep -q ${service}
	if [ "${?}" != "0" ]; then
		${KUBECTL} run ${service} --namespace=${namespace} --image=${image}
	else
		echo "warn: service '${service}' already running in namespace '${namespace}'"
	fi

	${KUBECTL} get service --namespace=${namespace} --no-headers 2>/dev/null | grep -q ${service}
	if [ "${?}" != "0" ]; then
		${KUBECTL} expose deployment ${service} --namespace=${namespace} --port=${port}
	else
		echo "warn: service '${service}' already exposed in namespace '${namespace}'"
	fi
}

#run_and_expose_rc nginx-controller nginx-rc.yml poddemo 80
run_and_expose_rc() {
	if [ "${#}" != "4" ]; then
		return -1
	fi

	rc_name="${1}"
	rc_file="${2}"
	namespace="${3}"
	port="${4}"

	echo "   starting replication controller '${rc_name}' from '${rc_file}' in namespace '${namespace}'"

	${KUBECTL} get rc --namespace=${namespace} --no-headers 2>/dev/null | grep -q ${rc_name}
	if [ "${?}" != "0" ]; then
		${KUBECTL} expose -f ${rc_file} --namespace=${namespace} --port=${port}
	else
		echo "warn: rc '${rc_name}' already running in namespace '${namespace}'"
	fi
}

echo "Starting sample kubernetes services..."

NAMESPACES="demo poddemo test"
create_namespaces

echo ""
echo "Starting services:"

run_and_expose_service mynginx demo nginx 80
run_and_expose_service webserver demo nginx 80
run_and_expose_service mynginx test nginx 80
run_and_expose_service webserver test nginx 80

echo ""
echo "Services exposed:"
${KUBECTL} get services --all-namespaces

echo ""
echo "Starting replicationcontrollers:"

run_and_expose_rc nginx-controller nginx-rc.yml poddemo 80

echo ""
echo "ReplicationControllers exposed:"
${KUBECTL} get rc --all-namespaces

cd ${PWD}


text:
var common = require("./common");
var moment = require("moment");

exports.register = function(req, res) {
	var email = req.param("email");
	var teamname = req.param("team");
	var school = req.param("school");
	var pwd = req.param("pass");

	if (!(email && email.length > 0 && teamname && teamname.length > 0 && school && school.length > 0 && pwd && pwd.length > 0)) {
		res.send({
			success: 0,
			message: "Please fill out all of the required fields."
		});
		return;
	}

	teamname = common._(teamname);
	school = common._(school);

	if (teamname.length == 0) {
		res.send({
			success: 0,
			message: "Please enter some characters."
		});
		return;
	}

	if (teamname.length > common.TEAMNAME_MAX_CHARS) {
		res.send({
			success: 0,
			message: "STAHP PLS"
		});
		return;
	}

	if (!teamname.match(common.ASCII)) {
		res.send({
			success: 0,
			message: "Please enter ascii characters only."
		});
		return;
	}

	if (school.length == 0) {
		res.send({
			success: 0,
			message: "Please enter some characters."
		});
		return;
	}

	if (school.length > common.TEAMNAME_MAX_CHARS) {
		res.send({
			success: 0,
			message: "STAHP PLS"
		});
		return;
	}

	if (!school.match(common.ASCII)) {
		res.send({
			success: 0,
			message: "Please enter ascii characters only."
		});
		return;
	}

	common.db.collection("accounts").find({
		$or: [
			{ teamname: teamname },
			{ email: email }
		]
	}).count(function(err, count) {
		if (count != 0) {
			res.send({
				success: 0,
				message: "That team name or email is already registered."
			});
			return;
		} else {
			console.log("[api/accounts.js] inserting account");
			common.db.collection("accounts").insert({
				email: email.toString(),
				teamname: teamname.toString(),
				school: school.toString(),
				pass: common.encryptPass(pwd.toString()),
				group: 1,
				registerDate: moment().format()
			}, { w: 1 }, function(err, inserted) {
				console.dir(inserted);
				console.log("[api/account.js] inserted.");
				res.send({
					success: 1,
					message: "Yay! You just registered!"
				});
				return;
			});
		}
	});
};


text:
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="https://fonts.googleapis.com/css?family=Khula:400,700" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Titillium+Web:200,400" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Lato:300" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="./css/autotagjs.css">
    <link rel="stylesheet" type="text/css" href="./css/icons.css">

    <link rel="stylesheet" type="text/css" href="./css/demo.css">
    <link rel="stylesheet" type="text/css" href="./css/tooltip.css">

AutotagJS

            A simple and lightweight (~5kb zipped) open source text formatter plugin
            built in plain Javascript.

8

9

10

11

12

14

18

24

30

40

70

Bigger

Smaller

1.5

Normal

Double

Correction

Clear

                            ●  ○  ▪  ...

Clear

                            1. a. i. ...

                Build Your Own Text Editor

                autotag.js provides a simple and intuitive way to apply custom
                formatting to text under the cursor.

                Title

autotagjs is #awesome!

                Description

Try it on your +project #today.

                Supercharge your forms

                Highlight hashtags, validate text or perform other operation on
                user input with less code.

                Supports all major browsers

                AutotagJS works on all webkit based browsers (Chrome, Safari,
                Vivaldi), Firefox and (perhaps) Edge, on desktops and mobile devices.


text:
PREFIX                  ?= /usr
INCLUDE_DIR             = ${PREFIX}/include
LIBRARY_DIR             = ${PREFIX}/lib
export LIBRARY_NAME		= amqpcpp
export SONAME			= 4.3
export VERSION			= 4.3.18

all:
		$(MAKE) -C src all

pure:
		$(MAKE) -C src pure

release:
		$(MAKE) -C src release

static:
		$(MAKE) -C src static

shared:
		$(MAKE) -C src shared

clean:
		$(MAKE) -C src clean

install:
		mkdir -p ${INCLUDE_DIR}/$(LIBRARY_NAME)
		mkdir -p ${INCLUDE_DIR}/$(LIBRARY_NAME)/linux_tcp
		mkdir -p ${LIBRARY_DIR}
		cp -f include/$(LIBRARY_NAME).h ${INCLUDE_DIR}
		cp -f include/amqpcpp/*.h ${INCLUDE_DIR}/$(LIBRARY_NAME)
		cp -f include/amqpcpp/linux_tcp/*.h ${INCLUDE_DIR}/$(LIBRARY_NAME)/linux_tcp
		-cp -f src/lib$(LIBRARY_NAME).so.$(VERSION) ${LIBRARY_DIR}
		-cp -f src/lib$(LIBRARY_NAME).a.$(VERSION) ${LIBRARY_DIR}
		ln -s -f lib$(LIBRARY_NAME).so.$(VERSION) $(LIBRARY_DIR)/lib$(LIBRARY_NAME).so.$(SONAME)
		ln -s -f lib$(LIBRARY_NAME).so.$(VERSION) $(LIBRARY_DIR)/lib$(LIBRARY_NAME).so
		ln -s -f lib$(LIBRARY_NAME).a.$(VERSION) $(LIBRARY_DIR)/lib$(LIBRARY_NAME).a


text:
package ideal.machine.elements;

import ideal.library.elements.*;

import java.lang.reflect.Array;
import java.util.Arrays;

public class array<T> {
  private final T[] the_elements;
  public final int size;

  @SuppressWarnings("unchecked")
  public array(Class<T> the_type, int size) {
    the_elements = (T[]) Array.newInstance(the_type, size);
    this.size = size;
  }

  @SuppressWarnings("unchecked")
  public array(int size) {
    the_elements = (T[]) new Object[size];
    this.size = size;
  }

  public T get(int index) {
    return the_elements[index];
  }

  public reference<T> at(final int index) {
    return new reference<T>() {
      @Override
      public T get() {
        return the_elements[index];
      }

      @Override
      public void set(T new_value) {
        the_elements[index] = new_value;
      }
    };
  }

  public void set(int index, T value) {
    the_elements[index] = value;
  }

  public void move(int source, int destination, int length) {
    System.arraycopy(the_elements, source, the_elements, destination, length);
  }

  public void copy(int source_begin, array destination, int destination_begin, int length) {
    Object[] destination_elements = destination.the_elements;
    System.arraycopy(the_elements, source_begin, destination_elements, destination_begin, length);
  }

  public void scrub(int index, int length) {
    Arrays.fill(the_elements, index, index + length, null);
  }
}


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Empresa;

/**
 * EmpresaSearch represents the model behind the search form about `app\models\Empresa`.
 */
class EmpresaSearch extends Empresa
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'estado', 'cidade'], 'integer'],
            [['razao_social', 'cnpj', 'inscricao_estadual', 'inscricao_municipal', 'logradouro', 'numero', 'cep', 'bairro', 'telefone1', 'telefone2', 'email', 'site', 'logo', 'responsavel_id'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Empresa::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'estado' => $this->estado,
            'cidade' => $this->cidade,
        ]);

        $query->andFilterWhere(['like', 'razao_social', $this->razao_social])
            ->andFilterWhere(['like', 'cnpj', $this->cnpj])
            ->andFilterWhere(['like', 'inscricao_estadual', $this->inscricao_estadual])
            ->andFilterWhere(['like', 'inscricao_municipal', $this->inscricao_municipal])
            ->andFilterWhere(['like', 'logradouro', $this->logradouro])
            ->andFilterWhere(['like', 'numero', $this->numero])
            ->andFilterWhere(['like', 'cep', $this->cep])
            ->andFilterWhere(['like', 'bairro', $this->bairro])
            ->andFilterWhere(['like', 'telefone1', $this->telefone1])
            ->andFilterWhere(['like', 'telefone2', $this->telefone2])
            ->andFilterWhere(['like', 'email', $this->email])
            ->andFilterWhere(['like', 'site', $this->site])
            ->andFilterWhere(['like', 'logo', $this->logo])
            ->andFilterWhere(['like', 'responsavel_id', $this->responsavel_id]);

        return $dataProvider;
    }
}


text:
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)

CHECK_INCLUDE_FILE("stddef.h" HAVE_STDDEF_H)
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)

set (SSE_COMPILE_FLAGS "")
option(AIM_USE_SSE "Use SSE2/3 Instructions where possible." ON)
if (AIM_USE_SSE)
  if (NOT MSVC)
    set(CMAKE_REQUIRED_C_FLAGS_SAVE ${CMAKE_REQUIRED_C_FLAGS})
    set(CMAKE_REQUIRED_C_FLAGS ${CMAKE_REQUIRED_C_FLAGS} "-msse3")
    CHECK_INCLUDE_FILE("pmmintrin.h" HAVE_SSE3_H)
    set(CMAKE_REQUIRED_C_FLAGS ${CMAKE_REQUIRED_C_FLAGS_SAVE})
    if (HAVE_SSE3_H)
        set(HAVE_SSE2_H 1)
        if (CMAKE_COMPILER_IS_GNUCC)
            set (SSE_COMPILE_FLAGS "-msse3")
            message(STATUS "SSE3 Detected")
        endif()
    else()
        set (HAVE_SSE3_H 0)
    endif()

    if (NOT HAVE_SSE3_H)
        set(CMAKE_REQUIRED_C_FLAGS_SAVE ${CMAKE_REQUIRED_C_FLAGS})
        set(CMAKE_REQUIRED_C_FLAGS ${CMAKE_REQUIRED_C_FLAGS} "-msse2")
        CHECK_INCLUDE_FILE("emmintrin.h" HAVE_SSE2_H)
        set(CMAKE_REQUIRED_C_FLAGS ${CMAKE_REQUIRED_C_FLAGS_SAVE})
        if(HAVE_SSE2_H)
            if (CMAKE_COMPILER_IS_GNUCC)
                set (SSE_COMPILE_FLAGS "-msse2" PARENT_SCOPE)
                message(STATUS "SSE2 Detected")
            endif()
        else()
           set (HAVE_SSE2_H 0)
        endif()
    endif()
  else()
    set(CMAKE_REQUIRED_C_FLAGS_SAVE ${CMAKE_REQUIRED_C_FLAGS})
    set(CMAKE_REQUIRED_C_FLAGS ${CMAKE_REQUIRED_C_FLAGS} "/arch:SSE2")
    CHECK_INCLUDE_FILE("intrin.h" HAVE_INTRIN_H)
    set(CMAKE_REQUIRED_C_FLAGS ${CMAKE_REQUIRED_C_FLAGS_SAVE})
    if (HAVE_INTRIN_H)
        set (SSE_COMPILE_FLAGS " /arch:SSE2 " PARENT_SCOPE)
    else()
        set (HAVE_INTRIN_H 0)
    endif()
  endif()
endif()


text:
package org.olat.core.id;

import java.util.Locale;
import java.util.Map;

/**
 * Description:
 *

 * The user represents a real world user with the following elements:
 *

 *
profile: a list of user properties

 *
preferences: a list of user settings

 *

 *

 *
 * @author Florian Gnägi
 */
public interface User extends CreateInfo, Persistable {

	/**
	 * Get the users prefereces object
	 *
	 * @return The users preferences object
	 */
	public Preferences getPreferences();

	/**
	 * Set the users prefereces
	 *
	 * @param prefs The users new preferences
	 */
	public void setPreferences(Preferences prefs);

	/**
	 * Set the value for the given user property identifyer
	 *
	 * @param propertyName The user property identifyer
	 * @param propertyValue The new value or NULL if no value is used
	 */
	public void setProperty(String propertyName, String propertyValue);

	/**
	 * Get a user property value for the given property identifyer. The local
	 * might be used to format the returned value if it is an internationalized
	 * value
	 *
	 * @param propertyName The user property identifyer
	 * @param locale The locale used for proper display or NULL if the default
	 *          locale should be used. In many cases it is ok to use NULL in any
	 *          case, e.g. the users firstname will not be internationalized in
	 *          anyway. Make sure you use a locale whenever you query for a date
	 *          property.
	 * @return The value or NULL if no value is set
	 */
	public String getProperty(String propertyName, Locale locale);

	/**
	 * internal use only.
	 * @param identEnvAttribs
	 */
	public void setIdentityEnvironmentAttributes(Map<String,String> identEnvAttribs);
	/**
	 * returns the property value, which is looked up first in the db stored user properties and if not available there, if it can be found in the
	 * volatile identity attributes which get set once per session during the login process.
	 *

	 * Usage so far is during Shibboleth Login (ShibbolethDispatcher), where the shibboleth attributes are extracted and set in the identity environment.
	 *
	 * @since introducing user tracking it was needed to expose the volatile identity environments attribute also in the user for the UserActivityLogger(Impl).
	 * @param next
	 * @param locale
	 * @return
	 */
	public String getPropertyOrIdentityEnvAttribute(String propertyName, Locale locale);

}


text:
'use strict';

var path = require('path');
var helper = module.exports = {};

// Returns boolean whether filepath is dir terminated
helper.isDir = function isDir(dir) {
  if (typeof dir !== 'string') { return false; }
  return (dir.slice(-(path.sep.length)) === path.sep) || (dir.slice(-1) === '/');
};

// Create a `key:[]` if doesnt exist on `obj` then push or concat the `val`
helper.objectPush = function objectPush(obj, key, val) {
  if (obj[key] == null) { obj[key] = []; }
  if (Array.isArray(val)) { obj[key] = obj[key].concat(val); }
  else if (val) { obj[key].push(val); }
  return obj[key] = helper.unique(obj[key]);
};

// Ensures the dir is marked with path.sep
helper.markDir = function markDir(dir) {
  if (typeof dir === 'string' &&
    dir.slice(-(path.sep.length)) !== path.sep &&
    dir !== '.') {
    dir += path.sep;
  }
  return dir;
};

// Changes path.sep to unix ones for testing
helper.unixifyPathSep = function unixifyPathSep(filepath) {
  return (process.platform === 'win32') ? String(filepath).replace(/\\/g, '/') : filepath;
};

// Converts a flat list of paths to the old style tree
helper.flatToTree = function flatToTree(files, cwd, relative, unixify, done) {
  cwd = helper.markDir(cwd);
  var tree = Object.create(null);

  helper.forEachSeries(files, function(filepath, next) {
    var parent = path.dirname(filepath) + path.sep;

    // If parent outside cwd, ignore
    if (path.relative(cwd, parent) === '..') {
      return next();
    }

    // If we want relative paths
    if (relative === true) {
      if (path.resolve(parent) === path.resolve(cwd)) {
        parent = './';
      } else {
        parent = path.relative(cwd, parent) + path.sep;
      }
      filepath = path.relative(path.join(cwd, parent), filepath) + (helper.isDir(filepath) ? path.sep : '');
    }

    // If we want to transform paths to unix seps
    if (unixify === true) {
      filepath = helper.unixifyPathSep(filepath);
      if (parent !== './') {
        parent = helper.unixifyPathSep(parent);
      }
    }

    if (!parent) { return next(); }

    if (!Array.isArray(tree[parent])) {
      tree[parent] = [];
    }
    tree[parent].push(filepath);
    next();
  }, function() {
    done(null, tree);
  });
};

/**
 * Lo-Dash 1.0.1 <http://lodash.com/>
 * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
 * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
 * Available under MIT license <http://lodash.com/license>
 */
helper.unique = function unique() { var array = Array.prototype.concat.apply(Array.prototype, arguments); var result = []; for (var i = 0; i < array.length; i++) { if (result.indexOf(array[i]) === -1) { result.push(array[i]); } } return result; };

/**
 * Copyright (c) 2010 Caolan McMahon
 * Available under MIT license <https://raw.github.com/caolan/async/master/LICENSE>
 */
helper.forEachSeries = function forEachSeries(arr, iterator, callback) {
  callback = callback || function () {};
  if (!arr.length) {
    return callback();
  }
  var completed = 0;
  var iterate = function () {
    iterator(arr[completed], function (err) {
      if (err) {
        callback(err);
        callback = function () {};
      }
      else {
        completed += 1;
        if (completed >= arr.length) {
          callback(null);
        } else {
          iterate();
        }
      }
    });
  };
  iterate();
};


text:
<?php

use Eloquent\Phony\Peridot\PeridotPhony;
use Evenement\EventEmitterInterface;
use Peridot\Console\Environment;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\ReporterInterface;

return function (EventEmitterInterface $emitter) {
    PeridotPhony::install($emitter);

    $reporter = new CodeCoverageReporters($emitter);
    $reporter->register();

    $emitter->on('peridot.start', function (Environment $environment) {
        $environment->getDefinition()->getArgument('path')
            ->setDefault('test/suite');
    });

    $emitter->on('code-coverage.start', function (ReporterInterface $reporter) {
        $reporter->addDirectoryToWhitelist(__DIR__ . '/src');
    });
};


text:
package com.divae.paralleltestrunner;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import java.util.concurrent.atomic.AtomicInteger;

import org.junit.AfterClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;

@RunWith(ParallelTestRunner.class)
@ContextConfiguration
public class ParallelTestRunnerTest {

	private static AtomicInteger firstCounter = new AtomicInteger();
	private static AtomicInteger secondCounter = new AtomicInteger();

	@Test
	public void firstTestMethod() throws InterruptedException {
		firstCounter.incrementAndGet();
	}

	@Test
	public void secondTestMethod() throws InterruptedException {
		secondCounter.incrementAndGet();
	}

	@AfterClass
	public static void assertCounters() {
		assertThat(firstCounter.get(), is(15));
		assertThat(secondCounter.get(), is(15));
	}

}


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

/**
 * @fileoverview
 * @suppress {reportUnknownTypes}
 */
const closureLintPlugin = /** @const {!ESLint.Config} */ (
    require('eslint-plugin-closure'));
const closureConfigBase = /** @const {!ESLint.Config} */ (
    require('eslint-config-closure-base'));
const closureConfigEs5 = /** @const {!ESLint.Config} */ (
    require('eslint-config-closure-es5'));
const closureConfigEs6 = /** @const {!ESLint.Config} */ (
    require('eslint-config-closure-es6'));

if (process.env.NODE_ENV === 'development') {
  require('../index.html');
}

/** @type {!CM.Doc} */
let EDITOR;
const CSS_CLASS_WARNING = 'cm__lint-warning';
const CSS_CLASS_ERROR = 'cm__lint-error';
const GUTTER_NAME = 'cm-gutter-container';
const SINGLE_COLUMN_RULES = {
  'closure/indent': true,
  'dot-location': true,
  'dot-notation': true,
  'eol-last': true,
  'no-empty': true,
  'no-extra-parens': true,
  'no-extra-semi': true,
  'no-irregular-whitespace': true,
  'no-regex-spaces': true,
  'semi': true,
}
/** @typedef {{
 *    base: !ESLint.Config,
 *    es5: !ESLint.Config,
 *    es6: !ESLint.Config,
 * }}
 */
let ConfigMap;

class Editor {
  /**
   *
   * @param {!ESLint.Linter} linter
   * @param {!CM.Object} CodeMirror
   * @param {!HTMLTextAreaElement} textArea
   * @param {!ConfigMap} configs
   */
  constructor(linter, CodeMirror, textArea, configs) {
    this.codeMirrorDoc = CodeMirror.fromTextArea(textArea, {
      mode: 'javascript',
      lineNumbers: true,
      gutters: [GUTTER_NAME],
    });
    this.linter = linter;

    this.eslintMessages = [];

    this.resultsNode = /** @type {!HTMLUlElement} */ (
        document.getElementById('results'));
    if (!this.resultsNode) {
      throw new Error('Can\'t find #results element.');
    }

    const prefixedClosureRules = {};
    Object.keys(closureLintPlugin.rules).forEach(ruleId => {
      const prefixedRuleId = 'closure/' + ruleId;
      prefixedClosureRules[prefixedRuleId ] = closureLintPlugin.rules[ruleId];
    });

    this.linter.defineRules(prefixedClosureRules);

    const debouncedVerifyCode = debounce(() => {
      this.verifyAndDisplayCode();
    }, 500);

    this.configMap = {
      es5: mergeRules(configs.base, configs.es5),
      es6: mergeRules(configs.base, configs.es6),
    }
    this.setConfig('es6');

    debouncedVerifyCode();
    this.codeMirrorDoc.on('change', debouncedVerifyCode);

  }

  fixAll() {
    const {messages, output} = applyFixes(this.getValue(), this.eslintMessages);
    this.codeMirrorDoc.setValue(output);
    this.displayLintResults(messages);
  }

  /**
   * @return {!Array<!ESLint.LintMessage>}
   */
  verifyCode() {
    const content = this.codeMirrorDoc.getValue();
    const messages = this.linter.verify(content, this.eslintConfig);
    this.eslintMessages = messages.map(
        msg => this.codeMirrorifyEslintMessage(msg));
    this.eslintMessagesByLine = this.groupMessagesByLine(this.eslintMessages);
    return this.eslintMessages;
  }

  verifyAndDisplayCode() {
    this.clearAllErrors();
    const results = this.verifyCode();
    this.displayLintResults(results);
  }

  setConfig(configKey) {
    this.eslintConfig = this.configMap[configKey];
    this.toggleConfigButton(configKey);
    this.verifyAndDisplayCode();
  }

  toggleConfigButton(configKey) {
    const es5Button = document.getElementById('es5Button');
    const es6Button = document.getElementById('es6Button');
    if (!es5Button || !es6Button) {
      throw new Error('Can\'t find buttons');
    }
    const buttonHighlight = 'mdl-button--accent';
    switch (configKey) {
      case 'es5':
        es5Button.classList.add(buttonHighlight);
        es6Button.classList.remove(buttonHighlight);
        break;

      case 'es6':
        es6Button.classList.add(buttonHighlight);
        es5Button.classList.remove(buttonHighlight);
        break;

      default:
        throw new Error('Unrecoginized config key, use es5 or es6.');
    }
  }

  /**
   * Modifies an ESLint message into code mirror friendly conventions:
   * - 0-based indexing
   * - computes a reasonable end-column and end-line.
   * @param {!ESLint.LintMessage} msg
   * @return {!ESLint.LintMessage}
   */
  codeMirrorifyEslintMessage(msg) {
    msg.line--;
    const sourceLine = this.codeMirrorDoc.getLine(msg.line);
    msg.column = Math.min(sourceLine.length - 1, msg.column - 1);
    msg.endLine = msg.endLine ? message.endLine - 1 : msg.line;
    msg.endColumn = this.findEndColumn(msg);
    return msg;
  }

  /**
   * Figures out where message should end, exclusive.
   * Most ESLint rules don't return a range, so we only highlight one character.
   * For most rules, we should highlight at least the next word.
   * @param {!ESLint.LintMessage} msg
   */
  findEndColumn(msg) {
    const line = msg.line;
    const column = msg.column;
    if (SINGLE_COLUMN_RULES[msg.ruleId]) {
      return column + 1;
    }

    const content = this.codeMirrorDoc.getLine(line);
    const nextContent = content.slice(column + 1);
    let spanLength = 1;
    const matches = nextContent.match(/\w+/);
    if (matches) {
      spanLength = matches[0].length;
    }
    return column + 1 + spanLength;
  }

  groupMessagesByLine(messages) {
    const msgByLine = {};
    messages.forEach(msg => {
      const line = msg.line;
      msgByLine[line] = msgByLine[line] || [];
      msgByLine[line].push(msg);
    });
    return msgByLine;
  }

  getValue() {
    return this.codeMirrorDoc.getValue();
  }

  /**
   * Creates list of HTML lint results.
   * @param {!Array<!ESLint.LintMessage>} results
   */
  displayLintResults(messages) {
    this.resultsNode.innerHTML = "";

    if (messages.length === 0) {
      this.resultsNode.innerHTML("
Lint Free!
");
      return;
    }

    messages.forEach(message => {
      this.resultsNode.appendChild(this.makeResultNode(message));
    });

    this.markAllErrors(messages);
    this.markAllGutters(messages);
  }

  /**
   * Transform an individual ESLint message to an HTML node.
   * @param {!ESLint.LintMessage} message
   * @return {!HTMLDivElement}
   */
  makeResultNode(message) {
    const elem = /** @type {!HTMLLiElement} */ (document.createElement('li'));

    elem.classList.add('mdl-list__item');

    if (message.fatal) {
      elem.classList.add('lint-result__fatal');
    }
    if (message.severity == 1) {
      elem.classList.add('list-result__warning');
    } else {
      elem.classList.add('lint-result__error');
    }

    const lintMessage = `
${message.line + 1}:${message.column + 1} - ${message.message} (${message.ruleId})`
    elem.innerHTML = lintMessage;
    return elem;
  }

  clearAllErrors() {
    this.codeMirrorDoc.getAllMarks().forEach(mark => mark.clear());
    this.codeMirrorDoc.clearGutter(GUTTER_NAME);
  }

  markError(lintMessage) {
    const markStart = {line: lintMessage.line, ch: lintMessage.column};
    const markEnd = {line: lintMessage.endLine, ch: lintMessage.endColumn};
    const markOptions = {className: messageSeverityCssClass(lintMessage)};
    this.codeMirrorDoc.markText(markStart, markEnd, markOptions);
  }

  markAllErrors(lintMessages) {
    this.clearAllErrors();
    lintMessages.forEach(msg => this.markError(msg));
  }

  markAllGutters(messages) {
    this.codeMirrorDoc.clearGutter(GUTTER_NAME);
    const msgByLine = this.groupMessagesByLine(messages);
    Object.keys(msgByLine).forEach(line => {
      const messages = msgByLine[line];
      const gutterLineElem = document.createElement('span');
      gutterLineElem.textContent = '●';
      messages.forEach(msg => {
        const gutterClassName = msg.severity == 2 ? 'cm-gutter__error' :
              'cm-gutter__warning';
        gutterLineElem.classList.add(gutterClassName);
      });
      this.codeMirrorDoc.setGutterMarker(
          Number(line), GUTTER_NAME, gutterLineElem);
    });
  }

}

/**
 * Returns the CSS class for eslintMessage's severity
 * @param {!ESLint.LintMessage} eslintMessage
 * @return {string}
 */
function messageSeverityCssClass(eslintMessage) {
  if (eslintMessage.severity == 2) {
    return CSS_CLASS_ERROR;
  } else {
    return CSS_CLASS_WARNING;
  }
}

/**
 * Creates a new ESLint config by merging a and b.  b overwrites a.
 * @param {!ESLint.Config} a
 * @param {!ESLint.Config} b
 * @return {!ESLint.Config}
 */
function mergeRules(a, b) {
  const combinedRule = {
    rules: {},
    parserOptions: {},
    settings: {},
    env: {},
    globals: {},
  };
  Object.assign(combinedRule.rules,
                a.rules || {}, b.rules || {});
  Object.assign(combinedRule.parserOptions,
                a.parserOptions || {}, b.parserOptions || {});
  Object.assign(combinedRule.settings,
                a.settings || {}, b.settings || {});
  Object.assign(combinedRule.env,
                a.env || {}, b.env || {});
  Object.assign(combinedRule.globals,
                a.globals || {}, b.globals || {});
  combinedRule.parser = b.parser || a.parser;
  return combinedRule;
}

/**
 * Debounces a function.
 * @param {!Function} func
 * @param {number} wait
 * @param {boolean=} immediate
 * @return {!Function}
 * @suppress {newCheckTypes,reportUnknownTypes}
 */
function debounce(func, wait, immediate) {
  let timeout;
  return function() {
    const context = this;
    const args = arguments;
    const later = function() {
      timeout = null;
      if (!immediate) func.apply(context, args);
    };
    const callNow = immediate && !timeout;
    clearTimeout(timeout);
    timeout = setTimeout(later, wait);
    if (callNow) func.apply(context, args);
  };
}

/**
 * Compares items in a messages array by range.
 * @param {!ESLint.LintMessage} a The first message.
 * @param {!ESLint.LintMessage} b The second message.
 * @returns {number} -1 if a comes before b, 1 if a comes after b, 0 if equal.
 */
function compareMessagesByFixRange(a, b) {
  return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1];
}

/**
 * Applies the fixes specified by the messages to the given text. Tries to be
 * smart about the fixes and won't apply fixes over the same area in the text.
 * @param {text} text
 * @param {!Array<!ESLint.LintMessage>} messages
 * @returns {Object} An object containing the fixed text and any unfixed messages.
 */
function applyFixes(text, messages) {
  const remainingMessages = [];
  const fixableMessages = [];

  let lastPos = Number.NEGATIVE_INFINITY;
  let output = "";

  messages.forEach(message => {
    if (message.hasOwnProperty("fix")) {
      fixableMessages.push(message);
    } else {
      remainingMessages.push(message);
    }
  });
  fixableMessages.sort(compareMessagesByFixRange);
  for (const fixableMessage of fixableMessages) {
    const fix = fixableMessage.fix;
    const start = fix.range[0];
    const end = fix.range[1];

    // Keep this message if it overlaps or has a negative range.
    if (lastPos >= start || start > end) {
      remainingMessages.push(fixableMessage);
      continue;
    }

    output += text.slice(Math.max(0, lastPos), Math.max(0, start));
    output += fix.text;
    lastPos = end;
  }
  output += text.slice(Math.max(0, lastPos));

  const anyFixes = fixableMessages.length > 0;
  return {
    fixed: anyFixes,
    messages: remainingMessages,
    output,
  };

};

function setupEditor() {
  /** @const {!ESLint.Linter} */
  const linter = /** @type {!ESLint.Linter} */ (window['eslint']);

  /** @const {!CM.Object} */
  const CodeMirror = /** @type {!CM.Object} */ (window['CodeMirror']);

  const editorTextArea = /** @type {!HTMLTextAreaElement} */ (
      document.getElementById('editor'));

  const configs = {
    base: closureConfigBase,
    es5: closureConfigEs5,
    es6: closureConfigEs6,
  }
  const editor = new Editor(linter, CodeMirror, editorTextArea, configs);
  window['EDITOR'] = editor;
}

document.addEventListener('DOMContentLoaded', setupEditor);


text:
<?php

namespace Respect\Validation\Rules;

/**
 * @group  rule
 * @covers Respect\Validation\Rules\Alnum
 * @covers Respect\Validation\Exceptions\AlnumException
 */
class AlnumTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider providerForValidAlnum
     */
    public function testValidAlnumCharsShouldReturnTrue($validAlnum, $additional)
    {
        $validator = new Alnum($additional);
        $this->assertTrue($validator->validate($validAlnum));
    }

    /**
     * @dataProvider providerForInvalidAlnum
     * @expectedException Respect\Validation\Exceptions\AlnumException
     */
    public function testInvalidAlnumCharsShouldThrowAlnumExceptionAndReturnFalse($invalidAlnum, $additional)
    {
        $validator = new Alnum($additional);
        $this->assertFalse($validator->validate($invalidAlnum));
        $this->assertFalse($validator->assert($invalidAlnum));
    }

    /**
     * @dataProvider providerForInvalidParams
     * @expectedException Respect\Validation\Exceptions\ComponentException
     */
    public function testInvalidConstructorParamsShouldThrowComponentExceptionUponInstantiation($additional)
    {
        $validator = new Alnum($additional);
    }

    /**
     * @dataProvider providerAdditionalChars
     */
    public function testAdditionalCharsShouldBeRespected($additional, $query)
    {
        $validator = new Alnum($additional);
        $this->assertTrue($validator->validate($query));
    }

    public function providerAdditionalChars()
    {
        return [
            ['!@#$%^&*(){}', '!@#$%^&*(){} abc 123'],
            ['[]?+=/\\-_|"\',<>.', "[]?+=/\\-_|\"',<>. \t \n abc 123"],
        ];
    }

    public function providerForInvalidParams()
    {
        return [
            [new \stdClass()],
            [[]],
            [0x2],
        ];
    }

    public function providerForValidAlnum()
    {
        return [
            ['alganet', ''],
            ['alganet', 'alganet'],
            ['0alg-anet0', '0-9'],
            ['1', ''],
            ["\t", ''],
            ["\n", ''],
            ['a', ''],
            ['foobar', ''],
            ['rubinho_', '_'],
            ['google.com', '.'],
            ['alganet alganet', ''],
            ["\nabc", ''],
            ["\tdef", ''],
            ["\nabc \t", ''],
            [0, ''],
        ];
    }

    public function providerForInvalidAlnum()
    {
        return [
            ['', ''],
            ['@#$', ''],
            ['_', ''],
            ['dgç', ''],
            [1e21, ''], //evaluates to "1.0E+21"
            [null, ''],
            [new \stdClass(), ''],
            [[], ''],
        ];
    }
}


text:
"use strict";
const debug = require('debug');
const log = debug('TelegramBotApi:more');
const events_1 = require('./events');
log('init');
/**
 * @class TelegramBotApi
 */
class TelegramBotApi extends events_1.default {
    /**
     * Create a TelegramBotApi
     * @param {string} token
     * @param {Object} options
     */
    constructor(token, options) {
        super(token, options);
        /**
         * Array of onMessage listeners
         * @private
         */
        this._onMsgListenerArray = [];
        /**
         * last _onMsgListenerArray item.id
         * @private
         */
        this._onMsgLastId = 0;
        this.on('update.message.text', this._onMsg.bind(this));
        log('constructor');
    }
    /**
     * Make loop on _onMsgListenerArray and if callBackFn return false break the loop
     * @private
     * @param {Function} callBackFn
     */
    _onMsgListenerLoop(callBackFn) {
        // log('_onMsgListenerLoop', callBackFn);
        let i = 0;
        let len = this._onMsgListenerArray.length;
        for (; i < len; i++) {
            // log(`_onMsgListenerLoop i`, callBackFn);
            if (callBackFn(this._onMsgListenerArray[i], i) === false)
                break;
        }
    }
    /**
     * Check patterns and call listeners
     * called when 'update.message.text' receive
     * @private
     * @param {any} msg
     */
    _onMsg(msg) {
        // log(`_onMsg: ${msg.text}`);
        this._onMsgListenerLoop((item) => {
            // log(item.pattern);
            if (item.pattern && item.pattern.test && item.pattern.test(msg.text)) {
                if (typeof item.listener === 'function') {
                    return item.listener(msg);
                }
            }
        });
    }
    /**
     * Make 'update.message.text' event on special regular expersion pattern
     * @param {RegExp} pattern
     * @param {Function} listener
     * @return {number} event id
     */
    onMessage(pattern, listener) {
        this._onMsgListenerArray.push({
            id: ++this._onMsgLastId,
            pattern: pattern,
            listener: listener
        });
        log(`onMessage (#${this._onMsgLastId})`, pattern);
        return this._onMsgLastId;
    }
    offMessage(id) {
        log(`offMessage (#${id})`);
        let removed = false;
        this._onMsgListenerLoop((item, index) => {
            if (item.id === id) {
                this._onMsgListenerArray.splice(index, 1);
                removed = true;
                return false; // break the loop;
            }
        });
        return removed;
    }
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = TelegramBotApi;


text:
"""
The SyncBox API will handle all actions and such that need be performed
by the SyncBox application.

"""

class SyncAPI(object):
    """
    API for SyncBox, and the _only_ way to execute commands and access the
    SyncBox internals.

    The instances has a shared state, because there is no need to have multiple
    states.

    """

    __state = {
        '_watchList': {}
    }

    def __init__(self):
        """
        Instantiate and set up the API object.

        Since the object should always share it's state, we set the __dict__
        variable to the class variable __state.

        """
        self.__dict__ = self.__state

    @property
    def watchList(self):
        """Getter for the watchList attribute"""
        return self._watchList

    @watchList.setter
    def watchList(self, value):
        """Getter for the watchList attribute"""
        self._watchList = value

    def crawlDirectory(self, path):
        """
        Crawl a directory and return a dictionary with files and their data
        """
        pass

    def watchDirectory(self, path):
        """Add a directory to the watch list"""
        pass

    def watchFile(self, filePath):
        """Add a file to the watch list"""
        pass


text:
require_relative 'errors'

module VagrantPlugins
  module Fabric
    class Provisioner < Vagrant.plugin("2", :provisioner)
      def provision
        ssh = @machine.ssh_info
        command = ['fab', '-i', ssh[:private_key_path], '-u', ssh[:username]]
        if config.uses_dynamic_port
          command << '--port' << ssh[:port].to_s
        end
        if config.args
          config.args.each do |arg|
            command << arg
          end
        end
        @machine.ui.info(command.join(' '), :color => :green)

        # Write stdout and stderr data, since it's the regular Fabric output
        command << {
          :notify => [:stdout, :stderr]
        }

        begin
          result = Vagrant::Util::Subprocess.execute(*command) do |type, data|
            if type == :stdout || type == :stderr
              @machine.env.ui.info(data, :new_line => false, :prefix => false)
            end
          end

          raise Vagrant::Errors::FabricFailed if result.exit_code != 0
        rescue Vagrant::Util::Subprocess::LaunchError,
            Vagrant::Errors::CommandUnavailable,
            Vagrant::Errors::CommandUnavailableWindows
          raise Vagrant::Errors::FabricAppNotFound
        end
      end
    end
  end
end


text:
Thanks for (thinking about) contributing to Gekko, all help is wanted!

## Before Submitting an Issue

First, please do a search in [open issues](https://github.com/askmike/gekko/issues/) to see if the issue or feature request has already been filed.

If you find your issue already exists, make relevant comments and add your reaction:

👍 - upvote

👎 - downvote

If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.

### Submitting an issue (bug)

* Be as clear and concise as possible.
* Do not submit more than one bug in a single issue.
* Clearly explain the following:

1. Action taken (what you did)
2. Expected result (what you hoped would happen)
3. Actual result (unexpected outcome)
4. Your setup (any and all relevant technical facts, error messages, logs, etc)

### Feature requests

* First consider if **you** yourself might be able to work on the feature?  If so, check out info on contributing code below.
* If you do not have the skills, then please take the time to clearly think through the request. Is is appropriate for all users of Gekko?  If so, create a new issue containing the following:

1. Write `[request]` as the first item in the title, followed by a short, concise description, eg: `[request] Export data to CSV`.
2. Fill in details explaining your request.  Be as clear and concise as possible and only 1 request at a time.
3. Add mock-ups, etc as needed to clearly demonstrate the idea.

## New Feature and code contributions

- If you want to add an exchange to Gekko, see [this doc](https://github.com/askmike/gekko/blob/develop/docs/internals/exchanges.md) for all the information you need.
- If you want to Gekko react to anything from the market, you can most likely put this functionality into a plugin. See [this document](https://github.com/askmike/gekko/blob/develop/docs/internals/plugins.md) for details.
- If you want to add trading strategies / indicators, please see [this document](https://github.com/askmike/gekko/blob/develop/docs/trading_bot/creating_a_trading_method.md).
- If you just want to work on Gekko, you can use the open issues with the tag `open-for-pulls` for inspiration.
- If you want to work on the web interface (Gekko UI), please see [this frontend doc](https://github.com/askmike/gekko/blob/develop/docs/internals/gekko_ui.md) on the Vue.js frontend.

Things to take into consideration when submitting a pull request:

 - Please submit all pull requests (except for hotfixes) to the [develop branch](https://github.com/askmike/gekko/tree/develop).
 - Please keep current code styling in mind.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.wicket.spring.injection.annot (Wicket Parent 1.5.7 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.wicket.spring.injection.annot package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.apache.wicket.spring.injection.annot

This package contains all the classes to make your wicket components and other pojos @SpringBean annotation aware.

See:

          Description

Class Summary

AnnotProxyFieldValueFactory
IFieldValueFactory that uses LazyInitProxyFactory to create proxies for Spring
 dependencies based on the SpringBean annotation applied to a field.

SpringComponentInjector
IComponentInstantiationListener that injects component properties annotated with
 SpringBean annotations.

Annotation Types Summary

SpringBean
Annotation used to tag a field as a placeholder for a spring bean.

Package org.apache.wicket.spring.injection.annot Description

This package contains all the classes to make your wicket components and other pojos @SpringBean annotation aware.

To setup automatic injection of wicket components in your application subclass init() method call:

addComponentInstantiationListener(new SpringComponentInjector(this));

To inject any pojo call InjectorHolder.getInjector().inject(this) in the pojo's constructor.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.


text:
var _ = require('lodash');

module.exports = function convertPrivateClassesToInterfaces() {
  return function(exportDocs, addInjectableReference) {
    _.forEach(exportDocs, function(exportDoc) {

      // Search for classes with a constructor marked as `@internal`
      if (exportDoc.docType === 'class' && exportDoc.constructorDoc && exportDoc.constructorDoc.internal) {

        // Convert this class to an interface with no constructor
        exportDoc.docType = 'interface';
        exportDoc.constructorDoc = null;

        if (exportDoc.heritage) {
          // convert the heritage since interfaces use `extends` not `implements`
          exportDoc.heritage = exportDoc.heritage.replace('implements', 'extends');
        }

        if (addInjectableReference) {
          // Add the `declare var SomeClass extends InjectableReference` construct
          exportDocs.push({
            docType: 'var',
            name: exportDoc.name,
            id: exportDoc.id,
            returnType: 'InjectableReference'
          });
        }
      }
    });
  };
};


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="res/img/favicon.png" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdn.rawgit.com/itotallyrock/MusePlayer/9da71c923678d24565090597d16431a4138b15d7/res/css/main.css">

    <link rel="stylesheet" href="/res/css/music.css">

    <title>Muse Player</title>

An Unknown Error Has Occured.

Please refresh to continue Refresh.

MusePlayer

            <input type="text" class="searchBox" placeholder="Type to Search">

×

Current Song:

Untitled Track


text:
#include "ConfigDescription.h"
#include "filter/ConfigFilter.h"

#include <androidfw/ResourceTypes.h>

namespace aapt {

void AxisConfigFilter::addConfig(ConfigDescription config) {
    uint32_t diffMask = ConfigDescription::defaultConfig().diff(config);

    // Ignore the version
    diffMask &= ~android::ResTable_config::CONFIG_VERSION;

    // Ignore any densities. Those are best handled in --preferred-density
    if ((diffMask & android::ResTable_config::CONFIG_DENSITY) != 0) {
        config.density = 0;
        diffMask &= ~android::ResTable_config::CONFIG_DENSITY;
    }

    mConfigs.insert(std::make_pair(config, diffMask));
    mConfigMask |= diffMask;
}

bool AxisConfigFilter::match(const ConfigDescription& config) const {
    const uint32_t mask = ConfigDescription::defaultConfig().diff(config);
    if ((mConfigMask & mask) == 0) {
        // The two configurations don't have any common axis.
        return true;
    }

    uint32_t matchedAxis = 0;
    for (const auto& entry : mConfigs) {
        const ConfigDescription& target = entry.first;
        const uint32_t diffMask = entry.second;
        uint32_t diff = target.diff(config);
        if ((diff & diffMask) == 0) {
            // Mark the axis that was matched.
            matchedAxis |= diffMask;
        } else if ((diff & diffMask) == android::ResTable_config::CONFIG_LOCALE) {
            // If the locales differ, but the languages are the same and
            // the locale we are matching only has a language specified,
            // we match.
            if (config.language[0] &&
                    memcmp(config.language, target.language, sizeof(config.language)) == 0) {
                if (config.country[0] == 0) {
                    matchedAxis |= android::ResTable_config::CONFIG_LOCALE;
                }
            }
        } else if ((diff & diffMask) == android::ResTable_config::CONFIG_SMALLEST_SCREEN_SIZE) {
            // Special case if the smallest screen width doesn't match. We check that the
            // config being matched has a smaller screen width than the filter specified.
            if (config.smallestScreenWidthDp != 0 &&
                    config.smallestScreenWidthDp < target.smallestScreenWidthDp) {
                matchedAxis |= android::ResTable_config::CONFIG_SMALLEST_SCREEN_SIZE;
            }
        }
    }
    return matchedAxis == (mConfigMask & mask);
}

} // namespace aapt


text:
package lc.largestdivisiblesubset;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/*
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or Sj % Si = 0.

If there are multiple solutions, return any subset is fine.

Example 1:

nums: [1,2,3]

Result: [1,2] (of course, [1,3] will also be ok)
Example 2:

nums: [1,2,4,8]

Result: [1,2,4,8]
*/

public class Solution {
  // this alg is in form of greedy, but doesn't work...We need DP to keep
  // all the information
  public List<Integer> largestDivisibleSubset(int[] nums) {
    List<Integer> list = new LinkedList<>();
    if (nums == null || nums.length == 0) return list;
    else if (nums.length == 1) {
      list.add(nums[0]);
      return list;
    }
    // list holding sets
    List<Set<Integer>> sets = new ArrayList<>();

    // the following nested for loops can cause problems!
    for (int num : nums) {
      // need to taverse every existing set in the sets, if it cannot be added to any set, then
      // create a new set to hold it
      boolean addedToSet = false;
      for (int i = 0; i < sets.size(); i ++) {
        boolean canAddToSet = true;
        for (Integer j : sets.get(i)) {
          if (j % num != 0 && num % j != 0) {
            canAddToSet = false;
            break;
          }
        }

        if (canAddToSet) {
          sets.get(i).add(num);
          addedToSet = true;
        }
      }

      if (!addedToSet) {
        // need to create a new set to hold the number
        HashSet<Integer> set = new HashSet<>();
        set.add(num);
        sets.add(set);
      }
    }
    // finally inspect each set in sets and pick the one with largest size
    int max_size = Integer.MIN_VALUE;
    int max_index = -1;
    for (int i = 0; i < sets.size(); i ++) {
      HashSet<Integer> set = (HashSet<Integer>)sets.get(i);
      if (set.size() > max_size) {
        max_size = set.size();
        max_index = i;
      }
    }

    // finally load the integers into list
    for (Integer i : sets.get(max_index)) list.add(i);
    return list;
  }

  /*
    Credit to the post http://dartmooryao.blogspot.com/2016/06/leetcode-368-largest-divisible-subset.html
    The problem is actually a variant of Longest Increasing Subsequence problem.

    Time complexity: O(n^2), space: O(k), where k is the length of the max subsequence if ignore
    resulting list
  */
  public List<Integer> largestDivisibleSubset2(int[] nums) {
    if (nums == null || nums.length == 0) return new LinkedList<Integer>();
    // map to keep track of the path
    Map<Integer, Integer> map = new HashMap<>();
    // sort the array so that we don't need to inspect all possible pairs
    // hence more efficient
    Arrays.sort(nums);
    // array to keep track of length of qualified sequence
    int [] counts = new int[nums.length];
    // fill all the entries in array with a specified value (the shortest
    // qualified sequence has length 1)
    Arrays.fill(counts, 1);
    int maxLen = 0;
    int maxIdx = 0;

    // move front from backward
    for (int i = nums.length - 1; i >= 0; i --) {
      // move from nums[i + 1] to tail
      for (int j = i + 1; j < nums.length; j ++) {
        if (nums[j] % nums[i] == 0) { // only need one-way comparision
          if (counts[i] < counts[j] + 1) {
            counts[i] = counts[j] + 1;
            // keep track of path, use index(unique)
            // This is a very useful technique!
            map.put(i, j);
          }
        }
      }
      // then compare the counts[i] with the max length of qualified
      // sequence we found, if larger than update max length
      if (counts[i] > maxLen) {
        maxLen = counts[i];
        maxIdx = i;
      }
    }

    // restore the path using map
    List<Integer> re = new ArrayList<>();
    Integer idx = maxIdx; // note maxIdx is the start point of the path
    while (idx != null) {
      re.add(nums[idx]);
      idx = map.get(idx); // Take heed on such technique! For the tail the value can be null
    }

    return re;
  }

  public static void main(String [] args) {
    int [] nums = {2,1,4,3,6,5, 10, 9, 12, 15, 30, 45, 90};
    Solution sol = new Solution();
    List<Integer> list = sol.largestDivisibleSubset2(nums);

    for (Integer i : list) System.out.print(i + " ");
  }
}


text:
#region COPYRIGHT© 2009-2014 Phillip Clark. All rights reserved.
// For licensing information see License.txt (MIT style licensing).
#endregion

using System;
using FlitBit.Core;

namespace FlitBit.ObjectIdentity
{
	/// <summary>
	///   Implementation of IdentityKey for types that don't declare an identity key.
	/// </summary>
	/// <typeparam name="T"></typeparam>
	public sealed class MissingIdentityKey<T> : IdentityKey<T>
	{
		/// <summary>
		///   Gets an instance's identity key.
		/// </summary>
		/// <param name="instance">and instance of T</param>
		/// <returns>the instance's identity key (as an untyped object).</returns>
		/// <exception cref="InvalidOperationException">thrown when target type T does not define an identity key.</exception>
		public override object UntypedKey(T instance)
		{
			throw new InvalidOperationException(String.Concat("Identity key not defined for type: ",
																												typeof(T).GetReadableFullName(), "."));
		}
	}
}


text:
<?php

namespace ZendTest\Form\TestAsset;

use Zend\Form\Fieldset;
use Zend\InputFilter\InputFilterProviderInterface;
use Zend\Stdlib\Hydrator\ClassMethods as ClassMethodsHydrator;

class AddressFieldset extends Fieldset implements InputFilterProviderInterface
{
    public function __construct()
    {
        parent::__construct('address');
        $this->setHydrator(new ClassMethodsHydrator(false))
             ->setObject(new Entity\Address());

        $street = new \Zend\Form\Element('street', array('label' => 'Street'));
        $street->setAttribute('type', 'text');

        $city = new CityFieldset;
        $city->setLabel('City');

        $this->add($street);
        $this->add($city);
    }

    /**
     * Should return an array specification compatible with
     * {@link Zend\InputFilter\Factory::createInputFilter()}.
     *
     * @return array
     */
    public function getInputFilterSpecification()
    {
        return array(
            'street' => array(
                'required' => true,
            )
        );
    }
}


text:
/*jshint node:true*/
'use strict';

/**
 * Gitemplate constructor.
 */
exports.Gitemplate = Gitemplate;

/**
 * Create a new Gitemplate.
 *
 * @return {object}
 */
exports.create = function create() { return new Gitemplate(); };

/**
 * Extend Gitemplate.prototype.
 *
 * @param {object} ext
 * @return {object} Merge result.
 */
exports.extend = function extendProto(ext) { return extend(Gitemplate.prototype, ext); };

const util = require('util');
const sprintf = util.format;
const outerShelljs = require('outer-shelljs');
const longCon = require('long-con');

const configurable = require('configurable');
const extend = require('extend');
const escapeRe = require('escape-regexp');
const defShellOpt = {silent: true};

/**
 * Gitemplate constructor.
 *
 * Usage:
 *
 *     const gt = require('gitemplate').create();
 *     gt
 *       .set('name', this.name)
 *       .set('src', this.src)
 *       .set('dst', this.dst)
 *       .set('desc', this.desc)
 *       .set('json', this.json)
 *       .set('repo', this.repo);
 *     gt.cloneRepo();
 *
 * Configuration:
 *
 * - `{string} desc` `gitemplate_desc` replacement value
 * - `{string} dst` Clone path
 * - `{object} json` Replacement key/value pairs from `--json`
 * - `{string} name` `gitemplate_name` replacement value
 * - `{string} originSha` `gitemplate_originSha` replacement value
 * - `{string} originUrl` `gitemplate_originUrl` replacement value
 * - `{string} src` Source repository URL/path
 * - `{string} year` `gitemplate_year` replacement value
 *
 * Properties:
 *
 * - `{object} shelljs` `OuterShelljs` instance
 * - `{object} stdout`
 *
 * @see OuterShelljs https://github.com/codeactual/outer-shelljs/blob/master/docs/OuterShelljs.md
 */
function Gitemplate() {
  this.settings = {
    name: '',
    desc: '',
    json: {},
    repo: '',
    year: (new Date()).getUTCFullYear(),
    originSha: '',
    originUrl: ''
  };

  this.shelljs = outerShelljs.create();

  const lc = longCon.create().set('time', false);
  this.stdout = lc.create('gitemplate', console.log); // eslint-disable-line no-console
}

configurable(Gitemplate.prototype);

/**
 * Apply collected configuration.
 */
Gitemplate.prototype.init = function init() {
  if (this.get('verbose')) {
    defShellOpt.silent = false;
  }

  if (!defShellOpt.silent) {
    this.shelljs.on('cmd', this.onShellCmd.bind(this));
  }
};

/**
 * Display details about each command in `--verbose` mode.
 *
 * Handler for the `cmd` event emitted from `OuterShelljs`.
 *
 * @api private
 */
Gitemplate.prototype.onShellCmd = function onShellCmd(method, args) {
  this.stdout('%s(%s)', method, JSON.stringify(args));
};

/**
 * Clone the configured repo.
 *
 * @return {object} `shelljs.exec()` result
 */
Gitemplate.prototype.cloneRepo = function cloneRepo() {
  const dst = this.get('dst');
  if (this.shelljs._('test', '-e', dst)) {
    return {code: 1, output: 'Destination already exists'};
  }
  return this.shelljs._(
    'exec',
    sprintf('git clone %s %s', this.get('src'), dst),
    defShellOpt
  );
};

/**
 * Remove `.git/` to prepare for a fresh init and remote origin.
 */
Gitemplate.prototype.rmGitDir = function rmGitDir() {
  this.shelljs._('rm', '-rf', this.get('dst') + '/.git');
};

/**
 * Replace macros found in repo file content.
 */
Gitemplate.prototype.replaceContentVars = function replaceContentVars() {
  const cmdHead = "find %s -type f -exec perl -p -i -e 's/";
  const cmdFoot = "/%s/gi' {} \\;";
  const dst = this.get('dst');
  const passThruKeys = ['name', 'desc', 'repo', 'year', 'originSha', 'originUrl'];
  let res = {code: 0};
  const self = this;

  passThruKeys.forEach(function forEachKey(key) {
    if (res.code !== 0) { // Prior exec() failed, bail out.
      return;
    }
    res = self.shelljs._(
      'exec',
      sprintf(cmdHead + gitemplateEscVar(key) + cmdFoot, dst, escapeRe(self.get(key))),
      defShellOpt
    );
  });
  if (res.code !== 0) { return res; }

  const json = this.get('json');
  Object.keys(json).forEach(function forEachKey(key) {
    res = self.shelljs._(
      'exec',
      sprintf(cmdHead + gitemplateEscVar(key) + cmdFoot, dst, escapeRe(json[key])),
      defShellOpt
    );
    if (res.code !== 0) { return res; }
  });

  return res;
};

/**
 * Replace macros found in repo file names.
 */
Gitemplate.prototype.replaceNameVars = function replaceNameVars() {
  const self = this;
  const name = this.get('name');
  const dst = this.get('dst');

  const nameVar = gitemplateVar('name');
  function mvNameVar(target) {
    self.shelljs._('mv', target, target.replace(nameVar, name));
  }

  let targets = this.shelljs._('find', dst).filter(function filterDir(file) { // In dir names
    return self.shelljs._('test', '-d', file) && file.match(nameVar);
  });
  targets.forEach(mvNameVar);
  targets = this.shelljs._('find', dst).filter(function filterFile(file) { // In file names
    return self.shelljs._('test', '-f', file) && file.match(nameVar);
  });
  targets.forEach(mvNameVar);

  const json = this.get('json');
  const jsonKeys = Object.keys(json);
  jsonKeys.forEach(function forEachKey(key) {
    const escapedKey = gitemplateEscVarCaseInsRe(key);
    function mvJsonVar(target) {
      self.shelljs._('mv', target, target.replace(escapedKey, json[key]));
    }

    const targets = self.shelljs._('find', dst).filter(function filterDir(file) {
      return self.shelljs._('test', '-d', file) && file.match(escapedKey);
    });
    targets.forEach(mvJsonVar);
  });

  jsonKeys.forEach(function forEachKey(key) {
    const escapedKey = gitemplateEscVarCaseInsRe(key);
    function mvJsonVar(target) {
      self.shelljs._('mv', target, target.replace(escapedKey, json[key]));
    }

    const targets = self.shelljs._('find', dst).filter(function filterFile(file) {
      return self.shelljs._('test', '-f', file) && file.match(escapedKey);
    });
    targets.forEach(mvJsonVar);
  });
};

/**
 * Initialize a repo in the clone dir.
 *
 * @return {object} `shelljs.exec()` result
 */
Gitemplate.prototype.initRepo = function initRepo() {
  this.shelljs._('cd', this.get('dst'));
  return this.shelljs._('exec', 'git init', defShellOpt);
};

/**
 * Set GitHub remote origin.
 */
Gitemplate.prototype.setGithubOrigin = function setGithubOrigin() {
  this.shelljs._('cd', this.get('dst'));
  return this.shelljs._(
    'exec',
    sprintf('git remote add origin git@github.com:%s.git', this.get('repo')),
    defShellOpt
  );
};

/**
 * Get replacement value for `gitemplate_originSha`.
 *
 * @return {string}
 * @api private
 */
Gitemplate.prototype.getRepoOriginSha = function getRepoOriginSha() {
  this.shelljs._('cd', this.get('dst'));
  return this.shelljs._('exec', 'git rev-parse HEAD', defShellOpt).output.slice(0, 10);
};

/**
 * Get replacement value for `gitemplate_originUrl`.
 *
 * @return {string}
 * @api private
 */
Gitemplate.prototype.getRepoOriginUrl = function getRepoOriginUrl() {
  this.shelljs._('cd', this.get('dst'));
  return this.shelljs._('exec', 'git remote show origin', defShellOpt).output.match(/Fetch\s+URL: (\S+)/)[1];
};

/**
 * Run the `.gitemplate.postreplace` script if present.
 *
 * @return {object} `shelljs.exec()` result
 */
Gitemplate.prototype.runPostReplace = function runPostReplace() {
  const dst = this.get('dst');
  const script = dst + '/.gitemplate.postreplace';
  if (!this.shelljs._('test', '-e', script)) {
    return {code: 0, output: ''};
  }
  this.shelljs._('cd', dst);
  const res = this.shelljs._('exec', script, defShellOpt);
  if (res.code === 0) {
    this.shelljs._('rm', '-f', script);
  }
  return res;
};

function gitemplateVar(key) { return 'gitemplate_' + key; }
function gitemplateEscVar(key) { return escapeRe(gitemplateVar(key)); }
function gitemplateEscVarCaseInsRe(key) { return new RegExp(gitemplateEscVar(key), 'i'); }


text:
/*  Businesses and individuals that for commercial or other reasons cannot
    comply with the terms of the GPLv2 license may obtain a commercial license
    before incorporating Reliance Edge into proprietary software for
    distribution in any form.  Visit http://www.datalight.com/reliance-edge for
    more information.
*/
/** @file
*/
#ifndef REDMISC_H
#define REDMISC_H

/** @brief Type of an inode or handle.

    Used to indicate the actual or expected type of an inode or handle.
*/
typedef enum
{
    FTYPE_FILE,     /**< Type is file. */
    FTYPE_DIR,      /**< Type is directory. */

    /** Type is either file or directory: used only to indicate an expected
        type, never as an actual type.
    */
    FTYPE_EITHER
} FTYPE;

#endif


text:
#import "../AmazonServiceRequest.h"

#import "ElasticLoadBalancingRequest.h"
#import "ElasticLoadBalancingConfigureHealthCheckRequest.h"
#import "ElasticLoadBalancingHealthCheck.h"

/**
 * Configure Health Check Request Marshaller
 */
@interface ElasticLoadBalancingConfigureHealthCheckRequestMarshaller:NSObject {
}

+(AmazonServiceRequest *)createRequest:(ElasticLoadBalancingConfigureHealthCheckRequest *)configureHealthCheckRequest;

@end