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

<!-- The Czech langpack -->

<izpack:langpack version="5.0"
                 xmlns:izpack="http://izpack.org/schema/langpack"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://izpack.org/schema/langpack http://izpack.org/schema/5.0/izpack-langpack-5.0.xsd">

    <!-- General installer strings -->
    <str id="installer.title" txt="IzPack - Instalace "/>
    <str id="installer.next" txt="Další"/>
    <str id="installer.prev" txt="Předcházející"/>
    <str id="installer.quit" txt="Konec"/>
    <str id="installer.madewith" txt="(Vytvořené pomocí IzPack - http://izpack.org/)"/>
    <str id="installer.reboot.ask.title" txt="Požadován reboot"/>
    <str id="installer.reboot.ask.message"
         txt="Reboot je požadovaný pro ukončení instalace. Chcete nyní restartovat počitač?"/>
    <str id="installer.reboot.notice.title" txt="Doporučen reboot"/>
    <str id="installer.reboot.notice.message" txt="Reboot je doporučený pro ukončení instalace."/>
    <str id="installer.quit.title" txt="Skutečně chcete ukončit instalaci ?"/>
    <str id="installer.quit.message" txt="Tato operace ukončí instalaci !"/>
    <str id="installer.warning" txt="Varování !"/>
    <str id="installer.yes" txt="Ano"/>
    <str id="installer.no" txt="Ne"/>
    <str id="installer.cancel" txt="Zrušit"/>
    <str id="installer.error" txt="Chyba"/>
    <str id="installer.errorMessage" txt="Nastala chyba"/>
    <str id="installer.close" txt="Zavřít"/>
    <str id="installer.showDetails" txt="Zobrazit podrobnosti"/>
    <str id="installer.hideDetails" txt="Skrýt podrobnosti"/>
    <str id="installer.copy" txt="Kopírovat"/>
    <str id="installer.sendReport" txt="Poslat report"/>
    <str id="installer.cancelled" txt="Instalace byla zrušena"/>
    <str id="installer.continueQuestion" txt="Přesto pokračovat?"/>

    <!-- Uninstaller specific strings -->
    <str id="uninstaller.warning" txt="Tato operace odstraní nainstalovanou aplikaci !"/>
    <str id="uninstaller.destroytarget" txt=" Odstranit "/>
    <str id="uninstaller.uninstall" txt="Odinstalovat"/>

    <!-- The strings for the 'official' IzPack plugins -->
    <str id="HelloPanel.welcome1" txt="Vítejte v instalaci "/>
    <str id="HelloPanel.welcome2" txt=" !"/>
    <str id="HelloPanel.authors" txt="Autoři tohoto softwaru jsou : "/>
    <str id="HelloPanel.url" txt="Domovská stránka projektu je : "/>

    <str id="LicencePanel.info" txt="Pozorně si prečetěte následující licenční podmínky:"/>
    <str id="LicencePanel.agree" txt="Souhlasím s licenčními podmímkami."/>
    <str id="LicencePanel.notagree" txt="Nesouhlasím s licenčními podmímkami."/>
    <str id="LicencePanel.yes" txt="Ano"/>
    <str id="LicencePanel.no" txt="Ne"/>

    <str id="InfoPanel.info" txt="Prečtěte si nasledující informace :"/>

    <str id="PathInputPanel.required" txt="Vybraný adresář by měl existovat."/>
    <str id="PathInputPanel.notValid" txt="Vybraný adresář neobsahuje požadavaný produkt."/>

    <str id="TargetPanel.info" txt="Vyberte instalační adresář :"/>
    <str id="TargetPanel.browse" txt="Prohledat ..."/>
    <str id="TargetPanel.warn"
         txt="Adresář existuje ! Jste si jistý ,že chcete nainstalovat software do tohoto adresáře ? Současné verze souborů budou přepsány?"/>
    <str id="TargetPanel.empty_target" txt="Nevybrali jste cílový adresář! Je to správně?"/>
    <str id="TargetPanel.createdir" txt="Bude vytvořen cílový adresář :"/>
    <str id="TargetPanel.nodir" txt="Tento soubor není adresář! Zvolte adresář!"/>
    <str id="TargetPanel.notwritable" txt="Tento adresář nelze vytvořit! Zvolte jiný adresář!"/>

    <str id="JDKPathPanel.intro"
         txt="Nainstalovaná aplikace potřebuje JDK. Java runtime environment (JRE) není postačující."/>
    <str id="JDKPathPanel.info" txt="Select the JDK path:"/>
    <str id="JDKPathPanel.badVersion1" txt="Zvolena špatná verze JDK (dostupné: "/>
    <str id="JDKPathPanel.badVersion2" txt=" vyžadované: "/>
    <str id="JDKPathPanel.badVersion3" txt=") má být toto JDK i přesto použito?"/>

    <str id="PacksPanel.info" txt="Vyberte balíky ktéré budou instalované :"/>
    <str id="PacksPanel.tip" txt="Poznámka: zašeděné balíky jsou vyžadované."/>
    <str id="PacksPanel.space" txt="Potřebné místo na disku: "/>
    <str id="PacksPanel.freespace" txt="Volné místo na disku: "/>
    <str id="PacksPanel.description" txt="Poznámka"/>
    <str id="PacksPanel.dependencyList"
         txt="Pro instalaci zvolených balíčků je nutné nainstalovat i následující balíčky"/>
    <str id="ImgPacksPanel.dependencyList" txt="Dependencies"/>
    <str id="PacksPanel.notEnoughSpace"
         txt="Požadované místo na disku pro instalaci je větší než dostupné volné místo."/>
    <str id="PacksPanel.notAscertainable" txt="not ascertainable"/>

    <str id="InstallPanel.info" txt="Kliknutím na tlačítko 'Instalovat !' začnete instalaci"/>
    <str id="InstallPanel.install" txt="Instalovat !"/>
    <str id="InstallPanel.tip" txt="Probíhá instalace:"/>
    <str id="InstallPanel.begin" txt="[Nic]"/>
    <str id="InstallPanel.finished" txt="[Ukončené]"/>
    <str id="InstallPanel.progress" txt="Celkový stav instalace :"/>
    <str id="InstallPanel.overwrite.title" txt="Soubor už existuje"/>
    <str id="InstallPanel.overwrite.question" txt="Soubor už existuje. Přepsat soubor?"/>

    <str id="FinishPanel.success" txt="Instalace proběhla úspěšně."/>
    <str id="FinishPanel.fail" txt="Chyba instalace!"/>
    <str id="FinishPanel.done" txt="Hotovo"/>
    <str id="FinishPanel.uninst.info" txt="Odinstalační program byl vytvořený v:"/>
    <str id="FinishPanel.auto" txt="Vytvořit automatický instalační script"/>
    <str id="FinishPanel.auto.tip" txt="Použijte tento script v případě instalace na jiný počítač."/>

    <str id="ImgPacksPanel.packs" txt="Následující balíky jsou k dispozici :"/>
    <str id="ImgPacksPanel.snap" txt="Náhled balíku  :"/>
    <str id="ImgPacksPanel.checkbox" txt=" Instalovat tento balík"/>

    <str id="ShortcutPanel.regular.list" txt="Vyberte skupinu programů pro Zástupce:"/>
    <str id="ShortcutPanel.regular.default" txt="Obnovit"/>
    <str id="ShortcutPanel.regular.desktop" txt="Vytvořit zástupce na ploše"/>
    <str id="ShortcutPanel.regular.create" txt="Vytvořit zástupce"/>
    <str id="ShortcutPanel.regular.userIntro" txt="vytvořit zástupce pro:"/>
    <str id="ShortcutPanel.regular.currentUser" txt="aktuálního užicatele"/>
    <str id="ShortcutPanel.regular.allUsers" txt="všech uživatelů"/>

    <str id="ShortcutPanel.alternate.apology"
         txt="Litujeme, ale IzPack nepodporuje vytvoření zástupců pro tento operační systém. Vytvořit zástupce musíte sami."/>
    <str id="ShortcutPanel.alternate.targetsLabel" txt="Toto je seznam zástupců, ke kterým by ste měli mít přístup."/>
    <str id="ShortcutPanel.alternate.textFileExplanation"
         txt="Můžete uložit detailní informace o průbehu instalace do textového souboru pro budoucí použití."/>
    <str id="ShortcutPanel.alternate.saveButton" txt="Uložit textový soubor"/>

    <str id="ShortcutPanel.textFile.header"
         txt="Informace o zástupcích\n====================\n\nToto je seznam zástupců, ke kterým by ste měli mít přístup.\n  Vytvořit zástupce musíte sami.\n"/>

    <str id="ShortcutPanel.textFile.name" txt="Zástupce        : "/>
    <str id="ShortcutPanel.textFile.location" txt="Umístění        : "/>
    <str id="ShortcutPanel.textFile.description" txt="Poznámka        : "/>
    <str id="ShortcutPanel.textFile.target" txt="Cíl zástupců    : "/>
    <str id="ShortcutPanel.textFile.command" txt="Příkaz          : "/>
    <str id="ShortcutPanel.textFile.iconName" txt="Soubor ikony    : "/>
    <str id="ShortcutPanel.textFile.iconIndex" txt="Číslo ikony     : "/>
    <str id="ShortcutPanel.textFile.work" txt="Pracovní adresář: "/>

    <str id="ShortcutPanel.location.desktop" txt="Plocha"/>
    <str id="ShortcutPanel.location.applications" txt="Menu programů"/>
    <str id="ShortcutPanel.location.startMenu" txt="Startovní Menu"/>
    <str id="ShortcutPanel.location.startup" txt="Skupina Autostart"/>

    <str id="UserInputPanel.error.caption" txt="Problém při spouštění"/>
    <str id="UserInputPanel.search.autodetect" txt="Automatická detekce"/>

    <!-- more descriptive error message would be cool, like specifying what
file we looked for -->
    <str id="UserInputPanel.search.autodetect.failed.message" txt="Automatická detekce selhala."/>
    <str id="UserInputPanel.search.autodetect.failed.caption" txt="Automatická detekce selhala."/>
    <str id="UserInputPanel.search.autodetect.tooltip" txt="Zkontrolujte soubor nebo adrešář v zadané cestě."/>
    <str id="UserInputPanel.search.location" txt="Zadejte cestu "/>
    <str id="UserInputPanel.search.location.checkedfile" txt="Zkontrolovaná existence {0} ."/>
    <str id="UserInputPanel.search.browse" txt="Prohledat..."/>
    <str id="UserInputPanel.search.wrongselection.message"
         txt="Vybraný soubor či adresář neexistuje nebo není správný."/>
    <str id="UserInputPanel.search.wrongselection.caption" txt="Nesprávný výběr."/>
    <str id="UserInputPanel.custom.swing.buttonlabel.add" txt="Přidat"/>
    <str id="UserInputPanel.custom.swing.buttonlabel.remove" txt="Odebrat"/>

    <str id="CompilePanel.heading" txt="Kompilace"/>
    <str id="CompilePanel.tip" txt="Průběh kompilace úlohy:"/>
    <str id="CompilePanel.browse" txt="Prohledat..."/>
    <str id="CompilePanel.browse.approve" txt="Použít jako překladač"/>
    <str id="CompilePanel.start" txt="Start"/>
    <str id="CompilePanel.progress.initial" txt="[Stiskněte tlačítko Start]"/>
    <str id="CompilePanel.progress.finished" txt="[Ukončené]"/>
    <str id="CompilePanel.progress.overall" txt="Celkový stav kompilace:"/>
    <str id="CompilePanel.error" txt="Chyba kompilace"/>
    <str id="CompilePanel.error.reconfigure" txt="Rekonfigurace"/>
    <str id="CompilePanel.error.ignore" txt="Ignorovat"/>
    <str id="CompilePanel.error.abort" txt="Zrušit"/>
    <str id="CompilePanel.error.seebelow" txt="Detaily selhané kompilace si prohlédněte dole."/>
    <str id="CompilePanel.error.nofiles" txt="Chyba v průběhu hledání souborů pro kompilaci."/>
    <str id="CompilePanel.error.compilernotfound" txt="Kompilace nemůže být spuštěna."/>
    <str id="CompilePanel.error.invalidarguments" txt="Překladač nepoznal použité argumenty ."/>
    <str id="CompilePanel.error.noclassfile" txt="Překladač nevytvoril třídu pro zdrojový soubor "/>
    <str id="CompilePanel.choose_compiler" txt="Překladač :"/>
    <str id="CompilePanel.additional_arguments" txt="Přídavné argumenty pro překladač:"/>

    <str id="ProcessPanel.heading" txt="Probíhá"/>

    <str id="data.validation.error.title" txt="Ověrování selhalo"/>
    <str id="data.validation.warning.title" txt="Ověrování selhalo - pokračuji instalaci"/>

</izpack:langpack>


text:
Rules

pkg_tar

pkg_deb

## Overview

These build rules are used for building various packaging such as tarball
and debian package.

## Basic Example

This example is a simplification of the debian packaging of Bazel:

```python

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar", "pkg_deb")

pkg_tar(
    name = "bazel-bin",
    data_path = "/src",
    directory = "/usr/bin",
    files = ["//src:bazel"],
    mode = "0755",
)

pkg_tar(
    name = "bazel-tools",
    data_path = "/",
    directory = "/usr/share/lib/bazel/tools",
    files = ["//tools:package-srcs"],
    mode = "0644",
    modes = {"tools/build_defs/docker/build_test.sh": "0755"},
)

pkg_tar(
    name = "debian-data",
    extension = "tar.gz",
    deps = [
        ":bazel-bin",
        ":bazel-tools",
    ],
)

pkg_deb(
    name = "bazel-debian",
    architecture = "amd64",
    built_using = "bazel (0.1.1)",
    data = ":debian-data",
    depends = [
        "zlib1g-dev",
        "unzip",
    ],
    description_file = "debian/description",
    homepage = "http://bazel.io",
    maintainer = "The Bazel Authors <bazel-dev@googlegroups.com>",
    package = "bazel",
    version = "0.1.1",
)
```

Here, the Debian package is built from three `pkg_tar` targets:

 - `bazel-bin` creates a tarball with the main binary (mode `0755`) in
   `/usr/bin`,
 - `bazel-tools` create a tarball with the base workspace (mode `0644`) to
   `/usr/share/bazel/tools` ; the `modes` attribute let us specifies executable
   files,
 - `debian-data` creates a gzip-compressed tarball that merge the three previous
   tarballs.

`debian-data` is then used for the data content of the debian archive created by
`pkg_deb`.

## Future work

 - Support more format, especially `pkg_zip`.
 - Maybe a bit more integration with the `docker_build` rule.

## pkg_tar

```python
pkg_tar(name, extension, data_path, directory, files, mode, modes, deps, symlinks)
```

Creates a tar file from a list of inputs.

  <colgroup>
    <col class="col-param" />
    <col class="param-description" />
  </colgroup>

      Attributes

      name

        Name, required

A unique name for this rule.

      extension

        String, default to 'tar'

            The extension for the resulting tarball. The output
            file will be 'name.extension'. This extension
            also decide on the compression: if set to tar.gz
            or tgz then gzip compression will be used and
            if set to tar.bz2 or tar.bzip2 then
            bzip2 compression will be used.

      strip_prefix

        String, optional

Root path of the files.

          The directory structure from the files is preserved inside the
          tarball but a prefix path determined by strip_prefix
          is removed from the directory structure. This path can
          be absolute from the workspace root if starting with a / or
          relative to the rule's directory. A relative path may start with "./"
          (or be ".") but cannot use ".." to go up level(s). By default, the
          data_path attribute is unused and all files are supposed to have no
          prefix. A data_path of "" (the empty string) means the
          same as the default.

      package_dir

        String, optional

Target directory.

          The directory in which to expand the specified files, defaulting to '/'.
          Only makes sense accompanying files.

      files

        List of files, optional

File to add to the layer.

          A list of files that should be included in the docker image.

      mode

        String, default to 0555

          Set the mode of files added by the files attribute.

      modes

        Dictionary, default to '{}'

          A string dictionary to change default mode of specific files from
          files. Each key should be a path to a file before
          appending the prefix directory and the corresponding
          value the octal permission of to apply to the file.

          modes = {
           "tools/py/2to3.sh": "0755
           ...
          },

      deps

        List of labels, optional

Tar files to extract and include in this tar package.

          A list of tarball labels to merge into the output tarball.

      symlinks

        Dictionary, optional

Symlinks to create in the output tarball.

          symlinks = {
           "/path/to/link": "/path/to/target",
           ...
          },

### pkg_deb

```python
pkg_deb(name, data, package, architecture, maintainer, preinst, postinst, prerm, postrm, version, version_file, description, description_file, built_using, built_using_file, priority, section, homepage, depends, suggests, enhances, predepends, recommends)
```

Create a debian package. See http://www.debian.org/doc/debian-policy/ch-controlfields.html
for more details on this.

  <colgroup>
    <col class="col-param" />
    <col class="param-description" />
  </colgroup>

      Attributes

      name

        Name, required

A unique name for this rule.

      data

        File, required

          A tar file that contains the data for the debian package (basically
          the list of files that will be installed by this package).

      package

        String, required

The name of the package.

      architecture

        String, default to 'all'

The architecture that this package target.

          See http://www.debian.org/ports/.

      maintainer

        String, required

The maintainer of the package.

      preinst, postinst, prerm and postrm

        Files, optional

          Respectively, the pre-install, post-install, pre-remove and
          post-remove scripts for the package.

          See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html.

      version, version_file

        String or File, required

          The package version provided either inline (with version)
          or from a file (with version_file).

      description, description_file

        String or File, required

          The package description provided either inline (with description)
          or from a file (with description_file).

      built_using, built_using_file

        String or File, default to 'Bazel'

          The tool that were used to build this package provided either inline
          (with built_using) or from a file (with built_using_file).

      priority

        String, default to 'optional'

The priority of the package.

          See http://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities.

      section

        String, default to 'contrib/devel'

The section of the package.

          See http://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections.

      homepage

        String, optional

The homepage of the project.

        depends, suggests, enhances,
        predepends and recommends.

        String list, optional

The list of dependencies in the project.

          See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps.

redpajama_set_name: RedPajamaGithub


text:
(function() {

var Core = {

		initialized: false,

		initialize: function() {

			if (this.initialized) return;
			this.initialized = true;

			this.build();
			this.events();

	},

	build: function() {

	this.animations();

	},

	animations: function() {

		$("[data-appear-animation]").each(function() {

				var $this = $(this);

				$this.addClass("appear-animation");

				if(!$("html").hasClass("no-csstransitions") && $(window).width() > 767) {

					$this.appear(function() {

						var delay = ($this.attr("data-appear-animation-delay") ? $this.attr("data-appear-animation-delay") : 1);

						if(delay > 1) $this.css("animation-delay", delay + "ms");
						$this.addClass($this.attr("data-appear-animation"));

						setTimeout(function() {
							$this.addClass("appear-animation-visible");
						}, delay);

					}, {accX: 0, accY: -150});

				} else {

					$this.addClass("appear-animation-visible");

				}

		});

	}

};

Core.initialize();

})();


text:
book-examples
=============

This is the Vaadin official book code source demo, i have used the maven instead of the ant build. All the rights is vaadin.

how to run
> **mvn clean install jetty:run-war -Dmaven.skip.test=true**

 1. [Demo site](http://demo.vaadin.com/book-examples/book)
 2. [Using Vaadin with Maven(Vaadin6)](https://vaadin.com/wiki/-/wiki/Main/Using%20Vaadin%20with%20Maven)


text:
require_relative 'boot'

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
# require "sprockets/railtie"
require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Rails5Api
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Only loads a smaller set of middleware suitable for API only apps.
    # Middleware like session, flash, cookies can be added back manually.
    # Skip views, helpers and assets when generating a new resource.
    config.api_only = true

    config.middleware.use Rack::Attack

    config.autoload_paths += [
      "#{config.root}/app/models/remote_db",
    ]

    ########## For Batch API ##########

    config.middleware.use BatchApi::RackMiddleware do |batch_config|
      # you can set various configuration options:
      batch_config.verb = :post # default :post
      batch_config.endpoint = "/batch" # default /batch
      batch_config.limit = 100 # how many operations max per request, default 50

      # default middleware stack run for each batch request
      batch_config.batch_middleware = Proc.new { }
      # default middleware stack run for each individual operation
      batch_config.operation_middleware = Proc.new { }
    end

  end
end


text:
package net.kyori.adventure.text;

import java.util.UUID;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

class ComponentIteratorTest {

  @Test
  public void testOf() {
    final int[] hits = {0};

    Component.text()
      .content("Purity Ring ")
      .append(Component.text("are absolutely ", NamedTextColor.DARK_PURPLE))
      .append(Component.text("the best "))
      .append(Component.translatable("some.adjective"))
      .append(Component.text(" band", NamedTextColor.GREEN).hoverEvent(HoverEvent.showText(Component.text("ever"))))
      .append(Component.text("."))
      .build()
      .iterable(ComponentIteratorType.DEPTH_FIRST)
      .forEach(component -> hits[0]++);

    assertEquals(6, hits[0]);
  }

  @Test
  public void testOfEmpty() {
    for (final Component component : Component.empty().iterable(ComponentIteratorType.DEPTH_FIRST)) {
      if (component.equals(Component.empty())) {
        return;
      }
    }

    fail("root component wasn't located");
  }

  @Test
  public void testOfDfs() {
    final Component component = Component.text()
      .content("SKIP")
      .append(Component.text("SKIP").append(Component.text("DEEP")))
      .append(Component.text("WIDE"))
      .build();

    for (final Component inner : component.iterable(ComponentIteratorType.DEPTH_FIRST)) {
      if (inner instanceof TextComponent) {
        final String content = ((TextComponent) inner).content();

        if (content.equals("WIDE")) {
          fail("WIDE before DEEP");
          return;
        } else if (content.equals("DEEP")) {
          return;
        }
      }
    }

    fail("target component not found");
  }

  @Test
  public void testOfBfs() {
    final Component component = Component.text()
      .content("SKIP")
      .append(Component.text("SKIP").append(Component.text("DEEP")))
      .append(Component.text("WIDE"))
      .build();

    for (final Component inner : component.iterable(ComponentIteratorType.BREADTH_FIRST)) {
      if (inner instanceof TextComponent) {
        final String content = ((TextComponent) inner).content();

        if (content.equals("DEEP")) {
          fail("DEEP before WIDE");
          return;
        } else if (content.equals("WIDE")) {
          return;
        }
      }
    }

    fail("target component not found");
  }

  @Test
  public void testOfHover() {
    final Component component = Component.text()
      .append(Component.text("WITH TEXT").hoverEvent(Component.text("TEXT")))
      .append(Component.text("WITH ENTITY")
        .hoverEvent(HoverEvent.showEntity(Key.key("minecraft:pig"), UUID.randomUUID(), Component.text("ENTITY"))))
      .build();

    boolean foundText = false;
    boolean foundEntity = false;

    for (final Component inner : component.iterable(ComponentIteratorType.BREADTH_FIRST, ComponentIteratorFlag.INCLUDE_HOVER_SHOW_TEXT_COMPONENT, ComponentIteratorFlag.INCLUDE_HOVER_SHOW_ENTITY_NAME)) {
      if (inner instanceof TextComponent) {
        final TextComponent text = (TextComponent) inner;

        if (text.content().equals("TEXT")) foundText = true;
        else if (text.content().equals("ENTITY")) foundEntity = true;
      }
    }

    assertTrue(foundText, "Could not locate text in component hover event.");
    assertTrue(foundEntity, "Could not locate entity display name in entity hover event.");
  }

  @Test
  public void testOfTranslatableArguments() {
    final Component component = Component.text()
      .append(Component.text("TEXT"))
      .append(Component.translatable("translatable", Component.text("ARG")))
      .build();

    for (final Component inner : component.iterable(ComponentIteratorType.BREADTH_FIRST, ComponentIteratorFlag.INCLUDE_TRANSLATABLE_COMPONENT_ARGUMENTS)) {
      if (inner instanceof TextComponent) {
        final TextComponent text = (TextComponent) inner;

        if (text.content().equals("ARG")) return;
      }
    }

    fail("Could not locale the arg of a translatable component.");
  }
}


text:
require 'spec_helper'

describe SimpleDeploy::Configuration do
  let(:config_data) do
    { 'environments' => {
        'test_env' => {
          'secret_key' => 'secret',
          'access_key' => 'access',
          'region'     => 'us-west-1'
      } },
      'notifications' => {
        'campfire' => {
          'token' => 'my_token'
      } } }
  end

  describe 'creating a configuration' do
    before do
      @the_module = SimpleDeploy::Configuration
    end

    it 'should accept config data as an argument' do
      YAML.should_not_receive(:load)

      @config = @the_module.configure 'test_env', :config => config_data
      @config.environment.should == config_data['environments']['test_env']
      @config.notifications.should == config_data['notifications']
    end

    it 'should load the config from ~/.simple_deploy.yml by default' do
      File.should_receive(:open).with("#{ENV['HOME']}/.simple_deploy.yml").
                                 and_return(config_data.to_yaml)

      @config = @the_module.configure 'test_env'
      @config.environment.should == config_data['environments']['test_env']
      @config.notifications.should == config_data['notifications']
    end

    it 'should load the config from SIMPLE_DEPLOY_CONFIG_FILE if supplied' do
      File.should_receive(:open).with("/my/config/file").
                                 and_return(config_data.to_yaml)
      env_mock = mock 'env'
      @the_module.stub(:env).and_return(env_mock)
      env_mock.should_receive(:load).
               with('SIMPLE_DEPLOY_CONFIG_FILE').
               and_return "/my/config/file"
      @config = @the_module.configure 'test_env'
      @config.environment.should == config_data['environments']['test_env']
      @config.notifications.should == config_data['notifications']
    end

  end

  describe "after creating a configuration" do
    before do
      @the_module = SimpleDeploy::Configuration
      @config = @the_module.configure 'test_env', :config => config_data
    end

    it "should return the default artifacts to deploy" do
      @config.artifacts.should == ['chef_repo', 'cookbooks', 'app']
    end

    it "should return the APP_URL for app" do
      @config.artifact_deploy_variable('app').should == 'APP_URL'
    end

    it "should return the Cloud Formation camel case variables" do
      @config.artifact_cloud_formation_url('app').should == 'AppArtifactURL'
    end

    it "should return the environment requested" do
      env_config = @config.environment
      env_config['access_key'].should == 'access'
      env_config['secret_key'].should == 'secret'
      env_config['region'].should == 'us-west-1'
    end

    it "should return the notifications available" do
      @config.notifications.should == ( { 'campfire' => { 'token' => 'my_token' } } )
    end

    it "should return the access_key for the environment" do
      @config.access_key.should == 'access'
    end

    it "should return the secret_key for the environment" do
      @config.secret_key.should == 'secret'
    end

    it "should return the region for the environment" do
      @config.region.should == 'us-west-1'
    end

    it "should return the deploy script" do
      @config.deploy_script.should == '/opt/intu/admin/bin/configure.sh'
    end

  end

  describe 'showing raw configuration for all instances' do
    before do
      @the_module = SimpleDeploy::Configuration
    end

    it "should return a hash for every environment" do
      environments = @the_module.environments :config => config_data
      environments.keys.should == ['test_env']
    end
  end

  describe "gracefully handling yaml file errors" do
    before do
      FakeFS.activate!
      @config_file_path = "#{ENV['HOME']}/.simple_deploy.yml"
      FileUtils.mkdir_p File.dirname(@config_file_path)

      @the_module = SimpleDeploy::Configuration
    end

    after do
      FakeFS.deactivate!
      FakeFS::FileSystem.clear
    end

    it "should handle a missing file gracefully" do
      expect {
        config = @the_module.configure 'test_env'
      }.to raise_error(RuntimeError, "#{@config_file_path} not found")
    end

    it "should handle a corrupt file gracefully" do
      s = "---\nport: | 80"
      File.open(@config_file_path, 'w') do |out|
        out.write(s)
      end

      expect {
        config = @the_module.configure 'test_env'
      }.to raise_error(RuntimeError, "#{@config_file_path} is corrupt")
    end
  end
end


text:
using System;
using System.Linq;
using System.Reflection;
using _02BlackBoxInteger;

namespace _02.Black_Box_Integer
{
    public class Startup
    {
        // get private constructor
        private static ConstructorInfo constructor = typeof(BlackBoxInt)
            .GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[0], null);
        // create instance using the private constructor info from above
        private static BlackBoxInt instance = (BlackBoxInt)constructor.Invoke(null);
        // get all methods using the instance we created above
        private static MethodInfo[] blackBoxMethods = typeof(BlackBoxInt)
            .GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);
        // get all fields from the instance of above
        private static FieldInfo[] blackBoxFields = typeof(BlackBoxInt)
            .GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);

        public static void Main()
        {
            var input = Console.ReadLine();

            while (!input.Equals("END"))
            {
                var inputSplit = input.Split('_');
                var command = inputSplit[0];
                var value = int.Parse(inputSplit[1]);

                InvokeCurrentMethod(value, command);

                input = Console.ReadLine();
            }
        }

        private static void InvokeCurrentMethod(int value, string command)
        {
            //long currentValue;

            blackBoxMethods.First(m => m.Name.Contains(command)).Invoke(instance, new object[] {value});
            Console.WriteLine(blackBoxFields.First().GetValue(instance).ToString());

            //foreach (var blackBoxMethod in blackBoxMethods)
            //{
            //    if (blackBoxMethod.Name.Contains(command))
            //    {
            //        blackBoxMethod.Invoke(instance, new object[] { value });
            //        break;
            //    }
            //}

            //foreach (var blackBoxField in blackBoxFields)
            //{
            //    currentValue = long.Parse(blackBoxField.GetValue(instance).ToString());
            //    Console.WriteLine(currentValue);
            //    break;
            //}
        }
    }
}


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

namespace Daves.WordamentSolver.WordSorters
{
    public class StartLetterByPointsOverWordLengthSorter : WordSorter, IComparer<Word>
    {
        public override string Name => "start letter by: points / word length";

        public virtual int Compare(Word x, Word y)
            => x.StartLetter != y.StartLetter
            ? x.StartLetter.CompareTo(y.StartLetter)
            : WordSorter.PointsOverWordLength.Compare(x, y);

        public override void Sort(Word[] words)
            => Array.Sort(words, comparer: this);
    }
}


text:
import $ from 'jquery';
import {has} from 'underscore';
import humanizeDuration from 'humanize-duration';
import PollingProvider from '../services/PollingProvider';
import store from '../reduxStore';
import { getRepoPath, getBranchBuildPath, getBranchStatePath } from '../utils/blazarPaths';

function _groupBuilds(builds) {
  const starredBranchIds = store.getState().starredBranches;
  return {
    all: builds,
    starred: builds.filter((build) => starredBranchIds.has(build.gitInfo.id)),
    building: builds.filter((build) => has(build, 'inProgressBuild'))
  };
}

function _parse(data) {
  const parsed = data.map((item) => {
    const {
      gitInfo,
      lastBuild,
      inProgressBuild
    } = item;

    const branchId = gitInfo.id;

    if (has(item, 'inProgressBuild')) {
      item.inProgressBuild.duration = humanizeDuration(Date.now() - item.inProgressBuild.startTimestamp, {round: true});
      item.inProgressBuild.blazarPath = getBranchBuildPath(branchId, inProgressBuild.buildNumber);
    }

    if (has(item, 'lastBuild')) {
      item.lastBuild.duration = humanizeDuration(item.lastBuild.endTimestamp - item.lastBuild.startTimestamp, {round: true});
      item.lastBuild.blazarPath = getBranchBuildPath(branchId, lastBuild.buildNumber);
    }

    item.gitInfo.blazarRepositoryPath = getRepoPath(gitInfo.repository);
    item.gitInfo.blazarBranchPath = getBranchStatePath(branchId);

    return item;
  });

  return parsed;
}

function fetchBuilds(extraData, cb) {
  if (this.buildsPoller) {
    this.buildsPoller.disconnect();
    this.buildsPoller = undefined;
  }

  let exclusionOpts = {
    property: [
      '!pendingBuild.buildOptions',
      '!inProgressBuild.buildOptions',
      '!lastBuild.buildOptions'
    ]
  };

  if (!extraData) {
    exclusionOpts = {
      property: [
        '!pendingBuild.commitInfo',
        '!inProgressBuild.commitInfo',
        '!lastBuild.commitInfo',
        '!pendingBuild.dependencyGraph',
        '!inProgressBuild.dependencyGraph',
        '!lastBuild.dependencyGraph',
        '!pendingBuild.buildTrigger',
        '!inProgressBuild.buildTrigger',
        '!lastBuild.buildTrigger',
        '!pendingBuild.buildOptions',
        '!inProgressBuild.buildOptions',
        '!lastBuild.buildOptions'
      ]
    };
  }

  this.buildsPoller = new PollingProvider({
    url: `${window.config.apiRoot}/branches/state`,
    type: 'GET',
    dataType: 'json',
    data: $.param(exclusionOpts, true)
  });

  this.buildsPoller.poll((err, resp) => {
    if (err) {
      cb(err);
      return;
    }

    cb(err, _groupBuilds(_parse(resp)));
  });
}

function stopPolling() {
  if (!this.buildsPoller) {
    return;
  }

  this.buildsPoller.disconnect();
}

export default {
  fetchBuilds,
  stopPolling
};


text:
The Snorlax library was created when I was working on a personal project that needed me to have a public API. I realized that a lot of the code I was writing was repetitive so I decided to try and make a library to help me.

## How To ##
The way it works is easy:

1. Include/require the load.php file.
2. Create a file called user-config.php in the config folder and set your configuration variables.
3. Create a new Snorlax object by calling the getInstance() static method.
4. All Snorlax methods throw either a PDOException or SnorlaxException, so wrap the rest of the code in a try:catch statement.
5. Create the options object depending on what method (verb) you want to call.
6. Call the method (verb).

## Example ##
### user-config.php: ###

```
#!php

<?php
    define("DEBUG", "true");
    define("DATABASE", "snorlax");
    define("USERNAME", "username");
    define("PASSWORD", "password");
```
### index.php: ###

```
#!php

<?php
    require_once("path/to/Snorlax.php");

    $snorlax = Snorlax::getInstance();

    //Empty array to hold the data.
    $data = array();

    //Empty array to hold the status.
    $status = array();

    try {
        //Options to send in to the get method.
        $opts = array(
            "tables" => "snorlax",
            "where" => array("id" => 3)
        );

        //Get the data from the database.
        $data = $snorlax->get($opts);

        //If successful set status
        $status = array("code" => 200, "message" => "OK");

    } catch (SnorlaxException $ex) {
        //Set the status
        $status = array("code" => $ex->getCode(), "message" => $ex->getMessage());
    } catch (PDOException $ex) {
        //Handle PDOException, don't give out too much information since it might leak sensitive data.
        $status = array("code" => 500, "message" => "Internal Server Error");
    }

    //Echo the data as JSON. The second parameter (true) sets the Content-Type header to JSON, the third parameter (true) sets the JSON_PRETTY_PRINT flag.
    Snorlax::toJSON(array("status" => $status, "data" => $data), true, true);
```
## Contact ##
If you have any questions please email me at marcelopluz@gmail.com.


text:
package com.example.weizhenbin.mydemo.ui;

import com.example.weizhenbin.mydemo.base.BaseActivity;
import com.weizhenbin.show.R;

/**
 * Created by weizhenbin on 16/10/16.
 */

public class NestScrollActivity extends BaseActivity {
    @Override
    protected void initView() {
        setContentView(R.layout.activity_nestscroll);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvent() {

    }
}


text:
module.exports = {
    first: ['jshint', 'writeBowerJson', 'jscs'],
    second: ['concat'],
    third: ['babel'],
    fourth: ['uglify'],
    last: ['version'],
};


text:
<!DOCTYPE html>

  <title>Form</title>

  Empty Input:
  <input id="emptyInput" type="text">
  Empty Textarea:
  <textarea id="emptyTextarea"></textarea>
  Checkboxes:
  <input id="checkbox1" name="thecheck" type="checkbox" />
  <input id="checkbox2" name="thecheck" type="checkbox" />
  Radio:
  <input id="radio1" name="theradio" type="radio" />
  <input id="radio2" name="theradio" type="radio" />
  Single Select:
  <select id="singleSelect">
    <option value="1">First Value</option>
    <option value="2">Second Value</option>
  </select>
  Multi Select:
  <select id="multiSelect" multiple>
    <option value="1">one</option>
    <option value="2">two</option>
  </select>


text:
require 'spec_helper.rb'

include OSX
require 'acl/entry'

def valid_acl
  ACL::Entry.from_text("group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000046:_www:70:allow,inherited:read,write")
end

describe ACL::Entry do
  describe '.from_text' do
    it "instantiates with text" do
      expect(ACL::Entry.from_text("doh")).to be_kind_of(ACL::Entry)
    end
  end

  it "has an assignment" do
    expect(valid_acl).to respond_to(:assignment)
  end

  it "has rules" do
    expect(valid_acl.rules).to eq(["allow", "inherited"])
  end

  it "has permissions" do
    expect(valid_acl.permissions).to eq(["read","write"])
  end
end


text:
set -e
echo "========== BUILD =========="
set -x
./make.bash
export PATH=$(pwd)/bin:$PATH
set +x

echo "========== Test: dummy =========="
set -x
docker build -t dummy ./example/dummy
nmzswarm -docker-stack dummy \
         -source dummy \
         -replicas 10
set +x

echo "========== Test: dummy-fail =========="
set -x
docker build -t dummy-fail ./example/dummy-fail
nmzswarm -docker-stack dummy-fail \
         -source dummy-fail \
         -replicas 10 && { echo should fail; false; }
set +x


text:
require 'chatty_crow_errbit/engine'

# Module for errbit extension!
module ChattyCrowErrbit
end


text:
package org.matomo.sdk.tools;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;

import java.io.File;

import testhelpers.BaseTest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

@RunWith(MockitoJUnitRunner.class)
public class ChecksumTest extends BaseTest {

    @Test
    public void testgetMD5Checksum() throws Exception {
        String md5 = Checksum.getMD5Checksum("foo");
        assertEquals(md5, "ACBD18DB4CC2F85CEDEF654FCCC4A4D8");
    }

    @Test
    public void testHex() throws Exception {
        assertNull(Checksum.getHex(null));
    }

    @Test
    public void testgetMD5ChecksumDir() throws Exception {
        File directory = new File(".", "");
        String md5 = Checksum.getMD5Checksum(directory);
        assertTrue(md5 == null);
    }

}


text:
package org.apache.commons.math3.analysis;

import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
import org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableFunction;
import org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableVectorFunction;
import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction;
import org.apache.commons.math3.analysis.function.Identity;
import org.apache.commons.math3.exception.DimensionMismatchException;
import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.exception.NumberIsTooLargeException;
import org.apache.commons.math3.exception.util.LocalizedFormats;

/**
 * Utilities for manipulating function objects.
 *
 * @version $Id: FunctionUtils.java 1455194 2013-03-11 15:45:54Z luc $
 * @since 3.0
 */
public class FunctionUtils {
    /**
     * Class only contains static methods.
     */
    private FunctionUtils() {}

    /**
     * Composes functions.
     *

     * The functions in the argument list are composed sequentially, in the
     * given order.  For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
     *
     * @param f List of functions.
     * @return the composite function.
     */
    public static UnivariateFunction compose(final UnivariateFunction ... f) {
        return new UnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                double r = x;
                for (int i = f.length - 1; i >= 0; i--) {
                    r = f[i].value(r);
                }
                return r;
            }
        };
    }

    /**
     * Composes functions.
     *

     * The functions in the argument list are composed sequentially, in the
     * given order.  For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
     *
     * @param f List of functions.
     * @return the composite function.
     * @since 3.1
     */
    public static UnivariateDifferentiableFunction compose(final UnivariateDifferentiableFunction ... f) {
        return new UnivariateDifferentiableFunction() {

            /** {@inheritDoc} */
            public double value(final double t) {
                double r = t;
                for (int i = f.length - 1; i >= 0; i--) {
                    r = f[i].value(r);
                }
                return r;
            }

            /** {@inheritDoc} */
            public DerivativeStructure value(final DerivativeStructure t) {
                DerivativeStructure r = t;
                for (int i = f.length - 1; i >= 0; i--) {
                    r = f[i].value(r);
                }
                return r;
            }

        };
    }

    /**
     * Composes functions.
     *

     * The functions in the argument list are composed sequentially, in the
     * given order.  For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
     *
     * @param f List of functions.
     * @return the composite function.
     * @deprecated as of 3.1 replaced by {@link #compose(UnivariateDifferentiableFunction...)}
     */
    public static DifferentiableUnivariateFunction compose(final DifferentiableUnivariateFunction ... f) {
        return new DifferentiableUnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                double r = x;
                for (int i = f.length - 1; i >= 0; i--) {
                    r = f[i].value(r);
                }
                return r;
            }

            /** {@inheritDoc} */
            public UnivariateFunction derivative() {
                return new UnivariateFunction() {
                    /** {@inheritDoc} */
                    public double value(double x) {
                        double p = 1;
                        double r = x;
                        for (int i = f.length - 1; i >= 0; i--) {
                            p *= f[i].derivative().value(r);
                            r = f[i].value(r);
                        }
                        return p;
                    }
                };
            }
        };
    }

    /**
     * Adds functions.
     *
     * @param f List of functions.
     * @return a function that computes the sum of the functions.
     */
    public static UnivariateFunction add(final UnivariateFunction ... f) {
        return new UnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                double r = f[0].value(x);
                for (int i = 1; i < f.length; i++) {
                    r += f[i].value(x);
                }
                return r;
            }
        };
    }

    /**
     * Adds functions.
     *
     * @param f List of functions.
     * @return a function that computes the sum of the functions.
     * @since 3.1
     */
    public static UnivariateDifferentiableFunction add(final UnivariateDifferentiableFunction ... f) {
        return new UnivariateDifferentiableFunction() {

            /** {@inheritDoc} */
            public double value(final double t) {
                double r = f[0].value(t);
                for (int i = 1; i < f.length; i++) {
                    r += f[i].value(t);
                }
                return r;
            }

            /** {@inheritDoc}
             * @throws DimensionMismatchException if functions are not consistent with each other
             */
            public DerivativeStructure value(final DerivativeStructure t)
                throws DimensionMismatchException {
                DerivativeStructure r = f[0].value(t);
                for (int i = 1; i < f.length; i++) {
                    r = r.add(f[i].value(t));
                }
                return r;
            }

        };
    }

    /**
     * Adds functions.
     *
     * @param f List of functions.
     * @return a function that computes the sum of the functions.
     * @deprecated as of 3.1 replaced by {@link #add(UnivariateDifferentiableFunction...)}
     */
    @Deprecated
    public static DifferentiableUnivariateFunction add(final DifferentiableUnivariateFunction ... f) {
        return new DifferentiableUnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                double r = f[0].value(x);
                for (int i = 1; i < f.length; i++) {
                    r += f[i].value(x);
                }
                return r;
            }

            /** {@inheritDoc} */
            public UnivariateFunction derivative() {
                return new UnivariateFunction() {
                    /** {@inheritDoc} */
                    public double value(double x) {
                        double r = f[0].derivative().value(x);
                        for (int i = 1; i < f.length; i++) {
                            r += f[i].derivative().value(x);
                        }
                        return r;
                    }
                };
            }
        };
    }

    /**
     * Multiplies functions.
     *
     * @param f List of functions.
     * @return a function that computes the product of the functions.
     */
    public static UnivariateFunction multiply(final UnivariateFunction ... f) {
        return new UnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                double r = f[0].value(x);
                for (int i = 1; i < f.length; i++) {
                    r *= f[i].value(x);
                }
                return r;
            }
        };
    }

    /**
     * Multiplies functions.
     *
     * @param f List of functions.
     * @return a function that computes the product of the functions.
     * @since 3.1
     */
    public static UnivariateDifferentiableFunction multiply(final UnivariateDifferentiableFunction ... f) {
        return new UnivariateDifferentiableFunction() {

            /** {@inheritDoc} */
            public double value(final double t) {
                double r = f[0].value(t);
                for (int i = 1; i < f.length; i++) {
                    r  *= f[i].value(t);
                }
                return r;
            }

            /** {@inheritDoc} */
            public DerivativeStructure value(final DerivativeStructure t) {
                DerivativeStructure r = f[0].value(t);
                for (int i = 1; i < f.length; i++) {
                    r = r.multiply(f[i].value(t));
                }
                return r;
            }

        };
    }

    /**
     * Multiplies functions.
     *
     * @param f List of functions.
     * @return a function that computes the product of the functions.
     * @deprecated as of 3.1 replaced by {@link #multiply(UnivariateDifferentiableFunction...)}
     */
    public static DifferentiableUnivariateFunction multiply(final DifferentiableUnivariateFunction ... f) {
        return new DifferentiableUnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                double r = f[0].value(x);
                for (int i = 1; i < f.length; i++) {
                    r *= f[i].value(x);
                }
                return r;
            }

            /** {@inheritDoc} */
            public UnivariateFunction derivative() {
                return new UnivariateFunction() {
                    /** {@inheritDoc} */
                    public double value(double x) {
                        double sum = 0;
                        for (int i = 0; i < f.length; i++) {
                            double prod = f[i].derivative().value(x);
                            for (int j = 0; j < f.length; j++) {
                                if (i != j) {
                                    prod *= f[j].value(x);
                                }
                            }
                            sum += prod;
                        }
                        return sum;
                    }
                };
            }
        };
    }

    /**
     * Returns the univariate function

     * {@code h(x) = combiner(f(x), g(x))}.
     *
     * @param combiner Combiner function.
     * @param f Function.
     * @param g Function.
     * @return the composite function.
     */
    public static UnivariateFunction combine(final BivariateFunction combiner,
                                             final UnivariateFunction f,
                                             final UnivariateFunction g) {
        return new UnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                return combiner.value(f.value(x), g.value(x));
            }
        };
    }

    /**
     * Returns a MultivariateFunction h(x[]) defined by

     * h(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...),f(x[x.length-1]))
     *

     *
     * @param combiner Combiner function.
     * @param f Function.
     * @param initialValue Initial value.
     * @return a collector function.
     */
    public static MultivariateFunction collector(final BivariateFunction combiner,
                                                 final UnivariateFunction f,
                                                 final double initialValue) {
        return new MultivariateFunction() {
            /** {@inheritDoc} */
            public double value(double[] point) {
                double result = combiner.value(initialValue, f.value(point[0]));
                for (int i = 1; i < point.length; i++) {
                    result = combiner.value(result, f.value(point[i]));
                }
                return result;
            }
        };
    }

    /**
     * Returns a MultivariateFunction h(x[]) defined by

     * h(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...),x[x.length-1])
     *

     *
     * @param combiner Combiner function.
     * @param initialValue Initial value.
     * @return a collector function.
     */
    public static MultivariateFunction collector(final BivariateFunction combiner,
                                                 final double initialValue) {
        return collector(combiner, new Identity(), initialValue);
    }

    /**
     * Creates a unary function by fixing the first argument of a binary function.
     *
     * @param f Binary function.
     * @param fixed Value to which the first argument of {@code f} is set.
     * @return the unary function h(x) = f(fixed, x)
     */
    public static UnivariateFunction fix1stArgument(final BivariateFunction f,
                                                    final double fixed) {
        return new UnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                return f.value(fixed, x);
            }
        };
    }
    /**
     * Creates a unary function by fixing the second argument of a binary function.
     *
     * @param f Binary function.
     * @param fixed Value to which the second argument of {@code f} is set.
     * @return the unary function h(x) = f(x, fixed)
     */
    public static UnivariateFunction fix2ndArgument(final BivariateFunction f,
                                                    final double fixed) {
        return new UnivariateFunction() {
            /** {@inheritDoc} */
            public double value(double x) {
                return f.value(x, fixed);
            }
        };
    }

    /**
     * Samples the specified univariate real function on the specified interval.
     *

     * The interval is divided equally into {@code n} sections and sample points
     * are taken from {@code min} to {@code max - (max - min) / n}; therefore
     * {@code f} is not sampled at the upper bound {@code max}.
     *
     * @param f Function to be sampled
     * @param min Lower bound of the interval (included).
     * @param max Upper bound of the interval (excluded).
     * @param n Number of sample points.
     * @return the array of samples.
     * @throws NumberIsTooLargeException if the lower bound {@code min} is
     * greater than, or equal to the upper bound {@code max}.
     * @throws NotStrictlyPositiveException if the number of sample points
     * {@code n} is negative.
     */
    public static double[] sample(UnivariateFunction f, double min, double max, int n)
       throws NumberIsTooLargeException, NotStrictlyPositiveException {

        if (n <= 0) {
            throw new NotStrictlyPositiveException(
                    LocalizedFormats.NOT_POSITIVE_NUMBER_OF_SAMPLES,
                    Integer.valueOf(n));
        }
        if (min >= max) {
            throw new NumberIsTooLargeException(min, max, false);
        }

        final double[] s = new double[n];
        final double h = (max - min) / n;
        for (int i = 0; i < n; i++) {
            s[i] = f.value(min + i * h);
        }
        return s;
    }

    /** Convert a {@link UnivariateDifferentiableFunction} into a {@link DifferentiableUnivariateFunction}.
     * @param f function to convert
     * @return converted function
     * @deprecated this conversion method is temporary in version 3.1, as the {@link
     * DifferentiableUnivariateFunction} interface itself is deprecated
     */
    @Deprecated
    public static DifferentiableUnivariateFunction toDifferentiableUnivariateFunction(final UnivariateDifferentiableFunction f) {
        return new DifferentiableUnivariateFunction() {

            /** {@inheritDoc} */
            public double value(final double x) {
                return f.value(x);
            }

            /** {@inheritDoc} */
            public UnivariateFunction derivative() {
                return new UnivariateFunction() {
                    /** {@inheritDoc} */
                    public double value(final double x) {
                        return f.value(new DerivativeStructure(1, 1, 0, x)).getPartialDerivative(1);
                    }
                };
            }

        };
    }

    /** Convert a {@link DifferentiableUnivariateFunction} into a {@link UnivariateDifferentiableFunction}.
     *

     * Note that the converted function is able to handle {@link DerivativeStructure} up to order one.
     * If the function is called with higher order, a {@link NumberIsTooLargeException} will be thrown.
     *

     * @param f function to convert
     * @return converted function
     * @deprecated this conversion method is temporary in version 3.1, as the {@link
     * DifferentiableUnivariateFunction} interface itself is deprecated
     */
    @Deprecated
    public static UnivariateDifferentiableFunction toUnivariateDifferential(final DifferentiableUnivariateFunction f) {
        return new UnivariateDifferentiableFunction() {

            /** {@inheritDoc} */
            public double value(final double x) {
                return f.value(x);
            }

            /** {@inheritDoc}
             * @exception NumberIsTooLargeException if derivation order is greater than 1
             */
            public DerivativeStructure value(final DerivativeStructure t)
                throws NumberIsTooLargeException {
                switch (t.getOrder()) {
                    case 0 :
                        return new DerivativeStructure(t.getFreeParameters(), 0, f.value(t.getValue()));
                    case 1 : {
                        final int parameters = t.getFreeParameters();
                        final double[] derivatives = new double[parameters + 1];
                        derivatives[0] = f.value(t.getValue());
                        final double fPrime = f.derivative().value(t.getValue());
                        int[] orders = new int[parameters];
                        for (int i = 0; i < parameters; ++i) {
                            orders[i] = 1;
                            derivatives[i + 1] = fPrime * t.getPartialDerivative(orders);
                            orders[i] = 0;
                        }
                        return new DerivativeStructure(parameters, 1, derivatives);
                    }
                    default :
                        throw new NumberIsTooLargeException(t.getOrder(), 1, true);
                }
            }

        };
    }

    /** Convert a {@link MultivariateDifferentiableFunction} into a {@link DifferentiableMultivariateFunction}.
     * @param f function to convert
     * @return converted function
     * @deprecated this conversion method is temporary in version 3.1, as the {@link
     * DifferentiableMultivariateFunction} interface itself is deprecated
     */
    @Deprecated
    public static DifferentiableMultivariateFunction toDifferentiableMultivariateFunction(final MultivariateDifferentiableFunction f) {
        return new DifferentiableMultivariateFunction() {

            /** {@inheritDoc} */
            public double value(final double[] x) {
                return f.value(x);
            }

            /** {@inheritDoc} */
            public MultivariateFunction partialDerivative(final int k) {
                return new MultivariateFunction() {
                    /** {@inheritDoc} */
                    public double value(final double[] x) {

                        final int n = x.length;

                        // delegate computation to underlying function
                        final DerivativeStructure[] dsX = new DerivativeStructure[n];
                        for (int i = 0; i < n; ++i) {
                            if (i == k) {
                                dsX[i] = new DerivativeStructure(1, 1, 0, x[i]);
                            } else {
                                dsX[i] = new DerivativeStructure(1, 1, x[i]);
                            }
                        }
                        final DerivativeStructure y = f.value(dsX);

                        // extract partial derivative
                        return y.getPartialDerivative(1);

                    }
                };
            }

            public MultivariateVectorFunction gradient() {
                return new MultivariateVectorFunction() {
                    /** {@inheritDoc} */
                    public double[] value(final double[] x) {

                        final int n = x.length;

                        // delegate computation to underlying function
                        final DerivativeStructure[] dsX = new DerivativeStructure[n];
                        for (int i = 0; i < n; ++i) {
                            dsX[i] = new DerivativeStructure(n, 1, i, x[i]);
                        }
                        final DerivativeStructure y = f.value(dsX);

                        // extract gradient
                        final double[] gradient = new double[n];
                        final int[] orders = new int[n];
                        for (int i = 0; i < n; ++i) {
                            orders[i]   = 1;
                            gradient[i] = y.getPartialDerivative(orders);
                            orders[i]   = 0;
                        }

                        return gradient;

                    }
                };
            }

        };
    }

    /** Convert a {@link DifferentiableMultivariateFunction} into a {@link MultivariateDifferentiableFunction}.
     *

     * Note that the converted function is able to handle {@link DerivativeStructure} elements
     * that all have the same number of free parameters and order, and with order at most 1.
     * If the function is called with inconsistent numbers of free parameters or higher order, a
     * {@link DimensionMismatchException} or a {@link NumberIsTooLargeException} will be thrown.
     *

     * @param f function to convert
     * @return converted function
     * @deprecated this conversion method is temporary in version 3.1, as the {@link
     * DifferentiableMultivariateFunction} interface itself is deprecated
     */
    @Deprecated
    public static MultivariateDifferentiableFunction toMultivariateDifferentiableFunction(final DifferentiableMultivariateFunction f) {
        return new MultivariateDifferentiableFunction() {

            /** {@inheritDoc} */
            public double value(final double[] x) {
                return f.value(x);
            }

            /** {@inheritDoc}
             * @exception NumberIsTooLargeException if derivation order is higher than 1
             * @exception DimensionMismatchException if numbers of free parameters are inconsistent
             */
            public DerivativeStructure value(final DerivativeStructure[] t)
                throws DimensionMismatchException, NumberIsTooLargeException {

                // check parameters and orders limits
                final int parameters = t[0].getFreeParameters();
                final int order      = t[0].getOrder();
                final int n          = t.length;
                if (order > 1) {
                    throw new NumberIsTooLargeException(order, 1, true);
                }

                // check all elements in the array are consistent
                for (int i = 0; i < n; ++i) {
                    if (t[i].getFreeParameters() != parameters) {
                        throw new DimensionMismatchException(t[i].getFreeParameters(), parameters);
                    }

                    if (t[i].getOrder() != order) {
                        throw new DimensionMismatchException(t[i].getOrder(), order);
                    }
                }

                // delegate computation to underlying function
                final double[] point = new double[n];
                for (int i = 0; i < n; ++i) {
                    point[i] = t[i].getValue();
                }
                final double value      = f.value(point);
                final double[] gradient = f.gradient().value(point);

                // merge value and gradient into one DerivativeStructure
                final double[] derivatives = new double[parameters + 1];
                derivatives[0] = value;
                final int[] orders = new int[parameters];
                for (int i = 0; i < parameters; ++i) {
                    orders[i] = 1;
                    for (int j = 0; j < n; ++j) {
                        derivatives[i + 1] += gradient[j] * t[j].getPartialDerivative(orders);
                    }
                    orders[i] = 0;
                }

                return new DerivativeStructure(parameters, order, derivatives);

            }

        };
    }

    /** Convert a {@link MultivariateDifferentiableVectorFunction} into a {@link DifferentiableMultivariateVectorFunction}.
     * @param f function to convert
     * @return converted function
     * @deprecated this conversion method is temporary in version 3.1, as the {@link
     * DifferentiableMultivariateVectorFunction} interface itself is deprecated
     */
    @Deprecated
    public static DifferentiableMultivariateVectorFunction toDifferentiableMultivariateVectorFunction(final MultivariateDifferentiableVectorFunction f) {
        return new DifferentiableMultivariateVectorFunction() {

            /** {@inheritDoc} */
            public double[] value(final double[] x) {
                return f.value(x);
            }

            public MultivariateMatrixFunction jacobian() {
                return new MultivariateMatrixFunction() {
                    /** {@inheritDoc} */
                    public double[][] value(final double[] x) {

                        final int n = x.length;

                        // delegate computation to underlying function
                        final DerivativeStructure[] dsX = new DerivativeStructure[n];
                        for (int i = 0; i < n; ++i) {
                            dsX[i] = new DerivativeStructure(n, 1, i, x[i]);
                        }
                        final DerivativeStructure[] y = f.value(dsX);

                        // extract Jacobian
                        final double[][] jacobian = new double[y.length][n];
                        final int[] orders = new int[n];
                        for (int i = 0; i < y.length; ++i) {
                            for (int j = 0; j < n; ++j) {
                                orders[j]      = 1;
                                jacobian[i][j] = y[i].getPartialDerivative(orders);
                                orders[j]      = 0;
                            }
                        }

                        return jacobian;

                    }
                };
            }

        };
    }

    /** Convert a {@link DifferentiableMultivariateVectorFunction} into a {@link MultivariateDifferentiableVectorFunction}.
     *

     * Note that the converted function is able to handle {@link DerivativeStructure} elements
     * that all have the same number of free parameters and order, and with order at most 1.
     * If the function is called with inconsistent numbers of free parameters or higher order, a
     * {@link DimensionMismatchException} or a {@link NumberIsTooLargeException} will be thrown.
     *

     * @param f function to convert
     * @return converted function
     * @deprecated this conversion method is temporary in version 3.1, as the {@link
     * DifferentiableMultivariateFunction} interface itself is deprecated
     */
    @Deprecated
    public static MultivariateDifferentiableVectorFunction toMultivariateDifferentiableVectorFunction(final DifferentiableMultivariateVectorFunction f) {
        return new MultivariateDifferentiableVectorFunction() {

            /** {@inheritDoc} */
            public double[] value(final double[] x) {
                return f.value(x);
            }

            /** {@inheritDoc}
             * @exception NumberIsTooLargeException if derivation order is higher than 1
             * @exception DimensionMismatchException if numbers of free parameters are inconsistent
             */
            public DerivativeStructure[] value(final DerivativeStructure[] t)
                throws DimensionMismatchException, NumberIsTooLargeException {

                // check parameters and orders limits
                final int parameters = t[0].getFreeParameters();
                final int order      = t[0].getOrder();
                final int n          = t.length;
                if (order > 1) {
                    throw new NumberIsTooLargeException(order, 1, true);
                }

                // check all elements in the array are consistent
                for (int i = 0; i < n; ++i) {
                    if (t[i].getFreeParameters() != parameters) {
                        throw new DimensionMismatchException(t[i].getFreeParameters(), parameters);
                    }

                    if (t[i].getOrder() != order) {
                        throw new DimensionMismatchException(t[i].getOrder(), order);
                    }
                }

                // delegate computation to underlying function
                final double[] point = new double[n];
                for (int i = 0; i < n; ++i) {
                    point[i] = t[i].getValue();
                }
                final double[] value      = f.value(point);
                final double[][] jacobian = f.jacobian().value(point);

                // merge value and Jacobian into a DerivativeStructure array
                final DerivativeStructure[] merged = new DerivativeStructure[value.length];
                for (int k = 0; k < merged.length; ++k) {
                    final double[] derivatives = new double[parameters + 1];
                    derivatives[0] = value[k];
                    final int[] orders = new int[parameters];
                    for (int i = 0; i < parameters; ++i) {
                        orders[i] = 1;
                        for (int j = 0; j < n; ++j) {
                            derivatives[i + 1] += jacobian[k][j] * t[j].getPartialDerivative(orders);
                        }
                        orders[i] = 0;
                    }
                    merged[k] = new DerivativeStructure(parameters, order, derivatives);
                }

                return merged;

            }

        };
    }

}


text:
//
// Created by kevin on 26/07/16.
//

#ifndef CPP_CSP_REGULAR_H
#define CPP_CSP_REGULAR_H

#include "../process.h"
#include "../chan.h"
#include "../timer.h"

namespace csp
{
    namespace plugnplay
    {
        /*! \class regular
         * \brief A process that outputs a given value at regular intervals.
         *
         * \tparam T The type that the process operates on.
         *
         * \author Kevin Chalmers
         *
         * \date 26/07/2016
         */
        template<typename T>
        class regular : public process
        {
        private:

            chan_out<T> _out; //<! The output channel from the process.

            T _value; //<! The value to output from the process.

            std::chrono::steady_clock::duration _interval; //<! The interval between outputs.

        public:
            /*!
             * \brief Creates a new regular process.
             *
             * \param[in] out The output channel from the process.
             * \param[in] value The value to output from the process.
             * \param[in] duration The interval between outputs.
             */
            regular(chan_out<T> out, T value, std::chrono::steady_clock::duration interval) noexcept
            : _out(out), _value(value), _interval(interval)
            {
            }

            /*!
             * \brief Executes the regular process.
             */
            void run() noexcept override final
            {
                timer t;
                auto next = t();
                while (true)
                {
                    _out(_value);
                    next += _interval;
                    t(next);
                }
            }
        };
    }
}

#endif //CPP_CSP_REGULAR_H


text:
<?php

namespace Oro\Bundle\TranslationBundle\Tests\Functional\DataFixtures;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Oro\Bundle\TestFrameworkBundle\Tests\Functional\DataFixtures\LoadBusinessUnit;
use Oro\Bundle\UserBundle\Entity\User;
use Oro\Bundle\UserBundle\Entity\UserManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

class LoadTranslationUsers extends AbstractFixture implements ContainerAwareInterface, DependentFixtureInterface
{
    use ContainerAwareTrait;

    const TRANSLATOR_USERNAME = 'translator';
    const TRANSLATOR_EMAIL = 'translator@example.com';

    /**
     * {@inheritdoc}
     */
    public function getDependencies()
    {
        return [
            LoadTranslationRoles::class, LoadBusinessUnit::class
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function load(ObjectManager $manager)
    {
        $this->loadTranslator($manager, $this->container->get('oro_user.manager'));
    }

    /**
     * @param ObjectManager $manager
     * @param UserManager $userManager
     */
    public function loadTranslator(ObjectManager $manager, UserManager $userManager)
    {
        $role = $manager->getRepository('OroUserBundle:Role')
            ->findOneBy(['role' => LoadTranslationRoles::ROLE_TRANSLATOR]);

        $organization = $manager->getRepository('OroOrganizationBundle:Organization')->findOneBy([]);

        /* @var $user User */
        $user = $userManager->createUser();
        $user
            ->setOwner($this->getReference('business_unit'))
            ->setFirstName('Demo')
            ->setLastName('Translator')
            ->setEmail(self::TRANSLATOR_EMAIL)
            ->setPlainPassword(self::TRANSLATOR_USERNAME)
            ->addRole($role)
            ->setEnabled(true)
            ->setUsername(self::TRANSLATOR_USERNAME)
            ->setOrganization($organization)
            ->addOrganization($organization);

        $userManager->updateUser($user);
    }
}


text:
from amazonia.classes.single_instance import SingleInstance
from amazonia.classes.single_instance_config import SingleInstanceConfig
from amazonia.classes.sns import SNS
from troposphere import ec2, Ref, Template

def main():
    vpc = ec2.VPC('MyVPC',
                  CidrBlock='10.0.0.0/16')
    subnet = ec2.Subnet('MySubnet',
                        AvailabilityZone='ap-southeast-2a',
                        VpcId=Ref(vpc),
                        CidrBlock='10.0.1.0/24')
    template = Template()
    sns_topic = SNS(template)
    single_instance_config = SingleInstanceConfig(
        keypair='INSERT_YOUR_KEYPAIR_HERE',
        si_image_id='ami-53371f30',
        si_instance_type='t2.micro',
        vpc=Ref(vpc),
        subnet=Ref(subnet),
        is_nat=True,
        instance_dependencies=vpc.title,
        public_hosted_zone_name=None,
        iam_instance_profile_arn=None,
        sns_topic=sns_topic,
        availability_zone='ap-southeast-2a'
    )
    SingleInstance(title='nat1',
                   template=template,
                   single_instance_config=single_instance_config
                   )

    template.add_resource(vpc)
    template.add_resource(subnet)
    print(template.to_json(indent=2, separators=(',', ': ')))

if __name__ == '__main__':
    main()


text:
package org.drools.examples.conway;

import java.io.Serializable;

/**
 * CellState enumerates all of the valid states that a Cell may
 * be in.
 *
 * @see Cell
 * @see CellGridImpl
 */
public class CellState implements Serializable {

    public static final CellState LIVE = new CellState( "LIVE" );
    public static final CellState DEAD = new CellState( "DEAD" );

    private final String          name;

    private CellState(final String name) {
        this.name = name;
    }

    public String toString() {
        return "CellState: " + this.name;
    }
}


text:
#include "CameraEntity.h"

CCameraEntity::CCameraEntity(const vec3f& position, const vec3f& target, float32 fov, const vec3f& up, float32 zNear, float32 zFar, float32 aspect)
:
m_vPosition(position)
{
    m_mProjection = mat4f::createPerspective(fov, aspect, zNear, zFar);
    m_mView = mat4f::createLookAt(m_vPosition, target, up);
    m_qQuatuernion = Quatf::frommat(m_mView);
}

CCameraEntity::~CCameraEntity()
{
}

void CCameraEntity::Update(float32 dt)
{
}
const Quatf& CCameraEntity::GetQuaternionRepresentation()
{
    return m_qQuatuernion;
}
void CCameraEntity::SetQuaternion(Quatf new_quat)
{
    //set the new quaternion
    m_qQuatuernion = new_quat;

    //extract view matrix from quaternion
    m_mView = m_qQuatuernion.transform();

    //update world view matrix
    m_mWorldView = m_mView.inverse();
    m_mWorldView[12] = m_vPosition.x;
    m_mWorldView[13] = m_vPosition.y;
    m_mWorldView[14] = m_vPosition.z;
    m_mView = m_mWorldView.inverse();
}
const mat4f& CCameraEntity::GetViewMatrix()
{
    //get the view matrix of the camera
    m_mView = m_qQuatuernion.transform();
    m_mWorldView = m_mView.inverse();
    m_mWorldView[12] = m_vPosition.x;
    m_mWorldView[13] = m_vPosition.y;
    m_mWorldView[14] = m_vPosition.z;
    m_mView = m_mWorldView.inverse();

    return m_mView;
}
void CCameraEntity::SetPosition(const vec3f& position)
{
    m_vPosition = position;
}

void CCameraEntity::SetProjectionMatrix(const mat4f& projection)
{
    m_mProjection = projection;
}

void CCameraEntity::Render(CShader* shader)
{
    if(shader->matview != -1 )
        glUniformMatrix4fv(shader->matview, 1, GL_FALSE, &GetViewMatrix()[0]);

    if(shader->matproj != -1)
       glUniformMatrix4fv(shader->matview, 1, GL_FALSE, &m_mProjection[0]);
}
vec3f CCameraEntity::GetPosition()
{
    m_mWorldView = m_mView.inverse();
    return vec3f(m_mWorldView[12], m_mWorldView[13], m_mWorldView[14]);
}
vec3f CCameraEntity::GetForwardVector()
{
     m_mWorldView = m_mView.inverse();
    return vec3f(-m_mWorldView[8], -m_mWorldView[9], -m_mWorldView[10]);
}
vec3f CCameraEntity::GetUpVector()
{
    m_mWorldView = m_mView.inverse();
    return vec3f(m_mWorldView[4], m_mWorldView[5], m_mWorldView[6]);
}
vec3f CCameraEntity::GetRigthVector()
{
    m_mWorldView = m_mView.inverse();
    return vec3f(m_mWorldView[0], m_mWorldView[1], m_mWorldView[2]);
}


text:
@echo off

REM Runs the bounds analyses

set OPTIONS=-show progress -stats! -stats valid -stats perMethod

if /i "%1" == "fast" goto doFast

@echo complete check
copy Framework\AllDLL.txt Framework\DLLs.txt
goto analyze

:doFast
@echo fast check
shift
copy Framework\ShortDLL.txt Framework\DLLs.txt

:analyze

@echo Testing Clousot with the Basic tests

for /F "eol=; tokens=1,2* delims=," %%i in (Analyses.txt) do (
 @echo . Testing the abstract domain: %%i
 cd Basic
 call Run.bat %%i %%j  %OPTIONS%
 if not errorlevel 0 set error=1
 cd ..
)

@echo Testing Clousot with the .NET framework DLLs

for /F "eol=; tokens=1,2* delims=," %%i in (Analyses.txt) do (
 @echo . Testing the abstract domain: %%i
 cd Framework
 call Run.bat %%i %%j  %OPTIONS%
 if not errorlevel 0 set error=1
 cd ..
)

REM Default: set the DLLs to be analyzed to all...
copy Framework\AllDLL.txt DLLs.txt

if defined %error% goto exitWithError

exit /b 0

:exitWithError
@echo failed
exit /b 1


text:
all:
	composer run-script qa-all --timeout=0

all-coverage:
	composer run-script qa-all-coverage --timeout=0

ci:
	composer run-script qa-ci --timeout=0

ci-extended:
	composer run-script qa-ci-extended --timeout=0

contrib:
	composer run-script qa-contrib --timeout=0

init:
	composer ensure-installed

cs:
	composer cs

cs-fix:
	composer cs-fix

unit:
	composer run-script unit --timeout=0

unit-coverage:
	composer run-script unit-coverage --timeout=0

ci-coverage: init
	composer ci-coverage

benchmark:
	./vendor/bin/phpbench run benchmarks/ --progress=dots --store --report='generator: "table", cols: ["benchmark", "subject", "params", "best", "mean", "mode", "worst", "diff"], break: ["benchmark"], sort: {mean: "asc"}'

travis-benchmark:
	mkdir -p .phpbench_storage/xml
	mkdir -p .phpbench_storage/store
	mkdir -p .phpbench_storage/csv
	./vendor/bin/phpbench run benchmarks/ --progress=travis --store --dump-file=.phpbench_storage/xml/latest.xml --context=$(TRAVIS_BUILD_NUMBER) -vvv --report='generator: "table", cols: ["benchmark", "subject", "params", "best", "mean", "mode", "worst", "diff"], break: ["benchmark"], sort: {mean: "asc"}'
	if [ -f ".phpbench_storage/xml/previous.xml" ]; then ./vendor/bin/phpbench report --file=.phpbench_storage/xml/previous.xml --file=.phpbench_storage/xml/latest.xml --report='generator: "table", compare: "revs", cols: ["subject", "params", "mean"], compare_fields: ["best", "mean", "mode", "worst"]'; fi;
	mv .phpbench_storage/xml/latest.xml .phpbench_storage/xml/previous.xml

travis-benchmark-delimited:
	if [ -f ".phpbench_storage/xml/previous.xml" ]; then ./vendor/bin/phpbench report --file=.phpbench_storage/xml/previous.xml --report='generator: "table", cols: ["benchmark", "subject", "params", "best", "mean", "mode", "worst", "diff"], break: ["benchmark"], sort: {mean: "asc"}' --output=delimited; fi;
	if [ -f ".phpbench_storage/xml/previous.xml" ]; then cat .phpbench_storage/csv/previous.csv; fi;


text:
@implementation BeamMinimalExampleProvider

-(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player albumForTrack:(NSUInteger)trackNumber {
    return @"Example Album that is very long and therefore needs scrolling";
}

-(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player artistForTrack:(NSUInteger)trackNumber {
    return @"Cim Tooks and the Pineapples";
}

-(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player titleForTrack:(NSUInteger)trackNumber {
    return @"If the Foo sings bar, it makes me wanna baz.";
}

-(CGFloat)musicPlayer:(BeamMusicPlayerViewController *)player lengthForTrack:(NSUInteger)trackNumber {
    return 125;
}

-(NSInteger)numberOfTracksInPlayer:(BeamMusicPlayerViewController *)player {
    return 3;
}

-(void)musicPlayer:(BeamMusicPlayerViewController *)player artworkForTrack:(NSUInteger)trackNumber receivingBlock:(BeamMusicPlayerReceivingBlock)receivingBlock {
    NSString* url = @"http://a3.mzstatic.com/us/r1000/045/Features/7f/50/ee/dj.zygromnm.600x600-75.jpg";

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
        NSData* urlData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];

        UIImage* image = [UIImage imageWithData:urlData];
        receivingBlock(image,nil);
    });
}

-(CGFloat)musicPlayer:(BeamMusicPlayerViewController*)player currentPositionForTrack:(NSUInteger)trackNumber {
    return player.currentPlaybackPosition + 1.0f;
}

@end


text:
from SimpleCV.Features.HaarCascade import *
from SimpleCV.Features.Features import *
from SimpleCV.Features.Detection import *
from SimpleCV.Features.BlobMaker import *
from SimpleCV.Features.Blob import *
from SimpleCV.Features.BOFFeatureExtractor import *
from SimpleCV.Features.FeatureExtractorBase import *
from SimpleCV.Features.HueHistogramFeatureExtractor import *
from SimpleCV.Features.MorphologyFeatureExtractor import *
from SimpleCV.Features.EdgeHistogramFeatureExtractor import *
from SimpleCV.Features.HaarLikeFeatureExtractor import *
from SimpleCV.Features.HaarLikeFeature import *
from SimpleCV.Features.PlayingCards import *
from SimpleCV.Features.FeatureUtils import *
from SimpleCV.Features.FaceRecognizer import *
from SimpleCV.Features.Superpixels import *


text:
#ifndef _Executor_LocalAuth_h
#define _Executor_LocalAuth_h

#include "Defines.h"

EXECUTOR_LINKAGE
int CreateLocalAuthFile(
    const char* path,
    int uid,
    int gid);

EXECUTOR_LINKAGE
int CheckLocalAuthToken(
    const char* path,
    const char* token);

EXECUTOR_LINKAGE
int StartLocalAuthentication(
    const char* user,
    char challenge[EXECUTOR_BUFFER_SIZE]);

EXECUTOR_LINKAGE
int FinishLocalAuthentication(
    const char* challenge,
    const char* response);

#endif /* _Executor_LocalAuth_h */


text:
'use strict';

import Mplayer from 'mplayer';
import EventEmitter from 'events';
import fsp from 'fs-promise';
import glob from 'glob-promise';

const TMP_DIR = '.bohemian2/tmp';
const TMP_BASE_NAME = 'track';
const MAX_ATTEMPTS = 3;

export default class Player extends EventEmitter {
  constructor(client) {
    super();
    this.playerStatus = {};
    this.client = client;
    this.player = new Mplayer();
    this.currentTime = 0;
    this.isReady = false;
    this.tmpDir = [this.getUserHome(), TMP_DIR].join('/');
    this.tmpFileBase = [this.tmpDir, TMP_BASE_NAME].join('/');
    this.registerListeners();
  }

  registerListeners() {
    this.player.on('ready', () => {
      this.isReady = true;
    });
    this.player.on('status', (status) => {
      this.playerStatus = status;
      this.emit('status', status);
    });
    this.player.on('stop', () => {
      this.emit('stop');
    });
    this.player.on('time', (time) => {
      this.currentTime = parseFloat(time);
    });

    process.on('exit', () => this.cleanup());
    process.on('SIGINT', () => this.cleanup());
    process.on('uncaughtException', () => this.cleanup());
  }

  waitUntilReady() {
    return new Promise((success) => {
      if (this.isReady) return success(true);
      return setTimeout(() => this.waitUntilReady().then(() => success), 100);
    });
  }

  hasContent() {
    return !!(this.player && this.playerStatus.filename);
  }

  playPause() {
    if (this.hasContent()) {
      if (this.playerStatus.playing) {
        this.player.pause();
      } else {
        this.player.play();
      }
    }
  }

  playTrack(track, attemptNumber = 0) {
    return this.cleanup()
      .then(() => fsp.ensureDir(this.tmpDir))
      .then(() => this.client.downloadTrack(track, this.tmpFileBase))
      .then((info) => this.waitUntilReady()
        .then(() => {
          this.player.openFile(info.file);
          this.player.play();
          return info;
        }))
      .catch((error) => {
        if (attemptNumber < MAX_ATTEMPTS) {
          process.stdout.write('Unable to load track. Trying again...\n');
          return new Promise((success, failure) => setTimeout(() =>
            this.playTrack(track, attemptNumber + 1).then(success, failure), 2000));
        }
        throw error;
      });
  }

  seekRelative(seconds) {
    if (this.hasContent()) this.player.seek(this.currentTime + seconds);
  }

  cleanup() {
    // Clean up known tmp tracks, and remove tmp dir only if empty
    return glob(`${this.tmpFileBase}.*`)
      .then((tracks) => Promise.all(tracks.map((t) => fsp.unlink(t))))
      .then(() => fsp.rmdir(this.tmpDir))
      .catch((error) => {
        if (error.code && ['ENOENT', 'ENOTEMPTY'].indexOf(error.code) < 0) throw error;
      });
  }

  getUserHome() {
    return process.env.HOME || process.env.USERPROFILE;
  }
}


text:
chef_group 'provisioners' do
end
# To be able to recreate the provisioners group
chef_acl 'groups' do
  rights :create, groups: 'provisioners'
end
# To be able to add others to the provisioners group
chef_acl 'groups/provisioners' do
  rights [ :read, :update ], groups: 'provisioners'
end
# To be able to create and delete machines
chef_acl 'nodes' do
  rights :all, groups: 'provisioners'
end
chef_acl 'clients' do
  rights :all, groups: 'provisioners'
end

# To be able to create and delete load balancers and images
chef_acl 'data' do
  rights [ :read, :create ], groups: 'provisioners'
  recursive false
end
%w(images load_balancers).each do |data_bag_name|
  chef_data_bag data_bag_name do
  end
  chef_acl "data/#{data_bag_name}" do
    rights :all, groups: 'provisioners'
  end
end

#
# Now let's make a provisioning machine
#
machine 'provisioning-machine' do
  recipe 'my_infrastructure'
end
chef_group 'provisioners' do
  clients 'provisioning-machine'
end


text:
{% load static %}
{% load fontawesome %}

<!doctype html>

        <title>{% block title %} {% endblock %}</title>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta name="theme-color" content="#2a3439" />
        <meta name="author" content="Joris den Ouden">

        <link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,300,400italic' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}" />

        {% block css %} {% endblock %}

        <link rel="icon" href="{% static 'favicon.ico' %}">
        {% fontawesome_stylesheet %}

{{ SITE_URL }}

            {% if not hide_logo %}

            {% endif %}

            {% block body %} {% endblock %}

            {% if not hide_footer %}

                    © {{ COPYRIGHT_NAME }} {{ COPYRIGHT_YEAR }}

            {% endif %}

        {% block js %} {% endblock %}