text:
/*$
 * @name handler.js
 * @fileOverview class to handle phone number parse states
 *
 *
 */

/*globals  G11n PhoneLoc */

//* @protected

enyo.g11n.StateHandler = function _StateHandler () {
	return this;
};

enyo.g11n.StateHandler.prototype = {
	processSubscriberNumber: function(number, fields, regionSettings) {
		var last;

		last = number.search(/[xwtp]/i);	// last digit of the local number

		if ( last > -1 ) {
			if ( last > 0 ) {
				fields.subscriberNumber = number.substring(0, last);
			}
			// strip x's which are there to indicate a break between the local subscriber number and the extension, but
			// are not themselves a dialable character
			fields.extension = number.substring(last).replace('x', '');
		} else {
			fields.subscriberNumber = number;
		}

		if (regionSettings.plan.fieldLengths &&
				regionSettings.plan.fieldLengths.maxLocalLength &&
				fields.subscriberNumber &&
				fields.subscriberNumber.length > regionSettings.plan.fieldLengths.maxLocalLength) {
			fields.invalid = true;
		}
	},

	processFieldWithSubscriberNumber: function(fieldName, length, number, currentChar, fields, regionSettings, noExtractTrunk) {
		var ret, end, last;

		last = number.search(/[xwtp]/i);	// last digit of the local number

		if ( length !== undefined && length > 0 ) {
			// fixed length
			end = length;
			if ( regionSettings.plan.trunkCode === "0" && number.charAt(0) === "0" ) {
				end += regionSettings.plan.trunkCode.length;  // also extract the trunk access code
			}
		} else {
			// variable length
			// the setting is the negative of the length to add, so subtract to make it positive
			end = currentChar + 1 - length;
		}

		if ( fields[fieldName] !== undefined ) {
			// we have a spurious recognition, because this number already contains that field! So, just put
			// everything into the subscriberNumber as the default
			this.processSubscriberNumber(number, fields, regionSettings);
		} else {
			// substring() extracts the part of the string up to but not including the end character,
			// so add one to compensate
			if ( !noExtractTrunk && regionSettings.plan.trunkCode === "0" && number.charAt(0) === "0" ) {
				fields.trunkAccess = number.charAt(0);
				fields[fieldName] = number.substring(1, end);
			} else {
				fields[fieldName] = number.substring(0, end);
			}

			if ( number.length > end ) {
				this.processSubscriberNumber(number.substring(end), fields, regionSettings);
			}
		}

		ret = {
			number: ""
		};

		return ret;
	},

	processField: function(fieldName, length, number, currentChar, fields, regionSettings) {
		var ret = {}, end;

		if ( length !== undefined && length > 0 ) {
			// fixed length
			end = length;
			if ( regionSettings.plan.trunkCode === "0" && number.charAt(0) === "0" ) {
				end += regionSettings.plan.trunkCode.length;  // also extract the trunk access code
			}
		} else {
			// variable length
			// the setting is the negative of the length to add, so subtract to make it positive
			end = currentChar + 1 - length;
		}

		if ( fields[fieldName] !== undefined ) {
			// we have a spurious recognition, because this number already contains that field! So, just put
			// everything into the subscriberNumber as the default
			this.processSubscriberNumber(number, fields, regionSettings);
			ret.number = "";
		} else {
			// substring() extracts the part of the string up to but not including the end character,
			// so add one to compensate
			if ( regionSettings.plan.trunkCode === "0" && number.charAt(0) === "0" ) {
				fields.trunkAccess = number.charAt(0);
				fields[fieldName] = number.substring(1, end);
				ret.skipTrunk = true;
			} else {
				fields[fieldName] = number.substring(0, end);
			}

			ret.number = (number.length > end) ? number.substring(end) : "";
		}

		return ret;
	},

	trunk: function(number, currentChar, fields, regionSettings) {
		var ret, trunkLength;

		if ( fields.trunkAccess !== undefined ) {
			// What? We already have one? Okay, put the rest of this in the subscriber number as the default behaviour then.
			this.processSubscriberNumber(number, fields, regionSettings);
			number = "";
		} else {
			trunkLength = regionSettings.plan.trunkCode.length;
			fields.trunkAccess = number.substring(0, trunkLength);
			number = (number.length > trunkLength) ? number.substring(trunkLength) : "";
		}

		ret = {
			number: number
		};

		return ret;
	},

	plus: function(number, currentChar, fields, regionSettings) {
		var ret = {};

		if ( fields.iddPrefix !== undefined ) {
			// What? We already have one? Okay, put the rest of this in the subscriber number as the default behaviour then.
			this.processSubscriberNumber(number, fields, regionSettings);
			ret.number = "";
		} else {
			// found the idd prefix, so save it and cause the function to parse the next part
			// of the number with the idd table
			fields.iddPrefix = number.substring(0, 1);

			ret = {
				number: number.substring(1),
				push: new enyo.g11n.Locale('_idd')    // shared subtable that parses the country code
			};
		}
		return ret;
	},

	idd: function(number, currentChar, fields, regionSettings) {
		var ret = {};

		if ( fields.iddPrefix !== undefined ) {
			// What? We already have one? Okay, put the rest of this in the subscriber number as the default behaviour then.
			this.processSubscriberNumber(number, fields, regionSettings);
			ret.number = "";
		} else {
			// found the idd prefix, so save it and cause the function to parse the next part
			// of the number with the idd table
			fields.iddPrefix = number.substring(0, currentChar+1);

			ret = {
				number: number.substring(currentChar+1),
				push: new enyo.g11n.Locale('_idd')    // shared subtable that parses the country code
			};
		}

		return ret;
	},

	country: function(number, currentChar, fields, regionSettings) {
		var ret, cc, locale;

		// found the country code of an IDD number, so save it and cause the function to
		// parse the rest of the number with the regular table for this locale
		fields.countryCode = number.substring(0, currentChar+1);
		cc = fields.countryCode.replace(/[wWpPtT\+#\*]/g, ''); // fix for NOV-108200
		locale = new enyo.g11n.PhoneLoc({countryCode: cc});

		// enyo.log("Found country code " + fields.countryCode + ". Switching to country " + locale.region + " to parse the rest of the number");

		ret = {
			number: number.substring(currentChar+1),
			push: locale
		};

		return ret;
	},

	cic: function(number, currentChar, fields, regionSettings) {
		return this.processField('cic', regionSettings.plan.fieldLengths.cic, number, currentChar, fields, regionSettings);
	},

	service: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.serviceCode, number, currentChar, fields, regionSettings);
	},

	area: function(number, currentChar, fields, regionSettings) {
		var ret, last, end, localLength;

		last = number.search(/[xwtp]/i);	// last digit of the local number
		localLength = (last > -1) ? last : number.length;

		if ( regionSettings.plan.fieldLengths.areaCode > 0 ) {
			// fixed length
			end = regionSettings.plan.fieldLengths.areaCode;
			if ( regionSettings.plan.trunkCode === number.charAt(0) ) {
				end += regionSettings.plan.trunkCode.length;  // also extract the trunk access code
				localLength -= regionSettings.plan.trunkCode.length;
			}
		} else {
			// variable length
			// the setting is the negative of the length to add, so subtract to make it positive
			end = currentChar + 1 - regionSettings.plan.fieldLengths.areaCode;
		}

		// substring() extracts the part of the string up to but not including the end character,
		// so add one to compensate
		if ( regionSettings.plan.trunkCode === number.charAt(0) ) {
			fields.trunkAccess = number.charAt(0);
			if ( number.length > 1 ) {
				fields.areaCode = number.substring(1, end);
			}
			if ( number.length > end ) {
				this.processSubscriberNumber(number.substring(end), fields, regionSettings);
			}
		} else if ( regionSettings.plan.fieldLengths.maxLocalLength !== undefined ) {
			if ( fields.trunkAccess !== undefined || fields.mobilePrefix !== undefined ||
					fields.countryCode !== undefined ||
					localLength > regionSettings.plan.fieldLengths.maxLocalLength ) {
				// too long for a local number by itself, or a different final state already parsed out the trunk
				// or mobile prefix, then consider the rest of this number to be an area code + part of the subscriber number
				fields.areaCode = number.substring(0, end);
				if ( number.length > end ) {
					this.processSubscriberNumber(number.substring(end), fields, regionSettings);
				}
			} else {
				// shorter than the length needed for a local number, so just consider it a local number
				this.processSubscriberNumber(number, fields, regionSettings);
			}
		} else {
			fields.areaCode = number.substring(0, end);
			if ( number.length > end ) {
				this.processSubscriberNumber(number.substring(end), fields, regionSettings);
			}
		}

		// extensions are separated from the number by a dash in Germany
		if (regionSettings.plan.findExtensions !== undefined && fields.subscriberNumber !== undefined) {
			var dash = enyo.indexOf("-", fields.subscriberNumber);
			if (dash > -1) {
				fields.subscriberNumber = fields.subscriberNumber.substring(0, dash);
				fields.extension = fields.subscriberNumber.substring(dash+1);
			}
		}

		ret = {
			number: ""
		};

		return ret;
	},

	none: function(number, currentChar, fields, regionSettings) {
		var ret;

		// this is a last resort function that is called when nothing is recognized.
		// When this happens, just put the whole stripped number into the subscriber number
		if ( regionSettings.plan && number.charAt(0) === regionSettings.plan.trunkCode ) {
			fields.trunkAccess = number.charAt(0);
			number = number.substring(1);
			//currentChar--;
		}

		if (number.length > 0) {
			this.processSubscriberNumber(number, fields, regionSettings);
			if ( currentChar > 0 && currentChar < number.length ) {
				// if we were part-way through parsing, and we hit an invalid digit,
				// indicate that the number could not be parsed properly
				fields.invalid = true;
			}
		}

		ret = {
			number: ""        // indicate that there is nothing left to parse
		};

		return ret;
	},

	vsc: function(number, currentChar, fields, regionSettings) {
		var ret, length, end;

		if ( fields.vsc === undefined ) {
			length = regionSettings.plan.fieldLengths.vsc || 0;
			if ( length !== undefined && length > 0 ) {
				// fixed length
				end = length;
			} else {
				// variable length
				// the setting is the negative of the length to add, so subtract to make it positive
				end = currentChar + 1 - length;
			}

			// found a VSC code (ie. a "star code"), so save it and cause the function to
			// parse the rest of the number with the same table for this locale
			fields.vsc = number.substring(0, end);
			number = (number.length > end) ? "^" + number.substring(end) : "";
		} else {
			// got it twice??? Okay, this is a bogus number then. Just put everything else into the subscriber number as the default
			this.processSubscriberNumber(number, fields, regionSettings);
			number = "";
		}

		// treat the rest of the number as if it were a completely new number
		ret = {
			number: number
		};

		return ret;
	},

	cell: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('mobilePrefix', regionSettings.plan.fieldLengths.mobilePrefix, number, currentChar, fields, regionSettings);
	},

	personal: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.personal, number, currentChar, fields, regionSettings);
	},

	emergency: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('emergency', regionSettings.plan.fieldLengths.emergency, number, currentChar, fields, regionSettings, true);
	},

	premium: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.premium, number, currentChar, fields, regionSettings);
	},

	special: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.special, number, currentChar, fields, regionSettings);
	},

	service2: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.service2, number, currentChar, fields, regionSettings);
	},

	service3: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.service3, number, currentChar, fields, regionSettings);
	},

	service4: function(number, currentChar, fields, regionSettings) {
		return this.processFieldWithSubscriberNumber('serviceCode', regionSettings.plan.fieldLengths.service4, number, currentChar, fields, regionSettings);
	},

	cic2: function(number, currentChar, fields, regionSettings) {
		return this.processField('cic', regionSettings.plan.fieldLengths.cic2, number, currentChar, fields, regionSettings);
	},

	cic3: function(number, currentChar, fields, regionSettings) {
		return this.processField('cic', regionSettings.plan.fieldLengths.cic3, number, currentChar, fields, regionSettings);
	},

	start: function(number, currentChar, fields, regionSettings) {
		// don't do anything except transition to the next state
		return {
			number: number
		};
	},

	local: function(number, currentChar, fields, regionSettings) {
		// in open dialling plans, we can tell that this number is a local subscriber number because it
		// starts with a digit that indicates as such
		this.processSubscriberNumber(number, fields, regionSettings);
		return {
			number: ""
		};
	}
};

// context-sensitive handler
enyo.g11n.CSStateHandler = function () {
	return this;
};

enyo.g11n.CSStateHandler.prototype = new enyo.g11n.StateHandler();
enyo.g11n.CSStateHandler.prototype.special = function (number, currentChar, fields, regionSettings) {
	var ret;

	// found a special area code that is both a node and a leaf. In
	// this state, we have found the leaf, so chop off the end
	// character to make it a leaf.
	if (number.charAt(0) === "0") {
		fields.trunkAccess = number.charAt(0);
		fields.areaCode = number.substring(1, currentChar);
	} else {
		fields.areaCode = number.substring(0, currentChar);
	}
	this.processSubscriberNumber(number.substring(currentChar), fields, regionSettings);

	ret = {
		number: ""
	};

	return ret;
};

enyo.g11n.USStateHandler = function () {
	return this;
};
enyo.g11n.USStateHandler.prototype = new enyo.g11n.StateHandler();
enyo.g11n.USStateHandler.prototype.vsc = function (number, currentChar, fields, regionSettings) {
	var ret, length, end;

	// found a VSC code (ie. a "star code")
	fields.vsc = number;

	// treat the rest of the number as if it were a completely new number
	ret = {
		number: ""
	};

	return ret;
};

enyo.g11n._handlerFactory = function (locale, plan) {
	if (typeof(plan.contextFree) === 'boolean' && plan.contextFree === false) {
		return new enyo.g11n.CSStateHandler();
	}
	var region = (locale && locale.region) || "zz";
	switch (region) {
	case 'us':
		return new enyo.g11n.USStateHandler();
		break;
	default:
		return new enyo.g11n.StateHandler();
	}
};


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
DelegatingMapper (DataFu Hourglass)
</TITLE>

<META NAME="date" CONTENT="2013-12-12">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

datafu.hourglass.mapreduce

Class DelegatingMapper

java.lang.Object
  org.apache.hadoop.mapreduce.Mapper<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>
      datafu.hourglass.mapreduce.DelegatingMapper

public class DelegatingMapper
extends org.apache.hadoop.mapreduce.Mapper<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>

A Hadoop mapper which delegates to an implementation read from the distributed cache.

Author:

"Matthew Hayes"

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper

org.apache.hadoop.mapreduce.Mapper.Context

Constructor Summary

DelegatingMapper()

Method Summary

protected  void
cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)

protected  void
map(java.lang.Object key,
    java.lang.Object value,
    org.apache.hadoop.mapreduce.Mapper.Context context)

protected  void
setup(org.apache.hadoop.mapreduce.Mapper.Context context)

Methods inherited from class org.apache.hadoop.mapreduce.Mapper

run

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DelegatingMapper

public DelegatingMapper()

Method Detail

setup

protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
              throws java.io.IOException,
                     java.lang.InterruptedException

Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>

Throws:

java.io.IOException

java.lang.InterruptedException

map

protected void map(java.lang.Object key,
                   java.lang.Object value,
                   org.apache.hadoop.mapreduce.Mapper.Context context)
            throws java.io.IOException,
                   java.lang.InterruptedException

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>

Throws:

java.io.IOException

java.lang.InterruptedException

cleanup

protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
                throws java.io.IOException,
                       java.lang.InterruptedException

Overrides:
cleanup in class org.apache.hadoop.mapreduce.Mapper<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object>

Throws:

java.io.IOException

java.lang.InterruptedException

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Matthew Hayes

redpajama_set_name: RedPajamaGithub


text:
package com.mcgoodtime.productionline.event;

import com.mcgoodtime.productionline.entity.EntityThrownItem;
import net.minecraft.util.math.RayTraceResult;
import net.minecraftforge.fml.common.eventhandler.Event;

/**
 * Created by BestOwl on 2015.12.10.0010.
 *
 * @author BestOwl
 */
public class EntityThrowableImpactEvent extends Event {

    public final RayTraceResult movingObjectPosition;
    public final EntityThrownItem entityThrownItem;

    public EntityThrowableImpactEvent(EntityThrownItem entityThrownItem, RayTraceResult movingObjectPosition) {
        super();
        this.movingObjectPosition = movingObjectPosition;
        this.entityThrownItem = entityThrownItem;
    }
}


text:
// Copyright 2017 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PUBLIC_FPDF_CATALOG_H_
#define PUBLIC_FPDF_CATALOG_H_

// NOLINTNEXTLINE(build/include)
#include "fpdfview.h"

#ifdef __cplusplus
extern "C" {
#endif  // __cplusplus

/**
 * Experimental API.
 *
 * Determine if |document| represents a tagged PDF.
 *
 * For the definition of tagged PDF, See (see 10.7 "Tagged PDF" in PDF
 * Reference 1.7).
 *
 *   document - handle to a document.
 *
 * Returns |true| iff |document| is a tagged PDF.
 */
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFCatalog_IsTagged(FPDF_DOCUMENT document);

#ifdef __cplusplus
}  // extern "C"
#endif  // __cplusplus

#endif  // PUBLIC_FPDF_CATALOG_H_


text:
package net.spy.memcached.tapmessage;

/**
 * The Magic enum contains a list all of the different magic that can be passed in a tap message in the flag field.
 */
public enum TapMagic {
	/**
	 * Defines a tap binary request packet
	 */
	PROTOCOL_BINARY_REQ((byte) 0x80),

	/**
	 * Defines a tap binary response packet
	 */
	PROTOCOL_BINARY_RES((byte) 0x81);

	/**
	 * The magic value
	 */
	public byte magic;

	/**
	 * Defines the magic value
	 * @param magic - The new magic value
	 */
	TapMagic(byte magic) {
		this.magic = magic;
	}

	public static TapMagic getMagicByByte(byte b) {
		if (b == PROTOCOL_BINARY_REQ.magic) {
			return TapMagic.PROTOCOL_BINARY_REQ;
		} else if (b == PROTOCOL_BINARY_RES.magic) {
			return TapMagic.PROTOCOL_BINARY_RES;
		} else {
			throw new IllegalArgumentException("Bad magic value");
		}
	}
}


text:
cask 'vscodium' do
  version '1.43.0'
  sha256 '626b8ffd13b44eff4cf27621a6948796ac5cc17fdba5aefb178761124822b72a'

  url "https://github.com/VSCodium/vscodium/releases/download/#{version}/VSCodium.#{version}.dmg"
  appcast 'https://github.com/VSCodium/vscodium/releases.atom'
  name 'VSCodium'
  homepage 'https://github.com/VSCodium/vscodium'

  auto_updates true
  conflicts_with cask: 'visual-studio-code'

  app 'VSCodium.app'
  binary "#{appdir}/VSCodium.app/Contents/Resources/app/bin/code"

  zap trash: [
               '~/Library/Application Support/VSCodium',
               '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.visualstudio.code.oss.sfl*',
               '~/Library/Logs/VSCodium',
               '~/Library/Preferences/com.visualstudio.code.oss.helper.plist',
               '~/Library/Preferences/com.visualstudio.code.oss.plist',
               '~/Library/Saved Application State/com.visualstudio.code.oss.savedState',
               '~/.vscode-oss',
             ]
end


text:
<template>
	<sort-dialog sort.bind="options.sort" sort-options.bind="sortColumns" dialog-id="exampleModal" ></sort-dialog>
	<require from="../../components/stamp-grid"></require>
	<require from="../../components/sort-dialog"></require>
	<require from="../../components/stamps/stamp-editor"></require>
	<require from="../../components/stamps/stamp-table"></require>
    <require from="../../widgets/paging/paging-toolbar"></require>

		<form class="navbar-form" role="search" submit.delegate="sendSearch()">

					<button type="button" class="btn btn-sm btn-default ${(editorShown)? 'active' : ''}" title="New Stamp" click.trigger="toggleEditor('create-stamp')">

					</button>

                    <input type="text" class="form-control" value.bind="searchText" placeholder="Search">
                    <button type="submit" class="btn btn-sm btn-default" title="Search">

                    </button>

					<button class="btn btn-sm btn-default" title="Show as grid" click.delegate="setViewMode('Grid')">

					</button>
					<button class="btn btn-sm btn-default" title="Show as list" click.delegate="setViewMode('List')">

					</button>

                        <button type="button" class="btn btn-default btn-sm dropdown-toggle sort-selector" data-toggle="dropdown">
                            ${options.sort.text | defaultValue:'Sort by'}

                        </button>

${sortCol.text}

					<button class="btn btn-sm btn-default" click.trigger="toggleSortDirection()">

					</button>
					<button class="btn btn-sm btn-default ${options.sort ? '' : 'disabled'}" title="Clear sort" click.trigger="clearSort()">

					</button>

                        <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"
                                aria-expanded="false">
                            Filter
                        </button>

All stamps

Only owned stamps

Only wantlist stamps

                        <button type="button" class="btn btn-default btn-sm dropdown-toggle result-size-selector" data-toggle="dropdown">
                            ${options.$top | defaultValue:'Size'}

                        </button>

${size}

		</form>

				<stamp-editor model.bind="editingStamp"></stamp-editor>

			<stamp-grid if.bind="gridMode" class="col-md-12 ${(editorShown) ? 'col-lg-8' : 'col-lg-12'}" stamps.bind="stamps" edit-id.bind="editingStamp.id"></stamp-grid>
			<stamp-table if.bind="!gridMode" class="col-md-12 ${(editorShown) ? 'col-lg-8' : 'col-lg-12'}" stamps.bind="stamps"></stamp-table>

		<form class="navbar-form" role="footer">
            <paging-toolbar page.bind="pageInfo.active" total.bind="pageInfo.total"></paging-toolbar>

					Total: ${pageInfo.active * options.$top + 1} - ${pageInfo.active * options.$top + stamps.length} of ${stampCount}

		</form>

</template>


text:
namespace System.Security.Cryptography
{
    public class RSAOAEPKeyExchangeFormatter : AsymmetricKeyExchangeFormatter
    {
        private byte[] ParameterValue;
        private RSA _rsaKey;
        private RandomNumberGenerator RngValue;

        public RSAOAEPKeyExchangeFormatter() { }
        public RSAOAEPKeyExchangeFormatter(AsymmetricAlgorithm key)
        {
            if (key == null)
                throw new ArgumentNullException(nameof(key));

            _rsaKey = (RSA)key;
        }

        public byte[] Parameter
        {
            get
            {
                if (ParameterValue != null)
                {
                    return (byte[])ParameterValue.Clone();
                }

                return null;
            }
            set
            {
                if (value != null)
                {
                    ParameterValue = (byte[])value.Clone();
                }
                else
                {
                    ParameterValue = null;
                }
            }
        }

        public override string Parameters
        {
            get { return null; }
        }

        public RandomNumberGenerator Rng
        {
            get { return RngValue; }
            set { RngValue = value; }
        }

        public override void SetKey(AsymmetricAlgorithm key)
        {
            if (key == null)
                throw new ArgumentNullException(nameof(key));

            _rsaKey = (RSA)key;
        }

        public override byte[] CreateKeyExchange(byte[] rgbData, Type symAlgType)
        {
            return CreateKeyExchange(rgbData);
        }

        public override byte[] CreateKeyExchange(byte[] rgbData)
        {
            if (_rsaKey == null)
                throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey);

            return _rsaKey.Encrypt(rgbData, RSAEncryptionPadding.OaepSHA1);
        }
    }
}


text:
// Copyright (c) 2013-2015 by Felix Rusu, LowPowerLab.com
// SPI Flash memory library for arduino/moteino.
// This works with 256byte/page SPI flash memory
// For instance a 4MBit (512Kbyte) flash chip will have 2048 pages: 256*2048 = 524288 bytes (512Kbytes)
// Minimal modifications should allow chips that have different page size but modifications
// DEPENDS ON: Arduino SPI library
// > Updated Jan. 5, 2015, TomWS1, modified writeBytes to allow blocks > 256 bytes and handle page misalignment.
// > Updated Feb. 26, 2015 TomWS1, added support for SPI Transactions (Arduino 1.5.8 and above)
// > Selective merge by Felix after testing in IDE 1.0.6, 1.6.4
// **********************************************************************************
// License
// **********************************************************************************
// This program is free software; you can redistribute it
// and/or modify it under the terms of the GNU General
// Public License as published by the Free Software
// Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will
// be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A
// PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General
// Public License along with this program.
// If not, see <http://www.gnu.org/licenses/>.
//
// Licence can be viewed at
// http://www.gnu.org/licenses/gpl-3.0.txt
//
// Please maintain this license information along with authorship
// and copyright notices in any redistribution of this code

#include <SPIFlash.h>

uint8_t SPIFlash::UNIQUEID[8];

/// IMPORTANT: NAND FLASH memory requires erase before write, because
///            it can only transition from 1s to 0s and only the erase command can reset all 0s to 1s
/// See http://en.wikipedia.org/wiki/Flash_memory
/// The smallest range that can be erased is a sector (4K, 32K, 64K); there is also a chip erase command

/// Constructor. JedecID is optional but recommended, since this will ensure that the device is present and has a valid response
/// get this from the datasheet of your flash chip
/// Example for Atmel-Adesto 4Mbit AT25DF041A: 0x1F44 (page 27: http://www.adestotech.com/sites/default/files/datasheets/doc3668.pdf)
/// Example for Winbond 4Mbit W25X40CL: 0xEF30 (page 14: http://www.winbond.com/NR/rdonlyres/6E25084C-0BFE-4B25-903D-AE10221A0929/0/W25X40CL.pdf)
SPIFlash::SPIFlash(uint8_t slaveSelectPin, uint16_t jedecID) {
  _slaveSelectPin = slaveSelectPin;
  _jedecID = jedecID;
}

/// Select the flash chip
void SPIFlash::select() {
  //save current SPI settings
#ifndef SPI_HAS_TRANSACTION
  noInterrupts();
#endif
  _SPCR = SPCR;
  _SPSR = SPSR;

#ifdef SPI_HAS_TRANSACTION
  SPI.beginTransaction(_settings);
#else
  // set FLASH SPI settings
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV4); //decided to slow down from DIV2 after SPI stalling in some instances, especially visible on mega1284p when RFM69 and FLASH chip both present
  SPI.begin();
#endif
  digitalWrite(_slaveSelectPin, LOW);
}

/// UNselect the flash chip
void SPIFlash::unselect() {
  digitalWrite(_slaveSelectPin, HIGH);
  //restore SPI settings to what they were before talking to the FLASH chip
#ifdef SPI_HAS_TRANSACTION
  SPI.endTransaction();
#else
  interrupts();
#endif
  SPCR = _SPCR;
  SPSR = _SPSR;
}

/// setup SPI, read device ID etc...
boolean SPIFlash::initialize()
{
  _SPCR = SPCR;
  _SPSR = SPSR;
  pinMode(_slaveSelectPin, OUTPUT);
#ifdef SPI_HAS_TRANSACTION
  _settings = SPISettings(4000000, MSBFIRST, SPI_MODE0);
#endif

  unselect();
  wakeup();

  if (_jedecID == 0 || readDeviceId() == _jedecID) {
    command(SPIFLASH_STATUSWRITE, true); // Write Status Register
    SPI.transfer(0);                     // Global Unprotect
    unselect();
    return true;
  }
  return false;
}

/// Get the manufacturer and device ID bytes (as a short word)
uint16_t SPIFlash::readDeviceId()
{
#if defined(__AVR_ATmega32U4__) // Arduino Leonardo, MoteinoLeo
  command(SPIFLASH_IDREAD); // Read JEDEC ID
#else
  select();
  SPI.transfer(SPIFLASH_IDREAD);
#endif
  uint16_t jedecid = SPI.transfer(0) << 8;
  jedecid |= SPI.transfer(0);
  unselect();
  return jedecid;
}

/// Get the 64 bit unique identifier, stores it in UNIQUEID[8]. Only needs to be called once, ie after initialize
/// Returns the byte pointer to the UNIQUEID byte array
/// Read UNIQUEID like this:
/// flash.readUniqueId(); for (uint8_t i=0;i<8;i++) { Serial.print(flash.UNIQUEID[i], HEX); Serial.print(' '); }
/// or like this:
/// flash.readUniqueId(); uint8_t* MAC = flash.readUniqueId(); for (uint8_t i=0;i<8;i++) { Serial.print(MAC[i], HEX); Serial.print(' '); }
uint8_t* SPIFlash::readUniqueId()
{
  command(SPIFLASH_MACREAD);
  SPI.transfer(0);
  SPI.transfer(0);
  SPI.transfer(0);
  SPI.transfer(0);
  for (uint8_t i=0;i<8;i++)
    UNIQUEID[i] = SPI.transfer(0);
  unselect();
  return UNIQUEID;
}

/// read 1 byte from flash memory
uint8_t SPIFlash::readByte(uint32_t addr) {
  command(SPIFLASH_ARRAYREADLOWFREQ);
  SPI.transfer(addr >> 16);
  SPI.transfer(addr >> 8);
  SPI.transfer(addr);
  uint8_t result = SPI.transfer(0);
  unselect();
  return result;
}

/// read unlimited # of bytes
void SPIFlash::readBytes(uint32_t addr, void* buf, uint16_t len) {
  command(SPIFLASH_ARRAYREAD);
  SPI.transfer(addr >> 16);
  SPI.transfer(addr >> 8);
  SPI.transfer(addr);
  SPI.transfer(0); //"dont care"
  for (uint16_t i = 0; i < len; ++i)
    ((uint8_t*) buf)[i] = SPI.transfer(0);
  unselect();
}

/// Send a command to the flash chip, pass TRUE for isWrite when its a write command
void SPIFlash::command(uint8_t cmd, boolean isWrite){
#if defined(__AVR_ATmega32U4__) // Arduino Leonardo, MoteinoLeo
  DDRB |= B00000001;            // Make sure the SS pin (PB0 - used by RFM12B on MoteinoLeo R1) is set as output HIGH!
  PORTB |= B00000001;
#endif
  if (isWrite)
  {
    command(SPIFLASH_WRITEENABLE); // Write Enable
    unselect();
  }
  //wait for any write/erase to complete
  //  a time limit cannot really be added here without it being a very large safe limit
  //  that is because some chips can take several seconds to carry out a chip erase or other similar multi block or entire-chip operations
  //  a recommended alternative to such situations where chip can be or not be present is to add a 10k or similar weak pulldown on the
  //  open drain MISO input which can read noise/static and hence return a non 0 status byte, causing the while() to hang when a flash chip is not present
  while(busy());
  select();
  SPI.transfer(cmd);
}

/// check if the chip is busy erasing/writing
boolean SPIFlash::busy()
{
  /*
  select();
  SPI.transfer(SPIFLASH_STATUSREAD);
  uint8_t status = SPI.transfer(0);
  unselect();
  return status & 1;
  */
  return readStatus() & 1;
}

/// return the STATUS register
uint8_t SPIFlash::readStatus()
{
  select();
  SPI.transfer(SPIFLASH_STATUSREAD);
  uint8_t status = SPI.transfer(0);
  unselect();
  return status;
}

/// Write 1 byte to flash memory
/// WARNING: you can only write to previously erased memory locations (see datasheet)
///          use the block erase commands to first clear memory (write 0xFFs)
void SPIFlash::writeByte(uint32_t addr, uint8_t byt) {
  command(SPIFLASH_BYTEPAGEPROGRAM, true);  // Byte/Page Program
  SPI.transfer(addr >> 16);
  SPI.transfer(addr >> 8);
  SPI.transfer(addr);
  SPI.transfer(byt);
  unselect();
}

/// write multiple bytes to flash memory (up to 64K)
/// WARNING: you can only write to previously erased memory locations (see datasheet)
///          use the block erase commands to first clear memory (write 0xFFs)
/// This version handles both page alignment and data blocks larger than 256 bytes.
///
void SPIFlash::writeBytes(uint32_t addr, const void* buf, uint16_t len) {
  uint16_t n;
  uint16_t maxBytes = 256-(addr%256);  // force the first set of bytes to stay within the first page
  uint16_t offset = 0;
  while (len>0)
  {
    n = (len<=maxBytes) ? len : maxBytes;
    command(SPIFLASH_BYTEPAGEPROGRAM, true);  // Byte/Page Program
    SPI.transfer(addr >> 16);
    SPI.transfer(addr >> 8);
    SPI.transfer(addr);

    for (uint16_t i = 0; i < n; i++)
      SPI.transfer(((uint8_t*) buf)[offset + i]);
    unselect();

    addr+=n;  // adjust the addresses and remaining bytes by what we've just transferred.
    offset +=n;
    len -= n;
    maxBytes = 256;   // now we can do up to 256 bytes per loop
  }
}

/// erase entire flash memory array
/// may take several seconds depending on size, but is non blocking
/// so you may wait for this to complete using busy() or continue doing
/// other things and later check if the chip is done with busy()
/// note that any command will first wait for chip to become available using busy()
/// so no need to do that twice
void SPIFlash::chipErase() {
  command(SPIFLASH_CHIPERASE, true);
  unselect();
}

/// erase a 4Kbyte block
void SPIFlash::blockErase4K(uint32_t addr) {
  command(SPIFLASH_BLOCKERASE_4K, true); // Block Erase
  SPI.transfer(addr >> 16);
  SPI.transfer(addr >> 8);
  SPI.transfer(addr);
  unselect();
}

/// erase a 32Kbyte block
void SPIFlash::blockErase32K(uint32_t addr) {
  command(SPIFLASH_BLOCKERASE_32K, true); // Block Erase
  SPI.transfer(addr >> 16);
  SPI.transfer(addr >> 8);
  SPI.transfer(addr);
  unselect();
}

/// erase a 64Kbyte block
void SPIFlash::blockErase64K(uint32_t addr) {
  command(SPIFLASH_BLOCKERASE_64K, true); // Block Erase
  SPI.transfer(addr >> 16);
  SPI.transfer(addr >> 8);
  SPI.transfer(addr);
  unselect();
}

void SPIFlash::sleep() {
  command(SPIFLASH_SLEEP);
  unselect();
}

void SPIFlash::wakeup() {
  command(SPIFLASH_WAKE);
  unselect();
}

/// cleanup
void SPIFlash::end() {
  SPI.end();
}


text:
package net.automatalib.automata.visualization;

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

import net.automatalib.automata.fsa.DFA;
import net.automatalib.commons.util.Pair;
import net.automatalib.commons.util.Triple;
import net.automatalib.visualization.DefaultVisualizationHelper;
import net.automatalib.words.Alphabet;
import org.checkerframework.checker.nullness.qual.NonNull;

public class SPAVisualizationHelper<I, S> extends DefaultVisualizationHelper<Pair<I, S>, Triple<I, I, S>> {

    final Map<I, DFA<S, I>> subModels;
    final Alphabet<I> callAlphabet;

    // cast is fine, because we make sure to only query states belonging to the respective procedures
    @SuppressWarnings("unchecked")
    public SPAVisualizationHelper(Alphabet<I> callAlphabet, Map<I, ? extends DFA<? extends S, I>> subModels) {
        this.callAlphabet = callAlphabet;
        this.subModels = (Map<I, DFA<S, I>>) subModels;
    }

    @Override
    protected Collection<Pair<I, S>> initialNodes() {
        final List<Pair<I, S>> initialNodes = new ArrayList<>(this.subModels.size());

        for (Entry<I, DFA<S, I>> e : subModels.entrySet()) {
            final S init = e.getValue().getInitialState();
            assert init != null;
            initialNodes.add(Pair.of(e.getKey(), init));
        }

        return initialNodes;
    }

    @Override
    public boolean getNodeProperties(Pair<I, S> node, Map<String, String> properties) {

        if (!super.getNodeProperties(node, properties)) {
            return false;
        }

        final I identifier = node.getFirst();
        @SuppressWarnings("assignment.type.incompatible") // we only use identifier for which procedures exists
        final @NonNull DFA<S, I> subModel = subModels.get(identifier);

        if (subModel.isAccepting(node.getSecond())) {
            properties.put(NodeAttrs.SHAPE, NodeShapes.DOUBLECIRCLE);
        } else {
            properties.put(NodeAttrs.SHAPE, NodeShapes.CIRCLE);
        }
        properties.put(NodeAttrs.LABEL, node.getFirst() + " " + node.getSecond());

        return true;
    }

    @Override
    public boolean getEdgeProperties(Pair<I, S> src,
                                     Triple<I, I, S> edge,
                                     Pair<I, S> tgt,
                                     Map<String, String> properties) {

        if (!super.getEdgeProperties(src, edge, tgt, properties)) {
            return false;
        }

        properties.put(EdgeAttrs.LABEL, String.valueOf(edge.getSecond()));

        if (callAlphabet.containsSymbol(edge.getSecond())) {
            properties.put(EdgeAttrs.STYLE, EdgeStyles.BOLD);
        }

        return true;
    }
}


text:
describe('Saiku Analytics', function() {
  context('Tests login', function() {
    beforeEach(function() {
      cy.visit('http://localhost:8080/');
    });

    it('Login failed with blank inputs', function() {
      // click the Login button
      cy.get('a[href="#login"]')
        .contains('Login').should('have.class', 'btn').click();

      // has "Authentication failed for:" ?
      cy.contains('Authentication failed for:');
    });

    it('Login failed with wrong username and password', function() {
      // fill the username input with "admin1"
      cy.get('input[name="username"]')
        .type('admin1').should('have.value', 'admin1');

      // fill the password input with "123456"
      cy.get('input[name="password"]')
        .type('123456').should('have.value', '123456');

      // click the Login button
      cy.get('a[href="#login"]')
        .contains('Login').should('have.class', 'btn').click();

      // has "Authentication failed for: admin" ?
      cy.contains('Authentication failed for: admin');
    });

    it('Login passes with license in place', function() {
      // fill the username input with "admin"
      cy.get('input[name="username"]')
        .type('admin').should('have.value', 'admin');

      // fill the password input with "admin"
      cy.get('input[name="password"]')
        .type('admin').should('have.value', 'admin');

      // click the Login button
      cy.get('a[href="#login"]')
        .contains('Login').should('have.class', 'btn').click();

      // has new query icon in the toolbar?
      cy.get('a#new_query').should('have.class', 'new_tab');
    });
  });

  context('Tests creating queries', function() {
    it('Sample data cubes are available on initial install', function() {
      // click the new query icon
      cy.get('a#new_query').click();

      // check if "Foodmart" schema exists
      cy.get('select#cubesselect > optgroup').each(function($el) {
        if ($el.attr('label').indexOf('FoodMart') !== -1) {
          expect($el).to.have.attr('label', 'FoodMart  (foodmart)');
        }
        else {
          return;
        }

        return false;
      });
    });

    it('New queries can be created', function() {
      // select the cube "Sales"
      cy.get('select#cubesselect')
        .select('Sales').should('have.value', 'foodmart/FoodMart/FoodMart/Sales');

      // click the measure "Unit Sales"
      cy.get('.measure_tree .d_measure a[measure="Unit Sales"]')
        .contains('Unit Sales').should('have.class', 'measure').click();

      // click the dimension "Customer"
      cy.get('.dimension_tree .parent_dimension a[title="Customer"]')
        .contains('Customer').should('have.class', 'folder_collapsed').click();

      // click the level "Country"
      cy.get('.dimension_tree .parent_dimension a[level="Country"]')
        .contains('Country').should('have.class', 'level').click();
    });

    it('Charts render', function() {
      // click the render chart icon
      cy.get('.query_toolbar_vertical > ul li:nth-child(2) a#chart_icon')
        .should('have.class', 'render_chart').click();
    });
  });

  context('Tests saving and opening files', function() {
    it('Files can be saved', function() {
      // click the render table icon
      cy.get('.query_toolbar_vertical > ul li:nth-child(1) a#table_icon')
        .should('have.class', 'render_table').click();

      // click the save icon in workspace toolbar
      cy.get('.workspace_toolbar a#save_icon')
        .should('have.class', 'save').click();

      // click the folder "homes"
      cy.get('.RepositoryObjects li .folder_row')
        .contains('homes').click();

      // click the folder "home:admin"
      cy.get('.RepositoryObjects li .folder_content')
        .contains('home:admin').click();

      // create the "test_cypress.saiku" file
      cy.get('input#relative-file-path').type('test_cypress');

      // click the Save button
      cy.get('a[href="#save"]')
        .contains('Save').should('have.class', 'btn').click();
    });

    it('Files can be opened', function() {
      // click the open icon in workspace toolbar
      cy.get('.workspace_toolbar #new_icon')
        .should('have.class', 'open').click();

      // click the folder "home"
      cy.get('.RepositoryObjects li .folder_row')
        .contains('homes').click();

      // click the folder "home:admin"
      cy.get('.RepositoryObjects li .folder_content')
        .contains('home:admin').click();

      // Open the "test_cypress.saiku" file
      cy.get('.RepositoryObjects li .folder_content')
        .contains('test_cypress.saiku').dblclick();
    });
  });

  context('Tests files and folders can be secured with roles', function() {
    it('Folder can be secured with roles', function() {
      // click the open query icon
      cy.get('a#open_query').should('have.class', 'open_query').click();

      // click the folder "homes"
      cy.get('.RepositoryObjects li .folder_row')
        .contains('homes').click({ force: true });

      // click the edit permissions icon
      cy.get('.workspace_toolbar .for_folder a.edit_permissions')
        .should('have.class', 'button').click();

      // fill the filter_roles input with "ROLE_ADMIN"
      cy.get('input#filter_roles')
        .type('ROLE_ADMIN').should('have.value', 'ROLE_ADMIN');

      // check the boxes "READ", "WRITE" and "GRANT"
      cy.get('input[type="checkbox"].acl[value="READ"]').should('have.value', 'READ').click({ force: true });
      cy.get('input[type="checkbox"].acl[value="WRITE"]').should('have.value', 'WRITE').click({ force: true });
      cy.get('input[type="checkbox"].acl[value="GRANT"]').should('have.value', 'GRANT').click({ force: true });

      // click the Add button
      cy.get('input.add_role').should('have.value', 'Add').click();

      // click the Ok button
      cy.get('a[href="#ok"]')
        .contains('Ok').should('have.class', 'btn').click();
    });

    it('Files can be secured with roles', function() {
      // click the open query icon
      cy.get('a#open_query').should('have.class', 'open_query').click();

      // click the folder "homes"
      cy.get('.RepositoryObjects li .folder_row')
        .contains('homes').click({ force: true });

      // click the folder "home:admin"
      cy.get('.RepositoryObjects li .folder_content')
        .contains('home:admin').click({ force: true });

      // click the "test_cypress.saiku" file
      cy.get('.RepositoryObjects li .folder_content')
        .contains('test_cypress.saiku').click({ force: true });

      // click the edit permissions icon
      cy.get('.workspace_toolbar .for_folder a.edit_permissions')
        .should('have.class', 'button').click({ force: true });

      // fill the filter_roles input with "ROLE_ADMIN"
      cy.get('input#filter_roles')
        .type('ROLE_ADMIN').should('have.value', 'ROLE_ADMIN');

      // check the boxes "READ", "WRITE" and "GRANT"
      cy.get('input[type="checkbox"].acl[value="READ"]').should('have.value', 'READ').click({ force: true });
      cy.get('input[type="checkbox"].acl[value="WRITE"]').should('have.value', 'WRITE').click({ force: true });
      cy.get('input[type="checkbox"].acl[value="GRANT"]').should('have.value', 'GRANT').click({ force: true });

      // click the Add button
      cy.get('input.add_role').should('have.value', 'Add').click();

      // click the Ok button
      cy.get('a[href="#ok"]')
        .contains('Ok').should('have.class', 'btn').click();
    });
  });
});


text:
package controllers

import models._
import play.api.mvc.Request
import play.api.mvc.AnyContent
import play.api.Play.current
import play.api.Play
import java.net.URI
import scala.collection.JavaConversions._
import com.typesafe.config.ConfigObject

object RequesterSession {

  val ProviderNsaSessionField = "nsaId"
  val AccessTokensSessionField = "accessTokens"
  val ServiceType = "http://services.ogf.org/nsi/2013/12/descriptions/EVTS.A-GOLE"
  val RequesterNsa = current.configuration.getString("requester.nsi.requesterNsa").getOrElse(sys.error("Requester NSA is not configured (requester.nsi.requesterNsa)"))

  def currentPortPrefix(implicit request: Request[AnyContent]): String = currentProvider.portPrefix

  def currentProvider(implicit request: Request[AnyContent]): Provider =
    request.session.get(ProviderNsaSessionField) flatMap findProvider getOrElse allProviders.head

  def currentEndPoint(implicit request: Request[AnyContent]): EndPoint = {
    request.session.get("accessTokens") match {
      case None => EndPoint(currentProvider, List())
      case Some(commaSeparated) => EndPoint(currentProvider, commaSeparated.split(",").toList)
    }
  }

  def ReplyToUrl(implicit request: Request[AnyContent]) = URI.create(routes.ResponseController.reply.absoluteURL(isUsingSsl))

  private def isUsingSsl(implicit request: Request[AnyContent]) = request.headers.get("X-Forwarded-Proto") == Some("https") || current.configuration.getBoolean("requester.ssl") == Some(true)

  // is not a lazy val, because some tests will break (object will only be initialized once during tests
  def allProviders: Seq[Provider] = {
    def toProvider(providerObject: ConfigObject): Provider =
      Provider(
        providerObject.get("id").unwrapped().asInstanceOf[String],
        URI.create(providerObject.get("url").unwrapped().asInstanceOf[String]),
        providerObject.get("portPrefix").unwrapped().asInstanceOf[String])

    current.configuration.getObjectList("requester.nsi.providers").map(_.map(toProvider)).getOrElse(sys.error("No NSI providers where configured (requester.ns.providers)"))
  }

  def findProvider(nsaId: String) = allProviders.find(_.nsaId == nsaId)
}


text:
#ifndef _LOGGER_STRINGUTIL_H
#define _LOGGER_STRINGUTIL_H

#ifdef __cplusplus
extern "C" {
#endif

/**
 @brief Retrieve just the filename from the full filepath (unix shell equivalent 'basename')
 @detail returned parameter #stringFileNameReturned does not contain a new refrence but simply a pointer within the char array provided w/o whitespaces
 @param[out] stringFileNameReturned char array of just the filename
 @param[out] stringFileNameReturnedLen length of above char array (optional)
 @param[in] filePath char array to remove path from
 @param[in] filePathLen length of above char array
 */
void logger_string_fileNameFromPath ( char ** stringFileNameReturned, size_t * stringFileNameReturnedLen, const char * filePath, size_t filePathLen );

/**
 @brief Return a subreference containing char array #str removed of any leading & trailing whitespace
 @detail returned parameter #stringTrimmed does not contain a new refrence but simply a pointer within the char array provided w/o whitespaces
 @param[out] stringTrimmed returned whitespace free char array
 @param[out] stringTrimmedLen length of above array
 @param[in] str char array to remove whitespaces from
 @param[in] strLen length of above array
 */
void logger_string_trimWhitespace ( char ** stringTrimmed, size_t * stringTrimmedLen, char * str, size_t strLen );

/**
 @brief Trim any filename extension at the end the provided char array #str
 @detail #stringTrimmedLen will return the last occurence of the character '.' in the #str char array
 @param[out] stringTrimmedLen length of string w/o fileName extension
 @param[in] str char array to search
 @param[in] strLen length of above char array
 */
void logger_string_trimFileNameExtension ( size_t * stringTrimmedLen, char * str, size_t strLen );

/** Return pointer to first occurence of char in given string.
 @param[in] str string to search
 @param[in] searchChar character to look for
 @return !NULL on success
 */
char* logger_string_findFirstOccurenceOfChar ( const char* str, const char searchChar );

/** Return pointer to first occurence of char in given string.
 @param[in] str string to search
 @param[in] strLen string length of above param
 @param[in] searchChar character to look for
 @return occurences of search char in string
 */
uint32_t logger_string_numberOfOccurencesOfChar ( const char* str, size_t strLen, const char searchChar );

#ifdef __cplusplus
}
#endif

#endif /* _LOGGER_STRINGUTIL_H */


text:
from itertools import *
import random; random.seed()

# Vendor
import graph_tool.all as gt
from pymongo import MongoClient

# -- Configuration --
mongo_uri = 'mongodb://localhost'
directed = True
n = 10000
skip = 8
filename = 'twitter-graph.xml.gz'
imagename = 'twitter-graph-lg.pdf'
blocks = 20
iterations = 50000
mindegree = 5
show = False

# -- Primary Types --
def create():
	mongo = MongoClient(mongo_uri)
	users = mongo.rc.twitter.graph.find(limit=n * (1+skip), timeout=False)
	print 'Retrieved %d users to create a graph with' % n

	users = skipevery(users, skip)
	users = printevery(users, 10, 'On user %d')
	g = make_graph(users, directed)

	if show:
		print 'Filtering complete. Now calculating base layout'
		g.vp['pos'] = gt.sfdp_layout(g)

	print 'Graph %s made, now saving as %s' % (g, filename)
	g.save(filename)

def show():
	g = gt.load_graph(filename)
	kwargs = {}
	print 'Graph loaded, now drawing to %s' % imagename

	if 'blocks' in g.vp:
		kwargs['vertex_fill_color'] = g.vertex_properties['blocks']
	if 'rank' in g.vp:
		kwargs['vertex_size'] = gt.prop_to_size(g.vp['rank'], mi=5, ma=15)
	if 'pos' in g.vp:
		kwargs['pos'] = g.vp['pos']

	gt.graph_draw(g, vertex_shape=g.vp['rc'], output=imagename, **kwargs)

def community():
	g = gt.load_graph(filename)
	print 'Graph loaded, now finding community'
	# state = gt.BlockState(g, B=blocks)
	# for i in xrange(iterations):
	# 	if i < iterations / 2:
	# 		gt.mcmc_sweep(state)
	# 	else:
	# 		gt.mcmc_sweep(state, beta=float('inf'))

	# g.vp['blocks'] = state.get_blocks()

	spins = {}
	if 'blocks' in g.vp:
		spins = {'spins': g.vp['blocks']}

	g.vp['blocks'] = gt.community_structure(g, n_iter=iterations, n_spins=blocks, **spins)

	if 'pos' in g.vp:
		gt.sfdp_layout(g, groups=g.vp['blocks'], pos=g.vp['pos'])

	for i in xrange(blocks):
		print '%d nodes in block %d' % (len(gt.find_vertex(g, g.vp['blocks'], i)), i)

	g.save(filename)

def central():
	g = gt.load_graph(filename)
	print 'Graph loaded, now calculating centrality'
	pr = gt.pagerank(g)
	g.vp['rank'] = pr
	g.save(filename)

def top():
	g = gt.load_graph(filename)
	print 'Graph loaded, now calculating top nodes'
	vblocks = g.vp['blocks']
	largest_block = max(range(blocks), key=lambda b: len(gt.find_vertex(g, vblocks, b)))
	print 'Largest block is %d with %d nodes' % (largest_block, len(gt.find_vertex(g, vblocks, largest_block)))

	for tup in top_ids(g, largest_block):
		print tup

def top_ids(g, block, n=10):
	'''List the most central node ids in a given block'''
	vid = g.vp['id']
	vrank = g.vp['rank']
	vertices = gt.find_vertex(g, g.vp['blocks'], block)
	sorted_vertices = sorted(vertices, key=lambda v: vrank[v], reverse=True)
	mapped_vertices = imap(lambda v: (vid[v], vrank[v]), sorted_vertices)

	return take(n, mapped_vertices)

def make_graph(users, directed=True):
	g = gt.Graph(directed=directed)
	vid = g.new_vertex_property('string')
	vrc = g.new_vertex_property('bool')
	g.vp['id'] = vid
	g.vp['rc'] = vrc

	vertex = lambda id: get_vertex(g, vid, id)
	edge = lambda v1, v2: add_edge(g, v1, v2)

	for user in users:
		id = user['user']['id']
		v = vertex(id)

		for friend in user['friends']:
			edge(v, vertex(friend))

		for follower in user['followers']:
			edge(vertex(follower), v)

	return filter_graph(g)

def filter_graph(g):
	vdeg = g.new_vertex_property('bool')
	for v in g.vertices():
		vdeg[v] = v.in_degree() + v.out_degree() > mindegree

	print 'Setting vertex filter at %d' % mindegree
	g.set_vertex_filter(vdeg)
	g.purge_vertices()
	return g

# -- Helpers --
vertices = {}
def get_vertex(g, vid, id):
	try:
		# return gt.find_vertex(g, vid, id)[0]
		return vertices[id]
	except KeyError:
		v = g.add_vertex()
		vid[v] = id
		vertices[id] = v
		return v

def add_edge(g, v1, v2):
	# if not g.edge(v1, v2):
	g.add_edge(v1, v2)

def skipevery(iter, n):
	while True:
		for i in xrange(n):
			y = next(iter)
		yield y

def printevery(iter, n, stmt):
	for i, el in enumerate(iter):
		if i % n == 0:
			print stmt % i
		yield el

def take(n, iterable):
	"Return first n items of the iterable as a list"
	return list(islice(iterable, n))

# -- Main Code --
actions = {
	'show': show,
	'create': create,
	'community': community,
	'central': central,
	'top': top
}

if __name__ == '__main__':
	import sys
	if len(sys.argv) > 1:
		for action in sys.argv[1:]:
			if action in actions:
				actions[action]()
			else:
				print 'Unknown action %s' % action
	else:
		create()


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/common/child_process_sandbox_support_impl_linux.h"

#include <sys/stat.h>

#include "base/debug/trace_event.h"
#include "base/memory/scoped_ptr.h"
#include "base/pickle.h"
#include "base/posix/eintr_wrapper.h"
#include "base/posix/unix_domain_socket_linux.h"
#include "base/safe_numerics.h"
#include "base/sys_byteorder.h"
#include "content/common/sandbox_linux.h"
#include "third_party/WebKit/public/platform/linux/WebFontFamily.h"
#include "third_party/WebKit/public/platform/linux/WebFontRenderStyle.h"

namespace content {

void GetFontFamilyForCharacter(int32_t character,
                               const char* preferred_locale,
                               WebKit::WebFontFamily* family) {
  TRACE_EVENT0("sandbox_ipc", "GetFontFamilyForCharacter");

  Pickle request;
  request.WriteInt(LinuxSandbox::METHOD_GET_FONT_FAMILY_FOR_CHAR);
  request.WriteInt(character);
  request.WriteString(preferred_locale);

  uint8_t buf[512];
  const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf,
                                                  sizeof(buf), NULL, request);

  std::string family_name;
  bool isBold = false;
  bool isItalic = false;
  if (n != -1) {
    Pickle reply(reinterpret_cast<char*>(buf), n);
    PickleIterator pickle_iter(reply);
    if (reply.ReadString(&pickle_iter, &family_name) &&
        reply.ReadBool(&pickle_iter, &isBold) &&
        reply.ReadBool(&pickle_iter, &isItalic)) {
      family->name = family_name;
      family->isBold = isBold;
      family->isItalic = isItalic;
    }
  }
}

void GetRenderStyleForStrike(const char* family, int sizeAndStyle,
                             WebKit::WebFontRenderStyle* out) {
  TRACE_EVENT0("sandbox_ipc", "GetRenderStyleForStrike");

  Pickle request;
  request.WriteInt(LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE);
  request.WriteString(family);
  request.WriteInt(sizeAndStyle);

  uint8_t buf[512];
  const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf,
                                                  sizeof(buf), NULL, request);

  out->setDefaults();
  if (n == -1) {
    return;
  }

  Pickle reply(reinterpret_cast<char*>(buf), n);
  PickleIterator pickle_iter(reply);
  int useBitmaps, useAutoHint, useHinting, hintStyle, useAntiAlias;
  int useSubpixelRendering, useSubpixelPositioning;
  if (reply.ReadInt(&pickle_iter, &useBitmaps) &&
      reply.ReadInt(&pickle_iter, &useAutoHint) &&
      reply.ReadInt(&pickle_iter, &useHinting) &&
      reply.ReadInt(&pickle_iter, &hintStyle) &&
      reply.ReadInt(&pickle_iter, &useAntiAlias) &&
      reply.ReadInt(&pickle_iter, &useSubpixelRendering) &&
      reply.ReadInt(&pickle_iter, &useSubpixelPositioning)) {
    out->useBitmaps = useBitmaps;
    out->useAutoHint = useAutoHint;
    out->useHinting = useHinting;
    out->hintStyle = hintStyle;
    out->useAntiAlias = useAntiAlias;
    out->useSubpixelRendering = useSubpixelRendering;
    out->useSubpixelPositioning = useSubpixelPositioning;
  }
}

int MatchFontWithFallback(const std::string& face, bool bold,
                          bool italic, int charset) {
  TRACE_EVENT0("sandbox_ipc", "MatchFontWithFallback");

  Pickle request;
  request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK);
  request.WriteString(face);
  request.WriteBool(bold);
  request.WriteBool(italic);
  request.WriteUInt32(charset);
  uint8_t reply_buf[64];
  int fd = -1;
  UnixDomainSocket::SendRecvMsg(GetSandboxFD(), reply_buf, sizeof(reply_buf),
                                &fd, request);
  return fd;
}

bool GetFontTable(int fd, uint32_t table_tag, off_t offset,
                  uint8_t* output, size_t* output_length) {
  if (offset < 0)
    return false;

  size_t data_length = 0;  // the length of the file data.
  off_t data_offset = 0;   // the offset of the data in the file.
  if (table_tag == 0) {
    // Get the entire font file.
    struct stat st;
    if (fstat(fd, &st) < 0)
      return false;
    data_length = base::checked_numeric_cast<size_t>(st.st_size);
  } else {
    // Get a font table. Read the header to find its offset in the file.
    uint16_t num_tables;
    ssize_t n = HANDLE_EINTR(pread(fd, &num_tables, sizeof(num_tables),
                             4 /* skip the font type */));
    if (n != sizeof(num_tables))
      return false;
    // Font data is stored in net (big-endian) order.
    num_tables = base::NetToHost16(num_tables);

    // Read the table directory.
    static const size_t kTableEntrySize = 16;
    const size_t directory_size = num_tables * kTableEntrySize;
    scoped_ptr<uint8_t[]> table_entries(new uint8_t[directory_size]);
    n = HANDLE_EINTR(pread(fd, table_entries.get(), directory_size,
                           12 /* skip the SFNT header */));
    if (n != base::checked_numeric_cast<ssize_t>(directory_size))
      return false;

    for (uint16_t i = 0; i < num_tables; ++i) {
      uint8_t* entry = table_entries.get() + i * kTableEntrySize;
      uint32_t tag = *reinterpret_cast<uint32_t*>(entry);
      if (tag == table_tag) {
        // Font data is stored in net (big-endian) order.
        data_offset =
            base::NetToHost32(*reinterpret_cast<uint32_t*>(entry + 8));
        data_length =
            base::NetToHost32(*reinterpret_cast<uint32_t*>(entry + 12));
        break;
      }
    }
  }

  if (!data_length)
    return false;
  // Clamp |offset| inside the allowable range. This allows the read to succeed
  // but return 0 bytes.
  offset = std::min(offset, base::checked_numeric_cast<off_t>(data_length));
  // Make sure it's safe to add the data offset and the caller's logical offset.
  // Define the maximum positive offset on 32 bit systems.
  static const off_t kMaxPositiveOffset32 = 0x7FFFFFFF;  // 2 GB - 1.
  if ((offset > kMaxPositiveOffset32 / 2) ||
      (data_offset > kMaxPositiveOffset32 / 2))
    return false;
  data_offset += offset;
  data_length -= offset;

  if (output) {
    // 'output_length' holds the maximum amount of data the caller can accept.
    data_length = std::min(data_length, *output_length);
    ssize_t n = HANDLE_EINTR(pread(fd, output, data_length, data_offset));
    if (n != base::checked_numeric_cast<ssize_t>(data_length))
      return false;
  }
  *output_length = data_length;

  return true;
}

}  // namespace content


text:
package net.onrc.openvirtex.db;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import net.onrc.openvirtex.api.service.handlers.TenantHandler;
import net.onrc.openvirtex.elements.address.IPAddress;
import net.onrc.openvirtex.elements.address.OVXIPAddress;
import net.onrc.openvirtex.elements.datapath.DPIDandPort;
import net.onrc.openvirtex.elements.datapath.DPIDandPortPair;
import net.onrc.openvirtex.elements.datapath.PhysicalSwitch;
import net.onrc.openvirtex.elements.datapath.Switch;
import net.onrc.openvirtex.elements.host.Host;
import net.onrc.openvirtex.elements.link.Link;
import net.onrc.openvirtex.elements.link.PhysicalLink;
import net.onrc.openvirtex.elements.network.OVXNetwork;
import net.onrc.openvirtex.elements.network.PhysicalNetwork;
import net.onrc.openvirtex.elements.port.Port;
import net.onrc.openvirtex.exceptions.DuplicateIndexException;
import net.onrc.openvirtex.exceptions.IndexOutOfBoundException;
import net.onrc.openvirtex.exceptions.PortMappingException;
import net.onrc.openvirtex.exceptions.RoutingAlgorithmException;
import net.onrc.openvirtex.routing.RoutingAlgorithms.RoutingType;
import net.onrc.openvirtex.routing.SwitchRoute;
import net.onrc.openvirtex.util.MACAddress;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * Component that creates a previously stored virtual network when all required switches, links and ports are online.
 */

public class OVXNetworkManager {

	private Map<String, Object> vnet;
	private Integer tenantId;
	// Set of offline and online physical switches
	private Set<Long> offlineSwitches;
	private Set<Long> onlineSwitches;
	// Set of offline and online physical links identified as (dpid, port)-pair
	private Set<DPIDandPortPair> offlineLinks;
	private Set<DPIDandPortPair> onlineLinks;
	// Set of offline and online physical ports
	private Set<DPIDandPort> offlinePorts;
	private Set<DPIDandPort> onlinePorts;
	private boolean bootState;

	private static Logger log = LogManager.getLogger(OVXNetworkManager.class
			.getName());

	public OVXNetworkManager(Map<String, Object> vnet) throws IndexOutOfBoundException, DuplicateIndexException {
		this.vnet = vnet;
		this.tenantId = (Integer) vnet.get(TenantHandler.TENANT);
		this.offlineSwitches = new HashSet<Long>();
		this.onlineSwitches = new HashSet<Long>();
		this.offlineLinks = new HashSet<DPIDandPortPair>();
		this.onlineLinks = new HashSet<DPIDandPortPair>();
		this.offlinePorts = new HashSet<DPIDandPort>();
		this.onlinePorts = new HashSet<DPIDandPort>();
		this.bootState = false;
	}

	public Integer getTenantId() {
		return this.tenantId;
	}

	public Integer getSwitchCount() {
		return this.offlineSwitches.size() + this.onlineSwitches.size();
	}

	public Integer getLinkCount() {
		return this.offlineLinks.size() + this.onlineLinks.size();
	}

	public Integer getPortCount() {
		return this.offlinePorts.size() + this.onlinePorts.size();
	}

	public boolean getStatus() {
		return this.bootState;
	}

	/**
	 * Register switch identified by dpid, ensuring the virtual network
	 * is spawned only after the switch is online.
	 *
	 * @param dpid
	 */
	public void registerSwitch(final Long dpid) {
		this.offlineSwitches.add(dpid);
	}

	/**
	 * Register link identified by key, ensuring the virtual network
	 * is spawned only after the link is online.
	 *
	 * @param dpp
	 */
	public void registerLink(final DPIDandPortPair dpp) {
		this.offlineLinks.add(dpp);
	}

	/**
	 * Register port identified by key, ensuring the virtual network
	 * is spawned only after the port is online.
	 *
	 * @param dpp
	 */
	public void registerPort(final DPIDandPort port) {
		this.offlinePorts.add(port);
	}

	/**
	 * Change switch from offline to online state
	 * Create and start virtual network if all links and switches are online.
	 * @param key Unique datapath id
	 */
	public synchronized void setSwitch(final Long dpid) {
		this.offlineSwitches.remove(dpid);
		this.onlineSwitches.add(dpid);
		if (this.offlineSwitches.isEmpty() && this.offlineLinks.isEmpty() && this.offlinePorts.isEmpty())
			this.createNetwork();
	}

	/**
	 * Change switch from online to offline state
	 * @param key Unique datapath id
	 */
	public synchronized void unsetSwitch(final Long dpid) {
		this.offlineSwitches.add(dpid);
		this.onlineSwitches.remove(dpid);
	}

	/**
	 * Change link from offline to single direction state, or from single direction to online.
	 * Create and start virtual network if all links and switches are online.
	 * @param key Unique link
	 */
	public synchronized void setLink(final DPIDandPortPair dpp) {
		// Link might have been set already, so check first if it's still offline
		if (this.offlineLinks.contains(dpp)) {
			this.offlineLinks.remove(dpp);
			this.onlineLinks.add(dpp);
			if (this.offlineSwitches.isEmpty() && this.offlineLinks.isEmpty() && this.offlinePorts.isEmpty())
				this.createNetwork();
		}
	}

	/**
	 * Change link from online to offline state
	 * @param key Unique link
	 */
	public synchronized void unsetLink(final DPIDandPortPair dpp) {
		if (this.onlineLinks.contains(dpp)) {
			this.onlineLinks.remove(dpp);
			this.offlineLinks.add(dpp);
		}
	}

	/**
	 * Change link from offline to single direction state, or from single direction to online.
	 * Create and start virtual network if all links and switches are online.
	 * @param key Unique link
	 */
	public synchronized void setPort(final DPIDandPort port) {
		// Port might have been set already, so check first if it's still offline
		if (this.offlinePorts.contains(port)) {
			this.offlinePorts.remove(port);
			this.onlinePorts.add(port);
			if (this.offlineSwitches.isEmpty() && this.offlineLinks.isEmpty() && this.offlinePorts.isEmpty())
				this.createNetwork();
		}
	}

	/**
	 * Change link from online to offline state
	 * @param key Unique link
	 */
	public synchronized void unsetPort(final DPIDandPort port) {
		if (this.onlinePorts.contains(port)) {
			this.onlinePorts.remove(port);
			this.offlinePorts.add(port);
		}
	}

	/**
	 * Convert path in db map format to list of physical links
	 * @param path
	 * @return
	 */

	@SuppressWarnings({ "rawtypes", "unchecked" })
	private List<PhysicalLink> pathToPhyLinkList(List<Map> path) {
		// Build list of physical links
		final List<PhysicalLink> result = new ArrayList<PhysicalLink>();
		for (Map<String, Object> hop: path) {
			// Get src/dst dpid & port number from map
			final Long sDpid = (Long) hop.get(TenantHandler.SRC_DPID);
			final Short sPort = ((Integer) hop.get(TenantHandler.SRC_PORT)).shortValue();
			final Long dDpid = (Long) hop.get(TenantHandler.DST_DPID);
			final Short dPort = ((Integer) hop.get(TenantHandler.DST_PORT)).shortValue();

			// Get physical switch instances of end points
			// TODO: what if any of the elements have gone down in the meantime?
			final PhysicalSwitch src = PhysicalNetwork.getInstance().getSwitch(sDpid);
			final PhysicalSwitch dst = PhysicalNetwork.getInstance().getSwitch(dDpid);

			// Get physical link instance
			final PhysicalLink phyLink = PhysicalNetwork.getInstance()
					.getLink(src.getPort(sPort), dst.getPort(dPort));

			result.add(phyLink);
		}
		return result;
	}

	/**
	 * Creates OVX network and elements based on persistent storage, boots network afterwards.
	 * TODO: proper error handling (roll-back?)
	 */

	@SuppressWarnings({ "rawtypes", "unchecked" })
	private void createNetwork() {

		OVXNetworkManager.log.info("Virtual network {} ready for boot", this.tenantId);

		// Create OVX network
		final ArrayList<String> ctrlUrls = (ArrayList<String>) this.vnet.get(TenantHandler.CTRLURLS);
		final Integer network = (Integer) this.vnet.get(TenantHandler.NETADD);
		final IPAddress addr = new OVXIPAddress(network, -1);
		final Short netMask = ((Integer) this.vnet.get(TenantHandler.NETMASK)).shortValue();
		OVXNetwork virtualNetwork;
		try {
			virtualNetwork = new OVXNetwork(this.tenantId, ctrlUrls, addr, netMask);
		} catch (IndexOutOfBoundException e) {
			OVXNetworkManager.log.error("Error recreating virtual network {} from database", this.tenantId);
			return;
		}
		virtualNetwork.register();

		// Create OVX switches
		final List<Map<String, Object>> switches = (List<Map<String, Object>>) this.vnet.get(Switch.DB_KEY);
		if (switches != null) {
			for (Map<String, Object> sw: switches) {
				List<Long> dpids = (List<Long>) sw.get(TenantHandler.DPIDS);
				long switchId = (long) sw.get(TenantHandler.VDPID);
				try {
					virtualNetwork.createSwitch(dpids, switchId);
				} catch (IndexOutOfBoundException e) {
					OVXNetworkManager.log.error("Error recreating virtual switch {} from database", switchId);
					continue;
				}
			}
		}

		// Create OVX ports
		final List<Map<String, Object>> ports = (List<Map<String, Object>>) this.vnet.get(Port.DB_KEY);
		if (ports != null) {
			for (Map<String, Object> port: ports) {
				long physicalDpid = (Long) port.get(TenantHandler.DPID);
				short portNumber = ((Integer) port.get(TenantHandler.PORT)).shortValue();
				short vportNumber = ((Integer) port.get(TenantHandler.VPORT)).shortValue();
				try {
					virtualNetwork.createPort(physicalDpid, portNumber, vportNumber);
				} catch (IndexOutOfBoundException e) {
					OVXNetworkManager.log.error("Error recreating virtual port {} from database", vportNumber);
					continue;
				}
			}
		}

		// Create OVX big switch routes if manual
		if (switches != null) {
			for (Map<String, Object> sw: switches) {
				long switchId = (long) sw.get(TenantHandler.VDPID);
				String alg = (String) sw.get(TenantHandler.ALGORITHM);
				Integer backups = (Integer) sw.get(TenantHandler.BACKUPS);
				// Don't bother with switch routes if not a bigswitch
				if ((alg == null) || (backups == null))
					continue;
				try {
					virtualNetwork.setOVXBigSwitchRouting(switchId, alg, backups.byteValue());
				} catch (RoutingAlgorithmException e) {
					OVXNetworkManager.log.error("Error setting routing mode for switch {} from database", switchId);
					continue;
				}

				// Only restore routes if manual routing
				// Remove all stored routes otherwise
				if (alg == RoutingType.NONE.name()) {
					final List<Map<String, Object>> routes = (List<Map<String, Object>>) this.vnet.get(SwitchRoute.DB_KEY);
					// List of created routeId's per switch
					final Map<Long, List<Integer>> routeIds = new HashMap<Long, List<Integer>>();
					if (routes != null) {
						for (Map<String, Object> route: routes) {
							long dpid = (Long) route.get(TenantHandler.VDPID);
							short srcPort = ((Integer) route.get(TenantHandler.SRC_PORT)).shortValue();
							short dstPort = ((Integer) route.get(TenantHandler.DST_PORT)).shortValue();
							byte priority = ((Integer) route.get(TenantHandler.PRIORITY)).byteValue();
							int routeId = (Integer) route.get(TenantHandler.ROUTE);
							// Maintain id's of routes per switch so we don't create reverse
							List<Integer> visited = routeIds.get(dpid);
							if (visited == null) {
								visited = new ArrayList<Integer>();
								routeIds.put(dpid, visited);
							}
							if (visited.contains(routeId))
								continue;
							else
								visited.add(routeId);

							List<Map> path = (List<Map>) route.get(TenantHandler.PATH);
							List<PhysicalLink> physicalLinks = this.pathToPhyLinkList(path);

							try {
								virtualNetwork.connectRoute(dpid, srcPort, dstPort, physicalLinks, priority, routeId);
							} catch (IndexOutOfBoundException e) {
								OVXNetworkManager.log.error("Error recreating virtual switch route {} from database", routeId);
								continue;
							}
						}
					}
				} else {
					DBManager.getInstance().removeSwitchPath(tenantId, switchId);
				}
			}
		}

		// Create OVX links
		final List<Map<String, Object>> links = (List<Map<String, Object>>) this.vnet.get(Link.DB_KEY);
		// Maintain link id's of virtual links we have created - ensure reverse link is not created again
		final List<Integer> linkIds = new ArrayList<Integer>();
		if (links != null) {
			for (Map<String, Object> link: links) {
				// Skip link if we already handled the reverse
				Integer linkId = (Integer) link.get(TenantHandler.LINK);
				if (linkIds.contains(linkId))
					continue;
				else
					linkIds.add(linkId);
				// Obtain virtual src and dst dpid/port, priority
				Long srcDpid = (Long) link.get(TenantHandler.SRC_DPID);
				Short srcPort = ((Integer) link.get(TenantHandler.SRC_PORT)).shortValue();
				Long dstDpid = (Long) link.get(TenantHandler.DST_DPID);
				Short dstPort = ((Integer) link.get(TenantHandler.DST_PORT)).shortValue();
				Byte priority = ((Integer) link.get(TenantHandler.PRIORITY)).byteValue();
				String alg = (String) link.get(TenantHandler.ALGORITHM);
				byte backups = ((Integer) link.get(TenantHandler.BACKUPS)).byteValue();

				// Build list of physical links
				List<Map> path = (List<Map>) link.get(TenantHandler.PATH);
				List<PhysicalLink> physicalLinks = this.pathToPhyLinkList(path);

				// Create virtual link
				try {
					DBManager.getInstance().removeLinkPath(tenantId, linkId);

					virtualNetwork.connectLink(srcDpid, srcPort, dstDpid, dstPort, alg, backups, linkId);

					// Only configure path if manual routing mode
					if (alg == RoutingType.NONE.getValue())
						virtualNetwork.setLinkPath(linkId, physicalLinks, priority);

				} catch (IndexOutOfBoundException | PortMappingException e) {
					OVXNetworkManager.log.error("Error recreating virtual link {} from database", linkId);
					continue;
				}
			}
		}

		// Connect hosts
		final List<Map<String, Object>> hosts = (List<Map<String, Object>>) this.vnet.get(Host.DB_KEY);
		if (hosts != null) {
			for (Map<String, Object> host: hosts) {
				final long dpid = (Long) host.get(TenantHandler.VDPID);
				final short port = ((Integer) host.get(TenantHandler.VPORT)).shortValue();
				final MACAddress macAddr = MACAddress.valueOf((Long) host.get(TenantHandler.MAC));
				final int hostId = (Integer) host.get(TenantHandler.HOST);
				try {
					virtualNetwork.connectHost(dpid, port, macAddr, hostId);
				} catch (IndexOutOfBoundException e) {
					OVXNetworkManager.log.error("Failed to create host {}", hostId);
					continue;
				}
			}
		}

		// Start network
		virtualNetwork.boot();
		this.bootState = true;
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<CrawlItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Text>Kasne, ne javljaju se na telefon, koma.</Text>
  <Rating>0.5</Rating>
  <Source>http://pauza.hr/menu/strossmayer</Source>
</CrawlItem>


text:
package org.apereo.cas.config;

import org.apereo.cas.adaptors.yubikey.YubiKeyCredential;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.util.serialization.ComponentSerializationPlanConfigurer;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * This is {@link YubiKeyComponentSerializationConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 6.0.0
 */
@Configuration(value = "yubikeyComponentSerializationConfiguration", proxyBeanMethods = false)
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class YubiKeyComponentSerializationConfiguration {

    @Bean
    @ConditionalOnMissingBean(name = "yubikeyComponentSerializationPlanConfigurer")
    public ComponentSerializationPlanConfigurer yubikeyComponentSerializationPlanConfigurer() {
        return plan -> plan.registerSerializableClass(YubiKeyCredential.class);
    }
}


text:
package org.tawja.platform.core;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 *
 * @author Jaafar BENNANI-SMIRES
 */
public class Utils {

    private static final String DELIM_START = "${";
    private static final String DELIM_STOP = "}";

    /**
     * <p>
     * This method performs property variable substitution on the specified
     * value. If the specified value contains the syntax
     * <tt>${<prop-name>}</tt>, where <tt><prop-name></tt>
     * refers to either a configuration property or a system property, then the
     * corresponding property value is substituted for the variable placeholder.
     * Multiple variable placeholders may exist in the specified value as well
     * as nested variable placeholders, which are substituted from inner most to
     * outer most. Configuration properties override system properties.
     * </p>
     *
     * @param val The string on which to perform property substitution.
     * @param currentKey The key of the property being evaluated used to detect
     * cycles.
     * @param cycleMap Map of variable references used to detect nested cycles.
     * @param configProps Set of configuration properties.
     * @return The value of the specified string after system property
     * substitution.
     * @throws IllegalArgumentException If there was a syntax error in the
     * property placeholder syntax or a recursive variable reference.
    *
     */
    public static String substVars(String val, String currentKey,
            Map cycleMap, Properties configProps)
            throws IllegalArgumentException {
        // If there is currently no cycle map, then create
        // one for detecting cycles for this invocation.
        if (cycleMap == null) {
            cycleMap = new HashMap();
        }

        // Put the current key in the cycle map.
        cycleMap.put(currentKey, currentKey);

        // Assume we have a value that is something like:
        // "leading ${foo.${bar}} middle ${baz} trailing"
        // Find the first ending '}' variable delimiter, which
        // will correspond to the first deepest nested variable
        // placeholder.
        int stopDelim = -1;
        int startDelim = -1;

        do {
            stopDelim = val.indexOf(DELIM_STOP, stopDelim + 1);
            // If there is no stopping delimiter, then just return
            // the value since there is no variable declared.
            if (stopDelim < 0) {
                return val;
            }
            // Try to find the matching start delimiter by
            // looping until we find a start delimiter that is
            // greater than the stop delimiter we have found.
            startDelim = val.indexOf(DELIM_START);
            // If there is no starting delimiter, then just return
            // the value since there is no variable declared.
            if (startDelim < 0) {
                return val;
            }
            while (stopDelim >= 0) {
                int idx = val.indexOf(DELIM_START, startDelim + DELIM_START.length());
                if ((idx < 0) || (idx > stopDelim)) {
                    break;
                } else if (idx < stopDelim) {
                    startDelim = idx;
                }
            }
        } while ((startDelim > stopDelim) && (stopDelim >= 0));

        // At this point, we have found a variable placeholder so
        // we must perform a variable substitution on it.
        // Using the start and stop delimiter indices, extract
        // the first, deepest nested variable placeholder.
        String variable
                = val.substring(startDelim + DELIM_START.length(), stopDelim);

        // Verify that this is not a recursive variable reference.
        if (cycleMap.get(variable) != null) {
            throw new IllegalArgumentException(
                    "recursive variable reference: " + variable);
        }

        // Get the value of the deepest nested variable placeholder.
        // Try to configuration properties first.
        String substValue = (configProps != null)
                ? configProps.getProperty(variable, null)
                : null;
        if (substValue == null) {
            // Ignore unknown property values.
            substValue = System.getProperty(variable, "");
        }

        // Remove the found variable from the cycle map, since
        // it may appear more than once in the value and we don't
        // want such situations to appear as a recursive reference.
        cycleMap.remove(variable);

        // Append the leading characters, the substituted value of
        // the variable, and the trailing characters to get the new
        // value.
        val = val.substring(0, startDelim)
                + substValue
                + val.substring(stopDelim + DELIM_STOP.length(), val.length());

        // Now perform substitution again, since there could still
        // be substitutions to make.
        val = substVars(val, currentKey, cycleMap, configProps);

        // Return the value.
        return val;
    }

}


text:
<?php

class Icl_Stepper
{

    /**
     * Added dummy element to match number of elements and to cover init action
     * @var array
     */
    protected $_steps = array(NULL);
    /**
     * Current step
     * @var int
     */
    protected $_step;
    /**
     * Next step can be forced with Icl_Stepper::setNextStep()
     * @var <type>
     */
    protected $_nextStep = NULL;

    /**
     * Provide current step here
     * @param int $step
     */
    function __construct($step = 0) {
        if (empty($step)) {
            $step = 0;
        }
        $this->_step = intval($step);
    }

    /**
     * Register steps (function names)
     */
    public function registerSteps() {
        $args = func_get_args();
        $this->_steps = array_merge($this->_steps, $args);
    }

    /**
     * Returns current step
     * @return int
     */
    public function getStep() {
        return $this->_step;
    }

    /**
     * Returns next step
     * @return int
     */
    public function getNextStep() {
        return !is_null($this->_nextStep)? $this->_nextStep : $this->_step += 1;
    }

    /**
     * Sets current step
     * @param int $num
     */
    public function setStep($num) {
        $this->_step = intval($num);
    }

    /**
     * Forcing next step
     * @param int $num
     */
    public function setNextStep($num) {
        $this->_nextStep = intval($num);
    }

    /**
     * Calculates bar width
     * @return int Should be used as percentage width (%)
     */
    public function barWidth() {
        return round(($this->_step*100)/count($this->_steps));
    }

    /**
     * Calls current step's function
     * @return mixed
     */
    public function init() {
        if ($this->_step !== 0 && isset($this->_steps[$this->_step])
                && is_callable($this->_steps[$this->_step])) {
            return call_user_func_array($this->_steps[$this->_step], array($this->_step, $this));
        }
    }

    /**
     * Returns initial HTML formatted screen
     * @param string $message Message to be displayed
     * @return string
     */
    public function render($message = '') {
        $output = '

barWidth() . '%;">

' . $message . '
';
        return $output;
    }

}


text:
from botocore.docs.method import document_model_driven_method
from botocore.docs.waiter import document_wait_method
from botocore.docs.paginator import document_paginate_method
from botocore.docs.bcdoc.restdoc import DocumentStructure

class LazyLoadedDocstring(str):
    """Used for lazily loading docstrings

    You can instantiate this class and assign it to a __doc__ value.
    The docstring will not be generated till accessed via __doc__ or
    help(). Note that all docstring classes **must** subclass from
    this class. It cannot be used directly as a docstring.
    """
    def __init__(self, *args, **kwargs):
        """
        The args and kwargs are the same as the underlying document
        generation function. These just get proxied to the underlying
        function.
        """
        super(LazyLoadedDocstring, self).__init__()
        self._gen_args = args
        self._gen_kwargs = kwargs
        self._docstring = None

    def __new__(cls, *args, **kwargs):
        # Needed in order to sub class from str with args and kwargs
        return super(LazyLoadedDocstring, cls).__new__(cls)

    def _write_docstring(self, *args, **kwargs):
        raise NotImplementedError(
            '_write_docstring is not implemented. Please subclass from '
            'this class and provide your own _write_docstring method'
        )

    def expandtabs(self, tabsize=8):
        """Expands tabs to spaces

        So this is a big hack in order to get lazy loaded docstring work
        for the ``help()``. In the ``help()`` function, ``pydoc`` and
        ``inspect`` are used. At some point the ``inspect.cleandoc``
        method is called. To clean the docs ``expandtabs`` is called
        and that is where we override the method to generate and return the
        docstrings.
        """
        if self._docstring is None:
            self._generate()
        return self._docstring.expandtabs(tabsize)

    def __str__(self):
        return self._generate()

    # __doc__ of target will use either __repr__ or __str__ of this class.
    __repr__ = __str__

    def _generate(self):
        # Generate the docstring if it is not already cached.
        if self._docstring is None:
            self._docstring = self._create_docstring()
        return self._docstring

    def _create_docstring(self):
        docstring_structure = DocumentStructure('docstring', target='html')
        # Call the document method function with the args and kwargs
        # passed to the class.
        self._write_docstring(
            docstring_structure, *self._gen_args,
            **self._gen_kwargs)
        return docstring_structure.flush_structure().decode('utf-8')

class ClientMethodDocstring(LazyLoadedDocstring):
    def _write_docstring(self, *args, **kwargs):
        document_model_driven_method(*args, **kwargs)

class WaiterDocstring(LazyLoadedDocstring):
    def _write_docstring(self, *args, **kwargs):
        document_wait_method(*args, **kwargs)

class PaginatorDocstring(LazyLoadedDocstring):
    def _write_docstring(self, *args, **kwargs):
        document_paginate_method(*args, **kwargs)


text:
package org.apache.druid.storage.azure;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Stores the configuration for writing task logs to Azure .
 */
public class AzureTaskLogsConfig
{
  @JsonProperty
  @NotNull
  private String container = null;

  @JsonProperty
  @NotNull
  private String prefix = null;

  @JsonProperty
  @Min(1)
  private int maxTries = 3;

  public AzureTaskLogsConfig()
  {
  }

  public AzureTaskLogsConfig(String container, String prefix, int maxTries)
  {
    this.container = container;
    this.prefix = prefix;
    this.maxTries = maxTries;
  }

  public String getContainer()
  {
    return container;
  }

  public String getPrefix()
  {
    return prefix;
  }

  public int getMaxTries()
  {
    return maxTries;
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Create_Class_Solution
{
    class Car
    {
        public string make;
        public string model;
        public string color;

        public void Drive()
        {
            Console.WriteLine("Driving");
        }

        public void Stop()
        {
            Console.WriteLine("Stopping");
        }
    }
}


text:
package org.usfirst.frc4579.Robot2017.subsystems;

import org.usfirst.frc4579.Robot2017.Robot;
import com.eagles.sensors.MPU6050_I2C;
import com.eagles.sensors.VL53LOX_I2C;
import org.usfirst.frc4579.instrumentation.DebugTextFile;
import org.usfirst.frc4579.instrumentation.Instrumentation;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 *
 */
public class Measurement extends Subsystem {
	// Put methods for controlling this subsystem
	// here. Call these from Commands.

	private static final double MMtoInches = 0.0393701;      // Millimeters to inches

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    //private final AnalogInput ultrasonic = RobotMap.measurementultrasonic;

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

    private final MPU6050_I2C mpu   = new MPU6050_I2C(MPU6050_I2C.ACCELFULLSCALE.ACCEL2G,
    												  MPU6050_I2C.GYROFULLSCALE.DEGSEC250);
    private final VL53LOX_I2C lidar = new VL53LOX_I2C(true, false, false); // long range mode, normal speed, normal accuracy.

    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    private final double angleToAccelScale = 1.0;

    private double fieldPosX        = 0.0; // X distance in field frame.  Field origin is location of robot at beginning of match.
    private double fieldPosY        = 0.0; // Y distance in field frame.
    private double distanceX        = 0.0; // Robot frame.
    private double distanceY        = 0.0; // Robot frame.
    private double linealDistance   = 0.0;

    private double velocityX        = 0.0; // Robot frame.
    private double velocityY        = 0.0; // Robot frame.

    private double robotAngleRateZ  = 0.0;
    private double robotAngleZ      = 0.0;
    private double robotAngleY      = 0.0;
    private double robotAngleX      = 0.0;

    private double correctedRange   = 0.0;  // Range finder range.

    private double lastTime  = 0.0;

    private boolean firstCall       = true;
    private boolean mpuAvailable    = false;
    private boolean lidarAvailable  = false;
    private boolean lidarContinuous = true;  // True  => lidar makes continous back-to-back measurements.
    										 // False => use lidar in single-shot mode.

    // Create a debug file containing data for this class for post-run
    // analysis.
    DebugTextFile measData = new DebugTextFile(
    		"measData", 															// Base file name.
    		true, 																	// Add time stamp to data.
    		"AccelX\tAccelY\tAccelZ\tVelX\tVelY\tdistX\tdistY\tzAngleRate\tzAngle", // File header.
    		20000);																	// Max anticipated lines in file.

    // Initializes the accelerometer and distance ranging devices.
    public void initialize() {

    	mpuAvailable = mpu.init();

    	lidarAvailable = lidar.init(false);
    	if (lidarAvailable) {
    		lidar.startContinuous(0); // Start back-to-back continuouse measurements.
    	}

    	if (mpuAvailable) {

        	System.out.println("***** MEASUREMENT INITIALIZED" + "\n");

    	}
    	else {
        	System.out.println("***** MPU INIT FAILED *********" + "\n");
    		measData.write("MPU INIT FAILED");
    	}

    	reset();

    	SmartDashboard.putBoolean ("MPU Available:", mpuAvailable);

    }

    public void stopSensors () {

    	if (lidarAvailable) {
    		lidar.stopContinuous();
    	}
    }

    // Resets the robot's current kinematic data.  All new kinematic computations
    // will be relative to the position of the robot at the time of this call.
    public void reset() {
    	velocityX        = 0.0;
        velocityY        = 0.0;
        distanceX        = 0.0;
        distanceY        = 0.0;
        robotAngleZ      = 0.0;
        robotAngleRateZ  = 0.0;
        robotAngleZ      = 0.0;
        robotAngleY      = 0.0;
        robotAngleX      = 0.0;
    }

    // Returns true if the distance measuring device is working.
    public boolean distanceAvailable() {
    	return lidarAvailable;
    }

    // Returns true if the accelerometer is working.
    public boolean positionAvailable() {
    	return mpuAvailable;
    }

    // Compute accelerometer and range data.
    public void measure() {

    	if (mpuAvailable) {

    		// Compute change in time since last computations.
    		double time   = Instrumentation.timeNow();
    		if (firstCall) {
    			lastTime = time;
    			firstCall = false;
    		}
    		double deltaT = time - lastTime;

    		lastTime = time;

    		// Get latest accelerometer data.
    		mpu.read(Robot.driveTrain.isNotMoving(), time);

    		double accelerationX  = mpu.getAccelX();
    		double accelerationY  = mpu.getAccelY();
    		double accelerationZ  = mpu.getAccelZ();

    		velocityX += accelerationX * deltaT;
    		velocityY += accelerationY * deltaT;

    		// Compute new distance vector.
    		double dX = velocityX * deltaT;
    		distanceX += dX;
    		double dY = velocityY * deltaT;
    		distanceY += dY;

    		linealDistance += Math.sqrt((dX * dX) + (dY * dY));

    		// Compute new angular data.
    		robotAngleRateZ = mpu.getGyroRateZ();
    		robotAngleZ    += robotAngleRateZ * deltaT;
    		double angleRateY = mpu.getGyroRateY();
    		robotAngleY    += angleRateY * deltaT;
    		double angleRateX = mpu.getGyroRateX();
    		robotAngleX    += angleRateX * deltaT;

    		// Compute the relative motion to absolute field coordinates.
        	fieldPosX += dX * Math.sin(Math.toRadians(robotAngleZ));
        	fieldPosY += dY * Math.sin(Math.toRadians(robotAngleZ));

    		// Display the data.
    		SmartDashboard.putString ("Field Pos X:", String.format("%7.1f", distanceX));
    		SmartDashboard.putString ("Field Pos Y:", String.format("%7.1f", distanceY));
    		SmartDashboard.putString ("Distance X:" , String.format("%7.1f", distanceX));
    		SmartDashboard.putString ("Distance Y:" , String.format("%7.1f", distanceY));
    		SmartDashboard.putString ("Velocity X:" , String.format("%7.2f", velocityX));
    		SmartDashboard.putString ("Velocity Y:" , String.format("%7.2f", velocityY));
    		SmartDashboard.putString ("Angle Z:"    , String.format("%7.1f", robotAngleZ));
    		SmartDashboard.putString ("Angle Y:"    , String.format("%7.1f", robotAngleY));
    		SmartDashboard.putString ("Angle X:"    , String.format("%7.1f", robotAngleX));
    		SmartDashboard.putString ("Total Lineal Distance:", String.format("%7.1f", linealDistance));

    		measData.write( accelerationX + "\t" + accelerationY  + "\t" + accelerationZ + "\t" +
    						velocityX + "\t" + velocityY + "\t" +
    						distanceX + "\t" + distanceY + "\t" + robotAngleRateZ + "\t" + robotAngleZ);

    	}

/*    	if (lidarAvailable) {

    		double range;

    		if (lidarContinuous)
    			range = lidar.readRangeContinuousMillimeters();
    		else
    		    range = (double)lidar.readRangeSingleMillimeters();
    		range *= MMtoInches;
    	    correctedRange = 1.125 * range;
    		SmartDashboard.putString ("VL53LOX Rng:", String.format("%7.1f", range));
    		SmartDashboard.putString ("VL53LOX Corrected Rng:", String.format("%7.1f", correctedRange));
    	}
    	else
    		correctedRange = 0.0;*/

    }

/*    // Returns the X displacement from starting location in inches.
    public double getFieldPositionX() {
    	return fieldPosX;
    }

    public double getDistanceX() {
    	return distanceX;
    }

    // Returns the Y displacement from starting location in inches.
    public double getFieldPositionY() {
    	return fieldPosY;
    }

    public double getDistanceY() {
    	return distanceY;
    }

    // X component of velocity vector in inches/sec.
    public double getVelocityX() {
    	return velocityX;
    }

    // Y component of velocity vector in inches/sec.
    public double getVelocityY() {
    	return velocityY;
    }
    */

    // Returns the robot angular displacement from its original placement (in degrees).
    public double getAngle() {
    	return robotAngleZ;
    }

    // Returns the robot angular rate (in degrees/sec).
    public double getAngleRate() {
    	return robotAngleRateZ;
    }

    // Returns the current range from a detected object (in inches).
    public double getRange() {
    	return correctedRange;
    }

	public void initDefaultCommand() {
		// Set the default command for a subsystem here.
		// setDefaultCommand(new MySpecialCommand());
	}
}