text:
using System;
using TwitchLeecher.Shared.Extensions;

namespace TwitchLeecher.Core.Models
{
    public class TwitchVideo
    {
        #region Constatnts

        private const string UNTITLED_BROADCAST = "Untitled Broadcast";

        #endregion Constatnts

        #region Constructors

        public TwitchVideo(string channel, string title, string id, int views, TimeSpan length, DateTime recordedDate, Uri thumbnail, Uri url, bool viewable, bool muted, bool live)
        {
            if (string.IsNullOrWhiteSpace(channel))
            {
                throw new ArgumentNullException(nameof(channel));
            }

            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (string.IsNullOrWhiteSpace(title))
            {
                title = UNTITLED_BROADCAST;
            }

            Channel = channel;
            Title = title;
            Id = id;
            Views = views;
            Length = length;
            RecordedDate = recordedDate;
            Thumbnail = thumbnail ?? throw new ArgumentNullException(nameof(thumbnail));
            Url = url ?? throw new ArgumentNullException(nameof(url));
            Viewable = viewable;
            Muted = muted;
            Live = live;
        }

        #endregion Constructors

        #region Properties

        public string Channel { get; }

        public string Title { get; }

        public string Id { get; }

        public TimeSpan Length { get; }

        public string LengthStr
        {
            get
            {
                return Length.ToDaylessString();
            }
        }

        public int Views { get; }

        public DateTime RecordedDate { get; }

        public Uri Thumbnail { get; }

        public Uri Url { get; }

        public bool Viewable { get; }

        public bool Muted { get; }

        public bool Live { get; }

        public TimeSpan? StartTime { get; set; }

        #endregion Properties
    }
}


text:
describe "Enumerable#count" do
  using Stupidedi::Refinements

  context "with no given arguments" do
    property "returns #length" do
      with(:size, between(0, 20)) { array { integer }}
    end.check do |enumerable|
      expect(enumerable.count).to be == enumerable.length
    end
  end

  context "with a given literal" do
    let(:enumerable) { %w(a b a b c d a) }

    it "returns the number of occurrences" do
      expect(enumerable.count("g")).to be == 0
      expect(enumerable.count("a")).to be == 3
      expect(enumerable.count("b")).to be == 2
      expect(enumerable.count("c")).to be == 1
      expect(enumerable.count("d")).to be == 1
    end
  end

  context "with a given block argument" do
    context "that always evaluates false" do
      it "returns 0" do
        expect(%w(a b c d e f).count { false }).to be == 0
      end

      property "returns 0" do
        with(:size, between(0, 20)) { array { integer }}
      end.check do |enumerable|
        expect(enumerable.count { false }).to be == 0
      end
    end

    context "that always evaluates true" do
      it "returns #length" do
        expect(%w(a b c d e f).count { true }).to be == 6
      end

      property "returns #length" do
        with(:size, between(0, 20)) { array { integer }}
      end.check do |enumerable|
        expect(enumerable.count { true }).to be == enumerable.length
      end
    end

    context "that evaluates true or false" do
      it "returns the number of elements that satisfy the predicate" do
        expect(%w(a bc d ef g hi).count{|s| s.length == 2 }).to be == 3
      end

      property "returns the number of elements that satisfy the predicate" do
        divisor    = choose([1,2,3,4])
        enumerable = with(:size, between(0, 20)) { array { integer }}

        [enumerable, divisor]
      end.check do |enumerable, divisor|
        a = enumerable.count{|n| n.modulo(divisor).zero? }
        b = enumerable.inject(0){|sum,n| sum + ((n.modulo(divisor).zero?) ? 1 : 0) }
        expect(a).to be == b
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
from typing_extensions import Final  # noqa: F401

MAILBOX_DOMAIN = 'lokole.ca'  # type: Final
RECEIVED_FOLDER = 'received'  # type: Final
SENT_FOLDER = 'sent'  # type: Final
FUTURE_TIMESTAMP = 2100000000  # type: Final


text:
package cmd

import (
	"github.com/spf13/cobra"
)

// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
	Use:     "turbo",
	Version: "v0.4.3",
}

// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() error {
	return RootCmd.Execute()
}


text:
package eveapi.xml.account.char.Blueprints

case class Eveapi(currentTime: String,
                  result: eveapi.xml.account.char.Blueprints.Result,
                  cachedUntil: String,
                  attributes: Map[String, scalaxb.DataRecord[Any]] = Map()) {
  lazy val version = attributes("@version").as[BigInt]
}

case class Result(rowset: eveapi.xml.account.char.Blueprints.Rowset)

case class Rowset(row: Seq[eveapi.xml.account.char.Blueprints.Row] = Nil,
                  attributes: Map[String, scalaxb.DataRecord[Any]] = Map()) {
  lazy val columns = attributes("@columns").as[String]
  lazy val key = attributes("@key").as[String]
  lazy val name = attributes("@name").as[String]
}

case class Row(attributes: Map[String, scalaxb.DataRecord[Any]] = Map()) {
  lazy val flagID = attributes("@flagID").as[BigInt]
  lazy val itemID = attributes("@itemID").as[BigInt]
  lazy val locationID = attributes("@locationID").as[BigInt]
  lazy val materialEfficiency = attributes("@materialEfficiency").as[BigInt]
  lazy val quantity = attributes("@quantity").as[BigInt]
  lazy val runs = attributes("@runs").as[BigInt]
  lazy val timeEfficiency = attributes("@timeEfficiency").as[BigInt]
  lazy val typeID = attributes("@typeID").as[BigInt]
  lazy val typeName = attributes("@typeName").as[String]
}


text:
import * as fs from   '@node-compat/fs';
import { J3D } from './j3d-all';

var gl;

var mx, my = 0;
var engine;
var path = "demo/models/014/";

var base, lee, eyeLeft, eyeRight, head, cam;
var tgry, tgrz, tgpz;
var auto;

var defphong, cover, reflective, toon, glitter, darkglass;
var dispersion;
var shd = 0;

var t = 0;
var shadersToLoad;

export function run(canvas) {
    console.log("Starting...");

    engine = new J3D.Engine(canvas);

    gl = engine.gl;

    shadersToLoad = 4;

    J3D.Loader.loadGLSL("demo/shaders/GoldHead.glsl", function(s) {
	reflective = s;
	setup();
    });

    J3D.Loader.loadGLSL("demo/shaders/Glitter.glsl", function(s) {
	glitter = s;
	setup();
    });

    J3D.Loader.loadGLSL("demo/shaders/DarkGlass.glsl", function(s) {
	darkglass = s;
	setup();
    });

    J3D.Loader.loadGLSL("demo/shaders/Stripes.glsl", function(s) {
	toon = s;
	setup();
    });
}

function setup() {
    shadersToLoad--;
    if(shadersToLoad > 0) return;

    console.log("Shaders loaded...");

    var cubemap = new J3D.Cubemap({
	left: path + "cubemap/front.jpg",
	right: path + "cubemap/back.jpg",
	up: path + "cubemap/left.jpg",
	down: path + "cubemap/right.jpg",
	back: path + "cubemap/top.jpg",
	front: path + "cubemap/top.jpg"
    });

    var headTex = new J3D.Texture(path + "map_col.jpg");

    var particleTex = new J3D.Texture(path + "particle01.png");
    particleTex.wrapMode = gl.CLAMP_TO_EDGE;

    var ramp = new J3D.Texture(path + "goldramp.png");

    reflective.uCubemap = cubemap;
    reflective.uColorTexture = headTex;

    darkglass.uCubemap = cubemap;
    darkglass.uColorTexture = headTex;
    darkglass.chromaticDispertion = [0.02, 0.0, -0.02];
    darkglass.bias = 0.0;
    darkglass.scale = 1.8;
    darkglass.power = 3.0;

    glitter.uColorSampler = ramp;
    glitter.uParticle = particleTex;

    toon.uColorSampler = ramp;

    J3D.Loader.loadJSON(path + "leeperry.js", function(jsmeshes) {
        J3D.Loader.loadJSON(path + "leeperryScene.js", function(jsscene) {
            jsscene.path = path;
            J3D.Loader.parseJSONScene(jsscene, jsmeshes, engine);

            base = engine.scene.find("base");
            cam = engine.scene.find("base/camera");

            lee = engine.scene.find("headbase");

            head = engine.scene.find("headbase/head");

            defphong = head.renderer;

            console.log("Models loaded...");

            setRenderer(darkglass, gl.TRIANGLES);
            setTransparency(false);
        });
    });

    //  document.onmousemove = onMouseMove;
    //  document.onmousedown = changeShaderManual;

    //  auto = setInterval(changeShader, 5000);
}

function setRenderer(r, m) {
    if (r != null) {
	head.renderer = r;
    } else {
	head.renderer = defphong;
    }

    if (m != null) {
	head.renderer.drawMode = m;
    }
}

function setTransparency(t, s, d) {
    head.geometry.setTransparency(t, s, d);
}

function changeShaderManual() {
    //  clearInterval(auto);
    changeShader();
}

function changeShader() {
    shd = (shd + 1) % 5;
    switch (shd) {
    case 0:
	setRenderer(null, gl.TRIANGLES);
	setTransparency(false);
	break;
    case 1:
	setRenderer(darkglass, gl.TRIANGLES);
	setTransparency(false);
	break;
    case 2:
	setRenderer(reflective, gl.TRIANGLES);
	setTransparency(false);
	break;
    case 3:
	setRenderer(toon, gl.TRIANGLES);
	setTransparency(false);
	break;
    case 4:
	setRenderer(glitter, gl.POINTS);
	setTransparency(true, gl.SRC_ALPHA, gl.DST_ALPHA);
	break;
    }
}

function onMouseMove(e) {
    mx = ( e.clientX / window.innerWidth  ) * 2 - 1;
    my = ( e.clientY / window.innerHeight ) * 2 - 1;
}

export function draw() {
    //requestAnimationFrame(draw);

    if(isNaN(mx)) mx = 0;
    if(isNaN(my)) my = 0;

    tgry = mx * Math.PI / 3.0;
    tgrz = -mx * Math.PI / 15.0;
    tgpz = my - 1;

    lee.position.z += (tgpz - lee.position.z) / 10;

    lee.rotation.y += (tgry - lee.rotation.y) / 2;
    lee.rotation.z += (tgrz - lee.rotation.z) / 12;
    lee.rotation.x = Math.sin(t) * 0.1;

    t += 0.1;

    engine.render();
}

export function tap() {
    changeShader();
}


text:
'use strict';
var plcgs = require('./portable_lcgs');

var Random = module.exports = function(idx, seed){
    this.lcgs = function(seed){ return plcgs(idx, seed) }
    this.seed = seed || 0;
}

Random.prototype.generate = function(){
    var ret = this.lcgs(this.seed);
    this.seed = ret[1];
    return ret[0];
}

Random.prototype.range = function(min, max){
    var rand = this.generate();
    return Math.floor(rand * (max - min + 1)) + min;
}

Random.prototype.frange = function(min, max){
    var rand = this.generate();
    return (rand * (max - min)) + min;
}


text:
package com.facebook.react.animated;

import javax.annotation.Nullable;

import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.OnBatchCompleteListener;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.GuardedChoreographerFrameCallback;
import com.facebook.react.uimanager.ReactChoreographer;
import com.facebook.react.uimanager.UIImplementation;
import com.facebook.react.uimanager.UIManagerModule;

import java.util.ArrayList;

/**
 * Module that exposes interface for creating and managing animated nodes on the "native" side.
 *
 * Animated.js library is based on a concept of a graph where nodes are values or transform
 * operations (such as interpolation, addition, etc) and connection are used to describe how change
 * of the value in one node can affect other nodes.
 *
 * Few examples of the nodes that can be created on the JS side:
 *  - Animated.Value is a simplest type of node with a numeric value which can be driven by an
 *    animation engine (spring, decay, etc) or by calling setValue on it directly from JS
 *  - Animated.add is a type of node that may have two or more input nodes. It outputs the sum of
 *    all the input node values
 *  - interpolate - is actually a method you can call on any node and it creates a new node that
 *    takes the parent node as an input and outputs its interpolated value (e.g. if you have value
 *    that can animate from 0 to 1 you can create interpolated node and set output range to be 0 to
 *    100 and when the input node changes the output of interpolated node will multiply the values
 *    by 100)
 *
 * You can mix and chain nodes however you like and this way create nodes graph with connections
 * between them.
 *
 * To map animated node values to view properties there is a special type of a node: AnimatedProps.
 * It is created by AnimatedImplementation whenever you render Animated.View and stores a mapping
 * from the view properties to the corresponding animated values (so it's actually also a node with
 * connections to the value nodes).
 *
 * Last "special" elements of the the graph are "animation drivers". Those are objects (represented
 * as a graph nodes too) that based on some criteria updates attached values every frame (we have
 * few types of those, e.g., spring, timing, decay). Animation objects can be "started" and
 * "stopped". Those are like "pulse generators" for the rest of the nodes graph. Those pulses then
 * propagate along the graph to the children nodes up to the special node type: AnimatedProps which
 * then can be used to calculate property update map for a view.
 *
 * This class acts as a proxy between the "native" API that can be called from JS and the main class
 * that coordinates all the action: {@link NativeAnimatedNodesManager}. Since all the methods from
 * {@link NativeAnimatedNodesManager} need to be called from the UI thread, we we create a queue of
 * animated graph operations that is then enqueued to be executed in the UI Thread at the end of the
 * batch of JS->native calls (similarily to how it's handled in {@link UIManagerModule}). This
 * isolates us from the problems that may be caused by concurrent updates of animated graph while UI
 * thread is "executing" the animation loop.
 */
public class NativeAnimatedModule extends ReactContextBaseJavaModule implements
    OnBatchCompleteListener, LifecycleEventListener {

  private interface UIThreadOperation {
    void execute(NativeAnimatedNodesManager animatedNodesManager);
  }

  private final Object mOperationsCopyLock = new Object();
  private @Nullable GuardedChoreographerFrameCallback mAnimatedFrameCallback;
  private @Nullable ReactChoreographer mReactChoreographer;
  private ArrayList<UIThreadOperation> mOperations = new ArrayList<>();
  private volatile @Nullable ArrayList<UIThreadOperation> mReadyOperations = null;

  public NativeAnimatedModule(ReactApplicationContext reactContext) {
    super(reactContext);
  }

  @Override
  public void initialize() {
    // Safe to acquire choreographer here, as initialize() is invoked from UI thread.
    mReactChoreographer = ReactChoreographer.getInstance();

    ReactApplicationContext reactCtx = getReactApplicationContext();
    UIImplementation uiImplementation =
      reactCtx.getNativeModule(UIManagerModule.class).getUIImplementation();

    final NativeAnimatedNodesManager nodesManager =
      new NativeAnimatedNodesManager(uiImplementation);
    mAnimatedFrameCallback = new GuardedChoreographerFrameCallback(reactCtx) {
      @Override
      protected void doFrameGuarded(final long frameTimeNanos) {

        ArrayList<UIThreadOperation> operations;
        synchronized (mOperationsCopyLock) {
          operations = mReadyOperations;
          mReadyOperations = null;
        }

        if (operations != null) {
          for (int i = 0, size = operations.size(); i < size; i++) {
            operations.get(i).execute(nodesManager);
          }
        }

        if (nodesManager.hasActiveAnimations()) {
          nodesManager.runUpdates(frameTimeNanos);
        }

        // TODO: Would be great to avoid adding this callback in case there are no active animations
        // and no outstanding tasks on the operations queue. Apparently frame callbacks can only
        // be posted from the UI thread and therefore we cannot schedule them directly from
        // @ReactMethod methods
        Assertions.assertNotNull(mReactChoreographer).postFrameCallback(
          ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
          mAnimatedFrameCallback);
      }
    };
    reactCtx.addLifecycleEventListener(this);
  }

  @Override
  public void onBatchComplete() {
    // Note: The order of executing onBatchComplete handler (especially in terms of onBatchComplete
    // from the UIManagerModule) doesn't matter as we only enqueue operations for the UI thread to
    // be executed from here. Thanks to ReactChoreographer all the operations from here are going
    // to be executed *after* all the operations enqueued by UIManager as the callback type that we
    // use for ReactChoreographer (CallbackType.NATIVE_ANIMATED_MODULE) is run after callbacks that UIManager
    // use
    ArrayList<UIThreadOperation> operations = mOperations.isEmpty() ? null : mOperations;
    if (operations != null) {
      mOperations = new ArrayList<>();
      synchronized (mOperationsCopyLock) {
        if (mReadyOperations == null) {
          mReadyOperations = operations;
        } else {
          mReadyOperations.addAll(operations);
        }
      }
    }
  }

  @Override
  public void onHostResume() {
    enqueueFrameCallback();
  }

  @Override
  public void onHostPause() {
    clearFrameCallback();
  }

  @Override
  public void onHostDestroy() {
    // do nothing
  }

  @Override
  public String getName() {
    return "NativeAnimatedModule";
  }

  private void clearFrameCallback() {
    Assertions.assertNotNull(mReactChoreographer).removeFrameCallback(
      ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
      mAnimatedFrameCallback);
  }

  private void enqueueFrameCallback() {
    Assertions.assertNotNull(mReactChoreographer).postFrameCallback(
      ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
      mAnimatedFrameCallback);
  }

  @ReactMethod
  public void createAnimatedNode(final int tag, final ReadableMap config) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.createAnimatedNode(tag, config);
      }
    });
  }

  @ReactMethod
  public void dropAnimatedNode(final int tag) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.dropAnimatedNode(tag);
      }
    });
  }

  @ReactMethod
  public void setAnimatedNodeValue(final int tag, final double value) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.setAnimatedNodeValue(tag, value);
      }
    });
  }

  @ReactMethod
  public void startAnimatingNode(
      final int animatedNodeTag,
      final ReadableMap animationConfig,
      final Callback endCallback) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.startAnimatingNode(
          animatedNodeTag,
          animationConfig,
          endCallback);
      }
    });
  }

  @ReactMethod
  public void connectAnimatedNodes(final int parentNodeTag, final int childNodeTag) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.connectAnimatedNodes(parentNodeTag, childNodeTag);
      }
    });
  }

  @ReactMethod
  public void disconnectAnimatedNodes(final int parentNodeTag, final int childNodeTag) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.disconnectAnimatedNodes(parentNodeTag, childNodeTag);
      }
    });
  }

  @ReactMethod
  public void connectAnimatedNodeToView(final int animatedNodeTag, final int viewTag) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.connectAnimatedNodeToView(animatedNodeTag, viewTag);
      }
    });
  }

  @ReactMethod
  public void disconnectAnimatedNodeFromView(final int animatedNodeTag, final int viewTag) {
    mOperations.add(new UIThreadOperation() {
      @Override
      public void execute(NativeAnimatedNodesManager animatedNodesManager) {
        animatedNodesManager.disconnectAnimatedNodeFromView(animatedNodeTag, viewTag);
      }
    });
  }
}


text:
using System.Collections.Generic;
using Nop.Core.Domain.Localization;
using Nop.Core.Domain.Shipping;
using Nop.Core.Domain.Stores;

namespace Nop.Core.Domain.Directory
{
    /// <summary>
    /// Represents a country
    /// </summary>
    public partial class Country : BaseEntity, ILocalizedEntity, IStoreMappingSupported
    {
        private ICollection<StateProvince> _stateProvinces;
        private ICollection<ShippingMethod> _restrictedShippingMethods;

        /// <summary>
        /// Gets or sets the name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether billing is allowed to this country
        /// </summary>
        public bool AllowsBilling { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether shipping is allowed to this country
        /// </summary>
        public bool AllowsShipping { get; set; }

        /// <summary>
        /// Gets or sets the two letter ISO code
        /// </summary>
        public string TwoLetterIsoCode { get; set; }

        /// <summary>
        /// Gets or sets the three letter ISO code
        /// </summary>
        public string ThreeLetterIsoCode { get; set; }

        /// <summary>
        /// Gets or sets the numeric ISO code
        /// </summary>
        public int NumericIsoCode { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether customers in this country must be charged EU VAT
        /// </summary>
        public bool SubjectToVat { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the entity is published
        /// </summary>
        public bool Published { get; set; }

        /// <summary>
        /// Gets or sets the display order
        /// </summary>
        public int DisplayOrder { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
        /// </summary>
        public bool LimitedToStores { get; set; }

        /// <summary>
        /// Gets or sets the state/provinces
        /// </summary>
        public virtual ICollection<StateProvince> StateProvinces
        {
            get { return _stateProvinces ?? (_stateProvinces = new List<StateProvince>()); }
            protected set { _stateProvinces = value; }
        }

        /// <summary>
        /// Gets or sets the restricted shipping methods
        /// </summary>
        public virtual ICollection<ShippingMethod> RestrictedShippingMethods
        {
            get { return _restrictedShippingMethods ?? (_restrictedShippingMethods = new List<ShippingMethod>()); }
            protected set { _restrictedShippingMethods = value; }
        }
    }

}


text:
/*eslint-env node */
/*jslint node: true */

"use strict";

var os = require("os");
var watcherManager = require("./FileWatcherManager");
var watcherImpl;
if (process.platform === "win32") {
    watcherImpl = require("./CSharpWatcher");
} else {
    watcherImpl = require("./ChokidarWatcher");
}

/**
 * Initialize the "fileWatcher" domain.
 * The fileWatcher domain handles watching and un-watching directories.
 */
function init(domainManager) {
    if (!domainManager.hasDomain("fileWatcher")) {
        domainManager.registerDomain("fileWatcher", {major: 0, minor: 1});
    }

    domainManager.registerCommand(
        "fileWatcher",
        "watchPath",
        watcherManager.watchPath,
        false,
        "Start watching a file or directory",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the file or directory to watch"
        }, {
            name: "ignored",
            type: "array",
            description: "list of path to ignore"
        }]
    );
    domainManager.registerCommand(
        "fileWatcher",
        "unwatchPath",
        watcherManager.unwatchPath,
        false,
        "Stop watching a single file or a directory and it's descendants",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the file or directory to unwatch"
        }]
    );
    domainManager.registerCommand(
        "fileWatcher",
        "unwatchAll",
        watcherManager.unwatchAll,
        false,
        "Stop watching all files and directories"
    );
    domainManager.registerEvent(
        "fileWatcher",
        "change",
        [
            {name: "event", type: "string"},
            {name: "parentDirPath", type: "string"},
            {name: "entryName", type: "string"},
            {name: "statsObj", type: "object"}
        ]
    );

    watcherManager.setDomainManager(domainManager);
    watcherManager.setWatcherImpl(watcherImpl);

}

exports.init = init;


text:
package com.circuit.CircuitMod.Rendering.Models;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class CircuitBoxModel extends ModelBase
{
    //fields
    ModelRenderer Shape1;

    public CircuitBoxModel()
    {
        textureWidth = 64;
        textureHeight = 32;

        Shape1 = new ModelRenderer(this, 0, 0);
        Shape1.addBox(0F, 0F, 0F, 8, 14, 8);
        Shape1.setRotationPoint(-4F, 10F, -4F);
        Shape1.setTextureSize(64, 32);
        Shape1.mirror = true;
        setRotation(Shape1, 0F, 0F, 0F);

    }

    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
    {
        super.render(entity, f, f1, f2, f3, f4, f5);
        setRotationAngles(f, f1, f2, f3, f4, f5, entity);
        Shape1.render(f5);

    }

    private void setRotation(ModelRenderer model, float x, float y, float z)
    {
        model.rotateAngleX = x;
        model.rotateAngleY = y;
        model.rotateAngleZ = z;
    }

    public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
    {
        super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
  <data>
    <variable
        name="model"
        type="${packageNameOfModel}.${modelName}"
    />
  </data>

  <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical">

  </LinearLayout>

</layout>


text:
on('change:ship-modules_button change:ship-support-vehicles_button change:ship-crew_button change:ship-impacts_button', function(eventinfo) {
  const type = eventinfo.sourceAttribute.match(/(.*?)_button/)[1]
  setAttrs({
    [`${type}`]: eventinfo.newValue
  });
});


text:
$(document).ready(function(){
  $("ul.star-ratingActive li.oneStar").hover(function(){
    $(this).parent().removeClass("ratedTwoStars").removeClass("ratedThreeStars").removeClass("ratedFourStars").removeClass("ratedFiveStars").addClass("ratedOneStar");
  });
  $("ul.star-ratingActive li.twoStars").hover(function(){
    $(this).parent().removeClass("ratedOneStar").removeClass("ratedThreeStars").removeClass("ratedFourStars").removeClass("ratedFiveStars").addClass("ratedTwoStars");
  });
  $("ul.star-ratingActive li.threeStars").hover(function(){
    $(this).parent().removeClass("ratedOneStar").removeClass("ratedTwoStars").removeClass("ratedFourStars").removeClass("ratedFiveStars").addClass("ratedThreeStars");
  });
  $("ul.star-ratingActive li.fourStars").hover(function(){
    $(this).parent().removeClass("ratedOneStar").removeClass("ratedTwoStars").removeClass("ratedThreeStars").removeClass("ratedFiveStars").addClass("ratedFourStars");
  });
  $("ul.star-ratingActive li.fiveStars").hover(function(){
    $(this).parent().removeClass("ratedOneStar").removeClass("ratedTwoStars").removeClass("ratedThreeStars").removeClass("ratedFourStars").addClass("ratedFiveStars");
  });
  $("ul.star-ratingActive").hover(function(){
  }, function(){
    $(this).removeClass("ratedOneStar").removeClass("ratedTwoStars").removeClass("ratedThreeStars").removeClass("ratedFourStars").removeClass("ratedFiveStars");
  });

  $("div#favoriteData_dropdown").hide();

  $("div#favoriteData a.buttonLink").toggle(
    function(){
       $(this).addClass("active");
       $("div#favoriteData_dropdown").slideDown("slow");
    },
    function(){
         $(this).removeClass("active");
         $("div#favoriteData_dropdown").slideUp("slow");
      }
  );

  $("li#moveBtn a.buttonLink").toggle(
    function(){
       $(this).addClass("active");
       $("div#favoriteData_dropdown").slideDown("slow");
    },
    function(){
         $(this).removeClass("active");
         $("div#favoriteData_dropdown").slideUp("slow");
      }
  );

  $("ul#additionalFields_details").hide();

  $("div#additionalFields h3 a").toggle(
    function(){
       $("ul#additionalFields_details").slideDown("slow");
    },
    function(){
         $("ul#additionalFields_details").slideUp("slow");
      }

  );

  $("form.generateAPI").hide();

  $("div#additionalKeys a.addLink").toggle(
    function(){
       $("form.generateAPI").slideDown("slow");
    },
    function(){
         $("form.generateAPI").slideUp("slow");
      }

  );

  $("div#addTag").hide();

  $("a#addTagLink").toggle(
    function(){
       $("div#addTag").slideDown("slow");
    },
    function(){
         $("div#addTag").slideUp("slow");
      }
  );

  $("div#addFolder").hide();

  $("a#addFolderLink").toggle(
    function(){
       $("div#addFolder").slideDown("slow");
    },
    function(){
         $("div#addFolder").slideUp("slow");
      }
  );

  $("ul.tabs").tabs("div.tab_panes > div.tab_pane", {
    current: 'active'
  });

});


text:
// ReSharper disable InconsistentNaming

using System;
using EasyNetQ.Consumer;
using NUnit.Framework;
using Rhino.Mocks;

namespace EasyNetQ.Tests.ConsumeTests
{
    [TestFixture]
    public class When_cancellation_of_message_handler_occurs : ConsumerTestBase
    {
        protected override void AdditionalSetUp()
        {
            ConsumerErrorStrategy.Expect(x => x.HandleConsumerCancelled(null))
                                 .IgnoreArguments()
                                 .Return(AckStrategies.Ack);

            StartConsumer((body, properties, info) =>
                {
                    Cancellation.Cancel();
                    Cancellation.Token.ThrowIfCancellationRequested();
                });
            DeliverMessage();
        }

        [Test]
        public void Should_invoke_the_cancellation_strategy()
        {
            ConsumerErrorStrategy.AssertWasCalled(x => x.HandleConsumerCancelled(
                Arg<ConsumerExecutionContext>.Matches(args => args.Info.ConsumerTag == ConsumerTag &&
                                                           args.Info.DeliverTag == DeliverTag &&
                                                           args.Info.Exchange == "the_exchange" &&
                                                           args.Body == OriginalBody)));

            ConsumerErrorStrategy.AssertWasNotCalled(
                x => x.HandleConsumerError(Arg<ConsumerExecutionContext>.Is.Anything, Arg<Exception>.Is.Anything));
        }

        [Test]
        public void Should_ack()
        {
            MockBuilder.Channels[0].AssertWasCalled(x => x.BasicAck(DeliverTag, false));
        }

        [Test]
        public void Should_dispose_of_the_consumer_error_strategy_when_the_bus_is_disposed()
        {
            MockBuilder.Bus.Dispose();

            ConsumerErrorStrategy.AssertWasCalled(x => x.Dispose());
        }
    }
}

// ReSharper restore InconsistentNaming


text:
date: '2012-12-19'
title: Round Table Discussion
location: Spring Creek BBQ - Woodlands
sponsors:
    - Mind Scape
---
Come join us for good food and thought provoking .NET discussions.


text:
package com.google.android.exoplayer2.upstream.cache;

import com.google.android.exoplayer2.upstream.DataSink;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DataSource.Factory;
import com.google.android.exoplayer2.upstream.FileDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource.EventListener;

/**
 * A {@link DataSource.Factory} that produces {@link CacheDataSource}.
 */
public final class CacheDataSourceFactory implements DataSource.Factory {

  private final Cache cache;
  private final DataSource.Factory upstreamFactory;
  private final DataSource.Factory cacheReadDataSourceFactory;
  private final DataSink.Factory cacheWriteDataSinkFactory;
  private final int flags;
  private final EventListener eventListener;

  /**
   * @see CacheDataSource#CacheDataSource(Cache, DataSource, int)
   */
  public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory, int flags) {
    this(cache, upstreamFactory, flags, CacheDataSource.DEFAULT_MAX_CACHE_FILE_SIZE);
  }

  /**
   * @see CacheDataSource#CacheDataSource(Cache, DataSource, int, long)
   */
  public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory, int flags,
      long maxCacheFileSize) {
    this(cache, upstreamFactory, new FileDataSourceFactory(),
        new CacheDataSinkFactory(cache, maxCacheFileSize), flags, null);
  }

  /**
   * @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int,
   *     EventListener)
   */
  public CacheDataSourceFactory(Cache cache, Factory upstreamFactory,
      Factory cacheReadDataSourceFactory,
      DataSink.Factory cacheWriteDataSinkFactory, int flags, EventListener eventListener) {
    this.cache = cache;
    this.upstreamFactory = upstreamFactory;
    this.cacheReadDataSourceFactory = cacheReadDataSourceFactory;
    this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory;
    this.flags = flags;
    this.eventListener = eventListener;
  }

  @Override
  public CacheDataSource createDataSource() {
    return new CacheDataSource(cache, upstreamFactory.createDataSource(),
        cacheReadDataSourceFactory.createDataSource(),
        cacheWriteDataSinkFactory != null ? cacheWriteDataSinkFactory.createDataSink() : null,
        flags, eventListener);
  }

}


text:
module.exports = function (RED) {
  const request = require('request'),
    SERVICE_IDENTIFIER = 'language-translator',
    SERVICE_VERSION = '2018-05-01',
    LanguageTranslatorV3 = require('ibm-watson/language-translator/v3'),
    { IamAuthenticator } = require('ibm-watson/auth');

  var pkg = require('../../package.json'),
    fs = require('fs'),
    fileType = require('file-type'),
    temp = require('temp'),
    serviceutils = require('../../utilities/service-utils'),
    payloadutils = require('../../utilities/payload-utils'),
    translatorutils = require('./translator-utils'),
    apikey = null,
    sApikey = null,
    endpoint = '',
    sEndpoint = 'https://gateway.watsonplatform.net/language-translator/api',
    service = serviceutils.getServiceCreds(SERVICE_IDENTIFIER);

  if (service) {
    sApikey = service.apikey ? service.apikey : '';
    sEndpoint = service.url;
  }

  // Node RED Admin - fetch and set vcap services
  RED.httpAdmin.get('/watson-doc-translator/vcap', function (req, res) {
    res.json(service ? {bound_service: true} : null);
  });

  // API used by widget to fetch available models
  RED.httpAdmin.get('/watson-doc-translator/models', function (req, res) {
    endpoint = req.query.e ? req.query.e : sEndpoint;
    var lt = null,
      authSettings = {},
      serviceSettings = {
        version: SERVICE_VERSION,
        url: endpoint,
        headers: {
          'User-Agent': pkg.name + '-' + pkg.version
        }
      };

    if (sApikey || req.query.key) {
      authSettings.apikey = sApikey ? sApikey : req.query.key;
    }
    serviceSettings.authenticator = new IamAuthenticator(authSettings);

    lt = new LanguageTranslatorV3(serviceSettings);

    lt.listModels({})
      .then((response) => {
        let models = [];
        if (response && response.result && response.result.models) {
          models = response.result;
        }
        res.json(models);
      })
      .catch((err) => {
        res.json(err);
      });
  });

  function Node (config) {
    var node = this;
    RED.nodes.createNode(this, config);

    function payloadCheck(msg, mode) {
      var message = null;
      switch (mode) {
      case 'listDocuments':
      case 'documentStatus':
      case 'deleteDocument':
      case 'getDocument':
      case 'translateSubmittedDocument':
        break;
      case 'translateDocument':
        if (!msg.payload) {
          message = 'Missing property: msg.payload';
        }
        break;
      default:
        message = 'Unexpected Mode';
        break;
      }
      if (message) {
        return Promise.reject(message);
      }
      return Promise.resolve();
    }

    function docID(msg) {
      if (msg.payload && 'string' === typeof msg.payload) {
        return msg.payload;
      }
      if (msg.payload &&
            'object' === typeof msg.payload &&
               msg.payload.document_id) {
        return msg.payload.document_id;
      }
      return config['document-id'];
    }

    function paramCheck(msg, mode) {
      var message = null;
      switch (mode) {
      case 'listDocuments':
      case 'translateDocument':
        break;
      case 'documentStatus':
      case 'deleteDocument':
      case 'getDocument':
      case 'translateSubmittedDocument':
        if (!docID(msg)) {
          message = 'Document ID is required';
        }
        break;
      default:
        break;
      }
      if (message) {
        return Promise.reject(message);
      }
      return Promise.resolve();
    }

    function getService() {
      let authSettings = {},
        serviceSettings = {
          version: '2018-05-01',
          headers: {
            'User-Agent': pkg.name + '-' + pkg.version
          }
        };

      if (apikey) {
        authSettings.apikey = apikey;
      }
      serviceSettings.authenticator = new IamAuthenticator(authSettings);

      if (endpoint) {
        serviceSettings.url = endpoint;
      }

      return new LanguageTranslatorV3(serviceSettings);
    }

    function buildAuthSettings () {
      var authSettings = {};
      if (apikey) {
        authSettings.user = 'apikey';
        authSettings.pass = apikey;
      }
      return authSettings;
    }

    function executeRequest(uriAddress, method) {
      return new Promise(function resolver(resolve, reject){
        var authSettings = buildAuthSettings();

        request({
          uri: uriAddress,
          method: method,
          auth: authSettings
        }, (error, response, body) => {
          if (error) {
            reject(error);
          } else {
            switch (response.statusCode) {
            case 200:
              let data = null;
              try {
                data = JSON.parse(body);
              } catch(e) {
                data = body;
              }
              resolve(data);
              break;
            case 204:
              resolve(body);
              break;
            case 404:
              reject('Document not found ' + response.statusCode);
              break;
            default:
              reject('Error Invoking API ' + response.statusCode);
              break;
            }
          }
        });

      });
    }

    function executeGetRequest(uriAddress) {
      return executeRequest(uriAddress, 'GET');
    }

    function executeDeleteRequest(uriAddress) {
      return executeRequest(uriAddress, 'DELETE');
    }

    function verifyDocumentPayload (msg) {
      if (!msg.payload) {
        return Promise.reject('Missing property: msg.payload');
      } else if ( (msg.payload instanceof Buffer) ||
          (payloadutils.isJsonObject(msg.payload)) ) {
        return Promise.resolve();
      } else {
        return Promise.reject('msg.payload should be a data buffer or json object');
      }
    }

    function determineSuffix(msg) {
      var ext = '.json';

      if (msg.payload instanceof Buffer) {
        var ft = fileType(msg.payload);

        if (ft && ft.ext) {
          ext = '.' + ft.ext;
        } else {
          // We don't know what file type, so just assume .txt
          ext = '.txt';
        }
      }

      return Promise.resolve(ext);
    }

    function loadFile(suffix) {
      return new Promise(function resolver(resolve, reject){
        var options = {};
        if (suffix) {
          options.suffix = suffix;
        }
        temp.open(options, function(err, info) {
          if (err) {
            reject('Error opening temp file');
          } else {
            resolve(info);
          }
        });
      });
    }

    function syncTheFile(info, msg) {
      return new Promise(function resolver(resolve, reject){
        fs.writeFile(info.path, msg.payload, function(err) {
          if (err) {
            reject('Error processing buffer');
          }
          resolve();
        });
      });
    }

    function createStream(info) {
      //var theStream = fs.createReadStream(info.path, 'utf8');
      var theStream = fs.readFileSync(info.path, 'utf8');
      return Promise.resolve(theStream);
    }

    function whatName(msg, suffix){
      var name = 'Doc ' + (new Date()).toString(); // + suffix;
      if (msg && msg.filename) {
        name = msg.filename;
      } else if (config && config.filename ) {
        name = config.filename;
      }
      name = name.replace(/[^0-9a-z]/gi, '');
      return (name + suffix);
    }

    function sourceLang(msg) {
      if (msg.payload &&
            'object' === typeof msg.payload &&
            msg.payload.source) {
        return msg.payload.source;
      }
      return msg.srclang ? msg.srclang : config.srclang;
    }

    function executePostRequest(uriAddress, params, msg) {
      return new Promise(function resolver(resolve, reject){
        var authSettings = buildAuthSettings();

        request({
          uri: uriAddress,
          method: 'POST',
          auth: authSettings,
          formData: params
        }, (error, response, body) => {
          if (!error && response.statusCode === 200) {
            let data = JSON.parse(body);
            resolve(data);
          } else if (error) {
            reject(error);
          } else {
            reject('Error performing request ' + response.statusCode + ' ' + body);
          }
        });
      });
    }

    function executeUnknownMethod(msg) {
      return Promise.reject('Unable to process as unknown mode has been specified');
    }

    function executeListDocuments(msg) {
      let uriAddress = `${endpoint}/v3/documents?version=${SERVICE_VERSION}`;
      return executeGetRequest(uriAddress);
    }

    function executeGetDocumentStatus(msg) {
      var docid = docID(msg);
      let uriAddress = `${endpoint}/v3/documents/${docid}?version=${SERVICE_VERSION}`;

      return executeGetRequest(uriAddress);
    }

    function executeGetDocument(msg) {
      return new Promise(function resolver(resolve, reject){
        let lt = getService(),
          docid = docID(msg);

        lt.getTranslatedDocument({documentId : docid})
          .then((response) => {
            msg.payload = response;
            if (response && response.result) {
              msg.payload = response.result;
            }
            return payloadutils.checkForStream(msg);
          })
          .then(() => {
            resolve(msg.payload);
          })
          .catch((err) => {
            reject(err);
          });
      });
    }

    function executeDeleteDocument(msg) {
      var docid = docID(msg);
      //let uriAddress = endpoint + '/v3/documents/' + docid + '?version=' + SERVICE_VERSION;
      let uriAddress = `${endpoint}/v3/documents/${docid}?version=${SERVICE_VERSION}`;

      return executeDeleteRequest(uriAddress);
    }

    function executeTranslateSubmittedDocument(msg) {
      let uriAddress = `${endpoint}/v3/documents?version=${SERVICE_VERSION}`;
      var params = {
        'source' : sourceLang(msg),
        'target' : msg.destlang ? msg.destlang : config.destlang,
        'document_id' : docID(msg)
      };
      return executePostRequest(uriAddress, params, msg);
    }

    function executeTranslateDocument(msg) {
      var p = null,
        fileInfo = null,
        fileSuffix = '';
      let uriAddress = `${endpoint}/v3/documents?version=${SERVICE_VERSION}`;

      p = verifyDocumentPayload(msg)
        .then (() => {
          return determineSuffix(msg);
        })
        .then ((suffix) => {
          //return loadFile(uriAddress, msg, ext);
          fileSuffix = suffix;
          return loadFile(suffix);
        })
        .then ((info) => {
          fileInfo = info;
          return syncTheFile(fileInfo, msg);
        })
        .then(function(){
          return createStream(fileInfo);
        })
        .then(function(theStream){
          //params.file = theStream;
          //var fname = 'temp' + fileSuffix;
          var params = {
            'source' : msg.srclang ? msg.srclang : config.srclang,
            'target' : msg.destlang ? msg.destlang : config.destlang
          };
          var fname = whatName(msg, fileSuffix);

          params.file = {
            value: theStream,
            options: {
              filename: fname
            }
          };

          //return Promise.reject('temp disabled');
          return executePostRequest(uriAddress, params, msg);
        });

      return p;
    }

    function executeAction(msg, action) {
      var f = null;

      const execute = {
        'listDocuments' : executeListDocuments,
        'translateDocument' : executeTranslateDocument,
        'translateSubmittedDocument' : executeTranslateSubmittedDocument,
        'documentStatus' : executeGetDocumentStatus,
        'deleteDocument' : executeDeleteDocument,
        'getDocument' : executeGetDocument
      };

      f = execute[action] || executeUnknownMethod;
      node.status({ fill: 'blue', shape: 'dot', text: 'processing' });
      return f(msg);
    }

    function processResponse(msg, data) {
      msg.payload = data;
      return Promise.resolve();
    }

    function doit(msg, send) {
      let action = msg.action || config.action;

      translatorutils.credentialCheck(apikey)
        .then(function(){
          return translatorutils.checkForAction(action);
        })
        .then(function(){
          return payloadCheck(msg, action);
        })
        .then(function(){
          return paramCheck(msg, action);
        })
        .then(function(){
          node.status({fill:'blue', shape:'dot', text:'executing'});
          return executeAction(msg, action);
        })
        .then( (data) => {
          node.status({ fill: 'blue', shape: 'dot', text: 'processing response' });
          return processResponse(msg, data);
        })
        .then(function(){
          temp.cleanup();
          node.status({});
          send(msg);
        })
        .catch(function(err){
          temp.cleanup();
          payloadutils.reportError(node, msg, err);
          send(msg);
        });
    }

    this.on('input', function(msg, send, done) {
      // The dynamic nature of this node has caused problems with the password field. it is
      // hidden but not a credential. If it is treated as a credential, it gets lost when there
      // is a request to refresh the model list.
      // Credentials are needed for each of the modes.
      apikey = sApikey || this.credentials.apikey || config.apikey;

      endpoint = sEndpoint;
      if (config['service-endpoint']) {
        endpoint = config['service-endpoint'];
      }

      node.status({});
      temp.track();

      if ('object' === typeof msg.payload &&
            msg.payload.documents &&
            Array.isArray(msg.payload.documents)) {
        let len = msg.payload.documents.length;

        msg.payload.documents.forEach((e, i) => {
          let msgClone = Object.assign({}, msg),
            pos = i+1;
          node.status({ fill: 'blue', shape: 'dot', text: `Processing document ${pos} of ${len}` });
          msgClone.payload = e;
          doit(msgClone, send);
        });

      } else {
        doit(msg, send);
      }
      done();
    });
  }

  RED.nodes.registerType('watson-doc-translator', Node, {
    credentials: {
      apikey: {type:'password'}
    }
  });
};


text:
<?php

namespace EmailMarketing\Infrastructure\Persistence\Doctrine\Repository;

use Doctrine\ORM\EntityManager;
use EmailMarketing\Domain\Entity\Cliente;
use Interop\Container\ContainerInterface;

class ClienteRepositoryFactory
{

    public function __invoke(ContainerInterface $container) : ClienteRepository
    {
        /** @var EntityManager $entityManager */
        $entityManager = $container->get(EntityManager::class);
        return $entityManager->getRepository(Cliente::class);
    }

}


text:
import { getAsyncInjectors } from 'utils/asyncInjectors';
import { refreshToken, clearToken } from 'utils/tokenManager';

const errorLoading = (err) => {
  console.error('Dynamic page loading failed', err); // eslint-disable-line no-console
};

const loadModule = (cb) => (componentModule) => {
  cb(null, componentModule.default);
};

const localStorage = global.window.localStorage;
const checkNRefreshToken = (isDashboard) => (nextState, replace, callback) => {
  if (localStorage.access_token && Date.now() < localStorage.expires_in - 10000) {
    if (isDashboard) {
      replace('/home');
    }
    return callback();
  }

  if (!localStorage.refresh_token) {
    if (window.location.pathname !== '/') {
      replace('/');
    }
    callback();
  } else {
    refreshToken()
      .then(() => {
        if (isDashboard) {
          replace('/home');
        }
        callback();
      })
      .catch((error) => {
        if (error.data.status_code === 400) {
          clearToken();
        }
        replace('/');
        callback(error);
      });
  }
  return true;
};

export default function createRoutes(store) {
  // Create reusable async injectors using getAsyncInjectors factory
  const { injectReducer, injectSagas } = getAsyncInjectors(store); // eslint-disable-line no-unused-vars

  return [
    {
      path: '/',
      getComponent(nextState, cb) {
        const importModules = Promise.all([
          System.import('containers/Dashboard'),
        ]);

        const renderRoute = loadModule(cb);

        importModules.then(([component]) => {
          renderRoute(component);
        });

        importModules.catch(errorLoading);
      },
      childRoutes: [
        {
          indexRoute: {
            getComponent(nextState, cb) {
              const importModules = Promise.all([
                System.import('containers/HomePage'),
              ]);

              const renderRoute = loadModule(cb);

              importModules.then(([component]) => {
                renderRoute(component);
              });

              importModules.catch(errorLoading);
            },
          },
        },
        {
          path: '/home',
          getComponent(nextState, cb) {
            const importModules = Promise.all([
              System.import('containers/HomePage'),
            ]);

            const renderRoute = loadModule(cb);

            importModules.then(([component]) => {
              renderRoute(component);
            });

            importModules.catch(errorLoading);
          },
          childRoutes: [
            {
              path: '/home/findmusic',
              getComponent(nextState, cb) {
                const importModules = Promise.all([
                  System.import('containers/FindMusic'),
                ]);

                const renderRoute = loadModule(cb);

                importModules.then(([component]) => {
                  renderRoute(component);
                });

                importModules.catch(errorLoading);
              },
            },
            {
              path: '/home/privateFM',
              getComponent(nextState, cb) {
                const importModules = Promise.all([
                  System.import('containers/PrivateFM'),
                ]);

                const renderRoute = loadModule(cb);

                importModules.then(([component]) => {
                  renderRoute(component);
                });

                importModules.catch(errorLoading);
              },
            },
          ],
        },
      ],
    },
    {
      path: '*',
      name: 'notfound',
      getComponent(nextState, cb) {
        System.import('containers/NotFoundPage')
          .then(loadModule(cb))
          .catch(errorLoading);
      },
    },
  ];
}


text:
FROM gitpod/workspace-mysql

USER gitpod

ENV NGINX_DOCROOT_IN_REPO=""

  # Copy required files to /tmp
COPY --chown=gitpod:gitpod .gp/bash/update-composer.sh \
.gp/conf/nginx/nginx.conf \
.gp/bash/.bash_aliases \
.gp/bash/php.sh \
.gp/bash/install-core-packages.sh \
.gp/bash/utils.sh \
.gp/snippets/server-functions.sh \
.gp/bash/install-xdebug.sh \
/tmp/

  # Create log files and move required files to their proper locations
RUN sudo touch /var/log/workspace-image.log \
&& sudo chmod 666 /var/log/workspace-image.log \
&& sudo touch /var/log/workspace-init.log \
&& sudo chmod 666 /var/log/workspace-init.log \
&& sudo touch /var/log/xdebug.log \
&& sudo chmod 666 /var/log/xdebug.log \
&& sudo mv /tmp/nginx.conf /etc/nginx/nginx.conf \
&& sudo mv /tmp/.bash_aliases /home/gitpod/.bash_aliases \
&& sudo mv /tmp/server-functions.sh /home/gitpod/.bashrc.d/server-functions

# Needed for local development? Remove later?
RUN sudo chown gitpod:gitpod /workspace

# Install and configure php and php-fpm
RUN sudo bash -c ". /tmp/php.sh" && rm /tmp/php.sh

# Install core packages
RUN sudo bash -c ". /tmp/install-core-packages.sh" && rm /tmp/install-core-packages.sh

# Download, compile, install and configure xdebug from source
RUN sudo bash -c ". /tmp/install-xdebug.sh" && rm /tmp/install-xdebug.sh

# Update composer
RUN bash -c ". /tmp/update-composer.sh" && rm /tmp/update-composer.sh

# Force the docker image to build by incrementing this value
ENV INVALIDATE_CACHE=13


text:
'use strict';

di('publicApi', function(injector) {
  var
    iconManager = injector('iconManager'),
    ready = injector('ready'),
    api;

  api = {
    icon: function(id, urlConfig, options) {
      iconManager.addIcon(id, urlConfig, options);
      return this;
    },

    svgSet: function(id, urlConfig, options) {
      iconManager.addSvgIconSet(id, urlConfig, options);
      return this;
    },

    font: function(id, cssClassConfig, options) {
      iconManager.addFontIconSet(id, cssClassConfig, options);
      return this;
    },

    sprite: function(id, cssClassConfig, options) {
      iconManager.addSpriteIconSet(id, cssClassConfig, options);
      return this;
    },

    sourceAlias: function(id, alias) {
      iconManager.addIconSetAlias(id, alias);
      return this;
    },

    defaultSvgSetUrl: function(url, options) {
      iconManager
        .addSvgIconSet(url, url, options)
        .setDefaultIconSet(url);
      return this;
    },

    defaultSource: function(id) {
      iconManager.setDefaultIconSet(id);
      return this;
    },

    defaultSvgIconSize: function(iconSize) {
      iconManager.setDefaultSvgIconSize(iconSize);
      return this;
    },

    preload: function(names, fn) {
      var
        promise;

      if (typeof names == 'function') {
        fn = names;
        names = null;
      }

      promise = iconManager.preload(names);
      fn && fn(promise);

      return this;
    },

    extension: ready

  };

  api.iconSet = api.svgSet;
  api.defaultIconSetUrl = api.defaultSvgSetUrl;
  api.defaultSvgIconSetUrl = api.defaultSvgSetUrl;
  api.alias = api.sourceAlias;
  api.default = api.defaultSource;

  return api;

});


text:
/**
 * holds data constants
 */
 base.registerModule('data', function(module) {
   var visual = base.importModule('visual');
   var level = base.importModule('level');
   var engine = base.importModule('engine');
   var resource = base.importModule('resource');

   module.COST_SUMMON = 10;

   module.PP_MANA = 1;
   module.PP_FOOD = 1;

   module.PP_TIN = 1; //how much it takes to produce it
   module.PP_COPPER = 3;
   module.PP_IRON = 5;

   module.CAVE_HURT = 0.5;
   module.MIN_CAVE_HP = 5;
   module.MAX_HP = 10;
   module.PLAYER_TOUGHNESS = 25;

   module.init = function init() {

   };
 });


text:
package ubuntu

import (
	"github.com/megamsys/urknall"
	"github.com/megamsys/libmegdc/templates"
)

var ubuntuparseexistlvm *UbuntuParseExistLvm

func init() {
	ubuntuparseexistlvm = &UbuntuParseExistLvm{}
	templates.Register("UbuntuParseExistLvm", ubuntuparseexistlvm)
}

type UbuntuParseExistLvm struct{}

func (tpl *UbuntuParseExistLvm) Render(p urknall.Package) {
	p.AddTemplate("parselvms", &UbuntuParseExistLvmTemplate{})
}

func (tpl *UbuntuParseExistLvm) Options(t *templates.Template) {}

func (tpl *UbuntuParseExistLvm) Run(target urknall.Target,inputs map[string]string) error {
	return urknall.Run(target, &UbuntuParseExistLvm{},inputs)
}

type UbuntuParseExistLvmTemplate struct{}

func (m *UbuntuParseExistLvmTemplate) Render(pkg urknall.Package) {

  pkg.AddCommands("list-pv",
    Shell("pvdisplay | grep \"PV Name\""),
  )
  pkg.AddCommands("list-vg",
    Shell("vgdisplay | grep \"VG Name\""),
  )
  pkg.AddCommands("list-lv",
    Shell("lvdisplay | grep \"LV Path\""),
  )
}


text:
package com.google.cloud.security.privateca.v1.samples;

// [START privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.security.privateca.v1.CertificateAuthorityName;
import com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient;
import com.google.cloud.security.privateca.v1.CertificateRevocationList;
import com.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest;

public class AsyncListCertificateRevocationLists {

  public static void main(String[] args) throws Exception {
    asyncListCertificateRevocationLists();
  }

  public static void asyncListCertificateRevocationLists() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CertificateAuthorityServiceClient certificateAuthorityServiceClient =
        CertificateAuthorityServiceClient.create()) {
      ListCertificateRevocationListsRequest request =
          ListCertificateRevocationListsRequest.newBuilder()
              .setParent(
                  CertificateAuthorityName.of(
                          "[PROJECT]", "[LOCATION]", "[CA_POOL]", "[CERTIFICATE_AUTHORITY]")
                      .toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .setOrderBy("orderBy-1207110587")
              .build();
      ApiFuture<CertificateRevocationList> future =
          certificateAuthorityServiceClient
              .listCertificateRevocationListsPagedCallable()
              .futureCall(request);
      // Do something.
      for (CertificateRevocationList element : future.get().iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}
// [END privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async]


text:
package com.intellij.history.core;

import com.intellij.openapi.util.io.IoTestUtil;
import com.intellij.util.containers.ContainerUtil;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

public class PathsTest extends LocalHistoryTestCase {
  @Test
  public void testParent() {
    assertEquals("dir1/dir2", Paths.getParentOf("dir1/dir2/file"));
    assertEquals("", Paths.getParentOf("file"));
    assertEquals("c:", Paths.getParentOf("c:/file"));
    assertEquals("/", Paths.getParentOf("/file"));
    assertEquals("/dir", Paths.getParentOf("/dir/file"));
  }

  @Test
  public void testName() {
    assertEquals("file", Paths.getNameOf("file"));
    assertEquals("file", Paths.getNameOf("dir/file"));
    assertEquals("/", Paths.getNameOf("/"));
  }

  @Test
  public void testAppending() {
    assertEquals("file1/file2", Paths.appended("file1", "file2"));
    assertEquals("c:/root/file", Paths.appended("c:/root", "file"));
    assertEquals("/foo", Paths.appended("/", "foo"));
    assertEquals("/foo/bar", Paths.appended("/foo", "bar"));

    assertEquals("bar", Paths.appended("", "bar"));
  }

  @Test
  public void testRenaming() {
    assertEquals("dir/file2", Paths.renamed("dir/file1", "file2"));
    assertEquals("file2", Paths.renamed("file1", "file2"));
    assertEquals("/bar", Paths.renamed("/foo", "bar"));
  }

  @Test
  public void testRelative() {
    assertEquals("file", Paths.relativeIfUnder("dir/file", "dir"));

    assertNull(Paths.relativeIfUnder("dir/file", "abc"));
    assertNull(Paths.relativeIfUnder("dir/file", "di"));

    assertNull("dir/file", Paths.relativeIfUnder("/dir/file", "/"));
    assertEquals("file", Paths.relativeIfUnder("/dir/file", "/dir"));

    Paths.setCaseSensitive(true);
    assertNull(Paths.relativeIfUnder("dir/file", "DiR"));

    Paths.setCaseSensitive(false);
    assertEquals("file", Paths.relativeIfUnder("dir/file", "DiR"));
  }

  @Test
  public void testIsParentOf() {
    assertTrue(Paths.isParent("foo", "foo"));
    assertTrue(Paths.isParent("foo", "foo/bar"));
    assertTrue(Paths.isParent("foo/bar", "foo/bar"));
    assertTrue(Paths.isParent("foo/bar", "foo/bar/baz"));
    assertTrue(Paths.isParent("/", "/foo"));
    assertTrue(Paths.isParent("/foo", "/foo/bar"));
    assertFalse(Paths.isParent("foo/bar", "foo/baz"));
    assertFalse(Paths.isParent("foo/bar", "foo/barr"));
    assertFalse(Paths.isParent("foo/bar", "foo/barr/baz"));

    assertTrue(Paths.isParent("", "foo"));
  }

  @Test
  public void testIsParentOrChildOf() {
    assertTrue(Paths.isParentOrChild("foo/bar", "foo/bar"));
    assertTrue(Paths.isParentOrChild("foo/bar", "foo/bar/baz"));
    assertTrue(Paths.isParentOrChild("foo/bar/baz", "foo/bar"));
    assertTrue(Paths.isParentOrChild("/", "/foo/bar"));
    assertTrue(Paths.isParentOrChild("/foo/bar", "/"));
    assertFalse(Paths.isParentOrChild("foo/baz", "foo/bar"));
  }

  @Test
  public void testWindowsPathsSplitting() {
    IoTestUtil.assumeWindows();
    testPathSplit("relative/folder/file.txt", "relative", "folder", "file.txt");
    testPathSplit("C:/Users/user/folder/file.txt", "C:", "Users", "user", "folder", "file.txt");
    testPathSplit("//wsl$/Distro/home/user/folder/file.txt", "//wsl$/Distro", "home", "user", "folder", "file.txt");
    testPathSplit("//wsl$/Distro", "//wsl$/Distro");
    testPathSplit("//wsl$/Distro/", "//wsl$/Distro");
    testPathSplit("//wsl$/", "//wsl$/");
  }

  @Test
  public void testUnixPathsSplitting() {
    IoTestUtil.assumeUnix();
    testPathSplit("relative/folder/file.txt", "relative", "folder", "file.txt");
    testPathSplit("/home/user/folder/file.txt", "/", "home", "user", "folder", "file.txt");
    testPathSplit("/home/user/folder", "/", "home", "user", "folder");
    testPathSplit("/home/user/folder/", "/", "home", "user", "folder");
    testPathSplit("/", "/");
  }

  private static void testPathSplit(String path, String... expectedElements) {
    List<String> actualElements = ContainerUtil.collect(Paths.split(path).iterator());
    assertEquals(path, Arrays.asList(expectedElements), actualElements);
  }

  @Test
  public void testEquals() {
    assertTrue(Paths.equals("one", "one"));
    assertFalse(Paths.equals("one", "two"));

    Paths.setCaseSensitive(true);
    assertFalse(Paths.equals("one", "ONE"));

    Paths.setCaseSensitive(false);
    assertTrue(Paths.equals("one", "ONE"));
  }
}


text:
**Autobahn**|Android documentation is generated using [Sphinx](http://sphinx-doc.org/).

To install Sphinx:

	pip install -U sphinx

To install [javasphinx](http://bronto.github.io/javasphinx/), install [lxml](https://pypi.python.org/pypi/lxml/) and then:

	pip install -U javasphinx

> Note: Due to a little bug, you currently need to use [this](https://github.com/oberstet/javasphinx).

To generate the docs:

	make html

> This will run `javasphinx-apidoc -u -o _gen ../Autobahn/src/` under the hood to first generate RST files from Javadoc.
>

To cleanup

	make clean


text:
"""
@file    simpleTest.py
@author  Simon Box, Craig Rafter
@date    29/01/2016

test Miller's algorithm
"""
import sys, os
sys.path.insert(0, '../sumoAPI')
import fixedTimeControl
import HybridVAControl
import actuatedControl
import sumoConnect
import readJunctionData
import traci
from routeGen import routeGen
from sumoConfigGen import sumoConfigGen
import numpy as np

controller = HybridVAControl.HybridVAControl
#controller = actuatedControl.actuatedControl
#controller = fixedTimeControl.fixedTimeControl

# Define road model directory
modelname = 'simpleT'
model = './models/{}/'.format(modelname)
# Generate new routes
N = 500  # Last time to insert vehicle at
stepSize = 0.1
AVratio = 0.0
AVtau = 1.0
seed = 10
vehNr, lastVeh = routeGen(N, AVratio, AVtau, routeFile=model + modelname + '.rou.xml', seed=seed)
print(vehNr, lastVeh)
print('Routes generated')

# Edit the the output filenames in sumoConfig
configFile = model + modelname + ".sumocfg"
exportPath = '../../simple/'
if not os.path.exists(model+exportPath): # this is relative to script not cfg file
    os.makedirs(model+exportPath)

simport = 8813
sumoConfigGen(modelname, configFile, exportPath, stepSize, port=simport, seed=seed)

# Connect to model
connector = sumoConnect.sumoConnect(model + modelname + ".sumocfg", gui=False, port=simport)
connector.launchSumoAndConnect()
print('Model connected')

# Get junction data
jd = readJunctionData.readJunctionData(model + modelname + ".jcn.xml")
junctionsList = jd.getJunctionData()

# Add controller models to junctions
controllerList = []
minGreenTime = 10
maxGreenTime = 60
for junction in junctionsList:
    controllerList.append(controller(junction))

print('Junctions and controllers acquired')

# Step simulation while there are vehicles
vehIDs = []
juncIDs = traci.trafficlights.getIDList()
juncPos = [traci.junction.getPosition(juncID) for juncID in juncIDs]

while traci.simulation.getMinExpectedNumber():
    traci.simulationStep()
    for c in controllerList:
        c.process()

connector.disconnect()
print('DONE')


text:
import React, { PropTypes } from 'react';
import Relay from 'relay';
import { ListGroupItem, Glyphicon } from 'react-bootstrap';
import { ColorMarker } from './elements';

class LabelItem extends React.Component {
	render() {
		const label = this.props.label;
		const content = {
			display: 'flex',
			flexDirection: 'row',
			alignItems: 'center'
		};

		return (
			<ListGroupItem>

					<Glyphicon glyph={this.props.select?'star':''}/>
					<ColorMarker color={label.color}/>
					{label.name}

			</ListGroupItem>
		);
	}
}

LabelItem.propTypes = {
	select: PropTypes.bool.isRequired
};

export default Relay.createContainer(LabelItem, {
	fragments: {
		label: () => {
			fragment on Label {
				id
				name
				color
			}
		}
	}
});


text: obj-y = checksum.o io.o memcpy.o memset.o


text:
package edu.mit.lastmite.insight_library.util;

import android.app.Application;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import javax.inject.Inject;

public class Storage {
    protected transient Application mApplication;

    public Storage(Application application) {
        mApplication = application;
    }

    public String getLocalKey(String queueName, String key) {
        return String.format("%s_%s", queueName, key);
    }

    public SharedPreferences getSharedPreferences() {
        return PreferenceManager.getDefaultSharedPreferences(mApplication);
    }

    @SuppressWarnings("UnusedDeclaration")
    public float getGlobalFloat(String key) {
        return getSharedPreferences().getFloat(key, -1.0f);
    }

    @SuppressWarnings("UnusedDeclaration")
    public float getLocalFloat(String queueName, String key) {
        return getSharedPreferences().getFloat(getLocalKey(queueName, key), -1.0f);
    }

    @SuppressWarnings("UnusedDeclaration")
    public void putGlobalFloat(String key, float value) {
        getSharedPreferences().edit().putFloat(key, value).apply();
    }

    @SuppressWarnings("UnusedDeclaration")
    public void putLocalFloat(String queueName, String key, float value) {
        getSharedPreferences().edit().putFloat(getLocalKey(queueName, key), value).apply();
    }

    @SuppressWarnings("UnusedDeclaration")
    public Integer getGlobalInteger(String key) {
        return getSharedPreferences().getInt(key, -1);
    }

    @SuppressWarnings("UnusedDeclaration")
    public Integer getLocalInteger(String queueName, String key) {
        return getSharedPreferences().getInt(getLocalKey(queueName, key), -1);
    }

    @SuppressWarnings("UnusedDeclaration")
    public void putGlobalInteger(String key, Integer value) {
        getSharedPreferences().edit().putInt(key, value).apply();
    }

    @SuppressWarnings("UnusedDeclaration")
    public void putLocalInteger(String queueName, String key, Integer value) {
        getSharedPreferences().edit().putInt(getLocalKey(queueName, key), value).apply();
    }

    @SuppressWarnings("UnusedDeclaration")
    public long getGlobalLong(String key) {
        return getSharedPreferences().getLong(key, -1);
    }

    @SuppressWarnings("UnusedDeclaration")
    public long getLocalLong(String queueName, String key) {
        return getSharedPreferences().getLong(getLocalKey(queueName, key), -1);
    }

    @SuppressWarnings("UnusedDeclaration")
    public void putGlobalLong(String key, long value) {
        getSharedPreferences().edit().putLong(key, value).apply();
    }

    @SuppressWarnings("UnusedDeclaration")
    public void putLocalLong(String queueName, String key, long value) {
        getSharedPreferences().edit().putLong(getLocalKey(queueName, key), value).apply();
    }

    @SuppressWarnings("UnusedDeclaration")
    public String getGlobalString(String key) {
        return getSharedPreferences().getString(key, null);
    }

    @SuppressWarnings("UnusedDeclaration")
    public String getLocalString(String queueName, String key) {
        return getSharedPreferences().getString(getLocalKey(queueName, key), null);
    }

    @SuppressWarnings("UnusedDeclaration")
    public void clear() {
        getSharedPreferences().edit().clear().apply();
    }
}


text:
package testdata

import "testing"

func TestBeforeComment(t *testing.T) {
	tests := []struct {
		name string
		want string
	}{
		// TODO: Add test cases.
	}
	for _, tt := range tests {
		if got := BeforeComment(); got != tt.want {
			t.Errorf("%q. BeforeComment() = %v, want %v", tt.name, got, tt.want)
		}
	}
}