text:
$(function() {
	var mapOptions = {
		center : new google.maps.LatLng(34.0522, -118.2428),
		zoom : 11,
		mapTypeId : google.maps.MapTypeId.ROADMAP,

		mapTypeControl : true,
		mapTypeControlOptions : {
			style : google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
			position : google.maps.ControlPosition.RIGHT_BOTTOM
		},
		panControl : true,
		panControlOptions : {
			position : google.maps.ControlPosition.RIGHT_CENTER
		},
		zoomControl : true,
		zoomControlOptions : {
			style : google.maps.ZoomControlStyle.LARGE,
			position : google.maps.ControlPosition.RIGHT_CENTER
		},
		scaleControl : true,
		scaleControlOptions : {
			position : google.maps.ControlPosition.RIGHT_BOTTOM
		},
		streetViewControl : true,
		streetViewControlOptions : {
			position : google.maps.ControlPosition.RIGHT_CENTER
		}
	};
	var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);

	/* URLs for the three APIs */
	API_TEMPLATE_URL = 'http://brain.isi.edu:4000/api/v1/grid/template/';
	API_GRID_URL = 'http://brain.isi.edu:4000/api/v1/grid/data/';

	/* Global variables */
	var drawing_manager;
	var grid_cells = {};
	var cell_id_list = [];
	// To store NE and SW coordinates of each grid cell
	var base_overlay = {};
	// To store the GoogleMaps overlay object for each grid
	var view_overlay = {};
	var base_cell_status = {};
	// To store status of each grid; selected/not-selected : 1/0
	var view_cell_status = {};
	var base_or_view = null;
	var multi_select_set = false;
	var chart_data = [{
		name: 'Base',
		data: []
	}, {
		name: 'View',
		data: []
	}];
	//

	/* OnLoad process */
	assignButtonsToDateFilter();
	$(".various").fancybox({
		fitToView	: false,
		width		: '850px',
		height		: '550px',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none'
	});
	initializeDrawingManager();
	//-----

	/* Event listners */
	google.maps.event.addDomListener(document.getElementById('load-button'), 'click', loadButtonClick);
	google.maps.event.addDomListener(document.getElementById('base-button'), 'click', baseButtonClick);
	google.maps.event.addDomListener(document.getElementById('multi-select-button'), 'click', multiSelectButtonClick);
	google.maps.event.addListener(drawing_manager, 'rectanglecomplete', function(rectangle) {
		multiSelectFrom(rectangle);
		rectangle.setMap(null);
		drawing_manager.setDrawingMode(null);
		multi_select_set = false;
	});
	google.maps.event.addDomListener(document.getElementById('view-button'), 'click', viewButtonClick);
	google.maps.event.addDomListener(document.getElementById('plot-button'), 'click', plotButtonClick);

	/* Grid styling */
	var base_not_selected = {
		strokeColor : "blue",
		strokeOpacity : 0.7,
		strokeWeight : 0.5,
		fillColor : "blue",
		fillOpacity : 0,
	};
	var base_selected = {
		strokeColor : "blue",
		strokeOpacity : 0.7,
		strokeWeight : 0.5,
		fillColor : "blue",
		fillOpacity : 0.25,
	};
	var view_not_selected = {
		strokeColor : "red",
		strokeOpacity : 0.7,
		strokeWeight : 0.5,
		fillColor : "red",
		fillOpacity : 0,
	};
	var view_selected = {
		strokeColor : "red",
		strokeOpacity : 0.7,
		strokeWeight : 0.5,
		fillColor : "red",
		fillOpacity : 0.25,
	};

	/* Function listing */
	function initializeDrawingManager() {
	/* This function initalizes the drawing manager. The Drawing
	* panel is however not shown on map.
	*/
	// Drawing Manager
	drawing_manager = new google.maps.drawing.DrawingManager({
		drawingMode : null, // No initial drawing mode
		drawingControl : false, // Do not display drawing controls
		drawingControlOptions : {
			drawingModes : [google.maps.drawing.OverlayType.RECTANGLE]
		},
	});
	drawing_manager.setMap(map);
}

	function loadButtonClick() {
		$('#load-button').button('loading');
		loadGridForLocation($('#location-list option:selected').val());
	}

	function loadGridForLocation(location_id) {
		/* Load all grid information for currently location from the API
		 * and store them locally.
		 */
		$.getJSON(API_TEMPLATE_URL + '?location_id=' + location_id, function(data) {
			$.each(data.cells, function(i, cell) {
				var id = Number(cell.id);
				cell_id_list.push(id);
				var new_box = {// Load grid coordinates
					sw : cell.box[0],
					ne : cell.box[1]
				};
				grid_cells[id] = new_box;

				base_cell_status[id] = 0;
				// Initialize cell status.
				view_cell_status[id] = 0;
			});
			console.log('Loaded!');
			//alert("You're ready to go!");

			// TODO better way of ajax call
			plotBaseGrid();
			plotViewGrid();

			$('#load-button').button('reset');
		});
	}

	function baseButtonClick() {
		if (base_or_view == null) {
			$('#base-button').button('loading');
			setBaseGrid();
			base_or_view = 'base';
			$('#base-button').button('reset');
			$('#base-button').button('toggle');
		} else if (base_or_view == 'base') {
			removeBaseGrid();
			base_or_view = null;
			$('#base-button').button('toggle');
		} else if (base_or_view == 'view') {
			removeViewGrid();
			$('#view-button').button('toggle');
			$('#base-button').button('loading');
			setBaseGrid();
			base_or_view = 'base';
			$('#base-button').button('reset');
			$('#base-button').button('toggle');
		}
	}

	function viewButtonClick() {
		if (base_or_view == null) {
			$('#view-button').button('loading');
			setViewGrid();
			base_or_view = 'view';
			$('#view-button').button('reset');
			$('#view-button').button('toggle');
		} else if (base_or_view == 'view') {
			removeViewGrid();
			base_or_view = null;
			$('#view-button').button('toggle');
		} else if (base_or_view == 'base') {
			removeBaseGrid();
			$('#base-button').button('toggle');
			$('#view-button').button('loading');
			setViewGrid();
			base_or_view = 'view';
			$('#view-button').button('reset');
			$('#view-button').button('toggle');
		}
	}

	function plotBaseGrid() {
		/* Plot all base cells for current grid, and render selected cells
		 * different from unselected.
		 */
		$.each(grid_cells, function(id, box) {
			base_overlay[id] = new google.maps.Rectangle();
			var ne = new google.maps.LatLng(box.ne[0], box.ne[1]);
			var sw = new google.maps.LatLng(box.sw[0], box.sw[1]);
			var cell_bounds = new google.maps.LatLngBounds(sw, ne);
			if (base_cell_status[id] == 0) {
				base_overlay[id].setOptions(base_not_selected);
			} else {
				base_overlay[id].setOptions(base_selected);
			}
			base_overlay[id].setBounds(cell_bounds);
			//base_overlay[id].setMap(map);
			google.maps.event.addListener(base_overlay[id], 'click', function() {
				clickBaseCell(id);
			});
		});
	}

	function setBaseGrid() {
		/* Set current base grid on map.
		 */
		$.each(cell_id_list, function(i, id) {
			base_overlay[id].setMap(map);
		});
	}

	function removeBaseGrid() {
		/* Remove current base grid from map.
		 */
		$.each(cell_id_list, function(i, id) {
			base_overlay[id].setMap(null);
		});
	}

	function clickBaseCell(id) {
		if (base_cell_status[id] == 0) {
			base_cell_status[id] = 1;
			base_overlay[id].setOptions(base_selected);
		} else {
			base_cell_status[id] = 0;
			base_overlay[id].setOptions(base_not_selected);
		}
	}

	function plotViewGrid() {
		$.each(grid_cells, function(id, box) {
			view_overlay[id] = new google.maps.Rectangle();
			var ne = new google.maps.LatLng(box.ne[0], box.ne[1]);
			var sw = new google.maps.LatLng(box.sw[0], box.sw[1]);
			var cell_bounds = new google.maps.LatLngBounds(sw, ne);
			if (view_cell_status[id] == 0) {
				view_overlay[id].setOptions(view_not_selected);
			} else {
				view_overlay[id].setOptions(view_selected);
			}
			view_overlay[id].setBounds(cell_bounds);
			//view_overlay[id].setMap(map);
			google.maps.event.addListener(view_overlay[id], 'click', function() {
				clickViewCell(id);
			});
		});
	}

	function setViewGrid() {
		$.each(cell_id_list, function(i, id) {
			view_overlay[id].setMap(map);
		});
	}

	function removeViewGrid() {
		$.each(cell_id_list, function(i, id) {
			view_overlay[id].setMap(null);
		});
	}

	function clickViewCell(id) {
		if (view_cell_status[id] == 0) {
			view_cell_status[id] = 1;
			view_overlay[id].setOptions(view_selected);
		} else {
			view_cell_status[id] = 0;
			view_overlay[id].setOptions(view_not_selected);
		}
	}

	function multiSelectButtonClick() {
		if(!multi_select_set) {
			drawing_manager.setDrawingMode(google.maps.drawing.OverlayType.RECTANGLE);
			multi_select_set = true;
		}
		else {
			drawing_manager.setDrawingMode(null);
			multi_select_set = false;
		}
	}

	function multiSelectFrom(rectangle) {
		if(base_or_view != null) {
			$.each(grid_cells, function(id, box) {
				var ne = new google.maps.LatLng(box.ne[0], box.ne[1]);
				var sw = new google.maps.LatLng(box.sw[0], box.sw[1]);

				var box_bound = new google.maps.LatLngBounds(sw, ne);

				if(box_bound.intersects(rectangle.getBounds())) {
					if(base_or_view == 'base') {
						clickBaseCell(id);
					}
					else if(base_or_view = 'view') {
						clickViewCell(id);
					}
				}
			});
		}
		//clear
	}

	// Plot window
	function assignButtonsToDateFilter() {
		$("#base-from-date").datepicker({
			dateFormat : "d M, y",
			minDate : new Date(2012, 11 - 1, 1),
			maxDate : new Date(2012, 11 - 1, 7),
			/*
			onSelect : function(dateText, inst) {
				var from_date = new Date(dateText);
				for(var i=0; i<=6; i++) {
					$('#base_day_'+i).attr('data-toggle', 'button');
					$('#base_day_'+i).append(from_date.getDate());
					from_date.setDate(from_date.getDate() + 1)
				}
			}
			*/
		});

		$("#view-from-date").datepicker({
			dateFormat : "d M, y",
			minDate : new Date(2012, 11 - 1, 1),
			maxDate : new Date(2012, 11 - 1, 7),
			/*
			onSelect : function(dateText, inst) {
				var from_date = new Date(dateText);
				for(var i=0; i<=6; i++) {
					$('#view_day_'+i).attr('data-toggle', 'button');
					$('#view_day_'+i).append(from_date.getDate());
					from_date.setDate(from_date.getDate() + 1)
				}
			}
			*/
		});
	}

	function plotButtonClick() {
		$('#calc-button').button('loading');
		$('#calc-button').button('...');
        getBaseData();
		//getViewData();	//TODO better way of ajax execution

		/*
		setTimeout(function() {
			console.log($.toJSON(chart_data));
			renderChart(chart_data);
			$('#calc-button').button('reset');
		}, 2000);
		*/
	}

	/*
	function plotButtonClick() {
		//console.log($.toJSON(chart_data));
		renderChart(chart_data);
	}
	*/

	function getBaseData() {
		var query_string = "";
		query_string = query_string + '?' + getDateQuery('base');
		query_string = query_string + '&ids=' + getCellQuery(base_cell_status);

		console.log(API_GRID_URL + query_string);
		$.getJSON(API_GRID_URL + query_string, function(data) {
			var vector = averageAllCells(data);
			vector = splitAndAvgByDay(vector);
			if($('#normalize option:selected').val() == '0') {
				//console.log('no norm');
			}
			else if($('#normalize option:selected').val() == '1') {
				vector = maxNormalize(vector);
				//console.log('max norm');
			}
			else if($('#normalize option:selected').val() == '2') {
				vector = areaNormalize(vector);
				//console.log('area norm');
			}

			chart_data[0].data = loseKeys(vector);

			// TODO Better way for ajax execution
			getViewData();
		});
	}

	function getViewData() {
		var query_string = "";
		query_string = query_string + '?' + getDateQuery('view');
		query_string = query_string + '&ids=' + getCellQuery(view_cell_status);

		console.log(API_GRID_URL + query_string);
		$.getJSON(API_GRID_URL + query_string, function(data) {
			var vector = averageAllCells(data);
			vector = splitAndAvgByDay(vector);
			if($('#normalize option:selected').val() == '0') {
				//console.log('no norm');
			}
			else if($('#normalize option:selected').val() == '1') {
				vector = maxNormalize(vector);
				//console.log('max norm');
			}
			else if($('#normalize option:selected').val() == '2') {
				vector = areaNormalize(vector);
				//console.log('area norm');
			}

			chart_data[1].data = loseKeys(vector);

			// TODO Better way for ajax execution
			//console.log($.toJSON(chart_data));
			renderChart(chart_data);
			$('#calc-button').button('reset');
			//
		});
	}

	function renderChart(series_data) {
		chart = new Highcharts.Chart({
            chart: {renderTo: "chart-container", type: 'area'},
            title: {text: ''},
            xAxis: {title: {text: '24 hours of a day'}, categories: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]},
            yAxis: {title: {text: 'Tweet count (normalized to 1)'}},
            series: series_data
		});
	}

	function getDateQuery(which) {
		var date_query = "";
		if(which == 'base') {
			var from_date = new Date($("#base-from-date").val());
		}
		else {
			var from_date = new Date($("#view-from-date").val());
		}
		var to_date = new Date(from_date);
		to_date.setDate(to_date.getDate() + Number($('#base-date-range').val()));
		date_query += "ts_start=" + from_date.getFullYear() + "-" + (from_date.getMonth() + 1) + "-" + from_date.getDate() + "T00:00:00";
		date_query += "&ts_end=" + to_date.getFullYear() + "-" + (to_date.getMonth() + 1) + "-" + to_date.getDate() + "T23:59:59";
		return date_query;
	}

	function getCellQuery(arr) {
		var out = [];
		$.each(arr, function(id, val) {
			if (val == 1) {
				out.push(Number(id));
			}
		});
		return $.toJSON(out);
	}

	// MATH tools
	function averageAllCells(data) {
		if(data.length != 1) {
			for(var i=0; i<data[0].data.length; i++) {
				for(var j=1; j<data.length; j++) {
					data[0].data[i] += data[j].data[i];
				}
			}
		}
		var count = data.length;
		for(var i=0; i<data[0].data.length; i++) {
			data[0].data[i] /= count;
			data[0].data[i] = Number(data[0].data[i].toFixed(3));
		}
		return data[0].data;
	}

	function splitAndAvgByDay(vector) {
		/* Takes a vector of size n, n is a multiple of 24, and converts
		 * to a single vector of length 24 with values averages for each
		 * 24 length vector in 'vector'.
		 */
		if (vector.length == 24) {
			return vector;
		} else {
			var out_vector = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
			var i;

			for ( i = 0; i < vector.length; i++) {
				out_vector[i % 24] = out_vector[i % 24] + vector[i];
			}
			var count = vector.length / 24;
			for ( i = 0; i < out_vector.length; i++) {
				out_vector[i] /= count;
				out_vector[i] = Number(out_vector[i].toFixed(2));
			}
			return out_vector;
		}
	}

	function maxNormalize(vector) {
		var max_num = vector[0];
		for (var i = 1; i < vector.length; i++) {
			if (vector[i] > max_num) {
				max_num = vector[i];
			}
		}
		for ( i = 0; i < vector.length; i++) {
			vector[i] /= max_num;
			vector[i] = Number(vector[i].toFixed(3));
		}
		return vector;
	}

	function areaNormalize(vector) {
		var area = 0;
		for (var i = 0; i < vector.length; i++) {
			area += vector[i];
		}
		for (i = 0; i < vector.length; i++) {
			vector[i] /= area;
			vector[i] = Number(vector[i].toFixed(3));
		}
		return vector;
	}

	function loseKeys(vector) {
		var new_vector = [];
		for (var i = 0; i < vector.length; i++) {
			new_vector.push(vector[i]);
		}
		return new_vector;
	}

});


text:
package java.util;

import java.util.function.BinaryOperator;
import java.util.function.DoubleBinaryOperator;
import java.util.function.IntBinaryOperator;
import java.util.function.IntFunction;
import java.util.function.IntToDoubleFunction;
import java.util.function.IntToLongFunction;
import java.util.function.IntUnaryOperator;
import java.util.function.LongBinaryOperator;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;
import javaemul.internal.annotations.KtNative;
import org.jspecify.nullness.NullMarked;
import org.jspecify.nullness.Nullable;

/**
 * Utility methods related to native arrays. See <a
 * href="https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html">the official Java API
 * doc</a> for details.
 */
@KtNative("java.util.Arrays") // Reimplemented in Kotlin, not transpiled.
@NullMarked
public class Arrays {

  public static native <T extends @Nullable Object> List<T> asList(T... array);

  public static native int binarySearch(byte[] sortedArray, int fromIndex, int toIndex, byte key);

  public static native int binarySearch(byte[] sortedArray, byte key);

  public static native int binarySearch(char[] sortedArray, int fromIndex, int toIndex, char key);

  public static native int binarySearch(char[] sortedArray, char key);

  public static native int binarySearch(
      double[] sortedArray, int fromIndex, int toIndex, double key);

  public static native int binarySearch(double[] sortedArray, double key);

  public static native int binarySearch(float[] sortedArray, int fromIndex, int toIndex, float key);

  public static native int binarySearch(float[] sortedArray, float key);

  public static native int binarySearch(int[] sortedArray, int fromIndex, int toIndex, int key);

  public static native int binarySearch(int[] sortedArray, int key);

  public static native int binarySearch(long[] sortedArray, int fromIndex, int toIndex, long key);

  public static native int binarySearch(long[] sortedArray, long key);

  public static native int binarySearch(
      @Nullable Object[] sortedArray, int fromIndex, int toIndex, @Nullable Object key);

  public static native int binarySearch(@Nullable Object[] sortedArray, @Nullable Object key);

  public static native int binarySearch(short[] sortedArray, int fromIndex, int toIndex, short key);

  public static native int binarySearch(short[] sortedArray, short key);

  public static native <T extends @Nullable Object> int binarySearch(
      T[] sortedArray,
      int fromIndex,
      int toIndex,
      T key,
      @Nullable Comparator<? super T> comparator);

  public static native <T extends @Nullable Object> int binarySearch(
      T[] sortedArray, T key, @Nullable Comparator<? super T> c);

  public static native boolean[] copyOf(boolean[] original, int newLength);

  public static native byte[] copyOf(byte[] original, int newLength);

  public static native char[] copyOf(char[] original, int newLength);

  public static native double[] copyOf(double[] original, int newLength);

  public static native float[] copyOf(float[] original, int newLength);

  public static native int[] copyOf(int[] original, int newLength);

  public static native long[] copyOf(long[] original, int newLength);

  public static native short[] copyOf(short[] original, int newLength);

  public static native <T> @Nullable T[] copyOf(@Nullable T[] original, int newLength);

  public static native <T, O> @Nullable T[] copyOf(
      @Nullable O[] original, int newLength, Class<?> newType);

  public static native boolean[] copyOfRange(boolean[] original, int from, int to);

  public static native byte[] copyOfRange(byte[] original, int from, int to);

  public static native char[] copyOfRange(char[] original, int from, int to);

  public static native double[] copyOfRange(double[] original, int from, int to);

  public static native float[] copyOfRange(float[] original, int from, int to);

  public static native int[] copyOfRange(int[] original, int from, int to);

  public static native long[] copyOfRange(long[] original, int from, int to);

  public static native short[] copyOfRange(short[] original, int from, int to);

  public static native <T> @Nullable T[] copyOfRange(@Nullable T[] original, int from, int to);

  // newType should be parameterized with T[], but the array parameterization is dropped in
  // transpilation and then doesn't match. Instead, we just rely on the the return type. This only
  // works because native arrays don't store the element type.
  public static native <T, O> @Nullable T[] copyOfRange(
      @Nullable O[] original, int from, int to, Class<?> newType);

  public static native boolean deepEquals(
      @Nullable Object @Nullable [] a1, @Nullable Object @Nullable [] a2);

  public static native int deepHashCode(@Nullable Object @Nullable [] a);

  public static native String deepToString(@Nullable Object @Nullable [] a);

  public static native boolean equals(boolean @Nullable [] array1, boolean @Nullable [] array2);

  public static native boolean equals(byte @Nullable [] array1, byte @Nullable [] array2);

  public static native boolean equals(char @Nullable [] array1, char @Nullable [] array2);

  public static native boolean equals(double @Nullable [] array1, double @Nullable [] array2);

  public static native boolean equals(float @Nullable [] array1, float @Nullable [] array2);

  public static native boolean equals(int @Nullable [] array1, int @Nullable [] array2);

  public static native boolean equals(long @Nullable [] array1, long @Nullable [] array2);

  public static native boolean equals(
      @Nullable Object @Nullable [] array1, @Nullable Object @Nullable [] array2);

  public static native boolean equals(short @Nullable [] array1, short @Nullable [] array2);

  public static native void fill(boolean[] a, boolean val);

  public static native void fill(boolean[] a, int fromIndex, int toIndex, boolean val);

  public static native void fill(byte[] a, byte val);

  public static native void fill(byte[] a, int fromIndex, int toIndex, byte val);

  public static native void fill(char[] a, char val);

  public static native void fill(char[] a, int fromIndex, int toIndex, char val);

  public static native void fill(double[] a, double val);

  public static native void fill(double[] a, int fromIndex, int toIndex, double val);

  public static native void fill(float[] a, float val);

  public static native void fill(float[] a, int fromIndex, int toIndex, float val);

  public static native void fill(int[] a, int val);

  public static native void fill(int[] a, int fromIndex, int toIndex, int val);

  public static native void fill(long[] a, long val);

  public static native void fill(long[] a, int fromIndex, int toIndex, long val);

  public static native void fill(
      @Nullable Object[] a, int fromIndex, int toIndex, @Nullable Object val);

  public static native void fill(@Nullable Object[] a, @Nullable Object val);

  public static native void fill(short[] a, short val);

  public static native void fill(short[] a, int fromIndex, int toIndex, short val);

  public static native int hashCode(boolean @Nullable [] a);

  public static native int hashCode(byte @Nullable [] a);

  public static native int hashCode(char @Nullable [] a);

  public static native int hashCode(double @Nullable [] a);

  public static native int hashCode(float @Nullable [] a);

  public static native int hashCode(int @Nullable [] a);

  public static native int hashCode(long @Nullable [] a);

  public static native int hashCode(@Nullable Object @Nullable [] a);

  public static native int hashCode(short @Nullable [] a);

  public static native void parallelPrefix(double[] array, DoubleBinaryOperator op);

  public static native void parallelPrefix(
      double[] array, int fromIndex, int toIndex, DoubleBinaryOperator op);

  public static native void parallelPrefix(int[] array, IntBinaryOperator op);

  public static native void parallelPrefix(
      int[] array, int fromIndex, int toIndex, IntBinaryOperator op);

  public static native void parallelPrefix(long[] array, LongBinaryOperator op);

  public static native void parallelPrefix(
      long[] array, int fromIndex, int toIndex, LongBinaryOperator op);

  public static native <T extends @Nullable Object> void parallelPrefix(
      T[] array, BinaryOperator<T> op);

  public static native <T extends @Nullable Object> void parallelPrefix(
      T[] array, int fromIndex, int toIndex, BinaryOperator<T> op);

  public static native <T extends @Nullable Object> void setAll(
      T[] array, IntFunction<? extends T> generator);

  public static native void setAll(double[] array, IntToDoubleFunction generator);

  public static native void setAll(int[] array, IntUnaryOperator generator);

  public static native void setAll(long[] array, IntToLongFunction generator);

  public static native <T extends @Nullable Object> void parallelSetAll(
      T[] array, IntFunction<? extends T> generator);

  public static native void parallelSetAll(double[] array, IntToDoubleFunction generator);

  public static native void parallelSetAll(int[] array, IntUnaryOperator generator);

  public static native void parallelSetAll(long[] array, IntToLongFunction generator);

  public static native void sort(byte[] array);

  public static native void sort(byte[] array, int fromIndex, int toIndex);

  public static native void sort(char[] array);

  public static native void sort(char[] array, int fromIndex, int toIndex);

  public static native void sort(double[] array);

  public static native void sort(double[] array, int fromIndex, int toIndex);

  public static native void sort(float[] array);

  public static native void sort(float[] array, int fromIndex, int toIndex);

  public static native void sort(int[] array);

  public static native void sort(int[] array, int fromIndex, int toIndex);

  public static native void sort(long[] array);

  public static native void sort(long[] array, int fromIndex, int toIndex);

  public static native void sort(Object[] array);

  public static native void sort(Object[] array, int fromIndex, int toIndex);

  public static native void sort(short[] array);

  public static native void sort(short[] array, int fromIndex, int toIndex);

  public static native <T extends @Nullable Object> void sort(
      T[] x, @Nullable Comparator<? super T> c);

  public static native <T extends @Nullable Object> void sort(
      T[] x, int fromIndex, int toIndex, @Nullable Comparator<? super T> c);

  public static native void parallelSort(byte[] array);

  public static native void parallelSort(byte[] array, int fromIndex, int toIndex);

  public static native void parallelSort(char[] array);

  public static native void parallelSort(char[] array, int fromIndex, int toIndex);

  public static native void parallelSort(double[] array);

  public static native void parallelSort(double[] array, int fromIndex, int toIndex);

  public static native void parallelSort(float[] array);

  public static native void parallelSort(float[] array, int fromIndex, int toIndex);

  public static native void parallelSort(int[] array);

  public static native void parallelSort(int[] array, int fromIndex, int toIndex);

  public static native void parallelSort(long[] array);

  public static native void parallelSort(long[] array, int fromIndex, int toIndex);

  public static native void parallelSort(short[] array);

  public static native void parallelSort(short[] array, int fromIndex, int toIndex);

  public static native <T extends Comparable<? super T>> void parallelSort(T[] array);

  public static native <T extends @Nullable Object> void parallelSort(
      T[] array, @Nullable Comparator<? super T> c);

  public static native <T extends Comparable<? super T>> void parallelSort(
      T[] array, int fromIndex, int toIndex);

  public static native <T extends @Nullable Object> void parallelSort(
      T[] array, int fromIndex, int toIndex, @Nullable Comparator<? super T> c);

  public static native Spliterator.OfDouble spliterator(double[] array);

  public static native Spliterator.OfDouble spliterator(
      double[] array, int startInclusive, int endExclusive);

  public static native Spliterator.OfInt spliterator(int[] array);

  public static native Spliterator.OfInt spliterator(
      int[] array, int startInclusive, int endExclusive);

  public static native Spliterator.OfLong spliterator(long[] array);

  public static native Spliterator.OfLong spliterator(
      long[] array, int startInclusive, int endExclusive);

  public static native <T extends @Nullable Object> Spliterator<T> spliterator(T[] array);

  public static native <T extends @Nullable Object> Spliterator<T> spliterator(
      T[] array, int startInclusive, int endExclusive);

  public static native DoubleStream stream(double[] array);

  public static native DoubleStream stream(double[] array, int startInclusive, int endExclusive);

  public static native IntStream stream(int[] array);

  public static native IntStream stream(int[] array, int startInclusive, int endExclusive);

  public static native LongStream stream(long[] array);

  public static native LongStream stream(long[] array, int startInclusive, int endExclusive);

  public static native <T extends @Nullable Object> Stream<T> stream(T[] array);

  public static native <T extends @Nullable Object> Stream<T> stream(
      T[] array, int startInclusive, int endExclusive);

  public static native String toString(boolean @Nullable [] a);

  public static native String toString(byte @Nullable [] a);

  public static native String toString(char @Nullable [] a);

  public static native String toString(double @Nullable [] a);

  public static native String toString(float @Nullable [] a);

  public static native String toString(int @Nullable [] a);

  public static native String toString(long @Nullable [] a);

  public static native String toString(@Nullable Object @Nullable [] x);

  public static native String toString(short @Nullable [] a);

  private Arrays() { }
}

redpajama_set_name: RedPajamaGithub


text:
module Tilia
  module DavAcl
    class MockAclNode < Dav::Node
      include IAcl

      attr_accessor :name
      attr_accessor :acl

      def initialize(name, acl = [])
        @name = name
        @acl = acl
      end

      def owner
        nil
      end

      def group
        nil
      end

      def supported_privilege_set
        nil
      end
    end
  end
end


text:
package com.algaworks.brewer.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

import com.algaworks.brewer.security.AppUserDetailsService;

@EnableWebSecurity
@ComponentScan(basePackageClasses = AppUserDetailsService.class)
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

	@Autowired
	private UserDetailsService userDetailsService;

	@Override
	protected void configure(AuthenticationManagerBuilder auth) throws Exception {
		auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
	}

	@Override
	public void configure(WebSecurity web) throws Exception {
		web.ignoring()
		.antMatchers("/layout/**")
		.antMatchers("/image/**");
	}

	@Override
	protected void configure(HttpSecurity http) throws Exception {
		http
			.authorizeRequests()
//				.antMatchers("/cidades/**").hasRole("CADASTRAR_CIDADE")
//				.antMatchers("/usuarios/**").hasRole("CADASTRAR_USUARIO")
				.anyRequest().authenticated()
				.and()
			.formLogin()
				.loginPage("/login")
				.permitAll()
				.and()
			.logout()
				.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
				.and()
			.exceptionHandling()
				.accessDeniedPage("/403")
				.and()
			.sessionManagement()
				.invalidSessionUrl("/login")
				.maximumSessions(1)
				.expiredUrl("/login");
	}

	@Bean
	public PasswordEncoder passwordEncoder() {
		return new BCryptPasswordEncoder();
	}
}


text:
<?php

namespace Tg\OkoaBundle\Response;

use Symfony\Component\HttpFoundation\Response;

/**
 * Dump a variable as a response.
 */
class CsvResponse extends Response
{
    /**
     * Construct using any number of variables which will all be var_dumped as
     * a response.
     */
    public function __construct($data = array(), $filename = 'export.csv')
    {
        $csvData = $this->arrayToCsv($data);

        $contentDisposition = sprintf('attachment; filename="%s"', $filename);

        parent::__construct($csvData, 200, [
            'Content-Type' => 'text/csv',
            'Content-Disposition' => $contentDisposition
        ]);
    }

    /**
     * @param  array $data
     * @return string
     */
    private function arrayToCsv($data)
    {
        $fp = tmpfile();
        foreach ($data as $fields) {
            fputcsv($fp, $fields);
        }
        $info = stream_get_meta_data($fp);
        $csvData = file_get_contents($info['uri']);
        fclose($fp);

        return $csvData;
    }
}


text:
import time
import sched

from expr import *

class RealtimeVM():

    def __init__(self, values):
        self._dispatcher = sched.scheduler(time.time, time.sleep)

        def dispatchProc(callback, timeout):
            self._dispatcher.enter(timeout, 1, callback, ())

        for val in values.values():
            val.setDispatchProc(dispatchProc)
        for val in values.values():
            val(False)

    def run(self):
        self._dispatcher.run()

class SimulationVM():

    def __init__(self, values):
       self._t = 0
       def int_t(dt):
           self._t += dt

       self._dispatcher = sched.scheduler(time.time, inc_t)

       def dispatchProc(callback, timeout):
           self._dispatcher.enter(timeout, 1, callback, ())

       for val in values.values():
           val.setDispatchProc(dispatchProc)
       for val in values.values():
           val(False)

    def run(self):
       self._dispatcher.run()


text:
"""
Base Classes and Infrastructure Supporting Concret Manager Implementations.

"""
import errno
import json
import logging
import os
import platform
from os import (
    curdir,
    getenv,
    listdir,
    makedirs,
    sep,
    walk,
)
from os.path import (
    basename,
    exists,
    isdir,
    join,
    relpath,
)
from shutil import rmtree
from uuid import uuid4

from pulsar import locks
from pulsar.client.job_directory import (
    get_mapped_file,
    RemoteJobDirectory,
)
from pulsar.managers import ManagerInterface

JOB_DIRECTORY_INPUTS = "inputs"
JOB_DIRECTORY_OUTPUTS = "outputs"
JOB_DIRECTORY_WORKING = "working"
JOB_DIRECTORY_METADATA = "metadata"
JOB_DIRECTORY_CONFIGS = "configs"
JOB_DIRECTORY_TOOL_FILES = "tool_files"

DEFAULT_ID_ASSIGNER = "galaxy"

ID_ASSIGNER = {
    # Generate a random id, needed if multiple
    # Galaxy instances submitting to same Pulsar.
    'uuid': lambda galaxy_job_id: uuid4().hex,
    # Pass galaxy id through, default for single
    # Galaxy Pulsar instance.
    'galaxy': lambda galaxy_job_id: galaxy_job_id
}

log = logging.getLogger(__name__)

def get_id_assigner(assign_ids):
    default_id_assigner = ID_ASSIGNER[DEFAULT_ID_ASSIGNER]
    return ID_ASSIGNER.get(assign_ids, default_id_assigner)

class BaseManager(ManagerInterface):

    def __init__(self, name, app, **kwds):
        self.name = name
        self.persistence_directory = getattr(app, 'persistence_directory', None)
        self.lock_manager = locks.LockManager()
        self._directory_maker = DirectoryMaker(kwds.get("job_directory_mode", None))
        staging_directory = kwds.get("staging_directory", app.staging_directory)
        self._setup_staging_directory(staging_directory)
        self.id_assigner = get_id_assigner(kwds.get("assign_ids", None))
        self.maximum_stream_size = kwds.get("maximum_stream_size", -1)
        self.__init_galaxy_system_properties(kwds)
        self.tmp_dir = kwds.get("tmp_dir", None)
        self.debug = str(kwds.get("debug", False)).lower() == "true"
        self.authorizer = app.authorizer
        self.__init_system_properties()
        self.__init_env_vars(**kwds)
        self.dependency_manager = app.dependency_manager
        self.job_metrics = app.job_metrics
        self.object_store = app.object_store

    @property
    def _is_windows(self) -> bool:
        return platform.system().lower() == "windows"

    def clean(self, job_id):
        if self.debug:
            # In debug mode skip cleaning job directories.
            return

        job_directory = self._job_directory(job_id)
        if job_directory.exists():
            try:
                job_directory.delete()
            except Exception:
                pass

    def system_properties(self):
        return self.__system_properties

    def __init_galaxy_system_properties(self, kwds):
        self.galaxy_home = kwds.get('galaxy_home', None)
        self.galaxy_virtual_env = kwds.get('galaxy_virtual_env', None)
        self.galaxy_config_file = kwds.get('galaxy_config_file', None)
        self.galaxy_dataset_files_path = kwds.get('galaxy_dataset_files_path', None)
        self.galaxy_datatypes_config_file = kwds.get('galaxy_datatypes_config_file', None)

    def __init_system_properties(self):
        system_properties = {
            "separator": sep,
        }
        galaxy_home = self._galaxy_home()
        if galaxy_home:
            system_properties["galaxy_home"] = galaxy_home
        galaxy_virtual_env = self._galaxy_virtual_env()
        if galaxy_virtual_env:
            system_properties["galaxy_virtual_env"] = galaxy_virtual_env
        for property in ['galaxy_config_file', 'galaxy_dataset_files_path', 'galaxy_datatypes_config_file']:
            value = getattr(self, property, None)
            if value:
                system_properties[property] = value

        self.__system_properties = system_properties

    def __init_env_vars(self, **kwds):
        env_vars = []
        for key, value in kwds.items():
            if key.lower().startswith("env_"):
                name = key[len("env_"):]
                env_vars.append(dict(name=name, value=value, raw=False))
        self.env_vars = env_vars

    def _galaxy_home(self):
        return self.galaxy_home or getenv('GALAXY_HOME', None)

    def _galaxy_virtual_env(self):
        return self.galaxy_virtual_env or getenv('GALAXY_VIRTUAL_ENV', None)

    def _galaxy_lib(self):
        galaxy_home = self._galaxy_home()
        galaxy_lib = None
        if galaxy_home and str(galaxy_home).lower() != 'none':
            galaxy_lib = join(galaxy_home, 'lib')
        return galaxy_lib

    def _setup_staging_directory(self, staging_directory):
        assert staging_directory is not None
        if not exists(staging_directory):
            self._directory_maker.make(staging_directory, recursive=True)
        assert isdir(staging_directory)
        self.staging_directory = staging_directory

    def _job_directory(self, job_id):
        return JobDirectory(
            self.staging_directory,
            job_id,
            self.lock_manager,
            self._directory_maker,
        )

    job_directory = _job_directory

    def _setup_job_directory(self, job_id):
        job_directory = self._job_directory(job_id)
        job_directory.setup()
        for directory in [JOB_DIRECTORY_INPUTS,
                          JOB_DIRECTORY_WORKING,
                          JOB_DIRECTORY_OUTPUTS,
                          JOB_DIRECTORY_CONFIGS,
                          JOB_DIRECTORY_TOOL_FILES,
                          JOB_DIRECTORY_METADATA]:
            job_directory.make_directory(directory)
        return job_directory

    def _get_authorization(self, job_id, tool_id):
        return self.authorizer.get_authorization(tool_id)

    def _check_execution(self, job_id, tool_id, command_line):
        log.debug("job_id: {} - Checking authorization of command_line [{}]".format(job_id, command_line))
        authorization = self._get_authorization(job_id, tool_id)
        job_directory = self._job_directory(job_id)
        tool_files_dir = job_directory.tool_files_directory()
        for file in self._list_dir(tool_files_dir):
            if os.path.isdir(join(tool_files_dir, file)):
                continue
            contents = open(join(tool_files_dir, file)).read()
            log.debug("job_id: {} - checking tool file {}".format(job_id, file))
            authorization.authorize_tool_file(basename(file), contents)
        config_files_dir = job_directory.configs_directory()
        for file in self._list_dir(config_files_dir):
            path = join(config_files_dir, file)
            authorization.authorize_config_file(job_directory, file, path)
        authorization.authorize_execution(job_directory, command_line)

    def _list_dir(self, directory_or_none):
        if directory_or_none is None or not exists(directory_or_none):
            return []
        else:
            return listdir(directory_or_none)

    def _expand_command_line(self, job_id, command_line: str, dependencies_description, job_directory=None) -> str:
        if dependencies_description is None:
            return command_line

        requirements = dependencies_description.requirements
        installed_tool_dependencies = dependencies_description.installed_tool_dependencies
        dependency_commands = self.dependency_manager.dependency_shell_commands(
            requirements=requirements,
            installed_tool_dependencies=installed_tool_dependencies,
            job_directory=job_directory,
        )
        if dependency_commands:
            command_line = "{}; {}".format("; ".join(dependency_commands), command_line)
        return command_line

    def setup_job(self, input_job_id, tool_id, tool_version):
        job_id = self._get_job_id(input_job_id)
        return self._setup_job_for_job_id(job_id, tool_id, tool_version)

    def _get_job_id(self, input_job_id):
        return str(self.id_assigner(input_job_id))

    def __str__(self):
        return "{}[name={}]".format(type(self).__name__, self.name)

class JobDirectory(RemoteJobDirectory):

    def __init__(
        self,
        staging_directory,
        job_id,
        lock_manager=None,
        directory_maker=None
    ):
        super().__init__(staging_directory, remote_id=job_id, remote_sep=sep)
        self._directory_maker = directory_maker or DirectoryMaker()
        self.lock_manager = lock_manager
        # Assert this job id isn't hacking path somehow.
        assert job_id == basename(job_id)

    def _job_file(self, name):
        return os.path.join(self.job_directory, name)

    def calculate_path(self, remote_path, input_type):
        """ Verify remote_path is in directory for input_type inputs
        and create directory if needed.
        """
        directory, allow_nested_files, allow_globs = self._directory_for_file_type(input_type)
        path = get_mapped_file(directory, remote_path, allow_nested_files=allow_nested_files, allow_globs=allow_globs)
        return path

    def read_file(self, name, size=-1, default=None):
        path = self._job_file(name)
        job_file = None
        try:
            job_file = open(path, 'rb')
            return job_file.read(size)
        except Exception:
            if default is not None:
                return default
            else:
                raise
        finally:
            if job_file:
                job_file.close()

    def write_file(self, name, contents):
        path = self._job_file(name)
        job_file = open(path, 'wb')
        try:
            if isinstance(contents, str):
                contents = contents.encode("UTF-8")
            job_file.write(contents)
        finally:
            job_file.close()
        return path

    def remove_file(self, name):
        """
        Quietly remove a job file.
        """
        try:
            os.remove(self._job_file(name))
        except OSError:
            pass

    def contains_file(self, name):
        return os.path.exists(self._job_file(name))

    def open_file(self, name, mode='wb'):
        return open(self._job_file(name), mode)

    def exists(self):
        return os.path.exists(self.path)

    def delete(self):
        return rmtree(self.path)

    def setup(self):
        self._directory_maker.make(self.job_directory)

    def make_directory(self, name):
        path = self._job_file(name)
        self._directory_maker.make(path)

    def lock(self, name=".state"):
        assert self.lock_manager, "Can only use job directory locks if lock manager defined."
        return self.lock_manager.get_lock(self._job_file(name))

    def working_directory_file_contents(self, name):
        working_directory = self.working_directory()
        working_directory_path = join(working_directory, name)
        if exists(working_directory_path):
            with open(working_directory_path, "rb") as f:
                return f.read()
        else:
            return None

    def working_directory_contents(self):
        working_directory = self.working_directory()
        return self.__directory_contents(working_directory)

    def outputs_directory_contents(self):
        outputs_directory = self.outputs_directory()
        return self.__directory_contents(outputs_directory)

    def metadata_directory_contents(self):
        metadata_directory = self.metadata_directory()
        return self.__directory_contents(metadata_directory)

    def job_directory_contents(self):
        # Set recursive to False to just get the top-level artifacts
        return self.__directory_contents(self.job_directory, recursive=False)

    def __directory_contents(self, directory, recursive=True):
        contents = []
        if recursive:
            for path, _, files in walk(directory):
                relative_path = relpath(path, directory)
                for name in files:
                    # Return file1.txt, dataset_1_files/image.png, etc... don't
                    # include . in path.
                    if relative_path != curdir:
                        contents.append(join(relative_path, name))
                    else:
                        contents.append(name)
        else:
            if os.path.isdir(directory):
                for name in os.listdir(directory):
                    contents.append(name)
        return contents

    # Following abstractions store metadata related to jobs.
    def store_metadata(self, metadata_name, metadata_value):
        self.write_file(metadata_name, json.dumps(metadata_value))

    def load_metadata(self, metadata_name, default=None):
        DEFAULT_RAW = object()
        contents = self.read_file(metadata_name, default=DEFAULT_RAW)
        if contents is DEFAULT_RAW:
            return default
        else:
            return json.loads(contents.decode())

    def has_metadata(self, metadata_name):
        return self.contains_file(metadata_name)

    def remove_metadata(self, metadata_name):
        self.remove_file(metadata_name)

class DirectoryMaker:

    def __init__(self, mode=None):
        self.mode = mode

    def make(self, path, recursive=False):
        makedir_args = [path]
        if self.mode is not None:
            makedir_args.append(self.mode)
        try:
            if recursive:
                makedirs(*makedir_args)
            else:
                os.mkdir(*makedir_args)
        except OSError as exc:
            if exc.errno != errno.EEXIST:
                raise


text:
from __future__ import print_function
from permuta import *
import permstruct
import permstruct.dag
from permstruct import *
from permstruct.dag import taylor_dag

import sys

is_classical = True

# STATUS ================================================ >

# Skew-merge permutations

task = '2143_2413_3142_3412'
patts = [ Permutation([ int(c) for c in p ]) for p in task.split('_') ]

perm_bound    = 7
verify_bound  = 8
ignored       = 0

# The dag
max_len_patt = None
upper_bound  = None
remove       = False

# Grids
max_rule_size = (6, 6)
max_non_empty = 6
max_rules     = None

# ------------------------------------------------------------------------------

settings = StructSettings(
        perm_bound=perm_bound,
        verify_bound=verify_bound,
        max_rule_size=max_rule_size,
        max_non_empty=max_non_empty,
        max_rules=max_rules,
        verbosity=StructLogger.INFO)
# settings.set_input(StructInput.from_avoidance(settings, patts))
settings.set_input(AvoiderInput(settings, patts))
settings.set_dag(taylor_dag(settings,
                    max_len_patt=max_len_patt,
                    remove=remove,
                    upper_bound=upper_bound))

exhaustive(settings)


text:
package org.syphr.mythtv.protocol.events.impl;

import java.util.List;

public interface BackendMessage
{
    public String getCommand();

    public List<String> getArgs();

    public List<String> getData();
}


text:
package hu.akarnokd.reactive4java.test.old;

import hu.akarnokd.reactive4java.base.Action0;
import hu.akarnokd.reactive4java.base.Action1;
import hu.akarnokd.reactive4java.base.Func1;
import hu.akarnokd.reactive4java.base.Observable;
import hu.akarnokd.reactive4java.reactive.Reactive;
import hu.akarnokd.reactive4java.util.Functions;
import hu.akarnokd.reactive4java.util.Observers;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * Test Reactive operators, B.
 * @author akarnokd
 */
public final class TestB {

    /**
     * Utility class.
     */
    private TestB() {
        // utility class
    }
    /**
     * Run the observable with a print attached.
     * @param observable the source observable
     * @throws InterruptedException when the current thread is interrupted while
     * waiting on the observable completion
     */
    static void run(Observable<?> observable) throws InterruptedException {
        Reactive.run(observable, Observers.print());
    }

    /**
     * @param args no arguments
     * @throws Exception on error
     */
    public static void main(String[] args)
    throws Exception {

        Reactive.run(Reactive.selectMany(
                Reactive.range(0, 10),
                new Func1<Integer, Observable<Integer>>() {
            @Override
            public Observable<Integer> invoke(Integer param1) {
                return Reactive.range(0, param1);
            }

        }), Observers.println());

        run(Reactive.tick(0, 10, 1, TimeUnit.SECONDS));

        Observable<Observable<Long>> window = Reactive.window(
                Reactive.tick(0, 10, 1, TimeUnit.SECONDS),
                Functions.constant0(Reactive.tick(0, 2, 2, TimeUnit.SECONDS)));

        final CountDownLatch cdl = new CountDownLatch(1);

        window.register(Observers.toObserver(new Action1<Observable<Long>>() {
            @Override
            public void invoke(Observable<Long> value) {
                System.out.println("New window");
                value.register(Observers.println());
            }
        },
        new Action1<Throwable>() {
            @Override
            public void invoke(Throwable value) {
                value.printStackTrace();
            }
        },
        new Action0() {
            @Override
            public void invoke() {
                System.out.println("Finished");
                cdl.countDown();
            }
        }
        ));

        cdl.await();

        System.out.printf("%nMain finished%n");
    }

}


text:
using System;
using RtmpSharp.IO;
using System.Collections.Generic;

namespace LegendaryClient.Logic.Riot.Platform
{
    [Serializable]
    [SerializedName("com.riotgames.platform.summoner.masterybook.MasteryBookPageDTO")]
    public class MasteryBookPageDTO
    {
        [SerializedName("talentEntries")]
        public List<TalentEntry> TalentEntries { get; set; }

        [SerializedName("pageId")]
        public Double PageId { get; set; }

        [SerializedName("name")]
        public String Name { get; set; }

        [SerializedName("current")]
        public Boolean Current { get; set; }

        [SerializedName("createDate")]
        public object CreateDate { get; set; }

        [SerializedName("summonerId")]
        public Double SummonerId { get; set; }
    }
}


text:
@import url(inter-ui/inter-hinted.css);
@import url(./inria-sans/fonts.css);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Microsoft.Practices.Unity;
using Ninject;

namespace IoC.Tests.Performance
{
    [TestFixture]
    public class SingletonPerformanceFixture
    {
        private readonly int _iterations = 1000000;

        #region SetUp / TearDown

        [SetUp]
        public void Init()
        { }

        [TearDown]
        public void Dispose()
        { }

        #endregion

        #region Tests

        [Test]
        public void IoCSingletonTest()
        {
            var container = new Container();
            container.Register<MockObject>().To(new MockObject()).AsSingleton();
            var start = DateTime.Now;
            for (int i = 0; i < _iterations; i++)
            {
                var t = container.Resolve<MockObject>();
            }
            var end = DateTime.Now;
            Console.WriteLine(string.Format("{0} Singleton, Total milliseconds elapsed: {1}", "IoC", (end - start).TotalMilliseconds));
        }

        [Test]
        public void HaveBoxSingletonTest()
        {
            var container = new HaveBox.Container();
            container.Configure(x => x.For<MockObject>().Use<MockObject>().AsSingleton());
            var start = DateTime.Now;
            for (int i = 0; i < _iterations; i++)
            {
                var t = container.GetInstance<MockObject>();
            }
            var end = DateTime.Now;
            Console.WriteLine(string.Format("{0} Singleton, Total milliseconds elapsed: {1}", "HaveBox", (end - start).TotalMilliseconds));
        }

        [Test]
        public void UnitySingletonTest()
        {
            var container = new UnityContainer();
            container.RegisterInstance<MockObject>(new MockObject());
            var start = DateTime.Now;
            for (int i = 0; i < _iterations; i++)
            {
                var t = container.Resolve<MockObject>();
            }
            var end = DateTime.Now;
            Console.WriteLine(string.Format("{0} Singleton, Total milliseconds elapsed: {1}", "Unity", (end - start).TotalMilliseconds));
        }

        [Test]
        public void TinyIoCSingletonTest()
        {
            var container = new TinyIoC.TinyIoCContainer();
            container.Register<MockObject>(new MockObject());
            var start = DateTime.Now;
            for (int i = 0; i < _iterations; i++)
            {
                var t = container.Resolve<MockObject>();
            }
            var end = DateTime.Now;
            Console.WriteLine(string.Format("{0} Singleton, Total milliseconds elapsed: {1}", "TinyIoC", (end - start).TotalMilliseconds));
        }

        [Test]
        public void NinjectSingletonTest()
        {
            var container = new Ninject.StandardKernel();
            container.Bind<MockObject>().ToConstant(new MockObject());
            var start = DateTime.Now;
            for (int i = 0; i < _iterations; i++)
            {
                var t = container.Get<MockObject>();
            }
            var end = DateTime.Now;
            Console.WriteLine(string.Format("{0} Singleton, Total milliseconds elapsed: {1}", "Ninject", (end - start).TotalMilliseconds));
        }

        #endregion

        private class MockObject { }
    }
}


text:
const AntenaReceptor = require("antena/lib/receptor");

const default_logger = (origin, recipient, meteor) => {
  console.log(origin+" >> "+recipient+": "+meteor);
};

module.exports = (logger) => {
  const receptor = AntenaReceptor();
  const distributor = {
    _receptor: receptor,
    _pendings: {__proto__:null},
    _callbacks: {__proto__:null},
    _logger: typeof logger === "function" ? logger : (logger && default_logger),
    ConnectionListener,
    RequestMiddleware,
    UpgradeMiddleware
  };
  receptor.onpost = onpost;
  receptor.onpull = onpull;
  receptor._melf = distributor;
  return distributor;
};

function ConnectionListener () {
  return this._receptor.ConnectionListener();
}

function RequestMiddleware (splitter) {
  return this._receptor.RequestMiddleware(splitter);
}

function UpgradeMiddleware (splitter) {
  return this._receptor.UpgradeMiddleware(splitter);
}

function onpost (origin, message) {
  const recipient = message.substring(0, message.indexOf("/"));
  const meteor = message.substring(recipient.length + 1);
  if (this._melf._logger)
    this._melf._logger(origin, recipient, meteor);
  this.push(recipient, meteor);
  if (this._melf._callbacks[recipient]) {
    this._melf._callbacks[recipient](meteor);
    this._melf._callbacks[recipient] = null;
  } else {
    if (!(recipient in this._melf._pendings))
      this._melf._pendings[recipient] = [];
    this._melf._pendings[recipient].push(meteor);
  }
}

function onpull (session, message, callback) {
  if (message)
    this.onpost(session, message);
  if (this._melf._pendings[session] && this._melf._pendings[session].length) {
    callback(this._melf._pendings[session].join("\n"));
    this._melf._pendings[session].length = 0;
  } else {
    this._melf._callbacks[session] = callback;
  }
}


text:
You are given a 2D array with dimensions 6*6. An hourglass in an array is defined as a portion shaped like this:

```
a b c
  d
e f g
```

For example, if we create an hourglass using the number 1 within an array full of zeros, it may look like this:

```
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
```

Actually, there are many hourglasses in the array above. The three topmost hourglasses are the following:

```
1 1 1     1 1 0     1 0 0
  1         0         0
1 1 1     1 1 0     1 0 0
```

The sum of an hourglass is the sum of all the numbers within it. The sum for the hourglasses above are 7, 4, and 2, respectively.

In this problem, you have to print the largest sum among all the hourglasses in the array.

##Input Format

There will be exactly 6 lines of input, each containing 6 integers separated by spaces. Each integer will be between -9 and 9, inclusively.

##Output Format

Print the answer to this problem on a single line.

##Sample Input

```
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 2 4 4 0
0 0 0 2 0 0
0 0 1 2 4 0
```

##Sample Output

```
19
```

##Explanation

The hourglass possessing the largest sum is:

```
2 4 4
  2
1 2 4
```


text:
/*
 * EVE Swagger Interface
 *
 * An OpenAPI for EVE Online
 *
 * OpenAPI spec version: 0.5.5
 *
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package esi

/* A list of GetCharactersCharacterIdClonesJumpClone. */
//easyjson:json
type GetCharactersCharacterIdClonesJumpCloneList []GetCharactersCharacterIdClonesJumpClone

/* jump_clone object */
//easyjson:json
type GetCharactersCharacterIdClonesJumpClone struct {
	Implants     []int32 `json:"implants,omitempty"`      /* implants array */
	LocationId   int64   `json:"location_id,omitempty"`   /* location_id integer */
	LocationType string  `json:"location_type,omitempty"` /* location_type string */
}


text:
package br.uff.ic.oceano.core.dao.controle.anotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target (ElementType.METHOD)
@Retention (RetentionPolicy.RUNTIME)
public @interface MetodoRecuperaPrimeiro
{
    String namedQuery() default "";
}