text:
using System;
using System.Collections;
using System.Collections.Generic;
using NHibernate.Criterion;

namespace Cuyahoga.Core.DataAccess
{
	/// <summary>
	/// Functionality for common simple data access.
	/// </summary>
	public interface ICommonDao
	{
		/// <summary>
		/// Get a single instance from the database by type and primary key.
		/// </summary>
		/// <param name="type"></param>
		/// <param name="id"></param>
		/// <returns></returns>
		object GetObjectById(Type type, int id);

		/// <summary>
		/// Get a single instance from the database by type and primary key. Optionally indicate if the
		/// object may be null when it is not found.
		/// </summary>
		/// <param name="type"></param>
		/// <param name="id"></param>
		/// <param name="allowNull"></param>
		/// <returns></returns>
		object GetObjectById(Type type, int id, bool allowNull);

		/// <summary>
		/// Get a single instance from the database by type and primary key.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="id"></param>
		/// <returns>The requested object of type T or null when not found.</returns>
		T GetObjectById<T>(int id);

		/// <summary>
		/// Get a single instance from the database by type and a string description of a given property.
		/// </summary>
		/// <param name="type"></param>
		/// <param name="propertyName"></param>
		/// <param name="description"></param>
		/// <returns></returns>
		object GetObjectByDescription(Type type, string propertyName, string description);

		/// <summary>
		/// Get all objects of a given type.
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		IList GetAll(Type type);

		/// <summary>
		/// Get all objects of T.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <returns></returns>
		IList<T> GetAll<T>();

		/// <summary>
		/// Get all objects of a given type sorted on the given properties (ascending).
		/// </summary>
		/// <param name="type"></param>
		/// <param name="sortProperties"></param>
		/// <returns></returns>
		IList GetAll(Type type, params string[] sortProperties);

		/// <summary>
		/// Get all objects of T sorted on the given properties (ascending).
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="sortProperties"></param>
		/// <returns></returns>
		IList<T> GetAll<T>(params string[] sortProperties);

		/// <summary>
		/// Get all objects of T that match the given criteria.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="criteria">NHibernate DetachedCriteria instance.</param>
		/// <returns></returns>
		/// <remarks>
		/// Be careful to not use this one from the UI layer beacuse it ties the UI to NHibernate.
		/// </remarks>
		IList<T> GetAllByCriteria<T>(DetachedCriteria criteria);

		/// <summary>
		/// Get all objects of T for the given id's.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="ids"></param>
		/// <returns></returns>
		IList<T> GetByIds<T>(int[] ids);

		/// <summary>
		/// Save or update a given object in the database.
		/// </summary>
		/// <param name="obj"></param>
		void SaveOrUpdateObject(object obj);

        /// <summary>
        /// Explicit update
        /// </summary>
        /// <param name="obj"></param>
        void UpdateObject(object obj);

        /// <summary>
        /// Explicit save
        /// </summary>
        /// <param name="obj"></param>
        void SaveObject(object obj);

		/// <summary>
		/// Delete a given object from the database;
		/// </summary>
		/// <param name="obj"></param>
		void DeleteObject(object obj);

		/// <summary>
		/// Mark a given object for deletion but don't delete it (yet) from the database.
		/// </summary>
		/// <param name="obj"></param>
		void MarkForDeletion(object obj);

		/// <summary>
		/// Remove a collection from the second level cache.
		/// </summary>
		/// <param name="roleName"></param>
		void RemoveCollectionFromCache(string roleName);

		/// <summary>
		/// Remove a collection from the second level cache.
		/// </summary>
		/// <param name="roleName">The fully qualified name of the collection (e.g. Cuyahoga.Core.Domain.Node.ChildNodes).</param>
		/// <param name="id">The id of the object that has the collection.</param>
		void RemoveCollectionFromCache(string roleName, int id);

		/// <summary>
		/// Remove a query from the second level query cache.
		/// </summary>
		/// <param name="cacheRegion">The name of the cached query to remove</param>
		void RemoveQueryFromCache(string cacheRegion);

		/// <summary>
		/// Writes all updates in the current unit of work to the database.
		/// </summary>
		void Flush();
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Tomasellia paraguayana Malme

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
void resampler_init(void);

void * resampler_create(void);
void resampler_delete(void *);
void * resampler_dup(const void *);
void resampler_dup_inplace(void *, const void *);

enum
{
    RESAMPLER_QUALITY_MIN = 0,
    RESAMPLER_QUALITY_ZOH = 0,
    RESAMPLER_QUALITY_BLEP = 1,
    RESAMPLER_QUALITY_LINEAR = 2,
    RESAMPLER_QUALITY_BLAM = 3,
    RESAMPLER_QUALITY_CUBIC = 4,
    RESAMPLER_QUALITY_SINC = 5,
    RESAMPLER_QUALITY_MAX = 5
};

void resampler_set_quality(void *, int quality);

int resampler_get_free_count(void *);
void resampler_write_sample(void *, short sample);
void resampler_write_sample_fixed(void *, int sample, unsigned char depth);
void resampler_set_rate( void *, double new_factor );
int resampler_ready(void *);
void resampler_clear(void *);
int resampler_get_sample_count(void *);
int resampler_get_sample(void *);
float resampler_get_sample_float(void *);
void resampler_remove_sample(void *, int decay);

#endif


text:
//
//  PMTweenUnit.h
//  PMTween
//
//  Created by Brett Walker on 3/29/14.
//  Copyright (c) 2014-2016 Poet & Mountain, LLC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PMTweening.h"
#import "PMTweenEasing.h"
#import "PMTweenTempo.h"
#import "PMTweenObjectUpdater.h"

/**
 *  PMTweenUnit handles a single tween operation on an NSValue property, interpolating between specified starting and ending values.
 */

@interface PMTweenUnit : NSObject <PMTweening, PMTweenTempoDelegate> {
    @protected
    BOOL _reversing;
    NSObject *_targetProperty;
    NSObject *_targetObject;
    NSString *_propertyKeyPath;
    PMTweenTempo *_tempo;
}

///-------------------------------------
/// @name Creating an Instance
///-------------------------------------

/**
 *  Initializes a new PMTweenUnit object, passing in a property and values for the tween operation.
 *
 *  @param property      An NSValue property to be tweened. Supported properties include several NSValue-encoded structs such as NSNumber, CGPoint, CGSize, CGRect, CGAffineTransform, and CATransform3D.
 *  @param startingValue The property's starting value for the tween operation.
 *  @param endingValue   The property's ending value for the tween operation.
 *  @param duration      The duration of the tween.
 *  @param options       A bitmask of `PMTweenOptions` configuration values. Defaults to `PMTweenOptionNone`.
 *  @param easingBlock   An optional `PMTweenEasingBlock` block which performs easing calculations.
 *
 *  @return A new instance of this class.
 *
 *  @remarks If you need to tween an NSValue directly, without needing to update an object such as a UIView instance, using this method is adequate.
 *
 *  @see initWithObject:propertyKeyPath:startingValue:endingValue:duration:options:easingBlock:
 */
- (instancetype)initWithProperty:(NSValue *)property
         startingValue:(double)startingValue
           endingValue:(double)endingValue
              duration:(NSTimeInterval)duration
               options:(PMTweenOptions)options
           easingBlock:(PMTweenEasingBlock)easingBlock;

/**
 *  Initalizes a new PMTweenUnit object, passing in a target object, its property, and values for the tween operation.
 *
 *  @param object           An object whose property should be tweened.
 *  @param propertyKeyPath  A string keyPath that points to a NSValue property of the target object to be tweened. Supported properties include several NSValue-encoded structs such as NSNumber, CGPoint, CGSize, CGRect, CGAffineTransform, and CATransform3D.
 *  @param startingValue    The property's starting value for the tween operation.
 *  @param endingValue      The property's ending value for the tween operation.
 *  @param duration         The duration of the tween.
 *  @param options          A bitmask of `PMTweenOptions` configuration values. Defaults to `PMTweenOptionNone`.
 *  @param easingBlock      An optional `PMTweenEasingBlock` block which performs easing calculations.
 *
 *  @return A new instance of this class.
 *
 *  @remarks If you need to update the property of an object such as a UIView, use this method. PMTweenUnit will handle updating the object's property automatically if you have provided a valid keyPath to the property. For a keyPath to be valid, all objects or NSValue types must be supported. By supplying a custom class to `structValueUpdater`, you can handle structs that PMTweenUnit doesn't support by default.
 *
 *  @see initWithProperty:startingValue:endingValue:duration:options:easingBlock:, structValueUpdater
 */
- (instancetype)initWithObject:(NSObject *)object
     propertyKeyPath:(NSString *)propertyKeyPath
       startingValue:(double)startingValue
         endingValue:(double)endingValue
            duration:(NSTimeInterval)duration
             options:(PMTweenOptions)options
         easingBlock:(PMTweenEasingBlock)easingBlock;

///-------------------------------------
/// @name Setting Up a Tween
///-------------------------------------

/**
 *  The delay, in seconds, before a tween operation begins.
 *
 *  @warning Setting this parameter after a tween operation has begun has no effect.
 */
@property (nonatomic, assign) NSTimeInterval delay;

/**
 *  The duration of a tween operation, in seconds. (read-only)
 *
 *  @remarks If `reversing` is set to `YES`, the duration of a total tween cycle will be twice this amount as there will be two separate tween operations (forwards and back).
 *
 *  @warning Do not set this parameter while a tween operation is in progress.
 */
@property (nonatomic, assign) NSTimeInterval duration;

/**
 *  A Boolean which determines whether a tween operation should repeat.
 *
 *  @remarks When set to `YES`, the tween operation repeats for the number of times specified by the `numberOfRepeats` property. The default value is `NO`.
 *
 *  @see numberOfRepeats
 */
@property (nonatomic, assign) BOOL repeating;

/**
 *  The number of tween cycle operations to repeat.
 *
 *  @remarks This property is only used when `repeating` is set to `YES`. The default value is 0.
 *
 *  @see repeating
 */
@property (nonatomic, assign) NSUInteger numberOfRepeats;

/**
 *  A Boolean which determines whether this tween should change its property value additively. Additive animation allows multiple tweens to produce a compound effect, instead of overwriting each other as they update the same property. Additive animation is now the default behavior for tweening animations in iOS 8, and is great for making user interface animations fluid and responsive.
 *
 *  @remarks The `startingValue` property is ignored for additive animations, and will instead combine with the current value of the property being tweened. Please be aware that because of the composite nature of additive animations, values can temporarily tween past the specified endingValue. This can have unintended consequences if the property you are tweening is clamped to a limited range of values. Also note that additive animations may not work well with complex tweens using sequences, reversing, or repeating, and will not work with other tweens that are not using the additive mode. Because of these caveats, the default value is NO.
 *
 */
@property (nonatomic, assign) BOOL additive;

/**
 *  An object conforming to the `PMTweenObjectUpdating` protocol which handles the updating of properties on objects and structs.
 *
 *  @remarks By default, PMTweenUnit will assign an instance of `PMTweenObjectUpdater` to this property, but you can override this with your own custom classes if, for instance, you need to tween a value in an object or struct which `PMTweenObjectUpdater` doesn't handle.
 */
@property (nonatomic, strong) NSObject <PMTweenObjectUpdating> *structValueUpdater;

///-------------------------------------
/// @name Easing Blocks
///-------------------------------------

/**
 *  A `PMTweenEasingBlock` block which performs easing calculations for the tweening operation.
 *
 *  @see reverseEasingBlock
 */
@property (nonatomic, copy) PMTweenEasingBlock easingBlock;

/**
 *  An optional `PMTweenEasingBlock` block which performs easing calculations for the tweening operation while reversing.
 *
 *  @remarks If not defined, the easing block defined by the `easingBlock` property is used during reversing tweens.
 *
 *  @see easingBlock
 */
@property (nonatomic, copy) PMTweenEasingBlock reverseEasingBlock;

///-------------------------------------
/// @name Tween State
///-------------------------------------

/**
 *  The property to be tweened.
 */
@property (readonly, nonatomic, strong) NSObject *targetProperty;

/**
 * The target object whose property should be tweened, applicable if this instance was initiated with the initWithProperty:... method.
 */
@property (readonly, nonatomic, strong) NSObject *targetObject;

/**
  * Key path for property on target. Only used when class is created with initWithObject.
  */
@property (readonly, nonatomic, copy) NSString *propertyKeyPath;

/**
 *  An operation ID is assigned to a PMTweenUnit when it is tweening an object's property (via initWithObject...) and its tween operation is currently in progress. (read-only)
 *
 *  @remarks This value returns 0 if no ID is currently assigned.
 */
@property (readonly, nonatomic, assign) NSUInteger operationID;

/**
 *  A `PMTweenState` enum which represents the current state of the tween operation. (read-only)
 */
@property (readonly, nonatomic, assign) PMTweenState tweenState;

/**
 *  A `PMTweenDirection` enum which represents the current direction of the tween operation. (read-only)
 */
@property (readonly, nonatomic, assign) PMTweenDirection tweenDirection;

/**
 *  The starting value of the tween operation.
 *
 *  @remarks Note that for non-numeric properties like structs this may affect multiple values, such as the x and y properties of CGPoint.
 *
 *  @see currentValue, endingvalue
 */
@property (nonatomic, assign) double startingValue;

/**
 *  The current value of the tween operation. (read-only)
 *
 *  @remarks Note that for non-numeric properties like structs this may affect multiple values, such as the x and y properties of CGPoint.
 *
 *  @see startingValue, endingvalue
 */
@property (readonly, nonatomic, assign) double currentValue;

/**
 *  The ending value of the tween operation.
 *
 *  @remarks Note that for non-numeric properties like structs this may affect multiple values, such as the x and y properties of CGPoint.
 */
@property (nonatomic, assign) double endingValue;

/**
 *  A float value between 0.0 and 1.0, which represents the current progress of a tween operation between two values. (read-only)
 */
@property (readonly, nonatomic, assign) CGFloat tweenProgress;

/**
 *  A float value between 0.0 and 1.0, which represents the current progress of a tween cycle. (read-only)
 *
 *  @remarks This progress could represent one tween or two, depending on whether `reversing` is set to `YES`.
 */
@property (readonly, nonatomic, assign) CGFloat cycleProgress;

/**
 *  The amount of completed tween cycles. (read-only)
 *
 * @remarks A cycle represents the total length of tweening operation. If `reversing` is set to `YES`, a cycle comprises two separate tweens; otherwise a cycle is the length of one tween.
 */
@property (readonly, nonatomic, assign) NSUInteger cyclesCompletedCount;

///-------------------------------------
/// @name Notification Blocks
///-------------------------------------

/**
 *  This notification block is executed when calling the `startTween` method on this instance causes a tween operation to start.
 *
 *  @see startTween
 */
@property (nonatomic, copy) PMTweenDidStartBlock startBlock;

/**
 *  This notification block is executed when calling the `stopTween` method on this instance causes a tween operation to stop.
 *
 *  @see stopTween
 */
@property (nonatomic, copy) PMTweenDidStopBlock stopBlock;

/**
 *  This notification block is executed when the `updateWithTimeInterval:currentTime:` method is called on this instance while this instance's `tweenState` is `PMTweenStateTweening`.
 *
 *  @see updateWithTimeInterval:currentTime:
 */
@property (nonatomic, copy) PMTweenDidUpdateBlock updateBlock;

/**
 *  This notification block is executed when a tween cycle has repeated.
 *
 *  @see repeating, cyclesCompletedCount
 */
@property (nonatomic, copy) PMTweenDidRepeatBlock repeatCycleBlock;

/**
 *  This notification block is executed when this instance's `tweenDirection` property changes to `PMTweenDirectionReverse`.
 *
 *  @see tweenDirection, reversing
 */
@property (nonatomic, copy) PMTweenDidReverseBlock reverseBlock;

/**
 *  This notification block is executed when calling the `pauseTween` method on this instance causes a tween operation to pause.
 *
 *  @see pauseTween
 */
@property (nonatomic, copy) PMTweenDidPauseBlock pauseBlock;

/**
 *  This notification block is executed when calling the `resumeTween` method on this instance causes a tween operation to resume.
 *
 *  @see resumeTween
 */
@property (nonatomic, copy) PMTweenDidResumeBlock resumeBlock;

/**
 *  This notification block is executed when a tween operation has completed (or when all tween cycles have completed, if `repeating` is set to `YES`).
 */
@property (nonatomic, copy) PMTweenDidCompleteBlock completeBlock;

@end


text:
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: ComVisible(false)]
[assembly: AssemblyProduct("Rook")]
[assembly: AssemblyTitle("Rook.Core")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyCopyright("Copyright © 2007-2016 Patrick Lioi")]
[assembly: AssemblyCompany("Patrick Lioi")]
[assembly: AssemblyConfiguration("Debug")]


text:
package tid.utils;

import infonet.javasim.bgp4.comm.IOBGPMessage;

import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class BytesUtils {
	public static int getU8(byte[] buffer, int offset){
		return ((int) buffer[offset] & 0x000000ff);
	}
	/**
	 * Get two byte of a buffer in the offset position
	 * @param buffer
	 * @param offset
	 * @return
	 */
	static public int getU16 (byte[]buffer, int offset)
	{
		int result = 0;
		for (int i = 0; i < 2; i++)
			result = ((result << 8) & 0xff00) + (buffer[offset + i] & 0xff);
		return result;
	}
	/**
	 * Get four byte of a buffer in the offset position
	 * @param buffer
	 * @param offset
	 * @return
	 */
	static public long getU32 (byte[]buffer, int offset)
	{
		long result = 0;
		for (int i = 0; i < 4; i++)
			result = ((result << 8) & 0xffffff00) + (buffer[offset + i] & 0xff);
		return result;
	}

	/**
	 * Turn a short value into two bytes
	 * @param value turned
	 * @return result of change
	 */
	static public byte[] toBytes(short value){
		byte[] result = new byte[2];
		for (int i = 0, j = 7;i<2;i++,j--){
			result[j] = (byte)(value & 255);
			value = (short) (value >> 8);
		}
		return result;
	}

	/**
	 * Turn a int value into four bytes
	 * @param value turned
	 * @return result of change
	 */
	static public byte[] toBytes(int value){
		byte[] result = new byte[4];
		for (int i = 0, j = 3;i<4;i++,j--){

			result[j] = (byte)(value & 255);
			value = value >> 8;
		}
		return result;
	}

	/**
	 * Turn a int value into eight bytes
	 * @param value turned
	 * @return result of change
	 */
	static public byte[] toBytes(long value){
		byte[] result = new byte[8];
		for (int i = 0, j = 7;i<8;i++,j--){
			result[j] = (byte)(value & 255);
			value = value >> 8;
		}
		return result;
	}

	/**
	 * Get ip address from a buffer in the offset position.
	 * @param buffer
	 * @param offset
	 * @param v6 This value say that it's ipv4 or ipv6
	 * @return Ip value in InetAddress format
	 * @throws UnknownHostException
	 */

	public static InetAddress getIp(byte[] buffer, int offset, boolean v6) throws UnknownHostException {
		if (v6)
			return Inet6Address.getByAddress(IOBGPMessage.getBytes(buffer,offset,6));
		return Inet4Address.getByAddress(IOBGPMessage.getBytes(buffer,offset,6));

	}

	/**
	 * Turn a ip into bytes
	 * @param value turned
	 * @return result of change
	 */
	// Este procedimiento no es necesario porque tenemos el getAddress()
	public static byte[] toBytes(InetAddress ip){
		return ip.getAddress();
	}

	/**
	 * Get some bytes from buffer in a possition
	 * @param buffer
	 * @param offset where they are in the buffer
	 * @param length number of bytes that we want take
	 * @return
	 */
	static public byte[] getBytes (byte[]buffer, int offset, int length) {
	     byte[]result = new byte[length];
	     for (int i = 0; i < length; i++)
	       result[i] = buffer[offset + i];
	     return result;
	}

	/**
	 * Copy some bytes into a buffer
	 * @param bufferOrigin From where we copy
	 * @param buffer where we copy
	 * @param offset position in the the buffer where we copy
	 * @param size Number of bytes that we want copy
	 */
	public static void setBytes(byte[] bufferOrigin, byte[]buffer,int offset, int size){
		for (int i = 0; i<size;i++)
			buffer[offset+i] = bufferOrigin[i];

	}
	public static byte[] invBytes(byte[] bytes){
		byte[] temp = new byte[bytes.length];

		for (int i = 0, j = bytes.length-1; i < bytes.length;i++,j--)
			temp[i] = bytes[j];
		return temp;
	}
	public static boolean[] byteToBin(byte[] bytes){
		return byteToBin(bytes,bytes.length*8);
	}
	public static boolean[] byteToBin(byte[] bytes,int size)
	{
		if (size > bytes.length*8)
			throw new Error("Size error");
		boolean[] binary = new boolean[size];
		for (int i = 0; i<size/8;i++)
		{
			for (int j = 0; (j<8) && (i*8+j < size);j++)
			{
				int pos = i*8+j;
				binary[pos] = !((bytes[i] & (1 << j)) == 0);
			}
		}

		return binary;
	}

	public static byte[] binToByte(boolean[] binary) {
		return binToByte(binary,binary.length);
	}
	public static byte[] binToByte(boolean[] binary,int size)
	{
		// TODO comprobar la division entera
		// 8
		int sizeByte = binary.length /8;
		sizeByte = (binary.length % 8 == 0)?sizeByte:sizeByte+1;
		byte[] bytes = new byte[sizeByte];
		for (int i = 0; i<sizeByte;i++)
		{
			for (int j = 0; (j<8) && (i*8+j < size);j++)
			{
				int pos = i*8+j;
				if (binary[pos])
					bytes[i] = (byte)(bytes[i] | (1 << j));
			}
		}

		return bytes;
	}
	public static Object[] arrayCopy(Object[] source, Object[] dest,int posSource, int posDest, int size){
		if(posSource+size >= source.length)
			throw new Error("Size error in source array");
		Object[] temp = new Object[posDest+size];
		for(int i = 0; i < posDest;i++)
			temp[i] = dest[i];
		for(int i = 0; i < size;i++)
			temp[i+posDest] = source[i+posDest];
		dest = temp;
		return dest;
	}
	public static Object[] arrayCopy(Object[] source, Object[] dest,int posSource, int posDest){
		return arrayCopy (source,dest, posSource,posDest,source.length-posSource);
	}
	public static byte[] arrayCopy(byte[] source, byte[] dest,int posSource, int posDest){
		return arrayCopy (source,dest, posSource,posDest,source.length-posSource);
	}

	public static Object[] arrayCopy(Object[] source,int posSource, int size){
		return arrayCopy(source,null,posSource,0,size);
	}
	public static Object[] arrayCopy(Object[]source,int size){
		return arrayCopy(source,null,0,0,size);
	}

	public static Object[] arrayCopy(Object source, Object[] dest,int posDest){
		Object [] array = {source};
		return arrayCopy(array, dest, 0, posDest, 1);

	}
	public static byte[] arrayCopy(byte source, byte[] dest,int posDest){
		byte [] array = {source};
		return arrayCopy(array, dest, 0, posDest, 1);

	}
	public static byte[] arrayCopy(byte[] source, byte[] dest,int posSource, int posDest, int size){
		int arraySize = ((dest != null) && (dest.length) > size+posDest)?dest.length:size+posDest;
		if(arraySize < 0){
			System.out.println("size: "+size);
			System.out.println("posSource: "+posSource);
			System.out.println("posDest: "+posDest);
			System.out.println("Sourcelenth: "+source.length);

			throw new Error("Negative size. size: "+ arraySize);
		}
		if(posSource+size-1 > source.length){
			int temp = posSource + size - 1;
			throw new Error("Size error in source array. source length: "+source.length+". pos+size: "+ temp );
		}
		byte[] temp = new byte[arraySize];
		if (dest != null)
			for(int i = 0; i < dest.length;i++)
				temp[i] = dest[i];
		for(int i = 0; i < size;i++)
			temp[i+posDest] = source[i+posSource];
		return temp;
	}
	public static byte[] arrayCopy(byte[] source,int posSource, int size){
		return arrayCopy(source,null,posSource,0,size);
	}
	public static byte[] arrayCopy(byte[]source,int size){
		return arrayCopy(source,null,0,0,size);
	}
	public static String byteToString(byte[] bytes,int init, int size){
		String cad = "";
		if (size > bytes.length)
			size = bytes.length;
		for (int i = init; i < size;i++){
			if (i< 10)
				cad += i+"   |";
			else if (i< 100)
				cad += i+"  |";
			else if (i< 1000)
				cad += i+" |";
		}
		cad += "\n";
		for (int i = init; i < size;i++){

			if (bytes[i] < -99)
				cad += bytes[i]+"|";
			else if (bytes[i] < -9)
				cad += bytes[i]+" |";
			else if (bytes[i] < 0)
				cad += bytes[i]+"  |";
			else if (bytes[i] < 10)
				cad += bytes[i]+"   |";
			else if (bytes[i] < 100)
				cad += bytes[i]+"  |";
			else if (bytes[i] < 1000)
				cad += bytes[i]+" |";

		}
		return cad;
	}
	public static String byteToString(byte[] bytes){
		return byteToString(bytes,0,bytes.length);
	}
}


text:
'''
Created on Oct 22, 2016

@author: pjmartin
'''
import scipy.ndimage as img
import scipy.misc as misc
import numpy as np
import matplotlib.pyplot as plt
import random as rnd
import os
import DigitStructFile
import sklearn.preprocessing as skproc
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import scale
import cPickle as pkl

# train_loc_root = '/Users/pjmartin/Documents/Udacity/MachineLearningProgram/Project5/udacity-mle-project5/data/train/'
# test_loc_root = '/Users/pjmartin/Documents/Udacity/MachineLearningProgram/Project5/udacity-mle-project5/data/test/'

# Crops a square, but may be skewed if the square goes outside of the top or left axis.
def square_dims(img_dict):
    mintop = np.min(img_dict['top'])
    minleft = np.min(img_dict['left'])
    height = np.max(img_dict['height'])
    width = np.sum(img_dict['width'])
    center_from_left = minleft + np.floor(width / 2.0)
    center_from_top = mintop + np.floor(height / 2.0)
    max_dim = max([height, width]) + 0.1*(max([height, width]))
    new_left = int(max([0, center_from_left - np.floor(max_dim/2.0)]))
    new_top = int(max([0, center_from_top - np.floor(max_dim/2.0)]))
    return [new_top, new_left, int(new_top + max_dim), int(new_left + max_dim)]

# This function extracts and crops the indexed image.
def extract_and_crop(img_loc, img_dict, resize):
    curr_img = img.imread(img_loc + img_dict['name'],mode='L')
    img_squaredims = square_dims(img_dict)
    # bb_top = np.min(img_dict['top'])
    # bb_left = np.min(img_dict['left'])
    # bb_height = np.max(img_dict['height'])
    # bb_twidth = np.sum(img_dict['width'])
    # Add some pixel buffer before cropping.
    # min_top = int( bb_top - 0.1*bb_top )
    # min_left = int( bb_left - 0.1*bb_left )
    # if min_left < 0:
    #     min_left = 0
    # if min_top < 0:
    #     min_top = 0
    # ... a little less on the height
    # total_height = int( bb_height + 0.05*bb_height )
    # total_width = int( bb_twidth + 0.15*bb_twidth )

    curr_img_crop = curr_img[img_squaredims[0]:img_squaredims[2], img_squaredims[1]:img_squaredims[3]]
    # curr_img_crop = curr_img[min_top:min_top+total_height,min_left:min_left+total_width]

    img_rs = misc.imresize(curr_img_crop, (resize,resize))
    return img_rs

# This function takes a digit struct and creates a one hot encoding of the data.
def extract_label(img_dict, encoder, max_len):
    # Build the label data with one hot encoding.
    street_label = np.array(img_dict['label']).astype(int)
    # Replace any instances of 10 with 0 - needed for one-hot encoding.
    street_label[street_label == 10] = 0
    curr_len = np.shape(street_label)[0]
    len_onehot = encoder.fit_transform(curr_len)
    y_onehot = np.concatenate((len_onehot, encoder.fit_transform(street_label.reshape(-1,1))),axis=0)
    # Create the padding for MAX_LENGTH - curr_len
    if max_len - curr_len > 0:
        nodigit_padding = np.array([10 for i in range(max_len-curr_len)])
        padding_onehot = encoder.fit_transform(nodigit_padding.reshape(-1,1))
        y_onehot = np.concatenate((y_onehot, padding_onehot), axis=0)
    return y_onehot

def generate_svhn_dataset(file_loc, n_vals, n_labels, crop_size, max_len):
    # Load from the digitstruct mat file.
    fname = os.path.join(file_loc, "digitStruct.mat")
    digitstruct = DigitStructFile(fname)
    data_len = len(digitstruct.digitStructName)
    X = np.zeros((data_len, crop_size, crop_size))
    y = np.zeros((data_len, n_labels, n_vals))

    invalid_idxs = []
    # Encoder for label generation.
    enc = skproc.OneHotEncoder(n_values=n_vals,sparse=False)
    for i in range(data_len):
        curr_dict = digitstruct.getDigitStructure(i)
        street_num_len = len(np.array(curr_dict['label']))
        if i % 1000 == 0:
            print "Processed through image " + str(i)
        if street_num_len <= 5 and street_num_len > 0:
            # Extract the label
            curr_y = extract_label(curr_dict, enc, max_len)
            curr_X = extract_and_crop(file_loc, curr_dict, crop_size)
            y[i,:,:] = curr_y
            X[i,:,:] = curr_X
        else:
            invalid_idxs.append(i)
            print "Invalid number! Index = " + str(i)
    X = np.delete(X,invalid_idxs,axis=0)
    y = np.delete(y,invalid_idxs,axis=0)
    return { 'data' : X, 'labels' : y }

def pickle_svhn(name, dataset):
    fname = "svhn_" + name + ".pkl"
    svhn_pkl_file = open(fname, 'wb')
    pkl.dump(dataset, svhn_pkl_file, -1)
    svhn_pkl_file.close()

def load_svhn_pkl(fname):
    svhn_pkl_file = open(fname, 'rb')
    loaded_dataset = pkl.load(svhn_pkl_file)
    svhn_pkl_file.close()
    return loaded_dataset

# Invokes the preprocessing algorithms above on training and test data.
def build_data_sets(train_loc_root, test_loc_root):
	test_dataset = generate_svhn_dataset(test_loc_root, 11, 6, 32, 5)
	pickle_svhn("test", test_dataset)
	train_dataset = generate_svhn_dataset(train_loc_root, 11, 6, 32, 5)
	pickle_svhn("train", train_dataset)


text:
<!DOCTYPE html>

	<title>Pension Schombel in Meuro</title>
	<link rel="stylesheet" type="text/css" href="../assets/css/style.css" />
	<link rel="stylesheet" type="text/css" href="../assets/css/font-awesome.min.css" />
	<link href="https://cdn.rawgit.com/sachinchoolur/lightgallery.js/master/dist/css/lightgallery.css" rel="stylesheet">
	<meta name="viewport" content="width=device-width">

Ferienhaus Schombel in Meuro

Willkommen in den Ferienhäusern direkt am Lausitzring

Home

Großes Ferienhaus

Gartenhaus

Anfahrt

Kontakt

Impressum

				Menu

Home

Großes Ferienhaus

Gartenhaus

Anfahrt

Kontakt

Impressum

Gartenhaus

			Das liebevoll gestaltete Gartenhaus befindet sich auf einem separaten Wiesengrundstück.
	Optimal ausgestattet ist es für 2 Personen, Platz zum Schlafen finden aber auch bis zu 4 Personen. Wir bieten ein Doppelbett, 2 Schlafliegen im Wohnbereich, eine Miniküche mit 2 Kochplatten, Kühlschrank, Spüle und Geschirr, einen Ess-Tresen, Kaminofen und ein Bad mit Dusche und WC. Handtücher und Bettwäsche sind selbstverständlich vorhanden.


text:
import { Component, OnInit } from '@angular/core';
import { HighlightDirective } from './region.directives';

@Component({
    moduleId: module.id,
    selector: 'region-details',
    template: require('./region-details.component.html'),
    directives: [HighlightDirective]
})
export class RegionDetailsComponent implements OnInit {
    constructor() { }

    ngOnInit() { }

    goBack(){
        window.history.back();
    }

}


text:
//
//  PSPushPopPressView.m
//  PSPushPopPressView
//
//  Based on BSSPushPopPressView by Blacksmith Software.
//

#import "PSPushPopPressView.h"
#import <QuartzCore/QuartzCore.h>

#define kPSAnimationDuration 0.35f
#define kPSShadowFadeDuration 0.45f
#define kPSAnimationMoveToOriginalPositionDuration 0.5f
#define kPSFullscreenAnimationBounce 20
#define kPSEmbeddedAnimationBounceMultiplier 0.05f

@interface PSPushPopPressView() {
    // internal state variables
    UIView *initialSuperview_;
    BOOL beingDragged_;
    BOOL gesturesEnded_;
    BOOL scaleActive_;
    BOOL wasPinned_;

    CGAffineTransform _previousScaleTransform;
    CGAffineTransform _previousRotateTransform;
    CGAffineTransform _previousPanTransform;

    UIView* _destinationSuperview;
    NSUInteger _destinationSuperviewIndex;

    UIView *_maskView;
}
@property (nonatomic, getter=isBeingDragged) BOOL beingDragged;
@property (nonatomic, getter=isFullscreen) BOOL fullscreen;
- (CGRect)windowBounds;
@end

@implementation PSPushPopPressView

@synthesize pushPopPressViewDelegate;
@synthesize beingDragged = beingDragged_;
@synthesize fullscreen = fullscreen_;
@synthesize initialFrame = initialFrame_;
@synthesize allowSingleTapSwitch = allowSingleTapSwitch_;
@synthesize ignoreStatusBar = ignoreStatusBar_;
@synthesize keepShadow = keepShadow_;

- (void)awakeFromNib
{
    [self setup];
}

- (id)initWithFrame:(CGRect)frame_ {
    if ((self = [super initWithFrame:frame_])) {
        [self setup];
    }

    return self;
}

- (void)setup
{
    self.userInteractionEnabled = YES;
    self.multipleTouchEnabled = YES;
     _isAnimating = NO;
    scaleTransform_ = _previousScaleTransform = CGAffineTransformIdentity;
    rotateTransform_ = _previousRotateTransform = CGAffineTransformIdentity;
    panTransform_ = _previousPanTransform = CGAffineTransformIdentity;

    initialIndex_ = 0;
    allowSingleTapSwitch_ = YES;
    keepShadow_ = YES;

    UIPinchGestureRecognizer* pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchPanRotate:)];
    pinchRecognizer.cancelsTouchesInView = NO;
    pinchRecognizer.delaysTouchesBegan = NO;
    pinchRecognizer.delaysTouchesEnded = NO;
    pinchRecognizer.delegate = self;
    [self addGestureRecognizer: pinchRecognizer];

    UIRotationGestureRecognizer* rotationRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(pinchPanRotate:)];
    rotationRecognizer.cancelsTouchesInView = NO;
    rotationRecognizer.delaysTouchesBegan = NO;
    rotationRecognizer.delaysTouchesEnded = NO;
    rotationRecognizer.delegate = self;
    [self addGestureRecognizer: rotationRecognizer];

    panRecognizer_ = [[UIPanGestureRecognizer alloc] initWithTarget: self action:@selector(pinchPanRotate:)];
    panRecognizer_.cancelsTouchesInView = NO;
    panRecognizer_.delaysTouchesBegan = NO;
    panRecognizer_.delaysTouchesEnded = NO;
    panRecognizer_.delegate = self;
    panRecognizer_.minimumNumberOfTouches = 2;
    panRecognizer_.maximumNumberOfTouches = 2;
    [self addGestureRecognizer:panRecognizer_];

    tapRecognizer_ = [[UITapGestureRecognizer alloc] initWithTarget: self action:@selector(tap:)];
    tapRecognizer_.delegate = self;
    tapRecognizer_.cancelsTouchesInView = NO;
    tapRecognizer_.delaysTouchesBegan = NO;
    tapRecognizer_.delaysTouchesEnded = NO;
    [self addGestureRecognizer:tapRecognizer_];

    doubleTouchRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapped:)];
    doubleTouchRecognizer.delegate = self;
    doubleTouchRecognizer.cancelsTouchesInView = NO;
    doubleTouchRecognizer.delaysTouchesBegan = NO;
    doubleTouchRecognizer.delaysTouchesEnded = NO;
    doubleTouchRecognizer.numberOfTouchesRequired = 2;
    doubleTouchRecognizer.minimumPressDuration = 0.f;
    [self addGestureRecognizer:doubleTouchRecognizer];

    self.layer.shadowRadius = 2.0f;
    self.layer.shadowOffset = CGSizeMake(5.0f, 5.0f);
    self.layer.shadowOpacity = 0.4f;
    self.layer.shadowColor = [UIColor blackColor].CGColor;
    self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
    self.layer.shadowOpacity = 0.0f;

    // manually track rotations and adapt fullscreen
    // needed if we rotate within a fullscreen animation and miss the autorotate event
    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
}

- (void)applicationDidEnterBackground:(NSNotification*)sender
{
    [_maskView removeFromSuperview];
}

- (void)dealloc {
    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    pushPopPressViewDelegate = nil;
}

- (void) setFrame:(CGRect)frame
{
	[super setFrame:frame];

	if(![self.superview isEqual:[self rootView]])
		initialFrame_ = self.frame;
}

- (void)setInitialFrame:(CGRect)initialFrame {
    initialFrame_ = initialFrame;

    // if we're not in fullscreen, re-set frame
    if (!self.isFullscreen) {
        self.frame = initialFrame;
    }
}

- (UIView *)rootView {

    if([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewSuperviewInFullscreen:)]) {
        _destinationSuperview = [self.pushPopPressViewDelegate pushPopPressViewSuperviewInFullscreen:self];
    }

    if([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewSuperviewIndexInFullscreen:)]) {
        _destinationSuperviewIndex = [self.pushPopPressViewDelegate pushPopPressViewSuperviewIndexInFullscreen:self];
    }

    if(_destinationSuperview) {
        return _destinationSuperview;
    }
    else {
        UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController;

        while (topController.presentedViewController) {
            topController = topController.presentedViewController;
        }

        return topController.view;
    }
}

- (CGRect)windowBounds {
    // completely fullscreen
    CGRect windowBounds = [self rootView].bounds;

    if (self.ignoreStatusBar) {
        windowBounds = [UIScreen mainScreen].bounds;
        if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
            windowBounds.size.width = windowBounds.size.height;
            windowBounds.size.height = [UIScreen mainScreen].bounds.size.width;
        }
    }
    return windowBounds;
}

- (CGRect)superviewCorrectedInitialFrame {
    UIView *rootView = [self rootView];
    CGRect superviewCorrectedInitialFrame = [rootView convertRect:initialFrame_ fromView:initialSuperview_];
    return superviewCorrectedInitialFrame;
}

- (BOOL)detachViewToWindow:(BOOL)enable {

    BOOL viewChanged = NO;
    UIView *rootView = [self rootView];

    if (enable && !initialSuperview_) {
		initialIndex_ = [self.superview.subviews indexOfObject:self];
        initialSuperview_ = self.superview;
        CGRect newFrame = [self.superview convertRect:initialFrame_ toView:rootView];

        if(_destinationSuperview) {
            [rootView insertSubview:self atIndex:_destinationSuperviewIndex];
        }
        else {
            [rootView addSubview:self];
        }

        _maskView = [[UIView alloc] initWithFrame:rootView.bounds];
        [rootView insertSubview:_maskView belowSubview:self];

        [self setFrame:newFrame];
        viewChanged = YES;
    }else if(!enable) {
        if (initialSuperview_) {
            [initialSuperview_ insertSubview:self atIndex:initialIndex_];
            viewChanged = YES;
        }
        [self setFrame:initialFrame_];
        initialSuperview_ = nil;

        [_maskView removeFromSuperview];
    }
    return viewChanged;
}

- (void)updateShadowPath {
    self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
}

- (void)applyShadowAnimated:(BOOL)animated {
	if (keepShadow_) return;
    if(animated) {
        CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
        anim.fromValue = [NSNumber numberWithFloat:0.0f];
        anim.toValue = [NSNumber numberWithFloat:1.0f];
        anim.duration = kPSShadowFadeDuration;
        [self.layer addAnimation:anim forKey:@"shadowOpacity"];
    }else {
        [self.layer removeAnimationForKey:@"shadowOpacity"];
    }

    [self updateShadowPath];
    self.layer.shadowOpacity = 1.0f;
}

- (void)removeShadowAnimated:(BOOL)animated {
	if (keepShadow_) return;
    // TODO: sometimes animates crazy, shadowOpacity animation losses shadowPath transform on certain conditions
    // shadow should also use a "lightSource", maybe it's easier to make a completely custom shadow view.
    if (animated) {
        CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
        anim.fromValue = [NSNumber numberWithFloat:1.0f];
        anim.toValue = [NSNumber numberWithFloat:1.0f];
        anim.duration = kPSShadowFadeDuration;
        [self.layer addAnimation:anim forKey:@"shadowOpacity"];
    }else {
        [self.layer removeAnimationForKey:@"shadowOpacity"];
    }

    self.layer.shadowOpacity = 1.0f;
}

- (void)setBeingDragged:(BOOL)newBeingDragged {
    if (newBeingDragged != beingDragged_) {
        beingDragged_ = newBeingDragged;

        if (beingDragged_) {
            [self applyShadowAnimated:YES];
        }else {
            //BOOL animate = !self.isFullscreen && !fullscreenAnimationActive_;
            [self removeShadowAnimated:NO];//TODO: removing this shadow animation fixes the (shadow) problem when coming back from fullscreen, that's a good give-and-take for me. The bool was nice writted but I think something messed up in other parts of the code and the check that creates the bool `animate' are messed up so I fixed that the simple way.
        }
    }
}

- (void)moveViewToOriginalPositionAnimated:(BOOL)animated bounces:(BOOL)bounces {
    CGFloat bounceX = panTransform_.tx * kPSEmbeddedAnimationBounceMultiplier * -1;
    CGFloat bounceY = panTransform_.ty * kPSEmbeddedAnimationBounceMultiplier * -1;

    // switch coordinates of gestureRecognizer in landscape
    if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
        CGFloat tmp = bounceY;
        bounceY = bounceX;
        bounceX = tmp;
    }

    self.fullscreen = NO;

    if ([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewWillAnimateToOriginalFrame:duration:)]) {
        [self.pushPopPressViewDelegate pushPopPressViewWillAnimateToOriginalFrame:self duration:kPSAnimationMoveToOriginalPositionDuration*1.5f];
    }

    [UIView animateWithDuration:animated ? kPSAnimationMoveToOriginalPositionDuration : 0.f delay: 0.0
                        options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction
                     animations:^{
                         // always reset transforms
                         _isAnimating = YES;
                         rotateTransform_ = CGAffineTransformIdentity;
                         panTransform_ = CGAffineTransformIdentity;
                         scaleTransform_ = CGAffineTransformIdentity;
                         self.transform = CGAffineTransformIdentity;

                         CGRect correctedInitialFrame = [self superviewCorrectedInitialFrame];

                         if (bounces) {
                             if (ABS(bounceX) > 0 || ABS(bounceY) > 0) {
                                 CGFloat widthDifference = (self.frame.size.width - correctedInitialFrame.size.width) * 0.05;
                                 CGFloat heightDifference = (self.frame.size.height - correctedInitialFrame.size.height) * 0.05;

                                 CGRect targetFrame = CGRectMake(correctedInitialFrame.origin.x + bounceX + (widthDifference / 2.0), correctedInitialFrame.origin.y + bounceY + (heightDifference / 2.0), correctedInitialFrame.size.width + (widthDifference * -1), correctedInitialFrame.size.height + (heightDifference * -1));
                                 [self setFrame:targetFrame];
                             }else {
                                 // there's reason behind this madness. shadow freaks out when we come from fullscreen, but not if we had transforms.
                                 fullscreenAnimationActive_ = YES;
                                 CGRect targetFrame = CGRectMake(correctedInitialFrame.origin.x + 3, correctedInitialFrame.origin.y + 3, correctedInitialFrame.size.width - 6, correctedInitialFrame.size.height - 6);
                                 //NSLog(@"targetFrame: %@ (superview: %@; initialSuperview: %@)", NSStringFromCGRect(targetFrame), self.superview, self.initialSuperview);
                                 [self setFrame:targetFrame];
                             }
                         }else {
                             [self setFrame:correctedInitialFrame];
                         }
                     }
                     completion: ^(BOOL finished) {
                         //NSLog(@"moveViewToOriginalPositionAnimated [complete] finished:%d, bounces:%d", finished, bounces);
                         fullscreenAnimationActive_ = NO;
                         if (bounces && finished) {
                             [UIView animateWithDuration: kPSAnimationMoveToOriginalPositionDuration/2 delay: 0.0
                                                 options:UIViewAnimationOptionAllowUserInteraction animations: ^{
                                                     CGRect correctedInitialFrame = [self superviewCorrectedInitialFrame];
                                                     [self setFrame:correctedInitialFrame];
                                                 } completion: ^(BOOL finished) {
                                                     if (finished && !self.isBeingDragged) {
                                                         [self detachViewToWindow:NO];
                                                     }
                                                      _isAnimating = NO;
                                                     if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidAnimateToOriginalFrame:)]) {
                                                         [self.pushPopPressViewDelegate pushPopPressViewDidAnimateToOriginalFrame: self];
                                                     }
                                                 }];
                         }else {
                             if (!self.isBeingDragged) {
                                 //[self detachViewToWindow:NO];
                             }
                              _isAnimating = NO;
                             if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidAnimateToOriginalFrame:)]) {
                                 [self.pushPopPressViewDelegate pushPopPressViewDidAnimateToOriginalFrame: self];
                             }
                         }
                     }];
}

- (void)moveToFullscreenAnimated:(BOOL)animated bounces:(BOOL)bounces {
    if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewWillAnimateToFullscreenWindowFrame:duration:)]) {
        [self.pushPopPressViewDelegate pushPopPressViewWillAnimateToFullscreenWindowFrame: self duration: kPSAnimationDuration];
    }

    BOOL viewChanged = [self detachViewToWindow:YES];
    self.fullscreen = YES;

    [UIView animateWithDuration: animated ? kPSAnimationDuration : 0.f delay: 0.0
     // view hierarchy change needs some time propagating, don't use UIViewAnimationOptionBeginFromCurrentState when just changed
                        options:(viewChanged ? 0 : UIViewAnimationOptionBeginFromCurrentState) | UIViewAnimationOptionAllowUserInteraction
                     animations:^{
                         _isAnimating = YES;
                         scaleTransform_ = CGAffineTransformIdentity;
                         rotateTransform_ = CGAffineTransformIdentity;
                         panTransform_ = CGAffineTransformIdentity;
                         self.transform = CGAffineTransformIdentity;
                         CGRect windowBounds = [self windowBounds];
                         if (bounces) {
                             [self setFrame:CGRectMake(windowBounds.origin.x - kPSFullscreenAnimationBounce, windowBounds.origin.y - kPSFullscreenAnimationBounce, windowBounds.size.width + kPSFullscreenAnimationBounce*2, windowBounds.size.height + kPSFullscreenAnimationBounce*2)];
                         }else {
                             [self setFrame:windowBounds];
                         }
                     }
                     completion:^(BOOL finished) {
                         if (bounces && finished) {
                             CGRect windowBounds = [self windowBounds];
                             [self detachViewToWindow:YES];
                             [UIView animateWithDuration:kPSAnimationDuration delay:0.f options:UIViewAnimationOptionAllowUserInteraction animations:^{
                                 [self setFrame:windowBounds];
                             } completion:^(BOOL finished) {
                                 _isAnimating = NO;
                                 if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidAnimateToFullscreenWindowFrame:)]) {
                                     [self.pushPopPressViewDelegate pushPopPressViewDidAnimateToFullscreenWindowFrame: self];
                                 }
                                 anchorPointUpdated = NO;
                             }];
                         }else {
                             _isAnimating = NO;
                             if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidAnimateToFullscreenWindowFrame:)]) {
                                 [self.pushPopPressViewDelegate pushPopPressViewDidAnimateToFullscreenWindowFrame: self];
                             }
                             anchorPointUpdated = NO;
                         }
                     }];
}

- (void)alignViewAnimated:(BOOL)animated bounces:(BOOL)bounces {
    if (self.frame.size.width > [self windowBounds].size.width) {
        [self moveToFullscreenAnimated:animated bounces:bounces];
    } else {
        [self moveViewToOriginalPositionAnimated:animated bounces:bounces];
    }
}

// disrupt gesture recognizer, which continues to receive touch events even as we set minimumNumberOfTouches to two.
- (void)resetGestureRecognizers {
    for(UIGestureRecognizer *aGestRec in [self gestureRecognizers]){
        [aGestRec setEnabled:NO];
        [aGestRec setEnabled:YES];
    }

}

- (void)startedGesture:(UIGestureRecognizer *)gesture {
    [self detachViewToWindow:YES];
    UIPinchGestureRecognizer *pinch = [gesture isKindOfClass:[UIPinchGestureRecognizer class]] ? (UIPinchGestureRecognizer *)gesture : nil;
    gesturesEnded_ = NO;
    if (pinch) {
        scaleActive_ = YES;
    }
}

/*
 When one gesture ends, the whole view manipulation is ended. In case the user also started a pinch and the pinch is still active, we wait for the pinch to finish as we want to check for a fast pinch movement to open the view in fullscreen or not. If no pinch is active, we can end the manipulation as soon as the first gesture ended.
 */
- (void)endedGesture:(UIGestureRecognizer *)gesture {
    if (gesturesEnded_) return;

    UIPinchGestureRecognizer *pinch = [gesture isKindOfClass:[UIPinchGestureRecognizer class]] ? (UIPinchGestureRecognizer *)gesture : nil;
    if (scaleActive_ == YES && pinch == nil) return;

    gesturesEnded_ = YES;
    if (pinch) {
        scaleActive_ = NO;

        BOOL allowsFullScreenZooming = NO;
        if([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewShouldAllowFullScreenZooming:)])
            allowsFullScreenZooming = [self.pushPopPressViewDelegate pushPopPressViewShouldAllowFullScreenZooming:self];

        if(allowsFullScreenZooming && self.isFullscreen)
        {
            BOOL isScaleSmallerThanFullScreen = sqrt(pow(scaleTransform_.a, 2) + pow(scaleTransform_.c, 2)) < 1;
            if(isScaleSmallerThanFullScreen)
            {
                if(wasPinned_)
                {
                    [self moveToFullscreenAnimated:YES bounces:YES];
                    _previousPanTransform = CGAffineTransformIdentity;
                    _previousRotateTransform = CGAffineTransformIdentity;
                    _previousScaleTransform = CGAffineTransformIdentity;
                    wasPinned_ = NO;
                }
                else
                {
                    [self moveViewToOriginalPositionAnimated:YES bounces:YES];
                }
            }
            else
            {
                _previousPanTransform = panTransform_;
                _previousRotateTransform = rotateTransform_;
                _previousScaleTransform = scaleTransform_;
                wasPinned_ = YES;

                CGPoint transformedCenter = CGPointMake(self.center.x + _previousPanTransform.tx, self.center.y + _previousPanTransform.ty);
                if(!CGRectContainsPoint([self rootView].bounds, transformedCenter)) {

                    [self moveToFullscreenAnimated:YES bounces:YES];
                    _previousPanTransform = CGAffineTransformIdentity;
                    _previousRotateTransform = CGAffineTransformIdentity;
                    _previousScaleTransform = CGAffineTransformIdentity;
                    wasPinned_ = NO;
                }
            }
        }
        else
        {
            if (pinch.velocity >= 2.0f) {
                [self moveToFullscreenAnimated:YES bounces:YES];
            } else {
                [self alignViewAnimated:YES bounces:YES];
            }
        }
    } else {
        [self alignViewAnimated:YES bounces:YES];
    }
}

- (void)modifiedGesture:(UIGestureRecognizer *)gesture {
    if ([gesture isKindOfClass:[UIPinchGestureRecognizer class]]) {
        UIPinchGestureRecognizer *pinch = (UIPinchGestureRecognizer *)gesture;
        scaleTransform_ = CGAffineTransformScale(_previousScaleTransform, pinch.scale, pinch.scale);
    }
    else if ([gesture isKindOfClass:[UIRotationGestureRecognizer class]]) {
        UIRotationGestureRecognizer *rotate = (UIRotationGestureRecognizer *)gesture;
        rotateTransform_ = CGAffineTransformRotate(_previousRotateTransform, rotate.rotation);
    }
    else if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) {
        UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)gesture;
        CGPoint translation = [pan translationInView: self.superview];
        panTransform_ = CGAffineTransformTranslate(_previousPanTransform, translation.x, translation.y);
    }

    BOOL shouldDisableTransformations = NO;
    if([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewShouldDisableTransformations:)]) {
        shouldDisableTransformations = [self.pushPopPressViewDelegate pushPopPressViewShouldDisableTransformations:self];
    }

    if(!shouldDisableTransformations)
        self.transform = CGAffineTransformConcat(CGAffineTransformConcat(scaleTransform_, rotateTransform_), panTransform_);
}

// scale and rotation transforms are applied relative to the layer's anchor point
// this method moves a gesture recognizer's view's anchor point between the user's fingers
- (void)adjustAnchorPointForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer {

    if([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewShouldAllowFullScreenZooming:)])
        if([self.pushPopPressViewDelegate pushPopPressViewShouldAllowFullScreenZooming:self]) {
            return;
        }

    if (!anchorPointUpdated) {
        UIView *piece = gestureRecognizer.view;
        CGPoint locationInView = [gestureRecognizer locationInView:piece];
        CGPoint locationInSuperview = [gestureRecognizer locationInView:piece.superview];

        piece.layer.anchorPoint = CGPointMake(locationInView.x / piece.bounds.size.width, locationInView.y / piece.bounds.size.height);
        piece.center = locationInSuperview;
        anchorPointUpdated = YES;
    }
}

- (void)pinchPanRotate:(UIGestureRecognizer *)gesture {

    switch (gesture.state) {
        case UIGestureRecognizerStateBegan: {
            [self adjustAnchorPointForGestureRecognizer:gesture];
            [self startedGesture:gesture];
            break;
        }
        case UIGestureRecognizerStatePossible: {
            break;
        }
        case UIGestureRecognizerStateCancelled: {
            [self endedGesture:gesture];
            anchorPointUpdated = NO;
            break;
        }
        case UIGestureRecognizerStateFailed: {
            anchorPointUpdated = NO;
            break;
        }
        case UIGestureRecognizerStateChanged: {
            [self modifiedGesture:gesture];
            break;
        }
        case UIGestureRecognizerStateEnded: {
            anchorPointUpdated = NO;
            [self endedGesture:gesture];
            break;
        }
    }
}

- (void)doubleTapped:(UITapGestureRecognizer *)gesture {
    switch (gesture.state) {
        case UIGestureRecognizerStateBegan: {
            break;
        }
        case UIGestureRecognizerStatePossible: {
            break;
        }
        case UIGestureRecognizerStateCancelled: {
            self.beingDragged = NO;
            [self resetGestureRecognizers];
            if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidFinishManipulation:)]) {
                [self.pushPopPressViewDelegate pushPopPressViewDidFinishManipulation:self];
            }
            break;
        }
        case UIGestureRecognizerStateFailed: {
            break;
        }
        case UIGestureRecognizerStateChanged: {
            if (NO == self.beingDragged) {
                if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidStartManipulation:)]) {
                    [self.pushPopPressViewDelegate pushPopPressViewDidStartManipulation:self];
                }
            }
            self.beingDragged = YES;
            break;
        }
        case UIGestureRecognizerStateEnded: {
            [self resetGestureRecognizers];
            if (self.beingDragged) {
                if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidFinishManipulation:)]) {
                    [self.pushPopPressViewDelegate pushPopPressViewDidFinishManipulation:self];
                }
            }
            self.beingDragged = NO;
            break;
        }
    }
}

- (void)tap:(UITapGestureRecognizer *)tap {
    if (self.allowSingleTapSwitch) {
        if (tap.state == UIGestureRecognizerStateEnded) {
            if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewDidReceiveTap:)]) {
                [self.pushPopPressViewDelegate pushPopPressViewDidReceiveTap: self];
            }

             if (!self.isFullscreen) {
                if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewShouldAllowTapToAnimateToFullscreenWindowFrame:)]) {
                    if ([self.pushPopPressViewDelegate pushPopPressViewShouldAllowTapToAnimateToFullscreenWindowFrame: self] == NO) return;
                }

                [self moveToFullscreenWindowAnimated:YES];
            } else {

                BOOL didZoomAndPinViewInFullScreen = !CGAffineTransformIsIdentity(CGAffineTransformConcat(_previousPanTransform, CGAffineTransformConcat(_previousRotateTransform, _previousScaleTransform)));
                if(didZoomAndPinViewInFullScreen)
                {
                    [self moveToFullscreenAnimated:YES bounces:YES];
                    _previousPanTransform = CGAffineTransformIdentity;
                    _previousRotateTransform = CGAffineTransformIdentity;
                    _previousScaleTransform = CGAffineTransformIdentity;
                    wasPinned_ = NO;
                    return;
                }

                if ([self.pushPopPressViewDelegate respondsToSelector: @selector(pushPopPressViewShouldAllowTapToAnimateToOriginalFrame:)]) {
                    if ([self.pushPopPressViewDelegate pushPopPressViewShouldAllowTapToAnimateToOriginalFrame: self] == NO) return;
                }

                [self moveToOriginalFrameAnimated:YES];
            }
        }
    }
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
    // if the gesture recognizers's view isn't one of our pieces, don't allow simultaneous recognition
    if (gestureRecognizer.view != self)
        return NO;

    // if the gesture recognizers are on different views, don't allow simultaneous recognition
    if (gestureRecognizer.view != otherGestureRecognizer.view)
        return NO;

    return YES;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
    if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] && [touch.view isKindOfClass: [UIButton class]]) {
        return NO;
    }

    if(_isAnimating) return NO;//Ignore gestures while animating (sceriu 03.04.2013)

    BOOL allowsManipulation = YES;
    if([self.pushPopPressViewDelegate respondsToSelector:@selector(pushPopPressViewShouldAllowManipulation:)])
        allowsManipulation = [self.pushPopPressViewDelegate pushPopPressViewShouldAllowManipulation:self];

    if (![gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] && !allowsManipulation)
        return NO;

    return YES;
}

- (void)moveToFullscreenWindowAnimated:(BOOL)animated bounces:(BOOL)bounces {
    if (self.isFullscreen) return;

    [self moveToFullscreenAnimated:animated bounces:bounces];
}

- (void)moveToOriginalFrameAnimated:(BOOL)animated bounces:(BOOL)bounces {
    if (self.isFullscreen == NO) return;

    [self moveViewToOriginalPositionAnimated:animated bounces:bounces];
}

- (void)moveToFullscreenWindowAnimated:(BOOL)animated {
    if (self.isFullscreen) return;

    [self moveToFullscreenAnimated:animated bounces:YES];
}

- (void)moveToOriginalFrameAnimated:(BOOL)animated {
    if (self.isFullscreen == NO) return;

    [self moveViewToOriginalPositionAnimated:animated bounces:YES];
}

// enable/disable single tap detection
- (void)setAllowSingleTapSwitch:(BOOL)allowSingleTapSwitch {
    if (allowSingleTapSwitch_ != allowSingleTapSwitch) {
        allowSingleTapSwitch_ = allowSingleTapSwitch;
        tapRecognizer_.enabled = allowSingleTapSwitch;
    }
}

@end


text:
package com.amazonaws.services.route53.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * A complex type that contains information about the traffic policy that you want to create a new version for.
 *

 *
 * @see AWS
 *      API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateTrafficPolicyVersionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The ID of the traffic policy for which you want to create a new version.
     *

     */
    private String id;
    /**
     *

     * The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     * CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     *

     */
    private String document;
    /**
     *

     * The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     *

     */
    private String comment;

    /**
     *

     * The ID of the traffic policy for which you want to create a new version.
     *

     *
     * @param id
     *        The ID of the traffic policy for which you want to create a new version.
     */

    public void setId(String id) {
        this.id = id;
    }

    /**
     *

     * The ID of the traffic policy for which you want to create a new version.
     *

     *
     * @return The ID of the traffic policy for which you want to create a new version.
     */

    public String getId() {
        return this.id;
    }

    /**
     *

     * The ID of the traffic policy for which you want to create a new version.
     *

     *
     * @param id
     *        The ID of the traffic policy for which you want to create a new version.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateTrafficPolicyVersionRequest withId(String id) {
        setId(id);
        return this;
    }

    /**
     *

     * The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     * CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     *

     *
     * @param document
     *        The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     *        CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     */

    public void setDocument(String document) {
        this.document = document;
    }

    /**
     *

     * The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     * CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     *

     *
     * @return The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     *         CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     */

    public String getDocument() {
        return this.document;
    }

    /**
     *

     * The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     * CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     *

     *
     * @param document
     *        The definition of this version of the traffic policy, in JSON format. You specified the JSON in the
     *        CreateTrafficPolicyVersion request. For more information about the JSON format, see CreateTrafficPolicy.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateTrafficPolicyVersionRequest withDocument(String document) {
        setDocument(document);
        return this;
    }

    /**
     *

     * The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     *

     *
     * @param comment
     *        The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     */

    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     *

     * The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     *

     *
     * @return The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     */

    public String getComment() {
        return this.comment;
    }

    /**
     *

     * The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     *

     *
     * @param comment
     *        The comment that you specified in the CreateTrafficPolicyVersion request, if any.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateTrafficPolicyVersionRequest withComment(String comment) {
        setComment(comment);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getId() != null)
            sb.append("Id: ").append(getId()).append(",");
        if (getDocument() != null)
            sb.append("Document: ").append(getDocument()).append(",");
        if (getComment() != null)
            sb.append("Comment: ").append(getComment());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CreateTrafficPolicyVersionRequest == false)
            return false;
        CreateTrafficPolicyVersionRequest other = (CreateTrafficPolicyVersionRequest) obj;
        if (other.getId() == null ^ this.getId() == null)
            return false;
        if (other.getId() != null && other.getId().equals(this.getId()) == false)
            return false;
        if (other.getDocument() == null ^ this.getDocument() == null)
            return false;
        if (other.getDocument() != null && other.getDocument().equals(this.getDocument()) == false)
            return false;
        if (other.getComment() == null ^ this.getComment() == null)
            return false;
        if (other.getComment() != null && other.getComment().equals(this.getComment()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
        hashCode = prime * hashCode + ((getDocument() == null) ? 0 : getDocument().hashCode());
        hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode());
        return hashCode;
    }

    @Override
    public CreateTrafficPolicyVersionRequest clone() {
        return (CreateTrafficPolicyVersionRequest) super.clone();
    }

}


text:
require 'spec_helper'

describe Vra::Requests do
  let(:client) do
    Vra::Client.new(username: 'user@corp.local',
                    password: 'password',
                    tenant: 'tenant',
                    base_url: 'https://vra.corp.local')
  end

  let(:requests) { Vra::Requests.new(client) }

  describe '#all_resources' do
    it 'calls the requests API endpoint' do
      expect(client).to receive(:http_get_paginated_array!)
        .with('/catalog-service/api/consumer/requests')
        .and_return([])

      requests.all_requests
    end

    it 'returns an array of request objects' do
      allow(client).to receive(:http_get_paginated_array!)
        .with('/catalog-service/api/consumer/requests')
        .and_return([ { 'id' => '1' }, { 'id' => '2' } ])

      items = requests.all_requests

      expect(items[0]).to be_an_instance_of(Vra::Request)
      expect(items[1]).to be_an_instance_of(Vra::Request)
    end
  end

  describe '#by_id' do
    it 'returns a request object' do
      expect(Vra::Request).to receive(:new).with(client, '12345')

      requests.by_id('12345')
    end
  end
end


text: <!DOCTYPE html>


text:
package Creator;

import javax.swing.ComboBoxModel;
import javax.swing.ListModel;
import javax.swing.event.EventListenerList;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;

public class ListAdapterComboBoxModel implements ComboBoxModel {

    private ListModel dataModel;
    private Object selectedObject;
    private DataModelListDataListenerAdapter listDataListenerAdapter;

    public ListAdapterComboBoxModel(ListModel ListModel) {
        dataModel = ListModel;
        this.listDataListenerAdapter = new DataModelListDataListenerAdapter();
        dataModel.addListDataListener(listDataListenerAdapter);
    }

    public int getSize() {
        return dataModel.getSize();
    }

    public Object getElementAt(int index) {
        return dataModel.getElementAt(index);
    }

    public void addListDataListener(ListDataListener l) {
        listDataListenerAdapter.addListDataListener(l);
    }

    public void removeListDataListener(ListDataListener l) {
        listDataListenerAdapter.removeListDataListener(l);
    }

    public void setSelectedItem(Object anObject) {
        if ((selectedObject != null && !selectedObject.equals(anObject))
                || selectedObject == null && anObject != null) {
            selectedObject = anObject;
            ListDataEvent e = new ListDataEvent(this,
                    ListDataEvent.CONTENTS_CHANGED, -1, -1);
            listDataListenerAdapter.delegateListDataEvent(e);
        }
    }

    public Object getSelectedItem() {
        return selectedObject;
    }

    private class DataModelListDataListenerAdapter implements ListDataListener {

        protected EventListenerList listenerList = new EventListenerList();

        public void removeListDataListener(ListDataListener l) {
            listenerList.remove(ListDataListener.class, l);
        }

        public void addListDataListener(ListDataListener l) {
            listenerList.add(ListDataListener.class, l);

        }

        public void intervalAdded(ListDataEvent e) {
            delegateListDataEvent(e);
        }

        public void intervalRemoved(ListDataEvent e) {
            checkSelection(e);
            delegateListDataEvent(e);
        }

        public void contentsChanged(ListDataEvent e) {
            checkSelection(e);
            delegateListDataEvent(e);
        }

        private void checkSelection(ListDataEvent e) {
            Object selectedItem = getSelectedItem();
            ListModel listModel = (ListModel) e.getSource();
            int size = listModel.getSize();
            boolean selectedItemNoLongerExists = true;
            for (int i = 0; i < size; i++) {
                Object elementAt = listModel.getElementAt(i);
                if (elementAt != null && elementAt.equals(selectedItem)) {
                    selectedItemNoLongerExists = false;
                    break;
                }
            }
            if (selectedItemNoLongerExists) {
                ListAdapterComboBoxModel.this.selectedObject = null;
            }
        }

        protected void delegateListDataEvent(ListDataEvent lde) {
            ListDataListener[] listeners = listenerList
                    .getListeners(ListDataListener.class);
            for (ListDataListener listDataListener : listeners) {
                listDataListener.contentsChanged(lde);
            }
        }

    }

}


text:
#ifndef ANT_STACK_CONFIG_H__
#define ANT_STACK_CONFIG_H__

#include <stdint.h>

/**
 * @file
 */

/**
 * @defgroup ant_stack_config ANT stack configuration
 * @{
 * @ingroup ant_sdk_utils
 * @brief Configuration of resources used in the ANT stack.
 *
 * This module initializes the stack according to the configuration of the ANT channels.
 */

/**
 * @brief   Function for configuring and enabling the ANT stack.
 * @details The function sets the channel configuration for the stack using the parameters provided
 *          in the ant_stack_config_defs.h file. It also assigns a correspondingly large buffer
 *          as static resource.
 *
 * @return A SoftDevice error code.
 */
uint32_t ant_stack_static_config(void);

/**
 * @}
 */

#endif // ANT_STACK_CONFIG_H__


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

namespace NewRelicSharp.Items
{
    [XmlRoot(ElementName = "application_hosts")]
    public class ApplicationHosts
    {
        [XmlElement(ElementName = "application_host")]
        public List<int> Hosts { get; set; }
    }
}


text:
"""Feature scaled kernel."""

import tensorflow.compat.v2 as tf
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import dtype_util
from tensorflow_probability.python.internal import parameter_properties
from tensorflow_probability.python.internal import tensor_util
from tensorflow_probability.python.math.psd_kernels import feature_transformed
from tensorflow_probability.python.math.psd_kernels.internal import util

__all__ = ['FeatureScaled']

# TODO(b/132103412): Support more general scaling via LinearOperator, along with
# scaling all feature dimensions.
class FeatureScaled(feature_transformed.FeatureTransformed):
  """Kernel that first rescales all feature dimensions.

  Given a kernel `k` and `scale_diag` and inputs `x` and `y`, this kernel
  first rescales the input by computing `x / scale_diag` and
  `y / scale_diag`, and passing this to `k`.

  With 1 feature dimension, this is also called Automatic Relevance
  Determination (ARD) [1].

  #### References
  [1]: Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian
       Processes for Machine Learning. Section 5.1 2006.
       http://www.gaussianprocess.org/gpml/chapters/RW5.pdf
  """

  def __init__(
      self,
      kernel,
      scale_diag=None,
      inverse_scale_diag=None,
      validate_args=False,
      name='FeatureScaled'):
    """Construct an FeatureScaled kernel instance.

    Args:
      kernel: `PositiveSemidefiniteKernel` instance. Inputs are rescaled and
        passed in to this kernel. Parameters to `kernel` must be broadcastable
        with `scale_diag`.
      scale_diag: Floating point `Tensor` that controls how sharp or wide the
        kernel shape is. `scale_diag` must have at least `kernel.feature_ndims`
        dimensions, and extra dimensions must be broadcastable with parameters
        of `kernel`. This is a "diagonal" in the sense that if all the feature
        dimensions were flattened, `scale_diag` acts as the inverse of a
        diagonal matrix.
      inverse_scale_diag: Non-negative floating point `Tensor` that is treated
        as `1 / scale_diag`. Only one of `scale_diag` or `inverse_scale_diag`
        should be provided.
        Default value: None
      validate_args: If `True`, parameters are checked for validity despite
        possibly degrading runtime performance
      name: Python `str` name prefixed to Ops created by this class.
    """
    parameters = dict(locals())
    if (scale_diag is None) == (inverse_scale_diag is None):
      raise ValueError(
          'Must specify exactly one of `scale_diag` and `inverse_scale_diag`.')
    with tf.name_scope(name):
      dtype = util.maybe_get_common_dtype(
          [kernel, scale_diag, inverse_scale_diag])
      self._scale_diag = tensor_util.convert_nonref_to_tensor(
          scale_diag, dtype=dtype, name='scale_diag')
      self._inverse_scale_diag = tensor_util.convert_nonref_to_tensor(
          inverse_scale_diag, dtype=dtype, name='inverse_scale_diag')

      def rescale_input(x, feature_ndims, example_ndims):
        """Computes `x / scale_diag`."""
        inverse_scale_diag = self.inverse_scale_diag
        if inverse_scale_diag is None:
          inverse_scale_diag = tf.math.reciprocal(self.scale_diag)
        inverse_scale_diag = tf.convert_to_tensor(inverse_scale_diag)
        inverse_scale_diag = util.pad_shape_with_ones(
            inverse_scale_diag,
            example_ndims,
            # Start before the first feature dimension. We assume scale_diag has
            # at least as many dimensions as feature_ndims.
            start=-(feature_ndims + 1))
        return x * inverse_scale_diag

      super(FeatureScaled, self).__init__(
          kernel,
          transformation_fn=rescale_input,
          validate_args=validate_args,
          name=name,
          parameters=parameters)

  @property
  def scale_diag(self):
    return self._scale_diag

  @property
  def inverse_scale_diag(self):
    return self._inverse_scale_diag

  @classmethod
  def _parameter_properties(cls, dtype):
    from tensorflow_probability.python.bijectors import softplus  # pylint:disable=g-import-not-at-top
    return dict(
        kernel=parameter_properties.BatchedComponentProperties(),
        scale_diag=parameter_properties.ParameterProperties(
            event_ndims=lambda self: self.kernel.feature_ndims,
            default_constraining_bijector_fn=(
                lambda: softplus.Softplus(low=dtype_util.eps(dtype)))),
        inverse_scale_diag=parameter_properties.ParameterProperties(
            event_ndims=lambda self: self.kernel.feature_ndims,
            default_constraining_bijector_fn=softplus.Softplus))

  def _parameter_control_dependencies(self, is_init):
    if not self.validate_args:
      return []
    assertions = []
    if (self._inverse_scale_diag is not None and
        is_init != tensor_util.is_ref(self._inverse_scale_diag)):
      assertions.append(assert_util.assert_non_negative(
          self._inverse_scale_diag,
          message='`inverse_scale_diag` must be non-negative.'))
    if (self._scale_diag is not None and
        is_init != tensor_util.is_ref(self._scale_diag)):
      assertions.append(assert_util.assert_positive(
          self._scale_diag,
          message='`scale_diag` must be positive.'))
    return assertions


text:
'use strict';

/* jshint -W098 */
angular.module('mean.persona').controller('Persona.CrearTipoDocumentoController', function(
    $scope, $state, SGTipoDocumento, SGTipoPersona, toastr){

    $scope.view = {
        tipoDocumento: SGTipoDocumento.$build()
    };

    $scope.combo = {
        tipoPersona: SGTipoPersona.$search().$object
    };
    $scope.combo.selected = {
        tipoPersona: undefined
    };

    $scope.save = function(){
        if ($scope.form.$valid) {
            $scope.view.tipoDocumento.$save().then(
                function(response){
                    toastr.success('Tipo documento creado');
                    $state.go('^.editarTipoDocumento', {id: $scope.view.tipoDocumento.abreviatura});
                },
                function error(err){
                    toastr.error(err.data.message);
                }
            );
        }
    };

});


text:
<?php /* Smarty version Smarty-3.1.21, created on 2016-02-24 10:37:03
         compiled from "/var/www/newscoop/themes/publication_1/theme_1/_tpl/multimedia.tpl" */ ?>
<?php /*%%SmartyHeaderCode:134036666156cdce1fd7e109-74373632%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' =>
  array (
    '00dcb90ae73a0324790292566858002b957459d6' =>
    array (
      0 => '/var/www/newscoop/themes/publication_1/theme_1/_tpl/multimedia.tpl',
      1 => 1455823954,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '134036666156cdce1fd7e109-74373632',
  'function' =>
  array (
  ),
  'variables' =>
  array (
    'multimediacounter' => 0,
    'multimediacountermax' => 0,
    'gimme' => 0,
    'multimediacurrent' => 0,
    'multimediatype' => 0,
    'multimedia' => 0,
    'articleID' => 0,
    'multimediaType' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.21',
  'unifunc' => 'content_56cdce1fee6ec3_71023657',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_56cdce1fee6ec3_71023657')) {function content_56cdce1fee6ec3_71023657($_smarty_tpl) {?><?php if (!is_callable('smarty_block_list_articles')) include '/var/www/newscoop/application/../include/smarty/campsite_plugins/block.list_articles.php';
if (!is_callable('smarty_block_list_article_attachments')) include '/var/www/newscoop/application/../include/smarty/campsite_plugins/block.list_article_attachments.php';
if (!is_callable('smarty_function_uri')) include '/var/www/newscoop/application/../include/smarty/campsite_plugins/function.uri.php';
?>
<?php if (isset($_smarty_tpl->tpl_vars['multimediacounter'])) {$_smarty_tpl->tpl_vars['multimediacounter'] = clone $_smarty_tpl->tpl_vars['multimediacounter'];
$_smarty_tpl->tpl_vars['multimediacounter']->value = 0; $_smarty_tpl->tpl_vars['multimediacounter']->nocache = null; $_smarty_tpl->tpl_vars['multimediacounter']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediacounter'] = new Smarty_variable(0, null, 0);?>
<?php if (isset($_smarty_tpl->tpl_vars['multimediacountermax'])) {$_smarty_tpl->tpl_vars['multimediacountermax'] = clone $_smarty_tpl->tpl_vars['multimediacountermax'];
$_smarty_tpl->tpl_vars['multimediacountermax']->value = 5; $_smarty_tpl->tpl_vars['multimediacountermax']->nocache = null; $_smarty_tpl->tpl_vars['multimediacountermax']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediacountermax'] = new Smarty_variable(5, null, 0);?>
<?php $_smarty_tpl->smarty->_tag_stack[] = array('list_articles', array('length'=>"100",'ignore_issue'=>"true",'ignore_section'=>"true",'order'=>"bypublishdate desc")); $_block_repeat=true; echo smarty_block_list_articles(array('length'=>"100",'ignore_issue'=>"true",'ignore_section'=>"true",'order'=>"bypublishdate desc"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

  <?php if ($_smarty_tpl->tpl_vars['multimediacounter']->value<$_smarty_tpl->tpl_vars['multimediacountermax']->value) {?>

      <?php if (isset($_smarty_tpl->tpl_vars['multimediacurrent'])) {$_smarty_tpl->tpl_vars['multimediacurrent'] = clone $_smarty_tpl->tpl_vars['multimediacurrent'];
$_smarty_tpl->tpl_vars['multimediacurrent']->value = 0; $_smarty_tpl->tpl_vars['multimediacurrent']->nocache = null; $_smarty_tpl->tpl_vars['multimediacurrent']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediacurrent'] = new Smarty_variable(0, null, 0);?>
      <?php  $_smarty_tpl->tpl_vars['slideshow'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['slideshow']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['gimme']->value->article->slideshows; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['slideshow']->key => $_smarty_tpl->tpl_vars['slideshow']->value) {
$_smarty_tpl->tpl_vars['slideshow']->_loop = true;
?>
        <?php if (isset($_smarty_tpl->tpl_vars['multimediacurrent'])) {$_smarty_tpl->tpl_vars['multimediacurrent'] = clone $_smarty_tpl->tpl_vars['multimediacurrent'];
$_smarty_tpl->tpl_vars['multimediacurrent']->value = 1; $_smarty_tpl->tpl_vars['multimediacurrent']->nocache = null; $_smarty_tpl->tpl_vars['multimediacurrent']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediacurrent'] = new Smarty_variable(1, null, 0);?>
        <?php if (isset($_smarty_tpl->tpl_vars['multimediatype'])) {$_smarty_tpl->tpl_vars['multimediatype'] = clone $_smarty_tpl->tpl_vars['multimediatype'];
$_smarty_tpl->tpl_vars['multimediatype']->value = 'slideshow'; $_smarty_tpl->tpl_vars['multimediatype']->nocache = null; $_smarty_tpl->tpl_vars['multimediatype']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediatype'] = new Smarty_variable('slideshow', null, 0);?>
      <?php } ?>
      <?php if ($_smarty_tpl->tpl_vars['gimme']->value->article->has_attachments) {?>
          <?php $_smarty_tpl->smarty->_tag_stack[] = array('list_article_attachments', array()); $_block_repeat=true; echo smarty_block_list_article_attachments(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

              <?php if ($_smarty_tpl->tpl_vars['gimme']->value->attachment->extension=='oga') {?>
                <?php if (isset($_smarty_tpl->tpl_vars['multimediacurrent'])) {$_smarty_tpl->tpl_vars['multimediacurrent'] = clone $_smarty_tpl->tpl_vars['multimediacurrent'];
$_smarty_tpl->tpl_vars['multimediacurrent']->value = 1; $_smarty_tpl->tpl_vars['multimediacurrent']->nocache = null; $_smarty_tpl->tpl_vars['multimediacurrent']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediacurrent'] = new Smarty_variable(1, null, 0);?>
                <?php if (isset($_smarty_tpl->tpl_vars['multimediatype'])) {$_smarty_tpl->tpl_vars['multimediatype'] = clone $_smarty_tpl->tpl_vars['multimediatype'];
$_smarty_tpl->tpl_vars['multimediatype']->value = 'audio'; $_smarty_tpl->tpl_vars['multimediatype']->nocache = null; $_smarty_tpl->tpl_vars['multimediatype']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediatype'] = new Smarty_variable('audio', null, 0);?>
              <?php } elseif ($_smarty_tpl->tpl_vars['gimme']->value->attachment->extension=='ogv'||$_smarty_tpl->tpl_vars['gimme']->value->attachment->extension=='ogg'||$_smarty_tpl->tpl_vars['gimme']->value->attachment->extension=='mp4'||$_smarty_tpl->tpl_vars['gimme']->value->attachment->extension=='webm') {?>
                <?php if (isset($_smarty_tpl->tpl_vars['multimediacurrent'])) {$_smarty_tpl->tpl_vars['multimediacurrent'] = clone $_smarty_tpl->tpl_vars['multimediacurrent'];
$_smarty_tpl->tpl_vars['multimediacurrent']->value = 1; $_smarty_tpl->tpl_vars['multimediacurrent']->nocache = null; $_smarty_tpl->tpl_vars['multimediacurrent']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediacurrent'] = new Smarty_variable(1, null, 0);?>
                <?php if (isset($_smarty_tpl->tpl_vars['multimediatype'])) {$_smarty_tpl->tpl_vars['multimediatype'] = clone $_smarty_tpl->tpl_vars['multimediatype'];
$_smarty_tpl->tpl_vars['multimediatype']->value = 'video'; $_smarty_tpl->tpl_vars['multimediatype']->nocache = null; $_smarty_tpl->tpl_vars['multimediatype']->scope = 0;
} else $_smarty_tpl->tpl_vars['multimediatype'] = new Smarty_variable('video', null, 0);?>
              <?php }?>
          <?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_list_article_attachments(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

      <?php }?>

      <?php if ($_smarty_tpl->tpl_vars['multimediacurrent']->value==1) {?>

        <?php $_smarty_tpl->createLocalArrayVariable('multimedia', null, 0);
$_smarty_tpl->tpl_vars['multimedia']->value[((string)$_smarty_tpl->tpl_vars['gimme']->value->article->number)] = ((string)$_smarty_tpl->tpl_vars['multimediatype']->value);?>

        <?php if (isset($_smarty_tpl->tpl_vars["multimediacounter"])) {$_smarty_tpl->tpl_vars["multimediacounter"] = clone $_smarty_tpl->tpl_vars["multimediacounter"];
$_smarty_tpl->tpl_vars["multimediacounter"]->value = $_smarty_tpl->tpl_vars['multimediacounter']->value+1; $_smarty_tpl->tpl_vars["multimediacounter"]->nocache = null; $_smarty_tpl->tpl_vars["multimediacounter"]->scope = 0;
} else $_smarty_tpl->tpl_vars["multimediacounter"] = new Smarty_variable($_smarty_tpl->tpl_vars['multimediacounter']->value+1, null, 0);?>
      <?php }?>
  <?php }?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_list_articles(array('length'=>"100",'ignore_issue'=>"true",'ignore_section'=>"true",'order'=>"bypublishdate desc"), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

Multimedia

      <?php  $_smarty_tpl->tpl_vars['multimediaType'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['multimediaType']->_loop = false;
 $_smarty_tpl->tpl_vars['articleID'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['multimedia']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['multimediaType']->key => $_smarty_tpl->tpl_vars['multimediaType']->value) {
$_smarty_tpl->tpl_vars['multimediaType']->_loop = true;
 $_smarty_tpl->tpl_vars['articleID']->value = $_smarty_tpl->tpl_vars['multimediaType']->key;
?>

          <?php $_smarty_tpl->smarty->_tag_stack[] = array('list_articles', array('ignore_issue'=>"true",'ignore_section'=>"true",'length'=>"1",'constraints'=>"number is ".((string)$_smarty_tpl->tpl_vars['articleID']->value))); $_block_repeat=true; echo smarty_block_list_articles(array('ignore_issue'=>"true",'ignore_section'=>"true",'length'=>"1",'constraints'=>"number is ".((string)$_smarty_tpl->tpl_vars['articleID']->value)), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

            <?php if ($_smarty_tpl->tpl_vars['multimediaType']->value=="video"||$_smarty_tpl->tpl_vars['multimediaType']->value=='audio') {?>
                <?php $_smarty_tpl->smarty->_tag_stack[] = array('list_article_attachments', array('length'=>"1")); $_block_repeat=true; echo smarty_block_list_article_attachments(array('length'=>"1"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

                    <?php if ($_smarty_tpl->tpl_vars['multimediaType']->value=="audio") {?>

 Audio

                    <?php } elseif ($_smarty_tpl->tpl_vars['multimediaType']->value=="video") {?>

 Video

                    <?php }?>
                <?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_list_article_attachments(array('length'=>"1"), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

            <?php } else { ?>

 Image

                    <?php }?>
              <?php if ($_smarty_tpl->tpl_vars['multimediaType']->value=="video"||$_smarty_tpl->tpl_vars['multimediaType']->value=='audio') {?>
                <?php $_smarty_tpl->smarty->_tag_stack[] = array('list_article_attachments', array('length'=>"1")); $_block_repeat=true; echo smarty_block_list_article_attachments(array('length'=>"1"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

                    <?php if ($_smarty_tpl->tpl_vars['multimediaType']->value=="audio") {?>
                      <a href="<?php echo smarty_function_uri(array('options'=>"article"),$_smarty_tpl);?>
#audioattachment">
                    <?php } elseif ($_smarty_tpl->tpl_vars['multimediaType']->value=="video") {?>
                      <a href="<?php echo smarty_function_uri(array('options'=>"article"),$_smarty_tpl);?>
#videoattachment">
                    <?php }?>
                <?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_list_article_attachments(array('length'=>"1"), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

            <?php } else { ?>
                      <a href="<?php echo smarty_function_uri(array('options'=>"article"),$_smarty_tpl);?>
#imageattachment">
                    <?php }?>

                <?php echo $_smarty_tpl->getSubTemplate ("_tpl/img/img_rectangle.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('where'=>"no"), 0);?>

            <?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_list_articles(array('ignore_issue'=>"true",'ignore_section'=>"true",'length'=>"1",'constraints'=>"number is ".((string)$_smarty_tpl->tpl_vars['articleID']->value)), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

      <?php } ?>

<?php }} ?>


text:
package com.intellij.psi.templateLanguages;

import com.intellij.lang.Commenter;
import com.intellij.lang.Language;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.PsiFile;

import javax.annotation.Nullable;

/**
 * @author Roman.Chernyatchik
 */
public interface MultipleLangCommentProvider {
  ExtensionPointName<MultipleLangCommentProvider> EP_NAME = ExtensionPointName.create("com.intellij.multiLangCommenter");

  @Nullable
  Commenter getLineCommenter(PsiFile file, Editor editor,
                             Language lineStartLanguage, Language lineEndLanguage);

  boolean canProcess(PsiFile file, FileViewProvider viewProvider);
}


text:
package com.braintreegateway;

import com.braintreegateway.util.NodeWrapper;

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

public class SettlementBatchSummary {

    private List<Map<String,String>> records;

    public SettlementBatchSummary(NodeWrapper node) {
        records = new ArrayList<Map<String,String>>();

        for (NodeWrapper record : node.findAll("records/record")) {
            records.add(record.findMap("*"));
        }
    }

    public List<Map<String,String>> getRecords() {
        return records;
    }

}


text: from .helpers import *


text:
require 'minitest/benchmark' if ENV['BENCH']
require 'minitest/autorun'
require 'edboxra'
require 'fake_box'
require 'log_stub'

class TestCase < MiniTest::Unit::TestCase
end


text:
<?php

namespace Imper86\AllegroApi\Rest\Model\AfterSalesServiceConditions;

class ReturnPoliciesResponse extends AbstractAfterSalesServiceConditionsResponse
{
    public function getConditionsArray(): array
    {
        return $this->getRaw()->returnPolicies;
    }

}


text:
@interface ControloriViewController : UIViewController <NSURLConnectionDelegate, NSURLConnectionDataDelegate, UITableViewDataSource, UITableViewDelegate>
- (IBAction)back:(UIButton *)sender;
@property (weak, nonatomic) IBOutlet UITableView *tabel;

@end


text:
var User = require('../models/user');

module.exports = function(id, done){
    User.findById(id, done);
};


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/menu_legend"
        android:icon="@drawable/menu_legend"
        android:title="@string/menu_show_legend">
    </item>

</menu>


text:
package keydbstore

import (
	"os"
	"testing"
	"time"

	"github.com/jinzhu/gorm"
	_ "github.com/lib/pq"
	"github.com/sirupsen/logrus"
	"github.com/stretchr/testify/require"
	"github.com/theupdateframework/notary"
)

func init() {
	// Get the PostgreSQL connection string from an environment variable
	dburl := os.Getenv("DBURL")
	if dburl == "" {
		logrus.Fatal("PostgreSQL environment variable not set")
	}

	for i := 0; i <= 30; i++ {
		gormDB, err := gorm.Open(notary.PostgresBackend, dburl)
		if err == nil {
			err := gormDB.DB().Ping()
			if err == nil {
				break
			}
		}
		if i == 30 {
			logrus.Fatalf("Unable to connect to %s after 60 seconds", dburl)
		}
		time.Sleep(2 * time.Second)
	}

	sqldbSetup = func(t *testing.T) (*SQLKeyDBStore, func()) {
		var cleanup1 = func() {
			gormDB, err := gorm.Open(notary.PostgresBackend, dburl)
			require.NoError(t, err)

			// drop all tables, if they exist
			gormDB.DropTable(&GormPrivateKey{})
		}
		cleanup1()
		dbStore := SetupSQLDB(t, notary.PostgresBackend, dburl)

		require.Equal(t, notary.PostgresBackend, dbStore.Name())

		return dbStore, func() {
			dbStore.db.Close()
			cleanup1()
		}
	}
}