text:
#import "CCBAnimationManager.h"
#import "CCBSequence.h"
#import "CCBSequenceProperty.h"
#import "CCBReader.h"
#import "CCBKeyframe.h"
//#import "SimpleAudioEngine.h"
#import <objc/runtime.h>

#import "CCDirector_Private.h"

#warning FIX Sounds

static NSInteger ccbAnimationManagerID = 0;

@implementation CCBAnimationManager

@synthesize sequences;
@synthesize autoPlaySequenceId;
@synthesize rootNode;
@synthesize rootContainerSize;
@synthesize owner;
@synthesize delegate;
@synthesize lastCompletedSequenceName;

- (id) init
{
    self = [super init];
    if (!self) return NULL;

    animationManagerId = ccbAnimationManagerID;
    ccbAnimationManagerID++;

    sequences = [[NSMutableArray alloc] init];
    nodeSequences = [[NSMutableDictionary alloc] init];
    baseValues = [[NSMutableDictionary alloc] init];

    return self;
}

- (CGSize) containerSize:(CCNode*)node
{
    if (node) return node.contentSize;
    else return rootContainerSize;
}

- (void) addNode:(CCNode*)node andSequences:(NSDictionary*)seq
{
    NSValue* nodePtr = [NSValue valueWithPointer:(__bridge const void *)(node)];
    [nodeSequences setObject:seq forKey:nodePtr];
}

- (void) moveAnimationsFromNode:(CCNode*)fromNode toNode:(CCNode*)toNode
{
    NSValue* fromNodePtr = [NSValue valueWithPointer:(__bridge const void *)(fromNode)];
    NSValue* toNodePtr = [NSValue valueWithPointer:(__bridge const void *)(toNode)];

    // Move base values
    id baseValue = [baseValues objectForKey:fromNodePtr];
    if (baseValue)
    {
        [baseValues setObject:baseValue forKey:toNodePtr];
        [baseValues removeObjectForKey:fromNodePtr];
    }

    // Move keyframes
    NSDictionary* seqs = [nodeSequences objectForKey:fromNodePtr];
    if (seqs)
    {
        [nodeSequences setObject:seqs forKey:toNodePtr];
        [nodeSequences removeObjectForKey:fromNodePtr];
    }
}

- (void) setBaseValue:(id)value forNode:(CCNode*)node propertyName:(NSString*)propName
{
    NSValue* nodePtr = [NSValue valueWithPointer:(__bridge const void *)(node)];

    NSMutableDictionary* props = [baseValues objectForKey:nodePtr];
    if (!props)
    {
        props = [NSMutableDictionary dictionary];
        [baseValues setObject:props forKey:nodePtr];
    }

    [props setObject:value forKey:propName];
}

- (id) baseValueForNode:(CCNode*) node propertyName:(NSString*) propName
{
    NSValue* nodePtr = [NSValue valueWithPointer:(__bridge const void *)(node)];

    NSMutableDictionary* props = [baseValues objectForKey:nodePtr];
    return [props objectForKey:propName];
}

- (int) sequenceIdForSequenceNamed:(NSString*)name
{
    for (CCBSequence* seq in sequences)
    {
        if ([seq.name isEqualToString:name])
        {
            return seq.sequenceId;
        }
    }
    return -1;
}

- (CCBSequence*) sequenceFromSequenceId:(int)seqId
{
    for (CCBSequence* seq in sequences)
    {
        if (seq.sequenceId == seqId) return seq;
    }
    return NULL;
}

- (CCActionInterval*) actionFromKeyframe0:(CCBKeyframe*)kf0 andKeyframe1:(CCBKeyframe*)kf1 propertyName:(NSString*)name node:(CCNode*)node
{
    float duration = kf1.time - kf0.time;

    if ([name isEqualToString:@"rotation"])
    {
        return [CCBRotateTo actionWithDuration:duration angle:[kf1.value floatValue]];
    }
    else if ([name isEqualToString:@"rotationX"])
    {
        return [CCBRotateXTo actionWithDuration:duration angle:[kf1.value floatValue]];
    }
    else if ([name isEqualToString:@"rotationY"])
    {
        return [CCBRotateYTo actionWithDuration:duration angle:[kf1.value floatValue]];
    }
    else if ([name isEqualToString:@"opacity"])
    {
        return [CCActionFadeTo actionWithDuration:duration opacity:[kf1.value intValue]];
    }
    else if ([name isEqualToString:@"color"])
    {
        ccColor3B c;
        [kf1.value getValue:&c];

        return [CCActionTintTo actionWithDuration:duration red:c.r green:c.g blue:c.b];
    }
    else if ([name isEqualToString:@"visible"])
    {
        if ([kf1.value boolValue])
        {
            return [CCActionSequence actionOne:[CCActionDelay actionWithDuration:duration] two:[CCActionShow action]];
        }
        else
        {
            return [CCActionSequence actionOne:[CCActionDelay actionWithDuration:duration] two:[CCActionHide action]];
        }
    }
    else if ([name isEqualToString:@"displayFrame"])
    {
        return [CCActionSequence actionOne:[CCActionDelay actionWithDuration:duration] two:[CCBSetSpriteFrame actionWithSpriteFrame:kf1.value]];
    }
    else if ([name isEqualToString:@"position"])
    {
        // Get position type
        //int type = [[[self baseValueForNode:node propertyName:name] objectAtIndex:2] intValue];

        id value = kf1.value;

        // Get relative position
        float x = [[value objectAtIndex:0] floatValue];
        float y = [[value objectAtIndex:1] floatValue];

        //CGSize containerSize = [self containerSize:node.parent];

        //CGPoint absPos = [node absolutePositionFromRelative:ccp(x,y) type:type parentSize:containerSize propertyName:name];

        return [CCActionMoveTo actionWithDuration:duration position:ccp(x,y)];
    }
    else if ([name isEqualToString:@"scale"])
    {
        // Get position type
        //int type = [[[self baseValueForNode:node propertyName:name] objectAtIndex:2] intValue];

        id value = kf1.value;

        // Get relative scale
        float x = [[value objectAtIndex:0] floatValue];
        float y = [[value objectAtIndex:1] floatValue];

        /*
        if (type == kCCBScaleTypeMultiplyResolution)
        {
            float resolutionScale = [node resolutionScale];
            x *= resolutionScale;
            y *= resolutionScale;
        }*/

        return [CCActionScaleTo actionWithDuration:duration scaleX:x scaleY:y];
    }
    else if ([name isEqualToString:@"skew"])
    {
        id value = kf1.value;

        float x = [[value objectAtIndex:0] floatValue];
        float y = [[value objectAtIndex:1] floatValue];

        return [CCActionSkewTo actionWithDuration:duration skewX:x skewY:y];
    }
    else
    {
        NSLog(@"CCBReader: Failed to create animation for property: %@", name);
    }
    return NULL;
}

- (void) setAnimatedProperty:(NSString*)name forNode:(CCNode*)node toValue:(id)value tweenDuration:(float) tweenDuration
{
    if (tweenDuration > 0)
    {
        // Create a fake keyframe to generate the action from
        CCBKeyframe* kf1 = [[CCBKeyframe alloc] init];
        kf1.value = value;
        kf1.time = tweenDuration;
        kf1.easingType = kCCBKeyframeEasingLinear;

        // Animate
        CCActionInterval* tweenAction = [self actionFromKeyframe0:NULL andKeyframe1:kf1 propertyName:name node:node];
        [node runAction:tweenAction];
    }
    else
    {
        // Just set the value

        if ([name isEqualToString:@"position"])
        {
            // Get position type
            //int type = [[[self baseValueForNode:node propertyName:name] objectAtIndex:2] intValue];

            // Get relative position
            float x = [[value objectAtIndex:0] floatValue];
            float y = [[value objectAtIndex:1] floatValue];
#ifdef __CC_PLATFORM_IOS
            [node setValue:[NSValue valueWithCGPoint:ccp(x,y)] forKey:name];
#elif defined (__CC_PLATFORM_MAC)
            [node setValue:[NSValue valueWithPoint:ccp(x,y)] forKey:name];
#endif

            //[node setRelativePosition:ccp(x,y) type:type parentSize:[self containerSize:node.parent] propertyName:name];
        }
        else if ([name isEqualToString:@"scale"])
        {
            // Get scale type
            //int type = [[[self baseValueForNode:node propertyName:name] objectAtIndex:2] intValue];

            // Get relative scale
            float x = [[value objectAtIndex:0] floatValue];
            float y = [[value objectAtIndex:1] floatValue];

            [node setValue:[NSNumber numberWithFloat:x] forKey:[name stringByAppendingString:@"X"]];
            [node setValue:[NSNumber numberWithFloat:y] forKey:[name stringByAppendingString:@"Y"]];

            //[node setRelativeScaleX:x Y:y type:type propertyName:name];
        }
        else if ([name isEqualToString:@"skew"])
        {
            node.skewX = [[value objectAtIndex:0] floatValue];
            node.skewY = [[value objectAtIndex:1] floatValue];
        }
        else
        {
            [node setValue:value forKey:name];
        }
    }
}

- (void) setFirstFrameForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)seqProp tweenDuration:(float)tweenDuration
{
    NSArray* keyframes = [seqProp keyframes];

    if (keyframes.count == 0)
    {
        // Use base value (no animation)
        id baseValue = [self baseValueForNode:node propertyName:seqProp.name];
        NSAssert1(baseValue, @"No baseValue found for property (%@)", seqProp.name);
        [self setAnimatedProperty:seqProp.name forNode:node toValue:baseValue tweenDuration:tweenDuration];
    }
    else
    {
        // Use first keyframe
        CCBKeyframe* keyframe = [keyframes objectAtIndex:0];
        [self setAnimatedProperty:seqProp.name forNode:node toValue:keyframe.value tweenDuration:tweenDuration];
    }
}

- (CCActionInterval*) easeAction:(CCActionInterval*) action easingType:(int)easingType easingOpt:(float) easingOpt
{
    if ([action isKindOfClass:[CCActionSequence class]]) return action;

    if (easingType == kCCBKeyframeEasingLinear)
    {
        return action;
    }
    else if (easingType == kCCBKeyframeEasingInstant)
    {
        return [CCActionEaseInstant actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingCubicIn)
    {
        return [CCActionEaseIn actionWithAction:action rate:easingOpt];
    }
    else if (easingType == kCCBKeyframeEasingCubicOut)
    {
        return [CCActionEaseOut actionWithAction:action rate:easingOpt];
    }
    else if (easingType == kCCBKeyframeEasingCubicInOut)
    {
        return [CCActionEaseInOut actionWithAction:action rate:easingOpt];
    }
    else if (easingType == kCCBKeyframeEasingBackIn)
    {
        return [CCActionEaseBackIn actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingBackOut)
    {
        return [CCActionEaseBackOut actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingBackInOut)
    {
        return [CCActionEaseBackInOut actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingBounceIn)
    {
        return [CCActionEaseBounceIn actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingBounceOut)
    {
        return [CCActionEaseBounceOut actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingBounceInOut)
    {
        return [CCActionEaseBounceInOut actionWithAction:action];
    }
    else if (easingType == kCCBKeyframeEasingElasticIn)
    {
        return [CCActionEaseElasticIn actionWithAction:action period:easingOpt];
    }
    else if (easingType == kCCBKeyframeEasingElasticOut)
    {
        return [CCActionEaseElasticOut actionWithAction:action period:easingOpt];
    }
    else if (easingType == kCCBKeyframeEasingElasticInOut)
    {
        return [CCActionEaseElasticInOut actionWithAction:action period:easingOpt];
    }
    else
    {
        NSLog(@"CCBReader: Unkown easing type %d", easingType);
        return action;
    }
}

- (void) removeActionsByTag:(NSInteger)tag fromNode:(CCNode*)node
{
    CCActionManager* am = [[CCDirector sharedDirector] actionManager];

    while ([am getActionByTag:tag target:node])
    {
        [am removeActionByTag:tag target:node];
    }
}

- (void) runActionsForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)seqProp tweenDuration:(float)tweenDuration
{
    NSArray* keyframes = [seqProp keyframes];
    int numKeyframes = (int)keyframes.count;

    if (numKeyframes > 1)
    {
        // Make an animation!
        NSMutableArray* actions = [NSMutableArray array];

        CCBKeyframe* keyframeFirst = [keyframes objectAtIndex:0];
        float timeFirst = keyframeFirst.time + tweenDuration;

        if (timeFirst > 0)
        {
            [actions addObject:[CCActionDelay actionWithDuration:timeFirst]];
        }

        for (int i = 0; i < numKeyframes - 1; i++)
        {
            CCBKeyframe* kf0 = [keyframes objectAtIndex:i];
            CCBKeyframe* kf1 = [keyframes objectAtIndex:i+1];

            CCActionInterval* action = [self actionFromKeyframe0:kf0 andKeyframe1:kf1 propertyName:seqProp.name node:node];
            if (action)
            {
                // Apply easing
                action = [self easeAction:action easingType:kf0.easingType easingOpt:kf0.easingOpt];

                [actions addObject:action];
            }
        }

        CCActionSequence* seq = [CCActionSequence actionWithArray:actions];
        seq.tag = animationManagerId;
        [node runAction:seq];
    }
}

- (id) actionForCallbackChannel:(CCBSequenceProperty*) channel
{
    float lastKeyframeTime = 0;

    NSMutableArray* actions = [NSMutableArray array];

    for (CCBKeyframe* keyframe in channel.keyframes)
    {
        float timeSinceLastKeyframe = keyframe.time - lastKeyframeTime;
        lastKeyframeTime = keyframe.time;
        if (timeSinceLastKeyframe > 0)
        {
            [actions addObject:[CCActionDelay actionWithDuration:timeSinceLastKeyframe]];
        }

        NSString* selectorName = [keyframe.value objectAtIndex:0];
        int selectorTarget = [[keyframe.value objectAtIndex:1] intValue];

        // Callback through obj-c
        id target = NULL;
        if (selectorTarget == kCCBTargetTypeDocumentRoot) target = self.rootNode;
        else if (selectorTarget == kCCBTargetTypeOwner) target = owner;

        SEL selector = NSSelectorFromString(selectorName);

        if (target && selector)
        {
            [actions addObject:[CCActionCallFunc actionWithTarget:target selector:selector]];
        }
    }

    if (!actions.count) return NULL;

    return [CCActionSequence actionWithArray:actions];
}

- (id) actionForSoundChannel:(CCBSequenceProperty*) channel
{
    float lastKeyframeTime = 0;

    NSMutableArray* actions = [NSMutableArray array];

    for (CCBKeyframe* keyframe in channel.keyframes)
    {
        float timeSinceLastKeyframe = keyframe.time - lastKeyframeTime;
        lastKeyframeTime = keyframe.time;
        if (timeSinceLastKeyframe > 0)
        {
            [actions addObject:[CCActionDelay actionWithDuration:timeSinceLastKeyframe]];
        }

        NSString* soundFile = [keyframe.value objectAtIndex:0];
        float pitch = [[keyframe.value objectAtIndex:1] floatValue];
        float pan = [[keyframe.value objectAtIndex:2] floatValue];
        float gain = [[keyframe.value objectAtIndex:3] floatValue];

        [actions addObject:[CCBSoundEffect actionWithSoundFile:soundFile pitch:pitch pan:pan gain:gain]];
    }

    if (!actions.count) return NULL;

    return [CCActionSequence actionWithArray:actions];
}

- (void) runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuration
{
    NSAssert(seqId != -1, @"Sequence id %d couldn't be found",seqId);

    // Stop actions associated with this animation manager
    [self removeActionsByTag:animationManagerId fromNode:rootNode];

    for (NSValue* nodePtr in nodeSequences)
    {
        CCNode* node = [nodePtr pointerValue];

        // Stop actions associated with this animation manager
        [self removeActionsByTag:animationManagerId fromNode:node];

        NSDictionary* seqs = [nodeSequences objectForKey:nodePtr];
        NSDictionary* seqNodeProps = [seqs objectForKey:[NSNumber numberWithInt:seqId]];

        NSMutableSet* seqNodePropNames = [NSMutableSet set];

        // Reset nodes that have sequence node properties, and run actions on them
        for (NSString* propName in seqNodeProps)
        {
            CCBSequenceProperty* seqProp = [seqNodeProps objectForKey:propName];
            [seqNodePropNames addObject:propName];

            [self setFirstFrameForNode:node sequenceProperty:seqProp tweenDuration:tweenDuration];
            [self runActionsForNode:node sequenceProperty:seqProp tweenDuration:tweenDuration];
        }

        // Reset the nodes that may have been changed by other timelines
        NSDictionary* nodeBaseValues = [baseValues objectForKey:nodePtr];
        for (NSString* propName in nodeBaseValues)
        {
            if (![seqNodePropNames containsObject:propName])
            {
                id value = [nodeBaseValues objectForKey:propName];

                if (value)
                {
                    [self setAnimatedProperty:propName forNode:node toValue:value tweenDuration:tweenDuration];
                }
            }
        }
    }

    // Make callback at end of sequence
    CCBSequence* seq = [self sequenceFromSequenceId:seqId];
    CCAction* completeAction = [CCActionSequence actionOne:[CCActionDelay actionWithDuration:seq.duration+tweenDuration] two:[CCActionCallFunc actionWithTarget:self selector:@selector(sequenceCompleted)]];
    completeAction.tag = animationManagerId;
    [rootNode runAction:completeAction];

    // Playback callbacks and sounds
    if (seq.callbackChannel)
    {
        // Build sound actions for channel
        CCAction* action = [self actionForCallbackChannel:seq.callbackChannel];
        if (action)
        {
            action.tag = animationManagerId;
            [self.rootNode runAction:action];
        }
    }

    if (seq.soundChannel)
    {
        // Build sound actions for channel
        CCAction* action = [self actionForSoundChannel:seq.soundChannel];
        if (action)
        {
            action.tag = animationManagerId;
            [self.rootNode runAction:action];
        }
    }

    // Set the running scene
    runningSequence = [self sequenceFromSequenceId:seqId];
}

- (void) runAnimationsForSequenceNamed:(NSString*)name tweenDuration:(float)tweenDuration
{
    int seqId = [self sequenceIdForSequenceNamed:name];
    [self runAnimationsForSequenceId:seqId tweenDuration:tweenDuration];
}

- (void) runAnimationsForSequenceNamed:(NSString*)name
{
    [self runAnimationsForSequenceNamed:name tweenDuration:0];
}

- (void) sequenceCompleted
{
    // Save last completed sequence
    if (lastCompletedSequenceName != runningSequence.name)
    {
        lastCompletedSequenceName = [runningSequence.name copy];
    }

    // Play next sequence
    int nextSeqId = runningSequence.chainedSequenceId;
    runningSequence = NULL;

    // Callbacks
    [delegate completedAnimationSequenceNamed:lastCompletedSequenceName];
    if (block) block(self);

    // Run next sequence if callbacks did not start a new sequence
    if (runningSequence == NULL && nextSeqId != -1)
    {
        [self runAnimationsForSequenceId:nextSeqId tweenDuration:0];
    }
}

- (NSString*) runningSequenceName
{
    return runningSequence.name;
}

-(void) setCompletedAnimationCallbackBlock:(void(^)(id sender))b
{
    block = [b copy];
}

/*
- (void) setCallFunc:(CCCallBlockN *)callFunc forJSCallbackNamed:(NSString *)callbackNamed
{
    [keyframeCallFuncs setObject:callFunc forKey:callbackNamed];
}
 */

- (void) dealloc
{
    self.rootNode = NULL;

}

- (void) debug
{
    //NSLog(@"baseValues: %@", baseValues);
    //NSLog(@"nodeSequences: %@", nodeSequences);
}

@end

#pragma mark Custom Actions

@implementation CCBSetSpriteFrame
+(id) actionWithSpriteFrame: (CCSpriteFrame*) sf;
{
	return [[self alloc]initWithSpriteFrame:sf];
}

-(id) initWithSpriteFrame: (CCSpriteFrame*) sf;
{
	if( (self=[super init]) )
		spriteFrame = sf;

	return self;
}

-(id) copyWithZone: (NSZone*) zone
{
	CCSpriteFrame *copy = [[[self class] allocWithZone: zone] initWithSpriteFrame:spriteFrame];
	return copy;
}

-(void) update:(CCTime)time
{
	((CCSprite *)self.target).spriteFrame = spriteFrame;
}

@end

@implementation CCBRotateTo

+(id) actionWithDuration:(CCTime)duration angle:(float)angle
{
    return [[self alloc] initWithDuration:duration angle:angle];
}

-(id) initWithDuration:(CCTime)duration angle:(float)angle
{
    self = [super initWithDuration:duration];
    if (!self) return NULL;

    dstAngle_ = angle;

    return self;
}

- (id) copyWithZone:(NSZone *)zone
{
    CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] angle:dstAngle_];
	return copy;
}

-(void) startWithTarget:(CCNode *)aTarget
{
	[super startWithTarget:aTarget];
    startAngle_ = [self.target rotation];
    diffAngle_ = dstAngle_ - startAngle_;
}

-(void) update: (CCTime) t
{
	[self.target setRotation: startAngle_ + diffAngle_ * t];
}

@end

@implementation CCBRotateXTo

-(void) startWithTarget:(CCNode *)aTarget
{
    _originalTarget = _target = aTarget;

    _elapsed = 0.0f;
	_firstTick = YES;

    startAngle_ = [self.target rotationalSkewX];
    diffAngle_ = dstAngle_ - startAngle_;
}

-(void) update: (CCTime) t
{
	[self.target setRotationalSkewX: startAngle_ + diffAngle_ * t];
}

@end

@implementation CCBRotateYTo

-(void) startWithTarget:(CCNode *)aTarget
{
	_originalTarget = _target = aTarget;

    _elapsed = 0.0f;
	_firstTick = YES;

    startAngle_ = [self.target rotationalSkewY];
    diffAngle_ = dstAngle_ - startAngle_;
}

-(void) update: (CCTime) t
{
	[self.target setRotationalSkewY: startAngle_ + diffAngle_ * t];
}

@end

@implementation CCBSoundEffect

+(id) actionWithSoundFile:(NSString*)f pitch:(float)pi pan:(float) pa gain:(float)ga
{
    return [[CCBSoundEffect alloc] initWithSoundFile:f pitch:pi pan:pa gain:ga];
}

-(id) initWithSoundFile:(NSString*)file pitch:(float)pi pan:(float) pa gain:(float)ga
{
    self = [super init];
    if (!self) return NULL;

    soundFile = [file copy];
    pitch = pi;
    pan = pa;
    gain = ga;

    return self;
}

- (void) update:(CCTime)time
{
#warning FIX Sounds
    //[[SimpleAudioEngine sharedEngine] playEffect:soundFile pitch:pitch pan:pan gain:gain];
}

@end

@implementation CCActionEaseInstant
-(void) update: (CCTime) t
{
    if (t < 0)
    {
        [self.inner update:0];
    }
    else
    {
        [self.inner update:1];
    }
}
@end


text:
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;

namespace ActionEngine {

	public static class TextExtension {

		public static void DummyForAlloc () {
		}

		private static Func<object, Color> AEColor_Getter = (t) => ((Text)t).color;
		private static Action<object, Color> AEColor_Setter = (t, k) => ((Text)t).color = k;

		public static ColorTweenAction AEColor (this Text obj, Color color, float duration) {
			return AE.Prepare<ColorTweenAction>()
				.SetGetterWithPayload(AEColor_Getter)
				.SetSetterWithPayload(AEColor_Setter)
				.SetPayload(obj)
				.SetEndValue(color)
				.SetDuration(duration);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.github.sandor_balazs.nosql_java.web.rest.dto;

import java.time.LocalDate;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;

/**
 * A DTO for the ProjectMilestone entity.
 */
public class ProjectMilestoneDTO implements Serializable {

    private Long id;

    private LocalDate planned;

    private LocalDate actual;

    private Long projectId;

    private String projectCode;

    private Long milestoneId;

    private String milestoneName;

    public Long getId() {
        return id;
    }

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

    public LocalDate getPlanned() {
        return planned;
    }

    public void setPlanned(LocalDate planned) {
        this.planned = planned;
    }

    public LocalDate getActual() {
        return actual;
    }

    public void setActual(LocalDate actual) {
        this.actual = actual;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public Long getMilestoneId() {
        return milestoneId;
    }

    public void setMilestoneId(Long milestoneId) {
        this.milestoneId = milestoneId;
    }

    public String getMilestoneName() {
        return milestoneName;
    }

    public void setMilestoneName(String milestoneName) {
        this.milestoneName = milestoneName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ProjectMilestoneDTO projectMilestoneDTO = (ProjectMilestoneDTO) o;

        if ( ! Objects.equals(id, projectMilestoneDTO.id)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "ProjectMilestoneDTO{" +
            "id=" + id +
            ", planned='" + planned + "'" +
            ", actual='" + actual + "'" +
            '}';
    }
}


text:
require_relative '../spec_helper'

RSpec.shared_examples 'builds with the requested Python version' do |python_version|
  it "builds with Python #{python_version}" do
    app.deploy do |app|
      expect(clean_output(app.output)).to include(<<~OUTPUT)
        remote: -----> Python app detected
        remote: -----> Installing python-#{python_version}
        remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
        remote: -----> Installing SQLite3
        remote: -----> Installing requirements with pip
        remote:        Collecting urllib3
      OUTPUT
      expect(app.run('python -V')).to include("Python #{python_version}")
    end
  end
end

RSpec.shared_examples 'aborts the build with a runtime not available message' do |requested_version|
  it 'aborts the build with a runtime not available message' do
    app.deploy do |app|
      expect(clean_output(app.output)).to include(<<~OUTPUT)
        remote: -----> Python app detected
        remote:  !     Requested runtime (python-#{requested_version}) is not available for this stack (#{app.stack}).
        remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
      OUTPUT
    end
  end
end

RSpec.describe 'Python version support' do
  context 'when no Python version is specified' do
    let(:buildpacks) { [:default] }
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_version_unspecified', buildpacks: buildpacks) }

    context 'with a new app' do
      it 'builds with the default Python version' do
        app.deploy do |app|
          expect(clean_output(app.output)).to include(<<~OUTPUT)
            remote: -----> Python app detected
            remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
          OUTPUT
        end
      end
    end

    context 'with an app last built using an older default Python version' do
      # This test performs an initial build using an older buildpack version, followed
      # by a build using the current version. This ensures that the current buildpack
      # can successfully read the version metadata written to the build cache in the past.
      let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v189'] }

      it 'builds with the same Python version as the last build' do
        app.deploy do |app|
          update_buildpacks(app, [:default])
          app.commit!
          app.push!
          # TODO: The build log should explain that sticky-versioning has occurred,
          # so that users know why their app is on an older Python version.
          expect(clean_output(app.output)).to include(<<~OUTPUT)
            remote: -----> Python app detected
            remote:  !     Python has released a security update! Please consider upgrading to python-#{LATEST_PYTHON_3_6}
            remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
          OUTPUT
          expect(app.run('python -V')).to include('Python 3.6.12')
        end
      end
    end
  end

  context 'when runtime.txt contains python-2.7.18' do
    let(:allow_failure) { false }
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_2.7', allow_failure: allow_failure) }

    context 'when using Heroku-16 or Heroku-18', stacks: %w[heroku-16 heroku-18] do
      it 'builds with Python 2.7.18' do
        app.deploy do |app|
          expect(clean_output(app.output)).to include(<<~OUTPUT)
            remote: -----> Python app detected
            remote:  !     Python 2 has reached its community EOL. Upgrade your Python runtime to maintain a secure application as soon as possible.
            remote:        Learn More: https://devcenter.heroku.com/articles/python-2-7-eol-faq
            remote: -----> Installing python-#{LATEST_PYTHON_2_7}
            remote: -----> Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2
            remote: -----> Installing SQLite3
            remote: -----> Installing requirements with pip
            remote:        Collecting urllib3
          OUTPUT
          expect(app.run('python -V')).to include("Python #{LATEST_PYTHON_2_7}")
        end
      end
    end

    context 'when using Heroku-20', stacks: %w[heroku-20] do
      let(:allow_failure) { true }

      # Python 2.7 is EOL, so it has not been built for Heroku-20.
      include_examples 'aborts the build with a runtime not available message', LATEST_PYTHON_2_7
    end
  end

  context 'when runtime.txt contains python-3.4.10' do
    let(:allow_failure) { false }
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.4', allow_failure: allow_failure) }

    context 'when using Heroku-16 or Heroku-18', stacks: %w[heroku-16 heroku-18] do
      it 'builds with Python 3.4.10' do
        app.deploy do |app|
          # The Pip deprecation warning is due to the newest Pip that works on Python 3.4
          # not supporting the `PIP_NO_PYTHON_VERSION_WARNING` env var.
          expect(clean_output(app.output)).to match(Regexp.new(<<~REGEX))
            remote: -----> Python app detected
            remote: -----> Installing python-#{LATEST_PYTHON_3_4}
            remote: -----> Installing pip 19.1.1, setuptools 43.0.0 and wheel 0.33.6
            remote: DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 \\(cf PEP 429\\).
            remote: -----> Installing SQLite3
            remote: -----> Installing requirements with pip
            remote:        DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 \\(cf PEP 429\\).
            remote:        Collecting urllib3 \\(from -r /tmp/build_.*/requirements.txt \\(line 1\\)\\)
          REGEX
          expect(app.run('python -V')).to include("Python #{LATEST_PYTHON_3_4}")
        end
      end
    end

    context 'when using Heroku-20', stacks: %w[heroku-20] do
      let(:allow_failure) { true }

      # Python 3.4 is EOL, so it has not been built for Heroku-20.
      include_examples 'aborts the build with a runtime not available message', LATEST_PYTHON_3_4
    end
  end

  context 'when runtime.txt contains python-3.5.10' do
    let(:allow_failure) { false }
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.5', allow_failure: allow_failure) }

    context 'when using Heroku-16 or Heroku-18', stacks: %w[heroku-16 heroku-18] do
      include_examples 'builds with the requested Python version', LATEST_PYTHON_3_5
    end

    context 'when using Heroku-20', stacks: %w[heroku-20] do
      let(:allow_failure) { true }

      # Python 3.5 is EOL, so it has not been built for Heroku-20.
      include_examples 'aborts the build with a runtime not available message', LATEST_PYTHON_3_5
    end
  end

  context 'when runtime.txt contains python-3.6.13' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.6') }

    include_examples 'builds with the requested Python version', LATEST_PYTHON_3_6
  end

  context 'when runtime.txt contains python-3.7.10' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.7') }

    include_examples 'builds with the requested Python version', LATEST_PYTHON_3_7
  end

  context 'when runtime.txt contains python-3.8.8' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.8') }

    include_examples 'builds with the requested Python version', LATEST_PYTHON_3_8
  end

  context 'when runtime.txt contains python-3.9.2' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.9') }

    include_examples 'builds with the requested Python version', LATEST_PYTHON_3_9
  end

  context 'when runtime.txt contains pypy2.7-7.3.2' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/pypy_2.7') }

    it 'builds with PyPy2.7 v7.3.2' do
      app.deploy do |app|
        expect(clean_output(app.output)).to include(<<~OUTPUT)
          remote: -----> Python app detected
          remote: -----> Installing pypy2.7-#{LATEST_PYPY_2_7}
          remote: -----> Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2
          remote: -----> Installing SQLite3
          remote: -----> Installing requirements with pip
          remote:        Collecting urllib3
        OUTPUT
        expect(app.run('python -V')).to include('Python 2.7', "PyPy #{LATEST_PYPY_2_7}")
      end
    end
  end

  context 'when runtime.txt contains pypy3.6-7.3.2' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/pypy_3.6') }

    it 'builds with PyPy3.6 v7.3.2' do
      app.deploy do |app|
        expect(clean_output(app.output)).to include(<<~OUTPUT)
          remote: -----> Python app detected
          remote: -----> Installing pypy3.6-#{LATEST_PYPY_3_6}
          remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
          remote: -----> Installing SQLite3
          remote: -----> Installing requirements with pip
          remote:        Collecting urllib3
        OUTPUT
        expect(app.run('python -V')).to include('Python 3.6', "PyPy #{LATEST_PYPY_3_6}")
      end
    end
  end

  context 'when runtime.txt contains an invalid python version string' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_version_invalid', allow_failure: true) }

    include_examples 'aborts the build with a runtime not available message', 'X.Y.Z'
  end

  context 'when runtime.txt contains stray whitespace' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/runtime_txt_with_stray_whitespace') }

    include_examples 'builds with the requested Python version', LATEST_PYTHON_3_9
  end

  context 'when there is only a runtime.txt and no requirements.txt', skip: 'not currently supported (W-8720280)' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/runtime_txt_only', allow_failure: true) }

    include_examples 'builds with the requested Python version', LATEST_PYTHON_3_9
  end

  context 'when the requested Python version has changed since the last build' do
    let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.6') }

    it 'builds with the new Python version after removing the old install' do
      app.deploy do |app|
        File.write('runtime.txt', "python-#{LATEST_PYTHON_3_9}")
        app.commit!
        app.push!
        # TODO: The output shouldn't say "installing from cache", since it's not.
        expect(clean_output(app.output)).to include(<<~OUTPUT)
          remote: -----> Python app detected
          remote: -----> Found python-#{LATEST_PYTHON_3_6}, removing
          remote: -----> No change in requirements detected, installing from cache
          remote: -----> Installing python-#{LATEST_PYTHON_3_9}
          remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
          remote: -----> Installing SQLite3
          remote: -----> Installing requirements with pip
          remote:        Collecting urllib3
        OUTPUT
      end
    end
  end
end


text:
<?php
namespace net\authorize\util;

class LogFactory
{
    private static $logger = NULL;
    public static function getLog($classType){
        if(NULL == self::$logger){
            self::$logger = new Log();
            if(defined('AUTHORIZENET_LOG_FILE')){
                self::$logger->setLogFile(AUTHORIZENET_LOG_FILE);
            }
        }
        return self::$logger;
    }
}
?>


text:
require_relative "../test_helper"

adapter = ENV["ADAPTER"]
abort "No adapter specified" unless adapter

puts "Using #{adapter}"
case adapter
when "mysql"
  require_relative "../support/mysql"
when "postgresql"
  require_relative "../support/postgresql"
when "mongoid"
  require_relative "../support/mongoid"
else
  require_relative "../support/sqlite"
end

require_relative "../support/query_methods_test"


text:
<?php
session_start();
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');

/* If access tokens are not available redirect to connect page. */
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
    header('Location: ./clearsessions.php');
}
/* Get user access tokens out of the session. */
$access_token = $_SESSION['access_token'];

/* Create a TwitterOauth object with consumer/user tokens. */
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);

/* If method is set change API call made. Test is called by default. */
$content = $connection->get('followers/ids', array('screen_name' => 'che2on', 'count' => '5000' , 'cursor' => '-1' ));
/* Some example calls */
//$connection->get('users/show', array('screen_name' => 'abraham'));
//$connection->post('statuses/update', array('status' => date(DATE_RFC822)));
//$connection->post('statuses/destroy', array('id' => 5437877770));

 //print_r('Here are your followers <5000');

 print_r($content); ?>


text:
var non_callable = 0;
non_callable();


text:
cask 'screens' do
  version '4.0.3,7986'
  sha256 'f2cbb75e665a834223153eb8030572825586322b731454e0c7ed0ed549e9bec8'

  # dl.devmate.com was verified as official when first introduced to the cask
  url "https://dl.devmate.com/com.edovia.screens4.mac/Screens#{version.major}.dmg"
  appcast "https://updates.devmate.com/com.edovia.screens#{version.major}.mac.xml",
          checkpoint: '1820bb69ff0728e49cc2f53379052d091da5b9d0fa1cb190698b0a4a181810f8'
  name 'Screens'
  homepage 'https://edovia.com/screens-mac/'

  app "Screens #{version.major}.app"

  uninstall launchctl: 'com.edovia.screens.launcher',
            quit:      "com.edovia.screens#{version.major}.mac"

  zap delete: [
                "~/Library/Application Scripts/com.edovia.screens#{version.major}.mac",
                "~/Library/Containers/com.edovia.screens#{version.major}.mac",
                '~/Library/Logs/Screens',
              ]
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Plataforma de Aprendizagem</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/shop-homepage.css" rel="stylesheet">

                  <input type="text" class="form-control" placeholder="Pesquisar um curso">

                    <button class="btn btn-default" type="button"> Pesquisar</button>

Aprendizagem

                  <button class="btn"> Página Inicial</button>

                    Entrar na conta:

                    <button style="width:80%" class="btn btn-primary raised" data-toggle="modal" data-target="#facebookModal">Facebook</button>

                    <button style="width:80%" class="btn btn-danger raised" data-toggle="modal" data-target="#googleModal">Google</button>

                    Perfil

                    <button class="btn"> Meus Cursos</button>

                    <button class="btn"> Sair</button>

              <button type="button" class="close" data-dismiss="modal">×</button>

Facebook

                  Email:
                  <input type="text" class="form-control" id="usr" placeholder="abc@gmail.com">

                  Palavra-passe:
                  <input type="password" class="form-control" id="pwd">

              <button type="button" class="btn btn-danger" data-dismiss="modal"> Cancelar</button>
              <button class="btn btn-success"> Entrar</button>

              <button type="button" class="close" data-dismiss="modal">×</button>

Google

                  Email:
                  <input type="text" class="form-control" id="usr" placeholder="abc@gmail.com">

                  Palavra-passe:
                  <input type="password" class="form-control" id="pwd">

              <button type="button" class="btn btn-danger" data-dismiss="modal"> Cancelar</button>
              <button class="btn btn-success"> Entrar</button>

Seleccionar categoria

                  Artes
                  Ciências
                  Línguas
                  Hobbies

Cursos populares

10€

Inglês

8€

Matemática

5€

Informática

8€

História

10€

Jardinagem

10€

Corte e costura


text:
#include "ifftw-mpi.h"

/* During planning, if any process fails to create a plan then
   all of the processes must fail.  This synchronization is implemented
   by the following routine.

   Instead of
        if (failure) goto nada;
   we instead do:
        if (any_true(failure, comm)) goto nada;
*/

int XM(any_true)(int condition, MPI_Comm comm)
{
     int result;
     MPI_Allreduce(&condition, &result, 1, MPI_INT, MPI_LOR, comm);
     return result;
}

/***********************************************************************/

#if defined(FFTW_DEBUG)
/* for debugging, we include an assertion to make sure that
   MPI problems all produce equal hashes, as checked by this routine: */

int XM(md5_equal)(md5 m, MPI_Comm comm)
{
     unsigned long s0[4];
     int i, eq_me, eq_all;

     X(md5end)(&m);
     for (i = 0; i < 4; ++i) s0[i] = m.s[i];
     MPI_Bcast(s0, 4, MPI_UNSIGNED_LONG, 0, comm);
     for (i = 0; i < 4 && s0[i] == m.s[i]; ++i) ;
     eq_me = i == 4;
     MPI_Allreduce(&eq_me, &eq_all, 1, MPI_INT, MPI_LAND, comm);
     return eq_all;
}
#endif


text:
namespace mediapipe {
namespace {

using ::mediapipe::tasks::metadata::ModelMetadataExtractor;
using ::testing::ElementsAreArray;

constexpr int kNumInputTensorsForBert = 3;
constexpr int kBertMaxSeqLen = 128;
constexpr absl::string_view kTestModelPath =
    "mediapipe/tasks/testdata/text/bert_text_classifier.tflite";

absl::StatusOr<std::vector<std::vector<int>>> RunBertPreprocessorCalculator(
    absl::string_view text, absl::string_view model_path) {
  auto graph_config = ParseTextProtoOrDie<CalculatorGraphConfig>(
      absl::Substitute(R"(
        input_stream: "text"
        output_stream: "tensors"
        node {
          calculator: "BertPreprocessorCalculator"
          input_stream: "TEXT:text"
          input_side_packet: "METADATA_EXTRACTOR:metadata_extractor"
          output_stream: "TENSORS:tensors"
          options {
            [mediapipe.BertPreprocessorCalculatorOptions.ext] {
              bert_max_seq_len: $0
            }
          }
        }
      )",
                       kBertMaxSeqLen));
  std::vector<Packet> output_packets;
  tool::AddVectorSink("tensors", &graph_config, &output_packets);

  std::string model_buffer = tasks::core::LoadBinaryContent(model_path.data());
  ASSIGN_OR_RETURN(std::unique_ptr<ModelMetadataExtractor> metadata_extractor,
                   ModelMetadataExtractor::CreateFromModelBuffer(
                       model_buffer.data(), model_buffer.size()));
  // Run the graph.
  CalculatorGraph graph;
  MP_RETURN_IF_ERROR(graph.Initialize(
      graph_config,
      {{"metadata_extractor",
        MakePacket<ModelMetadataExtractor>(std::move(*metadata_extractor))}}));
  MP_RETURN_IF_ERROR(graph.StartRun({}));
  MP_RETURN_IF_ERROR(graph.AddPacketToInputStream(
      "text", MakePacket<std::string>(text).At(Timestamp(0))));
  MP_RETURN_IF_ERROR(graph.WaitUntilIdle());

  if (output_packets.size() != 1) {
    return absl::InvalidArgumentError(absl::Substitute(
        "output_packets has size $0, expected 1", output_packets.size()));
  }
  const std::vector<Tensor>& tensor_vec =
      output_packets[0].Get<std::vector<Tensor>>();
  if (tensor_vec.size() != kNumInputTensorsForBert) {
    return absl::InvalidArgumentError(
        absl::Substitute("tensor_vec has size $0, expected $1",
                         tensor_vec.size(), kNumInputTensorsForBert));
  }

  std::vector<std::vector<int>> results;
  for (int i = 0; i < kNumInputTensorsForBert; i++) {
    const Tensor& tensor = tensor_vec[i];
    if (tensor.element_type() != Tensor::ElementType::kInt32) {
      return absl::InvalidArgumentError("Expected tensor element type kInt32");
    }
    auto* buffer = tensor.GetCpuReadView().buffer<int>();
    std::vector<int> buffer_view(buffer, buffer + kBertMaxSeqLen);
    results.push_back(buffer_view);
  }
  MP_RETURN_IF_ERROR(graph.CloseAllPacketSources());
  MP_RETURN_IF_ERROR(graph.WaitUntilDone());
  return results;
}

TEST(BertPreprocessorCalculatorTest, TextClassifierWithBertModel) {
  std::vector<std::vector<int>> expected_result = {
      {101, 2009, 1005, 1055, 1037, 11951, 1998, 2411, 12473, 4990, 102}};
  // segment_ids
  expected_result.push_back(std::vector(kBertMaxSeqLen, 0));
  // input_masks
  expected_result.push_back(std::vector(expected_result[0].size(), 1));
  expected_result[2].resize(kBertMaxSeqLen);
  // padding input_ids
  expected_result[0].resize(kBertMaxSeqLen);

  MP_ASSERT_OK_AND_ASSIGN(
      std::vector<std::vector<int>> processed_tensor_values,
      RunBertPreprocessorCalculator(
          "it's a charming and often affecting journey", kTestModelPath));
  EXPECT_THAT(processed_tensor_values, ElementsAreArray(expected_result));
}

TEST(BertPreprocessorCalculatorTest, LongInput) {
  std::stringstream long_input;
  long_input
      << "it's a charming and often affecting journey and this is a long";
  for (int i = 0; i < kBertMaxSeqLen; ++i) {
    long_input << " long";
  }
  long_input << " movie review";
  std::vector<std::vector<int>> expected_result = {
      {101, 2009, 1005, 1055, 1037, 11951, 1998, 2411, 12473, 4990, 1998, 2023,
       2003, 1037}};
  // "long" id
  expected_result[0].resize(kBertMaxSeqLen - 1, 2146);
  // "[SEP]" id
  expected_result[0].push_back(102);
  // segment_ids
  expected_result.push_back(std::vector(kBertMaxSeqLen, 0));
  // input_masks
  expected_result.push_back(std::vector(kBertMaxSeqLen, 1));

  MP_ASSERT_OK_AND_ASSIGN(
      std::vector<std::vector<int>> processed_tensor_values,
      RunBertPreprocessorCalculator(long_input.str(), kTestModelPath));
  EXPECT_THAT(processed_tensor_values, ElementsAreArray(expected_result));
}

}  // namespace
}  // namespace mediapipe


text:
import { createStore, applyMiddleware } from 'redux';
import { createEpicMiddleware } from 'redux-observable';
import reducer from './reducer';
import { compose } from 'recompose';
import epic from './epic';

// tslint:disable-next-line:no-any
const composeEnhancers =
    // tslint:disable-next-line:no-any
    (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const epicMiddleware = createEpicMiddleware(epic, {
    dependencies: {  }
});

export const configureStore = () => (
    createStore(
        reducer,
        composeEnhancers(applyMiddleware(epicMiddleware))
    )
);


text:
package gw.internal.schema.gw.xsd.w3c.xmlschema.anonymous.types.complex;

/***************************************************************************/
/* THIS IS AUTOGENERATED CODE - DO NOT MODIFY OR YOUR CHANGES WILL BE LOST */
/* THIS CODE CAN BE REGENERATED USING 'xsd-codegen'                        */
/***************************************************************************/
public class Annotation extends gw.internal.schema.gw.xsd.w3c.xmlschema.types.complex.OpenAttrs implements gw.internal.xml.IXmlGeneratedClass {

  public static final javax.xml.namespace.QName $ATTRIBUTE_QNAME_Id = new javax.xml.namespace.QName( "", "id", "" );
  public static final javax.xml.namespace.QName $ELEMENT_QNAME_Appinfo = new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "appinfo", "xs" );
  public static final javax.xml.namespace.QName $ELEMENT_QNAME_Documentation = new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "documentation", "xs" );
  public static final gw.util.concurrent.LockingLazyVar<gw.lang.reflect.IType> TYPE = new gw.util.concurrent.LockingLazyVar<gw.lang.reflect.IType>( gw.lang.reflect.TypeSystem.getGlobalLock() ) {
          @Override
          protected gw.lang.reflect.IType init() {
            return gw.lang.reflect.TypeSystem.getByFullName( "gw.xsd.w3c.xmlschema.anonymous.types.complex.Annotation" );
          }
        };
  private static final gw.util.concurrent.LockingLazyVar<java.lang.Object> SCHEMAINFO = new gw.util.concurrent.LockingLazyVar<java.lang.Object>( gw.lang.reflect.TypeSystem.getGlobalLock() ) {
          @Override
          protected java.lang.Object init() {
            gw.lang.reflect.IType type = TYPE.get();
            return getSchemaInfoByType( type );
          }
        };

  public Annotation() {
    super( TYPE.get(), SCHEMAINFO.get() );
  }

  protected Annotation( gw.lang.reflect.IType type, java.lang.Object schemaInfo ) {
    super( type, schemaInfo );
  }

  public java.util.List<gw.internal.schema.gw.xsd.w3c.xmlschema.Appinfo> Appinfo() {
    //noinspection unchecked
    return (java.util.List<gw.internal.schema.gw.xsd.w3c.xmlschema.Appinfo>) TYPE.get().getTypeInfo().getProperty( "Appinfo" ).getAccessor().getValue( this );
  }

  public void setAppinfo$( java.util.List<gw.internal.schema.gw.xsd.w3c.xmlschema.Appinfo> param ) {
    TYPE.get().getTypeInfo().getProperty( "Appinfo" ).getAccessor().setValue( this, param );
  }

  public java.util.List<gw.internal.schema.gw.xsd.w3c.xmlschema.Documentation> Documentation() {
    //noinspection unchecked
    return (java.util.List<gw.internal.schema.gw.xsd.w3c.xmlschema.Documentation>) TYPE.get().getTypeInfo().getProperty( "Documentation" ).getAccessor().getValue( this );
  }

  public void setDocumentation$( java.util.List<gw.internal.schema.gw.xsd.w3c.xmlschema.Documentation> param ) {
    TYPE.get().getTypeInfo().getProperty( "Documentation" ).getAccessor().setValue( this, param );
  }

  public java.lang.String Id() {
    return (java.lang.String) TYPE.get().getTypeInfo().getProperty( "Id" ).getAccessor().getValue( this );
  }

  public void setId$( java.lang.String param ) {
    TYPE.get().getTypeInfo().getProperty( "Id" ).getAccessor().setValue( this, param );
  }

  @SuppressWarnings( {"UnusedDeclaration"} )
  private static final long FINGERPRINT = -3788403261967307401L;

}


text:
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.Diagnostics
Imports Microsoft.CodeAnalysis.VisualBasic
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports System.Collections.Immutable

Namespace Performance
    <DiagnosticAnalyzer(LanguageNames.VisualBasic)>
    Public Class RemoveWhereWhenItIsPossibleAnalyzer
        Inherits DiagnosticAnalyzer

        Public Shared ReadOnly Id As String = DiagnosticId.RemoveWhereWhenItIsPossible.ToDiagnosticId()
        Public Const Title As String = "You should remove the 'Where' invocation when it is possible."
        Public Const MessageFormat As String = "You can remove 'Where' moving the predicate to '{0}'."
        Public Const Category As String = SupportedCategories.Performance
        Public Const Description As String = "When a LINQ operator supports a predicate parameter it should be used instead of using 'Where' followed by the operator"
        Protected Shared Rule As DiagnosticDescriptor = New DiagnosticDescriptor(
            Id,
            Title,
            MessageFormat,
            Category,
            DiagnosticSeverity.Warning,
            isEnabledByDefault:=True,
            description:=Description,
            helpLinkUri:=HelpLink.ForDiagnostic(DiagnosticId.RemoveWhereWhenItIsPossible))

        Public Overrides ReadOnly Property SupportedDiagnostics() As ImmutableArray(Of DiagnosticDescriptor) = ImmutableArray.Create(Rule)

        Shared ReadOnly supportedMethods() As String = {"First", "FirstOrDefault", "Last", "LastOrDefault", NameOf(Any), "Single", "SingleOrDefault", "Count"}

        Public Overrides Sub Initialize(context As AnalysisContext)
            context.RegisterSyntaxNodeAction(AddressOf AnalyzeNode, SyntaxKind.InvocationExpression)
        End Sub

        Private Sub AnalyzeNode(context As SyntaxNodeAnalysisContext)
            If (context.IsGenerated()) Then Return
            Dim whereInvoke = DirectCast(context.Node, InvocationExpressionSyntax)
            If GetNameOfTheInvokeMethod(whereInvoke) <> "Where" Then Exit Sub

            Dim nextMethodInvoke = whereInvoke.Parent.FirstAncestorOrSelf(Of InvocationExpressionSyntax)()

            Dim candidate = GetNameOfTheInvokeMethod(nextMethodInvoke)
            If Not supportedMethods.Contains(candidate) Then Exit Sub

            If nextMethodInvoke.ArgumentList.Arguments.Any Then Return

            Dim diag = Diagnostic.Create(Rule, GetNameExpressionOfTheInvokedMethod(whereInvoke).GetLocation(), candidate)

            context.ReportDiagnostic(diag)
        End Sub

        Friend Shared Function GetNameOfTheInvokeMethod(invoke As InvocationExpressionSyntax) As String
            If (invoke Is Nothing) Then Return Nothing
            Dim memberAccess = invoke.ChildNodes.
            OfType(Of MemberAccessExpressionSyntax).
            FirstOrDefault()

            Return GetNameExpressionOfTheInvokedMethod(invoke)?.ToString()
        End Function

        Friend Shared Function GetNameExpressionOfTheInvokedMethod(invoke As InvocationExpressionSyntax) As SimpleNameSyntax
            If invoke Is Nothing Then Return Nothing

            Dim memberAccess = invoke.ChildNodes.
            OfType(Of MemberAccessExpressionSyntax)().
            FirstOrDefault()

            Return memberAccess?.Name

        End Function

    End Class
End Namespace


text:
@implementation BaseTextField

- (instancetype)initWithAccount{
    if (self = [super init]) {
        self.frame = CGRectMake(0, 0, ScreenWidth, inputTextHeight);
        self.font = appFontSize(14);
        self.clearButtonMode = UITextFieldViewModeAlways;
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (instancetype)initWithPassword{
    if (self = [super init]) {
        self.frame = CGRectMake(0, 0, ScreenWidth, inputTextHeight);
        self.font = appFontSize(14);
        self.clearButtonMode = UITextFieldViewModeAlways;
        self.backgroundColor = [UIColor whiteColor];
        self.secureTextEntry = YES;
    }
    return self;
}
@end


text:
import {DetailedError} from "../base/DetailedError.js"
import {GateDrawParams} from "../draw/GateDrawParams.js"
import {Complex} from "../math/Complex.js"
import {Matrix} from "../math/Matrix.js"

/**
 * Describes a quantum operation that may vary with time.
 */
class Gate {
    constructor() {
        /** @type {!string} The text shown when drawing the gate. */
        this.symbol = '';
        /** @type {!string} The identifier text used for the gate when serializing/parsing JSON. */
        this.serializedId = '';
        /** @type {!string} The title text of gate tooltips. */
        this.name = '';
        /** @type {!string} Detail text of gate tooltips. */
        this.blurb = '';
        /** @type {!int} The number of columns the gate spans on a circuit. Controls go on the first column. */
        this.width = 1;
        /** @type {!int} The number of wires the gate spans on a circuit. */
        this.height = 1;
        /** @type {undefined|!string|!number|!Array} A custom value that gets serialized.
         *     Each gate may use it to determine behavior. */
        this.param = undefined;
        /**
         * Updates gate properties based on a new parameter value.
         * Called by `Gate.withParam` before returning its result.
         * @type {!function(gate: !Gate): undefined}
         * @private
         */
        this._withParamRecomputeFunc = g => {};

        /** @type {undefined|!function(!GateDrawParams) : void} Draws the gate. A default is used when undefined. */
        this.customDrawer = undefined;
        /** @type{undefined|!function(!Gate) : !Gate} */
        this.onClickGateFunc = undefined;
        /** @type {undefined|*} Used to stash error information when parsing goes bad. */
        this.tag = undefined;
        /**
         * An operation applied during the 'setup' phase of computing a column.
         * NOT AFFECTED BY CONTROLS.
         * @type {undefined|!function(!CircuitEvalContext) : void}
         */
        this.customBeforeOperation = undefined;
        /**
         * An operation applied during the main phase of computing a column.
         * @type {undefined|!function(!CircuitEvalContext) : void}
         */
        this.customOperation = undefined;
        /**
         * An operation applied during the 'cleanup' phase of computing a column.
         * Usually the inverse of the before operation.
         * NOT AFFECTED BY CONTROLS.
         * @type {undefined|!function(!CircuitEvalContext) : void}
         */
        this.customAfterOperation = undefined;
        /**
         * Produces a texture containing information that can be used by the drawing code of display gates.
         * @type {undefined|!function(!CircuitEvalContext) : !WglTexture|!Array.<!WglTexture>}
         */
        this.customStatTexturesMaker = undefined;
        /**
         * Returns some more useful form of the pixel data read from the custom-stat texture.
         * @type {undefined|!function(!Float32Array, !CircuitDefinition, !int, !int) : *}
         */
        this.customStatPostProcesser = undefined;
        /**
         * Returns a json form of the custom-stat data, used when exporting it.
         * @type {undefined|!function(data: *) : *}
         */
        this.processedStatsToJsonFunc = undefined;
        /** @type {!Array.<!Gate>} A list of size variants of this gate.*/
        this.gateFamily = [this];

        /** @type {!boolean} Determines if vertical lines are drawn between this gate and controls. */
        this.interestedInControls = true;
        /**
         * Determines if circuits containing this gate need to actively animate.
         * @type {undefined|Infinity|!number}
         * @private
         */
        this._stableDuration = undefined;
        /**
         * Determines the gate's operation (if no shader is specified).
         * @type {undefined|!Matrix}
         * @private
         */
        this._knownMatrix = undefined;
        /**
         * Determines the gate's time-varying operation (if no shader is specified).
         * @type {undefined|!function(time: !number) : !Matrix}
         * @private
         */
        this._knownMatrixFunc = undefined;
        /**
         * Indicates whether the gate can just be skipped over when computing.
         * @type {!boolean}
         * @private
         */
        this._hasNoEffect = false;
        /**
         * Indicates whether the gate's effect is classical, and so can apply to measured bits but perhaps not
         * combinations of measured and unmeasured bits.
         * @type {undefined|!boolean}
         * @private
         */
        this._effectPermutesStates = undefined;
        /**
         * Indicates whether the gate's effect is inherent quantum (w.r.t. the Z basis), and so is not safe to apply
         * to measured bits.
         * @type {undefined|!boolean}
         * @private
         */
        this._effectCreatesSuperpositions = undefined;
        /**
         * Indicates whether vertical lines should be drawn from this gate to gate's marked as controllable.
         * @type {!boolean}
         */
        this.isControlWireSource = false;
        /**
         * A circuit that is equivalent to this gate.
         * If no shader or matrix is specified, the circuit will be recursed into to compute the gate.
         * @type {undefined|!CircuitDefinition}
         */
        this.knownCircuit = undefined;
        /**
         * A cached version of the circuit equivalent to this gate, with slightly looser disabled reasons, used when
         * drawing tooltips.
         * @type {undefined|!CircuitDefinition}
         */
        this.knownCircuitNested = undefined;
        /**
         * Indicates context (such as 'Input Range A') that must be provided by other gates in the same column, or
         * earlier in the circuit in some cases, in order for this gate to function.
         * Doesn't include keys inherited from the gate's circuit (if known).
         * @type {!Array.<!string>}
         */
        this._requiredContextKeys = [];
        /**
         * Indicates whether the simulator needs to compute a qubit density matrix at locations/times where this gate is
         * placed.
         * @type {!boolean}
         */
        this.isSingleQubitDisplay = false;

        /**
         * Determines if this gate conditions or anti-conditions other operations or not.
         * Note that 'False' means 'anti-control', not 'not a control'. Use undefined for 'not a control'. Also,
         * this value may be set to "parity" to indicate a parity control.
         * Non-computational-basis controls also use this mechanism, but with before/after operations.
         * @type {undefined|!string|!boolean}
         * @private
         */
        this._controlBit = undefined;
        /**
         * Determines if a controlled gate's control is guaranteed to be known classically. This is used by the
         * combination detect-control-reset gates as a way to communicate that they can control permutation operations
         * on classical wires.
         * @type {boolean}
         * @private
         */
        this._isClassicalControl = false;
        /**
         * Indicates that this gate is guaranteed to preserve probability (as opposed to e.g. post-selection).
         * When gates with this property not set to true are present in a column, the simulator computes losses/gains.
         * @type {!boolean}
         * @private
         */
        this._isDefinitelyUnitary = false;
        /**
         * The alternate gate for this one, used when shift+alt dragging.
         * @type {!Gate}
         */
        this.alternate = this;
        /**
         * Returns context provided by this gate to other gates in the same column (or later columns in some cases).
         * @param {!int} qubit
         * @param {!Gate} gate
         * @returns {!Array.<!{key: !string, val: *}>}
         */
        this.customColumnContextProvider = (qubit, gate) => [];
        /** @type {!boolean} Determines if context generated by this gate sticks around for later columns or not. */
        this.isContextTemporary = true;
        /**
         * Checks for non-standard reasons that a gate should be disabled (e.g. modulus too big to fit in target).
         * @param {!GateCheckArgs} args
         * @returns {undefined|!string}
         */
        this.customDisableReasonFinder = args => undefined;
        /**
         * Indicates that a gate is a re-arrangement of the wires equivalent to the given function.
         * @type {undefined | !function(!int) : !int}
         */
        this.knownBitPermutationFunc = undefined;
        /**
         * When a permutation factors into sub-permutations over subsets of the bits, this map indexes each bit with
         * an id for the group that it belongs to.
         * @type {!Array.<!int>}
         */
        this.knownBitPermutationGroupMasks = undefined;
        /**
         * Indicates that a gate is a phasing function, and that it phases each computation basis state by the amount
         * returned by this function.
         * @type {undefined | !function(state: !int) : !number}
         */
        this.knownPhaseTurnsFunc = undefined;
        /**
         * Indicates that a gate is a re-arrangement of the basis states equivalent to the given function.
         * Used by all-gate tests to check that shaders are behaving correctly.
         * @type {
         *      !function(val: !int) : !int |
         *      !function(val: !int, a: !int) : !int |
         *      !function(val: !int, a: !int, b: !int) : !int |
         *      !function(val: !int, inputs: ...!int) : !int
         *  }
         */
        this.knownPermutationFuncTakingInputs = undefined;

        /**
         * Indicates that this gate should be shown as if it was not localized to the wires it is placed on, even if
         * this gate has no direct effect on the state vector.
         *
         * Example: used by SetInput gates, which technically have no effect but do change gates on far away wires.
         *
         * @type {boolean}
         * @private
         */
        this._showAsReachesOtherWires = false;
    }

    /**
     * @param {!string} symbol
     * @param {!Matrix} matrix
     * @param {!string} name
     * @param {!string} blurb
     * @param {undefined|!string} serializedId
     * @param {undefined|!Gate=} alternate
     * @returns {!Gate}
     */
    static fromKnownMatrix(symbol, matrix, name='', blurb='', serializedId=undefined, alternate=undefined) {
        if (!(matrix instanceof Matrix)) {
            throw new DetailedError("Bad matrix.", {symbol, matrix, name, blurb});
        }
        let builder = new GateBuilder().
            setSymbol(symbol).
            setSerializedId(serializedId === undefined ? symbol : serializedId).
            setTitle(name).
            setBlurb(blurb).
            setKnownEffectToMatrix(matrix);
        if (alternate !== undefined) {
            builder = builder.setAlternate(alternate);
        }
        return builder.gate;
    }

    /**
     * Returns a copy of this gate which can be safely mutated.
     * @private
     * @returns {!Gate}
     */
    _copy() {
        let g = new Gate();
        g.symbol = this.symbol;
        g.name = this.name;
        g.blurb = this.blurb;
        g.alternate = this.alternate;
        g.serializedId = this.serializedId;
        g.onClickGateFunc = this.onClickGateFunc;
        g.tag = this.tag;
        g.param = this.param;
        g.customDrawer = this.customDrawer;
        g.interestedInControls = this.interestedInControls;
        g.customBeforeOperation = this.customBeforeOperation;
        g.knownBitPermutationFunc = this.knownBitPermutationFunc;
        g.customOperation = this.customOperation;
        g.customAfterOperation = this.customAfterOperation;
        g.customStatTexturesMaker = this.customStatTexturesMaker;
        g.customStatPostProcesser = this.customStatPostProcesser;
        g.processedStatsToJsonFunc = this.processedStatsToJsonFunc;
        g.width = this.width;
        g.height = this.height;
        g.isSingleQubitDisplay = this.isSingleQubitDisplay;
        g._knownMatrix = this._knownMatrix;
        g.knownCircuit = this.knownCircuit;
        g._showAsReachesOtherWires = this._showAsReachesOtherWires;
        g.isContextTemporary = this.isContextTemporary;
        g.knownCircuitNested = this.knownCircuitNested;
        g._requiredContextKeys = this._requiredContextKeys;
        g._knownMatrixFunc = this._knownMatrixFunc;
        g._stableDuration = this._stableDuration;
        g._withParamRecomputeFunc = this._withParamRecomputeFunc;
        g._hasNoEffect = this._hasNoEffect;
        g._effectPermutesStates = this._effectPermutesStates;
        g._effectCreatesSuperpositions = this._effectCreatesSuperpositions;
        g._affectsOtherWires = this._affectsOtherWires;
        g._controlBit = this._controlBit;
        g._isClassicalControl = this._isClassicalControl;
        g.isControlWireSource = this.isControlWireSource;
        g._isDefinitelyUnitary = this._isDefinitelyUnitary;
        g.knownPhaseTurnsFunc = this.knownPhaseTurnsFunc;
        g.knownPermutationFuncTakingInputs = this.knownPermutationFuncTakingInputs;
        g.customColumnContextProvider = this.customColumnContextProvider;
        g.customDisableReasonFinder = this.customDisableReasonFinder;
        g.knownBitPermutationGroupMasks = this.knownBitPermutationGroupMasks;
        return g;
    }

    /**
     * Sets an arbitrary json value, saved and restored with the circuit, that the gate's custom functions may use.
     * @param {undefined|!string|!number|!Array} value
     * @returns {!Gate}
     */
    withParam(value) {
        let g = this._copy();
        g.param = value;
        g._withParamRecomputeFunc(g);
        return g;
    }

    /**
     * Creates size-variants of a gate that can be resized between.
     * @param {!int} minSize
     * @param {!int} maxSize
     * @param {!function(span: !int, builder: !GateBuilder)} gateBuildFunc
     * @returns {!{all: !Array.<!Gate>, ofSize: !function(!int) : !Gate}}
     */
    static buildFamily(minSize, maxSize, gateBuildFunc) {
        let gates = [];
        for (let span = minSize; span <= maxSize; span++) {
            let builder = new GateBuilder();
            builder.setHeight(span);
            gateBuildFunc(span, builder);
            builder.gate.gateFamily = gates;
            gates.push(builder.gate);
        }

        let ofSize = h => {
            for (let g of gates) {
                if (g.height === h) {
                    return g;
                }
            }
            return undefined;
        };

        return {all: gates, ofSize};
    }

    /**
     * Returns context keys required by this gate, including keys inherited from its custom circuit (if applicable).
     * @returns {!Set.<!String>}
     */
    getUnmetContextKeys() {
        let result = new Set(this._requiredContextKeys);
        if (this.knownCircuit !== undefined) {
            for (let key of this.knownCircuit.getUnmetContextKeys()) {
                result.add(key);
            }
        }
        return result;
    }

    /**
     * @returns {!boolean}
     */
    shouldShowAsHavingGlobalEffect() {
        return this._showAsReachesOtherWires || !this._isDefinitelyUnitary;
    }

    /**
     * @returns {!boolean}
     */
    canChangeInSize() {
        return this.gateFamily.length > 1;
    }

    /**
     * @returns {!boolean}
     */
    canIncreaseInSize() {
        return !this.gateFamily.every(e => e.height !== this.height + 1);
    }

    /**
     * @returns {!boolean}
     */
    canDecreaseInSize() {
        return !this.gateFamily.every(e => e.height !== this.height - 1);
    }

    /**
     * @param {!number} time
     * @returns {undefined|!Matrix}
     */
    knownMatrixAt(time) {
        return this._knownMatrix !== undefined ? this._knownMatrix :
            this._knownMatrixFunc !== undefined ? this._knownMatrixFunc(time, this.param) :
            undefined;
    }

    /**
     * @returns {!boolean}
     */
    isControl() {
        return this._controlBit !== undefined;
    }

    /**
     * @returns {!boolean}
     */
    isClassicalControl() {
        return this._isClassicalControl;
    }

    /**
     * @returns {undefined|!string|!boolean}
     */
    controlBit() {
        return this._controlBit;
    }

    /**
     * @returns {!boolean}
     */
    effectMightPermutesStates() {
        return this._effectPermutesStates !== undefined ? this._effectPermutesStates :
            this._knownMatrix !== undefined ? !this._knownMatrix.isDiagonal() :
            true;
    }

    /**
     * @returns {!boolean}
     */
    effectMightCreateSuperpositions() {
        return this._effectCreatesSuperpositions !== undefined ? this._effectCreatesSuperpositions :
            this._knownMatrix !== undefined ? !this._knownMatrix.isPhasedPermutation() :
            true;
    }

    /**
     * @returns {!boolean}
     */
    definitelyHasNoEffect() {
        return this._hasNoEffect;
    }

    /**
     * @returns {!boolean}
     */
    isDefinitelyUnitary() {
        return this._isDefinitelyUnitary;
    }

    /**
     * @returns {Infinity|!number}
     */
    stableDuration() {
        return this._stableDuration !== undefined ? this._stableDuration :
            this._knownMatrix !== undefined || this._hasNoEffect ? Infinity :
            0;
    }

    /**
     * @returns {!string}
     */
    toString() {
        return `Gate(${this.symbol})`;
    }
}

/**
 * Builds quantum gates.
 */
class GateBuilder {
    constructor() {
        this.gate = new Gate();
    }

    setSerializedIdAndSymbol(id) {
        this.gate.symbol = id;
        this.gate.serializedId = id;
        return this;
    }

    /**
     * Sets the text shown inside the box when drawing the gate (unless a custom drawer is used).
     * @param {!string} symbol
     * @returns {!GateBuilder}
     */
    setSymbol(symbol) {
        this.gate.symbol = symbol;
        return this;
    }

    /**
     * @param {!{all: !Array.<!Gate>, ofSize: !function(!int) : !Gate}} alternateFamily
     * @returns {!GateBuilder}
     */
    setAlternateFromFamily(alternateFamily) {
        return this.setAlternate(alternateFamily.ofSize(this.gate.height));
    }

    /**
     * @param {!Gate} alternate
     * @returns {!GateBuilder}
     */
    setAlternate(alternate) {
        if (alternate === undefined) {
            throw new Error("alternate === undefined");
        }
        if (alternate.height !== this.gate.height) {
            throw new Error("alternate.height !== this.gate.height");
        }
        if (alternate.alternate !== alternate) {
            throw new Error("alternate.alternate !== alternate");
        }
        alternate.alternate = this.gate;
        this.gate.alternate = alternate;
        return this;
    }

    /**
     * Specifies the id to use when serializing/parsing this gate (instead of defaulting to the symbol).
     * @param {!string} serializedId
     * @returns {!GateBuilder}
     */
    setSerializedId(serializedId) {
        this.gate.serializedId = serializedId;
        return this;
    }

    /**
     * Sets the gate's tooltip title.
     * @param {!string} title A helpful human-readable name for the operation.
     * @returns {!GateBuilder}
     */
    setTitle(title) {
        this.gate.name = title;
        return this;
    }

    /**
     * Sets the detail text shown inside tooltips for the gate.
     * @param {!string} blurb A helpful description of what the gate does.
     * @returns {!GateBuilder}
     */
    setBlurb(blurb) {
        this.gate.blurb = blurb;
        return this;
    }

    /**
     * Sets the number of wires the gate spans.
     * @param {!int} height
     * @returns {!GateBuilder}
     */
    setHeight(height) {
        this.gate.height = height;
        return this;
    }

    /**
     * Sets the number of columns the gate spans.
     * @param {!int} width
     * @returns {!GateBuilder}
     */
    setWidth(width) {
        this.gate.width = width;
        return this;
    }

    /**
     * Provides a custom drawing function for the gate (use undefined to use the default boxed-symbol drawer).
     * @param {undefined|!function(!GateDrawParams) : void} drawer
     * @returns {!GateBuilder}
     */
    setDrawer(drawer) {
        this.gate.customDrawer = drawer;
        return this;
    }

    /**
     * @param {!function(!Gate) : !Gate} gateFunc
     * @returns {!GateBuilder}
     */
    setOnClickGateFunc(gateFunc) {
        this.gate.onClickGateFunc = gateFunc;
        return this;
    }

    /**
     * @param {!Matrix} matrix
     * @returns {!GateBuilder}
     */
    setKnownEffectToMatrix(matrix) {
        if (!(matrix instanceof Matrix)) {
            throw new DetailedError("Bad matrix.", {matrix});
        }
        this.gate._isDefinitelyUnitary = matrix.isUnitary(0.01);
        this.gate._hasNoEffect = matrix.isIdentity();
        this.gate._stableDuration = Infinity;
        this.gate._knownMatrix = matrix;
        return this;
    }

    /**
     * Provides a permutation function asserted to be equivalent to the gate's effect.
     *
     * Determines various properties of the gate (e.g. unitarity) and also used by tests to check if the gate's shader's
     * behavior is correct.
     *
     * @param {!function(val: !int) : !int} permutationFunc Returns the output state for each input state.
     * @returns {!GateBuilder}
     */
    setKnownEffectToPermutation(permutationFunc) {
        this.gate.knownPermutationFuncTakingInputs = permutationFunc;
        this.gate._knownMatrixFunc = _ => Matrix.generateTransition(1 << this.gate.height, permutationFunc);
        this.gate._stableDuration = Infinity;
        this.gate._hasNoEffect = false;
        this.gate._effectPermutesStates = true;
        this.gate._effectCreatesSuperpositions = false;
        this.gate._isDefinitelyUnitary = true;
        return this;
    }

    /**
     * Provides a function equivalent to how the gate rearranges wires, for checking in tests if the gate's behavior is
     * correct.
     * @param {!function(!int) : !int} knownBitPermutationFunc Returns the output of the permutation for a
     *     given input, assuming the gate is exactly sized to the overall circuit.
     * @returns {!GateBuilder}
     */
    setKnownEffectToBitPermutation(knownBitPermutationFunc) {
        this.gate.knownBitPermutationFunc = knownBitPermutationFunc;
        this.gate.knownBitPermutationGroupMasks = permutationGrouping(knownBitPermutationFunc, this.gate.height);
        this.gate._isDefinitelyUnitary = true;
        this.gate._stableDuration = Infinity;
        this.gate._hasNoEffect = false;
        this.gate._effectPermutesStates = true;
        this.gate._effectCreatesSuperpositions = false;
        return this;
    }

    /**
     * Provides a permutation function asserted to be equivalent to the gate's effect.
     *
     * Determines various properties of the gate (e.g. unitarity) and also used by tests to check if the gate's shader's
     * behavior is correct.
     *
     * @param {!function(time: !number, state: !int) : !int} timeVaryingPermutationFunc
     * @returns {!GateBuilder}
     */
    setKnownEffectToTimeVaryingPermutation(timeVaryingPermutationFunc) {
        let g = this.gate;
        g._stableDuration = 0;
        g._knownMatrixFunc = t => Matrix.generateTransition(1 << g.height, i => timeVaryingPermutationFunc(t, i));
        g._hasNoEffect = false;
        g._effectPermutesStates = true;
        g._effectCreatesSuperpositions = false;
        g._isDefinitelyUnitary = true;
        return this;
    }

    /**
     * Provides a permutation function asserted to be equivalent to the gate's effect.
     *
     * Determines various properties of the gate (e.g. unitarity) and also used by tests to check if the gate's shader's
     * behavior is correct.
     *
     * @param {
     *      !function(val: !int, a: !int) : !int |
     *      !function(val: !int, a: !int, b: !int) : !int |
     *      !function(val: !int, a: !int, b: !int, r: !int) : !int
     *  } permutationFunc A permutation function taking the initial state of the covered register, then any input
     *      gate inputs, and returning the new state.
     * @returns {!GateBuilder}
     */
    setKnownEffectToParametrizedPermutation(permutationFunc) {
        let g = this.gate;
        g.knownPermutationFuncTakingInputs = permutationFunc;
        g._knownMatrixFunc = undefined;
        g._stableDuration = Infinity;
        g._hasNoEffect = false;
        g._effectPermutesStates = true;
        g._effectCreatesSuperpositions = false;
        g._isDefinitelyUnitary = true;
        return this;
    }

    /**
     * Provides a phase-factor function asserted to be equivalent to the gate's effect.
     *
     * Determines various properties of the gate (e.g. unitarity) and also used by tests to check if the gate's shader's
     * behavior is correct.
     *
     * @param {!function(state: !int) : !number} phaseTurnsFunc
     *      Determines how many turns each basis state should be phased by, in full-turn units.
     * @returns {!GateBuilder}
     */
    setKnownEffectToPhaser(phaseTurnsFunc) {
        this.gate._hasNoEffect = false;
        this.gate._effectPermutesStates = false;
        this.gate._effectCreatesSuperpositions = false;
        this.gate._isDefinitelyUnitary = true;
        this.gate._stableDuration = Infinity;
        this.gate.knownPhaseTurnsFunc = phaseTurnsFunc;
        this.gate._knownMatrixFunc = () => Matrix.generateDiagonal(
            1 << this.gate.height,
            k => Complex.polar(1, Math.PI * 2 * phaseTurnsFunc(k)));
        return this;
    }

    /**
     * @param {!function() : !Matrix} matrixFunc
     * @returns {GateBuilder}
     */
    setTooltipMatrixFunc(matrixFunc) {
        this.gate._knownMatrixFunc = _ => matrixFunc();
        this.gate._stableDuration = Infinity;
        return this;
    }

    /**
     * Provides a circuit equivalent to the gate's effect, which can be used to simulate or analyze the gate.
     * @param {!CircuitDefinition} circuitDefinition
     * @returns {!GateBuilder}
     */
    setKnownEffectToCircuit(circuitDefinition) {
        this.gate.knownCircuit = circuitDefinition;
        this.gate.knownCircuitNested = circuitDefinition.withDisabledReasonsForEmbeddedContext(0, new Map());
        this.gate._isDefinitelyUnitary = circuitDefinition.hasOnlyUnitaryGates();
        this.gate._stableDuration = circuitDefinition.stableDuration();
        this.gate.height = circuitDefinition.numWires;
        return this;
    }

    /**
     * @param {!function(time : !number, gateParam: *) : !Matrix} timeToMatrixFunc
     * @returns {!GateBuilder}
     */
    setEffectToTimeVaryingMatrix(timeToMatrixFunc) {
        this.gate._stableDuration = 0;
        this.gate._knownMatrixFunc = timeToMatrixFunc;
        this.gate._hasNoEffect = false;
        return this;
    }

    /**
     * A function called by `Gate.withParam` before returning its result.
     * @param {!function(gate: !Gate): undefined} withParamRecomputeFunc
     * @returns {!GateBuilder}
     */
    setWithParamPropertyRecomputeFunc(withParamRecomputeFunc) {
        this.gate._withParamRecomputeFunc = withParamRecomputeFunc;
        return this;
    }

    /**
     * Sets a custom circuit-update function to run when simulating this gate.
     * @param {undefined|!function(!CircuitEvalContext)} circuitUpdateFunc
     * @returns {!GateBuilder}
     */
    setActualEffectToUpdateFunc(circuitUpdateFunc) {
        if (circuitUpdateFunc !== undefined && typeof circuitUpdateFunc !== "function") {
            throw new DetailedError("Bad customOperation", {circuitUpdateFunc});
        }
        this.gate.customOperation = circuitUpdateFunc;
        return this;
    }

    /**
     * Sets a shader as the custom circuit-update function to run when simulating this gate.
     * @param {!function(!CircuitEvalContext) : !WglConfiguredShader} shaderFunc
     * @returns {!GateBuilder}
     */
    setActualEffectToShaderProvider(shaderFunc) {
        return this.setActualEffectToUpdateFunc(ctx => ctx.applyOperation(shaderFunc));
    }

    /**
     * Sets meta-properties to indicate the gate is safe for classical use and quantum use, but not safe for mixed used.
     * @returns {!GateBuilder}
     */
    promiseEffectOnlyPermutesAndPhases() {
        this.gate._hasNoEffect = false;
        this.gate._effectPermutesStates = true;
        this.gate._effectCreatesSuperpositions = false;
        this.gate._isDefinitelyUnitary = true;
        return this;
    }

    /**
     * Sets meta-properties to indicate the gate is equivalent to a matrix with diagonal entries, such as post-selection
     * in the computational basis.
     *
     * @returns {!GateBuilder}
     */
    promiseEffectIsDiagonal() {
        this.gate._hasNoEffect = false;
        this.gate._effectPermutesStates = false;
        this.gate._effectCreatesSuperpositions = false;
        return this;
    }

    /**
     * Sets meta-properties to indicate the gate is safe for classical, quantum, and mixed use.
     * @returns {!GateBuilder}
     */
    promiseEffectOnlyPhases() {
        this.gate._hasNoEffect = false;
        this.gate._effectPermutesStates = false;
        this.gate._effectCreatesSuperpositions = false;
        this.gate._isDefinitelyUnitary = true;
        return this;
    }

    /**
     * @returns {!GateBuilder}
     */
    promiseEffectIsUnitary() {
        this.gate._isDefinitelyUnitary = true;
        return this;
    }

    /**
     * Sets meta-properties to indicate a gate doesn't change over time, and so doesn't force the circuit to
     * constantly recompute.
     * @returns {!GateBuilder}
     */
    promiseEffectIsStable() {
        this.gate._stableDuration = Infinity;
        return this;
    }

    /**
     * Indicates that the gate can be skipped over when computing the system state.
     *
     * Note that Input gates and Z controls meet this definition, because their effects happen via other gates
     * conditioning on them. X and Y controls don't meet the definition because they have to perform a temporary
     * basis change which counts as a change.
     *
     * @returns {!GateBuilder}
     */
    promiseHasNoNetEffectOnStateVector() {
        this.gate._stableDuration = Infinity;
        this.gate._hasNoEffect = true;
        this.gate._isDefinitelyUnitary = true;
        this.gate._effectPermutesStates = false;
        this.gate._effectCreatesSuperpositions = false;
        return this;
    }

    /**
     * @returns {!GateBuilder}
     */
    promiseHasNoNetEffectOnStateVectorButStillRequiresDynamicRedraw() {
        this.promiseHasNoNetEffectOnStateVector();
        this.gate._stableDuration = 0;
        return this;
    }

    /**
     * Indicates that the gate isn't a control wire destination when drawing.
     * @returns {!GateBuilder}
     */
    markAsNotInterestedInControls() {
        this.gate.interestedInControls = false;
        return this;
    }

    /**
     * Sets meta-properties to indicate a gate is a control.
     * @param {!boolean|!string} bit: Whether gate is a control (True), anti-control (False), or parity control
     *     ("parity"). Use before/after operations for flexibility.
     * @param {!boolean} guaranteedClassical Whether or not the control can be used to control permutations of classical
     *     wires, even if placed on a coherent wire.
     * @returns {!GateBuilder}
     */
    markAsControlExpecting(bit, guaranteedClassical=false) {
        this.gate._controlBit = bit;
        this.gate.isControlWireSource = true;
        this.gate.interestedInControls = false;
        this.gate._isClassicalControl = guaranteedClassical;
        return this;
    }

    /**
     * Indicates that the effect of this gate can immediately affect gates or displays on wires other than the ones
     * this gate is placed on.
     * @returns {GateBuilder}
     */
    markAsReachingOtherWires() {
        this.gate._showAsReachesOtherWires = true;
        return this;
    }

    /**
     * Sets meta-properties indicating a qubit density matrix needs to be computed wherever this gate is placed.
     * @returns {!GateBuilder}
     */
    markAsDrawerNeedsSingleQubitDensityStats() {
        this.gate.isSingleQubitDisplay = true;
        return this;
    }

    /**
     * Specifies context values provided by other gates that this gate needs to be present in order to function.
     * @param {...!String} keys
     * @returns {!GateBuilder}
     */
    setRequiredContextKeys(...keys) {
        this.gate._requiredContextKeys = keys;
        return this;
    }

    /**
     * Specifies a function for retrieving the context provided by a gate to other gates.
     * @param {!function(qubit:!int,gate:!Gate):!Array.<!{key: !string, val: *}>} customColumnContextProvider
     * @returns {!GateBuilder}
     */
    setContextProvider(customColumnContextProvider) {
        this.gate.customColumnContextProvider = customColumnContextProvider;
        this.gate.isContextTemporary = true;
        return this;
    }

    /**
     * Specifies a function for retrieving the context provided by a gate to other gates.
     * @param {!function(qubit:!int,gate:!Gate):!Array.<!{key: !string, val: *}>} customColumnContextProvider
     * @returns {!GateBuilder}
     */
    setStickyContextProvider(customColumnContextProvider) {
        this.gate.customColumnContextProvider = customColumnContextProvider;
        this.gate.isContextTemporary = false;
        return this;
    }

    /**
     * Sets a setup shader to unconditionally run before executing the operations in a column containing this gate.
     * @param {undefined|!function(!CircuitEvalContext) : !WglConfiguredShader} beforeColumnShaderFunc
     * @param {undefined|!function(!CircuitEvalContext) : !WglConfiguredShader} afterColumnShaderFunc
     * @returns {!GateBuilder}
     */
    setSetupCleanupEffectsToShaderProviders(beforeColumnShaderFunc, afterColumnShaderFunc) {
        return this.setSetupCleanupEffectToUpdateFunc(
            beforeColumnShaderFunc === undefined ? undefined : ctx => ctx.applyOperation(beforeColumnShaderFunc),
            afterColumnShaderFunc === undefined ? undefined : ctx => ctx.applyOperation(afterColumnShaderFunc));
    }

    /**
     * Sets a setup operation to unconditionally run before executing the operations in a column containing this gate.
     * @param {undefined|!function(!CircuitEvalContext) : void} beforeColumnUpdateFunc
     * @param {undefined|!function(!CircuitEvalContext) : void} afterColumnUpdateFunc
     * @returns {!GateBuilder}
     */
    setSetupCleanupEffectToUpdateFunc(beforeColumnUpdateFunc, afterColumnUpdateFunc) {
        if (beforeColumnUpdateFunc !== undefined && typeof beforeColumnUpdateFunc !== "function") {
            throw new DetailedError("Bad beforeColumnUpdateFunc", {customOperation});
        }
        if (afterColumnUpdateFunc !== undefined && typeof afterColumnUpdateFunc !== "function") {
            throw new DetailedError("Bad afterColumnUpdateFunc", {customOperation});
        }
        this.gate.customBeforeOperation = beforeColumnUpdateFunc;
        this.gate.customAfterOperation = afterColumnUpdateFunc;
        return this;
    }

    /**
     * Specifies a function for retrieving unusual reasons a gate is being misused and so must be disabled.
     * @param {!function(!GateCheckArgs) : (undefined|!string)} customDisableReasonFinder
     * @returns {!GateBuilder}
     */
    setExtraDisableReasonFinder(customDisableReasonFinder) {
        this.gate.customDisableReasonFinder = customDisableReasonFinder;
        return this;
    }

    /**
     * Specifies how to extract data that will be needed when drawing a display gate.
     * @param {undefined|!function(!CircuitEvalContext) : (!WglTexture|!Array.<!WglTexture>)} statTexturesMaker
     * @returns {!GateBuilder}
     */
    setStatTexturesMaker(statTexturesMaker) {
        this.gate.customStatTexturesMaker = statTexturesMaker;
        return this;
    }

    /**
     * Specifies how to process raw pixel data from the custom stats texture maker into a more useful value.
     * @param {undefined|!function(pixelData: !Float32Array | Array.<!Float32Array>,
     *                             circuit: !CircuitDefinition,
     *                             col:!int,
     *                             row:!int)} pixelFunc
     * @returns {!GateBuilder}
     */
    setStatPixelDataPostProcessor(pixelFunc) {
        this.gate.customStatPostProcesser = pixelFunc;
        return this;
    }

    /**
     * Specifies how to convert custom stats data into json when exporting.
     * @param {undefined|!function(data: *) : *} jsonFunc
     * @returns {!GateBuilder}
     */
    setProcessedStatsToJsonFunc(jsonFunc) {
        this.gate.processedStatsToJsonFunc = jsonFunc;
        return this;
    }

    /**
     * @param {*} tag
     * @returns {!GateBuilder}
     */
    setTag(tag) {
        this.gate.tag = tag;
        return this;
    }
}

/**
 * @param {!function(!int) : !int} knownBitPermutationFunc Returns the output of the permutation for a
 *     given input, assuming the gate is exactly sized to the overall circuit.
 * @param {!int} height
 * @returns {!Array.<!int>}
 */
function permutationGrouping(knownBitPermutationFunc, height) {
    let seen = new Set();
    let result = [];
    for (let i = 0; i < height; i++) {
        let mask = 0;
        let j = i;
        while (!seen.has(j)) {
            seen.add(j);
            mask |= 1 << j;
            j = knownBitPermutationFunc(j);
        }
        if (mask !== 0) {
            result.push(mask);
        }
    }
    return result;
}

export {Gate, GateBuilder}


text:
package org.wso2.carbon.rule.common;

import junit.framework.TestCase;
import org.wso2.carbon.rule.common.config.RuleSetHelper;

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

public class TestRuleSet extends TestCase{

    public void testRuleSet(){
        RuleSet ruleSet = new RuleSet();

        String resourceType = "drl";
        String sourceType = "inline";
        String value = "package ruleTest;\n" +
                "\n" +
                "import org.wso2.carbon.rule.common.Test;\n" +
                "\n" +
                "rule SampleTest\n" +
                "\n" +
                "when\n" +
                "$test : Test( passed == true)\n" +
                "\n" +
                "then\n" +
                "$test.setMessage(\" Test Passed \");\n" +
                "\n";

        // Add rule
        Rule rule = new Rule();
        rule.setResourceType(resourceType);
        rule.setSourceType(sourceType);
        rule.setValue(value);
        ruleSet.addRule(rule);

        // Add property Map
        Map<String, String> propertyMAP = new HashMap<String, String>();
        propertyMAP.put("name1", "value1");
        propertyMAP.put("name2", "value2");

        ruleSet.setProperties(propertyMAP);

        RuleSet resultRuleSet = RuleSetHelper.getRuleSet(ruleSet.toOM());
        assertEquals(ruleSet.getProperties(), resultRuleSet.getProperties());
    }
}


text:
using System;
using System.ComponentModel.Composition;

namespace Fussen.Core.Extensions
{
	public interface IUniversalDetector
	{
		bool IsDone();
		void HandleData(byte[] buf, int offset, int length);
		void DataEnd();
		string GetDetectedCharset();
		void Reset();
	}
}


text:
import xs from 'xstream'
import Landing from 'pages/Landing'
import Router from 'components/Router'

const routes = {
  '/': Landing
}

export default function main (sources) {
  const page = Router({...sources, routes$: xs.of(routes)})
  return {
    DOM: page.DOM
  }
}


text:
package org.sleuthkit.autopsy.experimental.autoingest;

import java.io.Serializable;
import org.sleuthkit.autopsy.events.AutopsyEvent;

/**
 * Event published when an automated ingest manager prioritizes all or part of a
 * case.
 */
public final class AutoIngestCasePrioritizedEvent extends AutopsyEvent implements Serializable {

    private static final long serialVersionUID = 1L;
    private final String caseName;
    private final String nodeName;

    /**
     * Constructs an event published when an automated ingest manager
     * prioritizes all or part of a case.
     *
     * @param caseName The name of the case.
     * @param nodeName The host name of the node that prioritized the case.
     */
    public AutoIngestCasePrioritizedEvent(String nodeName, String caseName) {
        super(AutoIngestManager.Event.CASE_PRIORITIZED.toString(), null, null);
        this.caseName = caseName;
        this.nodeName = nodeName;
    }

    /**
     * Gets the name of the prioritized case.
     *
     * @return The case name.
     */
    public String getCaseName() {
        return caseName;
    }

    /**
     * Gets the host name of the node that prioritized the case.
     *
     * @return The host name of the node.
     */
    public String getNodeName() {
        return nodeName;
    }

}


text:
package com.giggs.heroquest.models.effects;

import com.giggs.heroquest.models.items.Characteristics;

/**
 * Created by guillaume on 19/10/14.
 */
public class StunEffect extends Effect {

    private static final long serialVersionUID = -2548241591886680058L;

    public StunEffect(String spriteName, Characteristics target, int value, int level) {
        super(spriteName, target, value, INFINITE_EFFECT, null, level);
    }

}


text:
module SolidusMarkdown
  module Generators
    class InstallGenerator < Rails::Generators::Base

      class_option :auto_run_migrations, :type => :boolean, :default => false

      def add_javascripts
      end

      def add_stylesheets
      end

      def add_migrations
      end

      def run_migrations
      end
    end
  end
end