text:
package ch.zuehlke.campplanner.security.jwt;

import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

//@Component
@Order(Ordered.LOWEST_PRECEDENCE)
public class JwtFilter extends GenericFilterBean {

	private final AuthService authService;

	public JwtFilter(AuthService authService) {
		this.authService = authService;
	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
			throws IOException, ServletException {
		if ("OPTIONS".equalsIgnoreCase(((HttpServletRequest) request).getMethod())) {
			return;
		}
		Authentication authentication = authService.getAuthentication((HttpServletRequest) request);
		SecurityContextHolder.getContext().setAuthentication(authentication);
		filterChain.doFilter(request, response);
		SecurityContextHolder.getContext().setAuthentication(null);
	}
}


text:
require 'spec_helper'
require 'pawnee/base'

# NOTE: These are designed to run in order on vagrant
describe "package actions" do
  before do
    @base = Pawnee::Base.new
    @base.destination_connection = VagrantManager.connect
  end

  it 'should install a package' do
    @base.install_package('memcached', '1.4.7-0.1ubuntu1')
    @base.exec('which memcached').strip.should_not == ''
  end

  it 'should not reinstall a package' do
    # Should be called once for the package version query
    @base.destination_server.should_receive(:run).once.and_return('ii memcached 1.4.7-0.1ubuntu1')
    @base.install_package('memcached', '1.4.7-0.1ubuntu1')
  end

  it 'should return the version of a package installed' do
    @base.installed_package_version('memcached').should == '1.4.7-0.1ubuntu1'
  end

  it "should remove a package" do
    @base.remove_package('memcached')
    @base.exec('which memcached').should == ''
  end

  it "should not try to re-remove a package" do
    @base.destination_server.should_receive(:run).once.and_return('')
    @base.remove_package('memcached')
  end

  it "should not return the package version after the package has been removed" do
    @base.installed_package_version('memcached').should == nil
  end

end

redpajama_set_name: RedPajamaGithub


text:
<element name="b-collapsible">
    <style>
        :host {
            display: block;
        }

        .b-collapsible-header {
            cursor: pointer;
        }

        .b-collapsible-closed {
            display: none;
        }

        .b-collapsible-body {
            height: 0px;
        }
    </style>
    <script>
        window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
            window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;

        var HEADER_CLASS = 'b-collapsible-header',
            BODY_CLASS = 'b-collapsible-body',
            CLOSED_CLASS = 'b-collapsible-closed';

        ({
            get active() {
                return this.hasAttribute('active');
            },

            set active(value) {
                value ? this.setAttribute('active', '') : this.removeAttribute('active');
            },

            createdCallback: function() {
                this.duration = this.hasAttribute('duration') ? parseFloat(this.getAttribute('duration')) : 0.33;
                this.dimension = this.hasAttribute('horizontal') ? 'width' : 'height';
                this.header = this.querySelector('.' + HEADER_CLASS);
                this.body = this.querySelector('.' + BODY_CLASS) || this.header.nextElementSibling;

                if (this.body) {
                    this.body.style.overflow = 'hidden';
                    if (this.supportsTransitions()) {
                        this.body.classList.add(BODY_CLASS);
                        if (this.active) {
                            this.setSize('auto');
                        }
                    }
                    this.addListeners();
                    this.toggleClosedClass(!this.active);
                }
            },

            detachedCallback: function() {
                this.removeListeners();
            },

            addListeners: function() {
                if (this.header) {
                    this.toggleListener = this.toggle.bind(this);
                    this.header.addEventListener('click', this.toggleListener, false);
                }
                if (this.supportsTransitions()) {
                    this.transitionEndListener = this.transitionEnd.bind(this);
                    this.body.addEventListener('webkitTransitionEnd', this.transitionEndListener);
                    this.body.addEventListener('transitionend', this.transitionEndListener);
                }
            },

            removeListeners: function() {
                if (this.toggleListener) {
                    this.header.removeEventListener('click', this.toggleListener, false);
                }
                if (this.supportsTransitions()) {
                    this.body.removeEventListener('webkitTransitionEnd', this.transitionEndListener);
                    this.body.removeEventListener('transitionend', this.transitionEndListener);
                }
            },

            attributeChangedCallback: function(name, oldValue, newValue) {
                if (name === 'active') this.activeChanged(oldValue, newValue);
            },

            toggle: function() {
                if (!this.dispatchEvent(new CustomEvent('b-collapsible-toggle', { cancelable: true }))) return;
                this.active = !this.active;
            },

            activeChanged: function(oldValue, newValue) {
                this.update();
            },

            update: function() {
                if (!this.body) return;
                this.active ? this.show() : this.hide();
            },

            show: function() {
                if (!this.dispatchEvent(new CustomEvent('b-collapsible-show', { cancelable: true }))) return;

                this.toggleClosedClass(false);
                if (this.supportsTransitions()) {
                    var size = this.calcSize();
                    this.updateSize(size, this.duration);
                }
            },

            hide: function() {
                if (!this.dispatchEvent(new CustomEvent('b-collapsible-hide', { cancelable: true }))) return;

                if (!this.supportsTransitions()) {
                    this.toggleClosedClass(true);
                    return;
                }
                var size = this.computeSize();
                this.setSize(size);
                this.updateSize(0, this.duration);
            },

            updateSize: function(size, duration) {
                var that = this;
                window.requestAnimationFrame(function() {
                    that.setSize(size);
                    that.setTransitionDuration(duration);
                });
            },

            calcSize: function() {
                this.setSize('auto');
                var size = this.computeSize();
                this.setSize(0);
                return size;
            },

            computeSize: function() {
                var size = parseInt(this.body.getBoundingClientRect()[this.dimension]);
                return (size - this.getBorderWidth()) + 'px';
            },

            getBorderWidth: function() {
                return this.dimension === 'width'
                        ? this.computeWidth('borderLeftWidth') + this.computeWidth('borderRightWidth')
                        : this.computeWidth('borderTopWidth') + this.computeWidth('borderBottomWidth');
            },

            computeWidth: function(property) {
                return parseInt(getComputedStyle(this.body)[property].replace('px', ''));
            },

            setSize: function(size) {
                this.body.style[this.dimension] = size;
            },

            setTransitionDuration: function(duration) {
                var s = this.body.style;
                s.webkitTransition = s.transition = duration ? (this.dimension + ' ' + duration + 's') : null;
            },

            toggleClosedClass: function(closed) {
                closed ? this.body.classList.add(CLOSED_CLASS) : this.body.classList.remove(CLOSED_CLASS);
            },

            transitionEnd: function() {
                this.setTransitionDuration(null);
                if (this.active) {
                    this.setSize('auto');
                } else {
                    this.toggleClosedClass(true);
                }
            },

            supportsTransitions: function() {
                return window.requestAnimationFrame !== undefined;
            }
        });
    </script>
</element>


text:
package com.jme3.scene.shape;

import com.jme3.export.*;
import com.jme3.math.Vector3f;
import com.jme3.scene.Mesh;

import java.io.IOException;

/**
 * An eight sided box.
 *

 * A {@code Box} is defined by a minimal point and a maximal point. The eight
 * vertices that make the box are then computed, they are computed in such
 * a way as to generate an axis-aligned box.
 *

 * This class does not control how the geometry data is generated, see {@link Box}
 * for that.
 *
 * @author Ian Phillips
 * @version $Revision: 4131 $, $Date: 2009-03-19 16:15:28 -0400 (Thu, 19 Mar 2009) $
 */
public abstract class AbstractBox extends Mesh {

    public final Vector3f center = new Vector3f(0f, 0f, 0f);

    public float xExtent, yExtent, zExtent;

    public AbstractBox() {
        super();
    }

    /**
     * Gets the array or vectors representing the 8 vertices of the box.
     *
     * @return a newly created array of vertex vectors.
     */
    protected final Vector3f[] computeVertices() {
        Vector3f[] axes = {
                Vector3f.UNIT_X.mult(xExtent),
                Vector3f.UNIT_Y.mult(yExtent),
                Vector3f.UNIT_Z.mult(zExtent)
        };
        return new Vector3f[] {
                center.subtract(axes[0]).subtractLocal(axes[1]).subtractLocal(axes[2]),
                center.add(axes[0]).subtractLocal(axes[1]).subtractLocal(axes[2]),
                center.add(axes[0]).addLocal(axes[1]).subtractLocal(axes[2]),
                center.subtract(axes[0]).addLocal(axes[1]).subtractLocal(axes[2]),
                center.add(axes[0]).subtractLocal(axes[1]).addLocal(axes[2]),
                center.subtract(axes[0]).subtractLocal(axes[1]).addLocal(axes[2]),
                center.add(axes[0]).addLocal(axes[1]).addLocal(axes[2]),
                center.subtract(axes[0]).addLocal(axes[1]).addLocal(axes[2])
        };
    }

    /**
     * Convert the indices into the list of vertices that define the box's geometry.
     */
    protected abstract void doUpdateGeometryIndices();

    /**
     * Update the normals of each of the box's planes.
     */
    protected abstract void doUpdateGeometryNormals();

    /**
     * Update the points that define the texture of the box.
     *

     * It's a one-to-one ratio, where each plane of the box has its own copy
     * of the texture. That is, the texture is repeated one time for each face.
     */
    protected abstract void doUpdateGeometryTextures();

    /**
     * Update the position of the vertices that define the box.
     *

     * These eight points are determined from the minimum and maximum point.
     */
    protected abstract void doUpdateGeometryVertices();

    /**
     * Get the center point of this box.
     */
    public final Vector3f getCenter() {
        return center;
    }

    /**
     * Get the x-axis size (extent) of this box.
     */
    public final float getXExtent() {
        return xExtent;
    }

    /**
     * Get the y-axis size (extent) of this box.
     */
    public final float getYExtent() {
        return yExtent;
    }

    /**
     * Get the z-axis size (extent) of this box.
     */
    public final float getZExtent() {
        return zExtent;
    }

    /**
     * Rebuilds the box after a property has been directly altered.
     *

     * For example, if you call {@code getXExtent().x = 5.0f} then you will
     * need to call this method afterwards in order to update the box.
     */
    public final void updateGeometry() {
        doUpdateGeometryVertices();
        doUpdateGeometryNormals();
        doUpdateGeometryTextures();
        doUpdateGeometryIndices();
        setStatic();
    }

    /**
     * Rebuilds this box based on a new set of parameters.
     *

     * Note that the actual sides will be twice the given extent values because
     * the box extends in both directions from the center for each extent.
     *
     * @param center the center of the box.
     * @param x the x extent of the box, in each directions.
     * @param y the y extent of the box, in each directions.
     * @param z the z extent of the box, in each directions.
     */
    public final void updateGeometry(Vector3f center, float x, float y, float z) {
        if (center != null) {this.center.set(center); }
        this.xExtent = x;
        this.yExtent = y;
        this.zExtent = z;
        updateGeometry();
    }

    /**
     * Rebuilds this box based on a new set of parameters.
     *

     * The box is updated so that the two opposite corners are {@code minPoint}
     * and {@code maxPoint}, the other corners are created from those two positions.
     *
     * @param minPoint the new minimum point of the box.
     * @param maxPoint the new maximum point of the box.
     */
    public final void updateGeometry(Vector3f minPoint, Vector3f maxPoint) {
        center.set(maxPoint).addLocal(minPoint).multLocal(0.5f);
        float x = maxPoint.x - center.x;
        float y = maxPoint.y - center.y;
        float z = maxPoint.z - center.z;
        updateGeometry(center, x, y, z);
    }

    @Override
    public void read(JmeImporter e) throws IOException {
        super.read(e);
        InputCapsule capsule = e.getCapsule(this);
        xExtent = capsule.readFloat("xExtent", 0);
        yExtent = capsule.readFloat("yExtent", 0);
        zExtent = capsule.readFloat("zExtent", 0);
        center.set((Vector3f) capsule.readSavable("center", Vector3f.ZERO.clone()));
    }

    @Override
    public void write(JmeExporter e) throws IOException {
        super.write(e);
        OutputCapsule capsule = e.getCapsule(this);
        capsule.write(xExtent, "xExtent", 0);
        capsule.write(yExtent, "yExtent", 0);
        capsule.write(zExtent, "zExtent", 0);
        capsule.write(center, "center", Vector3f.ZERO);
    }

}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About Us - GREY MEDICAL</title>
<meta name="keywords" content="GREY MEDICAL">
<meta name="description" content="三小时 四城 亚洲名医">
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<meta name="robots" content="index, follow" />
<link href="css/main.min.css" rel="stylesheet">
<link href="css/contact.css" rel="stylesheet">
<link href="images/touch/apple-touch-icon.png" rel="apple-touch-icon" />
<link href="images/touch/apple-touch-icon-76x76.png" rel="apple-touch-icon" sizes="76x76" />
<link href="images/touch/apple-touch-icon-120x120.png" rel="apple-touch-icon" sizes="120x120" />
<link href="images/touch/apple-touch-icon-152x152.png" rel="apple-touch-icon" sizes="152x152" />
<link href="images/touch/favicon.png" rel="icon" type="image/x-icon" />
<link href="images/touch/favicon.png" rel="shortcut icon">

About Us - GREY MEDICAL

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                Menu

            </button>

Home

News

About Us

F&Q

About Us

深圳市格蕾医疗公司

         地址:深圳深南大道1002号地王大厦1205
         电话:+86 0755 26008787
         邮箱:info@grey.com

        		© GREY MEDICAL 粤ICP备 15019080号

            	Legal notices   |   Contact Us


text:
<?php

namespace IHQS\NuitBlancheBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use ts3\libraries\TeamSpeak3\TeamSpeak3;

class Ts3Controller extends Controller
{
	private $api_url = "ServerQuery://query:4quraYJK@ks364780.kimsufi.com:10011/?server_port=9987";

	protected function getChannelsInfo(array $channels)
	{
		$result = array();
		foreach($channels as $channel)
		{
			$channel_name = (string) $channel;
			if(!$channel_name) { continue; }

			$sub_channels = $channel->subChannelList();

			$clients = array();
			foreach($channel->clientList() as $client)
			{
				$name = (string) $client;
				if(strpos($name, ' ') !== false) { $name = substr($name, 0, strpos($name, ' ')); }
				$clients[$name] = $name;
			}

			$result[$channel_name] = array(
				'clients'	=> $clients,
				'channels'	=> $this->getChannelsInfo($sub_channels)
			);
		}

		return $result;
	}

    /**
     * @Template()
     */
	public function _channelsAction()
	{
		$message = '';

		$cache = $this->container->get('kernel')->getCacheDir() . 'ts3channels.tmp';

		try
		{
			$ts3 = \TeamSpeak3_TeamSpeak3::factory($this->api_url);
			$ts3->serverSelect(1);
			$channels = array($ts3->serverGetSelected()->channelGetByName('Nuit Blanche'));
			$channels = $this->getChannelsInfo($channels);
			file_put_contents($cache, serialize($channels));
		}
		catch(\Exception $e)
		{
			$channels = unserialize(file_get_contents($cache));
		}

		return array(
			'channels' => $channels,
			'message'  => $message,
		);
	}
}


text:
define(function(){

	/*
		Inheritance model
	*/
	function __super(inst,b,args){
		if(!b) return;
		__super(inst,b.constructor.__sjs_base__,args);
		b.constructor.apply(inst,args);
	};

	function __invoke(inst,method,b,args){
		if(!b) return;
		__invoke(inst,method,b.constructor.__sjs_base__,args);
		var method = b.constructor.prototype[method];
		method.apply(inst,args);
	}

	/**
		@param {prototype} p
	*/
	function _inheritance_map(p){
		var map = Object.create(null);

		while(p) {
			var keys = Object.keys(p);
			for(var i=0; i<keys.length; i++){
				var key = keys[i];
				if(map[key]) continue;
				map[key] = (function(){
					this.proto[this.key].apply(this.instance,arguments);
				}).bind({instance:this,proto:p,key:key});
			}

			p = p.constructor.__sjs_base__;
		}

		return map;
	};

    /**
     * Interface emulator
     *
    */
    function Interface(_interface){
        this._name = Object.keys(_interface)[0];
        this._interface = _interface[this._name];
    }

	/**
	 * pseudo class wrapper
	 * */
	 function Class(_class){
		if(!_class) throw 'constructor function may not be empty';
		if(typeof(_class) !== 'function' ) throw 'Constructor must be a function';

		_class.extend = function(base){
			this.prototype = Object.create(base.prototype);
			this.prototype.constructor = this;
			/*
				we will need to invoke base prototypes methods thus
				constructor's base is a prototype
			*/
			this.__sjs_base__ = base.prototype;

			this.prototype.base = function(){
			/*
					ensure super constructor is invoked only once
					attach super prototype methods
			*/
			this.base = function(){};

			__super(this,_class.__sjs_base__, arguments);
			this.base = function(__class){
					if(!(this instanceof __class))
						throw 'Invalid super class "' + getFunctionName(__class) + '" of class "' + getFunctionName(_class) + '"' ;
					return _inheritance_map.call(this,__class.prototype);
				}
			}
			return this;
		}

        _class.implement = function(_interface){
            if(!(_interface instanceof Interface) )
                throw 'Cannot implement: ' + _interface + ' is not instance of Interface';

           var keys = Object.keys(_interface._interface);
           for(var key in keys){
               if(!this.prototype[keys[key]]) {
                this.prototype[keys[key]] = new Function('return function '+keys[key]+'(){ throw "function ' + keys[key] +' is not implemented in "+ global.sjs.fname(this.constructor);};')();
               } else {
                   throw 'Cannot implement '+ _interface._name+': function ' + keys[key] + ' already exists in ' +sjs.fname(this);
               }
           }
           return this;
        }

		return _class;
	};

return {
	Class:Class,
	Interface: Interface
};

});


text:
package es.bsc.mobile.runtime.types.requests.executor;

import es.bsc.mobile.runtime.components.Executor;
import es.bsc.mobile.runtime.types.Task;
import es.bsc.mobile.runtime.utils.OffloadDecisionMaker;
import es.bsc.mobile.runtime.components.offloader.Offloader;

public class RunTask extends ExecutorRequest {

    private final Task task;

    public RunTask(Task task) {

        this.task = task;
    }

    public Task getTask() {
        return task;
    }

    @Override
    public void dispatch(OffloadDecisionMaker odm, Offloader offloader, Executor ex) {
        if (odm.considerOffload(task)) {
            offloader.offloadTask(task);
        } else {
            ex.runTask(task);
        }
    }

}


text:
"""
check_memory.py
Kyle McChesney

Simple script to check memory useage
and let me know if its going crazy

"""

import logging, argparse, os, subprocess
import smtplib
from email.mime.text import MIMEText
from check_report import Check

def main():
    # args
    parser = argparse.ArgumentParser(
        description = (" Simple script to check disk space useage"),
    )

    parser.add_argument("--email", default="mbio.kyle@gmail.com")
    parser.add_argument("--db", help="sqlite db file to record sends", default="./mem.db")

    args = parser.parse_args()
    free_gb = free()
    check = Check(args.db)

    if int(free_gb) <= 2 and check.should_report():
        report(free_gb, args.email)
        check.log_report()

def free():

    command = ["free","-g"]
    output = subprocess.check_output(command)
    arrayed = [line for line in output.split("\n")]

    real_free = arrayed[2].split()[3]
    return real_free

def report(mem, email):

    # Create a text/plain message
    email_body = []
    email_body.append("Hello,\n")
    email_body.append("Warning: only {} GBs of RAM are free".format(mem))

    msg = MIMEText("\n".join(email_body))

    # header stuff
    # no one else cares but me!
    root  = "root@alpha-helix.oncology.wisc.edu"
    subject = "Memory Low Warning ( {}GB )".format(mem)

    msg['Subject'] = subject
    msg['From'] = root
    msg['To'] = email

    # Send the message via our own SMTP server, but don't include the
    # envelope header.
    s = smtplib.SMTP('localhost')
    s.sendmail(root, [email], msg.as_string())
    s.quit()

if __name__ == "__main__":
    main()


text:
#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>

#define IN_CARD_SERVICES
#include <pcmcia/cs_types.h>
#include <pcmcia/cs.h>
#include <pcmcia/bulkmem.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <pcmcia/ss.h>

#include "cs_internal.h"

int pcmcia_get_first_tuple(struct pcmcia_device *p_dev, tuple_t *tuple)
{
	return pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple);
}
EXPORT_SYMBOL(pcmcia_get_first_tuple);

int pcmcia_get_next_tuple(struct pcmcia_device *p_dev, tuple_t *tuple)
{
	return pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple);
}
EXPORT_SYMBOL(pcmcia_get_next_tuple);

int pcmcia_get_tuple_data(struct pcmcia_device *p_dev, tuple_t *tuple)
{
	return pccard_get_tuple_data(p_dev->socket, tuple);
}
EXPORT_SYMBOL(pcmcia_get_tuple_data);

int pcmcia_parse_tuple(struct pcmcia_device *p_dev, tuple_t *tuple, cisparse_t *parse)
{
	return pccard_parse_tuple(tuple, parse);
}
EXPORT_SYMBOL(pcmcia_parse_tuple);

int pcmcia_validate_cis(struct pcmcia_device *p_dev, cisinfo_t *info)
{
	return pccard_validate_cis(p_dev->socket, p_dev->func, info);
}
EXPORT_SYMBOL(pcmcia_validate_cis);

int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req)
{
	return pccard_reset_card(p_dev->socket);
}
EXPORT_SYMBOL(pcmcia_reset_card);


text:
namespace Microsoft.Azure.Management.StorageSync.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// The parameters used when creating a server endpoint.
    /// </summary>
    [Rest.Serialization.JsonTransformation]
    public partial class ServerEndpointCreateParameters : ProxyResource
    {
        /// <summary>
        /// Initializes a new instance of the ServerEndpointCreateParameters
        /// class.
        /// </summary>
        public ServerEndpointCreateParameters()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ServerEndpointCreateParameters
        /// class.
        /// </summary>
        /// <param name="id">Fully qualified resource ID for the resource. Ex -
        /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}</param>
        /// <param name="name">The name of the resource</param>
        /// <param name="type">The type of the resource. E.g.
        /// "Microsoft.Compute/virtualMachines" or
        /// "Microsoft.Storage/storageAccounts"</param>
        /// <param name="systemData">Azure Resource Manager metadata containing
        /// createdBy and modifiedBy information.</param>
        /// <param name="serverLocalPath">Server Local path.</param>
        /// <param name="cloudTiering">Cloud Tiering. Possible values include:
        /// 'on', 'off'</param>
        /// <param name="volumeFreeSpacePercent">Level of free space to be
        /// maintained by Cloud Tiering if it is enabled.</param>
        /// <param name="tierFilesOlderThanDays">Tier files older than
        /// days.</param>
        /// <param name="friendlyName">Friendly Name</param>
        /// <param name="serverResourceId">Server Resource Id.</param>
        /// <param name="offlineDataTransfer">Offline data transfer. Possible
        /// values include: 'on', 'off'</param>
        /// <param name="offlineDataTransferShareName">Offline data transfer
        /// share name</param>
        /// <param name="initialDownloadPolicy">Policy for how namespace and
        /// files are recalled during FastDr. Possible values include:
        /// 'NamespaceOnly', 'NamespaceThenModifiedFiles',
        /// 'AvoidTieredFiles'</param>
        /// <param name="localCacheMode">Policy for enabling follow-the-sun
        /// business models: link local cache to cloud behavior to pre-populate
        /// before local access. Possible values include:
        /// 'DownloadNewAndModifiedFiles', 'UpdateLocallyCachedFiles'</param>
        /// <param name="initialUploadPolicy">Policy for how the initial upload
        /// sync session is performed. Possible values include:
        /// 'ServerAuthoritative', 'Merge'</param>
        public ServerEndpointCreateParameters(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string serverLocalPath = default(string), string cloudTiering = default(string), int? volumeFreeSpacePercent = default(int?), int? tierFilesOlderThanDays = default(int?), string friendlyName = default(string), string serverResourceId = default(string), string offlineDataTransfer = default(string), string offlineDataTransferShareName = default(string), string initialDownloadPolicy = default(string), string localCacheMode = default(string), string initialUploadPolicy = default(string))
            : base(id, name, type, systemData)
        {
            ServerLocalPath = serverLocalPath;
            CloudTiering = cloudTiering;
            VolumeFreeSpacePercent = volumeFreeSpacePercent;
            TierFilesOlderThanDays = tierFilesOlderThanDays;
            FriendlyName = friendlyName;
            ServerResourceId = serverResourceId;
            OfflineDataTransfer = offlineDataTransfer;
            OfflineDataTransferShareName = offlineDataTransferShareName;
            InitialDownloadPolicy = initialDownloadPolicy;
            LocalCacheMode = localCacheMode;
            InitialUploadPolicy = initialUploadPolicy;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets server Local path.
        /// </summary>
        [JsonProperty(PropertyName = "properties.serverLocalPath")]
        public string ServerLocalPath { get; set; }

        /// <summary>
        /// Gets or sets cloud Tiering. Possible values include: 'on', 'off'
        /// </summary>
        [JsonProperty(PropertyName = "properties.cloudTiering")]
        public string CloudTiering { get; set; }

        /// <summary>
        /// Gets or sets level of free space to be maintained by Cloud Tiering
        /// if it is enabled.
        /// </summary>
        [JsonProperty(PropertyName = "properties.volumeFreeSpacePercent")]
        public int? VolumeFreeSpacePercent { get; set; }

        /// <summary>
        /// Gets or sets tier files older than days.
        /// </summary>
        [JsonProperty(PropertyName = "properties.tierFilesOlderThanDays")]
        public int? TierFilesOlderThanDays { get; set; }

        /// <summary>
        /// Gets or sets friendly Name
        /// </summary>
        [JsonProperty(PropertyName = "properties.friendlyName")]
        public string FriendlyName { get; set; }

        /// <summary>
        /// Gets or sets server Resource Id.
        /// </summary>
        [JsonProperty(PropertyName = "properties.serverResourceId")]
        public string ServerResourceId { get; set; }

        /// <summary>
        /// Gets or sets offline data transfer. Possible values include: 'on',
        /// 'off'
        /// </summary>
        [JsonProperty(PropertyName = "properties.offlineDataTransfer")]
        public string OfflineDataTransfer { get; set; }

        /// <summary>
        /// Gets or sets offline data transfer share name
        /// </summary>
        [JsonProperty(PropertyName = "properties.offlineDataTransferShareName")]
        public string OfflineDataTransferShareName { get; set; }

        /// <summary>
        /// Gets or sets policy for how namespace and files are recalled during
        /// FastDr. Possible values include: 'NamespaceOnly',
        /// 'NamespaceThenModifiedFiles', 'AvoidTieredFiles'
        /// </summary>
        [JsonProperty(PropertyName = "properties.initialDownloadPolicy")]
        public string InitialDownloadPolicy { get; set; }

        /// <summary>
        /// Gets or sets policy for enabling follow-the-sun business models:
        /// link local cache to cloud behavior to pre-populate before local
        /// access. Possible values include: 'DownloadNewAndModifiedFiles',
        /// 'UpdateLocallyCachedFiles'
        /// </summary>
        [JsonProperty(PropertyName = "properties.localCacheMode")]
        public string LocalCacheMode { get; set; }

        /// <summary>
        /// Gets or sets policy for how the initial upload sync session is
        /// performed. Possible values include: 'ServerAuthoritative', 'Merge'
        /// </summary>
        [JsonProperty(PropertyName = "properties.initialUploadPolicy")]
        public string InitialUploadPolicy { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (VolumeFreeSpacePercent > 100)
            {
                throw new ValidationException(ValidationRules.InclusiveMaximum, "VolumeFreeSpacePercent", 100);
            }
            if (VolumeFreeSpacePercent < 0)
            {
                throw new ValidationException(ValidationRules.InclusiveMinimum, "VolumeFreeSpacePercent", 0);
            }
            if (TierFilesOlderThanDays > 2147483647)
            {
                throw new ValidationException(ValidationRules.InclusiveMaximum, "TierFilesOlderThanDays", 2147483647);
            }
            if (TierFilesOlderThanDays < 0)
            {
                throw new ValidationException(ValidationRules.InclusiveMinimum, "TierFilesOlderThanDays", 0);
            }
        }
    }
}


text:
package org.radargun.stages.cache.generators;

import org.radargun.config.DefinitionElement;
import org.radargun.config.Init;
import org.radargun.config.Property;
import org.radargun.config.PropertyHelper;
import org.radargun.logging.Log;
import org.radargun.logging.LogFactory;
import org.radargun.utils.Utils;

/**
 * @author Radim Vansa <rvansa@redhat.com>
 */
@DefinitionElement(name = "plugin-specific", doc = "Wraps key generator that is specific to current plugin")
public class PluginSpecificKeyGenerator implements KeyGenerator {
   private static final Log log = LogFactory.getLog(PluginSpecificKeyGenerator.class);

   @Property(name = "class", doc = "Fully qualified name of the key generator class.", optional = false)
   protected String clazzName;

   @Property(doc = "Parameters for the generator (used to initialize properties). By default none.")
   protected String params = null;

   @Property(doc = "Generator used when the plugin-specific generator is not available. By default an exception is thrown.", complexConverter = KeyGenerator.ComplexConverter.class)
   protected KeyGenerator fallback;

   protected KeyGenerator instance;

   @Init
   public void init() {
      try {
         instance = Utils.instantiateAndInit(clazzName, params);
      } catch (Exception e) {
         log.trace("Cannot load plugin-specific generator through " + this, e);
         if (fallback != null) {
            instance = fallback;
         }
      }
   }

   @Override
   public Object generateKey(long keyIndex) {
      if (instance == null) throw new IllegalStateException("The plugin specific generator was not set!");
      return instance.generateKey(keyIndex);
   }

   @Override
   public String toString() {
      return PropertyHelper.getDefinitionElementName(getClass()) + PropertyHelper.toString(this);
   }
}


text:
import getClientRect from '../utils/getClientRect';
import getOppositePlacement from '../utils/getOppositePlacement';

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
export default function inner(data) {
  const placement = data.placement;
  const basePlacement = placement.split('-')[0];
  const popper = getClientRect(data.offsets.popper);
  const reference = getClientRect(data.offsets.reference);
  const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;

  const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;

  popper[isHoriz ? 'left' : 'top'] =
    reference[placement] -
    (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);

  data.placement = getOppositePlacement(placement);
  data.offsets.popper = getClientRect(popper);

  return data;
}


text:
layout: default
title: "Pricing - GoldFynch: e-discovery, simplified."
excerpt: "GoldFynch offers transparent, per case and upfront pricing.  Choose a plan which suites your current needs and effortlessly upgrade or downgrade as your case scales"
---

Transparent and upfront pricing

                Goldfynch pricing is per case. Add as many cases as you want.  Signups are always free.

                  Signup to create a case

Signup is simple and takes only a few steps.  You'll get a free case to try GoldFynch out - no sales call, no credit-card required.

                  See how it works

GoldFynch plans scale as your needs grow

Use the slider below to see different pricing options

Price/month

Volume

Price/GB

Productions

Case Sharing

Premium Processing

Prioritized Support

We will give you a free case to test drive GoldFynch when you sign up.  No credit-card required.

                See how it works

                Signup to see it in action

Special offers and discounts are available for Nonprofit Organizations and Bar Associations. Contact us to learn more.

		* Case size is uncompressed file volume after upload to the GoldFynch servers.  Case size is always available on the Case Overview page.

		* Only 1 free case per account is allowed.


text:
using System;

namespace Mozu.Api.Contracts.CommerceRuntime.Fulfillment
{
		public class ShipmentAdjustment
		{
			public decimal? HandlingAdjustment { get; set; }

			public decimal? HandlingTaxAdjustment { get; set; }

			public decimal? ItemAdjustment { get; set; }

			public decimal? ItemTaxAdjustment { get; set; }

			public decimal? ShippingAdjustment { get; set; }

			public decimal? ShippingTaxAdjustment { get; set; }

		}

}


text:
@interface ARNSwizzBlocksTests : XCTestCase

@end

@implementation ARNSwizzBlocksTests

- (void)setUp
{
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown
{
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample
{
    ARNSwizzBlockTestObject *testObj = ARNSwizzBlockTestObject.new;

    [testObj arn_swizzRespondsToSelector:@selector(testingWithString:number:) fromProtocol:nil usingBlock:^(id obj, NSString *aString, NSNumber *number) {
        NSLog(@"Call Block Method");
        NSLog(@"aString : %@", aString);
        NSLog(@"number : %@", number);
    }];

    [testObj testingWithString:@"testOK" number:@111];

    [testObj arn_swizzRespondsToSelector:@selector(testingWithString:number:) fromProtocol:nil usingBlock:^(id obj, NSString *aString, NSNumber *number) {
        NSLog(@"Call Block Method");
        NSLog(@"aString : %@", aString);
        NSLog(@"number : %@", number);
    }];

    [testObj testingWithString:@"testOK" number:@111];
}

- (void)testOtherObj
{
    ARNSwizzBlockTestObject *testObj = ARNSwizzBlockTestObject.new;
    [testObj testingWithString:@"otherObjOK" number:@222];
}
@end


text:
package com.streamsets.datacollector.execution.preview.common;

import com.streamsets.pipeline.api.ErrorCode;
import com.streamsets.pipeline.api.GenerateResourceBundle;

@GenerateResourceBundle
public enum PreviewError implements ErrorCode {

  PREVIEW_0001("No task is running"),
  PREVIEW_0002("Could not retrieve the preview output : {}"),
  PREVIEW_0003("Encountered error while previewing : {}")

  ;

  private final String msg;

  PreviewError(String msg) {
    this.msg = msg;
  }

  @Override
  public String getCode() {
    return name();
  }

  @Override
  public String getMessage() {
    return msg;
  }
}


text:
  Hangest-sur-Somme est
       un village
       localisé dans le département de Somme en Picardie. Elle comptait 682 habitants en 2008.

À coté de Hangest-sur-Somme sont situées les communes de
Yzeux à 3 km, 253 habitants,
Le Mesge à 3 km, 173 habitants,
Crouy-Saint-Pierre à 2 km, 335 habitants,
L'Étoile à 5 km, 1 249 habitants,
Condé-Folie située à 4 km, 851 habitants,
Ville-le-Marclet localisée à 4 km, 471 habitants,
 entre autres. De plus, Hangest-sur-Somme est située à seulement 19 km de Amiens.

Si vous envisagez de venir habiter à Hangest-sur-Somme, vous pourrez facilement trouver une maison à vendre.

À Hangest-sur-Somme, la valorisation moyenne à la vente d'un appartement se situe à zero € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1 581 € du m². À la location le prix moyen se situe à 0 € du m² par mois.

Le nombre d'habitations, à Hangest-sur-Somme, était réparti en 2011 en quatre appartements et 313 maisons soit
 un marché relativement équilibré.

La ville propose quelques  équipements, elle dispose, entre autres, de un terrain de sport et une boucle de randonnée.


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
J. Parasit. 49: 83-92 (1987)

#### Original name
Abelspora portucalensis C. Azevedo, 1987

### Remarks
null


text:
package com.eagle.programmar.Java;

import com.eagle.programmar.EagleLanguage;
import com.eagle.programmar.Java.Terminals.Java_Comment;
import com.eagle.programmar.Java.Terminals.Java_Identifier;
import com.eagle.programmar.Java.Terminals.Java_Keyword;
import com.eagle.tests.EagleInterpreter;
import com.eagle.tests.EagleRunnable;
import com.eagle.tokens.EagleScope.EagleScopeInterface;
import com.eagle.tokens.SeparatedList;
import com.eagle.tokens.TokenChooser;
import com.eagle.tokens.TokenList;
import com.eagle.tokens.TokenSequence;
import com.eagle.tokens.punctuation.PunctuationPeriod;
import com.eagle.tokens.punctuation.PunctuationSemicolon;
import com.eagle.tokens.punctuation.PunctuationStar;

public class Java_Program extends EagleLanguage implements EagleRunnable, EagleScopeInterface
{
	public static final String NAME = "Java";

	public Java_Program()
	{
		super(NAME, new Java_Syntax());
	}

	@Override
	public String getDocRoot()
	{
		return "http://docs.oracle.com/javase/specs/jls/se5.0/html/";
	}

	public static final String[] MODIFIERS = new String[] {
		"abstract",
		"final",
		"native",
		"private",
		"protected",
		"public",
		"static",
		"synchronized",
		"transient",
		"volatile"
	};

	public @OPT TokenList<Java_Comment> comments1;
	public @OPT Java_Annotation annotation;
	public @OPT TokenList<Java_Comment> comments2;
	public @OPT Java_Package jpackage;
	public @OPT TokenList<Java_ImportOrComment> jimportList;
	public @OPT TokenList<Java_ClassOrEnum> classOrEnum;

	public static class Java_ClassOrEnum extends TokenChooser
	{
		public @CHOICE Java_Class jclass;
		public @CHOICE Java_Enum jenum;
	}

	public static class Java_Package extends TokenSequence
	{
		public @BLANKLINE Java_Keyword PACKAGE = new Java_Keyword("package");
		public SeparatedList<Java_Identifier,PunctuationPeriod> ids;
		public @NOSPACE PunctuationSemicolon semicolon;
	}

	public static class Java_ImportOrComment extends TokenChooser
	{
		public @CHOICE @NEWLINE Java_Comment comment;
		public @CHOICE Java_Import jimport;
	}

	public static class Java_Import extends TokenSequence
	{
		public @NEWLINE Java_Keyword IMPORT = new Java_Keyword("import");
		public @OPT Java_Keyword STATIC = new Java_Keyword("static");
		public Java_Identifier id;
		public @OPT TokenList<Java_DotIdentifierStar> dotId;
		public @NOSPACE PunctuationSemicolon semicolon;

		public static class Java_DotIdentifierStar extends TokenSequence
		{
			public @NOSPACE PunctuationPeriod dot;
			public @NOSPACE Java_IdentifierStar idStar;

			public static class Java_IdentifierStar extends TokenChooser
			{
				public @CHOICE @NOSPACE Java_Identifier id;
				public @CHOICE @NOSPACE PunctuationStar star;
			}
		}
	}

	@Override
	public void interpret(EagleInterpreter interpreter)
	{
		interpreter.tryToInterpret(classOrEnum.first().getWhich());
	}
}


text:
require 'aws-sdk'

module Ognivo
  class S3Client
    def initialize(access_key_id, secret_access_key, bucket)
      @s3 = AWS::S3.new(
        access_key_id: access_key_id,
        secret_access_key: secret_access_key
      )

      @bucket = @s3.buckets[bucket]
    end

    def upload_file(file_path, key)
      File.open(file_path) do |file|
        upload(file, key)
      end
    end

    def upload(io, key)
      @bucket.objects[key].write(io, acl: 'public_read')
    end

    def public_url(name)
      @bucket.objects[name].public_url
    end

    def key_exists?(name)
      @bucket.objects[name].exists?
    end

    def read(name)
      @bucket.objects[name].read
    end

    def bucket_exists?
      @bucket.exists?
    end
  end
end


text:
import locale from '../locale/tr_TR';

export default locale;


text:
package gameAuthoring.scenes.pathBuilding.enemyLocations;

import javafx.geometry.Point2D;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;

/**
 * Common code from PathEndingLocation and PathStartingLocation
 *
 * @author Austin Kyker
 *
 */
public class PathLocation extends Circle {

    private static final int RADIUS = 25;

    public PathLocation (double x, double y, Color color) {
        super(RADIUS);
        this.setCenterX(x);
        this.setCenterY(y);
        this.setFill(color);
    }

    public Point2D getCenterLoc () {
        return new Point2D(this.getCenterX(), this.getCenterY());
    }
}


text:
@interface QYViewController : UIViewController

@end


text:
class PedigreeSerializer < ActiveModel::Serializer
  attributes :id, :relations
  has_one :current
  has_many :patients
  has_many :annotations

  def relations
    object.relations
  end

  def current
    object.current_patient
  end
end


text:
from __future__ import unicode_literals

from sqlalchemy import Column, Integer, String
from sqlalchemy.sql.functions import coalesce
from catsnap import Client
from catsnap.table.created_at_bookkeeper import CreatedAtBookkeeper

class Album(CreatedAtBookkeeper):
    __tablename__ = 'album'

    album_id = Column(Integer, primary_key=True)
    name = Column(String, nullable=False)

    @classmethod
    def images_for_album_id(cls, album_id):
        from catsnap.table.image import Image
        session = Client().session()
        return session.query(Image).\
                filter(Image.album_id == album_id).\
                order_by(coalesce(Image.photographed_at, Image.created_at)).\
                all()


text:
class UIStatBar : public UISimpleStatusBar {
public:
	static UIStatBar* Create(UISimpleFrame* parent = NULL);
	static void Destroy(UIStatBar* obj);
private:
	uint32_t setOwner(war3::CUnit* unit);
	uint32_t updateStat();
};

#endif


text:
package admin

import (
	"errors"
	"github.com/fuxiaohei/purine/src/mapi"
	"github.com/fuxiaohei/purine/src/model"
	"github.com/fuxiaohei/purine/src/route/base"
	"github.com/lunny/tango"
)

type Setting struct {
	base.AdminRender
	base.BaseAuther
	base.BaseBinder
	tango.Ctx
}

func (s *Setting) Get() {
	res := mapi.Call(mapi.Setting.ReadGeneral, nil)
	if !res.Status {
		s.RenderError(500, errors.New(res.Error))
		return
	}
	s.Assign("General", res.Data["general"].(*mapi.SettingGeneral))

	themes, err := model.GetThemes()
	if err != nil {
		s.RenderError(500, err)
		return
	}
	s.Assign("Themes", themes)

	res = mapi.Call(mapi.Setting.ReadMedia, nil)
	if !res.Status {
		s.RenderError(500, errors.New(res.Error))
		return
	}
	s.Assign("Media", res.Data["media"].(*mapi.SettingMedia))

	s.Title("Setting")
	s.Render("setting.tmpl")
}

func (s *Setting) Post() {
	if s.Form("general") == "true" {
		s.postGeneral()
		return
	}
	if s.Form("media") == "true" {
		s.postMedia()
		return
	}
	s.Get()
}

func (s *Setting) postGeneral() {
	form := new(mapi.SettingGeneralForm)
	if err := s.Bind(form); err != nil {
		s.Assign("Error", err.Error())
		s.Get()
		return
	}
	res := mapi.Call(mapi.Setting.SaveGeneral, form)
	if !res.Status {
		s.Assign("Error", res.Error)
		s.Get()
		return
	}
	s.Assign("Success", true)
	s.Get()
}

func (s *Setting) postMedia() {
	form := new(mapi.SettingMediaForm)
	if err := s.Bind(form); err != nil {
		s.Assign("MediaError", err.Error())
		s.Get()
		return
	}
	res := mapi.Call(mapi.Setting.SaveMedia, form)
	if !res.Status {
		s.Assign("MediaError", res.Error)
		s.Get()
		return
	}
	s.Assign("MediaSuccess", true)
	s.Redirect("/admin/setting#setting-media")
}


text:
namespace {

void SetPosition(const content::Geoposition& source, CefGeoposition& target) {
  target.latitude = source.latitude;
  target.longitude = source.longitude;
  target.altitude = source.altitude;
  target.accuracy = source.accuracy;
  target.altitude_accuracy = source.altitude_accuracy;
  target.heading = source.heading;
  target.speed = source.speed;
  cef_time_from_basetime(source.timestamp, target.timestamp);

  switch (source.error_code) {
    case content::Geoposition::ERROR_CODE_NONE:
      target.error_code = GEOPOSITON_ERROR_NONE;
      break;
    case content::Geoposition::ERROR_CODE_PERMISSION_DENIED:
      target.error_code = GEOPOSITON_ERROR_PERMISSION_DENIED;
      break;
    case content::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE:
      target.error_code = GEOPOSITON_ERROR_POSITION_UNAVAILABLE;
      break;
    case content::Geoposition::ERROR_CODE_TIMEOUT:
      target.error_code = GEOPOSITON_ERROR_TIMEOUT;
      break;
  }

  CefString(&target.error_message) = source.error_message;
}

void LocationCallback(CefRefPtr<CefGetGeolocationCallback> callback,
                      const content::Geoposition& position) {
  if (CefThread::CurrentlyOn(CefThread::UI)) {
    CefGeoposition cef_position;
    SetPosition(position, cef_position);
    callback->OnLocationUpdate(cef_position);
  } else {
    CefThread::PostTask(CefThread::UI, FROM_HERE,
        base::Bind(LocationCallback, callback, position));
  }
}

}  // namespace

bool CefGetGeolocation(CefRefPtr<CefGetGeolocationCallback> callback) {
  if (!CONTEXT_STATE_VALID()) {
    NOTREACHED() << "context not valid";
    return false;
  }

  if (!callback.get()) {
    NOTREACHED() << "invalid parameter";
    return false;
  }

  if (CefThread::CurrentlyOn(CefThread::IO)) {
    CefGeolocationClient::InitializeEnvironment();
    content::GeolocationProvider* provider =
        content::GeolocationProvider::GetInstance();
    if (provider) {
      provider->RequestCallback(base::Bind(LocationCallback, callback));
      return true;
    }
    return false;
  } else {
    CefThread::PostTask(CefThread::IO, FROM_HERE,
        base::Bind(base::IgnoreResult(CefGetGeolocation), callback));
    return true;
  }
}


text:
package minigamemanager.api.inventory;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;

import minigamemanager.api.items.ItemStackBuilder;
import minigamemanager.api.minigame.Minigame;
import minigamemanager.api.minigame.Minigame.EventListener;

public class SpectatorMenu extends PagedMenu {

	public SpectatorMenu(final Minigame minigame, String[] alive, String title, ItemStack backItem, ItemStack nextItem) {
		super(minigame, title, backItem, nextItem, new EventListener<InventoryClickEvent>() {
			public void onEvent(InventoryClickEvent event) {
				ItemStack item = event.getCurrentItem();
				if (item != null && item.getType() == Material.SKULL_ITEM) {
					HumanEntity human = event.getWhoClicked();
					// only works for spectators
					if (!(human instanceof Player) || minigame.isAlive(((Player) human)))
						return;
					SkullMeta meta = (SkullMeta) item.getItemMeta();
					Player target = Bukkit.getPlayer(meta.getOwner());
					human.teleport(target);
				}
			};
		}, getHeadsForPlayers(alive));
	}

	public static ItemStack[] getHeadsForPlayers(String... players) {
		ItemStack[] items = new ItemStack[players.length];
		for (int i = 0; i < items.length; i++) {
			ItemStack item = ItemStackBuilder.fromMaterial(Material.SKULL_ITEM).name("&6" + players[i]).durability((short) 3).build();
			SkullMeta im = (SkullMeta) item.getItemMeta();
			im.setOwner(players[i]);
			item.setItemMeta(im);
			items[i] = item;
		}
		return items;
	}

}


text:
> Generates a list of recursively dependent licenses used within a project

## Getting Started
This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-license --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-license');
```

## The "license" task

### Overview
In your project's Gruntfile, add a section named `license` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  license: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})
```

### Options

#### options.unknown
Type: `Boolean`
Default value: `false`

Only generate a list of unknown licenses (as opposed to all)

#### options.start
Type: `String`
Default value: `.`

Project directory from which to start the search

#### options.depth
Type: `Number`
Default Value: `1`

How deep to search for dependencies.  Setting value to `null` will recurse through all.

#### options.include
Type: `String` or `Array`
Default Value: `all`

The types of dependencies to include, such as: `["dependencies", "devDependencies", "peerDependencies"]`.

#### options.output
Type: `String`
Default Value: `LICENSES`

The path/filename to write the metadata to (WIP: should eventually output the actual licenses)

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).


text:
This is a UI for [home-assistant](http://home-assistant.io) i've
written for own use. It's main purpose is to be able to control
home-assistant from a pi with a touchscreen mounted on the wall.

This project uses [pygame](http://pygame.org) as backed & the awesome
[pgu](https://github.com/parogers/pgu) for the GUI. Using a custom theme
& UI elements, I've tried to mimmick the web ui of home-assistant.

## Screenshot
![images/screencast.png](images/screencast.gif)
![images/touchscreen.gif](images/touchscreen.gif)

## features
* displaying group items
* switching on/off of lights
* displaying sensor data
* ~~Uses EventStream (`/api/stream`) for streaming updates~~
* Uses the websocket connection of Home Assistant for communication & updates
* Using `icon_font_to_png` to use the Material Design Icon font on the fly.
* Cool

## Install
```bash
git clone https://github.com/subutux/HUD
# Install using pip
sudo pip3 install .

# run the help
hud --help
```

## Configuration

HUD needs a configuration file, ini-style. For Example:

```ini
[HomeAssistant]
Host = localhost
Port = 8123
Key = my-secret-password
SSL = True
```

The first one speaks for itself, home assistant configuration.

## Auto start

When running on a pi, you probably want to auto start hud.
When installing hud, there are some extra files installed:

- /etc/systemd/system/hud.service

  A systemd service for starting up HUD
- /etc/default/hud.opts

  Your command line parameters for HUD
- /usr/local/sbin/hud.init

  a workaround for a problem with sseclient in systemd

About that last one,This is a work around for a nasty problem with
SSEClient/requests. The problem was that the requests with
'stream=True' would'nt initialize when hud is run directly from
systemd.

> (Needs to be tested after switching to websockets)

For some weird reason running hud from this bash'wrapper' fixes
the annoyance.

If someone has any idea why this is, let me know. I'm eager to know.

### Enabling service

To enable the service, run:

```bash
sudo systemctl enable hud.service
sudo systemctl daemon-reload
```

## Arguments
```
usage: hud [-h] -c CONFIG [-f /dev/fbX] [-t /dev/input/eventX] [-n]
           [-H host.name] [-p PORT] [-k KEY] [-s] [-v]
           [-L {INFO,WARNING,ERROR,CRITICAL,DEBUG}] [-l LOGFILE]

A pygame GUI for Home Assistant.

optional arguments:
  -h, --help            show this help message and exit

Configuration:
  -c CONFIG, --config CONFIG
                        config file to use
  -f /dev/fbX, --framebuffer /dev/fbX
                        Use this framebuffer as output for the UI (defaults to
                        window mode)
  -t /dev/input/eventX, --touchscreen /dev/input/eventX
                        Enable touchscreen integration. Use this as event
                        input
  -n, --no-display      We don't have a display. Sets the SDL_VIDEODRIVER to
                        "dummy". Usefull for testing
  --width               The width of the display
  --height              The height of the display

HomeAssistant:
  (optional) Parameters to override the config file

  -H host.name, --homeassistant host.name
                        The location of home-assistant
  -p PORT, --port PORT  the port to use for home-assistant (default: 8123)
  -k KEY, --key KEY     The api password to use (default: None)
  -s, --ssl             Use ssl (default false)

Logging:
  (optional) Logging settings

  -v, --verbose         Log output
  -L {INFO,WARNING,ERROR,CRITICAL,DEBUG}, --logLevel {INFO,WARNING,ERROR,CRITICAL,DEBUG}
                        Log level to use (default: ERROR)
  -l LOGFILE, --logfile LOGFILE
                        Instead of logging to stdout, log to this file
```
## Disclamer

Don't look at the code, it's ugly! You're always welcome to post a pull request
to make the code cleaner, or just give me some pointers. I love to learn more!


text:
package xyz.zimuju.basekit.util;

import android.content.Context;
import android.os.CountDownTimer;
import android.widget.TextView;

/**
 * 倒计时工具类
 */
public class TimeCountUtils extends CountDownTimer {
    private ChangeListener changeListener;
    private boolean clickable = true;
    private TextView textView;

    public TimeCountUtils(Context context, long millisInFuture, long countDownInterval, TextView textView) {
        super(millisInFuture, countDownInterval);
        this.textView = textView;
    }

    public TimeCountUtils(long millisInFuture, long countDownInterval, TextView textView) {
        super(millisInFuture, countDownInterval);
        this.textView = textView;
    }

    public void setChangeListener(ChangeListener changeListener, boolean clickable) {
        this.changeListener = changeListener;
        this.clickable = clickable;
    }

    @Override
    public void onTick(long millisUntilFinished) {
        textView.setClickable(false);
        textView.setText(millisUntilFinished / 1000 + "S");
    }

    @Override
    public void onFinish() {
        if (clickable) {
            textView.setText("重新发送");
            textView.setClickable(true);
        } else {
            textView.setText("00");
            textView.setClickable(false);
            changeListener.finishListener();
        }
    }

    public void stop() {
        super.cancel();
        textView.setText("获取验证码");
        textView.setClickable(true);
    }

    public void close() {
        super.cancel();
        textView.setText("00");
        textView.setClickable(false);
    }

    public interface ChangeListener {
        void finishListener();
    }
}


text:
package org.apache.causeway.core.metamodel.facets.members.hidden.method;

import java.lang.reflect.Method;
import java.util.function.BiConsumer;

import org.apache.causeway.commons.collections.Can;
import org.apache.causeway.core.metamodel.facetapi.FacetHolder;
import org.apache.causeway.core.metamodel.facets.ImperativeFacet;
import org.apache.causeway.core.metamodel.interactions.VisibilityContext;
import org.apache.causeway.core.metamodel.object.ManagedObject;
import org.apache.causeway.core.metamodel.object.MmInvokeUtil;

import lombok.Getter;
import lombok.NonNull;
import lombok.val;

public class HideForContextFacetViaMethod
extends HideForContextFacetAbstract
implements ImperativeFacet {

    @Getter(onMethod_ = {@Override}) private final @NonNull Can<Method> methods;

    public HideForContextFacetViaMethod(final Method method, final FacetHolder holder) {
        super(holder);
        this.methods = ImperativeFacet.singleMethod(method);
    }

    @Override
    public Intent getIntent(final Method method) {
        return Intent.CHECK_IF_HIDDEN;
    }

    @Override
    public String hides(final VisibilityContext ic) {
        final ManagedObject target = ic.getTarget();
        if (target == null) {
            return null;
        }
        val method = methods.getFirstOrFail();
        final Boolean isHidden = (Boolean) MmInvokeUtil.invokeAutofit(method, target);
        return isHidden.booleanValue() ? "Hidden" : null;
    }

    @Override
    public void visitAttributes(final BiConsumer<String, Object> visitor) {
        super.visitAttributes(visitor);
        ImperativeFacet.visitAttributes(this, visitor);
    }

}


text:
import chai from 'chai';
import {case1, case2, case3, case4, setCase} from '../src/utils/calculate.js';
const should  = chai.should();
describe('Test function', () => {
  it('start test', (done) => {
    const test = 'hello';
    test.should.equal('hello');
    done();
  });
  it('Should randomData and currentData are same color', (done) =>{
    const currentData = 'R';
    const randomData1 = 'R';
    const randomData2 = 'B';
    case1(currentData, randomData1).should.equal(true);
    case1(currentData, randomData2).should.equal(false);
    done();
  });
  it('Should randomData and currentData are  not same color', (done) =>{
    const currentData = 'R';
    const randomData1 = 'R';
    const randomData2 = 'B';
    case2(currentData, randomData1).should.equal(false);
    case2(currentData, randomData2).should.equal(true);
    done();
  });
  it('Should randomData and currentData are same pattern', (done) =>{
    const currentData1 = ['R', 'B'];
    const currentData2 = ['B', 'B'];
    const randomData1 = 'R';
    const randomData2 = 'B';
    case3(currentData1, randomData1).should.equal(true);
    case3(currentData1, randomData2).should.equal(false);
    case3(currentData2, randomData1).should.equal(false);
    case3(currentData2, randomData2).should.equal(true);
    done();
  });
  it('Should randomData and currentData are not same pattern', (done) =>{
    const currentData1 = ['R', 'B'];
    const currentData2 = ['B', 'B'];
    const randomData1 = 'R';
    const randomData2 = 'B';
    case4(currentData1, randomData2).should.equal(true);
    case4(currentData1, randomData1).should.equal(false);
    case4(currentData2, randomData2).should.equal(false);
    case4(currentData2, randomData1).should.equal(true);
    done();
  });
  it('Should set correct case', (done) => {
    const history1 = [];
    const history2 = ['R'];
    const history3 = ['R'];
    const history4 = ['B'];
    const history5 = ['B'];
    setCase(history1, 'R').map((data, index) => {
      data.should.equal(['R', 'B', '-', '-'][index]);
    });
    setCase(history2,'B').map((data, index) => {
      data.should.equal(['B', 'R', 'R', 'B'][index]);
    });
    setCase(history3,'R').map((data, index) => {
      data.should.equal(['R', 'B', 'R', 'B'][index]);
    });
    setCase(history4,'R').map((data, index) => {
      data.should.equal(['R', 'B', 'B', 'R'][index]);
    });
    setCase(history5,'B').map((data, index) => {
      data.should.equal(['B', 'R', 'B', 'R'][index]);
    });
    done();
  });
});


text:
        <input name="{{bbDatepicker.inputName}}"
                type="text"
                class="form-control"
                placeholder="{{bbDatepicker.bbPlaceholder}}"

                ng-model="bbDatepicker.pickerDate"
                ng-model-options="{ allowInvalid: true }"
                ng-keydown="bbDatepicker.enterPress($event)"

                is-open="bbDatepicker.pickerOpened"
                datepicker-options="bbDatepicker.pickerOptions"
                uib-datepicker-popup="{{bbDatepicker.format}}"
                show-button-bar="bbDatepicker.showButtonBar"
                current-text="{{bbDatepicker.resources.datepicker_today}}"
                clear-text="{{bbDatepicker.resources.datepicker_clear}}"
                close-text="{{bbDatepicker.resources.datepicker_close}}"
                datepicker-append-to-body="{{bbDatepicker.appendToBody}}"
                close-on-date-selection="{{bbDatepicker.closeOnSelection}}"
                alt-input-formats="bbDatepicker.altInputFormats"

                bb-datepicker-custom-validate="{{bbDatepicker.hasCustomValidation}}"
                bb-datepicker-min-date
                bb-datepicker-max-date

                 />

            <button
                type="button"
                class="btn btn-default bb-date-field-calendar-button"
                ng-click="bbDatepicker.open($event)"
                ng-attr-aria-label="{{'datepicker_open' | bbResources}}"
				ng-attr-tabindex="{{bbDatepicker.bbDatepickerSkipButtonWhileTabbing === true ? '-1' : undefined}}">

            </button>


text:
cask 'mission-control-plus' do
  version '1.14'
  sha256 '8a89794c85dfab931d07bd309058064d6e3cf664057239d4cc75ce6b72276df4'

  # github.com/ronyfadel/MissionControlPlusReleases/ was verified as official when first introduced to the cask
  url "https://github.com/ronyfadel/MissionControlPlusReleases/releases/download/#{version}/Mission.Control.Plus.tgz"
  appcast 'https://github.com/ronyfadel/MissionControlPlusReleases/releases.atom'
  name 'Mission Control Plus'
  homepage 'https://fadel.io/MissionControlPlus'

  depends_on macos: '>= :high_sierra'

  app 'Mission Control Plus.app'
end


text:
import urllib2
import urllib
from Lang import *

# @ParamType TIME_OUT int
# 默认5秒
TIME_OUT = 5

class GoogleConmunication(object):
    # 发送翻译请求到google服务器,返回翻译的内容
    # @ParamType sourceLang string
    # 源语言
    # @ParamType targetLang string
    # 目标语言
    # @ParamType content string
    # 待翻译的内容
    # @ReturnType string
    def translate(self, source_lang=Lang.auto, target_lang=Lang.chinese_simplified, content=None):
        if not content:
            return content

        data = {"client": "t", "sl": source_lang, "tl": target_lang, "dt": "t", "ie": "UTF-8", "q": content}
        data = urllib.urlencode(data)

        headers = {'User-Agent': 'Mozilla/5.0'}
        req = urllib2.Request(self.__baseUrl, data, headers)

        raw = urllib2.urlopen(req, timeout=TIME_OUT).read()

        return self.parse_resutlt(raw)

    def parse_resutlt(self, raw=None):
        # 解析服务器返回得信息
        # @ParamType raw string
        # 服务器返回未经解析的数据
        # @ReturnType string
        if not raw:
            return raw

        index = raw.rfind(']],')

        raw = raw[1:index+2] + r''

        result_list = eval(raw)

        result = ''

        for i in result_list:
            result += i[0]

        return result

    def __init__(self):
        # @AttributeType string
        # google翻译接口地址
        self.__baseUrl = "https://translate.google.com/translate_a/single"


text:
layout: post
title:  在Raspberry Pi上安装ArchLinux
author: 詹子知(James Zhan)
date:   2015-04-30 23:00:00
meta:   版权所有,转载须声明出处
category: raspberrypi
tags: [raspberrypi, linux, archlinux, docker]
---

SD Card Creation
Replace sdX in the following instructions with the device name for the SD card as it appears on your computer.

Start fdisk to partition the SD card:
fdisk /dev/sdX
At the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +100M for the last sector.
Type t, then c to set the first partition to type W95 FAT32 (LBA).
Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
Write the partition table and exit by typing w.
Create and mount the FAT filesystem:
mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot
Create and mount the ext4 filesystem:
mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 root
Download and extract the root filesystem (as root, not via sudo):
wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-2-latest.tar.gz -C root
sync
Move boot files to the first partition:
mv root/boot/* boot
Unmount the two partitions:
umount boot root
Insert the SD card into the Raspberry Pi, connect ethernet, and apply 5V power.
Use the serial console or SSH to the IP address given to the board by your router. The default root password is 'root'.

ArchLinux的包管理软件是[pacman][1],类似apt-get,yum,brew等。

```sh
#更新整个系统,新安装好要运行一次
pacman -Syu && sync

#完全清理包缓存
pacman -Scc

# 安装应用程序
pacman -S gcc make git docker
# 删除docker
pacman -R docker –nosave
```

[1]: http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2 "ArchLinux"
[2]: https://wiki.archlinux.org/index.php/Pacman "Pacman"


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace MaxMelcher.QueryLogger.WebParts.OthersAreSearching {

    public partial class OthersAreSearchingUserControl {
    }
}


text:
class Post < ActiveRecord::Base

  has_flexiblefields

end


text:
// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Nerdbank.Streams
{
    using System;
    using System.IO.Pipelines;
    using System.Threading;
    using System.Threading.Tasks;

    internal class PipeWriterCompletionWatcher : PipeWriter
    {
        private readonly PipeWriter inner;
        private Action<Exception?, object?>? callback;
        private object? state;

        public PipeWriterCompletionWatcher(PipeWriter inner, Action<Exception?, object?> callback, object? state)
        {
            this.inner = inner ?? throw new ArgumentNullException(nameof(inner));
            this.callback = callback ?? throw new ArgumentNullException(nameof(callback));
            this.state = state;
        }

        /// <inheritdoc/>
        public override void Advance(int bytes) => this.inner.Advance(bytes);

        /// <inheritdoc/>
        public override void CancelPendingFlush() => this.inner.CancelPendingFlush();

        /// <inheritdoc/>
        public override void Complete(Exception? exception = null)
        {
            this.inner.Complete(exception);
            var callback = Interlocked.Exchange(ref this.callback, null);
            callback?.Invoke(exception, this.state);
            this.state = null;
        }

        /// <inheritdoc/>
        public override ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default) => this.inner.FlushAsync(cancellationToken);

        /// <inheritdoc/>
        public override Memory<byte> GetMemory(int sizeHint = 0) => this.inner.GetMemory(sizeHint);

        /// <inheritdoc/>
        public override Span<byte> GetSpan(int sizeHint = 0) => this.inner.GetSpan(sizeHint);

        /// <inheritdoc/>
        [Obsolete]
        public override void OnReaderCompleted(Action<Exception?, object?> callback, object? state) => this.inner.OnReaderCompleted(callback, state);
    }
}


text:
package org.springframework.boot.autoconfigure.jdbc;

import org.apache.commons.dbcp.BasicDataSource;

/**
 * {@link BasicDataSource} used for testing.
 *
 * @author Phillip Webb
 * @author Kazuki Shimizu
 */
public class TestDataSource extends BasicDataSource {

	public TestDataSource(String name) {
		setDriverClassName("org.hsqldb.jdbcDriver");
		setUrl("jdbc:hsqldb:target/" + name);
		setUsername("sa");
	}

}


text:
require 'mkmf'
extension_name = 'lazy_proxy'
dir_config(extension_name)
create_makefile(extension_name)


text: Scripts to automate the Hyperborean Encounter Tables created by Ben Ball