text:
span.menu {
	position: absolute;
	top: 28px;
	font-size: 1.4em;
	letter-spacing: 1px;
	color: #000;
}

.menu-container {
	/*position: absolute;
	top: 50%;
	left: 50%;
	margin: -20px 0 0 -65px;*/
	width: 8vh;
	height: 8vh;
	display: flex;
}

.menu-container input {
	display: none;
}

.menu-container label {
	position: relative;
	width: 30px;
	height: 30px;
	top: calc((100% - 50px)/2);
	left: calc((100% - 40px)/2);
	display: block;
	cursor: pointer;
	background: transparent;
}

/* Exit Icon */

.menu-container label:before,
.menu-container input:checked + label:before {
	content: '';
	position: absolute;
	top: 50%;
	margin-top: -2px;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: #000;
}

.menu-container label:before {
	-webkit-animation: animationOneReverse 1s ease forwards;
	animation: animationOneReverse 1s ease forwards;
}

@-webkit-keyframes animationOneReverse {
	0% { -webkit-transform: rotate(315deg); }
	25% { -webkit-transform: rotate(360deg); }
	50%, 100% { -webkit-transform: rotate(0deg); }
}
@keyframes animationOneReverse {
	0% { transform: rotate(315deg); }
	25% { transform: rotate(360deg); }
	50%, 100% { transform: rotate(0deg); }
}

.menu-container input:checked + label:before {
	-webkit-animation: animationOne 1s ease forwards;
	animation: animationOne 1s ease forwards;
}

@-webkit-keyframes animationOne {
	0%, 50% { -webkit-transform: rotate(0deg); }
	75% { -webkit-transform: rotate(360deg); }
	100% { -webkit-transform: rotate(315deg); }
}
@keyframes animationOne {
	0%, 50% { transform: rotate(0deg); }
	75% { transform: rotate(360deg); }
	100% { transform: rotate(315deg); }
}

.menu-container label:after,
.menu-container input:checked + label:after {
	content: '';
	position: absolute;
	top: 50%;
	margin-top: -2px;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: #000;
}

.menu-container label:after {
	-webkit-animation: animationTwoReverse 1s ease forwards;
	animation: animationTwoReverse 1s ease forwards;
}

@-webkit-keyframes animationTwoReverse {
	0% { -webkit-transform: rotate(405deg); }
	25% { -webkit-transform: rotate(450deg); }
	50%, 100% { -webkit-transform: rotate(0deg); }
}
@keyframes animationTwoReverse {
	0% { transform: rotate(405deg); }
	25% { transform: rotate(450deg); }
	50%, 100% { transform: rotate(0deg); }
}

.menu-container input:checked + label:after {
	-webkit-animation: animationTwo 1s ease forwards;
	animation: animationTwo 1s ease forwards;
}

@-webkit-keyframes animationTwo {
	0%, 50% { -webkit-transform: rotate(0deg); }
	75% { -webkit-transform: rotate(450deg); }
	100% { -webkit-transform: rotate(405deg); }
}
@keyframes animationTwo {
	0%, 50% { transform: rotate(0deg); }
	75% { transform: rotate(450deg); }
	100% { transform: rotate(405deg); }
}

/* Burger Icon */

.menu-container label .burger:before {
	content: '';
	position: absolute;
	top: 6px;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: #000;
	-webkit-animation: animationBurgerTopReverse 1s ease forwards;
	animation: animationBurgerTopReverse 1s ease forwards;
}

@-webkit-keyframes animationBurgerTopReverse {
	0%, 50% { -webkit-transform: translateY(12px); opacity: 0; }
	51% { -webkit-transform: translateY(12px); opacity: 1; }
	100% { -webkit-transform: translateY(0px); opacity: 1; }
}
@keyframes animationBurgerTopReverse {
	0%, 50% { transform: translateY(12px); opacity: 0; }
	51% { transform: translateY(12px); opacity: 1; }
	100% { transform: translateY(0px); opacity: 1; }
}

.menu-container input:checked + label .burger:before {
	-webkit-animation: animationBurgerTop 1s ease forwards;
	animation: animationBurgerTop 1s ease forwards;
}

@-webkit-keyframes animationBurgerTop {
	0% { -webkit-transform: translateY(0px); opacity: 1; }
	50% { -webkit-transform: translateY(12px); opacity: 1; }
	51%, 100% { -webkit-transform: translateY(12px); opacity: 0; }
}
@keyframes animationBurgerTop {
	0% { transform: translateY(0px); opacity: 1; }
	50% { transform: translateY(12px); opacity: 1; }
	51%, 100% { transform: translateY(12px); opacity: 0; }
}

.menu-container label .burger:after {
	content: '';
	position: absolute;
	bottom: 6px;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: #000;
	-webkit-animation: animationBurgerBottomReverse 1s ease forwards;
	animation: animationBurgerBottomReverse 1s ease forwards;
}

@-webkit-keyframes animationBurgerBottomReverse {
	0%, 50% { -webkit-transform: translateY(-12px); opacity: 0; }
	51% { -webkit-transform: translateY(-12px); opacity: 1; }
	100% { -webkit-transform: translateY(0px); opacity: 1; }
}
@keyframes animationBurgerBottomReverse {
	0%, 50% { transform: translateY(-12px); opacity: 0; }
	51% { transform: translateY(-12px); opacity: 1; }
	100% { transform: translateY(0px); opacity: 1; }
}

.menu-container input:checked + label .burger:after {
	-webkit-animation: animationBurgerBottom 1s ease forwards;
	animation: animationBurgerBottom 1s ease forwards;
}

@-webkit-keyframes animationBurgerBottom {
	0% { -webkit-transform: translateY(0px); opacity: 1; }
	50% { -webkit-transform: translateY(-12px); opacity: 1; }
	51%, 100% { -webkit-transform: translateY(-12px); opacity: 0; }
}
@keyframes animationBurgerBottom {
	0% { transform: translateY(0px); opacity: 1; }
	50% { transform: translateY(-12px); opacity: 1; }
	51%, 100% { transform: translateY(-12px); opacity: 0; }
}


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
The ciliated Protozoa. Characterization, classification and guide to the literature. 2nd revised Pergamon Press, Oxford, New York etc. : 268.

#### Original name
Puytoracia Raabe, 1972

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
var chai = require('chai');
var expect = chai.expect;
var colors = require('colors/safe');
var _ = require('lodash');
var fs = require('fs');
var git = require('git-rev');

function logExample(fn){
  runPrintingExample(fn,
    function logName(name){
      console.log(colors.gray('=========  ') + name + colors.gray('  ================'));
    },
    console.log,  //logTable
    console.log,  //logCode
    console.log,  //logSeparator
    identity      //screenShot
  )
}

function mdExample(fn,file,cb){
  git.long(function(commitHash){
    var buffer = [];

    runPrintingExample(fn,
      function logName(name){
        buffer.push('##### ' + name);
      },
      function logTable(table){
        //md files won't render color strings properly.
        table = stripColors(table);

        // indent table so is displayed preformatted text
        table = '    ' + (table.split('\n').join('\n    '));

        buffer.push(table);
      },
      function logCode(code){
        buffer.push('```javascript');
        buffer.push(stripColors(code));
        buffer.push('```');
      },
      function logSeparator(sep){
        buffer.push(stripColors(sep));
      },
      function logScreenShot(image){
          buffer.push('![table image](https://cdn.rawgit.com/jamestalmage/cli-table2/'
                  + commitHash + '/examples/screenshots/' + image + '.png)');
      }
    );

    fs.writeFileSync(file,buffer.join('\n'));

    if(cb){cb();}
  });
}

/**
 * Actually runs the tests and verifies the functions create the expected output.
 * @param name of the test suite, used in the mocha.describe call.
 * @param fn a function which creates the test suite.
 */
function runTest(name,fn){
  function testExample(name,fn,expected){
    it(name,function(){
      expect(fn().toString()).to.equal(expected.join('\n'));
    });
  }

  describe(name,function () {
    fn(testExample,identity);
  });
}

/**
 * Common execution for runs that print output (either to console or to a Markdown file);
 * @param fn - a function containing the tests/demos.
 * @param logName - callback to print the name of this test to the console or file.
 * @param logTable - callback to print the output of the table to the console or file.
 * @param logCode - callback to print the output of the table to the console or file.
 * @param logSeparator - callback to print extra whitespace between demos.
 * @param logScreenShot - write out a link to the screenShot image.
 */
function runPrintingExample(fn,logName,logTable,logCode,logSeparator,logScreenShot){

  /**
   * Called by every test/demo
   * @param name - the name of this test.
   * @param makeTable - a function which builds the table under test. Also, The contents of this function will be printed.
   * @param expected -  The expected result.
   * @param screenshot - If present, there is an image containing a screenshot of the output
   */
  function printExample(name,makeTable,expected,screenshot){
    var code = makeTable.toString().split('\n').slice(1,-2).join('\n');

    logName(name);
    if(screenshot && logScreenShot){
      logScreenShot(screenshot);
    }
    else {
      logTable(makeTable().toString());
    }
    logCode(code);
    logSeparator('\n');
  }

  fn(printExample);
}

// removes all the color characters from a string
function stripColors(str){
  return str.split( /\u001b\[(?:\d*;){0,5}\d*m/g).join('');
}

// returns the first arg - used as snapshot function
function identity(str){
  return str;
}

module.exports = {
  mdExample:mdExample,
  logExample:logExample,
  runTest:runTest
};


text:
#include "config.h"
#include "JSGlobalObjectRuntimeAgent.h"

#include "InjectedScript.h"
#include "InjectedScriptManager.h"
#include "JSGlobalObject.h"

using namespace JSC;

namespace Inspector {

JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(JSAgentContext& context)
    : InspectorRuntimeAgent(context)
    , m_frontendDispatcher(std::make_unique<RuntimeFrontendDispatcher>(context.frontendRouter))
    , m_backendDispatcher(RuntimeBackendDispatcher::create(context.backendDispatcher, this))
    , m_globalObject(context.inspectedGlobalObject)
{
}

void JSGlobalObjectRuntimeAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
{
}

InjectedScript JSGlobalObjectRuntimeAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
{
    ASSERT_UNUSED(executionContextId, !executionContextId);

    JSC::ExecState* scriptState = m_globalObject.globalExec();
    InjectedScript injectedScript = injectedScriptManager().injectedScriptFor(scriptState);
    if (injectedScript.hasNoValue())
        errorString = ASCIILiteral("Internal error: main world execution context not found.");

    return injectedScript;
}

} // namespace Inspector


text:
using System;

namespace LinqToDB.Mapping
{
	/// <summary>
	/// Marks property or field as a member of primary key for current mapping type.
	/// </summary>
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)]
	public class PrimaryKeyAttribute : Attribute
	{
		/// <summary>
		/// Creates attribute instance.
		/// </summary>
		public PrimaryKeyAttribute()
		{
			Order = -1;
		}

		/// <summary>
		/// Creates attribute instance.
		/// </summary>
		/// <param name="order">Column order in composite primary key.</param>
		public PrimaryKeyAttribute(int order)
		{
			Order = order;
		}

		/// <summary>
		/// Creates attribute instance.
		/// </summary>
		/// <param name="configuration">Mapping schema configuration name. See <see cref="Configuration"/>.</param>
		/// <param name="order">Column order in composite primary key.</param>
		public PrimaryKeyAttribute(string? configuration, int order)
		{
			Configuration = configuration;
			Order         = order;
		}

		/// <summary>
		/// Gets or sets mapping schema configuration name, for which this attribute should be taken into account.
		/// <see cref="ProviderName"/> for standard names.
		/// Attributes with <c>null</c> or empty string <see cref="Configuration"/> value applied to all configurations (if no attribute found for current configuration).
		/// </summary>
		public string? Configuration { get; set; }

		/// <summary>
		/// Gets or sets order of current column in composite primary key.
		/// Order is used for query generation to define in which order primary key columns must be mentioned in query
		/// from columns with smallest order value to greatest.
		/// Default value: <c>-1</c>.
		/// </summary>
		public int    Order         { get; set; }
	}
}


text:
package com.googlecode.mp4parser.authoring;

import com.coremedia.iso.boxes.Container;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.WritableByteChannel;

import static com.googlecode.mp4parser.util.CastUtils.l2i;

public class SampleImpl implements Sample {
    private final long offset;
    private final long size;
    private ByteBuffer[] data;
    private final Container parent;

    public SampleImpl(ByteBuffer buf) {
        this.offset = -1;
        this.size = buf.limit();
        this.data = new ByteBuffer[]{buf};
        this.parent = null;
    }

    public SampleImpl(ByteBuffer[] data) {
        this.offset = -1;
        int _size = 0;
        for (ByteBuffer byteBuffer : data) {
            _size += byteBuffer.remaining();
        }
        this.size = _size;
        this.data = data;
        this.parent = null;
    }

    public SampleImpl(long offset, long sampleSize, ByteBuffer data) {
        this.offset = offset;
        this.size = sampleSize;
        this.data = new ByteBuffer[]{data};
        this.parent = null;
    }

    public SampleImpl(long offset, long sampleSize, Container parent) {
        this.offset = offset;
        this.size = sampleSize;
        this.data = null;
        this.parent = parent;
    }

    protected void ensureData() {
        if (data != null) return;
        if (parent == null) {
            throw new RuntimeException("Missing parent container, can't read sample " + this);
        }
        try {
            data = new ByteBuffer[]{parent.getByteBuffer(offset, size)};
        } catch (IOException e) {
            throw new RuntimeException("couldn't read sample " + this, e);
        }
    }

    public void writeTo(WritableByteChannel channel) throws IOException {
        ensureData();
        for (ByteBuffer b : data) {
            channel.write(b.duplicate());
        }
    }

    public long getSize() {
        return size;
    }

    public ByteBuffer asByteBuffer() {
        ensureData();
        byte[] bCopy = new byte[l2i(size)];
        ByteBuffer copy = ByteBuffer.wrap(bCopy);
        for (ByteBuffer b : data) {
            copy.put(b.duplicate());
        }
        copy.rewind();
        return copy;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("SampleImpl");
        sb.append("{offset=").append(offset);
        sb.append("{size=").append(size);
        sb.append('}');
        return sb.toString();
    }
}


text:
#ifndef RADIUMENGINE_DIRLIGHT_HPP
#define RADIUMENGINE_DIRLIGHT_HPP

#include <Engine/RaEngine.hpp>
#include <Engine/Renderer/Light/Light.hpp>

namespace Ra {
namespace Engine {

/** Directional light for rendering
 *
 */
class RA_ENGINE_API DirectionalLight final : public Light
{
  public:
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW

    explicit DirectionalLight( Entity* entity, const std::string& name = "dirlight" );
    ~DirectionalLight() override = default;

    void getRenderParameters( RenderParameters& params ) const override;

    void setDirection( const Eigen::Matrix<Scalar, 3, 1>& dir ) override;
    inline const Eigen::Matrix<Scalar, 3, 1>& getDirection() const;

    std::string getShaderInclude() const override;

  private:
    Eigen::Matrix<Scalar, 3, 1> m_direction{0, -1, 0};
};

} // namespace Engine
} // namespace Ra

#include <Engine/Renderer/Light/DirLight.inl>

#endif // RADIUMENGINE_POINTLIGHT_HPP


text:
int main(int argc, char *argv[]) {
  try {
    using namespace kaldi;
    using namespace kaldi::nnet2;
    typedef kaldi::int32 int32;
    typedef kaldi::int64 int64;

    const char *usage =
        "Computes and prints the average log-prob per frame of the given data "
        "with a\n"
        "neural net.  The input of this is the output of e.g. nnet-get-egs\n"
        "Aside from the logging output, which goes to the standard error, this "
        "program\n"
        "prints the average log-prob per frame to the standard output.\n"
        "Also see nnet-logprob, which produces a matrix of log-probs for each "
        "utterance.\n"
        "\n"
        "Usage:  nnet-compute-prob [options] <model-in> "
        "<training-examples-in>\n"
        "e.g.: nnet-compute-prob 1.nnet ark:valid.egs\n";

    ParseOptions po(usage);

    po.Read(argc, argv);

    if (po.NumArgs() != 2) {
      po.PrintUsage();
      exit(1);
    }

    std::string nnet_rxfilename = po.GetArg(1),
                examples_rspecifier = po.GetArg(2);

    TransitionModel trans_model;
    AmNnet am_nnet;
    {
      bool binary_read;
      Input ki(nnet_rxfilename, &binary_read);
      trans_model.Read(ki.Stream(), binary_read);
      am_nnet.Read(ki.Stream(), binary_read);
    }

    std::vector<NnetExample> examples;
    double tot_weight = 0.0, tot_like = 0.0, tot_accuracy = 0.0;
    int64 num_examples = 0;
    SequentialNnetExampleReader example_reader(examples_rspecifier);
    for (; !example_reader.Done(); example_reader.Next(), num_examples++) {
      if (examples.size() == 1000) {
        double accuracy;
        tot_like += ComputeNnetObjf(am_nnet.GetNnet(), examples, &accuracy);
        tot_accuracy += accuracy;
        tot_weight += TotalNnetTrainingWeight(examples);
        examples.clear();
      }
      examples.push_back(example_reader.Value());
      if (num_examples % 5000 == 0 && num_examples > 0)
        KALDI_LOG << "Saw " << num_examples << " examples, average "
                  << "probability is " << (tot_like / num_examples) << " with "
                  << "total weight " << num_examples;
    }
    if (!examples.empty()) {
      double accuracy;
      tot_like += ComputeNnetObjf(am_nnet.GetNnet(), examples, &accuracy);
      tot_accuracy += accuracy;
      tot_weight += TotalNnetTrainingWeight(examples);
    }

    KALDI_LOG << "Saw " << num_examples << " examples, average "
              << "probability is " << (tot_like / tot_weight)
              << " and accuracy is " << (tot_accuracy / tot_weight) << " with "
              << "total weight " << tot_weight;

    std::cout << (tot_like / tot_weight) << "\n";
    return (num_examples == 0 ? 1 : 0);
  } catch (const std::exception &e) {
    std::cerr << e.what() << '\n';
    return -1;
  }
}


text:
"""
dbscheme file generation

`generate(opts, renderer)` will generate a `dbscheme` file out of a `yml` schema file.

Each final class in the schema file will get a corresponding defining DB table with the id and single properties as
columns.
Moreover:
* single properties in non-final classes will also trigger generation of a table with an id reference and all single
  properties as columns
* each optional property will trigger generation of a table with an id reference and the property value as columns
* each repeated property will trigger generation of a table with an id reference, an `int` index and the property value
  as columns
The type hierarchy will be translated to corresponding `union` declarations.
"""
import typing

import inflection

from swift.codegen.lib import schema
from swift.codegen.lib.dbscheme import *
from typing import Set, List

log = logging.getLogger(__name__)

def dbtype(typename: str, add_or_none_except: typing.Optional[str] = None) -> str:
    """ translate a type to a dbscheme counterpart, using `@lower_underscore` format for classes.
    For class types, appends an underscore followed by `null` if provided
    """
    if typename[0].isupper():
        underscored = inflection.underscore(typename)
        if add_or_none_except is not None and typename != add_or_none_except:
            suffix = "_or_none"
        else:
            suffix = ""
        return f"@{underscored}{suffix}"
    return typename

def cls_to_dbscheme(cls: schema.Class, lookup: typing.Dict[str, schema.Class], add_or_none_except: typing.Optional[str] = None):
    """ Yield all dbscheme entities needed to model class `cls` """
    if cls.ipa:
        return
    if cls.derived:
        yield Union(dbtype(cls.name), (dbtype(c) for c in cls.derived if not lookup[c].ipa))
    dir = pathlib.Path(cls.group) if cls.group else None
    # output a table specific to a class only if it is a leaf class or it has 1-to-1 properties
    # Leaf classes need a table to bind the `@` ids
    # 1-to-1 properties are added to a class specific table
    # in other cases, separate tables are used for the properties, and a class specific table is unneeded
    if not cls.derived or any(f.is_single for f in cls.properties):
        binding = not cls.derived
        keyset = KeySet(["id"]) if cls.derived else None
        yield Table(
            keyset=keyset,
            name=inflection.tableize(cls.name),
            columns=[
                Column("id", type=dbtype(cls.name), binding=binding),
            ] + [
                Column(f.name, dbtype(f.type, add_or_none_except)) for f in cls.properties if f.is_single
            ],
            dir=dir,
        )
    # use property-specific tables for 1-to-many and 1-to-at-most-1 properties
    for f in cls.properties:
        if f.is_repeated:
            yield Table(
                keyset=KeySet(["id", "index"]),
                name=inflection.tableize(f"{cls.name}_{f.name}"),
                columns=[
                    Column("id", type=dbtype(cls.name)),
                    Column("index", type="int"),
                    Column(inflection.singularize(f.name), dbtype(f.type, add_or_none_except)),
                ],
                dir=dir,
            )
        elif f.is_optional:
            yield Table(
                keyset=KeySet(["id"]),
                name=inflection.tableize(f"{cls.name}_{f.name}"),
                columns=[
                    Column("id", type=dbtype(cls.name)),
                    Column(f.name, dbtype(f.type, add_or_none_except)),
                ],
                dir=dir,
            )
        elif f.is_predicate:
            yield Table(
                keyset=KeySet(["id"]),
                name=inflection.underscore(f"{cls.name}_{f.name}"),
                columns=[
                    Column("id", type=dbtype(cls.name)),
                ],
                dir=dir,
            )

def get_declarations(data: schema.Schema):
    add_or_none_except = data.root_class.name if data.null else None
    declarations = [d for cls in data.classes.values() for d in cls_to_dbscheme(cls, data.classes, add_or_none_except)]
    if data.null:
        property_classes = {
            prop.type for cls in data.classes.values() for prop in cls.properties
            if cls.name != data.null and prop.type and prop.type[0].isupper()
        }
        declarations += [
            Union(dbtype(t, data.null), [dbtype(t), dbtype(data.null)]) for t in sorted(property_classes)
        ]
    return declarations

def get_includes(data: schema.Schema, include_dir: pathlib.Path, swift_dir: pathlib.Path):
    includes = []
    for inc in data.includes:
        inc = include_dir / inc
        with open(inc) as inclusion:
            includes.append(SchemeInclude(src=inc.relative_to(swift_dir), data=inclusion.read()))
    return includes

def generate(opts, renderer):
    input = opts.schema
    out = opts.dbscheme

    data = schema.load_file(input)

    dbscheme = Scheme(src=input.relative_to(opts.swift_dir),
                      includes=get_includes(data, include_dir=input.parent, swift_dir=opts.swift_dir),
                      declarations=get_declarations(data))

    renderer.render(dbscheme, out)


text:
package com.facebook.buck.io.file;

import com.facebook.buck.core.filesystems.RelPath;
import com.facebook.buck.core.util.immutables.BuckStyleValue;
import com.facebook.buck.io.watchman.Capability;
import com.google.common.collect.ImmutableList;
import java.nio.file.Path;
import java.util.Set;
import org.immutables.value.Value;

/** A contract for matching {@link Path}s. */
public interface PathMatcher {

  /** Check if given path matches pattern. */
  boolean matches(RelPath path);

  /**
   * Transforms this matcher into a Watchman match query arguments matching the same set of paths as
   * this matcher.
   */
  ImmutableList<?> toWatchmanMatchQuery(Set<Capability> capabilities);

  /**
   * Returns {@link PathOrGlob} object that contains a value that represents a path or glob pattern
   * identifying paths that should be matched by this matcher, and a way to figure out whether the
   * value is a Path or Glob.
   */
  PathOrGlob getPathOrGlob();

  /** Returns a glob pattern identifying paths that should be matched by this matcher. */
  String getGlob();

  /**
   * Wrapper around type of the path matcher's {@link #getPathOrGlob} return value (Path or Glob
   * type and a value).
   */
  @BuckStyleValue
  abstract class PathOrGlob {

    /** Type of the path matcher's {@link #getPathOrGlob} return value. Path or Glob */
    protected enum Type {
      PATH,
      GLOB
    }

    public abstract String getValue();

    protected abstract Type getType();

    @Value.Derived
    public boolean isPath() {
      return getType() == Type.PATH;
    }

    @Value.Derived
    public boolean isGlob() {
      return getType() == Type.GLOB;
    }

    public static PathOrGlob glob(String glob) {
      return ImmutablePathOrGlob.ofImpl(glob, Type.GLOB);
    }

    public static PathOrGlob path(RelPath path) {
      return ImmutablePathOrGlob.ofImpl(path.toString(), Type.PATH);
    }
  }
}


text:
<?php

namespace Prettus\Repository\Generators;

use Prettus\Repository\Generators\Migrations\NameParser;
use Prettus\Repository\Generators\Migrations\SchemaParser;
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;

/**
 * Class MigrationGenerator
 * @package Prettus\Repository\Generators
 */
class MigrationGenerator extends Generator
{

    /**
     * Get stub name.
     *
     * @var string
     */
    protected $stub = 'migration/plain';

    /**
     * Get base path of destination file.
     *
     * @return string
     */
    public function getBasePath()
    {
        return base_path() . '/database/migrations/';
    }

    /**
     * Get destination path for generated file.
     *
     * @return string
     */
    public function getPath()
    {
        return $this->getBasePath() . $this->getFileName() . '.php';
    }

    /**
     * Get generator path config node.
     *
     * @return string
     */
    public function getPathConfigNode()
    {
        return '';
    }

    /**
     * Get root namespace.
     *
     * @return string
     */
    public function getRootNamespace()
    {
        return '';
    }

    /**
     * Get migration name.
     *
     * @return string
     */
    public function getMigrationName()
    {
        return strtolower($this->name);
    }

    /**
     * Get file name.
     *
     * @return string
     */
    public function getFileName()
    {
        return date('Y_m_d_His_') . $this->getMigrationName();
    }

    /**
     * Get schema parser.
     *
     * @return SchemaParser
     */
    public function getSchemaParser()
    {
        return new SchemaParser($this->fields);
    }

    /**
     * Get name parser.
     *
     * @return NameParser
     */
    public function getNameParser()
    {
        return new NameParser($this->name);
    }

    /**
     * Get stub templates.
     *
     * @return string
     */
    public function getStub()
    {
        $parser = $this->getNameParser();

        $action = $parser->getAction();
        switch ($action) {
            case 'add':
            case 'append':
            case 'update':
            case 'insert':
                $file = 'change';
                $replacements = [
                    'class'       => $this->getClass(),
                    'table'       => $parser->getTable(),
                    'fields_up'   => $this->getSchemaParser()->up(),
                    'fields_down' => $this->getSchemaParser()->down(),
                ];
                break;

            case 'delete':
            case 'remove':
            case 'alter':
                $file = 'change';
                $replacements = [
                    'class'       => $this->getClass(),
                    'table'       => $parser->getTable(),
                    'fields_down' => $this->getSchemaParser()->up(),
                    'fields_up'   => $this->getSchemaParser()->down(),
                ];
                break;
            default:
                $file = 'create';
                $replacements = [
                    'class'  => $this->getClass(),
                    'table'  => $parser->getTable(),
                    'fields' => $this->getSchemaParser()->up(),
                ];
                break;
        }
        $path = config('repository.generator.stubsOverridePath', __DIR__);

        if (!file_exists($path . "/Stubs/migration/{$file}.stub")) {
            $path = __DIR__;
        }

        if (!file_exists($path . "/Stubs/migration/{$file}.stub")) {
            throw new FileNotFoundException($path . "/Stubs/migration/{$file}.stub");
        }

        return Stub::create($path . "/Stubs/migration/{$file}.stub", $replacements);
    }
}


text:
<?php

namespace Knwl\Contracts;

interface Plugin {

  /**
   * @return string
   */
  public function getName();

  public function calls();

}


text:
echo "root:"
git pull
echo ""

echo "1-player:"
(cd 1-player && git pull)
echo ""

echo "2-elastic-mp3-searcher:"
(cd 2-elastic-mp3-searcher && git pull)
echo ""

echo "3-socketServer:"
(cd 3-socketServer && git pull)
echo ""

echo "4-mp3Server:"
(cd 4-mp3Server && git pull)
echo ""


text:
package com.barentine.totalconnect.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for LyricDevice complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="LyricDevice">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="DeviceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LyricDevice", propOrder = {
    "deviceID"
})
public class LyricDevice {

    @XmlElement(name = "DeviceID")
    protected String deviceID;

    /**
     * Gets the value of the deviceID property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDeviceID() {
        return deviceID;
    }

    /**
     * Sets the value of the deviceID property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDeviceID(String value) {
        this.deviceID = value;
    }

}


text:
namespace Dropbox.Api.TeamLog
{
    using sys = System;
    using col = System.Collections.Generic;
    using re = System.Text.RegularExpressions;

    using enc = Dropbox.Api.Stone;

    /// <summary>
    /// <para>The smart sync not opt out type object</para>
    /// </summary>
    public class SmartSyncNotOptOutType
    {
        #pragma warning disable 108

        /// <summary>
        /// <para>The encoder instance.</para>
        /// </summary>
        internal static enc.StructEncoder<SmartSyncNotOptOutType> Encoder = new SmartSyncNotOptOutTypeEncoder();

        /// <summary>
        /// <para>The decoder instance.</para>
        /// </summary>
        internal static enc.StructDecoder<SmartSyncNotOptOutType> Decoder = new SmartSyncNotOptOutTypeDecoder();

        /// <summary>
        /// <para>Initializes a new instance of the <see cref="SmartSyncNotOptOutType" />
        /// class.</para>
        /// </summary>
        /// <param name="description">The description</param>
        public SmartSyncNotOptOutType(string description)
        {
            if (description == null)
            {
                throw new sys.ArgumentNullException("description");
            }

            this.Description = description;
        }

        /// <summary>
        /// <para>Initializes a new instance of the <see cref="SmartSyncNotOptOutType" />
        /// class.</para>
        /// </summary>
        /// <remarks>This is to construct an instance of the object when
        /// deserializing.</remarks>
        [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
        public SmartSyncNotOptOutType()
        {
        }

        /// <summary>
        /// <para>Gets the description of the smart sync not opt out type</para>
        /// </summary>
        public string Description { get; protected set; }

        #region Encoder class

        /// <summary>
        /// <para>Encoder for  <see cref="SmartSyncNotOptOutType" />.</para>
        /// </summary>
        private class SmartSyncNotOptOutTypeEncoder : enc.StructEncoder<SmartSyncNotOptOutType>
        {
            /// <summary>
            /// <para>Encode fields of given value.</para>
            /// </summary>
            /// <param name="value">The value.</param>
            /// <param name="writer">The writer.</param>
            public override void EncodeFields(SmartSyncNotOptOutType value, enc.IJsonWriter writer)
            {
                WriteProperty("description", value.Description, writer, enc.StringEncoder.Instance);
            }
        }

        #endregion

        #region Decoder class

        /// <summary>
        /// <para>Decoder for  <see cref="SmartSyncNotOptOutType" />.</para>
        /// </summary>
        private class SmartSyncNotOptOutTypeDecoder : enc.StructDecoder<SmartSyncNotOptOutType>
        {
            /// <summary>
            /// <para>Create a new instance of type <see cref="SmartSyncNotOptOutType"
            /// />.</para>
            /// </summary>
            /// <returns>The struct instance.</returns>
            protected override SmartSyncNotOptOutType Create()
            {
                return new SmartSyncNotOptOutType();
            }

            /// <summary>
            /// <para>Set given field.</para>
            /// </summary>
            /// <param name="value">The field value.</param>
            /// <param name="fieldName">The field name.</param>
            /// <param name="reader">The json reader.</param>
            protected override void SetField(SmartSyncNotOptOutType value, string fieldName, enc.IJsonReader reader)
            {
                switch (fieldName)
                {
                    case "description":
                        value.Description = enc.StringDecoder.Instance.Decode(reader);
                        break;
                    default:
                        reader.Skip();
                        break;
                }
            }
        }

        #endregion
    }
}


text:
'use strict';

// USUARIOS CRUD

// Importar rutas
// =============================================================================
var Model = require('../../models/jugando.js');

/* Rutas que terminan en /detalleMuerte
// router.route('/detalleMuerte') */
exports.getForm1 = function (req, res) {
  var animal = Model.Animal.build();
  var detalleMuerte = Model.DetalleMuerte.build();
  var muerte = Model.Muertes.build();
  //************************************
  var alarma = Model.Alarma.build();
  //************************************
  var mensaje = Model.Mensaje.build();
  //************************************
  if(!req.session.user){
    res.render('web/index/404.jade');
  }
  mensaje.retriveCount(function (mensaje1) {
    console.log('mensaje1', mensaje1);
    if (mensaje1) {
      mensaje.retrieveAll(function (mensaje2) {
        console.log('mensaje2', mensaje2);
        if (mensaje2) {
          animal.retrieveAll(function (animalQ) {
            console.log('animalQ',animalQ);
            if (animalQ) {
              muerte.retrieveId(function (muerteQ) {
                  if (muerteQ) {
                    console.log('soy muerte retrieveId',muerteQ);
                    alarma.retriveCount(function (alarma1) {
                      console.log('alarma1', alarma1);
                      if (alarma1) {
                        alarma.retrieveAll(function (alarma2) {
                          console.log('alarma2', alarma2);
                          if (alarma2) {
                            console.log(req.body);
                            var usuario = req.session.user.usuario;
                            var pass = req.session.user.pass;
                            var fechaCreacion = req.session.user.fechaCreacion;
                            res.render('web/detalleMuerte/index', {
                                            muerteJ:muerteQ,
                                            detalleMuerteJ: detalleMuerte,
                                            selectJ: animalQ,
                                            mensajes: mensaje1,
                                            mensajeria: mensaje2,
                                            alarmas1: alarma1,
                                            alarmas2: alarma2,
                                            usuarios: usuario,
                                            passs: pass,
                                            fechaCreacions: fechaCreacion
                            });
                           }else {
                            res.send(401, 'No se encontraron Alarmas');
                          }
                        }, function (error) {
                          res.send('Alarma no encontrado');
                        });
                      } else {
                        res.send(401, 'No se encontraron Alarmas');
                      }
                    }, function (error) {
                      res.send('Alarma no encontrado');
                    });
                  } else {
                    res.send(401, 'No se encontraron Muertes');
                  }
              });
            }else {
              res.send(401, 'No se Eencontraron Muertes');
            }
          }, function (error) {
            res.send('Detalle Muerte no encontrado');
            }
          );
        }else {
          res.send(401, 'No se encontraron Mensajes');
        }
      }, function (error) {
        res.send('Mensaje no encontrado');
      });
    } else {
      res.send(401, 'No se encontraron Mensajes');
    }
  }, function (error) {
    res.send('Mensaje no encontrado');
  });
};
// POST /detalleMuerte
exports.create1 = function (req, res) {
  console.log(req.body);
  // bodyParser debe hacer la magia
  var muertes =Model.Muertes.build();
  var stock =Model.Stock.build();

  var observacion = req.body.observacion;
  var AnimalIdAnimal = req.body.selectJ;
  var MuerteIdMuerte = req.body.id;

  var index = Model.DetalleMuerte.build({
    observacion: observacion,
    AnimalIdAnimal: AnimalIdAnimal,
    MuerteIdMuerte: MuerteIdMuerte
  });

  index.add(function (success) {
    index.retriveCount(MuerteIdMuerte, function (detalleMuertes) {
      if (detalleMuertes) {
        stock.retrieveByAnimal(AnimalIdAnimal, function (detalleAnimal) {
          if (detalleAnimal) {
            res.redirect('/web/detalleMuerte/cargar');
          } else {
            res.send(401, 'No se encontraron registros');
          }
        },function (err) {
            res.send('errores verifique');
        });
      } else {
        res.send(401, 'No anda tu count amigo');
      }
    },function (err) {
        res.send('errores aaaa');
    });
  },
  function (err) {
    res.send('errores ooooo');
  });
};
/* (trae todos los detalleMuerte)
// GET /detalleMuerte */
exports.readId = function (req, res) {
  var detalleMuerte = Model.DetalleMuerte.build();
  console.log('dentro de get /',req.body);
  //************************************
  var alarma = Model.Alarma.build();
  //************************************
  var mensaje = Model.Mensaje.build();
  //************************************
  if(!req.session.user){
    res.render('web/index/404.jade');
  }
  mensaje.retriveCount(function (mensaje1) {
    console.log('mensaje1', mensaje1);
    if (mensaje1) {
      mensaje.retrieveAll(function (mensaje2) {
        console.log('mensaje2', mensaje2);
        if (mensaje2) {
          detalleMuerte.retrieveAll(req.params.id, function (detalleMuertes) {
            if (detalleMuertes) {
               alarma.retriveCount(function (alarma1) {
                console.log('alarma1', alarma1);
                if (alarma1) {
                  alarma.retrieveAll(function (alarma2) {
                    console.log('alarma2', alarma2);
                    if (alarma2) {
                      console.log(req.body);
                      console.log('dentro de if');
                      var usuario = req.session.user.usuario;
                      var pass = req.session.user.pass;
                      var fechaCreacion = req.session.user.fechaCreacion;
                      res.render('web/detalleMuerte/success', {
                        detalleMuertes:detalleMuertes,
                        mensajes: mensaje1,
                        mensajeria: mensaje2,
                        alarmas1: alarma1,
                        alarmas2: alarma2,
                        usuarios: usuario,
                        passs: pass,
                        fechaCreacions: fechaCreacion
                      });
                     }else {
                      res.send(401, 'No se encontraron Alarmas');
                    }
                  }, function (error) {
                    res.send('Alarma no encontrado');
                  });
                } else {
                  res.send(401, 'No se encontraron Alarmas');
                }
              }, function (error) {
                res.send('Alarma no encontrado');
              });
            } else {
              res.send(401, 'No se encontraron Detalles');
            }
          }, function (error) {
            res.send('DetalleMuertesss no encontrado');
          });
        }else {
          res.send(401, 'No se encontraron Mensajes');
        }
      }, function (error) {
        res.send('Mensaje no encontrado');
      });
    } else {
      res.send(401, 'No se encontraron Mensajes');
    }
  }, function (error) {
    res.send('Mensaje no encontrado');
  });
};
//******************************************
exports.getForm2 = function (req, res) {
  var animal =Model.Animal.build();
  var detalleMuerte =Model.DetalleMuerte.build();
  var muerteId = req.params.muerteId;
  //************************************
  var alarma = Model.Alarma.build();
  //************************************
  var mensaje = Model.Mensaje.build();
  //************************************
  if(!req.session.user){
    res.render('web/index/404.jade');
  }
  mensaje.retriveCount(function (mensaje1) {
    console.log('mensaje1', mensaje1);
    if (mensaje1) {
      mensaje.retrieveAll(function (mensaje2) {
        console.log('mensaje2', mensaje2);
        if (mensaje2) {
          animal.retrieveAll(function (animalQ) {
            console.log('animalQ',animalQ);
            if (animalQ) {
              console.log('soy muerte retrieveId',muerteId);
              alarma.retriveCount(function (alarma1) {
                console.log('alarma1', alarma1);
                if (alarma1) {
                  alarma.retrieveAll(function (alarma2) {
                    console.log('alarma2', alarma2);
                    if (alarma2) {
                      console.log(req.body);
                      var usuario = req.session.user.usuario;
                      var pass = req.session.user.pass;
                      var fechaCreacion = req.session.user.fechaCreacion;
                      res.render('web/detalleMuerte/indexa', {
                                      muerteJ:muerteId,
                                      detalleMuerteJ: detalleMuerte,
                                      selectJ: animalQ,
                                      mensajes: mensaje1,
                                      mensajeria: mensaje2,
                                      alarmas1: alarma1,
                                      alarmas2: alarma2,
                                      usuarios: usuario,
                                      passs: pass,
                                      fechaCreacions: fechaCreacion
                      });
                    }else {
                      res.send(401, 'No se encontraron Alarmas');
                    }
                  }, function (error) {
                    res.send('Alarma no encontrado');
                  });
                } else {
                  res.send(401, 'No se encontraron Alarmas');
                }
              }, function (error) {
                res.send('Alarma no encontrado');
              });
            }else {
              res.send(401, 'No se Eencontraron Muertes');
            }
          }, function (error) {
            res.send('Detalle Muerte no encontrado');
          });
        }else {
          res.send(401, 'No se encontraron Mensajes');
        }
      }, function (error) {
        res.send('Mensaje no encontrado');
      });
    } else {
      res.send(401, 'No se encontraron Mensajes');
    }
  }, function (error) {
    res.send('Mensaje no encontrado');
  });
};
// POST /detalleMuerte
exports.create2 = function (req, res) {
  console.log(req.body);
  // bodyParser debe hacer la magia

  var stock =Model.Stock.build();

  var observacion = req.body.observacion;
  var AnimalIdAnimal = req.body.selectJ;
  var MuerteIdMuerte = req.body.id;

  var index = Model.DetalleMuerte.build({
    observacion: observacion,
    AnimalIdAnimal: AnimalIdAnimal,
    MuerteIdMuerte: MuerteIdMuerte
  });

  index.add(function (success) {
    index.retriveCount(MuerteIdMuerte, function (detalleMuertes) {
      if (detalleMuertes) {
        stock.retrieveByAnimal(AnimalIdAnimal, function (detalleAnimal) {
          if (detalleAnimal) {
            res.redirect('/web/muertes');
          } else {
            res.send(401, 'No se encontraron registros');
          }
        },function (err) {
            res.send('errores verifique');
        });
      } else {
        res.send(401, 'No anda tu count amigo');
      }
    },function (err) {
        res.send('errores aaaa');
    });
  },
  function (err) {
    res.send(err);
  });
};
//******************************************
/* Rutas que terminan en /detalleMuerte/:detalleMuerteId
// router.route('/detalleMuerte/:detalleMuerteId')
// PUT /detalleMuerte/:detalleMuerteId
// Actualiza detalleMuerte*/
exports.update = function (req, res) {
  var detalleMuerte = Model.DetalleMuerte.build();

  detalleMuerte.observacion = req.body.observacion;
  detalleMuerte.AnimalIdAnimal = req.body.animalSele;

 detalleMuerte.updateById(req.params.detalleMuerteId, function (success) {
    if (success) {
      res.redirect('/web/muertes');
    } else {
      res.send(401, 'Detalle Muerte Animal no encontrado');
    }
  }, function (error) {
    res.send('Detalle Muerte Animal no encontrado');
  });
};

// GET /detalleMuerte/:detalleMuerteId
// Toma un detalleMuerte por id
exports.read = function (req, res) {
  var detalleMuerte = Model.DetalleMuerte.build();
  var animal = Model.Animal.build();
  //************************************
  var alarma = Model.Alarma.build();
  //************************************
  if(!req.session.user){
    res.render('web/index/404.jade');
  }
  var mensaje = Model.Mensaje.build();
  //************************************
  mensaje.retriveCount(function (mensaje1) {
    console.log('mensaje1', mensaje1);
    if (mensaje1) {
      mensaje.retrieveAll(function (mensaje2) {
        console.log('mensaje2', mensaje2);
        if (mensaje2) {
          animal.retrieveAll(function (animal) {
            if (animal) {
              detalleMuerte.retrieveById(req.params.detalleMuerteId, function (detalleMuerte) {
                if (detalleMuerte) {
                  alarma.retriveCount(function (alarma1) {
                    console.log('alarma1', alarma1);
                    if (alarma1) {
                      alarma.retrieveAll(function (alarma2) {
                        console.log('alarma2', alarma2);
                        if (alarma2) {
                          console.log(req.body);
                          var usuario = req.session.user.usuario;
                          var pass = req.session.user.pass;
                          var fechaCreacion = req.session.user.fechaCreacion;
                          res.render('web/detalleMuerte/edit', {
                            detalleMuerte:detalleMuerte,
                            select: animal,
                            mensajes: mensaje1,
                            mensajeria: mensaje2,
                            alarmas1: alarma1,
                            alarmas2: alarma2,
                            usuarios: usuario,
                            passs: pass,
                            fechaCreacions: fechaCreacion
                          });
                        }else {
                          res.send(401, 'No se encontraron Alarmas');
                        }
                      }, function (error) {
                        res.send('Alarma no encontrado');
                      });
                    } else {
                      res.send(401, 'No se encontraron Alarmas');
                    }
                  }, function (error) {
                    res.send('Alarma no encontrado');
                  });
                } else {
                  res.send(401, 'Detalle Muerte Animal no encontrado');
                }
              }, function (error) {
                res.send('Detalle Muerte Animal no encontrado');
              });
            } else {
              res.send(401, 'No se encontraron Detalles');
            }
          }, function (error) {
            console.log(error);
            res.send('desDetalles no encontrado');
          });
        }else {
          res.send(401, 'No se encontraron Mensajes');
        }
      }, function (error) {
        res.send('Mensaje no encontrado');
      });
    } else {
      res.send(401, 'No se encontraron Mensajes');
    }
  }, function (error) {
    res.send('Mensaje no encontrado');
  });
};

// DELETE /detalleMuerte/detalleMuerteId
// Borra el detalleMuerteId
exports.delete = function (req, res) {
  var detalleMuerte = Model.DetalleMuerte.build();
  var variable = req.params.detalleMuerteId;
  console.log("estoy adentro");
  detalleMuerte.retriveCount2(variable, function (detalle) {
    console.log("dentro de count",detalle.MuerteIdMuerte);
    detalleMuerte.removeById(variable, function (eliminar) {
      console.log("dentro de delete");
      detalleMuerte.retriveCount(detalle.MuerteIdMuerte, function (contar) {
        console.log("actualizando");
        res.redirect('/web/muertes');
      }, function (error) {
        res.send('Detalle Muerte Animal no encontrado');
      });
    }, function (error) {
        res.send('mmmmDetalle Muerte Animal no encontrado');
    });
  }, function (error) {
    res.send('Detalle no encontrado');
  });
};


text:
// This test validates that Chutzpah detects the Chutzpah.json file and uses its RootReferencePathMode setting to
// change the behavior of a root reference path like <reference path="/stuff" /> to refer to start from the directory of the settings file
/// <reference path="/lib.js" />

module("RootReferencePathMode");
test("Settings File Directory", function () {
    ok(window.assertFileLoad);
});


text:
package cs263w16;

import com.google.appengine.api.datastore.*;
import com.google.appengine.api.memcache.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;

// The Worker servlet should be mapped to the "/worker" URL.
public class Worker extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
        MemcacheService syncCache = MemcacheServiceFactory.getMemcacheService();

        String key = request.getParameter("keyname");
        String val = request.getParameter("value");

        Entity tne = new Entity("TaskData", key);
        tne.setProperty("value", val);
        Date date = new Date();
        tne.setProperty("date", date);
        datastore.put(tne);
        syncCache.put(key, tne);
    }
}


text:
#block_one {
  width: 99%;
  height: 300px;
  background-color: slateblue; }
  #block_one h1 {
    color: brown; }

/*# sourceMappingURL=styles.css.map */


text:
namespace dp
{
extern char const * kSupportedAntialiasing;

class SupportManager
{
public:
  // This singleton must be available only from rendering threads.
  static SupportManager & Instance();

  // Initialization must be called only when graphics context is created.
  // Initialization happens once per application launch, so SupportManager
  // must not contain any properties which can be changed in the case of contexts
  // reinitialization.
  void Init(ref_ptr<GraphicsContext> context);

  bool IsSamsungGoogleNexus() const { return m_isSamsungGoogleNexus; }
  bool IsAdreno200Device() const { return m_isAdreno200; }
  bool IsTegraDevice() const { return m_isTegra; }
  bool IsAntialiasingEnabledByDefault() const { return m_isAntialiasingEnabledByDefault; }

  float GetMaxLineWidth() const { return m_maxLineWidth; }
  uint32_t GetMaxTextureSize() const { return m_maxTextureSize; }

  // These functions can be used without manager initialization.
  void ForbidVulkan();

  using Version = std::array<uint32_t, 3>;
  bool IsVulkanForbidden() const;
  bool IsVulkanForbidden(std::string const & deviceName,
                         Version apiVersion, Version driverVersion) const;

private:
  SupportManager() = default;

  std::string m_rendererName;
  std::string m_rendererVersion;
  bool m_isSamsungGoogleNexus = false;
  bool m_isAdreno200 = false;
  bool m_isTegra = false;
  bool m_isAntialiasingEnabledByDefault = false;

  float m_maxLineWidth = 1;
  uint32_t m_maxTextureSize = 1024;

  bool m_isInitialized = false;
  std::mutex m_mutex;

  DISALLOW_COPY_AND_MOVE(SupportManager);
};
}  // namespace dp


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AMing.KcvExtension.Core.Extensions
{
    public static class IEnumerableEx
    {
        public static void ForEach<T>(this IEnumerable<T> sequence, Action<T> action)
        {
            foreach (var item in sequence) action(item);
        }

        public static void ForEach<T>(this IEnumerable<T> sequence, Action<T, int> action)
        {
            int index = 0;
            foreach (var item in sequence)
            {
                action(item, index);
                index++;
            }
        }
    }
}


text:
<material>
    <technique name="Techniques/DiffSkyplane.xml" />
    <texture unit="diffuse" name="Textures/CloudPlane.dds" />
    <cull value="none" />
</material>


text:
package nablarch.etl.generator;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;

import java.util.Map;

import javax.persistence.Entity;
import javax.persistence.Table;

import nablarch.core.db.connection.ConnectionFactory;
import nablarch.core.db.connection.DbConnectionContext;
import nablarch.core.transaction.TransactionContext;
import nablarch.etl.InvalidEtlConfigException;
import nablarch.etl.config.DbToDbStepConfig;
import nablarch.test.support.SystemRepositoryResource;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

/**
 * {@link MaxLineNumberSqlGenerator}のテスト。
 */
public class MaxLineNumberSqlGeneratorTest {

    private final MaxLineNumberSqlGenerator sut = new MaxLineNumberSqlGenerator();

    @Rule
    public SystemRepositoryResource systemRepositoryResource = new SystemRepositoryResource("db-default.xml");

    @Before
    public void setUp() throws Exception {
        final ConnectionFactory connectionFactory = systemRepositoryResource.getComponentByType(ConnectionFactory.class);
        DbConnectionContext.setConnection(connectionFactory.getConnection(TransactionContext.DEFAULT_TRANSACTION_CONTEXT_KEY));
    }

    @After
    public void tearDown() throws Exception {
        DbConnectionContext.removeConnection();
    }

    /**
     * 設定で指定されたEntityのテーブル名が入ったSQL文が生成されること。
     */
    @Test
    public void generateMaxLineNumberSql() {

        final DbToDbStepConfig config = new DbToDbStepConfig() {
            {
                setUpdateSize(new UpdateSize());
                getUpdateSize().setBean(EtlMaxLineNumberGenEntity.class);
            }
        };

        final String result = sut.generateSql(config);

        assertThat(result, is("select max(LINE_NUMBER) from etl_work.etl_max_line_number_gen"));
    }

    /**
     * 非Entityクラスはエラーとなること。
     */
    @Test(expected = InvalidEtlConfigException.class)
    public void notEntityClass() throws Exception {

        final DbToDbStepConfig config = new DbToDbStepConfig() {
            {
                setUpdateSize(new UpdateSize());
                getUpdateSize().setBean(Map.class);
            }
        };

        sut.generateSql(config);
    }

    @Entity
    @Table(name = "etl_max_line_number_gen", schema = "etl_work")
    public static class EtlMaxLineNumberGenEntity {
    }
}


text:
__author__ = 'Kovachev'

from django.conf.urls import url
from django.views.generic import ListView
from apps.post.models import Post
from apps.projects import views

urlpatterns = [
    url(r'^',ListView.as_view(
        queryset=Post.objects.all().order_by("-created"),
        template_name='projects.html'), name='projects'),
]


text:
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h

#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include "FontWidthVariant.h"
#include "TextOrientation.h"
#include <wtf/FastAllocBase.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>

namespace WebCore {

class FontPlatformData;
class SharedBuffer;

struct FontCustomPlatformData {
    WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
public:
    FontCustomPlatformData() { }
    ~FontCustomPlatformData();

    // for use with QFontDatabase::addApplicationFont/removeApplicationFont
    int m_handle;

    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
                                      FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);

    static bool supportsFormat(const String&);
};

FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer);

} // namespace WebCore

#endif // FontCustomPlatformData_h


text:
* week 14-18:
  * organizing team: adding new organizers to the web.

* week 7-11:
  * dev team: fixing bug in stat function, adapting sql command to mirtop
  * organizing team: adding intro to mirtop page

## September 2019

* week 16-20:
  * dev team: review integration of the SQL feature.
  * isomir meta-analysis: Finish all backup in aws S3.

* week 9-13:
  * simulation: finish figures with all results and create table.
  * dev team: first integration of the SQL feature.
  * isomir meta-analysis: add fratta data. Backup all in S3.

## August 2019

* week 19-23:
  * simulation: analyzing S3/S4 Manatee.
  * isomir meta-analysis: adding the new samples for other studies to the results and normalizing trimming step.
  * dev team: assign projects to Arun (sql and Rshiny) and Florian (mirtop).

* week 12-16:
  * simulation: analyzing S0/S1.
  * isomir meta-analysis: getting new samples from other experiments

* week 01-05:
  * simulation: working on script to parse the new naming.
  * mirtop and mirgff3: working on developer team recruitment.

## July 2019

* week 21-26:
  * simulation: working on re-analysis monitoring resources
  * isomir meta-analysis:  running the 3 projects that use mirxplor data and re-analyze with bowtie
* week 14-19:
  * mirtop and mirgff3: convert to Bioinformatics format and re-submit
  * simulation: starting re-analysis monitoring resources
  * isomir meta-analysis: cleaning mirxplor references to contain sequences with H distance of 5 or more
* week 7-12:
  * mirtop and mirgff3: final revisions and adapting the code and repository files to 1.2 version
  * simulation: continueing with S4 and S5 rounds re-analysis
* week 1-5:
  * mirtop and mirgff3: revision of mirtop paper. Create new 1.2 version of format to add new headers. Optional genomic coordinates as output.
  * simulation:  continueing with S2 and S3 rounds re-analysis
  * isomir meta-analysis: get all samples trimmed by bcbio

## June 2019

* week 24-28:
  * isomir meta-analysis: create a new repository for the analysis, get all the samples trimmed for the next step
  * simulation: move back to original cluster to normalize analysis and calculate resources
* week 16-21:
  * isomir meta-analysis: starting getting data from last smrna kit comparison
  * simulation: creating new environment in new computer system and re-analyze new dataset
* week 3-7:
  * simulation: discussion about repeat all in a machine, add bwa + mirtop, add S0
  * mirgff3_viz: discussion how to add deseq2 to the app
  * isomir meta-analysis: touch bases with Ioannis to see next step of synthetic

## May 2019

* week 28-31: remove nonindels from simulated bam files.
* week 20-24: complete simulation figures. Fix mirtop issue.
* week 13-17: adding more tools to the simulation layers. Debug mirgff3_shiny to accept big files.
* week 5-10: automatizing simulator analysis. adding color options to mirgff3-shiny.
* week 29Apr-2May: working on round 3 and round 4 of simulator project. First draft for Rshiny app to visualize isomiRs.

## April 2019

* week 21-26: finishing tier2 of simulator analysis.
* week 15-19: running tier2 of simulation project.
* week 1-5: fix issue in mirtop affecting sequences that map in the same precursor, different positions. work on more figure to show difference between synthetic and biological samples.

## March 2019

* week 25-29: preseting mirtop to BIMDC institute. Working on figure for all the data analyzed until now.
* week 18-22: resubmitting mirtop/mirgff3 paper and debuging scripts from simulation project.
* week 11-15: working on isomir accuracy project to present to Bioinformatics club. Fixing some issues in mirtop API suit.
* week 4-8: work on tewari commonality for equimolar data. Starting visualization tool that uses GFF3 format.

## February 2019

* week 25-1: work on optimir compatibility and sqlite method to analyze big files.
* week 18-22: improving mirtop to handle Manatee, exploring to work with sqlite instead of dicts.
* week 11-15: improving mirtop to handle big bam with genomic positions. Start discussion about in person mirtop meeting.
* week 4-8: adding new memebers. Supporting chunk files for seqbuster. Script to parse big gff3 files for simulator project.

## January 2019

* week 28-1: adapt mirtop to read in chunk BAM files from precursor hits
* week 21-25: start the draft to put all the meta-analysis together in a google docs
* week 14-18: communication with Illumina to figure out a plan to sequence synthetic samples
* week 21-25: working on script to design unique synthetic sequences

## December 2018

* week 10-15: working on paper tables and merging suggestion from authors.
* week 2-7: talk at BIG meeting in Boston. https://bluejeans.com/s/h4CR2.

## November 2018

* week 25-30: working on mirtop paper and preparing format to final review round.
* week 12-16: design experiment for checking truncation events.
* week 5-9: add new data set to the analysis, maybe not possible to share right now.
* week 29-2: more modification to the mirGFF3 to addition variants. Finishing paper figure.

## October 2018

* week 22-26: Analyze Van Dijk data with spikeins to compare with current data. Update mirGFF3 definition for version 1.1.
* week 15-19: Add mirge2.0 and custom tewari synthetic plots to equimolar analysis. Discussion about changing some ideas of the mirgff3 format.
* week 8-12: Add gff3 to fasta. Analyze custom synthetic data from tewari set. Synthetic data analyzed by mirge2.0.
* week 1-5: Sync the version of mirGFF3, mirtop revision paper. Comparing plasma vs equimolar: https://github.com/miRTop/incubator/blob/master/projects/tewari_equimolar/plasma_vs_equimolar.md.

## September 2018

* week 24-28: New plots for the equimolar analysis to show the imporance of isomiRs found in the synthetic data.
* week 17-21: Working on equimolar analysis to define the background noise. (https://github.com/miRTop/incubator/blob/master/projects/tewari_equimolar/commonality.md)
* week 10-14: Studying the random isomiR generation in synthetic data.
* week 4-7: Support GFF3 from external tools that don't have UID specified.

## August 2018

* week 27-31: working on figure to show the commonality among labs and replicates at the same time.
* week 20-24: vacation time.
* week 13-17: working on testing IDR as a possible metric for reproducibility.
* week 6-10: first online meeting and plan for tewari re-analysis next steps. Starting the first draft for mirtop paper.

## July 2018

* week 30-2: improving log in stats command to be compatible with multiqc
* week 16-20: discussing road map for 1/2 2018
* week 9-13: adding compatibility with python 3

## June 2018

* week 25-29: Documenting functions in devel branch.
* week 17-22: Improving figure formats for tewari analysis.
* week 11-14: Generating [replicates reproducibility figures]l(https://github.com/miRTop/incubator/tree/master/projects/tewari)
* week 4-8: Generating [stats figures for each too]l(https://github.com/miRTop/incubator/tree/master/projects/tewari#for-each-tool-similarity-between-replicates-of-each-labprotocol)

## May 2018

* week 28-1:Fixing sRNAbench importer code.
* week 19-25: Working on commonality figures for bcbio and miRge for tewari data.
* week 11-16: Fixing bugs when joining miRge GFF into one file
* week 7-8: Running tewari data with sRNAbench, PROST and isomirSEA, preparing scripts for general stats for bcbio and miRge for pilot samples.
* week 1-4: Sharing trimmed data. Fixing --add-extra for isomiR-SEA tool

## April 2018

* week 23-27: Running data through bcbio to get trimmed data. Add extra attribute with Variants and nucleotides to allow better visual inspection.
* week 9-13: Fixing bugs in merge and stats thanks to @AlisR.
* week 2-6: Integrating PROST! output and updating synthetic data analysis.

## March 2018

* week 26-30: Working on [benchmarking report](https://github.com/miRTop/incubator/tree/master/synthetic)
* week 19-24: Adapting new sRNAbench format and discussion about PROST output
* week 12-16: Working on [abstract](https://github.com/miRTop/miRTOP.github.io/blob/master/docs/bosc2018_lpantano.pdf) for [BOSC2018](https://gccbosc2018.sched.com) presented by Lorena Pantano
* Week 5-9: Integrating [PROST tools](https://github.com/uoregon-postlethwait/prost) into miRTop command line

## February 2018

* Add summary function to miRTop
* Compatibility with isomiR-SEA

## January 2018

* Analyzing synthetic data to debug tools output


text:
last_modified_at: 2019-01-24

title: Manage your Gradle dependencies in Kotlin, even from Groovy scripts
description: >
  As projects grow we can quickly run into issues with dependency management. We will explore the ways Gradle allows us to define our dependencies, ending with looking at using Kotlin source files and easily accessing them from our Gradle scripts.
date: 2018-11-23
categories: [android]
tags: [code-quality]
image:
  path: &image /assets/img/posts/kotlin-gradle.png
  width: 1400
  height: 613
  feature: *image
medium:
  url:
summary: >
  As projects grow we can quickly run into issues with dependency management. We will explore the ways Gradle allows us to define our dependencies, ending with looking at using Kotlin source files and easily accessing them from our Gradle scripts.
---

When defining the dependencies for a Gradle project, such as an Android app, there are situations that call for duplicated information. A common case is that libraries or plugins can often come with multiple dependencies, which are usually released together with matching versions. Maintaining these dependencies requires the version to be duplicated and then kept up-to-date as new versions are released.

Another case is that it is common to have a multi-module project, where we may want a dependency to be added to multiple modules. Similarly to the case with versions, the dependency definition would be duplicated for each module and then kept in-sync moving forward.

It is clear that in both cases we may want to define the dependencies in one place and then access this location from wherever the dependency definition is needed.

## The Groovy way

There is a mechanism for sharing your dependency configuration using Groovy, by adding some extra properties in our root `build.gradle` file. This is [Google's recommended solution](https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties) and can be nicely seen in practice within the [SdkSearch app by Jake Wharton](https://github.com/JakeWharton/SdkSearch/blob/master/build.gradle), which works in a similar way to the following Gradle script snippets.

**→ /build.gradle**

```groovy
buildscript {
  ext.versions [
    'kotlin': '1.3.10',
    'dagger': '2.19'
  ]

  ext.deps [
    'kotlin': [
      'stdlib': "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}",
      'test': "org.jetbrains.kotlin:kotlin-test-common:${versions.kotlin}"
    ],
    'dagger': [
      'runtime': "com.google.dagger:dagger:${versions.dagger}",
      'compiler': "com.google.dagger:dagger-compiler:${versions.dagger}",
      'androidRuntime': "com.google.dagger:dagger-android:${versions.dagger}",
      'androidCompiler': "com.google.dagger:dagger-android-processor:${versions.dagger}",
    ]
  ]
}
```

**→ /app/build.gradle**

```groovy
dependencies {
  implementation deps.kotlin.stdlib

  implementation deps.dagger.runtime
  implementation deps.dagger.androidRuntime
  kapt deps.dagger.compiler
  kapt deps.dagger.androidCompiler

  testImplementation deps.kotlin.test
}
```

Sharing the configuration via the root `build.gradle` achieves the goal of having a single location to maintain. Only needing to update dependency versions in a single file is a great time-saver as well 🚀. Unfortunately from practice, when using the Groovy Gradle DSL auto-complete is often missing or incomplete in this situation, making it awkward to use.

On top of this, [Gradle 5.0](https://gradle.org/whats-new/gradle-5/) is now available which includes the production-ready Kotlin Gradle DSL. When we convert the above solution to Kotlin it isn't as nice to use in Kotlin as it is in Groovy. The map syntax can be achieved using `mapOf`, but reading the data to pass to `implementation` requires some casting to fit with the statically typed language. 😢

## Kotlin to the rescue

As many developers have found with their main app source code, Kotlin can help with defining our dependency configurations as well, from both Groovy and Kotlin Gradle scripts.

{% responsive_image
    path: assets/img/posts/kotlin-gradle.png
    caption: "Kotlin and Gradle - a match made in heaven?"
    picture_class: "figure-transparent" %}

When ran, Gradle will check for a `buildSrc` directory in the root of the project, placing any code that is found into the classpath of our build. This is really handy and allows us to put Kotlin code into `buildSrc` and then reference it from our Gradle scripts. To get started we just need a little bit of structure.

**→ /buildSrc/build.gradle.kts**

```
plugins {
  `kotlin-dsl`
}
```

The Kotlin DSL plugin needs to be specified for `buildSrc`.

**→ /buildSrc/src/main/kotlin/Versions.kt**

Our source files need to be placed within the standard sources directory structure. To use inner objects, for now we need to include the sources within a package, e.g. 'com.ourapp'.

```kotlin
object Versions {
  const val dagger = "2.21"
  const val ktlint = "0.29.0"
  const val kotlin = "1.3.11"
}
```

**→ /buildSrc/src/main/kotlin/Dependencies.kt**

```kotlin
object Plugins {
    const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
    const val ktlint = "com.github.shyiko:ktlint:${Versions.ktlint}"
}

object Libs {
    const val kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"

    const val daggerRuntime = "com.google.dagger:dagger:${Versions.dagger}"
    const val daggerCompiler = "com.google.dagger:dagger-compiler:${Versions.dagger}"
    const val daggerAndroidRuntime = "com.google.dagger:dagger-android:${Versions.dagger}"
    const val daggerAndroidCompiler = "com.google.dagger:dagger-android-processor:${Versions.dagger}"
}
```

Once Gradle has been synced, we can now reference our dependencies within our Gradle scripts. This is pretty much the same as we used with the Groovy extra properties solution above.

**→ /app/build.gradle**

```groovy
dependencies {
  implementation Libs.kotlinStdlib

  implementation Libs.daggerRuntime
  implementation Libs.daggerAndroidRuntime
  kapt Libs.daggerCompiler
  kapt Libs.daggerAndroidCompiler

  ktlint Plugins.ktlint
}
```

Using `buildSrc` and Kotlin sources achieves the goal of having a single location to maintain and we can even reduce it to a single Kotlin source file if it makes sense to. The solution can be used in the same way from both Groovy and Kotlin Gradle DSL without being altered, which frees us up to change our Gradle scripts to Kotlin if we want to.

The best thing about defining dependencies in this way is that we get access to effective auto-complete and being able to click through to where a dependency is defined from our Gradle scripts, super useful. 🙌

A good tool to look into is [Ben Manes' Gradle Versions Plugin](https://github.com/ben-manes/gradle-versions-plugin), which will inform us of any dependencies with new versions. Once we have the latest versions, we can simply update them in `Versions.kt`.

## Conclusion

Naturally, for the reasons given I prefer to use the `buildSrc` and Kotlin source approach in my Android projects. It is really nice to use with both Groovy Gradle scripts and those written using the Gradle Kotlin DSL.

What do you think of managing dependencies in this way? Do you already do it or do you have any thoughts on a way to improve it further? Please feel free to reach out to me on [Twitter @lordcodes]({{ site.twitter.url }}) with any questions or thoughts you have, or about anything else.

If you like what you have read, please don't hesitate to share the article and [subscribe to my feed]({{ '/subscribe' | relative_url }}) if you are interested.

Thanks for reading and happy coding! 🙏


text:
package com.netflix.governator.guice.runner.events;

import javax.inject.Singleton;

import com.netflix.governator.guice.runner.TerminationEvent;

/**
 * Simple TerminatEvent using a countdown latch as the termination signal.
 *
 * @author elandau
 */
@Singleton
public class BlockingTerminationEvent implements TerminationEvent {
    private volatile boolean isTerminated = false;

    @Override
    public synchronized void await() throws InterruptedException {
        while (!isTerminated) {
            this.wait();
        }
    }

    @Override
    public synchronized void terminate() {
        isTerminated = true;
        this.notifyAll();
    }

    @Override
    public boolean isTerminated() {
        return isTerminated;
    }
}


text:
package it.aive.utility;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.Hashtable;

/**
 * FileUtil.java Contiene funzioni di utilita per la gestione dei file

 *  Storia delle Modifiche

 * 01/12/2002 Prima versione

 *
 * @author Baraldi Marco
 * @version 1.0
 */
public class FileUtil
{
    //~ Methods ----------------------------------------------------------------
public static final String FILE_ON_FILESYSTEM="P";
 public static final String FILE_ON_CLASSPATH="C";
    /**
     * Dato il nome di un file  ritorna il suo contenuto  come stringa. Se il
     * flagWhere vale FILE_ON_CLASSPATH allora il file verra cercato nel classpath e quindi
     * non e' necessario definire il classpath (es pippo.xml)  se invece il
     * flagWhere vale FILE_ON_FILESYSTEM ha pisogno di tutto il path (es c:\prova\pippo.xml)
     *
     * @param fileName
     * @param flagWhere vale FILE_ON_FILESYSTEM o FILE_ON_CLASSPATH
     *
     * @return
     *
     * @throws IOException
     */
    public static String readFile(String fileName, String flagWhere) throws Exception
    {
        BufferedReader dis = new BufferedReader(new InputStreamReader(findInputStream(fileName, flagWhere)));
        StringBuffer buff = new StringBuffer("");
        String input;

        while ((input = dis.readLine()) != null)
        {
            buff.append(input);
            buff.append("\n");
        }

        dis.close();

        return buff.toString();
    }

    public static void writeFile(String fileName,String Content, String flagWhere) throws Exception
    {
        BufferedOutputStream dis = new BufferedOutputStream(findOutputStream(fileName, flagWhere));
       dis.write(Content.getBytes());
       dis.flush();
       dis.close();

    }

    public static void writeFile(String fileName,byte[] content, String flagWhere) throws Exception
    {
        BufferedOutputStream dis = new BufferedOutputStream(findOutputStream(fileName, flagWhere));
       dis.write(content);
       dis.flush();
       dis.close();

    }

    /**
     * Stampa un file parametrizzato e una map ritorna in un altro file il
     * risultato
     *
     * @param fileInputName DOCUMENT ME!
     * @param fileOutputName DOCUMENT ME!
     * @param parametri DOCUMENT ME!
     *
     * @return
     *
     * @throws IOException
     */
    public static void stampaFileParametrizzato(String fileInputName, String fileOutputName, Hashtable parametri,String flagWhereInputFile) throws Exception
    {
		  String template=readFile(fileInputName,flagWhereInputFile);
      	Enumeration names = parametri.keys();
				while ( names.hasMoreElements() ) {
           String	key;
           Object value;
					 key =	(String)names.nextElement();
					 value	=parametri.get(key);
           template=StringUtil.substitute(key,value.toString(),template);
        }
    writeFile(fileOutputName,template,flagWhereInputFile);
    }

    /**
     * DOCUMENT ME!
     *
     * @param fileName
     * @param searchFlag
     *
     * @return
     *
     * @throws Exception
     */
    public static InputStream findInputStream(String fileName, String searchFlag) throws Exception
    {
        InputStream fileResource = null;

        if (searchFlag.equalsIgnoreCase(FILE_ON_CLASSPATH))
        {
            // cerco il file nel Class Path
            FileUtil tmp1 = new FileUtil();
            ClassLoader loader = tmp1.getClass().getClassLoader();
            fileResource = loader.getResourceAsStream(fileName);
        } else    if (searchFlag.equalsIgnoreCase(FILE_ON_FILESYSTEM))
        {
            fileResource = new FileInputStream(fileName);
        } else {
         throw new Exception("Il flag deve essere C oppure P");
        }

        return fileResource;
    }

 public static FileOutputStream findOutputStream(String fileName, String searchFlag) throws Exception
    {
        FileOutputStream fileResource = null;

        if (searchFlag.equalsIgnoreCase(FILE_ON_CLASSPATH))
        {
            // cerco il file nel Class Path
            FileUtil tmp1 = new FileUtil();
            ClassLoader loader = tmp1.getClass().getClassLoader();
            //fileResource = loader.getResourceAsStream(fileName);
        } else    if (searchFlag.equalsIgnoreCase(FILE_ON_FILESYSTEM))
        {
            fileResource = new FileOutputStream(fileName);
        } else {
         throw new Exception("Il flag deve essere C oppure P");
        }

        return fileResource;
    }

    /**
     * Dato il nome di un file lo ricerca nel classpath  e ritorna il suo
     * contenuto  come stringa.
     *
     * @param fileName
     *
     * @return
     *
     * @throws Exception
     */
    public static String readFileFromClassPath(String fileName) throws Exception
    {
        FileUtil tmp1 = new FileUtil();
        ClassLoader loader = tmp1.getClass().getClassLoader();
        InputStream fileResource = loader.getResourceAsStream(fileName);
        InputStreamReader tmp = new InputStreamReader(fileResource);
        BufferedReader dis = new BufferedReader(tmp);
        StringBuffer buff = new StringBuffer("");
        String input;

        while ((input = dis.readLine()) != null)
        {
            buff.append(input);
            buff.append("\n");
        }

        dis.close();

        return buff.toString();
    }

    /**
     * Ritorna la lista dei file e delle sottodirectory presenti in  una
     * directory data. Non e' ricorsivo
     *
     * @param dir directory
     *
     * @return array di stringhe contenenti i nomi dei file
     */
    public static String[] returnFileList(String dir)
    {
        File stream = new File(dir);
        String[] listFiles = null;

        if (stream.isDirectory())
        {
            listFiles = stream.list();
        }

        return listFiles;
    }

    /**
     * Ritorna la lista dei file e delle sottodirectory presenti in  una
     * directory data. Non e' ricorsivo
     *
     * @param dir directory
     * @param ext DOCUMENT ME!
     *
     * @return array di stringhe contenenti i nomi dei file
     */
    public String[] returnFileList(String dir, String ext)
    {
        ExtFilter filter = new ExtFilter(ext);
        File stream = new File(dir);
        String[] listFiles = stream.list(filter);
        ;

        return listFiles;
    }

    /**
     * Data una directory ritona la lista di tutti i file conetuti in quella
     * directory e nelle sottodirectory
     *
     * @param dir di partenza
     *
     * @return Array di stringhe contenenti i nomi dei file
     */
    public static String[] returnFileListRec(String dir)
    {
        File stream = new File(dir);
        String[] listFiles = null;

        // Se e una directory....
        if (stream.isDirectory())
        {
            // Ho la lista di tutti i file della directory
            String[] fileFigli = stream.list();
            String[][] tutto = new String[fileFigli.length][1];

            // Richiamo ricorsivamente la funzione su tutti i figli
            for (int i = 0; i < fileFigli.length; i++)
            {
                String tmp = dir + File.separatorChar + fileFigli[i];
                tutto[i] = returnFileListRec(tmp);
            }

            // Linearizzo la matrice. Mi serve
            int dimensioneTotale = 0;

            for (int i = 0; i < tutto.length; i++)
            {
                dimensioneTotale += tutto[i].length;
            }

            listFiles = new String[dimensioneTotale];

            int count = 0;

            for (int i = 0; i < tutto.length; i++)
            {
                for (int j = 0; j < tutto[i].length; j++)
                {
                    listFiles[count] = tutto[i][j];
                    count++;
                }
            }
        }
        else
        {
            // Se e un file ritorna se stesso
            listFiles = new String[1];
            listFiles[0] = dir;
        }

        return listFiles;
    }

    //~ Inner Classes ----------------------------------------------------------

    class ExtFilter implements FilenameFilter
    {
        //~ Instance fields ----------------------------------------------------

        String afn;

        //~ Constructors -------------------------------------------------------

        ExtFilter(String afn)
        {
            this.afn = afn;
        }

        //~ Methods ------------------------------------------------------------

        public boolean accept(File dir, String name)
        {
            String f = new File(name).getName();

            return f.trim().endsWith(afn);
        }
    }

    public static boolean rename(String oldName,String newName){
     File tmp1 = new File(oldName);
     File tmp2 = new File(newName);
     return tmp1.renameTo(tmp2);

    }

     public static void copyFile(String nomeOriginale, String nomeFinale ) throws Exception {
       File in  = new File(nomeOriginale);

       File out = new File(nomeFinale);
    FileInputStream fis  = new FileInputStream(in);
    FileOutputStream fos = new FileOutputStream(out);
    byte[] buf = new byte[1024];
    int i = 0;
    while((i=fis.read(buf))!=-1) {
      fos.write(buf, 0, i);
      }
    fis.close();
    fos.close();
    }

  /**
	 * Move a file from one location to another.  An attempt is made to rename
	 * the file and if that fails, the file is copied and the old file deleted.
	 *
	 * If the destination file already exists, an exception will be thrown.
	 *
	 * @param from file which should be moved.
	 * @param to desired destination of the file.
	 * @throws IOException if an error occurs.
	 *
	 * @since ostermillerutils 1.00.00
	 */
	public static void move(File from, File to) throws IOException {
		move(from, to, false);
	}

	/**
	 * Move a file from one location to another.  An attempt is made to rename
	 * the file and if that fails, the file is copied and the old file deleted.
	 *
	 * @param from file which should be moved.
	 * @param to desired destination of the file.
	 * @param overwrite If false, an exception will be thrown rather than overwrite a file.
	 * @throws IOException if an error occurs.
	 *
	 * @since ostermillerutils 1.00.00
	 */
	public static void move(File from, File to, boolean overwrite) throws IOException {
		if (to.exists()){
			if (overwrite){
				if (!to.delete()){
					throw new IOException("Non riesco a cancellare il file");

				}
			} else {
				throw new IOException("Il file Esiste gia");

			}
		}

		if (from.renameTo(to)) return;

		InputStream in = null;
		OutputStream out = null;
		try {
			in = new FileInputStream(from);
			out = new FileOutputStream(to);
			copy(in, out);
			in.close();
			in = null;
			out.flush();
			out.close();
			out = null;
			if (!from.delete()){
				throw new IOException("Errore non riesco a cancellare il file");
			}
		} finally {
			if (in != null){
				in.close();
				in = null;
			}
			if (out != null){
				out.flush();
				out.close();
				out = null;
			}
		}
	}

	/**
	 * Buffer size when reading from input stream.
	 *
	 * @since ostermillerutils 1.00.00
	 */
	private final static int BUFFER_SIZE = 1024;

	/**
	 * Copy the data from the input stream to the output stream.
	 *
	 * @param in data source
	 * @param out data destination
	 * @throws IOException in an input or output error occurs
	 *
	 * @since ostermillerutils 1.00.00
	 */
	private static void copy(InputStream in, OutputStream out) throws IOException {
		byte[] buffer = new byte[BUFFER_SIZE];
		int read;
		while((read = in.read(buffer)) != -1){
			out.write(buffer, 0, read);
		}
	}

  	private static void copyDir(InputStream in, OutputStream out) throws IOException {
    //To do
    }

	public static boolean deleteDirectory(File dir) {
        if (dir.isDirectory()) {
            String[] children = dir.list();
            for (int i=0; i<children.length; i++) {
                boolean success = deleteDirectory(new File(dir, children[i]));
                if (!success) {
                    return false;
                }
            }
        }
        return dir.delete();
    }

	public static byte[] getBytesFromFile(File file) throws IOException{
        InputStream is = new FileInputStream(file);

        // recupero la grandezza del file
        long length = file.length();

        if (length > Integer.MAX_VALUE) {
        	throw new IOException("Il file è troppo grande");
        }

        // creo l'array di byte che conterrà i dati
        byte[] bytes = new byte[(int)length];

        // Leggo i byte
        int offset = 0;
        int numRead = 0;
        while (offset < bytes.length
               && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
            offset += numRead;
        }

        // controllo che tutti i byte siano stati letti
        if (offset < bytes.length) {
            throw new IOException("Il file non è stato letto completamente "+file.getName());
        }
        is.close();
        return bytes;
    }
}
/* End of File */


text:
var classtesting__1__1internal__1__1__predicate__formatter__from__matcher_8js =
[
    [ "classtesting_1_1internal_1_1_predicate_formatter_from_matcher", "classtesting__1__1internal__1__1__predicate__formatter__from__matcher_8js.html#a4d4325f6b40aa201d1b0388db3a88434", null ]
];


text:
/* global Mobiledoc */
'use strict';

$(() => {
  bootstrapEditor();
  bootstrapSimpleDemo();
  bootstrapToolbarEditor();
  bootstrapCardEditor();
});

let bootstrapEditor = () => {
  let el = $('#editor')[0];
  let editor = new Mobiledoc.Editor({
    placeholder: 'Type here',
    autofocus: true
  });
  editor.render(el);
  activateButtons('#editor-wrapper', editor);
  let displayMobiledoc = () => {
    let mobiledoc = editor.serialize();
    let html = mobiledocPrettyJSONRenderer(mobiledoc);
    $('#editor-output').html(html);
  };
  editor.postDidChange(displayMobiledoc);
  displayMobiledoc();
};

let bootstrapSimpleDemo = () => {
  let el = $('#editor-basic')[0];
  let editor = new Mobiledoc.Editor({
    placeholder: 'Welcome to Mobiledoc',
  });
  editor.render(el);
};

let activateButtons = (parentSelector, editor) => {
  $(`${parentSelector} button`).click(function() {
    let button = $(this);
    let action = button.data('action');
    let arg = button.data('arg');

    editor[action](arg);
  });
};

let bootstrapToolbarEditor = () => {
  let el = $('#editor-toolbar')[0];
  let editor = new Mobiledoc.Editor({
    placeholder: 'Editor with toolbar'
  });
  editor.render(el);

  activateButtons('#editor-toolbar-wrapper', editor);
}

let bootstrapCardEditor = () => {
  let card = {
    name: 'kitten',
    type: 'dom',
    render() {
      let el = $(`

Image of a kitten

`);
      return el[0];
    }
  };
  let atom = {
    name: 'mention',
    type: 'dom',
    render() {
      let el = $(`<span style='background-color: #CCC;'>@hello</span>`);
      return el[0];
    }
  };
  let el = $('#editor-card')[0];
  let editor = new Mobiledoc.Editor({
    placeholder: 'Editor with card',
    cards: [card],
    atoms: [atom]
  });
  editor.render(el);
  activateButtons('#editor-card-wrapper', editor);
};