text:
var socket = io();

var input = document.querySelector(".input");

var title = document.title;
var to = title.split(" ")[2].toLowerCase();

//set the form's onsubmit function
document.querySelector(".chat-form").onsubmit = function(e) {
    e.preventDefault();

    //ignore empty inputs
    if (input.value.length == 0) {
        return;
    }

    sendMessage(input.value);
};

//sends typing info to server when key is pressed
input.onkeyup = function() {

    //ignore empty inputs
    if (input.value.length == 0){
        return;
    }

    var data = {
        to: to
    };

    socket.emit('typing', data);
};

socket.on('new message', function(data){
    updateConversation(data, data.from);

    //if you're person A talking to person B,
    //but then person C messages you (person A),
    //we don't want to load C's message

    if (data.from !== to){
        return;
    }

    clearTyping();
    addMessage(data.from, data.message);
});

socket.on('own message', function(data){
    updateConversation(data, data.to);

    //this prevents your own message from
    //appearing in your other chats

    if (data.to !== to){
        return;
    }

    addMessage(data.from, data.message);
});

//emits a message to the server and clears the input
function sendMessage(text){
    var data = {
        to: to,
        message: text
    };
    socket.emit('send message', data);
    input.value = "";
}

//appends text to chat and blinks title if needed
function addMessage(from, message){
    var other = from === to;
    var cssClass = other ? "other" : "own";
    var append = "
" + message + "
";
    appendText(append);
    sendTitleBlink(other);
}

//moves the conversation of the last message to the top
function updateConversation(data, otherUsername){
    var toUpdate = getConversationByUsername(otherUsername);
    var conversations = document.querySelector(".conversations");
    toUpdate.querySelector(".conversation-snippet").innerHTML = data.message;
    conversations.appendChild(toUpdate);
    conversations.insertBefore(toUpdate, conversations.firstChild);
}

//returns the conversation node given a username
function getConversationByUsername(username){
    var conversations = document.querySelectorAll(".conversation-username");
    for (var i = 0; i < conversations.length; i++){
        if (conversations[i].innerHTML === username){
            return conversations[i].parentElement.parentElement.parentElement;
        }
    }
}

//auto scroll implementation below
var chat = document.querySelector(".chat");
chat.scrollTop = chat.scrollHeight;

function appendText(append){
    chat.innerHTML += append;
    chat.scrollTop = chat.scrollHeight;
}

//user is typing implementation below
var typing = document.querySelector(".typing");
var isTypingDuration = 10; //how long to display "is typing" in seconds
var typingInterval;

socket.on('typing', function(data){

    //if this refers to another conversation, do nothing
    if (data.from !== to){
        return;
    }

    //resets the countdown
    clearTimeout(typingInterval);

    //show the typing text
    typing.innerHTML = to + " is typing...";

    //set the timeout to clear it
    typingInterval = setTimeout(function(){
        clearTyping();
    }, isTypingDuration * 1000);
});

function clearTyping(){
    clearTimeout(typingInterval);
    typing.innerHTML = "";
}

//title blink implementation below
var blink = null;
var blinkBoolean = true;

function sendTitleBlink(other) {
    //blink only if not your own message, the tab is not active and is not already blinking
    var shouldBlink = other && document.visibilityState !== 'visible' && blink == null;
    if (shouldBlink){
        blink = setInterval(changeTitle, 1000);
    }
}

window.onfocus = function() {
    clearInterval(blink);
    blink = null;
    document.title = title;
};

function changeTitle() {
    document.title = blinkBoolean ? "New Message from " + to + "!" : title;
    blinkBoolean = !blinkBoolean;
}

redpajama_set_name: RedPajamaGithub


text:
package com.haskforce.stubs.types;

import com.haskforce.HaskellLanguage;
import com.haskforce.psi.HaskellFile;
import com.haskforce.stubs.HaskellFileStub;
import com.intellij.psi.PsiFile;
import com.intellij.psi.StubBuilder;
import com.intellij.psi.stubs.DefaultStubBuilder;
import com.intellij.psi.stubs.StubElement;
import com.intellij.psi.stubs.StubInputStream;
import com.intellij.psi.stubs.StubOutputStream;
import com.intellij.psi.tree.IStubFileElementType;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;

/**
 * Define how and when to create a stub for a Haskell file so we can index its contents.
 */
public class HaskellFileStubElementType extends IStubFileElementType<HaskellFileStub> {
    public static final int VERSION = 0;
    public static final IStubFileElementType INSTANCE = new HaskellFileStubElementType();

    public HaskellFileStubElementType() {
        super("FILE", HaskellLanguage.INSTANCE);
    }

    @Override
    public StubBuilder getBuilder() {
        return new DefaultStubBuilder() {
            @NotNull
            @Override
            protected StubElement createStubForFile(@NotNull PsiFile file) {
                if (file instanceof HaskellFile) {
                    return new HaskellFileStub((HaskellFile)file);
                }
                return super.createStubForFile(file);
            }
        };
    }

    @Override
    public int getStubVersion() {
        return VERSION;
    }

    @Override
    public void serialize(@NotNull HaskellFileStub stub, @NotNull StubOutputStream dataStream) throws IOException {
        // TODO
    }

    @NotNull
    @Override
    public HaskellFileStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
        return new HaskellFileStub(null);
    }

    @NotNull
    @Override
    public String getExternalId() {
        return "haskell.FILE";
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EncoderUtil.cs" company="Microsoft Corporation">
//   Copyright (c) 2008, 2009, 2010 All Rights Reserved, Microsoft Corporation
//
//   This source is subject to the Microsoft Permissive License.
//   Please see the License.txt file for more information.
//   All other rights reserved.
//
//   THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//   PARTICULAR PURPOSE.
//
// </copyright>
// <summary>
//   Provides helper methods common to all Anti-XSS encoders.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

// ReSharper disable CheckNamespace
namespace Microsoft.Security.Application
    // ReSharper restore CheckNamespace
{
    using System;
    using System.Text;

    /// <summary>
    /// Provides helper methods common to all Anti-XSS encoders.
    /// </summary>
    internal static class EncoderUtil
    {
        /// <summary>
        /// Gets an appropriately-sized StringBuilder for the output of an encoding routine.
        /// </summary>
        /// <param name="inputLength">The length (in characters) of the input string.</param>
        /// <param name="worstCaseOutputCharsPerInputChar">The worst-case ratio of output characters per input character.</param>
        /// <returns>A StringBuilder appropriately-sized to hold the output string.</returns>
        internal static StringBuilder GetOutputStringBuilder(int inputLength, int worstCaseOutputCharsPerInputChar)
        {
            // We treat 32KB byte size (16k chars) as a soft upper boundary for the length of any StringBuilder
            // that we allocate. We'll try to avoid going above this boundary if we can avoid it so that we
            // don't allocate objects on the LOH.
            const int UpperBound = 16 * 1024;

            int charsToAllocate;
            if (inputLength >= UpperBound)
            {
                // We know that the output will contain at least as many characters as the input, so if the
                // input length exceeds the soft upper boundary just pre-allocate the entire builder and hope for
                // a best-case outcome.
                charsToAllocate = inputLength;
            }
            else
            {
                // Allocate the worst-case if we can, but don't exceed the soft upper boundary.
                long worstCaseTotalChars = (long)inputLength * worstCaseOutputCharsPerInputChar; // don't overflow Int32
                charsToAllocate = (int)Math.Min(UpperBound, worstCaseTotalChars);
            }

            // Once we have chosen an initial value for the StringBuilder size, the StringBuilder type will
            // efficiently allocate additionally blocks if necessary.
            return new StringBuilder(charsToAllocate);
        }
    }
}


text:
from django import template
from django.conf import settings

from turbion.bits.utils.urls import uri_reverse

register = template.Library()

@register.simple_tag
def whitelist():
    return '<link rel="whitelist" href="%(url)s">' % {'url': uri_reverse("turbion_whitelist")}


text:
<?php
return array (
  'Inbox' => 'Caixa de entrada',
  'Messagebox' => 'Caixa de mensagem',
  'New' => 'Nova',
  'New message' => 'Nova mensagem',
  'There are no messages yet.' => 'Não há mensagens ainda.',
);


text:
'use strict'

var path = require('path');
var rootPath = path.normalize(__dirname + '/../..');
var uploadPath = path.normalize(__dirname + '/../../upload');
var orderPath = path.normalize(__dirname + '/../../public/views/order');

module.exports = {
  root: rootPath,
  uploadPath: uploadPath,
  orderPath: orderPath,
  port: process.env['PORT'] || 1025,
  vendorPath: process.env['TEATIME_VENDOR'] || path.normalize(__dirname + '/../../public/views/menu'),
  templateEngine: 'swig'
};


text:
layout: post
title: Tweets
date: 2020-02-16
summary: These are the tweets for February 16, 2020.
categories:
---


text:
package examples;

import org.mapdb.BTreeMap;
import org.mapdb.Bind;
import org.mapdb.DBMaker;
import org.mapdb.Fun;

import java.util.NavigableSet;
import java.util.TreeSet;

/**
 * Shows howto use secondary non-unique keys,
 */
public class Secondary_Key {

    public static void main(String[] args) {

        // stores string under id
        BTreeMap<Long, String> primary = DBMaker.newTempTreeMap();

        // stores value hash from primary map
        NavigableSet<Fun.Tuple2<Integer,Long>> valueHash =
                new TreeSet<Fun.Tuple2<Integer,Long>>(); //any Set will do

        // bind secondary to primary so it contains secondary key
        Bind.secondaryKey(primary, valueHash, new Fun.Function2<Integer, Long, String>() {
            @Override
            public Integer run(Long key, String value) {
                return value.hashCode();
            }
        });

        //insert some stuff into primary
        primary.put(111L, "some value");
        primary.put(112L, "some value");

        //shot content of secondary
        System.out.println(valueHash);

        //get all keys where value hashCode is N
        Iterable<Long> ids = Fun.filter(valueHash, 1571230533);
        System.out.println(ids.iterator().next());

    }
}


text:
from django import forms
from django.contrib import admin
from django.utils.timezone import now

# Register your models here.

from .models import Post

class PostAdminForm(forms.ModelForm):

    class Meta:
        model = Post

        fields = ['is_published', 'title', 'slug', 'excerpt', 'body']

        labels = {
            'is_published': 'Is published?',
        }

@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
    date_hierarchy = 'published_at'
    list_display = (
        'title',
        'is_published',
        'published_at',
        'created_at',
        'updated_at',
    )

    list_filter = ('is_published',)

    ordering = (
        '-published_at',
        '-created_at',
    )
    search_fields = (
        'title',
        'excerpt',
    )

    form = PostAdminForm

    prepopulated_fields = {
        'slug': ('title',)
    }

    def save_model(self, request, obj, form, change):
        if form.has_changed() and 'is_published' in form.changed_data:
            if obj.is_published:
                obj.published_at = now()
            else:
                obj.published_at = None

        super(PostAdmin, self).save_model(request, obj, form, change)


text:
package metric_parser

import (
//"github.com/Cepave/open-falcon-backend/common/utils"
//"log"
)

type metricType byte

const (
	MetricMax         metricType = 1
	MetricMin         metricType = 2
	MetricAvg         metricType = 3
	MetricMed         metricType = 4
	MetricMdev        metricType = 5
	MetricLoss        metricType = 6
	MetricCount       metricType = 7
	MetricPckSent     metricType = 8
	MetricPckReceived metricType = 9
	MetricNumAgent    metricType = 10
	MetricNumTarget   metricType = 11
)

var mapOfMetric = map[string]metricType{
	"max":          MetricMax,
	"min":          MetricMin,
	"avg":          MetricAvg,
	"med":          MetricMed,
	"mdev":         MetricMdev,
	"loss":         MetricLoss,
	"count":        MetricCount,
	"pck_sent":     MetricPckSent,
	"pck_received": MetricPckReceived,
	"num_agent":    MetricNumAgent,
	"num_target":   MetricNumTarget,
}


text:
/**
 * Created by Maikel Rivero Dorta mriverodorta@gmail.com on 7/08/14.
 */
"use strict";
// Declaramos la aplicacion y definimos sus dependencias
angular.module('myApp',[]);
/*angular.module('AngStarter', ['ngRoute']);*/


text:
package com.microsoft.azure.management.monitor;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The Http request info.
 */
public class HttpRequestInfo {
    /**
     * the client request id.
     */
    @JsonProperty(value = "clientRequestId")
    private String clientRequestId;

    /**
     * the client Ip Address.
     */
    @JsonProperty(value = "clientIpAddress")
    private String clientIpAddress;

    /**
     * the Http request method.
     */
    @JsonProperty(value = "method")
    private String method;

    /**
     * the Uri.
     */
    @JsonProperty(value = "uri")
    private String uri;

    /**
     * Get the clientRequestId value.
     *
     * @return the clientRequestId value
     */
    public String clientRequestId() {
        return this.clientRequestId;
    }

    /**
     * Set the clientRequestId value.
     *
     * @param clientRequestId the clientRequestId value to set
     * @return the HttpRequestInfo object itself.
     */
    public HttpRequestInfo withClientRequestId(String clientRequestId) {
        this.clientRequestId = clientRequestId;
        return this;
    }

    /**
     * Get the clientIpAddress value.
     *
     * @return the clientIpAddress value
     */
    public String clientIpAddress() {
        return this.clientIpAddress;
    }

    /**
     * Set the clientIpAddress value.
     *
     * @param clientIpAddress the clientIpAddress value to set
     * @return the HttpRequestInfo object itself.
     */
    public HttpRequestInfo withClientIpAddress(String clientIpAddress) {
        this.clientIpAddress = clientIpAddress;
        return this;
    }

    /**
     * Get the method value.
     *
     * @return the method value
     */
    public String method() {
        return this.method;
    }

    /**
     * Set the method value.
     *
     * @param method the method value to set
     * @return the HttpRequestInfo object itself.
     */
    public HttpRequestInfo withMethod(String method) {
        this.method = method;
        return this;
    }

    /**
     * Get the uri value.
     *
     * @return the uri value
     */
    public String uri() {
        return this.uri;
    }

    /**
     * Set the uri value.
     *
     * @param uri the uri value to set
     * @return the HttpRequestInfo object itself.
     */
    public HttpRequestInfo withUri(String uri) {
        this.uri = uri;
        return this;
    }

}


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

<TITLE>
Uses of Interface org.springframework.transaction.TransactionDefinition (Spring Framework API 2.5)
</TITLE>

<META NAME="date" CONTENT="2007-11-19">

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
org.springframework.transaction.TransactionDefinition

Packages that use TransactionDefinition

org.springframework.jca.cci.connection
Provides a utility class for easy ConnectionFactory access,
a PlatformTransactionManager for local CCI transactions,
and various simple ConnectionFactory proxies/adapters.

org.springframework.jdbc.datasource
Provides a utility class for easy DataSource access,
a PlatformTransactionManager for a single DataSource,
and various simple DataSource implementations.

org.springframework.jms.connection
Provides a PlatformTransactionManager implementation for a single
JMS ConnectionFactory, and a SingleConnectionFactory adapter.

org.springframework.orm.hibernate3
Package providing integration of
Hibernate3
with Spring concepts.

org.springframework.orm.jdo
Package providing integration of JDO (Java Date Objects) with Spring concepts.

org.springframework.orm.jpa
Package providing integration of JPA (Java Persistence API) with Spring concepts.

org.springframework.orm.jpa.vendor
Support classes for adapting to specific JPA vendors.

org.springframework.orm.toplink
Package providing integration of
Oracle TopLink
with Spring concepts.

org.springframework.test
Superclasses for tests requiring Spring application contexts,
including support for transactional execution of test cases,
with automatic rollback on completion.

org.springframework.test.context.transaction
Transactional support classes for the Spring TestContext
Framework.

org.springframework.transaction
Exception hierarchy for Spring's transaction infrastructure,
independent of any specific transaction management system.

org.springframework.transaction.interceptor
AOP-based solution for declarative transaction demarcation.

org.springframework.transaction.jta
Transaction SPI implementation for JTA.

org.springframework.transaction.support
Support classes for the org.springframework.transaction package.

Uses of TransactionDefinition in org.springframework.jca.cci.connection

Methods in org.springframework.jca.cci.connection with parameters of type TransactionDefinition

protected  void
CciLocalTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.jdbc.datasource

Methods in org.springframework.jdbc.datasource with parameters of type TransactionDefinition

protected  void
DataSourceTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

          This implementation sets the isolation level but ignores the timeout.

static Integer
DataSourceUtils.prepareConnectionForTransaction(Connection con,
                                TransactionDefinition definition)

          Prepare the given Connection with the given transaction semantics.

Uses of TransactionDefinition in org.springframework.jms.connection

Methods in org.springframework.jms.connection with parameters of type TransactionDefinition

protected  void
JmsTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.orm.hibernate3

Methods in org.springframework.orm.hibernate3 with parameters of type TransactionDefinition

protected  void
HibernateTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.orm.jdo

Methods in org.springframework.orm.jdo with parameters of type TransactionDefinition

 Object
JdoDialect.beginTransaction(javax.jdo.Transaction transaction,
                 TransactionDefinition definition)

          Begin the given JDO transaction, applying the semantics specified by the
 given Spring transaction definition (in particular, an isolation level
 and a timeout).

 Object
DefaultJdoDialect.beginTransaction(javax.jdo.Transaction transaction,
                 TransactionDefinition definition)

          This implementation invokes the standard JDO Transaction.begin
 method.

protected  void
JdoTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.orm.jpa

Methods in org.springframework.orm.jpa with parameters of type TransactionDefinition

 Object
JpaDialect.beginTransaction(javax.persistence.EntityManager entityManager,
                 TransactionDefinition definition)

          Begin the given JPA transaction, applying the semantics specified by the
 given Spring transaction definition (in particular, an isolation level
 and a timeout).

 Object
DefaultJpaDialect.beginTransaction(javax.persistence.EntityManager entityManager,
                 TransactionDefinition definition)

          This implementation invokes the standard JPA Transaction.begin
 method.

protected  void
JpaTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.orm.jpa.vendor

Methods in org.springframework.orm.jpa.vendor with parameters of type TransactionDefinition

 Object
TopLinkJpaDialect.beginTransaction(javax.persistence.EntityManager entityManager,
                 TransactionDefinition definition)

 Object
OpenJpaDialect.beginTransaction(javax.persistence.EntityManager entityManager,
                 TransactionDefinition definition)

 Object
HibernateJpaDialect.beginTransaction(javax.persistence.EntityManager entityManager,
                 TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.orm.toplink

Methods in org.springframework.orm.toplink with parameters of type TransactionDefinition

protected  void
TopLinkTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

Uses of TransactionDefinition in org.springframework.test

Fields in org.springframework.test declared as TransactionDefinition

protected  TransactionDefinition
AbstractTransactionalSpringContextTests.transactionDefinition

          Transaction definition used by this test class: by default, a plain
 DefaultTransactionDefinition.

Methods in org.springframework.test with parameters of type TransactionDefinition

protected  void
AbstractTransactionalSpringContextTests.setTransactionDefinition(TransactionDefinition customDefinition)

          Call this method in an overridden ConditionalTestCase.runBare() method to override
 the transaction attributes that will be used, so that AbstractSingleSpringContextTests.setUp()
 and AbstractSingleSpringContextTests.tearDown() behavior is modified.

Uses of TransactionDefinition in org.springframework.test.context.transaction

Fields in org.springframework.test.context.transaction declared as TransactionDefinition

protected  TransactionDefinition
TransactionalTestExecutionListener.transactionDefinition

          Transaction definition used by this
 TransactionalTestExecutionListener.

Uses of TransactionDefinition in org.springframework.transaction

Methods in org.springframework.transaction with parameters of type TransactionDefinition

 TransactionStatus
PlatformTransactionManager.getTransaction(TransactionDefinition definition)

          Return a currently active transaction or create a new one, according to
 the specified propagation behavior.

Uses of TransactionDefinition in org.springframework.transaction.interceptor

Subinterfaces of TransactionDefinition in org.springframework.transaction.interceptor

 interface
TransactionAttribute

          This interface adds a rollbackOn specification to TransactionDefinition.

Classes in org.springframework.transaction.interceptor that implement TransactionDefinition

 class
DefaultTransactionAttribute

          Transaction attribute that takes the EJB approach to rolling
 back on runtime, but not checked, exceptions.

 class
DelegatingTransactionAttribute

          TransactionAttribute implementation that delegates all calls to a given target
 TransactionAttribute.

 class
RuleBasedTransactionAttribute

          TransactionAttribute implementation that works out whether a given exception
 should cause transaction rollback by applying a number of rollback rules,
 both positive and negative.

Uses of TransactionDefinition in org.springframework.transaction.jta

Methods in org.springframework.transaction.jta with parameters of type TransactionDefinition

protected  void
JtaTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

protected  void
WebLogicJtaTransactionManager.doJtaBegin(JtaTransactionObject txObject,
           TransactionDefinition definition)

protected  void
OC4JJtaTransactionManager.doJtaBegin(JtaTransactionObject txObject,
           TransactionDefinition definition)

protected  void
JtaTransactionManager.doJtaBegin(JtaTransactionObject txObject,
           TransactionDefinition definition)

          Perform a JTA begin on the JTA UserTransaction or TransactionManager.

 Object
WebSphereUowTransactionManager.execute(TransactionDefinition definition,
        TransactionCallback callback)

Uses of TransactionDefinition in org.springframework.transaction.support

Classes in org.springframework.transaction.support that implement TransactionDefinition

 class
DefaultTransactionDefinition

          Default implementation of the TransactionDefinition interface,
 offering bean-style configuration and sensible default values
 (PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false).

 class
TransactionTemplate

          Template class that simplifies programmatic transaction demarcation and
 transaction exception handling.

Methods in org.springframework.transaction.support with parameters of type TransactionDefinition

protected  int
AbstractPlatformTransactionManager.determineTimeout(TransactionDefinition definition)

          Determine the actual timeout to use for the given definition.

protected abstract  void
AbstractPlatformTransactionManager.doBegin(Object transaction,
        TransactionDefinition definition)

          Begin a new transaction with semantics according to the given transaction
 definition.

 Object
CallbackPreferringPlatformTransactionManager.execute(TransactionDefinition definition,
        TransactionCallback callback)

          Execute the action specified by the given callback object within a transaction.

 TransactionStatus
AbstractPlatformTransactionManager.getTransaction(TransactionDefinition definition)

          This implementation handles propagation behavior.

protected  DefaultTransactionStatus
AbstractPlatformTransactionManager.newTransactionStatus(TransactionDefinition definition,
                     Object transaction,
                     boolean newTransaction,
                     boolean newSynchronization,
                     boolean debug,
                     Object suspendedResources)

          Create a new TransactionStatus for the given arguments,
 initializing transaction synchronization as appropriate.

Constructors in org.springframework.transaction.support with parameters of type TransactionDefinition

DefaultTransactionDefinition(TransactionDefinition other)

          Copy constructor.

TransactionTemplate(PlatformTransactionManager transactionManager,
                    TransactionDefinition transactionDefinition)

          Construct a new TransactionTemplate using the given transaction manager,
 taking its default settings from the given transaction definition.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2002-2007 The Spring Framework.


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bragalund.taxiorder">

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <activity android:name=".Activities.StartScreenActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Activities.MapActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.APP_MAPS" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
<?xml version="1.0" encoding="utf-8"?>
<book id="3JN" singlevoice="false" pageheader="3-e Иоанна">
  <block style="mt" chapter="0" book="3JN" initialStartVerse="0" characterId="BC-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="mt" chapter="0" book="3JN" initialStartVerse="0" characterId="BC-3JN">
      <text>3 JOHN</text>
    </ReferenceBlocks>
    <text>3-e Иоанна</text>
  </block>
  <block style="c" paragraphStart="true" chapter="1" book="3JN" initialStartVerse="0" characterId="BC-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="c" chapter="1" initialStartVerse="0">
      <text>3 JOHN CHP 1</text>
    </ReferenceBlocks>
    <text>1</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="1" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="1" characterId="narrator-3JN">
      <verse num="1" />
      <text>The elder to Gaius the beloved, whom I love in truth.</text>
    </ReferenceBlocks>
    <verse num="1" />
    <text>Старец— возлюбленному Гаию, которого я люблю по истине.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="2" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="2" characterId="narrator-3JN">
      <verse num="2" />
      <text>Beloved, I pray that you may prosper in all things and be healthy, even as your soul prospers.</text>
    </ReferenceBlocks>
    <verse num="2" />
    <text>Возлюбленный! молюсь, чтобы ты здравствовал и преуспевал во всем, как преуспевает душа твоя.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="3" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="3" characterId="narrator-3JN">
      <verse num="3" />
      <text>For I rejoiced greatly, when brothers came and testified about your truth, even as you walk in truth.</text>
    </ReferenceBlocks>
    <verse num="3" />
    <text>Ибо я весьма обрадовался, когда пришли братия и засвидетельствовали о твоей верности, как ты ходишь в истине.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="4" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="4" characterId="narrator-3JN">
      <verse num="4" />
      <text>I have no greater joy than this, to hear about my children walking in truth.</text>
    </ReferenceBlocks>
    <verse num="4" />
    <text>Для меня нет большей радости, как слышать, что дети мои ходят в истине.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="5" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="5" characterId="narrator-3JN">
      <verse num="5" />
      <text>Beloved, you do a faithful work in whatever you accomplish for those who are brothers and strangers.</text>
    </ReferenceBlocks>
    <verse num="5" />
    <text>Возлюбленный! ты как верный поступаешь в том, что делаешь для братьев и для странников.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="6" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="6" characterId="narrator-3JN">
      <verse num="6" />
      <text>They have testified about your love before the assembly. You will do well to send them forward on their journey in a way worthy of God.</text>
    </ReferenceBlocks>
    <verse num="6" />
    <text>Они засвидетельствовали перед церковью о твоей любви. Ты хорошо поступишь, если отпустишь их, как должно ради Бога,</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="7" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="7" characterId="narrator-3JN">
      <verse num="7" />
      <text>For the sake of the Name they went out, taking nothing from the Gentiles.</text>
    </ReferenceBlocks>
    <verse num="7" />
    <text>ибо они ради имени Его пошли, не взяв ничего от язычников.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="8" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="8" characterId="narrator-3JN">
      <verse num="8" />
      <text>We therefore ought to receive such, that we may be fellow workers for the truth.</text>
    </ReferenceBlocks>
    <verse num="8" />
    <text>Итак мы должны принимать таковых, чтобы сделаться споспешниками истине.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="9" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="9" characterId="narrator-3JN">
      <verse num="9" />
      <text>I wrote to the assembly, but Diotrephes, who loves to be first among them, doesn't accept what we say.</text>
    </ReferenceBlocks>
    <verse num="9" />
    <text>Я писал церкви; но любящий первенствовать у них Диотреф не принимает нас.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="10" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="10" characterId="narrator-3JN">
      <verse num="10" />
      <text>Therefore if I come, I will call attention to his deeds which he does, unjustly accusing us with wicked words. Not content with this, neither does he himself receive the brothers, and those who would, he forbids and throws out of the assembly.</text>
    </ReferenceBlocks>
    <verse num="10" />
    <text>Посему, если я приду, то напомню о делах, которые он делает, понося нас злыми словами, и не довольствуясь тем, и сам не принимает братьев, и запрещает желающим, и изгоняет из церкви.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="11" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="11" characterId="narrator-3JN">
      <verse num="11" />
      <text>Beloved, don't imitate that which is evil, but that which is good. He who does good is of God. He who does evil hasn't seen God.</text>
    </ReferenceBlocks>
    <verse num="11" />
    <text>Возлюбленный! не подражай злу, но добру. Кто делает добро, тот от Бога; а делающий зло не видел Бога.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="12" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="12" characterId="narrator-3JN">
      <verse num="12" />
      <text>Demetrius has the testimony of all, and of the truth itself; yes, we also testify, and you know that our testimony is true.</text>
    </ReferenceBlocks>
    <verse num="12" />
    <text>О Димитрии засвидетельствовано всеми и самою истиною; свидетельствуем также и мы, и вы знаете, что свидетельство наше истинно.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="13" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="13" characterId="narrator-3JN">
      <verse num="13" />
      <text>I had many things to write to you, but I am unwilling to write to you with ink and pen.</text>
    </ReferenceBlocks>
    <verse num="13" />
    <text>Многое имел я писать; но не хочу писать к тебе чернилами и тростью,</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="14" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="14" characterId="narrator-3JN">
      <verse num="14" />
      <text>I hope to see you soon, and then we will speak face to face.</text>
    </ReferenceBlocks>
    <verse num="14" />
    <text>а надеюсь скоро увидеть тебя и поговорить устами к устам.</text>
  </block>
  <block style="p" paragraphStart="true" chapter="1" initialStartVerse="15" characterId="narrator-3JN" matchesReferenceText="true">
    <ReferenceBlocks style="p" paragraphStart="true" chapter="1" initialStartVerse="15" characterId="narrator-3JN">
      <verse num="15" />
      <text>Peace be to you. The friends greet you. Greet the friends by name.</text>
    </ReferenceBlocks>
    <verse num="15" />
    <text>Мир тебе. Приветствуют тебя друзья; приветствуй друзей поименно. Аминь.</text>
  </block>
  <UnappliedSplits />
</book>


text:
var path = require('path');
var viewPath = path.join(__dirname + "/");
var fs = require("fs");
var _ = require('lodash');
var Logger = require(__configs + "loggingConfig");
var async = require('async');

var url = require('url');
var defaultTool = require(__components + 'Preferences/setupDefaultToolType.js');
var event = require(__components + "InteractionEvents/buildEvent.js");
var tracker = require(__components + "InteractionEvents/trackEvents.js");

var SurveyManager = require(__components + "Survey/helpers/surveyManager");
var SurveyBuilder = require(__components + "Survey/helpers/surveyBuilder");
var Survey = require(__components + "Survey/models/survey");

var preferencesDB = require(__components + 'Preferences/preferenceDB.js');
var TipManager = require(__components + 'TipManager/tipManager.js');

var {Assignment} = require("../../models/assignment");
var {Course} = require("../../models/course");
var {StudentClass} = require("../../models/studentClass");

module.exports = function (app, iosocket) {

  /**
   * Takes the tool preferences and the tools and updates the curren default and preferred values.
   * @param  {[type]} toolPreferences [description]
   * @param  {[type]} tools           [description]
   * @return {[type]}                 [description]
   */
   function updateJsonWithDbValues(toolPreferences, tools) {
        var toolPrefix = "enabled-";
        var optionPrefix = "opt-";
        for (var i = 0; i < toolPreferences.length; i++) {

            var optionName = toolPreferences[i].toolName;
            if (_.startsWith(optionName, toolPrefix)) {
                //Enable the tool checkbox
                optionName = _.replace(optionName, toolPrefix, "");
                var r = _.find(tools, _.matchesProperty('displayName', optionName));
                if (r) {
                    r['prefValue'] = ( toolPreferences[i].toolValue == "on" || toolPreferences[i].toolValue == "true");
                }
            }
            else if (_.startsWith(optionName, optionPrefix)) {
                var r = undefined;
                for (var y = 0; y < tools.length && !r; y++) {
                    var options = tools[y].options;
                    r = _.find(options, _.matchesProperty("name", optionName));
                    if (r) {
                        if (r.type == "checkbox")
                            r['prefValue'] = ( toolPreferences[i].toolValue == "on" || toolPreferences[i].toolValue == "true");
                        else if (r.type == "select" || r.type == "text")
                            r['prefValue'] = toolPreferences[i].toolValue;
                    }
                }
            }

        }
    }

    app.post('/tool/assignment', async function(req, res) {

        var insert = req.body.insert;
        var val = 0;
        var result = [];
        var selectedId = -1;

        if(insert == "*" || insert == "None")
        {
            res.send({'result': result});
        }
        else
        {
            // find assignments which are associated with the course code the student is enrolled in
            var val = await Assignment.query()
            .whereIn('classId', (builder) => {
                builder.select('id')
                .from('class')
                .where("code", "=", insert);
            })
            .catch(function(err) {
                res.send({
                    'value': val
                });
                console.log(err.stack);
                return;
            });

            for(var i = 0; i < val.length; i++)
            {
                if(req.session.submissionFocus && req.session.submissionFocus.assignmentName == val[i].name )
                    selectedId = i;
                result.push(val[i].name);
            }

            res.send({'result': result, 'selectedId':selectedId});
        }

    });

    app.get('/tool/course', async function(req, res) {

        var val = 0;
        var result = [];
        var ids = [];
        var classes = [];
        var userId = req.user.id;
        var selectedId = -1;

        // query course database to find the courses the student is enrolled in
        var val = await Course.query()
        .whereIn('id', (builder) =>{
            builder.select('classId')
            .from('student_class')
            .where("studentId", "=", userId);
        })
        .catch(function(err) {
            res.send({
                'value': val
            });
            console.log(err.stack);
            return;
        });

        for(var i = 0; i < val.length; i++)
        {
            if(req.session.submissionFocus && req.session.submissionFocus.courseName == val[i].code )
                selectedId = i;

            result.push(val[i].code);
            ids.push(val[i].id);
        }

        res.send({
            'result': result,
            'ids': ids,
            'selectedId': selectedId
        });

    });

    app.get('/tool/data', function (req, res) {
        fs.readFile(req.session.toolFile, 'utf-8', function (err, toolData) {
            if (err) {
                //Unable to get supported tools file, larger problem here.
                Logger.error(err);
                res.end();
            }
            else {
                //Load JSON tool file and send back to UI to create inputs
                preferencesDB.getStudentPreferencesByToolType(req.user.id, req.session.toolSelect, function (err, toolPreferences) {

                    var jsonObj = JSON.parse(toolData);
                    var tools = jsonObj['tools'];

                    if (toolPreferences)
                        updateJsonWithDbValues(toolPreferences, tools);

                    res.json(tools);
                });
            }
        });
    });

  /**
   * This loads all the survey data required for loading time.
   * @param  {[type]} req  [description]
   * @param  {[type]} res  [description]
   * @param  {[type]} next )             {                var userId [description]
   * @return {[type]}      [description]
       */
    app.get('/tool', function (req, res, next) {

        const userId = req.user.id || req.passport.user;

        fs.readFile(req.session.toolFile, 'utf-8', function (err, toolData) {
            //Load JSON tool file and send back to UI to create inputs
            preferencesDB.getStudentPreferencesByToolType(req.user.id, req.session.toolSelect, function (err, toolPreferences) {
                var jsonObj = JSON.parse(toolData);
                var tools = jsonObj['tools'];

                if (toolPreferences)
                    updateJsonWithDbValues(toolPreferences, tools);

                TipManager.selectTip(req, res, userId, ( tip) => {
                    if( tip )
                    {
                        res.render(viewPath + "tool", {
                            "tools": tools,
                            "title": req.session.toolSelect + ' Tool Screen',
                            "surveyQuestions": [],
                            "tip": tip
                        });
                    }
                    else
                    {
                        SurveyBuilder.getPulseSurvey(req.session.toolSelect.toLowerCase(), userId, (survey) => {
                            if (!survey) {
                                survey = [];
                            }
                            res.render(viewPath + "tool", {
                                "tools": tools,
                                "title": req.session.toolSelect + ' Tool Screen',
                                "surveyQuestions": survey
                            });
                        });
                    }
                });
            });
        });
    });

      /**
     * Post request from client-angular not a real form. Sending us select info on course/assignment focus data.
     * @param  {[type]} req    [description]
     * @param  {Object} res){                     req.session.dailyFocus [description]
     * @return {[type]}        [description]
     */
    app.post('/tool/saveSubmissionFocusData', function(req,res){
        req.session.submissionFocus = {
            courseName: req.body.courseName,
            assignmentName: req.body.assignName
        };
        tracker.trackEvent( iosocket, event.changeEvent(req.user.sessionId, req.user.id, "submissionFocus", req.session.submissionFocus));
        req.session.save();
    });
}


text:
module Dimensional
  module Enum
    class Attributes

      attr_reader :attrs

      def initialize( enum_attributes_hash={} )
        @attrs = enum_attributes_hash
      end

      def include?(key)
        @attrs.include? key
      end

      def to_attribute_h(enum_key)
        @attrs[enum_key]
      end

      def to_value_h(enum_key)
        hash = @attrs[enum_key].each_with_object({}) do |(key, value), h|
          h[key] = value[:id]
        end
      end

      def to_display_h(enum_key)
        hash = @attrs[enum_key].each_with_object({}) do |(key, value), h|
          h[key] = value[:name]
        end
      end

      def id(enum_key, enum_attr_key)
        @attrs[enum_key.to_sym][enum_attr_key.to_sym][:id]
      rescue
        nil
      end

      def name(enum_key, enum_attr_key)
        @attrs[enum_key.to_sym][enum_attr_key.to_sym][:name]
      rescue
        nil
      end

      def to_json(enum_key)
        arr = []
        @attrs[enum_key].each do |key, value|
          arr << { value: key, text: value[:name] }
        end
        JSON.unparse arr
      end

      alias_method :to_origin_h, :to_attribute_h
    end
  end
end


text:
#define LOG_TAG "matrix_ringbuf"
#include <string.h>

#include "mhal_defines.h"
#include "matrix_ringbuf.h"
#include <utils/Log.h>

typedef struct {
	unsigned int in;
	unsigned int out;
	unsigned int bufsize;
	unsigned char *buf;
	unsigned int allocFlag;
} _matrix_ringbuf;

 matrix_ringbuf_handle matrix_ringbuf_init(unsigned int bufsize) {
 	return matrix_ringbuf_initwithbuffer(NULL,bufsize);
}

matrix_ringbuf_handle matrix_ringbuf_initwithbuffer(void* ptr,unsigned int bufsize){
	ALOGI("ENTER %s\n", __FUNCTION__);
	if (bufsize & (bufsize - 1)) {
		ALOGE("%d bufsize should be 2^n", bufsize);
		return NULL;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf*)malloc(sizeof(_matrix_ringbuf));
	memset(ringBuf, 0, sizeof(_matrix_ringbuf));
	if (ptr != NULL){
		ringBuf->buf =(char*)ptr;
		ringBuf->allocFlag = 0;
	}else{
		ringBuf->buf = (unsigned char*)malloc(bufsize);
		ringBuf->allocFlag = 1;
	}

	MHAL_ASSERT(ringBuf->buf != NULL, "matrix_ringbuf_init : malloc Failed!!!");
	memset(ringBuf->buf, 0, bufsize);

	ringBuf->bufsize = bufsize;
	ALOGD("####EXIT %s bufsize =%d", __FUNCTION__, ringBuf->bufsize);
	return (void*)ringBuf;
}

unsigned int matrix_ringbuf_in(matrix_ringbuf_handle handle, unsigned char *buf, unsigned int size) {
	unsigned int len=0;

	//LOGV("ENTER %s", __FUNCTION__);
	if(handle == NULL || buf == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	//LOGV("@1 %s size=%u", __FUNCTION__, size);
	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	// size = min(size, freeSize)
	size = MHAL_MIN(size, (ringBuf->bufsize - (ringBuf->in - ringBuf->out)));
	//LOGV("@2 %s, size=%u, bufsize=%u, in=%u, out=%u", __FUNCTION__, size, ringBuf->bufsize, ringBuf->in, ringBuf->out);

	/* first put the data starting from fifo->in to buffer end */
    len = MHAL_MIN(size, ringBuf->bufsize - (ringBuf->in & (ringBuf->bufsize- 1)));
	int offset = (ringBuf->in & (ringBuf->bufsize - 1));
	//LOGV("@2-2 offset = %u", offset);
    memcpy(ringBuf->buf+offset , buf, len);
	//LOGV("@3 %s, len=%u, size=%u, bufsize=%u, in=%u, out=%u", __FUNCTION__, len, size, ringBuf->bufsize, ringBuf->in, ringBuf->out);

    /* then put the rest (if any) at the beginning of the buffer */
    memcpy(ringBuf->buf, buf + len, size - len);

    ringBuf->in += size;
	//LOGV("@4 %s in=%u", __FUNCTION__, size);

	//LOGV("EXIT %s write in size=%u", __FUNCTION__, size);
	return size;
}

unsigned int matrix_ringbuf_out(matrix_ringbuf_handle handle, unsigned char *buf, unsigned int size) {

	unsigned int len=0;

	//LOGV("ENTER %s", __FUNCTION__);
	if(handle == NULL || buf == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	// size = min(size, dataSize)
	size = MHAL_MIN(size, (ringBuf->in-ringBuf->out));

	/* first put the data starting from fifo->in to buffer end */
    len = MHAL_MIN(size, ringBuf->bufsize - (ringBuf->out & (ringBuf->bufsize- 1)));
    memcpy(buf, ringBuf->buf+ (ringBuf->out & (ringBuf->bufsize - 1)),  len);

    /* then put the rest (if any) at the beginning of the buffer */
    memcpy(buf + len, ringBuf->buf,  size - len);

    ringBuf->out += size;
	//LOGV("EXIT %s read out size=%d", __FUNCTION__, size);
	return size;
}

unsigned int matrix_ringbuf_skip(matrix_ringbuf_handle handle, unsigned int size){
	ALOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	if ((ringBuf->in - ringBuf->out) == 0) {
		ALOGW("%s, Here is no data in ring buffer", __FUNCTION__);
		return 0;
	}

	// size = min(size, dataSize)
	size = MHAL_MIN(size, (ringBuf->in - ringBuf->out));

	//skip
	ringBuf->out += size;

	MHAL_ASSERT(ringBuf->out <= ringBuf->in, "matrix_ringbuf_skip ERROR skip!");

	return size;
}

unsigned int matrix_ringbuf_aquireOut(matrix_ringbuf_handle handle, const unsigned char**buf) {

	unsigned int len = 0;

	//LOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL || buf == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	if ((ringBuf->in - ringBuf->out) == 0) {
		ALOGW("%s, Here is no data in ring buffer", __FUNCTION__);
		*buf = NULL;
		return 0;
	}

	// size =  dataSize
	len = ringBuf->in - ringBuf->out;

	//len = min(size, dataSize(out -> end))
    len = MHAL_MIN(len, ringBuf->bufsize - (ringBuf->out & (ringBuf->bufsize- 1)));
	*buf = ringBuf->buf+ (ringBuf->out & (ringBuf->bufsize - 1));

	return len;
}

unsigned int matrix_ringbuf_confirmAquireOut(matrix_ringbuf_handle handle, unsigned int size) {

	unsigned int len = 0;

	//LOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	//min(size, dataSize)
	size = MHAL_MIN(size, (ringBuf->in - ringBuf->out));
	//min(size, out->end)
    len = MHAL_MIN(size, ringBuf->bufsize - (ringBuf->out & (ringBuf->bufsize- 1)));

	if(ringBuf->out+len > ringBuf->in)
		ringBuf->out = ringBuf->in;
	else
		ringBuf->out += len;

	//LOGV("EXIT %s finished zero-copy read len = %u", __FUNCTION__, len);

	return len;
}

unsigned int matrix_ringbuf_aquireIn(matrix_ringbuf_handle handle, unsigned char**buf) {

	unsigned int len = 0;

	ALOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL || buf == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	if (ringBuf->bufsize - (ringBuf->in - ringBuf->out) == 0) {
		ALOGW("%s, Here is no free space in ring buffer", __FUNCTION__);
		*buf = NULL;
		return 0;
	}

	// len =  freeSpaceSize
	len = ringBuf->bufsize - (ringBuf->in - ringBuf->out);

	//len= min(size, dataSize(in -> end))
    len = MHAL_MIN(len, ringBuf->bufsize - (ringBuf->in & (ringBuf->bufsize- 1)));

	*buf = ringBuf->buf+ (ringBuf->in & (ringBuf->bufsize - 1));

	return len;
}

unsigned int matrix_ringbuf_confirmAquireIn(matrix_ringbuf_handle handle, unsigned int size) {

	unsigned int len = 0;

	ALOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	//min(size, freeSpaceSize)
	size = MHAL_MIN(size, (ringBuf->bufsize - (ringBuf->in - ringBuf->out)));

	//min(size, in->end)
    len = MHAL_MIN(size, ringBuf->bufsize - (ringBuf->in & (ringBuf->bufsize- 1)));

	ringBuf->in += len;

	ALOGI("EXIT %s finished zero-copy write len = %u", __FUNCTION__, len);

	return len;
}

unsigned int matrix_ringbuf_getDataSize(matrix_ringbuf_handle handle){

	unsigned int len = -1;

	//LOGV("ENTER %s handle(%p)", __FUNCTION__, (void*)handle);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	len = ringBuf->in - ringBuf->out;

	//LOGV("EXIT %s , in = %u, out = %u, validData = %u", __FUNCTION__, ringBuf->in, ringBuf->out, len);

	return len;
}

unsigned int matrix_ringbuf_getFreeSize(matrix_ringbuf_handle handle){

	unsigned int len = -1;

	//LOGV("ENTER %s handle(%p)", __FUNCTION__, (void*)handle);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	len = ringBuf->bufsize - (ringBuf->in - ringBuf->out);

	//LOGV("EXIT %s , in = %u, out = %u, freeSpaceSize = %u", __FUNCTION__, ringBuf->in, ringBuf->out, len);

	return len;

}

unsigned int matrix_ringbuf_rewind(matrix_ringbuf_handle handle, unsigned int size){

	unsigned int len = 0;

	ALOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return 0;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	if(ringBuf->in <= ringBuf->bufsize  && ringBuf->out <= ringBuf->bufsize)
		len = ringBuf->out;
	else
		len = ringBuf->bufsize - (ringBuf->in - ringBuf->out);

	if(size != 0xFFFFFFFF)
		len = MHAL_MIN(size, len);

	ringBuf->out -= len;

	ALOGV("EXIT %s rewind len = %u", __FUNCTION__, len);

	return len;

}

int matrix_ringbuf_reset(matrix_ringbuf_handle handle) {

	ALOGV("ENTER %s", __FUNCTION__);
	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return MHAL_EINVAL;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;
	ringBuf->out = 0;
	ringBuf->in = 0;

	ALOGV("EXIT %s", __FUNCTION__);
	return MHAL_SUCCESS;
}

int matrix_ringbuf_exit(matrix_ringbuf_handle handle) {

	ALOGV("ENTER %s", __FUNCTION__);

	if(handle == NULL){
		ALOGE("%s, Invalid Input Params!", __FUNCTION__);
		return MHAL_EINVAL;
	}

	_matrix_ringbuf *ringBuf = (_matrix_ringbuf *)handle;

	if (ringBuf->allocFlag ==  1 && ringBuf->buf != NULL){
		free(ringBuf->buf);
	}

	memset(ringBuf, 0, sizeof(_matrix_ringbuf));

	ALOGV("EXIT %s", __FUNCTION__);
	return MHAL_SUCCESS;
}


text:
typedef NS_ENUM(NSUInteger, JKImagePickerControllerFilterType) {
    JKImagePickerControllerFilterTypeNone,
    JKImagePickerControllerFilterTypePhotos,
    JKImagePickerControllerFilterTypeVideos
};

UIKIT_EXTERN ALAssetsFilter * ALAssetsFilterFromJKImagePickerControllerFilterType(JKImagePickerControllerFilterType type);

@class JKImagePickerController;

@protocol JKImagePickerControllerDelegate <NSObject>

@optional
- (void)imagePickerController:(JKImagePickerController *)imagePicker didSelectAsset:(JKAssets *)asset isSource:(BOOL)source;
- (void)imagePickerController:(JKImagePickerController *)imagePicker didSelectAssets:(NSArray *)assets isSource:(BOOL)source;
- (void)imagePickerControllerDidCancel:(JKImagePickerController *)imagePicker;
- (void)imagePickerController:(JKImagePickerController *)imagePicker didPhoto:(JKAssets *)asset;
@end

@interface JKImagePickerController : UIViewController

@property (nonatomic, weak) id<JKImagePickerControllerDelegate> delegate;
@property (nonatomic, assign) JKImagePickerControllerFilterType filterType;
@property (nonatomic, assign) BOOL showsCancelButton;
@property (nonatomic, assign) BOOL allowsMultipleSelection;
@property (nonatomic, assign) NSUInteger minimumNumberOfSelection;
@property (nonatomic, assign) NSUInteger maximumNumberOfSelection;
@property (nonatomic, strong) NSMutableArray     *selectedAssetArray;

@end


text:
package hydra;

/**
 * A class used to store keys for gateway receiver configuration
 * settings.  The settings are used to create instances of {@link
 * GatewayReceiverDescription}.
 *

 * The number of description instances is gated by {@link #names}.  For other
 * parameters, if fewer values than names are given, the remaining instances
 * will use the last value in the list.  See $JTESTS/hydra/hydra.txt for more
 * details.
 *

 * Unused parameters default to null, except where noted.  This uses the
 * product default, except where noted.
 *

 * Values of a parameter can be set to {@link #DEFAULT}, except where noted.
 * This uses the product default, except where noted.
 *

 * Values and fields can be set to {@link #NONE} where noted, with the
 * documented effect.
 *

 * Values of a parameter can use oneof, range, or robing except where noted, but
 * each description created will use a fixed value chosen at test configuration
 * time.  Use as a task attribute is illegal.
 */
public class GatewayReceiverPrms extends BasePrms {

  /**
   * (String(s))
   * Logical names of the gateway receiver descriptions.  Each name must be
   * unique.  Defaults to null.  Not for use with oneof, range, or robing.
   */
  public static Long names;

  /**
   * (int(s))
   * Ending port to use for each gateway receiver port range.
   */
  public static Long endPort;

  /**
   * (Comma-separated String(s))
   * Class names of gateway transport filters for each gateway receiver.  Can be
   * specified as {@link #NONE}.
   *

   * Example: To use ClassA and ClassB for the first gateway receiver, none for
   * the second gateway receiver, and ClassC for the third gateway receiver,
   * specify:
   *     ClassA ClassB, none, ClassC
   */
  public static Long gatewayTransportFilters;

  /**
   * (int(s))
   * Maximum time between pings for each gateway receiver.
   */
  public static Long maximumTimeBetweenPings;

  /**
   * (int(s))
   * Number of ports to listen on per JVM for each gateway receiver when
   * creating instances with {@link GatewayReceiverHelper
   * #createAndStartGatewayReceiver(String)}.  Defaults to 1.
   *

   * For example,
   */
  public static Long numInstances;

  /**
   * (int(s))
   * Starting port to use for each gateway receiver port range.
   */
  public static Long startPort;

  /**
   * (int(s))
   * Socket buffer size for each gateway receiver.
   */
  public static Long socketBufferSize;

//------------------------------------------------------------------------------
// parameter setup
//------------------------------------------------------------------------------

  static {
    setValues(GatewayReceiverPrms.class);
  }
}


text:
package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)

// StorageBridgeReference Bridge
//
// swagger:model storage_bridge_reference
type StorageBridgeReference struct {

	// links
	Links *StorageBridgeReferenceLinks `json:"_links,omitempty"`

	// wwn
	// Example: 2000001086600476
	Wwn string `json:"wwn,omitempty"`
}

// Validate validates this storage bridge reference
func (m *StorageBridgeReference) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateLinks(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *StorageBridgeReference) validateLinks(formats strfmt.Registry) error {
	if swag.IsZero(m.Links) { // not required
		return nil
	}

	if m.Links != nil {
		if err := m.Links.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("_links")
			}
			return err
		}
	}

	return nil
}

// ContextValidate validate this storage bridge reference based on the context it is used
func (m *StorageBridgeReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := m.contextValidateLinks(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *StorageBridgeReference) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error {

	if m.Links != nil {
		if err := m.Links.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("_links")
			}
			return err
		}
	}

	return nil
}

// MarshalBinary interface implementation
func (m *StorageBridgeReference) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *StorageBridgeReference) UnmarshalBinary(b []byte) error {
	var res StorageBridgeReference
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}

// StorageBridgeReferenceLinks storage bridge reference links
//
// swagger:model StorageBridgeReferenceLinks
type StorageBridgeReferenceLinks struct {

	// self
	Self *Href `json:"self,omitempty"`
}

// Validate validates this storage bridge reference links
func (m *StorageBridgeReferenceLinks) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateSelf(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *StorageBridgeReferenceLinks) validateSelf(formats strfmt.Registry) error {
	if swag.IsZero(m.Self) { // not required
		return nil
	}

	if m.Self != nil {
		if err := m.Self.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("_links" + "." + "self")
			}
			return err
		}
	}

	return nil
}

// ContextValidate validate this storage bridge reference links based on the context it is used
func (m *StorageBridgeReferenceLinks) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := m.contextValidateSelf(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *StorageBridgeReferenceLinks) contextValidateSelf(ctx context.Context, formats strfmt.Registry) error {

	if m.Self != nil {
		if err := m.Self.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("_links" + "." + "self")
			}
			return err
		}
	}

	return nil
}

// MarshalBinary interface implementation
func (m *StorageBridgeReferenceLinks) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *StorageBridgeReferenceLinks) UnmarshalBinary(b []byte) error {
	var res StorageBridgeReferenceLinks
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: keanor
 * Date: 17.08.15
 * Time: 22:23
 */

namespace JiraRestApi\Configuration;

/**
 * Class AbstractConfiguration
 *
 * @package JiraRestApi\Configuration
 */
abstract class AbstractConfiguration implements ConfigurationInterface
{
    /**
     * Jira host
     *
     * @var string
     */
    protected $jiraHost;

    /**
     * Jira login
     *
     * @var string
     */
    protected $jiraUser;

    /**
     * Jira password
     *
     * @var string
     */
    protected $jiraPassword;

    /**
     * Path to log file
     *
     * @var string
     */
    protected $jiraLogFile;

    /**
     * Log level (DEBUG, INFO, ERROR, WARNING)
     *
     * @var string
     */
    protected $jiraLogLevel;

    /**
     * Curl options CURLOPT_SSL_VERIFYHOST
     *
     * @var boolean
     */
    protected $curlOptSslVerifyHost;

    /**
     * Curl options CURLOPT_SSL_VERIFYPEER
     *
     * @var boolean
     */
    protected $curlOptSslVerifyPeer;

    /**
     * Curl options CURLOPT_VERBOSE
     *
     * @var boolean
     */
    protected $curlOptVerbose;

    /**
     * @return string
     */
    public function getJiraHost()
    {
        return $this->jiraHost;
    }

    /**
     * @return string
     */
    public function getJiraUser()
    {
        return $this->jiraUser;
    }

    /**
     * @return string
     */
    public function getJiraPassword()
    {
        return $this->jiraPassword;
    }

    /**
     * @return string
     */
    public function getJiraLogFile()
    {
        return $this->jiraLogFile;
    }

    /**
     * @return string
     */
    public function getJiraLogLevel()
    {
        return $this->jiraLogLevel;
    }

    /**
     * @return boolean
     */
    public function isCurlOptSslVerifyHost()
    {
        return $this->curlOptSslVerifyHost;
    }

    /**
     * @return boolean
     */
    public function isCurlOptSslVerifyPeer()
    {
        return $this->curlOptSslVerifyPeer;
    }

    /**
     * @return boolean
     */
    public function isCurlOptVerbose()
    {
        return $this->curlOptVerbose;
    }
}


text: export default state => state.navigation;


text:
namespace OPS
{
	namespace Analysis
	{
		class AnalysisPlugin
			: public Core::IPlugin
		{
		public:

			AnalysisPlugin();

		public: // Core::IPlugin

			virtual void initialize(); // override
			virtual void terminate(); // override
		};
	}
}

#endif // _ANALYSIS_PLUGIN_H_INCLUDED_


text:
Provides deploy and db restore tasks for your app

Use the following environmental variables to control the heroku app name to be deployed/restored from:

```
HEROKU_APPNAME_PRODUCTION
HEROKU_APPNAME_STAGING
```

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'heroku_rake_deploy', group: :development # No need to include this on production or staging
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install heroku_rake_deploy

## Usage
To see an updated list of tasks and descriptions:
`bundle exec rake heroku_rake_deploy -T heroku_rake_deploy`

~~~bash
rake db:restore                  # Pull Down a copy of the database from the specified heroku environment
rake db:restore:from_local_dump  # Restore from local dump file (defaults to '/tmp/latest.dump' - specify with DUMP_FILE Environmental Variable)
rake db:restore:local            # Erase local development and test database and restore from the local dump file
rake db:restore:production       # Restore a local copy of Heroku's Production Environment database
rake db:restore:staging          # Restore a local copy of Heroku's Staging Environment database
rake deploy                      # Deploy Safely to Heroku
rake deploy:production           # Deploy to Heroku's Production Environment
rake deploy:production:quick     # Quick Deploy to Production, without running migrations
rake deploy:staging:quick        # Quick Deploy to Staging, without running migrations
~~~

## Dependencies
The `db:restores`  tasks rely on the following gem:
* https://github.com/ldstudios/heroku_db_restore

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ldstudios/heroku_rake_deploy.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
require File.expand_path("#{File.dirname __FILE__}/node")

module CPN
  class State < Node
    attr_reader :marking
    attr_accessor :initial

    def initialize(name)
      super
      @marking = CPN::Marking.new
      listen_to_marking
    end

    def initial=(init_expr)
      @initial = init_expr
      reset
    end

    def empty?
      @marking.empty?
    end

    def remove_token(token, modify_initial = false)
      @marking.delete(token,false)
      @initial = @marking.as_json.join(', ') if(modify_initial)
    end

    def add_token(token, modify_initial = false)
      @marking << token
      @initial = @marking.as_json.join(', ') if(modify_initial)
    end

    def to_hash
      super.merge(
        :marking => marking.to_hash,
        :initial => initial
      )
    end

    def to_s
      s = "(#{@name})"
      s << "{#{@marking.as_json.join(',')}}" unless @marking.empty?
      s
    end

    def reset
      @marking.set(eval("[ #{@initial && @initial.to_s.gsub(/\@([\d\.]+)/,'.ready_at(\1)')} ]"))
    end

    def fuse_with(source_state)
      @marking.off
      source_state.marking.fuse_with(@marking)
      @marking = source_state.marking
      if @initial.nil?
        @initial = source_state.initial
      elsif source_state.initial.nil?
        source_state.initial = @initial
      end
      listen_to_marking
    end

    private

    def listen_to_marking
      @marking.on(:updated) do |source, op|
        @container.fire_state_changed(self, op) if @container
      end
    end

  end

end


text:
package org.apache.ignite.internal.processors.odbc.odbc;

import java.util.Collection;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.binary.BinaryReaderExImpl;
import org.apache.ignite.internal.binary.BinaryThreadLocalContext;
import org.apache.ignite.internal.binary.BinaryWriterExImpl;
import org.apache.ignite.internal.binary.GridBinaryMarshaller;
import org.apache.ignite.internal.binary.streams.BinaryHeapInputStream;
import org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream;
import org.apache.ignite.internal.binary.streams.BinaryInputStream;
import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
import org.apache.ignite.internal.processors.odbc.ClientListenerMessageParser;
import org.apache.ignite.internal.processors.odbc.ClientListenerProtocolVersion;
import org.apache.ignite.internal.processors.odbc.ClientListenerRequest;
import org.apache.ignite.internal.processors.odbc.ClientListenerResponse;
import org.apache.ignite.internal.processors.odbc.SqlListenerUtils;
import org.jetbrains.annotations.NotNull;

/**
 * JDBC message parser.
 */
public class OdbcMessageParser implements ClientListenerMessageParser {
    /** Marshaller. */
    private final GridBinaryMarshaller marsh;

    /** Initial output stream capacity. */
    protected static final int INIT_CAP = 1024;

    /** Kernal context. */
    protected final GridKernalContext ctx;

    /** Logger. */
    private final IgniteLogger log;

    /** Protocol version */
    private final ClientListenerProtocolVersion ver;

    /**
     * @param ctx Context.
     * @param ver Protocol version.
     */
    public OdbcMessageParser(GridKernalContext ctx, ClientListenerProtocolVersion ver) {
        this.ctx = ctx;
        this.ver = ver;

        log = ctx.log(getClass());

        if (ctx.cacheObjects() instanceof CacheObjectBinaryProcessorImpl) {
            CacheObjectBinaryProcessorImpl cacheObjProc = (CacheObjectBinaryProcessorImpl)ctx.cacheObjects();

            marsh = cacheObjProc.marshaller();
        }
        else {
            throw new IgniteException("ODBC can only be used with BinaryMarshaller (please set it " +
                "through IgniteConfiguration.setMarshaller())");
        }
    }

    /** {@inheritDoc} */
    @Override public ClientListenerRequest decode(byte[] msg) {
        assert msg != null;

        BinaryInputStream stream = new BinaryHeapInputStream(msg);

        BinaryReaderExImpl reader = new BinaryReaderExImpl(marsh.context(), stream, ctx.config().getClassLoader(), true);

        byte cmd = reader.readByte();

        ClientListenerRequest res;

        switch (cmd) {
            case OdbcRequest.QRY_EXEC: {
                String schema = reader.readString();
                String sql = reader.readString();
                int paramNum = reader.readInt();

                Object[] params = readParameterRow(reader, paramNum);

                int timeout = 0;

                if (ver.compareTo(OdbcConnectionContext.VER_2_3_2) >= 0)
                    timeout = reader.readInt();

                boolean autoCommit = true;

                if (ver.compareTo(OdbcConnectionContext.VER_2_7_0) >= 0)
                    autoCommit = reader.readBoolean();

                res = new OdbcQueryExecuteRequest(schema, sql, params, timeout, autoCommit);

                break;
            }

            case OdbcRequest.QRY_EXEC_BATCH: {
                String schema = reader.readString();
                String sql = reader.readString();
                int paramRowLen = reader.readInt();
                int rowNum = reader.readInt();
                boolean last = reader.readBoolean();

                Object[][] params = new Object[rowNum][];

                for (int i = 0; i < rowNum; ++i)
                    params[i] = readParameterRow(reader, paramRowLen);

                int timeout = 0;

                if (ver.compareTo(OdbcConnectionContext.VER_2_3_2) >= 0)
                    timeout = reader.readInt();

                boolean autoCommit = true;

                if (ver.compareTo(OdbcConnectionContext.VER_2_7_0) >= 0)
                    autoCommit = reader.readBoolean();

                res = new OdbcQueryExecuteBatchRequest(schema, sql, last, params, timeout, autoCommit);

                break;
            }

            case OdbcRequest.QRY_FETCH: {
                long queryId = reader.readLong();
                int pageSize = reader.readInt();

                res = new OdbcQueryFetchRequest(queryId, pageSize);

                break;
            }

            case OdbcRequest.QRY_CLOSE: {
                long queryId = reader.readLong();

                res = new OdbcQueryCloseRequest(queryId);

                break;
            }

            case OdbcRequest.META_COLS: {
                String schema = reader.readString();
                String table = reader.readString();
                String column = reader.readString();

                res = new OdbcQueryGetColumnsMetaRequest(schema, table, column);

                break;
            }

            case OdbcRequest.META_TBLS: {
                String catalog = reader.readString();
                String schema = reader.readString();
                String table = reader.readString();
                String tableType = reader.readString();

                res = new OdbcQueryGetTablesMetaRequest(catalog, schema, table, tableType);

                break;
            }

            case OdbcRequest.META_PARAMS: {
                String schema = reader.readString();
                String sqlQuery = reader.readString();

                res = new OdbcQueryGetParamsMetaRequest(schema, sqlQuery);

                break;
            }

            case OdbcRequest.MORE_RESULTS: {
                long queryId = reader.readLong();
                int pageSize = reader.readInt();

                res = new OdbcQueryMoreResultsRequest(queryId, pageSize);

                break;
            }

            default:
                throw new IgniteException("Unknown ODBC command: [cmd=" + cmd + ']');
        }

        return res;
    }

    /**
     * Read row of parameters using reader.
     * @param reader reader
     * @param paramNum Number of parameters in a row
     * @return Parameters array.
     */
    @NotNull private static Object[] readParameterRow(BinaryReaderExImpl reader, int paramNum) {
        Object[] params = new Object[paramNum];

        for (int i = 0; i < paramNum; ++i)
            params[i] = SqlListenerUtils.readObject(reader, true);

        return params;
    }

    /** {@inheritDoc} */
    @Override public byte[] encode(ClientListenerResponse msg0) {
        assert msg0 != null;

        assert msg0 instanceof OdbcResponse;

        OdbcResponse msg = (OdbcResponse)msg0;

        // Creating new binary writer
        BinaryWriterExImpl writer = new BinaryWriterExImpl(marsh.context(), new BinaryHeapOutputStream(INIT_CAP),
            BinaryThreadLocalContext.get().schemaHolder(), null);

        // Writing status.
        if (ver.compareTo(OdbcConnectionContext.VER_2_1_5) < 0) {
            writer.writeByte((byte) (msg.status() == ClientListenerResponse.STATUS_SUCCESS ?
                ClientListenerResponse.STATUS_SUCCESS : ClientListenerResponse.STATUS_FAILED));
        } else
            writer.writeInt(msg.status());

        if (msg.status() != ClientListenerResponse.STATUS_SUCCESS) {
            writer.writeString(msg.error());

            return writer.array();
        }

        Object res0 = msg.response();

        if (res0 == null)
            return writer.array();
        else if (res0 instanceof OdbcQueryExecuteResult) {
            OdbcQueryExecuteResult res = (OdbcQueryExecuteResult) res0;

            if (log.isDebugEnabled())
                log.debug("Resulting query ID: " + res.queryId());

            writer.writeLong(res.queryId());

            Collection<OdbcColumnMeta> metas = res.columnsMetadata();

            assert metas != null;

            writer.writeInt(metas.size());

            for (OdbcColumnMeta meta : metas)
                meta.write(writer);

            writeAffectedRows(writer, res.affectedRows());
        }
        else if (res0 instanceof OdbcQueryExecuteBatchResult) {
            OdbcQueryExecuteBatchResult res = (OdbcQueryExecuteBatchResult) res0;

            writer.writeBoolean(res.errorMessage() == null);
            writeAffectedRows(writer, res.affectedRows());

            if (res.errorMessage() != null) {
                writer.writeLong(res.errorSetIdx());
                writer.writeString(res.errorMessage());

                if (ver.compareTo(OdbcConnectionContext.VER_2_1_5) >= 0)
                    writer.writeInt(res.errorCode());
            }
        }
        else if (res0 instanceof OdbcQueryFetchResult) {
            OdbcQueryFetchResult res = (OdbcQueryFetchResult) res0;

            if (log.isDebugEnabled())
                log.debug("Resulting query ID: " + res.queryId());

            writer.writeLong(res.queryId());

            Collection<?> items0 = res.items();

            assert items0 != null;

            writer.writeBoolean(res.last());

            writer.writeInt(items0.size());

            for (Object row0 : items0) {
                if (row0 != null) {
                    Collection<?> row = (Collection<?>)row0;

                    writer.writeInt(row.size());

                    for (Object obj : row)
                        SqlListenerUtils.writeObject(writer, obj, true);
                }
            }
        }
        else if (res0 instanceof OdbcQueryMoreResultsResult) {
            OdbcQueryMoreResultsResult res = (OdbcQueryMoreResultsResult) res0;

            if (log.isDebugEnabled())
                log.debug("Resulting query ID: " + res.queryId());

            writer.writeLong(res.queryId());

            Collection<?> items0 = res.items();

            assert items0 != null;

            writer.writeBoolean(res.last());

            writer.writeInt(items0.size());

            for (Object row0 : items0) {
                if (row0 != null) {
                    Collection<?> row = (Collection<?>)row0;

                    writer.writeInt(row.size());

                    for (Object obj : row)
                        SqlListenerUtils.writeObject(writer, obj, true);
                }
            }
        }
        else if (res0 instanceof OdbcQueryCloseResult) {
            OdbcQueryCloseResult res = (OdbcQueryCloseResult) res0;

            if (log.isDebugEnabled())
                log.debug("Resulting query ID: " + res.getQueryId());

            writer.writeLong(res.getQueryId());
        }
        else if (res0 instanceof OdbcQueryGetColumnsMetaResult) {
            OdbcQueryGetColumnsMetaResult res = (OdbcQueryGetColumnsMetaResult) res0;

            Collection<OdbcColumnMeta> columnsMeta = res.meta();

            assert columnsMeta != null;

            writer.writeInt(columnsMeta.size());

            for (OdbcColumnMeta columnMeta : columnsMeta)
                columnMeta.write(writer);
        }
        else if (res0 instanceof OdbcQueryGetTablesMetaResult) {
            OdbcQueryGetTablesMetaResult res = (OdbcQueryGetTablesMetaResult) res0;

            Collection<OdbcTableMeta> tablesMeta = res.meta();

            assert tablesMeta != null;

            writer.writeInt(tablesMeta.size());

            for (OdbcTableMeta tableMeta : tablesMeta)
                tableMeta.writeBinary(writer);
        }
        else if (res0 instanceof OdbcQueryGetParamsMetaResult) {
            OdbcQueryGetParamsMetaResult res = (OdbcQueryGetParamsMetaResult) res0;

            byte[] typeIds = res.typeIds();

            SqlListenerUtils.writeObject(writer, typeIds, true);
        }
        else
            assert false : "Should not reach here.";

        return writer.array();
    }

    /**
     * @param writer Writer to use.
     * @param affectedRows Affected rows.
     */
    private void writeAffectedRows(BinaryWriterExImpl writer, Collection<Long> affectedRows) {
        if (ver.compareTo(OdbcConnectionContext.VER_2_3_2) < 0) {
            long summ = 0;

            for (Long value : affectedRows)
                summ += value == null ? 0 : value;

            writer.writeLong(summ);
        }
        else {
            writer.writeInt(affectedRows.size());
            for (Long value : affectedRows)
                writer.writeLong(value);
        }
    }
}


text:
require('./modules/ngUpload');
require('./modules/ngTagsInput');
var _ = require('underscore');

var extractLink = function (object, relation) {
  return _.find(object, function (item) {
    return item.rel === relation;
  });
};

angular.module('Common', [])

  .constant('_', _)
  .constant('extractLink', extractLink)
  .constant('msdElasticConfig', { append: ''})
  .constant('entitySelfUri', function (param, relation) {
    if( ! angular.isUndefined(param)) {

      var mode = (typeof param === 'object') ? 'encode' : 'decode';
      if(_.isUndefined(relation)){
        relation = 'self';
      }
      switch(mode){
        case 'encode':
          var currentLink = extractLink(param, relation).href.split('?')[0];
          return currentLink.replace(/\//g, ",");
          break;

        case 'decode':
          return param.replace(/,/g, "\/");
          break;
      }

    }
  })
  .constant('uniqid', require('./constant/uniqid'))
  .constant('objecthash', require('./constant/objecthash'))
  .constant('FilterMap', require('./constant/FilterMap'))
  .constant('FilterHelp', require('./constant/FilterHelp'))

  .service('MessageService', require('./services/messages'))
  .service('ValidationService', require('./services/validation'))
  .service('CollectionService', require('./services/collection'))
  .service('DataService', require('./services/data'))

  .controller('HeaderController', require('./controllers/header'))
  .controller('DownloadsController', require('./controllers/downloads'))
  .controller('DetailsController', require('./controllers/details'))
  .controller('WorkflowController', require('./controllers/workflow'))

  .filter('array2string', require('./filters/array2string'))
  .filter('maybeEmpty', require('./filters/maybeEmpty'))
  .filter('roundedcurrency', require('./filters/roundedCurrency'))
  .filter('fileSize', require('./filters/fileSize'))
  .filter('formatDate', require('./filters/formatDate'))
  .filter('usagetime', require('./filters/usageTime'))
  .filter('usagehours', require('./filters/usageHours'))
  .filter('age', require('./filters/age'))
  .filter('getDateAsNumDaysDiff', require('./filters/dateNumDaysDiff'))
  .filter('characters', require('./filters/charLimit'))
  .filter('words', require('./filters/charWords'))
  .filter('percentage', require('./filters/percentage'))

  .directive('showSuggestionsOnFocus', require('./directives/showSuggestionsOnFocus'))
  .directive('autoFocus', require('./directives/autoFocus'))
  .directive('autoSelect', require('./directives/autoSelect'))
  .directive('goDetails', require('./directives/goDetails'))
  .directive('goClick', require('./directives/goClick'))
  .directive('ngTabs', require('./directives/ngTabs'))
  .directive('ngTabHead', require('./directives/ngTabHead'))
  .directive('ngTabBody', require('./directives/ngTabBody'))
  .directive('duration', require('./directives/validateDuration'))
  .directive('elastic', require('./directives/elastic'))
  .directive('infoGraphic', require('./directives/infoGraphic'))
  .directive('validateManufacturer', require('./directives/validateManufacturer'));


text:
@implementation ChartsGalleryDataLabelDataSource

- (SChartSeries *)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
  SChartBarSeries *series = [SChartBarSeries new];
  series.title = [self.seriesNames[index] capitalizedString];
  series.stackIndex = @1;
  series.baseline = @0;
  series.style.dataPointLabelStyle.showLabels = YES;
  series.style.dataPointLabelStyle.font = [UIFont boldShinobiFontOfSize:16];
  series.style.dataPointLabelStyle.textColor = [UIColor whiteColor];
  return series;
}

@end


text:
using System.Reflection;
using Android.App;
using Android.OS;
using Xamarin.Android.NUnitLite;

// TODO: Remove this file
namespace xaump.Android.Test
{
    [Activity(Label = "xaump.Android.Test", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : TestSuiteActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            // tests can be inside the main assembly
            AddTest(Assembly.GetExecutingAssembly());
            // or in any reference assemblies
            // AddTest (typeof (Your.Library.TestClass).Assembly);

            // Once you called base.OnCreate(), you cannot add more assemblies.
            base.OnCreate(bundle);
        }
    }
}


text:
#ifndef _ALLJOYN_XMLHELPER_H
#define _ALLJOYN_XMLHELPER_H
/**
 * @file
 *
 * This file defines a class for traversing introspection XML.
 *
 */

/******************************************************************************
 * Copyright AllSeen Alliance. All rights reserved.
 *
 *    Permission to use, copy, modify, and/or distribute this software for any
 *    purpose with or without fee is hereby granted, provided that the above
 *    copyright notice and this permission notice appear in all copies.
 *
 *    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 *    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 *    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 *    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 *    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 *    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 *    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 ******************************************************************************/

#ifndef __cplusplus
#error Only include BusUtil.h in C++ code.
#endif

#include <qcc/platform.h>
#include <qcc/String.h>
#include <qcc/XmlElement.h>

#include <alljoyn/BusAttachment.h>
#include <alljoyn/ProxyBusObject.h>
#include <alljoyn/InterfaceDescription.h>

#include <alljoyn/Status.h>

namespace ajn {

/**
 * XmlHelper is a utility class for traversing introspection XML.
 */
class XmlHelper {
  public:

    XmlHelper(BusAttachment* bus, const char* ident) : bus(bus), ident(ident) { }

    /**
     * Traverse the XML tree adding all interfaces to the bus. Nodes are ignored.
     *
     * @param root  The root can be an <interface> or <node> element.
     *
     * @return #ER_OK if the XML was well formed and the interfaces were added.
     *         #ER_BUS_BAD_XML if the XML was not as expected.
     *         #Other errors indicating the interfaces were not succesfully added.
     */
    QStatus AddInterfaceDefinitions(const qcc::XmlElement* root) {
        if (root) {
            if (root->GetName() == "interface") {
                return ParseInterface(root, NULL);
            } else if (root->GetName() == "node") {
                return ParseNode(root, NULL);
            }
        }
        return ER_BUS_BAD_XML;
    }

    /**
     * Traverse the XML tree recursively adding all nodes as children of a parent proxy object.
     *
     * @param parent  The parent proxy object to add the children too.
     * @param root    The root must be a <node> element.
     *
     * @return #ER_OK if the XML was well formed and the children were added.
     *         #ER_BUS_BAD_XML if the XML was not as expected.
     *         #Other errors indicating the children were not succesfully added.
     */
    QStatus AddProxyObjects(ProxyBusObject& parent, const qcc::XmlElement* root) {
        if (root && (root->GetName() == "node")) {
            return ParseNode(root, &parent);
        } else {
            return ER_BUS_BAD_XML;
        }
    }

  private:

    QStatus ParseNode(const qcc::XmlElement* elem, ProxyBusObject* obj);
    QStatus ParseInterface(const qcc::XmlElement* elem, ProxyBusObject* obj);

    BusAttachment* bus;
    const char* ident;
};
}

#endif


text:
Återställ lösenord

Skicka användarnamn

Fyll i din emailadress och lös captchan.

        <form name="usernameRecoveryCaptchaForm" ng-submit="vm.usernameRecoveryCaptcha()" role="form">

            Email
            <input type="text" name="email" id="email" class="form-control" ng-model="vm.form.username.email" required />
            Email är obligatoriskt

            Captcha
            <input type="text" name="usernameCaptcha" id="usernameCaptcha" class="form-control" ng-model="vm.form.captcha.captcha" required />
            Captcha är obligatoriskt

            <button type="submit" ng-disabled="usernameRecoveryCaptchaForm.$invalid || vm.dataLoadingUsername" class="btn btn-primary">Verifiera</button>

        </form>

Steg 1 av 3. Fyll i användarnamn och lös captchan.

        <form name="passwordRecoveryCaptchaForm" ng-submit="vm.passwordRecoveryCaptcha()" role="form">

            Användarnamn
            <input type="text" name="username" id="username" class="form-control" ng-model="vm.form.username" required />
            Användarnamn är obligatoriskt

            Återställningstyp

                <input type="radio" name="recoveryType" ng-model="vm.form.captcha.recoveryType" value="notification" required> Via e-post

                <input type="radio" name="recoveryType" ng-model="vm.form.captcha.recoveryType" value="secretQuestion" required> Via fråga

            Captcha
            <input type="text" name="captcha" id="captcha" class="form-control" ng-model="vm.form.captcha.captcha" required />
            Captcha är obligatoriskt

            <button type="submit" ng-disabled="passwordRecoveryCaptchaForm.$invalid || vm.dataLoadingCaptcha" class="btn btn-primary">Verifiera</button>

        </form>

Steg 2 av 3. Fyll i koden ifrån utskickat mail och lös captchan.

        <form name="passwordRecoveryNotificationForm" ng-submit="vm.passwordRecoveryNotification()" role="form">

            Användarnamn
            <input type="text" name="notificationUsername" id="notificationUsername" class="form-control" ng-model="vm.form.username" disabled />

            Kod
            <input type="text" name="code" id="code" class="form-control" ng-model="vm.form.notification.code" required />
            Kod är obligatoriskt

            Captcha
            <input type="text" name="notificationCaptcha" id="notificationCaptcha" class="form-control" ng-model="vm.form.captcha.captcha" required />
            Captcha är obligatoriskt

            <button type="submit" ng-disabled="passwordRecoveryNotificationForm.$invalid || vm.dataLoadingActivation" class="btn btn-primary">Verifiera</button>

        </form>

Steg 2 av 3. Svara på frågan.

        <form name="passwordRecoverySecretQuestionForm" ng-submit="vm.passwordRecoverySecretQuestion()" role="form">

            Användarnamn
            <input type="text" name="passwordRecoverySecretQuestionUsername" id="passwordRecoverySecretQuestionUsername" class="form-control" ng-model="vm.form.username" disabled />

            Fråga
            <input type="text" name="passwordRecoverySecretQuestionQuestion" id="passwordRecoverySecretQuestionQuestion" class="form-control" ng-model="vm.form.question.challengeQuestion" disabled />

            Svar
            <input type="text" name="answer" id="answer" class="form-control" ng-model="vm.form.question.answer" required />
            Svar är obligatoriskt

            <button type="submit" ng-disabled="passwordRecoverySecretQuestionForm.$invalid || vm.dataLoadingActivation" class="btn btn-primary">Skicka</button>

        </form>

Steg 3 av 3. Uppdatera lösenord.

        <form name="passwordForm" ng-submit="vm.passwordRecovery()" role="form">

            Nytt lösenord
            <input type="password" name="password" id="password" class="form-control" ng-model="vm.form.password.password" ng-minlength="6" ng-maxlength="12" ng-pattern="/^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&*])(?!.*[{}])).{6,12}$/" required />
            Lösenord är obligatoriskt
            Lösenordet måste vara minst 6 tecken långt
            Lösenordet får vara max 12 tecken långt
            Lösenordet måste innehålla en siffra[0-9], en liten bokstav [a-z], en stor bokstav [A-Z] och en av karaktärerna !@#$%&
            Lösenordet får ej innehålla karaktärerna {}

            Upprepa lösenord
            <input type="password" name="passwordRepeat" id="passwordRepeat" class="form-control" ng-model="vm.form.password.passwordRepeat" ui-validate=" '$value==vm.form.password.password' " ui-validate-watch=" 'vm.form.password.password' " required />
            Måste upprepa lösenordet
            Lösenorden stämmer inte överrens

            <button type="submit" ng-disabled="passwordForm.$invalid || vm.dataLoading" class="btn btn-primary">Uppdatera</button>
            Ångra

        </form>


text:
module NetSuite
  module Records
    class CustomerPayment
      include Support::Fields
      include Support::RecordRefs
      include Support::Records
      include Support::Actions
      include Namespaces::TranCust

      actions :get, :initialize, :add, :delete, :upsert

      fields :auth_code, :auto_apply, :cc_approved, :cc_avs_street_match, :cc_avs_zip_match,
        :cc_expire_date, :cc_name, :cc_number, :cc_security_code, :cc_security_code_match, :cc_street, :cc_zip_code,
        :charge_it, :check_num, :created_date, :currency_name, :debit_card_issue_no, :exchange_rate, :ignore_avs,
        :last_modified_date, :memo, :payment, :pn_ref_num, :status, :three_d_status_code, :tran_date,
        :undep_funds, :valid_from

      field :custom_field_list, CustomFieldList
      field :apply_list,        CustomerPaymentApplyList

      read_only_fields :applied, :balance, :pending, :total, :unapplied

      record_refs :account, :ar_acct, :credit_card, :credit_card_processor, :custom_form, :customer, :department, :klass,
        :location, :payment_method, :posting_period, :subsidiary

      attr_reader   :internal_id
      attr_accessor :external_id

      def initialize(attributes = {})
        @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
        @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
        initialize_from_attributes_hash(attributes)
      end

      def to_record
        rec = super
        if rec["#{record_namespace}:customFieldList"]
          rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
        end
        rec
      end

    end
  end
end


text:
import angular from 'angular';

let loader = () => {
    return {
        restrict: 'E',
        scope: {
            show: '='
        },
        template: `

Please Wait...

            `
    }
}

export default angular.module('directives.loader', [])
  .directive('loader', loader)
  .name;


text:
/**
 * Model of ESDoc Configuration (.esdoc.json) file.
 */
export class EsDocConfiguration {
    public source: string;
    public destination: string;
    public includes: string[];
    public excludes: string[];
    public plugins: { name: string; option?: { [id: string]: any} }[];
}