text:
package com.elytradev.movingworld.common.chunk;

import com.elytradev.movingworld.MovingWorldMod;
import com.elytradev.movingworld.common.block.BlockMovingWorldMarker;
import com.elytradev.movingworld.common.chunk.assembly.AssembleResult;
import com.elytradev.movingworld.common.chunk.assembly.CanAssemble;
import com.elytradev.movingworld.common.tile.TileMovingMarkingBlock;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;

/**
 * Used for storing information given by and taken by the (Dis)Assembler <p/> Mostly for use in
 * GUIs, the ship pretty much immediately forgets this thing.
 */
public class MovingWorldAssemblyInteractor {

    public MovingWorldAssemblyInteractor fromByteBuf(byte resultCode, ByteBuf byteBuf) {
        return new MovingWorldAssemblyInteractor();
    }

    public MovingWorldAssemblyInteractor fromNBT(NBTTagCompound tag, World world) {
        return new MovingWorldAssemblyInteractor();
    }

    public boolean doDiagonalAssembly() {
        return MovingWorldMod.INSTANCE.getNetworkConfig().getShared().diagonalAssembly;
    }

    public void toByteBuf(ByteBuf byteBuf) {
    }

    /**
     * Called when a block is assembled to your moving world.
     */
    public void blockAssembled(LocatedBlock locatedBlock) {
    }

    /**
     * Called when a block is disassembled from your moving world.
     */
    public void blockDisassembled(LocatedBlock locatedBlock) {
        if (locatedBlock.tileEntity != null && locatedBlock.tileEntity.getWorld() != null
                && locatedBlock.tileEntity.getWorld().getTileEntity(locatedBlock.blockPos) != null)
            locatedBlock.tileEntity.getWorld().getTileEntity(locatedBlock.blockPos).markDirty();
    }

    /**
     * @return returns if it is an over writable block in the config.
     */
    public boolean canOverwriteState(IBlockState state) {
        return MovingWorldMod.INSTANCE.getNetworkConfig().canOverwriteState(state);
    }

    /**
     * Called when a block is overwritten when a moving world is disassembled.
     */
    public void blockOverwritten(Block block) {
    }

    /**
     * Called when a block is rotated during disassembling.
     */
    public IBlockState blockRotated(IBlockState blockState, int deltarot) {
        return blockState;
    }

    /**
     * Called when a chunk assembly has finished.
     */
    public void chunkAssembled(AssembleResult assembleResult) {
    }

    /**
     * Called when a chunk disassembly has finished.
     */
    public void chunkDissasembled(AssembleResult assembleResult) {
    }

    public CanAssemble isBlockAllowed(World world, LocatedBlock lb) {
        CanAssemble canAssemble = new CanAssemble(false, false);
        IBlockState state = lb.blockState;

        canAssemble.justCancel = !(!state.getMaterial().equals(Material.AIR) && !state.getMaterial().isLiquid() && MovingWorldMod.INSTANCE.getNetworkConfig().isStateAllowed(state));
        canAssemble.justCancel = canAssemble.justCancel || !MovingWorldMod.INSTANCE.getNetworkConfig().isTileAllowed(lb.tileEntity);

        return canAssemble;
    }

    public boolean isBlockMovingWorldMarker(Block block) {
        return block instanceof BlockMovingWorldMarker;
    }

    public boolean isTileMovingWorldMarker(TileEntity tile) {
        return tile instanceof TileMovingMarkingBlock;
    }

    public EnumFacing getFrontDirection(LocatedBlock marker) {
        return marker.blockState.getValue(BlockMovingWorldMarker.FACING).getOpposite();
    }

    /**
     * Recommended to call writeNBTMetadata first, then write the rest of your data.
     */
    public void writeNBTFully(NBTTagCompound tag) {
    }

    /**
     * Write metadata to NBT.
     */
    public void writeNBTMetadata(NBTTagCompound tag) {
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you 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.
  -->
<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">
    <parent>
        <artifactId>siddhi-io-rabbitmq-parent</artifactId>
        <groupId>org.wso2.extension.siddhi.io.rabbitmq</groupId>
        <version>1.0.14-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <packaging>bundle</packaging>
    <artifactId>siddhi-io-rabbitmq</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-query-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.rabbitmq</groupId>
            <artifactId>amqp-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.log4j.wso2</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.extension.siddhi.map.xml</groupId>
            <artifactId>siddhi-map-xml</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <classifier>runtime</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Private-Package>
                            com.rabbitmq.client.*, com.rabbitmq.utility.*
                        </Private-Package>
                        <Export-Package>
                            org.wso2.extension.siddhi.io.rabbitmq.*
                        </Export-Package>
                        <Import-Package>
                            *;resolution:=optional
                        </Import-Package>
                        <Include-Resource>
                            META-INF=target/classes/META-INF
                        </Include-Resource>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>local-rabbitmq</id>
            <!-- Fabric8 Docker Maven plugin -->
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <logDate>default</logDate>
                            <autoPull>true</autoPull>
                            <images>
                                <image>
                                    <alias>rabbitmq</alias>
                                    <name>rabbitmq:3</name>
                                    <run>
                                        <wait>
                                            <tcp>
                                                <ports>
                                                    <port>5672</port>
                                                </ports>
                                            </tcp>
                                            <time>60000</time>
                                        </wait>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                        <executions>
                            <execution>
                                <id>build</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>build</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>start</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <argLine>${failsafeArgLine}</argLine>
                            <systemPropertyVariables>
                                <brokerHostAddress>localhost</brokerHostAddress>
                            </systemPropertyVariables>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.8</version>
                        <executions>
                            <execution>
                                <id>pre-integration-test</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <destFile>${basedir}/target/jacoco.exec/</destFile>
                                    <propertyName>failsafeArgLine</propertyName>
                                </configuration>
                            </execution>
                            <execution>
                                <id>post-integration-test</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <dataFile>${basedir}/target/jacoco.exec</dataFile>
                                    <outputDirectory>${basedir}/target/coverage-reports/</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>documentation-deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.wso2.siddhi</groupId>
                        <artifactId>siddhi-doc-gen</artifactId>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>deploy-mkdocs-github-pages</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>

redpajama_set_name: RedPajamaGithub


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

namespace Utilities
{
    /// <summary>
    ///  Various constants used throughout the codebase
    /// </summary>
    public class Constants
    {
        public const string EDDI_NAME = "EDDI";
        public const string EDDI_VERSION = "2.3.0";
        public static readonly string DATA_DIR = Environment.GetEnvironmentVariable("AppData") + "\\" + EDDI_NAME;

        public const string ENVIRONMENT_WITCH_SPACE = "Witch space";
        public const string ENVIRONMENT_SUPERCRUISE = "Supercruise";
        public const string ENVIRONMENT_NORMAL_SPACE = "Normal space";

        public const string VEHICLE_SHIP = "Ship";
        public const string VEHICLE_SRV = "SRV";
        public const string VEHICLE_FIGHTER = "Fighter";
    }
}


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.HybridContainerService.Models
{
    internal partial class LinuxProfilePropertiesSsh : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsCollectionDefined(PublicKeys))
            {
                writer.WritePropertyName("publicKeys");
                writer.WriteStartArray();
                foreach (var item in PublicKeys)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
        }

        internal static LinuxProfilePropertiesSsh DeserializeLinuxProfilePropertiesSsh(JsonElement element)
        {
            Optional<IList<LinuxProfilePropertiesSshPublicKeysItem>> publicKeys = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("publicKeys"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<LinuxProfilePropertiesSshPublicKeysItem> array = new List<LinuxProfilePropertiesSshPublicKeysItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LinuxProfilePropertiesSshPublicKeysItem.DeserializeLinuxProfilePropertiesSshPublicKeysItem(item));
                    }
                    publicKeys = array;
                    continue;
                }
            }
            return new LinuxProfilePropertiesSsh(Optional.ToList(publicKeys));
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HuiEF.Web.Controllers
{
    public class DocsController : BaseController
    {
        //
        // GET: /Docs/

        public ActionResult Index()
        {
            return View();
        }
        [HttpGet]
        public ActionResult Add()
        {
            return View();
        }
        [HttpPost, ValidateInput(false)]
        public ActionResult Add(FormCollection fc)
        {
            return Success();
        }
    }
}


text:
namespace metrics {

// ScreenInfoMetricsProvider provides metrics related to screen info.
class ScreenInfoMetricsProvider : public MetricsProvider {
 public:
  ScreenInfoMetricsProvider();

  ScreenInfoMetricsProvider(const ScreenInfoMetricsProvider&) = delete;
  ScreenInfoMetricsProvider& operator=(const ScreenInfoMetricsProvider&) =
      delete;

  ~ScreenInfoMetricsProvider() override;

  // MetricsProvider:
  void ProvideSystemProfileMetrics(
      SystemProfileProto* system_profile_proto) override;

 protected:
  // Exposed for the sake of mocking in test code.

  // Returns the screen size for the primary monitor if available.
  virtual absl::optional<gfx::Size> GetScreenSize() const;

  // Returns the device scale factor for the primary monitor.
  virtual float GetScreenDeviceScaleFactor() const;

  // Returns the number of monitors the user is using.
  virtual int GetScreenCount() const;
};

}  // namespace metrics

#endif  // COMPONENTS_METRICS_UI_SCREEN_INFO_METRICS_PROVIDER_H_


text:
// Copyright (C) 2014 The Android Open Source Project
//
// 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.googlesource.gerrit.plugins.xdocs.client;

import com.google.gerrit.client.rpc.NativeMap;
import com.google.gerrit.client.rpc.Natives;
import com.google.gerrit.extensions.client.ChangeStatus;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import java.util.Collections;
import java.util.Comparator;

public class ChangeInfo extends JavaScriptObject {
  public final native String project() /*-{ return this.project; }-*/;

  public final native NativeMap<RevisionInfo> revisions() /*-{ return this.revisions; }-*/;

  public final native RevisionInfo revision(String n) /*-{ return this.revisions[n]; }-*/;

  public final native int _number() /*-{ return this._number; }-*/;

  private final native String statusRaw() /*-{ return this.status; }-*/;

  public final native String current_revision() /*-{ return this.current_revision; }-*/;

  public final native void set_edit(EditInfo edit) /*-{ this.edit = edit; }-*/;

  public final native EditInfo edit() /*-{ return this.edit; }-*/;

  public final native boolean has_edit() /*-{ return this.hasOwnProperty('edit') }-*/;

  public final ChangeStatus getStatus() {
    return ChangeStatus.valueOf(statusRaw());
  }

  public final boolean isOpen() {
    switch (getStatus()) {
      case NEW:
        return true;
      default:
        return false;
    }
  }

  protected ChangeInfo() {}

  public static class RevisionInfo extends JavaScriptObject {
    public static RevisionInfo fromEdit(EditInfo edit) {
      RevisionInfo revisionInfo = createObject().cast();
      revisionInfo.takeFromEdit(edit);
      return revisionInfo;
    }

    private final native void takeFromEdit(EditInfo edit) /*-{
      this._number = 0;
      this.name = edit.name;
      this.commit = edit.commit;
      this.edit_base = edit.base_revision;
    }-*/;

    public final native int _number() /*-{ return this._number; }-*/;

    public final native String name() /*-{ return this.name; }-*/;

    public final native String ref() /*-{ return this.ref; }-*/;

    public final native boolean is_edit() /*-{ return this._number == 0; }-*/;

    public final native CommitInfo commit() /*-{ return this.commit; }-*/;

    public final native String edit_base() /*-{ return this.edit_base; }-*/;

    public static int findEditParent(JsArray<RevisionInfo> list) {
      for (int i = 0; i < list.length(); i++) {
        // edit under revisions?
        RevisionInfo editInfo = list.get(i);
        if (editInfo.is_edit()) {
          String parentRevision = editInfo.edit_base();
          // find parent
          for (int j = 0; j < list.length(); j++) {
            RevisionInfo parentInfo = list.get(j);
            String name = parentInfo.name();
            if (name.equals(parentRevision)) {
              // found parent patch set number
              return parentInfo._number();
            }
          }
        }
      }
      return -1;
    }

    public static void sortRevisionInfoByNumber(JsArray<RevisionInfo> list) {
      final int editParent = findEditParent(list);
      Collections.sort(
          Natives.asList(list),
          new Comparator<RevisionInfo>() {
            @Override
            public int compare(RevisionInfo a, RevisionInfo b) {
              return num(a) - num(b);
            }

            private int num(RevisionInfo r) {
              return !r.is_edit() ? 2 * (r._number() - 1) + 1 : 2 * editParent;
            }
          });
    }

    protected RevisionInfo() {}
  }

  public static class EditInfo extends JavaScriptObject {
    public final native String name() /*-{ return this.name; }-*/;

    protected EditInfo() {}
  }
}


text:
package com.stratio.cassandra.lucene.schema;

import com.google.common.base.Objects;
import com.stratio.cassandra.lucene.IndexException;
import com.stratio.cassandra.lucene.schema.column.Columns;
import com.stratio.cassandra.lucene.schema.mapping.Mapper;
import org.apache.cassandra.config.CFMetaData;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.document.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Closeable;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * The user-defined mapping from Cassandra columns to Lucene documents.
 *
 * @author Andres de la Pena {@literal <adelapena@stratio.com>}
 */
public class Schema implements Closeable {

    private static final Logger logger = LoggerFactory.getLogger(Schema.class);

    /** The {@link Columns} {@link Mapper}s. */
    private final Map<String, Mapper> mappers;

    /** The wrapping all-in-one {@link Analyzer}. */
    private final SchemaAnalyzer analyzer;

    /** The names of the mapped columns. */
    private final Set<String> mappedColumns;

    /**
     * Returns a new {@code Schema} for the specified {@link Mapper}s and {@link Analyzer}s.
     *
     * @param defaultAnalyzer The default {@link Analyzer} to be used.
     * @param mappers         The per field {@link Mapper}s builders to be used.
     * @param analyzers       The per field {@link Analyzer}s to be used.
     */
    public Schema(Analyzer defaultAnalyzer, Map<String, Mapper> mappers, Map<String, Analyzer> analyzers) {
        this.mappers = mappers;
        this.analyzer = new SchemaAnalyzer(defaultAnalyzer, analyzers, mappers);
        mappedColumns = new HashSet<>();
        for (Mapper mapper : this.mappers.values()) {
            mappedColumns.addAll(mapper.mappedColumns);
        }
    }

    /**
     * Returns the used {@link Analyzer}.
     *
     * @return The used {@link Analyzer}.
     */
    public Analyzer getAnalyzer() {
        return analyzer;
    }

    /**
     * Returns the default {@link Analyzer}.
     *
     * @return The default {@link Analyzer}.
     */
    public Analyzer getDefaultAnalyzer() {
        return analyzer.getDefaultAnalyzer().getAnalyzer();
    }

    /**
     * Returns the {@link Analyzer} identified by the specified field name.
     *
     * @param fieldName A field name.
     * @return The {@link Analyzer} identified by the specified field name.
     */
    public Analyzer getAnalyzer(String fieldName) {
        return analyzer.getAnalyzer(fieldName).getAnalyzer();
    }

    /**
     * Returns the {@link Mapper} identified by the specified field name, or {@code null} if not found.
     *
     * @param field A field name.
     * @return The {@link Mapper} identified by the specified field name, or {@code null} if not found.
     */
    public Mapper getMapper(String field) {
        String[] components = field.split("\\.");
        for (int i = components.length - 1; i >= 0; i--) {
            StringBuilder sb = new StringBuilder();
            for (int j = 0; j <= i; j++) {
                sb.append(components[j]);
                if (j < i) {
                    sb.append('.');
                }
            }
            Mapper mapper = mappers.get(sb.toString());
            if (mapper != null) {
                return mapper;
            }
        }
        return null;
    }

    /**
     * Validates the specified {@link Columns} for mapping.
     *
     * @param columns The {@link Columns} to be validated.
     */
    public void validate(Columns columns) {
        Document document = new Document();
        for (Mapper mapper : mappers.values()) {
            mapper.addFields(document, columns);
        }
    }

    /**
     * Adds to the specified {@link Document} the Lucene fields representing the specified {@link Columns}.
     *
     * This is done in a best-effort way, so each mapper errors are logged and ignored.
     *
     * @param document The Lucene {@link Document} where the fields are going to be added.
     * @param columns  The {@link Columns} to be added.
     */
    public void addFields(Document document, Columns columns) {
        for (Mapper mapper : mappers.values()) {
            try {
                mapper.addFields(document, columns);
            } catch (IndexException e) {
                logger.error("Error in Lucene index:\n\t" +
                             "while mapping : {}\n\t" +
                             "with mapper   : {}\n\t" +
                             "caused by     : {}", columns, mapper, e.getMessage());
            }
        }
    }

    /**
     * Checks if this is consistent with the specified column family metadata.
     *
     * @param metadata A column family metadata.
     */
    public void validate(CFMetaData metadata) {
        for (Mapper mapper : mappers.values()) {
            mapper.validate(metadata);
        }
    }

    /**
     * Returns if there is any mapper mapping the specified column.
     *
     * @param column A column name.
     * @return {@code true} if there is any mapper mapping the specified column, {@code false} otherwise.
     */
    public boolean maps(String column) {
        return mappedColumns.contains(column);
    }

    /**
     * Returns if the specified {@link Columns} contains the all the mapped columns.
     *
     * @param columns A {@link Columns}.
     * @return {@code true} if the specified {@link Columns} contains the mapped columns, {@code false} otherwise.
     */
    public boolean mapsAll(Columns columns) {
        for (Mapper mapper : mappers.values()) {
            if (!mapper.maps(columns)) {
                return false;
            }
        }
        return true;
    }

    /** {@inheritDoc} */
    @Override
    public void close() {
        analyzer.close();
    }

    /** {@inheritDoc} */
    @Override
    public String toString() {
        return Objects.toStringHelper(this).add("mappers", mappers).add("analyzer", analyzer).toString();
    }
}


text:
import _ from 'lodash';
import IndexedArray from 'ui/indexed_array';
const notPropsOptNames = IndexedArray.OPT_NAMES.concat('constructor');

/**
 * Create a registry, which is just a Private module provider.
 *
 * The registry allows modifying the values it will provide
 * using the #register method.
 *
 * To access these modules, pass the registry to the Private
 * module loader.
 *
 * # Examples
 *
 * + register a module
 * ```js
 * let registry = require('ui/registry/vis_types');
 * registry.add(function InjectablePrivateModule($http, Promise) {
 *   ...
 * })
 * ```
 *
 * + get all registered modules
 * ```js
 * let visTypes = Private(RegistryVisTypesProvider);
 * ```
 *
 *
 * @param  {object} [spec] - an object describing the properties of
 *                         the registry to create. Any property specified
 *                         that is not listed below will be mixed into the
 *                         final IndexedArray object.
 *
 * # init
 * @param {Function} [spec.constructor] - an injectable function that is called when
 *                                      the registry is first instanciated by the app.
 *
 * # IndexedArray params
 * @param {array[String]} [spec.index] - passed to the IndexedArray constructor
 * @param {array[String]} [spec.group] - passed to the IndexedArray constructor
 * @param {array[String]} [spec.order] - passed to the IndexedArray constructor
 * @param {array[String]} [spec.initialSet] - passed to the IndexedArray constructor
 * @param {array[String]} [spec.immutable] - passed to the IndexedArray constructor
 *
 * @return {[type]}      [description]
 */
export default function createRegistry(spec) {
  spec = spec || {};

  let constructor = _.has(spec, 'constructor') && spec.constructor;
  let iaOpts = _.defaults(_.pick(spec, IndexedArray.OPT_NAMES), { index: ['name'] });
  let props = _.omit(spec, notPropsOptNames);
  let providers = [];

  /**
   * This is the Private module that will be instanciated by
   *
   * @tag:PrivateModule
   * @return {IndexedArray} - an indexed array containing the values
   *                          that were registered, the registry spec
   *                          defines how things will be indexed.
   */
  let registry = function (Private, $injector) {
    // index all of the modules
    iaOpts.initialSet = providers.map(Private);
    let modules = new IndexedArray(iaOpts);

    // mixin other props
    _.assign(modules, props);

    // construct
    if (constructor) {
      modules = $injector.invoke(constructor, modules) || modules;
    }

    return modules;
  };

  registry.displayName = '[registry ' + props.name + ']';

  registry.register = function (privateModule) {
    providers.push(privateModule);
    return registry;
  };

  return registry;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2010 Google Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<resources>
    <item type="id" name="title_container" />
    <item type="id" name="title_logo" />
    <item type="id" name="action_bar_filter" />
    <item type="id" name="action_bar_help" />
    <item type="id" name="action_bar_more" />
    <item type="id" name="action_bar_settings" />
    <item type="id" name="action_bar_searchid" />

</resources>


text:
- An express node server with a single GET route.
- If 0% difference, reports back plan text "Pages are the same".
- Otherwise, a PNG-format graphic is streamed back with the differences highlighted in red.

### Example Usage

```
http://localhost:3000/v1/<url_1>/<url_2>
```


text:
package security

import (
	//"net/smtp"
)

var serviceUsername = "customer"
var servicePassword = "demoESP30"
var serviceDomain = "@google.com"
var servicePort = 570

func SendMessage(emailValue string, subjectValue string, messageValue string) {

}


text:
<?xml version="1.0" encoding="utf-8"?>
<Type Name="CCDictMaker" FullName="Cocos2D.CCDictMaker">
  <TypeSignature Language="C#" Value="public class CCDictMaker : Cocos2D.ICCSAXDelegator" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit CCDictMaker extends System.Object implements class Cocos2D.ICCSAXDelegator" />
  <AssemblyInfo>
    <AssemblyName>cocos2d-xna</AssemblyName>
    <AssemblyVersion>2.0.3.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>Cocos2D.ICCSAXDelegator</InterfaceName>
    </Interface>
  </Interfaces>
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public CCDictMaker ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="ArrayWithContentsOfFile">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.List<object> ArrayWithContentsOfFile (string pFileName);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.Generic.List`1<object> ArrayWithContentsOfFile(string pFileName) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.List<System.Object></ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="pFileName" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="pFileName">To be added.</param>
        To be added.
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="DictionaryWithContentsOfFile">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.Dictionary<string,object> DictionaryWithContentsOfFile (string pFileName);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.Generic.Dictionary`2<string, object> DictionaryWithContentsOfFile(string pFileName) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.Dictionary<System.String,System.Object></ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="pFileName" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="pFileName">To be added.</param>
        To be added.
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="EndElement">
      <MemberSignature Language="C#" Value="public void EndElement (object ctx, string name);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void EndElement(object ctx, string name) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="ctx" Type="System.Object" />
        <Parameter Name="name" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="ctx">To be added.</param>
        <param name="name">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="m_pArray">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.List<object> m_pArray;" />
      <MemberSignature Language="ILAsm" Value=".field public class System.Collections.Generic.List`1<object> m_pArray" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.List<System.Object></ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="m_pCurDict">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.Dictionary<string,object> m_pCurDict;" />
      <MemberSignature Language="ILAsm" Value=".field public class System.Collections.Generic.Dictionary`2<string, object> m_pCurDict" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.Dictionary<System.String,System.Object></ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="m_pRootDict">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.Dictionary<string,object> m_pRootDict;" />
      <MemberSignature Language="ILAsm" Value=".field public class System.Collections.Generic.Dictionary`2<string, object> m_pRootDict" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.Dictionary<System.String,System.Object></ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="m_sCurKey">
      <MemberSignature Language="C#" Value="public string m_sCurKey;" />
      <MemberSignature Language="ILAsm" Value=".field public string m_sCurKey" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="m_tDictStack">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.Stack<System.Collections.Generic.Dictionary<string,object>> m_tDictStack;" />
      <MemberSignature Language="ILAsm" Value=".field public class System.Collections.Generic.Stack`1<class System.Collections.Generic.Dictionary`2<string, object>> m_tDictStack" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.Stack<System.Collections.Generic.Dictionary<System.String,System.Object>></ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="m_tState">
      <MemberSignature Language="C#" Value="public Cocos2D.CCSAXState m_tState;" />
      <MemberSignature Language="ILAsm" Value=".field public valuetype Cocos2D.CCSAXState m_tState" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Cocos2D.CCSAXState</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="StartElement">
      <MemberSignature Language="C#" Value="public void StartElement (object ctx, string name, string[] atts);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void StartElement(object ctx, string name, string[] atts) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="ctx" Type="System.Object" />
        <Parameter Name="name" Type="System.String" />
        <Parameter Name="atts" Type="System.String[]" />
      </Parameters>
      <Docs>
        <param name="ctx">To be added.</param>
        <param name="name">To be added.</param>
        <param name="atts">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="TextHandler">
      <MemberSignature Language="C#" Value="public void TextHandler (object ctx, byte[] s, int len);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void TextHandler(object ctx, unsigned int8[] s, int32 len) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.3.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="ctx" Type="System.Object" />
        <Parameter Name="s" Type="System.Byte[]" />
        <Parameter Name="len" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="ctx">To be added.</param>
        <param name="s">To be added.</param>
        <param name="len">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
package com.sobek.common.result;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.ejb.EJB;

import com.sobek.common.result.entity.TranslationDAOLocal;

public abstract class Message implements Serializable {

	private static final long serialVersionUID = 1L;

	// Without the java escape character '\' this would be '\{\{[^\{\}]*\}\}'
	// which should match anything inclosed in {{}}.  The negation symbol '^'
	// is needed to make the match start at '{{' and stop at '}}'.  The
	// negation of '{' should not be needed, but it is included in case
	// someone does this {{ blah {{ blah }}.
	private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\{\\{[^\\{\\}]*\\}\\}");

	private MessageCode code = null;
	private String message = "";
	boolean translated = false;

	@EJB
	private TranslationDAOLocal translationDAO;

	protected Message(MessageCode code) {
		if(code == null) {
			throw new IllegalArgumentException(
					"An instance of " + Message.class + " cannot be created with " +
					"null values.  The given values were: " +
					"ErrorCode [" + code + "].");
		}

		this.code = code;
	}

	protected abstract String getSubstitutionValue(String key);

	public MessageCode getCode() {
		return this.code;
	}

	public String getText() {
		return this.message;
	}

	public boolean translated() {
		return this.translated;
	}

	// package private
	synchronized void resetTranslation() {
		this.message = "";
		this.translated = false;
	}

	// package private
	synchronized void translate(Locale locale) {
		if(!this.translated) {
			if(locale == null) {
				locale = Locale.ENGLISH;
			}

			String translation = this.translationDAO.getTranslation(code, locale);

			// If a translation could not be retrieved with the full locale, try
			// only using the language.
			if(translation == null || translation.isEmpty()) {
				translation = this.translationDAO.getTranslation(code, locale.getLanguage());
			}

			// If we didn't get a translation for the local, try English (if English
			// was not the attempted local).
			if(translation == null || translation.isEmpty()) {
				if(!locale.getLanguage().equals(Locale.ENGLISH.getLanguage())) {
					translation = this.translationDAO.getTranslation(code, Locale.ENGLISH.getLanguage());
				}
			}

			// If we still didn't get a translation, just set the message to an
			// empty string.  We don't want to blow up on translations, the error
			// code will be enough to fix the translation issue.
			if(translation == null || translation.isEmpty()) {
				this.message = "";
			} else {
				this.message = translation;
			}

			this.substitutePlaceholders();
			this.translated = true;
		}
	}

	private void substitutePlaceholders() {
		Matcher matcher = PLACEHOLDER_PATTERN.matcher(this.message);
		Set<String> valuesToReplace = new HashSet<String>();
		while(matcher.find()) {
			String finding = matcher.group();
			if(!valuesToReplace.contains(finding)) {
				valuesToReplace.add(finding);
			}
		}

		for(String key : valuesToReplace) {
			String value = this.getSubstitutionValue(key);
			if(value != null) {
				this.message = this.message.replace(key, value);
			}
		}
	}
}


text:
<!DOCTYPE html>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
  <link rel="stylesheet" type="text/css" href="../css/angular.tree.directive.css">

        <tree
          data-angular-treeview="true"
          data-tree-id="treeCollapsible"
          data-tree-model="treeCollapsible"
          data-node-id="id"
          data-node-label="label"
          data-node-children="children"
          data-collapsibility="true"
          data-extra-template-head-node-model="{{node.label}}<button class='btn btn-default btn-sm'>Modify</button>"
          data-extra-template-node-model="leaf">
          <root>

            {{node.label}} / root
          </root>
          <node>

            {{node.label}} / node
          </node>
        </tree>


text:
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title></title>

		<link rel="stylesheet" type="text/css" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
		<script type="text/javascript" src="../node_modules/jquery/dist/jquery.min.js"></script>
		<script type="text/javascript" src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>

		<!-- styles -->
		<style type="text/css">
			html,
			body,
			#container,
			canvas {
				width: 100%;
				height: 100%;
				overflow: hidden;
			}
		</style>

		<!-- utilities -->
		<script type="text/javascript">
			var cacheBust = 1;
			function loadImage(src, cb) {
				function done(event) {
					cb(event.type === 'load' ? null : true, img, event);
				}
				var img = new Image();
				img.crossOrigin = "anonymous";
				img.onload = done;
				img.onerror = done;
				img.src = src + (src.indexOf('?') === -1 ? '?' : '&') + cacheBust;// src;// + cacheBust;
			}
		</script>

		<!-- image generator -->
		<script type="text/javascript">
			var VidmeImageGenerator = function(options) {
				this.url = 'https://api.vid.me/videos/list';
				this.cacheSize = (options && options.cacheSize) || 100;
				this.data = {
					order : 'video_id',
					direction : 'DESC',
					limit : 100,
					//maxVideoId : maxVideoId,
					moderated : 1,
					nsfw: 0,
					private: 0
				};
				this.imagePreloadSemaphore = 0;
				this.images = [];
				this._semaphore = 0;
			};

			VidmeImageGenerator.prototype.consume = function() {
				if( this.images.length < this.cacheSize ) {
					this.getBatch();
				}
				if( this.images.length ) {
					return this.images.shift();
				}
			};

			VidmeImageGenerator.prototype.getBatch = function() {
				if( this._semaphore > 0 ) {
					return;
				}
				this._semaphore++;

				if( this.maxVideoId ) {
					this.data.maxVideoId = this.maxVideoId;
				}

				var self = this;
				$.ajax({
					url: this.url,
					data: this.data
				}).done(function(data) {
					self.onDone(data);
					self._semaphore--;
				}).error(function() {
					self._semaphore--;
				});
			};

			VidmeImageGenerator.prototype.onDone = function(data) {
				var fn = this.loadImage.bind(this);
				$.each(data.videos, fn);
			};

			VidmeImageGenerator.prototype.loadImage = function(index, video) {
				var id = parseInt(video.video_id);
				if( this.maxVideoId === undefined || id < this.maxVideoId ) {
					this.maxVideoId = id;
				}
				var thumb = video.thumbnail_url;
				this._semaphore++;
				loadImage(thumb, function(err, img) {
					this._semaphore--;
					if( !err ) {
						this.images.push([img, video]);
					}
				}.bind(this));
			};
		</script>

		<!-- canvas utility -->
		<script type="text/javascript">
			var MCanvasImage = function(col, img, extra, index) {
				this.col = col;
				this.img = img;
				this.extra = extra;
				this.index = index;
				this.originalWidth = img.width;
				this.originalHeight = img.height;

				this.resize();
				console.log(this);
			};

			MCanvasImage.prototype.resize = function() {
				this.width = this.col.width;
				this.height = Math.round(this.originalHeight * this.col.width / this.originalWidth);
			};

			MCanvasImage.prototype.draw = function() {
				var ctx = this.col.main.ctx;
				var offheight = this.offset + this.height;
				// Ignore if completely offscreen
				if( this.offset > this.col.height ) {
					return;
				} else if( offheight < 0 ) {
					return;
				}
				// If partially onscreen, or not drawn, draw
				if( this.offset > 0 && offheight < this.col.height ) {
					// Fully on screen
					if( this.drawn ) {
						return;
					}
					this.drawn = true;
				} else {
					// Partially on screen
					return;
				}

				//if( this.drawn ) {
				//	return;
				//}
				//this.drawn = true;
				ctx.drawImage(this.img, this.col.offset, this.offset, this.width, this.height);
			};

			var MCanvasColumn = function(main, index) {
				this.main = main;
				this.index = index;
				this.imageIndex = 0;
				this.images = [];

				this.resize();
			};

			MCanvasColumn.prototype.resize = function() {
				this.width = Math.floor(this.main.width / this.main.nColumns);
				this.height = this.main.height;
				this.offset = this.index * this.width;
			};

			MCanvasColumn.prototype.needsImage = function() {
				var offset = this.getEndOffset();
				return offset <= this.main.visibleBottom;
			}

			MCanvasColumn.prototype.getEndOffset = function() {
				if( this.images.length <= 0 ) {
					return this.main.visibleTop;
				}
				var lastImage = this.images[this.images.length - 1];
				return lastImage.offset + lastImage.height;
			};

			MCanvasColumn.prototype.addImage = function(img, extra) {
				var offset = this.getEndOffset();
				var i = this.imageIndex++;
				var image = new MCanvasImage(this, img, extra, i);
				this.images.push(image);
				image.offset = offset;
			};

			MCanvasColumn.prototype.draw = function() {
				for( var i = 0; i < this.images.length; i++ ) {
					this.images[i].draw();
				}
			};

			MCanvasColumn.prototype.transform = function() {
				for( var i = 0; i < this.images.length; i++ ) {
					this.images[i].offset -= this.main.deltaPixels;
				}
			};

			var MCanvasMain = function(options) {
				this.$container = options.container;
				this.generator = options.generator;

				// Speed should be in pixels/second
				this.speed = (options && options.speed) || 100;
				this.nColumns = (options && options.nColumns) || 6;

				// Make canvas
				this.$canvas = $('<canvas>').appendTo(this.$container);
				this.ctx = this.$canvas[0].getContext('2d');
				this.resize();
				this.currentTranslateY = 0;

				// Setup columns
				this.columns = [];
				for( var i = 0; i < this.nColumns; i++ ) {
					this.columns[i] = new MCanvasColumn(this, i);
				}
			};

			MCanvasMain.prototype.resize = function() {
				var cwidth = this.$container.width();
				var cheight = this.$container.height();
				var extendFactor = 2;
				var clipFactor = 0.2;
				var extendPx = Math.round(cheight * extendFactor);
				var clipPx = Math.round(cheight * clipFactor);

				// Height should be 40% more than container
				this.width = cwidth;
				this.height = Math.round(cheight + (extendPx * 2));

				// Set the margin top to negative
				this.marginTop = - extendPx;

				// Set the props
				this.$canvas
					.width(this.width)
					.height(this.height)
					.prop('width', this.width)
					.prop('height', this.height)
					.css('margin-top', this.marginTop + 'px');

				// Make visible area - go for about 20% for now
				this.visibleTop = clipPx;
				this.visibleBottom = this.height - clipPx;

				console.log(extendPx, clipPx, this.width, this.height, this.marginTop, this.visibleTop, this.visibleBottom);
				// @todo resize columns
			};

			MCanvasMain.prototype.loop = function() {
				this.calcDelta();
				this.fillColumns();
				this.transform();
				this.draw();
			};

			MCanvasMain.prototype.calcDelta = function() {
				// Delta time
				var now = Date.now();
				if( this.lastTs ) {
					this.deltaTs = now - this.lastTs;
				} else {
					this.deltaTs = 0;
				}
				this.lastTs = now;

				// Delta pixels
				this.deltaPixels = Math.round(this.deltaTs * this.speed / 1000);
			}

			MCanvasMain.prototype.fillColumns = function() {
				var i;
				for( i = 0; i < this.nColumns; i++ ) {
					var col = this.columns[i];
					var img;
					if( col.needsImage() ) {
						img = this.generator.consume();
						if( img ) {
							col.addImage(img[0], img[1]);
						}
					}
				}
			};

			MCanvasMain.prototype.transform = function() {
				// Shift entire canvas
				this.ctx.save();
				this.ctx.translate(0, -this.deltaPixels);
				this.ctx.drawImage(this.$canvas[0], 0, 0);
				this.ctx.restore();

				this.currentTranslateY += -this.deltaPixels;

				// Transform the models
				for( var i = 0; i < this.nColumns; i++ ) {
					this.columns[i].transform();
					//this.columns[i].offset += this.deltaPixels
				}
			};

			MCanvasMain.prototype.draw = function() {
				for( var i = 0; i < this.nColumns; i++ ) {
					this.columns[i].draw();
				}

				// Draw lines for the visible area (debug)
				/*
				var ctx = this.ctx;
				ctx.beginPath();
				ctx.moveTo(0, this.visibleTop);
				ctx.lineTo(this.width, this.visibleTop);
				ctx.lineWidth = 1;
				ctx.strokeStyle = '#ff0000';
				ctx.stroke();

				ctx.beginPath();
				ctx.moveTo(0, this.visibleBottom);
				ctx.lineTo(this.width, this.visibleBottom);
				ctx.lineWidth = 1;
				ctx.strokeStyle = '#ff0000';
				ctx.stroke();
				*/
			};
		</script>

		<script type="text/javascript">
			var generator;
			var mainMs = 10;
			var mainInterval;
			var mCanvas;

			function mainLoop() {
				mCanvas.loop();
			}

			function start() {
				if( mainInterval ) {
					return;
				}
				mainInterval = setInterval(mainLoop, mainMs);
			}

			function stop() {
				if( !mainInterval ) {
					return;
				}
				clearInterval(mainInterval);
				mainInterval = undefined;
			}

			function onReady() {
				generator = new VidmeImageGenerator();
				mCanvas = new MCanvasMain({
					container : $('#container'),
					generator : generator,
					speed : 200
				});
				$(window).on('resize', function() {
					mCanvas.resize();
				});
				/* setInterval(function() {
					var images = generator.consume();
					console.log(images, generator.images.length);
				}, 500); */
				start();
				console.log('ok');
			}

			$(onReady);
		</script>
	</head>
	<body>
		<div id="container">

		</div>
	</body>
</html>


text:
package fasttemplate

import (
	"bytes"
	"fmt"
	"io"
	"sync"
)

// Template implements simple template engine, which can be used for fast
// tags' (aka placeholders) substitution.
type Template struct {
	texts           [][]byte
	tags            []string
	bytesBufferPool sync.Pool
}

// New parses the given template using the given startTag and endTag
// as tag start and tag end.
//
// The returned template can be executed by concurrently running goroutines
// using Execute* methods.
//
// New panics if the given template cannot be parsed. Use NewTemplate instead
// if template may contain errors.
func New(template, startTag, endTag string) *Template {
	t, err := NewTemplate(template, startTag, endTag)
	if err != nil {
		panic(err)
	}
	return t
}

// NewTemplate parses the given template using the given startTag and endTag
// as tag start and tag end.
//
// The returned template can be executed by concurrently running goroutines
// using Execute* methods.
func NewTemplate(template, startTag, endTag string) (*Template, error) {
	var t Template

	if len(startTag) == 0 {
		panic("startTag cannot be empty")
	}
	if len(endTag) == 0 {
		panic("endTag cannot be empty")
	}

	s := []byte(template)
	a := []byte(startTag)
	b := []byte(endTag)

	for {
		n := bytes.Index(s, a)
		if n < 0 {
			t.texts = append(t.texts, s)
			break
		}
		t.texts = append(t.texts, s[:n])

		s = s[n+len(a):]
		n = bytes.Index(s, b)
		if n < 0 {
			return nil, fmt.Errorf("Cannot find end tag=%q in the template=%q starting from %q", endTag, template, s)
		}

		t.tags = append(t.tags, string(s[:n]))
		s = s[n+len(b):]
	}

	t.bytesBufferPool.New = newBytesBuffer
	return &t, nil
}

func newBytesBuffer() interface{} {
	return &bytes.Buffer{}
}

// TagFunc can be used as a substitution value in the map passed to Execute*.
// Execute* functions pass tag (placeholder) name in 'tag' argument.
//
// TagFunc must be safe to call from concurrently running goroutines.
//
// TagFunc must write contents to w and return the number of bytes written.
type TagFunc func(w io.Writer, tag string) (int, error)

// ExecuteFunc calls f on each template tag (placeholder) occurrence.
//
// Returns the number of bytes written to w.
func (t *Template) ExecuteFunc(w io.Writer, f TagFunc) (int64, error) {
	var nn int64

	n := len(t.texts) - 1
	for i := 0; i < n; i++ {
		ni, err := w.Write(t.texts[i])
		if err != nil {
			return nn, err
		}
		nn += int64(ni)

		if ni, err = f(w, t.tags[i]); err != nil {
			return nn, err
		}
		nn += int64(ni)
	}
	ni, err := w.Write(t.texts[n])
	if err != nil {
		return nn, err
	}
	nn += int64(ni)
	return nn, nil
}

// Execute substitutes template tags (placeholders) with the corresponding
// values from the map m and writes the result to the given writer w.
//
// Substitution map m may contain values with the following types:
//   * []byte - the fastest value type
//   * string - convenient value type
//   * TagFunc - flexible value type
//
// Returns the number of bytes written to w.
func (t *Template) Execute(w io.Writer, m map[string]interface{}) (int64, error) {
	return t.ExecuteFunc(w, func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) })
}

// ExecuteFuncString call f on each template tag (placeholder) occurrence
// and substitutes it with the data written to TagFunc's w.
//
// Returns the resulting string.
func (t *Template) ExecuteFuncString(f TagFunc) string {
	w := t.bytesBufferPool.Get().(*bytes.Buffer)
	if _, err := t.ExecuteFunc(w, f); err != nil {
		panic(fmt.Sprintf("unexpected error: %s", err))
	}
	s := string(w.Bytes())
	w.Reset()
	t.bytesBufferPool.Put(w)
	return s
}

// ExecuteString substitutes template tags (placeholders) with the corresponding
// values from the map m and returns the result.
//
// Substitution map m may contain values with the following types:
//   * []byte - the fastest value type
//   * string - convenient value type
//   * TagFunc - flexible value type
//
func (t *Template) ExecuteString(m map[string]interface{}) string {
	return t.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) })
}

func stdTagFunc(w io.Writer, tag string, m map[string]interface{}) (int, error) {
	v := m[tag]
	if v == nil {
		return 0, nil
	}
	switch value := v.(type) {
	case []byte:
		return w.Write(value)
	case string:
		return w.Write([]byte(value))
	case TagFunc:
		return value(w, tag)
	default:
		panic(fmt.Sprintf("tag=%q contains unexpected value type=%#v. Expected []byte, string or TagFunc", tag, v))
	}
}


text:
<?php
namespace Ilios\WebBundle\Tests\DependencyInjection;

use Ilios\WebBundle\DependencyInjection\Configuration;
use Matthias\SymfonyConfigTest\PhpUnit\AbstractConfigurationTestCase;

class ConfigurationTest extends AbstractConfigurationTestCase
{
    protected function getConfiguration()
    {
        return new Configuration();
    }

    public function testSettingValues()
    {
        $faker = \Faker\Factory::create();
        $values = array(
            'frontend_release_version' => $faker->sha256,
            'keep_frontend_updated' => true,
        );
        $this->assertProcessedConfigurationEquals(
            array($values),
            $values
        );
    }

    public function testDefaultValues()
    {
        $defaults = array(
            'keep_frontend_updated' => true,
            'frontend_release_version' => '',
        );
        $this->assertProcessedConfigurationEquals(
            array(),
            $defaults
        );
    }
}


text:
<?xml version="1.0"?>
<NativeLibraries>
	<Linux32><Path>lib/vrpn/native</Path></Linux32>
	<Linux64><Path>lib/vrpn/native/linux64</Path></Linux64>
	<MacOSX><Path>lib/vrpn/native</Path></MacOSX>
	<Win32><Path>lib/vrpn/native</Path></Win32>
	<Win64><Path>lib/vrpn/native/win64</Path></Win64>
</NativeLibraries>


text:
#pragma once

#include <stdbool.h>
#include <stdlib.h>

struct config;
struct _cjose_jwk_int;
struct signer {
  char *issuer;
  struct _cjose_jwk_int *jwk;
  char *alg;
};

struct config *read_config_from_path(const char *const path);
struct config *read_config_from_string(const char *const buffer);
void config_delete(struct config *g);
struct signer *config_signer(struct config *);
struct _cjose_jwk_int **find_keys(struct config *cfg, const char *issuer);
struct _cjose_jwk_int *find_key_by_kid(struct config *cfg, const char *issuer, const char *kid);
bool uri_matches_auth_directive(struct config *cfg, const char *uri, size_t uri_ct);
const char *config_get_id(struct config *cfg);
bool config_strip_token(struct config *cfg);


text:
#ifndef _SCRYPT_PICK_PARAMS_H_
#define _SCRYPT_PICK_PARAMS_H_

NAN_METHOD(CreateParameterFunction);
//Handle<Value> CreateParameterFunction(const Arguments&);

#endif /*_SCRYPT_PICK_PARAMS_H_*/


text:
var controllers = angular.module('app.controllers');

/**
 * Signin controller.
 */
controllers.controller('UserController', [ '$rootScope', '$scope', '$location', 'User', '$translate',
    function($rootScope, $scope, $location, User, $translate) {

        $scope.signin = function(viewLocation) {
            if ($scope.user == null) {
                $scope.errorMessage = $translate.instant('SIGNIN_LOGIN_ERROR_MESSAGE');
            } else {
                console.log("Login user (username: %s) with password (password: %s)", $scope.user.username, $scope.user.password);
                $scope.isSaving = true;
                User.authenticate({username: $scope.user.username, password: $scope.user.password}, function(data, status) {
                    console.log("User auth success! data: %o, status: %o", data, status);
                    // get user profile info
                    User.get({username: $scope.user.username}, function(data, status) {
                        console.log("User get success! data: %o, status: %o", data, status);
                        $rootScope.loggedUser = data;

                        //$window.location.href = $rootScope.appBaseUrl+"webapp#/tasks";
                    }, function(data, status) {
                        console.log("Auth error! data: %o, status: %o", data, status);
                        $scope.user = {};
                        $scope.isSaving = false;
                    });
                }, function(data, status) {
                    console.log("User auth error! data: %o, status: %o", data, status);
                    $scope.isSaving = false;
                });
            }
        }
    }
]);


text:
[Project 1 Title](/sample_page)

---
[Project 2 Title](/pdf/sample_presentation.pdf)

---
[Project 3 Title](http://example.com/)

---

### Category Name 2

- [Project 1 Title](http://example.com/)
- [Project 2 Title](http://example.com/)
- [Project 3 Title](http://example.com/)
- [Project 4 Title](http://example.com/)
- [Project 5 Title](http://example.com/)

---

---

Page template forked from evanca


text:
import os
import shutil
import urllib
import idiokit
import unittest
import tempfile
from idiokit import socket
from idiokit.socket import SocketTimeout
from idiokit.http.server import ConnectionLost

from ..client import Client, HTTPUnixAdapter

@idiokit.stream
def serve(test_string, sock):
    conn, _ = yield sock.accept()
    try:
        request = ""
        while True:
            data = yield conn.recv(1024)
            if not data:
                raise RuntimeError("not enough data")

            request += data
            if "\r\n\r\n" in request:
                break

        yield conn.sendall("HTTP/1.0 200 OK\r\n")
        yield conn.sendall("\r\n")
        yield conn.sendall(test_string)
    finally:
        yield conn.close()

@idiokit.stream
def serve_simulate_timeout_start(sock):
    conn, _ = yield sock.accept()
    try:
        while True:
            yield idiokit.sleep(1.0)
    finally:
        yield conn.close()

@idiokit.stream
def serve_simulate_timeout_body(sock):
    conn, _ = yield sock.accept()
    try:
        request = ""
        while True:
            data = yield conn.recv(1024)
            if not data:
                raise RuntimeError("not enough data")

            request += data
            if "\r\n\r\n" in request:
                break

        yield conn.sendall("HTTP/1.0 200 OK\r\n")
        yield conn.sendall("Content-Length: 1024\r\n")
        yield conn.sendall("\r\n")
    finally:
        yield conn.close()

@idiokit.stream
def get(client, url):
    request = yield client.request("GET", url)
    response = yield request.finish()

    result = ""
    while True:
        data = yield response.read(1024)
        if not data:
            break
        result += data
    idiokit.stop(result)

class TestClient(unittest.TestCase):
    def test_http_client_user_agent(self):
        client = Client(user_agent="Test Agent")
        self.assertEqual(
            client.user_agent,
            "Test Agent idiokit/{0}".format(idiokit.__version__)
        )

    def test_http_adapter(self):
        @idiokit.stream
        def main(test_string, client):
            s = socket.Socket(socket.AF_INET)
            try:
                yield s.bind(("127.0.0.1", 0))
                yield s.listen(1)

                _, port = yield s.getsockname()
                result = yield serve(test_string, s) | get(client, "http://127.0.0.1:{0}/".format(port))
            finally:
                yield s.close()
            idiokit.stop(result)

        client = Client()
        self.assertEqual("this is a test", idiokit.main_loop(main("this is a test", client)))

    def test_http_unix_adapter(self):
        @idiokit.stream
        def main(test_string, client):
            s = socket.Socket(socket.AF_UNIX)
            try:
                tmpdir = tempfile.mkdtemp()
                try:
                    # Ensure that the path contains both upper and lower case
                    # characters to test case-sensitivity.
                    path = os.path.join(tmpdir, "socket.SOCKET")
                    url = "http+unix://{0}".format(urllib.quote(path, ""))

                    yield s.bind(path)
                    yield s.listen(1)
                    result = yield serve(test_string, s) | get(client, url)
                finally:
                    shutil.rmtree(tmpdir)
            finally:
                yield s.close()
            idiokit.stop(result)

        client = Client()
        client.mount("http+unix://", HTTPUnixAdapter())
        self.assertEqual("this is a test", idiokit.main_loop(main("this is a test", client)))

    def test_http_timeout_start(self):
        @idiokit.stream
        def main(client):
            s = socket.Socket(socket.AF_INET)
            try:
                yield s.bind(("127.0.0.1", 0))
                yield s.listen(1)

                _, port = yield s.getsockname()
                result = yield serve_simulate_timeout_start(s) | get(client, "http://127.0.0.1:{0}/".format(port))
            finally:
                yield s.close()
            idiokit.stop(result)

        client = Client(timeout=5.0)
        self.assertRaises(SocketTimeout, idiokit.main_loop, main(client))

    def test_http_timeout_body(self):
        @idiokit.stream
        def main(client):
            s = socket.Socket(socket.AF_INET)
            try:
                yield s.bind(("127.0.0.1", 0))
                yield s.listen(1)

                _, port = yield s.getsockname()
                result = yield serve_simulate_timeout_body(s) | get(client, "http://127.0.0.1:{0}/".format(port))
            finally:
                yield s.close()
            idiokit.stop(result)

        client = Client(timeout=5.0)
        self.assertRaises(ConnectionLost, idiokit.main_loop, main(client))


text:
<?php

namespace Gradwell\ConsoleDisplayLib;

class StdOutTest extends \PHPUnit_Framework_TestCase
{
        public function testUsesStreamOutput()
        {
                $stdout = new StdOut();
                $this->assertTrue ($stdout->outputEngine instanceof StreamOutput);
        }
}


text:
import { useState } from 'react';

import { c } from 'ttag';

import { Button, Icon, SettingsLink } from '@proton/components';
import { APPS } from '@proton/shared/lib/constants';

import { useReloadMessage } from '../../../hooks/message/useLoadMessage';
import { MessageErrors, MessageState } from '../../../logic/messages/messagesTypes';

const getTranslations = (key: keyof MessageErrors, alreadyTried: boolean) => {
    switch (key) {
        case 'network':
            return c('Error').t`Network error: Please check your connection and try again.`;
        case 'decryption':
            return alreadyTried
                ? c('Error').t`Sorry, Proton can't decrypt your message. Please check that all your keys are active.`
                : c('Error').t`Decryption error: decryption of this message's encrypted content failed.`;
        case 'processing':
            return c('Error').t`Message processing error.`;
        case 'signature':
            return c('Error').t`Signature verification error.`;
        default:
            return c('Error').t`Unknown error.`;
    }
};

interface Props {
    message: MessageState;
}

const ExtraErrors = ({ message }: Props) => {
    const reloadMessage = useReloadMessage(message.localID);

    const [alreadyTried, setAlreadyTried] = useState(false);

    const errorTypes = (Object.keys(message.errors || {}) as (keyof MessageErrors)[]).filter(
        (type) => message.errors?.[type]?.length
    );

    if (errorTypes.length === 0) {
        return null;
    }

    const handleReload = () => {
        void reloadMessage();
        setAlreadyTried(true);
    };

    // Using a Fragment here, is only to satisfy TS :(
    return (
        <>
            {errorTypes.map((errorType) => {
                const showReload = errorType === 'network' || (errorType === 'decryption' && !alreadyTried);
                const showKeysLink = errorType === 'decryption' && alreadyTried;

                return (

                            <Icon
                                name="exclamation-circle-filled"
                                className="flex-item-noshrink mt0-4 ml0-2 color-danger"
                            />

                                {getTranslations(errorType, alreadyTried)}

                        {showReload && (

                                <Button
                                    size="small"
                                    color="weak"
                                    shape="outline"
                                    fullWidth
                                    className="rounded-sm"
                                    onClick={handleReload}
                                >{c('Action').t`Try again`}</Button>

                        )}
                        {showKeysLink && (

                                <SettingsLink
                                    path="/encryption-keys"
                                    app={APPS.PROTONMAIL}
                                    className="text-underline color-inherit on-mobile-w100"
                                >
                                    {c('Action').t`View keys`}
                                </SettingsLink>

                        )}

                );
            })}
        </>
    );
};

export default ExtraErrors;


text:
<component name="libraryTable">
  <library name="SBT: com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.4:jar">
    <CLASSES>
      <root url="jar://$USER_HOME$/.ivy2/cache/com.fasterxml.jackson.module/jackson-module-scala_2.10/bundles/jackson-module-scala_2.10-2.4.4.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$USER_HOME$/.ivy2/cache/com.fasterxml.jackson.module/jackson-module-scala_2.10/docs/jackson-module-scala_2.10-2.4.4-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$USER_HOME$/.ivy2/cache/com.fasterxml.jackson.module/jackson-module-scala_2.10/srcs/jackson-module-scala_2.10-2.4.4-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
// Copyright 2017 Archos SA
//
// 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.archos.mediacenter.utils;

public class ThumbnailRequest {

	/**
	 * Position in the ListView (or GridView)
	 */
	private final int mListPosition;

	/**
	 * The ID in the Media database. -1 if not in the Media database
	 */
	private final long mMediaDbId;

	public ThumbnailRequest(int listPosition, long mediaDbId) {
		mListPosition = listPosition;
		mMediaDbId = mediaDbId;
	}

	public int getListPosition() {
		return mListPosition;
	}
	public long getMediaDbId() {
		return mMediaDbId;
	}

	/**
	 * @return the key to be used for storing / getting pooled results from thumb engine
	 */
	public Object getKey() {
	    return Long.valueOf(mMediaDbId);
	}

	@Override
	public String toString() {
		return ("("+mListPosition+"/"+mMediaDbId+")");
	}
}


text:
using Microsoft.Extensions.DependencyInjection;
using Robot.Middleware;
using System;
using System.Linq;

namespace Robot.Extensions
{
    internal class MiddlewareBuilder : IMiddlewareBuilder
    {
        private readonly IServiceCollection Services;

        public MiddlewareBuilder(IServiceCollection services)
            => Services = services;

        public IMiddlewareBuilder AddMiddleware<TMiddleware>()
        {
            return AddMiddleware(typeof(TMiddleware));
        }

        public IMiddlewareBuilder AddMiddleware(Type middlewareType)
        {
            if (!middlewareType.GetInterfaces().Any(x => x.GetGenericTypeDefinition().IsAssignableFrom(typeof(IMiddleware<>))))
                throw new ArgumentException("Can't use that as middleware");

            Services.AddScoped(typeof(IMiddleware), middlewareType);

            return this;
        }
    }
}


text:
Hiera Simulator Limitations
===========================

I am aware of these limitations, which exist because I do not have an appropriate setup for testing, and/or there was not a need to address them in my use case. I welcome contributions compatible with the Apache 2.0 license to improve any or all of the following:

- Limited backend support for Hiera. Only these Hiera backends are supported:
  - JSON
  - YAML

  If you're using something else (CouchDB, MySQL, Postgres, DynamoDB, PuppetDB, or anything else you might think of to use as a Hiera backend) this Hiera simulator currently does not support you.

- Hiera version. By default it will pull the latest version of Hiera. If you need hiera version 1, you may wish to run this with:

  ```
  BUNDLE_GEMFILE=Gemfile.hiera1 bundle exec bin/hiera-simulator ...
  ```

  Currently it should work correctly with Hiera 1.3.4 and the latest version of Hiera (3.1.1 as of the time of this writing). Please file an issue if it does not.


text:
package apps.dipoareoye.impact.ui.views;

import java.util.List;

import apps.dipoareoye.impact.entities.NewsArticle;

/**
 * Created by dipoareoye on 22/05/2016.
 */
public interface NewsListView {

    void setArticles(List<NewsArticle> articles);

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Anal. Soc. cient. argent. 26: 31 (1888)

#### Original name
Hypoxylon latissimum Speg., 1888

### Remarks
null


text:
package metadata

import (
	"bytes"
	"context"
	"fmt"
	"strings"
	"time"

	"github.com/containerd/containerd/gc"
	"github.com/containerd/containerd/log"
	"github.com/pkg/errors"
	bolt "go.etcd.io/bbolt"
)

const (
	// ResourceUnknown specifies an unknown resource
	ResourceUnknown gc.ResourceType = iota
	// ResourceContent specifies a content resource
	ResourceContent
	// ResourceSnapshot specifies a snapshot resource
	ResourceSnapshot
	// ResourceContainer specifies a container resource
	ResourceContainer
	// ResourceTask specifies a task resource
	ResourceTask
	// ResourceLease specifies a lease
	ResourceLease
	// ResourceIngest specifies a content ingest
	ResourceIngest
)

var (
	labelGCRoot       = []byte("containerd.io/gc.root")
	labelGCSnapRef    = []byte("containerd.io/gc.ref.snapshot.")
	labelGCContentRef = []byte("containerd.io/gc.ref.content")
	labelGCExpire     = []byte("containerd.io/gc.expire")
)

func scanRoots(ctx context.Context, tx *bolt.Tx, nc chan<- gc.Node) error {
	v1bkt := tx.Bucket(bucketKeyVersion)
	if v1bkt == nil {
		return nil
	}

	expThreshold := time.Now()

	// iterate through each namespace
	v1c := v1bkt.Cursor()

	for k, v := v1c.First(); k != nil; k, v = v1c.Next() {
		if v != nil {
			continue
		}
		nbkt := v1bkt.Bucket(k)
		ns := string(k)

		lbkt := nbkt.Bucket(bucketKeyObjectLeases)
		if lbkt != nil {
			if err := lbkt.ForEach(func(k, v []byte) error {
				if v != nil {
					return nil
				}
				libkt := lbkt.Bucket(k)

				if lblbkt := libkt.Bucket(bucketKeyObjectLabels); lblbkt != nil {
					if expV := lblbkt.Get(labelGCExpire); expV != nil {
						exp, err := time.Parse(time.RFC3339, string(expV))
						if err != nil {
							// label not used, log and continue to use lease
							log.G(ctx).WithError(err).WithField("lease", string(k)).Infof("ignoring invalid expiration value %q", string(expV))
						} else if expThreshold.After(exp) {
							// lease has expired, skip
							return nil
						}
					}
				}

				select {
				case nc <- gcnode(ResourceLease, ns, string(k)):
				case <-ctx.Done():
					return ctx.Err()
				}

				// Emit content and snapshots as roots instead of implementing
				// in references. Since leases cannot be referenced there is
				// no need to allow the lookup to be recursive, handling here
				// therefore reduces the number of database seeks.

				cbkt := libkt.Bucket(bucketKeyObjectContent)
				if cbkt != nil {
					if err := cbkt.ForEach(func(k, v []byte) error {
						select {
						case nc <- gcnode(ResourceContent, ns, string(k)):
						case <-ctx.Done():
							return ctx.Err()
						}
						return nil
					}); err != nil {
						return err
					}
				}

				sbkt := libkt.Bucket(bucketKeyObjectSnapshots)
				if sbkt != nil {
					if err := sbkt.ForEach(func(sk, sv []byte) error {
						if sv != nil {
							return nil
						}
						snbkt := sbkt.Bucket(sk)

						return snbkt.ForEach(func(k, v []byte) error {
							select {
							case nc <- gcnode(ResourceSnapshot, ns, fmt.Sprintf("%s/%s", sk, k)):
							case <-ctx.Done():
								return ctx.Err()
							}
							return nil
						})
					}); err != nil {
						return err
					}
				}

				ibkt := libkt.Bucket(bucketKeyObjectIngests)
				if ibkt != nil {
					if err := ibkt.ForEach(func(k, v []byte) error {
						select {
						case nc <- gcnode(ResourceIngest, ns, string(k)):
						case <-ctx.Done():
							return ctx.Err()
						}
						return nil
					}); err != nil {
						return err
					}
				}

				return nil
			}); err != nil {
				return err
			}
		}

		ibkt := nbkt.Bucket(bucketKeyObjectImages)
		if ibkt != nil {
			if err := ibkt.ForEach(func(k, v []byte) error {
				if v != nil {
					return nil
				}

				target := ibkt.Bucket(k).Bucket(bucketKeyTarget)
				if target != nil {
					contentKey := string(target.Get(bucketKeyDigest))
					select {
					case nc <- gcnode(ResourceContent, ns, contentKey):
					case <-ctx.Done():
						return ctx.Err()
					}
				}
				return sendSnapshotRefs(ns, ibkt.Bucket(k), func(n gc.Node) {
					select {
					case nc <- n:
					case <-ctx.Done():
					}
				})
			}); err != nil {
				return err
			}
		}

		cbkt := nbkt.Bucket(bucketKeyObjectContent)
		if cbkt != nil {
			ibkt := cbkt.Bucket(bucketKeyObjectIngests)
			if ibkt != nil {
				if err := ibkt.ForEach(func(k, v []byte) error {
					if v != nil {
						return nil
					}
					ea, err := readExpireAt(ibkt.Bucket(k))
					if err != nil {
						return err
					}
					if ea == nil || expThreshold.After(*ea) {
						return nil
					}
					select {
					case nc <- gcnode(ResourceIngest, ns, string(k)):
					case <-ctx.Done():
						return ctx.Err()
					}
					return nil
				}); err != nil {
					return err
				}
			}
			cbkt = cbkt.Bucket(bucketKeyObjectBlob)
			if cbkt != nil {
				if err := cbkt.ForEach(func(k, v []byte) error {
					if v != nil {
						return nil
					}
					return sendRootRef(ctx, nc, gcnode(ResourceContent, ns, string(k)), cbkt.Bucket(k))
				}); err != nil {
					return err
				}
			}
		}

		cbkt = nbkt.Bucket(bucketKeyObjectContainers)
		if cbkt != nil {
			if err := cbkt.ForEach(func(k, v []byte) error {
				if v != nil {
					return nil
				}
				snapshotter := string(cbkt.Bucket(k).Get(bucketKeySnapshotter))
				if snapshotter != "" {
					ss := string(cbkt.Bucket(k).Get(bucketKeySnapshotKey))
					select {
					case nc <- gcnode(ResourceSnapshot, ns, fmt.Sprintf("%s/%s", snapshotter, ss)):
					case <-ctx.Done():
						return ctx.Err()
					}
				}

				// TODO: Send additional snapshot refs through labels
				return sendSnapshotRefs(ns, cbkt.Bucket(k), func(n gc.Node) {
					select {
					case nc <- n:
					case <-ctx.Done():
					}
				})
			}); err != nil {
				return err
			}
		}

		sbkt := nbkt.Bucket(bucketKeyObjectSnapshots)
		if sbkt != nil {
			if err := sbkt.ForEach(func(sk, sv []byte) error {
				if sv != nil {
					return nil
				}
				snbkt := sbkt.Bucket(sk)

				return snbkt.ForEach(func(k, v []byte) error {
					if v != nil {
						return nil
					}

					return sendRootRef(ctx, nc, gcnode(ResourceSnapshot, ns, fmt.Sprintf("%s/%s", sk, k)), snbkt.Bucket(k))
				})
			}); err != nil {
				return err
			}
		}
	}
	return nil
}

func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node)) error {
	if node.Type == ResourceContent {
		bkt := getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectContent, bucketKeyObjectBlob, []byte(node.Key))
		if bkt == nil {
			// Node may be created from dead edge
			return nil
		}

		if err := sendSnapshotRefs(node.Namespace, bkt, fn); err != nil {
			return err
		}
		return sendContentRefs(node.Namespace, bkt, fn)
	} else if node.Type == ResourceSnapshot {
		parts := strings.SplitN(node.Key, "/", 2)
		if len(parts) != 2 {
			return errors.Errorf("invalid snapshot gc key %s", node.Key)
		}
		ss := parts[0]
		name := parts[1]

		bkt := getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectSnapshots, []byte(ss), []byte(name))
		if bkt == nil {
			getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectSnapshots).ForEach(func(k, v []byte) error {
				return nil
			})

			// Node may be created from dead edge
			return nil
		}

		if pv := bkt.Get(bucketKeyParent); len(pv) > 0 {
			fn(gcnode(ResourceSnapshot, node.Namespace, fmt.Sprintf("%s/%s", ss, pv)))
		}

		return sendSnapshotRefs(node.Namespace, bkt, fn)
	} else if node.Type == ResourceIngest {
		// Send expected value
		bkt := getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectContent, bucketKeyObjectIngests, []byte(node.Key))
		if bkt == nil {
			// Node may be created from dead edge
			return nil
		}
		// Load expected
		expected := bkt.Get(bucketKeyExpected)
		if len(expected) > 0 {
			fn(gcnode(ResourceContent, node.Namespace, string(expected)))
		}
		return nil
	}

	return nil
}

func scanAll(ctx context.Context, tx *bolt.Tx, fn func(ctx context.Context, n gc.Node) error) error {
	v1bkt := tx.Bucket(bucketKeyVersion)
	if v1bkt == nil {
		return nil
	}

	// iterate through each namespace
	v1c := v1bkt.Cursor()

	for k, v := v1c.First(); k != nil; k, v = v1c.Next() {
		if v != nil {
			continue
		}
		nbkt := v1bkt.Bucket(k)
		ns := string(k)

		lbkt := nbkt.Bucket(bucketKeyObjectLeases)
		if lbkt != nil {
			if err := lbkt.ForEach(func(k, v []byte) error {
				if v != nil {
					return nil
				}
				return fn(ctx, gcnode(ResourceLease, ns, string(k)))
			}); err != nil {
				return err
			}
		}

		sbkt := nbkt.Bucket(bucketKeyObjectSnapshots)
		if sbkt != nil {
			if err := sbkt.ForEach(func(sk, sv []byte) error {
				if sv != nil {
					return nil
				}
				snbkt := sbkt.Bucket(sk)
				return snbkt.ForEach(func(k, v []byte) error {
					if v != nil {
						return nil
					}
					node := gcnode(ResourceSnapshot, ns, fmt.Sprintf("%s/%s", sk, k))
					return fn(ctx, node)
				})
			}); err != nil {
				return err
			}
		}

		cbkt := nbkt.Bucket(bucketKeyObjectContent)
		if cbkt != nil {
			ibkt := cbkt.Bucket(bucketKeyObjectIngests)
			if ibkt != nil {
				if err := ibkt.ForEach(func(k, v []byte) error {
					if v != nil {
						return nil
					}
					node := gcnode(ResourceIngest, ns, string(k))
					return fn(ctx, node)
				}); err != nil {
					return err
				}
			}

			cbkt = cbkt.Bucket(bucketKeyObjectBlob)
			if cbkt != nil {
				if err := cbkt.ForEach(func(k, v []byte) error {
					if v != nil {
						return nil
					}
					node := gcnode(ResourceContent, ns, string(k))
					return fn(ctx, node)
				}); err != nil {
					return err
				}
			}
		}
	}

	return nil
}

func remove(ctx context.Context, tx *bolt.Tx, node gc.Node) error {
	v1bkt := tx.Bucket(bucketKeyVersion)
	if v1bkt == nil {
		return nil
	}

	nsbkt := v1bkt.Bucket([]byte(node.Namespace))
	if nsbkt == nil {
		return nil
	}

	switch node.Type {
	case ResourceContent:
		cbkt := nsbkt.Bucket(bucketKeyObjectContent)
		if cbkt != nil {
			cbkt = cbkt.Bucket(bucketKeyObjectBlob)
		}
		if cbkt != nil {
			log.G(ctx).WithField("key", node.Key).Debug("remove content")
			return cbkt.DeleteBucket([]byte(node.Key))
		}
	case ResourceSnapshot:
		sbkt := nsbkt.Bucket(bucketKeyObjectSnapshots)
		if sbkt != nil {
			parts := strings.SplitN(node.Key, "/", 2)
			if len(parts) != 2 {
				return errors.Errorf("invalid snapshot gc key %s", node.Key)
			}
			ssbkt := sbkt.Bucket([]byte(parts[0]))
			if ssbkt != nil {
				log.G(ctx).WithField("key", parts[1]).WithField("snapshotter", parts[0]).Debug("remove snapshot")
				return ssbkt.DeleteBucket([]byte(parts[1]))
			}
		}
	case ResourceLease:
		lbkt := nsbkt.Bucket(bucketKeyObjectLeases)
		if lbkt != nil {
			return lbkt.DeleteBucket([]byte(node.Key))
		}
	case ResourceIngest:
		ibkt := nsbkt.Bucket(bucketKeyObjectContent)
		if ibkt != nil {
			ibkt = ibkt.Bucket(bucketKeyObjectIngests)
		}
		if ibkt != nil {
			log.G(ctx).WithField("ref", node.Key).Debug("remove ingest")
			return ibkt.DeleteBucket([]byte(node.Key))
		}
	}

	return nil
}

// sendSnapshotRefs sends all snapshot references referred to by the labels in the bkt
func sendSnapshotRefs(ns string, bkt *bolt.Bucket, fn func(gc.Node)) error {
	lbkt := bkt.Bucket(bucketKeyObjectLabels)
	if lbkt != nil {
		lc := lbkt.Cursor()

		for k, v := lc.Seek(labelGCSnapRef); k != nil && strings.HasPrefix(string(k), string(labelGCSnapRef)); k, v = lc.Next() {
			snapshotter := k[len(labelGCSnapRef):]
			if i := bytes.IndexByte(snapshotter, '/'); i >= 0 {
				snapshotter = snapshotter[:i]
			}
			fn(gcnode(ResourceSnapshot, ns, fmt.Sprintf("%s/%s", snapshotter, v)))
		}
	}
	return nil
}

// sendContentRefs sends all content references referred to by the labels in the bkt
func sendContentRefs(ns string, bkt *bolt.Bucket, fn func(gc.Node)) error {
	lbkt := bkt.Bucket(bucketKeyObjectLabels)
	if lbkt != nil {
		lc := lbkt.Cursor()

		labelRef := string(labelGCContentRef)
		for k, v := lc.Seek(labelGCContentRef); k != nil && strings.HasPrefix(string(k), labelRef); k, v = lc.Next() {
			if ks := string(k); ks != labelRef {
				// Allow reference naming separated by . or /, ignore names
				if ks[len(labelRef)] != '.' && ks[len(labelRef)] != '/' {
					continue
				}
			}

			fn(gcnode(ResourceContent, ns, string(v)))
		}
	}
	return nil
}

func isRootRef(bkt *bolt.Bucket) bool {
	lbkt := bkt.Bucket(bucketKeyObjectLabels)
	if lbkt != nil {
		rv := lbkt.Get(labelGCRoot)
		if rv != nil {
			// TODO: interpret rv as a timestamp and skip if expired
			return true
		}
	}
	return false
}

func sendRootRef(ctx context.Context, nc chan<- gc.Node, n gc.Node, bkt *bolt.Bucket) error {
	if isRootRef(bkt) {
		select {
		case nc <- n:
		case <-ctx.Done():
			return ctx.Err()
		}
	}
	return nil
}

func gcnode(t gc.ResourceType, ns, key string) gc.Node {
	return gc.Node{
		Type:      t,
		Namespace: ns,
		Key:       key,
	}
}


text:
using std::lock_guard;
using std::move;
using std::mutex;
using std::unique_lock;

namespace helm {
namespace task {

QueueTaskExecutorService::QueueTaskExecutorService(uint32_t thread_count) :
    _worker_running{true}
{
    for (uint32_t i = 0; i < thread_count; ++i) {
        _worker_threads.emplace_back(&QueueTaskExecutorService::_worker_thread_main, this);
    }
}

QueueTaskExecutorService::~QueueTaskExecutorService()
{
    _worker_running = false;
    _task_available.notify_all();
    for (auto& thread : _worker_threads) {
        thread.join();
    }
}

void QueueTaskExecutorService::execute_task(Task task) const
{
    {
        lock_guard<mutex> _(_task_queue_mutex);
        _task_queue.push(move(task));
    }
    _task_available.notify_one();
}

void QueueTaskExecutorService::_worker_thread_main()
{
    while (_worker_running) {
        Task to_execute;
        {
            unique_lock<mutex> l(_task_queue_mutex);
            _task_available.wait(l, [this]() { return !_task_queue.empty() || !_worker_running; });
            if (!_worker_running) {
                return;
            }
            to_execute = move(_task_queue.front());
            _task_queue.pop();
        }
        to_execute();
    }
}

} // namespace task
} // namespace helm


text:
package org.openstreetmap.wiki.tttbot.output

import org.openstreetmap.wiki.tttbot.config.ColumnConfig
import org.openstreetmap.wiki.tttbot.convert.TableData
import org.openstreetmap.wiki.tttbot.convert.ExtractedData
import scala.xml

/**
 * writes table data to a single HTML table element
 */
class HTMLTableWriter (

	val filters : Seq[TableFilter],

	val tableSummary : String

) extends Writer[xml.Elem] {

	def write(extractedData : ExtractedData) : xml.Elem = {

		throw new Error("unimplemented")

//		//TODO create tableData from extractedData
//
//		val data = TableFilter.filterTable(tableData, filters)
//		val visibleColumns = data.columns.filter(_.visible)
//
//		return

//

 {
//				for (column <- visibleColumns) yield
//					{column.label}
//			}

//
 {
//				for (
//					line <- data.getLines()
//				) yield
//
 {
//						for (column <- visibleColumns; cell = line.values.get(column).get)
//							yield if (cell == null) unknown
//							      else { cell.text }
//					}

//			}

//

	}

}


text:
<!doctype html>

    <meta name="viewport" content="width=device-width, initial-scale=1" />

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

Non Circular

        jCarouselLite carousels are circular by default. You have to explicitly disable circular behavior if you don't want them. Like this.

        ‹

        ›

$(".nonCircular .carousel").jCarouselLite({
    btnNext: ".nonCircular .next",
    btnPrev: ".nonCircular .prev",
    circular: false
});


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Movie;
use DB;

class PageController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //$this->middleware('auth');
    }

    /**
     * Show the home page.
     *
     * @return \Illuminate\Http\Response
     */
    public function home()
    {
        $recents = Movie::orderBy('id')
            ->where('poster', '<>', '', 'and')
            ->where('has_local_poster', true)
            ->orderBy('views', 'desc')
            ->orderBy(\DB::raw('RAND()'))
            ->limit(50)
            ->get();

        return view('pages.home', [
            'recents' => $recents
        ]);
    }

    /**
     * Show the about page.
     *
     * @return \Illuminate\Http\Response
     */
    public function about()
    {
        return view('pages.about');
    }

    /**
     * Show the contact page.
     *
     * @return \Illuminate\Http\Response
     */
    public function contact()
    {
        return view('pages.contact');
    }

    /**
     * Show the privacy page.
     *
     * @return \Illuminate\Http\Response
     */
    public function privacy()
    {
        return view('pages.privacy');
    }
}


text:
dojo.provide("dojox.drawing.util.typeset");
dojo.require("dojox.drawing.library.greek");
// Summary:
//		Singleton used for converting characters and typsetting.  Required by _base.
//
// Description:
//		Eventually, this is supposed to turn input strings of mathematical
//		expressions into typeset expressions that can be displayed on the
//		canvas.  For now, we just generate Greek letters based on LaTeX style
//		entity codes.

(function(){

	var greeks = dojox.drawing.library.greek;

	dojox.drawing.util.typeset = {

		convertHTML: function(inText){
			if(inText){
				return inText.replace(/&([^;]+);/g,function(match,code){
					if(code.charAt(0)=='#'){
						//coerce remainder of string to int
						var number=+code.substr(1);
						if(!isNaN(number)){
							return String.fromCharCode(number);
						}
					}else if(greeks[code]){
						return String.fromCharCode(greeks[code]);
					}
					// This is generally for server code, so there
					// is no point bothering the user in the case of an error.
					console.warn("no HTML conversion for ",match);
					return match;
				});
			}
			return inText;
		},

		convertLaTeX: function(inText){
			// console.log("***** convertLaTeX for ",inText);
			if(inText){
				return inText.replace(/\\([a-zA-Z]+)/g,function(match,word){
					if(greeks[word]){
						return String.fromCharCode(greeks[word]);
					}else if(word.substr(0,2)=="mu"){
						// special handling for \mu since it is
						// a unit prefix for micro.
						return String.fromCharCode(greeks["mu"])+word.substr(2);
					}else if(word.substr(0,5)=="theta"){
						// special handling for \theta since it is
						// a standard prefix for angle associated with a vector.
						return String.fromCharCode(greeks["theta"])+word.substr(5);
					}else if(word.substr(0,3)=="phi"){
						// special handling for \phi since it is
						// a standard prefix for angle associated with a z-axis vector.
						return String.fromCharCode(greeks["phi"])+word.substr(3);
					}
					console.log("no match for ",match," in ",inText);
					console.log("Need user-friendly error handling here!");
				}).replace(/\\\\/g,'\\');
			}
			return inText;
		}

	};

})();