text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package kobdig.market;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * A virtual trading pit, where a given security, commodity, or contract
 * is traded by performing an call auction.
 * Market participants trade by sending orders to the pit where the asset
 * they are interested in is traded.
 *
 * @author Andrea G. B. Tettamanzi
 */
public class Pit
{
    /** The name of the traded contract. */
    protected String ticker;

    /** The bid order book. */
    protected Book bids;

    /** The offer book. */
    protected Book asks;

    /** The last clearing price. */
    protected int price;

    /** The volume traded during the last auction. */
    protected int volume;

    /**
     * Creates a new trading pit for the contract with the given ticker.
     * The initial price is arbitrarily set to 1.
     */
    public Pit(String contract)
    {
        ticker = contract;
        bids = new Book(Order.BUY);
        asks = new Book(Order.SELL);
        price = 100;
    }

    /**
     * Gets the last clearing price of the contract traded.
     *
     * @return the current market price in this pit.
     */
    public int price()
    {
        return price;
    }

    /**
     * Gets the volume traded during the last auction.
     *
     */
    public int volume()
    {
        return volume;
    }

    /**
     * Checks whether the given market participant has the right to
     * submit orders to this trading pit.
     */
    public boolean recognize(Participant trader)
    {
        // For the time being, being a valid participant is enough...
        return trader!=null;
    }

    /**
     * Sends an order to this trading pit.
     * Only orders with a recognized issuer are accepted.
     *
     * @param o an order
     * @return if the order has been accepted
     */
    public boolean send(Order o)
    {
        if(!recognize(o.issuer()))
            return false;
        if(o.sign()==Order.BUY)
        {
            // Market.log.println("Received from " + o.issuer().name() +
            //         " BUY " + o.qty() + " " + ticker + " @" + o.price());
            return bids.insert(o);
        }
        else
        {
            // Market.log.println("Received from " + o.issuer().name() +
            //         " SELL " + o.qty() + " " + ticker + " @" + o.price());
            return asks.insert(o);
        }
    }

    /**
     * Deletes a previously submitted order.
     *
     * @param o an existing order
     */
    public void delete(Order o)
    {
        if(o==null)
            return;
        if(o.sign()==Order.BUY)
            bids.delete(o);
        else
            asks.delete(o);
    }

    /**
     * Performs a single-price auction to clear as many orders as possible.
     *
     * @return the volume traded
     */
    int clear()
    {
        Order bid, ask;
        LinkedList<Trade> trades = new LinkedList<Trade>();
        volume = 0;

        // Match orders and arrange trades:
        bid = bids.best();
        ask = asks.best();
        if(bid==null || ask==null)
            return volume;
        while(ask.price()<=bid.price())
        {
            int qty = Math.min(ask.qty(), bid.qty());
            // Arrange a new trade, leaving the price provisionally blank
            Trade trade = new Trade(ask, bid, qty, 0);
            trades.add(trade);
            volume += qty;

            // tentatively set clearing price as an average of bid and ask:
            int askprice = ask.price();
            if(askprice==0) askprice = bid.price();
            int bidprice = bid.price();
            if(bidprice==Integer.MAX_VALUE) bidprice = ask.price();
            if(askprice<=bidprice)
               price = (askprice + bidprice)/2;
            // otherwise, both seller and buyer are trading at market,
            // and the previously fixed price is still valid.

            ask.fill(qty);
            if(ask.qty()==0)
            {
                asks.delete(ask);
                ask = asks.best();
            }
            bid.fill(qty);
            if(bid.qty()==0)
            {
                bids.delete(bid);
                bid = bids.best();
            }
            if(ask==null || bid==null) break;
        }
        // N.B.: the last price is the clearing price!

        // Settle all the trades:
        Iterator<Trade> i = trades.iterator();
        while(i.hasNext())
        {
            Trade trade = i.next();
            trade.price = price;
            trade.ask.issuer().executed(trade.ask, -trade.qty, price);
            trade.bid.issuer().executed(trade.bid, trade.qty, price);
            Market.log.println(trade.ask.issuer().name() +
                    " -> " + trade.bid.issuer().name() +
                    " " + trade.qty + " " + ticker + " @" + trade.price);
        }
        return volume;
    }

    /**
     * Returns the ticker symbol of the security traded in this pit.
     *
     * @return a ticker symbol
     */
    public String ticker()
    {
        return ticker;
    }
}


text:
using System.Collections.Generic;
using Gtk;

namespace Luadicrous.Framework
{
	public abstract class VisualTreeElement : VisualTree<VisualTreeElement>
	{
		internal abstract Widget Widget { get; set; }

        internal Dictionary<string, object> AttachedProperties { get; set; } = new Dictionary<string, object>();

		internal BindingContext BindingContext { get; set; }
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php if (!defined('BASEPATH')) exit('No direct access allowed');

class Persona_model extends CI_model{

	function getUser($idUsuario = ''){
		if ($idPersona = '') {
			return(array());
		}
		$query = $this->db->where('idUsuario',$idUsuario);
		$query = $this->db->get('Usuario');
		return $query->row_array();

		$query = $this->db->where('idPersona',$idPersona);
		$query = $this->db->get('Persona');
		return $query->row();
	}

}
?>


text:
<?xml version="1.0" encoding="utf-8"?>
<EmailConnection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Name>Default</Name>
  <EmailConnectionType>DB</EmailConnectionType>
  <Settings />
</EmailConnection>


text: module.exports = require('./build/spawnAsync').default;


text:
package com.deleidos.rtws.core.framework;

import static org.junit.Assert.*;

import java.util.LinkedList;

import net.sf.json.JSONObject;

import org.junit.Test;

import com.deleidos.rtws.core.framework.AbstractProcessor;

public class AbstractProcessorTest {

	@Test
	public void testIncludeSingleAsset() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setAssetsToProcess("test");
		processor.process(record);
		assertEquals("Failed to process record for asset in include list.", 1, processor.records.size());
		assertSame("Wrong record processed.", record, processor.records.getFirst());
	}

	@Test
	public void testIncludeMultipleAssets() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setAssetsToProcess("test, this, that");
		processor.process(record);
		assertEquals("Failed to process record for asset in include list.", 1, processor.records.size());
		assertSame("Wrong record processed.", record, processor.records.getFirst());
	}

	@Test
	public void testIncludeOtherAssets() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setAssetsToProcess("this, that");
		processor.process(record);
		assertTrue("Processed a record for an asset that is not in the include list.", processor.records.isEmpty());
	}

	@Test
	public void testExcludeSingleAsset() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setAssetsToExclude("test");
		processor.process(record);
		assertTrue("Processed a record for an asset that is in the exclude list.", processor.records.isEmpty());
	}

	@Test
	public void testExcludeMultipleAssets() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setAssetsToExclude("test, this, that");
		processor.process(record);
		assertTrue("Processed a record for an asset that is in the exclude list.", processor.records.isEmpty());
	}

	@Test
	public void testExcludeOtherAssets() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setAssetsToExclude("this, that");
		processor.process(record);
		assertEquals("Failed to process record for asset that is not in the exclude list.", 1, processor.records.size());
		assertSame("Wrong record processed.", record, processor.records.getFirst());
	}

	@Test
	public void testDisabled() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.setProcessorEnabled(false);
		processor.process(record);
		assertTrue("Process called on disabled processor.", processor.records.isEmpty());
	}

	@Test
	public void testProcess() {
		JSONObject record = JSONObject.fromObject("{\"standardHeader\":{\"inputName\":\"test\"}}");
		MockProcessor processor = new MockProcessor();
		processor.process(record);
		assertEquals("Incorrect number of records processed.", 1, processor.records.size());
		assertSame("Wrong record processed.", record, processor.records.getFirst());
	}

	private static class MockProcessor extends AbstractProcessor {
		public LinkedList<JSONObject> records = new LinkedList<JSONObject>();

		public void initialize() {
		}

		public void dispose() {
		}

		protected void processInternal(JSONObject record) {
			records.add(record);
		}
	}

}


text:
import Container from './container'
import { DashboardItemMetadata } from './item'
import { extend } from '../../core/util'
import { PropertyList } from '../../core/property'

export default class Cell extends Container {
  static meta: DashboardItemMetadata = {
    category:     'structural'
  }

  span: number = 3
  offset: number
  align: string

  constructor(data?: any) {
    super(data)
    if (data) {
      this.span = data.span || this.span
      this.offset = data.offset
      this.align = data.align
    }
  }

  set_span(value: number) : Cell {
    this.span = value
    return <Cell> this.updated()
  }

  set_offset(value: number) : Cell {
    this.offset = value
    return <Cell> this.updated()
  }

  set_align(value: string) : Cell {
    this.align = value
    return <Cell> this.updated()
  }

  toJSON() : any {
    return extend(super.toJSON(), {
      span: this.span,
      offset: this.offset,
      align: this.align
    })
  }

  interactive_properties() : PropertyList {
    return super.interactive_properties().concat([
      'style',
      {
        name: 'span',
        edit_options: {
          type: 'select',
          source: [
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
          ],
          update: function(item, value) {
            item.set_span(Number(value))
          }
        }
      },
      {
        name: 'offset',
        edit_options: {
          type: 'select',
          source: [
            { value: undefined, text: 'none' }, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
          ],
          update: function(item, value) {
            item.set_offset(Number(value))
          }
        }
      },
      {
        name: 'align',
        type: 'select',
        edit_options: {
          source: [
            undefined,
            'left',
            'center',
            'right'
          ]
        }
      }
    ])
  }
}


text:
'use strict';

var env = {};

exports.setEnv = function(name, value) {
    env[name] = value;
};

exports.getEnv = function(name) {
    return env[name];
};


text:
aws_instance_id         = node[:opsworks][:instance][:aws_instance_id]
layer                   = node[:opsworks][:instance][:layers].first
hostname                = node[:opsworks][:instance][:hostname]
instances               = node[:opsworks][:layers].fetch(layer)[:instances].sort_by{|k,v| v[:booted_at] }
is_first_node           = instances.index{|i|i[0] == hostname} == 0

Chef::Log.debug("aws_instance_id: #{aws_instance_id}")
Chef::Log.debug("layer: #{layer}")
Chef::Log.debug("instances: #{instances.map{|i| i[0] }.join(', ')}")
Chef::Log.debug("is_first_node: #{is_first_node}")
Chef::Log.debug("hostname: #{hostname}")

if is_first_node && instances.count > 1 then
	Chef::Log.info("Glusterfs: More than one node and first one: Creating volume")

    instances.each do |i|
        instance = i[1]
        private_dns_name = instance[:private_dns_name]
        is_self = instance[:aws_instance_id] == aws_instance_id;

        Chef::Log.debug("Peer private_dns_name: #{private_dns_name}")

        execute "gluster peer probe #{private_dns_name}" do
            not_if "gluster peer status | grep '^Hostname: #{private_dns_name}'"
            not_if { is_self }
        end

    end

    node[:glusterfs][:server][:volumes].each do |volume_name|
    #node[:deploy].each do |application, deploy|
        Chef::Log.info("Gluster Volume: #{volume_name}")

        execute "gluster volume setup" do
            not_if "gluster volume info #{volume_name} | grep '^Volume Name: #{volume_name}'"
            bricks = instances.map{|i| i[1][:private_dns_name] + ":#{node[:glusterfs][:server][:export_directory]}/" + volume_name}.join(' ')
            command "gluster volume create #{volume_name} replica #{instances.count} transport tcp #{bricks}"
            action :run
        end

        execute "gluster volume start #{volume_name}" do
            not_if "gluster volume info #{volume_name} | grep '^Status: Started'"
            action :run
        end
    end
end

if instances.count > 1 then
	Chef::Log.info("Glusterfs: More than one node: Mounting volume")
	gluster_instances = node[:opsworks][:layers].fetch(layer)[:instances]
	Chef::Log.debug("Glusterfs: Instances: #{gluster_instances.map{|i| i[0] }.join(', ')}")

	puts gluster_instances.inspect
	if gluster_instances.count > 0 then
		gluster_server = gluster_instances.sort_by{|k,v| v[:booted_at] }[0][1][:private_ip].first
		Chef::Log.debug("Glusterfs: Server: #{gluster_server}")

		node[:glusterfs][:bind_mounts][:mounts].each do |source, dir|
			Chef::Log.debug("Glusterfs: Directory: #{dir}")
			Chef::Log.debug("Glsuterfs: Source: #{source}")
			directory dir do
				recursive true
				action :create
				mode "0755"
			end

			# mount -t glusterfs -o log-level=WARNING,log-file=/var/log/gluster.log 10.200.1.11:/test /mnt
			mount "#{dir}"  do
				device "#{gluster_server}:/#{source}"
				fstype "glusterfs"
				options "log-level=WARNING,log-file=/var/log/gluster.log"
				action :mount
			end
		end
	end
end


text:
import React from 'react'
import { withRouter } from 'react-router'
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'
import styled from 'styled-components'

const Button = styled.div`
  background-color: ${props => props.save ? '#2BC3A1' : ''};
  color: ${props => props.save ? 'white' : '#A3A3A3'};
  height: 48px;
  line-height: 1;
  font-size: 18px;
  padding: 15px 30px;
  cursor: pointer;
  font-weight: 300;
  border-radius: 4px
`

const ImageContainer = styled.div`
  width: 100%;
  background-color: #F7F7F7;
  min-height: 250px;
  margin-bottom: 20px;
`

const Card = styled.div`
  background-color: white;
  box-shadow: 0 1px 11px 0 rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  padding: 20px;
`

class AddPokemonCard extends React.Component {

  static propTypes = {
    router: React.PropTypes.object.isRequired,
    params: React.PropTypes.object.isRequired,
  }

  state = {
    name: '',
    url: '',
  }

  render () {
    return (

        <Card style={{ maxWidth: 400 }}>
          <input
            className='w-100 pa3 mv2'
            value={this.state.name}
            placeholder='Name'
            onChange={(e) => this.setState({name: e.target.value})}
          />
          <input
            className='w-100 pa3 mv2'
            value={this.state.url}
            placeholder='Image Url'
            onChange={(e) => this.setState({url: e.target.value})}
          />
          <ImageContainer>
            {this.state.url &&

            }
          </ImageContainer>

            <Button onClick={this.handleCancel}>Cancel</Button>
            {this.canSave()
              ? <Button save onClick={this.handleSave}>Save</Button>
              : <Button disabled>Save</Button>
            }

        </Card>

    )
  }

  canSave = () => {
    return this.state.name && this.state.url
  }

  handleSave = () => {

  }

  handleCancel = () => {
    this.props.router.replace('/')
  }
}

export default withRouter(AddPokemonCard)


text:
<?php

namespace Void\HTML;

use \ActiveRecord\Model;

class LabelTag extends Tag {
  public function __construct($name, $for, $attributes = Array()) {
    parent::__construct("label", null, $attributes);
    if($name instanceof Model) {
      $this->for = $for;
      // call the proper method on the model to get the Columnname
      $this->setContent($for);
    } else {
      $this->setContent($name);
      $this->for = $for;
    }
  }
}


text:
"""
This file contains functions to help with caching.
"""

# Django's cache module
from django.core.cache import cache

# Cached models
from core.spaces.models import Space

# Response types
from django.shortcuts import get_object_or_404

# Tries to get the object from cache
# Else queries the database
# Else returns a 404 error

def _get_cache_key_for_model(model, key):
    """
    Returns a unique key for the given model.

    We prefix the given `key` with the name of the `model` to provide a further
    degree of uniqueness of keys across the cache.
    """

    if not isinstance(key, basestring):
        raise TypeError('key must be  str or a unicode string')

    return model.__name__ + '_' + key

def get_or_insert_object_in_cache(model, key, *args, **kwargs):
    """
    Returns an instance of the `model` stored in the cache with the given key.
    If the object is not found in the cache, it is retrieved from the database
    and set in the cache.
    """

    actual_key = _get_cache_key_for_model(model, key)
    return_object = cache.get(actual_key)

    if not return_object:
        return_object = get_object_or_404(model, *args, **kwargs)
        cache.set(actual_key, return_object)

    return return_object


text:
/**
 * @fileoverview Rule to flag use constant conditions
 * @author Christian Schulz <http://rndm.de>
 */

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

module.exports = function(context) {

    "use strict";

    // array of types that should always trigger this rule if used inside a condition
    var alwaysSimpleConstantCondition = ["Literal", "FunctionExpression", "ObjectExpression", "ArrayExpression"],
        // map of functions that should be called to determine if it is a constant condition
        sometimesSimpleConstantCondition = {
            /**
             * Checks assignment expression for literal argument.
             * @example returns true for: if (t = +2) { doSomething() }
             * @param {ASTNode} field The AST node to check.
             * @returns {Boolean} true if assignment has right side literal or identifier.
             */
            "AssignmentExpression": function(field) {
                return (field.right.type === "Literal" ||
                    (field.right.type === "UnaryExpression" && field.right.argument.type === "Literal"));
            },
            /**
             * Checks unary expression for literal argument.
             * @example returns true for: if (+2) { doSomething(); }
             * @param {ASTNode} field The AST node to check.
             * @returns {Boolean} true if field has literal argument type.
             */
            "UnaryExpression": function(field) {
                return field.argument.type === "Literal";
            }
        };

    //--------------------------------------------------------------------------
    // Helpers
    //--------------------------------------------------------------------------

    /**
     * Checks if a node contains a constant condition.
     * @param {ASTNode} node The AST node to check.
     * @returns {void}
     * @private
     */
    function checkConstantCondition(node) {
        var field = node.test;
        // check if type exists in simpleConditions array
        if (alwaysSimpleConstantCondition.indexOf(field.type) !== -1 ||
            // check if type exists in sometimes simple conditions
            (sometimesSimpleConstantCondition.hasOwnProperty(field.type) &&
                // check if type is a simple condition
                sometimesSimpleConstantCondition[field.type](field))) {

            context.report(node, "Unexpected constant condition.");
        }
    }

    //--------------------------------------------------------------------------
    // Public
    //--------------------------------------------------------------------------

    return {
        "ConditionalExpression": checkConstantCondition,
        "IfStatement": checkConstantCondition,
        "WhileStatement": checkConstantCondition,
        "DoWhileStatement": checkConstantCondition,
        "ForStatement": checkConstantCondition
    };

};


text:
<?php

namespace BaseProject\Admin\Block;

use App\libs\App\Block;

class ListAdmin extends Block
{
    /** @var array */
    private $_headerLabel;
    /** @var array */
    private $_lines;
    /** @var array */
    private $_colsWidth;
    /** @var string */
    private $_urlToClick;
    /** @var array */
    private $_urlParams;

    /**
     * Menu constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $this->_colsWidth = [];
        $this->_lines = [];
        $this->_headerLabel = [];
        $this->setTemplate('/admin/list.phtml');
    }

    /**
     * @return array
     */
    public function getHeaderLabel()
    {
        return $this->_headerLabel;
    }

    /**
     * @param array $headerLabel
     */
    public function setHeaderLabel($headerLabel)
    {
        $this->_headerLabel = $headerLabel;
    }

    /**
     * @return array
     */
    public function getLines()
    {
        return $this->_lines;
    }

    /**
     * @param array $lines
     */
    public function setLines($lines)
    {
        $this->_lines = $lines;
    }

    /**
     * @return array
     */
    public function getColsWidth()
    {
        return $this->_colsWidth;
    }

    /**
     * @param array $colWidth
     */
    public function setColsWidth($colWidth)
    {
        $this->_colsWidth = $colWidth;
    }

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

    /**
     * @param string $urlToClick
     */
    public function setUrlToClick($urlToClick)
    {
        $this->_urlToClick = $urlToClick;
    }

    /**
     * @return array
     */
    public function getUrlParams()
    {
        return $this->_urlParams;
    }

    /**
     * @param array $urlParams
     */
    public function setUrlParams($urlParams)
    {
        $this->_urlParams = $urlParams;
    }

    /**
     * @param $line
     * @return null|string
     */
    public function buildUrl($line) {

        if ($this->_urlToClick) {
            $url = $this->_urlToClick;
            foreach ($this->_urlParams as $param) {
                $url = str_replace('{'.$param.'}', $line[$param], $url);
            }

            return $url;
        }
        return null;
    }
}


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

/**
 * Controller for the replica set list view.
 *
 * @final
 */
export class ReplicaSetListController {
  /**
   * @param {!backendApi.ReplicaSetList} replicaSetList
   * @param {!angular.Resource} kdReplicaSetListResource
   * @ngInject
   */
  constructor(replicaSetList, kdReplicaSetListResource) {
    /** @export {!backendApi.ReplicaSetList} */
    this.replicaSetList = replicaSetList;

    /** @export {!angular.Resource} */
    this.replicaSetListResource = kdReplicaSetListResource;
  }
}


text:
        <title>About Number Formatting</title>
        <link rel="stylesheet" href="nbdocs:/org/netbeans/modules/usersguide/ide.css" type="text/css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

About Number Formatting

            In the tab 'NumberFormatting' you can specify the number format.

            The number patterns details described below
            are extracted from :

        <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
            <param name="content" value="http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html">
            <param name="text" value="DecimalFormat">
            <param name="textFontSize" value="medium">
            <param name="textColor" value="blue">
        </object>

Patterns

                DecimalFormat patterns have the following syntax:

      Pattern:
      PositivePattern
      PositivePattern ; NegativePattern

      PositivePattern:
      Prefixopt Number Suffixopt
      NegativePattern:
      Prefixopt Number Suffixopt

      Prefix:
      any Unicode characters except \uFFFE, \uFFFF, and special characters
      Suffix:
      any Unicode characters except \uFFFE, \uFFFF, and special characters
      Number:
      Integer Exponentopt

      Integer . Fraction Exponentopt
      Integer:
      MinimumInteger
      #
      # Integer

      # , Integer
      MinimumInteger:
      0
      0 MinimumInteger
      0 , MinimumInteger
      Fraction:

      MinimumFractionopt OptionalFractionopt
      MinimumFraction:
      0 MinimumFractionopt
      OptionalFraction:

      # OptionalFractionopt
      Exponent:
      E MinimumExponent
      MinimumExponent:
      0 MinimumExponentopt

                A DecimalFormat pattern contains a positive and negative
                subpattern, for example, "#,##0.00;(#,##0.00)".  Each
                subpattern has a prefix, numeric part, and suffix. The negative subpattern
                is optional; if absent, then the positive subpattern prefixed with the
                localized minus sign ('-' in most locales) is used as the
                negative subpattern. That is, "0.00" alone is equivalent to
                "0.00;-0.00".  If there is an explicit negative subpattern, it
                serves only to specify the negative prefix and suffix; the number of digits,
                minimal digits, and other characteristics are all the same as the positive
                pattern. That means that "#,##0.0#;(#)" produces precisely
                the same behavior as "#,##0.0#;(#,##0.0#)".

                The prefixes, suffixes, and various symbols used for infinity, digits,
                thousands separators, decimal separators, etc. may be set to arbitrary
                values, and they will appear properly during formatting.  However, care must
                be taken that the symbols and strings do not conflict, or parsing will be
                unreliable.  For example, either the positive and negative prefixes or the
                suffixes must be distinct for DecimalFormat.parse() to be able
                to distinguish positive from negative values.  (If they are identical, then
                DecimalFormat will behave as if no negative subpattern was
                specified.)  Another example is that the decimal separator and thousands
                separator should be distinct characters, or parsing will be impossible.

                The grouping separator is commonly used for thousands, but in some
                countries it separates ten-thousands. The grouping size is a constant number
                of digits between the grouping characters, such as 3 for 100,000,000 or 4 for
                1,0000,0000.  If you supply a pattern with multiple grouping characters, the
                interval between the last one and the end of the integer is the one that is
                used. So "#,##,###,####" == "######,####" ==
                "##,####,####".

Special Pattern Characters

                Many characters in a pattern are taken literally; they are matched during
                parsing and output unchanged during formatting.  Special characters, on the
                other hand, stand for other characters, strings, or classes of characters.
                They must be quoted, unless noted otherwise, if they are to appear in the
                prefix or suffix as literals.

                The characters listed here are used in non-localized patterns.  Localized
                patterns use the corresponding characters taken from this formatter's
                DecimalFormatSymbols object instead, and these characters lose
                their special status.  Two exceptions are the currency sign and quote, which
                are not localized.

                    Symbol
                    Location
                    Localized?
                    Meaning

                    0
                    Number
                    Yes
                    Digit

                    #
                    Number
                    Yes
                    Digit, zero shows as absent

                    .

                    Number
                    Yes
                    Decimal separator or monetary decimal separator

                    -
                    Number
                    Yes
                    Minus sign

                    ,
                    Number
                    Yes
                    Grouping separator

                    E
                    Number
                    Yes
                    Separates mantissa and exponent in scientific notation.
                    Need not be quoted in prefix or suffix.

                    ;
                    Subpattern boundary
                    Yes
                    Separates positive and negative subpatterns

                    %
                    Prefix or suffix
                    Yes
                    Multiply by 100 and show as percentage

                    \u2030
                    Prefix or suffix
                    Yes
                    Multiply by 1000 and show as per mille value

                    ¤ (\u00A4)
                    Prefix or suffix
                    No
                    Currency sign, replaced by currency symbol.  If
                    doubled, replaced by international currency symbol.
                    If present in a pattern, the monetary decimal separator
                    is used instead of the decimal separator.

                    '
                    Prefix or suffix
                    No
                    Used to quote special characters in a prefix or suffix,
                    for example, "'#'#" formats 123 to
                    "#123".  To create a single quote
                    itself, use two in a row: "# o''clock".

Scientific Notation

                Numbers in scientific notation are expressed as the product of a mantissa
                and a power of ten, for example, 1234 can be expressed as 1.234 x 10^3.  The
                mantissa is often in the range 1.0 <= x < 10.0, but it need not be.
                DecimalFormat can be instructed to format and parse scientific
                notation only via a pattern; there is currently no factory method
                that creates a scientific notation format.  In a pattern, the exponent
                character immediately followed by one or more digit characters indicates
                scientific notation.  Example: "0.###E0" formats the number
                1234 as "1.234E3".

The number of digit characters after the exponent character gives the
                minimum exponent digit count.  There is no maximum.  Negative exponents are
                formatted using the localized minus sign, not the prefix and suffix
                from the pattern.  This allows patterns such as "0.###E0 m/s".

The minimum and maximum number of integer digits are interpreted
                together:

If the maximum number of integer digits is greater than their minimum number
                    and greater than 1, it forces the exponent to be a multiple of the maximum
                    number of integer digits, and the minimum number of integer digits to be
                    interpreted as 1.  The most common use of this is to generate
                    engineering notation, in which the exponent is a multiple of three,
                    e.g., "##0.#####E0". Using this pattern, the number 12345
                    formats to "12.345E3", and 123456 formats to
                    "123.456E3".

Otherwise, the minimum number of integer digits is achieved by adjusting the
                    exponent.  Example: 0.00123 formatted with "00.###E0" yields
                    "12.3E-4".

The number of significant digits in the mantissa is the sum of the
                minimum integer and maximum fraction digits, and is
                unaffected by the maximum integer digits.  For example, 12345 formatted with
                "##0.##E0" is "12.3E3". To show all digits, set
                the significant digits count to zero.  The number of significant digits
                does not affect parsing.

Exponential patterns may not contain grouping separators.

Rounding

            DecimalFormat uses half-even rounding (see
            BigDecimal.ROUND_HALF_EVEN) for
            formatting.

Digits

            For formatting, DecimalFormat uses the ten consecutive
            characters starting with the localized zero digit defined in the
            DecimalFormatSymbols object as digits. For parsing, these
            digits as well as all Unicode decimal digits, as defined by
            Character.digit, are recognized.

Special Values

                NaN is formatted as a single character, typically
                \uFFFD.  This character is determined by the
                DecimalFormatSymbols object.  This is the only value for which
                the prefixes and suffixes are not used.

                Infinity is formatted as a single character, typically
                \u221E, with the positive or negative prefixes and suffixes
                applied.  The infinity character is determined by the
                DecimalFormatSymbols object.

                Negative zero ("-0") parses to

BigDecimal(0) if isParseBigDecimal() is
                true,

Long(0) if isParseBigDecimal() is false
                and isParseIntegerOnly() is true,

Double(-0.0) if both isParseBigDecimal()

                and isParseIntegerOnly() are false.


text:
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"rad-reveal":[function(require,module,exports){

/* jshint -W097 */
/* global document, Reveal, module, console */

/**
 * The core RadReveal functionality used by all add-ons.
 * Please see [project README](https://github.com/joelarson4/radReveal) for an overview.
 *
 * Import using `require('rad-reveal');`.
 * @module RadReveal
 */
'use strict';

var config; //reveal + rad config
var allSlideElements; //all 'section' elements
var allSlideObjs = []; //the rad objects created for slides
var currentSlideObj;
var currentFragObj;

function register(name, initialize) {
    for(var di = 0, dlen = config.dependencies.length; di < dlen; di++) {
        if(config.dependencies[di].radName == name) {
            initialize(config.dependencies[di].radConfig, allSlideObjs);
        }
    }
}

/**
 * Registers specific event handlers for attributes.  The handler is called after all addons are initialized.
 * Behavior varies slightly whether the level is 'section' or 'fragment'.
 * @param {string} level - either 'section' or 'fragment'
 * @param {object} addon - addon module being registered
 * @param {string} attrName - the name of the attribute to associate the event with.
 * @private
 */
function registerAttributeEventHandler(attrName, events, handler) {
    if(typeof events == 'string') {
        events = events.split(',');
    }

    var slidesWithAttr = Array.prototype.slice.apply(document.querySelectorAll('section[' + attrName + ']'));
    var fragsWithAttr = Array.prototype.slice.apply(document.querySelectorAll('.fragment[' + attrName + ']'));
    var eleWithAttr = slidesWithAttr.concat(fragsWithAttr);
    eleWithAttr.forEach(function(eleElement) {
        var indexAttr;
        var level;
        if(eleElement.tagName == 'SECTION') {
            indexAttr = 'data-rad-main-slide-index';
            level = 'slide';
        } else if(eleElement.className.indexOf('fragment') > -1) {
            indexAttr = 'data-rad-main-fragment-index';
            level = 'fragment';
        } else {
            console.log(attrName + ' attached to non-section, non-fragment element; ignored');
            return; //not a fragment or slide, ignore
        }

        var eleIndex = parseInt(eleElement.getAttribute(indexAttr));
        var eleObj;
        if(level == 'slide') {
            eleObj = allSlideObjs[eleIndex];
        } else {
            var slideIndex = parseInt(eleElement.getAttribute('data-rad-main-fragment-slide'));
            eleObj = allSlideObjs[slideIndex].fragObjs[eleIndex];
        }
        var attrVal = eleElement.getAttribute(attrName);

        events.forEach(function(eventName) {
            eventName = eventName.trim();

            //run 'load' immediately
            if(eventName == 'load') {
                handler(attrVal, eleObj, { type: 'rad' }, eventName);
            }

            //add shown to element's onShown list
            if(eventName == 'shown') {
                eleObj.onShown.push(handlerClosure(handler, attrVal, eleObj, eventName));
            }

            //add hidden to element's onShown list
            if(eventName == 'hidden') {
                eleObj.onHidden.push(handlerClosure(handler, attrVal, eleObj, eventName));
            }
        });
    });
}

/**
 * Simple closure to run handler within.
 * @private
 */
function handlerClosure(handler, attrVal, slideObj, radEventName) {
    return function(event) {
        handler(attrVal, slideObj, event, radEventName);
    };
}

/**
 * Sets up a slide for use within the framework.
 * @private
 */
function slideSetup(slideElement, si) {
    var prevSlideObj = ( si ? allSlideObjs[si - 1] : null);
    var slideObj = {
        index: si,
        element: slideElement,
        nextSlideObj: null,
        prevSlideObj: prevSlideObj,
        lastSlideObj: null, //the slide we left to get to current slide
        onShown: [],
        onHidden: [],
        data: {}
    };
    slideElement.setAttribute('data-rad-main-slide-index', si + '');
    if(prevSlideObj) prevSlideObj.nextSlideObj = slideObj;
    allSlideObjs.push(slideObj);

    slideObj.fragElements = Array.prototype.slice.apply(slideElement.querySelectorAll('.fragment'));
    slideObj.fragObjs = [];
    slideObj.fragElements.forEach(function(fragElement, fi) {
        fragSetup(slideObj, fragElement, fi);
    });
}

/**
 * Sets up a fragment for use within the framework.
 * @private
 */
function fragSetup(slideObj, fragElement, fi) {
    var prevFragObj = ( fi ? slideObj.fragObjs[fi - 1] : null);
    var fragObj = {
        index: fi,
        element: fragElement,
        slideObj: slideObj,
        nextFragObj: null,
        prevFragObj: prevFragObj,
        onShown: [],
        onHidden: [],
        data: {}
    };
    fragElement.setAttribute('data-rad-main-fragment-index', fi + '');
    fragElement.setAttribute('data-rad-main-fragment-slide', slideObj.index + '');
    if(prevFragObj) prevFragObj.nextFragObj = fragObj;
    slideObj.fragObjs.push(fragObj);
}

/**
 * Event handler called when slide is changed, which then passes off to underlying addon handlers.
 * @private
 */
function slideHandler(event) {
    var slideElement = event.currentSlide;
    var slideIndex = parseInt(slideElement.getAttribute('data-rad-main-slide-index'));

    //prevents double firing under some circumstances
    if(allSlideObjs[slideIndex] == currentSlideObj) return;

    event.direction = null;
    if(currentSlideObj) {
        if(currentSlideObj.indexh < event.indexh) {
            event.direction = 'left';
        } else if(currentSlideObj.indexh > event.indexh) {
            event.direction = 'right';
        } else if(currentSlideObj.indexv < event.indexv) {
            event.direction = 'down';
        } else if(currentSlideObj.indexv > event.indexv) {
            event.direction = 'up';
        } else {
            event.direction = 'unknown';
        }
    }

    allSlideObjs[slideIndex].lastSlideObj = currentSlideObj;

    var oi, olen;

    if(currentSlideObj) {
        for(oi = 0, olen = currentSlideObj.onHidden.length; oi < olen; oi++) {
            currentSlideObj.onHidden[oi](event);
        }
    }

    currentSlideObj = allSlideObjs[slideIndex];
    currentSlideObj.indexh = event.indexh;
    currentSlideObj.indexv = event.indexv;

    for(oi = 0, olen = currentSlideObj.onShown.length; oi < olen; oi++) {
        currentSlideObj.onShown[oi](event);
    }

    currentFragObj = null;
}

/**
 * Event handler called when fragment is changed, which then passes off to underlying addon handlers.
 * @private
 */
function fragHandler(eventName, event) {
    var fragElement = event.fragment;
    var fragIndex = parseInt(fragElement.getAttribute('data-rad-main-fragment-index'));

    var fragObj = currentSlideObj.fragObjs[fragIndex];

    for(var oi = 0, olen = fragObj[eventName].length; oi < olen; oi++) {
        fragObj[eventName][oi](event);
    }
}

function fragShownHandler(event) {
    fragHandler('onShown', event);
}

function fragHiddenHandler(event) {
    fragHandler('onHidden', event);
}

/**
 * Gets dependencies settings and registers event handlers.
 */
function initialize() {
    config = Reveal.getConfig();

    Reveal.addEventListener('ready', slideHandler);
    Reveal.addEventListener('slidechanged', slideHandler);

    Reveal.addEventListener('fragmentshown', fragShownHandler);
    Reveal.addEventListener('fragmenthidden', fragHiddenHandler);
}

/**
 * Returns all the slide objects set up by RadReveal.  This should only be used in test code.
 */
function getSlideObjects() {
    return allSlideObjs.concat([]);
}

//Must capture the DOM before Reveal.js gets involved.
allSlideElements = Array.prototype.slice.apply(document.querySelectorAll('.reveal section'));
allSlideElements.forEach(slideSetup);

module.exports = {
    register: register,
    on: registerAttributeEventHandler,
    initialize: initialize,
    getSlideObjects: getSlideObjects
};
},{}]},{},["rad-reveal"]);


text:
import pkg_resources
pkg_resources.declare_namespace(__name__)


text:
<?php

namespace Oro\Component\Layout\Extension\Theme\Model;

interface ThemeFactoryInterface
{
    /**
     * @param string $themeName
     * @param array  $themeDefinition
     *
     * @return Theme
     */
    public function create($themeName, array $themeDefinition);
}


text:
#ifndef SHOVELER_FONT_H
#define SHOVELER_FONT_H

#include <ft2build.h>
#include <stdbool.h>
#include FT_FREETYPE_H

#include <glib.h>

typedef struct ShovelerFontsStruct {
  FT_Library library;
  /** map from string names to (ShovelerFont *) */
  GHashTable* fonts;
} ShovelerFonts;

typedef struct ShovelerFontStruct {
  ShovelerFonts* fonts;
  char* name;
  FT_Face face;
} ShovelerFont;

ShovelerFonts* shovelerFontsCreate();
ShovelerFont* shovelerFontsLoadFontFile(
    ShovelerFonts* fonts, const char* name, const char* filename);
ShovelerFont* shovelerFontsLoadFontBuffer(
    ShovelerFonts* fonts, const char* name, const unsigned char* buffer, int bufferSize);
bool shovelerFontsUnloadFont(ShovelerFonts* fonts, const char* name);
void shovelerFontsFree(ShovelerFonts* fonts);

#endif


text:
This application audits disk usage on filesystem partitions.

Broadly speaking, for a list of directories, possibly on multiple hosts, the package generates a report showing, for each directory, how much space each user's files are occupying, with a list of directories that are particularly big.  In addition, it generates lists of broken symbolic links and unreadable directories (since it cannot record disk usage for directories it cannot read).  Optionally, a reduced version of the report can be emailed to a list of users, and a per-user list of broken links and unreadable directories can be mailed to the owner.

### Installation

Either clone the latest from GitHub and unpack it:

```bash
>>>>>>> 756da7a877f832b51bd9ad426fe153da3f8e8152
git clone git@github.com:gdbzork/disk_space_audit.git
cd disk_space_audit
```

or download a tagged release from `https://github.com/gdbzork/disk_space_audit/releases`, unpack it and change to the source directory:

```bash
>>>>>>> 756da7a877f832b51bd9ad426fe153da3f8e8152
tar xf disk_space_audit-N.n.x.tar.gz
cd disk_space_audit-N.n.x
```

Then make sure you have the necessary support packages, build it and install it:
```bash
bundle
gem build diskAudit.gemspec
gem install diskAudit-N.n.x.gem
```

where "N", "n" and "x" are the major release number, minor release number, and
patch level.

Note that "N", "n" and "x" are the major release number, minor release number, and patch level.  In general, the patch level is incremented for bug fixes or documentation changes, the minor release is incremented for backwards-compatible changes, and the major release number is incremented for non-backwards-compatible changes.

### Usage

The overall model of operation is that the report generator will be run on some host machine (typically via a `cron` job), connecting to one or more remote machines (possibly including the host machine), scanning listed directories on the remote machine(s), then generating a report showing the disk usage, by user, on each of the specified paths.  The report may be text or html.  Optionally the report can be mailed to a list of users.  Log messages are written to a specified file on the host.

In addition, the program generates a list of broken symbolic links, and of subdirectories it did not have read access to (and so cannot include in the report).   individual reports of broken links and unreadable directories can be mailed to the owners of the broken paths.

#### Configuration

##### Configuration file

Execution of the package is controlled primarily by a configuration file in YAML syntax (see http://www.yaml.org/).  Sections that should be set are:

`destination` -- the directory to write the results files into.  May also be set on the command line (default: `./tmp`).

`format` -- output format, either "text" or "html".  May also be set on the command line (default: text).

`ssh_user` -- username of the remote user when generating a report for a remote host (default: the current user).

`group_id` -- Unix filesystem group the report is being generated for, so we can report on `lustre` group quotas.

`system_log` -- file to append log messages to (on the local machine) (default: stderr).

`log_level` -- how much logging to do: "debug", "info", "warn", "error" (default: warn).

`admins` -- a list of admin email addresses for warning/error messages.

`targets` -- a list of `host:path` pairs for which to generate reports.

`exclude` -- a list of `host:path` pairs to exclude from the above targets (for example, a target might be `bioinf-srv003:/data` but the report should exclude `bioinf-srv003:/data/reference_data`).

`people` -- a dictionary of `username:email address` pairs who should receive emails when this report is run (if emails are enabled).

`useridMap` -- a map of numeric userids to usernames, to allow the report to name people whose accounts are no longer active, and who therefore are only known by their numeric userid.  (Think of it as a "cheat list" to allow the report to name the guilty, rather than just identifying them by number.)

Following is an example of a configuration file.  Note the difference in syntax between lists (`targets` for example) and maps (`people`).

```YAML
destination: /var/www/html/diskAudit
format: html
ssh_user: brown22
system_log: /var/log/diskAudit/diskAudit.log
log_level: info
admins:
  - Gordon.Brown@cruk.cam.ac.uk
targets:
  - bioinf-srv003:/data
  - sol-srv003:/lustre/mib-cri
  - clust1-headnode:/mnt/scratcha/bioinformatics
  - clust1-headnode:/mnt/scratchb/bioinformatics
exclude:
  - bioinf-srv003:/data/reference_data
people:
  baller01 : Stephane.Ballereau@cruk.cam.ac.uk
  bowers01 : Richard.Bowers@cruk.cam.ac.uk
  brown22 : Gordon.Brown@cruk.cam.ac.uk
useridMap:
  802161580 : howe01
  853250745 : halim01
  899611315 : macart01
```

The default configuration file is stored as part of the package, in `.../data/diskAudit/configuration.yaml`.  An alternative configuration file can be supplied on the command line.

##### Other Configuration

For the package to operate correctly, `ssh` keys must be set up so that the host machine (on which the report is being generated) can remote login to the target machines (for which we want reports) without a password.

Ruby and this gem must be installed on the host and target machines.  The Ruby executable and the top-level program of this gem (`bioinfDiskAudit`) must be in the `PATH` on the target machines.  (In a normal installation, the program will reside in the same directory as the Ruby executable.)

#### Command Line Syntax

The basic syntax of the command line is:

```
bioinfDiskAudit [options] dump|remote|local [<path>]
```

The three subcommands determine overall behaviour:
  * `remote` -- normal mode: communicate with remote hosts and generate a report.
  * `dump` -- this instruction tells the program that it is running on a remote host, to scan a directory hierarchy and return the results to the controller.
  * `local` -- run the program on a local directory.  This is primarily for testing purposes.  The `<path>` parameter is used in local mode to provide the path to examine; it should not be specified in other modes.

Normal usage will only ever use `remote`; the program will invoke its remote copies via `dump`.

If an option is not specified either in the configuration file or on the command line, then whatever it controls will be omitted.  For example, if no ``people`` are listed, no emails will be sent.  And so on.

Several options control the behaviour of the program (defaults in square brackets).

`--config *file*` -- configuration file to use [`data/diskAudit/configuration.yaml` relative to the installation directory].

`--destination *path*` -- directory in which to write output files [`./tmp`].

`-d|--default` -- write configuration to stdout (and exit).

`--format text|html` -- output format, text or html [text].

`-h|--help` -- display usage message (and exit).

`--level debug|info|warn|error` -- logging level required [warn].

`--logfile *file*` -- file to append log messages to [stderr].

`--nomail` -- do not send any emails, whatever the configuration might indicate.

`-v|--version` -- write the version of the package to stdout (and exit).

#### Logging

As briefly mentioned above, log messages can be written to a file on the host machine.  The `log_level` parameter in the configuration file determines the level of logging:

  1. `debug` -- debugging messages (very verbose)
  1. `info` -- informative messages (somewhat verbose)
  1. `warn` -- warnings (non-fatal errors)
  1. `error` -- fatal errors (program cannot continue)

As with every other logging system in the world, setting a particular level includes all messages of that *and higher* severity.

### Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

### Contributing

Bug reports are welcome on GitHub at https://github.com/gdbzork/disk_space_audit.

### License

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


text:
/**
 *  Set up namespace
 */
namespace Php {

/**
 *  Class definition
 */
class PHPCPP_EXPORT ArrayAccess
{
public:
    /**
     *  Check if a member is set
     *  @param  key
     *  @return bool
     */
    virtual bool offsetExists(const Php::Value &key) = 0;

    /**
     *  Set a member
     *  @param  key
     *  @param  value
     */
    virtual void offsetSet(const Php::Value &key, const Php::Value &value) = 0;

    /**
     *  Retrieve a member
     *  @param  key
     *  @return value
     */
    virtual Php::Value offsetGet(const Php::Value &key) = 0;

    /**
     *  Remove a member
     *  @param key
     */
    virtual void offsetUnset(const Php::Value &key) = 0;
};

/**
 *  End namespace
 */
}


text:
package org.eclipse.jetty.websocket.jsr356.annotations;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;
import javax.websocket.EndpointConfig;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;

import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.common.events.annotated.AbstractMethodAnnotationScanner;
import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException;
import org.eclipse.jetty.websocket.common.util.ReflectUtils;

public class AnnotatedEndpointScanner<T extends Annotation, C extends EndpointConfig> extends AbstractMethodAnnotationScanner<AnnotatedEndpointMetadata<T, C>>
{
    private static final Logger LOG = Log.getLogger(AnnotatedEndpointScanner.class);

    private final LinkedList<IJsrParamId> paramsOnOpen;
    private final LinkedList<IJsrParamId> paramsOnClose;
    private final LinkedList<IJsrParamId> paramsOnError;
    private final LinkedList<IJsrParamId> paramsOnMessage;
    private final AnnotatedEndpointMetadata<T, C> metadata;

    public AnnotatedEndpointScanner(AnnotatedEndpointMetadata<T, C> metadata)
    {
        this.metadata = metadata;

        paramsOnOpen = new LinkedList<>();
        paramsOnClose = new LinkedList<>();
        paramsOnError = new LinkedList<>();
        paramsOnMessage = new LinkedList<>();

        metadata.customizeParamsOnOpen(paramsOnOpen);
        paramsOnOpen.add(JsrParamIdOnOpen.INSTANCE);

        metadata.customizeParamsOnClose(paramsOnClose);
        paramsOnClose.add(JsrParamIdOnClose.INSTANCE);

        metadata.customizeParamsOnError(paramsOnError);
        paramsOnError.add(JsrParamIdOnError.INSTANCE);

        metadata.customizeParamsOnMessage(paramsOnMessage);
        paramsOnMessage.add(JsrParamIdText.INSTANCE);
        paramsOnMessage.add(JsrParamIdBinary.INSTANCE);
        paramsOnMessage.add(JsrParamIdPong.INSTANCE);
    }

    private void assertNotDuplicate(JsrCallable callable, Class<? extends Annotation> methodAnnotationClass, Class<?> pojo, Method method)
    {
        if (callable != null)
        {
            // Duplicate annotation detected
            StringBuilder err = new StringBuilder();
            err.append("Encountered duplicate method annotations @");
            err.append(methodAnnotationClass.getSimpleName());
            err.append(" on ");
            err.append(ReflectUtils.toString(pojo,callable.getMethod()));
            err.append(" and ");
            err.append(ReflectUtils.toString(pojo,method));

            throw new InvalidSignatureException(err.toString());
        }
    }

    @Override
    public void onMethodAnnotation(AnnotatedEndpointMetadata<T, C> metadata, Class<?> pojo, Method method, Annotation annotation)
    {
        if (LOG.isDebugEnabled())
        {
            LOG.debug("onMethodAnnotation({}, {}, {}, {})",metadata,pojo,method,annotation);
        }

        if (isAnnotation(annotation,OnOpen.class))
        {
            assertIsPublicNonStatic(method);
            assertIsReturn(method,Void.TYPE);
            assertNotDuplicate(metadata.onOpen,OnOpen.class,pojo,method);
            OnOpenCallable onopen = new OnOpenCallable(pojo,method);
            visitMethod(onopen,pojo,method,paramsOnOpen,OnOpen.class);
            metadata.onOpen = onopen;
            return;
        }

        if (isAnnotation(annotation,OnClose.class))
        {
            assertIsPublicNonStatic(method);
            assertIsReturn(method,Void.TYPE);
            assertNotDuplicate(metadata.onClose,OnClose.class,pojo,method);
            OnCloseCallable onclose = new OnCloseCallable(pojo,method);
            visitMethod(onclose,pojo,method,paramsOnClose,OnClose.class);
            metadata.onClose = onclose;
            return;
        }

        if (isAnnotation(annotation,OnError.class))
        {
            assertIsPublicNonStatic(method);
            assertIsReturn(method,Void.TYPE);
            assertNotDuplicate(metadata.onError,OnError.class,pojo,method);
            OnErrorCallable onerror = new OnErrorCallable(pojo,method);
            visitMethod(onerror,pojo,method,paramsOnError,OnError.class);
            metadata.onError = onerror;
            return;
        }

        if (isAnnotation(annotation,OnMessage.class))
        {
            assertIsPublicNonStatic(method);
            // assertIsReturn(method,Void.TYPE); // no validation, it can be any return type
            OnMessageCallable onmessage = new OnMessageCallable(pojo,method);
            visitMethod(onmessage,pojo,method,paramsOnMessage,OnMessage.class);

            Param param = onmessage.getMessageObjectParam();
            switch (param.role)
            {
                case MESSAGE_BINARY:
                    metadata.onBinary = new OnMessageBinaryCallable(onmessage);
                    break;
                case MESSAGE_BINARY_STREAM:
                    metadata.onBinaryStream = new OnMessageBinaryStreamCallable(onmessage);
                    break;
                case MESSAGE_TEXT:
                    metadata.onText = new OnMessageTextCallable(onmessage);
                    break;
                case MESSAGE_TEXT_STREAM:
                    metadata.onTextStream = new OnMessageTextStreamCallable(onmessage);
                    break;
                case MESSAGE_PONG:
                    metadata.onPong = new OnMessagePongCallable(onmessage);
                    break;
                default:
                    StringBuilder err = new StringBuilder();
                    err.append("An unrecognized message type <");
                    err.append(param.type);
                    err.append(">: does not meet specified type categories of [TEXT, BINARY, DECODER, or PONG]");
                    throw new InvalidSignatureException(err.toString());
            }
        }
    }

    public AnnotatedEndpointMetadata<T, C> scan()
    {
        scanMethodAnnotations(metadata,metadata.getEndpointClass());
        return metadata;
    }

    private void visitMethod(JsrCallable callable, Class<?> pojo, Method method, LinkedList<IJsrParamId> paramIds,
            Class<? extends Annotation> methodAnnotationClass)
    {
        // Identify all of the parameters
        for (Param param : callable.getParams())
        {
            if (!visitParam(callable,param,paramIds))
            {
                StringBuilder err = new StringBuilder();
                err.append("Encountered unknown parameter type <");
                err.append(param.type.getName());
                err.append("> on @");
                err.append(methodAnnotationClass.getSimpleName());
                err.append(" annotated method: ");
                err.append(ReflectUtils.toString(pojo,method));

                throw new InvalidSignatureException(err.toString());
            }
        }
    }

    private boolean visitParam(JsrCallable callable, Param param, List<IJsrParamId> paramIds)
    {
        for (IJsrParamId paramId : paramIds)
        {
            if (LOG.isDebugEnabled())
            {
                LOG.debug("{}.process()",paramId);
            }
            if (paramId.process(param,callable))
            {
                // Successfully identified
                if (LOG.isDebugEnabled())
                {
                    LOG.debug("Identified: {}",param);
                }
                return true;
            }
        }

        // Failed identification as a known parameter
        return false;
    }
}


text:
* support scheduled maintenance

### 0.3.0 (2022-07-05)

#### Features

* Updated minimum Ruby version to 2.6 ([#18443](https://github.com/googleapis/google-cloud-ruby/issues/18443))
#### Bug Fixes

* Fixed a crash when making certain long-running-operations status calls ([#18441](https://github.com/googleapis/google-cloud-ruby/issues/18441))

### 0.2.5 / 2022-01-11

#### Bug Fixes

* Honor quota project in auxiliary operations clients

#### Documentation

* Fix titles of documentation pages
* Remove some broken images and fix outdated content in authentication documentation

### 0.2.4 / 2021-11-08

#### Documentation

* Added simple code snippets to RPC method documentation

### 0.2.3 / 2021-08-11

#### Bug Fixes

* Honor client-level timeout configuration

### 0.2.2 / 2021-07-12

#### Documentation

* Clarify some language around authentication configuration

### 0.2.1 / 2021-06-17

#### Bug Fixes

* Support future 1.x versions of gapic-common

### 0.2.0 / 2021-04-05

#### Features

* Drop support for Ruby 2.4 and add support for Ruby 3.0
* Support for apply_software_update
* Use self-signed JWT credentials when possible

#### Bug Fixes

* Allow special symbolic credentials in client configs

#### Documentation

* Timeout config description correctly gives the units as seconds.

### 0.1.2 / 2020-08-06

#### Bug Fixes

* Fix retry logic by checking the correct numeric error codes

### 0.1.1 / 2020-06-18

#### Documentation

* Add documentation and API enablement links to the readme

### 0.1.0 / 2020-06-15

Initial release.


text:
<?xml version="1.0" encoding="UTF-8"?>
<Barony name="Serpia" x="9" y="15" z="0" heightmap="serpia">
    <Holding name="Hebi" type="Village" objectNo="1"></Holding>
    <Holding name="Snakewoods" type="Great Forest" objectNo="2"></Holding>
	<Levy>
   	    <Regiment type="Pikemen" amount="100" maxAmount="100" position="0"></Regiment>
   	    <Regiment type="Pikemen" amount="200" maxAmount="200" position="1"></Regiment>
   	</Levy>
   	<Garrison>
   	    <Regiment type="Walls" amount="1000" maxAmount="1000" position="0"></Regiment>
   	    <Regiment type="Walls" amount="1000" maxAmount="1000" position="1"></Regiment>
   	    <Regiment type="Guardians" amount="100" maxAmount="100" position="2"></Regiment>
   	</Garrison>
</Barony>


text:
package org.eclipse.freemarker.internal.core;

import org.eclipse.core.runtime.Plugin;

public class FMCorePlugin extends Plugin {

	public static final String ID = "org.eclipse.freemarker.core"; //$NON-NLS-1$

	// The shared instance.
	private static FMCorePlugin plugin;

	/**
	 * The constructor.
	 */
	public FMCorePlugin() {
		super();
		plugin = this;
	}

}


text:
package com.aj.eb;

import android.graphics.drawable.Drawable;

public class DrawerItem {

    private boolean mShowNotify;
    private Drawable mIcon;
    private String mTitle;

    public DrawerItem() {
    }

    public DrawerItem(boolean showNotify, Drawable icon, String title) {
        mShowNotify = showNotify;
        mIcon = icon;
        mTitle = title;
    }

    public boolean isShowNotify() {
        return mShowNotify;
    }

    public void setShowNotify(boolean showNotify) {
        mShowNotify = showNotify;
    }

    public Drawable getIcon() {
        return mIcon;
    }

    public void setIcon(Drawable icon) {
        mIcon = icon;
    }

    public String getTitle() {
        return mTitle;
    }

    public void setTitle(String title) {
        mTitle = title;
    }
}


text:
export default {
  title:
    'A Mind for Numbers - How to Excel at Math and Science Review & Summary',
  tags: ['Books', 'Learning To Learn'],
  nick: 'mind for numbers',
  body: `
7/10 people I meet claim to be bad learners, especially in the field of math and science. If you are one of those 7, [this book will help you tremendously](http://amzn.to/2vDVzk1).

good for beginners in the field of how to learn, especially for math and science. Got some nice illustrations.

## Concepts learned:

- chunking
- context
- spaced repetition,
- recall vs rereading
- right brain / left brain thinking or focused/diffused thinking
- physical activity to induce recall / solve problems
- why focusing too much doesn't work (or, don't bang your head against the wall, dah ...)
- Interleaving - practice by doing a mixture different kinds of problems requiring different strategies.

## Misc Points
- You want your brain to become used to the idea that just knowing how to use a particular problem-solving technique isn't enough—you also need to know when to use it

- Mastering how to drive will not get you very far in the open sea, even with the best car in the world with a tank full of gas.

- Mix types of problems. Solving 100 addition questions and then 100 multiplication, is not as effective is alternating every 5.

- Teaching others what u've learned greatly solidifies learning.

- Recall information in different physical positions while moving to solidify learning.

- Rehearse in your mind while walking to the bus, being bored, etc

- students who have blindly followed their passion, without rational analysis of whether their choice of career truly was wise, have been more unhappy with their job choices than those who coupled passion with rationality.

- Use metaphors. It's often helpful to pretend you are the concept you are trying to understand. Put yourself in an electron's warm and fuzzy slippers as it burrows through a slab of copper, or sneak inside the x of an algebraic equation, or a graph equation

- Remember people's names by retrieving the people's names from memory at increasing time intervals after first learning the name

- Memory palace - Mentally walk in a place you know and place things you want to remember along the way, i.e. a giant egg open you the door, gets crushed by a pack of sugar, then in the corridor there's a pack of cigarettes (which you might wanna quit but don't know how to yet?)

- Using sentences to memorize: King Henry Died While Drinking Chocolate Milk. This translates to kilo —1,000; Hecto—100; Deca—10; "while" represents 1; Deci—0.1; Centi—0.01; Milli—0.001

- Acronyms to memorize - Let's say you wanted to remember four plants that help ward off vampires—garlic, rose, hawthorn, and mustard. The first letters abbreviate to GRHM, so all you need to do is remember the image of a GRAHAM cracker.

- Combine memory palace with sentences: Let's say you are trying to remember the mineral hardness scale, which ranges from 1 to 10 (talc 1, gypsum 2, calcite 3, fluorite 4, apatite 5, orthoclase 6, quartz 7, topaz 8, corundum 9, diamond 10). You can come up with a memory sentence mnemonic: Terrible Giants Can Find Alligators or Quaint Trolls Conveniently Digestible. The problem is that it can still be difficult to remember the sentence. But things become easier if you then add the memory palace. At your front door, there is a terrible giant there, holding a can. Once inside, you find an alligator

- If you're memorizing something commonly used, see whether someone's come up with a particularly memorable memory trick by searching it out online. Otherwise, try coming up with your own (and open source it)!

- Persistence is often more important than intelligence.

- Approaching material with a goal of learning it on your own gives you a unique path to mastery.

- Ask questions to LEARN, not to show how much you know (like most people do)

- A simple sentence growing from the vast experience of a mentor can change the course of your future

- Truly great teachers make the material seem both simple and profound, set up mechanisms for students to learn from each other, and inspire students to learn on their own

- Learning and brainstorming with like minded people is easier, but if your all TOO like minded about too many things, you won't uncover each others' blind spots.

- "You need to think about what the equation means, so that your math result and your intuition match. If they don't match, then you have either a mistake in your math or a mistake in your intuition. Either way, you win by figuring out why the two don't match"

- Explore the end of the model for better understanding. For a complicated expression, take limiting cases where one variable or another goes to zero or infinity, and see if that helps you understand what the equation is saying

- Testing is itself an extraordinarily powerful learning experience

- outline lots of problem solutions quickly, without spending time on the algebra and calculations, so you practice big picture thinking

- If you can't explain it to a six year old, you don't understand it yourself - **Albert Einstein**

## Taking tests
- Scan entire test, start with hardest question, pull away to an easy question the moment you get stuck. This will get your difuse mode thinking working on the hard task in the background, as you work yoru way through the easy questions. I've never thought about that personally, it sounds like a nifty little tricks indeed! This can be applied to any task, at the office or in our personal lives.
- Panic and anxiety - Move THROUGH the sensations instead of fighting them, and turn your attention inwards, to your breathing and your body. Acknowledge what's going on PHYSICALLY, i.e. "my palms are sweaty, my heart is beating a bit faster". That's better than "OMG what's happening to my body", which is generating a fear OF the fear, and then your screwed ;)
- Study in the same place or at least a similar environment as the place you will take the test.
- Bonus: [Talk to me](/contactNEW), I have some mind tricks up my sleeve :)
- Doube check your answers in random order, not sequentially front to back, so you "catch you brain" ungaurd and process the information differently.
- Write any negative thought immediately before the test.

## Procrastination Zombies
- The dread of doing a task often consumes more time and energy than the task itself
- Zombies cannot be vanquished by will power
- Habit cycle: Cue -> Routine -> Reward -> Belief
- ways of breaking the habit:
  1. Develop different cues (learn for the exam in a different place, different time, with different people)
  2. Set time limit (study for 10 minutes, instead of until you finish problems a be see., this was you can't fail see :)
  3. contrast mental images. Make one vivid image of what will happen if you do the task (get a better job, promotion, etc), and one iamge if you don't (get fired, begging for money)
  4. Pomodoro technique and protecting yourself from peeps in an elegant

## Tricks for anti procrastination:
 1. Wear sport cloth, prime yourself for workout
 2. Get up easily by mentally crave your breakfast, instead of "having" to get up
 3. Identify the easiest part to start with
 4. ^^^ Organise material needed (for math problem, copy needed equations etc ...)
 5. silence phone and laptop notifications
 6. log activities for a few weeks and notice your procrastination triggers
 7. write tomorrow's to do list prior bed time.
 8. Do the most important and most disliked jobs first, as soon as you wake up, when you are highest in energy (could be after a coffee or two ;)
 9. Infuse physical tasks (laundry, weeding, dishes) between mental ones
 10. Break long period goals to daily processes
 11. Put visual reminders of your end goal (look at the salary of an engineer while learning for the exam)
 12. Paralyzed? Jot down 3 micro-tasks you can do in minutes
 13. reward small chunks of progress (i.e. 5 minutes of YouTube after 1 pomodoro)

## Resources
- The [Pomodoro](http://pomodorotechnique.com/) technique (varied prices and resources):
Tasks, Planning, and Flash Cards
- [30/30](http://3030.binaryhammer.com/) — combines timers with a task list
- [StudyBlue](http://www.studyblue.com/) — combines flash cards and notes with text messages when it's time to study again, along with a direct link to the material
- [Evernote](http://evernote.com/) — One of author's personal favorites; very popular for noting task lists and random pieces of information (replaces the little notebook writers have long carried to keep track of their ideas)
- [Anki](http://ankisrs.net/) — one of the best pure flash card systems, with an excellent spaced repetition algorithm; many excellent premade decks are available for a variety of disciplines
- [Quizlet.com](http://quizlet.com/) — allows you to input your own flash cards; you can work with classmates to divide up the duties
- [Google Tasks and Calendar](http://mail.google.com/mail/help/tasks/)

## ## ## Limiting Distractions
- [Freedom](http://macfreedom.com/) — many people swear by this program, available for MacOS, Windows, and Android ($10)
- [StayFocusd](https://chrome.google.com/webstore/detail/stayfocusd/laankejkbhbdhmipfmgcngdelahlfoji) — for Google Chrome
- LeechBlock — for Firefox
- [MeeTimer](https://addons.mozilla.org/en-us/firefox/addon/meetimer/) — for Firefox; tracks and logs where you spend your time

######Cheering Yourself and Others
- [43 Things](http://www.43things.com/) — a goal-setting site
- [StickK](http://www.stickk.com/) — a goal-setting site
- [Coffitivity](http://coffitivity.com/) — modest background noise similar to a coffee shop

## Recommended books by the author:
- [Calculus Made Easy](http://amzn.to/2i0JZMq) - Silvanus Thompson
- [The Click Moment](http://amzn.to/2vE2uJU) - Frans Johansson
- [Stalling for Time](http://amzn.to/2fHierH)- FBI hostage negotiator Gary Noesner
- [The Power of Habit](http://amzn.to/2uEuiAD) - Charles Duhigg
- [Buddha in Blue Jeans](http://amzn.to/2vzvQe5) - Tai Sheridan
- [Getting things done](http://amzn.to/2fG2tRy) - David Allen
- [The Now Habit](http://amzn.to/2w55uSB) - Neil Fiore

If you found these notes useful, stack up your karma points and share this with others, and if you want to dive deeper, you can [get it here](http://amzn.to/2vDVzk1)
`,
}


text:
package com.twister.plugin.baseplugin;

import java.applet.Applet;
import java.awt.Component;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Properties;

import javax.swing.JPanel;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;

import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.twister.Item;
import com.twister.plugin.twisterinterface.CommonInterface;
import com.twister.plugin.twisterinterface.TwisterPluginInterface;

public class BasePlugin extends JPanel implements TwisterPluginInterface {
	private static final long serialVersionUID = 1L;
	protected ArrayList<Item> suite;// suite list
	protected ArrayList<Item> suitetest;// test suite list generated
	protected Hashtable<String, String> variables;
	protected Document pluginsConfig;
	protected Element rootElement;
	protected ChannelSftp c;
	protected Session session;

	@Override
	public void init(ArrayList<Item> suite, ArrayList<Item> suitetest,
			Hashtable<String, String> variables, Document pluginsConfig,Applet container) {
		this.suite = suite;
		this.suitetest = suitetest;
		this.variables = variables;
		this.pluginsConfig = pluginsConfig;
		initializeSFTP();
		createXMLStructure();
		setEnabledValue(true);
		uploadPluginsFile();
	}

	@Override
	public void terminate() {
		setEnabledValue(false);
		uploadPluginsFile();
		session.disconnect();
		c.disconnect();
		c = null;
		session = null;
		suite = null;
		suitetest = null;
		variables = null;
		pluginsConfig = null;
		rootElement = null;
	}

	public void setEnabledValue(boolean value){
		Element item = (Element)rootElement.getElementsByTagName("status").item(0);
		if(value){
			item.getChildNodes().item(0).setNodeValue("enabled");
		} else {
			item.getChildNodes().item(0).setNodeValue("disabled");
		}
	}

	@Override
	public Component getContent() {
		return this;
	}

	@Override
	public String getName() {
		return "Base plugin..";
	}

	@Override
	public String getDescription(String localplugindir) {
		try {
			String descfile = localplugindir
					+ "/"
					+ getFileName().substring(0,
							getFileName().indexOf("."))
					+ "_description.txt";
			BufferedReader br = new BufferedReader(new FileReader(descfile));
			StringBuilder sb = new StringBuilder();
			String line;
			while ((line = br.readLine()) != null) {
				sb.append(line);
				sb.append("\n");
			}
			br.close();
			return sb.toString();
		} catch (Exception e) {
			System.out.println("Could not read description file from plugin ");
			e.printStackTrace();
			return "Could not read description file from plugin ";
		}
	}

	@Override
	public String getFileName() {
		return "FileName.jar";
	}

	/*
     * method to copy plugins configuration file
     * to server
     */
    public boolean uploadPluginsFile(){
        try{
            DOMSource source = new DOMSource(pluginsConfig);
            File file = new File(variables.get("pluginslocalgeneralconf"));
            Result result = new StreamResult(file);
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            transformer.setOutputProperty("{http:xml.apache.org/xslt}indent-amount","4");
            transformer.transform(source, result);
            c.cd(variables.get("remoteuserhome")+"/twister/config/");
            FileInputStream in = new FileInputStream(file);
            c.put(in, file.getName());
            in.close();
            System.out.println("Saved "+file.getName()+" to: "+
					variables.get("remoteuserhome")+"/twister/config/");
            return true;}
        catch(Exception e){
            e.printStackTrace();
            return false;
        }
    }

    public ChannelSftp getSFTP(){
    	return c;
    }

    public void initializeSFTP(){
		try{
			JSch jsch = new JSch();
            String user = variables.get("user");
            session = jsch.getSession(user, variables.get("host"), 22);
            session.setPassword(variables.get("password"));
            Properties config = new Properties();
            config.put("StrictHostKeyChecking", "no");
            session.setConfig(config);
            session.connect();
            Channel channel = session.openChannel("sftp");
            channel.connect();
            c = (ChannelSftp)channel;
            System.out.println("SFTP successfully initialized");
		}
		catch(Exception e){
			System.out.println("SFTP could not be initialized");
			e.printStackTrace();
		}
	}

	/*
	 * method to check and create XML structure for this plugin
	 */
	public void createXMLStructure() {
		Document doc = pluginsConfig;
		NodeList list1 = doc.getElementsByTagName("Plugin");
		Element item;
		Element compare;
		boolean found = false;
		for (int i = 0; i < list1.getLength(); i++) {
			item = (Element) list1.item(i);
			compare = (Element) item.getElementsByTagName("jarfile").item(0);
			if (compare.getChildNodes().item(0).getNodeValue()
					.equals(getFileName())) {
				found = true;
				rootElement = item;
				break;
			}
		}
		if (!found) {
			rootElement = doc.createElement("Plugin");
			doc.getFirstChild().appendChild(rootElement);
			Element em2 = doc.createElement("name");
			em2.appendChild(doc.createTextNode(getName()));
			rootElement.appendChild(em2);
			em2 = doc.createElement("jarfile");
			em2.appendChild(doc.createTextNode(getFileName()));
			rootElement.appendChild(em2);
			em2 = doc.createElement("pyfile");
			String filename = getFileName().split(".jar")[0] + ".py";
			em2.appendChild(doc.createTextNode(filename));
			rootElement.appendChild(em2);
			em2 = doc.createElement("status");
			em2.appendChild(doc.createTextNode("enabled"));
			rootElement.appendChild(em2);
		}
	}

	/*
	 * method to get a Node from general config xml that represents a property
	 * with name=name and coresponds to this plugin. If the method doesent find
	 * the property it creates one
	 */
	public Node getPropValue(String name) {
		NodeList list2 = rootElement.getElementsByTagName("property");
		Element item;
		Element compare;
		Document doc = pluginsConfig;
		for (int j = 0; j < list2.getLength(); j++) {
			item = (Element) list2.item(j);
			compare = (Element) item.getElementsByTagName("propname").item(0);
			if (compare.getChildNodes().item(0).getNodeValue().equals(name)) {
				compare = (Element) item.getElementsByTagName("propvalue")
						.item(0);
				try {
					if (compare.getChildNodes().item(0) == null) {
						compare.appendChild(doc.createTextNode(" "));
						compare.getChildNodes().item(0).setNodeValue("");
					}
					return compare.getChildNodes().item(0);
				} catch (Exception e) {
					compare.appendChild(doc.createTextNode(" "));
					compare.getChildNodes().item(0).setNodeValue("");
					return compare.getChildNodes().item(0);
				}
			}
		}
		Element em2 = doc.createElement("property");

		Element em3 = doc.createElement("propname");
		em3.appendChild(doc.createTextNode(name));
		em2.appendChild(em3);

		Element em4 = doc.createElement("propvalue");
		em4.appendChild(doc.createTextNode(" "));
		em4.getChildNodes().item(0).setNodeValue("");

		em2.appendChild(em4);

		rootElement.appendChild(em2);

		return em4.getChildNodes().item(0);
	}

	@Override
	public void setInterface(CommonInterface commoninterface) {
	}

	@Override
	public void resizePlugin(int width, int height) {

	}
}


text:
"""Auto-generated file, do not edit by hand. ID metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_ID = PhoneMetadata(id='ID', country_code=None, international_prefix=None,
    general_desc=PhoneNumberDesc(national_number_pattern='[178]\\d{2,4}', possible_number_pattern='\\d{3,5}'),
    toll_free=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    emergency=PhoneNumberDesc(national_number_pattern='11[02389]', possible_number_pattern='\\d{3}', example_number='112'),
    short_code=PhoneNumberDesc(national_number_pattern='1(?:1[02389]|40\\d{2})|71400|89887', possible_number_pattern='\\d{3,5}', example_number='112'),
    standard_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    carrier_specific=PhoneNumberDesc(national_number_pattern='71400|89887', possible_number_pattern='\\d{5}', example_number='71400'),
    short_data=True)


text:
import { PropTypes } from 'react';
import Leaflet from 'leaflet';

import latlngListType from './types/latlngList';
import PopupContainer from './PopupContainer';

export default class Polygon extends PopupContainer {
  static propTypes = {
    positions: PropTypes.oneOfType([
      latlngListType,
      PropTypes.arrayOf(latlngListType)
    ]).isRequired
  };

  componentWillMount() {
    super.componentWillMount();
    const { map, positions, ...props } = this.props;
    this.leafletElement = Leaflet.polygon(positions, props);
  }

  componentDidUpdate(prevProps) {
    if (this.props.positions !== prevProps.positions) {
      this.leafletElement.setLatLngs(this.props.positions);
    }
  }
}


text:
require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))

class SnapshotFromTest < KitchenSync::EndpointTestCase
  include TestTableSchemas

  def from_or_to
    :from
  end

  def send_schema_command(to = spawner)
    to.send_command Commands::SCHEMA
    assert_equal [Commands::SCHEMA, [{"tables" => [footbl_def]}]], to.read_command
  end

  test_each "accepts the without_snapshot command for solo from endpoints after the protocol negotation, and returns nil to show its completed" do
    clear_schema
    create_footbl # arbitrary, just something to show the schema was loaded successfully

    send_protocol_command(LATEST_PROTOCOL_VERSION_SUPPORTED)
    send_types_command(connection.supported_column_types)
    send_command   Commands::WITHOUT_SNAPSHOT
    expect_command Commands::WITHOUT_SNAPSHOT
    send_schema_command
  end

  test_each "gives back a string from the export_snapshot command, and accepts that string in another worker" do
    clear_schema
    create_footbl # arbitrary, just something to show the schema was loaded successfully

    send_protocol_command(LATEST_PROTOCOL_VERSION_SUPPORTED)
    send_types_command(connection.supported_column_types)
    send_command Commands::EXPORT_SNAPSHOT
    command, args = read_command
    assert_equal Commands::EXPORT_SNAPSHOT, command
    assert_equal 1, args.length
    snapshot = args[0]
    assert_instance_of String, snapshot

    extra_spawner = KitchenSyncSpawner.new(binary_path, program_args, program_env, :capture_stderr_in => captured_stderr_filename).tap(&:start_binary)
    begin
      extra_spawner.send_command Commands::PROTOCOL, [LATEST_PROTOCOL_VERSION_SUPPORTED]
      assert_equal [Commands::PROTOCOL, [LATEST_PROTOCOL_VERSION_SUPPORTED]], extra_spawner.read_command
      extra_spawner.send_command Commands::TYPES, [connection.supported_column_types]
      assert_equal [Commands::TYPES], extra_spawner.read_command
      extra_spawner.send_command Commands::IMPORT_SNAPSHOT, [snapshot]
      assert_equal [Commands::IMPORT_SNAPSHOT], extra_spawner.read_command

      send_command Commands::UNHOLD_SNAPSHOT
      expect_command Commands::UNHOLD_SNAPSHOT

      send_schema_command
      send_schema_command extra_spawner
    ensure
      extra_spawner.stop_binary
    end
  end
end


text:
member-add-component

member-add-component

member-add-component

member-add-component

{{text | json}}
{{results | json}}


text:
layout: course
department: African American Studies (AFRICAM)
course: 101
course-name: Research Methods for African American Studies
prerequisites: STAT 2 or STAT 20
description: As an introduction to interdisciplinary research methods as they are applied to the study of African American communities, the course will examine theoretical and conceptual issues; techniques for identifying existing research; and sources and methods of social research and data collection. The main focus will be on qualitative methods.
units: 5
tools:
cluster:
- Humanities
foundational:
applied: Applied
meta:
---


text:
#define SPINDLEAXIS 4
#define FACTOR (2048/60.0) //1000 counts/sec / 100 counts/rev = 1 RPS = 60 RPM
#define SPINDLECW_BIT 154
#define SPINDLECCW_BIT 155
#define SPEEDVAR 99
#define STATEVAR 98
#define KMVAR 1

// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed

main()
{
	float speed = *(float *)&persist.UserData[SPEEDVAR];  // value stored is actually a float
	float LastState = persist.UserData[STATEVAR];  // get last state

	if (LastState==1)
	{
		// if spindle was CW now we want CCW
		// spin down

		ClearBit(SPINDLECW_BIT);
		ClearBit(SPINDLECCW_BIT);
		Jog(SPINDLEAXIS,0);
		while (!CheckDone(SPINDLEAXIS)) ;
	}

	// turn spindle on CCW and ramp to new speed
	SetBit(SPINDLECCW_BIT);

	// spindle is already on, so ramp to new speed
	Jog(SPINDLEAXIS,-speed * FACTOR);
	printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);

	persist.UserData[STATEVAR] = -1;  // remember we are CCW
}


text:
<?php

namespace GPI\DocumentBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Route\RouteCollection;

class DocumentAdmin extends Admin
{
    /**
     * @param DatagridMapper $datagridMapper
     */
    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('id')
            ->add('description', null, array('label' => 'Opis'))
            ->add('createdBy', null, array('label' => 'Dodano przez'));
    }

    /**
     * @param ListMapper $listMapper
     */
    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->add('id')
            ->add('description', null, array('label' => 'Opis'))
            ->add('path', null, array('label' => 'Nazwa pliku'))
            ->add('createdBy', null, array('label' => 'Dodano przez'))
            ->add(
                '_action',
                'actions',
                array(
                    'actions' => array(
                        'show' => array(),
                        //                        'edit' => array(),
                        //                        'delete' => array(),
                    ),
                    'label' => 'Opcje'
                )
            );
    }

    protected function configureRoutes(RouteCollection $collection)
    {
        // to remove a single route
        $collection->remove('create');
        // OR remove all route except named ones
        //        $collection->clearExcept(array('list', 'show'));
    }

    /**
     * @param FormMapper $formMapper
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        //        $formMapper
        //            ->add(
        //                'id',
        //                null,
        //                array(
        //                    'read_only' => true
        //                )
        //            )
        //            ->add('description', 'textarea')
        //            ->add(
        //                'WebPath',
        //                'textarea',
        //                array(
        //                    'read_only' => true
        //                )
        //            )
        //            ->add(
        //                'createdBy',
        //                null,
        //                array(
        //                    'read_only' => true,
        //                    'disabled' => true,
        //                )
        //            );
    }

    /**
     * @param ShowMapper $showMapper
     */
    protected function configureShowFields(ShowMapper $showMapper)
    {
        $showMapper
            ->add('id')
            ->add('description', null, array('label' => 'Opis'))
            ->add('path', null, array('label' => 'Nazwa pliku'))
            ->add('createdBy', null, array('label' => 'Dodano przez'))
            ->add('Podglad', null, array(
                'template' => 'GPIAuctionBundle:Admin:image_preview.html.twig',
                'label' => 'Podgląd'
            ));
    }

    protected function configureSideMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
    {
        if (!$childAdmin && !in_array($action, array('edit'))) {
            return;
        }

        $admin = $this->isChild() ? $this->getParent() : $this;

        $id = $admin->getRequest()->get('id');
        //        $auction = $this->getObject($id);

        $menu->addChild(
            $this->trans('Edycja', array(), 'SonataAuctionBundle'),
            array('uri' => $admin->generateUrl('edit', array('id' => $id)))
        );
    }
}


text:
package org.metafacture.triples;

import org.metafacture.framework.FluxCommand;
import org.metafacture.framework.MetafactureException;
import org.metafacture.framework.annotations.Description;
import org.metafacture.framework.annotations.In;
import org.metafacture.framework.annotations.Out;
import org.metafacture.framework.helpers.DefaultObjectReceiver;
import org.metafacture.framework.objects.Triple;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @author Christoph Böhme
 *
 */
@Description("Writes triples into a file.")
@In(Triple.class)
@Out(Void.class)
@FluxCommand("write-triples")
public final class TripleWriter extends DefaultObjectReceiver<Triple> {

    public static final int BUFFERSIZE = 2048;

    private final String filename;

    private ObjectOutputStream outputStream;

    /**
     * Constructs a TripleWriter with a given file name as output path.
     *
     * @param filename the name of the file to write to
     */
    public TripleWriter(final String filename) {
        this.filename = filename;
        resetStream();
    }

    @Override
    public void process(final Triple obj) {
        try {
            obj.write(outputStream);
        }
        catch (final IOException e) {
            throw new MetafactureException(e);
        }
    }

    @Override
    public void resetStream() {
        try {
            if (outputStream != null) {
                outputStream.close();
            }
            outputStream = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(filename), BUFFERSIZE));
        }
        catch (final IOException e) {
            throw new MetafactureException(e);
        }
    }

    @Override
    public void closeStream() {
        try {
            if (outputStream != null) {
                outputStream.close();
            }
        }
        catch (final IOException e) {
            throw new MetafactureException(e);
        }
    }

}


text:
struct ListNode {
  int val;
  ListNode *next;
  ListNode(int x) : val(x), next(0) {}
};

class Solution {
public:
  bool hasCycle(ListNode *head) {
    if (!head) return false;
    auto hare = head;
    auto tortoise = head;
    while (hare && hare->next != 0) {
      hare = hare->next->next;
      tortoise = tortoise->next;
      if (tortoise == hare) return true;
    }
    return false;
  }
};


text:
//
// Created by Bradley Austin Davis on 2016/12/12
// Copyright 2013-2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
/*global print, Resources, Test, MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, Audio, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt */
/*global ColorIndicator */

'use strict';

Script.include("./BenchmarkLib.js");

Resources.overrideUrlPrefix(TEST_ROOT, Script.resolvePath(".."));

var DEFAULT_AVATAR_URL = "http://mpassets.highfidelity.com/f14bf7c9-49a1-4249-988a-0a577ed78957-v1/beingOfLight.fst";
var TEST_AVATAR_URL = "http://mpassets.highfidelity.com/b4502145-15eb-4023-b7d6-a81c5cbf6abf-v1/F_FitTra.fst";

MyAvatar.skeletonModelURL = DEFAULT_AVATAR_URL;
var testScript = new TestScript();
testScript.addTest({
    name: "avatar_switch",
    duration: 20,
    loader: TestScript.locationLoader("hifi://dev-welcome", true),
    traceActions: function() {
        Script.setTimeout(function () {
            Test.startTraceEvent("avatarChange");
            MyAvatar.skeletonModelURL = TEST_AVATAR_URL;
            Script.setTimeout(function () { Test.endTraceEvent("avatarChange"); }, 1000);
        }, 5 * 1000);
        Script.setTimeout(function () {
            Test.startTraceEvent("avatarChange");
            MyAvatar.skeletonModelURL = DEFAULT_AVATAR_URL;
            Script.setTimeout(function () { Test.endTraceEvent("avatarChange"); }, 1000);
        }, 15 * 1000);
    },
});
testScript.runTests();


text:
package main

import (
	"fmt"
	"path/filepath"
	"strings"

	"github.com/google/syzkaller/pkg/compiler"
)

type darwin struct{}

func (*darwin) prepare(sourcedir string, build bool, arches []*Arch) error {
	return nil
}

func (*darwin) prepareArch(arch *Arch) error {
	return nil
}

func (*darwin) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
	args := []string{
		"-nostdinc",
		"-DPRIVATE",
		"-DPF",
		"-I", filepath.Join(arch.sourceDir, "bsd"),
		"-I", filepath.Join(arch.sourceDir, "bsd", "sys"),
		"-I", filepath.Join(arch.sourceDir, "osfmk"),
	}
	for _, incdir := range info.Incdirs {
		args = append(args, "-I"+filepath.Join(arch.sourceDir, incdir))
	}
	fmt.Printf("dirs: %v", arch.includeDirs)
	if arch.includeDirs != "" {
		for _, dir := range strings.Split(arch.includeDirs, ",") {
			args = append(args, "-I"+dir)
		}
	}
	// TODO(HerrSpace): investigate use of bsd/kern/syscalls.master and
	// osfmk/mach/mach_traps.h here.
	params := &extractParams{
		AddSource:     "#include <sys/syscall.h>",
		DeclarePrintf: true,
		TargetEndian:  arch.target.HostEndian,
	}
	return extract(info, "clang", args, params)
}


text:
const fs = require('fs');
const userList = require('../data/userList.json');
const path = require('path');

const returnUserList = [];

userList.users.forEach(user => {
  // const userDetail = require(`../data/users/profile_${user}.json`);
  const userDetail = JSON.parse(
    fs.readFileSync(path.resolve(__dirname, `../data/users/profile_${user}.json`), 'utf-8')
  );

  let displayName = user;
  if (userDetail.name !== null) {
    displayName = userDetail.name;
  }

  returnUserList.push({
    username: user,
    name: displayName,
    image: userDetail.avatar_url,
    films: [],
    bonus: [],
    weeklyWinner: 0
  });
});

const userListComplete = `data/userListComplete.json`;

fs.writeFile(userListComplete, JSON.stringify(returnUserList), err => {
  if (err) throw err;
});