text:
package com.leaking.slideswitch;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.v4.view.MotionEventCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

import com.example.slideswitch.R;

public class SlideSwitch extends View {

	public static final int SHAPE_RECT = 1;
	public static final int SHAPE_CIRCLE = 2;
	private static final int RIM_SIZE = 6;
	private static final int COLOR_THEME = Color.parseColor("#ff00ee00");
	// 3 attributes
	private int color_theme;
	private boolean isOpen;
	private int shape;
	// varials of drawing
	private Paint paint;
	private Rect backRect;
	private Rect frontRect;
	private int alpha;
	private int max_left;
	private int min_left;
	private int frontRect_left;
	private int frontRect_left_begin = RIM_SIZE;
	private int eventStartX;
	private int eventLastX;
	private int diffX = 0;

	private boolean slideable = true;

	private SlideListener listener;

	public interface SlideListener {
		public void open();
		public void close();
	}

	public SlideSwitch(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		listener = null;
		paint = new Paint();
		paint.setAntiAlias(true);
		TypedArray a = context.obtainStyledAttributes(attrs,
				R.styleable.slideswitch);
		color_theme = a.getColor(R.styleable.slideswitch_themeColor,
				COLOR_THEME);
		isOpen = a.getBoolean(R.styleable.slideswitch_isOpen, false);
		shape = a.getInt(R.styleable.slideswitch_shape, SHAPE_RECT);
		a.recycle();
	}

	public SlideSwitch(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public SlideSwitch(Context context) {
		this(context, null);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		int width = measureDimension(280, widthMeasureSpec);
		int height = measureDimension(140, heightMeasureSpec);
		if (shape == SHAPE_CIRCLE) {
			if (width < height)
				width = height * 2;
		}
		setMeasuredDimension(width, height);
		initDrawingVal();
	}

	public void initDrawingVal(){
		int width = getMeasuredWidth();
		int height = getMeasuredHeight();

		backRect = new Rect(0, 0, width, height);
		min_left = RIM_SIZE;
		if (shape == SHAPE_RECT)
			max_left = width / 2;
		else
			max_left = width - (height - 2 * RIM_SIZE) - RIM_SIZE;
		if (isOpen) {
			frontRect_left = max_left;
			alpha = 255;
		} else {
			frontRect_left = RIM_SIZE;
			alpha = 0;
		}
		frontRect_left_begin = frontRect_left;
	}

	public int measureDimension(int defaultSize, int measureSpec) {
		int result;
		int specMode = MeasureSpec.getMode(measureSpec);
		int specSize = MeasureSpec.getSize(measureSpec);
		if (specMode == MeasureSpec.EXACTLY) {
			result = specSize;
		} else {
			result = defaultSize; // UNSPECIFIED
			if (specMode == MeasureSpec.AT_MOST) {
				result = Math.min(result, specSize);
			}
		}
		return result;
	}

	@Override
	protected void onDraw(Canvas canvas) {
		if (shape == SHAPE_RECT) {
			paint.setColor(Color.GRAY);
			canvas.drawRect(backRect, paint);
			paint.setColor(color_theme);
			paint.setAlpha(alpha);
			canvas.drawRect(backRect, paint);

			frontRect = new Rect(frontRect_left, RIM_SIZE, frontRect_left
					+ getMeasuredWidth() / 2 - RIM_SIZE, getMeasuredHeight()
					- RIM_SIZE);
			paint.setColor(Color.WHITE);
			canvas.drawRect(frontRect, paint);
		} else {
			// »Ô²ÐÎ
			int radius;
			radius = backRect.height() / 2 - RIM_SIZE;
			paint.setColor(Color.GRAY);
			canvas.drawRoundRect(new RectF(backRect), radius, radius, paint);
			paint.setColor(color_theme);
			paint.setAlpha(alpha);
			canvas.drawRoundRect(new RectF(backRect), radius, radius, paint);

			frontRect = new Rect(frontRect_left, RIM_SIZE, frontRect_left
					+ backRect.height() - 2 * RIM_SIZE, backRect.height()
					- RIM_SIZE);
			paint.setColor(Color.WHITE);
			canvas.drawRoundRect(new RectF(frontRect), radius, radius, paint);
		}
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if(slideable == false)
			return super.onTouchEvent(event);
		int action = MotionEventCompat.getActionMasked(event);
		switch (action) {
		case MotionEvent.ACTION_DOWN:
			eventStartX = (int) event.getRawX();
			break;
		case MotionEvent.ACTION_MOVE:
			eventLastX = (int) event.getRawX();
			diffX = eventLastX - eventStartX;
			int tempX = diffX + frontRect_left_begin;
			tempX = (tempX > max_left ? max_left : tempX);
			tempX = (tempX < min_left ? min_left : tempX);
			if (tempX >= min_left && tempX <= max_left) {
				frontRect_left = tempX;
				alpha = (int) (255 * (float) tempX / (float) max_left);
				invalidateView();
			}
			break;
		case MotionEvent.ACTION_UP:
			int wholeX = (int) (event.getRawX() - eventStartX);
			frontRect_left_begin = frontRect_left;
			boolean toRight;
			toRight = (frontRect_left_begin > max_left / 2 ? true : false);
			if (Math.abs(wholeX) < 3) {
				toRight = !toRight;
			}
			moveToDest(toRight);
			break;
		default:
			break;
		}
		return true;
	}

	/**
	 * draw again
	 */
	private void invalidateView() {
		if (Looper.getMainLooper() == Looper.myLooper()) {
			invalidate();
		} else {
			postInvalidate();
		}
	}

	public void setSlideListener(SlideListener listener) {
		this.listener = listener;
	}

	public void moveToDest(final boolean toRight) {
		final Handler handler = new Handler() {

			@Override
			public void handleMessage(Message msg) {
				if (msg.what == 1) {
					listener.open();
				} else {
					listener.close();
				}
			}

		};

		new Thread(new Runnable() {
			@Override
			public void run() {
				if (toRight) {
					while (frontRect_left <= max_left) {
						alpha = (int) (255 * (float) frontRect_left / (float) max_left);
						invalidateView();
						frontRect_left += 3;
						try {
							Thread.sleep(3);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					alpha = 255;
					frontRect_left = max_left;
					isOpen = true;
					if (listener != null)
						handler.sendEmptyMessage(1);
					frontRect_left_begin = max_left;

				} else {
					while (frontRect_left >= min_left) {
						alpha = (int) (255 * (float) frontRect_left / (float) max_left);
						invalidateView();
						frontRect_left -= 3;
						try {
							Thread.sleep(3);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					alpha = 0;
					frontRect_left = min_left;
					isOpen = false;
					if (listener != null)
						handler.sendEmptyMessage(0);
					frontRect_left_begin = min_left;

				}
			}
		}).start();

	}

	public void setState(boolean isOpen) {
		this.isOpen = isOpen;
		initDrawingVal();
		invalidateView();
		if(listener != null)
			if(isOpen == true){
				listener.open();
			}else{
				listener.close();
			}
	}

	public void setShapeType(int shapeType) {
		this.shape = shapeType;
	}

	public void setSlideable(boolean slideable){
		this.slideable = slideable;
	}

}


text:
ParObject::ParObject()
{
	printf("VectorX: Creating object ParObject on localhost\n");
}

ParObject::ParObject(POPString machine)
{
	printf("VectorX: Creating object ParObject on %s\n",(const char *)POPSystem::GetHost());
}

ParObject::ParObject(float f)
{
	printf("VectorX: Creating object ParObject with power %f\n",f);
}

ParObject::~ParObject()
{
	printf("VectorX: Destroying the object ParObject... %d\n",  theData.size());
}

void ParObject::SetData(POPxVector data)
{
	theData=data;
}

POPxVector ParObject::GetData()
{
	return theData;
}

@pack(ParObject);

redpajama_set_name: RedPajamaGithub


text:
@interface  MIMRangeGraph()
{

    NSMutableArray *myPathArray;
    NSMutableArray *_yValElements;
    NSMutableArray *_xValElements;
    NSArray *_xTitles;
    NSArray *_xNumericValues;

    float _contentWidth;
    float _gridWidth;
    float _gridHeight;///==float _contentHeight;
    float _scalingX;
    float _scalingY;
    float _tileWidth;

    float _tileHeight;
    BOOL _tileWidthDefinedByUser;
    float offsetXLabelOnLongGraph;

    BOOL xIsString;
    BOOL _isLongGraph;
    BOOL fitsToScreenWidth;
    float pixelsPerTile;
    int numOfHLines;
    float minimumOnY;
    NSMutableArray *lineColorA;
    int itemCountOnXAxis;

    NSMutableArray *aPropertiesArray;
    NSMutableDictionary *hlProperties;
    NSMutableDictionary *vlProperties;
    NSMutableDictionary *xLProperties;
    NSMutableDictionary *yLProperties;

    LineScrollView *lineGScrollView;

    float yAxisWidth;
    float xAxisHeight;

}
-(BOOL)initAndWarnings;
//(void)_drawAnchorPoints;
-(void)_displayXAxisLabels;
-(void)_displayYAxisLabels;

@end

@implementation MIMRangeGraph

@synthesize mbackgroundColor;
@synthesize xTitleStyle;
@synthesize delegate;
@synthesize anchorTypeArray;
@synthesize rangeColorArray;
@synthesize minimumLabelOnYIsZero;
@synthesize titleLabel;
@synthesize rightMargin,topMargin,leftMargin,bottomMargin;
@synthesize rangeLineThickness;

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self)
    {
        self.backgroundColor=[UIColor clearColor];
        [self initVars];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self.backgroundColor=[UIColor clearColor];
        [self initVars];
    }
    return self;
}

-(void)drawMIMRangeGraph
{
    offsetXLabelOnLongGraph=0;
    //BOOL multipleLines=[self initAndWarnings];

    BOOL addRandomAnchorType=TRUE;
    if (self.anchorTypeArray) addRandomAnchorType=FALSE;

    float _leftMargin=leftMargin+yAxisWidth;
    float _bottomMargin=bottomMargin+xAxisHeight;

    if(_isLongGraph)
    {
        _leftMargin=0;
        //_bottomMargin=0;
    }

    //Now Save the Path
    //In form of BezierPath
    myPathArray=[[NSMutableArray alloc]init];

    for (int l=0; l<[_xValElements count]; l+=2)
    {

        //Create the Bezier Path
        UIBezierPath *lineBezierPath=[[UIBezierPath alloc]init];
        lineBezierPath.lineWidth=1.0;
        lineBezierPath.lineJoinStyle=kCGLineJoinRound;

        float valueX;

        if(xIsString)
            valueX=(float)l;
        else
            valueX=[[_xValElements objectAtIndex:l] floatValue];

        float mX;
        float mX2;
        //Currently it supports only date version
        {
            //Find valueX

            NSString *startDateString=[_xValElements objectAtIndex:l];
            NSString *endDateString=[_xValElements objectAtIndex:l+1];

            NSArray *dateComp=[startDateString componentsSeparatedByString:@"."];
            int day=[[dateComp objectAtIndex:1] intValue];
            int month=[[dateComp objectAtIndex:0] intValue];
            int year=[[dateComp objectAtIndex:2] intValue];

            //Find BEGIN DATE month and year matches with which in _xNumeric
            for(int i=0;i<[_xNumericValues count];i++)
            {
                NSString *xNumString=[_xNumericValues objectAtIndex:i];
                NSArray *xNumComp=[xNumString componentsSeparatedByString:@"."];
                if ([xNumComp count]<2) continue;
                int xmonth=[[xNumComp objectAtIndex:0] intValue];
                int xyear=[[xNumComp objectAtIndex:1] intValue];

                if((month==xmonth)&&(year==xyear))
                {

                    mX=i*_tileWidth;

                    //Add the amount for date component.
                    mX+=(_tileWidth*day/30);

                    break;
                }

            }

            dateComp=[endDateString componentsSeparatedByString:@"."];
            day=[[dateComp objectAtIndex:1] intValue];
            month=[[dateComp objectAtIndex:0] intValue];
            year=[[dateComp objectAtIndex:2] intValue];

            //Find END DATE month and year matches with which in _xNumeric
            for(int i=0;i<[_xNumericValues count];i++)
            {
                NSString *xNumString=[_xNumericValues objectAtIndex:i];
                NSArray *xNumComp=[xNumString componentsSeparatedByString:@"."];
                if ([xNumComp count]<2) continue;
                int xmonth=[[xNumComp objectAtIndex:0] intValue];
                int xyear=[[xNumComp objectAtIndex:1] intValue];

                if((month==xmonth)&&(year==xyear))
                {

                    mX2=i*_tileWidth;

                    //Add the amount for date component.
                    mX2+=(_tileWidth*day/30);

                    break;
                }

            }

        }

        //float mX=valueX*_scalingX +_leftMargin;
        float mY=((l/2)*_scalingY) + _bottomMargin + _scalingY;
        mX+=_leftMargin;
        mX2+=_leftMargin;

        if (_isLongGraph) {

            mY+=topMargin;
        }

        [lineBezierPath moveToPoint:CGPointMake(mX+offsetXLabelOnLongGraph,mY)];
        [lineBezierPath addLineToPoint:CGPointMake(mX2+offsetXLabelOnLongGraph,mY)];
        [myPathArray addObject:lineBezierPath];
        //if (addRandomAnchorType) [anchorTypeArray addObject:[NSNumber numberWithInt:rand()%7+1]];

    }

    titleLabel.frame=CGRectMake(leftMargin, topMargin+_gridHeight+xAxisHeight+5, CGRectGetWidth(self.frame)-leftMargin-rightMargin, 20);

    [self createLineColorArray];//Get colors for the line
    [self setNeedsDisplay];
    [self _displayXAxisLabels];
    [self _displayYAxisLabels];
}

#pragma mark - INIT AND CALCULATIONS

-(void)initVars
{
    offsetXLabelOnLongGraph=0;
    rangeLineThickness=1;
    anchorTypeArray=[[NSMutableArray alloc]init];
    xTitleStyle=XTitleStyle2;
    mbackgroundColor=nil;
    _isLongGraph=FALSE;
    rightMargin=0;
    topMargin=0;
    leftMargin=0;
    bottomMargin=0;
    yAxisWidth=50;
    xAxisHeight=70;

    titleLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 20)];
    [titleLabel setBackgroundColor:[UIColor clearColor]];
    [titleLabel setFont:[UIFont fontWithName:@"Helvetica" size:12]];
    [titleLabel setTextColor:[UIColor blackColor]];
    [titleLabel setTextAlignment:UITextAlignmentCenter];
    [self addSubview:titleLabel];

    titleLabel.text=@"Line Chart Title";

}

-(BOOL)initAndWarnings
{
    //reMove everythng which is there
    for (UIView *view in self.subviews) {
        [view removeFromSuperview];
    }

    srand(time(NULL));

    [MIMColor InitFragmentedBarColors];

    _yValElements=[[NSMutableArray alloc]init];

    xIsString=TRUE;
    if([delegate respondsToSelector:@selector(valuesForXAxis:)])
    {
        NSArray *valueArray_=[delegate valuesForXAxis:self];
        if(valueArray_)
        {
            NSAssert(([valueArray_ count] !=0),@"WARNING::No values available for x-Axis Labels.");

            if([valueArray_ count]>0)
            {
                _xValElements=[[NSMutableArray alloc]initWithArray:valueArray_];
            }

            if([[_xValElements objectAtIndex:0] isKindOfClass:[NSString class]])
            {
                xIsString=[MIM_MathClass checkIfStringIsAlphaNumericOnly:[_xValElements objectAtIndex:0]];
            }
            else
            {
                xIsString=[MIM_MathClass checkIfStringIsAlphaNumericOnly:[[_xValElements objectAtIndex:0]objectAtIndex:0]];
            }

        }

    }
    else
    {
       // NSLog(@"Warning:No values available for x-Axis Labels.Use delegate Method valuesForXAxis: ");
    }

    BOOL multipleLines=FALSE;
    if([delegate respondsToSelector:@selector(valuesForGraph:)])
    {
        NSArray *valueArray_=[delegate valuesForGraph:self];
        NSAssert(([valueArray_ count] !=0),@"WARNING::No values available to draw graph.");

        //See if the its an array or array or just one array
        if([valueArray_ count]>0)
        {
            if([[valueArray_ objectAtIndex:0] isKindOfClass:[NSString class]]||[[valueArray_ objectAtIndex:0] isKindOfClass:[NSNumber class]]) {}
            else multipleLines=TRUE;
            _yValElements=[[NSMutableArray alloc]initWithArray:valueArray_];
        }

    }
    else
    {
        //NSLog(@"Error: Use delegate Method valuesForGraph: to give values for graph.");
    }

    if([delegate respondsToSelector:@selector(titlesForXAxis:)])
    {
        _xTitles=[[NSArray alloc]initWithArray:[delegate titlesForXAxis:self]];
        if([_xTitles count]==0)
        {
           // NSLog(@"WARNING:Give values in titlesForXAxis: to give display values on X-Axis.");
        }

    }
    else
    {
       // NSLog(@"WARNING:If there are any auto-calculated values for X-Axis, they will be displayed, Otherwise Use delegate Method titlesForXAxis: to give display  specific values on X-Axis.");
    }
    //-(NSArray *)numericValuesForXAxis:(id)graph;

    if([delegate respondsToSelector:@selector(numericValuesForXAxis:)])
    {
        _xNumericValues=[[NSArray alloc]initWithArray:[delegate numericValuesForXAxis:self]];
        if([_xNumericValues count]==0)
        {
           // NSLog(@"ERROR :Give values in titlesForXAxis: to give display values on X-Axis.");
        }

    }
    else
    {
       // NSLog(@"ERROR : You need to provide the numeric values in numericValuesForXAxis:.");
    }

    if([delegate respondsToSelector:@selector(AnchorProperties:)])
        if([delegate AnchorProperties:self]!=nil)
        {
            aPropertiesArray=[[NSMutableArray alloc]initWithArray:[delegate AnchorProperties:self]];
        }

    //Horizontal Seperator Line
    if([delegate respondsToSelector:@selector(horizontalLinesProperties:)])
        hlProperties=[[NSMutableDictionary alloc]initWithDictionary:[delegate horizontalLinesProperties:self]];
    else
        hlProperties=[[NSMutableDictionary alloc]init];

    //Vertical Seperator Line
    if([delegate respondsToSelector:@selector(verticalLinesProperties:)])
        vlProperties=[[NSMutableDictionary alloc]initWithDictionary:[delegate verticalLinesProperties:self]];
    else
        vlProperties=[[NSMutableDictionary alloc]init];

    _tileWidthDefinedByUser=FALSE;
    if([[vlProperties allKeys] containsObject:@"gap"])
        _tileWidthDefinedByUser=TRUE;

    //X-AXis
    if([delegate respondsToSelector:@selector(xAxisProperties:)])
        xLProperties=[[NSMutableDictionary alloc]initWithDictionary:[delegate xAxisProperties:self]];
    else
        xLProperties=[[NSMutableDictionary alloc]init];

    //Y-Axis
    if([delegate respondsToSelector:@selector(yAxisProperties:)])
        yLProperties=[[NSMutableDictionary alloc]initWithDictionary:[delegate yAxisProperties:self]];
    else
        yLProperties=[[NSMutableDictionary alloc]init];

    if([yLProperties valueForKey:@"width"])
        yAxisWidth=[[yLProperties valueForKey:@"width"] floatValue];

    if([xLProperties valueForKey:@"height"])
        xAxisHeight=[[xLProperties valueForKey:@"height"] floatValue];

    //[self drawLineInfoBox];
    //[self CalculateGridDimensions];
    _gridWidth=self.frame.size.width;
    _gridWidth=[MIMProperties CalculateGridWidth:_gridWidth leftMargin:leftMargin rightMargin:rightMargin yAxisSpace:yAxisWidth];

    _gridHeight=self.frame.size.height;
    _gridHeight=[MIMProperties CalculateGridHeight:_gridHeight bottomMargin:bottomMargin topMargin:topMargin xAxisSpace:xAxisHeight];

    itemCountOnXAxis=[MIMProperties countXValuesInArray:[NSMutableArray arrayWithArray:_xNumericValues]];

    //[self FindTileWidthAndHeight];
    _tileHeight=[MIMProperties FindTileHeight:hlProperties GridHeight:_gridHeight];
    _tileWidth=[MIMProperties FindTileWidth:vlProperties GridWidth:_gridWidth xItemsCount:itemCountOnXAxis];

    //WE need to figure out if tileHeight*numOfHLines + 10 >=_gridHeight
    //If not, then try reducing numOfHLines
    numOfHLines=_gridHeight/_tileHeight;

    if(numOfHLines < 3)
        _tileHeight=[MIMProperties fixTileHeight:_gridHeight];

    _isLongGraph=[MIMProperties findIfItIsALongGraph:_tileWidth TotalItemsOnXAxis:itemCountOnXAxis GridWidth:_gridWidth];
    //[self ScalingFactor];

    float minOfY=[MIMProperties findGlobalMinimum:_yValElements];
    //float maxOfY=[MIMProperties findGlobalMaximum:_yValElements];

    minimumOnY=[MIMProperties findMinimumOnY:minOfY];
    _scalingY=[MIMProperties findScaleForYTile:_yValElements gridHeight:_gridHeight tileHeight:_tileHeight :numOfHLines Min:0 Max:0];
    _scalingX=[MIMProperties findScaleForXTile:_xValElements XValuesAreString:xIsString LongGraph:_isLongGraph TileWidth:_tileWidth TileWidthDefinedByUser:_tileWidthDefinedByUser];
    pixelsPerTile=_tileHeight/_scalingY;

    _contentWidth=[MIMProperties returnLongGraphContentWidth:_scalingX TotalItemsOnXAxis:itemCountOnXAxis];
    if(_contentWidth < _gridWidth)
    {
        _isLongGraph=NO;
        _scalingX=[MIMProperties findScaleForXTile:_xValElements XValuesAreString:xIsString LongGraph:_isLongGraph TileWidth:_tileWidth TileWidthDefinedByUser:_tileWidthDefinedByUser];

    }

    if (_isLongGraph) {

        offsetXLabelOnLongGraph=_scalingX/4;
        if(offsetXLabelOnLongGraph<20)offsetXLabelOnLongGraph=20;
    }

    [self createLongLineGraphScrollView];
    //[self addSetterButton];

    return multipleLines;

}

-(void)createLineColorArray
{
    //Colors defined by user
    //Now it can be a single color or multiple color
    if(rangeColorArray)
    {
        lineColorA=[[NSMutableArray alloc] initWithArray:rangeColorArray];
        return;
    }

    int totalColors=[MIMColor sizeOfColorArray];

    //------
    BOOL pickDefaultColorForLineChart;

    if([delegate respondsToSelector:@selector(ColorsForRangeChart:)])
    {
        lineColorA=[[NSMutableArray alloc]initWithArray:[delegate ColorsForRangeChart:self]];
        if(lineColorA==nil)
        {
            pickDefaultColorForLineChart=TRUE;
            //NSLog(@"WARNING:Color of Line Chart not defined,hence picking up random color.");
        }
    }
    else
    {
        pickDefaultColorForLineChart=TRUE;

    }

    //By Default, pick same colors for all ranges
    //If not satisfied, user can call ColorsForRangeChart or rangeColorArray
    if(pickDefaultColorForLineChart)
    {
        lineColorA=[[NSMutableArray alloc]init];
        NSDictionary *_colorDic=[MIMColor GetColorAtIndex:rand()%totalColors];
        float red= [[_colorDic valueForKey:@"red"] floatValue];
        float green=[[_colorDic valueForKey:@"green"] floatValue];
        float blue=[[_colorDic valueForKey:@"blue"] floatValue];

        MIMColorClass *color=[MIMColorClass colorWithRed:red Green:green Blue:blue Alpha:1.0];
        [lineColorA addObject:color];
    }

}

-(void)createLongLineGraphScrollView
{
    if(_isLongGraph)
    {
        _contentWidth=[MIMProperties returnLongGraphContentWidth:_scalingX TotalItemsOnXAxis:itemCountOnXAxis];
        float contentHeight=self.frame.size.height-bottomMargin-topMargin;

        lineGScrollView=[[LineScrollView alloc]initWithFrame:CGRectMake(leftMargin+yAxisWidth, topMargin, _gridWidth -5, contentHeight)];
        [lineGScrollView setBackgroundColor:[UIColor clearColor]];
        lineGScrollView.contentSize=CGSizeMake(_contentWidth, contentHeight);

        [lineGScrollView setShowsHorizontalScrollIndicator:NO];
        [lineGScrollView setShowsVerticalScrollIndicator:NO];

        [self addSubview:lineGScrollView];
    }
}

#pragma mark - DRAW
- (void)drawRect:(CGRect)rect
{

    if([myPathArray count]==0)
        return;

    if(_xValElements==nil)
        return;

    // Drawing code
    CGContextRef ctx = UIGraphicsGetCurrentContext();

    CGContextSetAllowsAntialiasing(ctx, NO);
    CGContextSetShouldAntialias(ctx, NO);

    CGRect r=CGRectMake(0, 0, CGRectGetWidth(rect), CGRectGetHeight(rect));
    CGContextSetBlendMode(ctx,kCGBlendModeClear);
    CGContextSetFillColorWithColor(ctx, [UIColor redColor].CGColor);
    CGContextAddRect(ctx, r);
    CGContextFillPath(ctx);
    CGContextSetBlendMode(ctx,kCGBlendModeNormal);

    if(_isLongGraph)
    {

        for (UIView *view in lineGScrollView.subviews)
            if([view isKindOfClass:[MIMLongRangeGraph class]])
            {
                [view removeFromSuperview];
            }

        [MIMProperties drawBgPattern:ctx color:mbackgroundColor gridWidth:_gridWidth gridHeight:_gridHeight leftMargin:leftMargin+yAxisWidth topMargin:topMargin];
        [MIMProperties drawHorizontalBgLines:ctx withProperties:hlProperties gridHeight:_gridHeight tileHeight:_scalingY gridWidth:_gridWidth leftMargin:leftMargin+yAxisWidth topMargin:topMargin];

        MIMLongRangeGraph *graph=[[MIMLongRangeGraph alloc]initWithFrame:CGRectMake(0, 0, _contentWidth, self.frame.size.height)];
        graph.gridHeight=_gridHeight;
        graph.scalingX=_scalingX;
        graph.scalingY=_scalingY;
        graph.xIsString=xIsString;
        graph.rangeLineThickness=rangeLineThickness;
        graph.lineColorArray=lineColorA;
        graph.lineBezierPath=myPathArray;
        graph.aPropertiesArray=[NSMutableArray arrayWithArray:aPropertiesArray];
        graph.xValElements=[[NSMutableArray alloc]initWithArray:_xValElements];
        graph.yValElements=[[NSMutableArray alloc]initWithArray:_yValElements];
        graph.leftMargin=leftMargin;
        graph.bottomMargin=bottomMargin;
        graph.xAxisHeight=xAxisHeight;
        [lineGScrollView addSubview:graph];

        return;

    }
    else{

        [MIMProperties drawBgPattern:ctx color:mbackgroundColor gridWidth:_gridWidth gridHeight:_gridHeight leftMargin:leftMargin+yAxisWidth topMargin:topMargin];
        [MIMProperties drawHorizontalBgLines:ctx withProperties:hlProperties gridHeight:_gridHeight tileHeight:_scalingY gridWidth:_gridWidth leftMargin:leftMargin+yAxisWidth topMargin:topMargin];

    }

    [MIMProperties drawVerticalBgLines:ctx withProperties:vlProperties gridHeight:_gridHeight tileWidth:_tileWidth gridWidth:_gridWidth scalingX:_scalingX xIsString:xIsString bottomMargin:bottomMargin leftMargin:leftMargin+yAxisWidth topMargin:topMargin];

    CGAffineTransform flipTransform = CGAffineTransformMake( 1, 0, 0, -1, 0, self.frame.size.height);
    CGContextConcatCTM(ctx, flipTransform);

    CGContextSetAllowsAntialiasing(ctx, YES);
    CGContextSetShouldAntialias(ctx, YES);

    for (int i=0; i<[myPathArray count]; i++)
    {
        MIMColorClass *c=[lineColorA objectAtIndex:0];
        if([lineColorA count]==[myPathArray count])
        {
            c=[lineColorA objectAtIndex:i];
        }

        UIColor *_color=[[UIColor alloc]initWithRed:c.red green:c.green blue:c.blue alpha:c.alpha];
        [_color setStroke];
        UIBezierPath *myP=[myPathArray objectAtIndex:i];
        [myP setLineWidth:rangeLineThickness];
        [myP strokeWithBlendMode:kCGBlendModeNormal alpha:1.0];

    }

   // [self _drawAnchorPoints];

}

-(void)_displayXAxisLabels
{

    if([[xLProperties allKeys] count]==0)
        xLProperties=[[NSMutableDictionary alloc] init];

    if(![xLProperties valueForKey:@"style"]) [xLProperties setValue:[NSNumber numberWithInt:xTitleStyle] forKey:@"style"];
    [xLProperties setValue:[NSNumber numberWithBool:xIsString] forKey:@"xisstring"];
    [xLProperties setValue:[NSNumber numberWithBool:YES] forKey:@"linechart"];
    [xLProperties setValue:[NSNumber numberWithFloat:_scalingX] forKey:@"xscaling"];
    [xLProperties setValue:[NSNumber numberWithFloat:offsetXLabelOnLongGraph] forKey:@"xoffset"];

    XAxisBand *_xBand;
    if(_isLongGraph)
        _xBand=[[XAxisBand alloc]initWithFrame:CGRectMake(0,_gridHeight, _contentWidth+offsetXLabelOnLongGraph,xAxisHeight)];//
    else
        _xBand=[[XAxisBand alloc]initWithFrame:CGRectMake(leftMargin+yAxisWidth,_gridHeight+topMargin, _gridWidth, xAxisHeight)];

    _xBand.properties=xLProperties;
    _xBand.xElements=[[NSArray alloc]initWithArray:_xTitles];
    if(_isLongGraph) [lineGScrollView addSubview:_xBand];
    else [self addSubview:_xBand];

}

-(void)_displayYAxisLabels
{

    BOOL yLabelsVisible=FALSE;
    if([yLProperties valueForKey:@"hide"])
        yLabelsVisible=[[yLProperties valueForKey:@"hide"] boolValue];

    if(yLabelsVisible)
        return;

    if([[yLProperties allKeys] count]==0)
        yLProperties=[[NSMutableDictionary alloc] init];

    [yLProperties setValue:[NSNumber numberWithFloat:pixelsPerTile] forKey:@"pxpertile"];
    [yLProperties setValue:[NSNumber numberWithInt:numOfHLines] forKey:@"num"];
    [yLProperties setValue:[NSNumber numberWithFloat:minimumOnY] forKey:@"minY"];
    [yLProperties setValue:[NSNumber numberWithFloat:_scalingY] forKey:@"tileHeight"];

    YAxisBand *_yBand=[[YAxisBand alloc]initWithFrame:CGRectMake(leftMargin,topMargin-10, yAxisWidth, _gridHeight+20)];
    _yBand.properties=yLProperties;
    _yBand.yTitles=_yValElements;
    //Add one more element at index 0.
    [self addSubview:_yBand];

}

@end


text:
Arborescence

 PASS! Anglais 2012-2013 Master MES

 En route vers le A1

 En route vers le A2

 Charte d'engagement PASS! MES (de ce cours = objet transversal cours)

 Forum (objet transversal cours)

 Parcours PASS with Deirdre

 Forum (objet transversal unité)

 Présentation

 Que faire ici ?

 Je serai votre tutrice

 Etape 1 - Nice to meet you !

 Livrets de liaison

 Week 1- Greeting someone

 Week 2- Talking about your family

 Week 3- Asking and answering questions

 Week 4- Let's Review!

 Week 5- Writing

 Etape 2- Things around you

 Livrets de Liaison

 Week 1- Describing people

 The Flatmates: At the Airport

 What are your best qualities?

 The Flatmates: The Year of the dog

 The Flatmates: Not so much

 Have or have got

 Week 2- Describing places

 Listen to six people describe where they like to live

 Countryside

 Town jigsaw puzzle

 Listen to six people describing the best places to live

 Past Simple

 Week 3- Describing things

 Office vocabulary (Match the image with the word)

 Shapes vocabulary (Match the image with the word)

 Office Supplies Hangman (Play this game to test your knowledge on office vocabulary)

 Week 4- Let's Review!

 Describing people

 Past Simple

 Shapes

 In the Classroom

 Adjectives

 Week 5- Writing

 How to Write an Article?

 The Simpsons

 Writing

  Etape 3- Food & Drink

 Livrets de Liaison

 Week 1- Saying What you Eat or Drink

 Week 2- Asking for Things in a Restaurant

 Week 3- Likes and Dislikes

 Week 4- Let's Review!

 Week 5- Writing

 Etape 4- Everday Acrivities

 Livrets de Liaison

 Week 1- Talking about your Daily Routine

 Week 2- Asking for Things in a Restaurant

 Week 3- Talking about Shops and Shopping

 Week 4- Let's Review!

 Week 5- Writing

 En route vers le B1

 En route vers le B2

 En route vers le C1


text:
import {
  DateTime,
  Duration,
  Interval,
  Settings,
  Info,
  Zone,
  LocalZone,
} from 'luxon';

(Settings.defaultLocale: string);
(Settings.defaultNumberingSystem: ?string);
(Settings.defaultOutputCalendar: ?string);
(Settings.defaultZone: Zone);
(Settings.defaultZoneName: string);
(Settings.now(): number);
(Settings.throwOnInvalid: boolean);
Settings.resetCaches();
Settings.defaultZone = new LocalZone();

(Info.eras('long'): Array<string>);
(Info.eras('long', { locale: 'de-DE' }): Array<string>);
// $FlowExpectedError[prop-missing]
(Info.eras('long', { foo: 'bar' }): Array<string>);

(Info.features().intl: boolean);
(Info.features().intlTokens: boolean);
(Info.features().timezones: boolean);
(Info.features().relative: boolean);

(Info.hasDST('America/Chicago'): boolean);
(Info.hasDST(new LocalZone()): boolean);

(Info.meridiems(): Array<string>);
(Info.meridiems({ locale: 'de-DE' }): Array<string>);

(Info.months('long'): Array<string>);
(Info.months('narrow', { locale: 'de-DE' }): Array<string>);
(Info.months('short', { numberingSystem: 'arab' }): Array<string>);
(Info.months('2-digit', {
  numberingSystem: 'latn',
  outputCalendar: 'buddhist',
}): Array<string>);
// $FlowExpectedError[prop-missing]
(Info.months('long', { foo: 'bar' }): Array<string>);

(Info.monthsFormat('long'): Array<string>);
(Info.monthsFormat('narrow', { locale: 'de-DE' }): Array<string>);
(Info.monthsFormat('short', { numberingSystem: 'arab' }): Array<string>);
(Info.monthsFormat('2-digit', {
  numberingSystem: 'latn',
  outputCalendar: 'buddhist',
}): Array<string>);
// $FlowExpectedError[prop-missing]
(Info.monthsFormat('long', { foo: 'bar' }): Array<string>);

(Info.weekdays('long'): Array<string>);
(Info.weekdays('narrow', { locale: 'de-DE' }): Array<string>);
(Info.weekdays('short', { numberingSystem: 'arab' }): Array<string>);
(Info.weekdays('long', {
  numberingSystem: 'latn',
  outputCalendar: 'buddhist',
}): Array<string>);
// $FlowExpectedError[prop-missing]
(Info.weekdays('long', { foo: 'bar' }): Array<string>);

(Info.weekdaysFormat('long'): Array<string>);
(Info.weekdaysFormat('narrow', { locale: 'de-DE' }): Array<string>);
(Info.weekdaysFormat('short', { numberingSystem: 'arab' }): Array<string>);
(Info.weekdaysFormat('long', {
  numberingSystem: 'latn',
  outputCalendar: 'buddhist',
}): Array<string>);
// $FlowExpectedError[prop-missing]
(Info.weekdaysFormat('long', { foo: 'bar' }): Array<string>);

(DateTime.local().toJSDate(): Date);
DateTime.local(2012).toJSDate();
DateTime.local(2012, 1, 16).toJSDate();

(DateTime.utc().toJSDate(): Date);
DateTime.utc(2012).toJSDate();
DateTime.utc(2012, 1, 16).toJSDate();

var date: DateTime = DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT');
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', {});
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { zone: 'America/Chicago' });
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { zone: new LocalZone() });
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { locale: 'en-US' });
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP();
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP({});
// $FlowExpectedError[prop-missing]
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT', { numberingSystem: 2 });

var date: DateTime = DateTime.fromObject({ year: 2017, month: 1, day: 23 });
DateTime.fromObject({ year: 2017, month: 1, day: 23 });
DateTime.fromObject({ year: 2017, month: 1, day: 23, zone: 'America/Chicago' });
DateTime.fromObject({ year: 2017, month: 1, day: 23, zone: new LocalZone() });
DateTime.fromObject({ year: 2017, month: 1, day: 23, locale: 'en-US' });
DateTime.fromObject({
  year: 2017,
  month: 1,
  day: 23,
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromObject();
// $FlowExpectedError[incompatible-call]
DateTime.fromObject('blah');
// $FlowExpectedError[prop-missing]
DateTime.fromObject({ year: 2017, month: 1, day: 23, foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 'January', day: 23 });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 1, day: 'Monday' });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 1, day: 23, zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 1, day: 23, locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 1, day: 23, setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 1, day: 23, outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromObject({ year: 2017, month: 1, day: 23, numberingSystem: 2 });

var date: DateTime = DateTime.fromISO('2017-01-28T23:00:01');
DateTime.fromISO('2017-01-28T23:00:01', {});
DateTime.fromISO('2017-01-28T23:00:01', { zone: 'America/Chicago' });
DateTime.fromISO('2017-01-28T23:00:01', { zone: new LocalZone() });
DateTime.fromISO('2017-01-28T23:00:01', { locale: 'en-US' });
DateTime.fromISO('2017-01-28T23:00:01', {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromISO();
// $FlowExpectedError[prop-missing]
DateTime.fromISO('2017-01-28T23:00:01', { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromISO('2017-01-28T23:00:01', { zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromISO('2017-01-28T23:00:01', { locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromISO('2017-01-28T23:00:01', { setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromISO('2017-01-28T23:00:01', { outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromISO('2017-01-28T23:00:01', { numberingSystem: 2 });

var date: DateTime = DateTime.fromJSDate(new Date());
DateTime.fromJSDate(new Date(), {});
DateTime.fromJSDate(new Date(), { zone: 'America/Chicago' });
DateTime.fromJSDate(new Date(), { zone: new LocalZone() });
// $FlowExpectedError[prop-missing]
DateTime.fromJSDate(new Date(), { locale: 'en-US' });
// $FlowExpectedError[incompatible-call]
DateTime.fromJSDate();
// $FlowExpectedError[incompatible-call]
DateTime.fromJSDate(1234234123);
// $FlowExpectedError[prop-missing]
DateTime.fromJSDate(new Date(), { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromJSDate(new Date(), { zone: 2 });
// $FlowExpectedError[prop-missing]
DateTime.fromJSDate(new Date(), { locale: 2 });
// $FlowExpectedError[prop-missing]
DateTime.fromJSDate(new Date(), { setZone: 'yes' });
// $FlowExpectedError[prop-missing]
DateTime.fromJSDate(new Date(), { outputCalendar: 2 });
// $FlowExpectedError[prop-missing]
DateTime.fromJSDate(new Date(), { numberingSystem: 2 });

var date: DateTime = DateTime.fromMillis(123412323);
DateTime.fromMillis(123412323, {});
DateTime.fromMillis(123412323, { zone: 'America/Chicago' });
DateTime.fromMillis(123412323, { zone: new LocalZone() });
DateTime.fromMillis(123412323, { locale: 'en-US' });
DateTime.fromMillis(123412323, {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis();
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis('1234234123');
// $FlowExpectedError[prop-missing]
DateTime.fromMillis(123412323, { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis(123412323, { zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis(123412323, { locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis(123412323, { setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis(123412323, { outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromMillis(123412323, { numberingSystem: 2 });

var date: DateTime = DateTime.fromSeconds(123412323);
DateTime.fromSeconds(123412323, {});
DateTime.fromSeconds(123412323, { zone: 'America/Chicago' });
DateTime.fromSeconds(123412323, { zone: new LocalZone() });
DateTime.fromSeconds(123412323, { locale: 'en-US' });
DateTime.fromSeconds(123412323, {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds();
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds('1234234123');
// $FlowExpectedError[prop-missing]
DateTime.fromSeconds(123412323, { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds(123412323, { zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds(123412323, { locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds(123412323, { setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds(123412323, { outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromSeconds(123412323, { numberingSystem: 2 });

var date: DateTime = DateTime.fromRFC2822('12/15/2017, 12:47:25 PM');
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', {});
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { zone: 'America/Chicago' });
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { zone: new LocalZone() });
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { locale: 'en-US' });
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromRFC2822();
// $FlowExpectedError[prop-missing]
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromRFC2822('12/15/2017, 12:47:25 PM', { numberingSystem: 2 });

var date: DateTime = DateTime.fromSQL('12/15/2017, 12:47:25 PM');
DateTime.fromSQL('12/15/2017, 12:47:25 PM', {});
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { zone: 'America/Chicago' });
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { zone: new LocalZone() });
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { locale: 'en-US' });
DateTime.fromSQL('12/15/2017, 12:47:25 PM', {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromSQL();
// $FlowExpectedError[prop-missing]
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { foo: 'bar' });
// $FlowExpectedError[incompatible-call]
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { zone: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { locale: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { setZone: 'yes' });
// $FlowExpectedError[incompatible-call]
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { outputCalendar: 2 });
// $FlowExpectedError[incompatible-call]
DateTime.fromSQL('12/15/2017, 12:47:25 PM', { numberingSystem: 2 });

var date: DateTime = DateTime.fromFormat(
  '12/15/2017, 12:47:25 PM',
  'dd/MM/yyyy h:mm:ss a'
);
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  zone: 'America/Chicago',
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  zone: new LocalZone(),
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  locale: 'en-US',
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  zone: 'America/Chicago',
  setZone: true,
  locale: 'en-US',
  outputCalendar: 'gregory',
  numberingSystem: 'buddhist',
});
// $FlowExpectedError[incompatible-call]
DateTime.fromFormat();
// $FlowExpectedError[incompatible-call]
DateTime.fromFormat('12/15/2017, 12:47:25 PM');
// $FlowExpectedError[incompatible-call]
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 2);
// $FlowExpectedError[incompatible-call]
DateTime.fromFormat('12/15/2017, 12:47:25 PM', { zone: 'America/Chicago' });
// $FlowExpectedError[prop-missing]
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  foo: 'bar',
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  // $FlowExpectedError[incompatible-call]
  zone: 2,
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  // $FlowExpectedError[incompatible-call]
  locale: 2,
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  // $FlowExpectedError[incompatible-call]
  setZone: 'yes',
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  // $FlowExpectedError[incompatible-call]
  outputCalendar: 2,
});
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  // $FlowExpectedError[incompatible-call]
  numberingSystem: 2,
});
var date: DateTime = DateTime.invalid('test');
// $FlowExpectedError[incompatible-call]
DateTime.invalid();

// Flow 0.40 - 0.45 allows these but they're incorrect...bug!
// DateTime.max();
// DateTime.min();

var date = DateTime.max(DateTime.local(), DateTime.utc(), DateTime.utc());
var date = DateTime.min(DateTime.local(), DateTime.utc(), DateTime.utc());
// $FlowExpectedError[incompatible-call]
var date = DateTime.max(DateTime.local(), null, DateTime.utc());
// $FlowExpectedError[incompatible-call]
var date = DateTime.min(DateTime.local(), null, DateTime.utc());

(date.day: number);
(date.daysInMonth: number);
(date.daysInYear: number);
(date.hour: number);
(date.invalidReason: ?string);
(date.invalidExplanation: ?string);
(date.isInDST: boolean);
(date.isInLeapYear: boolean);
(date.isOffsetFixed: boolean);
(date.isValid: boolean);
(date.locale: string);
(date.millisecond: number);
(date.minute: number);
(date.month: number);
(date.monthLong: string);
(date.monthShort: string);
(date.numberingSystem: ?string);
(date.offset: number);
(date.offsetNameLong: string);
(date.offsetNameShort: string);
(date.ordinal: number);
(date.outputCalendar: ?string);
(date.second: number);
(date.weekNumber: number);
(date.weekYear: number);
(date.weekday: number);
(date.weekdayLong: string);
(date.weekdayShort: string);
(date.weeksInWeekYear: number);
(date.year: number);
(date.zoneName: string);

(date.diff(DateTime.utc(), 'year'): Duration);
(date.diff(DateTime.utc(), ['year', 'month']): Duration);
(date.diff(DateTime.utc(), ['year', 'month'], {}): Duration);
(date.diff(DateTime.utc(), ['year', 'month'], {
  conversionAccuracy: 'longterm',
}): Duration);
// $FlowExpectedError[incompatible-call]
(date.diff(new Date()): Duration);
(date.diff(DateTime.utc()): Duration);
// $FlowExpectedError[incompatible-call]
(date.diff(DateTime.utc(), 'glom'): Duration);
// $FlowExpectedError[incompatible-call]
(date.diff(DateTime.utc(), ['year', 'glom']): Duration);
// $FlowExpectedError[prop-missing]
(date.diff(DateTime.utc(), ['year', 'month'], { foo: 'bar' }): Duration);

(date.diffNow(): Duration);
(date.diffNow('year'): Duration);
(date.diffNow(['year', 'month']): Duration);
(date.diffNow(['year', 'month'], {}): Duration);
(date.diffNow(['year', 'month'], { conversionAccuracy: 'longterm' }): Duration);
// $FlowExpectedError[incompatible-call]
(date.diff(new Date()): Duration);
(date.diff(DateTime.utc()): Duration);
// $FlowExpectedError[incompatible-call]
(date.diffNow('glom'): Duration);
// $FlowExpectedError[incompatible-call]
(date.diffNow(['year', 'glom']): Duration);
// $FlowExpectedError[prop-missing]
(date.diffNow(['year', 'month'], { foo: 'bar' }): Duration);

(date.startOf('year'): DateTime);
(date.startOf('month'): DateTime);
(date.startOf('day'): DateTime);
(date.startOf('seconds'): DateTime);
// $FlowExpectedError[incompatible-call]
(date.startOf('secs'): DateTime);

(date.endOf('year'): DateTime);
(date.endOf('month'): DateTime);
(date.endOf('day'): DateTime);
(date.endOf('seconds'): DateTime);
// $FlowExpectedError[incompatible-call]
(date.endOf('secs'): DateTime);

if (date.equals(DateTime.utc())) {
}
// $FlowExpectedError[incompatible-call]
if (date.equals(new Date())) {
}

(date.get('year'): number);
(date.get('month'): number);
// $FlowExpectedError[incompatible-call]
(date.get('secs'): number);

(date.hasSame(DateTime.utc(), 'year'): boolean);
(date.hasSame(DateTime.utc(), 'month'): boolean);
// $FlowExpectedError[incompatible-call]
(date.hasSame(DateTime.utc(), 'secs'): boolean);
// $FlowExpectedError[incompatible-call]
(date.hasSame(new Date(), 'month'): boolean);

(date.minus({ day: 1 }): DateTime);
(date.minus(232): DateTime);
(date.minus(Duration.fromObject({ day: 1 })): DateTime);
// $FlowExpectedError[incompatible-call]
(date.minus({ glab: 1 }): DateTime);

(date.plus({ day: 1 }): DateTime);
(date.plus(232): DateTime);
(date.plus(Duration.fromObject({ day: 1 })): DateTime);
// $FlowExpectedError[incompatible-call]
(date.plus({ glab: 1 }): DateTime);

(date.reconfigure({ zone: 'America/Detroit' }): DateTime);

(date.resolvedLocaleOpts().locale: string);
(date.resolvedLocaleOpts().outputCalendar: string);
(date.resolvedLocaleOpts().numberingSystem: string);

(date.set({ year: 1, month: 2 }): DateTime);
(date.set({ minutes: 1, seconds: 2 }): DateTime);
(date.set({ minutes: 1, seconds: 2, ordinal: 255 }): DateTime);
// $FlowExpectedError[incompatible-call]
(date.set({ minutes: 1, seconds: 2, simpsons: 3 }): DateTime);

(date.setLocale('de-DE'): DateTime);

(date.setZone('America/Detroit'): DateTime);
(date.setZone('America/Detroit', { keepCalendarTime: true }): DateTime); // Support deprecated name for keepLocalTime
(date.setZone('America/Detroit', { keepLocalTime: true }): DateTime);
(date.setZone(new LocalZone()): DateTime);

(date.toBSON(): Date);

(date.toFormat('yyyy/MM/dd'): string);
(date.toFormat('yyyy/MM/dd', { round: true }): string);

(date.toHTTP(): string);

(date.toISO(): string);
(date.toISO({}): string);
(date.toISO({
  suppressMilliseconds: true,
  suppressSeconds: true,
  includeOffset: true,
}): string);
// $FlowExpectedError[prop-missing]
(date.toISO({ blah: true }): string);

(date.toISOTime(): string);
(date.toISOTime({}): string);
(date.toISOTime({
  suppressMilliseconds: true,
  suppressSeconds: true,
  includeOffset: true,
}): string);
// $FlowExpectedError[prop-missing]
(date.toISOTime({ blah: true }): string);

(date.toISOWeekDate(): string);
(date.toJSDate(): Date);
(date.toLocal(): DateTime);

(date.toLocaleParts(): Array<{ type: string, value: number, ... }>);
(date.toLocaleParts({ month: 'numeric' }): Array<{
  type: string,
  value: number,
  ...
}>);
(date.toLocaleParts({ year: 'numeric' }): Array<{
  type: string,
  value: number,
  ...
}>);
// $FlowExpectedError[prop-missing]
(date.toLocaleParts({ foo: 'bar' }): Array<{
  type: string,
  value: number,
  ...
}>);

(date.toLocaleString(): string);
(date.toLocaleString({ month: 'numeric' }): string);
(date.toLocaleString({ year: 'numeric' }): string);
// $FlowExpectedError[prop-missing]
(date.toLocaleString({ foo: 'bar' }): string);

(date.toRelative(): string);
(date.toRelative({ base: date }): string);
// $FlowExpectedError[incompatible-call]
(date.toRelative({ base: '2020-09-01' }): string);
(date.toRelative({ locale: 'fr' }): string);
// $FlowExpectedError[prop-missing]
(date.toRelative({ foo: 'bar' }): string);

(date.toRelativeCalendar(): string);
(date.toRelativeCalendar({ base: date }): string);
// $FlowExpectedError[incompatible-call]
(date.toRelativeCalendar({ base: '2020-09-01' }): string);
(date.toRelativeCalendar({ locale: 'fr' }): string);
// $FlowExpectedError[incompatible-call]
(date.toRelativeCalendar({ unit: 'seconds' }): string);
(date.toRelativeCalendar({ unit: 'quarters' }): string);
// $FlowExpectedError[prop-missing]
(date.toRelativeCalendar({ foo: 'bar' }): string);

(date.toMillis(): number);

(date.toObject().year: number);
(date.toObject().month: number);
(date.toObject().day: number);
(date.toObject().hour: number);
(date.toObject().minute: number);
(date.toObject().second: number);
(date.toObject().millisecond: number);
(date.toObject({ includeConfig: true }).locale: string);
(date.toObject({ includeConfig: true }).outputCalendar: ?string);
(date.toObject({ includeConfig: true }).numberingSystem: ?string);
// $FlowExpectedError[prop-missing]
date.toObject({ includeConfig: false }).locale;
// $FlowExpectedError[prop-missing]
date.toObject({ includeConfig: false }).outputCalendar;
// $FlowExpectedError[prop-missing]
date.toObject({ includeConfig: false }).numberingSystem;

(date.toRFC2822(): string);

(date.toSQL(): string);
(date.toSQL({}): string);
(date.toSQL({ includeZone: true, includeOffset: true }): string);
// $FlowExpectedError[prop-missing]
(date.toSQL({ blah: true }): string);

(date.toSQLDate(): string);

(date.toSQLTime(): string);
(date.toSQLTime({}): string);
(date.toSQLTime({ includeZone: true, includeOffset: true }): string);
// $FlowExpectedError[prop-missing]
(date.toSQLTime({ blah: true }): string);

(date.toString(): string);

(date.toUTC(): DateTime);
(date.toUTC(32): DateTime);
(date.toUTC(32, { keepCalendarTime: true }): DateTime); // Support deprecated name for keepLocalTime
(date.toUTC(32, { keepLocalTime: true }): DateTime);

(date.until(DateTime.utc()): Interval);

(date.valueOf(): number);

(Duration.fromISO('lkasdfa'): Duration);
(Duration.fromISO('lkasdfa', {
  locale: 'de-DE',
  numberingSystem: 'gujr',
  conversionAccuracy: 'casual',
}): Duration);
// $FlowExpectedError[incompatible-call]
(Duration.fromISO(): Duration);
// $FlowExpectedError[prop-missing]
(Duration.fromISO('lkasdfa', { foo: 'bar' }): Duration);

(Duration.fromObject({ year: 1 }): Duration);
(Duration.fromObject({ years: 1 }): Duration);
(Duration.fromObject({ year: 1, months: 1 }): Duration);
(Duration.fromObject({
  year: 1,
  months: 1,
  locale: 'de-DE',
  numberingSystem: 'gujr',
  conversionAccuracy: 'casual',
}): Duration);
// $FlowExpectedError[incompatible-call]
(Duration.fromObject(): Duration);
// $FlowExpectedError[prop-missing]
(Duration.fromObject({ year: 1, months: 1, foo: 'bar' }): Duration);

(Duration.fromMillis(23123412): Duration);
(Duration.fromMillis(23123412, {
  locale: 'de-DE',
  numberingSystem: 'gujr',
  conversionAccuracy: 'casual',
}): Duration);
// $FlowExpectedError[incompatible-call]
(Duration.fromMillis(): Duration);
// $FlowExpectedError[prop-missing]
(Duration.fromMillis(23123412, { foo: 'bar' }): Duration);

(Duration.invalid('test'): Duration);
// $FlowExpectedError[incompatible-call]
(Duration.invalid(): Duration);

var dur: Duration = Duration.invalid('test');

(dur.days: number);
(dur.hours: number);
(dur.invalidReason: ?string);
(dur.invalidExplanation: ?string);
(dur.isValid: boolean);
(dur.locale: string);
(dur.milliseconds: number);
(dur.minutes: number);
(dur.months: number);
(dur.quarters: number);
(dur.numberingSystem: string);
(dur.seconds: number);
(dur.weeks: number);
(dur.years: number);

(dur.as('year'): number);
(dur.as('years'): number);
(dur.as('month'): number);
(dur.as('months'): number);
(dur.as('week'): number);
(dur.as('weeks'): number);
(dur.as('day'): number);
(dur.as('days'): number);
(dur.as('hour'): number);
(dur.as('hours'): number);
(dur.as('minute'): number);
(dur.as('minutes'): number);
(dur.as('second'): number);
(dur.as('seconds'): number);
(dur.as('millisecond'): number);
(dur.as('milliseconds'): number);
// $FlowExpectedError[incompatible-call]
(dur.as('date'): number);

(dur.equals(Duration.invalid('test')): boolean);
// $FlowExpectedError[incompatible-call]
(dur.equals(new Date()): boolean);

(dur.get('year'): number);
(dur.get('years'): number);
(dur.get('quarter'): number);
(dur.get('quarters'): number);
(dur.get('month'): number);
(dur.get('months'): number);
(dur.get('week'): number);
(dur.get('weeks'): number);
(dur.get('day'): number);
(dur.get('days'): number);
(dur.get('hour'): number);
(dur.get('hours'): number);
(dur.get('minute'): number);
(dur.get('minutes'): number);
(dur.get('second'): number);
(dur.get('seconds'): number);
(dur.get('millisecond'): number);
(dur.get('milliseconds'): number);
// $FlowExpectedError[incompatible-call]
(dur.get('date'): number);

(dur.negate(): Duration);
(dur.normalize(): Duration);

(dur.minus({ day: 1 }): Duration);
(dur.minus(232): Duration);
(dur.minus(Duration.fromObject({ day: 1 })): Duration);
// $FlowExpectedError[incompatible-call]
(dur.minus({ glab: 1 }): Duration);

(dur.plus({ day: 1 }): Duration);
(dur.plus(232): Duration);
(dur.plus(Duration.fromObject({ day: 1 })): Duration);
// $FlowExpectedError[incompatible-call]
(dur.plus({ glab: 1 }): Duration);

(dur.reconfigure({ locale: 'de-DE' }): Duration);
(dur.reconfigure({ numberingSystem: 'latn' }): Duration);
(dur.reconfigure({ conversionAccuracy: 'longterm' }): Duration);
// $FlowExpectedError[prop-missing]
(dur.reconfigure({ foo: 'bar' }): Duration);
// $FlowExpectedError[incompatible-call]
(dur.reconfigure({ conversionAccuracy: 'date' }): Duration);

(dur.set({ year: 1 }): Duration);
(dur.set({ months: 1 }): Duration);
(dur.set({ months: 1, locale: 'de-DE' }): Duration);
// $FlowExpectedError[prop-missing]
(dur.set({ foos: 1 }): Duration);

(dur.shiftTo('years'): Duration);
(dur.shiftTo('years', 'days'): Duration);
// $FlowExpectedError[incompatible-call]
(dur.shiftTo('years', 'mnths', 'days'): Duration);

(dur.toFormat('yyyy/MM/dd'): string);
(dur.toFormat('yyyy/MM/dd', { floor: true }): string);
// $FlowExpectedError[prop-missing]
(dur.toFormat('yyyy/MM/dd', { rnd: true }): string);

(dur.toISO(): string);
(dur.toJSON(): string);

(dur.toObject().years: ?number);
(dur.toObject().months: ?number);
(dur.toObject().days: ?number);
(dur.toObject().hours: ?number);
(dur.toObject().minutes: ?number);
(dur.toObject().seconds: ?number);
(dur.toObject().milliseconds: ?number);
(dur.toObject({ includeConfig: true }).locale: string);
(dur.toObject({ includeConfig: true }).numberingSystem: ?string);
(dur.toObject({ includeConfig: true }).conversionAccuracy: ?string);
// $FlowExpectedError[prop-missing]
dur.toObject({ includeConfig: false }).locale;
// $FlowExpectedError[prop-missing]
dur.toObject({ includeConfig: false }).numberingSystem;
// $FlowExpectedError[prop-missing]
dur.toObject({ includeConfig: false }).conversionAccuracy;

(dur.toString(): string);
(dur.valueOf(): number);

(Interval.after(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.after(DateTime.utc(), { year: 1 }): Interval);
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $FlowExpectedError[incompatible-call]
(Interval.after({ year: 2017, month: 1, foo: 'bar' }, { year: 1 }): Interval);
// $FlowExpectedError[incompatible-call]
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: 'bar' }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $FlowExpectedError[incompatible-call]
(Interval.before({ year: 2017, month: 1, foo: 'bar' }, { year: 1 }): Interval);
// $FlowExpectedError[incompatible-call]
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: 'bar' }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  // $FlowExpectedError[incompatible-call]
  { year: 2016, month: 1, foo: 'bar' },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  // $FlowExpectedError[incompatible-call]
  { year: 2017, month: 1, foo: 'bar' }
): Interval);

(Interval.fromISO('23;lkj1'): Interval);
(Interval.fromISO('23;lkj1', {
  zone: 'America/Chicago',
  locale: 'de-DE',
}): Interval);
// $FlowExpectedError[prop-missing]
(Interval.fromISO('23;lkj1', { foo: 'bar' }): Interval);

(Interval.invalid('test'): Interval);
// $FlowExpectedError[incompatible-call]
(Interval.invalid(): Interval);

var int: Interval = Interval.invalid('test');

(Interval.merge([int]): Array<Interval>);
(Interval.merge([int, int, int]): Array<Interval>);
// $FlowExpectedError[extra-arg]
(Interval.merge([int], int): Array<Interval>);
// $FlowExpectedError[incompatible-call]
(Interval.merge(int): Array<Interval>);

(Interval.xor([int]): Array<Interval>);
(Interval.xor([int, int, int]): Array<Interval>);
// $FlowExpectedError[extra-arg]
(Interval.xor([int], int): Array<Interval>);
// $FlowExpectedError[incompatible-call]
(Interval.xor(int): Array<Interval>);

(int.end: DateTime);
(int.invalidReason: ?string);
(int.isValid: boolean);
(int.start: DateTime);

(int.abutsEnd(int): boolean);
(int.abutsStart(int): boolean);
(int.contains(date): boolean);

(int.count('year'): number);
(int.count('years'): number);
(int.count('month'): number);
(int.count('months'): number);
(int.count('day'): number);
(int.count('days'): number);
(int.count('hour'): number);
(int.count('hours'): number);
(int.count('minute'): number);
(int.count('minutes'): number);
(int.count('second'): number);
(int.count('seconds'): number);
(int.count('millisecond'): number);
(int.count('milliseconds'): number);
(int.count('week'): number);
(int.count('weeks'): number);
// $FlowExpectedError[incompatible-call]
(int.count('wks'): number);
// $FlowExpectedError[incompatible-call]
(int.count('weekNumber'): number);
// $FlowExpectedError[incompatible-call]
(int.count('weekNumbers'): number);
// $FlowExpectedError[incompatible-call]
(int.count('weekYear'): number);
// $FlowExpectedError[incompatible-call]
(int.count('weekYears'): number);
// $FlowExpectedError[incompatible-call]
(int.count('weekday'): number);
// $FlowExpectedError[incompatible-call]
(int.count('weekdays'): number);
// $FlowExpectedError[incompatible-call]
(int.count('ordinal'): number);

(int.difference(): Interval);
(int.difference(int): Interval);
(int.difference(int, int, int): Interval);

(int.divideEqually(3): Array<Interval>);
(int.engulfs(int): boolean);
(int.equals(int): boolean);

(int.hasSame('year'): boolean);
(int.hasSame('years'): boolean);
(int.hasSame('month'): boolean);
(int.hasSame('months'): boolean);
(int.hasSame('day'): boolean);
(int.hasSame('days'): boolean);
(int.hasSame('hour'): boolean);
(int.hasSame('hours'): boolean);
(int.hasSame('minute'): boolean);
(int.hasSame('minutes'): boolean);
(int.hasSame('second'): boolean);
(int.hasSame('seconds'): boolean);
(int.hasSame('millisecond'): boolean);
(int.hasSame('milliseconds'): boolean);
(int.hasSame('week'): boolean);
(int.hasSame('weeks'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('wks'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('weekNumber'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('weekNumbers'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('weekYear'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('weekYears'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('weekday'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('weekdays'): boolean);
// $FlowExpectedError[incompatible-call]
(int.hasSame('ordinal'): boolean);

(int.intersection(int): Interval);

(int.isAfter(date): boolean);
(int.isBefore(date): boolean);
(int.isEmpty(): boolean);

(int.length('year'): number);
(int.length('years'): number);
(int.length('month'): number);
(int.length('months'): number);
(int.length('day'): number);
(int.length('days'): number);
(int.length('hour'): number);
(int.length('hours'): number);
(int.length('minute'): number);
(int.length('minutes'): number);
(int.length('second'): number);
(int.length('seconds'): number);
(int.length('millisecond'): number);
(int.length('milliseconds'): number);
(int.length('week'): number);
(int.length('weeks'): number);
// $FlowExpectedError[incompatible-call]
(int.length('wks'): number);
// $FlowExpectedError[incompatible-call]
(int.length('weekNumber'): number);
// $FlowExpectedError[incompatible-call]
(int.length('weekNumbers'): number);
// $FlowExpectedError[incompatible-call]
(int.length('weekYear'): number);
// $FlowExpectedError[incompatible-call]
(int.length('weekYears'): number);
// $FlowExpectedError[incompatible-call]
(int.length('weekday'): number);
// $FlowExpectedError[incompatible-call]
(int.length('weekdays'): number);
// $FlowExpectedError[incompatible-call]
(int.length('ordinal'): number);

(int.overlaps(int): boolean);

(int.set({ start: date }): Interval);
(int.set({ end: date }): Interval);
(int.set({ start: date, end: date }): Interval);
// $FlowExpectedError[prop-missing]
(int.set({ foo: 'bar' }): Interval);

(int.splitAt(): Array<Interval>);
(int.splitAt(date): Array<Interval>);
(int.splitAt(date, date, date): Array<Interval>);
(int.toDuration('year'): Duration);
(int.toDuration(['year', 'month']): Duration);
(int.toDuration(['year', 'month'], {
  conversionAccuracy: 'longterm',
}): Duration);
(int.toDuration('year', { conversionAccuracy: 'longterm' }): Duration);
// $FlowExpectedError[incompatible-call]
(int.toDuration('year', { conversionAccuracy: 'blah' }): Duration);
// $FlowExpectedError[prop-missing]
(int.toDuration('year', { foo: 'bar' }): Duration);

(int.toISO(): string);
(int.toISO({
  suppressMilliseconds: true,
  suppressSeconds: true,
  includeOffset: true,
}): string);
// $FlowExpectedError[prop-missing]
(int.toISO({
  suressMilliseconds: true,
  suppressSeconds: true,
  includeOffset: true,
}): string);

(int.toString(): string);

(int.union(int): Interval);


text:
package org.aikodi.chameleon.eclipse.editors.preferences;

import org.aikodi.chameleon.core.language.Language;
import org.aikodi.chameleon.eclipse.ChameleonEditorPlugin;
import org.aikodi.chameleon.eclipse.LanguageMgt;
import org.aikodi.chameleon.eclipse.editors.ChameleonEditor;
import org.aikodi.chameleon.eclipse.presentation.PresentationStyle;
import org.aikodi.chameleon.eclipse.presentation.Selector;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.*;
import org.eclipse.ui.internal.WorkbenchMessages;

import java.util.*;

/**
 * @author Manuel Van Wesemael
 * @author Joeri Hendrickx
 *
 * A preference page for chameleonDocuments.
 * It handles the colors used in the syntax coloring for the various languages.
 * The colors can be changed at will.
 */
public class ColoringPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

	//per language, contains a color selector and the field editor that represents it
	private HashMap<String, HashMap<Selector, Vector<FieldEditor>>> options;

	public ColoringPreferencePage() {
		super(FieldEditorPreferencePage.GRID);
		// Set the preference store for the preference page.
		IPreferenceStore store = ChameleonEditorPlugin.getDefault().getPreferenceStore();
		setPreferenceStore(store);
	}

	/*
	 * stores the chosen colors and recolors all the documents
	 */
	private void performChoices(){

		for (String language : options.keySet()) {

			HashMap<Selector, Vector<FieldEditor>> fieldsBySelector = options.get(language);

			Set<Selector> selectors = fieldsBySelector.keySet();

			for (Iterator<Selector> iterator = selectors.iterator(); iterator.hasNext();) {
				Selector selector = iterator.next();
				OptionalColorFieldEditor fg = (OptionalColorFieldEditor) fieldsBySelector.get(selector).get(0);
				OptionalColorFieldEditor bg = (OptionalColorFieldEditor) fieldsBySelector.get(selector).get(1);
				BooleanFieldEditor bold = (BooleanFieldEditor) fieldsBySelector.get(selector).get(2);
				BooleanFieldEditor italic = (BooleanFieldEditor) fieldsBySelector.get(selector).get(3);
				BooleanFieldEditor underline = (BooleanFieldEditor) fieldsBySelector.get(selector).get(4);
				BooleanFieldEditor foldable = (BooleanFieldEditor) fieldsBySelector.get(selector).get(5);
				BooleanFieldEditor folded = (BooleanFieldEditor) fieldsBySelector.get(selector).get(6);
				PresentationStyle style = new PresentationStyle(fg.getOptionalColor(), bg.getOptionalColor(), bold.getBooleanValue(), italic.getBooleanValue(), underline.getBooleanValue(), foldable.getBooleanValue(), folded.getBooleanValue());
				// FIXME: this should update the presentation models of all project natures.
				LanguageMgt.getInstance().getPresentationModel(language).updateRule(selector, style);
			}

		}

		IPreferenceStore store = ChameleonEditorPlugin.getDefault().getPreferenceStore();
		store.setValue("Chameleon_color_prefs_inited", true);

		recolorAll();

	}

	//recolors all open editors.
	private void recolorAll() {
		SafeRunner.run(new SafeRunnable(WorkbenchMessages.ErrorClosing) {
			private IWorkbench workbench = _workbench;
			@Override
         public void run() {
				// Collect dirtyParts
				//ArrayList dirtyParts = new ArrayList();
				//ArrayList dirtyEditorsInput = new ArrayList();
				IWorkbenchWindow windows[] = workbench.getWorkbenchWindows();
				for (int i = 0; i < windows.length; i++) {
					IWorkbenchPage pages[] = windows[i].getPages();
					for (int j = 0; j < pages.length; j++) {
						IWorkbenchPage page = pages[j];

						IEditorReference[] parts = page.getEditorReferences();

                        for (int k = 0; k < parts.length; k++) {
                        	IEditorPart editor = parts[k].getEditor(true);
                        	try{
                        		ChameleonEditor chamEditor = (ChameleonEditor) editor;
                        		chamEditor.updateFoldingStructure();
                        		chamEditor.getDocument().doPresentation(chamEditor.getChameleonConfiguration().getChameleonPresentationReconciler().getTextViewer());

                        	}catch(ClassCastException cce){
                        		// the part is not a chameleonEditor. No changes are needed
                        	}

                        }
					}
				}
			}

		});
	}

	@Override
	protected void createFieldEditors() {

		options = new HashMap<String, HashMap<Selector, Vector<FieldEditor>>>();

		//a vector containing:
		// per language a vector of elements
		// the first element of each vector is the language name
		HashMap<String, HashMap<Selector, PresentationStyle>> possibilities =  readConfigurables();

		TabFolder languageTabs = new TabFolder(getFieldEditorParent(),SWT.NONE);
		languageTabs.setLayoutData(new GridData(SWT.FILL, SWT.FILL,true, true));
		languageTabs.setLayout(new GridLayout(1, true));
		Set<String> talen = possibilities.keySet();

		for (Iterator<String> iter = talen.iterator(); iter.hasNext();) {

			String taalS = iter.next();

			TabItem currentPage = new TabItem(languageTabs, SWT.NONE);
			currentPage.setText(taalS);
			ScrolledComposite scroller = new ScrolledComposite(languageTabs, SWT.V_SCROLL);
			currentPage.setControl(scroller);
			scroller.setLayoutData(new GridData(SWT.FILL, SWT.FILL,true, true));
			scroller.setLayout(new GridLayout(1, true));
			Composite container = new Composite(scroller, SWT.BORDER);
			scroller.setContent(container);
			GridLayout grid = new GridLayout(2, true);
			container.setLayout(grid);
			container.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));

			HashMap<Selector, Vector<FieldEditor>> current = new HashMap<Selector, Vector<FieldEditor>>();

			HashMap<Selector, PresentationStyle> taal = possibilities.get(taalS);
			Set<Selector> selectors = taal.keySet();
			for (Iterator<Selector> iterator = selectors.iterator(); iterator.hasNext();) {

				Group selectorGroup = new Group(container,SWT.NONE);
				GridLayout grid2 = new GridLayout();
				selectorGroup.setLayout(grid2);
				Composite selectorGroupC = new Composite(selectorGroup, SWT.NONE);
				selectorGroupC.setLayout(new GridLayout(2, true));
				selectorGroup.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT, true, false));
				selectorGroupC.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT, true, false));

				Composite c = selectorGroupC;

				Vector<FieldEditor> current2 = new Vector<FieldEditor>();
				Selector selector = iterator.next();

				// PresentationStyle presrule = taal.get(selector);
				String fieldNaam = "stylerule_"+taalS+"_"+selector.getElementType()+"_"+selector.getPositionType()+"_";
//				PresentationStyle presrule = taal.get(selector);
//				String fieldNaam = "stylerule_"+taalS+"_"+selector.getElementType()+"_"+selector.getDecoratorType()+"_";

				//Label elementLb = new Label(c, SWT.NONE);
				selectorGroup.setText(selector.getDescription());
				//addField(spacer2);
				PresentationStyle style = taal.get(selector);
				OptionalColorFieldEditor foregroundEdit = new OptionalColorFieldEditor(fieldNaam+"foreground", "Foreground", c);
				foregroundEdit.setOptionalColor(style.getForeground());
				//foregroundEdit.fillIntoGrid(c,2);

				//addField(spacer3);
				OptionalColorFieldEditor backgroundEdit = new OptionalColorFieldEditor(fieldNaam+"background","Background", c);
				backgroundEdit.setOptionalColor(style.getBackground());
				//addField(spacer1);
				BooleanFieldEditor bold = new BooleanFieldEditor(
						fieldNaam+"bold",
						"Bold",
				 		new Composite(c,SWT.NONE));
				BooleanFieldEditor italic= new BooleanFieldEditor(
						fieldNaam+"italic",
						"Italic",
						new Composite(c,SWT.NONE));
				BooleanFieldEditor underline = new BooleanFieldEditor(
						fieldNaam+"underline",
						"Underline",
						new Composite(c,SWT.NONE));
				BooleanFieldEditor foldable = new BooleanFieldEditor(
						fieldNaam+"foldable",
						"Foldable",
						new Composite(c,SWT.NONE));
				BooleanFieldEditor folded = new BooleanFieldEditor(
						fieldNaam+"folded",
						"Folded",
						new Composite(c,SWT.NONE));
				addField(foregroundEdit);
				addField(backgroundEdit);
				addField(bold);
				addField(italic);
				addField(underline);
				addField(foldable);
				addField(folded);

				current2.add(foregroundEdit);
				current2.add(backgroundEdit);
				current2.add(bold);
				current2.add(italic);
				current2.add(underline);
				current2.add(foldable);
				current2.add(folded);
				current.put(selector, current2);

				c.pack();
				selectorGroup.pack();

			}
			options.put(taalS, current);
			container.pack();
			scroller.pack();
		}

	}

	@Override
   public void init(IWorkbench workbench) {
		_workbench = workbench;
	}

	private IWorkbench _workbench;

	//reads the configuration for a specific language and gets it from the xml file
	private HashMap<String, HashMap<Selector, PresentationStyle>> readConfigurables() {
	    //lees eerst alle talen uit
		List<String> languages = new ArrayList<String>();
		for(Language lang: LanguageMgt.getInstance().workspace().languageRepository().languages()) {
			languages.add(lang.name());
		}
		//haal van alle talen alle elementen op
	    HashMap<String, HashMap<Selector, PresentationStyle>> result = obtainLanguageColorElements(languages);
	    return result;
	}

	private HashMap<String, HashMap<Selector, PresentationStyle>> obtainLanguageColorElements(List<String> talen) {
		HashMap<String, HashMap<Selector, PresentationStyle>> result = new HashMap<String, HashMap<Selector, PresentationStyle>>();
		for(String taal: talen){
			HashMap<Selector,PresentationStyle> taalResult = LanguageMgt.getInstance().getPresentationModel(taal).getRules();
			result.put(taal, taalResult);
		}
		return result;
	}

	@Override
   public boolean performOk(){
		boolean prev= super.performOk();
		performChoices();

		return prev;
	}

	@Override
   public void performApply(){
		super.performApply();

		performChoices();

		//ChameleonOutlineTree.setAllowedElements(lang, allowed);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.danielflower.mavenplugins.testprojects.dependecymanagement</groupId>
    <artifactId>parent-module</artifactId>
    <version>1.2.3-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.github.danielflower.mavenplugins.testprojects.dependecymanagement</groupId>
                <artifactId>root-bom</artifactId>
                <version>1.0-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.danielflower.mavenplugins</groupId>
                <artifactId>multi-module-maven-release-plugin</artifactId>
                <version>${current.plugin.version}</version>
            </plugin>
        </plugins>
    </build>
</project>


text:
namespace Trinity
{
	namespace Debugger
	{
		void EnableUnhandledExceptionFilter();
		void TryStartDebugger(bool suspendOtherThreads);

		List<THREADENTRY32> GetThreads(DWORD pid);
		BOOL SuspendOtherThreads();

		void printError(char* msg);

		typedef bool(*DebuggerCommand)(Array<string>&);

		struct DebuggerCommandTuple
		{
			String m_string;
			DebuggerCommand m_cmd;
		};
	}
}
#endif


text:
package com.mpay24.payment.data;

public class Token {
	private String returnCode;
	private String redirectLocation;
	private String token;
	private String apiKey;
	public String getReturnCode() {
		return returnCode;
	}
	public void setReturnCode(String returnCode) {
		this.returnCode = returnCode;
	}
	public String getRedirectLocation() {
		return redirectLocation;
	}
	public void setRedirectLocation(String redirectLocation) {
		this.redirectLocation = redirectLocation;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public String getApiKey() {
		return apiKey;
	}
	public void setApiKey(String apiKey) {
		this.apiKey = apiKey;
	}
}


text:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Foreign Key definition" do

  before(:all) do
    load_core_schema
  end

  let(:definition) { SchemaPlus::ActiveRecord::ConnectionAdapters::ForeignKeyDefinition.new("posts_user_fkey", :posts, :user, :users, :id) }

  it "it is dumped to sql with quoted values" do
    definition.to_sql.should == %Q{CONSTRAINT posts_user_fkey FOREIGN KEY (#{quote_column_name('user')}) REFERENCES #{quote_table_name('users')} (#{quote_column_name('id')})}
  end

  def quote_table_name(table)
    ActiveRecord::Base.connection.quote_table_name(table)
  end

  def quote_column_name(column)
    ActiveRecord::Base.connection.quote_column_name(column)
  end

end


text:
package org.concord.energy3d.undo;

import java.util.List;

import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;

import org.concord.energy3d.model.Foundation;
import org.concord.energy3d.model.HousePart;
import org.concord.energy3d.model.SolarReflector;
import org.concord.energy3d.scene.Scene;

public class ChangeSolarReceiverEfficiencyForAllReflectorsCommand extends MyAbstractUndoableEdit {

	private static final long serialVersionUID = 1L;
	private final double[] oldValues;
	private double[] newValues;
	private final List<SolarReflector> reflectors;

	public ChangeSolarReceiverEfficiencyForAllReflectorsCommand(final Class<?> c) {
		reflectors = Scene.getInstance().getAllSolarReflectors(c);
		final int n = reflectors.size();
		oldValues = new double[n];
		for (int i = 0; i < n; i++) {
			final SolarReflector r = reflectors.get(i);
			if (r instanceof HousePart) {
				oldValues[i] = (((HousePart) r).getTopContainer()).getSolarReceiverEfficiency();
			}
		}
	}

	@Override
	public void undo() throws CannotUndoException {
		super.undo();
		final int n = reflectors.size();
		newValues = new double[n];
		for (int i = 0; i < n; i++) {
			final SolarReflector r = reflectors.get(i);
			if (r instanceof HousePart) {
				final Foundation f = ((HousePart) r).getTopContainer();
				newValues[i] = f.getSolarReceiverEfficiency();
				f.setSolarReceiverEfficiency(oldValues[i]);
			}
		}
	}

	@Override
	public void redo() throws CannotRedoException {
		super.redo();
		final int n = reflectors.size();
		for (int i = 0; i < n; i++) {
			final SolarReflector r = reflectors.get(i);
			if (r instanceof HousePart) {
				final Foundation f = ((HousePart) r).getTopContainer();
				f.setSolarReceiverEfficiency(newValues[i]);
			}
		}
	}

	@Override
	public String getPresentationName() {
		return "Solar Receiver Efficiency Change for All Reflectors";
	}

}


text:
using System;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
//using Microsoft.Owin.Security.Google;
using Owin;
using Sistrategia.Drive.Business;
using System.Configuration;
using Microsoft.Owin.Security.Google;

namespace Sistrategia.Drive.WebSite
{
    public partial class Startup
    {
        // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
        public void ConfigureAuth(IAppBuilder app) {
            //// Configure the db context, user manager and signin manager to use a single instance per request
            app.CreatePerOwinContext(ApplicationDbContext.Create);
            app.CreatePerOwinContext<SecurityUserManager>(SecurityUserManager.Create);
            app.CreatePerOwinContext<SecuritySignInManager>(SecuritySignInManager.Create);

            // Enable the application to use a cookie to store information for the signed in user
            // and to use a cookie to temporarily store information about a user logging in with a third party login provider
            // Configure the sign in cookie
            app.UseCookieAuthentication(new CookieAuthenticationOptions {

                // http://stackoverflow.com/questions/28947342/asp-net-identity-securitystampvalidator-onvalidateidentity-regenerateidentity-pa

                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login"),
                Provider = new CookieAuthenticationProvider {
                    OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<SecurityUserManager, SecurityUser, int>(
                        validateInterval: TimeSpan.FromMinutes(30), //  5
                        //validateInterval: TimeSpan.FromSeconds(10),
                        //regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)
                        regenerateIdentityCallback: (manager, user) => user.GenerateUserIdentityAsync(manager),
                        getUserIdCallback: (id) => id.GetUserId<int>()
                    )
                }
            });
            app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

            // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
            app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); // .FromMinutes(1));

            // Enables the application to remember the second login verification factor such as phone or email.
            // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
            // This is similar to the RememberMe option when you log in.
            app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);

            // Uncomment the following lines to enable logging in with third party login providers
            //app.UseMicrosoftAccountAuthentication(
            //    clientId: "",
            //    clientSecret: "");

            //app.UseTwitterAuthentication(
            //   consumerKey: "",
            //   consumerSecret: "");

            //app.UseFacebookAuthentication(
            //   appId: "",
            //   appSecret: "");

            app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() {
                ClientId = ConfigurationManager.AppSettings["GoogleClientId"],
                ClientSecret = ConfigurationManager.AppSettings["GoogleClientSecret"]
            });
        }
    }
}


text:
/************************************************************************
*
* Flood Project © (2008-201x)
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/

#pragma once

#include "Engine/Scene/Geometry.h"

NAMESPACE_ENGINE_BEGIN

//-----------------------------------//

/**
 * Generates a procedural quad mesh.
 */

API_SCENE REFLECT_DECLARE_CLASS(Quad)

class API_SCENE Quad : public Geometry
{
	REFLECT_DECLARE_OBJECT(Quad)

public:

	Quad( float width = 1.0f, float height = 1.0f );

private:

	GeometryBufferPtr createQuad( float width, float height );
};

TYPEDEF_INTRUSIVE_POINTER_FROM_TYPE( Quad );

//-----------------------------------//

NAMESPACE_ENGINE_END


text:
package nl.stokpop.lograter.clickpath;

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

public class ClickPathCollectorTest {

    @Test
    public void testInMemoryClickPathCollector() {

        final long startTimestamp = System.currentTimeMillis();
        ClickPath clickPath1 = new ClickPath(startTimestamp, "step1", "sessionId1");
        clickPath1.addToPath("step2", startTimestamp + 100);
        clickPath1.addToPath("step3", startTimestamp + 200);
        clickPath1.addToPath("step4", startTimestamp + 300);
        clickPath1.addToPath("step5", startTimestamp + 400);

        final long startTimestamp1_1 = startTimestamp + 10000;
        ClickPath clickPath1_1 = new ClickPath(startTimestamp1_1, "step1", "sessionId1_1");
        clickPath1_1.addToPath("step2", startTimestamp1_1 + 200);
        clickPath1_1.addToPath("step3", startTimestamp1_1 + 400);
        clickPath1_1.addToPath("step4", startTimestamp1_1 + 600);
        clickPath1_1.addToPath("step5", startTimestamp1_1 + 800);

        final long startTimestamp2 = startTimestamp + 1000;
        ClickPath clickPath2 = new ClickPath(startTimestamp2, "step1", "sessionId2");
        clickPath2.addToPath("step5", startTimestamp2 + 100);
        clickPath2.addToPath("step4", startTimestamp2 + 200);

        final long startTimestamp3 = startTimestamp + 3000;
        ClickPath clickPath3 = new ClickPath(startTimestamp3, "step3", "sessionId3");
        clickPath3.addToPath("step5", startTimestamp3 + 100);
        clickPath3.addToPath("step2", startTimestamp3 + 200);

        InMemoryClickpathCollector collector = new InMemoryClickpathCollector();
        collector.addClickPath(clickPath1);
        collector.addClickPath(clickPath2);
        collector.addClickPath(clickPath3);
        collector.addClickPath(clickPath1_1);

        Assert.assertEquals(400, clickPath1.getSessionDurationInMillis());
        Assert.assertEquals(200, clickPath2.getSessionDurationInMillis());
        Assert.assertEquals(200, clickPath3.getSessionDurationInMillis());

        Assert.assertArrayEquals(new Long[] {100L, 100L, 100L, 100L}, clickPath1.getDurationPerStepInMillis());

        Assert.assertEquals(600, collector.getAvgSessionDurationForClickPath(clickPath1.getPathAsString()));

        Assert.assertEquals(4, collector.getAvgDurationBetweenSteps(clickPath1.getPathAsString()).length);
        Assert.assertArrayEquals(new Long[]{150L, 150L, 150L, 150L}, collector.getAvgDurationBetweenSteps(clickPath1.getPathAsString()));

        Assert.assertTrue(collector.getPathAsStringWithAvgDuration(clickPath1.getPathAsString()).endsWith(ClickPath.CLICKPATH_END));
    }
}


text:
package timelogger.control;
import org.orm.PersistentTransaction;

import timelogger.domain.Utente;
import timelogger.domain.UtenteFactory;
import timelogger.presentation.UIFacade;
import timelogger.presentation.ui.shared.alertDialog;

public class TimeLogger {
	@SuppressWarnings("unused")
	private alertDialog alert;
	public TimeLogger(int LoggedUserID)
	{
		PersistentTransaction t=null;
		Utente user=null;
		user=UtenteFactory.loadUtenteByORMID(LoggedUserID);
		if(user!=null) {
			user.createCommands();
			ControlFacade.getInstance().addData("user",user);

			UIFacade.getInstance().startUseCase();
		}
		else alert = new alertDialog("DataBase","Errore di connessione al dataBase");
	}
}


text:
'use strict';

import express from 'express';
import http from 'http';
import CONFIG from './config/environment';

var app = express();
var server = http.createServer(app);

require('./config/express')(app);
require('./routes')(app);

// Start server function
function startServer() {
    app.nodeServer = server.listen(CONFIG.PORT, CONFIG.IP, () => {
        console.log('Express server listening on %d, in %s mode', CONFIG.PORT, app.get('env'));
    });
}

startServer();
require('./sqldb/migrate').up()
    .then(() => {
        console.log('Sequelize migrations successfully executed.');
    })
    .catch(err => {
        console.log('Server failed to start due to error: %s', err);
    });

// Expose app
module.exports = app;


text: export default function useEventCallback<T extends (...args: any[]) => any>(func: T): T;


text:
(function(jiglib) {

	var JMatrix3D = jiglib.JMatrix3D;
	var Vector3D = jiglib.Vector3D;
	var JMath3D = jiglib.JMath3D;
	var JNumber3D = jiglib.JNumber3D;

	var Matrix3D = function()
	{
	}

	Matrix3D.prototype.get_determinant = function()
	{

	}

	Matrix3D.prototype.get_position = function()
	{

	}

	Matrix3D.prototype.get_rawData = function()
	{

	}

	Matrix3D.prototype.set_rawData = function(rawData)
	{

	}

	Matrix3D.prototype.clone = function()
	{

	}

	Matrix3D.prototype.deltaTransformVector = function()
	{

	}

	Matrix3D.prototype.interpolate = function()
	{

	}

	Matrix3D.prototype.transformVector = function()
	{

	}

	jiglib.Matrix3D = Matrix3D;

})(jiglib);


text:
/* TypeChecking:
 *
 * Test for Protected Access
 *
 * B.B extends A.A
 * C.C extends B.B
 * D.D extends C.C
 */

package C;

public class C extends B.B {
    public C() {}

    /* static field access through superclass
     * => OK, since the current type C is a subclass of the declaring type A.A (6.6.2.1)
     */
    public void staticFieldAccessFromSuperClass(int x) {
	A.A.staticField = x;
    }
}


text:
package com.flowy.fomoapi.services

import java.util.UUID

import com.flowy.common.utils.Utils
import com.softwaremill.bootzooka.email.application.{EmailService, EmailTemplatingEngine}
import com.softwaremill.bootzooka.user._
import com.flowy.fomoapi.database.dao.UserDao
import com.flowy.common.models.{UserData, User}

import scala.concurrent.{ExecutionContext, Future}

class UserService(
    userDao: UserDao,
    emailService: EmailService,
    emailTemplatingEngine: EmailTemplatingEngine
)(implicit ec: ExecutionContext) {

  def findById(userId: UserId): Future[Option[UserData]] =
    userDao.findBasicDataById(userId)

  def registerNewUser(first: String, last: String, email: String, password: String): Future[UserRegisterResult] = {
    def checkUserExistence(): Future[Either[String, Unit]] = {
      val existingEmailFuture = userDao.findByEmail(email)

      existingEmailFuture.map{ existingEmailOpt =>
        existingEmailOpt match {
          case Some(u) => Left("E-mail already in use!")
          case None => Right(():Unit)
        }
      }
    }

    def registerValidData() = checkUserExistence().flatMap {
      case Left(msg) => Future.successful(UserRegisterResult.UserExists(msg))
      case Right(_) =>
        val salt          = Utils.randomString(128)
        val userAddResult = userDao.add(
          User.withRandomUUID(email.toLowerCase, first, last, password, salt))
        userAddResult.foreach { _ =>
          val confirmationEmail = emailTemplatingEngine.registrationConfirmation(first)
          emailService.scheduleEmail(email, confirmationEmail)
        }
        userAddResult.map(_ => UserRegisterResult.Success)
    }

    UserRegisterValidator
      .validate(email, password)
      .fold(
        msg => Future.successful(UserRegisterResult.InvalidData(msg)),
        _ => registerValidData()
      )
  }

  def authenticate(email: String, nonEncryptedPassword: String): Future[Option[UserData]] =
    userDao
      .findByEmail(email)
      .map(userOpt => userOpt.filter(u => User.passwordsMatch(nonEncryptedPassword, u)).map(UserData.fromUser))

  def changeEmail(userId: UUID, newEmail: String): Future[Either[String, Unit]] =
    userDao.findByEmail(newEmail).flatMap {
      case Some(_) => Future.successful(Left("E-mail used by another user"))
      case None    => userDao.changeEmail(userId, newEmail).map(Right(_))
    }

  def changePassword(userId: UUID, currentPassword: String, newPassword: String): Future[Either[String, Unit]] =
    userDao.findById(userId).flatMap {
      case Some(u) =>
        if (User.passwordsMatch(currentPassword, u)) {
          userDao.changePassword(u.id, User.encryptPassword(newPassword, u.salt)).map(Right(_))
        } else Future.successful(Left("Current password is invalid"))

      case None => Future.successful(Left("User not found hence cannot change password"))
    }
}

sealed trait UserRegisterResult

object UserRegisterResult {

  case class InvalidData(msg: String) extends UserRegisterResult

  case class UserExists(msg: String) extends UserRegisterResult

  case object Success extends UserRegisterResult

}

object UserRegisterValidator {
  private val ValidationOk = Right(())
  val MinLoginLength       = 3

  def validate(email: String, password: String): Either[String, Unit] =
    for {
      _ <- validEmail(email.trim).right
      _ <- validPassword(password.trim).right
    } yield ()

  private def validLogin(login: String) =
    if (login.length >= MinLoginLength) ValidationOk else Left("Login is too short!")

  private val emailRegex =
    """^[a-zA-Z0-9\.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$""".r

  private def validEmail(email: String) =
    if (emailRegex.findFirstMatchIn(email).isDefined) ValidationOk else Left("Invalid e-mail!")

  private def validPassword(password: String) =
    if (password.nonEmpty) ValidationOk else Left("Password cannot be empty!")
}


text:
require 'spec_helper'

include Serverspec::Helper::RedHat

describe mail_alias('daemon') do
  it { should be_aliased_to "root" }
  its(:command) { should eq "getent aliases daemon | grep -- \\[\\[:space:\\]\\]root$" }
end

describe mail_alias('invalid-recipient') do
  it { should_not be_aliased_to "foo" }
end


text:
<?php

include_once __DIR__.'/../vendor/autoload.php';

//TODO test double:writeSheetHeader
//TODO test invalid UTF8
//TODO test outoforder writeSheetRow('Sheet1',());

class _XLSXWriter_ extends XLSXWriter
{
    public function writeCell(XLSXWriter_BuffererWriter &$file, $row_number, $column_number, $value, $cell_format) {
		return call_user_func_array('parent::writeCell', func_get_args());
	}
}
//Just a simple test, by no means comprehensive

class XLSXWriterTest extends PHPUnit_Framework_TestCase
{
    /**
     * @covers XLSXWriter::writeCell
     */
	public function testWriteCell()
	{
		$filename = tempnam("/tmp", "xlsx_writer");
		$file_writer = new XLSXWriter_BuffererWriter($filename);

        $xlsx_writer = new _XLSXWriter_();
        $xlsx_writer->writeCell($file_writer, 0, 0, '0123', 'string');
        $file_writer->close();
        $cell_xml = file_get_contents($filename);
        $this->assertNotEquals('<c r="A1" s="0" t="n"><v>123</v></c>', $cell_xml);
        $this->assertEquals('<c r="A1" s="0" t="s"><v>0</v></c>', $cell_xml);//0123 should be the 0th index of the shared string array
        @unlink($filename);
    }

    /**
     * @covers XLSXWriter::writeToFile
     */
	public function testWriteToFile()
	{
		$filename = tempnam("/tmp", "xlsx_writer");

		$header = array('0'=>'string','1'=>'string','2'=>'string','3'=>'string');
		$sheet = array(
				array('55','66','77','88'),
				array('10','11','12','13'),
		);

		$xlsx_writer = new XLSXWriter();
		$xlsx_writer->writeSheet($sheet,'mysheet',$header);
		$xlsx_writer->writeToFile($filename);

		$zip = new ZipArchive();
		$r = $zip->open($filename);
		$this->assertTrue($r);

		$r = $zip->numFiles>0 ? true : false;
		$this->assertTrue($r);

		$out_sheet = array();
		for($z=0; $z<$zip->numFiles; $z++)
		{
			$inside_zip_filename = $zip->getNameIndex($z);
			if (preg_match("/sheet(\d+).xml/", basename($inside_zip_filename)))
			{
				$out_sheet = $this->stripCellsFromSheetXML($zip->getFromName($inside_zip_filename));
				array_shift($out_sheet);
				$out_sheet = array_values($out_sheet);
			}
		}
		$zip->close();
		@unlink($filename);

		$r1 = self::array_diff_assoc_recursive($out_sheet, $sheet);
		$r2 = self::array_diff_assoc_recursive($sheet, $out_sheet);
		$this->assertEmpty($r1);
		$this->assertEmpty($r2);
	}

	private function stripCellsFromSheetXML($sheet_xml)
	{
		$output=array();
		$xml = new SimpleXMLElement($sheet_xml);
		$i=0;
		foreach($xml->sheetData->row as $row)
		{
			$j=0;
			foreach($row->c as $c)
			{
				$output[$i][$j] = (string)$c->v;
				$j++;
			}
			$i++;
		}
		return $output;
	}

    public static function array_diff_assoc_recursive($array1, $array2)
    {
        foreach($array1 as $key => $value)
        {
            if(is_array($value))
            {
                if(!isset($array2[$key]) || !is_array($array2[$key]))
                {
                    $difference[$key] = $value;
                }
                else
                {
                    $new_diff = self::array_diff_assoc_recursive($value, $array2[$key]);
                    if(!empty($new_diff))
                    {
                        $difference[$key] = $new_diff;
                    }
                }
            }
            else if(!isset($array2[$key]) || $array2[$key] != $value)
            {
                $difference[$key] = $value;
            }
        }
        return !isset($difference) ? array() : $difference;
    }
}