text:
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
namespace DalSic
{
	/// <summary>
	/// Strongly-typed collection for the SysMunicipio class.
	/// </summary>
    [Serializable]
	public partial class SysMunicipioCollection : ActiveList<SysMunicipio, SysMunicipioCollection>
	{
		public SysMunicipioCollection() {}

        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>SysMunicipioCollection</returns>
		public SysMunicipioCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                SysMunicipio o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }

	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the Sys_Municipio table.
	/// </summary>
	[Serializable]
	public partial class SysMunicipio : ActiveRecord<SysMunicipio>, IActiveRecord
	{
		#region .ctors and Default Settings

		public SysMunicipio()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}

		private void InitSetDefaults() { SetDefaults(); }

		public SysMunicipio(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}

		public SysMunicipio(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}

		public SysMunicipio(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}

		protected static void SetSQLProps() { GetTableSchema(); }

		#endregion

		#region Schema and Query Accessor
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}

		private static void GetTableSchema()
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("Sys_Municipio", TableType.Table, DataService.GetInstance("sicProvider"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns

				TableSchema.TableColumn colvarIdMunicipio = new TableSchema.TableColumn(schema);
				colvarIdMunicipio.ColumnName = "idMunicipio";
				colvarIdMunicipio.DataType = DbType.Int32;
				colvarIdMunicipio.MaxLength = 0;
				colvarIdMunicipio.AutoIncrement = true;
				colvarIdMunicipio.IsNullable = false;
				colvarIdMunicipio.IsPrimaryKey = true;
				colvarIdMunicipio.IsForeignKey = false;
				colvarIdMunicipio.IsReadOnly = false;
				colvarIdMunicipio.DefaultSetting = @"";
				colvarIdMunicipio.ForeignKeyTableName = "";
				schema.Columns.Add(colvarIdMunicipio);

				TableSchema.TableColumn colvarNombre = new TableSchema.TableColumn(schema);
				colvarNombre.ColumnName = "nombre";
				colvarNombre.DataType = DbType.String;
				colvarNombre.MaxLength = 200;
				colvarNombre.AutoIncrement = false;
				colvarNombre.IsNullable = false;
				colvarNombre.IsPrimaryKey = false;
				colvarNombre.IsForeignKey = false;
				colvarNombre.IsReadOnly = false;

						colvarNombre.DefaultSetting = @"('')";
				colvarNombre.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNombre);

				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["sicProvider"].AddSchema("Sys_Municipio",schema);
			}
		}
		#endregion

		#region Props

		[XmlAttribute("IdMunicipio")]
		[Bindable(true)]
		public int IdMunicipio
		{
			get { return GetColumnValue<int>(Columns.IdMunicipio); }
			set { SetColumnValue(Columns.IdMunicipio, value); }
		}

		[XmlAttribute("Nombre")]
		[Bindable(true)]
		public string Nombre
		{
			get { return GetColumnValue<string>(Columns.Nombre); }
			set { SetColumnValue(Columns.Nombre, value); }
		}

		#endregion

		#region PrimaryKey Methods

        protected override void SetPrimaryKey(object oValue)
        {
            base.SetPrimaryKey(oValue);

            SetPKValues();
        }

		private DalSic.RemFormularioCollection colRemFormularioRecords;
		public DalSic.RemFormularioCollection RemFormularioRecords
		{
			get
			{
				if(colRemFormularioRecords == null)
				{
					colRemFormularioRecords = new DalSic.RemFormularioCollection().Where(RemFormulario.Columns.IdMunicipio, IdMunicipio).Load();
					colRemFormularioRecords.ListChanged += new ListChangedEventHandler(colRemFormularioRecords_ListChanged);
				}
				return colRemFormularioRecords;
			}
			set
			{
					colRemFormularioRecords = value;
					colRemFormularioRecords.ListChanged += new ListChangedEventHandler(colRemFormularioRecords_ListChanged);
			}
		}

		void colRemFormularioRecords_ListChanged(object sender, ListChangedEventArgs e)
		{
		    if (e.ListChangedType == ListChangedType.ItemAdded)
		    {
		        // Set foreign key value
		        colRemFormularioRecords[e.NewIndex].IdMunicipio = IdMunicipio;
		    }
		}

		#endregion

		//no foreign key tables defined (0)

		//no ManyToMany tables defined (0)

		#region ObjectDataSource support

		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(string varNombre)
		{
			SysMunicipio item = new SysMunicipio();

			item.Nombre = varNombre;

			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varIdMunicipio,string varNombre)
		{
			SysMunicipio item = new SysMunicipio();

				item.IdMunicipio = varIdMunicipio;

				item.Nombre = varNombre;

			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion

        #region Typed Columns

        public static TableSchema.TableColumn IdMunicipioColumn
        {
            get { return Schema.Columns[0]; }
        }

        public static TableSchema.TableColumn NombreColumn
        {
            get { return Schema.Columns[1]; }
        }

        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string IdMunicipio = @"idMunicipio";
			 public static string Nombre = @"nombre";

		}
		#endregion

		#region Update PK Collections

        public void SetPKValues()
        {
                if (colRemFormularioRecords != null)
                {
                    foreach (DalSic.RemFormulario item in colRemFormularioRecords)
                    {
                        if (item.IdMunicipio != IdMunicipio)
                        {
                            item.IdMunicipio = IdMunicipio;
                        }
                    }
               }
		}
        #endregion

        #region Deep Save

        public void DeepSave()
        {
            Save();

                if (colRemFormularioRecords != null)
                {
                    colRemFormularioRecords.SaveAll();
               }
		}
        #endregion
	}
}


text:
//
//  PnPWalletManagementConstants.h
//  PlugNPlay
//
//  Created by Raji Nair on 07/09/16.
//  Copyright © 2016 Citrus Payment Solutions, Pvt. Ltd. All rights reserved.
//

#ifndef PnPWalletManagementConstants_h
#define PnPWalletManagementConstants_h

#define CITRUS_CASH_TITLE @"PayuMoney Wallet"

#endif /* PnPWalletManagementConstants_h */

redpajama_set_name: RedPajamaGithub


text:
set -euo pipefail
#ORIGINAL_IFS=$IFS
IFS=$'\t\n' # Stricter IFS settings

# Deps
brew tap homebrew/versions
brew install qt5 libarchive
#brew install qt5 # qt5-qtwebengine qt5-sqlite-plugin libarchive

# Qt Creator
brew install Caskroom/cask/qt-creator
brew cask install qt-creator

# Create temp directory for the build
TEMP_DIR=$(mktemp -dt "$(basename $0).XXXXXX")
echo "Created temp directory $TEMP_DIR"
cd $TEMP_DIR

# Download zeal
git clone https://github.com/zealdocs/zeal.git
cd zeal

# Configure
# Add this to the pri file:
# Note that the versions in the paths must be correct.
cat << EOF >> src/libs/core/core.pri
macx: {
    INCLUDEPATH += /usr/local/Cellar/libarchive/3.2.2/include
    LIBS += -L/usr/local/Cellar/libarchive/3.2.2/lib -larchive
    INCLUDEPATH += /usr/local/Cellar/sqlite/3.15.2/include
    LIBS += -L/usr/local/Cellar/sqlite/3.15.2/lib -lsqlite3

}
EOF

# Build
# Not sure if INCLUDEPATH and LIBS really need to be set
/usr/local/opt/qt5/bin/qmake -makefile INCLUDEPATH+=/usr/local/opt/libarchive/include "LIBS+=-L/usr/local/opt/libarchive/lib -larchive"
make

# Install
# This is what the blog post said to do, but it broke the app
#/usr/local/opt/qt5/bin/macdeployqt Zeal.app
# This works though
cp -r bin/Zeal.app /Applications

# Remove temp directory
rm -rf $TEMP_DIR

cat <<EOF

Installation complete! You should see the Zeal app in your applications
directory. OSX will complain about the app being from an unidenfied developer,
so you need to tell it to allow Zeal.

For use on the command line add this to your .bashrc:

    alias zeal='/Applications/Zeal.app/Contents/MacOS/Zeal'

EOF


text:
var Guacamole = Guacamole || {};

/**
 * Guacamole protocol client. Given a {@link Guacamole.Tunnel},
 * automatically handles incoming and outgoing Guacamole instructions via the
 * provided tunnel, updating its display using one or more canvas elements.
 *
 * @constructor
 * @param {Guacamole.Tunnel} tunnel The tunnel to use to send and receive
 *                                  Guacamole instructions.
 */
Guacamole.Client = function(tunnel) {

    var guac_client = this;

    var STATE_IDLE          = 0;
    var STATE_CONNECTING    = 1;
    var STATE_WAITING       = 2;
    var STATE_CONNECTED     = 3;
    var STATE_DISCONNECTING = 4;
    var STATE_DISCONNECTED  = 5;

    var currentState = STATE_IDLE;

    var currentTimestamp = 0;
    var pingInterval = null;

    /**
     * Translation from Guacamole protocol line caps to Layer line caps.
     * @private
     */
    var lineCap = {
        0: "butt",
        1: "round",
        2: "square"
    };

    /**
     * Translation from Guacamole protocol line caps to Layer line caps.
     * @private
     */
    var lineJoin = {
        0: "bevel",
        1: "miter",
        2: "round"
    };

    /**
     * The underlying Guacamole display.
     */
    var display = new Guacamole.Display();

    /**
     * All available layers and buffers
     */
    var layers = {};

    // No initial parsers
    var parsers = [];

    // No initial audio channels
    var audio_channels = [];

    // No initial streams
    var streams = [];

    /**
     * All current objects. The index of each object is dictated by the
     * Guacamole server.
     *
     * @type Guacamole.Object[]
     */
    var objects = [];

    // Pool of available stream indices
    var stream_indices = new Guacamole.IntegerPool();

    // Array of allocated output streams by index
    var output_streams = [];

    function setState(state) {
        if (state != currentState) {
            currentState = state;
            if (guac_client.onstatechange)
                guac_client.onstatechange(currentState);
        }
    }

    function isConnected() {
        return currentState == STATE_CONNECTED
            || currentState == STATE_WAITING;
    }

    /**
     * Returns the underlying display of this Guacamole.Client. The display
     * contains an Element which can be added to the DOM, causing the
     * display to become visible.
     *
     * @return {Guacamole.Display} The underlying display of this
     *                             Guacamole.Client.
     */
    this.getDisplay = function() {
        return display;
    };

    /**
     * Sends the current size of the screen.
     *
     * @param {Number} width The width of the screen.
     * @param {Number} height The height of the screen.
     */
    this.sendSize = function(width, height) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        tunnel.sendMessage("size", width, height);

    };

    /**
     * Sends a key event having the given properties as if the user
     * pressed or released a key.
     *
     * @param {Boolean} pressed Whether the key is pressed (true) or released
     *                          (false).
     * @param {Number} keysym The keysym of the key being pressed or released.
     */
    this.sendKeyEvent = function(pressed, keysym) {
        // Do not send requests if not connected
        if (!isConnected())
            return;

        tunnel.sendMessage("key", keysym, pressed);
    };

    /**
     * Sends a mouse event having the properties provided by the given mouse
     * state.
     *
     * @param {Guacamole.Mouse.State} mouseState The state of the mouse to send
     *                                           in the mouse event.
     */
    this.sendMouseState = function(mouseState) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        // Update client-side cursor
        display.moveCursor(
            Math.floor(mouseState.x),
            Math.floor(mouseState.y)
        );

        // Build mask
        var buttonMask = 0;
        if (mouseState.left)   buttonMask |= 1;
        if (mouseState.middle) buttonMask |= 2;
        if (mouseState.right)  buttonMask |= 4;
        if (mouseState.up)     buttonMask |= 8;
        if (mouseState.down)   buttonMask |= 16;

        // Send message
        tunnel.sendMessage("mouse", Math.floor(mouseState.x), Math.floor(mouseState.y), buttonMask);
    };

    /**
     * Sets the clipboard of the remote client to the given text data.
     *
     * @deprecated Use createClipboardStream() instead.
     * @param {String} data The data to send as the clipboard contents.
     */
    this.setClipboard = function(data) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        // Open stream
        var stream = guac_client.createClipboardStream("text/plain");
        var writer = new Guacamole.StringWriter(stream);

        // Send text chunks
        for (var i=0; i<data.length; i += 4096)
            writer.sendText(data.substring(i, i+4096));

        // Close stream
        writer.sendEnd();

    };

    /**
     * Opens a new file for writing, having the given index, mimetype and
     * filename.
     *
     * @param {String} mimetype The mimetype of the file being sent.
     * @param {String} filename The filename of the file being sent.
     * @return {Guacamole.OutputStream} The created file stream.
     */
    this.createFileStream = function(mimetype, filename) {

        // Allocate index
        var index = stream_indices.next();

        // Create new stream
        tunnel.sendMessage("file", index, mimetype, filename);
        var stream = output_streams[index] = new Guacamole.OutputStream(guac_client, index);

        // Override sendEnd() of stream to automatically free index
        var old_end = stream.sendEnd;
        stream.sendEnd = function() {
            old_end();
            stream_indices.free(index);
            delete output_streams[index];
        };

        // Return new, overridden stream
        return stream;

    };

    /**
     * Opens a new pipe for writing, having the given name and mimetype.
     *
     * @param {String} mimetype The mimetype of the data being sent.
     * @param {String} name The name of the pipe.
     * @return {Guacamole.OutputStream} The created file stream.
     */
    this.createPipeStream = function(mimetype, name) {

        // Allocate index
        var index = stream_indices.next();

        // Create new stream
        tunnel.sendMessage("pipe", index, mimetype, name);
        var stream = output_streams[index] = new Guacamole.OutputStream(guac_client, index);

        // Override sendEnd() of stream to automatically free index
        var old_end = stream.sendEnd;
        stream.sendEnd = function() {
            old_end();
            stream_indices.free(index);
            delete output_streams[index];
        };

        // Return new, overridden stream
        return stream;

    };

    /**
     * Opens a new clipboard object for writing, having the given mimetype.
     *
     * @param {String} mimetype The mimetype of the data being sent.
     * @param {String} name The name of the pipe.
     * @return {Guacamole.OutputStream} The created file stream.
     */
    this.createClipboardStream = function(mimetype) {

        // Allocate index
        var index = stream_indices.next();

        // Create new stream
        tunnel.sendMessage("clipboard", index, mimetype);
        var stream = output_streams[index] = new Guacamole.OutputStream(guac_client, index);

        // Override sendEnd() of stream to automatically free index
        var old_end = stream.sendEnd;
        stream.sendEnd = function() {
            old_end();
            stream_indices.free(index);
            delete output_streams[index];
        };

        // Return new, overridden stream
        return stream;

    };

    /**
     * Creates a new output stream associated with the given object and having
     * the given mimetype and name. The legality of a mimetype and name is
     * dictated by the object itself.
     *
     * @param {Number} index
     *     The index of the object for which the output stream is being
     *     created.
     *
     * @param {String} mimetype
     *     The mimetype of the data which will be sent to the output stream.
     *
     * @param {String} name
     *     The defined name of an output stream within the given object.
     *
     * @returns {Guacamole.OutputStream}
     *     An output stream which will write blobs to the named output stream
     *     of the given object.
     */
    this.createObjectOutputStream = function createObjectOutputStream(index, mimetype, name) {

        // Allocate index
        var streamIndex = stream_indices.next();

        // Create new stream
        tunnel.sendMessage("put", index, streamIndex, mimetype, name);
        var stream = output_streams[streamIndex] = new Guacamole.OutputStream(guac_client, streamIndex);

        // Override sendEnd() of stream to automatically free index
        var oldEnd = stream.sendEnd;
        stream.sendEnd = function freeStreamIndex() {
            oldEnd();
            stream_indices.free(streamIndex);
            delete output_streams[streamIndex];
        };

        // Return new, overridden stream
        return stream;

    };

    /**
     * Requests read access to the input stream having the given name. If
     * successful, a new input stream will be created.
     *
     * @param {Number} index
     *     The index of the object from which the input stream is being
     *     requested.
     *
     * @param {String} name
     *     The name of the input stream to request.
     */
    this.requestObjectInputStream = function requestObjectInputStream(index, name) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        tunnel.sendMessage("get", index, name);
    };

    /**
     * Acknowledge receipt of a blob on the stream with the given index.
     *
     * @param {Number} index The index of the stream associated with the
     *                       received blob.
     * @param {String} message A human-readable message describing the error
     *                         or status.
     * @param {Number} code The error code, if any, or 0 for success.
     */
    this.sendAck = function(index, message, code) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        tunnel.sendMessage("ack", index, message, code);
    };

    /**
     * Given the index of a file, writes a blob of data to that file.
     *
     * @param {Number} index The index of the file to write to.
     * @param {String} data Base64-encoded data to write to the file.
     */
    this.sendBlob = function(index, data) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        tunnel.sendMessage("blob", index, data);
    };

    /**
     * Marks a currently-open stream as complete.
     *
     * @param {Number} index The index of the stream to end.
     */
    this.endStream = function(index) {

        // Do not send requests if not connected
        if (!isConnected())
            return;

        tunnel.sendMessage("end", index);
    };

    /**
     * Fired whenever the state of this Guacamole.Client changes.
     *
     * @event
     * @param {Number} state The new state of the client.
     */
    this.onstatechange = null;

    /**
     * Fired when the remote client sends a name update.
     *
     * @event
     * @param {String} name The new name of this client.
     */
    this.onname = null;

    /**
     * Fired when an error is reported by the remote client, and the connection
     * is being closed.
     *
     * @event
     * @param {Guacamole.Status} status A status object which describes the
     *                                  error.
     */
    this.onerror = null;

    /**
     * Fired when the clipboard of the remote client is changing.
     *
     * @event
     * @param {Guacamole.InputStream} stream The stream that will receive
     *                                       clipboard data from the server.
     * @param {String} mimetype The mimetype of the data which will be received.
     */
    this.onclipboard = null;

    /**
     * Fired when a file stream is created. The stream provided to this event
     * handler will contain its own event handlers for received data.
     *
     * @event
     * @param {Guacamole.InputStream} stream The stream that will receive data
     *                                       from the server.
     * @param {String} mimetype The mimetype of the file received.
     * @param {String} filename The name of the file received.
     */
    this.onfile = null;

    /**
     * Fired when a filesystem object is created. The object provided to this
     * event handler will contain its own event handlers and functions for
     * requesting and handling data.
     *
     * @event
     * @param {Guacamole.Object} object
     *     The created filesystem object.
     *
     * @param {String} name
     *     The name of the filesystem.
     */
    this.onfilesystem = null;

    /**
     * Fired when a pipe stream is created. The stream provided to this event
     * handler will contain its own event handlers for received data;
     *
     * @event
     * @param {Guacamole.InputStream} stream The stream that will receive data
     *                                       from the server.
     * @param {String} mimetype The mimetype of the data which will be received.
     * @param {String} name The name of the pipe.
     */
    this.onpipe = null;

    /**
     * Fired whenever a sync instruction is received from the server, indicating
     * that the server is finished processing any input from the client and
     * has sent any results.
     *
     * @event
     * @param {Number} timestamp The timestamp associated with the sync
     *                           instruction.
     */
    this.onsync = null;

    /**
     * Returns the layer with the given index, creating it if necessary.
     * Positive indices refer to visible layers, an index of zero refers to
     * the default layer, and negative indices refer to buffers.
     *
     * @param {Number} index The index of the layer to retrieve.
     * @return {Guacamole.Display.VisibleLayer|Guacamole.Layer} The layer having the given index.
     */
    function getLayer(index) {

        // Get layer, create if necessary
        var layer = layers[index];
        if (!layer) {

            // Create layer based on index
            if (index === 0)
                layer = display.getDefaultLayer();
            else if (index > 0)
                layer = display.createLayer();
            else
                layer = display.createBuffer();

            // Add new layer
            layers[index] = layer;

        }

        return layer;

    }

    function getParser(index) {

        var parser = parsers[index];

        // If parser not yet created, create it, and tie to the
        // oninstruction handler of the tunnel.
        if (parser == null) {
            parser = parsers[index] = new Guacamole.Parser();
            parser.oninstruction = tunnel.oninstruction;
        }

        return parser;

    }

    function getAudioChannel(index) {

        var audio_channel = audio_channels[index];

        // If audio channel not yet created, create it
        if (audio_channel == null)
            audio_channel = audio_channels[index] = new Guacamole.AudioChannel();

        return audio_channel;

    }

    /**
     * Handlers for all defined layer properties.
     * @private
     */
    var layerPropertyHandlers = {

        "miter-limit": function(layer, value) {
            display.setMiterLimit(layer, parseFloat(value));
        }

    };

    /**
     * Handlers for all instruction opcodes receivable by a Guacamole protocol
     * client.
     * @private
     */
    var instructionHandlers = {

        "ack": function(parameters) {

            var stream_index = parseInt(parameters[0]);
            var reason = parameters[1];
            var code = parseInt(parameters[2]);

            // Get stream
            var stream = output_streams[stream_index];
            if (stream) {

                // Signal ack if handler defined
                if (stream.onack)
                    stream.onack(new Guacamole.Status(code, reason));

                // If code is an error, invalidate stream
                if (code >= 0x0100) {
                    stream_indices.free(stream_index);
                    delete output_streams[stream_index];
                }

            }

        },

        "arc": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var x = parseInt(parameters[1]);
            var y = parseInt(parameters[2]);
            var radius = parseInt(parameters[3]);
            var startAngle = parseFloat(parameters[4]);
            var endAngle = parseFloat(parameters[5]);
            var negative = parseInt(parameters[6]);

            display.arc(layer, x, y, radius, startAngle, endAngle, negative != 0);

        },

        "audio": function(parameters) {

            var stream_index = parseInt(parameters[0]);
            var channel = getAudioChannel(parseInt(parameters[1]));
            var mimetype = parameters[2];
            var duration = parseFloat(parameters[3]);

            // Create stream
            var stream = streams[stream_index] =
                    new Guacamole.InputStream(guac_client, stream_index);

            // Assemble entire stream as a blob
            var blob_reader = new Guacamole.BlobReader(stream, mimetype);

            // Play blob as audio
            blob_reader.onend = function() {
                channel.play(mimetype, duration, blob_reader.getBlob());
            };

            // Send success response
            guac_client.sendAck(stream_index, "OK", 0x0000);

        },

        "blob": function(parameters) {

            // Get stream
            var stream_index = parseInt(parameters[0]);
            var data = parameters[1];
            var stream = streams[stream_index];

            // Write data
            stream.onblob(data);

        },

        "body" : function handleBody(parameters) {

            // Get object
            var objectIndex = parseInt(parameters[0]);
            var object = objects[objectIndex];

            var streamIndex = parseInt(parameters[1]);
            var mimetype = parameters[2];
            var name = parameters[3];

            // Create stream if handler defined
            if (object && object.onbody) {
                var stream = streams[streamIndex] = new Guacamole.InputStream(guac_client, streamIndex);
                object.onbody(stream, mimetype, name);
            }

            // Otherwise, unsupported
            else
                guac_client.sendAck(streamIndex, "Receipt of body unsupported", 0x0100);

        },

        "cfill": function(parameters) {

            var channelMask = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var r = parseInt(parameters[2]);
            var g = parseInt(parameters[3]);
            var b = parseInt(parameters[4]);
            var a = parseInt(parameters[5]);

            display.setChannelMask(layer, channelMask);
            display.fillColor(layer, r, g, b, a);

        },

        "clip": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));

            display.clip(layer);

        },

        "clipboard": function(parameters) {

            var stream_index = parseInt(parameters[0]);
            var mimetype = parameters[1];

            // Create stream
            if (guac_client.onclipboard) {
                var stream = streams[stream_index] = new Guacamole.InputStream(guac_client, stream_index);
                guac_client.onclipboard(stream, mimetype);
            }

            // Otherwise, unsupported
            else
                guac_client.sendAck(stream_index, "Clipboard unsupported", 0x0100);

        },

        "close": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));

            display.close(layer);

        },

        "copy": function(parameters) {

            var srcL = getLayer(parseInt(parameters[0]));
            var srcX = parseInt(parameters[1]);
            var srcY = parseInt(parameters[2]);
            var srcWidth = parseInt(parameters[3]);
            var srcHeight = parseInt(parameters[4]);
            var channelMask = parseInt(parameters[5]);
            var dstL = getLayer(parseInt(parameters[6]));
            var dstX = parseInt(parameters[7]);
            var dstY = parseInt(parameters[8]);

            display.setChannelMask(dstL, channelMask);
            display.copy(srcL, srcX, srcY, srcWidth, srcHeight,
                         dstL, dstX, dstY);

        },

        "cstroke": function(parameters) {

            var channelMask = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var cap = lineCap[parseInt(parameters[2])];
            var join = lineJoin[parseInt(parameters[3])];
            var thickness = parseInt(parameters[4]);
            var r = parseInt(parameters[5]);
            var g = parseInt(parameters[6]);
            var b = parseInt(parameters[7]);
            var a = parseInt(parameters[8]);

            display.setChannelMask(layer, channelMask);
            display.strokeColor(layer, cap, join, thickness, r, g, b, a);

        },

        "cursor": function(parameters) {

            var cursorHotspotX = parseInt(parameters[0]);
            var cursorHotspotY = parseInt(parameters[1]);
            var srcL = getLayer(parseInt(parameters[2]));
            var srcX = parseInt(parameters[3]);
            var srcY = parseInt(parameters[4]);
            var srcWidth = parseInt(parameters[5]);
            var srcHeight = parseInt(parameters[6]);

            display.setCursor(cursorHotspotX, cursorHotspotY,
                              srcL, srcX, srcY, srcWidth, srcHeight);

        },

        "curve": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var cp1x = parseInt(parameters[1]);
            var cp1y = parseInt(parameters[2]);
            var cp2x = parseInt(parameters[3]);
            var cp2y = parseInt(parameters[4]);
            var x = parseInt(parameters[5]);
            var y = parseInt(parameters[6]);

            display.curveTo(layer, cp1x, cp1y, cp2x, cp2y, x, y);

        },

        "dispose": function(parameters) {

            var layer_index = parseInt(parameters[0]);

            // If visible layer, remove from parent
            if (layer_index > 0) {

                // Remove from parent
                var layer = getLayer(layer_index);
                layer.dispose();

                // Delete reference
                delete layers[layer_index];

            }

            // If buffer, just delete reference
            else if (layer_index < 0)
                delete layers[layer_index];

            // Attempting to dispose the root layer currently has no effect.

        },

        "distort": function(parameters) {

            var layer_index = parseInt(parameters[0]);
            var a = parseFloat(parameters[1]);
            var b = parseFloat(parameters[2]);
            var c = parseFloat(parameters[3]);
            var d = parseFloat(parameters[4]);
            var e = parseFloat(parameters[5]);
            var f = parseFloat(parameters[6]);

            // Only valid for visible layers (not buffers)
            if (layer_index >= 0) {
                var layer = getLayer(layer_index);
                layer.distort(a, b, c, d, e, f);
            }

        },

        "error": function(parameters) {

            var reason = parameters[0];
            var code = parseInt(parameters[1]);

            // Call handler if defined
            if (guac_client.onerror)
                guac_client.onerror(new Guacamole.Status(code, reason));

            guac_client.disconnect();

        },

        "end": function(parameters) {

            // Get stream
            var stream_index = parseInt(parameters[0]);
            var stream = streams[stream_index];

            // Signal end of stream
            if (stream.onend)
                stream.onend();

        },

        "file": function(parameters) {

            var stream_index = parseInt(parameters[0]);
            var mimetype = parameters[1];
            var filename = parameters[2];

            // Create stream
            if (guac_client.onfile) {
                var stream = streams[stream_index] = new Guacamole.InputStream(guac_client, stream_index);
                guac_client.onfile(stream, mimetype, filename);
            }

            // Otherwise, unsupported
            else
                guac_client.sendAck(stream_index, "File transfer unsupported", 0x0100);

        },

        "filesystem" : function handleFilesystem(parameters) {

            var objectIndex = parseInt(parameters[0]);
            var name = parameters[1];

            // Create object, if supported
            if (guac_client.onfilesystem) {
                var object = objects[objectIndex] = new Guacamole.Object(guac_client, objectIndex);
                guac_client.onfilesystem(object, name);
            }

            // If unsupported, simply ignore the availability of the filesystem

        },

        "identity": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));

            display.setTransform(layer, 1, 0, 0, 1, 0, 0);

        },

        "jpeg": function(parameters) {

            var channelMask = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var x = parseInt(parameters[2]);
            var y = parseInt(parameters[3]);
            var data = parameters[4];

            display.setChannelMask(layer, channelMask);
            display.draw(layer, x, y, "data:image/jpeg;base64," + data);

        },

        "lfill": function(parameters) {

            var channelMask = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var srcLayer = getLayer(parseInt(parameters[2]));

            display.setChannelMask(layer, channelMask);
            display.fillLayer(layer, srcLayer);

        },

        "line": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var x = parseInt(parameters[1]);
            var y = parseInt(parameters[2]);

            display.lineTo(layer, x, y);

        },

        "lstroke": function(parameters) {

            var channelMask = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var srcLayer = getLayer(parseInt(parameters[2]));

            display.setChannelMask(layer, channelMask);
            display.strokeLayer(layer, srcLayer);

        },

        "move": function(parameters) {

            var layer_index = parseInt(parameters[0]);
            var parent_index = parseInt(parameters[1]);
            var x = parseInt(parameters[2]);
            var y = parseInt(parameters[3]);
            var z = parseInt(parameters[4]);

            // Only valid for non-default layers
            if (layer_index > 0 && parent_index >= 0) {
                var layer = getLayer(layer_index);
                var parent = getLayer(parent_index);
                layer.move(parent, x, y, z);
            }

        },

        "name": function(parameters) {
            if (guac_client.onname) guac_client.onname(parameters[0]);
        },

        "nest": function(parameters) {
            var parser = getParser(parseInt(parameters[0]));
            parser.receive(parameters[1]);
        },

        "pipe": function(parameters) {

            var stream_index = parseInt(parameters[0]);
            var mimetype = parameters[1];
            var name = parameters[2];

            // Create stream
            if (guac_client.onpipe) {
                var stream = streams[stream_index] = new Guacamole.InputStream(guac_client, stream_index);
                guac_client.onpipe(stream, mimetype, name);
            }

            // Otherwise, unsupported
            else
                guac_client.sendAck(stream_index, "Named pipes unsupported", 0x0100);

        },

        "png": function(parameters) {

            var channelMask = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var x = parseInt(parameters[2]);
            var y = parseInt(parameters[3]);
            var data = parameters[4];

            display.setChannelMask(layer, channelMask);
            display.draw(layer, x, y, "data:image/png;base64," + data);

        },

        "pop": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));

            display.pop(layer);

        },

        "push": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));

            display.push(layer);

        },

        "rect": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var x = parseInt(parameters[1]);
            var y = parseInt(parameters[2]);
            var w = parseInt(parameters[3]);
            var h = parseInt(parameters[4]);

            display.rect(layer, x, y, w, h);

        },

        "reset": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));

            display.reset(layer);

        },

        "set": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var name = parameters[1];
            var value = parameters[2];

            // Call property handler if defined
            var handler = layerPropertyHandlers[name];
            if (handler)
                handler(layer, value);

        },

        "shade": function(parameters) {

            var layer_index = parseInt(parameters[0]);
            var a = parseInt(parameters[1]);

            // Only valid for visible layers (not buffers)
            if (layer_index >= 0) {
                var layer = getLayer(layer_index);
                layer.shade(a);
            }

        },

        "size": function(parameters) {

            var layer_index = parseInt(parameters[0]);
            var layer = getLayer(layer_index);
            var width = parseInt(parameters[1]);
            var height = parseInt(parameters[2]);

            display.resize(layer, width, height);

        },

        "start": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var x = parseInt(parameters[1]);
            var y = parseInt(parameters[2]);

            display.moveTo(layer, x, y);

        },

        "sync": function(parameters) {

            var timestamp = parseInt(parameters[0]);

            // Flush display, send sync when done
            display.flush(function __send_sync_response() {
                if (timestamp !== currentTimestamp) {
                    tunnel.sendMessage("sync", timestamp);
                    currentTimestamp = timestamp;
                }
            });

            // If received first update, no longer waiting.
            if (currentState === STATE_WAITING)
                setState(STATE_CONNECTED);

            // Call sync handler if defined
            if (guac_client.onsync)
                guac_client.onsync(timestamp);

        },

        "transfer": function(parameters) {

            var srcL = getLayer(parseInt(parameters[0]));
            var srcX = parseInt(parameters[1]);
            var srcY = parseInt(parameters[2]);
            var srcWidth = parseInt(parameters[3]);
            var srcHeight = parseInt(parameters[4]);
            var function_index = parseInt(parameters[5]);
            var dstL = getLayer(parseInt(parameters[6]));
            var dstX = parseInt(parameters[7]);
            var dstY = parseInt(parameters[8]);

            /* SRC */
            if (function_index === 0x3)
                display.put(srcL, srcX, srcY, srcWidth, srcHeight,
                    dstL, dstX, dstY);

            /* Anything else that isn't a NO-OP */
            else if (function_index !== 0x5)
                display.transfer(srcL, srcX, srcY, srcWidth, srcHeight,
                    dstL, dstX, dstY, Guacamole.Client.DefaultTransferFunction[function_index]);

        },

        "transform": function(parameters) {

            var layer = getLayer(parseInt(parameters[0]));
            var a = parseFloat(parameters[1]);
            var b = parseFloat(parameters[2]);
            var c = parseFloat(parameters[3]);
            var d = parseFloat(parameters[4]);
            var e = parseFloat(parameters[5]);
            var f = parseFloat(parameters[6]);

            display.transform(layer, a, b, c, d, e, f);

        },

        "undefine" : function handleUndefine(parameters) {

            // Get object
            var objectIndex = parseInt(parameters[0]);
            var object = objects[objectIndex];

            // Signal end of object definition
            if (object && object.onundefine)
                object.onundefine();

        },

        "video": function(parameters) {

            var stream_index = parseInt(parameters[0]);
            var layer = getLayer(parseInt(parameters[1]));
            var mimetype = parameters[2];
            var duration = parseFloat(parameters[3]);

            // Create stream
            var stream = streams[stream_index] =
                    new Guacamole.InputStream(guac_client, stream_index);

            // Assemble entire stream as a blob
            var blob_reader = new Guacamole.BlobReader(stream, mimetype);

            // Play video once finished
            blob_reader.onend = function() {

                // Read data from blob from stream
                var reader = new FileReader();
                reader.onload = function() {

                    var binary = "";
                    var bytes = new Uint8Array(reader.result);

                    // Produce binary string from bytes in buffer
                    for (var i=0; i<bytes.byteLength; i++)
                        binary += String.fromCharCode(bytes[i]);

                    // Play video
                    layer.play(mimetype, duration, "data:" + mimetype + ";base64," + window.btoa(binary));

                };
                reader.readAsArrayBuffer(blob_reader.getBlob());

            };

            // Send success response
            tunnel.sendMessage("ack", stream_index, "OK", 0x0000);

        }

    };

    tunnel.oninstruction = function(opcode, parameters) {

        var handler = instructionHandlers[opcode];
        if (handler)
            handler(parameters);

    };

    /**
     * Sends a disconnect instruction to the server and closes the tunnel.
     */
    this.disconnect = function() {

        // Only attempt disconnection not disconnected.
        if (currentState != STATE_DISCONNECTED
                && currentState != STATE_DISCONNECTING) {

            setState(STATE_DISCONNECTING);

            // Stop ping
            if (pingInterval)
                window.clearInterval(pingInterval);

            // Send disconnect message and disconnect
            tunnel.sendMessage("disconnect");
            tunnel.disconnect();
            setState(STATE_DISCONNECTED);

        }

    };

    /**
     * Connects the underlying tunnel of this Guacamole.Client, passing the
     * given arbitrary data to the tunnel during the connection process.
     *
     * @param data Arbitrary connection data to be sent to the underlying
     *             tunnel during the connection process.
     * @throws {Guacamole.Status} If an error occurs during connection.
     */
    this.connect = function(data) {

        setState(STATE_CONNECTING);

        try {
            tunnel.connect(data);
        }
        catch (status) {
            setState(STATE_IDLE);
            throw status;
        }

        // Ping every 5 seconds (ensure connection alive)
        pingInterval = window.setInterval(function() {
            tunnel.sendMessage("sync", currentTimestamp);
        }, 5000);

        setState(STATE_WAITING);
    };

};

/**
 * Map of all Guacamole binary raster operations to transfer functions.
 * @private
 */
Guacamole.Client.DefaultTransferFunction = {

    /* BLACK */
    0x0: function (src, dst) {
        dst.red = dst.green = dst.blue = 0x00;
    },

    /* WHITE */
    0xF: function (src, dst) {
        dst.red = dst.green = dst.blue = 0xFF;
    },

    /* SRC */
    0x3: function (src, dst) {
        dst.red   = src.red;
        dst.green = src.green;
        dst.blue  = src.blue;
        dst.alpha = src.alpha;
    },

    /* DEST (no-op) */
    0x5: function (src, dst) {
        // Do nothing
    },

    /* Invert SRC */
    0xC: function (src, dst) {
        dst.red   = 0xFF & ~src.red;
        dst.green = 0xFF & ~src.green;
        dst.blue  = 0xFF & ~src.blue;
        dst.alpha =  src.alpha;
    },

    /* Invert DEST */
    0xA: function (src, dst) {
        dst.red   = 0xFF & ~dst.red;
        dst.green = 0xFF & ~dst.green;
        dst.blue  = 0xFF & ~dst.blue;
    },

    /* AND */
    0x1: function (src, dst) {
        dst.red   =  ( src.red   &  dst.red);
        dst.green =  ( src.green &  dst.green);
        dst.blue  =  ( src.blue  &  dst.blue);
    },

    /* NAND */
    0xE: function (src, dst) {
        dst.red   = 0xFF & ~( src.red   &  dst.red);
        dst.green = 0xFF & ~( src.green &  dst.green);
        dst.blue  = 0xFF & ~( src.blue  &  dst.blue);
    },

    /* OR */
    0x7: function (src, dst) {
        dst.red   =  ( src.red   |  dst.red);
        dst.green =  ( src.green |  dst.green);
        dst.blue  =  ( src.blue  |  dst.blue);
    },

    /* NOR */
    0x8: function (src, dst) {
        dst.red   = 0xFF & ~( src.red   |  dst.red);
        dst.green = 0xFF & ~( src.green |  dst.green);
        dst.blue  = 0xFF & ~( src.blue  |  dst.blue);
    },

    /* XOR */
    0x6: function (src, dst) {
        dst.red   =  ( src.red   ^  dst.red);
        dst.green =  ( src.green ^  dst.green);
        dst.blue  =  ( src.blue  ^  dst.blue);
    },

    /* XNOR */
    0x9: function (src, dst) {
        dst.red   = 0xFF & ~( src.red   ^  dst.red);
        dst.green = 0xFF & ~( src.green ^  dst.green);
        dst.blue  = 0xFF & ~( src.blue  ^  dst.blue);
    },

    /* AND inverted source */
    0x4: function (src, dst) {
        dst.red   =  0xFF & (~src.red   &  dst.red);
        dst.green =  0xFF & (~src.green &  dst.green);
        dst.blue  =  0xFF & (~src.blue  &  dst.blue);
    },

    /* OR inverted source */
    0xD: function (src, dst) {
        dst.red   =  0xFF & (~src.red   |  dst.red);
        dst.green =  0xFF & (~src.green |  dst.green);
        dst.blue  =  0xFF & (~src.blue  |  dst.blue);
    },

    /* AND inverted destination */
    0x2: function (src, dst) {
        dst.red   =  0xFF & ( src.red   & ~dst.red);
        dst.green =  0xFF & ( src.green & ~dst.green);
        dst.blue  =  0xFF & ( src.blue  & ~dst.blue);
    },

    /* OR inverted destination */
    0xB: function (src, dst) {
        dst.red   =  0xFF & ( src.red   | ~dst.red);
        dst.green =  0xFF & ( src.green | ~dst.green);
        dst.blue  =  0xFF & ( src.blue  | ~dst.blue);
    }

};


text:
from syn.five import xrange
from syn.types.a import Type, Set, FrozenSet, \
    hashable, serialize, deserialize, estr, rstr, visit, find_ne, \
    SetDifferences, deep_feq, safe_sorted, primitive_form, collect
from syn.types.a import enumerate as enumerate_
from syn.base_utils import is_hashable, assert_equivalent, on_error, elog, \
    ngzwarn, is_unique, subclasses, hangwatch

from syn.globals import TEST_SAMPLES as SAMPLES
SAMPLES //= 10
SAMPLES = max(SAMPLES, 1)
ngzwarn(SAMPLES, 'SAMPLES')

#-------------------------------------------------------------------------------

def examine_set(cls, val):
    assert type(val) is cls.type
    assert is_hashable(hashable(val))
    sval = deserialize(serialize(val))
    assert deep_feq(sval, val)
    assert deserialize(serialize(cls.type)) is cls.type
    assert isinstance(rstr(val), str)

    assert list(visit(val)) == safe_sorted(list(val))
    assert find_ne(val, val) is None

    # NOTE: estr has been relegated to experimental status for now
    # eitem = eval(estr(val))
    # assert deep_feq(eitem, val)
    # assert type(eitem) is cls.type

#-------------------------------------------------------------------------------
# Set

def test_set():
    s = frozenset([1, 2.3, 'abc'])
    t = Type.dispatch(s)
    assert isinstance(t, Set)
    assert type(t) is FrozenSet

    assert hashable(s) == t.hashable() == s
    assert is_hashable(s)
    assert is_hashable(hashable(s))

    s1 = {1, 2, 3}
    s2 = {2, 3, 4}
    assert find_ne(s1, s2) == SetDifferences(s1, s2)

    e1 = eval(estr(s1))
    assert_equivalent(e1, s1)

    examine_set(Set, set(s))
    examine_set(FrozenSet, s)

    for cls in subclasses(Set, [Set]):
        for k in xrange(SAMPLES):
            val = cls.generate()
            with on_error(elog, examine_set, (cls, val)):
                hangwatch(1, examine_set, cls, val)

        buf = []
        last = None
        for item in enumerate_(cls.type, max_enum=SAMPLES * 10, step=100):
            assert type(item) is cls.type
            assert item != last
            buf.append(item)
            last = item

        assert is_unique(buf)

    s = {1, 2, (3, 4)}
    assert primitive_form(s) == [1, 2, [3, 4]]
    assert collect(s) == primitive_form(s)

#-------------------------------------------------------------------------------

if __name__ == '__main__': # pragma: no cover
    from syn.base_utils import run_all_tests
    run_all_tests(globals(), verbose=True, print_errors=False)


text:
"""
This script will build up the first movement of Mozart's C major Sonata (K545)
while trying out experimental features of Sebastian.
"""
from pprint import pprint
from sebastian.core import Point, HSeq, VSeq, OSequence, DURATION_64, DEGREE
from sebastian.core.transforms import midi_pitch, degree_in_key_with_octave, add, transform_sequence
from sebastian.core.notes import Key, major_scale
from sebastian.midi import write_midi

def transpose_degree(point, degree_delta):
    result = Point(point)
    result[DEGREE] = result[DEGREE] + degree_delta
    return result

@transform_sequence
def chord(point):
    children = [transpose_degree(point, i) for i in point.get('chord', (0, 2, 4))]
    point["sequence"] = VSeq(children)
    return point

@transform_sequence
def arpeggio(pattern, point):
    """
    turns each subsequence into an arpeggio matching the given ``pattern``.
    """
    point['sequence'] = HSeq(point['sequence'][i] for i in pattern)
    return point

@transform_sequence
def fill(duration, point):
    """
    fills the subsequence of the point with repetitions of its subsequence and
    sets the ``duration`` of each point.
    """
    point['sequence'] = point['sequence'] * (point[DURATION_64] / (8 * duration)) | add({DURATION_64: duration})
    return point

def expand(sequence):
    """
    expands a tree of sequences into a single, flat sequence, recursively.
    """
    expanse = []
    for point in sequence:
        if 'sequence' in point:
            expanse.extend(expand(point['sequence']))
        else:
            expanse.append(point)
    return sequence.__class__(expanse)

def debug(sequence):
    """
    adds information to the sequence for better debugging, currently only
    an index property on each point in the sequence.
    """
    points = []
    for i, p in enumerate(sequence):
        copy = Point(p)
        copy['index'] = i
        points.append(copy)
    return sequence.__class__(points)

def build_movement():
    # Define our alberti bass signature.
    alberti = arpeggio([0, 2, 1, 2])

    # Create the basic interval pattern.
    intervals = HSeq({DEGREE: x} for x in [1, 5, 1, 4, 1, 5, 1])

    # Create the rhythm
    rhythm = HSeq({DURATION_64: x} for x in [128, 64, 64, 64, 64, 64, 64])

    # Set specific chords to be used in certain measures.
    intervals[1]["chord"] = (-3, -1, 0, 2)  # second inversion 7th
    intervals[3]["chord"] = (-3, 0, 2)      # second inversion
    intervals[5]["chord"] = (-5, -3, 0)     # first inversion

    # Combine the sequences, make them chords, produce alberti on the chords,
    # fill with each being 8, expand it to a flat sequence.
    melody = intervals & rhythm | chord() | alberti | fill(8) | expand

    # Define our key
    C_major = Key("C", major_scale)

    #key(major_scale(-2))

    # Set the degree, add the midi pitch, make it an OSequence, add debugging information.
    return melody | degree_in_key_with_octave(C_major, 5) | midi_pitch() | OSequence | debug

if __name__ == "__main__":
    movement = build_movement()
    for point in movement:
        pprint(point)
    write_midi.write("first_movement.mid", [movement])


text:
package gcbatch.svc.reverseproxy;

import gcbatch.base.data.model.AbstractModel;
import gcbatch.base.exception.BusinessException;
import gcbatch.utils.MapUtil;
import gcbatch.utils.StringUtil;

import java.util.List;
import java.util.Map;
import java.util.Vector;

public class RouteRule extends AbstractModel {
    private RouteRule(String name, String sourceHost, String sourceUrl, String targetHost, int targetPort, boolean doUrlReplace, String replaceUrlStr) {
        this.name = name;
        this.sourceHost = sourceHost;
        this.sourceUrl = sourceUrl;

        this.targetHost = targetHost;
        this.targetPort = targetPort;
        this.doUrlReplace = doUrlReplace;
        this.replaceUrlStr = replaceUrlStr;
    }

    // not null
    private String name;
    private String sourceHost;
    private String sourceUrl;

    private String targetHost;
    private int targetPort;
    private boolean doUrlReplace;
    private String replaceUrlStr;

    public static Vector<RouteRule> getRouteRules(List<Map> mapList) throws BusinessException {
        Vector<RouteRule> rules = new Vector<>();
        //noinspection unchecked
        for(Map<String, Object> map : mapList) {
            rules.add(new RouteRule(
                    MapUtil.getStr(map,"name"),
                    MapUtil.getStrOr(map,"sourceHost", ""),
                    MapUtil.getStrOr(map, "sourceUrl", ""),
                    MapUtil.getStr(map,"targetHost"),
                    MapUtil.getInt(map, "targetPort"),
                    MapUtil.getBoolean(map, "doUrlReplace"),
                    MapUtil.getStrOr(map, "replaceUrlStr", "")
                ));
        }

        rules.sort((o1, o2) -> {
            if (o1.sourceHost.length() == o2.sourceHost.length()) {
                if (o1.sourceUrl.length() > o2.sourceUrl.length()) return 1;
                else return -1;
            }
            if (o1.sourceHost.length() > o2.sourceHost.length()) return 1;
            return -1;
        });

        return rules;
    }

    public static RouteRule chooseRoute(Vector<RouteRule> routeRuleVector, String sourceHost, String sourceUrl) {
        for(RouteRule rule : routeRuleVector) {
            if(rule.sourceHost.length() == 0) {
                if("".equals(rule.sourceUrl)) return rule;
                if(sourceUrl.startsWith(rule.sourceUrl)) return rule;
            }

            if(rule.sourceHost.equals(sourceHost) || sourceHost.startsWith(rule.sourceHost)) {
                if("".equals(rule.sourceUrl)) return rule;
                if(sourceUrl.startsWith(rule.sourceUrl)) return rule;
            }
        }

        return null;
    }

    public String getTargetUrl(String url) {
        if(doUrlReplace) {
            if(url.length() < sourceUrl.length()) {
                return url;
            }

            if(!StringUtil.isEmpty(replaceUrlStr)) {
                return this.replaceUrlStr + url.substring(this.sourceUrl.length());
            } else {
                return url.substring(this.sourceUrl.length());
            }
        }
        return url;
    }

    public String getName() {
        return name;
    }
    public String getSourceHost() {
        return sourceHost;
    }

    public String getTargetHost() {
        return targetHost;
    }

    public int getTargetPort() {
        return targetPort;
    }

}


text:
npm package for access to the labkomp.org API.

install this package:
```sh
npm install labkomp
```

### Docs
The docs are available here: [https://docs@labkomp.org](https://docs@labkomp.org)


text:
drop table if exists urls;
create table urls (
  short string primary key,
  custom string,
  notes string,
  dest string not null,
  createdby string not null,
  createdon string not null
);
drop table if exists hits;
create table hits (
  short string,
  hitdate string,
  hits4 integer default 0,
  hits6 integer default 0
);
drop table if exists users;
create table users (
  username string,
  password string,
  registered_on string,
  last_login string,
  logins integer default 0
);


text:
package com.arjuna.dbplugins.interconnect.serializableobject;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.arjuna.databroker.data.DataFlowNode;
import com.arjuna.databroker.data.DataFlowNodeFactory;
import com.arjuna.databroker.data.DataSink;
import com.arjuna.databroker.data.DataSource;
import com.arjuna.databroker.data.InvalidClassException;
import com.arjuna.databroker.data.InvalidMetaPropertyException;
import com.arjuna.databroker.data.InvalidNameException;
import com.arjuna.databroker.data.InvalidPropertyException;
import com.arjuna.databroker.data.MissingMetaPropertyException;
import com.arjuna.databroker.data.MissingPropertyException;
import com.arjuna.dbplugins.interconnect.serializableobject.dataflownodes.SerializableObjectAcceptorDataSource;
import com.arjuna.dbplugins.interconnect.serializableobject.dataflownodes.SerializableObjectProviderDataSink;
import com.arjuna.dbplugins.interconnect.serializableobject.dataflownodes.SerializableObjectPullDataSource;
import com.arjuna.dbplugins.interconnect.serializableobject.dataflownodes.SerializableObjectPushDataSink;

public class SerializableObjectInterconnectDataFlowNodeFactory implements DataFlowNodeFactory
{
    public SerializableObjectInterconnectDataFlowNodeFactory(String name, Map<String, String> properties)
    {
        _name       = name;
        _properties = properties;
    }

    @Override
    public String getName()
    {
        return _name;
    }

    @Override
    public Map<String, String> getProperties()
    {
        return _properties;
    }

    @Override
    public List<Class<? extends DataFlowNode>> getClasses()
    {
        List<Class<? extends DataFlowNode>> classes = new LinkedList<Class<? extends DataFlowNode>>();

        classes.add(DataSource.class);
        classes.add(DataSink.class);

        return classes;
    }

    @Override
    public <T extends DataFlowNode> List<String> getMetaPropertyNames(Class<T> dataFlowNodeClass)
        throws InvalidClassException
    {
        if (dataFlowNodeClass.equals(DataSource.class) || dataFlowNodeClass.equals(DataSink.class))
        {
            List<String> metaPropertyNames = new LinkedList<String>();

            metaPropertyNames.add("Type");

            return metaPropertyNames;
        }
        else
            throw new InvalidClassException("Unsupported class", dataFlowNodeClass.getName());
    }

    @Override
    public <T extends DataFlowNode> List<String> getPropertyNames(Class<T> dataFlowNodeClass, Map<String, String> metaProperties)
        throws InvalidClassException, InvalidMetaPropertyException, MissingMetaPropertyException
    {
        if (dataFlowNodeClass.equals(DataSource.class))
        {
            if ((metaProperties.size() == 1) && metaProperties.containsKey("Type"))
            {
                List<String> propertyNames = new LinkedList<String>();

                String type = metaProperties.get("Type");
                if (type.equals("Pull"))
                {
                    propertyNames.add(SerializableObjectPullDataSource.SERVICEROOTURL_PROPERTYNAME);
                    propertyNames.add(SerializableObjectPullDataSource.ENDPOINTPATH_PROPERTYNAME);
                    propertyNames.add(SerializableObjectPullDataSource.SCHEDULEDELAY_PROPERTYNAME);
                    propertyNames.add(SerializableObjectPullDataSource.SCHEDULEPERIOD_PROPERTYNAME);
                }
                else if (type.equals("Acceptor"))
                {
                    propertyNames.add(SerializableObjectAcceptorDataSource.ENDPOINTPATH_PROPERTYNAME);
                }
                else
                    throw new InvalidMetaPropertyException("Expecting value of 'Type' meta property 'Pull' or 'Acceptor'", "Type", type);

                return propertyNames;
            }
            else
                throw new MissingMetaPropertyException("No metaproperties expected", "Type");
        }
        else if (dataFlowNodeClass.equals(DataSink.class))
        {
            if ((metaProperties.size() == 1) && metaProperties.containsKey("Type"))
            {
                List<String> propertyNames = new LinkedList<String>();

                String type = metaProperties.get("Type");
                if (type.equals("Push"))
                {
                    propertyNames.add(SerializableObjectPushDataSink.SERVICEROOTURL_PROPERTYNAME);
                    propertyNames.add(SerializableObjectPushDataSink.ENDPOINTPATH_PROPERTYNAME);
                }
                else if (type.equals("Provider"))
                    propertyNames.add(SerializableObjectProviderDataSink.ENDPOINTPATH_PROPERTYNAME);
                else
                    throw new InvalidMetaPropertyException("Expecting value of 'Type' meta property 'Push' or 'Provider'", "Type", type);

                return propertyNames;
            }
            else
                throw new MissingMetaPropertyException("No metaproperties expected", "Type");
        }
        else
            throw new InvalidClassException("Unsupported class", dataFlowNodeClass.getName());
    }

    @SuppressWarnings("unchecked")
    @Override
    public <T extends DataFlowNode> T createDataFlowNode(String name, Class<T> dataFlowNodeClass, Map<String, String> metaProperties, Map<String, String> properties)
        throws InvalidClassException, InvalidNameException, InvalidMetaPropertyException, MissingMetaPropertyException, InvalidPropertyException, MissingPropertyException
    {
        if (dataFlowNodeClass.equals(DataSource.class))
        {
            if ((metaProperties.size() == 1) && metaProperties.containsKey("Type"))
            {
                String type = metaProperties.get("Type");
                if (type.equals("Pull"))
                    return (T) new SerializableObjectPullDataSource(name, properties);
                else if (type.equals("Acceptor"))
                    return (T) new SerializableObjectAcceptorDataSource(name, properties);
                else
                    throw new InvalidMetaPropertyException("Expecting value of 'Type' meta property 'Pull' or 'Acceptor'", "Type", type);
            }
            else
                throw new InvalidMetaPropertyException("No metaproperties expected", null, null);
        }
        else if (dataFlowNodeClass.equals(DataSink.class))
        {
            if ((metaProperties.size() == 1) && metaProperties.containsKey("Type"))
            {
                String type = metaProperties.get("Type");
                if (type.equals("Push"))
                    return (T) new SerializableObjectPushDataSink(name, properties);
                else if (type.equals("Provider"))
                    return (T) new SerializableObjectProviderDataSink(name, properties);
                else
                    throw new InvalidMetaPropertyException("Expecting value of 'Type' meta property 'Push' or 'Provider'", "Type", type);
            }
            else
                throw new InvalidMetaPropertyException("No metaproperties expected", null, null);
        }
        else
            throw new InvalidClassException("Unsupported class", dataFlowNodeClass.getName());
    }

    private String              _name;
    private Map<String, String> _properties;
}


text:
<?php
namespace Boekkooi\Tactician\AMQP;

interface AMQPAwareMessage extends Message
{
    /**
     * Returns the vhost name to publish the message to
     *
     * @return string
     */
    public function getVHost();

    /**
     * Returns the exchange name to publish the message to
     *
     * @return string
     */
    public function getExchange();
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Datastores — php-opencloud 1.12.1 documentation</title>

  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>

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

    <link rel="top" title="php-opencloud 1.12.1 documentation" href="../../index.html"/>
        <link rel="up" title="Databases v1" href="index.html"/>
        <link rel="next" title="DNS v1" href="../dns/index.html"/>
        <link rel="prev" title="Users" href="users.html"/>

         php-opencloud

  <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Auto Scale v2

Setup

Operations

Glossary

Further Links

Compute v2

Setup

Operations

Glossary

Further Links

Databases v1

Setup

Operations

Glossary

Further Links

DNS v1

Setup

Operations

Glossary

Further Links

Identity v2

Setup

Operations

Glossary

Further Links

Images v1

Setup

Operations

Glossary

Further Links

Load Balancer v1

Setup

Operations

Glossary

Further Links

Monitoring v1

Setup

Operations

Glossary

Further links

Networking v2

Setup

Operations

Glossary

Further links

Object Store v1

Setup

Operations

Glossary

Further links

Orchestration v1

Setup

Operations

Glossary

Further links

Queues v1

Setup

Operations

Glossary

Further links

Volumes v1

Setup

Operations

Glossary

Further links

Debugging

Strategy 1: Meaningful exception handling

Strategy 2: Wire logging

Caching credentials

Filesystem example

Iterators

Common behaviour

Very important note

Using paginated collections

Setting up a PaginatedIterator

Rackspace regions

URL types

internalURL

publicURL

Logging

Logger injection

HTTP Clients

Default HTTP headers

User agents

Other functionality

Authentication

Service Catalog

        php-opencloud

Docs »

Databases v1 »

Datastores

           View page source

Datastores¶

Listing datastores¶

You can list out all the datastores available as shown below:

$datastores = $service->datastoreList();
foreach ($datastores as $datastore) {
    /** @var $datastore OpenCloud\Database\Resource\Datastore **/
}

Get the executable PHP script for this example

Retrieving a datastore¶

You can retrieve a specific datastore’s information, using its ID, as
shown below:

/** @var OpenCloud\Database\Resource\Datastore **/
$datastore = $service->datastore('{datastoreId}');

Get the executable PHP script for this example

Listing datastore versions¶

You can list out all the versions available for a specific datastore, as
shown below:

$versions = $datastore->versionList();
foreach ($versions as $version) {
    /** @var $version OpenCloud\Database\Resource\DatastoreVersion **/
}

Get the executable PHP script for this example

Retrieving a datastore version¶

You a retrieve a specific datastore version, using its ID, as shown
below:

$datastoreVersion = $datastore->version('{versionId}');

Get the executable PHP script for this example

        Next

         Previous

        © Copyright 2015, Jamie Hannaford, Shaunak Kashyap.

  Sphinx theme provided by Read the Docs


text:
using System;
using System.IO;

namespace Folder_Size
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] files = Directory.GetFiles("TestFolder");
            double sum = 0;

            foreach(string file in files)
            {
                FileInfo fileInfo = new FileInfo(file);
                sum += fileInfo.Length;
            }

            sum = sum / 1024 / 1024;
            File.WriteAllText("output.txt", sum.ToString());
        }
    }
}


text:
(function () {
  // trim polyfill : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
  if (!String.prototype.trim) {
    (function () {
      // Make sure we trim BOM and NBSP
      var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
      String.prototype.trim = function () {
        return this.replace(rtrim, '');
      };
    })();
  }
  [].slice.call(document.querySelectorAll('input.input__field')).forEach(function (inputEl) {
    // in case the input is already filled..
    if (inputEl.value.trim() !== '') {
      classie.add(inputEl.parentNode, 'input--filled');
    }
    // events:
    inputEl.addEventListener('focus', onInputFocus);
    inputEl.addEventListener('blur', onInputBlur);
  });

  function onInputFocus(ev) {
    classie.add(ev.target.parentNode, 'input--filled');
  }

  function onInputBlur(ev) {
    if (ev.target.value.trim() === '') {
      classie.remove(ev.target.parentNode, 'input--filled');
    }
  }
})();


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

using System;
using System.Threading.Tasks;
using Xunit;

/// <summary>
/// Tests creating a backup using customer managed encryption.
/// </summary>
[Collection(nameof(SpannerFixture))]
public class CreateBackupWithEncryptionKeyAsyncTest
{
    private readonly SpannerFixture _fixture;

    public CreateBackupWithEncryptionKeyAsyncTest(SpannerFixture fixture)
    {
        _fixture = fixture;
    }

    [SkippableFact]
    public async Task TestCreatBackupWithEncryptionKeyAsync()
    {
        Skip.If(!_fixture.RunCmekBackupSampleTests, SpannerFixture.SkipCmekBackupSamplesMessage);
        // Create a backup with a custom encryption key.
        var sample = new CreateBackupWithEncryptionKeyAsyncSample();
        var backup = await sample.CreateBackupWithEncryptionKeyAsync(_fixture.ProjectId, _fixture.InstanceId, _fixture.FixedEncryptedDatabaseId, _fixture.EncryptedBackupId, _fixture.KmsKeyName);
        Assert.Equal(_fixture.KmsKeyName.CryptoKeyId, backup.EncryptionInfo.KmsKeyVersionAsCryptoKeyVersionName.CryptoKeyId);
    }
}


text:
export interface SavedFC {
  id: string;
  name: string;
  world: string;
  loadDateTime: number;
}

export interface SaveFreeCompanyMessage {
  method: 'Nunze_saveFreeCompany';
  fc: SavedFC;
}

export interface SaveFreeCompanyResponse {
  method: 'Nunze_saveFreeCompany';
  succeed: boolean;
}

export function isSaveFreeCompanyResponse(
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  response: any
): response is SaveFreeCompanyResponse {
  return response.method === 'Nunze_saveFreeCompany';
}


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

package com.google.api.ads.adwords.jaxws.v201809.cm;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             Adds labels to the AdGroupAd or removes labels from the AdGroupAd.
 *
Add - Apply an existing label to an existing {@linkplain AdGroupAd ad group ad}. The
 *             {@code adGroupId} and {@code adId} must reference an existing
 *             {@linkplain AdGroupAd ad group ad}. The {@code labelId} must reference an existing
 *             {@linkplain Label label}.
 *
Remove - Removes the link between the specified {@linkplain AdGroupAd ad group ad} and
 *             {@linkplain Label label}.
 *             @param operations The operations to apply.
 *             @return A list of AdGroupAdLabel where each entry in the list is the result of
 *             applying the operation in the input list with the same index. For an
 *             add operation, the returned AdGroupAdLabel contains the AdGroupId, AdId and the LabelId.
 *             In the case of a remove operation, the returned AdGroupAdLabel will only have AdGroupId and
 *             AdId.
 *             @throws ApiException when there are one or more errors with the request.
 *
 *
 *
Java class for mutateLabel element declaration.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <element name="mutateLabel">
 *   <complexType>
 *     <complexContent>
 *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *         <sequence>
 *           <element name="operations" type="{https://adwords.google.com/api/adwords/cm/v201809}AdGroupAdLabelOperation" maxOccurs="unbounded" minOccurs="0"/>
 *         </sequence>
 *       </restriction>
 *     </complexContent>
 *   </complexType>
 * </element>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "operations"
})
@XmlRootElement(name = "mutateLabel")
public class AdGroupAdServiceInterfacemutateLabel {

    protected List<AdGroupAdLabelOperation> operations;

    /**
     * Gets the value of the operations property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the operations property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getOperations().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link AdGroupAdLabelOperation }
     *
     *
     */
    public List<AdGroupAdLabelOperation> getOperations() {
        if (operations == null) {
            operations = new ArrayList<AdGroupAdLabelOperation>();
        }
        return this.operations;
    }

}


text:
#define GET_BUFFER_SMPL(varName, v8Object)									\
	char* varName = node::Buffer::Data(v8Object);						\
	auto varName##Len = node::Buffer::Length(v8Object);

#define GET_BUFFER_ARGS(varName, argIndex)								\
	GET_BUFFER_SMPL(varName, info[argIndex]);

#endif // INCLUDE_H_PKCS11_CORE


text:
Mesos
#####

:version: latest
:date: 2015-02-09 12:00
:category: App
:tags: official, arm, app, mesos, docker
:uuid:
:icon:
:author: Online Labs
:email: opensource@ocs.online.net
:github_url: https://github.com/online-labs/image-app-mesos
:issues_url: https://github.com/online-labs/image-app-mesos/issues
:community_url:
:help_url:
:vendor_url:
:vendor_name: Mesos
:summary: Mesos ARMhf image
:status: draft

Official Mesos image


text:
package org.daisy.dotify.api.embosser;

import java.io.File;

import javax.print.PrintException;

/**
 * Provides an interface to transmit a file to a device, typically a printer.
 * @author Joel Håkansson
 */
public interface Device {

	/**
	 * Transmits a file to the Device
	 * @param file the file to transmit
	 * @throws PrintException if the file could not be transmitted
	 */
	public void transmit(File file) throws PrintException;

}


text:
#ifndef SER_CONFIG_H__
#define SER_CONFIG_H__

#include <stdint.h>

#include "nrf51.h"
#include "nrf51_bitfields.h"

/***********************************************************************************************//**
 * General parameters configuration.
 **************************************************************************************************/

/** Value used as error code on SoftDevice stack dump. Can be used to identify stack location on
 *  stack unwind.*/
#define SER_SD_ERROR_CODE    (uint32_t)(0xDEADBEEF)

/** Value used as error code indicating warning - unusual situation but not critical so system
 *  should NOT be reseted. */
#define SER_WARNING_CODE     (uint32_t)(0xBADDCAFE)

/***********************************************************************************************//**
 * HAL Transport layer configuration.
 **************************************************************************************************/

/** Max packets size in serialization HAL Transport layer (packets before adding PHY header i.e.
 *  packet length). */
#define SER_HAL_TRANSPORT_APP_TO_CONN_MAX_PKT_SIZE    (uint32_t)(384)
#define SER_HAL_TRANSPORT_CONN_TO_APP_MAX_PKT_SIZE    (uint32_t)(384)

#define SER_HAL_TRANSPORT_MAX_PKT_SIZE ((SER_HAL_TRANSPORT_APP_TO_CONN_MAX_PKT_SIZE) >= \
                                        (SER_HAL_TRANSPORT_CONN_TO_APP_MAX_PKT_SIZE)    \
                                        ?                                               \
                                        (SER_HAL_TRANSPORT_APP_TO_CONN_MAX_PKT_SIZE) :  \
                                        (SER_HAL_TRANSPORT_CONN_TO_APP_MAX_PKT_SIZE))
#ifdef SER_CONNECTIVITY
    #define SER_HAL_TRANSPORT_TX_MAX_PKT_SIZE         SER_HAL_TRANSPORT_CONN_TO_APP_MAX_PKT_SIZE
    #define SER_HAL_TRANSPORT_RX_MAX_PKT_SIZE         SER_HAL_TRANSPORT_APP_TO_CONN_MAX_PKT_SIZE

#else /* APPLICATION SIDE */
    #define SER_HAL_TRANSPORT_TX_MAX_PKT_SIZE         SER_HAL_TRANSPORT_APP_TO_CONN_MAX_PKT_SIZE
    #define SER_HAL_TRANSPORT_RX_MAX_PKT_SIZE         SER_HAL_TRANSPORT_CONN_TO_APP_MAX_PKT_SIZE
#endif /* SER_CONNECTIVITY */

/***********************************************************************************************//**
 * SER_PHY layer configuration.
 **************************************************************************************************/

#define SER_PHY_HEADER_SIZE             2

/** Max transfer unit for SPI MASTER and SPI SLAVE. */
#define SER_PHY_SPI_MTU_SIZE            255

/** UART transmission parameters */
#define SER_PHY_UART_FLOW_CTRL          APP_UART_FLOW_CONTROL_ENABLED
#define SER_PHY_UART_PARITY             true
#define SER_PHY_UART_BAUDRATE           UART_BAUDRATE_BAUDRATE_Baud1M

/** Find UART baudrate value based on chosen register setting. */
#if (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud1200)
    #define SER_PHY_UART_BAUDRATE_VAL 1200uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud2400)
    #define SER_PHY_UART_BAUDRATE_VAL 2400uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud4800)
    #define SER_PHY_UART_BAUDRATE_VAL 4800uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud9600)
    #define SER_PHY_UART_BAUDRATE_VAL 9600uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud14400)
    #define SER_PHY_UART_BAUDRATE_VAL 14400uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud19200)
    #define SER_PHY_UART_BAUDRATE_VAL 19200uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud28800)
    #define SER_PHY_UART_BAUDRATE_VAL 28800uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud38400)
    #define SER_PHY_UART_BAUDRATE_VAL 38400uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud57600)
    #define SER_PHY_UART_BAUDRATE_VAL 57600uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud76800)
    #define SER_PHY_UART_BAUDRATE_VAL 76800uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud115200)
    #define SER_PHY_UART_BAUDRATE_VAL 115200uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud230400)
    #define SER_PHY_UART_BAUDRATE_VAL 230400uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud250000)
    #define SER_PHY_UART_BAUDRATE_VAL 250000uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud460800)
    #define SER_PHY_UART_BAUDRATE_VAL 460800uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud921600)
    #define SER_PHY_UART_BAUDRATE_VAL 921600uL
#elif (SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud1M)
    #define SER_PHY_UART_BAUDRATE_VAL 1000000uL
#endif /* SER_PHY_UART_BAUDRATE */

/** Configuration timeouts of connectivity MCU */
#define CONN_CHIP_RESET_TIME            50      /**< The time to keep the reset line to the nRF51822 low (in milliseconds). */
#define CONN_CHIP_WAKEUP_TIME           500     /**< The time for nRF51822 to reset and become ready to receive serialized commands (in milliseconds). */

#ifdef S110
    #define SER_MAX_CONNECTIONS 1
#else
    #ifdef S120
        #define SER_MAX_CONNECTIONS 8
    #endif
    #ifdef S130
        #define SER_MAX_CONNECTIONS 1
    #endif
#endif

#endif /* SER_CONFIG_H__ */


text:
<?xml version="1.0" encoding="utf-8" ?>
<project name="Ant Properties Echo" default="echo">

	<target name="echo">
		<echo message="${ant.version}"></echo>
		<echo message="${basedir}"></echo>
		<echo message="${ant.file}"></echo>
		<echo message="${ant.java.version}"></echo>
		<echo message="${ant.home}"/>
		<echo message="${user.home}"></echo>
		<echo message="${java.home}"></echo>
		<echo message="${project.lib}"></echo>
	</target>
	<!--
	<target name="echoXml">
		<echoproperties format="xml" destfile="current-properties.xml"></echoproperties>
	</target>-->
	<!--
	<target name="init">
		<mkdir dir="${dist.dir}"/>
	</target>-->
</project>


text:
import pyodbc
import sys
import re
import getpass
import json
import datetime

database_name=''
table_name=''

json_data=open('gen_from_ddl_config.json')

data = json.load(json_data)

for extract_ddl in data['extract_ddl']['config']:
	dsn = extract_ddl['dsn']
	database_name = str(extract_ddl['database_name'])
	table_name = str(extract_ddl['table_name'])
	output_file_name = extract_ddl['output_file_name']

json_data.close()

pw = getpass.getpass()
user = getpass.getuser()

pyodbc.pooling=False
conn_string = 'DSN=' + dsn + ';PORT=1025;UID=' + user + ';PWD=' + pw + ';'
conn = pyodbc.connect(conn_string)
cursor = conn.cursor()

query = 'select columnname, columntype, '
query = query + 'CASE WHEN CharType <> 0 THEN columnlength '
query = query + 'ELSE \'\' END AS charlength from DBC.Columns C WHERE databasename = ? '
query = query + 'and tablename = ? order by columnId;'

cursor.execute(query, database_name, table_name)
rows=cursor.fetchall()
i=0

cols=[]

for row in rows:
	print row[0], row[1], row[2]
	field_position=i
	col_name=row[0]
	col_type='UNKNOWN'
	col_min=''
	col_max=''
	default_date = datetime.datetime.today()
	type_check = row[1]
	if type_check is not None:
		type_check = type_check.strip()

	if type_check == 'AT':
		col_type='TIMESTAMP'
	elif type_check == 'BF':
		col_type='BYTE'
	elif type_check == 'BO':
		col_type='BLOB'
	elif type_check == 'BV':
		col_type='VARBYTE'
	elif type_check == 'CF':
		col_type='STRING'
		if row[2] is not None:
			col_min='0'
			col_max='1'
	elif type_check == 'CO':
		col_type='CLOB'
	elif type_check == 'CV':
		col_type='STRING'
	elif type_check == 'D':
		col_type='DECIMAL'
	elif type_check == 'DA':
		col_type='DATE'
		col_min=default_date.strftime("%Y-%m-%d")
		col_max=default_date.strftime("%Y-%m-%d")
	elif type_check == 'F':
		col_type='DECIMAL'
	elif type_check == 'I1':
		col_type='INT'
		if row[2] is not None:
			col_min='-128'
			col_max='127'
	elif type_check == 'I2':
		col_type='INT'
		if row[2] is not None:
			col_min='-32768'
			col_max='32767'
	elif type_check == 'I8':
		col_type='INT'
	elif type_check == 'I':
		col_type='INT'
	elif type_check == 'SZ':
		col_type='TIMESTAMP'
	elif type_check == 'TS':
		col_type='TIMESTAMP'
	elif type_check == 'TZ':
		col_type='TIMESTAMP'
	else:
		pass

	if col_max == '':
		col_max=row[2].strip()

	if col_type == 'TIMESTAMP':
		col_min=default_date.strftime("%Y-%m-%d %H:%M:%S")
		col_max=default_date.strftime("%Y-%m-%d %H:%M:%S")

	c={'field_position':field_position, 'field_name':col_name.strip(), 'field_type':col_type, 'values':[{'MIN':col_min,'MAX':col_max}]}
	cols.append(c)
	i+=1

n={'columns' : cols}
outfile = open(output_file_name, "w")

outfile.write(json.dumps(n, indent=4, sort_keys=True, ensure_ascii=True))

outfile.close()
conn.close()


text:
<?php

namespace Ivory\CKEditorBundle\Model;

/**
 * Ivory CKEditor plugin manager.
 *
 * @author GeLo <geloen.eric@gmail.com>
 */
interface PluginManagerInterface
{
    /**
     * Checks if the CKEditor plugins exists.
     *
     * @return boolean TRUE if the CKEditor plugins exists else FALSE.
     */
    public function hasPlugins();

    /**
     * Gets the CKEditor plugins.
     *
     * @return array The CKEditor plugins.
     */
    public function getPlugins();

    /**
     * Sets the CKEditor plugins.
     *
     * @param array $plugins The CKEditor plugins.
     */
    public function setPlugins(array $plugins);

    /**
     * Checks if a specific CKEditor plugin exists.
     *
     * @param string $name The CKEditor plugin name.
     *
     * @return boolean TRUE if the CKEditor plugin exists else FALSE.
     */
    public function hasPlugin($name);

    /**
     * Gets a specific CKEditor plugin.
     *
     * @param string $name The CKEditor name.
     *
     * @return array The CKEditor plugin.
     */
    public function getPlugin($name);

    /**
     * Sets a CKEditor plugin.
     *
     * @param string $name   The CKEditor plugin name.
     * @param array  $plugin The CKEditor plugin.
     */
    public function setPlugin($name, array $plugin);
}


text:
(function(){
  'use strict';
  angular.module('fsReferenceClientShared')
    .directive('fsRelationshipMemberEdit', function() {
      return {
        templateUrl: 'fsReferenceClientShared/fsRelationshipMember/fsRelationshipMemberEdit/fsRelationshipMemberEdit.tpl.html',
        scope: {
          person: '=',
          agent: '=',
          role: '@'
        }
      };
    });
})();


text:
//
//  ofxAvAudioWriter.h
//  emptyExample
//
//  Created by Hansi on 13.09.15.
//
//

#ifndef __emptyExample__ofxAvAudioWriter__
#define __emptyExample__ofxAvAudioWriter__

#include <string>
#include <iostream>

#include <math.h>
#include <map>

extern "C"{
	#include <libavcodec/avcodec.h>
	#include <libavformat/avformat.h>
	#include <libavutil/avutil.h>
	#include <libavformat/avformat.h>
	#include <libavutil/channel_layout.h>
	#include <libavutil/samplefmt.h>
	#include <libswresample/swresample.h>
}

class ofxAvAudioWriter{
public:
	ofxAvAudioWriter();
	~ofxAvAudioWriter();

	// let the writer know which data you will feed into it
	void setup( int sampleRate, int numChannels );

	// sets the title that will be used in the file
	void addMeta( std::string key, std::string value );

	// open an output file.
	// formatExtension is wav or ogg
	bool open( std::string filename, std::string formatExtension, int sampleRate = -1, int numChannels = -1);

	// opens an output file.
	// sample rate and num channels is optional.
	//   if provided libavcodec will select a best match, depending on what the codec supports
	//   if not provided libavcodec will select a best match, depending on the data provided to setup()
	// either way automatic resampling will take place.
	bool open( std::string filename, AVCodecID av_codec_id, int requestedOutputSampleRate = -1, int requestedOutputNumChannels = -1 );

	// add samples
	// samples must be numFrames*numChannels long and interleaved
	// ie, numFrames = 4, numChannels = 2, samples = {l1, r1, l2, r2, l3, r3, l4, r4}
	void write( float * samples, int numFrames );

	void close();

	// sample rate and num channels used by the codec
	int file_sample_rate;
	int file_num_channels;
	int file_codec;

	// sample rate and num channels provided to setup
	int in_sample_rate;
	int in_num_channels;
	int in_channel_layout;
	std::map<std::string,std::string> meta;

	// tries to find a codec id from a file extension
	static AVCodecID codecForExtension( std::string extension );

private:
	SwrContext * swr_context;
	AVFormatContext *ofmt_ctx;
	AVStream *out_stream;
	uint16_t *samples;
	int buffer_size;

	AVCodec *codec;
	AVCodecContext *c;
	AVFrame *frame;
	AVPacket *pkt;

	int frame_pointer;
	int got_output;

};
#endif /* defined(__emptyExample__ofxAvAudioWriter__) */


text:
./example_flower.sh flower/flower_1_10.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_11.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_1.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_2.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_3.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_4.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_5.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_6.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_7.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_8.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_1_9.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_10.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_11.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_12.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_13.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_14.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_15.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_16.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_17.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_18.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_19.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_1.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_2.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_3.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_4.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_5.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_7.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_2_9.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_3_1.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_3_2.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_3_3.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_3_4.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_3_5.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_3_6.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_10.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_11.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_12.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_13.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_14.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_15.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_16.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_17.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_18.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_19.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_1.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_20.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_21.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_22.png gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_23.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_24.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_25.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_26.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_27.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_2.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_3.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_5.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_6.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_7.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_8.jpg gan_flowers/sentence_1_11.jpg
./example_flower.sh flower/flower_4_9.jpg gan_flowers/sentence_1_11.jpg


text: TODO about: final