text:
namespace ASCOM.Komakallio
{
    partial class SetupDialogForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.cmdOK = new System.Windows.Forms.Button();
            this.cmdCancel = new System.Windows.Forms.Button();
            this.picASCOM = new System.Windows.Forms.PictureBox();
            this.label2 = new System.Windows.Forms.Label();
            this.serverAddressTextBox = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
            this.SuspendLayout();
            //
            // cmdOK
            //
            this.cmdOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.cmdOK.Location = new System.Drawing.Point(562, 215);
            this.cmdOK.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.cmdOK.Name = "cmdOK";
            this.cmdOK.Size = new System.Drawing.Size(118, 46);
            this.cmdOK.TabIndex = 0;
            this.cmdOK.Text = "OK";
            this.cmdOK.UseVisualStyleBackColor = true;
            this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
            //
            // cmdCancel
            //
            this.cmdCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.cmdCancel.Location = new System.Drawing.Point(562, 273);
            this.cmdCancel.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.cmdCancel.Name = "cmdCancel";
            this.cmdCancel.Size = new System.Drawing.Size(118, 48);
            this.cmdCancel.TabIndex = 1;
            this.cmdCancel.Text = "Cancel";
            this.cmdCancel.UseVisualStyleBackColor = true;
            this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
            //
            // picASCOM
            //
            this.picASCOM.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.picASCOM.Cursor = System.Windows.Forms.Cursors.Hand;
            this.picASCOM.Image = global::ASCOM.Komakallio.Properties.Resources.ASCOM;
            this.picASCOM.Location = new System.Drawing.Point(584, 17);
            this.picASCOM.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.picASCOM.Name = "picASCOM";
            this.picASCOM.Size = new System.Drawing.Size(48, 56);
            this.picASCOM.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.picASCOM.TabIndex = 3;
            this.picASCOM.TabStop = false;
            this.picASCOM.Click += new System.EventHandler(this.BrowseToAscom);
            this.picASCOM.DoubleClick += new System.EventHandler(this.BrowseToAscom);
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(15, 120);
            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(158, 25);
            this.label2.TabIndex = 5;
            this.label2.Text = "Server address";
            //
            // serverAddressTextBox
            //
            this.serverAddressTextBox.Location = new System.Drawing.Point(182, 120);
            this.serverAddressTextBox.Name = "serverAddressTextBox";
            this.serverAddressTextBox.Size = new System.Drawing.Size(353, 31);
            this.serverAddressTextBox.TabIndex = 6;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(15, 33);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(383, 25);
            this.label1.TabIndex = 7;
            this.label1.Text = "Komakallio ObservingConditions driver";
            //
            // SetupDialogForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(700, 337);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.serverAddressTextBox);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.picASCOM);
            this.Controls.Add(this.cmdCancel);
            this.Controls.Add(this.cmdOK);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "SetupDialogForm";
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Komakallio Setup";
            ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button cmdOK;
        private System.Windows.Forms.Button cmdCancel;
        private System.Windows.Forms.PictureBox picASCOM;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox serverAddressTextBox;
        private System.Windows.Forms.Label label1;
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.devtestlabs.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Information about a Windows OS. */
@Fluent
public final class WindowsOsInfo {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(WindowsOsInfo.class);

    /*
     * The state of the Windows OS (i.e. NonSysprepped, SysprepRequested,
     * SysprepApplied).
     */
    @JsonProperty(value = "windowsOsState")
    private WindowsOsState windowsOsState;

    /**
     * Get the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested,
     * SysprepApplied).
     *
     * @return the windowsOsState value.
     */
    public WindowsOsState windowsOsState() {
        return this.windowsOsState;
    }

    /**
     * Set the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested,
     * SysprepApplied).
     *
     * @param windowsOsState the windowsOsState value to set.
     * @return the WindowsOsInfo object itself.
     */
    public WindowsOsInfo withWindowsOsState(WindowsOsState windowsOsState) {
        this.windowsOsState = windowsOsState;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}

redpajama_set_name: RedPajamaGithub


text:
/* global $:true */
$(function() {
    'use strict';

    //nav init
    function navInit() {
        var sidebar = $('#sidebar_list');
        sidebar.find(' > dt > span').click(function() {
            $(this).toggleClass('glyphicon-plus').parent().next().toggleClass('hide');
        })

        $('#txtSearch').keyup(function(e) {
            //if(e.keyCode === 13){
            filter($(this).parent().next().children('dd'), $.trim(this.value));
            //}
        })

        var path = window.location.pathname,
            name = path.substring(path.lastIndexOf('/')),
            current = sidebar.find('a[href$="' + name + '"]:first').addClass('active').parent().parent().parent();

        if (current.hasClass('hide')) {
            current.removeClass('hide').prev().children('span').removeClass('glyphicon-plus');
        }
    }

    function filter(list, text) {
        if (text) {
            var fnMatch = matchText(text);
            list.each(function() {
                var modMatch, mod;
                mod = $(this).find(' > ul > li').each(function() {
                    var cls = $(this);
                    if (fnMatch(cls.text())) {
                        cls.removeClass('hide');
                        modMatch = true;
                    } else {
                        cls.addClass('hide');
                    }
                }).end().prev();

                if (!modMatch) {
                    modMatch = fnMatch(mod.children('a').text());
                }
                mod.toggleClass('hide', !modMatch);
            })
        } else {
            list.parent().find('.hide').removeClass('hide');
        }
    }

    function matchText(match) {
        match = match.toLowerCase();
        return function(text) {
            return text.toLowerCase().indexOf(match) > -1;
        }
    }

    function InitClasses() {
        $('#classesItems').find('a').on('click', function(event) {
            var tabToActivate = $(this).attr('data-tabid'),
                anchor = $(this).attr('data-anchor');
            event.preventDefault();
            anchorTo(tabToActivate, anchor);
        });

        var tab = $('#itemTab'),
            doc = $(document);

        function anchorTo(tabToActivate, anchor) {
            tab.find('[href="' + tabToActivate + '"]').click();
            doc.scrollTop($(anchor).offset().top - 50);
        }

        function gotoItem() {
            var hash = location.hash,
                params;
            if (hash.length > 1) {
                params = hash.split('_');
                setTimeout(function() {
                    anchorTo(params[0], hash);
                }, 100)
            }
        }
        window.onhashchange = gotoItem;

        gotoItem();
    }

    /* 代码行定位 */
    function gotoCode() {
        var line = location.hash,
            item, top;
        if (line && line.length > 2) {
            line = location.hash.substring(2);
            item = $('#src_code > ol > li:eq(' + line + ")");
            if (item.length) {
                item.addClass('active');
                top = item.position().top - 100;
                setTimeout(function() {
                    $(document).scrollTop(top);
                }, 0)
            }
        }
    }

    var html_ifr = '';

    function toggleDemoTab(target) {
        target.siblings('.active').removeClass('active')
        target.addClass('active');
    }

    function initDemoView() {
        //demo tab切换处理
        var list = $('.example-list').on('click', 'li', function(i) {
            var title = $(this),
                active;
            if (!title.hasClass('active')) {
                active = title.parent().next().children(':eq(' + title.attr("_no") + ')');
                toggleDemoTab(title);
                toggleDemoTab(active);
                loadShowDemo(active);
            }
        });

        //处理初始化代码显示
        list.next().each(function(){
            var demo = $(this).children(':first').addClass('active');
             loadShowDemo(demo);
        });

        $('.btn-viewDemo').click(openDemo).next().click(editDemo);
    }
    function loadShowDemo(code){
        if(code.hasClass('demo-loaded'))
            return;

        var codeText = code.text().trim(),
            ifr;

        if (code.parent().hasClass('showdemo')) {
            ifr = $(html_ifr).load(loadDemo);
            code.prepend(ifr);
            ifr.attr('src', '/assets/show.html');
        }
        code.addClass('demo-loaded');
    }
    function buildShowDemo(code, no) {
        var codeText = code.text().trim(),
            ifr;

        if (code.parent().hasClass('showdemo')) {
            ifr = $(html_ifr).load(loadDemo);
            code.before(ifr);
            ifr.attr('src', '/assets/show.html');
        }

        (ifr || code).attr('id', no);
    }

    function openDemo() {
        var code = $(this).prev().children('.active').text().trim();
        window.open('../assets/show.html', code);
    }

    function editDemo() {
        var btn = $(this),
            code = btn.prev().prev().children('.active').text().trim();
        window.open('../assets/code.html?n=' + btn.parent().parent().children(':first').text(), code);
    }

    function loadDemo() {
        var ifr = $(this),
            code = ifr.next().text().trim(),
            html, js;

        ifr.addClass('demo-loaded');

        var win = ifr[0].contentWindow;
        if (win && win.__st_render) {
            html = getCode(code, 'html');
            js = getCode(code, 'script') || (html && code);

            win.__st_render(html, js);
            ifr.height(win.document.body.scrollHeight);
        }
    }

    function getCode(code, type) {
        var index = code.indexOf('<' + type + '>');

        if (index > -1) {
            return code.substring(index + type.length + 2, code.indexOf('</' + type + '>'));
        }
    }

    function initFilterApi() {
        var config = window.__docConfig,
            filterItems = config.filterItems,
            filterList = $('#filterList'),
            txtSearchAPI = $('#txtSearchAPI'),
            path = location.pathname;

        if (path.charAt(path.length - 1) === '/' || path.lastIndexOf('/index.html') > 0)
            path = "./";
        else
            path = "../";

        var timer, curItem;
        txtSearchAPI.keyup(function(e) {
            var code = e.keyCode;
            if (code === 38 || code === 40) {
                moveItem(e.keyCode);
            } else if (code === 13) {
                if (filterList.css('display') === 'none')
                    filterList.show();
                else if (curItem)
                    location.href = curItem.children().attr('href');
            } else {
                if (timer)
                    clearTimeout(timer);

                timer = setTimeout(filterAPI, 200);

            }

            return false;
        }).blur(function() {
            setTimeout(function() {
                filterList.hide();
            }, 300);
        })

        function moveItem(code) {
            var next, isNext = code === 40;
            if (curItem) {
                curItem.removeClass('active');
                curItem = isNext ? curItem.next() : curItem.prev();
                if (curItem.length === 0)
                    curItem = null;
            }

            if (!curItem)
                curItem = filterList.children(isNext ? ':first' : ':last')

            curItem.addClass('active');
        }

        function filterAPI() {
            timer = null;
            var text = $.trim(txtSearchAPI.val()),
                fnMatch, result = [];

            if (text) {
                var fnMatch = matchText(text);
                filterItems.forEach(function(item) {
                    var itemTag;
                    if (fnMatch(item.name)) {
                        result.push('
<a href="', path, item.type === 'module' ? 'modules/' : 'classes/', item.className || item.name, '.html');

                        if (item.className) {
                            result.push("#", item.type, "_", item.name);
                            itemTag = '' + item.className + '-' + item.type;
                        }

                        result.push('">', item.name, " [", itemTag || item.type, "]
");
                    }
                })
                filterList.html(result.join('')).show();
                curItem = filterList.children(':first');

                if (curItem.length)
                    curItem.addClass('active')
                else
                    curItem = null;
            } else
                filterList.hide();
        }
    }

    navInit();
    initDemoView();
    prettyPrint();
    initFilterApi();

    if (checkPath('/classes/')) {
        InitClasses();
    } else if (checkPath('/files/')) {
        gotoCode();
    }

    function checkPath(type) {
        return location.pathname.indexOf(type) > -1;
    }

    function autoHeight() {
        var leftNav = $('#sidebar_list'),
            top = leftNav.offset().top - window.scrollY;

        leftNav.height($(window).height() - top);
    }

    $(window).resize(autoHeight);
    autoHeight();
});


text:
package cli

import (
	"github.com/alecthomas/kingpin"
	"github.com/pkg/profile"
)

type profileFlags struct {
	profileDir      string
	profileCPU      bool
	profileMemory   int
	profileBlocking bool
	profileMutex    bool
}

func (c *profileFlags) setup(app *kingpin.Application) {
	app.Flag("profile-dir", "Write profile to the specified directory").Hidden().StringVar(&c.profileDir)
	app.Flag("profile-cpu", "Enable CPU profiling").Hidden().BoolVar(&c.profileCPU)
	app.Flag("profile-memory", "Enable memory profiling").Hidden().IntVar(&c.profileMemory)
	app.Flag("profile-blocking", "Enable block profiling").Hidden().BoolVar(&c.profileBlocking)
	app.Flag("profile-mutex", "Enable mutex profiling").Hidden().BoolVar(&c.profileMutex)
}

// withProfiling runs the given callback with profiling enabled, configured according to command line flags.
func (c *profileFlags) withProfiling(callback func() error) error {
	if c.profileDir != "" {
		pp := profile.ProfilePath(c.profileDir)
		if c.profileMemory > 0 {
			defer profile.Start(pp, profile.MemProfileRate(c.profileMemory)).Stop()
		}

		if c.profileCPU {
			defer profile.Start(pp, profile.CPUProfile).Stop()
		}

		if c.profileBlocking {
			defer profile.Start(pp, profile.BlockProfile).Stop()
		}

		if c.profileMutex {
			defer profile.Start(pp, profile.MutexProfile).Stop()
		}
	}

	return callback()
}


text:
/*
 * GrupoRadio.cpp
 *
 *  Created on: 09/02/2010
 *      Author: Yuri Pourre
 */

#include "GrupoRadio.h"

GrupoRadio::GrupoRadio()
{
	elementoAtivo = 1;
}

GrupoRadio::~GrupoRadio()
{
	// TODO Auto-generated destructor
}

int GrupoRadio::getElementoAtivo()
{
	return elementoAtivo;
}
int* GrupoRadio::getIDAtivo()
{
	return &elementoAtivo;
}

void GrupoRadio::setElementoAtivo(int idElemento)
{
	elementoAtivo = idElemento;
}
//void GrupoRadio::setAtivo(RadioCustom* elemento)
//{
//	elementoAtivo = elemento->getID();
//}


text:
using System;
using System.Data.Linq.Mapping;

namespace Bloom.Domain.Models
{
    /// <summary>
    /// Represents an association between an artist and a photo.
    /// </summary>
    [Table(Name = "artist_photo")]
    public class ArtistPhoto
    {
        /// <summary>
        /// Creates a new artist photo instance.
        /// </summary>
        /// <param name="artist">An artist.</param>
        /// <param name="photo">The photo.</param>
        /// <param name="priority">The order priority.</param>
        public static ArtistPhoto Create(Artist artist, Photo photo, int priority)
        {
            return new ArtistPhoto
            {
                ArtistId = artist.Id,
                PhotoId = photo.Id,
                Priority = priority
            };
        }

        /// <summary>
        /// Gets or sets the artist identifier.
        /// </summary>
        [Column(Name = "artist_id", IsPrimaryKey = true)]
        public Guid ArtistId { get; set; }

        /// <summary>
        /// Gets or sets the photo identifier.
        /// </summary>
        [Column(Name = "photo_id", IsPrimaryKey = true)]
        public Guid PhotoId { get; set; }

        /// <summary>
        /// Gets or sets the order priority of this artist photo.
        /// </summary>
        [Column(Name = "priority")]
        public int Priority { get; set; }
    }
}


text:
package org.apache.sysds.hops;

import org.apache.sysds.api.DMLScript;
import org.apache.sysds.common.Types.DataType;
import org.apache.sysds.common.Types.OpOp1;
import org.apache.sysds.common.Types.OpOp2;
import org.apache.sysds.common.Types.ValueType;
import org.apache.sysds.hops.AggBinaryOp.SparkAggType;
import org.apache.sysds.hops.rewrite.HopRewriteUtils;
import org.apache.sysds.lops.Data;
import org.apache.sysds.lops.Lop;
import org.apache.sysds.common.Types.ExecType;
import org.apache.sysds.lops.RightIndex;
import org.apache.sysds.runtime.meta.DataCharacteristics;
import org.apache.sysds.runtime.meta.MatrixCharacteristics;

//for now only works for range based indexing op
public class IndexingOp extends Hop
{
	public static String OPSTRING = "rix"; //"Indexing";

	private boolean _rowLowerEqualsUpper = false;
	private boolean _colLowerEqualsUpper = false;

	private enum IndexingMethod {
		CP_RIX, //in-memory range index
		MR_RIX, //general case range reindex
		MR_VRIX, //vector (row/col) range index
	}

	private IndexingOp() {
		//default constructor for clone
	}

	//right indexing doesn't really need the dimensionality of the left matrix
	//private static Lops dummy=new Data(null, Data.OperationTypes.READ, null, "-1", DataType.SCALAR, ValueType.INT, false);
	public IndexingOp(String l, DataType dt, ValueType vt, Hop inpMatrix, Hop inpRowL, Hop inpRowU, Hop inpColL, Hop inpColU, boolean passedRowsLEU, boolean passedColsLEU) {
		super(l, dt, vt);

		getInput().add(0, inpMatrix);
		getInput().add(1, inpRowL);
		getInput().add(2, inpRowU);
		getInput().add(3, inpColL);
		getInput().add(4, inpColU);

		// create hops if one of them is null
		inpMatrix.getParent().add(this);
		inpRowL.getParent().add(this);
		inpRowU.getParent().add(this);
		inpColL.getParent().add(this);
		inpColU.getParent().add(this);

		// set information whether left indexing operation involves row (n x 1) or column (1 x m) matrix
		setRowLowerEqualsUpper(passedRowsLEU);
		setColLowerEqualsUpper(passedColsLEU);
	}

	@Override
	public void checkArity() {
		HopsException.check(_input.size() == 5, this, "should have 5 inputs but has %d inputs", _input.size());
	}

	public boolean isRowLowerEqualsUpper(){
		return _rowLowerEqualsUpper;
	}

	public boolean isColLowerEqualsUpper() {
		return _colLowerEqualsUpper;
	}

	public void setRowLowerEqualsUpper(boolean passed){
		_rowLowerEqualsUpper  = passed;
	}

	public void setColLowerEqualsUpper(boolean passed) {
		_colLowerEqualsUpper = passed;
	}

	@Override
	public boolean isGPUEnabled() {
		if(!DMLScript.USE_ACCELERATOR) {
			return false;
		}
		else {
			// Indexing is only supported on GPU if:
			// 1. the input is of type matrix AND
			// 2. the input is less than 2GB.
			// The second condition is added for following reason:
			// 1. Indexing is a purely memory-bound operation and doesnot benefit drastically from pushing down to GPU.
			// 2. By forcing larger matrices to GPU (for example: training dataset), we run into risk of unnecessary evictions of
			// parameters and the gradients. For single precision, there is additional overhead of converting training dataset
			// to single precision every single time it is evicted.
			return (getDataType() == DataType.MATRIX) && getInputMemEstimate() < 2e+9;
		}
	}

	@Override
	public Lop constructLops()
	{
		//return already created lops
		if( getLops() != null )
			return getLops();

		Hop input = getInput().get(0);

		//rewrite remove unnecessary right indexing
		if( HopRewriteUtils.isUnnecessaryRightIndexing(this) ) {
			setLops( input.constructLops() );
		}
		//actual lop construction, incl operator selection
		else
		{
			try {
				ExecType et = optFindExecType();

				if( et == ExecType.SPARK )
				{
					IndexingMethod method = optFindIndexingMethod( _rowLowerEqualsUpper, _colLowerEqualsUpper,
						input.getDim1(), input.getDim2(), getDim1(), getDim2());
					SparkAggType aggtype = (method==IndexingMethod.MR_VRIX || isBlockAligned()) ?
						SparkAggType.NONE : SparkAggType.MULTI_BLOCK;

					Lop dummy = Data.createLiteralLop(ValueType.INT64, Integer.toString(-1));
					RightIndex reindex = new RightIndex(
						input.constructLops(), getInput().get(1).constructLops(), getInput().get(2).constructLops(),
						getInput().get(3).constructLops(), getInput().get(4).constructLops(), dummy, dummy,
						getDataType(), getValueType(), aggtype, et);

					setOutputDimensions(reindex);
					setLineNumbers(reindex);
					setLops(reindex);
				}
				else //CP or GPU
				{
					Lop dummy = Data.createLiteralLop(ValueType.INT64, Integer.toString(-1));
					RightIndex reindex = new RightIndex(
							input.constructLops(), getInput().get(1).constructLops(), getInput().get(2).constructLops(),
							getInput().get(3).constructLops(), getInput().get(4).constructLops(), dummy, dummy,
							getDataType(), getValueType(), et);

					setOutputDimensions(reindex);
					setLineNumbers(reindex);
					setLops(reindex);
				}
			} catch (Exception e) {
				throw new HopsException(this.printErrorLocation() + "In IndexingOp Hop, error constructing Lops " , e);
			}
		}

		//add reblock/checkpoint lops if necessary
		constructAndSetLopsDataFlowProperties();

		return getLops();
	}

	@Override
	public String getOpString() {
		String s = new String("");
		s += OPSTRING;
		return s;
	}

	@Override
	public boolean allowsAllExecTypes()
	{
		return true;
	}

	@Override
	public void computeMemEstimate( MemoTable memo )
	{
		//default behavior
		super.computeMemEstimate(memo);

		//try to infer via worstcase input statistics (for the case of dims known
		//but nnz initially unknown)
		DataCharacteristics dcM1 = memo.getAllInputStats(getInput().get(0));
		if( dimsKnown() && dcM1.getNonZeros()>=0 ){
			long lnnz = dcM1.getNonZeros(); //worst-case output nnz
			double lOutMemEst = computeOutputMemEstimate(getDim1(), getDim2(), lnnz);
			if( lOutMemEst<_outputMemEstimate ){
				_outputMemEstimate = lOutMemEst;
				_memEstimate = getInputOutputSize();
			}
		}
	}

	@Override
	protected double computeOutputMemEstimate( long dim1, long dim2, long nnz )
	{
		// only dense right indexing supported on GPU
		double sparsity =  isGPUEnabled() ? 1.0 : OptimizerUtils.getSparsity(dim1, dim2, nnz);
		return OptimizerUtils.estimateSizeExactSparsity(dim1, dim2, sparsity);
	}

	@Override
	protected double computeIntermediateMemEstimate( long dim1, long dim2, long nnz )
	{
		return 0;
	}

	@Override
	protected DataCharacteristics inferOutputCharacteristics( MemoTable memo )
	{
		DataCharacteristics ret = null;

		Hop input = getInput().get(0); //original matrix
		DataCharacteristics dc = memo.getAllInputStats(input);
		if( dc != null )
		{
			long lnnz = dc.dimsKnown()?Math.min(dc.getRows()*dc.getCols(), dc.getNonZeros()):-1;
			//worst-case is input size, but dense
			ret = new MatrixCharacteristics(dc.getRows(), dc.getCols(), -1, lnnz);

			//exploit column/row indexing information
			if( _rowLowerEqualsUpper ) ret.setRows(1);
			if( _colLowerEqualsUpper ) ret.setCols(1);

			//infer tight block indexing size
			Hop rl = getInput().get(1);
			Hop ru = getInput().get(2);
			Hop cl = getInput().get(3);
			Hop cu = getInput().get(4);
			if( isBlockIndexingExpression(rl, ru) )
				ret.setRows(getBlockIndexingExpressionSize(rl, ru));
			if( isBlockIndexingExpression(cl, cu) )
				ret.setCols(getBlockIndexingExpressionSize(cl, cu));
		}

		return ret;
	}

	/**
	 * Indicates if the lbound:rbound expressions is of the form
	 * "(c * (i - 1) + 1) : (c * i)", where we could use c as a tight size estimate.
	 *
	 * @param lbound lower bound high-level operator
	 * @param ubound uppser bound high-level operator
	 * @return true if block indexing expression
	 */
	private static boolean isBlockIndexingExpression(Hop lbound, Hop ubound)
	{
		boolean ret = false;
		LiteralOp constant = null;
		DataOp var = null;

		//handle lower bound
		if( lbound instanceof BinaryOp && ((BinaryOp)lbound).getOp()==OpOp2.PLUS
			&& lbound.getInput().get(1) instanceof LiteralOp
			&& HopRewriteUtils.getDoubleValueSafe((LiteralOp)lbound.getInput().get(1))==1
			&& lbound.getInput().get(0) instanceof BinaryOp)
		{
			BinaryOp lmult = (BinaryOp)lbound.getInput().get(0);
			if( lmult.getOp()==OpOp2.MULT && lmult.getInput().get(0) instanceof LiteralOp
				&& lmult.getInput().get(1) instanceof BinaryOp )
			{
				BinaryOp lminus = (BinaryOp)lmult.getInput().get(1);
				if( lminus.getOp()==OpOp2.MINUS && lminus.getInput().get(1) instanceof LiteralOp
					&& HopRewriteUtils.getDoubleValueSafe((LiteralOp)lminus.getInput().get(1))==1
					&& lminus.getInput().get(0) instanceof DataOp )
				{
					constant = (LiteralOp)lmult.getInput().get(0);
					var = (DataOp) lminus.getInput().get(0);
				}
			}
		}

		//handle upper bound
		if( var != null && constant != null && ubound instanceof BinaryOp
			&& ubound.getInput().get(0) instanceof LiteralOp
			&& ubound.getInput().get(1) instanceof DataOp
			&& ubound.getInput().get(1).getName().equals(var.getName()) )
		{
			LiteralOp constant2 = (LiteralOp)ubound.getInput().get(0);
			ret = ( HopRewriteUtils.getDoubleValueSafe(constant) ==
					HopRewriteUtils.getDoubleValueSafe(constant2) );
		}

		return ret;
	}

	/**
	 * Indicates if the right indexing ranging is block aligned, i.e., it does not require
	 * aggregation across blocks due to shifting.
	 *
	 * @return true if block aligned
	 */
	private boolean isBlockAligned() {
		Hop input1 = getInput().get(0); //original matrix
		Hop input2 = getInput().get(1); //inpRowL
		Hop input3 = getInput().get(2); //inpRowU
		Hop input4 = getInput().get(3); //inpColL
		Hop input5 = getInput().get(4); //inpRowU

		long rl = (input2 instanceof LiteralOp) ? (HopRewriteUtils.getIntValueSafe((LiteralOp)input2)) : -1;
		long ru = (input3 instanceof LiteralOp) ? (HopRewriteUtils.getIntValueSafe((LiteralOp)input3)) : -1;
		long cl = (input4 instanceof LiteralOp) ? (HopRewriteUtils.getIntValueSafe((LiteralOp)input4)) : -1;
		long cu = (input5 instanceof LiteralOp) ? (HopRewriteUtils.getIntValueSafe((LiteralOp)input5)) : -1;
		int blen = input1.getBlocksize();

		return OptimizerUtils.isIndexingRangeBlockAligned(rl, ru, cl, cu, blen);
	}

	private static long getBlockIndexingExpressionSize(Hop lbound, Hop ubound) {
		//NOTE: ensure consistency with isBlockIndexingExpression
		LiteralOp c = (LiteralOp) ubound.getInput().get(0); //(c*i)
		return HopRewriteUtils.getIntValueSafe(c);
	}

	@Override
	protected ExecType optFindExecType(boolean transitive) {

		checkAndSetForcedPlatform();

		if( _etypeForced != null )
		{
			_etype = _etypeForced;
		}
		else
		{
			if ( OptimizerUtils.isMemoryBasedOptLevel() ) {
				_etype = findExecTypeByMemEstimate();
			}
			else if ( getInput().get(0).areDimsBelowThreshold() )
			{
				_etype = ExecType.CP;
			}
			else
			{
				_etype = ExecType.SPARK;
			}

			//check for valid CP dimensions and matrix size
			checkAndSetInvalidCPDimsAndSize();
		}

		if( getInput().get(0).getDataType()==DataType.LIST )
			_etype = ExecType.CP;

		//mark for recompile (forever)
		setRequiresRecompileIfNecessary();

		return _etype;
	}

	private static IndexingMethod optFindIndexingMethod( boolean singleRow, boolean singleCol, long m1_dim1, long m1_dim2, long m2_dim1, long m2_dim2 )
	{
		if(    singleRow && m1_dim2 == m2_dim2 && m2_dim2!=-1
			|| singleCol && m1_dim1 == m2_dim1 && m2_dim1!=-1 )
		{
			return IndexingMethod.MR_VRIX;
		}

		return IndexingMethod.MR_RIX; //general case
	}

	@Override
	public void refreshSizeInformation()
	{
		Hop input1 = getInput().get(0); //matrix
		Hop input2 = getInput().get(1); //inpRowL
		Hop input3 = getInput().get(2); //inpRowU
		Hop input4 = getInput().get(3); //inpColL
		Hop input5 = getInput().get(4); //inpColU

		//update single row/column flags (depends on CSE)
		_rowLowerEqualsUpper = (input2 == input3);
		_colLowerEqualsUpper = (input4 == input5);

		//parse input information
		boolean allRows = isAllRows();
		boolean allCols = isAllCols();
		boolean constRowRange = (input2 instanceof LiteralOp && input3 instanceof LiteralOp);
		boolean constColRange = (input4 instanceof LiteralOp && input5 instanceof LiteralOp);

		//set dimension information
		if( _rowLowerEqualsUpper ) //ROWS
			setDim1(1);
		else if( allRows ) {
			setDim1(input1.getDim1());
		}
		else if( constRowRange ) {
			setDim1( HopRewriteUtils.getIntValueSafe((LiteralOp)input3)
					-HopRewriteUtils.getIntValueSafe((LiteralOp)input2)+1 );
		}
		else if( isBlockIndexingExpression(input2, input3) ) {
			setDim1(getBlockIndexingExpressionSize(input2, input3));
		}
		else {
			//for reset (e.g., on reconcile after loops)
			setDim1(-1);
		}

		if( _colLowerEqualsUpper ) //COLS
			setDim2(1);
		else if( allCols ) {
			setDim2(input1.getDim2());
		}
		else if( constColRange ) {
			setDim2( HopRewriteUtils.getIntValueSafe((LiteralOp)input5)
					-HopRewriteUtils.getIntValueSafe((LiteralOp)input4)+1 );
		}
		else if( isBlockIndexingExpression(input4, input5) ) {
			setDim2(getBlockIndexingExpressionSize(input4, input5));
		}
		else {
			//for reset (e.g., on reconcile after loops)
			setDim2(-1);
		}
	}

	public boolean isAllRows() {
		Hop input1 = getInput().get(0);
		Hop input2 = getInput().get(1);
		Hop input3 = getInput().get(2);
		return HopRewriteUtils.isLiteralOfValue(input2, 1)
			&& ((HopRewriteUtils.isUnary(input3, OpOp1.NROW) && input3.getInput().get(0) == input1 )
			|| HopRewriteUtils.isLiteralOfValue(input3, input1.getDim1()));
	}

	public boolean isAllCols() {
		Hop input1 = getInput().get(0);
		Hop input4 = getInput().get(3);
		Hop input5 = getInput().get(4);
		return HopRewriteUtils.isLiteralOfValue(input4, 1)
			&& ((HopRewriteUtils.isUnary(input5, OpOp1.NCOL) && input5.getInput().get(0) == input1 )
			|| HopRewriteUtils.isLiteralOfValue(input5, input1.getDim2()));
	}

	@Override
	public Object clone() throws CloneNotSupportedException  {
		IndexingOp ret = new IndexingOp();
		//copy generic attributes
		ret.clone(this, false);
		//copy specific attributes
		return ret;
	}

	@Override
	public boolean compare( Hop that )
	{
		if(    !(that instanceof IndexingOp)
			|| getInput().size() != that.getInput().size() )
		{
			return false;
		}

		return getInput().get(0) == that.getInput().get(0)
			&& getInput().get(1) == that.getInput().get(1)
			&& getInput().get(2) == that.getInput().get(2)
			&& getInput().get(3) == that.getInput().get(3)
			&& getInput().get(4) == that.getInput().get(4);
	}
}


text:
package exec

import (
	"errors"
	"io/fs"
	"os"
	"path/filepath"
	"strings"
)

// ErrNotFound is the error resulting if a path search failed to find an executable file.
var ErrNotFound = errors.New("executable file not found in $path")

func findExecutable(file string) error {
	d, err := os.Stat(file)
	if err != nil {
		return err
	}
	if m := d.Mode(); !m.IsDir() && m&0111 != 0 {
		return nil
	}
	return fs.ErrPermission
}

// LookPath searches for an executable named file in the
// directories named by the path environment variable.
// If file begins with "/", "#", "./", or "../", it is tried
// directly and the path is not consulted.
// On success, the result is an absolute path.
//
// In older versions of Go, LookPath could return a path relative to the current directory.
// As of Go 1.19, LookPath will instead return that path along with an error satisfying
// errors.Is(err, ErrDot). See the package documentation for more details.
func LookPath(file string) (string, error) {
	// skip the path lookup for these prefixes
	skip := []string{"/", "#", "./", "../"}

	for _, p := range skip {
		if strings.HasPrefix(file, p) {
			err := findExecutable(file)
			if err == nil {
				return file, nil
			}
			return "", &Error{file, err}
		}
	}

	path := os.Getenv("path")
	for _, dir := range filepath.SplitList(path) {
		path := filepath.Join(dir, file)
		if err := findExecutable(path); err == nil {
			if !filepath.IsAbs(path) && execerrdot.Value() != "0" {
				return path, &Error{file, ErrDot}
			}
			return path, nil
		}
	}
	return "", &Error{file, ErrNotFound}
}


text:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Escape Extension Example</title>
    </head>
    <body>
        <textarea id="txt" cols="50" rows="10" autofocus></textarea>
        <script src="lib/jquery-1.10.2.min.js"></script>
        <script src="lib/taboverride-4.0.0.min.js"></script>
        <script src="lib/jquery.taboverride-4.0.0.min.js"></script>
        <script src="../src/taboverride.escape.js"></script>
        <script src="../src/jquery.taboverride.escape.js"></script>
        <script>
            /*global tabOverride, jQuery, $ */

            // escape is enabled by default
            $('#txt').tabOverride();

            // disable the escape extension
            //$.fn.tabOverride.escape(false);
        </script>
    </body>
</html>


text:
require 'spec_helper'

describe command('curl -L http://localhost/') do
  its(:stdout) { should match /<title>Choose language | Drupal<\/title>/ }
  its(:exit_status) { should eq 0 }
end


text:
Fastcast
========

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fastcast/fastcast?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

### Share audio and video

![fastcast-demo](https://raw.githubusercontent.com/fastcast/fastcast/master/img/fastcast-demo.png)

**[Fastcast](http://fastcast.nz)** is a new way to experience the audio and video you love. Designed for fast, high quality content streaming.

### Features

- Streaming audio and video content
- Utilises a peer-to-peer network, so that you can stream high quality audio and video
- Powered by [WebTorrent](https://webtorrent.io): a streaming torrent client for the browser

### Support Fastcast

- **[Become a seeder!](http://fastcast.nz)** - Help share the vidoes on Fastcast by streaming them
- **[Share The Love](https://btorrent.xyz/#8C5BDAB3DBD3F92DE525283B345AD6E6E1C3717C) - Seed the videos so the devs worry about the important things
- **Join the conversation in [Gitter](https://gitter.im/fastcast/fastcast)** and share your ideas with everyone
- **[Create a new issue](https://github.com/fastcast/fastcast/issues/new)** to report bugs
- **[Fix an issue](https://github.com/fastcast/fastcast/issues?state=open)**

### License

MIT. Copyright (c) [Jacob Fulton Buckle](https://github.com/jakefb).


text:
<?php

namespace StackExchangeBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class StackExchangeBundle extends Bundle
{
}


text:
package org.activiti.editor.language.xml;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.activiti.bpmn.model.BpmnModel;
import org.activiti.bpmn.model.EventDefinition;
import org.activiti.bpmn.model.ExclusiveGateway;
import org.activiti.bpmn.model.FlowElement;
import org.activiti.bpmn.model.IntermediateCatchEvent;
import org.activiti.bpmn.model.SequenceFlow;
import org.activiti.bpmn.model.TimerEventDefinition;
import org.activiti.bpmn.model.UserTask;
import org.junit.Test;

public class SimpleConverterTest extends AbstractConverterTest {

  @Test
  public void connvertXMLToModel() throws Exception {
    BpmnModel bpmnModel = readXMLFile();
    validateModel(bpmnModel);
  }

  @Test
  public void convertModelToXML() throws Exception {
    BpmnModel bpmnModel = readXMLFile();
    BpmnModel parsedModel = exportAndReadXMLFile(bpmnModel);
    validateModel(parsedModel);
    deployProcess(parsedModel);
  }

  protected String getResource() {
    return "simplemodel.bpmn";
  }

  private void validateModel(BpmnModel model) {
    assertEquals(2, model.getDefinitionsAttributes().size());
    assertEquals("2.2A", model.getDefinitionsAttributeValue("http://activiti.com/modeler", "version"));
    assertEquals("20140312T10:45:23", model.getDefinitionsAttributeValue("http://activiti.com/modeler", "exportDate"));

    assertEquals("simpleProcess", model.getMainProcess().getId());
    assertEquals("Simple process", model.getMainProcess().getName());
    assertEquals("simple doc", model.getMainProcess().getDocumentation());
    assertEquals(true, model.getMainProcess().isExecutable());

    FlowElement flowElement = model.getMainProcess().getFlowElement("flow1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
    assertEquals("flow1", flowElement.getId());

    flowElement = model.getMainProcess().getFlowElement("catchEvent");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof IntermediateCatchEvent);
    assertEquals("catchEvent", flowElement.getId());
    IntermediateCatchEvent catchEvent = (IntermediateCatchEvent) flowElement;
    assertTrue(catchEvent.getEventDefinitions().size() == 1);
    EventDefinition eventDefinition = catchEvent.getEventDefinitions().get(0);
    assertTrue(eventDefinition instanceof TimerEventDefinition);
    TimerEventDefinition timerDefinition = (TimerEventDefinition) eventDefinition;
    assertEquals("PT5M", timerDefinition.getTimeDuration());

    flowElement = model.getMainProcess().getFlowElement("userTask1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    UserTask task = (UserTask) flowElement;
    assertEquals("task doc", task.getDocumentation());

    flowElement = model.getMainProcess().getFlowElement("flow1Condition");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
    assertEquals("flow1Condition", flowElement.getId());
    SequenceFlow flow = (SequenceFlow) flowElement;
    assertEquals("${number <= 1}", flow.getConditionExpression());

    flowElement = model.getMainProcess().getFlowElement("gateway1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof ExclusiveGateway);
  }
}


text:
    #define OKLog(s, ...)     NSLog(@"OpenKit: %@", [NSString stringWithFormat:(s), ##__VA_ARGS__])
    #define OKLogInfo(s, ...) NSLog(@"OpenKit:Info: %@", [NSString stringWithFormat:(s), ##__VA_ARGS__])
    #define OKLogErr(s, ...)  NSLog(@"OpenKit:Err: %@", [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
    #define OKLog(s, ...)     NSLog(@"OpenKit: %@", [NSString stringWithFormat:(s), ##__VA_ARGS__])
    #define OKLogInfo(...)    {} while (0)
    #define OKLogErr(s, ...)  NSLog(@"OpenKit:Err: %@", [NSString stringWithFormat:(s), ##__VA_ARGS__])
#endif

#define OK_CURRENT_APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

#define OK_RAISE(name, ...) {\
    NSString *str = [NSString stringWithFormat:__VA_ARGS__]; \
    NSLog(@"Raising %@: %@", name, str); \
    [NSException raise:name format:str]; \
}

#ifdef  DEBUG
#define OKBridgeLog( s, ... ) NSLog(@"OKBridgeIOS: %@", [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
#define OKBridgeLog( s, ...) {} while (0)
#endif

// System Versioning
#define OK_SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define OK_SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define OK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define OK_SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define OK_SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

#endif


text:
package io.searchbox.cluster;

import io.searchbox.action.AbstractAction;
import io.searchbox.action.GenericResultAbstractAction;
import io.searchbox.client.config.ElasticsearchVersion;

/**
 * @author Dogukan Sonmez
 * @author cihat keser
 */
public class State extends GenericResultAbstractAction {

    protected State(Builder builder) {
        super(builder);
    }

    @Override
    protected String buildURI(ElasticsearchVersion elasticsearchVersion) {
        return super.buildURI(elasticsearchVersion) + "/_cluster/state";
    }

    @Override
    public String getRestMethodName() {
        return "GET";
    }

    public static class Builder extends AbstractAction.Builder<State, Builder> {

        /**
         * Shows the cluster state version.
         */
        public Builder withVersion() {
            return addCleanApiParameter("version");
        }

        /**
         * Shows the elected master_node part of the response.
         */
        public Builder withMasterNode() {
            return addCleanApiParameter("master_node");
        }

        /**
         * Shows the nodes part of the response
         */
        public Builder withNodes() {
            return addCleanApiParameter("nodes");
        }

        /**
         * Shows the routing_table part of the response.
         */
        public Builder withRoutingTable() {
            return addCleanApiParameter("routing_table");
        }

        /**
         * Shows the metadata part of the response.
         */
        public Builder withMetadata() {
            return addCleanApiParameter("metadata");
        }

        /**
         * Shows the blocks part of the response
         */
        public Builder withBlocks() {
            return addCleanApiParameter("blocks");
        }

        /**
         * When not filtering metadata, a comma separated list of indices to include in the response.
         */
        public Builder indices(String value) {
            return setParameter("indices", value);
        }

        /**
         * For debugging purposes, you can retrieve the cluster state local to a particular node.
         */
        public Builder local() {
            return addCleanApiParameter("local");
        }

        @Override
        public State build() {
            return new State(this);
        }
    }
}


text:
<?php
App::uses('AppController', 'Controller');
/**
 * Users Controller
 *
 * @property User $User
 * @property PaginatorComponent $Paginator
 */
class UsersController extends AppController {

/**
 * Components
 *
 * @var array
 */
	public $components = array('Paginator', 'Session');

/**
 * index method
 *
 * @return void
 */
	public function index() {
		$this->User->recursive = 0;
		$this->set('users', $this->Paginator->paginate());
	}

/**
 * view method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function view($id = null) {
		if (!$this->User->exists($id)) {
			throw new NotFoundException(__('Invalid user'));
		}
		$options = array('conditions' => array('User.' . $this->User->primaryKey => $id));
		$this->set('user', $this->User->find('first', $options));
	}

/**
 * add method
 *
 * @return void
 */
	public function add() {
		if ($this->request->is('post')) {
			$this->User->create();
			if ($this->User->save($this->request->data)) {
				$this->Session->setFlash(__('The user has been saved.'));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
			}
		}
		$groups = $this->User->Group->find('list');
		$this->set(compact('groups'));
	}

/**
 * edit method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function edit($id = null) {
		if (!$this->User->exists($id)) {
			throw new NotFoundException(__('Invalid user'));
		}
		if ($this->request->is(array('post', 'put'))) {
			if ($this->User->save($this->request->data)) {
				$this->Session->setFlash(__('The user has been saved.'));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
			}
		} else {
			$options = array('conditions' => array('User.' . $this->User->primaryKey => $id));
			$this->request->data = $this->User->find('first', $options);
		}
		$groups = $this->User->Group->find('list');
		$this->set(compact('groups'));
	}

/**
 * delete method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function delete($id = null) {
		$this->User->id = $id;
		if (!$this->User->exists()) {
			throw new NotFoundException(__('Invalid user'));
		}
		$this->request->allowMethod('post', 'delete');
		if ($this->User->delete()) {
			$this->Session->setFlash(__('The user has been deleted.'));
		} else {
			$this->Session->setFlash(__('The user could not be deleted. Please, try again.'));
		}
		return $this->redirect(array('action' => 'index'));
	}
}


text:
using UnityEngine;
using System.Collections;

public class CameraDrag : MonoBehaviour
{
	public float MinX = 0;
	public float MaxX = 0;
	public float Speed = 400f;
	public float _SmoothTime = 2f;

	private Camera _Camera;
	private Transform _CameraTransform;

	private bool _IsDragging = false;
	private bool _UnderInertia = false;
	private float _Time = 0.0f;

	private Vector3 _TouchOrigin;
	private Vector3 _LastDragPosition;
	private float _CurrentSpeed;

	private float _TouchBeganTime;
	private float _TouchDragTime = 0.08f; //0.15f

	// Use this for initialization
	void Start()
	{
		_Camera = GetComponent<Camera>();

		if (_Camera == null)
			_Camera = Camera.main;

		_CameraTransform = _Camera.transform;
	}

	void MoveCamera(float deltaX)
	{
		Vector3 move = new Vector3(deltaX * Speed, 0, 0);

		_CameraTransform.Translate(move, Space.Self);

		Vector3 currentPos = _CameraTransform.position;
		if (currentPos.x >= MaxX)
		{
			currentPos.x = MaxX;
			_CameraTransform.position = currentPos;
		}
		else if (currentPos.x <= MinX)
		{
			currentPos.x = MinX;
			_CameraTransform.position = currentPos;
		}
	}

	// Update is called once per frame
	void Update()
	{
		//Pause
		if (Utilities.IS_PAUSED) return;

		if(_UnderInertia && _Time <= _SmoothTime)
		{
			MoveCamera(_CurrentSpeed * -1);
			_CurrentSpeed = Mathf.Lerp(_CurrentSpeed, 0, _Time / _SmoothTime);

			_Time += Time.deltaTime;
		}
		else
		{
			_UnderInertia = false;
			_Time = 0.0f;
		}

		if (Input.touchCount > 0)
		{
			foreach(Touch t in Input.touches)
			{
				if (t.phase == TouchPhase.Began)
				{
					_TouchOrigin = Input.mousePosition;
					_LastDragPosition = _TouchOrigin;

					_TouchBeganTime = Time.time;
				}
				else if (t.phase == TouchPhase.Moved)
				{
					if (!_IsDragging)
					{
						if (Time.time - _TouchBeganTime > _TouchDragTime)
						{
							_TouchOrigin = Input.mousePosition;
							_LastDragPosition = _TouchOrigin;

							_IsDragging = true;
							_UnderInertia = false;
						}
					}
					else
					{
						Vector3 pos = _Camera.ScreenToViewportPoint(Input.mousePosition - _LastDragPosition);

						_CurrentSpeed = pos.x;
						MoveCamera(_CurrentSpeed * -1);

						_LastDragPosition = t.position;
					}
				}
				else if (t.phase == TouchPhase.Ended)
				{
					if (_IsDragging)
					{
						_IsDragging = false;
						_UnderInertia = true;
					}
				}
			}
		}
		else
		{
			if(Input.GetMouseButtonDown(0))
			{
				_TouchOrigin = Input.mousePosition;
				_LastDragPosition = _TouchOrigin;

				_IsDragging = true;
				_UnderInertia = false;
			}

			if (!Input.GetMouseButton(0))
			{
				_IsDragging = false;
				_UnderInertia = true;
			}

			if (_IsDragging)
			{
				Vector3 pos = _Camera.ScreenToViewportPoint(Input.mousePosition - _LastDragPosition);

				_CurrentSpeed = pos.x;
				MoveCamera(_CurrentSpeed * -1);

				_LastDragPosition = Input.mousePosition;
			}
		}
	}

	public bool IsMoving()
	{
		bool move = false;

		if (Input.touchCount > 0)
		{
			move = _IsDragging;
		}
		else
		{
			move = _CurrentSpeed != 0f || _Time != 0f;
		}

		return move;
	}
}


text:
package org.apache.drill.exec.server;

import static com.google.common.base.Preconditions.checkNotNull;
import io.netty.channel.EventLoopGroup;

import java.util.Collection;
import java.util.concurrent.ExecutorService;

import org.apache.drill.common.config.DrillConfig;
import org.apache.drill.common.config.LogicalPlanPersistence;
import org.apache.drill.common.scanner.persistence.ScanResult;
import org.apache.drill.exec.compile.CodeCompiler;
import org.apache.drill.exec.coord.ClusterCoordinator;
import org.apache.drill.exec.expr.fn.FunctionImplementationRegistry;
import org.apache.drill.exec.memory.BufferAllocator;
import org.apache.drill.exec.physical.impl.OperatorCreatorRegistry;
import org.apache.drill.exec.planner.PhysicalPlanReader;
import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
import org.apache.drill.exec.rpc.control.Controller;
import org.apache.drill.exec.rpc.control.WorkEventBus;
import org.apache.drill.exec.rpc.data.DataConnectionCreator;
import org.apache.drill.exec.server.options.SystemOptionManager;
import org.apache.drill.exec.store.SchemaFactory;
import org.apache.drill.exec.store.StoragePluginRegistry;
import org.apache.drill.exec.store.sys.PStoreProvider;

import com.codahale.metrics.MetricRegistry;

public class DrillbitContext {
//  private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillbitContext.class);

  private final BootStrapContext context;
  private final PhysicalPlanReader reader;
  private final ClusterCoordinator coord;
  private final DataConnectionCreator connectionsPool;
  private final DrillbitEndpoint endpoint;
  private final StoragePluginRegistry storagePlugins;
  private final OperatorCreatorRegistry operatorCreatorRegistry;
  private final Controller controller;
  private final WorkEventBus workBus;
  private final FunctionImplementationRegistry functionRegistry;
  private final SystemOptionManager systemOptions;
  private final PStoreProvider provider;
  private final CodeCompiler compiler;
  private final ScanResult classpathScan;
  private final LogicalPlanPersistence lpPersistence;

  public DrillbitContext(
      DrillbitEndpoint endpoint,
      BootStrapContext context,
      ClusterCoordinator coord,
      Controller controller,
      DataConnectionCreator connectionsPool,
      WorkEventBus workBus,
      PStoreProvider provider) {
    this.classpathScan = context.getClasspathScan();
    this.workBus = workBus;
    this.controller = checkNotNull(controller);
    this.context = checkNotNull(context);
    this.coord = coord;
    this.connectionsPool = checkNotNull(connectionsPool);
    this.endpoint = checkNotNull(endpoint);
    this.provider = provider;
    this.lpPersistence = new LogicalPlanPersistence(context.getConfig(), classpathScan);

    // TODO remove escaping "this".
    this.storagePlugins = context.getConfig()
        .getInstance(StoragePluginRegistry.STORAGE_PLUGIN_REGISTRY_IMPL, StoragePluginRegistry.class, this);

    this.reader = new PhysicalPlanReader(context.getConfig(), classpathScan, lpPersistence, endpoint, storagePlugins);
    this.operatorCreatorRegistry = new OperatorCreatorRegistry(classpathScan);
    this.systemOptions = new SystemOptionManager(lpPersistence, provider);
    this.functionRegistry = new FunctionImplementationRegistry(context.getConfig(), classpathScan, systemOptions);
    this.compiler = new CodeCompiler(context.getConfig(), systemOptions);
  }

  public FunctionImplementationRegistry getFunctionImplementationRegistry() {
    return functionRegistry;
  }

  public WorkEventBus getWorkBus() {
    return workBus;
  }

  /**
   * @return the system options manager. It is important to note that this manager only contains options at the
   * "system" level and not "session" level.
   */
  public SystemOptionManager getOptionManager() {
    return systemOptions;
  }

  public DrillbitEndpoint getEndpoint() {
    return endpoint;
  }

  public DrillConfig getConfig() {
    return context.getConfig();
  }

  public Collection<DrillbitEndpoint> getBits() {
    return coord.getAvailableEndpoints();
  }

  public BufferAllocator getAllocator() {
    return context.getAllocator();
  }

  public OperatorCreatorRegistry getOperatorCreatorRegistry() {
    return operatorCreatorRegistry;
  }

  public StoragePluginRegistry getStorage() {
    return this.storagePlugins;
  }

  public EventLoopGroup getBitLoopGroup() {
    return context.getBitLoopGroup();
  }

  public DataConnectionCreator getDataConnectionsPool() {
    return connectionsPool;
  }

  public Controller getController() {
    return controller;
  }

  public MetricRegistry getMetrics() {
    return context.getMetrics();
  }

  public PhysicalPlanReader getPlanReader() {
    return reader;
  }

  public PStoreProvider getPersistentStoreProvider() {
    return provider;
  }

  public SchemaFactory getSchemaFactory() {
    return storagePlugins.getSchemaFactory();
  }

  public ClusterCoordinator getClusterCoordinator() {
    return coord;
  }

  public CodeCompiler getCompiler() {
    return compiler;
  }

  public ExecutorService getExecutor() {
    return context.getExecutor();
  }

  public LogicalPlanPersistence getLpPersistence() {
    return lpPersistence;
  }

  public ScanResult getClasspathScan() {
    return classpathScan;
  }

}


text:
namespace RAGENativeUI.Elements
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;

    /// <summary>
    /// Represents a timer bar containing a list of checkpoints.
    /// <para>
    /// Each checkpoint is drawn as a circle which is either greyed out when not completed, black when failed or of a specific color when completed.
    /// Additionally, it can be crossed out.
    /// </para>
    /// <para>
    /// The state of the checkpoints is defined using the <see cref="TimerBarCheckpoint"/> class and the <see cref="Checkpoints"/> property.
    /// </para>
    /// </summary>
    /// <see cref="TimerBarCheckpoint"/>
    /// <see cref="TimerBarCheckpointState"/>
    public class CheckpointsTimerBar : TimerBarBase
    {
        private IList<TimerBarCheckpoint> checkpoints;

        /// <summary>
        /// Gets or sets the list containing the <see cref="TimerBarCheckpoint"/>s of the timer bar.
        /// The checkpoints are shown from right to left: the checkpoint at index 0 is the right-most circle
        /// and the last checkpoint in the list is the left-most circle.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <c>value</c> is null.
        /// </exception>
        public IList<TimerBarCheckpoint> Checkpoints
        {
            get => checkpoints;
            set => checkpoints = value ?? throw new ArgumentNullException(nameof(value));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CheckpointsTimerBar"/> class.
        /// </summary>
        /// <param name="label">A <see cref="string"/> that will appear at the left side of the timer bar.</param>
        /// <param name="numberOfCheckpoints">Determines the number of <see cref="TimerBarCheckpoint"/>s created initially.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="numberOfCheckpoints"/> is negative.</exception>
        public CheckpointsTimerBar(string label, int numberOfCheckpoints) : base(label)
        {
            if (numberOfCheckpoints < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(numberOfCheckpoints), numberOfCheckpoints, $"{nameof(numberOfCheckpoints)} is negative");
            }

            Thin = true;

            Checkpoints = new List<TimerBarCheckpoint>();
            for (int i = 0; i < numberOfCheckpoints; i++)
            {
                Checkpoints.Add(new TimerBarCheckpoint());
            }
        }

        /// <inheritdoc/>
        public override void Draw(float x, float y)
        {
            base.Draw(x, y);

            if (Checkpoints.Count > 0)
            {
                x += TB.CheckpointXOffset;
                y += TB.CheckpointYOffset;

                bool requestedCrossTxd = false;
                foreach (TimerBarCheckpoint cp in Checkpoints)
                {
                    if (cp != null)
                    {
                        Color circleColor = cp.State switch
                        {
                            TimerBarCheckpointState.Completed => cp.Color,
                            TimerBarCheckpointState.Failed => Color.Black,
                            _ => Color.FromArgb(51, 255, 255, 255),
                        };

                        N.DrawSprite(TB.CheckpointTextureDictionary, TB.CheckpointTextureName, x, y, TB.CheckpointWidth, TB.CheckpointHeight, 0.0f,
                                    circleColor.R, circleColor.G, circleColor.B, circleColor.A);

                        if (cp.IsCrossedOut)
                        {
                            if (!requestedCrossTxd)
                            {
                                N.RequestStreamedTextureDict(TB.CrossTextureDictionary);
                                if (!N.HasStreamedTextureDictLoaded(TB.CrossTextureDictionary))
                                {
                                    break;
                                }

                                requestedCrossTxd = true;
                            }

                            int crossColor = cp.State == TimerBarCheckpointState.Failed ? 255 : 0;
                            N.DrawSprite(TB.CrossTextureDictionary, TB.CrossTextureName, x, y, TB.CheckpointWidth, TB.CheckpointHeight, 0.0f,
                                        crossColor, crossColor, crossColor, 250);
                        }
                    }

                    x -= TB.CheckpointPadding;
                }
            }
        }
    }

    /// <summary>
    /// Specifies the state of a <see cref="TimerBarCheckpoint"/>.
    /// </summary>
    public enum TimerBarCheckpointState
    {
        /// <summary>
        /// Represents an unfinished objective. Shown as a grey circle.
        /// </summary>
        InProgress = 0,
        /// <summary>
        /// Represents a successfully completed objective. Shown as a circle with color <see cref="TimerBarCheckpoint.Color"/>.
        /// </summary>
        Completed,
        /// <summary>
        /// Represents a failed objective. Shown as a black circle.
        /// </summary>
        Failed,
    }

    /// <summary>
    /// Represents a checkpoint of a <see cref="CheckpointsTimerBar"/>.
    /// </summary>
    public class TimerBarCheckpoint
    {
        /// <summary>
        /// Gets or sets the current state of this checkpoint.
        /// </summary>
        public TimerBarCheckpointState State { get; set; }

        /// <summary>
        /// Gets or sets whether the checkpoint is crossed out.
        /// If <c>true</c>, a cross is drawn on top of the checkpoint circle, otherwise, nothing is drawn on top.
        /// </summary>
        public bool IsCrossedOut { get; set; }

        /// <summary>
        /// Gets or sets the color used to draw the checkpoint when <see cref="State"/> is set to <see cref="TimerBarCheckpointState.Completed"/>.
        /// </summary>
        public Color Color { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="TimerBarCheckpoint"/> class with the given color.
        /// </summary>
        /// <param name="color">The color used to draw the checkpoint when <see cref="State"/> is set to <see cref="TimerBarCheckpointState.Completed"/></param>
        public TimerBarCheckpoint(Color color)
        {
            State = TimerBarCheckpointState.InProgress;
            IsCrossedOut = false;
            Color = color;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TimerBarCheckpoint"/> class with <see cref="Color"/> set to <see cref="Color.White"/>.
        /// </summary>
        public TimerBarCheckpoint() : this(Color.White)
        {
        }
    }
}


text:
angular.module('admin-projects', ['resources.projects', 'resources.users', 'services.crud'])

.config(['crudRouteProvider', function (crudRouteProvider) {

  var adminUser =  ['AuthenticationService', function(AuthenticationService) {
    return AuthenticationService.requireAdminUser();
  }];

  var getAllUsers = ['Projects', 'Users', '$route', function(Projects, Users, $route){
    return Users.all();
  }];

  crudRouteProvider.routesFor('Projects', 'admin')
    .whenList({
      projects: ['Projects', function(Projects) { return Projects.all(); }],
      adminUser: adminUser
    })
    .whenNew({
      project: ['Projects', function(Projects) { return new Projects(); }],
      users: getAllUsers,
      adminUser: adminUser
    })
    .whenEdit({
      project: ['Projects', 'Users', '$route', function(Projects, Users, $route) { return Projects.getById($route.current.params.itemId); }],
      users: getAllUsers,
      adminUser: adminUser
    });
}])

.controller('ProjectsListCtrl', ['$scope', 'crudListMethods', 'projects', function($scope, crudListMethods, projects) {
  $scope.projects = projects;

  angular.extend($scope, crudListMethods('/admin/projects'));
}])

.controller('ProjectsEditCtrl', ['$scope', '$location', 'i18nNotifications', 'users', 'project', function($scope, $location, i18nNotifications, users, project) {

  $scope.project = project;
  $scope.selTeamMember = undefined;

  $scope.users = users;
  //prepare users lookup, just keep references for easier lookup
  $scope.usersLookup = {};
  angular.forEach(users, function(value, key) {
    $scope.usersLookup[value.$id()] = value;
  });

  $scope.onSave = function(project) {
    i18nNotifications.pushForNextRoute('crud.project.save.success', 'success', {id : project.$id()});
    $location.path('/admin/projects');
  };

  $scope.onError = function() {
    i18nNotifications.pushForCurrentRoute('crud.project.save.error', 'error');
  };

  $scope.project.teamMembers = $scope.project.teamMembers || [];

  $scope.productOwnerCandidates = function() {
    return $scope.users.filter(function(user) {
      return $scope.usersLookup[user.$id()] && $scope.project.canActAsProductOwner(user.$id());
    });
  };

  $scope.scrumMasterCandidates = function() {
    return $scope.users.filter(function(user) {
      return $scope.usersLookup[user.$id()] && $scope.project.canActAsScrumMaster(user.$id());
    });
  };

  $scope.teamMemberCandidates = function() {
    return $scope.users.filter(function(user) {
      return $scope.usersLookup[user.$id()] && $scope.project.canActAsDevTeamMember(user.$id()) && !$scope.project.isDevTeamMember(user.$id());
    });
  };

  $scope.addTeamMember = function() {
    if($scope.selTeamMember) {
      $scope.project.teamMembers.push($scope.selTeamMember);
      $scope.selTeamMember = undefined;
    }
  };

  $scope.removeTeamMember = function(teamMember) {
    var idx = $scope.project.teamMembers.indexOf(teamMember);
    if(idx >= 0) {
      $scope.project.teamMembers.splice(idx, 1);
    }
  };
}]);


text:
var elixir = require('laravel-elixir'),
    gulp   = require('gulp');
var plugins = require('gulp-load-plugins')();

elixir.config.assetsPath = 'resources/themes/bootstrap/assets';
var themeResources = 'resources/themes/bootstrap/';
var public_theme_path = './public/themes/bootstrap/';
var packages_path = './packages/arangel/';

var paths = {
    'jquery': './vendor/bower_components/jquery/',
    'bootstrap': './vendor/bower_components/bootstrap/',
    'fontAwesome' : './vendor/bower_components/font-awesome/',
    'angularBootstrap' : './vendor/bower_components/angular-bootstrap/',
    'angular': "./vendor/bower_components/angular/",
    'angularResource' : './vendor/bower_components/angular-resource/',
    'angularMessages' : './vendor/bower_components/angular-messages/',
    'angularUiRoute': "./vendor/bower_components/angular-ui-router/",
    'angularCookie': './vendor/bower_components/angular-cookie/',
    'angularCookies': './vendor/bower_components/angular-cookies/',
    'angularAnimate' : './vendor/bower_components/angular-animate/',
    'angularTranslate' : './vendor/bower_components/angular-translate/',
    'angularTranslateLoader' : './vendor/bower_components/angular-translate-loader-url/',
    'angularTranslateStaticLoader' : './vendor/bower_components/angular-translate-loader-static-files/',
    'angularTranslateStorageLocal' : './vendor/bower_components/angular-translate-storage-local/',
    'angularTranslateStorageCookie' : './vendor/bower_components/angular-translate-storage-cookie/',
    'angularSanitize' : './vendor/bower_components/angular-sanitize/',
    'angularTokenAuth': './vendor/bower_components/ng-token-auth/dist/',
    'satellizer' : './vendor/bower_components/satellizer/',
    'adminLTE' : './vendor/bower_components/admin-lte/',
    'angularGoogleMaps':  './vendor/bower_components/angular-google-maps/',
    'angularSimpleLogger':  './vendor/bower_components/angular-simple-logger/',
    'lodash': './vendor/bower_components/lodash/',
    'ngTable' : './vendor/bower_components/ng-table/',
    'angularBootstrapMultiselect' : './vendor/bower_components/angular-bootstrap-multiselect/'
};

function getTask(task, b_path, p_path, filename) {
    return require('./gulp-tasks/' + task)(gulp, plugins, b_path, p_path);
}

function getGlobalScripts(){
    return [
        paths.jquery + "dist/jquery.js",
        paths.bootstrap + "dist/js/bootstrap.min.js",
        paths.angular + "angular.js",
        paths.angularBootstrap + "ui-bootstrap.min.js",
        paths.angularBootstrap + "ui-bootstrap-tpls.min.js",
        paths.angularResource + 'angular-resource.min.js',
        paths.angularMessages + 'angular-messages.min.js',
        paths.angularUiRoute + "release/angular-ui-router.min.js",
        paths.angularAnimate + 'angular-animate.min.js',
        paths.angularTranslate + 'angular-translate.min.js',
        paths.angularTranslateLoader + 'angular-translate-loader-url.min.js',
        paths.angularTranslateStaticLoader + 'angular-translate-loader-static-files.min.js',
        paths.angularTranslateStorageLocal + 'angular-translate-storage-local.min.js',
        paths.angularTranslateStorageCookie + 'angular-translate-storage-cookie.min.js',
        paths.angularCookies + 'angular-cookies.min.js',
        paths.angularSanitize + 'angular-sanitize.min.js',
        paths.satellizer + 'satellizer.min.js',
        paths.adminLTE + 'dist/js/app.js',
        paths.lodash + 'lodash.min.js',
        paths.angularGoogleMaps + 'dist/angular-google-maps_dev_mapped.js',
        paths.angularSimpleLogger + 'dist/index.js',
        paths.angularBootstrapMultiselect + 'angular-bootstrap-multiselect.js',
        paths.ngTable + 'dist/ng-table.min.js'
    ];
}

elixir(function(mix) {

    /*
     *   AUTH TASKS
     */
    gulp.task('auth-scripts', getTask('auth-scripts', packages_path+'/smart-auth/src/Resources/assets/js', public_theme_path));
    gulp.task('auth-less', getTask('less', packages_path+'/smart-auth/src/Resources/assets/less', public_theme_path));
    gulp.task('auth-jade', getTask('jade', packages_path+'/smart-auth/src/Resources/jade', public_theme_path));
    //gulp.task('auth-lang', getTask('auth-lang', packages_path+'/smart-auth/src/Resources/lang', themeResources+'assets/resources/'));

    /*
     *   ADMIN TASKS
     */
    gulp.task('admin-scripts', getTask('admin-scripts', packages_path+'/smart-admin/src/Resources/assets/js', public_theme_path));
    gulp.task('admin-less', getTask('less', packages_path+'/smart-admin/src/Resources/assets/less', public_theme_path));
    gulp.task('admin-jade', getTask('jade', packages_path+'/smart-admin/src/Resources/jade', public_theme_path));

    /*
     *   GLOBAL TASKS
     */
    gulp.task('global-jade', getTask('jade', themeResources+'jade', public_theme_path));
    gulp.task('global-images', getTask('imgs', elixir.config.assetsPath+'/images', public_theme_path));
    gulp.task('global-locales', getTask('lang', elixir.config.assetsPath+'/resources', public_theme_path));

    mix.task('auth-scripts')
        .task('auth-less')
        .task('auth-jade')
        .task('admin-scripts')
        .task('admin-less')
        .task('admin-jade')
        .less('styles.less', public_theme_path+'assets/css/styles.css')
        .task('global-jade', themeResources+'jade/**/*.jade')
        //.task('global-images', elixir.config.assetsPath+'/images/**/*.{png,gif,jpg,svg}')
        //.task('global-locales', elixir.config.assetsPath+'/resources/**/*.json')
        .copy(paths.bootstrap + 'fonts/**', public_theme_path+'assets/fonts')
        .copy(paths.fontAwesome + 'fonts/**', public_theme_path+'assets/fonts')
        .scripts(getGlobalScripts(), public_theme_path+'assets/js/scripts.js')
        .scripts(["app.js"], public_theme_path+'assets/js/app.js')
        .scripts(["controllers/public.js"], public_theme_path+'assets/js/controllers.js')
        .scripts(["directives/checkImage.js"], public_theme_path+'assets/js/directives.js')
        .scripts([
            "services/alert.js",
            "services/global.js",
            "services/http.js"
        ], public_theme_path+'assets/js/services.js')
        .scripts([
            "libs/es5-shim.min.js",
            "libs/es5-sham.min.js",
            "libs/console.sham.js"
        ], public_theme_path+'assets/js/libs.js')
});


text:
package net.omniscimus.fireworks;

import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Map;
import java.util.logging.Level;

import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

/**
 * Access point for config-based actions. The plugin has two custom configs:
 * runningshows.yml, to which running shows are saved on server shutdown, so
 * they can be started again on server startup. savedshows.yml, to which shows
 * are saved if the user wishes to stop a show and save it for later use.
 *
 * @author Omniscimus
 */
public class ConfigHandler {

    private final Fireworks plugin;

    public ConfigHandler(Fireworks plugin) {
        this.plugin = plugin;
    }

    /**
     * Saves all currently running shows to runningshows.yml.
     *
     * @throws UnsupportedEncodingException if runningshows.yml has an
     * unsupported encoding
     */
    protected void saveRunningShows() throws UnsupportedEncodingException {
        getConfig(FireworksConfigType.RUNNINGSHOWS)
                .set("saved-shows", plugin.getShowHandler().getRunningShowsLocations().toArray());
        saveCustomConfig(FireworksConfigType.RUNNINGSHOWS);
    }

    /**
     * Saves the specified show to savedshows.yml.
     *
     * @param showName the name of the show to save
     * @throws UnsupportedEncodingException if runningshows.yml as an
     * unsupported encoding
     * @throws IOException If the file with saved shows couldn't be saved.
     */
    public void saveRunningShow(String showName)
            throws UnsupportedEncodingException, IOException {
        ArrayList<Location> show = new ArrayList<>();
        ShowHandler showHandler = plugin.getShowHandler();
        show.addAll(showHandler.getRunningShowsLocations());

        Map<String, ArrayList<Location>> savedShows
                = showHandler.getSavedShows();
        savedShows.put(showName, show);
        getConfig(FireworksConfigType.SAVEDSHOWS).set("saved-shows", savedShows);
        FireworksConfigType.SAVEDSHOWS.save();
    }

    /**
     * Deletes a saved show from savedshows.yml.
     *
     * @param showName the name of the show to delete
     * @return true if the show was removed; false if there was no show with
     * that name
     * @throws IOException If the file with saved shows couldn't be saved.
     */
    public boolean removeSavedShow(String showName) throws IOException {
        ShowHandler showHandler = plugin.getShowHandler();
        Map<String, ArrayList<Location>> savedShows
                = showHandler.getSavedShows();
        if (savedShows.remove(showName) == null) {
            return false;
        }
        getConfig(FireworksConfigType.SAVEDSHOWS).set("saved-shows", savedShows);
        FireworksConfigType.SAVEDSHOWS.save();
        return true;
    }

    /**
     * Reloads one of the plugin's configs, which can then be accessed via
     * getCustomConfig(whichConfig);
     *
     * @param whichConfig the config which should be reloaded
     * @throws IOException If the config file is a directory.
     */
    public void reloadConfig(FireworksConfigType whichConfig) throws IOException {
        if (whichConfig != FireworksConfigType.CONFIG) {

            if (whichConfig.getFile() == null) {
                File file = new File(plugin.getDataFolder(), whichConfig.getFileName());
                if (!file.exists()) {
                    File parent = file.getParentFile();
                    if (!parent.isDirectory()) {
                        if (!parent.mkdirs()) {
                            throw new IOException("Couldn't create the directory: " + parent);
                        }
                    }
                    file.createNewFile();
                } else {
                    if (!file.isFile()) {
                        throw new IOException("Configuration file is a directory! " + file);
                    }
                }
                whichConfig.setFile(file);
            }

            whichConfig.setFileConfiguration(
                    YamlConfiguration.loadConfiguration(whichConfig.getFile()));
            Reader defConfigStream;
            try {
                defConfigStream = new InputStreamReader(
                        plugin.getResource(whichConfig.getFileName()), "UTF8");
            } catch (UnsupportedEncodingException e) {
                sendExceptionMessage(e);
                return;
            }
            YamlConfiguration defConfig
                    = YamlConfiguration.loadConfiguration(defConfigStream);
            whichConfig.getFileConfiguration().setDefaults(defConfig);

        } else {
            plugin.reloadConfig();
        }
    }

    /**
     * Gets the custom config of the specified type.
     *
     * @param whichConfig the config that should be returned
     * @return a FileConfiguration instance belonging to the specified config
     * type
     */
    public FileConfiguration getConfig(FireworksConfigType whichConfig) {
        if (whichConfig != FireworksConfigType.CONFIG) {
            if (whichConfig.getFileConfiguration() == null) {
                try {
                    reloadConfig(whichConfig);
                } catch (IOException ex) {
                    sendExceptionMessage(ex);
                    return null;
                }
            }
            return whichConfig.getFileConfiguration();
        } else {
            return plugin.getConfig();
        }
    }

    /**
     * Saves the custom config of the specified type.
     *
     * @param whichConfig the config that should be saved
     */
    public void saveCustomConfig(FireworksConfigType whichConfig) {
        try {
            getConfig(whichConfig).save(whichConfig.getFile());
        } catch (IOException e) {
            sendExceptionMessage(e);
        }
    }

    /**
     * Sends an error message to the console.
     *
     * @param e Exception that occurred
     */
    private void sendExceptionMessage(Exception e) {
        plugin.getLogger()
                .log(Level.WARNING, "Something went wrong while accessing the save file!", e);
    }

}


text:
using Microsoft.WindowsAzure.Storage.Table;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace MappyData
{
    public static class RoutePointSourceFactory
    {
        public static async Task StartAsync(string pointSourceName, Action<IRoutePoint> onNewPoint)
        {
            if (string.IsNullOrWhiteSpace(pointSourceName)) throw new ArgumentNullException("pointSourceName");
            switch (pointSourceName.ToLowerInvariant())
            {
                case "eventhub":
                    {
                        await new EventHubRoutePointSource(onNewPoint).StartAsync();
                    }
                    break;

                case "random":
                    {
                        await new RandomRoutePointSource(onNewPoint).StartAsync();
                    }
                    break;

                case "tablestorage":
                    {
                        new TableStorageRoutePointSource(onNewPoint).Start();
                    }
                    break;

                default:
                    throw new ArgumentException("Unknown point source: " + pointSourceName);
            }
        }
    }

    public class EventHubRoutePointSource
    {
        public EventHubRoutePointSource(Action<IRoutePoint> onNewPoint)
        {
            this._onPoint = onNewPoint;
        }

        public async Task StartAsync()
        {
            var ehConnStr = AzureUtilities.ServiceBusConnectionString(
                AzureUtilities.FromConfiguration("MappyServiceBusNamespace"),
                AzureUtilities.FromConfiguration("MappyEventHubSASName"),
                AzureUtilities.FromConfiguration("MappyEventHubSASKey"));
            var storageConnStr = AzureUtilities.StorageConnectionString(
                AzureUtilities.FromConfiguration("MappyStorageName"),
                AzureUtilities.FromConfiguration("MappyStorageKey"));
            var eventHubName = AzureUtilities.FromConfiguration("MappyEventHubName");
            var consumerGroup = AzureUtilities.FromConfiguration("MappyConsumerGroupName") ?? "$Default";

            Trace.TraceInformation("Connecting to {0}/{1}/{2}, storing in {3}", ehConnStr, eventHubName, consumerGroup, storageConnStr);

            var factory = new RoutePointProcessorFactory(item =>
            {
                Trace.TraceInformation("From EH: {0} @ ({1}, {2})", item.UserID, item.Latitude, item.Longitude);
                this._onPoint(item);
            });
            await AzureUtilities.AttachProcessorForHub("mappy", ehConnStr, storageConnStr, eventHubName, consumerGroup, factory);
        }

        private Action<IRoutePoint> _onPoint;
    }

    public class TableStorageRoutePointSource
    {
        public TableStorageRoutePointSource(Action<IRoutePoint> onNewPoint)
        {
            this.RouteItemTable = AzureUtilities.GetRoutePointsTable();
            this.LastCheck = DateTime.UtcNow.AddHours(-24);
            this._onPoint = onNewPoint;
        }

        public void Start()
        {
            var quanta = 10000;
            Task.Run(async () =>
            {
                while (true)
                {
                    await Task.Delay(1000);
                    foreach (var item in AzureUtilities.GetRoutePointsFromTo(this.RouteItemTable, this.LastCheck, this.LastCheck.AddSeconds(quanta)))
                    {
                        Trace.TraceInformation("Sending point ({0}, {1}, {2})", item.UserID, item.Latitude, item.Longitude);
                        this._onPoint(item);
                    }
                    this.LastCheck = this.LastCheck.AddSeconds(quanta);
                    if (this.LastCheck > DateTime.UtcNow) this.LastCheck = DateTime.UtcNow;
                }
            });
        }

        private CloudTable RouteItemTable { get; set; }

        private DateTime LastCheck { get; set; }

        private Action<IRoutePoint> _onPoint;
    }

    public class RandomRoutePointSource
    {
        public RandomRoutePointSource(Action<IRoutePoint> onNewPoint, int seed = 17, int millisBetweenPoints = 100, int numUsers = 20, double maxRangeLatLong = .1)
        {
            this._random = new Random(seed);
            this._timeBetweenPoints = TimeSpan.FromMilliseconds(millisBetweenPoints);
            this._numUsers = numUsers;
            this._maxRange = maxRangeLatLong;
            this.Cancel = new CancellationToken();
            this._onPoint = onNewPoint;
        }

        public CancellationToken Cancel;

        private Random _random;
        private TimeSpan _timeBetweenPoints;
        private int _numUsers;
        private double _maxRange;
        private double _centerLat = MappyData.Constants.SeattleLatitude;
        private double _centerLon = MappyData.Constants.SeattleLongitude;
        private Dictionary<int, RoutePoint> _previousPoint = new Dictionary<int, RoutePoint>();
        private Action<IRoutePoint> _onPoint;

        public async Task StartAsync()
        {
            while (!this.Cancel.IsCancellationRequested)
            {
                var point = GeneratePoint();
                this._onPoint(point);
                await Task.Delay(_timeBetweenPoints);
            }
        }

        private RoutePoint GeneratePoint()
        {
            var user = _random.Next(1, _numUsers);
            RoutePoint prev, cur;
            if (_previousPoint.TryGetValue(user, out prev))
            {
                cur = new RoutePoint()
                {
                    Latitude = NextCoord(prev.Latitude, _maxRange / 100.0),
                    Longitude = NextCoord(prev.Longitude, _maxRange / 100.0),
                    UserID = user.ToString(),
                    MeasurementTime = DateTime.UtcNow
                };
            }
            else
            {
                cur = new RoutePoint()
                {
                    Latitude = NextCoord(_centerLat, _maxRange),
                    Longitude = NextCoord(_centerLon, _maxRange),
                    UserID = user.ToString(),
                    MeasurementTime = DateTime.UtcNow
                };
            }

            _previousPoint[user] = cur;
            Trace.TraceInformation("Generated {0}", cur);
            return cur;
        }

        private double NextCoord(double center, double maxRange)
        {
            return center + (_random.NextDouble() * maxRange) - (maxRange / 2.0);
        }

        private class RoutePoint : IRoutePoint
        {
            public double Latitude { get; set; }
            public double Longitude { get; set; }
            public DateTime MeasurementTime { get; set; }
            public string UserID { get; set; }

            public override string ToString()
            {
                return string.Format("Pt({0} @ {1},{2} @ {3}", UserID, Latitude, Longitude, MeasurementTime.ToString("o"));
            }
        }
    }
}


text:
namespace Slp.Evi.Storage.Utils
{
    /// <summary>
    /// Visitable object for visitor pattern
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IVisitable<in T> where T : IVisitor
    {
        /// <summary>
        /// Accepts the specified visitor.
        /// </summary>
        /// <param name="visitor">The visitor.</param>
        /// <param name="data">The data.</param>
        /// <returns>The returned value from visitor.</returns>
        object Accept(T visitor, object data);
    }
}


text:
package org.lemurproject.galago.core.retrieval.ann;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Class annotates galago operators with a string representing format and
 * example of use.
 *
 * @author smh
 */

@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface OperatorDescription {
  String description () default "";
}