text:
/**
 * ### .getPathValue(path, object)
 *
 * This allows the retrieval of values in an
 * object given a string path.
 *
 *     var obj = {
 *         prop1: {
 *             arr: ['a', 'b', 'c']
 *           , str: 'Hello'
 *         }
 *       , prop2: {
 *             arr: [ { nested: 'Universe' } ]
 *           , str: 'Hello again!'
 *         }
 *     }
 *
 * The following would be the results.
 *
 *     getPathValue('prop1.str', obj); // Hello
 *     getPathValue('prop1.att[2]', obj); // b
 *     getPathValue('prop2.arr[0].nested', obj); // Universe
 *
 * @param {String} path
 * @param {Object} object
 * @returns {Object} value or `undefined`
 * @name getPathValue
 * @api public
 */

var getPathValue = module.exports = function (path, obj) {
  var parsed = parsePath(path);
  return _getPathValue(parsed, obj);
};

/*!
 * ## parsePath(path)
 *
 * Helper function used to parse string object
 * paths. Use in conjunction with `_getPathValue`.
 *
 *      var parsed = parsePath('myobject.property.subprop');
 *
 * ### Paths:
 *
 * * Can be as near infinitely deep and nested
 * * Arrays are also valid using the formal `myobject.document[3].property`.
 *
 * @param {String} path
 * @returns {Object} parsed
 * @api private
 */

function parsePath (path) {
  var str = path.replace(/\[/g, '.[')
    , parts = str.match(/(\\\.|[^.]+?)+/g);
  return parts.map(function (value) {
    var re = /\[(\d+)\]$/
      , mArr = re.exec(value)
    if (mArr) return { i: parseFloat(mArr[1]) };
    else return { p: value };
  });
};

/*!
 * ## _getPathValue(parsed, obj)
 *
 * Helper companion function for `.parsePath` that returns
 * the value located at the parsed address.
 *
 *      var value = getPathValue(parsed, obj);
 *
 * @param {Object} parsed definition from `parsePath`.
 * @param {Object} object to search against
 * @returns {Object|Undefined} value
 * @api private
 */

function _getPathValue (parsed, obj) {
  var tmp = obj
    , res;
  for (var i = 0, l = parsed.length; i < l; i++) {
    var part = parsed[i];
    if (tmp) {
      if ('undefined' !== typeof part.p)
        tmp = tmp[part.p];
      else if ('undefined' !== typeof part.i)
        tmp = tmp[part.i];
      if (i == (l - 1)) res = tmp;
    } else {
      res = undefined;
    }
  }
  return res;
};


text:
class MoralSupportDiceRoller : public DiceRoller {

    public:

        MoralSupportDiceRoller() : DiceRoller(120000) {}
        ~MoralSupportDiceRoller();
};

#endif

redpajama_set_name: RedPajamaGithub


text:
Refer to [the Angular's official documentation](https://angular.io/guide/http) for more details on `HttpClient` module.

## API References

| Name     | Type    |
|----------|---------|
| [HttpClient](https://angular.io/guide/http) | `Module` |


text:
module Extensions

using Compat; import Compat.String

"""
!!summary(Methods to extend how Docile handles parsing of docstrings.)

These methods could just as easily be defined outside of the package and allow
for package authors to customise how their documentation is presented to users.
"""
Extensions

import ..Formats: Formats, @META_str
import ..Cache

"""
!!summary(Get the value stored in an object's metadata field.)

In the following example the value associated with the field ``:author`` is
spliced back into the docstring in place of it:

    \\!!get(author)

When no field is found in the metadata for the object, the module and package
metadata are searched in turn.
"""
function Formats.metamacro(::META"get", body, mod, obj)
    out = Cache.findmeta(mod, obj, symbol(body), Any)
    isnull(out) && throw(KeyError("No metadata found in $(obj) for '$(body)'."))
    get(out)
end

"""
!!summary(Set the value for a field in an object's metadata.)

    \\!!set(author:Author's Name)

The key in this example is ``:author`` and the value is ``"Author's Name"``.
"""
function Formats.metamacro(::META"set", body, mod, obj)
    key, value = @compat(split(body, ':', limit = 2))
    Cache.getmeta(mod, obj)[symbol(key)] = value
    ""
end

function Formats.metamacro(::META"setget", body, mod, obj)
    Base.warn_once("'!!setget(...)' is deprecated. Using '!!var(...)' instead.")
    Formats.metamacro(META"var"(), body, mod, obj)
end

"""
!!summary(Equivalent to ``!!set`` followed by ``!!get`` for the provided key.)

    \\!!var(author:Author's Name)

The key in this example is ``:author`` and the value is ``"Author's Name"``.
"""
function Formats.metamacro(::META"var", body, mod, obj)
    key, value = @compat(split(body, ':', limit = 2))
    Cache.getmeta(mod, obj)[symbol(key)] = value
end

"""
!!summary(Specify a short (120 character) summary for a docstring.)

    \\!!summary(...)

The text will be used in the generated index page produced by Lexicon.

A warning is printed when a summary exceeds the character limit.
"""
function Formats.metamacro(::META"summary", body, mod, obj)
    length(body) > 120 && warn("Overlong summary in '$(obj)' docstring.")
    Cache.getmeta(mod, obj)[:summary] = body
    body
end

"""
!!summary(Make the contained text only appear in non-interactive output.)

    \\!!longform(
    ...
    )

In the REPL the text is not displayed. Other ``metamacro`` calls can be nested
inside a ``\\!!longform(...)`` call, such as ``\\!!include(...)``.
"""
function Formats.metamacro(::META"longform", body, mod, obj)
    body = Formats.extractmeta!(body, mod, obj) # Make nestable.
    Cache.getmeta(mod, obj)[:longform] = body
    isinteractive() ? "" : body
end

"""
!!summary(Splice the contents of a file in place of the ``metamacro`` call.)

    \\!!include(filename)

``filename`` must reference an available file found relative to the source file
where the ``metamacro`` is called from.
"""
function Formats.metamacro(::META"include", body, mod, obj)
    meta = Cache.getmeta(mod, obj)
    filename = abspath(joinpath(dirname(meta[:textsource][2]), body))
    isfile(filename) || throw(ArgumentError("Unknown '!!include(...)' file: $(filename)"))
    Formats.extractmeta!(readall(filename), mod, obj)
end

end


text:
require('../lib/node_loader');
var AWS = require('../lib/core');
var Service = AWS.Service;
var apiLoader = AWS.apiLoader;

apiLoader.services['outposts'] = {};
AWS.Outposts = Service.defineService('outposts', ['2019-12-03']);
Object.defineProperty(apiLoader.services['outposts'], '2019-12-03', {
  get: function get() {
    var model = require('../apis/outposts-2019-12-03.min.json');
    model.paginators = require('../apis/outposts-2019-12-03.paginators.json').pagination;
    return model;
  },
  enumerable: true,
  configurable: true
});

module.exports = AWS.Outposts;


text:
describe('GGRC.Components.templateAttributes', function () {
  'use strict';

  var Component;  // the component under test

  beforeAll(function () {
    Component = GGRC.Components.get('templateAttributes');
  });

  describe('fieldRemoved() method', function () {
    var method;  // the method under test
    var scope;
    var remainingFields;
    var $el;
    var eventObj;

    beforeEach(function () {
      scope = new can.Map({
        fields: []
      });
      method = Component.prototype.scope.fieldRemoved.bind(scope);
      $el = $('

');
      eventObj = $.Event('on-delete');
    });

    it('removes the deleted field from the fields list', function () {
      var deletedField = new can.Map({id: 4, title: 'bar'});

      var currentFields = [
        new can.Map({id: 17, title: 'foo'}),
        new can.Map({id: 4, title: 'bar'}),
        new can.Map({id: 52, title: 'baz'})
      ];
      scope.attr('fields').replace(currentFields);

      method(deletedField, $el, eventObj);

      remainingFields = _.map(scope.fields, 'title');
      expect(remainingFields).toEqual(['foo', 'baz']);
    });

    it('removes the field without id from the fields list', function () {
      var deletedField = new can.Map({title: 'bar'});

      var currentFields = [
        new can.Map({id: 17, title: 'foo'}),
        new can.Map({title: 'bar'}),
        new can.Map({id: 52, title: 'baz'})
      ];
      scope.attr('fields').replace(currentFields);

      method(deletedField, $el, eventObj);

      remainingFields = _.map(scope.fields, 'title');
      expect(remainingFields).toEqual(['foo', 'baz']);
    });

    it('doesn\'t change the fields list if field doesn\'t match', function () {
      var deletedField = new can.Map({title: 'barbaz'});

      var currentFields = [
        new can.Map({id: 17, title: 'foo'}),
        new can.Map({id: 4, title: 'bar'}),
        new can.Map({id: 52, title: 'baz'})
      ];
      scope.attr('fields').replace(currentFields);

      spyOn(console, 'warn');

      method(deletedField, $el, eventObj);

      remainingFields = _.map(scope.fields, 'title');
      expect(remainingFields).toEqual(['foo', 'bar', 'baz']);
      expect(console.warn).toHaveBeenCalled();
    });
  });
});


text:
<?php

declare(strict_types = 1);

namespace KoolKode\BPMN\Job\Executor;

use KoolKode\BPMN\Engine\AbstractBusinessCommand;
use KoolKode\BPMN\Engine\BinaryData;
use KoolKode\BPMN\Engine\ProcessEngine;
use KoolKode\BPMN\Job\Handler\JobHandlerInterface;
use KoolKode\BPMN\Job\Job;

/**
 * Execute a job within an engine execution cycle.
 *
 * @author Martin Schröder
 */
class ExecuteJobCommand extends AbstractBusinessCommand
{
    /**
     * The job to be executed.
     *
     * @var Job
     */
    protected $job;

    /**
     * The job handler instance.
     *
     * @var JobHandlerInterface
     */
    protected $handler;

    /**
     * Create a new job execution command that can be processed by the engine.
     *
     * @param Job $job
     * @param JobHandlerInterface $handler
     */
    public function __construct(Job $job, JobHandlerInterface $handler)
    {
        $this->job = $job;
        $this->handler = $handler;
    }

    /**
     * {@inheritdoc}
     */
    protected function executeCommand(ProcessEngine $engine): void
    {
        $execution = $engine->findExecution($this->job->getExecutionId());

        $engine->debug('Executing job <{job}> using handler "{handler}" ({impl}) within {execution}', [
            'job' => (string) $this->job->getId(),
            'handler' => $this->handler->getType(),
            'impl' => \get_class($this->handler),
            'execution' => (string) $execution
        ]);

        try {
            $this->handler->executeJob($this->job, $execution, $engine);

            // Delete job when it has been completed successfully.
            $engine->getConnection()->delete('#__bpmn_job', [
                'id' => $this->job->getId()
            ]);
        } catch (\Exception $e) {
            $engine->warning('Job <{job}> failed with exception {exception}: "{message}"', [
                'job' => (string) $this->job->getId(),
                'exception' => \get_class($e),
                'message' => $e->getMessage()
            ]);

            $stmt = $engine->prepareQuery("
                UPDATE `#__bpmn_job`
                SET `retries` = `retries` - 1,
                    `scheduled_at` = NULL,
                    `lock_owner` = NULL,
                    `locked_at` = NULL,
                    `exception_type` = :type,
                    `exception_message` = :message,
                    `exception_data` = :data
                WHERE `id` = :id
            ");
            $stmt->bindValue('id', $this->job->getId());
            $stmt->bindValue('type', \get_class($e));
            $stmt->bindValue('message', (string) $e->getMessage());
            $stmt->bindValue('data', new BinaryData(\serialize($e->getTraceAsString())));
            $stmt->execute();
        }
    }
}


text:
<?php
class A {
    protected $protected = 'a';
    protected static $protectedStatic = 'b';
    private $private = 'c';
    private static $privateStatic = 'd';
}

class B extends A {}

$a               = new A;
$protected       = new ReflectionProperty($a, 'protected');
$protectedStatic = new ReflectionProperty('A', 'protectedStatic');
$private         = new ReflectionProperty($a, 'private');
$privateStatic   = new ReflectionProperty('A', 'privateStatic');

try {
    var_dump($protected->getValue($a));
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

try {
    var_dump($protectedStatic->getValue());
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

try {
    var_dump($private->getValue($a));
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

try {
    var_dump($privateStatic->getValue());
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

$protected->setAccessible(TRUE);
$protectedStatic->setAccessible(TRUE);
$private->setAccessible(TRUE);
$privateStatic->setAccessible(TRUE);

var_dump($protected->getValue($a));
var_dump($protectedStatic->getValue());
var_dump($private->getValue($a));
var_dump($privateStatic->getValue());

$protected->setValue($a, 'e');
$protectedStatic->setValue('f');
$private->setValue($a, 'g');
$privateStatic->setValue('h');

var_dump($protected->getValue($a));
var_dump($protectedStatic->getValue());
var_dump($private->getValue($a));
var_dump($privateStatic->getValue());

$a               = new A;
$b               = new B;
$protected       = new ReflectionProperty($b, 'protected');
$protectedStatic = new ReflectionProperty('B', 'protectedStatic');
$private         = new ReflectionProperty($a, 'private');

try {
    var_dump($protected->getValue($b));
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

try {
    var_dump($protectedStatic->getValue());
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

try {
    var_dump($private->getValue($b));
}

catch (ReflectionException $e) {
    var_dump($e->getMessage());
}

$protected->setAccessible(TRUE);
$protectedStatic->setAccessible(TRUE);
$private->setAccessible(TRUE);

var_dump($protected->getValue($b));
var_dump($protectedStatic->getValue());
var_dump($private->getValue($b));

$protected->setValue($b, 'e');
$protectedStatic->setValue('f');
$private->setValue($b, 'g');

var_dump($protected->getValue($b));
var_dump($protectedStatic->getValue());
var_dump($private->getValue($b));
?>


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

import com.facebook.presto.metadata.BoundVariables;
import com.facebook.presto.metadata.FunctionManager;
import com.facebook.presto.metadata.SqlAggregationFunction;
import com.facebook.presto.operator.aggregation.AggregationMetadata.AccumulatorStateDescriptor;
import com.facebook.presto.operator.aggregation.state.DoubleState;
import com.facebook.presto.operator.aggregation.state.LongState;
import com.facebook.presto.operator.aggregation.state.StateCompiler;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.function.AccumulatorState;
import com.facebook.presto.spi.function.AccumulatorStateSerializer;
import com.facebook.presto.spi.type.StandardTypes;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.spi.type.TypeManager;
import com.google.common.collect.ImmutableList;
import io.airlift.bytecode.DynamicClassLoader;

import java.lang.invoke.MethodHandle;
import java.util.List;

import static com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata;
import static com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType.BLOCK_INDEX;
import static com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType.BLOCK_INPUT_CHANNEL;
import static com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType.INPUT_CHANNEL;
import static com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType.STATE;
import static com.facebook.presto.operator.aggregation.AggregationUtils.generateAggregationName;
import static com.facebook.presto.spi.type.RealType.REAL;
import static com.facebook.presto.spi.type.TypeSignature.parseTypeSignature;
import static com.facebook.presto.util.Reflection.methodHandle;
import static java.lang.Float.floatToIntBits;
import static java.lang.Float.intBitsToFloat;

public class RealAverageAggregation
        extends SqlAggregationFunction
{
    public static final RealAverageAggregation REAL_AVERAGE_AGGREGATION = new RealAverageAggregation();
    private static final String NAME = "avg";

    private static final MethodHandle INPUT_FUNCTION = methodHandle(RealAverageAggregation.class, "input", LongState.class, DoubleState.class, long.class);
    private static final MethodHandle COMBINE_FUNCTION = methodHandle(RealAverageAggregation.class, "combine", LongState.class, DoubleState.class, LongState.class, DoubleState.class);
    private static final MethodHandle OUTPUT_FUNCTION = methodHandle(RealAverageAggregation.class, "output", LongState.class, DoubleState.class, BlockBuilder.class);

    protected RealAverageAggregation()
    {
        super(NAME,
                ImmutableList.of(),
                ImmutableList.of(),
                parseTypeSignature(StandardTypes.REAL),
                ImmutableList.of(parseTypeSignature(StandardTypes.REAL)));
    }

    @Override
    public String getDescription()
    {
        return "Returns the average value of the argument";
    }

    @Override
    public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager)
    {
        DynamicClassLoader classLoader = new DynamicClassLoader(AverageAggregations.class.getClassLoader());
        Class<? extends AccumulatorState> longStateInterface = LongState.class;
        Class<? extends AccumulatorState> doubleStateInterface = DoubleState.class;
        AccumulatorStateSerializer<?> longStateSerializer = StateCompiler.generateStateSerializer(longStateInterface, classLoader);
        AccumulatorStateSerializer<?> doubleStateSerializer = StateCompiler.generateStateSerializer(doubleStateInterface, classLoader);

        AggregationMetadata metadata = new AggregationMetadata(
                generateAggregationName(NAME, parseTypeSignature(StandardTypes.REAL), ImmutableList.of(parseTypeSignature(StandardTypes.REAL))),
                ImmutableList.of(new ParameterMetadata(STATE), new ParameterMetadata(STATE), new ParameterMetadata(INPUT_CHANNEL, REAL)),
                INPUT_FUNCTION,
                COMBINE_FUNCTION,
                OUTPUT_FUNCTION,
                ImmutableList.of(
                        new AccumulatorStateDescriptor(
                                longStateInterface,
                                longStateSerializer,
                                StateCompiler.generateStateFactory(longStateInterface, classLoader)),
                        new AccumulatorStateDescriptor(
                                doubleStateInterface,
                                doubleStateSerializer,
                                StateCompiler.generateStateFactory(doubleStateInterface, classLoader))),
                REAL);

        GenericAccumulatorFactoryBinder factory = AccumulatorCompiler.generateAccumulatorFactoryBinder(metadata, classLoader);
        return new InternalAggregationFunction(
                NAME,
                ImmutableList.of(REAL),
                ImmutableList.of(
                        longStateSerializer.getSerializedType(),
                        doubleStateSerializer.getSerializedType()),
                REAL,
                true,
                false,
                factory);
    }

    private static List<ParameterMetadata> createInputParameterMetadata(Type value)
    {
        return ImmutableList.of(new ParameterMetadata(STATE), new ParameterMetadata(BLOCK_INPUT_CHANNEL, value), new ParameterMetadata(BLOCK_INDEX));
    }

    public static void input(LongState count, DoubleState sum, long value)
    {
        count.setLong(count.getLong() + 1);
        sum.setDouble(sum.getDouble() + intBitsToFloat((int) value));
    }

    public static void combine(LongState count, DoubleState sum, LongState otherCount, DoubleState otherSum)
    {
        count.setLong(count.getLong() + otherCount.getLong());
        sum.setDouble(sum.getDouble() + otherSum.getDouble());
    }

    public static void output(LongState count, DoubleState sum, BlockBuilder out)
    {
        if (count.getLong() == 0) {
            out.appendNull();
        }
        else {
            REAL.writeLong(out, floatToIntBits((float) (sum.getDouble() / count.getLong())));
        }
    }
}


text:
package org.graphwalker.core.condition;

import org.graphwalker.core.generator.RandomPath;
import org.graphwalker.core.machine.Context;
import org.graphwalker.core.machine.TestExecutionContext;
import org.graphwalker.core.model.Edge;
import org.graphwalker.core.model.Model;
import org.graphwalker.core.model.Vertex;
import org.graphwalker.core.statistics.SimpleProfiler;
import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;

/**
 * @author Miroslav Janeski
 */
public class DependencyEdgeCoverageTest {

  @Test
  public void testConstructor() throws Exception {
    DependencyEdgeCoverage edgeCoverage = new DependencyEdgeCoverage(100);
    assertThat(edgeCoverage.getDependency(), is(100));
  }

  @Test(expected = StopConditionException.class)
  public void testNegativeDependency() throws Exception {
    new DependencyEdgeCoverage(-55);
  }

  @Test
  public void testFulfilmentOneEdgeBelowDependency() throws Exception {
    Vertex v1 = new Vertex();
    Vertex v2 = new Vertex();
    Edge e1 = new Edge().setSourceVertex(v1).setTargetVertex(v2).setDependency(90);
    Edge e2 = new Edge().setSourceVertex(v2).setTargetVertex(v1).setDependency(80);
    Model model = new Model().addEdge(e1).addEdge(e2);
    StopCondition condition = new DependencyEdgeCoverage(85);
    Context context = new TestExecutionContext(model, new RandomPath(condition));
    context.setProfiler(new SimpleProfiler());
    assertThat(condition.getFulfilment(), is(0.0));
    context.setCurrentElement(e1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertThat(condition.getFulfilment(), is(1.0));
    context.setCurrentElement(e2.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertThat(condition.getFulfilment(), is(1.0));
  }

  @Test
  public void testFulfilment() throws Exception {
    Vertex v1 = new Vertex();
    Vertex v2 = new Vertex();
    Edge e1 = new Edge().setSourceVertex(v1).setTargetVertex(v2).setDependency(90);
    Edge e2 = new Edge().setSourceVertex(v2).setTargetVertex(v1).setDependency(80);
    Model model = new Model().addEdge(e1).addEdge(e2);
    StopCondition condition = new DependencyEdgeCoverage(75);
    Context context = new TestExecutionContext(model, new RandomPath(condition));
    context.setProfiler(new SimpleProfiler());
    assertThat(condition.getFulfilment(), is(0.0));
    context.setCurrentElement(e1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertThat(condition.getFulfilment(), is(0.5));
    context.setCurrentElement(e2.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertThat(condition.getFulfilment(), is(1.0));
  }

  @Test
  public void testIsFulfilled() throws Exception {
    Vertex v1 = new Vertex();
    Vertex v2 = new Vertex();
    Edge e1 = new Edge().setSourceVertex(v1).setTargetVertex(v2).setDependency(90);
    Edge e2 = new Edge().setSourceVertex(v2).setTargetVertex(v1).setDependency(80);
    Model model = new Model().addEdge(e2).addEdge(e1);
    StopCondition condition = new DependencyEdgeCoverage(85);
    Context context = new TestExecutionContext(model, new RandomPath(condition));
    context.setProfiler(new SimpleProfiler());
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(e1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(e2.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(v1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertTrue(condition.isFulfilled());
  }

  @Test
  public void testIsFulfilledHighDependencyTreshold() throws Exception {
    Vertex v1 = new Vertex();
    Vertex v2 = new Vertex();
    Edge e1 = new Edge().setSourceVertex(v1).setTargetVertex(v2).setDependency(80);
    Edge e2 = new Edge().setSourceVertex(v2).setTargetVertex(v1).setDependency(80);
    Model model = new Model().addEdge(e2).addEdge(e1);
    StopCondition condition = new DependencyEdgeCoverage(85);
    Context context = new TestExecutionContext(model, new RandomPath(condition));
    context.setProfiler(new SimpleProfiler());
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(e1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(e2.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(v1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
  }

  @Test
  public void testIsFulfilledDependencyTreshold() throws Exception {
    Vertex v1 = new Vertex();
    Vertex v2 = new Vertex();
    Edge e1 = new Edge().setSourceVertex(v1).setTargetVertex(v2).setDependency(90);
    Edge e2 = new Edge().setSourceVertex(v2).setTargetVertex(v1).setDependency(80);
    Model model = new Model().addEdge(e2).addEdge(e1);
    StopCondition condition = new DependencyEdgeCoverage(85);
    Context context = new TestExecutionContext(model, new RandomPath(condition));
    context.setProfiler(new SimpleProfiler());
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(e1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(e2.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertFalse(condition.isFulfilled());
    context.setCurrentElement(v1.build());
    context.getProfiler().start(context);
    context.getProfiler().stop(context);
    assertTrue(condition.isFulfilled());
  }

}


text:
import os
import random
from flask import render_template, request, current_app
from emonitor.extensions import db
from emonitor.modules.settings.settings import Settings
from emonitor.modules.settings.department import Department
from emonitor.modules.streets.street import Street
from emonitor.modules.maps.map import Map
from emonitor.modules.cars.car import Car
from emonitor.modules.alarmobjects.alarmobject import AlarmObject
from emonitor.modules.alarmobjects.alarmobjecttype import AlarmObjectType
from emonitor.modules.alarmobjects.alarmobjectfile import AlarmObjectFile

def getAdminContent(self, **params):
    """
    Deliver admin content of module alarmobjects

    :param params: use given parameters of request
    :return: rendered template as string
    """
    module = request.view_args['module'].split('/')

    def chunks(l, n):
        return [l[i:i + n] for i in range(0, len(l), n)]

    if len(module) > 1:  # type definition
        if module[1] == 'types':
            if request.method == 'POST':
                if request.form.get('action') == 'createalarmobjecttype':  # add type
                    params.update({'alarmobjecttype': AlarmObjectType('', '')})
                    return render_template('admin.alarmobjects.types_action.html', **params)

                elif request.form.get('action') == 'savealarmobjecttype':  # save type
                    if request.form.get('alarmobjecttype_id') == 'None':  # add new type
                        alarmobjecttype = AlarmObjectType('', '')
                        db.session.add(alarmobjecttype)
                    else:  # update existing
                        alarmobjecttype = AlarmObjectType.getAlarmObjectTypes(id=int(request.form.get('alarmobjecttype_id')))
                    alarmobjecttype.name = request.form.get('alarmobjecttype_name')
                    alarmobjecttype.remark = request.form.get('alarmobjecttype_remark')
                    db.session.commit()

                elif request.form.get('action').startswith('detailobjecttype'):  # edit type
                    alarmobjecttype = AlarmObjectType.getAlarmObjectTypes(id=int(request.form.get('action').split('_')[-1]))
                    params.update({'alarmobjecttype': alarmobjecttype})
                    return render_template('admin.alarmobjects.types_action.html', **params)

                elif request.form.get('action').startswith('deleteobjecttype_'):  # delete type
                    db.session.delete(AlarmObjectType.getAlarmObjectTypes(id=int(request.form.get('action').split('_')[-1])))
                    db.session.commit()

            params.update({'alarmobjecttypes': AlarmObjectType.getAlarmObjectTypes()})
            return render_template('admin.alarmobjects.types.html', **params)

        elif module[1] == 'fields':
            if request.method == 'POST':
                if request.form.get('action') == 'updatefield':  # update fields
                    Settings.set('alarmobjectfields', [i for i in chunks(request.form.getlist('fieldname'), 2) if i[0] != ''])
                    db.session.commit()

            params.update({'fields': Settings.get('alarmobjectfields', [])})
            return render_template('admin.alarmobjects.fields.html', **params)

    else:  # base view
        if request.method == 'POST':
            streets = Street.getStreets()
            if request.form.get('action') == 'createalarmobject':  # add alarmobject
                params.update({'alarmobject': AlarmObject('', 0, '', Settings.get('defaultLat'), Settings.get('defaultLng'), Settings.get('defaultZoom'), '', '', '', 0, 0), 'streets': streets, 'selectedstreet': '', 'map': Map.getDefaultMap(), 'alarmobjecttypes': AlarmObjectType.getAlarmObjectTypes()})
                return render_template('admin.alarmobjects_actions.html', **params)

            elif request.form.get('action') == 'savealarmobject':  # save
                if request.form.get('alarmobject_id') == 'None':  # add new
                    alarmobject = AlarmObject('', 0, '', 0, 0, 0, '', '', '', 0, 0)
                    db.session.add(alarmobject)
                else:  # update existing
                    alarmobject = AlarmObject.getAlarmObjects(id=request.form.get('alarmobject_id'))
                alarmobject.name = request.form.get('edit_name')
                alarmobject._streetid = request.form.get('streetid')
                alarmobject._objecttype = int(request.form.get('edit_objecttype'))
                alarmobject.remark = request.form.get('edit_remark')
                if request.form.get('edit_position') == '1':
                    alarmobject.lat = request.form.get('edit_lat')
                    alarmobject.lng = request.form.get('edit_lng')
                    alarmobject.zoom = request.form.get('edit_zoom')
                alarmobject.streetno = request.form.get('edit_streetno')
                alarmobject.alarmplan = request.form.get('edit_alarmplan')
                alarmobject.bma = request.form.get('edit_bma')
                alarmobject.active = int(request.form.get('edit_active', '0'))
                db.session.commit()

            elif request.form.get('action') == 'savealarmobjectattributes':  # save attributes
                alarmobject = AlarmObject.getAlarmObjects(id=request.form.get('alarmobject_id'))
                for field in Settings.get('alarmobjectfields', []):  # store attributes
                    if 'edit_%s' % field[0] in request.form:
                        alarmobject.set(field[0], request.form.get('edit_%s' % field[0]))
                db.session.commit()

            elif request.form.get('action') == 'savealarmobjectaao':  # save aao
                alarmobject = AlarmObject.getAlarmObjects(id=request.form.get('alarmobject_id'))
                if alarmobject:
                    alarmobject.set('cars1', [c for c in request.form.get('cars1').split(';') if c != ''])
                    alarmobject.set('cars2', [c for c in request.form.get('cars2').split(';') if c != ''])
                    alarmobject.set('material', [c for c in request.form.get('material').split(';') if c != ''])
                    db.session.commit()

            elif request.form.get('action').startswith('editalarmobject_'):  # edit alarmobject
                alarmobject = AlarmObject.getAlarmObjects(id=int(request.form.get('action').split('_')[-1]))
                params.update({'alarmobject': alarmobject, 'streets': streets, 'selectedstreet': '%s (%s)' % (alarmobject.street.name, alarmobject.street.city.name), 'map': Map.getDefaultMap(), 'alarmobjecttypes': AlarmObjectType.getAlarmObjectTypes(), 'fields': Settings.get('alarmobjectfields', []), 'cars': Car.getCars(deptid=Department.getDefaultDepartment().id)})
                return render_template('admin.alarmobjects_actions.html', **params)

            elif request.form.get('action').startswith('deletealarmobject_'):  # delete alarmobject
                db.session.delete(AlarmObject.getAlarmObjects(id=int(request.form.get('action').split('_')[-1])))
                db.session.commit()

        params.update({'alarmobjects': AlarmObject.getAlarmObjects(active=0), 'alarmobjecttypes': AlarmObjectType.getAlarmObjectTypes()})
        return render_template('admin.alarmobjects.html', **params)

def getAdminData(self):
    """
    Deliver admin content of module alarmobjects (ajax)

    :return: rendered template as string or json dict
    """
    if request.args.get('action') == 'uploadfile':  # add file for alarmobject
        ufile = request.files['uploadfile']
        filetype = request.form.get('name')
        alarmobject = AlarmObject.getAlarmObjects(id=request.form.get('alarmobject_id'))
        filename = '%s%s' % (str(random.random())[2:], os.path.splitext(ufile.filename)[1])

        if not os.path.exists('%salarmobjects/%s/' % (current_app.config.get('PATH_DATA'), alarmobject.id)):  # create base directory
            os.makedirs('%salarmobjects/%s/' % (current_app.config.get('PATH_DATA'), alarmobject.id))

        ufile.save('%salarmobjects/%s/%s' % (current_app.config.get('PATH_DATA'), alarmobject.id, filename))
        alarmobject.files.set(AlarmObjectFile(alarmobject.id, filename, filetype))
        db.session.commit()
        return render_template('admin.alarmobjects.file.html', alarmobject=alarmobject)

    elif request.args.get('action') == 'deletefile':  # delete file with id
        objectfile = AlarmObjectFile.getFile(id=request.args.get('id'))
        oid = objectfile.object_id
        if os.path.exists('%salarmobjects/%s/%s' % (current_app.config.get('PATH_DATA'), oid, objectfile.filename)):
            os.remove('%salarmobjects/%s/%s' % (current_app.config.get('PATH_DATA'), oid, objectfile.filename))
        db.session.delete(objectfile)
        db.session.commit()
        alarmobject = AlarmObject.getAlarmObjects(id=oid)
        return render_template('admin.alarmobjects.file.html', alarmobject=alarmobject)

    return ""


text:
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WallpaperPicker) {
  host_resolver()->AddRule("a.com", "127.0.0.1");
  ASSERT_TRUE(StartTestServer());
  ASSERT_TRUE(RunComponentExtensionTest("wallpaper_manager")) << message_;
}


text:
package resourceprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor"

import (
	"context"

	"go.opentelemetry.io/collector/pdata/plog"
	"go.opentelemetry.io/collector/pdata/pmetric"
	"go.opentelemetry.io/collector/pdata/ptrace"
	"go.uber.org/zap"

	"github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/attraction"
)

type resourceProcessor struct {
	logger   *zap.Logger
	attrProc *attraction.AttrProc
}

func (rp *resourceProcessor) processTraces(ctx context.Context, td ptrace.Traces) (ptrace.Traces, error) {
	rss := td.ResourceSpans()
	for i := 0; i < rss.Len(); i++ {
		rp.attrProc.Process(ctx, rp.logger, rss.At(i).Resource().Attributes())
	}
	return td, nil
}

func (rp *resourceProcessor) processMetrics(ctx context.Context, md pmetric.Metrics) (pmetric.Metrics, error) {
	rms := md.ResourceMetrics()
	for i := 0; i < rms.Len(); i++ {
		rp.attrProc.Process(ctx, rp.logger, rms.At(i).Resource().Attributes())
	}
	return md, nil
}

func (rp *resourceProcessor) processLogs(ctx context.Context, ld plog.Logs) (plog.Logs, error) {
	rls := ld.ResourceLogs()
	for i := 0; i < rls.Len(); i++ {
		rp.attrProc.Process(ctx, rp.logger, rls.At(i).Resource().Attributes())
	}
	return ld, nil
}


text:
Extremely lightweight and fast-to-launch DI with no third-party dependencies. Even more powerful: support of nested scopes,
singletons and instance factories, modules, optimized multi-threaded and single-threaded injectors. All reflection is
completely abstracted out in a separate module and is entirely optional.

You can add this module to your project by inserting the following dependency to **pom.xml**:
```xml
<dependency>
    <groupId>io.datakernel</groupId>
    <artifactId>datakernel-di</artifactId>
    <version>3.2-SNAPSHOT</version>
</dependency>
```

### To find out more visit [our site](https://datakernel.io/docs/core/di.html).


text:
package net.roboconf.core.dsl.parsing;

/**
 * A block for blank areas (several line breaks, tabulations, etc).
 * @author Vincent Zurczak - Linagora
 */
public class BlockBlank extends AbstractIgnorableInstruction {

	/**
	 * Constructor.
	 * @param declaringFile the definition file
	 * @param content the block's content
	 */
	public BlockBlank( FileDefinition declaringFile, String content ) {
		super( declaringFile, content );
	}

	/*
	 * (non-Javadoc)
	 * @see net.roboconf.core.dsl.parsing.AbstractBlock#getInstructionType()
	 */
	@Override
	public int getInstructionType() {
		return AbstractBlock.BLANK;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Blank region";
	}
}


text:
require 'spec_helper'

describe USER_APP do
  def app
    USER_APP
  end

  def post_json(uri, json)
    post(uri, json, { "CONTENT_TYPE" => "application/json" })
  end

  after :each do
    puts "Response was:"
    puts "Status: #{last_response.status}"
    puts "Body:"
    puts "#{last_response.body.lines.first(20).join('')}"
  end

  context 'invalid JSON to JSON routes' do
    routes = ['/signup', '/login']
    routes.each do |route|
      it "responds with 400 for #{route}" do
        post_json route, '}'
        expect(last_response.status).to eq(400)
      end

      it "responds with JSON_PARSING code for #{route}" do
        post_json route, '}'
        expect(JSON.parse(last_response.body)['code']).to eq('JSON_PARSING')
      end
    end
  end
end


text:
from __future__ import print_function
import sys
import pexdoc.exh
import pexdoc.pcontracts
import tests.support.pinspect_support_module_2

def module_enclosing_func(offset):  # noqa: D202
    """Test function to see if module-level enclosures are detected."""

    def module_closure_func(value):
        """Actual closure function."""
        return offset + value

    return module_closure_func

def class_enclosing_func():
    """Test function to see if classes within enclosures are detected."""
    import tests.support.pinspect_support_module_3

    class ClosureClass(object):
        """Actual closure class."""

        def __init__(self):  # noqa: D401
            """Constructor method."""
            self.obj = None

        def get_obj(self):
            """Getter method."""
            return self.obj

        def set_obj(self, obj):
            """Setter method."""
            self.obj = obj

        def sub_enclosure_method(self):  # noqa: D202
            """Test method to see if class of classes are detected."""

            class SubClosureClass(object):
                """Actual sub-closure class."""

                def __init__(self):  # noqa: D401
                    """Constructor method."""
                    self.subobj = None

            return SubClosureClass

        mobj = sys.modules["tests.support.pinspect_support_module_2"]
        obj = property(
            mobj.getter_func_for_closure_class,
            set_obj,
            tests.support.pinspect_support_module_3.deleter,
        )

    return ClosureClass

class ClassWithPropertyDefinedViaLambdaAndEnclosure(object):
    """Class with lambda for property function and enclosed function to define prop."""

    def __init__(self):  # noqa: D107
        self._clsvar = None

    clsvar = property(
        lambda self: self._clsvar + 10,
        tests.support.pinspect_support_module_2.setter_enclosing_func(5),
        doc="Class variable property",
    )

def dummy_decorator(func):  # noqa: D401
    """Dummy property decorator, to test if chained decorators are handled correctly."""
    return func

def simple_property_generator():  # noqa: D401,D202
    """Function to test if properties done via enclosed functions properly detected."""

    def fget(self):
        """Actual getter function."""
        return self._value

    return property(fget)

class ClassWithPropertyDefinedViaFunction(object):
    """Class to test if properties defined via property function handled correctly."""

    def __init__(self):  # noqa: D107
        self._state = None

    @pexdoc.pcontracts.contract(state=int)
    @dummy_decorator
    def _setter_func(self, state):
        """Setter method with property defined via property() function."""
        exobj = (
            pexdoc.exh.get_exh_obj()
            if pexdoc.exh.get_exh_obj()
            else pexdoc.exh.ExHandle()
        )
        exobj.add_exception(
            exname="dummy_exception_1", extype=ValueError, exmsg="Dummy message 1"
        )
        exobj.add_exception(
            exname="dummy_exception_2", extype=TypeError, exmsg="Dummy message 2"
        )
        self._state = state

    def _getter_func(self):
        """Getter method with property defined via property() function."""
        return self._state

    def _deleter_func(self):  # noqa: D401
        """Deleter method with property defined via property() function."""
        print("Cannot delete attribute")

    state = property(_getter_func, _setter_func, _deleter_func, doc="State attribute")

import math

class ClassWithPropertyDefinedViaDecorators(object):
    """Class to test if properties defined via decorator functions handled correctly."""

    def __init__(self):  # noqa: D107
        self._value = None

    def __call__(self):  # noqa: D102
        self._value = 2 * self._value if self._value else self._value

    @property
    def temp(self):
        """Getter method defined with decorator."""
        return math.sqrt(self._value)

    @temp.setter
    @pexdoc.pcontracts.contract(value=int)
    def temp(self, value):
        """Setter method defined with decorator."""
        self._value = value

    @temp.deleter
    def temp(self):  # noqa: D401
        """Deleter method defined with decorator."""
        print("Cannot delete attribute")

    encprop = simple_property_generator()

import tests.support.pinspect_support_module_4

def class_namespace_test_enclosing_func():
    """Test namespace support for enclosed class properties."""
    # pylint: disable=C0301

    class NamespaceTestClosureClass(object):  # noqa: D200,D210,D400
        r""" Actual class
        """  # This is to test a comment after a multi-line docstring

        def __init__(self, value):
            _, _, _ = (5, 3, 7)

            self._value = value

        nameprop = (
            tests.support.pinspect_support_module_4.another_property_action_enclosing_function()
        )

    return NamespaceTestClosureClass


text:
from __future__ import unicode_literals

from django_event.backends.selector import BackendSelector

Backend = BackendSelector()


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.kodcu</groupId>
    <artifactId>AsciidocFX</artifactId>
    <version>1.4.5</version>
    <packaging>jar</packaging>

    <name>AsciidocFX</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <mainClass>com.kodcu.boot.AppStarter</mainClass>
        <install4j.home>/home/travis/build/asciidocfx/AsciidocFX/install4j6</install4j.home>
        <install4j.licenseKey>${env.CI_LICENSE_KEY}</install4j.licenseKey>
    </properties>

    <organization>
        <name>kodcu.com</name>
    </organization>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.2.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>com.dooapp.fxform2</groupId>
            <artifactId>core</artifactId>
            <version>8.0.12</version>
            <exclusions>
                <exclusion>
                    <artifactId>validation-api</artifactId>
                    <groupId>javax.validation</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>snakeyaml</artifactId>
                    <groupId>org.yaml</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-messaging</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>aopalliance</artifactId>
                    <groupId>aopalliance</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency>
        <dependency>
            <groupId>de.jensd</groupId>
            <artifactId>fontawesomefx</artifactId>
            <version>8.0.10</version>
        </dependency>
        <dependency>
            <groupId>org.jooq</groupId>
            <artifactId>joox</artifactId>
            <version>1.3.0</version>
        </dependency>
        <!--PDF Generate with Apache FOP-->
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>fop</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>org.zeroturnaround</groupId>
            <artifactId>zt-exec</artifactId>
            <version>1.8</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.plantuml</groupId>
            <artifactId>plantuml</artifactId>
            <version>8033</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>batik-codec</artifactId>
            <version>1.8</version>
        </dependency>
        <dependency>
            <groupId>de.tototec</groupId>
            <artifactId>de.tototec.cmdoption</artifactId>
            <version>0.4.1</version>
        </dependency>
        <dependency>
            <artifactId>install4j</artifactId>
            <groupId>i4jruntime</groupId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.odftoolkit</groupId>
            <artifactId>simple-odf</artifactId>
            <version>0.7-incubating</version>
        </dependency>
        <dependency>
            <groupId>org.carrot2</groupId>
            <artifactId>morfologik-speller</artifactId>
            <version>1.10.0</version>
        </dependency>
    </dependencies>

    <build>
        <finalName>AsciidocFX</finalName>

        <plugins>
            <!--            <plugin>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-maven-plugin</artifactId>
                            <version>${spring-boot.version}</version>
                            <configuration>
                                <mainClass>com.kodcu.boot.AppStarter</mainClass>
                            </configuration>
                        </plugin>-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>appassembler-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>assemble</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <programs>
                        <program>
                            <mainClass>com.kodcu.boot.AppStarter</mainClass>
                            <id>asciidocfx</id>
                        </program>
                    </programs>
                    <extraJvmArguments>-Duser.language=en -Duser.country=US -XX:+UseG1GC</extraJvmArguments>
                    <repositoryLayout>flat</repositoryLayout>
                    <useWildcardClassPath>true</useWildcardClassPath>
                    <binFileExtensions>
                        <unix>.sh</unix>
                    </binFileExtensions>
                    <repositoryName>lib</repositoryName>
                    <configurationDirectory>conf</configurationDirectory>
                    <configurationSourceDirectory>${project.basedir}/conf</configurationSourceDirectory>
                    <copyConfigurationDirectory>true</copyConfigurationDirectory>
                    <!--<logsDirectory>log</logsDirectory>-->
                    <showConsoleWindow>true</showConsoleWindow>
                    <!--<unixScriptTemplate>${project.basedir}/src/main/resources/assembly/unixBinTemplate.sh</unixScriptTemplate>-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.install4j</groupId>
                <artifactId>install4j-maven-plugin</artifactId>
                <version>1.0.7</version>
                <executions>
                    <execution>
                        <id>compile-installers</id>
                        <phase>package</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <projectFile>${project.basedir}/asciidocfx.install4j</projectFile>
                            <installDir>${install4j.home}</installDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Central</name>
            <url>http://repo1.maven.org/maven2/</url>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
        </repository>
        <repository>
            <id>rahmanusta-releases</id>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
                <updatePolicy>always</updatePolicy>
            </releases>
            <url>http://asciidocfx.com/build</url>
        </repository>
    </repositories>

</project>


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

<TITLE>
B-Index
</TITLE>

<META NAME="date" CONTENT="2013-03-01">

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

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E G K M S T U

B

Base64 - Class in ch.unifr.pai.twice.authentication.client.security
Custom Base64 encode/decode implementation suitable for use in GWT applications (uses only translatable classes).
Base64() -
Constructor for class ch.unifr.pai.twice.authentication.client.security.Base64

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E G K M S T U


text:
#! /usr/bin/env node

import { log, use, getArchCliNames } from "builder-util"
import { printErrorAndExit } from "builder-util/out/promise"
import { computeDefaultAppDirectory, getConfig } from "app-builder-lib/out/util/config"
import { getElectronVersion } from "app-builder-lib/out/electron/electronVersion"
import { createLazyProductionDeps } from "app-builder-lib/out/util/packageDependencies"
import { installOrRebuild } from "app-builder-lib/out/util/yarn"
import { readJson } from "fs-extra"
import { Lazy } from "lazy-val"
import * as path from "path"
import { orNullIfFileNotExist } from "read-config-file"
import yargs from "yargs"

declare const PACKAGE_VERSION: string

/** @internal */
export function configureInstallAppDepsCommand(yargs: yargs.Argv): yargs.Argv {
  // https://github.com/yargs/yargs/issues/760
  // demandOption is required to be set
  return yargs
    .parserConfiguration({
      "camel-case-expansion": false,
    })
    .option("platform", {
      choices: ["linux", "darwin", "win32"],
      default: process.platform,
      description: "The target platform",
    })
    .option("arch", {
      choices: getArchCliNames().concat("all"),
      default: process.arch === "arm" ? "armv7l" : process.arch,
      description: "The target arch",
    })
}

/** @internal */
export async function installAppDeps(args: any) {
  try {
    log.info({version: PACKAGE_VERSION}, "electron-builder")
  }
  catch (e) {
    // error in dev mode without babel
    if (!(e instanceof ReferenceError)) {
      throw e
    }
  }

  const projectDir = process.cwd()
  const packageMetadata = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, "package.json"))))
  const config = await getConfig(projectDir, null, null, packageMetadata)
  const [appDir, version] = await Promise.all<string>([
    computeDefaultAppDirectory(projectDir, use(config.directories, it => it!.app)),
    getElectronVersion(projectDir, config, packageMetadata),
  ])

  // if two package.json — force full install (user wants to install/update app deps in addition to dev)
  await installOrRebuild(config, appDir, {
    frameworkInfo: {version, useCustomDist: true},
    platform: args.platform,
    arch: args.arch,
    productionDeps: createLazyProductionDeps(appDir, null),
  }, appDir !== projectDir)
}

function main() {
  return installAppDeps(configureInstallAppDepsCommand(yargs).argv)
}

if (require.main === module) {
  log.warn("please use as subcommand: electron-builder install-app-deps")
  main()
    .catch(printErrorAndExit)
}


text:
{% import 'macros.jinja2' as utils %}
{% import 'base.c.jinja2' as cpp %}
{% import 'mcu.jinja2' as embedded %}
{% set template = namespace(math=false) %}

#ifndef _{{info.title}}_H_
#define _{{info.title}}_H_

{# Create enums for functions #}
{% if functions %}
{% for key,function in functions|dictsort %}
{# Check if we need to import `math` lib #}
{% if 'computed' in function %}
{% for ckey,compute in function.computed|dictsort %}
{% macro scanForMathLib(logicKeys) -%}
{% for logic in logicKeys %}
{% if logic is mapping %}
{% for logicKey in logic.keys() %}
{% if logicKey == 'power' or logicKey == 'arc tangent' %}
{% if template.math is sameas false %}
#include <math.h>
{% set template.math = true %}
{% endif %}
{% elif logic[logicKey] is iterable and logic[logicKey] is not string -%}
{{- scanForMathLib(logic[logicKey]) -}}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{%- endmacro %}
{{- scanForMathLib(compute.logic) -}}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}

{# Create enums for fields #}
{% if fields %}
{% for key,field in fields|dictsort %}
{% if field.enum %}
{# Create enum #}
/*
{{utils.pad_string(" * ", "Valid values for " + field.title)}}
 */
enum {{key}} {
    {% set args = namespace(index=0) %}
    {% for ekey,enum in field.enum|dictsort %}
    {{key.upper()}}_{{ekey.upper()}} = {{enum.value}}{{- "," if args.index + 1 < field.enum | length }} // {{enum.title}}
    {% set args.index = args.index + 1 %}
    {% endfor %}
};
typedef enum {{key}} {{key}}_t;
{% endif %}
{% endfor %}
{% endif %}
{% if i2c.address is iterable and i2c.address is not string %}
enum deviceAddress {
    {% for address in i2c.address %}
    I2C_ADDRESS_{{address}} = {{address}}{{ "," if not loop.last }}
    {% endfor %}
};
typedef enum deviceAddress deviceAddress_t;
{% endif %}

{% if i2c.address is iterable and i2c.address is not string %}
int {{info.title.lower()}}_init(deviceAddress_t address, int (*connect)(uint8_t));
{% else %}
int {{info.title.lower()}}_init(int (*connect)(uint8_t));
{% endif %}

{% for key,register in registers|dictsort -%}
{% set length = (register.length / 8) | round(1, 'ceil') | int %}
{% if (not 'readWrite' in register) or ('readWrite' in register and 'R' is in(register.readWrite)) %}
/**
 {{utils.pad_string(" * ", register.description)}}
*/
int {{info.title.lower()}}_read{{key}}(
    {{cpp.numtype(register.length)}}* val,
    int (*read)(uint8_t, uint8_t, {{cpp.numtype(register.length)}}*, uint8_t)
);
{% endif %}

{% if (not 'readWrite' in register) or ('readWrite' in register and 'W' is in(register.readWrite)) %}
/**
{{utils.pad_string(" * ", register.description)}}
 */
int {{info.title.lower()}}_write{{key}}(
    {% if register.length > 0 %}
    {{cpp.numtype(register.length)}}* data,
    {% endif %}
    int (*read)(uint8_t, uint8_t, {{cpp.numtype(register.length)}}*, uint8_t),
    int (*write)(uint8_t, uint8_t, {{cpp.numtype(register.length)}}*, uint8_t)
);
{% endif %}
{%- endfor %}
{% if fields %}
{% for key,field in fields|dictsort %}
{% if 'R' is in(field.readWrite) %}
{% set int_t = cpp.registerSize(registers, field.register[12:]) %}
/**
{{utils.pad_string(" * ", field.description)}}
 */
int {{info.title.lower()}}_get_{{key.lower()}}(
    {{int_t}}* val,
    int (*read)(uint8_t, uint8_t, int*, uint8_t)
);
{% endif %}
{% if 'W' is in(field.readWrite) %}
{% set int_t = cpp.registerSize(registers, field.register[12:]) %}
/**
{{utils.pad_string(" * ", field.description)}}
 */
int {{info.title.lower()}}_set_{{key.lower()}}(
    {{int_t}}* data,
    int (*read)(uint8_t, uint8_t, int*, uint8_t),
    int (*write)(uint8_t, uint8_t, int*, uint8_t)
);
{% endif %}
{% endfor %}
{% endif %}

{% if functions %}
{% for key,function in functions|dictsort %}
{% for ckey,compute in function.computed|dictsort %}
/**
{{utils.pad_string(" * ", function.description)}}
*/
{# Look for any callbacks #}
{% set useCallback = namespace(delay=false) %}
{% if compute.logic %}
{% for stepk in compute.logic %}
{% for key,value in stepk|dictsort %}
{% if key == '$delay' %}
{# This won't work for nested delays #}
{% set useCallback.delay = value %}
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- endif %}
{% if useCallback.delay %}
{# We need to define a struct for the callback #}
{% set int_t = cpp.returnType(compute) %}
struct {{useCallback.delay.name}}Callback {
    {{int_t}}* (*callback({{useCallback.delay.name}}Callback, float, *int, *int)) callback;
    // Include all functions -- A snapshot of function state
{{ cpp.variables(compute.variables) }}
}

{{useCallback.delay.name}}Callback {{info.title.lower()}}_{{key.lower()}}_{{ckey.lower()}}(
{{ embedded.functionParams(cpp, functions, compute, true) }}
{% else %}
void {{info.title.lower()}}_{{key.lower()}}_{{ckey.lower()}}(
{{ embedded.functionParams(cpp, functions, compute, false) }}
{% endif %}
);
{% endfor %}

{% endfor %}
{% endif %}

#endif


text:
<!DOCTYPE html>

    <title>Berry - Multipage Business HTML Template</title>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="Berry - Multipage Business HTML Template" />
    <meta name="keywords" content="Berry, parallax, one page, multipage, responsive, landing, html template" />
    <meta name="author" content="TidyTheme">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="icon" type="image/png" href="images/favicon.png">
    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">

    <link href="css/font-awesome.min.css" rel="stylesheet">

    <link href="icon/elegant-icons/style.css" rel="stylesheet">
    <link href="icon/etlinefont-bower-master/style.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/hover.css" rel="stylesheet">

    <link href="css/prettyPhoto.css" rel="stylesheet">

    <link href="css/owl.carousel.css" rel="stylesheet">
    <link href="css/owl.theme.css" rel="stylesheet">
    <link href="css/owl.transitions.css" rel="stylesheet">

    <link rel="stylesheet" href="css/nivo-slider.css" type="text/css" />
    <link rel="stylesheet" href="css/nivo-preview.css" type="text/css" media="screen" />

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/normalize.css" rel="stylesheet">

    <link href="css/style.css" rel="stylesheet">
    <link href="css/responsive.css" rel="stylesheet">

	<link rel="stylesheet" href="css/colors/default-color.css">

	<link rel="stylesheet" id="switcher-css" type="text/css" href="css/switcher.css" media="all" />

	<link rel="alternate stylesheet" type="text/css" href="css/colors/color_1.css" title="alternate" media="all" />
	<link rel="alternate stylesheet" type="text/css" href="css/colors/color_2.css" title="next" media="all" />
	<link rel="alternate stylesheet" type="text/css" href="css/colors/color_3.css" title="bookmark" media="all" />
	<link rel="alternate stylesheet" type="text/css" href="css/colors/color_4.css" title="colorfr" media="all" />

                <button class="navbar-toggle" data-target=".navbar-collapse" data-toggle="collapse" type="button">
                </button>

                Business Theme

				Welcome to Barry

                    Home

                            Home

                            Home Two

                            One Page

                            One Page

                            One Page

                    about

                    team

                    service

                    work

                            Work Page

                            Single Work

                    pages

                            Work Page

                            Single Work

                            Service

                            Single Blog

                    blog

                    contact

 Home  / Contact

COntact Us

Contact Us

 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type

                        <form class="form-group" action="http://tidytheme.com/barry/html/mailer.php" id="contactForm" method="post" name="contactForm">

                                <input class="form-control" id="Name" name="Name" placeholder="Name :" type="text">

                                <input class="form-control" id="Email" name="Email" placeholder="Email :" type="text">

                                <input class="form-control" id="Tel" name="Tel" placeholder="Number :" type="text">

                                <textarea class="form-control" id="Message" name="Message" placeholder="Message :"></textarea>

                            <input class="submit-button btn" name="submit" value="Submit" type="submit">
                        </form>

Get in Tuch

Email :

 myemail@mail.com

New York

Address :

 New York, 56462

Barry

Loren ipsum dolor consectetur adipiscing elit sed do eiusmod tempor incididunt know you labore et dolore magna aliqua consectetur adipiscing

100 Lorem Street, New York

+00 978-783-0597

duncansp @themeview.com

Latest post

                                    17 Jun

Loren ipsum dolor consectetur adipiscing elit sed do eiusmod

                                    15 Jun

Loren ipsum dolor consectetur adipiscing elit sed do eiusmod

                                    27 Jun

Loren ipsum dolor consectetur adipiscing elit sed do eiusmod

Subscribe

                                    Enter your email and we'll send you a coupon with 10% off your next order.

                                <form action="#" class="validate" id="mc-embedded-subscribe-form" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">

                                    <input class="email" id="mce-EMAIL" name="EMAIL" placeholder="Your Email" required="" type="text" value="">
                                    <input class="mc-embedded-subscribe" id="mc-embedded-subscribe" name="subscribe" type="submit" value="Subscribe now!">
                                </form>

2016 © Copyright BERRY. All rights Reserved.

                    Go To Top

LAYOUT STYLE

Multipurpose v1

Multipurpose v2

 Landingpage v1

 Landingpage v2

 Landingpage v3

CHOOSE YOUR COLOR

	  RESET STYLE


text:
[![Build Status](https://img.shields.io/travis/D-32/IPasscode/master.svg?style=flat)](https://travis-ci.org/D-32/IPasscode)
[![Version](https://img.shields.io/cocoapods/v/IPasscode.svg?style=flat)](http://cocoadocs.org/docsets/IPasscode)
![License](https://img.shields.io/cocoapods/l/IPasscode.svg?style=flat)
[![twitter: @dylan36032](http://img.shields.io/badge/twitter-%40dylan36032-blue.svg?style=flat)](https://twitter.com/dylan36032)

A simple passcode screen that can be displayed manually. If Touch ID is available the user can skip the screen and instead use his fingerprint to unlock.

Can easily be customised to fit your design.

![image](http://46.105.26.1/uploads/passcode2.png)

## Installation

IPasscode is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

    pod "IPasscode"
If you're not using CocoaPods you'll find the source code files inside `Pod/Classes`. You'll also have to add the `IPasscode.bundle` to your project.

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

The class `IPasscode` contains following methods:

	+ (void)setupPasscodeInViewController:(UIViewController *)viewController completion:(PasscodeCompletionBlock)completion;
	+ (void)showPasscodeInViewController:(UIViewController *)viewController completion:(PasscodeCompletionBlock)completion;
	+ (void)removePasscode;
	+ (BOOL)isPasscodeSet;
	+ (void)setConfig:(IPasscodeConfig *)config;

#### PasscodeCompletionBlock(BOOL success, NSError *error)

PasscodeCompletionBlock is a custom type of block provided to `IPasscode` that returns values in the form of two parameters, a `BOOL success` and a `NSError *error`.
If `success`, then the user has successfully either setup their passcode, or successfully unlocked with their passcode.

If not `success`, then the user has either cancelled the passcode process, in which case `error` will be nil.  Or the user has failed to unlock with their passcode, in
which case `error` will not be nil.

## Customisation

You can pass `IPasscode` a configuration. Just create a new `IPasscodeConfiguration`.
Following properties are available to customise the passcode screen:

	animationsEnabled
	backgroundColor
	navigationBarBackgroundColor
	navigationBarForegroundColor
	statusBarStyle
	fieldColor
	emptyFieldColor
    errorFont
	errorBackgroundColor
	errorForegroundColor
	descriptionColor
    inputKeyboardAppearance
    instructionsFont
    navigationBarTitle
    navigationBarFont
    navigationBarTitleColor


text:
package structvisualizer.animatecollections.animatemethods.arraylist;

 /*
 * Clone   4/2/16, 19:48
 *
 * By Kyrylo Havrylenko
 *
 */

import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import parser.SomeClass;
import structvisualizer.animatecollections.animatemethods.AnimateMethod;
import structvisualizer.data.OutputStrings;

import java.util.ArrayList;

import static structvisualizer.animatecollections.animatemethods.arraylist.Arraylists.translateStackpanes;

/**
 * <what class do>
 *
 * @author Kyrylo Havrylenko
 * @see
 */
public class Clone extends AnimateMethod {
    public Clone(Pane canvasPane, String type, SomeClass obj) {
        super(canvasPane, type, obj);
    }

    /**
     * @param type
     *
     * @throws UnsupportedOperationException
     */
    @Override
    public void animate(String type) throws UnsupportedOperationException {
        ArrayList<StackPane> origin = Arraylists.createArrayList(type);
        ArrayList<StackPane> clone = Arraylists.createArrayList(type);
        translateStackpanes(clone);
        //        TranslateTransition tt = new TranslateTransition(Duration.ZERO, origin);

        canvasPane.getChildren().addAll(origin);
        canvasPane.getChildren().addAll(clone);
        AnimateMethod.setTooltip(origin, type, customClass);
        AnimateMethod.setTooltip(clone, type, customClass);
    }

    @Override
    public String getCode(OutputStrings os) throws UnsupportedOperationException {
        String result = os.getCode() + "\n\tArrayList<" + type + "> clone = tmp.clone();" + "\n\t}\n}";

        return result;
    }

    @Override
    public String getResults(OutputStrings os) throws UnsupportedOperationException {
        return "You now have 2 identical structures in memory.";
    }
}


text:
/**
 * Created by yuriel on 2/22/17.
 */
export class ImageViewerCanvas {
    constructor() {}
}


text:
package org.tomighty.resources;

import java.awt.Image;
import java.util.ArrayList;
import java.util.List;

import org.tomighty.ioc.Inject;

public class Images {

	@Inject private Resources resources;

	public Image tomato() {
		return resources.image("/tomato-48.png");
	}

	public List<Image> tomatoes() {
		List<Image> list = new ArrayList<Image>();
		list.add(resources.image("/tomato-16.png"));
		list.add(resources.image("/tomato-24.png"));
		list.add(resources.image("/tomato-32.png"));
		list.add(resources.image("/tomato-48.png"));
		return list;
	}

}


text:
require 'elcinema/scrapper/elcinema/base'
require 'elcinema/scrapper/elcinema/movie'
require 'elcinema/scrapper/elcinema/theater'
require 'elcinema/scrapper/elcinema/video'


text:
package me.mos.ti.utils;

import java.security.GeneralSecurityException;
import java.security.Key;

import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;

import org.apache.commons.codec.binary.Base64;

/**
 *
 * @author 刘飞
 *
 * @version 1.0.0
 * @since 2015年3月24日 下午3:38:57
 */
public class AES {

	private static final String AES = "AES";

	public static String encrypt(String content, byte[] key) throws GeneralSecurityException {
		Cipher cipher = Cipher.getInstance(AES);
		Key secretKey = new SecretKeySpec(key, AES);
		cipher.init(Cipher.ENCRYPT_MODE, secretKey);
		return new String(Base64.encodeBase64(cipher.doFinal(content.getBytes(Charsets.UTF_8))), Charsets.UTF_8);
	}

	public static String decrypt(String content, byte[] key) throws GeneralSecurityException {
		Cipher cipher = Cipher.getInstance(AES);
		Key secretKey = new SecretKeySpec(key, AES);
		cipher.init(Cipher.DECRYPT_MODE, secretKey);
		return new String(cipher.doFinal(Base64.decodeBase64(content.getBytes(Charsets.UTF_8))), Charsets.UTF_8);
	}

}


text:
#pragma once
#include <aws/mediaconvert/MediaConvert_EXPORTS.h>
#include <aws/mediaconvert/model/FileSourceConvert608To708.h>
#include <aws/mediaconvert/model/CaptionSourceFramerate.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace MediaConvert
{
namespace Model
{

  /**
   * If your input captions are SCC, SMI, SRT, STL, TTML, WebVTT, or IMSC 1.1 in an
   * xml file, specify the URI of the input caption source file. If your caption
   * source is IMSC in an IMF package, use TrackSourceSettings instead of
   * FileSoureSettings.

See Also:
   AWS
   * API Reference

   */
  class AWS_MEDIACONVERT_API FileSourceSettings
  {
  public:
    FileSourceSettings();
    FileSourceSettings(Aws::Utils::Json::JsonView jsonValue);
    FileSourceSettings& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     * Specify whether this set of input captions appears in your outputs in both 608
     * and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes the
     * captions data in two ways: it passes the 608 data through using the 608
     * compatibility bytes fields of the 708 wrapper, and it also translates the 608
     * data into 708.
     */
    inline const FileSourceConvert608To708& GetConvert608To708() const{ return m_convert608To708; }

    /**
     * Specify whether this set of input captions appears in your outputs in both 608
     * and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes the
     * captions data in two ways: it passes the 608 data through using the 608
     * compatibility bytes fields of the 708 wrapper, and it also translates the 608
     * data into 708.
     */
    inline bool Convert608To708HasBeenSet() const { return m_convert608To708HasBeenSet; }

    /**
     * Specify whether this set of input captions appears in your outputs in both 608
     * and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes the
     * captions data in two ways: it passes the 608 data through using the 608
     * compatibility bytes fields of the 708 wrapper, and it also translates the 608
     * data into 708.
     */
    inline void SetConvert608To708(const FileSourceConvert608To708& value) { m_convert608To708HasBeenSet = true; m_convert608To708 = value; }

    /**
     * Specify whether this set of input captions appears in your outputs in both 608
     * and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes the
     * captions data in two ways: it passes the 608 data through using the 608
     * compatibility bytes fields of the 708 wrapper, and it also translates the 608
     * data into 708.
     */
    inline void SetConvert608To708(FileSourceConvert608To708&& value) { m_convert608To708HasBeenSet = true; m_convert608To708 = std::move(value); }

    /**
     * Specify whether this set of input captions appears in your outputs in both 608
     * and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes the
     * captions data in two ways: it passes the 608 data through using the 608
     * compatibility bytes fields of the 708 wrapper, and it also translates the 608
     * data into 708.
     */
    inline FileSourceSettings& WithConvert608To708(const FileSourceConvert608To708& value) { SetConvert608To708(value); return *this;}

    /**
     * Specify whether this set of input captions appears in your outputs in both 608
     * and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes the
     * captions data in two ways: it passes the 608 data through using the 608
     * compatibility bytes fields of the 708 wrapper, and it also translates the 608
     * data into 708.
     */
    inline FileSourceSettings& WithConvert608To708(FileSourceConvert608To708&& value) { SetConvert608To708(std::move(value)); return *this;}

    /**
     * Ignore this setting unless your input captions format is SCC. To have the
     * service compensate for differing frame rates between your input captions and
     * input video, specify the frame rate of the captions file. Specify this value as
     * a fraction, using the settings Framerate numerator (framerateNumerator) and
     * Framerate denominator (framerateDenominator). For example, you might specify 24
     * / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976 fps, or 30000 / 1001
     * for 29.97 fps.
     */
    inline const CaptionSourceFramerate& GetFramerate() const{ return m_framerate; }

    /**
     * Ignore this setting unless your input captions format is SCC. To have the
     * service compensate for differing frame rates between your input captions and
     * input video, specify the frame rate of the captions file. Specify this value as
     * a fraction, using the settings Framerate numerator (framerateNumerator) and
     * Framerate denominator (framerateDenominator). For example, you might specify 24
     * / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976 fps, or 30000 / 1001
     * for 29.97 fps.
     */
    inline bool FramerateHasBeenSet() const { return m_framerateHasBeenSet; }

    /**
     * Ignore this setting unless your input captions format is SCC. To have the
     * service compensate for differing frame rates between your input captions and
     * input video, specify the frame rate of the captions file. Specify this value as
     * a fraction, using the settings Framerate numerator (framerateNumerator) and
     * Framerate denominator (framerateDenominator). For example, you might specify 24
     * / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976 fps, or 30000 / 1001
     * for 29.97 fps.
     */
    inline void SetFramerate(const CaptionSourceFramerate& value) { m_framerateHasBeenSet = true; m_framerate = value; }

    /**
     * Ignore this setting unless your input captions format is SCC. To have the
     * service compensate for differing frame rates between your input captions and
     * input video, specify the frame rate of the captions file. Specify this value as
     * a fraction, using the settings Framerate numerator (framerateNumerator) and
     * Framerate denominator (framerateDenominator). For example, you might specify 24
     * / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976 fps, or 30000 / 1001
     * for 29.97 fps.
     */
    inline void SetFramerate(CaptionSourceFramerate&& value) { m_framerateHasBeenSet = true; m_framerate = std::move(value); }

    /**
     * Ignore this setting unless your input captions format is SCC. To have the
     * service compensate for differing frame rates between your input captions and
     * input video, specify the frame rate of the captions file. Specify this value as
     * a fraction, using the settings Framerate numerator (framerateNumerator) and
     * Framerate denominator (framerateDenominator). For example, you might specify 24
     * / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976 fps, or 30000 / 1001
     * for 29.97 fps.
     */
    inline FileSourceSettings& WithFramerate(const CaptionSourceFramerate& value) { SetFramerate(value); return *this;}

    /**
     * Ignore this setting unless your input captions format is SCC. To have the
     * service compensate for differing frame rates between your input captions and
     * input video, specify the frame rate of the captions file. Specify this value as
     * a fraction, using the settings Framerate numerator (framerateNumerator) and
     * Framerate denominator (framerateDenominator). For example, you might specify 24
     * / 1 for 24 fps, 25 / 1 for 25 fps, 24000 / 1001 for 23.976 fps, or 30000 / 1001
     * for 29.97 fps.
     */
    inline FileSourceSettings& WithFramerate(CaptionSourceFramerate&& value) { SetFramerate(std::move(value)); return *this;}

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline const Aws::String& GetSourceFile() const{ return m_sourceFile; }

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline bool SourceFileHasBeenSet() const { return m_sourceFileHasBeenSet; }

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline void SetSourceFile(const Aws::String& value) { m_sourceFileHasBeenSet = true; m_sourceFile = value; }

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline void SetSourceFile(Aws::String&& value) { m_sourceFileHasBeenSet = true; m_sourceFile = std::move(value); }

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline void SetSourceFile(const char* value) { m_sourceFileHasBeenSet = true; m_sourceFile.assign(value); }

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline FileSourceSettings& WithSourceFile(const Aws::String& value) { SetSourceFile(value); return *this;}

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline FileSourceSettings& WithSourceFile(Aws::String&& value) { SetSourceFile(std::move(value)); return *this;}

    /**
     * External caption file used for loading captions. Accepted file extensions are
     * 'scc', 'ttml', 'dfxp', 'stl', 'srt', 'xml', 'smi', 'webvtt', and 'vtt'.
     */
    inline FileSourceSettings& WithSourceFile(const char* value) { SetSourceFile(value); return *this;}

    /**
     * Specifies a time delta in seconds to offset the captions from the source file.
     */
    inline int GetTimeDelta() const{ return m_timeDelta; }

    /**
     * Specifies a time delta in seconds to offset the captions from the source file.
     */
    inline bool TimeDeltaHasBeenSet() const { return m_timeDeltaHasBeenSet; }

    /**
     * Specifies a time delta in seconds to offset the captions from the source file.
     */
    inline void SetTimeDelta(int value) { m_timeDeltaHasBeenSet = true; m_timeDelta = value; }

    /**
     * Specifies a time delta in seconds to offset the captions from the source file.
     */
    inline FileSourceSettings& WithTimeDelta(int value) { SetTimeDelta(value); return *this;}

  private:

    FileSourceConvert608To708 m_convert608To708;
    bool m_convert608To708HasBeenSet;

    CaptionSourceFramerate m_framerate;
    bool m_framerateHasBeenSet;

    Aws::String m_sourceFile;
    bool m_sourceFileHasBeenSet;

    int m_timeDelta;
    bool m_timeDeltaHasBeenSet;
  };

} // namespace Model
} // namespace MediaConvert
} // namespace Aws


text:
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

#ifndef __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__
#define __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__

#include "ISceneNode.h"

namespace irr
{
namespace scene
{
	class CSceneNodeAnimatorRotation : public ISceneNodeAnimator
	{
	public:

		//! constructor
		CSceneNodeAnimatorRotation(u32 time, const core::vector3df& rotation);

		//! animates a scene node
		virtual void animateNode(ISceneNode* node, u32 timeMs);

		//! Writes attributes of the scene node animator.
		virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;

		//! Reads attributes of the scene node animator.
		virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);

		//! Returns type of the scene node animator
		virtual ESCENE_NODE_ANIMATOR_TYPE getType() const { return ESNAT_ROTATION; }

		//! Creates a clone of this animator.
		/** Please note that you will have to drop
		(IReferenceCounted::drop()) the returned pointer after calling this. */
		virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);

	private:

		core::vector3df Rotation;
		u32 StartTime;
	};

} // end namespace scene
} // end namespace irr

#endif


text:
import React from 'react'
import styled from 'styled-components'

export const Date = ({ start, end }) => {
  const active = end.toLowerCase() === 'present'

  return (
    <Container>
      <Pill active={active}>
        {start} - {end}
      </Pill>
    </Container>
  )
}

const Container = styled.div`
  display: flex;
  flex-flow: row wrap;
`

const Pill = styled.div`
  max-width: fit-content;
  border: 1px solid ${({ theme, active }) =>
    active ? theme.palette.green[400] : theme.palette.grey[500]};
  ${({ theme }) => theme.borderRadius.all}
  margin-top: ${({ theme }) => theme.spacing(1)};
  margin-right: ${({ theme }) => theme.spacing(1)};
  padding-right: ${({ theme }) => theme.spacing(0.5)};
  padding-left: ${({ theme }) => theme.spacing(0.5)};

  color: ${({ theme, active }) =>
    active ? theme.palette.green[400] : theme.palette.grey[500]};
  font-size: 13px;
  line-height: 1.4em;
`


text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/autofill/address_accessory_controller_impl.h"

#include <algorithm>
#include <memory>
#include <ostream>
#include <string>
#include <vector>
#include "base/strings/utf_string_conversions.h"
#include "base/test/mock_callback.h"
#include "chrome/browser/autofill/mock_manual_filling_controller.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/strings/grit/components_strings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"

namespace autofill {
namespace {
using autofill::UserInfo;
using base::ASCIIToUTF16;
using testing::_;
using testing::ByMove;
using testing::Mock;
using testing::NiceMock;
using testing::Return;
using testing::SaveArg;
using testing::StrictMock;
using FillingSource = ManualFillingController::FillingSource;

base::string16 addresses_empty_str() {
  return l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESS_SHEET_EMPTY_MESSAGE);
}

base::string16 manage_addresses_str() {
  return l10n_util::GetStringUTF16(
      IDS_AUTOFILL_ADDRESS_SHEET_ALL_ADDRESSES_LINK);
}

// Creates a AccessorySheetData::Builder with a "Manage Addresses" footer.
AccessorySheetData::Builder AddressAccessorySheetDataBuilder(
    const base::string16& title) {
  return AccessorySheetData::Builder(AccessoryTabType::ADDRESSES, title)
      .AppendFooterCommand(manage_addresses_str(),
                           AccessoryAction::MANAGE_ADDRESSES);
}

std::unique_ptr<KeyedService> BuildTestPersonalDataManager(
    content::BrowserContext* context) {
  auto personal_data_manager = std::make_unique<TestPersonalDataManager>();
  personal_data_manager->SetAutofillProfileEnabled(true);
  return personal_data_manager;
}

}  // namespace

class AddressAccessoryControllerTest : public ChromeRenderViewHostTestHarness {
 public:
  AddressAccessoryControllerTest() {}

  void SetUp() override {
    ChromeRenderViewHostTestHarness::SetUp();
    PersonalDataManagerFactory::GetInstance()->SetTestingFactory(
        GetBrowserContext(),
        base::BindRepeating(&BuildTestPersonalDataManager));

    AddressAccessoryControllerImpl::CreateForWebContentsForTesting(
        web_contents(), mock_manual_filling_controller_.AsWeakPtr());
  }

  void TearDown() override { personal_data_manager()->ClearProfiles(); }

  AddressAccessoryController* controller() {
    return AddressAccessoryControllerImpl::FromWebContents(web_contents());
  }

  TestPersonalDataManager* personal_data_manager() {
    return static_cast<TestPersonalDataManager*>(
        PersonalDataManagerFactory::GetForProfile(profile()));
  }

 protected:
  StrictMock<MockManualFillingController> mock_manual_filling_controller_;
};

TEST_F(AddressAccessoryControllerTest, IsNotRecreatedForSameWebContents) {
  AddressAccessoryControllerImpl* initial_controller =
      AddressAccessoryControllerImpl::FromWebContents(web_contents());
  EXPECT_NE(nullptr, initial_controller);
  AddressAccessoryControllerImpl::CreateForWebContents(web_contents());
  EXPECT_EQ(AddressAccessoryControllerImpl::FromWebContents(web_contents()),
            initial_controller);
}

TEST_F(AddressAccessoryControllerTest, RefreshSuggestionsCallsUI) {
  AutofillProfile canadian = test::GetFullValidProfileForCanada();
  personal_data_manager()->AddProfile(canadian);

  AccessorySheetData result(AccessoryTabType::PASSWORDS, base::string16());
  EXPECT_CALL(mock_manual_filling_controller_, RefreshSuggestions(_))
      .WillOnce(SaveArg<0>(&result));

  controller()->RefreshSuggestions();

  ASSERT_EQ(
      result,
      AddressAccessorySheetDataBuilder(base::string16())
          .AddUserInfo()
          .AppendSimpleField(canadian.GetRawInfo(ServerFieldType::NAME_FULL))
          .AppendSimpleField(canadian.GetRawInfo(ServerFieldType::COMPANY_NAME))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::ADDRESS_HOME_LINE1))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::ADDRESS_HOME_LINE2))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::ADDRESS_HOME_ZIP))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::ADDRESS_HOME_CITY))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::ADDRESS_HOME_STATE))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::ADDRESS_HOME_COUNTRY))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::PHONE_HOME_WHOLE_NUMBER))
          .AppendSimpleField(
              canadian.GetRawInfo(ServerFieldType::EMAIL_ADDRESS))
          .Build());
}

TEST_F(AddressAccessoryControllerTest, ProvidesEmptySuggestionsMessage) {
  AccessorySheetData result(AccessoryTabType::PASSWORDS, base::string16());
  EXPECT_CALL(mock_manual_filling_controller_, RefreshSuggestions(_))
      .WillOnce(SaveArg<0>(&result));

  controller()->RefreshSuggestions();

  ASSERT_EQ(result,
            AddressAccessorySheetDataBuilder(addresses_empty_str()).Build());
}

TEST_F(AddressAccessoryControllerTest, TriggersRefreshWhenDataChanges) {
  AccessorySheetData result(AccessoryTabType::PASSWORDS, base::string16());
  EXPECT_CALL(mock_manual_filling_controller_, RefreshSuggestions(_))
      .WillRepeatedly(SaveArg<0>(&result));

  // A refresh without data stores an empty sheet and registers an observer.
  controller()->RefreshSuggestions();
  ASSERT_EQ(result,
            AddressAccessorySheetDataBuilder(addresses_empty_str()).Build());

  // When new data is added, a refresh is automatically triggered.
  AutofillProfile email = test::GetIncompleteProfile2();
  personal_data_manager()->AddProfile(email);
  ASSERT_EQ(result, AddressAccessorySheetDataBuilder(base::string16())
                        .AddUserInfo()
                        /*name full:*/
                        .AppendSimpleField(base::string16())
                        /*company name:*/
                        .AppendSimpleField(base::string16())
                        /*address line1:*/
                        .AppendSimpleField(base::string16())
                        /*address line2:*/
                        .AppendSimpleField(base::string16())
                        /*address zip:*/
                        .AppendSimpleField(base::string16())
                        /*address city:*/
                        .AppendSimpleField(base::string16())
                        /*address state:*/
                        .AppendSimpleField(base::string16())
                        /*address country:*/
                        .AppendSimpleField(base::string16())
                        /*phone number:*/.AppendSimpleField(base::string16())
                        .AppendSimpleField(
                            email.GetRawInfo(ServerFieldType::EMAIL_ADDRESS))
                        .Build());
}

}  // namespace autofill


text:
class CreateSubscribes < ActiveRecord::Migration
  def self.up
    create_table :subscribes do |t|
      t.integer :subscription_id, :null => false
      t.integer :work_id, :null => false
      t.datetime :start_at, :null => false
      t.datetime :end_at, :null => false

      t.timestamps
    end
    add_index :subscribes, :subscription_id
    add_index :subscribes, :work_id
  end

  def self.down
    drop_table :subscribes
  end
end


text:
We now want to franchise our pizza store (see Factory pattern), and let different stores pick which factory they want. Each factory produces a different style. There's a NY Style Pizza, Chicago Style Pizza, etc.

## Solution 1

Create the different factories, then each store has to load the factory and pass it to the store object.

## Factory Method Pattern

Put the pizza creation function back into the store class, but force subclasses to define it.

 - In the Factory Pattern, we have a concrete class that has all the non-changing (common) elements, and is given a factory that contains all the changing elements. It uses the factory to generate the correct object.
 - In Factory Method Pattern, we have an abstract class that is has all the non-changing elements, and it is subclassed wholly for the changing elements. Instead of having separate factory objects, we the factory is baked into the class itself.

## OO Principle

Encapsulation.

Depend on abstractions, not concrete classes.


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE HTML>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="index, all" />
    <title>olcesium side-by-side example</title>
    <link rel="stylesheet" href="../node_modules/ol/ol.css" type="text/css">

    <input id="enable" type="button" value="Enable/disable" />