text:
package io

import (
	"encoding/binary"
	"io"

	"gx/ipfs/QmddjPSGZb3ieihSseFeCfVRpZzcqczPNsD2DvarSwnjJB/gogo-protobuf/proto"
)

const uint32BinaryLen = 4

func NewUint32DelimitedWriter(w io.Writer, byteOrder binary.ByteOrder) WriteCloser {
	return &uint32Writer{w, byteOrder, nil, make([]byte, uint32BinaryLen)}
}

func NewSizeUint32DelimitedWriter(w io.Writer, byteOrder binary.ByteOrder, size int) WriteCloser {
	return &uint32Writer{w, byteOrder, make([]byte, size), make([]byte, uint32BinaryLen)}
}

type uint32Writer struct {
	w         io.Writer
	byteOrder binary.ByteOrder
	buffer    []byte
	lenBuf    []byte
}

func (this *uint32Writer) writeFallback(msg proto.Message) error {
	data, err := proto.Marshal(msg)
	if err != nil {
		return err
	}

	length := uint32(len(data))
	this.byteOrder.PutUint32(this.lenBuf, length)
	if _, err = this.w.Write(this.lenBuf); err != nil {
		return err
	}
	_, err = this.w.Write(data)
	return err
}

func (this *uint32Writer) WriteMsg(msg proto.Message) error {
	m, ok := msg.(marshaler)
	if !ok {
		return this.writeFallback(msg)
	}

	n, ok := getSize(m)
	if !ok {
		return this.writeFallback(msg)
	}

	size := n + uint32BinaryLen
	if size > len(this.buffer) {
		this.buffer = make([]byte, size)
	}

	this.byteOrder.PutUint32(this.buffer, uint32(n))
	if _, err := m.MarshalTo(this.buffer[uint32BinaryLen:]); err != nil {
		return err
	}

	_, err := this.w.Write(this.buffer[:size])
	return err
}

func (this *uint32Writer) Close() error {
	if closer, ok := this.w.(io.Closer); ok {
		return closer.Close()
	}
	return nil
}

type uint32Reader struct {
	r         io.Reader
	byteOrder binary.ByteOrder
	lenBuf    []byte
	buf       []byte
	maxSize   int
}

func NewUint32DelimitedReader(r io.Reader, byteOrder binary.ByteOrder, maxSize int) ReadCloser {
	return &uint32Reader{r, byteOrder, make([]byte, 4), nil, maxSize}
}

func (this *uint32Reader) ReadMsg(msg proto.Message) error {
	if _, err := io.ReadFull(this.r, this.lenBuf); err != nil {
		return err
	}
	length32 := this.byteOrder.Uint32(this.lenBuf)
	length := int(length32)
	if length < 0 || length > this.maxSize {
		return io.ErrShortBuffer
	}
	if length >= len(this.buf) {
		this.buf = make([]byte, length)
	}
	_, err := io.ReadFull(this.r, this.buf[:length])
	if err != nil {
		return err
	}
	return proto.Unmarshal(this.buf[:length], msg)
}

func (this *uint32Reader) Close() error {
	if closer, ok := this.r.(io.Closer); ok {
		return closer.Close()
	}
	return nil
}


text:
using Microsoft.Azure.Batch;
using Microsoft.Azure.Batch.Common;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace AzureConnection
{
    public class Pool
    {
        public async Task Create()
        {
            var storageAccount = CloudStorageAccount.Parse(Settings.StorageConnectionString);
            var blobClient = storageAccount.CreateCloudBlobClient();

            const string appContainerName = "application";

            var applicationFilePaths = new List<string>
            {
                typeof(JobApp.Program).Assembly.Location,
                "Microsoft.WindowsAzure.Storage.dll"
            };

            //List<string> inputFilePaths = new List<string>
            //{
            //    @"..\..\taskdata1.txt",
            //    @"..\..\taskdata2.txt",
            //    @"..\..\taskdata3.txt"
            //};

            var applicationFiles = await UploadFilesToContainerAsync(blobClient, appContainerName, applicationFilePaths);
            //List<ResourceFile> inputFiles = await UploadFilesToContainerAsync(blobClient, inputContainerName, inputFilePaths);

            // Obtain a shared access signature that provides write access to the output container to which
            // the tasks will upload their output.
            //var outputContainerSasUrl = GetContainerSasUrl(blobClient, outputContainerName, SharedAccessBlobPermissions.Write);
            using (BatchClient batchClient = BatchClient.Open(Settings.Credentials))
            {
                await CreatePoolIfNotExistAsync(batchClient, Settings.PoolId, applicationFiles);
            }
        }

        public async Task Delete()
        {
            using (var batchClient = BatchClient.Open(Settings.Credentials))
            {
                await batchClient.PoolOperations.DeletePoolAsync(Settings.PoolId);
            }
        }

        private static async Task CreateContainerIfNotExistAsync(CloudBlobClient blobClient, string containerName)
        {
            var container = blobClient.GetContainerReference(containerName);

            if (await container.CreateIfNotExistsAsync())
            {
                Console.WriteLine("Container [{0}] created.", containerName);
            }
            else
            {
                Console.WriteLine("Container [{0}] exists, skipping creation.", containerName);
            }
        }

        private static async Task<List<ResourceFile>> UploadFilesToContainerAsync(CloudBlobClient blobClient, string inputContainerName, List<string> filePaths)
        {
            List<ResourceFile> resourceFiles = new List<ResourceFile>();

            foreach (string filePath in filePaths)
            {
                resourceFiles.Add(await UploadFileToContainerAsync(blobClient, inputContainerName, filePath));
            }

            return resourceFiles;
        }

        private static async Task<ResourceFile> UploadFileToContainerAsync(CloudBlobClient blobClient, string containerName, string filePath)
        {
            Console.WriteLine("Uploading file {0} to container [{1}]...", filePath, containerName);

            string blobName = Path.GetFileName(filePath);

            CloudBlobContainer container = blobClient.GetContainerReference(containerName);
            CloudBlockBlob blobData = container.GetBlockBlobReference(blobName);
            await blobData.UploadFromFileAsync(filePath, FileMode.Open);

            // Set the expiry time and permissions for the blob shared access signature. In this case, no start time is specified,
            // so the shared access signature becomes valid immediately
            SharedAccessBlobPolicy sasConstraints = new SharedAccessBlobPolicy
            {
                SharedAccessExpiryTime = DateTime.UtcNow.AddHours(2),
                Permissions = SharedAccessBlobPermissions.Read
            };

            // Construct the SAS URL for blob
            string sasBlobToken = blobData.GetSharedAccessSignature(sasConstraints);
            string blobSasUri = String.Format("{0}{1}", blobData.Uri, sasBlobToken);

            return new ResourceFile(blobSasUri, blobName);
        }

        private static async Task CreatePoolIfNotExistAsync(BatchClient batchClient, string poolId, IList<ResourceFile> resourceFiles)
        {
            CloudPool pool = null;
            try
            {
                Console.WriteLine("Creating pool [{0}]...", poolId);

                pool = batchClient.PoolOperations.CreatePool(
                    poolId: poolId,
                    targetDedicated: Settings.NofCors,
                    virtualMachineSize: "small",                                                // single-core, 1.75 GB memory, 225 GB disk
                    cloudServiceConfiguration: new CloudServiceConfiguration(osFamily: "4"));   // Windows Server 2012 R2

                pool.StartTask = new StartTask
                {
                    CommandLine = "cmd /c (robocopy %AZ_BATCH_TASK_WORKING_DIR% %AZ_BATCH_NODE_SHARED_DIR%) ^& IF %ERRORLEVEL% LEQ 1 exit 0",
                    ResourceFiles = resourceFiles,
                    WaitForSuccess = true
                };

                await pool.CommitAsync();
            }
            catch (BatchException be)
            {
                if (be.RequestInformation?.BatchError != null && be.RequestInformation.BatchError.Code == BatchErrorCodeStrings.PoolExists)
                {
                    Console.WriteLine("The pool {0} already existed when we tried to create it", poolId);
                }
                else
                {
                    throw;
                }
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.oep.processmgt.service.persistence;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;

import java.io.Serializable;

/**
 * @author trungdk
 * @generated
 */
public class ProcessOrder2UserPK implements Comparable<ProcessOrder2UserPK>,
	Serializable {
	public long processOrderId;
	public long userId;

	public ProcessOrder2UserPK() {
	}

	public ProcessOrder2UserPK(long processOrderId, long userId) {
		this.processOrderId = processOrderId;
		this.userId = userId;
	}

	public long getProcessOrderId() {
		return processOrderId;
	}

	public void setProcessOrderId(long processOrderId) {
		this.processOrderId = processOrderId;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	@Override
	public int compareTo(ProcessOrder2UserPK pk) {
		if (pk == null) {
			return -1;
		}

		int value = 0;

		if (processOrderId < pk.processOrderId) {
			value = -1;
		}
		else if (processOrderId > pk.processOrderId) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		if (userId < pk.userId) {
			value = -1;
		}
		else if (userId > pk.userId) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (!(obj instanceof ProcessOrder2UserPK)) {
			return false;
		}

		ProcessOrder2UserPK pk = (ProcessOrder2UserPK)obj;

		if ((processOrderId == pk.processOrderId) && (userId == pk.userId)) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return (String.valueOf(processOrderId) + String.valueOf(userId)).hashCode();
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(10);

		sb.append(StringPool.OPEN_CURLY_BRACE);

		sb.append("processOrderId");
		sb.append(StringPool.EQUAL);
		sb.append(processOrderId);

		sb.append(StringPool.COMMA);
		sb.append(StringPool.SPACE);
		sb.append("userId");
		sb.append(StringPool.EQUAL);
		sb.append(userId);

		sb.append(StringPool.CLOSE_CURLY_BRACE);

		return sb.toString();
	}
}


text:
package com.vmware.vim25;

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

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

 * <complexType name="CustomizationIpV6Generator">
 *   <complexContent>
 *     <extension base="{urn:vim25}DynamicData">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomizationIpV6Generator")
@XmlSeeAlso({
    CustomizationCustomIpV6Generator.class,
    CustomizationStatelessIpV6Generator.class,
    CustomizationUnknownIpV6Generator.class,
    CustomizationFixedIpV6 .class,
    CustomizationDhcpIpV6Generator.class,
    CustomizationAutoIpV6Generator.class
})
public class CustomizationIpV6Generator
    extends DynamicData
{

}


text:
package debop4k.data.orm.hibernate.dao;

import debop4k.core.asyncs.Asyncx;
import lombok.Getter;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import nl.komponents.kovenant.Promise;
import org.hibernate.Session;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Projections;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.concurrent.Callable;

/**
 * Hibernate 는 기본적으로 Thread-safe 하지 않지만, 성능을 위해 새로운 Session을 만들어 부가 정보를 얻을 수 있도록 합니다.
 *
 * @author sunghyouk.bae@gmail.com
 */
@Slf4j
@Getter
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Transactional
@SuppressWarnings("unchecked")
public class HibernateAsyncDao extends HibernateDao {

  /**
   * 비동기 방식으로 {@link DetachedCriteria} 질의에 해당하는 ROW COUNT 를 구합니다.
   */
  public Promise<Long, Exception> countAsync(@NonNull DetachedCriteria dc) {
    return uniqueResultAsync(dc.setProjection(Projections.rowCount()));
  }

  /**
   * 비동기 방식으로 Criteria#uniqueResult 를 수행합니다.
   */
  public <T> Promise<T, Exception> uniqueResultAsync(@NonNull final DetachedCriteria dc) {

    return Asyncx.future(new Callable<T>() {
      @Override
      public T call() throws Exception {
        Session sess = getSf().openSession();
        try {
          return (T) dc.getExecutableCriteria(sess).uniqueResult();
        } finally {
          sess.close();
        }
      }
    });
  }

}


text:
package com.codiply.barrio.helpers

import java.nio.file.Files
import java.nio.file.Paths

import scopt.OptionParser

import com.codiply.barrio.geometry.Metric

object ArgsConfig {
  val defaultMaxPointsPerLeaf = 128
  val defaultTreesPerNode = 3
}

sealed trait DataSourceType

object DataSourceType {
  case object LocalDataSource extends DataSourceType
  case object WebDataSource extends DataSourceType
  case object S3DataSource extends DataSourceType
}

case class ArgsConfig(
    cache: Boolean = false,
    coordinateSeparator: String = ",",
    dimensions: Int = -1,
    encoding: String = "UTF-8",
    file: String = "",
    separator: String = ":::",
    maxPointsPerLeaf: Int = ArgsConfig.defaultMaxPointsPerLeaf,
    metric: String = Metric.euclidean.name,
    randomSeed: Option[Int] = None,
    s3Bucket: Option[String] = None,
    seedOnlyNode: Boolean = false,
    treesPerNode: Int = ArgsConfig.defaultTreesPerNode,
    isUrl: Boolean = false) {
  import DataSourceType._

  val dataSourceType =
    (isUrl, s3Bucket) match {
      case (true, _) => WebDataSource
      case (_, Some(_)) => S3DataSource
      case _ => LocalDataSource
    }
}

object ArgsParser {
  import DataSourceType._

  private val parser = new OptionParser[ArgsConfig]("barrio") {
    override def showUsageOnError = true

    head("Barrio", VersionHelper.version)

    help("help")
    version("version")

    opt[Unit]("seedOnlyNode")
      .maxOccurs(1)
      .action { (v, conf) => conf.copy(seedOnlyNode = true) }
      .text("flag for making this node act as a seed for the cluster only")

    opt[String]('f', "file")
      .maxOccurs(1)
      .action { (v, conf) => conf.copy(file = v) }
      .text("the path to the input file containing the data points")

    opt[String]("encoding")
      .maxOccurs(1)
      .action { (v, conf) => conf.copy(encoding = v)}
      .text("the encoding to be used when loading the data")

    opt[String]('m', "metric")
      .maxOccurs(1)
      .validate(m =>
          if (Metric.allMetrics.contains(m.toLowerCase)) {
            success
          } else {
            val options = Metric.allMetrics.keys.mkString(", ")
            failure(s"Unkown metric ${m}. Use one of the following options: ${options}.")
          })
      .action( (m, conf) => conf.copy(metric = m) )
      .text("the metric for calculating distances")

    opt[Int]('d', "dimensions")
      .maxOccurs(1)
      .validate(d =>
          if (d > 0) {
            success
          } else {
            failure("Value <dimensions> must be >0")
          })
      .action( (v, conf) => conf.copy(dimensions = v) )
      .text("the number of dimensions")

    opt[Int]('l', "maxPointsPerLeaf")
      .maxOccurs(1)
      .validate(n =>
          if (n > 0) {
            success
          } else {
            failure("Value <maxPointsPerLeaf> must be >0")
          })
      .action( (v, conf) => conf.copy(maxPointsPerLeaf = v) )
      .text("the maximum number of points per leaf")

    opt[Int]('s', "randomSeed")
      .maxOccurs(1)
      .action( (v, conf) => conf.copy(randomSeed = Some(v)) )
      .text("the seed for the random number generator")

    opt[Int]('t', "treesPerNode")
      .maxOccurs(1)
      .validate(n =>
          if (n > 0) {
            success
          } else {
            failure("Value <treesPerNode> must be >0")
          })
      .action( (v, conf) => conf.copy(treesPerNode = v) )
      .text("the number of trees per node")

    opt[String]("separator")
      .maxOccurs(1)
      .action( (v, conf) => conf.copy(separator = v) )
      .text("the separator used in the input data for separating the id, the coordinates and additional data")

    opt[String]("coordinateSeparator")
      .maxOccurs(1)
      .action( (v, conf) => conf.copy(coordinateSeparator = v) )
      .text("the separator used in the input data for separating the coordinates within the coordinates field")

    opt[Unit]("isUrl")
      .maxOccurs(1)
      .action( (_, conf) => conf.copy(isUrl = true) )
      .text("flag for loading data from the web")

    opt[String]("s3Bucket")
      .maxOccurs(1)
      .action( (v, conf) => conf.copy(s3Bucket = Some(v)) )
      .text("S3 bucket containing the data file")

    opt[Unit]("cache")
      .maxOccurs(1)
      .action( (_, conf) => conf.copy(cache = true) )
      .text("flag for caching responses (when possible)")

    help("help").text("prints this usage text")

    checkConfig(conf => {
      conf match {
        case _ if (!conf.seedOnlyNode && conf.file.isEmpty()) =>
          failure("Missing option --file")
        case _ if (!conf.seedOnlyNode && conf.dimensions < 0) =>
          failure("Missing option --dimensions")
        case _ if (conf.dataSourceType == LocalDataSource && !Files.exists(Paths.get(conf.file))) =>
          failure("Value <file> refers to non-existent file")
        case _ if (conf.separator == conf.coordinateSeparator) =>
          failure("value <separator> cannot be the same as <coordinateSeparator>")
        case _ => success
      }
    })
  }

  def parse(args: Seq[String]): Option[ArgsConfig] = {
    parser.parse(args, ArgsConfig())
  }
}


text:
if [[ -z "$RAGUEL_DIR" ]]; then
  if [[ -z "$BASH_SOURCE" ]]; then
    export RAGUEL_DIR=$(dirname $0)
  else
    export RAGUEL_DIR=$(dirname "${BASH_SOURCE[0]}")
  fi
fi
. "${RAGUEL_DIR}/display.sh"
. "${RAGUEL_DIR}/checker/checker_var.sh"
. "${RAGUEL_DIR}/configurator/distro_manager.sh"

# to auto install all provided packages as arguments
auto_install(){
  if_not_var $RAGUEL_PACKAGE_INSTALL then_run load_distro_specifics
  shout "$RAGUEL_PACKAGE_INSTALL ${@:1}"
  eval "$RAGUEL_PACKAGE_INSTALL ${@:1}"
}

# to auto uninstall all provided packages as arguments
auto_uninstall(){
  if_not_var $RAGUEL_PACKAGE_UNINSTALL then_run load_distro_specifics
  shout "$RAGUEL_PACKAGE_UNINSTALL ${@:1}"
  eval "$RAGUEL_PACKAGE_UNINSTALL ${@:1}"
}


text:
#ifndef COOL_STATICASSERTHELPERS_H_
#define COOL_STATICASSERTHELPERS_H_

// These are some helper template classes to give better error messages than
//  static_assert; namely, ones with the values or class name
//
// Example usage:
//
//  static_assert(AssertSizeof<char, 2>(), "");
//
// produces the following error messages of the form:
//
//  StaticAssertHelpers.h: error: invalid use of incomplete type 'struct AssertEqual<Expected<long unsigned int, 2ul>, Actual<long unsigned int, 1ul> >'
//  StaticAssertHelpers.h: error: declaration of 'struct AssertEqual<Expected<long unsigned int, 2ul>, Actual<long unsigned int, 1ul> >'
//
//  YourFile.cpp: error: 'struct AssertSizeof<char, 2ul>' used where a 'bool' was expected
//
// Expected<...> and Actual<...> derive from integral_constant so the names
//  "Expected" and "Actual" show up in the error message
//
// Assert<T> is always an incomplete type
//
// AssertTrue<C> derives from true_type iff the type is C<T, 0>
//
// AssertFalse<C> derives from true_type iff the type is C<T, v> where v != 0
//
// AssertEqual<E, A> derives from true_type iff E and A represent the same
//  integral constant; otherwise, it is an incomplete type
//
// AssertSizeof<T, e> derives from true_type iff sizeof(T) == e; otherwise, it
//  is an incomplete type
//
// Note: no need to put a message in the static_assert(AssertHelper<>(), ""),
//  since it will never be displayed.  Use it as a comment if you like

#include <type_traits>

namespace cool {

    template<typename T, T v>
    struct Expected : std::integral_constant<T, v> {};

    template<typename T, T v>
    struct Actual : std::integral_constant<T, v> {};

    template<typename...>
    struct Assert;

    template<typename C>
    struct AssertTrue;

    template<template<typename U, U> class C, typename T, T v>
    struct AssertTrue<C<T, v>> : std::true_type {};

    template<template<typename U, U> class C, typename T>
    struct AssertTrue<C<T, 0>>;

    template<typename C>
    struct AssertFalse;

    template<template<typename U, U> class C, typename T, T v>
    struct AssertFalse<C<T, v>>;

    template<template<typename U, U> class C, typename T>
    struct AssertFalse<C<T, 0>> : std::true_type {};

    template<typename E, typename A>
    struct AssertEqual;

    template<template<typename LL, LL> class L, template<typename RR, RR> class R, typename T, T v>
    struct AssertEqual<L<T, v>, R<T, v>> : std::true_type {};

    // Use decltype(sizeof(int)) instead of size_t so we don't have to include another header

    template<typename T, decltype(sizeof(int)) e>
    struct AssertSizeof : AssertEqual<Expected<decltype(sizeof(int)), e>, Actual<decltype(sizeof(int)), sizeof(T)>>::type {};

} // cool namespace

#endif /* COOL_STATICASSERTHELPERS_H_ */


text:
if (!ORYX.Plugins)
    ORYX.Plugins = {};

if (!ORYX.Config)
    ORYX.Config = {};

ORYX.Plugins.ActiveNodesHighlighter = Clazz.extend({
    construct: function(facade){
        this.facade = facade;

        this.facade.registerOnEvent(ORYX.CONFIG.EVENT_LOADED, this.highlightnodes.bind(this));
    },
    highlightnodes: function(options) {
        ORYX.EDITOR._canvas.getChildren().each((function(child) {
            this.applyHighlightingToChild(child);
        }).bind(this));
    },
    applyHighlightingToChild: function(child) {
        if(ORYX.ACTIVENODES) {
            for(var i=0;i<ORYX.ACTIVENODES.length;i++) {
                if(child instanceof ORYX.Core.Node || child instanceof ORYX.Core.Edge) {
                    if(ORYX.ACTIVENODES[i] == child.resourceId) {
                        child.setProperty("oryx-bordercolor", "#FF0000");
                    }
                }
            }
        }
        if(ORYX.COMPLETEDNODES) {
            for(var i=0;i<ORYX.COMPLETEDNODES.length;i++) {
                if(child instanceof ORYX.Core.Node || child instanceof ORYX.Core.Edge) {
                    if(ORYX.COMPLETEDNODES[i] == child.resourceId) {
                        child.setProperty("oryx-bordercolor", "#A8A8A8");
                        child.setProperty("oryx-bgcolor", "#CDCDCD");
                    }
                }
            }
        }

        if(child instanceof ORYX.Core.Node || child instanceof ORYX.Core.Edge) {
            if(ORYX.READONLY == true || ORYX.VIEWLOCKED == true) {
                child.setSelectable(false);
                child.setMovable(false);
                child.setProperty("oryx-isselectable", "false");

                if(child instanceof ORYX.Core.Edge) {
                    child.dockers.each((function(docker){
                        docker.setMovable(false);
                        docker.update();
                    }));
                }
            }
            child.refresh();
        }

        if(child && child.getChildren().size() > 0) {
            for (var i = 0; i < child.getChildren().size(); i++) {
                this.applyHighlightingToChild(child.getChildren()[i]);
            }
        }
    }
});


text:
from django.utils.translation import ugettext as _
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_stream_message, create_stream_if_needed
from zerver.lib.response import json_success, json_error
from zerver.lib.validator import check_string, check_int
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.models import UserProfile

ZULIP_MESSAGE_TEMPLATE = u"**{message_sender}**: `{text}`"
VALID_OPTIONS = {'SHOULD_NOT_BE_MAPPED': '0', 'SHOULD_BE_MAPPED': '1'}

@api_key_only_webhook_view('Slack')
@has_request_variables
def api_slack_webhook(request, user_profile,
                      user_name=REQ(),
                      text=REQ(),
                      channel_name=REQ(),
                      stream=REQ(default='slack'),
                      channels_map_to_topics=REQ(default='1')):
    # type: (HttpRequest, UserProfile, str, str, str, str, str) -> HttpResponse

    if channels_map_to_topics not in list(VALID_OPTIONS.values()):
        return json_error(_('Error: channels_map_to_topics parameter other than 0 or 1'))

    if channels_map_to_topics == VALID_OPTIONS['SHOULD_BE_MAPPED']:
        subject = "channel: {}".format(channel_name)
    else:
        stream = channel_name
        subject = _("Message from Slack")

    content = ZULIP_MESSAGE_TEMPLATE.format(message_sender=user_name, text=text)
    check_send_stream_message(user_profile, request.client, stream, subject, content)
    return json_success()


text:
import private_settings

DEBUG = False
TEMPLATE_DEBUG = DEBUG
ASSETS_DEBUG = DEBUG
ASSETS_AUTO_BUILD = DEBUG

# used in admin template so we know which site we're looking at
DEPLOY_ENV = "production"
DEPLOY_ENV_NAME = "Production Server"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',  # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '{{ repo }}',                      # Or path to database file if using sqlite3.
        'USER': '{{ repo[:16] }}',                      # Not used with sqlite3.
        'PASSWORD': private_settings.DB_PASSWORD,                  # Not used with sqlite3.
        'HOST': '127.0.0.1',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
        'OPTIONS': {
            "init_command": "SET storage_engine=INNODB",
        }
    }
}

# Commented out now that we're using raven/sentry instead
ADMINS = (
#    ('Ben Webb', 'ben.webb@opendataservices.coop'),
)

ALLOWED_HOSTS = [
    '.',
    'www.',
    '{{ pillar.domain_prefix }}ocds.opendataservices.coop',
    'ocds.open-contracting.org',
]

MANAGERS = ADMINS

DEFAULT_FROM_EMAIL = 'support@opendataservices.coop'
SERVER_EMAIL = 'code@opendataservices.coop'

{% if repo == 'opendatacomparison' %}
EXTRA_INSTALLED_APPS = ()
EXTRA_MIDDLEWARE_CLASSES = ()
LOGIN_URL = '/opendatacomparison/accounts/login/'
{% endif %}


text:
require "noam_server/persistence/memory"

describe NoamServer::Persistence::Memory do

  let(:persistence) { NoamServer::Persistence::Memory.new({}) }

  it "saves data" do
    key = persistence.save('bucket', 'user_id', 'group_id')
    persistence.load('bucket', key).should == ['user_id', 'group_id']
  end

  it "queries on an unknown bucket is empty" do
    persistence.load('unknown_bucket', 'key').should == []
  end

  it "clears a bucket" do
    key = persistence.save('bucket', 'user_id', 'group_id')
    persistence.clear('bucket')
    persistence.load('bucket', key).should == []
  end

  it "gets a bucket" do
    persistence.save('bucket', 'user_id', 'group_id')
    persistence.get_bucket('bucket').should == {'user_id' => ['user_id', 'group_id']}
  end

end


text:
namespace rubbish{

    namespace helper{
        // Helper function of forward_list_base<T,Node>::sort()
        template <class Node> Node* forward_list_merge(Node *h1,Node *h2){
            if(h1==h2)
                return h1;
            Node *head,**ptr=&head;
            while(h1!=nullptr&&h2!=nullptr){
                if(h1->data<h2->data){
                    *ptr=h1;
                    h1=h1->next;
                } else {
                    *ptr=h2;
                    h2=h2->next;
                }
                ptr=&(*ptr)->next;
            }
            if(h1!=nullptr)
                *ptr=h1;
            if(h2!=nullptr)
                *ptr=h2;
            return head;
        }

        template <class Node> Node* forward_list_merge_sort(Node *head){
            if(head==nullptr||head->next==nullptr)
                return head;
            if(head->next->next==nullptr){
                Node *next=head->next;
                if(next->data<head->data){
                    next->next=head;
                    head->next=nullptr;
                    head=next;
                }
                return head;
            }
            Node *slow=head,*fast=head->next->next;
            while(fast!=nullptr){
                slow=slow->next;
                fast=fast->next;
                if(fast!=nullptr)
                    fast=fast->next;
            }
            // Reuse fast
            fast=forward_list_merge_sort<Node>(slow->next);
            slow->next=nullptr;
            return forward_list_merge<Node>(forward_list_merge_sort<Node>(head),fast);
        }

    } // namespace helper

} // namespace rubbish

template <class T,class Node> constexpr rubbish::forward_list_base<T,Node>::forward_list_base():m_head(nullptr),m_end(nullptr),m_length(0) {}

template <class T,class Node> rubbish::forward_list_base<T,Node>::forward_list_base(std::size_t len,const T &value):m_head(nullptr),m_end(nullptr),m_length(len){
    if(len==0)
        return;
    m_end=m_head=new node(value);
    for(;len>1;len--){
        m_end->next=new node(value);
        m_end=m_end->next;
    }
}

template <class T,class Node> rubbish::forward_list_base<T,Node>::forward_list_base(rubbish::forward_list_base<T,Node> &&other):m_head(other.m_head),m_end(other.m_end),m_length(other.m_length) {other.m_head=other.m_end=nullptr;other.m_length=0;}

template <class T,class Node> rubbish::forward_list_base<T,Node>::forward_list_base(const rubbish::forward_list_base<T,Node> &other):m_head(nullptr),m_end(nullptr),m_length(other.m_length){
    if(other.empty())
        return;
    node **ptr=&m_head;const node *optr=other.m_head;
    *ptr=new node(*optr); optr=optr->next;
    while(optr!=nullptr){
        (*ptr)->next=new node(*optr);
        ptr=&(*ptr)->next;
        optr=optr->next;
    }
    m_end=*ptr;
}

template <class T,class Node> rubbish::forward_list_base<T,Node>::forward_list_base(std::initializer_list<T> &&l):m_head(nullptr),m_end(nullptr),m_length(0){
    if(l.size()==0)
        return;
    auto it=l.begin();
    m_head=m_end=new node(*(it++));
    for(;it!=l.end();++it){
        m_end->next=new node(*it);
        m_end=m_end->next;
    }
}

template <class T,class Node> rubbish::forward_list_base<T,Node>::~forward_list_base(){
    while(m_head!=nullptr){
        m_end=m_head->next;
        delete m_head;
        m_head=m_end;
    }
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::remove_elem(const T &elem){
    if(m_head->data==elem){
        if(m_head->next==nullptr){
            delete m_head;
            m_length--;
            m_head=nullptr;
            return;
        }
        node *ptr=m_head->next;
        delete m_head;
        m_length--;
        m_head=ptr;
        this->remove_elem(elem);
    }
    node *ptr=m_head->next,*prev=m_head;
    while(ptr!=nullptr){
        if(ptr->elem==elem){
            prev->next=ptr->next;
            delete ptr;
            m_length--;
            ptr=prev->next;
        } else {
            prev=ptr;
            ptr=ptr->next;
        }
    }
    if(prev->next==nullptr)
        m_end=prev;
}

template <class T,class Node> bool rubbish::forward_list_base<T,Node>::empty() const {return m_head==nullptr;}

template <class T,class Node> std::size_t rubbish::forward_list_base<T,Node>::size() const noexcept {return m_length;}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::sort() {
    m_head=helper::forward_list_merge_sort<Node>(m_head);
    auto ptr=m_head;
    while(ptr->next!=nullptr)
        ptr=ptr->next;
    m_end=ptr;
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::clear() {
    this->~forward_list_base();
    m_head=m_end=nullptr;
    m_length=0;
}

template <class T,class Node> typename rubbish::forward_list_base<T,Node>::iterator rubbish::forward_list_base<T,Node>::search(const T &elem) const{
    node *p=m_head;
    while(p!=nullptr){
        if(p->data==elem)
            return iterator(p);
        p=p->next;
    }
    return iterator(nullptr);
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::insert_after(iterator it,const T &elem){
    node const *_it=it.get();
    if(_it==nullptr)
        return;
    if(_it==m_end){
        m_end->next=new node(elem);
        m_end=m_end->next;
    } else {
        node *temp=new node(elem);
        temp->next=_it->next;
        _it->next=temp;
    }
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::push_back(const T &elem){
    ++m_length;
    if(m_head==nullptr){
        m_head=m_end=new node(elem);
        return;
    }
    m_end->next=new node(elem);
    m_end=m_end->next;
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::pop_front(){
    if(m_head==nullptr)
        throw std::out_of_range("forward_list_base::pop_front: empty list!");
    --m_length;
    if(m_end==m_head){
        delete m_end;
        m_head=m_end=nullptr;
        return;
    }
    node *save=m_head->next;
    delete m_head;
    m_head=save;
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::push_front(const T &elem){
    ++m_length;
    if(m_head==nullptr){
        m_head=m_end=new node(elem);
        return;
    }
    node *tmp=new node(elem);
    tmp->next=m_head;
    m_head=tmp;
}

template <class T,class Node> T& rubbish::forward_list_base<T,Node>::front() const {return m_head->data;}

template <class T,class Node> T& rubbish::forward_list_base<T,Node>::back() const {return m_end->data;}

template <class T,class Node> typename rubbish::forward_list_base<T,Node>::self_type& rubbish::forward_list_base<T,Node>::operator=(const self_type &other) {
    this->~forward_list_base();
    m_length=other.m_length;
    if(other.empty()){
        m_head=m_end=nullptr;
        return *this;
    }
    node **ptr=&m_head;const node *optr=other.m_head;
    *ptr=new node(*optr); optr=optr->next;
    while(optr!=nullptr){
        (*ptr)->next=new node(*optr);
        ptr=&(*ptr)->next;
    }
    m_end=*ptr;
    return *this;
}

template <class T,class Node> rubbish::forward_list_base<T,Node>& rubbish::forward_list_base<T,Node>::operator=(self_type &&other) {
    this->~forward_list_base();
    m_head=other.m_head;
    m_end=other.m_end;
    m_length=other.m_length;
    other.m_head=other.m_end=nullptr;
    other.m_length=0;
    return *this;
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::reverse(){
    if(m_head==nullptr||m_head->next==nullptr)
        return;
    m_end=m_head;
    node *nhead=nullptr;
    while(m_head!=nullptr){
        node *p=m_head->next;
        m_head->next=nhead;
        nhead=m_head;
        m_head=p;
    }
    m_head=nhead;
}

template <class T,class Node> void rubbish::forward_list_base<T,Node>::remove_after(iterator it){
    node const *_it=it.get();
    if(_it==nullptr||_it->next==nullptr)
        return;
    node *save=_it->next->next;
    delete _it->next;
    _it->next=save;
    m_length--;
}

template <class T,class Node> typename rubbish::forward_list_base<T,Node>::iterator rubbish::forward_list_base<T,Node>::begin() {return iterator(m_head);}

template <class T,class Node> typename rubbish::forward_list_base<T,Node>::iterator rubbish::forward_list_base<T,Node>::end() {return iterator(nullptr);}

template <class T,class Node> typename rubbish::forward_list_base<T,Node>::const_iterator rubbish::forward_list_base<T,Node>::cbegin() const {return const_iterator(const_cast<forward_list_base<T,Node>*>(this)->begin());}

template <class T,class Node> typename rubbish::forward_list_base<T,Node>::const_iterator rubbish::forward_list_base<T,Node>::cend() const {return const_iterator(const_cast<forward_list_base<T,Node>*>(this)->end());}


text:
package javax.el;

import java.lang.reflect.Method;

/**
 *
 */
public abstract class FunctionMapper {

    public abstract Method resolveFunction(String prefix, String localName);

}


text:
define([
	'jquery',
	'underscore',
	'backbone',
	'marionette',
	'text!templates/users/accounts/edit/edit-my-account.tpl',
	'scripts/registry',
	'scripts/views/dialogs/notify-view',
	'scripts/views/dialogs/error-view',
	'scripts/views/users/dialogs/user-validation-error-view',
	'scripts/views/users/user-profile/user-profile-form-view'
], function($, _, Backbone, Marionette, Template, Registry, NotifyView, ErrorView, UserValidationErrorView, UserProfileFormView) {
	return Backbone.Marionette.LayoutView.extend({

		//
		// attributes
		//

		template: _.template(Template),

		regions: {
			userProfileForm: "#user-profile-form"
		},

		events: {
			"click .alert .close": "onClickAlertClose",
			"click #save": "onClickSave",
			"click #cancel": "onClickCancel"
		},

		//
		// methods
		//

		initialize: function() {
			this.model = Registry.application.session.user;
		},

		//
		// rendering methods
		//

		onRender: function() {
			this.userProfileForm.show(
				new UserProfileFormView({
					model: this.model
				})
			);
		},

		showWarning: function() {
			this.$el.find(".alert-error").show();
		},

		hideWarning: function() {
			this.$el.find(".alert-error").hide();
		},

		//
		// event handling methods
		//

		onClickAlertClose: function() {
			this.hideWarning();
		},

		onClickSave: function() {
			var self = this;

			// check validation
			//
			if (this.userProfileForm.currentView.isValid()) {

				// update model from form
				//
				this.userProfileForm.currentView.update(this.model);

				// check to see if model is valid
				//
				var response = this.model.checkValidation(this.model.changedAttributes(), {

					// callbacks
					//
					success: function() {

						// prevent ownership emails from being sent
						//
						self.model.unset(
							"owner"
						);

						// save user profile
						//
						self.model.save(undefined, {

							// callbacks
							//
							success: function() {

								// update user name in header (if changed)
								//
								Registry.application.header.currentView.render();

								// notify user
								//
								var message = "Your user profile has been successfully updated.";
								if (self.model.changed.email) {
									message = "An email verification link has been sent to your new email address. Please follow the link to change your email address. Your previous email address will remain in effect until you do so.

" + message;
								}

								// show success notification dialog
								//
								Registry.application.modal.show(
									new NotifyView({
										title: "My Profile Updated",
										message: message,

										// callbacks
										//
										accept: function() {

											// return to my account view
											//
											Backbone.history.navigate("#my-account", {
												trigger: true
											});
										}
									})
								);
							},

							error: function() {

								// show error dialog
								//
								Registry.application.modal.show(
									new ErrorView({
										message: "Could not save user profile changes."
									})
								);
							}
						});
					},

					error: function() {
						var errors = JSON.parse(response.responseText);

						// show validation errors dialog
						//
						Registry.application.modal.show(
							new UserValidationErrorView({
								errors: errors
							})
						);
					}
				});
			} else {
				this.showWarning();
			}
		},

		onClickCancel: function() {

			// go to my account view
			//
			Backbone.history.navigate("#my-account", {
				trigger: true
			});
		}
	});
});


text:
require File.expand_path('lib/config', File.dirname(__FILE__))
require File.expand_path('lib/puts_logger', File.dirname(__FILE__))
require File.expand_path('lib/base', File.dirname(__FILE__))


text:
package io.specto.hoverfly.junit.dsl;

import io.specto.hoverfly.junit.core.model.DelaySettings;
import io.specto.hoverfly.junit.core.model.Request;

import java.util.concurrent.TimeUnit;

public class ResponseDelaySettingsBuilder extends AbstractDelaySettingsBuilder {

    private StubServiceBuilder invoker;

    ResponseDelaySettingsBuilder(int delay, TimeUnit delayTimeUnit) {
        super(delay, delayTimeUnit);
    }

    public ResponseDelaySettingsBuilder to(StubServiceBuilder invoker) {
        this.invoker = invoker;
        return this;
    }

    void forRequest(Request request) {
        if (isValid()) {
            String urlPattern = toPattern(request.getDestination()) + toPattern(request.getPath());
            invoker.addDelaySetting(new DelaySettings(urlPattern, getConvertedDelay(), null));
        }
    }

}


text:
package br.com.transmetais.bean;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlTransient;
@Entity
@Table(name="item_pesagem")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "tipo", length = 1, discriminatorType = DiscriminatorType.STRING)
public abstract class ItemPesagem {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	@Column(name="peso_perc")
	private Double pesoPercentual;
	@Column(name="peso_liquido")
	private BigDecimal pesoLiquido;
	@ManyToOne
	@JoinColumn(name="comprov_pesagem_id")
	@XmlTransient
	private ComprovantePesagem comprovantePesagem;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public BigDecimal getPesoLiquido() {
		return pesoLiquido;
	}
	public void setPesoLiquido(BigDecimal pesoLiquido) {
		this.pesoLiquido = pesoLiquido;
	}
	public Double getPesoPercentual() {
		return pesoPercentual;
	}
	public void setPesoPercentual(Double pesoPercentual) {
		this.pesoPercentual = pesoPercentual;
	}
	public ComprovantePesagem getComprovantePesagem() {
		return comprovantePesagem;
	}
	public void setComprovantePesagem(ComprovantePesagem comprovantePesagem) {
		this.comprovantePesagem = comprovantePesagem;
	}

}


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

<!--

This file is part of the Lug package.

(c) Eric GELOEN <geloen.eric@gmail.com>

For the full copyright and license information, please read the LICENSE
file that was distributed with this source code.

-->

<container xmlns="http://symfony.com/schema/dic/services">
    <services>
        <service
            id="lug.resource.listener.message"
            class="Lug\Bundle\ResourceBundle\EventListener\MessageListener"
        >
            <argument type="service" id="translator" />
            <argument type="service" id="property_accessor" />
            <argument type="service" id="lug.resource.routing.parameter_resolver" />
        </service>

        <service
            id="lug.resource.listener.flash"
            class="Lug\Bundle\ResourceBundle\EventListener\FlashListener"
        >
            <argument type="service" id="session" />
            <argument type="service" id="lug.resource.routing.parameter_resolver" />
        </service>
    </services>
</container>


text:
set -e

check_protoc_version () {
  this_version=$(protoc --version)
  return $([ "libprotoc $PROTOC_VERSION" = "$this_version" ])
}

if check_protoc_version; then
    echo "[SUCCESS] protobuf version $PROTOC_VERSION detected."
    exit
fi

echo "[INFO] Installing protobuf $PROTOC_VERSION to $HOME/protobuf..."

cd "$TMPDIR"
wget "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip"
unzip -o -d "$HOME/protobuf" "protoc-$PROTOC_VERSION-linux-x86_64.zip"

echo "[SUCCESS] Done."


text:
cdb.admin.overlays.Text = cdb.geo.ui.Text.extend({

  className: "text overlay snap",

  template_name: 'table/views/overlays/text',

  events: {

    "mouseenter .text":  "_onMouseEnter",

    "click .close":      "_close",
    "click .content":    "_onClickEdit",
    "click .text":       "_onClickEdit",
    "dblclick .content": "_onDblClick",
    "dblclick .text":    "_onDblClick",

    "keyup .text":       "_onKeyUp",
    "paste .text":       "_onPaste"

  },

  form_data: [{
    name: 'Text',
    form: {
      'font-size':  { type: 'simple_number', value: 12, min: 5, max: 50, inc: 2, disable_triggering: true },
      'color':      { type: 'color', value: '#FFF', extra: { tick: "left", picker_horizontal_position: "left", picker_vertical_position: "down" }},
      'font-family-name': {
        type: 'select',
        value: "Helvetica",
        extra: ["Helvetica", "Droid Sans", "Vollkorn", "Roboto", "Open Sans", "Lato", "Graduate", "Gravitas One", "Old Standard TT"]

      },
      'text-align':      { type: 'text_align', value: 'left' }
    }
  }, {
    name: 'Box',
    form: {
      'box-color':   { type: 'color', value: '#000', extra: { tick: "left", picker_horizontal_position: "left", picker_vertical_position: "down" }},
      'box-opacity': { type: 'simple_opacity', value: .7, min:0, max:1, inc: .1, disable_triggering: true },
      'box-padding': { type: 'simple_number_with_label', value: 10, min: 5, max: 200, inc: 1, label: "P", disable_triggering: true }
    }
  }, {
    name: 'Max Width',
    form: {
      'box-width':  { type: 'simple_number', value: 300, min: 50, max: 2000, inc: 10, disable_triggering: true },
    }
  }],

  initialize: function() {

    _.bindAll(this, "_close", "_onChangeMode", "_onKeyDown");

    this.template = this.getTemplate(this.template_name);

    this._setupModels();

  },

  // Setup the internal and custom model
  _setupModels: function() {

    var self  = this;
    var extra = this.model.get("extra");

    this.model.set({ text: extra.text }, { silent: true });

    var applyStyle = function() {
      self._applyStyle(true);
    };

    // Binding
    this.model.bind('remove',   this.hide, this);

    this.model.bind('change:style',   applyStyle,            this);
    this.model.bind('change:text',    this._setText,         this);
    this.model.bind('change:display', this._onChangeDisplay, this);
    this.model.bind('change:extra',   this._onChangeExtra,   this);
    this.model.bind('change:selected', this._onChangeSelected, this);

    // Internal model to store the editing state
    this.editModel = new cdb.core.Model({ mode: "" });
    this.editModel.bind('change:mode', this._onChangeMode, this);

    this.add_related_model(this.editModel);

  },

  // Element events
  _onKeyUp: function(e) {

    if (this.timeout) {
      clearTimeout(this.timeout);
    }

    this.model.set({ text: this.$text.html() }, { silent: true });

  },

  _onClickEdit: function(e) {

    this.killEvent(e);

    cdb.god.trigger("closeOverlayDropdown");

    $(document).bind('keydown', this._onKeyDown);

    this._savePosition(false);

    this.trigger("clickEdit", this.model, this.form_data);

    this.model.set("selected", true);

  },

  _onKeyDown: function(e) {

    var selected = this.model.get("selected");

    if (selected) {
      var editable = this.editModel.get("mode") == "editable";
      var focus    = this.$(".overlay_text").is(":focus");

      // hitting the backspace removes the overlay
      if ($(e.target).hasClass("overlay_text") || $(e.target).hasClass("cartodb-map")) {
        if (e.keyCode === $.ui.keyCode.BACKSPACE && (!editable || !focus)) {
          this.killEvent(e);
          this._close();
        }
      }
    }

    if (e.keyCode === $.ui.keyCode.ESCAPE) {
      this.editModel.set("mode", "");
    }

  },

  _onPaste: function(e) {

    var self = this;

    setTimeout(function() {

      var text = cdb.Utils.stripHTML(self.model.get("text"));
      self.model.set("text", text)

    }, 200);

  },

  _onDblClick: function(e) {

    this.killEvent(e);
    this._savePosition(true);

  },

  _savePosition: function(editable) {

    var extra = this.model.get("extra");

    var x     = this.model.get("x");
    var y     = this.model.get("y");

    var oldX  = this.$el.position().left;
    var oldY  = this.$el.position().top;

    var portrait_direction  = extra.portrait_dominant_side;
    var landscape_direction = extra.landscape_dominant_side;

    if (y === 0 && portrait_dominant_side === "bottom") oldY = y;
    if (x === 0 && landscape_dominant_side === "right") oldX = x;

    var moved = true;
      // If we didn't move the overlay
   if (oldX === x && y === oldY || x === 0 && landscape_dominant_side === "right" && y === oldY || y == 0 && portrait_dominant_side === "bottom" && oldX === x) {

      moved = false;

      this.$el.addClass("selected");

      if (editable) {
        this.editModel.set("mode", "editable");
        return;
      }

    }

    x = this.$el.position().left;
    y = this.$el.position().top;

    var width  = this.$el.width();
    var height = this.$el.height();

    var right  = $(".cartodb-map").width()  - x;
    var bottom = $(".cartodb-map").height() - y;

    var right_position          = right  - width;
    var bottom_position         = bottom - height;

    var map_width               = $(".cartodb-map").width();
    var map_height              = $(".cartodb-map").width();

    var left_percentage         = (x + (width/2))  / map_width  * 100;
    var top_percentage          = (y + (height/2)) / map_height * 100;

    var landscape_dominant_side = x <= right_position ? "left" : "right";
    var portrait_dominant_side  = y <= bottom_position ? "top" : "bottom";

    // Default positions
    extra.default_position        = false;
    extra.landscape_dominant_side = landscape_dominant_side;
    extra.portrait_dominant_side  = portrait_dominant_side;
    extra.top_percentage          = top_percentage;
    extra.left_percentage         = left_percentage;
    extra.right_position          = right_position;
    extra.bottom_position         = bottom_position;
    extra.right                   = right;
    extra.bottom                  = bottom;
    extra.width                   = width;
    extra.height                  = height;

    this.model.set({ extra: extra }, { silent: true});
    this.model.set({ x: x, y: y });

    if (moved) {
      this.model.save();
    }

  },

  _onMouseDown: function() { },

  _onMouseEnter: function() {

    this.$el.addClass("hover");

    if (this.editModel.get("mode") === "editable") {
      if (this.timeout) clearTimeout(this.timeout);
    }

  },

  show: function(animated) {

    this.$el.show();

    if (true) this.$el.addClass('animated bounceIn');

  },

  hide: function(callback) {

    var self = this;

    this.$el
    .removeClass('animated bounceIn')
    .addClass('animated bounceOut')
    .removeClass('selected');

    callback && _.isFunction(callback) && callback();

    $(document).unbind('keydown', this._onKeyDown);

    cdb.god.unbind("closeDialogs", this._onCloseDialogs, this);

    // Give it some time to complete the animation
    setTimeout(function() {
      self.clean();
    }, 550);

  },

  _close: function(e) {

    this.killEvent(e);

    var self = this;

    this.hide(function() {
      self.trigger("remove", self);
    });

  },

  _onChangeDisplay: function() {

    var display = this.model.get("display");

    if (display) {
      this.show();
    } else {
      this.$el.hide();
    }

  },

  _onChangeExtra: function() {

    var extra  = this.model.get("extra");
    extra.text = this.model.get("text");

    this.model.set({ extra: extra }, { silent: true });

  },

  /*
   * Applies style to the content of the widget
   */

  _applyStyle: function(save) {

    var style      = this.model.get("style");

    var boxColor   = style["box-color"];
    var boxOpacity = style["box-opacity"];
    var boxWidth   = style["box-width"];
    var boxPadding = style["box-padding"];

    var fontFamily = style["font-family-name"];

    this.$text.css(style);

    this.$(".content").css("padding", boxPadding);
    this.$text.css("font-size", style["font-size"] + "px");
    this.$el.css("z-index", style["z-index"]);

    var rgbaCol = 'rgba(' + parseInt(boxColor.slice(-6,-4),16)
    + ',' + parseInt(boxColor.slice(-4,-2),16)
    + ',' + parseInt(boxColor.slice(-2),16)
    +', ' + boxOpacity + ' )';

    this.$el.css("background-color", rgbaCol);
    this.$el.css("max-width", boxWidth);

    var fontFamilyClass = "";

    if      (fontFamily  == "Droid Sans")       fontFamilyClass = "droid";
    else if (fontFamily  == "Vollkorn")         fontFamilyClass = "vollkorn";
    else if (fontFamily  == "Open Sans")        fontFamilyClass = "open_sans";
    else if (fontFamily  == "Roboto")           fontFamilyClass = "roboto";
    else if (fontFamily  == "Lato")             fontFamilyClass = "lato";
    else if (fontFamily  == "Graduate")         fontFamilyClass = "graduate";
    else if (fontFamily  == "Gravitas One")     fontFamilyClass = "gravitas_one";
    else if (fontFamily  == "Old Standard TT")  fontFamilyClass = "old_standard_tt";
    this.$el.css("width", "auto");

    this.$el
    .removeClass("droid")
    .removeClass("vollkorn")
    .removeClass("roboto")
    .removeClass("open_sans")
    .removeClass("lato")
    .removeClass("graduate")
    .removeClass("gravitas_one")
    .removeClass("old_standard_tt");

    this.$el.addClass(fontFamilyClass);

    if (save) this.model.save();

  },

  _onChangeSelected: function() {

    var selected = this.model.get("selected");

    if (selected) {

      this.$el.addClass("selected");

    } else {

      this.$el.removeClass("selected");
      this._disableEditingMode();

    }

  },

  _onChangeMode: function() {

    var mode = this.editModel.get("mode");

    if (mode === "editable") {
      this._enableEditingMode();
    } else {
      this._disableEditingMode();
    }

  },

  _enableEditingMode: function() {

    this.$el
    .addClass("editable")
    .addClass("disabled");

    this.$text.attr("contenteditable", true).focus();

    var style = this.model.get("style");
    var width = style["box-width"];

    var text = this.model.get("text");

    this.$el.css("width", "auto");
    this.$el.css("max-width", width);
    this.$text.html(text);
    this.$(".hint").fadeIn(150);

  },

  _isEmptyText: function(text) {
    var regexp = new RegExp(/^(<div>)*(<br ?\/?>)*(<\/div>)*$/);

    if (text.trim() && !text.trim().match(regexp)) {
      return false;
    } else {
      return true;
    }
  },

  _disableEditingMode: function() {

    $(document).unbind('keydown', this._onKeyDown);

    var text = this._transformToMarkdown(this.model.get("text"));

    this.editModel.set("mode", "");

    if (!this._isEmptyText(text)) {

      var self = this;

      self.$(".hint").fadeOut(150, function() {

        self.$el
        .removeClass("editable")
        .removeClass("disabled");

        self.$text.attr("contenteditable", false);
        self.$el.css("width", "auto");

        setTimeout(function() {

          var width = self.$el.width();
          var extra = self.model.get("extra");

          extra.width = width;

          self.model.set({ extra: extra }, { silent: true });

          if (!self.model.isNew()) {
            self.model.save();
          }

          self.$text.html(text);

          self.$el.css("width", "auto");

        }, 100);

        if (!self.model.isNew()) {
          self.model.save();
        }

      });

    } else {
      this._close();
    }

  },

  _setText: function() {

    var text          = this.model.get("text");
    var rendered_text = this._transformToMarkdown(text);

    var extra = this.model.get("extra");

    extra.text          = text;
    extra.rendered_text = rendered_text

    this.model.set({ extra: extra }, { silent: true });

    if (rendered_text) {
      this.$text.html(rendered_text);
    }

  },

  _transformToMarkdown: function(text) {

    text = markdown.toHTML(text)

    text = text.replace(/</g, "<");
    text = text.replace(/>/g, ">");
    text = text.replace(/<p>/g, "");
    text = text.replace(/&nbsp;/g, " ");
    text = text.replace(/<\/p>/g, "");

    return text;

  },

  _place: function() {

    var mode  = this.editModel.get("mode");
    var extra = this.model.get("extra");

    if (mode === "editable" || !extra) {
      return;
    }

    var landscape_dominant_side = extra.landscape_dominant_side;
    var portrait_dominant_side  = extra.portrait_dominant_side;

    if (portrait_dominant_side === 'bottom') {

      this.$el.offset({
        bottom: extra.bottom_position
      });

      this.$el.css({
        top: "auto",
        bottom: extra.bottom_position
      });

    } else {

      this.$el.offset({
        top: this.model.get("y"),
        bottom: "auto"
      });

    }

    if (landscape_dominant_side === 'right') {

      this.$el.offset({
        right: extra.right_position
      });

      this.$el.css({
        left: "auto",
        right: extra.right_position
      });

    } else {

      this.$el.offset({
        left: this.model.get("x"),
        right: "auto"
      });

    }

  },

  _onCloseDialogs: function() {
    if (this.model.get("selected") !== undefined) this.model.set("selected", false);
  },

  render: function() {

    this._place();

    this.$el.append(this.template(this.model.attributes));

    this.$text = this.$(".content div.text");
    var text   = this._transformToMarkdown(this.model.get("text"));

    this.$text.html(text);

    this._applyStyle(false);
    this._onChangeExtra();

    this.$el.addClass(this.model.get("device"));

    cdb.god.unbind("closeDialogs", this._onCloseDialogs, this);
    cdb.god.bind("closeDialogs", this._onCloseDialogs, this);

    return this;

  }

});


text:
package com.amazonaws.services.gamelift.model;

import javax.annotation.Generated;

/**
 * <p>
 * The game instance is currently full and cannot allow the requested player(s) to join. Clients can retry such requests
 * immediately or after a waiting period.
 * </p>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GameSessionFullException extends com.amazonaws.services.gamelift.model.AmazonGameLiftException {
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new GameSessionFullException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public GameSessionFullException(String message) {
        super(message);
    }

}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=project.js.map


text:
<ons-list-header ng-class="{'has-error': showError}">* {{options.templateOptions.label}}</ons-list-header>
<ons-list-item>
    <signature-pad
        id="{{options.key}}"
        name="{{options.key}}"
        ng-model="model[options.key]"></signature-pad>
</ons-list-item>


text:
document.observe('dom:loaded', function() {

  when('table.index', function(table){
    if(table.identify() == 'site-map')
      new SiteMap(table);
    else
      new RuledTable(table);
  });

  when('page_title', function(title) {
    var slug = $('page_slug'),
        breadcrumb = $('page_breadcrumb'),
        oldTitle = title.value;

    if (!slug || !breadcrumb) return;

    new Form.Element.Observer(title, 0.15, function() {
      if (oldTitle.toSlug() == slug.value) slug.value = title.value.toSlug();
      if (oldTitle == breadcrumb.value) breadcrumb.value = title.value;
      oldTitle = title.value;
    });
  });

  when('tab-control', function(element) {
    tabControl = new TabControl(element);

    $$('#pages div.part > input[type=hidden]:first-child').each(function(part, index) {
      var page = part.up('.page');
      tabControl.addTab('tab-' + (index + 1), part.value, page.id);
    });

    tabControl.autoSelect();
  });

  when('tag-reference-popup', function(popup) {
    var tags, searchingOn = "";

    new Form.Element.Observer('search-tag-reference', 0.5, function(element, value) {
      if (!tags) tags = popup.select('.tag-description')

      if (value.length < 3 && searchingOn != "") {
        searchingOn = "";
        tags.invoke('show');
      } else if (value.length >= 3 && searchingOn != value) {
        searchingOn = value
        tags.each(function(div) {
          div[div.hasWord(value) ? 'show' : 'hide']();
        });
      }
    });

    popup.down('p a.close').observe('click', function(e) {
      e.findElement('.popup').hide();
      e.stop();
    });
  });

  when('page_status_id', function(select){
    if($F('page_status_id') == '100')
      $('publication-date').show().select('select').invoke('enable');

    select.observe('change', function(){
      if($F(this) == '100')
        $('publication-date').show().select('select').invoke('enable');
      else
        $('publication-date').hide().select('select').invoke('disable');
    })
  });

  when('notice', function(notice) {
    new Effect.Fade(notice, {delay: 3});
  });

});

Element.addMethods({
  hasWord: function(element, word) {
    element = $(element);
    if (element.nodeType == Node.TEXT_NODE) {
      return element.nodeValue.include(word);
    } else {
      return $A(element.childNodes).any(function(child) {
        return Element.hasWord(child, word);
      });
    }
  }
})

// When object is available, do function fn.
function when(obj, fn) {
  if (Object.isString(obj)) obj = /^[\w-]+$/.test(obj) ? $(obj) : $(document.body).down(obj);
  if (Object.isArray(obj) && !obj.length) return;
  if (obj) fn(obj);
}

function part_added() {
  var partNameField = $('part-name-field');
  var partIndexField = $('part-index-field');
  var index = parseInt(partIndexField.value || 0) + 1;
  var tab = 'tab-' + index;
  var caption = partNameField.value;
  var page = 'page-' + index;
  tabControl.addTab(tab, caption, page);
  Element.hide('add-part-popup');
  Element.hide('busy');
  partNameField.value = '';
  partIndexField.value = (index + 1).toString();
  $('add-part-button').disabled = false;
  Field.focus(partNameField);
  tabControl.select(tab);
}
function part_loading() {
  $('add-part-button').disabled = true;
  $('busy').appear();
}
function valid_part_name() {
  var partNameField = $('part-name-field');
  var name = partNameField.value.downcase().strip();
  var result = true;
  if (name == '') {
    alert('Part name cannot be empty.');
    return false;
  }
  tabControl.tabs.each(function(pair){
    if (tabControl.tabs.get(pair.key).caption == name) {
      result = false;
      alert('Part name must be unique.');
      throw $break;
    }
  })
  return result;
}
function center(element) {
  var header = $('header')
  element = $(element);
  element.style.position = 'absolute';
  var dim = Element.getDimensions(element);
  var top = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
  element.style.top = (top + 200) + 'px';
  element.style.left = ((header.offsetWidth - dim.width) / 2) + 'px';
}
function toggle_add_part_popup() {
  var popup = $('add-part-popup');
  var partNameField = $('part-name-field');
  center(popup);
  Element.toggle(popup);
  Field.focus(partNameField);
}


text:
package stacks

import "github.com/emirpasic/gods/containers"

type Stack interface {
	Push(value interface{})
	Pop() (value interface{}, ok bool)
	Peek() (value interface{}, ok bool)

	containers.Container
	// Empty() bool
	// Size() int
	// Clear()
	// Values() []interface{}
}


text:
<?php

namespace Esier\Http;

use GuzzleHttp\Client;

class GuzzleHttp implements HttpInterface
{
    /*
    *	Client instance
    *
    *	@var GuzzleHttp\Client
    */
    private $client;

    /*
    *	Create the object
    *
    *	@param array $config
    *
    *	@return void
    */
    public function __construct(array $config)
    {
        $this->client = new Client($config);
    }

    /*
    *	Handle a request with the client
    *
    *	@param string $method
    *	@param string $uri
    *	@param array $settings
    *
    *	@return Esier\Http\APIResponse
    */
    public function request(string $method, string $uri, array $settings) : APIResponse
    {
        $response = $this->client->request($method, $uri, $settings);

        return new APIResponse(
            $response->getStatusCode(),
            $response->getReasonPhrase(),
            $response->getHeaders(),
            (string) $response->getBody()
        );
    }
}