text:
package com.universeCraft.tileEntity;

import java.util.Random;

import com.universeCraft.blocks.ModBlocks;

import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class TileEntityPartAccelBlock extends TileEntity {

	private int i = 0;
	private int j = 0;
	private int k = 0;
	private int l = 0;
	private int i2 = 0;
	private int blocksCollated = 0;
	public int sizeOfExplosion = 0;
	int r = 0;
	int x = -r;
	int y = -r;
	int z = -r;

	public void readFromNBT(NBTTagCompound tagCompound) {
		super.readFromNBT(tagCompound);
		this.i = tagCompound.getInteger("Increment");
		this.sizeOfExplosion = tagCompound.getInteger("Explosion");
		this.blocksCollated = tagCompound.getInteger("Collated");
	}

	public void writeToNBT(NBTTagCompound tagCompound) {
		super.writeToNBT(tagCompound);
		tagCompound.setInteger("Increment", this.i);
		tagCompound.setInteger("Explosion", this.sizeOfExplosion);
		tagCompound.setInteger("Collated", this.blocksCollated);
	}

	public int parAccelCheck(World world, int x, int y, int z, int switchValue, Random rand){
		for(int a = 18; a > -19; a--){
			for(int b = 1; b > -3; b--){
				for(int c = 19; c > -19; c--){
					if(switchValue == 0){
						if(world.getBlock(x+a, y+b, z+c) == ModBlocks.metadataBlocks && world.getBlockMetadata(x+a, y+b, z+c) == 8){
							blocksCollated++;
						}
					}
					if(switchValue == 1){
						if(world.getBlock(x+a, y+b, z+c) == ModBlocks.partAccelBlock){
							if(rand.nextInt(4) == 0){
								world.setBlockToAir(x+a, y+b, z+c);
							}
							else{
								world.setBlock(x+a, y+b, z+c, ModBlocks.metadataBlocks, 4, 2);
							}
						}
						else if(world.getBlock(x+a, y+b, z+c) == ModBlocks.metadataBlocks){
							world.setBlockMetadataWithNotify(x+a, y+b, z+c, 7, 2);
						}
					}
				}
			}
		}
		markDirty();
		worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
		return blocksCollated;
	}

	public void updateEntity(){
		Random rand = new Random();
		if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1){
			this.sizeOfExplosion = this.parAccelCheck(worldObj, xCoord, yCoord, zCoord, 0, rand);
			if(this.sizeOfExplosion > 0){
				if(i<600){
					i++;
					if(i==60){
						EntityLightningBolt lightning0 = new EntityLightningBolt(worldObj, xCoord+10, yCoord, zCoord);
						worldObj.addWeatherEffect(lightning0);
						worldObj.addWeatherEffect(lightning0);
						worldObj.addWeatherEffect(lightning0);
						this.createSphere(20, 20, 0, 0);
					}
					else if(i==120){
						EntityLightningBolt lightning1 = new EntityLightningBolt(worldObj, xCoord-20, yCoord, zCoord);
						worldObj.addWeatherEffect(lightning1);
						worldObj.addWeatherEffect(lightning1);
						worldObj.addWeatherEffect(lightning1);
						this.createSphere(20, -20, 0, 0);
					}
					else if(i==180){
						EntityLightningBolt lightning2 = new EntityLightningBolt(worldObj, xCoord, yCoord, zCoord+20);
						worldObj.addWeatherEffect(lightning2);
						worldObj.addWeatherEffect(lightning2);
						worldObj.addWeatherEffect(lightning2);
						this.createSphere(20, 0, 0, 20);
					}
					else if(i==240){
						EntityLightningBolt lightning3 = new EntityLightningBolt(worldObj, xCoord+20, yCoord, zCoord-20);
						worldObj.addWeatherEffect(lightning3);
						worldObj.addWeatherEffect(lightning3);
						worldObj.addWeatherEffect(lightning3);
						this.createSphere(20, 0, 0, -20);
					}
					else if(i==300){
						EntityLightningBolt lightning4 = new EntityLightningBolt(worldObj, xCoord-20, yCoord, zCoord-20);
						worldObj.addWeatherEffect(lightning4);
						worldObj.addWeatherEffect(lightning4);
						worldObj.addWeatherEffect(lightning4);
						this.createSphere(20, -20, 0, -20);
					}
					else if(i==360){
						EntityLightningBolt lightning5 = new EntityLightningBolt(worldObj, xCoord+20, yCoord, zCoord-20);
						worldObj.addWeatherEffect(lightning5);
						worldObj.addWeatherEffect(lightning5);
						worldObj.addWeatherEffect(lightning5);
						this.createSphere(20, 20, 0, -20);
					}
					else if(i==420){
						EntityLightningBolt lightning6 = new EntityLightningBolt(worldObj, xCoord+20, yCoord, zCoord+20);
						worldObj.addWeatherEffect(lightning6);
						worldObj.addWeatherEffect(lightning6);
						worldObj.addWeatherEffect(lightning6);
						this.createSphere(20, 20, 0, 20);
					}
					else if(i==480){
						EntityLightningBolt lightning7 = new EntityLightningBolt(worldObj, xCoord-20, yCoord, zCoord+20);
						worldObj.addWeatherEffect(lightning7);
						worldObj.addWeatherEffect(lightning7);
						worldObj.addWeatherEffect(lightning7);
						this.createSphere(20, -20, 0, 20);
					}
				}
				else if(i==600 || i>600){
					for(int a = 0; a<20; a++){
						EntityLightningBolt lightning8 = new EntityLightningBolt(worldObj, xCoord+rand.nextInt(20)-rand.nextInt(30), yCoord, zCoord+rand.nextInt(20)-rand.nextInt(30));
						worldObj.addWeatherEffect(lightning8);
					}
					this.createSphere(30, 0, 0, 0);
				}
			}
			else{
				if(i2<200){
					i2++;
				}
				else{
					EntityLightningBolt lightning9 = new EntityLightningBolt(worldObj, xCoord+rand.nextInt(20)-rand.nextInt(30), yCoord, zCoord+rand.nextInt(20)-rand.nextInt(30));
					worldObj.addWeatherEffect(lightning9);
					this.createSphere(this.sizeOfExplosion, 0, 0, 0);
					this.parAccelCheck(worldObj, xCoord, yCoord, zCoord, 1, rand);
				}
			}
		}
		super.updateEntity();
	}

	public void createSphere(int radius, int xInc, int yInc, int zInc){
		for(this.r = 0; this.r < radius; this.r++){
			for(this.x = -this.r; this.x < this.r; this.x++){
				for(this.y = -this.r; this.y < this.r; this.y++){
					for(this.z = -this.r; this.z < this.r; this.z++){
						double dist = MathHelper.sqrt_double((x*x + y*y + z*z)); //Calculates the distance
						if(dist > this.r){
							continue;
						}
						worldObj.setBlockToAir(xCoord+x+xInc, yCoord+y+yInc, zCoord+z+zInc);
					}
				}
			}
		}
	}
}


text:
import { ApolloClient, createNetworkInterface, ApolloProvider } from 'react-apollo';
import { browserHistory } from 'react-router';
import Raven from 'raven-js';

import { GRAPHQL_API_URL } from './constants';
import { getJwtToken, haveJwtToken, deleteJwtToken } from './utils/auth';
import { loginPage } from './local-urls';
import { setFatalError } from './containers/App/actions';

/* eslint-disable no-param-reassign */
const authMiddleware = {
  applyMiddleware(req, next) {
    if (!haveJwtToken()) next();

    if (!req.options.headers) {
      req.options.headers = {};
    }

    req.options.headers.authorization = `Bearer ${getJwtToken()}`;
    next();
  },
  applyAfterware({ response }, next) {
    response.clone().json().then((body) => {
      if (body.errors && body.errors.some((e) => e.status === 401)) {
        deleteJwtToken();
        browserHistory.replace(loginPage(browserHistory.getCurrentLocation().pathname));
      } else {
        next();
      }
    });
  },
};
/* eslint-enable no-param-reassign */

const logMiddleware = (store) => ({
  applyAfterware({ response }, next) {
    if (response.status === 500) {
      response.json().then((data) => {
        const message = 'Error while receiving graphql response';
        console.error(message, response, data); // eslint-disable-line no-console
        store.dispatch(setFatalError());
        Raven.captureException(new Error(message), { extra: { response, data } });
      });
    } else {
      next();
    }
  },
});

const createApolloClient = () => {
  networkInterface = createNetworkInterface({
    uri: GRAPHQL_API_URL,
    queryDeduplication: true,
  });
  networkInterface.use([authMiddleware]);
  networkInterface.useAfter([authMiddleware]);

  return new ApolloClient({
    networkInterface,
    reduxRootSelector: (state) => state.get('apollo'),
    connectToDevTools: process.env.NODE_ENV !== 'production',
  });
};

const initializeApolloLogging = (store) => networkInterface.useAfter([logMiddleware(store)]);

let networkInterface = null;
const client = createApolloClient();
export { ApolloProvider, client, initializeApolloLogging };

redpajama_set_name: RedPajamaGithub


text:
Subscribes the authenticated user to the specified list.

You MUST set either the list id or slug. If the list slug is set, then you MUST provide either the owner screen name
or id.

``` php
use Widop\Twitter\Rest\Lists\ListsSubscribersCreateRequest;

$request = new ListsSubscribersCreateRequest();

$request->setOwnerScreenName('noradio');
$ownerScreenName = $request->getOwnerScreenName();

$request->setOwnerId('123456789');
$ownerId = $request->getOwnerId();

$request->setListId('123456789');
$listId = $request->getListId();

$request->setSlug('mama-mia');
$listSlug = $request->getSlug();

$user = $twitter->send($request);
```

You can get more informations [here](https://dev.twitter.com/docs/api/1.1/post/lists/subscribers/create).


text:
// Include gulp
var gulp = require('gulp');

// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var connect = require('gulp-connect');

// Lint Task
gulp.task('lint', function() {
    return gulp.src('js/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});

// Compile Our Sass
gulp.task('sass', function() {
    return gulp.src('scss/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('dist/css'));
});

// Concatenate & Minify JS
gulp.task('scripts', function() {
    return gulp.src('js/*.js')
        .pipe(concat('all.js'))
        .pipe(gulp.dest('dist'))
        .pipe(rename('all.min.js'))
        .pipe(uglify())
        .pipe(gulp.dest('dist/js'));
});

var gulp = require('gulp');
var browserSync = require('browser-sync').create();

gulp.task('browserSync', function() {
  browserSync.init({
    server: {
      baseDir: './'
    },
  })
})

var webserver = require('gulp-webserver');
gulp.task('webserver', function() {
  gulp.src('app')
    .pipe(webserver({
      livereload: true,
      directoryListing: true,
      open: true,
      fallback: './src/app/index.html'
    }));
});

gulp.task('sass', function() {
  return gulp.src('app/scss/**/*.scss') // Gets all files ending with .scss in app/scss
    .pipe(sass())
    .pipe(gulp.dest('app/css'))
    .pipe(browserSync.reload({
      stream: true
    }))
});

// Watch Files For Changes
gulp.task('watch', function() {
    gulp.watch('js/*.js', ['lint', 'scripts']);
    gulp.watch('scss/*.scss', ['sass']);
});

// Make sure change in code is reflected in browser

gulp.task('connect', function() {
  connect.server({
    root: '.',
    livereload: true
  });
});

// var realFavicon = require ('gulp-real-favicon');
// var fs = require('fs');
//
// // File where the favicon markups are stored
// var FAVICON_DATA_FILE = 'faviconData.json';
//
// // Generate the icons. This task takes a few seconds to complete.
// // You should run it at least once to create the icons. Then,
// // you should run it whenever RealFaviconGenerator updates its
// // package (see the check-for-favicon-update task below).
// gulp.task('generate-favicon', function(done) {
// 	realFavicon.generateFavicon({
// 		masterPicture: 'TODO: Path to your master picture',
// 		dest: 'TODO: Path to the directory where to store the icons',
// 		iconsPath: '/',
// 		design: {
// 			ios: {
// 				pictureAspect: 'noChange',
// 				assets: {
// 					ios6AndPriorIcons: false,
// 					ios7AndLaterIcons: false,
// 					precomposedIcons: false,
// 					declareOnlyDefaultIcon: true
// 				}
// 			},
// 			desktopBrowser: {},
// 			windows: {
// 				pictureAspect: 'noChange',
// 				backgroundColor: '#da532c',
// 				onConflict: 'override',
// 				assets: {
// 					windows80Ie10Tile: false,
// 					windows10Ie11EdgeTiles: {
// 						small: false,
// 						medium: true,
// 						big: false,
// 						rectangle: false
// 					}
// 				}
// 			},
// 			androidChrome: {
// 				pictureAspect: 'noChange',
// 				themeColor: '#ffffff',
// 				manifest: {
// 					name: 'Raine/Maker',
// 					display: 'standalone',
// 					orientation: 'notSet',
// 					onConflict: 'override',
// 					declared: true
// 				},
// 				assets: {
// 					legacyIcon: false,
// 					lowResolutionIcons: false
// 				}
// 			},
// 			safariPinnedTab: {
// 				pictureAspect: 'silhouette',
// 				themeColor: '#5bbad5'
// 			}
// 		},
// 		settings: {
// 			scalingAlgorithm: 'Mitchell',
// 			errorOnImageTooSmall: false
// 		},
// 		markupFile: FAVICON_DATA_FILE
// 	}, function() {
// 		done();
// 	});
// });
//
// // Inject the favicon markups in your HTML pages. You should run
// // this task whenever you modify a page. You can keep this task
// // as is or refactor your existing HTML pipeline.
// gulp.task('inject-favicon-markups', function() {
// 	return gulp.src([ 'TODO: List of the HTML files where to inject favicon markups' ])
// 		.pipe(realFavicon.injectFaviconMarkups(JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).favicon.html_code))
// 		.pipe(gulp.dest('TODO: Path to the directory where to store the HTML files'));
// });
//
// // Check for updates on RealFaviconGenerator (think: Apple has just
// // released a new Touch icon along with the latest version of iOS).
// // Run this task from time to time. Ideally, make it part of your
// // continuous integration system.
// gulp.task('check-for-favicon-update', function(done) {
// 	var currentVersion = JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).version;
// 	realFavicon.checkForUpdates(currentVersion, function(err) {
// 		if (err) {
// 			throw err;
// 		}
// 	});
// });
// Default Task
gulp.task('default', ['lint', 'sass', 'scripts', 'watch', 'connect']);


text:
//
//  KPAEmail.h
//  EmailCorrectionProjector
//
//  Created by Kenny Ackerson on 12/13/14.
//  Copyright (c) 2014 Kenny Ackerson. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 Model class to describe an email and the parts of an email address.
 */
@interface KPAEmail : NSObject

/**
 *  @param emailAddress The string email address.
 *
 *  @return Initialized instance of a KPAEmail or nil.
 */
- (instancetype)initWithEmailAddress:(NSString *)emailAddress;

/**
 *  @param userName Email username.
 *  @param domain   The domain the email server is on.
 *  @param TLD      The top level domain of the email, eg .com, .co.uk, .net.
 *
 *  @return Initialized instance of a KPAEmail.
 */
- (instancetype)initWithUserName:(NSString *)userName domain:(NSString *)domain andTLD:(NSString *)TLD;

@property (nonatomic, copy, readonly) NSString *TLD;

@property (nonatomic, copy, readonly) NSString *domain;

@property (nonatomic, copy, readonly) NSString *emailAddress;

@property (nonatomic, copy, readonly) NSString *userName;

@end


text:
#include "cairoint.h"

#include "cairo-error-private.h"
#include "cairo-slope-private.h"

static int
_cairo_pen_vertices_needed (double tolerance,
			    double radius,
			    const cairo_matrix_t *matrix);

static void
_cairo_pen_compute_slopes (cairo_pen_t *pen);

cairo_status_t
_cairo_pen_init (cairo_pen_t	*pen,
		 double		 radius,
		 double		 tolerance,
		 const cairo_matrix_t	*ctm)
{
    int i;
    int reflect;

    if (CAIRO_INJECT_FAULT ())
	return _cairo_error (CAIRO_STATUS_NO_MEMORY);

    VG (VALGRIND_MAKE_MEM_UNDEFINED (pen, sizeof (cairo_pen_t)));

    pen->radius = radius;
    pen->tolerance = tolerance;

    reflect = _cairo_matrix_compute_determinant (ctm) < 0.;

    pen->num_vertices = _cairo_pen_vertices_needed (tolerance,
						    radius,
						    ctm);

    if (pen->num_vertices > ARRAY_LENGTH (pen->vertices_embedded)) {
	pen->vertices = _cairo_malloc_ab (pen->num_vertices,
					  sizeof (cairo_pen_vertex_t));
	if (unlikely (pen->vertices == NULL))
	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
    } else {
	pen->vertices = pen->vertices_embedded;
    }

    /*
     * Compute pen coordinates.  To generate the right ellipse, compute points around
     * a circle in user space and transform them to device space.  To get a consistent
     * orientation in device space, flip the pen if the transformation matrix
     * is reflecting
     */
    for (i=0; i < pen->num_vertices; i++) {
	double theta = 2 * M_PI * i / (double) pen->num_vertices;
	double dx = radius * cos (reflect ? -theta : theta);
	double dy = radius * sin (reflect ? -theta : theta);
	cairo_pen_vertex_t *v = &pen->vertices[i];
	cairo_matrix_transform_distance (ctm, &dx, &dy);
	v->point.x = _cairo_fixed_from_double (dx);
	v->point.y = _cairo_fixed_from_double (dy);
    }

    _cairo_pen_compute_slopes (pen);

    return CAIRO_STATUS_SUCCESS;
}

void
_cairo_pen_fini (cairo_pen_t *pen)
{
    if (pen->vertices != pen->vertices_embedded)
	free (pen->vertices);

    VG (VALGRIND_MAKE_MEM_NOACCESS (pen, sizeof (cairo_pen_t)));
}

cairo_status_t
_cairo_pen_init_copy (cairo_pen_t *pen, const cairo_pen_t *other)
{
    VG (VALGRIND_MAKE_MEM_UNDEFINED (pen, sizeof (cairo_pen_t)));

    *pen = *other;

    if (CAIRO_INJECT_FAULT ())
	return _cairo_error (CAIRO_STATUS_NO_MEMORY);

    pen->vertices = pen->vertices_embedded;
    if (pen->num_vertices) {
	if (pen->num_vertices > ARRAY_LENGTH (pen->vertices_embedded)) {
	    pen->vertices = _cairo_malloc_ab (pen->num_vertices,
					      sizeof (cairo_pen_vertex_t));
	    if (unlikely (pen->vertices == NULL))
		return _cairo_error (CAIRO_STATUS_NO_MEMORY);
	}

	memcpy (pen->vertices, other->vertices,
		pen->num_vertices * sizeof (cairo_pen_vertex_t));
    }

    return CAIRO_STATUS_SUCCESS;
}

cairo_status_t
_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points)
{
    cairo_status_t status;
    int num_vertices;
    int i;

    if (CAIRO_INJECT_FAULT ())
	return _cairo_error (CAIRO_STATUS_NO_MEMORY);

    num_vertices = pen->num_vertices + num_points;
    if (num_vertices > ARRAY_LENGTH (pen->vertices_embedded) ||
	pen->vertices != pen->vertices_embedded)
    {
	cairo_pen_vertex_t *vertices;

	if (pen->vertices == pen->vertices_embedded) {
	    vertices = _cairo_malloc_ab (num_vertices,
		                         sizeof (cairo_pen_vertex_t));
	    if (unlikely (vertices == NULL))
		return _cairo_error (CAIRO_STATUS_NO_MEMORY);

	    memcpy (vertices, pen->vertices,
		    pen->num_vertices * sizeof (cairo_pen_vertex_t));
	} else {
	    vertices = _cairo_realloc_ab (pen->vertices,
					  num_vertices,
					  sizeof (cairo_pen_vertex_t));
	    if (unlikely (vertices == NULL))
		return _cairo_error (CAIRO_STATUS_NO_MEMORY);
	}

	pen->vertices = vertices;
    }

    pen->num_vertices = num_vertices;

    /* initialize new vertices */
    for (i=0; i < num_points; i++)
	pen->vertices[pen->num_vertices-num_points+i].point = point[i];

    status = _cairo_hull_compute (pen->vertices, &pen->num_vertices);
    if (unlikely (status))
	return status;

    _cairo_pen_compute_slopes (pen);

    return CAIRO_STATUS_SUCCESS;
}

/*
The circular pen in user space is transformed into an ellipse in
device space.

We construct the pen by computing points along the circumference
using equally spaced angles.

We show that this approximation to the ellipse has maximum error at the
major axis of the ellipse.

Set

	    M = major axis length
	    m = minor axis length

Align 'M' along the X axis and 'm' along the Y axis and draw
an ellipse parameterized by angle 't':

	    x = M cos t			y = m sin t

Perturb t by ± d and compute two new points (x+,y+), (x-,y-).
The distance from the average of these two points to (x,y) represents
the maximum error in approximating the ellipse with a polygon formed
from vertices 2∆ radians apart.

	    x+ = M cos (t+∆)		y+ = m sin (t+∆)
	    x- = M cos (t-∆)		y- = m sin (t-∆)

Now compute the approximation error, E:

	Ex = (x - (x+ + x-) / 2)
	Ex = (M cos(t) - (Mcos(t+∆) + Mcos(t-∆))/2)
	   = M (cos(t) - (cos(t)cos(∆) + sin(t)sin(∆) +
			  cos(t)cos(∆) - sin(t)sin(∆))/2)
	   = M(cos(t) - cos(t)cos(∆))
	   = M cos(t) (1 - cos(∆))

	Ey = y - (y+ - y-) / 2
	   = m sin (t) - (m sin(t+∆) + m sin(t-∆)) / 2
	   = m (sin(t) - (sin(t)cos(∆) + cos(t)sin(∆) +
			  sin(t)cos(∆) - cos(t)sin(∆))/2)
	   = m (sin(t) - sin(t)cos(∆))
	   = m sin(t) (1 - cos(∆))

	E² = Ex² + Ey²
	   = (M cos(t) (1 - cos (∆)))² + (m sin(t) (1-cos(∆)))²
	   = (1 - cos(∆))² (M² cos²(t) + m² sin²(t))
	   = (1 - cos(∆))² ((m² + M² - m²) cos² (t) + m² sin²(t))
	   = (1 - cos(∆))² (M² - m²) cos² (t) + (1 - cos(∆))² m²

Find the extremum by differentiation wrt t and setting that to zero

∂(E²)/∂(t) = (1-cos(∆))² (M² - m²) (-2 cos(t) sin(t))

         0 = 2 cos (t) sin (t)
	 0 = sin (2t)
	 t = nπ

Which is to say that the maximum and minimum errors occur on the
axes of the ellipse at 0 and π radians:

	E²(0) = (1-cos(∆))² (M² - m²) + (1-cos(∆))² m²
	      = (1-cos(∆))² M²
	E²(π) = (1-cos(∆))² m²

maximum error = M (1-cos(∆))
minimum error = m (1-cos(∆))

We must make maximum error ≤ tolerance, so compute the ∆ needed:

	    tolerance = M (1-cos(∆))
	tolerance / M = 1 - cos (∆)
	       cos(∆) = 1 - tolerance/M
                    ∆ = acos (1 - tolerance / M);

Remembering that ∆ is half of our angle between vertices,
the number of vertices is then

             vertices = ceil(2π/2∆).
                      = ceil(π/∆).

Note that this also equation works for M == m (a circle) as it
doesn't matter where on the circle the error is computed.
*/

static int
_cairo_pen_vertices_needed (double	    tolerance,
			    double	    radius,
			    const cairo_matrix_t  *matrix)
{
    /*
     * the pen is a circle that gets transformed to an ellipse by matrix.
     * compute major axis length for a pen with the specified radius.
     * we don't need the minor axis length.
     */

    double  major_axis = _cairo_matrix_transformed_circle_major_axis (matrix,
								      radius);

    /*
     * compute number of vertices needed
     */
    int	    num_vertices;

    /* Where tolerance / M is > 1, we use 4 points */
    if (tolerance >= major_axis) {
	num_vertices = 4;
    } else {
	double delta = acos (1 - tolerance / major_axis);
	num_vertices = ceil (M_PI / delta);

	/* number of vertices must be even */
	if (num_vertices % 2)
	    num_vertices++;

	/* And we must always have at least 4 vertices. */
	if (num_vertices < 4)
	    num_vertices = 4;
    }

    return num_vertices;
}

static void
_cairo_pen_compute_slopes (cairo_pen_t *pen)
{
    int i, i_prev;
    cairo_pen_vertex_t *prev, *v, *next;

    for (i=0, i_prev = pen->num_vertices - 1;
	 i < pen->num_vertices;
	 i_prev = i++) {
	prev = &pen->vertices[i_prev];
	v = &pen->vertices[i];
	next = &pen->vertices[(i + 1) % pen->num_vertices];

	_cairo_slope_init (&v->slope_cw, &prev->point, &v->point);
	_cairo_slope_init (&v->slope_ccw, &v->point, &next->point);
    }
}
/*
 * Find active pen vertex for clockwise edge of stroke at the given slope.
 *
 * The strictness of the inequalities here is delicate. The issue is
 * that the slope_ccw member of one pen vertex will be equivalent to
 * the slope_cw member of the next pen vertex in a counterclockwise
 * order. However, for this function, we care strongly about which
 * vertex is returned.
 *
 * [I think the "care strongly" above has to do with ensuring that the
 * pen's "extra points" from the spline's initial and final slopes are
 * properly found when beginning the spline stroking.]
 */
int
_cairo_pen_find_active_cw_vertex_index (const cairo_pen_t *pen,
					const cairo_slope_t *slope)
{
    int i;

    for (i=0; i < pen->num_vertices; i++) {
	if ((_cairo_slope_compare (slope, &pen->vertices[i].slope_ccw) < 0) &&
	    (_cairo_slope_compare (slope, &pen->vertices[i].slope_cw) >= 0))
	    break;
    }

    /* If the desired slope cannot be found between any of the pen
     * vertices, then we must have a degenerate pen, (such as a pen
     * that's been transformed to a line). In that case, we consider
     * the first pen vertex as the appropriate clockwise vertex.
     */
    if (i == pen->num_vertices)
	i = 0;

    return i;
}

/* Find active pen vertex for counterclockwise edge of stroke at the given slope.
 *
 * Note: See the comments for _cairo_pen_find_active_cw_vertex_index
 * for some details about the strictness of the inequalities here.
 */
int
_cairo_pen_find_active_ccw_vertex_index (const cairo_pen_t *pen,
					 const cairo_slope_t *slope)
{
    cairo_slope_t slope_reverse;
    int i;

    slope_reverse = *slope;
    slope_reverse.dx = -slope_reverse.dx;
    slope_reverse.dy = -slope_reverse.dy;

    for (i=pen->num_vertices-1; i >= 0; i--) {
	if ((_cairo_slope_compare (&pen->vertices[i].slope_ccw, &slope_reverse) >= 0) &&
	    (_cairo_slope_compare (&pen->vertices[i].slope_cw, &slope_reverse) < 0))
	    break;
    }

    /* If the desired slope cannot be found between any of the pen
     * vertices, then we must have a degenerate pen, (such as a pen
     * that's been transformed to a line). In that case, we consider
     * the last pen vertex as the appropriate counterclockwise vertex.
     */
    if (i < 0)
	i = pen->num_vertices - 1;

    return i;
}


text:
#ifndef RADIATIONPRESSURECOEFFICIENT_H
#define RADIATIONPRESSURECOEFFICIENT_H

#include <Eigen/Core>

#include "Tudat/Astrodynamics/OrbitDetermination/EstimatableParameters/estimatableParameter.h"
#include "Tudat/Astrodynamics/ElectroMagnetism/radiationPressureInterface.h"

namespace tudat
{

namespace estimatable_parameters
{

//! Interface class for the estimation of a radiation pressure coefficient
class RadiationPressureCoefficient: public EstimatableParameter< double >
{

public:
    //! Constructor.
    /*!
     * Constructor
     * \param radiationPressureInterface Object containing the radiation pressure coefficient to be estimated.
     * \param associatedBody Name of body containing the radiationPressureInterface object
     */
    RadiationPressureCoefficient(
            boost::shared_ptr< electro_magnetism::RadiationPressureInterface > radiationPressureInterface,
            std::string& associatedBody ):
        EstimatableParameter< double >( radiation_pressure_coefficient, associatedBody ),
        radiationPressureInterface_( radiationPressureInterface )
    { }

    //! Destructor.
    ~RadiationPressureCoefficient( ) { }

    //! Function to get the current value of the radiation pressure coefficient that is to be estimated.
    /*!
     * Function to get the current value of the radiation pressure coefficient that is to be estimated.
     * \return Current value of the radiation pressure coefficient that is to be estimated.
     */
    double getParameterValue( )
    {
        return radiationPressureInterface_->getRadiationPressureCoefficient( );
    }

    //! Function to reset the value of the radiation pressure coefficient that is to be estimated.
    /*!
     * Function to reset the value of the radiation pressure coefficient that is to be estimated.
     * \param parameterValue New value of the radiation pressure coefficient that is to be estimated.
     */
    void setParameterValue( double parameterValue )
    {
        radiationPressureInterface_->resetRadiationPressureCoefficient( parameterValue );
    }

    //! Function to retrieve the size of the parameter (always 1).
    /*!
     *  Function to retrieve the size of the parameter (always 1).
     *  \return Size of parameter value (always 1).
     */
    int getParameterSize( ){ return 1; }

protected:

private:

    //! Object containing the radiation pressure coefficient to be estimated.
    boost::shared_ptr< electro_magnetism::RadiationPressureInterface > radiationPressureInterface_;
};

}

}

#endif // RADIATIONPRESSURECOEFFICIENT_H


text:
'use strict';

var restify = require('restify');
var server = restify.createServer();

server.use(restify.bodyParser());

require('./routes.js')(server);

if (module.parent) { // Manhattan
    module.exports = server.server;
} else {
    server.listen(3012, function () {
        console.log('%s listening at %s', server.name, server.url);
    });
}


text:
package site

import (
	"fmt"
	"html/template"
	"image/color"
	"math"
	"net/http"
	"net/url"
	"regexp"
	"runtime"
	"strconv"
	"strings"
	"time"

	"github.com/google/triage-party/pkg/provider"

	"github.com/google/triage-party/pkg/hubbub"
	"github.com/google/triage-party/pkg/triage"
	"github.com/google/triage-party/pkg/updater"

	"github.com/dustin/go-humanize"
	"gopkg.in/yaml.v2"

	"k8s.io/klog/v2"
)

// VERSION is what version of Triage Party we advertise as.
const VERSION = "v1.4.0"

var (
	nonWordRe = regexp.MustCompile(`\W`)

	// MaxPlayers is how many players to enable in the web interface.
	MaxPlayers = 20

	// Cut-off points for human duration (reversed order)
	defaultMagnitudes = []humanize.RelTimeMagnitude{
		{time.Second, "now", time.Second},
		{2 * time.Second, "1 second %s", 1},
		{time.Minute, "%d seconds %s", time.Second},
		{2 * time.Minute, "1 minute %s", 1},
		{time.Hour, "%d minutes %s", time.Minute},
		{2 * time.Hour, "1 hour %s", 1},
		{humanize.Day, "%d hours %s", time.Hour},
		{2 * humanize.Day, "1 day %s", 1},
		{20 * humanize.Day, "%d days %s", humanize.Day},
		{8 * humanize.Week, "%d weeks %s", humanize.Week},
		{humanize.Year, "%d months %s", humanize.Month},
		{18 * humanize.Month, "1 year %s", 1},
		{2 * humanize.Year, "2 years %s", 1},
		{humanize.LongTime, "%d years %s", humanize.Year},
		{math.MaxInt64, "a long while %s", 1},
	}
)

// Config is how external users interact with this package.
type Config struct {
	BaseDirectory string
	Name          string
	WarnAge       time.Duration
	Updater       *updater.Updater
	Party         *triage.Party
}

func New(c *Config) *Handlers {
	return &Handlers{
		baseDir:   c.BaseDirectory,
		updater:   c.Updater,
		party:     c.Party,
		siteName:  c.Name,
		warnAge:   c.WarnAge,
		startTime: time.Now(),
	}
}

// Handlers is a mix of config and client interfaces to connect with.
type Handlers struct {
	baseDir   string
	updater   *updater.Updater
	party     *triage.Party
	siteName  string
	warnAge   time.Duration
	startTime time.Time
}

// Root redirects to leaderboard.
func (h *Handlers) Root() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		sts, err := h.party.ListCollections()
		if err != nil {
			klog.Errorf("collections: %v", err)
			return
		}
		http.Redirect(w, r, fmt.Sprintf("/s/%s", sts[0].ID), http.StatusSeeOther)
	}
}

// Page are values that are passed into the renderer
type Page struct {
	Version      string
	SiteName     string
	ID           string
	Category     string
	Title        string
	Description  string
	Warning      template.HTML
	Notification template.HTML
	Total        int
	TotalShown   int
	Types        string
	UniqueItems  []*hubbub.Conversation
	ResultAge    time.Duration
	Stale        bool

	Player        int
	Players       int
	PlayerChoices []string
	PlayerNums    []int
	Index         int

	AverageResponseLatency time.Duration
	TotalPullRequests      int
	TotalIssues            int

	ClosedPerDay float64

	Collection  triage.Collection
	Collections []triage.Collection
	Categories  []string

	Swimlanes            []*Swimlane
	CollectionResult     *triage.CollectionResult
	SelectorVar          string
	SelectorOptions      []Choice
	Milestone            *provider.Milestone
	CompletionETA        time.Time
	MilestoneETA         time.Time
	MilestoneCountOffset int
	MilestoneVeryLate    bool

	OpenStats     *triage.CollectionResult
	VelocityStats *triage.CollectionResult
	GetVars       string
	Status        string
}

// Choice is a selector choice
type Choice struct {
	Value    int
	Text     string
	Selected bool
}

// is this request an HTTP refresh?
func isRefresh(r *http.Request) bool {
	cc := r.Header["Cache-Control"]
	if len(cc) == 0 {
		return false
	}
	//	klog.Infof("cc=%s headers=%+v", cc, r.Header)
	return cc[0] == "max-age-0" || cc[0] == "no-cache"
}

// helper to get integers from a URL
func getInt(url *url.URL, key string, fallback int) int {
	vals := url.Query()[key]
	if len(vals) == 1 {
		i, err := strconv.ParseInt(vals[0], 10, 32)
		if err != nil {
			klog.Warningf("bad %s int value: %v", key, vals)
			return fallback
		}
		return int(i)
	}
	return fallback
}

func toYAML(v interface{}) string {
	s, err := yaml.Marshal(v)
	if err != nil {
		return fmt.Sprintf("yaml err: %v", err)
	}
	return string(s)
}

// Acknowledge JS sanitization issues (what data do we trust?)
func toJS(s string) template.JS {
	return template.JS(s)
}

// Acknowledge JS sanitization issues (what data do we trust?)
func toJSfunc(s string) template.JS {
	return template.JS(nonWordRe.ReplaceAllString(s, "_"))
}

// Make a class name
func className(s string) template.HTMLAttr {
	s = strings.ToLower(nonWordRe.ReplaceAllString(s, "-"))
	s = strings.Replace(s, "_", "-", -1)
	return template.HTMLAttr(s)
}

func parseHexColor(s string) (c color.RGBA, err error) {
	c.A = 0xff

	if s[0] != '#' {
		return c, fmt.Errorf("%q is not a valid hex color", s)
	}

	hexToByte := func(b byte) byte {
		switch {
		case b >= '0' && b <= '9':
			return b - '0'
		case b >= 'a' && b <= 'f':
			return b - 'a' + 10
		case b >= 'A' && b <= 'F':
			return b - 'A' + 10
		}
		err = fmt.Errorf("%q is not a parseable hex color", s)
		return 0
	}

	switch len(s) {
	case 7:
		c.R = hexToByte(s[1])<<4 + hexToByte(s[2])
		c.G = hexToByte(s[3])<<4 + hexToByte(s[4])
		c.B = hexToByte(s[5])<<4 + hexToByte(s[6])
	case 4:
		c.R = hexToByte(s[1]) * 17
		c.G = hexToByte(s[2]) * 17
		c.B = hexToByte(s[3]) * 17
	default:
		err = fmt.Errorf("%q is not a proper hex color", s)
	}
	return
}

// pick an appropriate text color given a background color
func textColor(s string) template.CSS {
	color, err := parseHexColor(fmt.Sprintf("#%s", strings.TrimPrefix(s, "#")))
	if err != nil {
		klog.Errorf("parse hex color failed: %v", err)
		return "f00"
	}

	// human eye is most sensitive to green
	lum := (0.299*float64(color.R) + 0.587*float64(color.G) + 0.114*float64(color.B)) / 255
	if lum > 0.5 {
		return "111"
	}
	return "fff"
}

func unixNano(t time.Time) int64 {
	return t.UnixNano()
}

func humanDuration(d time.Duration) string {
	return roughTime(time.Now().Add(-d))
}

func toDays(d time.Duration) string {
	return fmt.Sprintf("%0.1fd", d.Hours()/24)
}

func roughTime(t time.Time) string {
	if t.IsZero() {
		return ""
	}

	ds := humanize.CustomRelTime(t, time.Now(), "ago", "from now", defaultMagnitudes)
	ds = strings.Replace(ds, " ago", "", 1)

	ds = strings.Replace(ds, " minutes", "min", 1)
	ds = strings.Replace(ds, " minute", "min", 1)

	ds = strings.Replace(ds, " hours", "h", 1)
	ds = strings.Replace(ds, " hour", "h", 1)

	ds = strings.Replace(ds, " days", "d", 1)
	ds = strings.Replace(ds, " day", "d", 1)

	ds = strings.Replace(ds, " months", "mo", 1)
	ds = strings.Replace(ds, " month", "mo", 1)

	ds = strings.Replace(ds, " years", "y", 1)
	ds = strings.Replace(ds, " year", "y", 1)

	ds = strings.Replace(ds, " weeks", "wk", 1)
	ds = strings.Replace(ds, " week", "wk", 1)

	return ds
}

func avatar(u *provider.User) template.HTML {
	return template.HTML(fmt.Sprintf(`<a href="%s" title="%s"><img src="%s" width="20" height="20"></a>`, u.GetHTMLURL(), u.GetLogin(), u.GetAvatarURL()))
}

// playerFilter filters out results for a particular player
func playerFilter(result *triage.CollectionResult, player int, players int) *triage.CollectionResult {
	klog.Infof("Filtering for player %d of %d ...", player, players)

	os := []*triage.RuleResult{}
	seen := map[string]*triage.Rule{}

	for _, o := range result.RuleResults {
		cs := []*hubbub.Conversation{}

		for _, i := range o.Items {
			if (i.ID % players) == (player - 1) {
				cs = append(cs, i)
			}
		}

		os = append(os, triage.SummarizeRuleResult(o.Rule, cs, seen))
	}

	return triage.SummarizeCollectionResult(result.Collection, os)
}

// Healthz returns a dummy healthz page - it's always happy here!
func (h *Handlers) Healthz() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusOK)
		w.Write([]byte(fmt.Sprintf("ok: %s", h.updater.Status())))
	}
}

// Threadz returns a threadz page
func (h *Handlers) Threadz() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		klog.Infof("GET %s: %v", r.URL.Path, r.Header)
		w.WriteHeader(http.StatusOK)
		w.Write(stack())
	}
}

// stack returns a formatted stack trace of all goroutines
// It calls runtime.Stack with a large enough buffer to capture the entire trace.
func stack() []byte {
	buf := make([]byte, 1024)
	for {
		n := runtime.Stack(buf, true)
		if n < len(buf) {
			return buf[:n]
		}
		buf = make([]byte, 2*len(buf))
	}
}


text:
using System;

class Volleyball
{
    static void Main()
    {
        string year = Console.ReadLine();
        int p = int.Parse(Console.ReadLine());
        int h = int.Parse(Console.ReadLine());

        double saturdayPlays = (48 - h) * 3 / 4.0;
        double holidayPlays = p * 2 / 3.0;
        double totalPlays = saturdayPlays + h + holidayPlays;

        if (year == "leap")
        {
            double leapYearPlays = totalPlays + (totalPlays * 15 / 100.0);
            Console.WriteLine("{0}", Math.Floor(leapYearPlays));
        }
        else
        {
            Console.WriteLine("{0}", Math.Floor(totalPlays));
        }
    }
}


text:
<?php

namespace Doctrine\Tests\Common\Cache;

use Doctrine\Common\Cache\Cache;
use ArrayObject;

abstract class CacheTest extends \Doctrine\Tests\DoctrineTestCase
{
    /**
     * @dataProvider provideCrudValues
     */
    public function testBasicCrudOperations($value)
    {
        $cache = $this->_getCacheDriver();

        // Test saving a value, checking if it exists, and fetching it back
        $this->assertTrue($cache->save('key', 'value'));
        $this->assertTrue($cache->contains('key'));
        $this->assertEquals('value', $cache->fetch('key'));

        // Test updating the value of a cache entry
        $this->assertTrue($cache->save('key', 'value-changed'));
        $this->assertTrue($cache->contains('key'));
        $this->assertEquals('value-changed', $cache->fetch('key'));

        // Test deleting a value
        $this->assertTrue($cache->delete('key'));
        $this->assertFalse($cache->contains('key'));
    }

    public function provideCrudValues()
    {
        return array(
            'array' => array(array('one', 2, 3.0)),
            'string' => array('value'),
            'integer' => array(1),
            'float' => array(1.5),
            'object' => array(new ArrayObject()),
            'null' => array(null),
        );
    }

    public function testDeleteAll()
    {
        $cache = $this->_getCacheDriver();

        $this->assertTrue($cache->save('key1', 1));
        $this->assertTrue($cache->save('key2', 2));
        $this->assertTrue($cache->deleteAll());
        $this->assertFalse($cache->contains('key1'));
        $this->assertFalse($cache->contains('key2'));
    }

    public function testDeleteAllAndNamespaceVersioningBetweenCaches()
    {
        if ( ! $this->isSharedStorage()) {
            $this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage');
        }

        $cache1 = $this->_getCacheDriver();
        $cache2 = $this->_getCacheDriver();

        $this->assertTrue($cache1->save('key1', 1));
        $this->assertTrue($cache2->save('key2', 2));

        /* Both providers are initialized with the same namespace version, so
         * they can see entries set by each other.
         */
        $this->assertTrue($cache1->contains('key1'));
        $this->assertTrue($cache1->contains('key2'));
        $this->assertTrue($cache2->contains('key1'));
        $this->assertTrue($cache2->contains('key2'));

        /* Deleting all entries through one provider will only increment the
         * namespace version on that object (and in the cache itself, which new
         * instances will use to initialize). The second provider will retain
         * its original version and still see stale data.
         */
        $this->assertTrue($cache1->deleteAll());
        $this->assertFalse($cache1->contains('key1'));
        $this->assertFalse($cache1->contains('key2'));
        $this->assertTrue($cache2->contains('key1'));
        $this->assertTrue($cache2->contains('key2'));

        /* A new cache provider should not see the deleted entries, since its
         * namespace version will be initialized.
         */
        $cache3 = $this->_getCacheDriver();
        $this->assertFalse($cache3->contains('key1'));
        $this->assertFalse($cache3->contains('key2'));
    }

    public function testFlushAll()
    {
        $cache = $this->_getCacheDriver();

        $this->assertTrue($cache->save('key1', 1));
        $this->assertTrue($cache->save('key2', 2));
        $this->assertTrue($cache->flushAll());
        $this->assertFalse($cache->contains('key1'));
        $this->assertFalse($cache->contains('key2'));
    }

    public function testFlushAllAndNamespaceVersioningBetweenCaches()
    {
        if ( ! $this->isSharedStorage()) {
            $this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage');
        }

        $cache1 = $this->_getCacheDriver();
        $cache2 = $this->_getCacheDriver();

        /* Deleting all elements from the first provider should increment its
         * namespace version before saving the first entry.
         */
        $cache1->deleteAll();
        $this->assertTrue($cache1->save('key1', 1));

        /* The second provider will be initialized with the same namespace
         * version upon its first save operation.
         */
        $this->assertTrue($cache2->save('key2', 2));

        /* Both providers have the same namespace version and can see entires
         * set by each other.
         */
        $this->assertTrue($cache1->contains('key1'));
        $this->assertTrue($cache1->contains('key2'));
        $this->assertTrue($cache2->contains('key1'));
        $this->assertTrue($cache2->contains('key2'));

        /* Flushing all entries through one cache will remove all entries from
         * the cache but leave their namespace version as-is.
         */
        $this->assertTrue($cache1->flushAll());
        $this->assertFalse($cache1->contains('key1'));
        $this->assertFalse($cache1->contains('key2'));
        $this->assertFalse($cache2->contains('key1'));
        $this->assertFalse($cache2->contains('key2'));

        /* Inserting a new entry will use the same, incremented namespace
         * version, and it will be visible to both providers.
         */
        $this->assertTrue($cache1->save('key1', 1));
        $this->assertTrue($cache1->contains('key1'));
        $this->assertTrue($cache2->contains('key1'));

        /* A new cache provider will be initialized with the original namespace
         * version and not share any visibility with the first two providers.
         */
        $cache3 = $this->_getCacheDriver();
        $this->assertFalse($cache3->contains('key1'));
        $this->assertFalse($cache3->contains('key2'));
        $this->assertTrue($cache3->save('key3', 3));
        $this->assertTrue($cache3->contains('key3'));
    }

    public function testNamespace()
    {
        $cache = $this->_getCacheDriver();

        $cache->setNamespace('ns1_');

        $this->assertTrue($cache->save('key1', 1));
        $this->assertTrue($cache->contains('key1'));

        $cache->setNamespace('ns2_');

        $this->assertFalse($cache->contains('key1'));
    }

    public function testDeleteAllNamespace()
    {
        $cache = $this->_getCacheDriver();

        $cache->setNamespace('ns1');
        $this->assertFalse($cache->contains('key1'));
        $cache->save('key1', 'test');
        $this->assertTrue($cache->contains('key1'));

        $cache->setNamespace('ns2');
        $this->assertFalse($cache->contains('key1'));
        $cache->save('key1', 'test');
        $this->assertTrue($cache->contains('key1'));

        $cache->setNamespace('ns1');
        $this->assertTrue($cache->contains('key1'));
        $cache->deleteAll();
        $this->assertFalse($cache->contains('key1'));

        $cache->setNamespace('ns2');
        $this->assertTrue($cache->contains('key1'));
        $cache->deleteAll();
        $this->assertFalse($cache->contains('key1'));
    }

    /**
     * @group DCOM-43
     */
    public function testGetStats()
    {
        $cache = $this->_getCacheDriver();
        $stats = $cache->getStats();

        $this->assertArrayHasKey(Cache::STATS_HITS, $stats);
        $this->assertArrayHasKey(Cache::STATS_MISSES, $stats);
        $this->assertArrayHasKey(Cache::STATS_UPTIME, $stats);
        $this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats);
        $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILABLE, $stats);
    }

    public function testFetchMissShouldReturnFalse()
    {
        $cache = $this->_getCacheDriver();

        /* Ensure that caches return boolean false instead of null on a fetch
         * miss to be compatible with ORM integration.
         */
        $result = $cache->fetch('nonexistent_key');

        $this->assertFalse($result);
        $this->assertNotNull($result);
    }

    /**
     * Return whether multiple cache providers share the same storage.
     *
     * This is used for skipping certain tests for shared storage behavior.
     *
     * @return boolean
     */
    protected function isSharedStorage()
    {
        return true;
    }

    /**
     * @return \Doctrine\Common\Cache\CacheProvider
     */
    abstract protected function _getCacheDriver();
}


text:
Meteor.startup(function () {
});

ServiceConfiguration.configurations.upsert(
  { service: "meteor-developer" },
  {
    $set: {
      clientId: "eJEQYJxmkjbocCKGQ",
      loginStyle: "popup",
      secret: "c3SnBdfN3XPcMb2f2DPiiARHteeaBGDfwM"
    }
  }
);


text:
module RichardGuy.A282615 (a282615) where
import Helpers.RichardGuy (enumerateA104429, isSeparable, also, isSelfConjugate)

a282615 :: Int -> Int
a282615 = length . enumerateA282615

enumerateA282615 :: Int -> [[(Int, Int, Int)]]
enumerateA282615 n = filter (isSeparable `also` isSelfConjugate n) $ enumerateA104429 n


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('recipes', '0003_auto_20160329_1621'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='recipe',
            name='category',
        ),
        migrations.AddField(
            model_name='recipe',
            name='categories',
            field=models.ManyToManyField(blank=True, null=True, to='recipes.Category'),
        ),
        migrations.AlterField(
            model_name='recipe',
            name='directions',
            field=models.TextField(blank=True),
        ),
        migrations.AlterField(
            model_name='recipe',
            name='slug',
            field=models.SlugField(help_text='This is the part of the recipe that will appear in the address bar. You should not need to edit it, but it will be the recipe name without any punctuation or spaces.', max_length=255, unique=True),
        ),
    ]


text:
package com.android.sdklib.internal.repository.packages;

import com.android.sdklib.SdkManager;
import com.android.sdklib.internal.repository.archives.ArchFilter;
import com.android.sdklib.internal.repository.archives.Archive;
import com.android.sdklib.internal.repository.sources.SdkRepoSource;
import com.android.sdklib.internal.repository.sources.SdkSource;
import com.android.sdklib.repository.FullRevision;
import com.android.sdklib.repository.PkgProps;
import com.android.sdklib.repository.descriptors.IPkgDesc;
import com.android.sdklib.repository.descriptors.PkgDesc;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Properties;

import junit.framework.TestCase;

public class PackageTest extends TestCase {

    protected static final String LOCAL_ARCHIVE_PATH = "/local/archive/path";

    /** Local class used to test the abstract Package class */
    protected static class MockPackage extends MajorRevisionPackage {
        public MockPackage(
                SdkSource source,
                Properties props,
                int revision,
                String license,
                String description,
                String descUrl,
                String archiveOsPath) {
            super(source,
                    props,
                    revision,
                    license,
                    description,
                    descUrl,
                    archiveOsPath);
        }

        @Override
        public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
        }

        @Override
        public String getListDescription() {
            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
        }

        @Override
        public String getShortDescription() {
            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
        }

        @Override
        public boolean sameItemAs(Package pkg) {
            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
        }

        @Override
        public String installId() {
            return "mock-pkg";  //$NON-NLS-1$
        }

        @Override
        public IPkgDesc getPkgDesc() {
            return PkgDesc.Builder.newTool(
                    new FullRevision(1, 2, 3, 4),
                    FullRevision.NOT_SPECIFIED).create();
        }
    }

    public void testCreate() throws Exception {
        Properties props = createExpectedProps();

        Package p = new MockPackage(
                null, //source
                props,
                -1, //revision
                null, //license
                null, //description
                null, //descUrl
                LOCAL_ARCHIVE_PATH //archiveOsPath
                );

        testCreatedPackage(p);
    }

    public void testSaveProperties() throws Exception {
        Properties expected = createExpectedProps();

        Package p = new MockPackage(
                null, //source
                expected,
                -1, //revision
                null, //license
                null, //description
                null, //descUrl
                LOCAL_ARCHIVE_PATH //archiveOsPath
                );

        Properties actual = new Properties();
        p.saveProperties(actual);

        assertEquals(expected, actual);
    }

    /**
     * Sets the properties used by {@link #testCreate()} and
     * {@link #testSaveProperties()}.
     * This is protected and used by derived classes to perform
     * a similar creation test.
     */
    protected Properties createExpectedProps() {
        return createDefaultProps();
    }

    /**
     * Similar to {@link #createExpectedProps()} but static so that
     * it can be reused by test not deriving from {@link PackageTest}.
     */
    public static Properties createDefaultProps() {
        Properties props = new Properties();

        // Package properties
        props.setProperty(PkgProps.PKG_REVISION,     "42");
        props.setProperty(PkgProps.PKG_LICENSE,      "The License");
        props.setProperty(PkgProps.PKG_DESC,         "Some description.");
        props.setProperty(PkgProps.PKG_DESC_URL,     "http://description/url");
        props.setProperty(PkgProps.PKG_LIST_DISPLAY, "Some description.");
        props.setProperty(PkgProps.PKG_RELEASE_NOTE, "Release Note");
        props.setProperty(PkgProps.PKG_RELEASE_URL,  "http://release/note");
        props.setProperty(PkgProps.PKG_SOURCE_URL,   "http://source/url");
        props.setProperty(PkgProps.PKG_OBSOLETE,     "true");
        return props;
    }

    /**
     * Tests the values set via {@link #createExpectedProps()} after the
     * package has been created in {@link #testCreate()}.
     * This is protected and used by derived classes to perform
     * a similar creation test.
     */
    protected void testCreatedPackage(Package p) {
        // Package properties
        assertEquals("42", p.getRevision().toShortString());
        assertEquals("<License ref:null, text:The License>", p.getLicense().toString());
        assertEquals("Some description.", p.getDescription());
        assertEquals("http://description/url", p.getDescUrl());
        assertEquals("Release Note", p.getReleaseNote());
        assertEquals("http://release/note", p.getReleaseNoteUrl());
        assertEquals(new SdkRepoSource("http://source/url", null /*uiName*/), p.getParentSource());
        assertTrue(p.isObsolete());

        assertNotNull(p.getArchives());
        assertEquals(1, p.getArchives().length);
        Archive a = p.getArchives()[0];
        assertNotNull(a);
        assertEquals(new ArchFilter(null), a.getArchFilter());
        assertEquals(LOCAL_ARCHIVE_PATH, a.getLocalOsPath());
    }

    // ----

    public void testCompareTo() throws Exception {
        ArrayList<Package> list = new ArrayList<Package>();
        MockPlatformPackage p1;

        list.add(p1 = new MockPlatformPackage(1, 2));
        list.add(new MockAddonPackage(p1, 3));
        list.add(new MockSystemImagePackage(p1, 4, "x86"));
        list.add(new MockBrokenPackage(BrokenPackage.MIN_API_LEVEL_NOT_SPECIFIED, 1));
        list.add(new MockExtraPackage("vendor", "path", 5, 6));
        list.add(new MockToolPackage(7, 8));

        Collections.sort(list);

        assertEquals(
                "[Android SDK Tools, revision 7, " +
                 "SDK Platform Android android-1, API 1, revision 2, " +
                 "Intel x86 Atom System Image, Android API 1, revision 4, " +
                 "addon, Android API 1, revision 3, " +
                 "Broken package for API 1, " +
                 "Vendor Path, revision 5]",
                Arrays.toString(list.toArray()));
    }

    public void testGetPropertyInt() {
        Properties p = new Properties();

        assertEquals(42, Package.getPropertyInt(p, "key", 42));

        p.setProperty("key", "");
        assertEquals(43, Package.getPropertyInt(p, "key", 43));

        p.setProperty("key", "I am not a number");
        assertEquals(44, Package.getPropertyInt(p, "key", 44));

        p.setProperty("key", "6");
        assertEquals(6, Package.getPropertyInt(p, "key", 45));
    }

}


text:
///Credit ChoMPHi
///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/

using System.Collections;

namespace UnityEngine.UI.Extensions.Tweens
{
	internal interface ITweenValue
	{
		void TweenValue(float floatPercentage);
		bool ignoreTimeScale { get; }
		float duration { get; }
		bool ValidTarget();
		void Finished();
	}
}


text:
var gulp        = require('gulp');
var browserSync = require('browser-sync').create();
var sass        = require('gulp-sass');
var concat      = require('gulp-concat');

// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function () {

    browserSync.init({
        server: "./"
    });

    gulp.watch("./scss/*.scss", ['sass']);
    gulp.watch("./*.html").on('change', browserSync.reload);
});

// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function () {
    return gulp.src("./scss/*.scss")
        .pipe(sass({ style: 'compressed' }))
        .pipe(gulp.dest("./css"))
        .pipe(browserSync.stream());
});

gulp.task('default', ['serve']);


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

var app = express();

//app.use("/build", express.static( __dirname + "/../build"));
app.use(express.static(__dirname));

var rPort = Math.floor(Math.random()*65000);

app.listen(rPort, function()
{
	console.log('Listening on port: ' + rPort);

});


text:
module="scull"
device="scull"
mode="664"

# invoke insmod with all arguments we got
# and use a pathname as newer modutils don't look in . by default
/sbin/insmod ./$module.ko $* || exit 1

# remove stale nodes
rm -f /dev/${device}[0-3]

major=$(awk "\\$2==\"$module\" {print \\$1}" /proc/devices)

mknod /dev/${device}0 c $major 0
mknod /dev/${device}1 c $major 1
mknod /dev/${device}2 c $major 2
mknod /dev/${device}3 c $major 3

# give appropriate group/permissions, and change the group.
# Not all distributions have staff, some have "wheel" instead.
group="staff"
grep -q '^staff:' /etc/group || group="wheel"

# anyone can read, but only root can write
chgrp $group /dev/${device}[0-3]
chmod $mode /dev/${device}[0-3]


text:
.class final Ljava/util/concurrent/ConcurrentHashMap$TreeNode;
.super Ljava/util/concurrent/ConcurrentHashMap$Node;
.source "ConcurrentHashMap.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Ljava/util/concurrent/ConcurrentHashMap;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "TreeNode"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<K:",
        "Ljava/lang/Object;",
        "V:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/util/concurrent/ConcurrentHashMap$Node",
        "<TK;TV;>;"
    }
.end annotation

# instance fields
.field left:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap$TreeNode",
            "<TK;TV;>;"
        }
    .end annotation
.end field

.field parent:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap$TreeNode",
            "<TK;TV;>;"
        }
    .end annotation
.end field

.field prev:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap$TreeNode",
            "<TK;TV;>;"
        }
    .end annotation
.end field

.field red:Z

.field right:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap$TreeNode",
            "<TK;TV;>;"
        }
    .end annotation
.end field

# direct methods
.method constructor <init>(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/concurrent/ConcurrentHashMap$Node;Ljava/util/concurrent/ConcurrentHashMap$TreeNode;)V
    .locals 0
    .param p1, "hash"    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(ITK;TV;",
            "Ljava/util/concurrent/ConcurrentHashMap$Node",
            "<TK;TV;>;",
            "Ljava/util/concurrent/ConcurrentHashMap$TreeNode",
            "<TK;TV;>;)V"
        }
    .end annotation

    .prologue
    .line 1869
    .local p0, "this":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    .local p2, "key":Ljava/lang/Object;, "TK;"
    .local p3, "val":Ljava/lang/Object;, "TV;"
    .local p4, "next":Ljava/util/concurrent/ConcurrentHashMap$Node;, "Ljava/util/concurrent/ConcurrentHashMap$Node<TK;TV;>;"
    .local p5, "parent":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    invoke-direct {p0, p1, p2, p3, p4}, Ljava/util/concurrent/ConcurrentHashMap$Node;-><init>(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/concurrent/ConcurrentHashMap$Node;)V

    .line 1870
    iput-object p5, p0, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->parent:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;

    .line 1871
    return-void
.end method

# virtual methods
.method find(ILjava/lang/Object;)Ljava/util/concurrent/ConcurrentHashMap$Node;
    .locals 1
    .param p1, "h"    # I
    .param p2, "k"    # Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/concurrent/ConcurrentHashMap$Node",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 1874
    .local p0, "this":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    const/4 v0, 0x0

    invoke-virtual {p0, p1, p2, v0}, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->findTreeNode(ILjava/lang/Object;Ljava/lang/Class;)Ljava/util/concurrent/ConcurrentHashMap$TreeNode;

    move-result-object v0

    return-object v0
.end method

.method final findTreeNode(ILjava/lang/Object;Ljava/lang/Class;)Ljava/util/concurrent/ConcurrentHashMap$TreeNode;
    .locals 8
    .param p1, "h"    # I
    .param p2, "k"    # Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I",
            "Ljava/lang/Object;",
            "Ljava/lang/Class",
            "<*>;)",
            "Ljava/util/concurrent/ConcurrentHashMap$TreeNode",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 1882
    .local p0, "this":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    .local p3, "kc":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
    if-eqz p2, :cond_1

    .line 1883
    move-object v1, p0

    .line 1886
    .local v1, "p":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    :cond_0
    iget-object v4, v1, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->left:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;

    .local v4, "pl":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    iget-object v5, v1, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->right:Ljava/util/concurrent/ConcurrentHashMap$TreeNode;

    .line 1887
    .local v5, "pr":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    iget v2, v1, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->hash:I

    .local v2, "ph":I
    if-le v2, p1, :cond_3

    .line 1888
    move-object v1, v4

    .line 1906
    :goto_0
    if-nez v1, :cond_0

    .line 1908
    .end local v1    # "p":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    .end local v2    # "ph":I
    .end local v4    # "pl":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    .end local v5    # "pr":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    :cond_1
    const/4 v6, 0x0

    :cond_2
    :goto_1
    return-object v6

    .line 1889
    .restart local v1    # "p":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    .restart local v2    # "ph":I
    .restart local v4    # "pl":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    .restart local v5    # "pr":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    :cond_3
    if-ge v2, p1, :cond_4

    .line 1890
    move-object v1, v5

    goto :goto_0

    .line 1891
    :cond_4
    iget-object v3, v1, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->key:Ljava/lang/Object;

    .local v3, "pk":Ljava/lang/Object;, "TK;"
    if-eq v3, p2, :cond_5

    if-eqz v3, :cond_6

    invoke-virtual {p2, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-eqz v7, :cond_6

    :cond_5
    move-object v6, v1

    .line 1892
    goto :goto_1

    .line 1893
    :cond_6
    if-nez v4, :cond_7

    if-eqz v5, :cond_1

    .line 1895
    :cond_7
    if-nez p3, :cond_8

    invoke-static {p2}, Ljava/util/concurrent/ConcurrentHashMap;->comparableClassFor(Ljava/lang/Object;)Ljava/lang/Class;

    move-result-object p3

    if-eqz p3, :cond_a

    :cond_8
    invoke-static {p3, p2, v3}, Ljava/util/concurrent/ConcurrentHashMap;->compareComparables(Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/Object;)I

    move-result v0

    .local v0, "dir":I
    if-eqz v0, :cond_a

    .line 1898
    if-gez v0, :cond_9

    move-object v1, v4

    :goto_2
    goto :goto_0

    :cond_9
    move-object v1, v5

    goto :goto_2

    .line 1899
    .end local v0    # "dir":I
    :cond_a
    if-nez v4, :cond_b

    .line 1900
    move-object v1, v5

    goto :goto_0

    .line 1901
    :cond_b
    if-eqz v5, :cond_c

    invoke-virtual {v5, p1, p2, p3}, Ljava/util/concurrent/ConcurrentHashMap$TreeNode;->findTreeNode(ILjava/lang/Object;Ljava/lang/Class;)Ljava/util/concurrent/ConcurrentHashMap$TreeNode;

    move-result-object v6

    .local v6, "q":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    if-nez v6, :cond_2

    .line 1903
    .end local v6    # "q":Ljava/util/concurrent/ConcurrentHashMap$TreeNode;, "Ljava/util/concurrent/ConcurrentHashMap$TreeNode<TK;TV;>;"
    :cond_c
    move-object v1, v4

    goto :goto_0
.end method


text:
<!doctype html>

    <title>Code coverage report for Login.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="prettify.css" />
    <link rel="stylesheet" href="base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      All files Login.js

        100%
        Statements
        9/9

        100%
        Branches
        0/0

        100%
        Functions
        5/5

        100%
        Lines
        9/9

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

3x

3x

14x

1x

1x

1x

1x

3x

3x

import React from 'react';

const localStyles = {
  wrapper: {
    backfaceVisibility: 'hidden',
    position: 'absolute',
    top: 0,
    left: 0,
    zIndex: 2,
    transform: 'rotateY(0deg)',
    width: '100%',
  },
  inputWrapper: {
    display: 'flex',
    flexFlow: 'row wrap',
    justifyContent: 'center',
    alignItems: 'center',
  },
  buttonsWrapper: {
    display: 'flex',
    flexFlow: 'row wrap',
    justifyContent: 'center',
    alignItems: 'center',
  },
  input: {
    width: 344,
    height: 40,
    margin: '15px 0',
  },
  recoverPasswordWrapper: {
    width: '100%',
    display: 'flex',
    flexFlow: 'row wrap',
    justifyContent: 'center',
    alignItems: 'center',
  },
  recoverPassword: {
    textAlign: 'center',
    cursor: 'pointer',
    margin: '20px 0',
    padding: 15,
  },
  button: {
    margin: '0 15px',
    padding: 15,
  },
};

const Login = ({
    handleShowSignup,
    handleShowRecover,
    styles,
    handleLogin,
    handleChange,
    username,
    password,
  }) => (
    <section id="login-form" style={Object.assign({}, localStyles.wrapper, styles.wrapper)}>
      <div id="fields" style={Object.assign({}, localStyles.inputWrapper, styles.inputWrapper)}>
        <input
          style={Object.assign({}, localStyles.input, styles.input)}
          type="text"
          id="username"
          name="username"
          placeholder="Username"
          onChange={e => handleChange(e.target.name, e.target.value)}
          value={username}
        />
        <input
          style={Object.assign({}, localStyles.input, styles.input)}
          type="password"
          id="password"
          name="password"
          placeholder="Password"
          onChange={e => handleChange(e.target.name, e.target.value)}
          value={password}
        />
      </div>
      <div style={Object.assign({}, localStyles.buttonsWrapper, styles.buttonsWrapper)}>
        <div
          style={Object.assign(
            {},
            localStyles.recoverPasswordWrapper,
            styles.recoverPasswordWrapper)}
        >
          <button
            id="recorver-password"
            style={Object.assign({}, localStyles.recoverPassword, styles.recoverPasswordButton)}
            onClick={() => { handleShowRecover('isRecoveringPassword', true); }}
          >Recover Password</button>
        </div>
        <button
          id="signup-button"
          style={Object.assign({}, localStyles.button, styles.button)}
          onClick={() => { handleShowSignup('isLogin', false); }}
        >Signup</button>
        <input
          id="submit-login"
          name="submit-login"
          type="submit"
          value="Login"
          style={Object.assign({}, localStyles.button, styles.button)}
          onClick={handleLogin}
        />
      </div>
    </section>
);

Login.propTypes = {
  handleShowSignup: React.PropTypes.func.isRequired,
  handleShowRecover: React.PropTypes.func.isRequired,
  handleLogin: React.PropTypes.func.isRequired,
  handleChange: React.PropTypes.func.isRequired,
  username: React.PropTypes.string.isRequired,
  password: React.PropTypes.string.isRequired,
  styles: React.PropTypes.shape({
    wrapper: React.PropTypes.object,
    inputWrapper: React.PropTypes.object,
    buttonsWrapper: React.PropTypes.object,
    input: React.PropTypes.object,
    recoverPasswordWrapper: React.PropTypes.object,
    recoverPasswordButton: React.PropTypes.object,
    button: React.PropTypes.object,
  }),
};

Login.defaultProps = {
  styles: {},
};

export default Login;

  Code coverage
  generated by istanbul at Mon Feb 13 2017 19:02:28 GMT-0800 (PST)


text:
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>RelationshipCriteria__c</fullName>
    <deprecated>false</deprecated>
    <externalId>false</externalId>
    <inlineHelpText>SOQL WHERE clause applied when querying Child Object records, e.g. Amount > 200</inlineHelpText>
    <label>Relationship Criteria</label>
    <length>255</length>
    <required>false</required>
    <trackTrending>false</trackTrending>
    <type>Text</type>
    <unique>false</unique>
</CustomField>


text:
layout: post
date: 2016-08-12
title: "Ivy & Aster Dusk to Dawn Sleeveless Court Train Aline/Princess"
category: Ivy & Aster
tags: [Ivy & Aster ,Ivy & Aster,Aline/Princess ,Halter,Court Train,Sleeveless]
---
### Ivy & Aster Dusk to Dawn
Just **$319.99**
###   Sleeveless Court Train Aline/Princess

BRANDS	Ivy & Aster

Silhouette	Aline/Princess

Neckline	Halter

Hemline/Train	Court Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/ivy-aster-/34813-ivy-aster-dusk-to-dawn.html](https://www.readybrides.com/en/ivy-aster-/34813-ivy-aster-dusk-to-dawn.html)


text:
Reports integer division where the
result is either directly or indirectly used as a floating point number.
Such division is often an error, and may result in unexpected results
due to the truncation that happens in integer division.

Example:

  float x = 3.0F + 3/5;


text:
[Grunt homepage](https://github.com/gruntjs/grunt) | [Documentation table of contents](toc.md)

# Grunt exit codes

* `1` - Generic error
* `2` - Config file not found
* `3` - Task failure
* `10` - [UglifyJS](https://github.com/mishoo/UglifyJS) error
* `11` - Banner generation error
* `20` - Init error
* `90-99` - [Nodeunit](https://github.com/caolan/nodeunit) / [QUnit](http://docs.jquery.com/QUnit) error

## Nodeunit / QUnit specific

* `90` - Non assertion-specific error, like a timeout or JavaScript error.
* `91-99` - 91 = 1 assertion failed, 95 = 5 assertions failed, 99 = 9 or more assertions failed (you get the idea).


text:
// A factory method defining global application service variables
function Globals($document, Workgroup) {
  'use strict';
  var _this = this;

  _this.forceGraph = [];
  _this.statChart = [];
  _this.data = {};
  _this.colorScale = d3.scale.ordinal();

  // Variable to hold the ID of the city's group when selected
  _this.statsGroupSelected = {};

  // Variable to hold the group nationalities aggregated via "setGroupNationalities"
  // Best be moved to a convenient object
  // Format: array of objects: {name: "nationality name", value: 0}
  _this.groupNationalities = [];

  // Variable to hold the group languages aggregated via "setGroupLanguages"
  // Best be moved to a convenient object
  // Format: array of objects: {name: "language name", value: 0}
  _this.groupLanguages = [];

  // Data lookups for use in views that require the scope
  // plus an additional citiesIndex lookup
  _this.dataLookup = {
    citiesIndex: {}, // CitisIndex used for retrieving city by ID
    cities: [], // Cities array from Globals.data
    population: {}, // Population object from Globals.data
    languagesPerLocation: {}, // languagesPerLocation array from Globals.data
    naitonalitiesPerLocation: {} // nationalitiesPerLocation array from Globals.data
  };

  _this.graphingTools = {
    // Retrieve the width of the 'forceGraph' div
    forceWidth: function() {
      // Using the $document service to retrieve width of 'forceGraph'
      // See https://docs.angularjs.org/api/ng/service/$document
      // On page load this is equal to the window size...
      var width = $document[0].getElementById('forceGraph').clientWidth;
      // No larger than 900
      if (width > 900) return 900;
      else return width;
    },
    // Retrieve the width of the 'statsChart' div
    chartWidth: function() {
      // considering 40px padding on statsElement left & right
      //var width = $document[0].getElementById('stats').clientWidth - 40 - $document[0].getElementById('statsDetails').clientWidth;
      var width = $document[0].getElementById('statsChart').clientWidth;
      return width;
    },
    // to use for colorScale domain. would need to be called everytime groupsActive change
    colorScaleDomain: function() {
      var domain = [];
      for (var i = 0, len = Workgroup.groupsActive.groups.length; i < len; i++) {
        domain.push(Workgroup.groupsActive.groups[i].id);
      }
      return domain;
    }
  };

  // Callback to render the chart upon model changes
  _this.renderChart = function() {
    if (Workgroup.groupsActive.groups.length > 0) {
      // Compute data for the chart

      var chartData = [];
      /* We want the data in this format (where a, b, c are group IDs):
        [ {name: 'educated', value: [{"a":100}, {"b":150}, {"c":200}]},
          {name: 'uneducated', value: [{"a":200}, {"b":250}, {"c":300}]} ]
      */

      // for each education level
      for (var i = 0, len = _this.data.educationLevels.length; i < len; i++) {
        var eduName = _this.data.educationLevels[i];
        var eduValue = [];
        // for each active group
        for (var j = 0, len2 = Workgroup.groupsActive.groups.length; j < len2; j++) {
          var groupTotal = 0;
          // for each entity in active group
          for (var k = 0, len3 = Workgroup.groupsActive.groups[j].entities.length; k < len3; k++) {
            // add to group total
            groupTotal += _this.data.education[Workgroup.groupsActive.groups[j].entities[k].id][eduName];
          }
          // Push group result { groupID : group total } to chartData's value array (eduValue)
          var groupResult = {};
          groupResult[Workgroup.groupsActive.groups[j].id] = groupTotal;
          eduValue.push(groupResult);
        }
        // push into chartData the final education level's results
        chartData.push({name: eduName, value: eduValue});
      }
      // Render the chart with the new data (will replace previous chart)
      BarChart.render(chartData, _this.statChart);
    } else {
      // Run the init code to clear graph and display only the x/y axes
      BarChart.init(_this.statChart);
    }
  };

  // When a node is clicked we need the group languages and nationalities to be computed dynamically
  // to reflect any changes in node grouping/adding/removal etc.
  _this.statsGroupClicked = function(id) {
    _this.statsGroupSelected = Workgroup.groupsActive.find(id);
    _this.setGroupLanguages();
    _this.setGroupNationalities();
    console.log(_this.statsGroupSelected);
  };

  _this.setGroupLanguages = function() {
    var groupLanguages = [];

    if (_this.statsGroupSelected === null) return false;

    var group = Workgroup.groupsActive.find(_this.statsGroupSelected.id);

    if (group === null) return false;

    for (var i = 0, len = group.entities.length; i < len; i += 1) {
      var entity = group.entities[i];
      var entityLanguages = _this.dataLookup.languagesPerLocation[entity.id];

      for (var j = 0, len2 = entityLanguages.length; j < len2; j += 1) {
        var language = entityLanguages[j];
        var index = arrayObjectIndexOf(groupLanguages, 'name', language.name);

        if (index !== -1) {
          var inc = groupLanguages[index].value + language.value;
          groupLanguages[index].value = inc;
        } else {
          groupLanguages.push({name:language.name, value: language.value});
        }
      }
    }
    _this.groupLanguages = groupLanguages;
  };

  _this.setGroupNationalities = function() {
    var groupNationalities = [];

    if (_this.statsGroupSelected === null) return false;

    var group = Workgroup.groupsActive.find(_this.statsGroupSelected.id);

    if (group === null) return false;

    for (var i = 0, len = group.entities.length; i < len; i += 1) {
      var entity = group.entities[i];
      var entityNationalities = _this.dataLookup.nationalitiesPerLocation[entity.id];

      for (var j = 0, len2 = entityNationalities.length; j < len2; j += 1) {
        var nationality = entityNationalities[j];
        var index = arrayObjectIndexOf(groupNationalities, 'name', nationality.name);

        if (index !== -1) {
          var inc = groupNationalities[index].value + nationality.value;
          groupNationalities[index].value = inc;
        } else {
          groupNationalities.push({name:nationality.name, value: nationality.value});
        }
      }
    }
    _this.groupNationalities = groupNationalities;
  };
}

Globals.$inject = ['$document', 'Workgroup'];
angular.module('myapp').service('Globals', Globals);


text:
import moment from 'moment';
import { expect } from 'chai';

import toISODateString from '../../src/utils/toISODateString';
import { ISO_FORMAT } from '../../src/constants';

describe('toISODateString', () => {
  it('returns null for falsy argument', () => {
    expect(toISODateString()).to.equal(null);
  });

  it('converts moment object to localized date string', () => {
    const testDate = moment('1991-07-13');
    const dateString = toISODateString(testDate);
    expect(dateString).to.equal('1991-07-13');
  });

  it('matches moment format behavior', () => {
    const testDate = moment('1991-07-13');
    const dateString = toISODateString(testDate);
    expect(dateString).to.equal(testDate.format(ISO_FORMAT));
  });

  it('converts iso date string to ISO date string', () => {
    const testDate = moment('1991-07-13');
    const dateString = toISODateString(testDate.format(ISO_FORMAT));
    expect(dateString).to.equal('1991-07-13');
  });

  it('convers localized date strings to ISO date string', () => {
    const testDate = moment('1991-07-13');
    const dateString = toISODateString(testDate.format('L'));
    expect(dateString).to.equal('1991-07-13');
  });

  it('converts custom format date strings with format passed in', () => {
    const testDate = moment('1991-07-13');
    const dateString = toISODateString(testDate.format('YYYY---DD/MM'), 'YYYY---DD/MM');
    expect(dateString).to.equal('1991-07-13');
  });
});


text:
package com.dangdang.ddframe.job.lite.config;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses(LiteJobConfigurationTest.class)
public final class AllConfigTests {
}


text:
<?PHP

/* page support
*  version 0.1
*  developed by Matt Howard
*  creates virtual directory and such
*/

class url{

	var $fullUrl,$pageId,$error404,$pageTitle,$privatePage;

	//initialize
	public function init(){
	global $mySQLLink,$domain;

	//full url
	$this->fullUrl = $domain.$_SERVER['REQUEST_URI'];

	//everything after ".org"
	$url = $_SERVER['REQUEST_URI'];

	//bug fix: if only "/o/?sid=blah", add home
	if(substr($url,0,4)=="/o/?")
	$url = "/o/home?".substr($url,4);

	$explode = explode("/",$url);

	$error404 = false;

	$parentId = 0;

	if($explode[sizeof($explode)-1]=="")
	unset($explode[sizeof($explode)-1]);

	$explode[sizeof($explode)-1] = explode("?",$explode[sizeof($explode)-1]);

	$explode[sizeof($explode)-1] = $explode[sizeof($explode)-1][0];

	for($i=2;$i<sizeOf($explode);$i++){

		$query = mysql_query("SELECT * FROM `pages` WHERE `deleted` = '0' AND `parentId` = '".$parentId."' AND `title` LIKE '".mysql_real_escape_string(str_replace("_"," ",$explode[$i]),$mySQLLink)."'",$GLOBALS["mySQLLink"]) or die(mysql_error());

		$row = mysql_fetch_array($query);

		$this->error404 = $row ? false : true;

		$parentId = $row["id"];
		$this->title = $row["title"];
		}

	if(sizeOf($explode)==2||sizeOf($explode)==1){
		$query = mysql_query("SELECT * FROM `pages` WHERE `deleted` = '0' AND `title` LIKE 'home'",$GLOBALS["mySQLLink"]) or die(mysql_error());

		$row = mysql_fetch_array($query);

		$parentId = $row["id"];
		$this->title = $row["title"];
		}
	//redirect
	if(strlen($row["redirect"])>0){
		header("location:".$row["redirect"]);
		exit;
		}

	$this->pageId = $parentId;

	$this->privatePage = $row["private"]?true:false;
	}

	//return breadcrumbs for page
	public function breadCrumbs($page = -1){
		if($page = -1)
			$page = $this->pageId;
		$breadCrumbs = "Home";
		$index = $page;
		$titles = $redirects = array();
		//get all pages parent of starting page
		while($index != 0){
			$query = mysql_query("SELECT `title`, `parentId`, `redirect` FROM `pages` WHERE `id` = $index") or die(mysq_error());
			$row = mysql_fetch_array($query);
			$titles[] = $row["title"];
			//check if redirect is false page (container)
			$redirects[] = ($row["redirect"]=="javascript:void(0);")?true:false;
			$index = $row["parentId"];
		}
		$url = "";
		//reassemble $titles into the breadcrumbs
		for($i = sizeof($titles)-1;$i >= 0 && sizeof($titles) != 0;$i--){
			$url .= "/".str_replace(" ","_",$titles[$i]);
			$breadCrumbs .= " > ".($redirects[$i]?"":"").$titles[$i].($redirects[$i]?"":"");
		}
		return $breadCrumbs;
	}
}

?>


text:
package io.quarkus.micrometer.deployment.binder;

import static io.restassured.RestAssured.when;

import java.util.concurrent.CompletionStage;

import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Application;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.micrometer.core.instrument.MeterRegistry;
import io.quarkus.micrometer.test.ServletEndpoint;
import io.quarkus.micrometer.test.Util;
import io.quarkus.micrometer.test.VertxWebEndpoint;
import io.quarkus.test.QuarkusUnitTest;
import io.restassured.RestAssured;

public class UriTagWithHttpApplicationRootTest {
    @RegisterExtension
    static final QuarkusUnitTest config = new QuarkusUnitTest()
            .withConfigurationResource("test-logging.properties")
            .overrideConfigKey("quarkus.http.root-path", "/foo")
            .overrideConfigKey("quarkus.micrometer.binder-enabled-default", "false")
            .overrideConfigKey("quarkus.micrometer.binder.http-client.enabled", "true")
            .overrideConfigKey("quarkus.micrometer.binder.http-server.enabled", "true")
            .overrideConfigKey("quarkus.micrometer.binder.vertx.enabled", "true")
            .overrideConfigKey("pingpong/mp-rest/url", "${test.url}")
            .withApplicationRoot((jar) -> jar
                    .addClasses(Util.class,
                            PingPongResource.class,
                            PingPongResource.PingPongRestClient.class,
                            ServletEndpoint.class,
                            VertxWebEndpoint.class,
                            BarApp.class));

    @Inject
    MeterRegistry registry;

    @Test
    public void testRequestUris() throws Exception {
        RestAssured.basePath = "/";

        // If you invoke requests, http server and client meters should be registered
        // Leading context root (/foo) should be stripped from resulting _server_ tag
        // Application path (/bar) only impacts REST endpoints

        when().get("/foo/vertx/item/123").then().statusCode(200);
        when().get("/foo/servlet/12345").then().statusCode(200);

        // Server -> Rest client -> Server (templated)
        when().get("/foo/bar/ping/one").then().statusCode(200);
        when().get("/foo/bar/ping/two").then().statusCode(200);
        when().get("/foo/bar/ping/three").then().statusCode(200);
        when().get("/foo/bar/async-ping/one").then().statusCode(200);
        when().get("/foo/bar/async-ping/two").then().statusCode(200);
        when().get("/foo/bar/async-ping/three").then().statusCode(200);

        Util.waitForMeters(registry.find("http.server.requests").timers(), 5);
        Util.waitForMeters(registry.find("http.client.requests").timers(), 1);

        System.out.println("Server paths\n" + Util.listMeters(registry, "http.server.requests"));
        System.out.println("Client paths\n" + Util.listMeters(registry, "http.client.requests"));

        // Application Path does not apply to non-rest endpoints: /vertx/item/{id}, /servlet
        Assertions.assertEquals(1, registry.find("http.server.requests").tag("uri", "/vertx/item/{id}").timers().size(),
                Util.foundServerRequests(registry,
                        "Vert.x Web template path (/vertx/item/:id) should be detected/translated to /vertx/item/{id}."));
        Assertions.assertEquals(1, registry.find("http.server.requests").tag("uri", "/servlet").timers().size(),
                Util.foundServerRequests(registry, "Servlet path (/servlet) should be used for servlet"));

        // URIs for server should include Application Path: /bar/ping/{message}, /bar/async-ping/{message}
        // URIs for inbound rest client request should include Application Path: /bar/pong/{message}
        Assertions.assertEquals(1, registry.find("http.server.requests").tag("uri", "/bar/ping/{message}").timers().size(),
                Util.foundServerRequests(registry, "/bar/ping/{message} should be returned by JAX-RS"));
        Assertions.assertEquals(1,
                registry.find("http.server.requests").tag("uri", "/bar/async-ping/{message}").timers().size(),
                Util.foundServerRequests(registry, "/bar/async-ping/{message} should be returned by JAX-RS."));
        Assertions.assertEquals(1, registry.find("http.server.requests").tag("uri", "/bar/pong/{message}").timers().size(),
                Util.foundServerRequests(registry, "/bar/pong/{message} should be returned by JAX-RS"));

        // URIs For client: /foo/pong/{message}
        Assertions.assertEquals(1, registry.find("http.client.requests").tag("uri", "/bar/pong/{message}").timers().size(),
                Util.foundClientRequests(registry, "/foo/bar/pong/{message} should be returned by Rest client."));
    }

    @ApplicationPath("/bar")
    public static class BarApp extends Application {
    }

    @Path("/")
    @Singleton
    public static class PingPongResource {

        @RegisterRestClient(configKey = "pingpong")
        public interface PingPongRestClient {

            @Path("/bar/pong/{message}")
            @GET
            String pingpong(@PathParam("message") String message);

            @GET
            @Path("/bar/pong/{message}")
            CompletionStage<String> asyncPingPong(@PathParam("message") String message);
        }

        @Inject
        @RestClient
        PingPongRestClient pingRestClient;

        @GET
        @Path("pong/{message}")
        public String pong(@PathParam("message") String message) {
            return message;
        }

        @GET
        @Path("ping/{message}")
        public String ping(@PathParam("message") String message) {
            return pingRestClient.pingpong(message);
        }

        @GET
        @Path("async-ping/{message}")
        public CompletionStage<String> asyncPing(@PathParam("message") String message) {
            return pingRestClient.asyncPingPong(message);
        }
    }
}


text:
var fs = require('fs');
var redis_lib = require('redis');
var pub = redis_lib.createClient();

module.exports = {
    send_privmsg: function(to, message) {
	return pub.publish('out', JSON.stringify({
	    version: 1,
	    type: 'privmsg',
	    data: {
		to: to,
		message: message
	    },
	}));
    },
    load_config: function(name) {
	return JSON.parse(fs.readFileSync(name, 'utf8'));
    },
}


text:
<?php

namespace SensioLabs\Behat\PageObjectExtension\Context;

use SensioLabs\Behat\PageObjectExtension\PageObject\Factory as PageObjectFactory;

interface PageObjectAware
{
    /**
     * @param PageObjectFactory $pageObjectFactory
     */
    public function setPageObjectFactory(PageObjectFactory $pageObjectFactory);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Selfie</string>
    <string name="share">Share</string>
    <string name="send_to">Send to…</string>
    <string name="button_capture">Capture Image</string>
    <string name="button_undo">Undo Sticker</string>
</resources>