text:
'use strict';

var url = require('url');
var EventEmitter = require('events').EventEmitter;
var inherits = require('util').inherits;
var _ = require('lodash');
var propagate = require('propagate');

// skiff parts
var Skiff = require('skiff-redis');
var Gossip = require('sombrero-gossip');
var defaultOptions = require('./defaultOptions.js');
var Peer = require('./peer.js');
var callbackQueue = require('callback-queue');

/**
 * Creates task dispatcher node
 * @param {String} skiffURL
 * @param {Object} options
 */
function Node(skiffURL, options) {
    var connectionData;

    // instanciate ee
    EventEmitter.call(this);

    // bind methods and get default options
    _.bindAll(this);
    _.defaults(options, defaultOptions);

    if (!skiffURL) {
        throw new Error('need skiff URL');
    }

    this.id = skiffURL;
    this._options = options;

    this.callbackQueue = callbackQueue;

    // init metadata
    connectionData = url.parse(skiffURL);
    this.metadata = {
        gossipPort: options.gossip.port,
        hostname: connectionData.hostname,
        port: options.port
    };
    options.skiff.metadata = this.metadata;

    // init skiff node
    // determines cluster leader and performs fail over if leader dies
    this.skiff = new Skiff(skiffURL, options.skiff);
    this.skiff.on('joined', this._onPeerJoined);
    this.skiff.on('reconnected', this._onPeerJoined);
    this.skiff.on('leader', this._onLeader);
    this.skiff.on('left', this._removePeerGossip);

    propagate(this.skiff, this);

    // setup gossip cluster - basically in-memory shared storage
    // useful for holding shared cluster state
    this._remotes = {};
    this._remoteIds = [];

    // these proxy methods will grant access to other operations that are
    // defined in _allowedRemoteCalls variable
    this._remoteCallMethods = _.keys(this._allowedRemoteCalls);

    // instantiate transport server
    this._transportServer = options.transport.listen(options.port, options.hostname, _.pick(this, this._remoteCallMethods), this._transportListening);
    this._transportServer.on('error', this._proxyError);

    this.gossip = new Gossip(this._options.gossip);
    this.gossip.on('error', this._proxyError);
    this.gossip.on('cluster change', this._onGossipClusterChange);
}
inherits(Node, EventEmitter);

/**
 * Static function: attaches remote call
 * @param {String}   name     - resource name
 * @param {Function} function - function to perform, will be invoked with local scope
 */
Node.attachRemoteCall = function (name, method) {
    if (typeof Node.prototype[name] !== 'undefined') {
        throw new Error('Function ' + name + ' is already defined');
    }

    Node.prototype._allowedRemoteCalls[name] = true;
    Node.prototype[name] = method;
};

//
// Cluster rpc-allowed operations
//

/**
 * Method that can be performed by an RPC call
 * @type {Object}
 */
Node.prototype._allowedRemoteCalls = {
    getsetnx: true,
    update: true
};

/**
 * Returns operation key that is used for callback caching
 * @return {String}
 */
Node.prototype.ok = function () {
    var length = arguments.length;
    if (length === 0) {
        throw new Error('arguments must not be empty');
    }

    var arr = new Array(length);
    for (var i = 0; i < length; i++) {
        arr[i] = arguments[i];
    }

    return arr.join('~');
};

/**
 * Get resourceId of resourceType, if not exists - create it first.
 * The operation flow is the following: check local storage (gossip cluster),
 * if there is no result of this operation, queue this operation locally
 * and make a remote call
 *
 * @param  {String}   resourceId   - unique resource id, used for request queueing
 * @param  {String}   resourceType - resource type, determines what has to be done
 * @param  {Array}    args         - args to be applied to resource type
 * @param  {Function} next         - invoked when method completes
 *
 */
Node.prototype.getsetnx = function (resourceId, resourceType, args, next) {

    if (typeof resourceId !== 'string' || !resourceId) {
        return setImmediate(next, new Error('resourceId must be a truthy string'));
    }

    if (typeof resourceType !== 'string' || !this._allowedRemoteCalls[resourceType]) {
        return setImmediate(next, new Error('remote call ' + resourceType + ' is not allowed'));
    }

    var cluster = this.gossip.cluster;
    var operationKey = [ resourceType, resourceId ].join('~');
    var operationResult = cluster.get(operationKey);

    if (operationResult !== null && operationResult !== undefined) {
        return setImmediate(next, null, operationResult);
    }

    var callback = callbackQueue.add(operationKey, next);
    if (!callback) {
        // callback will be invoked later when ongoing operation will be completed
        return;
    }

    var currentLeader = cluster.get('leader');
    if (currentLeader === this.id) {
        args.unshift(operationKey, resourceId);
        args.push(callback);
        return this[resourceType].apply(this, args);
    }

    // push args there
    args.unshift(resourceId, resourceType);

    setImmediate(this._remoteCall, currentLeader, 'getsetnx', args, callback);
};

/**
 * Deletes specific resource type from shared storage, can be performed from either node
 * @param  {String}   resourceId
 * @param  {String}   resourceType
 * @param  {Function} next
 */
Node.prototype.del = function (resourceId, resourceType, next) {
    this.update(resourceId, resourceType, null, next);
};

/**
 * Updates specific resource type from shared storage, can be performed from either node
 *
 * @param  {String}   resourceId
 * @param  {String}   resourceType
 * @param  {Mixed}    value
 * @param  {Function} next
 *
 */
Node.prototype.update = function (resourceId, resourceType, value, next) {

    if (typeof resourceId !== 'string' || !resourceId) {
        return setImmediate(next, new Error('resourceId must be a truthy string'));
    }

    if (typeof resourceType !== 'string' || !this._allowedRemoteCalls[resourceType]) {
        return setImmediate(next, new Error('remote call ' + resourceType + ' is not allowed'));
    }

    if (value === undefined) {
        return setImmediate(next, new Error('value cant be set to undefined'));
    }

    var cluster = this.gossip.cluster;
    var operationKey = [ resourceType, resourceId ].join('~');
    var currentValue = cluster.get(operationKey);

    if (currentValue === value) {
        return setImmediate(next);
    }

    var currentLeader = cluster.get('leader');
    if (currentLeader === this.id) {
        cluster.set(operationKey, value);
        return setImmediate(next);
    }

    setImmediate(this._remoteCall, currentLeader, 'update', [ resourceId, resourceType, value ], next);
};

//
// Cluster topology section, public
//

Node.prototype.join = function join(url, options, next) {
    this.skiff.join(url, options || null, next);
};

Node.prototype.leave = function leave(url, next) {
    this.skiff.leave(url, next);
};

Node.prototype.open = function open(next) {
    this.skiff.open(next);
};

Node.prototype.close = function close(next) {
    var self = this;
    this._transportServer.close(function () {
        self.gossip.stop(function () {
            self.skiff.close(next);
        });
    });
};

//
// cluster setup section, private
//

/**
 * Performs RPC call
 * @param {String}   node   - node id to perform the operation on
 * @param {String}   method - method to invoke
 * @param {Array}    args   - arguments to pass
 * @param {Function} next   - callback that will be eventually called
 */
Node.prototype._remoteCall = function (node, method, args, next) {
    var remote = this._remote(node);
    var invoke = function (client) {
        var m = client[method];
        if (!m) {
            return next(new Error('Method not found: ' + method));
        }
        args.push(next);
        m.apply(client, args);
    };

    if (!remote) {
        return next(new Error('could not find remote metadata for URL ' + node));
    } else if (remote.connected) {
        invoke(remote.client);
    } else {
        remote.once('connect', invoke);
    }
};

/**
 * Establishes peer connection when it's first required to
 * @param  {String} node - node id
 * @return {TransportConnection}
 */
Node.prototype._remote = function (node) {
    var remote = this.peerOnline(node);
    if (!remote) {
        var meta = this.skiff.peerMeta(node);
        if (meta) {
            remote = this._remotes[node] = new Peer(this._remoteCallMethods, meta.hostname, meta.port);
        }
    }

    return remote;
};

/**
 * Returns peer reference or null/undefined if it's not online
 * @param {String} node id
 */
Node.prototype.peerOnline = function (node) {
    return this._remotes[node];
};

/**
 * Returns random peer or self
 */
Node.prototype.randomPeerOrSelf = function () {
    var id = _.sample(this._remoteIds);

    if (!id) {
        // if we do not have followers, perform operation locally
        return this;
    }

    return this._remotes[id];
};

/**
 * Sets waitForNode option. It means that operation will only complete
 * after the command that was performed on the leader is propagated to the
 * local client
 *
 * @param {Object} options
 * @param {String} nodeId - optionally overwrite, which node we are waiting to commit
 */
Node.prototype._waitForNode = function (options, nodeId) {
    if (!options) {
        options = {};
    }
    options.waitForNode = nodeId || this.id;
    return options;
};

/**
 * When peer joins cluster, make it join gossip cluster as well
 * @param {Object} peer
 */
Node.prototype._onPeerJoined = function (peer) {
    if (peer && peer.id !== this.id && peer.metadata && peer.metadata.gossipPort) {
        this.gossip.addPeer({
            id: peer.id,
            hostname: peer.metadata.hostname,
            port: peer.metadata.gossipPort
        });
    }
};

/**
 * When node becomes a leader, set appropriate record in the shared doc
 */
Node.prototype._onLeader = function () {
    this._gossipLeader(this.id);
};

/**
 * When peer disconnected, remove it from shared store, too
 * @param {Object} peer
 */
Node.prototype._removePeerGossip = function (peer) {
    var idx = this._remoteIds.indexOf(peer.id);
    if (idx >= 0) {
        this._remoteIds.splice(idx, 1);
    }
    this._remotes[peer.id] = null;
    this.gossip.removePeer(peer.id);
};

/**
 * Promote this node to leader on the gossip cluster
 * @param {String} leaderId
 */
Node.prototype._gossipLeader = function (leaderId) {
    var cluster = this.gossip.cluster;
    var currentLeader = cluster.get('leader');
    if (currentLeader !== leaderId) {
        cluster.set('leader', leaderId);
    }
};

/**
 * Notifies when transport (gossip cluster) had connected to it
 * @param {Error} err
 */
Node.prototype._transportListening = function (err) {
    if (err) {
        this.emit('error', err);
        return;
    }

    this.emit('transport-connected');
};

/**
 * Proxies error emitted by some other EE
 * @param {Error} err
 */
Node.prototype._proxyError = function (err) {
    if (err) {
        this.emit('error', err);
    }
};

/**
 * Emitted when cluster change event was emitted on the gossip cluster
 */
Node.prototype._onGossipClusterChange = function () {
    this.emit('cluster change');
};

module.exports = Node;


text:
package fp4g.data.operators;

import fp4g.core.IValue;

public interface ISubtractable
{
	public IValue<?> sub(IValue<?> right);
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>


text:
package org.freeeed.search.web.session;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.freeeed.search.web.utils.WebConstants;
import org.freeeed.search.web.controller.commons.SecureController;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
 *
 * The Application Session Interceptor
 *
 * @author ilazarov
 *
 */
public class SessionInterceptor extends HandlerInterceptorAdapter {
	private static final Logger log = Logger.getLogger(SessionInterceptor.class);

	private boolean isFreePage(Object handle) {
		return !(handle instanceof SecureController);
	}

	public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object handle) throws Exception {
		HttpSession session = req.getSession();
		SiteVisitor siteVisitor = null;
		LoggedSiteVisitor loggedSiteVisitor = (LoggedSiteVisitor) session.getAttribute(WebConstants.LOGGED_SITE_VISITOR_SESSION_KEY);

		if (!isFreePage(handle)) {
			log.debug("The page is NOT free for not logged users!");
			if (loggedSiteVisitor == null) {
				log.debug("The user is not logged in, will redirect the login required page!");

				redirectToLoginRequired(res);
				return false;
			}
		}

		log.debug("The page is free for not logged users!");

		if (handle instanceof SiteVisitorAware) {
			siteVisitor = (SiteVisitor) session.getAttribute(WebConstants.SITE_VISITOR_SESSION_KEY);
			if (siteVisitor == null) {
				siteVisitor = new SiteVisitor();
				siteVisitor.setVisitorIP(req.getRemoteHost());

				session.setAttribute(WebConstants.SITE_VISITOR_SESSION_KEY, siteVisitor);
			}

			((SiteVisitorAware) handle).setSiteVisitor(siteVisitor);
		}

		if (handle instanceof LoggedSiteVisitorAware) {
			((LoggedSiteVisitorAware) handle).setLoggedVisitor(loggedSiteVisitor);
		}

		return true;
	}

	private void redirectToLoginRequired(HttpServletResponse res) throws IOException {
        String url = res.encodeRedirectURL(WebConstants.LOGIN_REQUIRED_PAGE);
        res.sendRedirect(url);
	}
}


text:
package diff_test

import (
	"testing"

	"github.com/PieterD/diff"
)

func TestDeltaString(t *testing.T) {
	if diff.Left.String() != "Left" {
		t.Fatalf("Expected Left, got %s", diff.Left.String())
	}
	if diff.Right.String() != "Right" {
		t.Fatalf("Expected Right, got %s", diff.Right.String())
	}
	if diff.Both.String() != "Both" {
		t.Fatalf("Expected Both, got %s", diff.Both.String())
	}
	if diff.Delta(55).String() != "unknown" {
		t.Fatalf("Expected unknown, got %s", diff.Delta(55).String())
	}
}


text:
package pl.touk.nussknacker.engine.kafka.source.flink

import io.circe.generic.JsonCodec
import io.circe.{Decoder, Encoder}
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.kafka.clients.consumer.ConsumerRecord
import org.apache.kafka.clients.producer.{ProducerRecord, RecordMetadata}
import org.apache.kafka.common.header.Headers
import org.apache.kafka.common.record.TimestampType
import org.apache.kafka.common.serialization.{Deserializer, StringDeserializer}
import org.scalatest.Assertion
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
import pl.touk.nussknacker.engine.api.CirceUtil.decodeJsonUnsafe
import pl.touk.nussknacker.engine.api.DisplayJsonWithEncoder
import pl.touk.nussknacker.engine.api.process.ProcessObjectDependencies
import pl.touk.nussknacker.engine.kafka.consumerrecord.{ConsumerRecordDeserializationSchemaFactory, ConsumerRecordToJsonFormatterFactory}
import pl.touk.nussknacker.engine.kafka.serialization.schemas.BaseSimpleSerializationSchema
import pl.touk.nussknacker.engine.kafka.source.KafkaSourceFactory
import pl.touk.nussknacker.engine.kafka.source.flink.KafkaSourceFactoryMixin._
import pl.touk.nussknacker.engine.kafka.{ConsumerRecordUtils, KafkaConfig, KafkaSpec, serialization}
import pl.touk.nussknacker.engine.util.namespaces.ObjectNamingProvider
import pl.touk.nussknacker.test.PatientScalaFutures

import java.nio.charset.StandardCharsets
import java.util.Optional
import scala.reflect.ClassTag

trait KafkaSourceFactoryMixin extends AnyFunSuite with Matchers with KafkaSpec with PatientScalaFutures {

  val sampleValue: SampleValue = SampleValue("first", "last")
  val sampleKey: SampleKey = SampleKey("one", 2L)
  val sampleHeadersMap: Map[String, String] = Map("headerOne" -> "valueOfHeaderOne", "headerTwo" -> null)
  val sampleHeaders: Headers = ConsumerRecordUtils.toHeaders(sampleHeadersMap)

  val sampleTopic = "topic"
  val constTimestamp: Long = 123L
  lazy val kafkaConfig: KafkaConfig = KafkaConfig.parseConfig(config)

  lazy val processObjectDependencies: ProcessObjectDependencies = ProcessObjectDependencies(config, ObjectNamingProvider(getClass.getClassLoader))

  protected def objToSerializeSerializationSchema(topic: String): serialization.KafkaSerializationSchema[Any] = new BaseSimpleSerializationSchema[ObjToSerialize](
    topic,
    obj => Option(obj.value).map(v => implicitly[Encoder[SampleValue]].apply(v).noSpaces).orNull,
    obj => Option(obj.key).map(k => implicitly[Encoder[SampleKey]].apply(k).noSpaces).orNull,
    obj => ConsumerRecordUtils.toHeaders(obj.headers)
  ).asInstanceOf[serialization.KafkaSerializationSchema[Any]]

  protected def createTopic(name: String, partitions: Int = 1): String = {
    kafkaClient.createTopic(name, partitions = partitions)
    name
  }

  protected def pushMessage(kafkaSerializer: serialization.KafkaSerializationSchema[Any], obj: AnyRef, topic: String, partition: Option[Int] = None, timestamp: Long = 0L): RecordMetadata = {
    val record: ProducerRecord[Array[Byte], Array[Byte]] = kafkaSerializer.serialize(obj, timestamp)
    kafkaClient.sendRawMessage(topic = record.topic(), key = record.key(), content = record.value(), partition = partition, timestamp = record.timestamp(), headers = record.headers()).futureValue
  }

  protected def checkResult[K, V](a: ConsumerRecord[K, V], b: ConsumerRecord[K, V]): Assertion = {
    // "a shouldEqual b" raises TestFailedException so here compare field by field
    a.topic() shouldEqual b.topic()
    a.partition() shouldEqual b.partition()
    a.offset() shouldEqual b.offset()
    a.timestamp() shouldEqual b.timestamp()
    a.timestampType() shouldEqual b.timestampType()
    // skipping checksum, deprecated and when event is read from topic it comes with calculated checksum
    // skipping serializedKeySize and serializedValueSize
    a.key() shouldEqual b.key()
    a.value() shouldEqual b.value()
    a.headers() shouldEqual b.headers()
    a.leaderEpoch() shouldEqual b.leaderEpoch()
  }

  protected lazy val StringSourceFactory: KafkaSourceFactory[Any, Any] = {
    val deserializationSchemaFactory = new SampleConsumerRecordDeserializationSchemaFactory(new StringDeserializer with Serializable, new StringDeserializer with Serializable)
    val formatterFactory = new ConsumerRecordToJsonFormatterFactory[String, String]
    val sourceFactory = new KafkaSourceFactory(
      deserializationSchemaFactory,
      formatterFactory,
      processObjectDependencies,
      new FlinkKafkaSourceImplFactory(None)
    )
    sourceFactory.asInstanceOf[KafkaSourceFactory[Any, Any]]
  }

  protected lazy val SampleEventSourceFactory: KafkaSourceFactory[Any, Any] = {
    val deserializationSchemaFactory = new SampleConsumerRecordDeserializationSchemaFactory(new StringDeserializer with Serializable, sampleValueJsonDeserializer)
    val formatterFactory = new ConsumerRecordToJsonFormatterFactory[String, SampleValue]
    val sourceFactory = new KafkaSourceFactory(
      deserializationSchemaFactory,
      formatterFactory,
      processObjectDependencies,
      new FlinkKafkaSourceImplFactory(None)
    )
    sourceFactory.asInstanceOf[KafkaSourceFactory[Any, Any]]
  }

  protected lazy val ConsumerRecordValueSourceFactory: KafkaSourceFactory[Any, Any] = {
    val deserializationSchemaFactory = new SampleConsumerRecordDeserializationSchemaFactory(new StringDeserializer with Serializable, sampleValueJsonDeserializer)
    val formatterFactory = new ConsumerRecordToJsonFormatterFactory[String, SampleValue]
    val sourceFactory = new KafkaSourceFactory(
      deserializationSchemaFactory,
      formatterFactory,
      processObjectDependencies,
      new FlinkKafkaSourceImplFactory(None)
    )
    sourceFactory.asInstanceOf[KafkaSourceFactory[Any, Any]]
  }

  protected lazy val ConsumerRecordKeyValueSourceFactory: KafkaSourceFactory[Any, Any] = {
    val deserializationSchemaFactory = new SampleConsumerRecordDeserializationSchemaFactory(sampleKeyJsonDeserializer, sampleValueJsonDeserializer)
    val formatterFactory = new ConsumerRecordToJsonFormatterFactory[SampleKey, SampleValue]
    val sourceFactory = new KafkaSourceFactory(
      deserializationSchemaFactory,
      formatterFactory,
      processObjectDependencies,
      new FlinkKafkaSourceImplFactory(None)
    )
    sourceFactory.asInstanceOf[KafkaSourceFactory[Any, Any]]
  }
}

object KafkaSourceFactoryMixin {

  @JsonCodec case class SampleKey(partOne: String, partTwo: Long) extends DisplayJsonWithEncoder[SampleKey]
  @JsonCodec case class SampleValue(id: String, field: String) extends DisplayJsonWithEncoder[SampleValue]
  @JsonCodec case class ObjToSerialize(value: SampleValue, key: SampleKey, headers: Map[String, String])

  implicit val sampleKeyTypeInformation: TypeInformation[SampleKey] = TypeInformation.of(classOf[SampleKey])
  implicit val sampleValueTypeInformation: TypeInformation[SampleValue] = TypeInformation.of(classOf[SampleValue])
  implicit val stringTypeInformation: TypeInformation[String] = TypeInformation.of(classOf[String])

  val sampleKeyJsonDeserializer: Deserializer[SampleKey] = createDeserializer[SampleKey]
  val sampleValueJsonDeserializer: Deserializer[SampleValue] = createDeserializer[SampleValue]

  def createDeserializer[T: Decoder]: Deserializer[T] = new Deserializer[T] with Serializable {
    override def deserialize(topic: String, data: Array[Byte]): T = decodeJsonUnsafe[T](data)
  }

  def createConsumerRecord[Key, Value](topic: String, partition: Int, offset: Long, timestamp: Long, timestampType: TimestampType, key: Key, value: Value, headers: Headers, leaderEpoch: Optional[Integer]): ConsumerRecord[Key, Value] = {
    new ConsumerRecord(topic, partition, offset,
      timestamp, timestampType,
      ConsumerRecord.NULL_SIZE, ConsumerRecord.NULL_SIZE,
      key, value, headers,
      leaderEpoch
    )
  }

  def serialize[T: Encoder](data: T): Array[Byte] = Encoder[T].apply(data).noSpaces.getBytes(StandardCharsets.UTF_8)

  def serializeKeyValue(key: Option[String], value: String): (Array[Byte], Array[Byte]) = (key.map(_.getBytes(StandardCharsets.UTF_8)).orNull, value.getBytes(StandardCharsets.UTF_8))
  def serializeKeyValue[V:Encoder](key: Option[String], value: V): (Array[Byte], Array[Byte]) = (key.map(_.getBytes(StandardCharsets.UTF_8)).orNull, serialize[V](value))
  def serializeKeyValue[K:Encoder, V:Encoder](key: Option[K], value: V): (Array[Byte], Array[Byte]) = (key.map(serialize[K]).orNull, serialize[V](value))

}

class SampleConsumerRecordDeserializationSchemaFactory[K: ClassTag, V: ClassTag](keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V])
  extends ConsumerRecordDeserializationSchemaFactory[K, V] {
  override protected def createKeyDeserializer(kafkaConfig: KafkaConfig): Deserializer[K] = keyDeserializer
  override protected def createValueDeserializer(kafkaConfig: KafkaConfig): Deserializer[V] = valueDeserializer
}


text:
{% from 'message_box.html' import message_box %}
{% from '_sortable_list.html' import sortable_list %}

            {%- trans %}Add new field{% endtrans -%}

            {% for form_type in custom_field_types %}

                        {{ form_type.friendly_name }}

            {% endfor %}

    {% set abstract_content_item = {'id': 'content', 'title': _("Abstracts content")} %}
    {% call(item) sortable_list([abstract_content_item], draggable=false, invisible_handle=true,
                                id='contributions-fixed-fields', classes='tiles') %}

    {% endcall %}

    {% if custom_fields %}
        {% call(custom_field) sortable_list(custom_fields, id="contributions-custom-fields", classes='tiles disable-if-locked') %}

        {% endcall %}
    {% else %}
        {%- call message_box('info') %}
            {%- trans %}There are no custom contribution fields yet.{% endtrans %}
        {%- endcall %}
    {% endif %}

        <button class="i-button big" data-button-back>{% trans %}Close{% endtrans %}</button>


text:
package org.apache.isis.viewer.wicket.model.hints;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;

public class IsisSelectorEvent extends IsisEventLetterAbstract {

    private final Component component;
    private final String hintKey;
    private final String hintValue;

    public IsisSelectorEvent(
            final Component component,
            final String hintKey,
            final String hintValue,
            final AjaxRequestTarget target) {
        super(target);
        this.component = component;
        this.hintKey = hintKey;
        this.hintValue = hintValue;
    }

    public String hintFor(Component component, String hintKey) {
        return this.component == component && this.hintKey == hintKey ? hintValue : null;
    }
}


text:
require 'test/unit'

class JpmobileEmoticonFilterTest < Test::Unit::TestCase
  # Replace this with your real tests.
  def test_this_plugin
    flunk
  end
end


text:
import set from 'lodash/set'
import cloneDeep from 'lodash/cloneDeep'
import { types } from '../actions/frontend'

/**
 * The initial frontend state. Add variables as you like.
 */
const initialState = {
    navigation: {
        visible: false,
    },
    filters: {
        visible: false,
    },
    modalConfirm: {
        visible: false,
        // other parts of the modalConfirm state come from `action.options`
    },
    pageNotFound: {
        message: 'The requested page could not be found.',
    },
    blockUI: false,
    bottomBar: {
        visible: false,
    },
    reload: {},
}

/**
 * Returns a copy of the state with a new value of the given variable
 */
function transit(state, variable, value) {
    // FIXME: deep copying of the whole state can be eventually slow...
    const newState = cloneDeep(state)
    set(newState, variable, value)
    return newState
}

export default function (state = initialState, action) {
    // A simpler transit function:
    const t = (variable, value) => transit(state, variable, value)

    switch (action.type) {
        case types.SHOW_NAVIGATION:
            return t('navigation.visible', true)
        case types.HIDE_NAVIGATION:
            return t('navigation.visible', false)
        case types.TOGGLE_NAVIGATION:
            return t('navigation.visible', !state.navigation.visible)
        case types.SHOW_FILTERS:
            return t('filters.visible', true)
        case types.HIDE_FILTERS:
            return t('filters.visible', false)
        case types.TOGGLE_FILTERS:
            return t('filters.visible', !state.filters.visible)
        case types.SHOW_MODAL_CONFIRM:
            return t('modalConfirm', Object.assign({ visible: true }, action.options))
        case types.HIDE_MODAL_CONFIRM:
            return t('modalConfirm', { visible: false })
        case types.PAGE_NOT_FOUND_MESSAGE:
            return t('pageNotFound', { message: action.message })
        case types.SHOW_BLOCK_OVERLAY:
            return t('blockUI', true)
        case types.HIDE_BLOCK_OVERLAY:
            return t('blockUI', false)
        case types.SHOW_BOTTOMBAR:
            return t('bottomBar.visible', true)
        case types.HIDE_BOTTOMBAR:
            return t('bottomBar.visible', false)
        case types.TOGGLE_BOTTOMBAR:
            return t('bottomBar.visible', !state.bottomBar.visible)
        case types.RELOAD_FIELD:
            return t('reload', Object.assign({}, state.reload, { [action.fieldId]: true }))
        case types.FIELD_RELOADED:
            return t('reload', Object.assign({}, state.reload, { [action.fieldId]: false }))
        default:
            return state
    }
}


text:
require 'spec_helper'

describe DroidProj::Runner do
  BASIC_DROIDFILE = %Q{
magic
block_magic do
  3
end}

  WORKING_DROIDFILE = %Q{
res do
  drawable 'back_icon' do
    hdpi './images/back@hdpi.png'
    ldpi './images/back@ldpi.png'
    mdpi './images/back.png'
  end
end}

  TEST_FOLDER = File.join(File.dirname(__FILE__), 'runnable_spec')

  before do
    FileUtils.mkdir TEST_FOLDER
    FileUtils.cp_r SPEC_RESOURCES, File.join(TEST_FOLDER, 'images')

    droidfile = File.join(TEST_FOLDER, 'Droidfile')
    File.open(droidfile, 'w') { |f| f.write(WORKING_DROIDFILE) }

    @runner = DroidProj::Runner.new
  end

  after do
    FileUtils.rm_rf TEST_FOLDER
  end

  describe "#eval_droidfile" do
    before do
      @temp_droidfile = File.join(File.dirname(__FILE__), '_droidfile')
      File.open(@temp_droidfile, 'w') { |file|
        file.write(BASIC_DROIDFILE)
      }
    end

    after do
      FileUtils.rm_f @temp_droidfile
    end

    it "should call methods of Android::App" do
      @runner.droidfile = @temp_droidfile
      @runner.app = Object.new.tap do |o|
        def o.magic
          @magic = true
        end

        def o.block_magic(&block)
          @block_magic = block.call
        end
      end

      @runner.eval_droidfile

      @runner.app.instance_variable_get("@magic").should == true
      @runner.app.instance_variable_get("@block_magic").should == 3
    end
  end

  describe ".run" do
    before do
     @original_dir = Dir.pwd
     Dir.chdir(TEST_FOLDER)
    DroidProj::Logger.logger.enabled = true
    end

    after do
      Dir.chdir @original_dir
      DroidProj::Logger.logger.enabled = false
    end

    it "should create the correct filesystem" do
      DroidProj::Runner.run

      ['drawable', 'drawable-hdpi', 'drawable-ldpi', 'drawable-mdpi'].each do |folder|
        Dir.exists?(File.join(TEST_FOLDER, 'res', folder)).should == true
        if folder != 'drawable'
          File.exists?(File.join(TEST_FOLDER, 'res', folder, "#{DroidProj::Android::Drawable::FINAL_FILE_PREFIX}back_icon.png")).should == true
        else
          File.exists?(File.join(TEST_FOLDER, 'res', folder, 'back_icon.xml')).should == true
        end
      end
    end
  end
end


text:
layout: post
title: Pierced and tattooed mom Kasey Storm fucking
titleinfo: pornvd
desc: Watch Pierced and tattooed mom Kasey Storm fucking. Pornhub is the ultimate xxx porn and sex site.
---

Pierced and tattooed mom Kasey Storm fucking

Watch Pierced and tattooed mom Kasey Storm fucking. Pornhub is the ultimate xxx porn and sex site.


text:
/* NetHack 3.6	macerrs.c	$NHDT-Date: 1432512797 2015/05/25 00:13:17 $  $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Michael Hamel, 1991 */
/* NetHack may be freely redistributed.  See license for details. */

#if defined(macintosh) && defined(__SC__) && !defined(__FAR_CODE__)
/* this needs to be resident always */
#pragma segment Main
#endif

#include "hack.h"
#include "macwin.h"
#if !TARGET_API_MAC_CARBON
#include <Dialogs.h>
#include <TextUtils.h>
#include <Resources.h>
#endif

void
error(const char *format, ...)
{
    Str255 buf;
    va_list ap;

    va_start(ap, format);
    vsprintf((char *) buf, format, ap);
    va_end(ap);

    C2P((char *) buf, buf);
    ParamText(buf, (StringPtr) "", (StringPtr) "", (StringPtr) "");
    Alert(128, (ModalFilterUPP) NULL);
    ExitToShell();
}

#if 0 /* Remainder of file is obsolete and will be removed */

#define stackDepth 1
#define errAlertID 129
#define stdIOErrID 1999

static Str255 gActivities[stackDepth] = {""};
static short gTopactivity = 0;

void showerror(char * errdesc, const char * errcomment)
{
	short		itemHit;
	Str255		paserr,
				pascomment;

	SetCursor(&qd.arrow);
	if (errcomment == nil) errcomment = "";
	C2P (errcomment, pascomment);
	C2P (errdesc, paserr);
	ParamText(paserr,pascomment,gActivities[gTopactivity],(StringPtr)"");
	itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
}

Boolean itworked(short errcode)
/* Return TRUE if it worked, do an error message and return false if it didn't. Error
   strings for native C errors are in STR#1999, Mac errs in STR 2000-errcode, e.g
   2108 for not enough memory */

{
	if (errcode != 0) {
		short		 itemHit;
		Str255 		 errdesc;
		StringHandle strh;

		errdesc[0] = '\0';
		if (errcode > 0) GetIndString(errdesc,stdIOErrID,errcode);  /* STDIO file rres, etc */
		else {
			strh = GetString(2000-errcode);
			if (strh != (StringHandle) nil) {
				memcpy(errdesc,*strh,256);
				ReleaseResource((Handle)strh);
			}
		}
		if (errdesc[0] == '\0') {  /* No description found, just give the number */
			sprintf((char *)&errdesc[1],"a %d error occurred",errcode);
			errdesc[0] = strlen((char*)&errdesc[1]);
		}
		SetCursor(&qd.arrow);
		ParamText(errdesc,(StringPtr)"",gActivities[gTopactivity],(StringPtr)"");
		itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
	}
	return(errcode==0);
}

void mustwork(short errcode)
/* For cases where we can't recover from the error by any means */
{
	if (itworked(errcode)) ;
	else ExitToShell();
}

#if defined(USE_STDARG) || defined(USE_VARARGS)
#ifdef USE_STDARG
static void vprogerror(const char *line, va_list the_args);
#else
static void vprogerror();
#endif

/* Macro substitute for error() */
void error VA_DECL(const char *, line)
{
	VA_START(line);
	VA_INIT(line, char *);
	vprogerror(line, VA_ARGS);
	VA_END();
}

#ifdef USE_STDARG
static void
vprogerror(const char *line, va_list the_args)
#else
static void
vprogerror(line, the_args) const char *line; va_list the_args;
#endif

#else /* USE_STDARG | USE_VARARG */

void
error VA_DECL(const char *, line)
#endif
{  /* opening brace for vprogerror(), nested block for USE_OLDARG error() */
	char pbuf[BUFSZ];

	if(index(line, '%')) {
		Vsprintf(pbuf,line,VA_ARGS);
		line = pbuf;
	}
	showerror("of an internal error",line);

#if !(defined(USE_STDARG) || defined(USE_VARARGS))
        VA_END();  /* provides closing brace for USE_OLDARGS's nested block */
#endif
}

void attemptingto(char * activity)
/* Say what we are trying to do for subsequent error-handling: will appear as x in an
   alert in the form "Could not x because y" */
{	C2P(activity,gActivities[gTopactivity]);
}

void comment(char *s, long n)
{
	Str255 paserr;
	short itemHit;

	sprintf((char *)&paserr[1], "%s - %d",s,n);
	paserr[0] = strlen ((char*)&paserr[1]);
	ParamText(paserr,(StringPtr)"",(StringPtr)"",(StringPtr)"");
	itemHit = Alert(128, (ModalFilterUPP)nil);
}

void pushattemptingto(char * activity)
/* Push a new description onto stack so we can pop later to previous state */
{
	if (gTopactivity < stackDepth) {
		gTopactivity++;
		attemptingto(activity);
	}
	else error("activity stack overflow");
}

void popattempt(void)
/* Pop to previous state */
{
	if (gTopactivity > 1) --gTopactivity;
	else error("activity stack underflow");
}

#endif /* Obsolete */


text:
require 'mechanize'
require 'logger'
require 'tempfile'
require 'tmpdir'
require 'webrick'
require 'zlib'

require 'rubygems'

begin
  gem 'minitest'
rescue Gem::LoadError
end

require 'minitest/autorun'

begin
  require 'minitest/pride'
rescue LoadError
end

##
# A generic test case for testing mechanize.  Using a subclass of
# Mechanize::TestCase for your tests will create an isolated mechanize
# instance that won't pollute your filesystem or other tests.
#
# Once Mechanize::TestCase is loaded no HTTP requests will be made outside
# mechanize itself.  All requests are handled via WEBrick servlets.
#
# Mechanize uses WEBrick servlets to test some functionality.  You can run
# other HTTP clients against the servlets using:
#
#   ruby -rmechanize/test_case/server -e0
#
# Which will launch a test server at http://localhost:8000

class Mechanize::TestCase < Minitest::Test

  TEST_DIR = File.expand_path '../../../test', __FILE__
  REQUESTS = []

  ##
  # Creates a clean mechanize instance +@mech+ for use in tests.

  def setup
    super

    REQUESTS.clear
    @mech = Mechanize.new
    @ssl_private_key = nil
    @ssl_certificate = nil
  end

  ##
  # Creates a fake page with URI http://fake.example and an empty, submittable
  # form.

  def fake_page agent = @mech
    uri = URI 'http://fake.example/'
    html = String.new(<<~END)
      <html>
      <body>
      <form><input type="submit" value="submit" /></form>
      </body>
      </html>
    END

    Mechanize::Page.new uri, nil, html, 200, agent
  end

  ##
  # Is the Encoding constant defined?

  def have_encoding?
    Object.const_defined? :Encoding
  end

  ##
  # Creates a Mechanize::Page with the given +body+

  def html_page body
    uri = URI 'http://example/'
    Mechanize::Page.new uri, nil, body, 200, @mech
  end

  ##
  # Creates a Mechanize::CookieJar by parsing the given +str+

  def cookie_jar str, uri = URI('http://example')
    Mechanize::CookieJar.new.tap do |jar|
      jar.parse str, uri
    end
  end

  ##
  # Runs the block inside a temporary directory

  def in_tmpdir
    Dir.mktmpdir do |dir|
      Dir.chdir dir do
        yield
      end
    end
  end

  ##
  # Creates a Nokogiri Node +element+ with the given +attributes+

  def node element, attributes = {}
    Nokogiri::XML::Node.new(element, Nokogiri::HTML::Document.new).tap do |node|
      attributes.each do |name, value|
        node[name] = value
      end
    end
  end

  ##
  # Creates a Mechanize::Page for the given +uri+ with the given
  # +content_type+, response +body+ and HTTP status +code+

  def page uri, content_type = 'text/html', body = String.new, code = 200
    uri = URI uri unless URI::Generic === uri

    Mechanize::Page.new(uri, { 'content-type' => content_type }, body, code,
                        @mech)
  end

  ##
  # Requests made during this tests

  def requests
    REQUESTS
  end

  ##
  # An SSL private key.  This key is the same across all test runs

  def ssl_private_key
    @ssl_private_key ||= OpenSSL::PKey::RSA.new <<-KEY
-----BEGIN RSA PRIVATE KEY-----
MIG7AgEAAkEA8pmEfmP0Ibir91x6pbts4JmmsVZd3xvD5p347EFvBCbhBW1nv1Gs
bCBEFlSiT1q2qvxGb5IlbrfdhdgyqdTXUQIBAQIBAQIhAPumXslvf6YasXa1hni3
p80joKOug2UUgqOLD2GUSO//AiEA9ssY6AFxjHWuwo/+/rkLmkfO2s1Lz3OeUEWq
6DiHOK8CAQECAQECIQDt8bc4vS6wh9VXApNSKIpVygtxSFe/IwLeX26n77j6Qg==
-----END RSA PRIVATE KEY-----
    KEY
  end

  ##
  # An X509 certificate.  This certificate is the same across all test runs

  def ssl_certificate
    @ssl_certificate ||= OpenSSL::X509::Certificate.new <<-CERT
-----BEGIN CERTIFICATE-----
MIIBQjCB7aADAgECAgEAMA0GCSqGSIb3DQEBBQUAMCoxDzANBgNVBAMMBm5vYm9k
eTEXMBUGCgmSJomT8ixkARkWB2V4YW1wbGUwIBcNMTExMTAzMjEwODU5WhgPOTk5
OTEyMzExMjU5NTlaMCoxDzANBgNVBAMMBm5vYm9keTEXMBUGCgmSJomT8ixkARkW
B2V4YW1wbGUwWjANBgkqhkiG9w0BAQEFAANJADBGAkEA8pmEfmP0Ibir91x6pbts
4JmmsVZd3xvD5p347EFvBCbhBW1nv1GsbCBEFlSiT1q2qvxGb5IlbrfdhdgyqdTX
UQIBATANBgkqhkiG9w0BAQUFAANBAAAB////////////////////////////////
//8AMCEwCQYFKw4DAhoFAAQUePiv+QrJxyjtEJNnH5pB9OTWIqA=
-----END CERTIFICATE-----
    CERT
  end

  ##
  # Creates a Tempfile with +content+ that is immediately unlinked

  def tempfile content
    Tempfile.new(@NAME).tap do |body_io|
      body_io.unlink
      body_io.write content
      body_io.flush
      body_io.rewind
    end
  end

  ##
  # Returns true if the current platform is a Windows platform
  def windows?
    ::RUBY_PLATFORM =~ /mingw|mswin/
  end

  ##
  # Return the contents of the file without Windows carriage returns
  def file_contents_without_cr(path)
    File.read(path).gsub(/\r\n/, "\n")
  end
end

require 'mechanize/test_case/servlets'

module Net # :nodoc:
end

class Net::HTTP # :nodoc:
  alias :old_do_start :do_start

  def do_start
    @started = true
  end

  PAGE_CACHE = {}

  alias :old_request :request

  def request(req, *data, &block)
    url = URI.parse(req.path)
    path = WEBrick::HTTPUtils.unescape(url.path)

    path = '/index.html' if path == '/'

    res = ::Response.new
    res.query_params = url.query

    req.query = if 'POST' != req.method && url.query then
                  WEBrick::HTTPUtils.parse_query url.query
                elsif req['content-type'] =~ /www-form-urlencoded/ then
                  WEBrick::HTTPUtils.parse_query req.body
                elsif req['content-type'] =~ /boundary=(.+)/ then
                  boundary = WEBrick::HTTPUtils.dequote $1
                  WEBrick::HTTPUtils.parse_form_data req.body, boundary
                else
                  {}
                end

    req.cookies = WEBrick::Cookie.parse(req['Cookie'])

    Mechanize::TestCase::REQUESTS << req

    if servlet_klass = MECHANIZE_TEST_CASE_SERVLETS[path]
      servlet = servlet_klass.new({})
      servlet.send "do_#{req.method}", req, res
    else
      filename = "htdocs#{path.gsub(/[^\/\\.\w\s]/, '_')}"
      unless PAGE_CACHE[filename]
        ::File.open("#{Mechanize::TestCase::TEST_DIR}/#{filename}", 'rb') do |io|
          PAGE_CACHE[filename] = io.read
        end
      end

      res.body = PAGE_CACHE[filename]
      case filename
      when /\.txt$/
        res['Content-Type'] = 'text/plain'
      when /\.jpg$/
        res['Content-Type'] = 'image/jpeg'
      end
    end

    res['Content-Type'] ||= 'text/html'
    res.code ||= "200"

    response_klass = Net::HTTPResponse::CODE_TO_OBJ[res.code.to_s]
    response = response_klass.new res.http_version, res.code, res.message

    res.header.each do |k,v|
      v = v.first if v.length == 1
      response[k] = v
    end

    res.cookies.each do |cookie|
      response.add_field 'Set-Cookie', cookie.to_s
    end

    response['Content-Type'] ||= 'text/html'
    response['Content-Length'] = res['Content-Length'] || res.body.length.to_s

    io = StringIO.new(res.body)
    response.instance_variable_set :@socket, io
    def io.read clen, dest = nil, _ = nil
      if dest then
        dest << super(clen)
      else
        super clen
      end
    end

    body_exist = req.response_body_permitted? &&
      response_klass.body_permitted?

    response.instance_variable_set :@body_exist, body_exist

    yield response if block_given?

    response
  end
end

class Net::HTTPRequest # :nodoc:
  attr_accessor :query, :body, :cookies, :user

  def host
    'example'
  end

  def port
    80
  end
end

class Response # :nodoc:
  include Net::HTTPHeader

  attr_reader :code
  attr_accessor :body, :query, :cookies
  attr_accessor :query_params, :http_version
  attr_accessor :header

  def code=(c)
    @code = c.to_s
  end

  alias :status :code
  alias :status= :code=

    def initialize
      @header = {}
      @body = String.new
      @code = nil
      @query = nil
      @cookies = []
      @http_version = '1.1'
    end

  def read_body
    yield body
  end

  def message
    ''
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cucurbitaria ulmea P. Karst.

### Remarks
null


text:
const winston = require('winston');

class Transport {

  constructor(categoryName, config) {

    // console transport

    config.console_level = config.console_level || 'info';

    const consoleTransport = new (winston.transports.Console)({
      level:     config.console_level,
      label:     categoryName,
      json:      false,
      //handleExceptions: true,
      timestamp: true,

      colorize: true
    });

    return consoleTransport;
  }

}

module.exports = Transport;


text:
package com.google.code.play2.plugin;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class LessDependencyCache
{
    private static final String FILE_HEADER = "format: 1";
    private static final String FILE_DEPENDENCY_PREFIX = "  ";

    private Map<String, Set<String>> allDependencies = new TreeMap<String, Set<String>>();

    public void readFromFile( File file )
        throws IOException
    {
        BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) );
        try
        {
            String line = reader.readLine();
            if ( !FILE_HEADER.equals( line ) )
            {

            }
            //check header
            line = reader.readLine();
            while ( line != null )
            {
                String fileName = line;
                Set<String> dependencies = new TreeSet<String>();
                line = reader.readLine();
                while ( line != null && line.startsWith( FILE_DEPENDENCY_PREFIX ) )
                {
                    String dependencyFileName = line.substring( 2 );
                    dependencies.add( dependencyFileName );
                    line = reader.readLine();
                }
                allDependencies.put( fileName, dependencies );
            }
        }
        finally
        {
            reader.close();
        }
    }

    public void writeToFile( File file )
        throws IOException
    {
        BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( file ), "UTF-8" ) );
        try
        {
            writer.write( FILE_HEADER );
            writer.newLine();
            for ( String fileName: allDependencies.keySet() )
            {
                writer.write( fileName );
                writer.newLine();
                Set<String> deps = allDependencies.get( fileName );
                for ( String dependencyFileName: deps )
                {
                    writer.write( FILE_DEPENDENCY_PREFIX );
                    writer.write( dependencyFileName );
                    writer.newLine();
                }

            }
        }
        finally
        {
            writer.flush();
            writer.close();
        }
    }

    public Set<String> get( String fileName )
    {
        return allDependencies.get( fileName );
    }
//    public Set<String> get( File file )
//    {
//        return allDependencies.get( file.getAbsolutePath() );
//    }

    public void set( String fileName, Collection<String> dependencies )
    {
        allDependencies.put( fileName, new TreeSet<String>( dependencies ) );
    }
//    public void set( File file, Collection<File> dependencies )
//    {
//        Set<String> deps = new TreeSet<String>();
//        for ( File dependencyFile: dependencies )
//        {
//            deps.add( dependencyFile.getAbsolutePath() );
//        }
//        allDependencies.put( file.getAbsolutePath(), deps );
//    }

    @Override
    public int hashCode()
    {
        return allDependencies.hashCode();
    }

    @Override
    public boolean equals( Object obj )
    {
        return obj instanceof LessDependencyCache && allDependencies.equals( ( (LessDependencyCache) obj ).allDependencies );
    }
    //TEMP
    @Override
    public String toString()
    {
        StringBuilder sb = new StringBuilder( '\n' );
        for ( String key: allDependencies.keySet() )
        {
            //sb.append( String.format( "%s\n", key ) );
            sb.append( key );
            sb.append( '\n' );
            Set<String> deps = allDependencies.get( key );
            for ( String dep: deps )
            {
                sb.append( String.format( "  %s\n", dep ) );
            }

        }
        return sb.toString();
    }
}


text:
export default class LogoutCtrl {
    constructor($state, $timeout, authService) {
        this.$state = $state;
        this.$timeout = $timeout;
        this.authService = authService;
        this.error = null;
        this.logout();
    }
    async logout() {
        try {
            let result = await this.authService.signOut();
            this.$timeout(() => {
                this.$state.go(this.$state.params.fromState, this.$state.params.fromParams);
            });
        } catch (error) {
            this.$timeout(() => {
                this.error = error;
            });
        }
    }
}

LogoutCtrl.$inject = ['$state', '$timeout', 'AuthService'];


text:
#ifndef TYPES_H

#include <cstdint>

#define TYPES_H

namespace Ramble
{
	/**
	 *	Here we typedef some useful stuff.
	 **/
	typedef int8_t I8;
	typedef uint8_t U8;

	typedef int16_t I16;
	typedef uint16_t U16;

	typedef int32_t I32;	//32-bit is the size of integer used by the MSVC++ compiler
	typedef uint32_t U32;

	typedef int64_t I64;
	typedef uint64_t U64;

	typedef float F32;
	typedef double F64;

	typedef unsigned long ULong;

	typedef uintptr_t uptr;

	typedef uint8_t BYTE;
}

#endif


text:
<?php
/**
 *
 * Recursive file importing
 *
 */
namespace CssCrush;

class Importer
{
    protected $process;

    public function __construct(Process $process)
    {
        $this->process = $process;
    }

    public function collate()
    {
        $process = $this->process;
        $options = $process->options;
        $regex = Regex::$patt;
        $input = $process->input;

        $str = '';

        // Keep track of all import file info for cache data.
        $mtimes = [];
        $filenames = [];

        // Resolve main input; a string of css or a file.
        if (isset($input->string)) {
            $str .= $input->string;
            $process->sources[] = 'Inline CSS';
        }
        else {
            $str .= file_get_contents($input->path);
            $process->sources[] = $input->path;
        }

        // If there's a parsing error go no further.
        if (! $this->prepareImport($str)) {

            return $str;
        }

        // This may be set non-zero during the script if an absolute @import URL is encountered.
        $search_offset = 0;

        // Recurses until the nesting heirarchy is flattened and all import files are inlined.
        while (preg_match($regex->import, $str, $match, PREG_OFFSET_CAPTURE, $search_offset)) {

            $match_len = strlen($match[0][0]);
            $match_start = $match[0][1];

            $import = new \stdClass();
            $import->url = $process->tokens->get($match[1][0]);
            $import->media = trim($match[2][0]);

            // Protocoled import urls are not processed. Stash for prepending to output.
            if ($import->url->protocol) {
                $str = substr_replace($str, '', $match_start, $match_len);
                $process->absoluteImports[] = $import;
                continue;
            }

            // Resolve import path information.
            $import->path = null;
            if ($import->url->isRooted) {
                $import->path = realpath($process->docRoot . $import->url->value);
            }
            else {
                $url =& $import->url;
                $candidates = ["$input->dir/$url->value"];

                // If `import_path` option is set implicit relative urls
                // are additionally searched under specified import path(s).
                if (is_array($options->import_path) && $url->isRelativeImplicit()) {
                    foreach ($options->import_path as $importPath) {
                        $candidates[] = "$importPath/$url->originalValue";
                    }
                }
                foreach ($candidates as $candidate) {
                    if (file_exists($candidate)) {
                        $import->path = realpath($candidate);
                        break;
                    }
                }
            }

            // If unsuccessful getting import contents continue with the import line removed.
            $import->content = $import->path ? @file_get_contents($import->path) : false;
            if ($import->content === false) {
                $errDesc = 'was not found';
                if ($import->path && ! is_readable($import->path)) {
                    $errDesc = 'is not readable';
                }
                if (! empty($process->sources)) {
                    $errDesc .= " (from within {$process->input->dir})";
                }
                notice("@import '{$import->url->value}' $errDesc");
                $str = substr_replace($str, '', $match_start, $match_len);
                continue;
            }

            $import->dir = dirname($import->path);
            $import->relativeDir = Util::getLinkBetweenPaths($input->dir, $import->dir);

            // Import file exists so register it.
            $process->sources[] = $import->path;
            $mtimes[] = filemtime($import->path);
            $filenames[] = $import->relativeDir . basename($import->path);

            // If the import content doesn't pass syntax validation skip to next import.
            if (! $this->prepareImport($import->content)) {

                $str = substr_replace($str, '', $match_start, $match_len);
                continue;
            }

            // Alter all embedded import URLs to be relative to the host-file.
            foreach (Regex::matchAll($regex->import, $import->content) as $m) {

                $nested_url = $process->tokens->get($m[1][0]);

                // Resolve rooted paths.
                if ($nested_url->isRooted) {
                    $link = Util::getLinkBetweenPaths(dirname($nested_url->getAbsolutePath()), $import->dir);
                    $nested_url->update($link . basename($nested_url->value));
                }
                elseif (strlen($import->relativeDir)) {
                    $nested_url->prepend("$import->relativeDir/");
                }
            }

            // Optionally rewrite relative url and custom function data-uri references.
            if ($options->rewrite_import_urls) {
                $this->rewriteImportedUrls($import);
            }

            if ($import->media) {
                $import->content = "@media $import->media {{$import->content}}";
            }

            $str = substr_replace($str, $import->content, $match_start, $match_len);
        }

        // Save only if caching is on and the hostfile object is associated with a real file.
        if ($input->path && $options->cache) {

            $process->cacheData[$process->output->filename] = [
                'imports' => $filenames,
                'datem_sum' => array_sum($mtimes) + $input->mtime,
                'options' => $options->get(),
            ];
            $process->io->saveCacheData();
        }

        return $str;
    }

    protected function rewriteImportedUrls($import)
    {
        $link = Util::getLinkBetweenPaths($this->process->input->dir, dirname($import->path));

        if (empty($link)) {
            return;
        }

        // Match all urls that are not imports.
        preg_match_all(Regex::make('~(?<!@import ){{u_token}}~iS'), $import->content, $matches);

        foreach ($matches[0] as $token) {

            $url = $this->process->tokens->get($token);

            if ($url->isRelative) {
                $url->prepend($link);
            }
        }
    }

    protected function prepareImport(&$str)
    {
        $regex = Regex::$patt;
        $process = $this->process;
        $tokens = $process->tokens;

        // Convert all EOL to unix style.
        $str = preg_replace('~\r\n?~', "\n", $str);

        // Trimming to reduce regex backtracking.
        $str = rtrim($this->captureCommentAndString(rtrim($str)));

        if (! $this->syntaxCheck($str)) {

            $str = '';
            return false;
        }

        // Normalize double-colon pseudo elements for backwards compatability.
        $str = preg_replace('~::(after|before|first-(?:letter|line))~iS', ':$1', $str);

        // Store @charset if set.
        if (preg_match($regex->charset, $str, $m)) {
            $replace = '';
            if (! $process->charset) {
                // Keep track of newlines for line numbering.
                $replace = str_repeat("\n", substr_count($m[0], "\n"));
                $process->charset = trim($tokens->get($m[1]), '"\'');
            }
            $str = preg_replace($regex->charset, $replace, $str);
        }

        $str = $tokens->captureUrls($str, true);

        $this->addMarkers($str);

        $str = Util::normalizeWhiteSpace($str);

        return true;
    }

    protected function syntaxCheck(&$str)
    {
        // Catch obvious typing errors.
        $errors = false;
        $current_file = 'file://' . end($this->process->sources);
        $balanced_parens = substr_count($str, "(") === substr_count($str, ")");
        $balanced_curlies = substr_count($str, "{") === substr_count($str, "}");

        $validate_pairings = function ($str, $pairing) use ($current_file)
        {
            if ($pairing === '{}') {
                $opener_patt = '~\{~';
                $balancer_patt = Regex::make('~^{{block}}~');
            }
            else {
                $opener_patt = '~\(~';
                $balancer_patt = Regex::make('~^{{parens}}~');
            }

            // Find unbalanced opening brackets.
            preg_match_all($opener_patt, $str, $matches, PREG_OFFSET_CAPTURE);
            foreach ($matches[0] as $m) {
                $offset = $m[1];
                if (! preg_match($balancer_patt, substr($str, $offset), $m)) {
                    $substr = substr($str, 0, $offset);
                    $line = substr_count($substr, "\n") + 1;
                    $column = strlen($substr) - strrpos($substr, "\n");
                    return "Unbalanced '{$pairing[0]}' in $current_file, Line $line, Column $column.";
                }
            }

            // Reverse the string (and brackets) to find stray closing brackets.
            $str = strtr(strrev($str), $pairing, strrev($pairing));

            preg_match_all($opener_patt, $str, $matches, PREG_OFFSET_CAPTURE);
            foreach ($matches[0] as $m) {
                $offset = $m[1];
                $substr = substr($str, $offset);
                if (! preg_match($balancer_patt, $substr, $m)) {
                    $line = substr_count($substr, "\n") + 1;
                    $column = strpos($substr, "\n");
                    return "Stray '{$pairing[1]}' in $current_file, Line $line, Column $column.";
                }
            }

            return false;
        };

        if (! $balanced_curlies) {
            $errors = true;
            warning($validate_pairings($str, '{}') ?: "Unbalanced '{' in $current_file.");
        }
        if (! $balanced_parens) {
            $errors = true;
            warning($validate_pairings($str, '()') ?: "Unbalanced '(' in $current_file.");
        }

        return $errors ? false : true;
    }

    protected function addMarkers(&$str)
    {
        $process = $this->process;
        $currentFileIndex = count($process->sources) - 1;

        static $patt;
        if (! $patt) {
            $patt = Regex::make('~
                (?:^|(?<=[;{}]))
                (?<before>
                    (?: \s | {{c_token}} )*
                )
                (?<selector>
                    (?:
                        # Some @-rules are treated like standard rule blocks.
                        @(?: (?i)page|abstract|font-face(?-i) ) {{RB}} [^{]*
                        |
                        [^@;{}]+
                    )
                )
                \{
            ~xS');
        }

        $count = preg_match_all($patt, $str, $matches, PREG_OFFSET_CAPTURE);
        while ($count--) {

            $selectorOffset = $matches['selector'][$count][1];

            $line = 0;
            $before = substr($str, 0, $selectorOffset);
            if ($selectorOffset) {
                $line = substr_count($before, "\n");
            }

            $pointData = [$currentFileIndex, $line];

            // Source maps require column index too.
            if ($process->generateMap) {
                $pointData[] = strlen($before) - (strrpos($before, "\n") ?: 0);
            }

            // Splice in marker token (packing point_data into string is more memory efficient).
            $str = substr_replace(
                $str,
                $process->tokens->add(implode(',', $pointData), 't'),
                $selectorOffset,
                0);
        }
    }

    protected function captureCommentAndString($str)
    {
        $process = $this->process;
        $callback = function ($m) use ($process) {

            $fullMatch = $m[0];

            if (strpos($fullMatch, '/*') === 0) {

                // Bail without storing comment if output is minified or a private comment.
                if ($process->minifyOutput || strpos($fullMatch, '/*$') === 0) {

                    $label = '';
                }
                else {
                    // Fix broken comments as they will break any subsquent
                    // imported files that are inlined.
                    if (! preg_match('~\*/$~', $fullMatch)) {
                        $fullMatch .= '*/';
                    }
                    $label = $process->tokens->add($fullMatch, 'c');
                }
            }
            else {
                // Fix broken strings as they will break any subsquent
                // imported files that are inlined.
                if ($fullMatch[0] !== $fullMatch[strlen($fullMatch)-1]) {
                    $fullMatch .= $fullMatch[0];
                }

                // Backticked literals may have been used for custom property values.
                if ($fullMatch[0] === '`') {
                    $fullMatch = preg_replace('~\x5c`~', '`', trim($fullMatch, '`'));
                }

                $label = $process->tokens->add($fullMatch, 's');
            }

            return $process->generateMap ? Tokens::pad($label, $fullMatch) : $label;
        };

        return preg_replace_callback(Regex::$patt->commentAndString, $callback, $str);
    }
}


text:
RE-P-Roc-2 - Communication with P/P3-Roc broke down
===================================================

+------------------------------------------------------------------------------+
| Related Config File Sections                                                 |
+==============================================================================+
| :doc:`/config/p_roc`                                                         |
+------------------------------------------------------------------------------+

In your log you will probably find a line such as:

.. code-block:: doscon

   OSError: Error in WriteData: wrote 0 of 8 bytes

This error occurs when ``pinproc`` (the library MPF uses to talk to the
P/P3-Roc) reports an error while talking to the P/P3-Roc via USB.
This is most likely a bad cable or a power supply issue.
See :doc:`/hardware/multimorphic/troubleshooting` for potential causes and
solutions.

.. include:: config_error_footer.rst

Related How To guides
---------------------

* :doc:`/hardware/multimorphic/troubleshooting`
* :doc:`/hardware/voltages_and_power/wiring_and_connectors`
* :doc:`/hardware/voltages_and_power/voltages_and_power`


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using OpenSim.Framework;

using log4net;

namespace OpenSim.Region.ClientStack.LindenUDP
{
    /// <summary>
    /// A hierarchical token bucket for bandwidth throttling. See
    /// http://en.wikipedia.org/wiki/Token_bucket for more information
    /// </summary>
    public class TokenBucket
    {
        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        private static Int32 m_counter = 0;

//        private Int32 m_identifier;

        protected const float m_timeScale = 1e-3f;

        /// <summary>
        /// This is the number of m_minimumDripRate bytes
        /// allowed in a burst
        /// roughtly, with this settings, the maximum time system will take
        /// to recheck a bucket in ms
        ///
        /// </summary>
        protected const float m_quantumsPerBurst = 5;

        /// <summary>
        /// </summary>
        protected const float m_minimumDripRate = 1500;

        /// <summary>Time of the last drip</summary>
        protected double m_lastDrip;

        /// <summary>
        /// The number of bytes that can be sent at this moment. This is the
        /// current number of tokens in the bucket
        /// </summary>
        protected float m_tokenCount;

        /// <summary>
        /// Map of children buckets and their requested maximum burst rate
        /// </summary>

        protected Dictionary<TokenBucket, float> m_children = new Dictionary<TokenBucket, float>();

#region Properties

        /// <summary>
        /// The parent bucket of this bucket, or null if this bucket has no
        /// parent. The parent bucket will limit the aggregate bandwidth of all
        /// of its children buckets
        /// </summary>
        protected TokenBucket m_parent;
        public TokenBucket Parent
        {
            get { return m_parent; }
            set { m_parent = value; }
        }
        /// <summary>
        /// This is the maximum number
        /// of tokens that can accumulate in the bucket at any one time. This
        /// also sets the total request for leaf nodes
        /// </summary>
        protected float m_burst;

        protected float m_maxDripRate = 0;
        public virtual float MaxDripRate
        {
            get { return m_maxDripRate; }
            set { m_maxDripRate = value; }
        }

        public float RequestedBurst
        {
            get { return m_burst; }
            set {
                float rate = (value < 0 ? 0 : value);
                if (rate < 1.5f * m_minimumDripRate)
                    rate = 1.5f * m_minimumDripRate;
                else if (rate > m_minimumDripRate * m_quantumsPerBurst)
                    rate = m_minimumDripRate * m_quantumsPerBurst;

                m_burst = rate;
                }
        }

        public float Burst
        {
            get {
                float rate = RequestedBurst * BurstModifier();
                if (rate < m_minimumDripRate)
                    rate = m_minimumDripRate;
                return (float)rate;
            }
        }

        /// <summary>
        /// The requested drip rate for this particular bucket.
        /// </summary>
        /// <remarks>
        /// 0 then TotalDripRequest is used instead.
        /// Can never be above MaxDripRate.
        /// Tokens are added to the bucket at any time
        /// <seealso cref="RemoveTokens"/> is called, at the granularity of
        /// the system tick interval (typically around 15-22ms)</remarks>
        protected float m_dripRate;

        public float RequestedDripRate
        {
            get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); }
            set {
                m_dripRate = (value < 0 ? 0 : value);
                m_totalDripRequest = m_dripRate;

                if (m_parent != null)
                    m_parent.RegisterRequest(this,m_dripRate);
            }
        }

       public float DripRate
        {
            get {
                float rate = Math.Min(RequestedDripRate,TotalDripRequest);
                if (m_parent == null)
                    return rate;

                rate *= m_parent.DripRateModifier();
                if (rate < m_minimumDripRate)
                    rate = m_minimumDripRate;

                return (float)rate;
            }
        }

        /// <summary>
        /// The current total of the requested maximum burst rates of children buckets.
        /// </summary>
        protected float m_totalDripRequest;
        public float TotalDripRequest
        {
            get { return m_totalDripRequest; }
            set { m_totalDripRequest = value; }
        }

#endregion Properties

#region Constructor

        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="identifier">Identifier for this token bucket</param>
        /// <param name="parent">Parent bucket if this is a child bucket, or
        /// null if this is a root bucket</param>
        /// <param name="maxBurst">Maximum size of the bucket in bytes, or
        /// zero if this bucket has no maximum capacity</param>
        /// <param name="dripRate">Rate that the bucket fills, in bytes per
        /// second. If zero, the bucket always remains full</param>
        public TokenBucket(TokenBucket parent, float dripRate, float MaxBurst)
        {
            m_counter++;

            Parent = parent;
            RequestedDripRate = dripRate;
            RequestedBurst = MaxBurst;
            m_lastDrip = Util.GetTimeStampMS() + 100000.0; // skip first drip
        }

#endregion Constructor

        /// <summary>
        /// Compute a modifier for the MaxBurst rate. This is 1.0, meaning
        /// no modification if the requested bandwidth is less than the
        /// max burst bandwidth all the way to the root of the throttle
        /// hierarchy. However, if any of the parents is over-booked, then
        /// the modifier will be less than 1.
        /// </summary>
        protected float DripRateModifier()
        {
            float driprate = DripRate;
            return driprate >= TotalDripRequest ? 1.0f : (driprate / TotalDripRequest);
        }

        /// <summary>
        /// </summary>
        protected float BurstModifier()
        {
            // for now... burst rate is always m_quantumsPerBurst (constant)
            // larger than drip rate so the ratio of burst requests is the
            // same as the drip ratio
            return DripRateModifier();
        }

        /// <summary>
        /// Register drip rate requested by a child of this throttle. Pass the
        /// changes up the hierarchy.
        /// </summary>
        public void RegisterRequest(TokenBucket child, float request)
        {
            lock (m_children)
            {
                m_children[child] = request;

                m_totalDripRequest = 0;
                foreach (KeyValuePair<TokenBucket, float> cref in m_children)
                    m_totalDripRequest += cref.Value;
            }

            // Pass the new values up to the parent
            if (m_parent != null)
                m_parent.RegisterRequest(this, Math.Min(RequestedDripRate, TotalDripRequest));
        }

        /// <summary>
        /// Remove the rate requested by a child of this throttle. Pass the
        /// changes up the hierarchy.
        /// </summary>
        public void UnregisterRequest(TokenBucket child)
        {
            lock (m_children)
            {
                m_children.Remove(child);

                m_totalDripRequest = 0;
                foreach (KeyValuePair<TokenBucket, float> cref in m_children)
                    m_totalDripRequest += cref.Value;
            }

            // Pass the new values up to the parent
            if (Parent != null)
                Parent.RegisterRequest(this,Math.Min(RequestedDripRate, TotalDripRequest));
        }

        /// <summary>
        /// Remove a given number of tokens from the bucket
        /// </summary>
        /// <param name="amount">Number of tokens to remove from the bucket</param>
        /// <returns>True if the requested number of tokens were removed from
        /// the bucket, otherwise false</returns>
        public bool RemoveTokens(int amount)
        {
            // Deposit tokens for this interval
            Drip();

            // If we have enough tokens then remove them and return
            if (m_tokenCount - amount >= 0)
            {
                // we don't have to remove from the parent, the drip rate is already
                // reflective of the drip rate limits in the parent
                m_tokenCount -= amount;
                return true;
            }

            return false;
        }

        public bool CheckTokens(int amount)
        {
            return  (m_tokenCount - amount >= 0);
        }

        public int GetCatBytesCanSend(int timeMS)
        {
//            return (int)(m_tokenCount + timeMS * m_dripRate * 1e-3);
            return (int)(timeMS * DripRate * 1e-3);
        }

        /// <summary>
        /// Add tokens to the bucket over time. The number of tokens added each
        /// call depends on the length of time that has passed since the last
        /// call to Drip
        /// </summary>
        /// <returns>True if tokens were added to the bucket, otherwise false</returns>
        protected void Drip()
        {
            // This should never happen... means we are a leaf node and were created
            // with no drip rate...
            if (DripRate == 0)
            {
                m_log.WarnFormat("[TOKENBUCKET] something odd is happening and drip rate is 0 for {0}", m_counter);
                return;
            }

            double now = Util.GetTimeStampMS();
            double deltaMS = now - m_lastDrip;
            m_lastDrip = now;

            if (deltaMS <= 0)
                return;

            m_tokenCount += (float)deltaMS * DripRate * m_timeScale;

            float burst = Burst;
            if (m_tokenCount > burst)
                m_tokenCount = burst;
        }
    }

    public class AdaptiveTokenBucket : TokenBucket
    {
        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public bool AdaptiveEnabled { get; set; }

        /// <summary>
        /// The minimum rate for flow control. Minimum drip rate is one
        /// packet per second.
        /// </summary>

        protected const float m_minimumFlow = 50000;

        // <summary>
        // The maximum rate for flow control. Drip rate can never be
        // greater than this.
        // </summary>

        public override float MaxDripRate
        {
            get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); }
            set
            {
                m_maxDripRate = (value == 0 ? m_totalDripRequest : Math.Max(value, m_minimumFlow));
            }
        }

        private bool m_enabled = false;

        // <summary>
        // Adjust drip rate in response to network conditions.
        // </summary>
        public float AdjustedDripRate
        {
            get { return m_dripRate; }
            set
            {
                m_dripRate = OpenSim.Framework.Util.Clamp<float>(value, m_minimumFlow, MaxDripRate);

                if (m_parent != null)
                    m_parent.RegisterRequest(this, m_dripRate);
            }
        }

        // <summary>
        //
        // </summary>
        public AdaptiveTokenBucket(TokenBucket parent, float maxDripRate, float maxBurst, bool enabled)
            : base(parent, maxDripRate, maxBurst)
        {
            m_enabled = enabled;

            m_maxDripRate = (maxDripRate == 0 ? m_totalDripRequest : Math.Max(maxDripRate, m_minimumFlow));

            if (enabled)
                m_dripRate = m_maxDripRate * .5f;
            else
                m_dripRate = m_maxDripRate;
            if (m_parent != null)
                m_parent.RegisterRequest(this, m_dripRate);
        }

        /// <summary>
        /// Reliable packets sent to the client for which we never received an ack adjust the drip rate down.
        /// <param name="packets">Number of packets that expired without successful delivery</param>
        /// </summary>
        public void ExpirePackets(Int32 count)
        {
            // m_log.WarnFormat("[ADAPTIVEBUCKET] drop {0} by {1} expired packets",AdjustedDripRate,count);
            if (m_enabled)
                AdjustedDripRate = (Int64)(AdjustedDripRate / Math.Pow(2, count));
        }

        // <summary>
        //
        // </summary>
        public void AcknowledgePackets(Int32 count)
        {
            if (m_enabled)
                AdjustedDripRate = AdjustedDripRate + count;
        }
    }
}


text:
#ifndef __MACH_DMA_V1_H__
#define __MACH_DMA_V1_H__

#define imx_has_dma_v1()	(cpu_is_mx1() || cpu_is_mx21() || cpu_is_mx27())

#include <mach/dma.h>

#define IMX_DMA_CHANNELS  16

#define DMA_MODE_READ		0
#define DMA_MODE_WRITE		1
#define DMA_MODE_MASK		1

#define MX1_DMA_REG(offset)	MX1_IO_ADDRESS(MX1_DMA_BASE_ADDR + (offset))

/* DMA Interrupt Mask Register */
#define MX1_DMA_DIMR		MX1_DMA_REG(0x08)

/* Channel Control Register */
#define MX1_DMA_CCR(x)		MX1_DMA_REG(0x8c + ((x) << 6))

#define IMX_DMA_MEMSIZE_32	(0 << 4)
#define IMX_DMA_MEMSIZE_8	(1 << 4)
#define IMX_DMA_MEMSIZE_16	(2 << 4)
#define IMX_DMA_TYPE_LINEAR	(0 << 10)
#define IMX_DMA_TYPE_2D		(1 << 10)
#define IMX_DMA_TYPE_FIFO	(2 << 10)

#define IMX_DMA_ERR_BURST     (1 << 0)
#define IMX_DMA_ERR_REQUEST   (1 << 1)
#define IMX_DMA_ERR_TRANSFER  (1 << 2)
#define IMX_DMA_ERR_BUFFER    (1 << 3)
#define IMX_DMA_ERR_TIMEOUT   (1 << 4)

int
imx_dma_config_channel(int channel, unsigned int config_port,
	unsigned int config_mem, unsigned int dmareq, int hw_chaining);

void
imx_dma_config_burstlen(int channel, unsigned int burstlen);

int
imx_dma_setup_single(int channel, dma_addr_t dma_address,
		unsigned int dma_length, unsigned int dev_addr,
		unsigned int dmamode);

/*
 * Use this flag as the dma_length argument to imx_dma_setup_sg()
 * to create an endless running dma loop. The end of the scatterlist
 * must be linked to the beginning for this to work.
 */
#define IMX_DMA_LENGTH_LOOP	((unsigned int)-1)

int
imx_dma_setup_sg(int channel, struct scatterlist *sg,
		unsigned int sgcount, unsigned int dma_length,
		unsigned int dev_addr, unsigned int dmamode);

int
imx_dma_setup_handlers(int channel,
		void (*irq_handler) (int, void *),
		void (*err_handler) (int, void *, int), void *data);

int
imx_dma_setup_progression_handler(int channel,
		void (*prog_handler) (int, void*, struct scatterlist*));

void imx_dma_enable(int channel);

void imx_dma_disable(int channel);

int imx_dma_request(int channel, const char *name);

void imx_dma_free(int channel);

int imx_dma_request_by_prio(const char *name, enum imx_dma_prio prio);

#endif	/* __MACH_DMA_V1_H__ */


text:
/*	$NetBSD: aml_obj.c,v 1.2 2009/01/18 09:46:59 lukem Exp $	*/

/*-
 * Copyright (c) 1999 Takanori Watanabe
 * Copyright (c) 1999, 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	Id: aml_obj.c,v 1.17 2000/08/12 15:20:45 iwasaki Exp
 *	$FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_obj.c,v 1.3 2000/11/09 06:24:45 iwasaki Exp $
 */
#include <sys/cdefs.h>
__RCSID("$NetBSD: aml_obj.c,v 1.2 2009/01/18 09:46:59 lukem Exp $");

#include <sys/param.h>

#include <acpi_common.h>
#include <aml/aml_amlmem.h>
#include <aml/aml_env.h>
#include <aml/aml_name.h>
#include <aml/aml_obj.h>
#include <aml/aml_status.h>
#include <aml/aml_store.h>

#ifndef _KERNEL
#include <sys/stat.h>
#include <sys/mman.h>

#include <assert.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#else /* _KERNEL */
#include <sys/systm.h>
#endif /* !_KERNEL */

union aml_object *
aml_copy_object(struct aml_environ *env, union aml_object *orig)
{
	int	i;
	union	aml_object *ret;

	if (orig == NULL)
		return (NULL);
	switch (orig->type) {
	case aml_t_regfield:
		ret = aml_alloc_object(aml_t_buffer, 0);
		ret->buffer.size = (orig->regfield.bitlen / 8) +
		    ((orig->regfield.bitlen % 8) ? 1 : 0);
		if (ret->buffer.size == 0) {
			goto out;
		}
		ret->buffer.data = memman_alloc_flexsize(aml_memman, ret->buffer.size);
		aml_store_to_object(env, orig, ret);
		break;

	default:
		ret = aml_alloc_object(0, orig);
		break;
	}

	if (1 || orig != &env->tempobject) {	/* XXX */
		if (orig->type == aml_t_buffer) {
			if (orig->buffer.size == 0) {
				goto out;
			}
			ret->buffer.data = memman_alloc_flexsize(aml_memman,
			    orig->buffer.size);
			bcopy(orig->buffer.data, ret->buffer.data, orig->buffer.size);
		} else if (orig->type == aml_t_package) {
			if (ret->package.elements == 0) {
				goto out;
			}
			ret->package.objects = memman_alloc_flexsize(aml_memman,
			    ret->package.elements * sizeof(union aml_object *));
			for (i = 0; i < ret->package.elements; i++) {
				ret->package.objects[i] = aml_copy_object(env, orig->package.objects[i]);
			}
		} else if (orig->type == aml_t_string && orig->str.needfree != 0) {
			ret->str.string = memman_alloc_flexsize(aml_memman,
			    strlen((const char *)orig->str.string) + 1);
			strcpy((char *)orig->str.string,
			    (const char *)ret->str.string);
		} else if (orig->type == aml_t_num) {
                        ret->num.constant = 0;
                }
	} else {
		printf("%s:%d\n", __FILE__, __LINE__);
		env->tempobject.type = aml_t_null;
	}
out:
	return ret;
}

/*
 * This function have two function: copy or allocate.  if orig != NULL,
 *  orig is duplicated.
 */

union aml_object *
aml_alloc_object(enum aml_objtype type, union aml_object *orig)
{
	unsigned	int memid;
	union	aml_object *ret;

	if (orig != NULL) {
		type = orig->type;
	}
	switch (type) {
	case aml_t_namestr:
		memid = memid_aml_namestr;
		break;
	case aml_t_buffer:
		memid = memid_aml_buffer;
		break;
	case aml_t_string:
		memid = memid_aml_string;
		break;
	case aml_t_bufferfield:
		memid = memid_aml_bufferfield;
		break;
	case aml_t_package:
		memid = memid_aml_package;
		break;
	case aml_t_num:
		memid = memid_aml_num;
		break;
	case aml_t_powerres:
		memid = memid_aml_powerres;
		break;
	case aml_t_opregion:
		memid = memid_aml_opregion;
		break;
	case aml_t_method:
		memid = memid_aml_method;
		break;
	case aml_t_processor:
		memid = memid_aml_processor;
		break;
	case aml_t_field:
		memid = memid_aml_field;
		break;
	case aml_t_mutex:
		memid = memid_aml_mutex;
		break;
	case aml_t_device:
		memid = memid_aml_objtype;
		break;
	case aml_t_objref:
		memid = memid_aml_objref;
		break;
	default:
		memid = memid_aml_objtype;
		break;
	}
	ret = memman_alloc(aml_memman, memid);
	ret->type = type;

	if (orig != NULL) {
		bcopy(orig, ret, memman_memid2size(aml_memman, memid));
	}
	return (ret);
}

void
aml_free_objectcontent(union aml_object *obj)
{
	int	i;

	if (obj->type == aml_t_buffer && obj->buffer.data != NULL) {
		memman_free_flexsize(aml_memman, obj->buffer.data);
		obj->buffer.data = NULL;
	}
	if (obj->type == aml_t_string && obj->str.string != NULL) {
		if (obj->str.needfree != 0) {
			memman_free_flexsize(aml_memman, obj->str.string);
			obj->str.string = NULL;
		}
	}
	if (obj->type == aml_t_package && obj->package.objects != NULL) {
		for (i = 0; i < obj->package.elements; i++) {
			aml_free_object(&obj->package.objects[i]);
		}
		memman_free_flexsize(aml_memman, obj->package.objects);
		obj->package.objects = NULL;
	}
}

void
aml_free_object(union aml_object **obj)
{
	union	aml_object *body;

	body = *obj;
	if (body == NULL) {
		return;
	}
	aml_free_objectcontent(*obj);
	memman_free(aml_memman, memid_unkown, *obj);
	*obj = NULL;
}

void
aml_realloc_object(union aml_object *obj, int size)
{
	int	i;
	enum	aml_objtype type;
	union	aml_object tmp;

	type = obj->type;
	switch (type) {
	case aml_t_buffer:
		if (obj->buffer.size >= size) {
			return;
		}
		tmp.buffer.size = size;
		tmp.buffer.data = memman_alloc_flexsize(aml_memman, size);
		bzero(tmp.buffer.data, size);
		bcopy(obj->buffer.data, tmp.buffer.data, obj->buffer.size);
		aml_free_objectcontent(obj);
		*obj = tmp;
		break;
	case aml_t_string:
		if ((int)strlen((const char *)obj->str.string) >= size) {
			return;
		}
		tmp.str.string = memman_alloc_flexsize(aml_memman, size + 1);
		strcpy((char *)tmp.str.string, (const char *)obj->str.string);
		aml_free_objectcontent(obj);
		*obj = tmp;
		break;
	case aml_t_package:
		if (obj->package.elements >= size) {
			return;
		}
		tmp.package.objects = memman_alloc_flexsize(aml_memman,
		    size * sizeof(union aml_object *));
		bzero(tmp.package.objects, size * sizeof(union aml_object *));
		for (i = 0; i < obj->package.elements; i++) {
			tmp.package.objects[i] = obj->package.objects[i];
		}
		memman_free_flexsize(aml_memman, obj->package.objects);
		obj->package.objects = tmp.package.objects;
		break;
	default:
		break;
	}
}


text:
package net.npg.abattle.common.model.impl;

import net.npg.abattle.common.model.Cell;
import net.npg.abattle.common.model.Link;
import net.npg.abattle.common.model.ModelVisitor;
import net.npg.abattle.common.utils.Validate;

/**
 * @author Cymric
 *
 */
public class LinkImpl<T extends Cell> extends IDElementImpl implements Link<T> {

	private final T destinationCell;
	private final T sourceCell;

	public LinkImpl(final int id, final T sourceCell, final T destinationCell) {
		super(id);
		Validate.notNulls(sourceCell, destinationCell);
		this.destinationCell = destinationCell;
		this.sourceCell = sourceCell;
	}

	protected LinkImpl(final T sourceCell, final T destinationCell) {
		super();
		Validate.notNulls(sourceCell, destinationCell);
		this.destinationCell = destinationCell;
		this.sourceCell = sourceCell;
	}

	@Override
	public void accept(final ModelVisitor visitor) {
		Validate.notNulls(visitor);
		visitor.visit(this);
	}

	@Override
	public T getDestinationCell() {
		assert destinationCell != null;
		return destinationCell;
	}

	@Override
	public T getSourceCell() {
		assert sourceCell != null;
		return sourceCell;
	}

	@Override
	public String toString() {
		assert destinationCell != null;
		assert sourceCell != null;
		return "LinkImpl [destinationCell=" + destinationCell.getId() + ", sourceCell=" + sourceCell.getId() + "]";
	}

}


text: This is a public health project management tool built in rails.


text:
@interface SideChannelDataLeakageVC () <UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,strong) NSArray *vulnerabilities;
@property (nonatomic,assign) NSInteger vulnCode;

@end

@implementation SideChannelDataLeakageVC

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
     self.vulnerabilities = [NSArray arrayWithObjects:@"Device Logs",@"App Screenshot",@"Pasteboard",@"Keystroke logging",@"Cookies",nil];
    [self.slidingViewController.topViewController.view addGestureRecognizer:self.slidingViewController.panGesture];
    [DamnVulnerableAppUtilities addCommonBackgroundImageToViewController:self];
     self.navigationController.navigationBar.tintColor = kNavigationTintColor;
	// Do any additional setup after loading the view.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.vulnerabilities.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString * cellIdentifier = @"Cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
    }
    cell.textLabel.text = [self.vulnerabilities objectAtIndex:indexPath.row];
    cell.textLabel.font = kCellFont;
    cell.accessoryType =  UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return kRowHeight;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    self.vulnCode = indexPath.row;
    [self performSegueWithIdentifier:@"pushSensInfoDetailsVC" sender:self];
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if([segue.identifier isEqualToString:@"pushSensInfoDetailsVC"]){
        SideChannelDataLeakageDetailsVC  *vc = segue.destinationViewController;
        vc.vulnCode = self.vulnCode;
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
<!doctype html>

    <meta charset="utf-8">
    <title>AngularJS solvex-feedback demo</title>

    <link rel="stylesheet" href="../dist/solvex-feedback.css">
    <link rel="stylesheet" href="demo.css">

Demo solvex-feedback

Simple usage

This is a simple usage of the solvex-feedback

<solvex-feedback></solvex-feedback>

            <solvex-feedback></solvex-feedback>


text:
#include <kinect2_depth_registration/depth_registration.h>

#ifdef DEPTH_REG_CPU
#include "depth_registration_cpu.h"
#endif

#ifdef DEPTH_REG_OPENCL
#include "depth_registration_opencl.h"
#endif

#define OUT_NAME(FUNCTION) "[DepthRegistration::" FUNCTION "] "

DepthRegistration::DepthRegistration()
{
}

DepthRegistration::~DepthRegistration()
{
}

bool DepthRegistration::init(const cv::Mat &cameraMatrixRegistered, const cv::Size &sizeRegistered, const cv::Mat &cameraMatrixDepth, const cv::Size &sizeDepth,
                             const cv::Mat &distortionDepth, const cv::Mat &rotation, const cv::Mat &translation,
                             const float zNear, const float zFar, const int deviceId, const std::map<std::string, std::string>& params)
{
  this->cameraMatrixRegistered = cameraMatrixRegistered;
  this->cameraMatrixDepth = cameraMatrixDepth;
  this->rotation = rotation;
  this->translation = translation;
  this->sizeRegistered = sizeRegistered;
  this->sizeDepth = sizeDepth;
  this->zNear = zNear;
  this->zFar = zFar;

  cv::initUndistortRectifyMap(cameraMatrixDepth, distortionDepth, cv::Mat(), cameraMatrixRegistered, sizeRegistered, CV_32FC1, mapX, mapY);

  return init(deviceId, params);
}

DepthRegistration *DepthRegistration::New(Method method)
{
  if(method == DEFAULT)
  {
#ifdef DEPTH_REG_OPENCL
    method = OPENCL;
#elif defined DEPTH_REG_CPU
    method = CPU;
#endif
  }

  switch(method)
  {
  case DEFAULT:
    std::cerr << OUT_NAME("New") "No default registration method available!" << std::endl;
    break;
  case CPU:
#ifdef DEPTH_REG_CPU
    std::cout << OUT_NAME("New") "Using CPU registration method!" << std::endl;
    return new DepthRegistrationCPU();
#else
    std::cerr << OUT_NAME("New") "CPU registration method not available!" << std::endl;
    break;
#endif
  case OPENCL:
#ifdef DEPTH_REG_OPENCL
    std::cout << OUT_NAME("New") "Using OpenCL registration method!" << std::endl;
    return new DepthRegistrationOpenCL();
#else
    std::cerr << OUT_NAME("New") "OpenCL registration method not available!" << std::endl;
    break;
#endif
  }
  return NULL;
}


text:
<?php defined('BASEPATH') OR exit('No direct script access allowed');

 class Eventos extends CI_Controller {

     function __construct() {
         parent::__construct();
         $this->load->model('eventos_model', 'eventos');
    }

    public function index() {
        $data['eventos'] = $this->eventos->listar_eventos();
        $this->load->view('eventos', $data);
    }

}

?>


text:
Stack = function() {
  this.data = [];
};

Stack.prototype.push = function(val) {
  this.data.push(val);
  return val;
};

Stack.prototype.pop = function () {
  var ret = this.data.pop();
  return ret;
};

Stack.prototype.top = function () {
  return this.data[this.data.length - 1];
};

Stack.prototype.bottom = function() {
  return this.data[0];
};

Stack.prototype.length = function() {
  return this.data.length;
};

Stack.prototype.size = function() {
  return this.length();
};

Stack.prototype.each = function(callback) {
  for (var i = 0; i < this.size(); i ++) {
    callback.call(this, this.data[i]);
  }
};


text:
package com.githang.android.actionsheet;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
package org.wso2.ballerina.core.flow.contentaware.exceptions;

/**
 * Exception when failing to add type converters due there is already an existing type converter.
 */
public class TypeConverterExistsException extends Exception {

    private final Class<?> toType;
    private final Class<?> fromType;

    public TypeConverterExistsException(Class<?> toType, Class<?> fromType) {
        super("Failed to add type converter because a type converter exists. " + fromType + " -> " + toType);
        this.toType = toType;
        this.fromType = fromType;

    }

    public Class<?> getToType() {
        return toType;
    }

    public Class<?> getFromType() {
        return fromType;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syst. mycol. (Lundae) 1: 97 (1821)

#### Original name
Agaricus hebepodius Fr.

### Remarks
null


text:
package org.apache.camel.processor;

import org.apache.camel.Exchange;

public class ExchangeAwareDelayCalcBean {

    static final String BEAN_DELAYER_HEADER = "BEAN_DELAYER_HEADER";

    public long delayMe(Exchange exchange) {
        return exchange.getIn().getHeader("BEAN_DELAYER_HEADER", Long.class);
    }

}


text:
function listen(mktcw, libPath) {
  let lib = ctypes.open(libPath);

  let mktcw_message_t = ctypes.StructType("mktcw_message", [
    { "isDestroyNotification": ctypes.bool },
    { "pressedDown": ctypes.bool },
    { "keyCode": ctypes.int },
    { "keyFlags": ctypes.int },
    { "keyRepeat": ctypes.bool },
   ]);

  let mktcw_get_message = lib.declare("mktcw_get_message", ctypes.default_abi, mktcw_message_t, ctypes.voidptr_t);

  while (true) {
    let msg = mktcw_get_message(mktcw);
    if (msg.isDestroyNotification) {
      lib.close();
      self.close();
      return;
    }
    self.postMessage({
      pressedDown: msg.pressedDown,
      keyCode: msg.keyCode,
      keyFlags: msg.keyFlags,
      keyRepeat: msg.keyRepeat,
    });
  }
}

self.onmessage = function (msg) {
  let mktcwAddressAsDecimalString = msg.data.mktcwAddressAsDecimalString;
  let mktcw = ctypes.cast(ctypes.uintptr_t(mktcwAddressAsDecimalString), ctypes.voidptr_t);
  listen(mktcw, msg.data.libPath);
}