text:
"""

@author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/

"""

#This is a massive two asset portfolio tester with a brute force optimizer
#Takes all pair combos, tests, and sorts.

#Import modules
import numpy as np
import random as rand
import pandas as pd
import time as t
#from DatabaseGrabber import DatabaseGrabber
from YahooGrabber import YahooGrabber
from ListPairs import ListPairs

#Empty data structures
Empty = []
Counter = 0
Counter2 = 0
Dataset2 = pd.DataFrame()

#Iterable
iterations = range(0, 10000)

#Start timer
Start = t.time()

#Assign tickers
tickers = ('TLT', 'SPY', 'TMF', 'AAPL', 'PBF', 'UVXY', '^VIX', 'GLD', 'SLV',
           'JO','CORN', 'DBC', 'SOYB')

#Make all pairs in final list
MajorList = ListPairs(tickers)

#For all pairs in Brute Force Optimization
for m in MajorList:
    #Read in tickers
    Ticker1 = m[0]
    Ticker2 = m[1]
    #Create combined ticker name
    TAG = m[0] + '/' + m[1]
    #Empty dataframes
    Dataset = pd.DataFrame()
    Dataset2 = pd.DataFrame()
    Portfolio = pd.DataFrame()
    #Request data
    Asset1 = YahooGrabber(Ticker1)
    Asset2 = YahooGrabber(Ticker2)
    #Calculate log returns
    Asset1['LogRet'] = np.log(Asset1['Adj Close']/Asset1['Adj Close'].shift(1))
    Asset1['LogRet'] = Asset1['LogRet'].fillna(0)
    Asset2['LogRet'] = np.log(Asset2['Adj Close']/Asset2['Adj Close'].shift(1))
    Asset2['LogRet'] = Asset2['LogRet'].fillna(0)
    #Time series trimmer
    trim = abs(len(Asset1) - len(Asset2))
    if len(Asset1) == len(Asset2):
        pass
    else:
        if len(Asset1) > len(Asset2):
            Asset1 = Asset1[trim:]
        else:
            Asset2 = Asset2[trim:]
    #For number of iterations
    for i in iterations:
        #Iteration tracking
        Counter = Counter + 1
        #Generate random params
        aa = rand.random() * 2 #uniformly distributed random number 0 to 2
        a = aa - 1          #a > 1 indicating long position in a
        bb = rand.random()
        if bb >= .5:
            bb = 1
        else:
            bb = -1
        b = bb * (1 - abs(a))

        #Can change c and d to 0 by default if you want to just go flat
        #Generate random params
        cc = rand.random() * 2 #uniformly distributed random number 0 to 2
        c = cc - 1          #cc > 1 indicating long position in c
        dd = rand.random() * 2
        if dd >= 1:
            edd = 1
        else:
            edd = -1
        d = (dd - 1)
        #Constraint
        if abs(c) + abs(d) > 1:
            continue
        #Generate random params
        e = rand.randint(3,20)
        window = int(e)
        #Price relative
        Asset1['PriceRelative'] = Asset1['Adj Close']/Asset2['Adj Close']
        #Price relative moving average
        Asset1['PRMA'] = Asset1['PriceRelative'].rolling(window=window, center=False).mean()
        #Position sizing
        Asset1['Position'] = a
        #Alternative position sizing
        Asset1['Position'] = np.where(Asset1['PriceRelative'].shift(1) > Asset1['PRMA'].shift(1),
                                        c,a)
        #Apply position to returns
        Asset1['Pass'] = (Asset1['LogRet'] * Asset1['Position'])
        #Position sizing
        Asset2['Position'] = b
        #Alternative position sizing
        Asset2['Position'] = np.where(Asset1['PriceRelative'].shift(1) > Asset1['PRMA'].shift(1),
                                        d,b)
        #Apply position to returns
        Asset2['Pass'] = (Asset2['LogRet'] * Asset2['Position'])
        #Pass individual return streams to portfolio
        Portfolio['Asset1Pass'] = (Asset1['Pass']) #* (-1) #Pass a short position
        Portfolio['Asset2Pass'] = (Asset2['Pass']) #* (-1) #Pass a short position
        #Cumulative portfolio returns
        Portfolio['LongShort'] = Portfolio['Asset1Pass'] + Portfolio['Asset2Pass']
        #Constraint
        if Portfolio['LongShort'].std() == 0:
            continue
        #Returns on $1
        Portfolio['Multiplier'] = Portfolio['LongShort'].cumsum().apply(np.exp)
        #Incorrectly calculated max drawdown
        drawdown =  1 - Portfolio['Multiplier'].div(Portfolio['Multiplier'].cummax())
        MaxDD = max(drawdown)
        #Constraint
        if MaxDD > float(.51):
            continue
        #Performance metric
        dailyreturn = Portfolio['LongShort'].mean()
        if dailyreturn < .0003:
            continue
        #Performance metrics
        dailyvol = Portfolio['LongShort'].std()
        sharpe =(dailyreturn/dailyvol)

        #Iteration tracking
        print(Counter)

        #Save params and metrics to list
        Empty.append(a)
        Empty.append(b)
        Empty.append(c)
        Empty.append(d)
        Empty.append(e)
        Empty.append(sharpe)
        Empty.append(sharpe/MaxDD)
        Empty.append(dailyreturn/MaxDD)
        Empty.append(MaxDD)
        #List to series
        Emptyseries = pd.Series(Empty)
        #Series to dataframe
        Dataset[i] = Emptyseries.values
        #Clear list
        Empty[:] = []
    #Metric of choice
    z1 = Dataset.iloc[6]
    #Threshold
    w1 = np.percentile(z1, 80)
    v1 = [] #this variable stores the Nth percentile of top params
    DS1W = pd.DataFrame() #this variable stores your params for specific dataset
    #For all metrics
    for h in z1:
        #If metric is greater than threshold
        if h > w1:
          #Add to list
          v1.append(h)
    #For top metrics
    for j in v1:
          #Get column ID of metric
          r = Dataset.columns[(Dataset == j).iloc[6]]
          #Add to dataframe
          DS1W = pd.concat([DS1W,Dataset[r]], axis = 1)
    #Top metric
    y = max(z1)
    #Column ID of top metric
    k = Dataset.columns[(Dataset == y).iloc[6]]
    #Column ID of top metric - float
    kfloat = float(k[0])
    #End timer
    End = t.time()
    #Timer stats
    print(End-Start, 'seconds later')
    #Assign params
    Dataset[TAG] = Dataset[kfloat]
    Dataset2[TAG] = Dataset[TAG]
    #Rename dataframe columns
    Dataset2 = Dataset2.rename(columns = {Counter2:TAG})
    #Iteration tracking
    Counter2 = Counter2 + 1
    #print(Dataset[TAG])

#Create dataframe
Portfolio2 = pd.DataFrame()
#Metric of choice
z1 = Dataset2.iloc[6]
#Threshold
w1 = np.percentile(z1, 99)
v1 = [] #this variable stores the Nth percentile of top params
winners = pd.DataFrame() #this variable stores your params for specific dataset
#For all metrics
for h in z1:
    #If greater than thresold
    if h > w1:
      #Add to list
      v1.append(h)
#For top metrics
for j in v1:
      #Get column ID of metric
      r = Dataset2.columns[(Dataset2 == j).iloc[6]]
      #Add to dataframe
      winners = pd.concat([winners,Dataset2[r]], axis = 1)
#Top metric
y = max(z1)
#Pair name
k = Dataset2.columns[(Dataset2 == y).iloc[6]]
#Pair name - string
kfloat = str(k[0])

#Separate tickers in TAG
num = kfloat.find('/')
num2 = num + 1

#Request data
Asset3 = YahooGrabber(kfloat[:num])
Asset4 = YahooGrabber(kfloat[num2:])

#Time series trimmer
trim = abs(len(Asset3) - len(Asset4))
if len(Asset3) == len(Asset4):
    pass
else:
    if len(Asset3) > len(Asset4):
        Asset3 = Asset3[trim:]
    else:
        Asset4 = Asset4[trim:]

#Calculate log returns
Asset3['LogRet'] = np.log(Asset3['Adj Close']/Asset3['Adj Close'].shift(1))
Asset3['LogRet'] = Asset3['LogRet'].fillna(0)
Asset4['LogRet'] = np.log(Asset4['Adj Close']/Asset4['Adj Close'].shift(1))
Asset4['LogRet'] = Asset4['LogRet'].fillna(0)

#Read in params
window = int((Dataset2[kfloat][4]))

#Price relative
Asset3['PriceRelative'] = Asset3['Adj Close']/Asset4['Adj Close']
#Price relative moving average
Asset3['PRMA'] = Asset3['PriceRelative'].rolling(window=window, center=False).mean()

#Position sizing
Asset3['Position'] = (Dataset2[k[0]][0])
#Alternative position sizing
Asset3['Position'] = np.where(Asset3['PriceRelative'].shift(1) > Asset3['PRMA'].shift(1),
                                    Dataset2[k[0]][2],Dataset2[k[0]][0])
#Apply position to returns
Asset3['Pass'] = (Asset3['LogRet'] * Asset3['Position'])
#Position sizing
Asset4['Position'] = (Dataset2[kfloat][1])
#Alternative position sizing
Asset4['Position'] = np.where(Asset3['PriceRelative'].shift(1) > Asset3['PRMA'].shift(1),
                                    Dataset2[k[0]][3],Dataset2[k[0]][1])
#Apply position to returns
Asset4['Pass'] = (Asset4['LogRet'] * Asset4['Position'])

#Pass individual return streams to portfolio
Portfolio2['Asset3Pass'] = Asset3['Pass'] #* (-1)
Portfolio2['Asset4Pass'] = Asset4['Pass'] #* (-1)
#Price relative
Portfolio2['PriceRelative'] = Asset3['Adj Close'] / Asset3['Adj Close']
#Cumulative portfolio returns
Portfolio2['LongShort'] = Portfolio2['Asset3Pass'] + Portfolio2['Asset4Pass']

#Graphical display
Portfolio2['LongShort'][:].cumsum().apply(np.exp).plot(grid=True,
                                     figsize=(8,5))

#Performance metrics
dailyreturn = Portfolio2['LongShort'].mean()
dailyvol = Portfolio2['LongShort'].std()
sharpe =(dailyreturn/dailyvol)
Portfolio2['Multiplier'] = Portfolio2['LongShort'].cumsum().apply(np.exp)
#Incorrectly calculated max drawdown
drawdown2 =  1 - Portfolio2['Multiplier'].div(Portfolio2['Multiplier'].cummax())

#Display top param set + results
print(kfloat)
print('--------')
print(Dataset2[kfloat])
print('Max Drawdown is ',max(drawdown2),'See Dataset2')

#Save to pickle
#pd.to_pickle(Portfolio, 'FileName')


text:
module Azure::Batch::Mgmt::V2018_12_01
  module Models
    #
    # Properties used to create a user account on a Linux node.
    #
    #
    class LinuxUserConfiguration

      include MsRestAzure

      # @return [Integer] The user ID of the user account. The uid and gid
      # properties must be specified together or not at all. If not specified
      # the underlying operating system picks the uid.
      attr_accessor :uid

      # @return [Integer] The group ID for the user account. The uid and gid
      # properties must be specified together or not at all. If not specified
      # the underlying operating system picks the gid.
      attr_accessor :gid

      # @return [String] The SSH private key for the user account. The private
      # key must not be password protected. The private key is used to
      # automatically configure asymmetric-key based authentication for SSH
      # between nodes in a Linux pool when the pool's
      # enableInterNodeCommunication property is true (it is ignored if
      # enableInterNodeCommunication is false). It does this by placing the key
      # pair into the user's .ssh directory. If not specified, password-less
      # SSH is not configured between nodes (no modification of the user's .ssh
      # directory is done).
      attr_accessor :ssh_private_key

      #
      # Mapper for LinuxUserConfiguration class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'LinuxUserConfiguration',
          type: {
            name: 'Composite',
            class_name: 'LinuxUserConfiguration',
            model_properties: {
              uid: {
                client_side_validation: true,
                required: false,
                serialized_name: 'uid',
                type: {
                  name: 'Number'
                }
              },
              gid: {
                client_side_validation: true,
                required: false,
                serialized_name: 'gid',
                type: {
                  name: 'Number'
                }
              },
              ssh_private_key: {
                client_side_validation: true,
                required: false,
                serialized_name: 'sshPrivateKey',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
type Peg = String
type Move = (Peg, Peg)

hanoi :: Integer -> Peg -> Peg -> Peg -> [Move]
hanoi = undefined


text:
<?php

namespace RossKuyper\DB;

/**
 * A single query and its properties
 */
class Query {
	/**
	 * The SQL string
	 * @var string
	 */
	protected $sql;

	/**
	 * Params to bind to the statement
	 * @var array
	 */
	protected $params = [];

	/**
	 * Pre-process the params and sql
	 */
	public function __construct($sql, $params) {
		// Process the params
		foreach ($params as $value) {
			if (is_array($value)) {
				/**
				 * We assume that an array indicates the use of IN (IN)
				 * Loop through the array binding each value, and replace (IN)
				 * with the correct number of ? placeholders.
				 *
				 * If we don't find (IN), throw an error.
				 */
				$count = count($value);
				$limit = 1;

				// Check for (IN)
				if (stripos($sql, '(IN)') === false) {
					// echo $sql;
					throw new \RuntimeException("Invalid use of an array parameter");
				}

				// Replace the next instance of (IN) with the correct placeholders
				$sql = str_ireplace('(IN)', '(' . implode(',', array_fill(0, $count, '?')) . ')', $sql, $limit);

				// Add the sub-values
				foreach ($value as $subValue) {
					$this->params[] = new Param($subValue);
				}
			} else {
				$this->params[] = new Param($value);
			}
		}

		$this->sql = $sql;
	}

	/**
	 * Return the params
	 * @return array
	 */
	public function params() {
		return $this->params;
	}

	/**
	 * Get the SQL
	 * @return string
	 */
	public function sql() {
		return $this->sql;
	}
}


text:
namespace NArms.Config.Tests
{
    using System;
    using NUnit.Framework;

    [TestFixture]
    public class TimeSpanPropertyReadingTests
    {
        private Config _config;

        private class Config : ConfigBase
        {
            public TimeSpan HrMinSecTimeSpan { get; set; }
            public TimeSpan DsHrMinSecTimeSpan { get; set; }
            public TimeSpan HrTimeSpan { get; set; }
            public TimeSpan MinTimeSpan { get; set; }
            public TimeSpan SecTimeSpan { get; set; }
            public TimeSpan MsecTimeSpan { get; set; }
            public TimeSpan BigHrTimeSpan { get; set; }
            public TimeSpan BigMinTimeSpan { get; set; }
            public TimeSpan BigSecTimeSpan { get; set; }
            public TimeSpan BigMsecTimeSpan { get; set; }
            public TimeSpan DaysTimeSpan { get; set; }
            public TimeSpan? NullableTimeSpan { get; set; }
        }

        [SetUp]
        public void SetUp()
        {
            _config = new Config();
        }

        [Test]
        public void ShouldBeAbleToReadHrMinSecTimeSpanValues()
        {
            var timeSpan = new TimeSpan(10, 20, 30);

            Assert.AreEqual(timeSpan, _config.HrMinSecTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadDsHrMinSecTimeSpanValues()
        {
            var timeSpan = new TimeSpan(5, 10, 20, 30);

            Assert.AreEqual(timeSpan, _config.DsHrMinSecTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadHrTimeSpanValues()
        {
            var timeSpan = new TimeSpan(10, 0, 0);

            Assert.AreEqual(timeSpan, _config.HrTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadMinTimeSpanValues()
        {
            var timeSpan = new TimeSpan(0, 20, 0);

            Assert.AreEqual(timeSpan, _config.MinTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadSecTimeSpanValues()
        {
            var timeSpan = new TimeSpan(0, 0, 30);

            Assert.AreEqual(timeSpan, _config.SecTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadMsecTimeSpanValues()
        {
            var timeSpan = new TimeSpan(0, 0, 0, 0, 580);

            Assert.AreEqual(timeSpan, _config.MsecTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadBigHrTimeSpanValues()
        {
            var timeSpan = new TimeSpan(1, 1, 0, 0);

            Assert.AreEqual(timeSpan, _config.BigHrTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadBigMinTimeSpanValues()
        {
            var timeSpan = new TimeSpan(2, 20, 0);

            Assert.AreEqual(timeSpan, _config.BigMinTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadBigSecTimeSpanValues()
        {
            var timeSpan = new TimeSpan(0, 10, 25);

            Assert.AreEqual(timeSpan, _config.BigSecTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadBigMsecTimeSpanValues()
        {
            var timeSpan = new TimeSpan(0, 0, 0, 3, 180);

            Assert.AreEqual(timeSpan, _config.BigMsecTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadDaysTimeSpanValues()
        {
            var timeSpan = new TimeSpan(3, 0, 0, 0);

            Assert.AreEqual(timeSpan, _config.DaysTimeSpan);
        }

        [Test]
        public void ShouldBeAbleToReadNullableTimeSpan()
        {
            Assert.IsNull(_config.NullableTimeSpan);
        }
    }
}


text:
namespace transducers {
    class atomic_escape_hatch : public details::escape_hatch<std::atomic_bool> {};
};


text:
static float const kG8MinimalSimilarity = 0.99;

@implementation NSData (G8Equal)

- (float)g8_similarityWithData:(NSData *)data {

  NSUInteger numDifferences = 0;
  NSUInteger totalCompares = self.length;

  char *selfBytes = (char*)self.bytes;
  char *otherBytes = (char*)data.bytes;
  for (unsigned int i = 0; i < totalCompares; i++) {
    if (selfBytes[i] != otherBytes[i]) {
      numDifferences++;
    }
  }

  return 1.0 - (float)numDifferences / totalCompares;
}

- (BOOL)g8_isEqualToData:(NSData *)data {

  if (self == data) {
    return YES;
  }

  float similarity = [self g8_similarityWithData:data];
  return similarity > kG8MinimalSimilarity;
}

@end


text:
// MongoOptions.java

package com.mongodb;

import java.net.*;

/**
 * Various settings for the driver
 */
public class MongoOptions {

    public MongoOptions(){
        reset();
    }

    public void reset(){
        connectionsPerHost = Bytes.CONNECTIONS_PER_HOST;
        threadsAllowedToBlockForConnectionMultiplier = 5;
        maxWaitTime = 1000 * 60 * 2;
        connectTimeout = 0;
        socketTimeout = 0;
        autoConnectRetry = false;
    }

    /**

The number of connections allowed per host (the pool size, per host)

Once the pool is exhausted, this will block. See {@linkplain MongoOptions.threadsAllowedToBlockForConnectionMultiplier}

     */
    public int connectionsPerHost;

    /**
       multiplier for connectionsPerHost for # of threads that can block
       if connectionsPerHost is 10, and threadsAllowedToBlockForConnectionMultiplier is 5,
       then 50 threads can block
       more than that and an exception will be throw
     */
    public int threadsAllowedToBlockForConnectionMultiplier;

    /**
     * The max wait time for a blocking thread for a connection from the pool
     */
    public int maxWaitTime;

    /**
       The connection timeout in milliseconds; this is for establishing the socket connections (open). 0 is default and infinite
     */
    public int connectTimeout;

    /**
      The socket timeout; this value is passed to {@link Socket.setSoTimeout}.  0 is default and infinite
     */
    public int socketTimeout;

    /**
       This controls whether the system retries automatically on connection errors.  defaults to false
    */
    public boolean autoConnectRetry;

    public String toString(){
        StringBuilder buf = new StringBuilder();
        buf.append( "connectionsPerHost: " ).append( connectionsPerHost ).append( " " );
        buf.append( "threadsAllowedToBlockForConnectionMultiplier: " ).append( threadsAllowedToBlockForConnectionMultiplier ).append( " " );
        buf.append( "maxWaitTime: " ).append( maxWaitTime ).append( " " );
        buf.append( "connectTimeout: " ).append( connectTimeout ).append( " " );
        buf.append( "socketTimeout: " ).append( socketTimeout ).append( " " );
        buf.append( "autoConnectRetry: " ).append( autoConnectRetry ).append( " " );
        return buf.toString();
    }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Xerces-C++: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Xerces-C++
    3.1.2

Main Page

Related Pages

Classes

Files

Class List

Class Index

Class Hierarchy

Class Members

DOMImplementationLS Member List

This is the complete list of members for DOMImplementationLS, including all inherited members.

createLSInput(MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)=0	DOMImplementationLS	pure virtual

createLSOutput(MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)=0	DOMImplementationLS	pure virtual

createLSParser(const DOMImplementationLSMode mode, const XMLCh *const schemaType, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager, XMLGrammarPool *const gramPool=0)=0	DOMImplementationLS	pure virtual

createLSSerializer(MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)=0	DOMImplementationLS	pure virtual

DOMImplementationLS()	DOMImplementationLS	protected

DOMImplementationLSMode enum name	DOMImplementationLS

MODE_ASYNCHRONOUS enum value	DOMImplementationLS

MODE_SYNCHRONOUS enum value	DOMImplementationLS

~DOMImplementationLS()	DOMImplementationLS	virtual

<address class="footer">
Generated on Wed Mar 18 2015 10:43:38 for Xerces-C++ by

 1.8.9.1
</address>


text:
function createMethodURL(_method, _data, stringify) {
    var url = "";
    url = "production" == Ti.App.deployType ? "http://" + PROD_URL + "/peppa/api/" + API_VERSION + "/" + _method : "http://" + DEMO_URL + "/peppa/api/" + API_VERSION + "/" + _method;
    var params = false;
    if (_data) {
        for (var key in _data) if (_data.hasOwnProperty(key)) {
            params ? params += "&" : params = "?";
            params += key + "=" + encodeURI(stringify ? JSON.stringify(_data[key]) : _data[key]);
        }
        url += params;
    }
    return url;
}

function generateRESTRequest(method, url, payload, callback) {
    var request = Ti.Network.createHTTPClient({
        autoRedirect: true,
        cache: false,
        enableKeepAlive: true,
        timeout: 5e3,
        onload: function() {
            var data = JSON.parse(this.responseText);
            callback && callback(true, data, false);
        },
        onerror: function(e) {
            callback && callback(false, this.responseText, e);
        }
    });
    request.open(method, url);
    request.setRequestHeader("X-PEPPA-API-KEY", API_KEY);
    SESSION_ID && request.setRequestHeader("X-PEPPA-SESSIONID", SESSION_ID);
    if (payload) {
        request.setRequestHeader("Content-Type", "application/json");
        request.send(JSON.stringify(payload));
    } else request.send();
}

function userSync(method, model, options) {
    var payload = model.toJSON();
    var error;
    switch (method) {
      case "read":
        var url = createMethodURL("user", payload);
        generateRESTRequest("GET", url, null, function(success, res, error) {
            if (success) {
                SESSION_ID = res.user[model.idAttribute];
                options.success(res.user, JSON.stringify(res.user), options);
            } else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
        break;

      case "create":
        var url = createMethodURL("user");
        generateRESTRequest("POST", url, payload, function(success, res, error) {
            if (success) options.success(res.user, JSON.stringify(res.user), options); else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
        break;

      case "update":
        var url = createMethodURL("user");
        generateRESTRequest("PUT", url, payload, function(success, res, error) {
            if (success) options.success(res.user, JSON.stringify(res.user), options); else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
        break;

      case "delete":
        var url = createMethodURL("user/logout");
        generateRESTRequest("GET", url, null, function(success, res, error) {
            if (success) options.success(res, JSON.stringify(res), options); else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
        break;

      default:
        error = "User function not implemented";
    }
    if (error) {
        options.error(model, error, options);
        Ti.API.error(error);
        model.trigger("error");
    }
}

function objectSync(method, model, options, name) {
    var payload = model.toJSON();
    var error;
    if (SESSION_ID) switch (method) {
      case "read":
        if (payload[model.idAttribute]) {
            var url = createMethodURL("object/" + name + "/" + payload[model.idAttribute]);
            generateRESTRequest("GET", url, null, function(success, res, error) {
                if (success) options.success(res.data, JSON.stringify(res.data), options); else {
                    var err = res ? res.error : error;
                    Ti.API.error(err);
                    options.error(model, error, options);
                    model.trigger("error");
                }
            });
        } else {
            var url = createMethodURL("object/" + name);
            generateRESTRequest("GET", url, null, function(success, res, error) {
                if (success) options.success(res.data, JSON.stringify(res.data), options); else {
                    var err = res ? res.error : error;
                    Ti.API.error(err);
                    options.error(model, error, options);
                    model.trigger("error");
                }
            });
        }
        break;

      case "create":
        var url = createMethodURL("object/" + name);
        generateRESTRequest("POST", url, payload, function(success, res, error) {
            if (success) options.success(res.data, JSON.stringify(res.data), options); else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
        break;

      case "update":
        var url = createMethodURL("object/" + name + "/" + payload[model.idAttribute]);
        generateRESTRequest("PUT", url, payload, function(success, res, error) {
            if (success) options.success(res.data, JSON.stringify(res.data), options); else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
        break;

      case "delete":
        var url = createMethodURL("object/" + name + "/" + payload[model.idAttribute]);
        generateRESTRequest("DELETE", url, null, function(success, res, error) {
            if (success) options.success(res.data, JSON.stringify(res.data), options); else {
                var err = res ? res.error : error;
                Ti.API.error(err);
                options.error(model, error, options);
                model.trigger("error");
            }
        });
    } else error = "No session id log user in first!";
    if (error) {
        options.error(model, error, options);
        Ti.API.error(error);
        model.trigger("error");
    }
}

var SESSION_ID = false;

var API_KEY = "{PUT YOUR APIKEY HERE}";

var API_VERSION = "2";

var PROD_URL = "this is where you can set the default endpoint";

var DEMO_URL = "this is where you can set the default endpoint";

module.exports.sync = function(method, model, options) {
    switch (model.config.adapter.collection_name) {
      case "user":
        userSync(method, model, options);
        break;

      default:
        objectSync(method, model, options, model.config.adapter.collection_name);
    }
};

module.exports.beforeModelCreate = function(config) {
    config = config || {};
    config.adapter.api_key && (API_KEY = config.adapter.api_key);
    config.adapter.api_version && (API_VERSION = config.adapter.api_version);
    config.adapter.prod_url && (PROD_URL = config.adapter.prod_url);
    config.adapter.demo_url && (DEMO_URL = config.adapter.demo_url);
    return config;
};

module.exports.afterModelCreate = function() {};


text:
(function () {

  'use strict';

  MyOD.module('HomeModule', function (HomeModule, App, Backbone, Marionette, $, _) {

    //Router for the module
    HomeModule.Router = Backbone.Marionette.AppRouter.extend({
      appRoutes:{
        '': 'show'
      }
    });

    //Add the router during the initialization
    HomeModule.addInitializer(function (options) {
      var router = new HomeModule.Router({ controller: HomeModule.API });
    });

    //Simple API object that provides the implementation for the routes
    HomeModule.API = {

      show: function(options){

        if(!this.homeController){
          this.homeController = new HomeModule.Controller(options);
        }

        this.homeController.initUi(options);
      }
    };

  });
})();


text:
package com.intellij.codeInsight.daemon.impl.quickfix;

import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.daemon.QuickFixBundle;
import com.intellij.codeInsight.generation.JavaOverrideImplementMemberChooser;
import com.intellij.codeInsight.generation.OverrideImplementExploreUtil;
import com.intellij.codeInsight.generation.OverrideImplementUtil;
import com.intellij.codeInsight.generation.PsiMethodMember;
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.featureStatistics.ProductivityFeatureNames;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiEnumConstant;
import com.intellij.psi.PsiFile;
import com.intellij.psi.infos.CandidateInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class ImplementMethodsFix extends LocalQuickFixAndIntentionActionOnPsiElement {
  public ImplementMethodsFix(PsiElement aClass) {
    super(aClass);
  }

  @NotNull
  @Override
  public String getText() {
    return QuickFixBundle.message("implement.methods.fix");
  }

  @Override
  @NotNull
  public String getFamilyName() {
    return getText();
  }

  @Override
  public boolean isAvailable(@NotNull Project project,
                             @NotNull PsiFile file,
                             @NotNull PsiElement startElement,
                             @NotNull PsiElement endElement) {
    return BaseIntentionAction.canModify(startElement);
  }

  @Override
  public void invoke(@NotNull Project project,
                     @NotNull PsiFile file,
                     @Nullable final Editor editor,
                     @NotNull PsiElement startElement,
                     @NotNull PsiElement endElement) {
    final PsiElement myPsiElement = startElement;

    if (editor == null || !FileModificationService.getInstance().prepareFileForWrite(myPsiElement.getContainingFile())) return;
    if (myPsiElement instanceof PsiEnumConstant) {
      final boolean hasClassInitializer = ((PsiEnumConstant)myPsiElement).getInitializingClass() != null;
      final JavaOverrideImplementMemberChooser chooser = chooseMethodsToImplement(editor, startElement,
                                                                              ((PsiEnumConstant)myPsiElement).getContainingClass(),
                                                                              hasClassInitializer);
      if (chooser == null) return;

      final List<PsiMethodMember> selectedElements = chooser.getSelectedElements();
      if (selectedElements == null || selectedElements.isEmpty()) return;

      WriteCommandAction.writeCommandAction(project, file).run(() -> {
        final PsiClass psiClass = ((PsiEnumConstant)myPsiElement).getOrCreateInitializingClass();
        OverrideImplementUtil.overrideOrImplementMethodsInRightPlace(editor, psiClass, selectedElements, chooser.getOptions());
      });
    }
    else {
      OverrideImplementUtil.chooseAndImplementMethods(project, editor, (PsiClass)myPsiElement);
    }

  }

  @Override
  public boolean startInWriteAction() {
    return false;
  }

  @Nullable
  protected static JavaOverrideImplementMemberChooser chooseMethodsToImplement(Editor editor,
                                                                               PsiElement startElement,
                                                                               PsiClass aClass,
                                                                               boolean implemented) {
    FeatureUsageTracker.getInstance().triggerFeatureUsed(ProductivityFeatureNames.CODEASSISTS_OVERRIDE_IMPLEMENT);

    final Collection<CandidateInfo> overrideImplement = OverrideImplementExploreUtil.getMapToOverrideImplement(aClass, true, implemented).values();
    return OverrideImplementUtil
      .showJavaOverrideImplementChooser(editor, startElement, true, overrideImplement, new ArrayList<>());
  }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package wvlet.airframe.surface

object AirSpecBridgeCompat {
  val isScalaJS: Boolean = false
}


text:
package org.kodejava.example.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class ScrollableAfterLastExample {
    private static final String URL = "jdbc:mysql://localhost/kodejava";
    private static final String USERNAME = "root";
    private static final String PASSWORD = "";

    public static void main(String[] args) {
        try (Connection connection =
                 DriverManager.getConnection(URL, USERNAME, PASSWORD)) {

            Statement statement = connection.createStatement(
                ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_READ_ONLY);

            String sql = "SELECT code, name, price FROM products";
            ResultSet resultSet = statement.executeQuery(sql);

            // Let's jump to the last records. The afterLast() method will
            // position the cursor after the last record.
            resultSet.afterLast();

            while (resultSet.previous()) {
                String code = resultSet.getString("code");
                String name = resultSet.getString("name");
                double price = resultSet.getDouble("price");

                System.out.println(code + "\t" + name + "\t" + price);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}


text:
require 'rake'
require 'rake/confirm'


text:
// Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent,
// with the colors in the order red, white and blue.

// Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.

// Note:
// You are not suppose to use the library's sort function for this problem.
/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */

 var sortColors = function(nums) { // 96 ms runtime
    if( nums === null || nums.length<2 ) return;
    var low = 0,
        high = nums.length-1;
    // The idea is to sweep all 0s to the left and all 2s to the right, then all 1s are left in the middle.
    for( var i=low; i<=high; ){
        if( nums[i] === 1 ){
           i++;
        } else if( nums[i] === 2 ){
            //swap nums[i] and nums[high] and high--;
            var temp = nums[i];
            nums[i] = nums[high];
            nums[high] = temp;
            high--;
        } else{
            // swap nums[i] and nums[low] and i,low both ++
            var temp = nums[i];
            nums[i] = nums[low];
            nums[low] = temp;
            i++;low++;
        }
    }
};

// ------------------------------------------------------------

var sortColors = function(nums) {
    var red = [],
        white = [],
        blue = [];
    for(var i=0; i<nums.length; i++ ){
        if( nums[i] === 1 ){
           white.push(nums[i]);
        } else if( nums[i] === 2 ){
            blue.push(nums[i]);
        } else{
            red.push(nums[i]);
        }
    }
    nums = red.concat( white, blue );
};


text:
package org.jetbrains.idea.maven.wizards;

import com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurable;
import com.intellij.ide.util.frameworkSupport.FrameworkSupportModel;
import com.intellij.ide.util.frameworkSupport.FrameworkSupportProvider;
import com.intellij.ide.util.projectWizard.ModuleBuilder;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.module.StdModuleTypes;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.maven.model.MavenConstants;
import org.jetbrains.idea.maven.model.MavenId;
import org.jetbrains.idea.maven.project.MavenProjectsManager;
import org.jetbrains.idea.maven.utils.MavenIcons;

import javax.swing.*;
import java.util.Collections;

public class MavenFrameworkSupportProvider extends FrameworkSupportProvider {
  public MavenFrameworkSupportProvider() {
    super(MavenFrameworkSupportProvider.class.getName(), "Maven");
  }

  @NotNull
  @Override
  public FrameworkSupportConfigurable createConfigurable(@NotNull FrameworkSupportModel model) {
    return new FrameworkSupportConfigurable() {
      @Override
      public JComponent getComponent() {
        return new JPanel();
      }

      @Override
      public void addSupport(@NotNull Module module, @NotNull ModifiableRootModel model, @Nullable Library library) {
        VirtualFile[] roots = model.getContentRoots();
        VirtualFile root;
        if (roots.length == 0) {
          root = module.getModuleFile().getParent();
          model.addContentEntry(root);
        }
        else {
          root = roots[0];
        }

        VirtualFile existingPom = root.findChild(MavenConstants.POM_XML);
        if (existingPom != null) {
          MavenProjectsManager.getInstance(module.getProject()).addManagedFiles(Collections.singletonList(existingPom));
        }
        else {
          new MavenModuleBuilderHelper(new MavenId("groupId", module.getName(), "1.0-SNAPSHOT"), null, null, false, false, null,
                                       "Add Maven Support").configure(model.getProject(), root, true);
        }
      }
    };
  }

  @Override
  public boolean isEnabledForModuleBuilder(@NotNull ModuleBuilder builder) {
    return false;
  }

  @Override
  public boolean isSupportAlreadyAdded(@NotNull Module module) {
    return MavenProjectsManager.getInstance(module.getProject()).isMavenizedModule(module);
  }

  @Override
  public boolean isEnabledForModuleType(@NotNull ModuleType moduleType) {
    return moduleType.equals(StdModuleTypes.JAVA);
  }

  @Override
  public Icon getIcon() {
    return MavenIcons.MAVEN_ICON;
  }
}


text:
var Proyect = require('mongoose').model('Proyect');
var fs = require('fs');
var spawn = require('child_process').spawn;
var runProject;

module.exports = function(io)
{
	io.on('connection', (socket) =>
	{
		console.log('a user connected');
		socket.on('disconnect', () =>
		{
			console.log('user disconnected');
		});
		socket.on('runProject', function(data)
		{
			Proyect.findOne({
				_id: data.id
			},
			function(err, proyect)
			{
				if(proyect.language === "Javascript")
				{
					var env = process.env;
					env["PORT"] = data.port;
					runProject = spawn('node', [data.name], {cwd: proyect.route, env: env, shell: true});
					runProject.stdout.on('data', (d) => {
						var result = d.toString();
						console.log(result);
						io.emit('shellOutput', result);
					});
					runProject.stderr.on('data', (d) => {
					 	console.log(`stderr: ${d}`);
					});
				}
			});
		});
		socket.on('stopProject',function()
		{
			runProject.kill('SIGINT');
			console.log('stop');
		});
		socket.on('installPackage', function(data)
		{
			var depType = "";
			Proyect.findOne({
				_id: data.id
			},
			function(err, proyect)
			{
				if(proyect.language === "Javascript")
				{
					if(data.dev)
						depType = '--save-dev';
					else
						depType = '--save';
					var npm = spawn('npm',['install', data.package, depType], {cwd: proyect.route,  shell: true});
					npm.stdout.on('data', (data) => {
						var result = data.toString();
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
					npm.on('error', function(err){
						var result = err.message;
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
					npm.on('close', function(code){
						io.emit('packageInstallOutput', code);
					});
				}
				else if(proyect.language === "PHP")
				{
					if(data.dev)
						depType = '--dev';
					var composer = spawn('composer',['require', data.package, depType], {cwd: proyect.route,  shell: true});
					composer.stdout.on('data', (data) => {
						var result = data.toString();
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
					composer.on('error', function(err){
						var result = err.message;
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
					composer.on('close', function(code){
						io.emit('packageInstallOutput', code);
					});
				}
			});
		});
		socket.on('uninstallPackage', function(data)
		{
			var depType = "";
			Proyect.findOne({
				_id: data.id
			},
			function(err, proyect)
			{
				if(proyect.language === "Javascript")
				{
					if(data.dev)
						depType = '--save-dev';
					else
						depType = '--save';
					var npm = spawn('npm',['uninstall', data.package, depType], {cwd: proyect.route,  shell: true});
					npm.stdout.on('data', (data) => {
						var result = data.toString();
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
					npm.on('error', function(err){
						var result = err.message;
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
				}
				else if(proyect.language === "PHP")
				{
					if(data.dev)
						depType = '--dev';
					var composer = spawn('composer',['remove', data.package, depType], {cwd: proyect.route,  shell: true});
					composer.stdout.on('data', (data) => {
						var result = data.toString();
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
					composer.on('error', function(err){
						var result = err.message;
						console.log(result);
						io.emit('packageInstallOutput', result);
					});
				}
			});
		});
	});
}


text:
module Data.Graph.Inductive.Query.MaxFlow(
    getRevEdges, augmentGraph, updAdjList, updateFlow, mfmg, mf, maxFlowgraph,
    maxFlow
) where

import Data.List

import Data.Graph.Inductive.Basic
import Data.Graph.Inductive.Graph
--import Data.Graph.Inductive.Tree
import Data.Graph.Inductive.Query.BFS

-- |
-- @
--                 i                                 0
-- For each edge a--->b this function returns edge b--->a .
--          i
-- Edges a\<--->b are ignored
--          j
-- @
getRevEdges :: (Num b,Ord b) => [(Node,Node)] -> [(Node,Node,b)]
getRevEdges [] = []
getRevEdges ((u,v):es) | notElem (v,u) es = (v,u,0):getRevEdges es
                       | otherwise        = getRevEdges (delete (v,u) es)

-- |
-- @
--                 i                                  0
-- For each edge a--->b insert into graph the edge a\<---b . Then change the
--                            i         (i,0,i)
-- label of every edge from a---->b to a------->b
-- @
--
-- where label (x,y,z)=(Max Capacity, Current flow, Residual capacity)
augmentGraph :: (DynGraph gr,Num b,Ord b) => gr a b -> gr a (b,b,b)
augmentGraph g = emap (\i->(i,0,i)) (insEdges (getRevEdges (edges g)) g)

-- | Given a successor or predecessor list for node u and given node v, find
-- the label corresponding to edge (u,v) and update the flow and residual
-- capacity of that edge's label. Then return the updated list.
updAdjList::(Num b,Ord b) => [((b,b,b),Node)]->Node->b->Bool->[((b,b,b),Node)]
updAdjList s v cf fwd | fwd == True = ((x,y+cf,z-cf),w):rs
                      | otherwise   = ((x,y-cf,z+cf),w):rs
                        where ((x,y,z),w) = head (filter (\(_,w')->v==w') s)
                              rs          = filter (\(_,w')->v/=w') s

-- | Update flow and residual capacity along augmenting path from s to t in
-- graph G. For a path [u,v,w,...] find the node u in G and its successor and
-- predecessor list, then update the corresponding edges (u,v) and (v,u) on
-- those lists by using the minimum residual capacity of the path.
updateFlow :: (DynGraph gr,Num b,Ord b) => Path -> b -> gr a (b,b,b) -> gr a (b,b,b)
updateFlow []	     _ g = g
updateFlow [_]       _ g = g
updateFlow (u:v:vs) cf g = case match u g of
                             (Nothing,g')        -> g'
                             (Just (p,u',l,s),g') -> (p',u',l,s') & g2
                                where g2 = updateFlow (v:vs) cf g'
                                      s' = updAdjList s v cf True
                                      p' = updAdjList p v cf False

-- | Compute the flow from s to t on a graph whose edges are labeled with
-- (x,y,z)=(max capacity,current flow,residual capacity) and all edges
-- are of the form a\<---->b. First compute the residual graph, that is,
-- delete those edges whose residual capacity is zero. Then compute the
-- shortest augmenting path from s to t, and finally update the flow and
-- residual capacity along that path by using the minimum capacity of
-- that path. Repeat this process until no shortest path from s to t exist.
mfmg :: (DynGraph gr,Num b,Ord b) => gr a (b,b,b) -> Node -> Node -> gr a (b,b,b)
mfmg g s t | augPath == [] = g
           | otherwise     = mfmg (updateFlow augPath minC g) s t
             where minC        = minimum (map ((\(_,_,z)->z).snd)(tail augLPath))
                   augPath     = map fst augLPath
                   LP augLPath = lesp s t gf
                   gf          = elfilter (\(_,_,z)->z/=0) g

-- | Compute the flow from s to t on a graph whose edges are labeled with
-- x, which is the max capacity and where not all edges need to be of the
-- form a\<---->b. Return the flow as a grap whose edges are labeled with
-- (x,y,z)=(max capacity,current flow,residual capacity) and all edges
-- are of the form a\<---->b
mf :: (DynGraph gr,Num b,Ord b) => gr a b -> Node -> Node -> gr a (b,b,b)
mf g s t = mfmg (augmentGraph g) s t

-- | Compute the maximum flow from s to t on a graph whose edges are labeled
-- with x, which is the max capacity and where not all edges need to be of
-- the form a\<---->b. Return the flow as a grap whose edges are labeled with
-- (y,x) = (current flow, max capacity).
maxFlowgraph :: (DynGraph gr,Num b,Ord b) => gr a b -> Node -> Node -> gr a (b,b)
maxFlowgraph g s t = emap (\(u,v,_)->(v,u)) g2
                           where g2 = elfilter (\(x,_,_)->x/=0) g1
                                 g1 = mf g s t

-- | Compute the value of a maximumflow
maxFlow :: (DynGraph gr,Num b,Ord b) => gr a b -> Node -> Node -> b
maxFlow g s t = foldr (+) 0 (map (\(_,_,(x,_))->x)(maybe [] id $ out (maxFlowgraph g s t) s))

------------------------------------------------------------------------------
-- Some test cases: clr595 is from the CLR textbook, page 595. The value of
-- the maximum flow for s=1 and t=6 (23) coincides with the example but the
-- flow itself is slightly different since the textbook does not compute the
-- shortest augmenting path from s to t, but just any path. However remember
-- that for a given flow graph the maximum flow is not unique.
-- (gr595 is defined in GraphData.hs)
------------------------------------------------------------------------------


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB)
// Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source
// schema.
// Generated on: 2016.05.30 at 07:47:34 PM JST
//
package org.sbml._2001.ns.celldesigner;

import java.math.BigDecimal;

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

// TODO: Auto-generated Javadoc
/**
 * Degradation symbol.
 *

 * Java class for degradedShapeInBlockDiagram complex type.
 *

 * The following schema fragment specifies the expected content contained within
 * this class.
 *
 *

 * <complexType name="degradedShapeInBlockDiagram">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <attribute name="width" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}short">
 *             <minInclusive value="0"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="height" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}short">
 *             <minInclusive value="0"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="offsetX" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}decimal">
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="offsetY" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}decimal">
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "degradedShapeInBlockDiagram")
public class DegradedShapeInBlockDiagram {

  /** The width. */
  @XmlAttribute(name = "width", required = true)
  protected short      width;
  /** The height. */
  @XmlAttribute(name = "height", required = true)
  protected short      height;
  /** The offset X. */
  @XmlAttribute(name = "offsetX", required = true)
  protected BigDecimal offsetX;
  /** The offset Y. */
  @XmlAttribute(name = "offsetY", required = true)
  protected BigDecimal offsetY;

  /**
   * Gets the value of the width property.
   *
   * @return the width
   */
  public short getWidth() {
    return width;
  }

  /**
   * Sets the value of the width property.
   *
   * @param value
   *        the new width
   */
  public void setWidth(short value) {
    this.width = value;
  }

  /**
   * Gets the value of the height property.
   *
   * @return the height
   */
  public short getHeight() {
    return height;
  }

  /**
   * Sets the value of the height property.
   *
   * @param value
   *        the new height
   */
  public void setHeight(short value) {
    this.height = value;
  }

  /**
   * Gets the value of the offsetX property.
   *
   * @return
   *         possible object is {@link BigDecimal }
   */
  public BigDecimal getOffsetX() {
    return offsetX;
  }

  /**
   * Sets the value of the offsetX property.
   *
   * @param value
   *        allowed object is {@link BigDecimal }
   */
  public void setOffsetX(BigDecimal value) {
    this.offsetX = value;
  }

  /**
   * Gets the value of the offsetY property.
   *
   * @return
   *         possible object is {@link BigDecimal }
   */
  public BigDecimal getOffsetY() {
    return offsetY;
  }

  /**
   * Sets the value of the offsetY property.
   *
   * @param value
   *        allowed object is {@link BigDecimal }
   */
  public void setOffsetY(BigDecimal value) {
    this.offsetY = value;
  }
}


text:
#import "UIView.h"

@class UIImageView;

@interface SBHighlightView : UIView
{
    UIImageView *_highlight;
    double _highlightAlpha;
    double _highlightHeight;
}

+ (id)_highlightImageWithHeight:(double)arg1 alpha:(double)arg2;
@property(readonly, nonatomic) double highlightHeight; // @synthesize highlightHeight=_highlightHeight;
@property(readonly, nonatomic) double highlightAlpha; // @synthesize highlightAlpha=_highlightAlpha;
- (void)layoutSubviews;
- (void)dealloc;
- (id)initWithFrame:(struct CGRect)arg1 highlightAlpha:(double)arg2 highlightHeight:(double)arg3;

@end


text:
from gnuradio import analog
from gnuradio import audio
from gnuradio import eng_notation
from gnuradio import filter
from gnuradio import gr
from gnuradio import wxgui
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from gnuradio.wxgui import forms
from gnuradio.wxgui import scopesink2
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import osmosdr
import time
import wx

class Transmit(grc_wxgui.top_block_gui):

    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="Transmit")
        _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
        self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 250000
        self.gain = gain = 40
        self.freq = freq = 435000000
        self.audio_rate = audio_rate = 48000
        self.audio_interp = audio_interp = 4

        ##################################################
        # Blocks
        ##################################################
        self._freq_text_box = forms.text_box(
        	parent=self.GetWin(),
        	value=self.freq,
        	callback=self.set_freq,
        	label="frequency",
        	converter=forms.float_converter(),
        )
        self.Add(self._freq_text_box)
        self.wxgui_scopesink2_0 = scopesink2.scope_sink_f(
        	self.GetWin(),
        	title="Scope Plot",
        	sample_rate=audio_rate,
        	v_scale=0,
        	v_offset=0,
        	t_scale=0,
        	ac_couple=False,
        	xy_mode=False,
        	num_inputs=1,
        	trig_mode=wxgui.TRIG_MODE_AUTO,
        	y_axis_label="Counts",
        )
        self.Add(self.wxgui_scopesink2_0.win)
        self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
                interpolation=int(samp_rate * 1.0),
                decimation=audio_rate * audio_interp,
                taps=None,
                fractional_bw=None,
        )
        self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + "" )
        self.osmosdr_sink_0.set_sample_rate(samp_rate)
        self.osmosdr_sink_0.set_center_freq(freq, 0)
        self.osmosdr_sink_0.set_freq_corr(0, 0)
        self.osmosdr_sink_0.set_gain(10, 0)
        self.osmosdr_sink_0.set_if_gain(20, 0)
        self.osmosdr_sink_0.set_bb_gain(20, 0)
        self.osmosdr_sink_0.set_antenna("", 0)
        self.osmosdr_sink_0.set_bandwidth(0, 0)

        _gain_sizer = wx.BoxSizer(wx.VERTICAL)
        self._gain_text_box = forms.text_box(
        	parent=self.GetWin(),
        	sizer=_gain_sizer,
        	value=self.gain,
        	callback=self.set_gain,
        	label="Gain",
        	converter=forms.float_converter(),
        	proportion=0,
        )
        self._gain_slider = forms.slider(
        	parent=self.GetWin(),
        	sizer=_gain_sizer,
        	value=self.gain,
        	callback=self.set_gain,
        	minimum=0,
        	maximum=90,
        	num_steps=100,
        	style=wx.SL_HORIZONTAL,
        	cast=float,
        	proportion=1,
        )
        self.Add(_gain_sizer)
        self.audio_source_0 = audio.source(48000, "", True)
        self.analog_nbfm_tx_0 = analog.nbfm_tx(
        	audio_rate=audio_rate,
        	quad_rate=audio_rate * audio_interp,
        	tau=75e-6,
        	max_dev=5e3,
        )

        ##################################################
        # Connections
        ##################################################
<<<<<<< HEAD
        self.connect((self.analog_nbfm_tx_0, 0), (self.rational_resampler_xxx_0, 0))
        self.connect((self.audio_source_0, 0), (self.analog_nbfm_tx_0, 0))
        self.connect((self.audio_source_0, 0), (self.wxgui_scopesink2_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0), (self.osmosdr_sink_0, 0))
=======
        self.connect((self.analog_nbfm_tx_0, 0), (self.rational_resampler_xxx_0, 0))
        self.connect((self.audio_source_0, 0), (self.analog_nbfm_tx_0, 0))
        self.connect((self.audio_source_0, 0), (self.wxgui_scopesink2_0, 0))
        self.connect((self.rational_resampler_xxx_0, 0), (self.uhd_usrp_sink_0, 0))

>>>>>>> 3d8d9462dccebde3f004b0663274cea6cdc2ac37

    def get_samp_rate(self):
        return self.samp_rate

    def set_samp_rate(self, samp_rate):
        self.samp_rate = samp_rate
        self.osmosdr_sink_0.set_sample_rate(self.samp_rate)

    def get_gain(self):
        return self.gain

    def set_gain(self, gain):
        self.gain = gain
        self._gain_slider.set_value(self.gain)
        self._gain_text_box.set_value(self.gain)

    def get_freq(self):
        return self.freq

    def set_freq(self, freq):
        self.freq = freq
        self._freq_text_box.set_value(self.freq)
        self.osmosdr_sink_0.set_center_freq(self.freq, 0)

    def get_audio_rate(self):
        return self.audio_rate

    def set_audio_rate(self, audio_rate):
        self.audio_rate = audio_rate
        self.wxgui_scopesink2_0.set_sample_rate(self.audio_rate)

    def get_audio_interp(self):
        return self.audio_interp

    def set_audio_interp(self, audio_interp):
        self.audio_interp = audio_interp

if __name__ == '__main__':
    import ctypes
    import sys
    if sys.platform.startswith('linux'):
        try:
            x11 = ctypes.cdll.LoadLibrary('libX11.so')
            x11.XInitThreads()
        except:
            print "Warning: failed to XInitThreads()"
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    (options, args) = parser.parse_args()
    tb = Transmit()
    tb.Start(True)
    tb.Wait()


text:
<?php
namespace HostAttribute\Mapper;

use Zend\Db\Adapter\AdapterInterface;
use Zend\Db\Adapter\Driver\ResultInterface;
use Zend\Db\ResultSet\HydratingResultSet;
use Zend\Db\Sql\Sql;
use Zend\Db\Sql\Delete;
use Zend\Db\Sql\Insert;
use Zend\Db\Sql\Update;
use Zend\Stdlib\Hydrator\HydratorInterface;
use HostAttribute\Entity\AttributeEntity;

class AttributeMapper implements AttributeMapperInterface
{

    /**
     *
     * @var AdapterInterface
     */
    protected $readAdapter;

    /**
     *
     * @var AdapterInterface
     */
    protected $writeAdapter;

    /**
     *
     * @var HydratorInterface
     */
    protected $hydrator;

    /**
     *
     * @var AttributeEntity
     */
    protected $prototype;

    /**
     *
     * @param AdapterInterface $readAdapter
     * @param AdapterInterface $writeAdapter
     * @param HydratorInterface $hydrator
     * @param AttributeEntity $prototype
     */
    public function __construct(AdapterInterface $readAdapter, AdapterInterface $writeAdapter, HydratorInterface $hydrator, AttributeEntity $prototype)
    {
        $this->readAdapter = $readAdapter;

        $this->writeAdapter = $writeAdapter;

        $this->hydrator = $hydrator;

        $this->prototype = $prototype;
    }

    /**
     *
     * {@inheritDoc}
     *
     * @see \HostAttribute\Mapper\AttributeMapperInterface::getAll()
     */
    public function getAll($filter)
    {
        $sql = new Sql($this->readAdapter);

        $select = $sql->select('host_attribute');

        $stmt = $sql->prepareStatementForSqlObject($select);

        $result = $stmt->execute();

        if ($result instanceof ResultInterface && $result->isQueryResult()) {

            $resultSet = new HydratingResultSet($this->hydrator, $this->prototype);

            $resultSet->buffer();

            return $resultSet->initialize($result);
        }

        return array();
    }

    /**
     *
     * {@inheritDoc}
     *
     * @see \HostAttribute\Mapper\AttributeMapperInterface::get()
     */
    public function get($id)
    {
        $sql = new Sql($this->readAdapter);

        $select = $sql->select('host_attribute');

        $select->where(array(
            'host_attribute.host_attribute_id = ?' => $id
        ));

        $resultSetPrototype = new HydratingResultSet($this->hydrator, $this->prototype);

        $stmt = $sql->prepareStatementForSqlObject($select);

        $result = $stmt->execute();

        if ($result instanceof ResultInterface && $result->isQueryResult()) {

            $resultSet = new HydratingResultSet($this->hydrator, $this->prototype);

            $resultSet->buffer();

            return $resultSet->initialize($result)->current();
        }

        return array();
    }

    /**
     *
     * {@inheritDoc}
     *
     * @see \HostAttribute\Mapper\AttributeMapperInterface::save()
     */
    public function save(AttributeEntity $entity)
    {
        $postData = $this->hydrator->extract($entity);

        if ($entity->getHostAttributeId()) {

            // ID present, it's an Update
            $action = new Update('host_attribute');

            $action->set($postData);

            $action->where(array(
                'host_attribute.host_attribute_id = ?' => $entity->getHostAttributeId()
            ));
        } else {
            // ID NOT present, it's an Insert
            $action = new Insert('host_attribute');

            $action->values($postData);
        }

        $sql = new Sql($this->writeAdapter);

        $stmt = $sql->prepareStatementForSqlObject($action);

        $result = $stmt->execute();

        if ($result instanceof ResultInterface) {
            $newId = $result->getGeneratedValue();

            if ($newId) {
                // When a value has been generated, set it on the object
                $entity->setHostAttributeId($newId);
            }

            return $entity;
        }

        throw new \Exception("Database error");
    }

    /**
     *
     * {@inheritDoc}
     *
     * @see \HostAttribute\Mapper\AttributeMapperInterface::delete()
     */
    public function delete(AttributeEntity $entity)
    {
        $action = new Delete('host_attribute');

        $action->where(array(
            'host_attribute.host_attribute_id = ?' => $entity->getHostAttributeId()
        ));

        $sql = new Sql($this->writeAdapter);

        $stmt = $sql->prepareStatementForSqlObject($action);

        $result = $stmt->execute();

        return (bool) $result->getAffectedRows();
    }
}


text:
install_dmg_app "$DROPBOX_APP_URL" "Dropbox Installer" "$DROPBOX_APP_NAME"

# CloudApp
#install_dmg_app "$CLOUD_APP_URL" "CloudApp" "$CLOUD_APP_NAME"

# Knox
#install_zip_app "$KNOX_APP_URL" "$KNOX_APP_NAME"

# iTerm
install_zip_app "$ITERM_APP_URL" "$ITERM_APP_NAME"

# Sublime Text
install_dmg_app "$SUBLIME_TEXT_APP_URL" "Sublime Text" "$SUBLIME_TEXT_APP_NAME"

# Sublime Text URL Handler
#install_zip_app "$SUBLIME_URL_HANDLER_APP_URL" "$SUBLIME_URL_HANDLER_APP_NAME"

# Alfred
#install_zip_app "$ALFRED_APP_URL" "$ALFRED_APP_NAME"

# TextExpander
#install_zip_app "$TEXTEXPANDER_APP_URL" "$TEXTEXPANDER_APP_NAME"

# Path Finder
#install_zip_app "$PATH_FINDER_APP_URL" "$PATH_FINDER_APP_NAME"

# Firefox
install_dmg_app "$FIREFOX_APP_URL" "Firefox" "$FIREFOX_APP_NAME"

# Google Chrome
#install_dmg_app "$CHROME_APP_URL" "Google Chrome" "$CHROME_APP_NAME"

# Opera
install_dmg_app "$OPERA_APP_URL" "Opera" "$OPERA_APP_NAME"

# OmniGraffle
#install_dmg_app "$OMNIGRAFFLE_APP_URL" "OmniGrafflePro" "$OMNIGRAFFLE_APP_NAME"

# Transmit
#install_zip_app "$TRANSMIT_APP_URL" "$TRANSMIT_APP_NAME"

# iStat Menus
#install_zip_app "$ISTATS_APP_URL" "$ISTATS_APP_NAME"

# Bartender
#install_zip_app "$BARTENDER_APP_URL" "$BARTENDER_APP_NAME"

# Snippets
#install_zip_app "$SNIPPETS_APP_URL" "$SNIPPETS_APP_NAME"

# Acorn
#install_zip_app "$ACORN_APP_URL" "$ACORN_APP_NAME"

# DoubleTake
#install_dmg_app "$DOUBLETAKE_APP_URL" "DoubleTake" "$DOUBLETAKE_APP_NAME"

# ImageOptim
#install_tar_app "$IMAGE_OPTIM_APP_URL" "$IMAGE_OPTIM_APP_NAME" "-xjf"

# Iconjar
#install_zip_app "$ICONJAR_APP_URL" "$ICONJAR_APP_NAME"

# VLC
install_dmg_app "$VLC_APP_URL" "vlc-2.2.0" "$VLC_APP_NAME"

# PG Admin
#install_dmg_app "$PG_ADMIN_APP_URL" "pgAdmin3" "$PG_ADMIN_APP_NAME"

# PSequael
#install_zip_app "$PSEQUEL_APP_URL" "$PSEQUEL_APP_NAME"

# Sequel Pro
#install_dmg_app "$SEQUEL_PRO_APP_URL" "Sequel Pro 1.0.2" "$SEQUEL_PRO_APP_NAME"

# CheatSheet
install_zip_app "$CHEATSHEET_APP_URL" "$CHEATSHEET_APP_NAME"

# OpenOffice
#install_dmg_app "$OPEN_OFFICE_APP_URL" "OpenOffice" "$OPEN_OFFICE_APP_NAME"

# Cloak
#install_dmg_app "$CLOAK_APP_URL" "Cloak" "$CLOAK_APP_NAME"

# Screenhero
#install_dmg_app "$SCREENHERO_APP_URL" "Screenhero" "$SCREENHERO_APP_NAME"

# Speak
#install_dmg_app "$SPEAK_APP_URL" "Speak Installer" "$SPEAK_APP_NAME"

# VirtualBox
#install_dmg_pkg "$VIRTUAL_BOX_APP_URL" "VirtualBox" "$VIRTUAL_BOX_APP_NAME"

# Doxie
#install_dmg_app "$DOXIE_APP_URL" "Doxie" "$DOXIE_APP_NAME"

# Sonos
#install_dmg_app "$SONOS_APP_URL" "Sonos" "$SONOS_APP_NAME"

# App Cleaner
#install_zip_app "$APP_CLEANER_APP_URL" "$APP_CLEANER_APP_NAME"

# Hazel
#install_dmg_app "$HAZEL_APP_URL" "Hazel" "$HAZEL_APP_NAME"

# Trailer
#install_zip_app "$TRAILER_APP_URL" "$TRAILER_APP_NAME"

# Carbon Copy Cloner
#install_zip_app "$CARBON_COPY_CLONER_APP_URL" "$CARBON_COPY_CLONER_APP_NAME"

# QuickLook - Plain Text
#install_zip_app "$QUICK_LOOK_PLAIN_TEXT_APP_URL" "$QUICK_LOOK_PLAIN_TEXT_APP_NAME"

# ksdiff
#install_zip_pkg "$KSDIFF_APP_URL" "$KSDIFF_APP_NAME"


text:
@class DVTDocumentLocation, DVTFileDataType, DVTSymbol, IDEContainerItem, IDEFileReference, NSArray, NSImage, NSNull, NSString, NSURL;

@interface IDEContainer (PasteboardSupport) <IDEKeyDrivenNavigableItemRepresentedObject>
- (id)containerItemFromPlistRepresentation:(id)arg1;
- (id)containerItemFromNameAndIndexPath:(id)arg1 rootGroup:(id)arg2;
- (id)plistRepresentationForContainerItem:(id)arg1;
- (id)pathToContainerItem:(id)arg1;
@property(readonly, nonatomic) NSString *navigableItem_name;
@property(readonly) BOOL ide_shouldSupressNavigation;
- (id)ide_defaultNewFileTemplate;
- (id)ide_defaultNewFileTemplateForPath:(id)arg1;
- (id)ide_templateForName:(id)arg1 andCategory:(id)arg2;
@property(readonly) NSString *ideInspectedReferencedRelativeLocationContainingFolderPlaceholder;
@property(readonly) NSString *ideInspectedReferencedRelativeLocationPlaceholder;
@property(readonly) NSString *ideInspectedReferenceMessageForChoosingRelativeLocation;
@property(readonly) BOOL ideInspectedReferenceRelativeLocationShouldChooseFile;
@property(readonly) BOOL ideInspectedReferenceShowsFileTypePopUp;
@property(readonly) BOOL ideInspectedIsReferenceNameEditable;
@property(readonly) IDEContainerItem *explorableItemForNavigation;
@property(readonly) NSString *explorableName;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly, nonatomic) NSString *navigableItem_accessibilityIdentifier;
@property(readonly, nonatomic) NSString *navigableItem_accessibleImageDescription;
@property(readonly, nonatomic) NSArray *navigableItem_additionalFilterMatchingText;
@property(readonly, nonatomic) NSArray *navigableItem_childRepresentedObjects;
@property(readonly, nonatomic) DVTDocumentLocation *navigableItem_contentDocumentLocation;
@property(readonly, nonatomic) DVTFileDataType *navigableItem_documentType;
@property(readonly, nonatomic) IDEFileReference *navigableItem_fileReference;
@property(readonly, nonatomic) NSNull *navigableItem_filtered;
@property(readonly, nonatomic) NSString *navigableItem_groupIdentifier;
@property(readonly, nonatomic) NSImage *navigableItem_image;
@property(readonly, nonatomic) BOOL navigableItem_isEnabled;
@property(readonly, nonatomic) BOOL navigableItem_isLeaf;
@property(readonly, nonatomic) BOOL navigableItem_isMajorGroup;
@property(readonly, nonatomic) BOOL navigableItem_isVisible;
@property(readonly, nonatomic) BOOL navigableItem_missingReferencedContentIsImportant;
@property(readonly, nonatomic) id navigableItem_parentRepresentedObject;
@property(readonly, nonatomic) BOOL navigableItem_referencedContentExists;
@property(readonly, nonatomic) DVTSymbol *navigableItem_representedSymbol;
@property(readonly, nonatomic) NSURL *navigableItem_representedURL;
@property(readonly, nonatomic) NSString *navigableItem_subtitle;
@property(readonly, nonatomic) NSString *navigableItem_toolTip;
@property(readonly) Class superclass;
@end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tests.gl_500;

import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL4;
import static com.jogamp.opengl.GL4.*;
import com.jogamp.opengl.util.GLBuffers;
import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
import glm.glm;
import glm.mat._4.Mat4;
import glm.vec._2.Vec2;
import glm.vec._2.i.Vec2i;
import glm.vec._4.Vec4;
import framework.BufferUtils;
import framework.Caps;
import framework.DrawElementsIndirectCommand;
import framework.Profile;
import framework.Semantic;
import framework.Test;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
import java.util.logging.Level;
import java.util.logging.Logger;
import jgli.Texture2d;

/**
 *
 * @author GBarbieri
 */
public class Gl_500_multi_draw_indirect_count_arb extends Test {

    public static void main(String[] args) {
        Gl_500_multi_draw_indirect_count_arb gl_500_multi_draw_indirect_count_arb = new Gl_500_multi_draw_indirect_count_arb();
    }

    public Gl_500_multi_draw_indirect_count_arb() {
        super("gl-500-multi-draw-indirect-count-arb", Profile.CORE, 4, 5, new Vec2i(640, 480),
                new Vec2(-Math.PI * 0.2f, Math.PI * 0.2f));
    }

    private final String SHADERS_SOURCE = "multi-draw-indirect-count";
    private final String SHADERS_ROOT = "src/data/gl_500";
    private final String TEXTURE_DIFFUSE = "kueken7_rgba8_srgb.dds";

    private int elementCount = 15;
    private int elementSize = elementCount * Short.BYTES;
    private short[] elementData = {
        0, 1, 2,
        0, 2, 3,
        0, 1, 2,
        0, 1, 2,
        0, 2, 3};

    private int vertexCount = 11;
    private int vertexSize = vertexCount * glf.Vertex_v2fv2f.SIZE;
    private float[] vertexData = {
        -1.0f, -1.0f,/**/ 0.0f, 1.0f,
        +1.0f, -1.0f,/**/ 1.0f, 1.0f,
        +1.0f, +1.0f,/**/ 1.0f, 0.0f,
        -1.0f, +1.0f,/**/ 0.0f, 0.0f,
        //
        -0.5f, -1.0f,/**/ 0.0f, 1.0f,
        +1.5f, -1.0f,/**/ 1.0f, 1.0f,
        +0.5f, +1.0f,/**/ 1.0f, 0.0f,
        //
        -0.5f, -1.0f,/**/ 0.0f, 1.0f,
        +0.5f, -1.0f,/**/ 1.0f, 1.0f,
        +1.5f, +1.0f,/**/ 1.0f, 0.0f,
        -1.5f, +1.0f,/**/ 0.0f, 0.0f};

    private int drawDataCount = 3;
    private int drawSize = drawDataCount * Integer.BYTES;
    private int[] drawIDData = {
        0, 1, 2};

    private int indirectBufferCount = 3;

    private class Buffer {

        public static final int VERTEX = 0;
        public static final int ELEMENT = 1;
        public static final int TRANSFORM = 2;
        public static final int INDIRECT = 3;
        public static final int PARAMETER = 4;
        public static final int VERTEX_INDIRECTION = 4;
        public static final int MAX = 5;
    }

    private class Texture {

        public static final int A = 0;
        public static final int B = 1;
        public static final int C = 2;
        public static final int MAX = 3;
    }

    private int[] bufferName = new int[Buffer.MAX], textureName = new int[Texture.MAX],
            drawOffset = new int[drawDataCount], drawCount = new int[drawDataCount], vertexArrayName = {0},
            pipelineName = {0}, uniformArrayStrideInt = {0};
    private Vec4[] viewport = new Vec4[drawDataCount];
    private int programName;

    @Override
    protected boolean begin(GL gl) {

        GL4 gl4 = (GL4) gl;

        boolean validated = true;
        validated = validated && gl4.isExtensionAvailable("GL_ARB_shader_draw_parameters");

        if (validated) {
            validated = initProgram(gl4);
        }
        if (validated) {
            validated = initBuffer(gl4);
        }
        if (validated) {
            validated = initVertexArray(gl4);
        }
        if (validated) {
            validated = initTexture(gl4);
        }

        Caps caps = new Caps(gl4, Profile.CORE);

        viewport[0] = new Vec4(windowSize.x / 3.0f * 0.0f, 0, windowSize.x / 3, windowSize.y);
        viewport[1] = new Vec4(windowSize.x / 3.0f * 1.0f, 0, windowSize.x / 3, windowSize.y);
        viewport[2] = new Vec4(windowSize.x / 3.0f * 2.0f, 0, windowSize.x / 3, windowSize.y);

        gl4.glEnable(GL_DEPTH_TEST);
        gl4.glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);

        return validated;
    }

    private boolean initProgram(GL4 gl4) {

        boolean validated = true;

        ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
                this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "vert", null, true);
        ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER,
                this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "frag", null, true);

        ShaderProgram shaderProgram = new ShaderProgram();
        shaderProgram.init(gl4);

        programName = shaderProgram.program();

        gl4.glProgramParameteri(programName, GL_PROGRAM_SEPARABLE, GL_TRUE);

        shaderProgram.add(vertShaderCode);
        shaderProgram.add(fragShaderCode);
        shaderProgram.link(gl4, System.out);

        int[] activeUniform = {0};
        gl4.glGetProgramiv(programName, GL_ACTIVE_UNIFORMS, activeUniform, 0);

        for (int i = 0; i < activeUniform[0]; ++i) {

            byte[] name = new byte[128];
            int[] length = {0};

            gl4.glGetActiveUniformName(programName, i, name.length, length, 0, name, 0);

            String stringName = new String(name).trim();

            if (stringName.equals("indirection.Transform[0]")) {
                gl4.glGetActiveUniformsiv(programName, 1, new int[]{i}, 0, GL_UNIFORM_ARRAY_STRIDE,
                        uniformArrayStrideInt, 0);
            }
        }

        if (validated) {

            gl4.glGenProgramPipelines(1, pipelineName, 0);
            gl4.glUseProgramStages(pipelineName[0], GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
        }

        return validated & checkError(gl4, "initProgram");
    }

    private boolean initBuffer(GL4 gl4) {

        gl4.glGenBuffers(Buffer.MAX, bufferName, 0);

        gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName[Buffer.VERTEX]);
        FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);
        gl4.glBufferData(GL_ARRAY_BUFFER, vertexSize, vertexBuffer, GL_STATIC_DRAW);
        BufferUtils.destroyDirectBuffer(vertexBuffer);
        gl4.glBindBuffer(GL_ARRAY_BUFFER, 0);

        gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName[Buffer.ELEMENT]);
        ShortBuffer elementBuffer = GLBuffers.newDirectShortBuffer(elementData);
        gl4.glBufferData(GL_ELEMENT_ARRAY_BUFFER, elementSize, elementBuffer, GL_STATIC_DRAW);
        BufferUtils.destroyDirectBuffer(elementBuffer);
        gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

        int[] vertexIndirection = {0, 1, 2};
        int paddingInt = Math.max(Integer.BYTES, uniformArrayStrideInt[0]);
        gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName[Buffer.VERTEX_INDIRECTION]);
        gl4.glBufferData(GL_UNIFORM_BUFFER, paddingInt * 3, null, GL_DYNAMIC_DRAW);
        IntBuffer paddingIntBuffer = GLBuffers.newDirectIntBuffer(1);
        paddingIntBuffer.put(vertexIndirection[0]).rewind();
        gl4.glBufferSubData(GL_UNIFORM_BUFFER, paddingInt * 0, Integer.BYTES, paddingIntBuffer);
        paddingIntBuffer.put(vertexIndirection[1]).rewind();
        gl4.glBufferSubData(GL_UNIFORM_BUFFER, paddingInt * 1, Integer.BYTES, paddingIntBuffer);
        paddingIntBuffer.put(vertexIndirection[2]).rewind();
        gl4.glBufferSubData(GL_UNIFORM_BUFFER, paddingInt * 2, Integer.BYTES, paddingIntBuffer);
        gl4.glBindBuffer(GL_UNIFORM_BUFFER, 0);

        gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName[Buffer.TRANSFORM]);
        gl4.glBufferData(GL_UNIFORM_BUFFER, Mat4.SIZE * drawDataCount, null, GL_DYNAMIC_DRAW);
        gl4.glBindBuffer(GL_UNIFORM_BUFFER, 0);

        DrawElementsIndirectCommand[] commands = new DrawElementsIndirectCommand[6];
        commands[0] = new DrawElementsIndirectCommand(elementCount, 1, 0, 0, 0);
        commands[1] = new DrawElementsIndirectCommand(elementCount >> 1, 1, 6, 4, 1);
        commands[2] = new DrawElementsIndirectCommand(elementCount, 1, 9, 7, 2);
        commands[3] = new DrawElementsIndirectCommand(elementCount, 1, 0, 0, 0);
        commands[4] = new DrawElementsIndirectCommand(elementCount >> 1, 1, 6, 4, 1);
        commands[5] = new DrawElementsIndirectCommand(elementCount, 1, 9, 7, 2);

        drawCount[0] = 3;
        drawCount[1] = 2;
        drawCount[2] = 1;
        drawOffset[0] = 0;
        drawOffset[1] = 1;
        drawOffset[2] = 3;

        gl4.glBindBuffer(GL_DRAW_INDIRECT_BUFFER, bufferName[Buffer.INDIRECT]);
        IntBuffer commandsBuffer = GLBuffers.newDirectIntBuffer(5 * commands.length);
        for (DrawElementsIndirectCommand command : commands) {
            commandsBuffer.put(command.toIa_());
        }
        /**
         * Critical, I forgot once to rewing the buffer, the driver video crashed.
         */
        commandsBuffer.rewind();
        gl4.glBufferData(GL_DRAW_INDIRECT_BUFFER, DrawElementsIndirectCommand.SIZE * commands.length, commandsBuffer,
                GL_STATIC_DRAW);
        gl4.glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0);
        BufferUtils.destroyDirectBuffer(commandsBuffer);

        gl4.glBindBuffer(GL_PARAMETER_BUFFER_ARB, bufferName[Buffer.PARAMETER]);
        IntBuffer drawCountBuffer = GLBuffers.newDirectIntBuffer(drawCount);
        gl4.glBufferData(GL_PARAMETER_BUFFER_ARB, drawCount.length * Integer.BYTES, drawCountBuffer, GL_DYNAMIC_DRAW);
        BufferUtils.destroyDirectBuffer(drawCountBuffer);
        gl4.glBindBuffer(GL_PARAMETER_BUFFER_ARB, 0);

        return true;
    }

    private boolean initVertexArray(GL4 gl4) {

        gl4.glGenVertexArrays(1, vertexArrayName, 0);
        gl4.glBindVertexArray(vertexArrayName[0]);
        {
            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName[Buffer.VERTEX]);
            gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, glf.Vertex_v2fv2f.SIZE, 0);
            gl4.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, glf.Vertex_v2fv2f.SIZE, Vec2.SIZE);
            gl4.glBindBuffer(GL_ARRAY_BUFFER, 0);

            gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION);
            gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD);

            gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName[Buffer.ELEMENT]);
        }
        gl4.glBindVertexArray(0);

        return true;
    }

    private boolean initTexture(GL4 gl4) {

        try {
            jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
            assert (!texture.empty());
            jgli.Gl.Format format = jgli.Gl.translate(texture.format());

            gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

            gl4.glGenTextures(Texture.MAX, textureName, 0);
            gl4.glActiveTexture(GL_TEXTURE0);
            gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.A]);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_NONE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_NONE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
            //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, GLint(Texture.levels() - 1));
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
            gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value,
                    texture.dimensions()[0], texture.dimensions()[1]);
            for (int level = 0; level < texture.levels(); ++level) {

                gl4.glTexSubImage2D(GL_TEXTURE_2D, level,
                        0, 0,
                        texture.dimensions(level)[0], texture.dimensions(level)[1],
                        format.external.value, format.type.value,
                        texture.data(level));
            }

            gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.B]);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_NONE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_NONE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
            //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, GLint(Texture.levels() - 1));
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
            gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value,
                    texture.dimensions()[0], texture.dimensions()[1]);
            for (int level = 0; level < texture.levels(); ++level) {

                gl4.glTexSubImage2D(GL_TEXTURE_2D, level,
                        0, 0,
                        texture.dimensions(level)[0], texture.dimensions(level)[1],
                        format.external.value, format.type.value,
                        texture.data(level));
            }

            gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.C]);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_NONE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_NONE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
            //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, GLint(Texture.levels() - 1));
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
            gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
            gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value,
                    texture.dimensions()[0], texture.dimensions()[1]);
            for (int level = 0; level < texture.levels(); ++level) {

                gl4.glTexSubImage2D(GL_TEXTURE_2D, level,
                        0, 0,
                        texture.dimensions(level)[0], texture.dimensions(level)[1],
                        format.external.value, format.type.value,
                        texture.data(level));
            }

            gl4.glBindTexture(GL_TEXTURE_2D, 0);
            gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4);

        } catch (IOException ex) {
            Logger.getLogger(Gl_500_multi_draw_indirect_arb.class.getName()).log(Level.SEVERE, null, ex);
        }
        return true;
    }

    private void validate(GL4 gl4) {

        int[] status = {0};
        gl4.glValidateProgramPipeline(pipelineName[0]);
        gl4.glGetProgramPipelineiv(pipelineName[0], GL_VALIDATE_STATUS, status, 0);

        if (status[0] != GL_TRUE) {

            int[] lengthMax = {0};
            gl4.glGetProgramPipelineiv(pipelineName[0], GL_INFO_LOG_LENGTH, lengthMax, 0);

            int[] lengthQuery = {0};
            byte[] infoLog = new byte[lengthMax[0] + 1];
            gl4.glGetProgramPipelineInfoLog(pipelineName[0], infoLog.length, lengthQuery, 0, infoLog, 0);

            gl4.glDebugMessageInsert(
                    GL_DEBUG_SOURCE_APPLICATION,
                    GL_DEBUG_TYPE_OTHER, 76,
                    GL_DEBUG_SEVERITY_LOW,
                    lengthQuery[0], new String(infoLog).trim());
        }
    }

    @Override
    protected boolean render(GL gl) {

        GL4 gl4 = (GL4) gl;

        float[] depth = {1.0f};
        gl4.glClearBufferfv(GL_DEPTH, 0, depth, 0);
        gl4.glClearBufferfv(GL_COLOR, 0, new float[]{1.0f, 1.0f, 1.0f, 1.0f}, 0);

        {
            gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName[Buffer.TRANSFORM]);
            ByteBuffer pointer = gl4.glMapBufferRange(GL_UNIFORM_BUFFER, 0, Mat4.SIZE * drawDataCount,
                    GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

            Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, windowSize.x / 3.0f / windowSize.y,
                    0.1f, 100.0f);
            Mat4 view = viewMat4();
            Mat4 model = new Mat4(1.0f);

            pointer.asFloatBuffer().put(projection.mul(view, new Mat4()).translate(0.0f, 0.0f, 0.5f).toFa_());
            pointer.position(Mat4.SIZE * 1);
            pointer.asFloatBuffer().put(projection.mul(view, new Mat4()).translate(0.0f, 0.0f, 0.0f).toFa_());
            pointer.position(Mat4.SIZE * 2);
            pointer.asFloatBuffer().put(projection.mul(view, new Mat4()).translate(0.0f, 0.0f, -0.5f).toFa_());
            pointer.rewind();

            gl4.glUnmapBuffer(GL_UNIFORM_BUFFER);
        }

        gl4.glActiveTexture(GL_TEXTURE0);
        gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.A]);
        gl4.glActiveTexture(GL_TEXTURE1);
        gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.B]);
        gl4.glActiveTexture(GL_TEXTURE2);
        gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.C]);

        gl4.glBindProgramPipeline(pipelineName[0]);
        gl4.glBindVertexArray(vertexArrayName[0]);
        gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName[Buffer.TRANSFORM]);
        gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.INDIRECTION, bufferName[Buffer.VERTEX_INDIRECTION]);

        gl4.glBindBuffer(GL_DRAW_INDIRECT_BUFFER, bufferName[Buffer.INDIRECT]);
        gl4.glBindBuffer(GL_PARAMETER_BUFFER_ARB, bufferName[Buffer.PARAMETER]);

        validate(gl4);

        for (int i = 0; i < drawDataCount; ++i) {

            gl4.glViewportIndexedfv(0, viewport[i].toFA_(), 0);
            gl4.glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_SHORT,
                    DrawElementsIndirectCommand.SIZE * drawOffset[i], // Offset in the indirect draw buffer
                    drawCount[i], // Offset in the paramter buffer
                    4, DrawElementsIndirectCommand.SIZE);
        }

        return true;
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';

import Navbar from './nav-bar';

const App = ({ children }) => (
  <div className="app-conainer">
    <Navbar />
    { children }
  </div>
);

App.propTypes = {
  children: PropTypes.node.isRequired,
};

export default App;


text:
//
//  AKTanhDistortionDSPKernel.hpp
//  AudioKit
//
//  Created by Aurelius Prochazka, revision history on Github.
//  Copyright (c) 2016 Aurelius Prochazka. All rights reserved.
//

#ifndef AKTanhDistortionDSPKernel_hpp
#define AKTanhDistortionDSPKernel_hpp

#import "AKDSPKernel.hpp"
#import "AKParameterRamper.hpp"

#import <AudioKit/AudioKit-Swift.h>

extern "C" {
#include "soundpipe.h"
}

enum {
    pregainAddress = 0,
    postgainAddress = 1,
    postiveShapeParameterAddress = 2,
    negativeShapeParameterAddress = 3
};

class AKTanhDistortionDSPKernel : public AKDSPKernel {
public:
    // MARK: Member Functions

    AKTanhDistortionDSPKernel() {}

    void init(int channelCount, double inSampleRate) {
        channels = channelCount;

        sampleRate = float(inSampleRate);

        sp_create(&sp);
        sp->sr = sampleRate;
        sp->nchan = channels;
        sp_dist_create(&dist);
        sp_dist_init(sp, dist);
        dist->pregain = 2.0;
        dist->postgain = 0.5;
        dist->shape1 = 0.0;
        dist->shape2 = 0.0;
    }

    void start() {
        started = true;
    }

    void stop() {
        started = false;
    }

    void destroy() {
        sp_dist_destroy(&dist);
        sp_destroy(&sp);
    }

    void reset() {
    }

    void setParameter(AUParameterAddress address, AUValue value) {
        switch (address) {
            case pregainAddress:
                pregainRamper.set(clamp(value, (float)0.0, (float)10.0));
                break;

            case postgainAddress:
                postgainRamper.set(clamp(value, (float)0.0, (float)10.0));
                break;

            case postiveShapeParameterAddress:
                postiveShapeParameterRamper.set(clamp(value, (float)-10.0, (float)10.0));
                break;

            case negativeShapeParameterAddress:
                negativeShapeParameterRamper.set(clamp(value, (float)-10.0, (float)10.0));
                break;

        }
    }

    AUValue getParameter(AUParameterAddress address) {
        switch (address) {
            case pregainAddress:
                return pregainRamper.goal();

            case postgainAddress:
                return postgainRamper.goal();

            case postiveShapeParameterAddress:
                return postiveShapeParameterRamper.goal();

            case negativeShapeParameterAddress:
                return negativeShapeParameterRamper.goal();

            default: return 0.0f;
        }
    }

    void startRamp(AUParameterAddress address, AUValue value, AUAudioFrameCount duration) override {
        switch (address) {
            case pregainAddress:
                pregainRamper.startRamp(clamp(value, (float)0.0, (float)10.0), duration);
                break;

            case postgainAddress:
                postgainRamper.startRamp(clamp(value, (float)0.0, (float)10.0), duration);
                break;

            case postiveShapeParameterAddress:
                postiveShapeParameterRamper.startRamp(clamp(value, (float)-10.0, (float)10.0), duration);
                break;

            case negativeShapeParameterAddress:
                negativeShapeParameterRamper.startRamp(clamp(value, (float)-10.0, (float)10.0), duration);
                break;

        }
    }

    void setBuffers(AudioBufferList *inBufferList, AudioBufferList *outBufferList) {
        inBufferListPtr = inBufferList;
        outBufferListPtr = outBufferList;
    }

    void process(AUAudioFrameCount frameCount, AUAudioFrameCount bufferOffset) override {
        // For each sample.
        for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
            double pregain = double(pregainRamper.getStep());
            double postgain = double(postgainRamper.getStep());
            double postiveShapeParameter = double(postiveShapeParameterRamper.getStep());
            double negativeShapeParameter = double(negativeShapeParameterRamper.getStep());

            int frameOffset = int(frameIndex + bufferOffset);

            dist->pregain = (float)pregain;
            dist->postgain = (float)postgain;
            dist->shape1 = (float)postiveShapeParameter;
            dist->shape2 = (float)negativeShapeParameter;

            if (!started) {
                outBufferListPtr->mBuffers[0] = inBufferListPtr->mBuffers[0];
                outBufferListPtr->mBuffers[1] = inBufferListPtr->mBuffers[1];
                return;
            }
            for (int channel = 0; channel < channels; ++channel) {
                float *in  = (float *)inBufferListPtr->mBuffers[channel].mData  + frameOffset;
                float *out = (float *)outBufferListPtr->mBuffers[channel].mData + frameOffset;

                sp_dist_compute(sp, dist, in, out);
            }
        }
    }

    // MARK: Member Variables

private:

    int channels = AKSettings.numberOfChannels;
    float sampleRate = AKSettings.sampleRate;

    AudioBufferList *inBufferListPtr = nullptr;
    AudioBufferList *outBufferListPtr = nullptr;

    sp_data *sp;
    sp_dist *dist;

public:
    bool started = true;
    AKParameterRamper pregainRamper = 2.0;
    AKParameterRamper postgainRamper = 0.5;
    AKParameterRamper postiveShapeParameterRamper = 0.0;
    AKParameterRamper negativeShapeParameterRamper = 0.0;
};

#endif /* AKTanhDistortionDSPKernel_hpp */


text:
/**
 * @module node-zk-treecache
 */
/**  */

import { State } from "node-zookeeper-client"
import {
  ConnectionState,
  isConnected as csIsConnected
} from "./ConnectionState"
import { CuratorFramework } from "./CuratorFramework"

export type ConnectionStateListener = (
  client: CuratorFramework,
  state: ConnectionState
) => void

export interface PartialZooKeeperClient {
  addListener(event: "state", cb: (state: State) => void): this

  getState(): State
}

/**
 * @private
 */
export class ConnectionStateManager {
  private numberOfConnectEvent: number = 0
  private listeners: ConnectionStateListener[] = []

  constructor(
    private zkClient: PartialZooKeeperClient,
    curator: CuratorFramework
  ) {
    zkClient.addListener("state", state => {
      if (
        state === State.SYNC_CONNECTED ||
        state === State.SASL_AUTHENTICATED
      ) {
        this.numberOfConnectEvent++
      }

      this.listeners.forEach(listener => {
        try {
          listener(curator, this.zkStateToCS(state))
        } catch (e) {
          // TODO Manage this error
        }
      })
    })
  }

  addConnectionStateListener(listener: ConnectionStateListener): void {
    this.listeners.push(listener)
  }

  removeConnectionStateListener(listener: ConnectionStateListener): void {
    const i = this.listeners.indexOf(listener)

    if (i > -1) {
      this.listeners.splice(i, 1)
    }
  }

  get connectionState(): ConnectionState {
    return this.zkStateToCS(this.zkClient.getState())
  }

  get isConnected(): boolean {
    return csIsConnected(this.connectionState)
  }

  private zkStateToCS(s: State | undefined) {
    switch (s) {
      case State.DISCONNECTED:
        return ConnectionState.SUSPENDED
      case State.SYNC_CONNECTED:
        return this.numberOfConnectEvent > 1
          ? ConnectionState.RECONNECTED
          : ConnectionState.CONNECTED
      case State.AUTH_FAILED:
        return ConnectionState.LOST
      case State.CONNECTED_READ_ONLY:
        return ConnectionState.READ_ONLY
      case State.SASL_AUTHENTICATED:
        return this.numberOfConnectEvent > 1
          ? ConnectionState.RECONNECTED
          : ConnectionState.CONNECTED
      case State.EXPIRED:
        return ConnectionState.LOST
      default:
        return ConnectionState.SUSPENDED
    }
  }
}


text:
package ch14typeinfo.pets;

public class Cat extends Pet {
	public Cat(String name) {
		super(name);
	}

	public Cat() {
		super();
	}
}


text:
using System;
using System.Collections.Generic;
using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;

namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
    internal abstract class PatternContext<TFrame> : IPatternContext
    {
        private Stack<TFrame> _stack = new Stack<TFrame>();
        protected TFrame Frame;

        public virtual void Declare(Action<IPathSegment, bool> declare) { }

        public abstract PatternTestResult Test(FileInfoBase file);

        public abstract bool Test(DirectoryInfoBase directory);

        public abstract void PushDirectory(DirectoryInfoBase directory);

        public virtual void PopDirectory()
        {
            Frame = _stack.Pop();
        }

        protected void PushDataFrame(TFrame frame)
        {
            _stack.Push(Frame);
            Frame = frame;
        }

        protected bool IsStackEmpty()
        {
            return _stack.Count == 0;
        }
    }
}


text:
package ezdb.comparator;

import java.nio.ByteBuffer;
import java.util.Comparator;

/**
 * A comparator that compares bytes using lexicographical ordering.
 *
 * @author criccomini
 *
 */
public class LexicographicalComparator implements Comparator<ByteBuffer> {
	public static final LexicographicalComparator get = new LexicographicalComparator();

	@Override
	public int compare(final ByteBuffer bytes1, final ByteBuffer bytes2) {
		return bytes1.compareTo(bytes2);
	}

}