text:
namespace System.ComponentModel.DataAnnotations
{
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = true)]
    [System.ObsoleteAttribute("This attribute is no longer in use and will be ignored if applied.")]
    public sealed partial class AssociationAttribute : System.Attribute
    {
        public AssociationAttribute(string name, string thisKey, string otherKey) { }
        public bool IsForeignKey { get { throw null; } set { } }
        public string Name { get { throw null; } }
        public string OtherKey { get { throw null; } }
        public System.Collections.Generic.IEnumerable<string> OtherKeyMembers { get { throw null; } }
        public string ThisKey { get { throw null; } }
        public System.Collections.Generic.IEnumerable<string> ThisKeyMembers { get { throw null; } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(128), AllowMultiple = false)]
    public partial class CompareAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public CompareAttribute(string otherProperty) { }
        public string OtherProperty { get { throw null; } }
        public string OtherPropertyDisplayName { get { throw null; } }
        public override bool RequiresValidationContext { get { throw null; } }
        public override string FormatErrorMessage(string name) { throw null; }
        protected override System.ComponentModel.DataAnnotations.ValidationResult IsValid(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = true)]
    public sealed partial class ConcurrencyCheckAttribute : System.Attribute
    {
        public ConcurrencyCheckAttribute() { }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public sealed partial class CreditCardAttribute : System.ComponentModel.DataAnnotations.DataTypeAttribute
    {
        public CreditCardAttribute() : base(default(System.ComponentModel.DataAnnotations.DataType)) { }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2500), AllowMultiple = true)]
    public sealed partial class CustomValidationAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public CustomValidationAttribute(System.Type validatorType, string method) { }
        public string Method { get { throw null; } }
        public System.Type ValidatorType { get { throw null; } }
        public override string FormatErrorMessage(string name) { throw null; }
        protected override System.ComponentModel.DataAnnotations.ValidationResult IsValid(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { throw null; }
    }
    public enum DataType
    {
        CreditCard = 14,
        Currency = 6,
        Custom = 0,
        Date = 2,
        DateTime = 1,
        Duration = 4,
        EmailAddress = 10,
        Html = 8,
        ImageUrl = 13,
        MultilineText = 9,
        Password = 11,
        PhoneNumber = 5,
        PostalCode = 15,
        Text = 7,
        Time = 3,
        Upload = 16,
        Url = 12,
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2496), AllowMultiple = false)]
    public partial class DataTypeAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public DataTypeAttribute(System.ComponentModel.DataAnnotations.DataType dataType) { }
        public DataTypeAttribute(string customDataType) { }
        public string CustomDataType { get { throw null; } }
        public System.ComponentModel.DataAnnotations.DataType DataType { get { throw null; } }
        public System.ComponentModel.DataAnnotations.DisplayFormatAttribute DisplayFormat { get { throw null; } protected set { } }
        public virtual string GetDataTypeName() { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
    public sealed partial class DisplayAttribute : System.Attribute
    {
        public DisplayAttribute() { }
        public bool AutoGenerateField { get { throw null; } set { } }
        public bool AutoGenerateFilter { get { throw null; } set { } }
        public string Description { get { throw null; } set { } }
        public string GroupName { get { throw null; } set { } }
        public string Name { get { throw null; } set { } }
        public int Order { get { throw null; } set { } }
        public string Prompt { get { throw null; } set { } }
        public System.Type ResourceType { get { throw null; } set { } }
        public string ShortName { get { throw null; } set { } }
        public System.Nullable<bool> GetAutoGenerateField() { throw null; }
        public System.Nullable<bool> GetAutoGenerateFilter() { throw null; }
        public string GetDescription() { throw null; }
        public string GetGroupName() { throw null; }
        public string GetName() { throw null; }
        public System.Nullable<int> GetOrder() { throw null; }
        public string GetPrompt() { throw null; }
        public string GetShortName() { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(4), Inherited = true, AllowMultiple = false)]
    public partial class DisplayColumnAttribute : System.Attribute
    {
        public DisplayColumnAttribute(string displayColumn) { }
        public DisplayColumnAttribute(string displayColumn, string sortColumn) { }
        public DisplayColumnAttribute(string displayColumn, string sortColumn, bool sortDescending) { }
        public string DisplayColumn { get { throw null; } }
        public string SortColumn { get { throw null; } }
        public bool SortDescending { get { throw null; } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    public partial class DisplayFormatAttribute : System.Attribute
    {
        public DisplayFormatAttribute() { }
        public bool ApplyFormatInEditMode { get { throw null; } set { } }
        public bool ConvertEmptyStringToNull { get { throw null; } set { } }
        public string DataFormatString { get { throw null; } set { } }
        public bool HtmlEncode { get { throw null; } set { } }
        public string NullDisplayText { get { throw null; } set { } }
        public Type NullDisplayTextResourceType { get { throw null; } set { } }
        public string GetNullDisplayText() { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = true)]
    public sealed partial class EditableAttribute : System.Attribute
    {
        public EditableAttribute(bool allowEdit) { }
        public bool AllowEdit { get { throw null; } }
        public bool AllowInitialValue { get { throw null; } set { } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public sealed partial class EmailAddressAttribute : System.ComponentModel.DataAnnotations.DataTypeAttribute
    {
        public EmailAddressAttribute() : base(default(System.ComponentModel.DataAnnotations.DataType)) { }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2496), AllowMultiple = false)]
    public sealed partial class EnumDataTypeAttribute : System.ComponentModel.DataAnnotations.DataTypeAttribute
    {
        public EnumDataTypeAttribute(System.Type enumType) : base(default(System.ComponentModel.DataAnnotations.DataType)) { }
        public System.Type EnumType { get { throw null; } }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public sealed partial class FileExtensionsAttribute : System.ComponentModel.DataAnnotations.DataTypeAttribute
    {
        public FileExtensionsAttribute() : base(default(System.ComponentModel.DataAnnotations.DataType)) { }
        public string Extensions { get { throw null; } set { } }
        public override string FormatErrorMessage(string name) { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    [System.ObsoleteAttribute("This attribute is no longer in use and will be ignored if applied.")]
    public sealed partial class FilterUIHintAttribute : System.Attribute
    {
        public FilterUIHintAttribute(string filterUIHint) { }
        public FilterUIHintAttribute(string filterUIHint, string presentationLayer) { }
        public FilterUIHintAttribute(string filterUIHint, string presentationLayer, params object[] controlParameters) { }
        public System.Collections.Generic.IDictionary<string, object> ControlParameters { get { throw null; } }
        public string FilterUIHint { get { throw null; } }
        public string PresentationLayer { get { throw null; } }
        public override bool Equals(object obj) { throw null; }
        public override int GetHashCode() { throw null; }
    }
    public partial interface IValidatableObject
    {
        System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(System.ComponentModel.DataAnnotations.ValidationContext validationContext);
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = true)]
    public sealed partial class KeyAttribute : System.Attribute
    {
        public KeyAttribute() { }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public partial class MaxLengthAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public MaxLengthAttribute() { }
        public MaxLengthAttribute(int length) { }
        public int Length { get { throw null; } }
        public override string FormatErrorMessage(string name) { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public partial class MinLengthAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public MinLengthAttribute(int length) { }
        public int Length { get { throw null; } }
        public override string FormatErrorMessage(string name) { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public sealed partial class PhoneAttribute : System.ComponentModel.DataAnnotations.DataTypeAttribute
    {
        public PhoneAttribute() : base(default(System.ComponentModel.DataAnnotations.DataType)) { }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public partial class RangeAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public RangeAttribute(double minimum, double maximum) { }
        public RangeAttribute(int minimum, int maximum) { }
        public RangeAttribute(System.Type type, string minimum, string maximum) { }
        public object Maximum { get { throw null; } }
        public object Minimum { get { throw null; } }
        public System.Type OperandType { get { throw null; } }
        public override string FormatErrorMessage(string name) { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public partial class RegularExpressionAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public RegularExpressionAttribute(string pattern) { }
        public int MatchTimeoutInMilliseconds { get { throw null; } set { } }
        public string Pattern { get { throw null; } }
        public override string FormatErrorMessage(string name) { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public partial class RequiredAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public RequiredAttribute() { }
        public bool AllowEmptyStrings { get { throw null; } set { } }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    public partial class ScaffoldColumnAttribute : System.Attribute
    {
        public ScaffoldColumnAttribute(bool scaffold) { }
        public bool Scaffold { get { throw null; } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public partial class StringLengthAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public StringLengthAttribute(int maximumLength) { }
        public int MaximumLength { get { throw null; } }
        public int MinimumLength { get { throw null; } set { } }
        public override string FormatErrorMessage(string name) { throw null; }
        public override bool IsValid(object value) { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = true)]
    public sealed partial class TimestampAttribute : System.Attribute
    {
        public TimestampAttribute() { }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = true)]
    public partial class UIHintAttribute : System.Attribute
    {
        public UIHintAttribute(string uiHint) { }
        public UIHintAttribute(string uiHint, string presentationLayer) { }
        public UIHintAttribute(string uiHint, string presentationLayer, params object[] controlParameters) { }
        public System.Collections.Generic.IDictionary<string, object> ControlParameters { get { throw null; } }
        public string PresentationLayer { get { throw null; } }
        public string UIHint { get { throw null; } }
        public override bool Equals(object obj) { throw null; }
        public override int GetHashCode() { throw null; }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(2432), AllowMultiple = false)]
    public sealed partial class UrlAttribute : System.ComponentModel.DataAnnotations.DataTypeAttribute
    {
        public UrlAttribute() : base(default(System.ComponentModel.DataAnnotations.DataType)) { }
        public override bool IsValid(object value) { throw null; }
    }
    public abstract partial class ValidationAttribute : System.Attribute
    {
        protected ValidationAttribute() { }
        protected ValidationAttribute(System.Func<string> errorMessageAccessor) { }
        protected ValidationAttribute(string errorMessage) { }
        public string ErrorMessage { get { throw null; } set { } }
        public string ErrorMessageResourceName { get { throw null; } set { } }
        public System.Type ErrorMessageResourceType { get { throw null; } set { } }
        protected string ErrorMessageString { get { throw null; } }
        public virtual bool RequiresValidationContext { get { throw null; } }
        public virtual string FormatErrorMessage(string name) { throw null; }
        public System.ComponentModel.DataAnnotations.ValidationResult GetValidationResult(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { throw null; }
        public virtual bool IsValid(object value) { throw null; }
        protected virtual System.ComponentModel.DataAnnotations.ValidationResult IsValid(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { throw null; }
        public void Validate(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { }
        public void Validate(object value, string name) { }
    }
    public sealed partial class ValidationContext : System.IServiceProvider
    {
        public ValidationContext(object instance) { }
        public ValidationContext(object instance, System.Collections.Generic.IDictionary<object, object> items) { }
        public ValidationContext(object instance, System.IServiceProvider serviceProvider, System.Collections.Generic.IDictionary<object, object> items) { }
        public string DisplayName { get { throw null; } set { } }
        public System.Collections.Generic.IDictionary<object, object> Items { get { throw null; } }
        public string MemberName { get { throw null; } set { } }
        public object ObjectInstance { get { throw null; } }
        public System.Type ObjectType { get { throw null; } }
        public object GetService(System.Type serviceType) { throw null; }
        public void InitializeServiceProvider(System.Func<System.Type, object> serviceProvider) { }
    }
    public partial class ValidationException : System.Exception
    {
        public ValidationException() { }
        public ValidationException(System.ComponentModel.DataAnnotations.ValidationResult validationResult, System.ComponentModel.DataAnnotations.ValidationAttribute validatingAttribute, object value) { }
        public ValidationException(string message) { }
        public ValidationException(string errorMessage, System.ComponentModel.DataAnnotations.ValidationAttribute validatingAttribute, object value) { }
        public ValidationException(string message, System.Exception innerException) { }
        protected ValidationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
        public System.ComponentModel.DataAnnotations.ValidationAttribute ValidationAttribute { get { throw null; } }
        public System.ComponentModel.DataAnnotations.ValidationResult ValidationResult { get { throw null; } }
        public object Value { get { throw null; } }
    }
    public partial class ValidationResult
    {
        public static readonly System.ComponentModel.DataAnnotations.ValidationResult Success;
        protected ValidationResult(System.ComponentModel.DataAnnotations.ValidationResult validationResult) { }
        public ValidationResult(string errorMessage) { }
        public ValidationResult(string errorMessage, System.Collections.Generic.IEnumerable<string> memberNames) { }
        public string ErrorMessage { get { throw null; } set { } }
        public System.Collections.Generic.IEnumerable<string> MemberNames { get { throw null; } }
        public override string ToString() { throw null; }
    }
    public static partial class Validator
    {
        public static bool TryValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.ICollection<System.ComponentModel.DataAnnotations.ValidationResult> validationResults) { throw null; }
        public static bool TryValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.ICollection<System.ComponentModel.DataAnnotations.ValidationResult> validationResults, bool validateAllProperties) { throw null; }
        public static bool TryValidateProperty(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.ICollection<System.ComponentModel.DataAnnotations.ValidationResult> validationResults) { throw null; }
        public static bool TryValidateValue(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.ICollection<System.ComponentModel.DataAnnotations.ValidationResult> validationResults, System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationAttribute> validationAttributes) { throw null; }
        public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { }
        public static void ValidateObject(object instance, System.ComponentModel.DataAnnotations.ValidationContext validationContext, bool validateAllProperties) { }
        public static void ValidateProperty(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext) { }
        public static void ValidateValue(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationAttribute> validationAttributes) { }
    }
}
namespace System.ComponentModel.DataAnnotations.Schema
{
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    public partial class ColumnAttribute : System.Attribute
    {
        public ColumnAttribute() { }
        public ColumnAttribute(string name) { }
        public string Name { get { throw null; } }
        public int Order { get { throw null; } set { } }
        public string TypeName { get { throw null; } set { } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(4), AllowMultiple = false)]
    public partial class ComplexTypeAttribute : System.Attribute
    {
        public ComplexTypeAttribute() { }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    public partial class DatabaseGeneratedAttribute : System.Attribute
    {
        public DatabaseGeneratedAttribute(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption databaseGeneratedOption) { }
        public System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption DatabaseGeneratedOption { get { throw null; } }
    }
    public enum DatabaseGeneratedOption
    {
        Computed = 2,
        Identity = 1,
        None = 0,
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    public partial class ForeignKeyAttribute : System.Attribute
    {
        public ForeignKeyAttribute(string name) { }
        public string Name { get { throw null; } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false)]
    public partial class InversePropertyAttribute : System.Attribute
    {
        public InversePropertyAttribute(string property) { }
        public string Property { get { throw null; } }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(388), AllowMultiple = false)]
    public partial class NotMappedAttribute : System.Attribute
    {
        public NotMappedAttribute() { }
    }
    [System.AttributeUsageAttribute((System.AttributeTargets)(4), AllowMultiple = false)]
    public partial class TableAttribute : System.Attribute
    {
        public TableAttribute(string name) { }
        public string Name { get { throw null; } }
        public string Schema { get { throw null; } set { } }
    }
}


text:
package uk.gov.hmrc.ct.accounts.approval.accountsApproval.accountsApproval

import org.scalatest.mock.MockitoSugar
import org.scalatest.{Matchers, WordSpec}
import uk.gov.hmrc.ct.accounts.approval.boxes.AC8091
import uk.gov.hmrc.ct.accounts.{AccountsFreeTextValidationFixture, MockFrs102AccountsRetriever}
import uk.gov.hmrc.ct.accounts.frs102.retriever.{AbridgedAccountsBoxRetriever, Frs102AccountsBoxRetriever}
import uk.gov.hmrc.ct.box.CtValidation

class AC8091Spec extends WordSpec
  with MockitoSugar
  with Matchers
  with MockFrs102AccountsRetriever
  with AccountsFreeTextValidationFixture[Frs102AccountsBoxRetriever] {

  "AC8091 validate" should {
    "return errors when AC8091 is empty" in {
      val mockBoxRetriever = mock[AbridgedAccountsBoxRetriever]

      AC8091(None).validate(mockBoxRetriever) shouldBe Set(CtValidation(Some("AC8091"), "error.AC8091.required"))
    }

    "return errors when AC8091 is false" in {
      val mockBoxRetriever = mock[AbridgedAccountsBoxRetriever]

      AC8091(Some(false)).validate(mockBoxRetriever) shouldBe Set(CtValidation(Some("AC8091"), "error.AC8091.required"))
    }

    "return value when AC8091 is true" in {
      val mockBoxRetriever = mock[AbridgedAccountsBoxRetriever]

      AC8091(Some(true)).value shouldBe Some(true)
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
@interface CarrierPlugin : CDVPlugin {

}

- (void)getCarrierName:(CDVInvokedUrlCommand*)command;
- (void)getCountryCode:(CDVInvokedUrlCommand*)command;

@end


text:
#import "EC2Storage.h"

#ifdef AWS_MULTI_FRAMEWORK
#import <AWSRuntime/AmazonServiceRequestConfig.h>
#else
#import "../AmazonServiceRequestConfig.h"
#endif

/**
 * Bundle Instance Request
 */

@interface EC2BundleInstanceRequest:AmazonServiceRequestConfig

{
    NSString   *instanceId;
    EC2Storage *storage;
}

/**
 * The ID of the instance to bundle.
 */
@property (nonatomic, retain) NSString *instanceId;

/**
 *
 */
@property (nonatomic, retain) EC2Storage *storage;

/**
 * Default constructor for a new BundleInstanceRequest object.  Callers should use the
 * property methods to initialize this object after creating it.
 */
-(id)init;

/**
 * Constructs a new BundleInstanceRequest object.
 * Callers should use properties to initialize any additional object members.
 *
 * @param theInstanceId The ID of the instance to bundle.
 * @param theStorage
 */
-(id)initWithInstanceId:(NSString *)theInstanceId andStorage:(EC2Storage *)theStorage;

/**
 * Returns a string representation of this object; useful for testing and
 * debugging.
 *
 * @return A string representation of this object.
 */
-(NSString *)description;

@end


text:
package org.tinspin.data.hdf5;

/**
 * 0x000C
 * Attribute message.
 *
 * @author Tilmann Zäschke
 *
 */
public class DOMsg000C extends DOMsg {

	//The version number information is used for changes in the format of the
	//attribute message and is described here:
	//Version 	Description
	//0 	Never used.
	//1 	Used by the library before version 1.6 to encode attribute message.
	//      This version does not support shared datatypes.
	int b0Version;

	byte b1Zero;

	//The length of the attribute name in bytes including the null terminator.
	//Note that the Name field below may contain additional padding not
	//represented by this field.
	//Name Size
	int s2NameSize;

	//The length of the datatype description in the Datatype field below.
	//Note that the Datatype field may contain additional padding not
	//represented by this field.
	//Datatype Size
	int s4DatatypeSize;

	//The length of the dataspace description in the Dataspace field below.
	//Note that the Dataspace field may contain additional padding not
	//represented by this field.
	//Dataspace Size
	int s6DataspaceSize;

	//The null-terminated attribute name. This field is padded with additional
	//null characters to make it a multiple of eight bytes.
	//Name
	String name;

	//The datatype description follows the same format as described for the
	//datatype object header message. This field is padded with additional
	//zero bytes to make it a multiple of eight bytes.
	//Datatype
	DOMsg0003 datatype;

	//The dataspace description follows the same format as described for the
	//dataspace object header message. This field is padded with additional
	//zero bytes to make it a multiple of eight bytes.
	//Dataspace
	DOMsg0001 dataspace;

	//The raw data for the attribute. The size is determined from the datatype
	//and dataspace descriptions. This field is not padded with additional bytes.
	//Data
	byte[] data;

	public DOMsg000C(int offset, int version) {
		super(offset, Reader.MSG.MSG_000C_ATTRIBUTE, version);
	}

	@Override
	public String toString() {
		return "000C:AttributeMessage: " + super.toString() + Reader.L +
				"Version=" + b0Version + Reader.L +
				//"Zero=" + b1Zero + Reader.L +
				"NameSize=" + s2NameSize + Reader.L +
				"DatatypeSize=" + s4DatatypeSize + Reader.L +
				"DataspaceSize=" + s6DataspaceSize + Reader.L +
				"Name=" + name +
				Reader.NL + datatype +
				Reader.NL + dataspace;
	}

}


text:
namespace rx {

using namespace std;
using namespace std::chrono;
using std::decay_t;

}

#include "rx_util.h"

/// a subscription represents a managed asynchronous scope
///
/// similar to shared_ptr a subscription provides allocations that are scoped to its lifetime
/// nested scopes are supported by insert(subscription)/erase(subscription)
/// the async scope can be cancelled using stop(), the stop can be handled using insert(void())
/// the async scope can be joined by join()
///
#include "rx_subscription.h"

/// an observer is informed of next, error and complete
/// an observer has a subscription to represent its lifetime
///
/// the observer enforces a contract
///   0 or more next are followed by
///   0 or 1 call to error or complete folowed by
///   lifetime.stop()
///   there will never be overlapping calls to next, error or complete
///
#include "rx_observer.h"

/// a strand will defer a call to an observer to a
/// later time and perhaps a different execution context.
/// a strand provides its own notion of now() to
/// support scenarios where time must be independednt
/// of real-time. (media scrubbing, tests, etc..)
///
/// a strand guarantees FIFO order for items
/// scheduled to start at the same time.
///
#include "rx_strand.h"

/// a context is used to start an async operation
/// it provides the lifetime (subscription) a 'payload'
/// instance bounded by the subscription lifetime and a
/// strand maker that is used to shift execution context.
///
#include "rx_context.h"

/// a subscriber is a function that takes a context and returns an observer
#include "rx_subscriber.h"
/// a starter is a function that takes a context and returns a subscription
#include "rx_starter.h"
/// an observable is a function that takes a subscriber and returns a starter
#include "rx_observable.h"
/// a lifter is a function that takes a subscriber and returns a subscriber
#include "rx_lifter.h"
/// an adaptor is a function that takes an observable and returns an observable
#include "rx_adaptor.h"
/// a terminator is a function that takes an observable and returns a starter
#include "rx_terminator.h"

/// constructs a context to pass to a starter
#include "rx_start.h"
/// constructs a type-forgetter inbetween two types
#include "rx_as_interface.h"
/// joins with the subscription returned from a started operation
#include "rx_join.h"

/// the pipe operator `operator|()` is used to connect the pieces together.
///
/// the order imposed is:
///   observable -> (adaptor|lifter)* -> subscriber -> context -> join
///
/// the pipe operator supports connecting any subset into an intermediate
/// type that forms a reusable segment that can be connected into many operations
///
/// the constructed types are not bound to the value type or the error type for the operation.
/// the late binding of the types allows a single operation to process multiple types over time - like an async tuple.
///
/// transform_merge (the STL nominclature for flat_map)
///   transform_merge(auto makeStrand, auto f) {return transform(f) | merge(makeStrand);}
/// or
///   auto threeeven = copy_if(even) | take(3);
///
#include "rx_pipe_operator.h"

#include "observables/rx_ints.h"
#include "observables/rx_intervals.h"

#include "lifters/rx_copy_if.h"
#include "lifters/rx_transform.h"
#include "lifters/rx_delay.h"
#include "lifters/rx_observe_on.h"
#include "lifters/rx_finally.h"
#include "lifters/rx_last_or_default.h"

#include "adaptors/rx_take.h"
#include "adaptors/rx_merge.h"
#include "adaptors/rx_transform_merge.h"

#include "subscribers/rx_printto.h"

#include "schedulers/rx_observe_at_queue.h"
#include "schedulers/rx_run_loop.h"
#include "schedulers/rx_new_thread.h"

namespace rx {

namespace shapes {

template<class Payload>
struct state;

struct subscription
{
    bool is_stopped();
    void stop();

    void insert(const subscription& s);
    void erase(const subscription& s);

    void insert(function<void()> stopper);

    template<class Payload, class... ArgN>
    state<Payload> make_state(ArgN... argn);
    template<class Payload>
    state<Payload> copy_state(const state<Payload>&);

    void bind_defer(function<void(function<void()>)> d);

    void join();
};

template<class Payload>
struct state {
    subscription lifetime;
    Payload& get();
};

struct observer {
    template<class T>
    void next(T);
    template<class E>
    void error(E);
    void complete();
};

template<class Clock>
struct strand {
    subscription lifetime;

    typename Clock::time_point now();
    void defer_at(typename Clock::time_point, observer);
};

template<class Payload, class Clock>
struct context {
    subscription lifetime;

    typename Clock::time_point now();
    void defer_at(typename Clock::time_point, observer);

    Payload& get();
};

struct starter {
    template<class Payload, class Clock>
    subscription start(context<Payload, Clock>);
};

struct subscriber {
    template<class Payload, class Clock>
    observer create(context<Payload, Clock>);
};

struct observable {
    starter bind(subscriber);
};

struct lifter {
    subscriber lift(subscriber);
};

struct adaptor {
    observable adapt(observable);
};

struct terminator {
    starter terminate(observable);
};

template<class Clock>
void defer(strand<Clock>, observer);
template<class Clock>
void defer_at(strand<Clock>, typename Clock::time_point, observer);
template<class Clock>
void defer_after(strand<Clock>, typename Clock::duration, observer);
template<class Clock>
void defer_periodic(strand<Clock>, typename Clock::time_point, typename Clock::duration, observer);

template<class Payload, class Clock>
void defer(context<Payload, Clock>, observer);
template<class Payload, class Clock>
void defer_at(context<Payload, Clock>, typename Clock::time_point, observer);
template<class Payload, class Clock>
void defer_after(context<Payload, Clock>, typename Clock::duration, observer);
template<class Payload, class Clock>
void defer_periodic(context<Payload, Clock>, typename Clock::time_point, typename Clock::duration, observer);

}

}


text:
package com.cloud.consoleproxy;

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

import javax.ejb.Local;
import javax.naming.ConfigurationException;

import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.vm.ConsoleProxyVO;

import edu.emory.mathcs.backport.java.util.Collections;

@Local(value={ConsoleProxyAllocator.class})
public class ConsoleProxyBalanceAllocator implements ConsoleProxyAllocator {

    private String _name;
    private final Random _rand = new Random(System.currentTimeMillis());

    @Override
	public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates, final Map<Long, Integer> loadInfo, long dataCenterId) {
    	if(candidates != null) {

    		List<ConsoleProxyVO> allocationList = new ArrayList<ConsoleProxyVO>();
    		for(ConsoleProxyVO proxy : candidates) {
				allocationList.add(proxy);
    		}

    		Collections.sort(candidates, new Comparator<ConsoleProxyVO> () {
				@Override
				public int compare(ConsoleProxyVO x, ConsoleProxyVO y) {
					Integer loadOfX = loadInfo.get(x.getId());
					Integer loadOfY = loadInfo.get(y.getId());

					if(loadOfX != null && loadOfY != null) {
						if(loadOfX < loadOfY)
							return -1;
						else if(loadOfX > loadOfY)
							return 1;
						return 0;
					} else if(loadOfX == null && loadOfY == null) {
						return 0;
					} else {
						if(loadOfX == null)
							return -1;
						return 1;
					}
				}
    		});

    		if(allocationList.size() > 0)
    			return allocationList.get(0);
    	}
    	return null;
    }

    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        _name = name;
        ComponentLocator locator = ComponentLocator.getCurrentLocator();
        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
        if (configDao == null) {
            throw new ConfigurationException("Unable to get the configuration dao.");
        }

        Map<String, String> configs = configDao.getConfiguration();

        return true;
    }

    @Override
    public String getName() {
        return _name;
    }

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

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


text:
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [8.1.1](https://github.com/bitpay/bitcore-wallet/compare/v8.1.0...v8.1.1) (2019-03-21)

**Note:** Version bump only for package bitcore-wallet

## [8.1.0](https://github.com/bitpay/bitcore-wallet/compare/v5.0.0-beta.44...v8.1.0) (2019-02-27)

**Note:** Version bump only for package bitcore-wallet

## [8.0.0](https://github.com/bitpay/bitcore-wallet/compare/v5.0.0-beta.44...v8.0.0) (2019-02-27)


text:
Use this template to create an Architecture Decision Record, look at existing
ones for more detailed information.

The filename should be the date (in YYYY-MM-DD format), followed by a dash
followed by a mnemonic for the ADR, with the words separated by dashes.
If we make two decisions in one day then just move one of the decisions to the
next day during the PR review.

**Title**: short present tense imperative phrase, less than 50 characters, like a git commit message.

**Status**: proposed, accepted, rejected, deprecated, superseded, etc.

**Context**: what is the issue that we're seeing that is motivating this decision or change.

**Decision**: what is the change that we're actually proposing or doing.

**Consequences**: what becomes easier or more difficult to do because of this change.


text:
declare module 'next' {
  declare type RequestHandler = (
    req: http$IncomingMessage,
    res: http$ServerResponse,
    parsedUrl: any
  ) => Promise<void>;
  declare type NextApp = {
    prepare(): Promise<void>,
    getRequestHandler(): RequestHandler,
    render(
      req: http$IncomingMessage,
      res: http$ServerResponse,
      pathname: string,
      query: any
    ): any,
    renderToHTML(
      req: http$IncomingMessage,
      res: http$ServerResponse,
      pathname: string,
      query: string
    ): string,
    renderError(
      err: Error,
      req: http$IncomingMessage,
      res: http$ServerResponse,
      pathname: any,
      query: any
    ): any,
    renderErrorToHTML(
      err: Error,
      req: http$IncomingMessage,
      res: http$ServerResponse,
      pathname: string,
      query: any
    ): string,
  };
  declare type Options = {
    dev?: boolean,
    dir?: string,
    quiet?: boolean,
    staticMarkup?: boolean,
  };
  declare module.exports: (opts: Options) => NextApp;
}

declare module 'next/head' {
  import type { Component } from 'react';

  declare export default Class<Component<void, *, *>>
}

declare module 'next/link' {
  import type { Component } from 'react';

  declare type State = { href: string };
  declare export default Class<Component<void, State, *>>
}

declare module 'next/prefetch' {
  import type { Component } from 'react';

  declare type State = {
    href: string,
    prefetch?: boolean,
  };
  declare export var reloadIfPrefetched: any;
  declare export function prefetch(url: string): any;
  declare export default Class<Component<void, State, *>>
}

declare module 'next/router' {
  declare type RouteError = Error & { cancelled: boolean };
  declare type RouteCallback = (url: string) => void;
  declare type RouteErrorCallback = (err: RouteError, url: string) => void;

  declare export default {
    route: string,
    pathname: string,
    query: Object,
    onRouteChangeStart: ?RouteCallback,
    onRouteChangeComplete: ?RouteCallback,
    onRouteChangeError: ?RouteErrorCallback,
    push(url: string, as: ?string): Promise<boolean>,
    replace(url: string, as: ?string): Promise<boolean>,
  }
}

declare module 'next/document' {
  import type { Component } from 'react';

  declare type Context = {
    pathname: string,
    query: any,
    req?: any,
    res?: any,
    xhr?: any,
    err?: any,
  };
  declare export var Head: Class<Component<void, *, *>>;
  declare export var Main: Class<Component<void, *, *>>;
  declare export var NextScript: Class<Component<void, *, *>>;
  declare export default Class<Component<void, *, *>> & {
    getInitialProps: (ctx: Context) => Promise<*>,
    renderPage(cb: Function): void,
  }
}


text: <!DOCTYPE html>


text:
'''
PEXPECT LICENSE

    This license is approved by the OSI and FSF as GPL-compatible.
        http://opensource.org/licenses/isc-license.txt

    Copyright (c) 2012, Noah Spurrier <noah@noah.org>
    PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
    PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE
    COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES.
    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

'''
from __future__ import print_function

import pexpect
import unittest
import PexpectTestCase
import time
import sys

if sys.version_info[0] >= 3:
    def byte(i):
        return bytes([i])
else:
    byte = chr

class TestCtrlChars(PexpectTestCase.PexpectTestCase):

    def test_control_chars(self):
        '''This tests that we can send all 256 8-bit characters to a child
        process.'''
        child = pexpect.spawn('python getch.py')
        child.expect('READY', timeout=5)
        try:
            for i in range(1,256):
                child.send(byte(i))
                child.expect ('%d\r\n' % (i,))
            # This needs to be last, as getch.py exits on \x00
            child.send(byte(0))
            child.expect('0\r\n')
            child.expect(pexpect.EOF)
        except Exception:
            err = sys.exc_info()[1]
            msg = "Did not echo character value: " + str(i) + "\n"
            msg = msg + str(err)
            self.fail(msg)

    def test_sendintr (self):
        try:
            child = pexpect.spawn('python getch.py')
            child.expect('READY', timeout=5)
            child.sendintr()
            child.expect ('3\r\n')
        except Exception:
            err = sys.exc_info()[1]
            self.fail("Did not echo character value: 3, %s\n%s\n%s" % (
                str(err), child.before, child.after,))

    def test_bad_sendcontrol_chars (self):
        '''This tests that sendcontrol will return 0 for an unknown char. '''

        child = pexpect.spawn('python getch.py')
        retval = child.sendcontrol('1')
        assert retval == 0, "sendcontrol() should have returned 0 because there is no such thing as ctrl-1."

    def test_sendcontrol(self):
        '''This tests that we can send all special control codes by name.
        '''
        child = pexpect.spawn('python getch.py')
        # On slow machines, like Travis, the process is not ready in time to
        # catch the first character unless we wait for it.
        child.expect('READY', timeout=5)
        child.delaybeforesend = 0.05
        for ctrl in 'abcdefghijklmnopqrstuvwxyz':
            assert child.sendcontrol(ctrl) == 1
            val = ord(ctrl) - ord('a') + 1
            try:
                child.expect_exact(str(val)+'\r\n', timeout=2)
            except:
                print(ctrl)
                raise

        # escape character
        assert child.sendcontrol('[') == 1
        child.expect ('27\r\n')
        assert child.sendcontrol('\\') == 1
        child.expect ('28\r\n')
        # telnet escape character
        assert child.sendcontrol(']') == 1
        child.expect ('29\r\n')
        assert child.sendcontrol('^') == 1
        child.expect ('30\r\n')
        # irc protocol uses this to underline ...
        assert child.sendcontrol('_') == 1
        child.expect ('31\r\n')
        # the real "backspace is delete"
        assert child.sendcontrol('?') == 1
        child.expect ('127\r\n')
        # NUL, same as ctrl + ' '
        assert child.sendcontrol('@') == 1
        child.expect ('0\r\n')
        # 0 is sentinel value to getch.py, assert exit:
        #   causes child to exit, but, if immediately tested,
        #   isalive() still returns True unless an artifical timer
        #   is used.
        time.sleep(0.5)
        assert child.isalive() == False, child.isalive()
        assert child.exitstatus == 0

if __name__ == '__main__':
    unittest.main()

suite = unittest.makeSuite(TestCtrlChars,'test')


text:
namespace place_page_layout
{
NSTimeInterval const kAnimationSpeed = IPAD ? 0.15 : 0.25;

inline void animate(MWMVoidBlock animate, MWMVoidBlock completion = nil)
{
  [UIView animateWithDuration:kAnimationSpeed
                        delay:0
                      options:UIViewAnimationOptionCurveEaseIn
                   animations:animate
                   completion:^(BOOL finished) {
                     if (completion)
                       completion();
                   }];
}
}  // namepsace place_page_layout

@protocol MWMPlacePageLayoutDelegate;
@class MWMPPPreviewLayoutHelper;

@protocol MWMPlacePageLayoutImpl <NSObject>

- (instancetype)initOwnerView:(UIView *)ownerView
                placePageView:(MWMPPView *)placePageView
                     delegate:(id<MWMPlacePageLayoutDelegate>)delegate;
- (void)onShow;
- (void)onClose;

@property(weak, nonatomic) UIView * ownerView;
@property(weak, nonatomic) MWMPPView * placePageView;
@property(weak, nonatomic) id<MWMPlacePageLayoutDelegate> delegate;
@property(weak, nonatomic) MWMPlacePageActionBar * actionBar;

@optional
- (void)setPreviewLayoutHelper:(MWMPPPreviewLayoutHelper *)layoutHelper;
- (void)updateAvailableArea:(CGRect)frame;
- (void)updateContentLayout;

@end


text:
var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.forward('index.html');
});

module.exports = router;


text:
package org.wildfly.swarm.monitor;

import org.junit.Assert;
import org.junit.Test;
import org.wildfly.swarm.health.HealthStatus;
import org.wildfly.swarm.monitor.runtime.HealthAnnotationProcessor;

/**
 * @author Heiko Braun
 */
public class MonitorTest {

    // see https://issues.jboss.org/browse/SWARM-505
    @Test
    public void testAttributes() {

        HealthStatus healthStatus = HealthStatus.named("test")
                .up()
                .withAttribute("a", "b")
                .withAttribute("c", "d");

        String message = healthStatus.getMessage().get();
        Assert.assertTrue("Expected a", message.contains("a"));
        Assert.assertTrue("Expected c", message.contains("c"));
        System.out.println(message);
    }

    @Test
    public void testPathStructures() {
        StringBuilder sb = new StringBuilder();
        HealthAnnotationProcessor.safeAppend(sb, "jboss-web");
        HealthAnnotationProcessor.safeAppend(sb, "/webcontext");
        HealthAnnotationProcessor.safeAppend(sb, "/app");
        Assert.assertEquals("/jboss-web/webcontext/app", sb.toString());

        // --

        sb = new StringBuilder();
        HealthAnnotationProcessor.safeAppend(sb, "jboss-web/");
        HealthAnnotationProcessor.safeAppend(sb, "/webcontext");
        HealthAnnotationProcessor.safeAppend(sb, "app");
        Assert.assertEquals("/jboss-web/webcontext/app", sb.toString());

        // --

        sb = new StringBuilder();
        HealthAnnotationProcessor.safeAppend(sb, "jboss-web");
        HealthAnnotationProcessor.safeAppend(sb, "webcontext");
        HealthAnnotationProcessor.safeAppend(sb, "app");
        Assert.assertEquals("/jboss-web/webcontext/app", sb.toString());

        // --

        sb = new StringBuilder();
        HealthAnnotationProcessor.safeAppend(sb, "jboss-web/");
        HealthAnnotationProcessor.safeAppend(sb, "webcontext/");
        HealthAnnotationProcessor.safeAppend(sb, "app/");
        Assert.assertEquals("/jboss-web/webcontext/app", sb.toString());

        // --

        sb = new StringBuilder();
        HealthAnnotationProcessor.safeAppend(sb, "/jboss-web/");
        HealthAnnotationProcessor.safeAppend(sb, "/webcontext/");
        HealthAnnotationProcessor.safeAppend(sb, "/app/");
        Assert.assertEquals("/jboss-web/webcontext/app", sb.toString());

    }
}


text:
require 'sqlite3'

db = SQLite3::Database.new "./public/test_db"

db.execute "INSERT INTO Clients (Name, date) VALUES ('Guss', '2016-07-07')"

db.close


text:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
          "https://checkstyle.org/dtds/configuration_1_3.dtd">

<!-- Checkstyle configuration that checks the sun coding conventions from:
	- the Java Language Specification at https://docs.oracle.com/javase/specs/jls/se11/html/index.html
	- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
	- the Javadoc guidelines at https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
	- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/ -
	some best practices Checkstyle is very configurable. Be sure to read the
	documentation at https://checkstyle.org (or in your downloaded distribution).
	Most Checks are configurable, be sure to consult the documentation. To completely
	disable a check, just comment it out or delete it from the file. To suppress
	certain violations please review suppression filters. Finally, it is worth
	reading the documentation. -->

<module name="Checker">
	<!-- If you set the basedir property below, then all reported file names
		will be relative to the specified directory. See https://checkstyle.org/config.html#Checker
		<property name="basedir" value="${basedir}"/> -->
	<property name="severity" value="error" />

	<property name="fileExtensions" value="java, properties, xml" />

	<!-- Excludes all 'module-info.java' files -->
	<!-- See https://checkstyle.org/config_filefilters.html -->
	<module name="BeforeExecutionExclusionFileFilter">
		<property name="fileNamePattern" value="module\-info\.java$" />
	</module>

	<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
	<module name="SuppressionFilter">
		<property name="file"
			value="${org.checkstyle.sun.suppressionfilter.config}"
			default="checkstyle-suppressions.xml" />
		<property name="optional" value="true" />
	</module>

	<!-- Checks that a package-info.java file exists for each package. -->
	<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
	<!-- TODO: <module name="JavadocPackage"/> -->

	<!-- Checks whether files end with a new line. -->
	<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
	<module name="NewlineAtEndOfFile" />

	<!-- Checks that property files contain the same keys. -->
	<!-- See https://checkstyle.org/config_misc.html#Translation -->
	<module name="Translation" />

	<!-- Checks for Size Violations. -->
	<!-- See https://checkstyle.org/config_sizes.html -->
	<module name="FileLength" />
	<!-- we do not care about the line length: <module name="LineLength"> <property
		name="fileExtensions" value="java"/> </module> -->

	<!-- Checks for whitespace -->
	<!-- See https://checkstyle.org/config_whitespace.html -->
	<module name="FileTabCharacter" />

	<!-- Miscellaneous other checks. -->
	<!-- See https://checkstyle.org/config_misc.html -->
	<module name="RegexpSingleline">
		<property name="format" value="\s+$" />
		<property name="minimum" value="0" />
		<property name="maximum" value="0" />
		<property name="message" value="Line has trailing spaces." />
	</module>

	<!-- Checks for Headers -->
	<!-- See https://checkstyle.org/config_header.html -->
	<!-- <module name="Header"> -->
	<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
	<!-- <property name="fileExtensions" value="java"/> -->
	<!-- </module> -->

	<module name="TreeWalker">

		<!-- Checks for Javadoc comments. -->
		<!-- See https://checkstyle.org/config_javadoc.html -->
		<module name="InvalidJavadocPosition" />
		<module name="JavadocMethod"/>
		<module name="JavadocType"/>
		<module name="JavadocStyle"/>

		<!--
		<module name="JavadocVariable"/>
		<module name="MissingJavadocMethod"/> -->

		<!-- Checks for Naming Conventions. -->
		<!-- See https://checkstyle.org/config_naming.html -->
		<module name="ConstantName" />
		<module name="LocalFinalVariableName" />
		<module name="LocalVariableName" />
		<module name="MemberName" />
		<module name="MethodName" />
		<module name="PackageName" />
		<module name="ParameterName" />
		<module name="StaticVariableName" />
		<module name="TypeName" />

		<!-- Checks for imports -->
		<!-- See https://checkstyle.org/config_imports.html -->
		<module name="AvoidStarImport" />
		<module name="IllegalImport" /> <!-- defaults to sun.* packages -->
		<module name="RedundantImport" />
		<module name="UnusedImports">
			<property name="processJavadoc" value="false" />
		</module>

		<!-- Checks for Size Violations. -->
		<!-- See https://checkstyle.org/config_sizes.html -->
		<!-- <module name="MethodLength"/> -->
		<!-- TODO: <module name="ParameterNumber"/> -->

		<!-- Checks for whitespace -->
		<!-- See https://checkstyle.org/config_whitespace.html -->
		<module name="EmptyForIteratorPad" />
		<module name="GenericWhitespace" />
		<module name="MethodParamPad" />
		<!-- <module name="NoWhitespaceAfter"/> -->
		<module name="NoWhitespaceBefore" />
		<module name="OperatorWrap" />
		<module name="ParenPad" />
		<module name="TypecastParenPad" />
		<module name="WhitespaceAfter" />
		<module name="WhitespaceAround" />

		<!-- Modifier Checks -->
		<!-- See https://checkstyle.org/config_modifiers.html -->
		<module name="ModifierOrder" />
		<module name="RedundantModifier" />

		<!-- Checks for blocks. You know, those {}'s -->
		<!-- See https://checkstyle.org/config_blocks.html -->
		<module name="AvoidNestedBlocks" />
		<module name="EmptyBlock" />
		<module name="LeftCurly" />
		<module name="NeedBraces" />
		<module name="RightCurly" />

		<!-- Checks for common coding problems -->
		<!-- See https://checkstyle.org/config_coding.html -->
		<module name="EmptyStatement" />
		<module name="EqualsHashCode" />
		<!-- TODO: <module name="HiddenField"/> -->
		<module name="IllegalInstantiation" />
		<module name="InnerAssignment" />
		<!-- TODO: enable and add exceptions: <module name="MagicNumber"/> -->
		<module name="MissingSwitchDefault" />
		<module name="MultipleVariableDeclarations" />
		<module name="SimplifyBooleanExpression" />
		<module name="SimplifyBooleanReturn" />

		<!-- Checks for class design -->
		<!-- See https://checkstyle.org/config_design.html -->
		<!-- TODO: enable <module name="DesignForExtension"/> -->
		<module name="FinalClass" />
		<module name="HideUtilityClassConstructor" />
		<module name="InterfaceIsType" />
		<!-- TODO: <module name="VisibilityModifier"/> -->

		<!-- Miscellaneous other checks. -->
		<!-- See https://checkstyle.org/config_misc.html -->
		<module name="ArrayTypeStyle" />
		<!-- <module name="FinalParameters"/> -->
		<!-- <module name="TodoComment"/> -->
		<module name="UpperEll" />

		<module name="SuppressionCommentFilter" />

		<!-- additional rules -->
		<module name="MissingOverride" />
		<module name="CustomImportOrder">
			<property name="customImportOrderRules" value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
			<property name="specialImportsRegExp" value="^org\."/>
			<property name="thirdPartyPackageRegExp" value="^com\."/>
			<property name="sortImportsInGroupAlphabetically" value="true"/>
			<property name="separateLineBetweenGroups" value="true"/>
		</module>

	</module>

</module>


text:
package com.dberm22.DBoard.Settings;

import java.awt.Color;
import java.util.ArrayList;

public class Settings
{
	public ArrayList<ArrayList<ArrayList<SoundFile>>> mediafiles = new ArrayList<ArrayList<ArrayList<SoundFile>>>();
	private String backgroundImage = null;
	private Color backgroundColor = new Color(200,200,200);
	private Float buttonAlpha = 1.0f;
	private Color buttonColor = null;
	private String position = "Center";
	private boolean	singularAudio = false;

    public Settings(){}

    public Settings(ArrayList<ArrayList<ArrayList<SoundFile>>> mediafiles)
    {
    	if(mediafiles != null) this.mediafiles = mediafiles;
    }

    public Object getBackground()
    {
    	if("None".equals(position))
    	{
    		return this.backgroundColor;
    	}
    	else
    	{
    		return this.backgroundImage;
    	}
    }

    public void setBackgroundImage(String image)
    {
    	this.backgroundImage = image;
    }

    public String getBackgroundImage()
    {
    	if(this.backgroundImage != null) return this.backgroundImage;
    	else return "";
    }

    public void setBackgroundImagePosition(String pos)
    {
    	this.position = pos;
    }

    public String getBackgroundImagePosition()
    {
    	return this.position;
    }

    public void setBackgroundColor(Color color)
    {
    	this.backgroundColor = color;
    }

    public Color getBackgroundColor()
    {
    	return this.backgroundColor;
    }

    public void setButtonAlpha(float alpha)
    {
    	this.buttonAlpha = alpha;
    }

    public float getButtonAlpha()
    {
    	return this.buttonAlpha;
    }

    public void setButtonColor(Color color)
    {
    	this.buttonColor = color;
    }

    public Color getButtonColor()
    {
    	return this.buttonColor;
    }

    public void setMediaFiles(ArrayList<ArrayList<ArrayList<SoundFile>>> mediafiles)
    {
    	this.mediafiles = mediafiles;
    }

    public ArrayList<ArrayList<ArrayList<SoundFile>>> getMediaFiles()
    {
    	return this.mediafiles;
    }

    public void setSingularAudioSetting(boolean setSingular)
    {
    	this.singularAudio = setSingular;
    }

    public boolean getSingularAudioSetting()
    {
    	return this.singularAudio;
    }

}


text:
<?php

namespace Aslan\AdminBundle\Controller;

use Aslan\StoreBundle\Controller\StoreController as StoreController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Aslan\AdminBundle\Form\Type\BrandType;
use Aslan\AdminBundle\Entity\Brands;
use Aslan\AdminBundle\Form\Type\BlogsType;
use Aslan\AdminBundle\Entity\Blogs;

class PlaceController extends StoreController {

    public function placeImage($img, $val) {
        $blogsNew = array();
        $size = getimagesize($img);
        $width = $size[0];
        $height = $size[1];
        $const = $width / $height;
        $blogsNew['width'] = $val;
        $blogsNew['height'] = $val / $const;
        return $blogsNew;
    }

    public function adminImgAction(Request $request, $type) {
        $session = $this->getRequest()->getSession();
        $user_id = $session->get('user_id');
        if (!isset($user_id)) {
            return $this
                            ->render('AslanAdminBundle:Default:login.admin.html.twig');
        } else {
            //$onemenu = parent::oneMenuAction($id);
            $pag = parent::imgAction($type);
            $albums = parent::findAllAction('Albums');
            $page = new Images();
            $form = $this->createForm(new ImageType(), $page);
            if ($request->getMethod() == 'POST') {
                $form->bindRequest($request);
                $file = $form['img']->getData();
                $href = $form['href']->getData();
                $fileName = '';
                if ($file) {
                    //$extension = $file->guessExtension();
                    $extension = ".jpg";
                    $fileName = 'img' . date('YmdHis') . '.' . $extension;
                    $file->move('media/pictures/', $fileName);
                }
                //$found = parent::emailOneFoundImageAction($text);
                $src = parent::imgNewAction($fileName, $href, $type);
                return new Response($src);
                /* if (!$found) {
                  parent::emailSetImageAction($text);
                  return new Response(
                  $this->get('translator')
                  ->trans("Thank you! We'll notify you."));
                  } else {
                  return new Response(
                  $this->get('translator')
                  ->trans(
                  "Sorry, but this email already exists!"));
                  } */
            } else {
                if ($type == "photo")
                    $menu = 2;
                else
                    $menu = 6;
                $form['href']->setData('http://');
                return $this
                                ->render(
                                        'AslanAdminBundle:Default:admin.slider.html.twig', array("img" => $pag, 'albums' => $albums, 'menu' => $menu,
                                    "form" => $form->createView(), "type" => $type));
            }
        }
    }

    public function adminImgDeleteAction(Request $request) {
        $id = $request->request->get('id');
        parent::imgDeleteAction($id);
        return new Response();
    }

    public function adminPhotoAction() {
        $session = $this->getRequest()->getSession();
        $user_id = $session->get('user_id');
        if (!isset($user_id)) {
            return $this
                            ->render('AslanAdminBundle:Default:login.admin.html.twig');
        } else {
            $image = parent::imageAction();
            $category = parent::categoryAction();
            $session = $this->getRequest()->getSession();
            $locale = $session->get('changeLocale');
            if (!isset($locale)) {
                $locale = 0;
            }
            return $this
                            ->render('AslanAdminBundle:Default:photo.admin.html.twig', array("image" => $image,
                                "category" => $category[0],
                                "changeLocale" => $locale));
        }
    }

    public function adminParkettAction(Request $request) {
        $idBrand = $request->request->get('id');
        return $this->idPageAction($idBrand);
        //return new Response($idBrand);
    }

    public function adminBrandImgAction(Request $request) {
        $id = $request->request->get('id');
        return new Response(parent::brandImgAction($id));
    }

    public function adminBrandAction(Request $request) {
        $session = $this->getRequest()->getSession();
        $user_id = $session->get('user_id');
        if (!isset($user_id)) {
            return $this
                            ->render('AslanAdminBundle:Default:login.admin.html.twig');
        } else {
            //$onemenu = parent::oneMenuAction($id);
            $brandall = parent::brandAllAction();
            $page = new Brands();
            $form = $this->createForm(new BrandType(), $page);
            if ($request->getMethod() == 'POST') {
                $form->bindRequest($request);
                $name = $form['name']->getData();
                $id = $form['id']->getData();
                //$found = parent::emailOneFoundImageAction($text);
                $src = parent::brandUpdateAction($name, $id);
                return new Response($src);
                /* if (!$found) {
                  parent::emailSetImageAction($text);
                  return new Response(
                  $this->get('translator')
                  ->trans("Thank you! We'll notify you."));
                  } else {
                  return new Response(
                  $this->get('translator')
                  ->trans(
                  "Sorry, but this email already exists!"));
                  } */
            } else {
                return $this
                                ->render(
                                        'AslanAdminBundle:Default:admin.brand.html.twig', array("secondmenuall" => $brandall,
                                    'menu' => 5,
                                    "form" => $form->createView()));
            }
        }
    }

    public function adminPlaceFormAction(Request $request) {
        $session = $this->getRequest()->getSession();
        $user_id = $session->get('user_id');
        if (!isset($user_id)) {
            return $this
                            ->render('AslanAdminBundle:Default:login.admin.html.twig');
        } else {
            //$onemenu = parent::oneMenuAction($id);
            $page = new Blogs();
            $form = $this->createForm(new BlogsType(), $page);
            if ($request->getMethod() == 'POST') {
                $form->bindRequest($request);
                $text = $page->getText();
                if (!$text)
                    $text = ' ';
                $name = $page->getName();
                if (!$name)
                    $name = ' ';
                $id = $page->getId();
                if (!$id)
                    $id = '';
                $src = parent::blogsUpdateAction($name, $text, $id);
                return new Response($src);
            } else {
                return $this
                                ->render(
                                        'AslanAdminBundle:Default:admin.blogsForm.html.twig', array("form" => $form->createView()));
            }
        }
    }

    public function adminPlaceAction(Request $request) {
        $session = $this->getRequest()->getSession();
        $user_id = $session->get('user_id');
        if (!isset($user_id)) {
            return $this
                            ->render('AslanAdminBundle:Default:login.admin.html.twig');
        } else {
            //$onemenu = parent::oneMenuAction($id);
            $brandall = parent::blogsAllAction();

            return $this
                            ->render(
                                    'AslanAdminBundle:Default:admin.blogs.html.twig', array("secondmenuall" => $brandall,
                                'menu' => 4));
        }
    }

    public function adminBrandPageAction(Request $request) {
        $id = $request->request->get('id');
        $pod = parent::brandPageAction($id);
        $ret = array();
        for ($i = 0; $i < count($pod); $i++) {
            $ret[$i][0] = $pod[$i]->getId();
            $ret[$i][1] = $pod[$i]->getName();
        }
        return new Response(json_encode($ret));
    }

    public function adminRemoveBrandAction(Request $request) {
        $id = $request->request->get('id');
        parent::brandRemoveAction($id);
        return new Response();
    }

    public function adminRemovePlaceAction(Request $request) {
        $id = $request->request->get('id');
        parent::blogRemoveAction($id);
        return new Response();
    }

    public function idPageAction($id) {
        $page = parent::onePageAction($id);
        $ret = array();
        if ($page) {
            for ($i = 0; $i < count($page); $i++) {
                $ret[$i][0] = $page[$i]->getId();
                $ret[$i][1] = $page[$i]->getName();
                $ret[$i][2] = $page[$i]->getImg();
                $ret[$i][3] = $page[$i]->getDescription();
                $ret[$i][4] = $page[$i]->getText();
                $ret[$i][5] = $page[$i]->getWood();
                $ret[$i][6] = $page[$i]->getCountry();
                $ret[$i][7] = $page[$i]->getGrade();
                $ret[$i][8] = $page[$i]->getProcessing();
                $ret[$i][9] = $page[$i]->getWidth();
                $ret[$i][10] = $page[$i]->getLength();
                $ret[$i][11] = $page[$i]->getThickness();
                $ret[$i][12] = $page[$i]->getArticle();
                $ret[$i][13] = $page[$i]->getBrand()->getId();
                /* for ($i = 0, $j = 14; $i < count($page->getPageimgs()); $i++ . $j++) {
                  $pag = $page->getPageimgs();
                  $ret[0][$j] = $pag[$i]->getImg();
                  } */
            }
        }
        return new Response(json_encode($ret));
    }

    public function idPlaceAction(Request $request) {
        $id = $request->request->get('id');
        $page = parent::oneBlogsAction($id);
        $ret = array();
        $ret[0][0] = $page->getId();
        $ret[0][1] = $page->getHead();
        $ret[0][2] = $page->getPage();
        return new Response(json_encode($ret));
    }

    public function adminRenameBrandAction(Request $request) {
        $text = $request->request->get('text');
        $text2 = $request->request->get('text2');
        $text3 = $request->request->get('text3');
        $id = $request->request->get('id');
        parent::brandUpdateAction($text, $text2, $text3, $id);
        return new Response($text);
    }

    public function logAction(Request $request) {
        $login = $request->request->get('login');
        $password = $request->request->get('password');
        if (!$password || !$login) {
            return new Response(
                    '<script>alert("Не все поля заполнены!");window.location.href="/admin";</script>');
        } else {
            $user = parent::userAction($login);
            if (!$user) {
                return new Response(
                        '<script>alert("Неверный логин или пароль!");window.location.href="/admin";</script>');
            } else {
                $hash = hash("sha256", $password);
                $log = parent::logGetAction($login, $hash);
                if (!$log) {
                    return new Response(
                            '<script>alert("Неверный логин или пароль!");window.location.href="/admin";</script>');
                } else {
                    $session = $this->getRequest()->getSession();
                    $user_id = $session->set('user_id', 1);
                    return $this
                                    ->redirect(
                                            $this
                                            ->generateUrl(
                                                    'AslanAdminBundle_admin_homepage'), 301);
                }
            }
        }
    }

    public function adminPhotoDeleteAction(Request $request) {
        $id = $request->request->get('id');
        return parent::photoDeleteAction($id);
    }

    public function adminDescrEditAction(Request $request) {
        $id = $request->request->get('id');
        $val = $request->request->get('val');
        return parent::descrEditAction($id, $val);
    }

    public function adminHeadEditAction(Request $request) {
        $id = $request->request->get('id');
        $val = $request->request->get('val');
        return parent::headEditAction($id, $val);
    }

    public function adminCatChangeAction(Request $request) {
        $id = $request->request->get('id');
        $val = $request->request->get('val');
        return parent::catChangeAction($id, $val);
    }

    public function adminPhotoUploadAction() {
        return parent::photoUploadAction($_FILES);
    }

    public function adminParkettImgAction(Request $request) {
        $id = $request->request->get('id');
        return new Response(parent::parkettImgAction($id));
    }

    public function adminPageImgNewAction(Request $request) {
        $fileName2 = array();
        $send = array();
        $id = $request->request->get('idImg');
        if ($request->getMethod() == 'POST') {
            if (isset($_FILES['files'])) {
                foreach ($_FILES['files']['name'] as $k => $f) {
                    if (!$_FILES['files']['error'][$k]) {
                        if (is_uploaded_file($_FILES['files']['tmp_name'][$k])) {
                            $extension = ".jpg";
                            $fileName2[$k] = 'img' . $k . date('YmdHis') . '.'
                                    . $extension;
                            if (move_uploaded_file(
                                            $_FILES['files']['tmp_name'][$k], "media/pictures/" . $fileName2[$k])) {
                                $blogs = $this->placeImage('media/pictures/' . $fileName2[$k], 100);
                                $this->get('image.handling')->open('media/pictures/' . $fileName2[$k])->resize($blogs['width'], $blogs['height'])->save('media/pictures/small' . $fileName2[$k]);
                            }
                        }
                    }
                }
            }
            for ($i = 0; $i < count($fileName2); $i++) {
                $idd = parent::PageImgNewAction($id, $fileName2[$i]);
                $send[$i]['id'] = $idd;
                $send[$i]['src'] = $fileName2[$i];
            }
        }
        return new Response(json_encode($send));
    }

}


text:
package com.sequenceiq.environment.api.v1.platformresource.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.swagger.annotations.ApiModel;

@ApiModel
@JsonIgnoreProperties(ignoreUnknown = true)
public class PlatformSshKeyResponse implements Serializable {

    private String name;

    private Map<String, Object> properties = new HashMap<>();

    public PlatformSshKeyResponse() {
    }

    public PlatformSshKeyResponse(String name, Map<String, Object> properties) {
        this.name = name;
        this.properties = properties;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, Object> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, Object> properties) {
        this.properties = properties;
    }

    @Override
    public String toString() {
        return "PlatformSshKeyResponse{" +
                "name='" + name + '\'' +
                ", properties=" + properties +
                '}';
    }
}


text:
package com.metalabs.cephei.web.configuration;

import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrationsAdapter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import java.lang.reflect.Method;

@Configuration
public class RestBaseUrl {
    @Bean
    public WebMvcRegistrationsAdapter webMvcRegistrationsHandlerMapping() {
        return new WebMvcRegistrationsAdapter() {
            @Override
            public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
                return new RequestMappingHandlerMapping() {
                    private final static String API_BASE_PATH = "rest";

                    @Override
                    protected void registerHandlerMethod(Object handler, Method method, RequestMappingInfo mapping) {
                        Class<?> beanType = method.getDeclaringClass();
                        if (AnnotationUtils.findAnnotation(beanType, RestController.class) != null) {
                            PatternsRequestCondition apiPattern = new PatternsRequestCondition(API_BASE_PATH)
                                    .combine(mapping.getPatternsCondition());

                            mapping = new RequestMappingInfo(mapping.getName(), apiPattern,
                                    mapping.getMethodsCondition(), mapping.getParamsCondition(),
                                    mapping.getHeadersCondition(), mapping.getConsumesCondition(),
                                    mapping.getProducesCondition(), mapping.getCustomCondition());
                        }

                        super.registerHandlerMethod(handler, method, mapping);
                    }
                };
            }
        };
    }
}


text:
// @flow

import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
import { StateListenerRegistry } from '../base/redux';

/**
 * Updates the on stage participant video.
 */
StateListenerRegistry.register(
    /* selector */ state => state['features/large-video'].participantId,
    /* listener */ participantId => {
        VideoLayout.updateLargeVideo(participantId, true);
    }
);


text:
package org.apache.arrow.memory;

import static org.junit.Assert.assertEquals;

import org.junit.Assert;
import org.junit.Test;

public class TestAccountant {

  @Test
  public void basic() {
    ensureAccurateReservations(null);
  }

  @Test
  public void nested() {
    final Accountant parent = new Accountant(null, "test", 0, Long.MAX_VALUE);
    ensureAccurateReservations(parent);
    assertEquals(0, parent.getAllocatedMemory());
    assertEquals(parent.getLimit() - parent.getAllocatedMemory(), parent.getHeadroom());
  }

  @Test
  public void multiThread() throws InterruptedException {
    final Accountant parent = new Accountant(null, "test", 0, Long.MAX_VALUE);

    final int numberOfThreads = 32;
    final int loops = 100;
    Thread[] threads = new Thread[numberOfThreads];

    for (int i = 0; i < numberOfThreads; i++) {
      Thread t = new Thread() {

        @Override
        public void run() {
          try {
            for (int i = 0; i < loops; i++) {
              ensureAccurateReservations(parent);
            }
          } catch (Exception ex) {
            ex.printStackTrace();
            Assert.fail(ex.getMessage());
          }
        }

      };
      threads[i] = t;
      t.start();
    }

    for (Thread thread : threads) {
      thread.join();
    }

    assertEquals(0, parent.getAllocatedMemory());
    assertEquals(parent.getLimit() - parent.getAllocatedMemory(), parent.getHeadroom());
  }

  private void ensureAccurateReservations(Accountant outsideParent) {
    final Accountant parent = new Accountant(outsideParent, "test", 0, 10);
    assertEquals(0, parent.getAllocatedMemory());

    final Accountant child = new Accountant(parent, "test", 2, Long.MAX_VALUE);
    assertEquals(2, parent.getAllocatedMemory());
    assertEquals(10, child.getHeadroom());
    {
      AllocationOutcome first = child.allocateBytes(1);
      assertEquals(AllocationOutcome.Status.SUCCESS, first.getStatus());
    }

    // child will have new allocation
    assertEquals(1, child.getAllocatedMemory());

    // root has no change since within reservation
    assertEquals(2, parent.getAllocatedMemory());

    {
      AllocationOutcome first = child.allocateBytes(1);
      assertEquals(AllocationOutcome.Status.SUCCESS, first.getStatus());
    }

    // child will have new allocation
    assertEquals(2, child.getAllocatedMemory());

    // root has no change since within reservation
    assertEquals(2, parent.getAllocatedMemory());

    child.releaseBytes(1);

    // child will have new allocation
    assertEquals(1, child.getAllocatedMemory());

    // root has no change since within reservation
    assertEquals(2, parent.getAllocatedMemory());

    {
      AllocationOutcome first = child.allocateBytes(2);
      assertEquals(AllocationOutcome.Status.SUCCESS, first.getStatus());
    }

    // child will have new allocation
    assertEquals(3, child.getAllocatedMemory());

    // went beyond reservation, now in parent accountant
    assertEquals(3, parent.getAllocatedMemory());

    assertEquals(7, child.getHeadroom());
    assertEquals(7, parent.getHeadroom());

    {
      AllocationOutcome first = child.allocateBytes(7);
      assertEquals(AllocationOutcome.Status.SUCCESS, first.getStatus());
    }

    // child will have new allocation
    assertEquals(10, child.getAllocatedMemory());

    // went beyond reservation, now in parent accountant
    assertEquals(10, parent.getAllocatedMemory());

    child.releaseBytes(9);

    assertEquals(1, child.getAllocatedMemory());
    assertEquals(9, child.getHeadroom());

    // back to reservation size
    assertEquals(2, parent.getAllocatedMemory());
    assertEquals(8, parent.getHeadroom());

    AllocationOutcome first = child.allocateBytes(10);
    assertEquals(AllocationOutcome.Status.FAILED_PARENT, first.getStatus());

    // unchanged
    assertEquals(1, child.getAllocatedMemory());
    assertEquals(2, parent.getAllocatedMemory());

    boolean withinLimit = child.forceAllocate(10);
    assertEquals(false, withinLimit);

    // at new limit
    assertEquals(child.getAllocatedMemory(), 11);
    assertEquals(parent.getAllocatedMemory(), 11);
    assertEquals(-1, child.getHeadroom());
    assertEquals(-1, parent.getHeadroom());

    child.releaseBytes(11);
    assertEquals(child.getAllocatedMemory(), 0);
    assertEquals(parent.getAllocatedMemory(), 2);
    assertEquals(10, child.getHeadroom());
    assertEquals(8, parent.getHeadroom());

    child.close();
    parent.close();
  }
}


text:
var del = require('del');

/* Utils.del()
 * Delete a specify path (file/folder) */

module.exports = function (obj) {
	del.sync(obj);
	this.log('Cleared: ' + obj);
	return this;
};


text:
import sys

n = int(raw_input().strip())
arr = map(int,raw_input().strip().split(' '))

print sum(arr)


text:
title: Weird bug in AngularJS $http?
author: arnehass
date: 2013-08-28
template: article.pug
tags: $http, AngularJS, checkbox survey, iframe
original: http://icanhasweb.net/blog/2013/08/weird-bug-angularjs-http/
---

At work we've been working with AngularJS for a few months, and we are very pleased with its flexibility and solutions to many familiar problems when working with large amount of JavaScript code. There have been problems and bugs, but none we couldn't solve in due time.

But my latest task have left me somewhat puzzled, and I write this post in the hope that somebody out there know what it was about, and also because I just ain't able to summarize it into a proper question on a forum or what-have-you. So here goes.

The task required me to work with a 3rd-party service through an iframe. The service in question is [Checkbox Survey](http://www.checkbox.com/), which we use to, well, make surveys. We embed a given survey within the iframe, and run some code that looks for a specific ID within the embedded page. The gist below shows part of the directive that handles how we "look" for this.

Upon completion (or pausing) an event is emitted. This event is fetched by a parent controller, and the gist below shows how it's handled.

Ideally, line 2 and 3 wouldn't be needed. Ideally, $scope.result.$complete would've been called (it's a $http-object), and success would be triggered upon a (hopefully) successful result. But this doesn't happen. It seems that the browser need the user to interact with the page before it will send the request. To enable this, and to guide the user so she doesn't navigate away from the page until the request is sent, I've included a link that's shown when showButton is truthy. The link doesn't actually do anything but link to "#", as shown in the gist below.

I also realized that scope.$digest was necessary to get the button shown. Another hack I'm puzzled by. This is far from an elegant solution, and I hope that maybe someone out there will stumble upon this post and give me some advice about what is amiss. Or I'll find it out myself, and update this post later.


text:
var assert = require('chai').assert;
var expect = require('chai').expect;
var passwordGenerator = require('../src/password-generator');

describe('password-generator', function() {
    describe('generate', function() {
        it('should generate a random password according to the default configuration', function() {
            var password = passwordGenerator.generate();

            assert.match(password, /[A-Z]+/, 'contains at least one upper alphabetic character');
            assert.match(password, /[a-z]+/, 'contains at least one lower alphabetic character');
            assert.match(password, /[0-9]+/, 'contains at least one digital character');
            assert.match(password, /[ @%+\/'!#$^?:,\(\)\{\}\[\]~`\-_]+/, 'contains at least one special character');
            expect(password.length).to.equal(16);
        });
    });
});


text:
@interface ViewController ()

@property (nonatomic, strong) KBCircleStepView *stepView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    KBCircleStepViewModel *model = ({
        KBCircleStepViewModel *model = [KBCircleStepViewModel new];
        model.circleContentArray     = @[@"1",@"2",@"3"];
        model.activeCircleIndex      = 0;
        model.activeColor            = [UIColor colorWithRed:41.0f/255.0f green:170.0f/255.0f blue:110.0f/255.0f alpha:1.0f];
        model.unActiveColor          = [UIColor colorWithRed:187.0f/255.0f green:187.0f/255.0f blue:187.0f/255.0f alpha:1];
        model.activeContentFont      = [UIFont systemFontOfSize:42];
        model.unActiveContentFont    = [UIFont systemFontOfSize:21.0f];
        model.activeCircleRadius     = 28.0f;
        model.unActiveCircleRadius   = 20.0f;
        model.circleLineWidth        = 5.0f;
        model.connectLineWidth       = 5.0f;
        model;
    });

    self.stepView = [KBCircleStepView kbCircleStepViewWithCircleStepViewModel:model frame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, 200)];
    self.stepView.backgroundColor = [UIColor colorWithRed:239.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1];
    [self.view addSubview:self.stepView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
module GEPUB
  #
  # Static Object to hold and operate with OEBPS data MIME types
  #

  class Mime

    # compile mime_types regexp
    def self.compile_mime_types
      @@mime_types_compiled = Hash[@@mime_types.map { |expr, mime| [ /\A\.#{expr}\Z/i, mime ] }]
    end

    # media types by file extension regexp seeds to mime types
    @@mime_types =  {
      '(html|xhtml)' => 'application/xhtml+xml',
      'css' => 'text/css',
      'js' => 'text/javascript',
      '(jpg|jpeg)' => 'image/jpeg',
      'png' => 'image/png',
      'gif' => 'image/gif',
      'svg' => 'image/svg+xml',
      'opf' => 'application/oebps-package+xml',
      'ncx' => 'application/x-dtbncx+xml',
      '(otf|ttf|ttc|eot)' => 'application/vnd.ms-opentype',
      'woff' => 'application/font-woff',
      'mp4' => 'video/mp4',
      'mp3' => 'audio/mpeg'
    }
    compile_mime_types

    # return mime media types => mime types hash
    def self.mime_types
       @@mime_types
    end

    # add new mediatype to @@mediatypes
    def self.add_mimetype(mediatypes)
      mediatypes.each { |expr, mime| @@mime_types[expr] ||= mime }
      compile_mime_types
    end

     #guess mediatype by mime type mask
    def self.guess_mediatype(href)
      ext = File.extname(href)
      @@mime_types_compiled.select { |pattern, mime| ext =~ pattern }.values[0]
    end

  end
end


text:
package utils

import (
	"sync"
	"time"
)

func NewJSONMessagePublisher() *JSONMessagePublisher {
	return &JSONMessagePublisher{}
}

type JSONMessageListener chan<- JSONMessage

type JSONMessagePublisher struct {
	m           sync.RWMutex
	subscribers []JSONMessageListener
}

func (p *JSONMessagePublisher) Subscribe(l JSONMessageListener) {
	p.m.Lock()
	p.subscribers = append(p.subscribers, l)
	p.m.Unlock()
}

func (p *JSONMessagePublisher) SubscribersCount() int {
	p.m.RLock()
	count := len(p.subscribers)
	p.m.RUnlock()
	return count
}

// Unsubscribe closes and removes the specified listener from the list of
// previously registed ones.
// It returns a boolean value indicating if the listener was successfully
// found, closed and unregistered.
func (p *JSONMessagePublisher) Unsubscribe(l JSONMessageListener) bool {
	p.m.Lock()
	defer p.m.Unlock()

	for i, subscriber := range p.subscribers {
		if subscriber == l {
			close(l)
			p.subscribers = append(p.subscribers[:i], p.subscribers[i+1:]...)
			return true
		}
	}
	return false
}

func (p *JSONMessagePublisher) Publish(m JSONMessage) {
	p.m.RLock()
	for _, subscriber := range p.subscribers {
		// We give each subscriber a 100ms time window to receive the event,
		// after which we move to the next.
		select {
		case subscriber <- m:
		case <-time.After(100 * time.Millisecond):
		}
	}
	p.m.RUnlock()
}