text:
package ch.ethz.inf.vs.californium.rd.resources;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Logger;

import ch.ethz.inf.vs.californium.coap.CoAP.ResponseCode;
import ch.ethz.inf.vs.californium.coap.LinkFormat;
import ch.ethz.inf.vs.californium.coap.MediaTypeRegistry;
import ch.ethz.inf.vs.californium.coap.Request;
import ch.ethz.inf.vs.californium.coap.Response;
import ch.ethz.inf.vs.californium.network.Exchange;
import ch.ethz.inf.vs.californium.network.config.NetworkConfig;
import ch.ethz.inf.vs.californium.server.resources.CoapExchange;
import ch.ethz.inf.vs.californium.server.resources.Resource;
import ch.ethz.inf.vs.californium.server.resources.ResourceBase;

public class RDNodeResource extends ResourceBase {

	private static final Logger LOGGER = Logger.getLogger(RDNodeResource.class.getCanonicalName());

	/*
	 * After the lifetime expires, the endpoint has RD_VALIDATION_TIMEOUT seconds
	 * to update its entry before the RD enforces validation and removes the endpoint
	 * if it does not respond.
	 */
	private Timer lifetimeTimer;
	private Timer validationTimer;

	private int lifeTime;
	private long expiryTime;

	private String endpointIdentifier;
	private String domain;
	private String endpointType;
	private String context;

	private byte[] etag = null;

	public RDNodeResource(String name, String endpointID, String domain) {
		super(name);
		this.endpointIdentifier = endpointID;
		this.domain = domain;
	}

	/**
	 * Updates the endpoint parameters from POST and PUT requests.
	 *
	 * @param request A POST or PUT request with a {?et,lt,con} URI Template query
	 * 			and a Link Format payload.
	 *
	 */
	public boolean setParameters(Request request) {

		LinkAttribute attr;

		String newEndpointType = "";
		int newLifeTime = NetworkConfig.getStandard().getInt("RD_DEFAULT_LIFETIME");
		String newContext = "";

		/*
		 * get lifetime from option query - only for PUT request.
		 */
		List<String> query = request.getOptions().getURIQueries();
		for (String q : query) {
			// FIXME Do not use Link attributes for URI template variables
			attr = LinkAttribute.parse(q);

			if (attr.getName().equals(LinkFormat.END_POINT_TYPE)) {
				newEndpointType = attr.getValue();
			}

			if (attr.getName().equals(LinkFormat.LIFE_TIME)) {
				newLifeTime = attr.getIntValue();

				if (newLifeTime < 60) {
					LOGGER.warning("Enforcing minimal RD lifetime of 60 seconds (was "+newLifeTime+")");
					newLifeTime = 60;
				}
			}

			if (attr.getName().equals(LinkFormat.CONTEXT)){
				newContext = attr.getValue();
			}
		}

		setEndpointType(newEndpointType);
		setLifeTime(newLifeTime);

		// TODO check with draft authors if update should be atomic
		if (newContext.equals("")) {
			context = "coap://" + request.getSource()+":"+request.getSourcePort();
		} else {
			Request checkRequest = Request.newGet();

			try {
				checkRequest.setURI(context);
			} catch (Exception e) {
				LOGGER.warning(e.toString());
				return false;
			}
		}

		return updateEndpointResources(request.getPayloadString());
	}

	/*
	 * add a new resource to the node. E.g. the resource temperature or
	 * humidity. If the path is /readings/temp, temp will be a subResource
	 * of readings, which is a subResource of the node.
	 */
	public ResourceBase addNodeResource(String path) {
		Scanner scanner = new Scanner(path);
		scanner.useDelimiter("/");
		String next = "";
		boolean resourceExist = false;
		Resource resource = this; // It's the resource that represents the endpoint

		ResourceBase subResource = null;
		while (scanner.hasNext()) {
			resourceExist = false;
			next = scanner.next();
			for (Resource res : resource.getChildren()) {
				if (res.getName().equals(next)) {
					subResource = (ResourceBase) res;
					resourceExist = true;
				}
			}
			if (!resourceExist) {
				subResource = new RDTagResource(next,true, this);
				resource.add(subResource);
			}
			resource = subResource;
		}
		subResource.setPath(resource.getPath());
		subResource.setName(next);
		scanner.close();
		return subResource;
	}

	@Override
	public void delete() {

		LOGGER.info("Removing endpoint: "+getContext());

		if (lifetimeTimer!=null) {
			lifetimeTimer.cancel();
		}
		if (validationTimer!=null) {
			validationTimer.cancel();
		}

		super.delete();
	}

	/*
	 * GET only debug return endpoint identifier
	 */
	@Override
	public void handleGET(Exchange exchange) {
		Response resp = new Response(ResponseCode.CONTENT);
		resp.setPayload(endpointIdentifier+"."+domain, MediaTypeRegistry.TEXT_PLAIN);
		resp.getOptions().setMaxAge((int) Math.max((expiryTime - System.currentTimeMillis())/1000, 0));
		exchange.respond(resp);
	}

	/*
	 * PUTs content to this resource. PUT is a periodic request from the
	 * node to update the lifetime.
	 */
	@Override
	public void handlePUT(Exchange exchange) {

		if (lifetimeTimer != null) {
			lifetimeTimer.cancel();
		}
		if (validationTimer!=null) {
			validationTimer.cancel();
		}

		setParameters(exchange.getRequest());

		// complete the request
		exchange.respond(ResponseCode.CHANGED);

	}

	/*
	 * DELETEs this node resource
	 */
	@Override
	public void handleDELETE(CoapExchange exchange) {
		delete();
		exchange.respond(ResponseCode.DELETED);
	}

	/*
	 * set either a new lifetime (for new resources, POST request) or update
	 * the lifetime (for PUT request)
	 */
	public void setLifeTime(int newLifeTime) {

		lifeTime = newLifeTime;

		expiryTime = System.currentTimeMillis() + lifeTime * 1000;

		if (lifetimeTimer != null) {
			lifetimeTimer.cancel();
		}
		if (validationTimer!=null) {
			validationTimer.cancel();
		}

		lifetimeTimer = new Timer();
		lifetimeTimer.schedule(new ExpiryTask(this), lifeTime * 1000);// from sec to ms

	}

	/**
	 * Creates a new subResource for each resource the node wants
	 * register. Each resource is separated by ",". E.g. A node can
	 * register a resource for reading the temperature and another one
	 * for reading the humidity.
	 */
	private boolean updateEndpointResources(String linkFormat) {

		Scanner scanner = new Scanner(linkFormat);

		scanner.useDelimiter(",");
		List<String> pathResources = new ArrayList<String>();
		while (scanner.hasNext()) {
			pathResources.add(scanner.next());
		}
		for (String p : pathResources) {
			scanner = new Scanner(p);

			/*
			 * get the path of the endpoint's resource. E.g. from
			 * </readings/temp> it will select /readings/temp.
			 */
			String path = "", pathTemp = "";
			if ((pathTemp = scanner.findInLine("</.*?>")) != null) {
				path = pathTemp.substring(1, pathTemp.length() - 1);
			} else {
				scanner.close();
				return false;
			}

			ResourceBase resource = addNodeResource(path);
			/*
			 * Since created the subResource, get all the attributes from
			 * the payload. Each parameter is separated by a ";".
			 */
			scanner.useDelimiter(";");
			while (scanner.hasNext()) {
				LinkAttribute attr = LinkAttribute.parse(scanner.next());
				if (attr.getValue() == null)
					resource.getAttributes().addAttribute(attr.getName());
				else resource.getAttributes().addAttribute(attr.getName(), attr.getValue());
			}
			resource.getAttributes().addAttribute(LinkFormat.END_POINT, getEndpointIdentifier());
		}
		scanner.close();

		return true;
	}

	// TODO: Merge into LinkFormat class
	/*
	 * the following three methods are used to print the right string to put in
	 * the payload to respond to the GET request.
	 */
	public String toLinkFormat(List<String> query) {

		// Create new StringBuilder
		StringBuilder builder = new StringBuilder();

		// Build the link format
		buildLinkFormat(this, builder, query);

		// Remove last delimiter
		if (builder.length() > 0) {
			builder.deleteCharAt(builder.length() - 1);
		}

		return builder.toString();
	}

	public String toLinkFormatItem(Resource resource) {
		StringBuilder linkFormat = new StringBuilder();

//TODO return absolute link
		linkFormat.append("<"+getContext());
		linkFormat.append(resource.getPath().substring(this.getPath().length()));
		linkFormat.append(">");

		return linkFormat.append( LinkFormat.serializeResource(resource).toString().replaceFirst("<.+>", "") ).toString();
	}

	private void buildLinkFormat(Resource resource, StringBuilder builder, List<String> query) {
		if (resource.getChildren().size() > 0) {

			// Loop over all sub-resources
			for (Resource res : resource.getChildren()) {
				// System.out.println(resource.getSubResources().size());
				// System.out.println(res.getName());
				if (LinkFormat.matches(res, query) && res.getAttributes().getCount() > 0) {

					// Convert Resource to string representation and add
					// delimiter
					builder.append(toLinkFormatItem(res));
					builder.append(',');
				}
				// Recurse
				buildLinkFormat(res, builder, query);
			}
		}
	}

	/*
	 * Setter And Getter
	 */

	public String getEndpointIdentifier() {
		return endpointIdentifier;
	}

	public String getDomain() {
		return domain;
	}

	public String getEndpointType() {
		return endpointType;
	}

	public void setEndpointType(String endpointType) {
		this.endpointType = endpointType;
	}

	public String getContext() {
		return context;
	}

	public void setContext(String context) {
		this.context = context;
	}

	class ExpiryTask extends TimerTask {
		RDNodeResource resource;

		public ExpiryTask(RDNodeResource resource) {
			super();
			this.resource = resource;
		}

		@Override
		public void run() {
			LOGGER.info("Scheduling validation of expired endpoint: "+getContext());
			validationTimer = new Timer();
			validationTimer.schedule(new ValidationTask(resource), NetworkConfig.getStandard().getInt("RD_VALIDATION_TIMEOUT") * 1000);
		}
	}

	class ValidationTask extends TimerTask {
		RDNodeResource resource;

		public ValidationTask(RDNodeResource resource) {
			super();
			this.resource = resource;
		}

		@Override
		public void run() {

			LOGGER.info("Validating endpoint: "+getContext());

			Request validationRequest = Request.newGet();
			validationRequest.setURI(getContext()+"/.well-known/core");
			if (etag!=null) {
				validationRequest.getOptions().addETag(etag);
			}
			Response response = null;

			try {
				validationRequest.send();
				response = validationRequest.waitForResponse();

			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			if (response == null) {

				delete();

			} else if(response.getCode() == ResponseCode.VALID) {

				LOGGER.fine("Resources up-to-date: "+getContext());

			} else if (response.getCode() == ResponseCode.CONTENT) {

				List<byte[]> etags = response.getOptions().getETags();

				if (!etags.isEmpty()) {
					etag = etags.get(0);
				}

				updateEndpointResources(response.getPayloadString());
				setLifeTime(lifeTime);

				LOGGER.fine("Updated Resources: " + getContext());
			}
		}
	}

}


text:
'use strict';

// MODULES //

var tape = require( 'tape' );
var noop = require( '@stdlib/utils/noop' );
var FLOAT64_MAX = require( '@stdlib/constants/float64/max' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var LineChart = require( './../lib/main.js' );

// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.strictEqual( typeof LineChart, 'function', 'main export is a function' );
	t.end();
});

tape( 'the export is a class constructor', function test( t ) {
	var chart = new LineChart();
	t.strictEqual( chart instanceof LineChart, true, 'returns class instance' );
	t.end();
});

tape( 'the constructor does not require the `new` keyword (no data, no options)', function test( t ) {
	var chart;
	var ctor;

	ctor = LineChart;
	chart = ctor();

	t.strictEqual( chart instanceof LineChart, true, 'returns class instance' );
	t.end();
});

tape( 'the constructor does not require the `new` keyword (data)', function test( t ) {
	var chart;
	var ctor;

	ctor = LineChart;
	chart = ctor( [ 1, 2, 3 ] );

	t.strictEqual( chart instanceof LineChart, true, 'returns class instance' );
	t.end();
});

tape( 'the constructor does not require the `new` keyword (options)', function test( t ) {
	var chart;
	var ctor;

	ctor = LineChart;
	chart = ctor({
		'bufferSize': 10,
		'description': 'beep',
		'infinities': true,
		'isDefined': noop,
		'data': [ 1, 2, 3 ],
		'autoRender': true,
		'label': 'foo',
		'yMin': null,
		'yMax': null
	});

	t.strictEqual( chart instanceof LineChart, true, 'returns class instance' );
	t.end();
});

tape( 'the constructor does not require the `new` keyword (data and options)', function test( t ) {
	var chart;
	var ctor;

	ctor = LineChart;
	chart = ctor( [ 1, 2, 3 ], {
		'bufferSize': 10,
		'description': 'beep',
		'infinities': true,
		'isDefined': noop,
		'autoRender': true,
		'label': 'foo',
		'yMin': null,
		'yMax': null
	});

	t.strictEqual( chart instanceof LineChart, true, 'returns class instance' );
	t.end();
});

tape( 'the constructor will throw an error if provided an invalid options argument (no data argument)', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		5,
		NaN,
		null,
		void 0,
		true,
		false,
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			var chart = new LineChart( value ); // eslint-disable-line no-unused-vars
		};
	}
});

tape( 'the constructor will throw an error if provided an invalid options argument (data argument)', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		5,
		NaN,
		null,
		void 0,
		true,
		false,
		[],
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws a type error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			var chart = new LineChart( [ 1, 2, 3 ], value ); // eslint-disable-line no-unused-vars
		};
	}
});

tape( 'the constructor throws an error if provided an invalid option (no data argument)', function test( t ) {
	t.throws( foo, TypeError, 'throws an error' );
	t.end();

	function foo() {
		// eslint-disable-next-line no-unused-vars
		var chart = new LineChart({
			'description': []
		});
	}
});

tape( 'the constructor throws an error if provided an invalid option (data argument)', function test( t ) {
	t.throws( foo, TypeError, 'throws an error' );
	t.end();

	function foo() {
		// eslint-disable-next-line no-unused-vars
		var chart = new LineChart( [ 1, 2, 3 ], {
			'description': []
		});
	}
});

tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (options)', function test( t ) {
	t.throws( foo, Error, 'throws an error' );
	t.end();

	function foo() {
		// eslint-disable-next-line no-unused-vars
		var chart = new LineChart({
			'data': [ 1, 2, 3, 4, 5 ],
			'bufferSize': 3
		});
	}
});

tape( 'the constructor throws an error if provided a `bufferSize` option which is less than the number of data elements (data argument)', function test( t ) {
	t.throws( foo, Error, 'throws an error' );
	t.end();

	function foo() {
		// eslint-disable-next-line no-unused-vars
		var chart = new LineChart( [ 1, 2, 3, 4, 5 ], {
			'bufferSize': 3
		});
	}
});

tape( 'an instance has a writable `autoRender` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( chart.autoRender, false, 'default value is false' );

	opts = {
		'autoRender': true
	};
	chart = new LineChart( opts );

	expected = true;
	t.strictEqual( chart.autoRender, expected, 'returns expected value' );

	chart.autoRender = false;

	expected = false;
	t.strictEqual( chart.autoRender, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `bufferSize` property', function test( t ) {
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( chart.bufferSize, FLOAT64_MAX, 'default value is the maximum double-precision floating-point number' );

	opts = {
		'bufferSize': 20
	};
	chart = new LineChart( opts );
	t.strictEqual( chart.bufferSize, opts.bufferSize, 'returns expected value' );

	chart.bufferSize = 5;
	t.strictEqual( chart.bufferSize, 5, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `data` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.deepEqual( chart.data, [], 'default value is an empty array' );

	opts = {
		'data': [ 1, 2, 3 ]
	};
	chart = new LineChart( opts );

	expected = [ 1, 2, 3 ];
	t.deepEqual( chart.data, expected, 'returns expected value' );

	chart.data = [ 4, 5, 6 ];

	expected = [ 4, 5, 6 ];
	t.deepEqual( chart.data, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `infinities` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( chart.infinities, false, 'default value is false' );

	opts = {
		'infinities': true
	};
	chart = new LineChart( opts );

	expected = true;
	t.strictEqual( chart.infinities, expected, 'returns expected value' );

	chart.infinities = false;

	expected = false;
	t.strictEqual( chart.infinities, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `isDefined` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( typeof chart.isDefined, 'function', 'default value is a function' );

	opts = {
		'isDefined': noop
	};
	chart = new LineChart( opts );

	expected = noop;
	t.deepEqual( chart.isDefined, expected, 'returns expected value' );

	chart.isDefined = noop;

	expected = noop;
	t.deepEqual( chart.isDefined, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `label` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( chart.label, '', 'default value is an empty string' );

	opts = {
		'label': 'foo'
	};
	chart = new LineChart( opts );

	expected = 'foo';
	t.strictEqual( chart.label, expected, 'returns expected value' );

	chart.label = 'bar';

	expected = 'bar';
	t.strictEqual( chart.label, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `yMax` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( chart.yMax, NINF, 'default value is -infinity' );

	opts = {
		'data': [ 1, 2, 3 ],
		'yMax': 10
	};
	chart = new LineChart( opts );

	expected = 10;
	t.strictEqual( chart.yMax, expected, 'returns expected value' );

	chart.yMax = null;

	expected = 3;
	t.strictEqual( chart.yMax, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a writable `yMin` property', function test( t ) {
	var expected;
	var chart;
	var opts;

	chart = new LineChart();
	t.strictEqual( chart.yMin, PINF, 'default value is +infinity' );

	opts = {
		'data': [ 1, 2, 3 ],
		'yMin': 10
	};
	chart = new LineChart( opts );

	expected = 10;
	t.strictEqual( chart.yMin, expected, 'returns expected value' );

	chart.yMin = null;

	expected = 1;
	t.strictEqual( chart.yMin, expected, 'returns expected value' );

	t.end();
});

tape( 'an instance has a `push` method for appending data', function test( t ) {
	var chart = new LineChart();
	t.strictEqual( typeof chart.push, 'function', 'has push method' );
	t.end();
});

tape( 'an instance has a `render` method for rendering a chart', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];

	str = chart.render();
	t.strictEqual( str, '⡈⠑⠢⠔⠒⠒⠒', 'returns rendered chart' );

	t.end();
});

tape( 'if a chart has not been provided data, the render method returns an empty string', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();

	str = chart.render();
	t.strictEqual( str, '', 'returns empty string' );

	t.end();
});

tape( 'by default, a chart renders `NaN` and infinite values as missing values', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [
		1.0,
		5.0,
		NaN,
		PINF,
		NINF,
		4.0,
		3.0
	];

	str = chart.render();
	t.strictEqual( str, '⡈⠉   ⠒⠒', 'returns rendered chart with missing values' );

	t.end();
});

tape( 'if the `infinities` option/property is set to `true`, the chart encodes infinite values as `∞`', function test( t ) {
	var chart;
	var str;

	chart = new LineChart({
		'infinities': true
	});
	chart.data = [
		1.0,
		5.0,
		NaN,
		PINF,
		NINF,
		4.0,
		3.0
	];

	str = chart.render();
	t.strictEqual( str, '⡈⠉ ∞∞⠒⠒', 'returns rendered chart with infinities encoded as ∞' );

	t.end();
});

tape( 'if provided `yMin` and/or `yMax` values, the chart fixes the y-axis domain', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [
		-1.0,
		5.0,
		-3.0,
		2.0,
		-4.0,
		4.0,
		3.0
	];
	chart.yMin = 0.0;
	chart.yMax = 10.0;

	str = chart.render();
	t.strictEqual( str, '⡐⢂⡠⢄⡠⠤⠤', 'returns rendered chart with fixed y-axis domain' );

	chart.data = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
	chart.yMin = null;
	chart.yMax = 3.0;

	str = chart.render();
	t.strictEqual( str, '⡐⠊⠉⠉⠉⠉', 'returns rendered chart with fixed y-axis domain' );

	t.end();
});

tape( 'if all datum are `0` and the y-axis domain is `0`, the chart renders each finite datum as the smallest glyph', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [
		0.0,
		0.0,
		0.0,
		0.0,
		0.0,
		0.0,
		0.0
	];

	str = chart.render();
	t.strictEqual( str, '⣀⣀⣀⣀⣀⣀⣀', 'returns rendered chart' );

	t.end();
});

tape( 'if all datum are constant and non-zero and the y-axis domain is `0`, the chart renders each finite datum as the same mid-sized glyph', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [
		5.0,
		5.0,
		5.0,
		5.0,
		5.0,
		5.0,
		5.0
	];

	str = chart.render();
	t.strictEqual( str, '⠒⠒⠒⠒⠒⠒⠒', 'returns rendered chart' );

	t.end();
});

tape( 'glyphs preceding infinite values slope in the direction of those values', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [ 1.0, 5.0, NINF, 2.0, PINF, 4.0, 3.0 ];

	str = chart.render();
	t.strictEqual( str, '⡈⢁ ⠌ ⠒⠒', 'returns rendered chart' );

	t.end();
});

tape( 'an instance has a `toString` method for serializing a chart to string', function test( t ) {
	var chart;
	var str;

	chart = new LineChart();
	chart.data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];

	str = chart.toString();
	t.strictEqual( str, '⡈⠑⠢⠔⠒⠒⠒', 'returns rendered chart' );

	t.end();
});

redpajama_set_name: RedPajamaGithub


text:
//
//  als.h
//  cycle-x-pro
//
//  Created by Carlos Salamanca on 9/29/16.
//  Copyright © 2016 team14. All rights reserved.
//

#ifndef als_h
#define als_h

#include "globals.h"
#include "types.h"

#define DEBOUNCE_DELAY 500
#define FLASH_INTERVAL 100
#define REAR_FLASH_INTERVAL 100

#define US_MIN_DISTANCE 20

extern volatile uint8_t g_byChangedToSimple;
extern volatile uint32_t g_wLastDebounceTime;
extern volatile uint8_t g_byFlashingPattern;
extern volatile uint32_t g_wPreviousMillis;
extern uint32_t g_wPreviousMillis2;
extern volatile uint8_t g_byALSPin1State;
extern volatile uint8_t g_byALSPin2State;
extern volatile uint8_t g_byALSPin3State;
extern uint8_t g_byUsoundLtPinState;
extern volatile uint8_t g_byFlashingCount;
extern uint8_t g_byBatteryLevel;
extern uint8_t g_byThreat;
extern uint8_t g_byBrakeCounter;
extern uint8_t g_byBrakeLtPinState;
extern uint8_t g_byRelayState;
extern uint8_t g_byStateOfCharge;

#ifdef __cplusplus
extern "C" {
#endif //__cplusplus

    /** ALS Functions **/
    void readDebounceButton(void);
    void switchFlashingPattern(void);
    void flashingPattern0(void);
    void flashingPattern1(void);
    void flashingPattern2(void);
    void flashingPattern3(void);
    void flashingPattern4(void);
    void flashRearLEDS(void);
    void ALSButton_isr(void);
    void getUSThreat(void);
    void setupALS(void);
    void changeBrakeLight(void);
    void getBatteryLevel(void);
    uint8_t roundTo5(float32_t x);
    void switchRelay(void);
    float floatMap(float x, float in_min, float in_max, float out_min, float out_max);

#ifdef __cplusplus
}
#endif //__cplusplus

#endif /* als_h */


text:
class Energia < Recurso

	def costo_base
		propietario.class.costo_energia_base
	end

end


text:
:: Author:  Lisandro Dalcin
:: Contact: dalcinl@gmail.com
:: Credits: Olivier Grisel and Kyle Kastner
@ECHO OFF

SET COMMAND_TO_RUN=%*

SET PYTHON_VERSION_MAJOR=%PYTHON_VERSION:~0,1%
SET PYTHON_VERSION_MINOR=%PYTHON_VERSION:~2,1%

SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
IF %PYTHON_VERSION_MAJOR% == 2 SET WIN_SDK_VERSION="v7.0"
IF %PYTHON_VERSION_MAJOR% == 3 SET WIN_SDK_VERSION="v7.1"

IF %PYTHON_ARCH% == 64 SET USE_WIN_SDK=1
IF %PYTHON_VERSION_MAJOR% EQU 3 IF %PYTHON_VERSION_MINOR% GEQ 5 SET USE_WIN_SDK=0
IF %PYTHON_VERSION_MAJOR% GTR 3 SET USE_WIN_SDK=0
if %PYTHON_ARCH% == 32 SET USE_WIN_SDK=0

IF %USE_WIN_SDK% == 1 (
    ECHO Configuring Windows SDK %WIN_SDK_VERSION% for %PYTHON_ARCH% bit architecture
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    "%WIN_SDK_ROOT%\%WIN_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WIN_SDK_VERSION%
    "%WIN_SDK_ROOT%\%WIN_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
    ECHO Executing: %COMMAND_TO_RUN%
    CALL %COMMAND_TO_RUN% || EXIT 1
) ELSE (
    ECHO Using default MSVC build environment for %PYTHON_ARCH% bit architecture
    ECHO Executing: %COMMAND_TO_RUN%
    CALL %COMMAND_TO_RUN% || EXIT 1
)


text:
export const config = {};

export function setConfig(options) {
  Object.assign(config, options);
}

function formatMsg(msg) {
  return `${msg}${msg ? ': ' : ''}`;
}

export function assertTruthy(actual, msg = '') {
  if (!actual) {
    throw new Error(`${formatMsg(msg)}expected: truthy, actual: ${actual}`);
  }
}

export function assertFalsy(actual, msg = '') {
  if (actual) {
    throw new Error(`${formatMsg(msg)}expected: falsy, actual: ${actual}`);
  }
}

export function assertStringMatchesRegEx(actual, regex, msg = '') {
  if (!regex.test(actual)) {
    throw new Error(`${formatMsg(msg)}expected: ${regex}, actual: ${actual}`);
  }
}

export function assertLessThan(actual, expected, msg = '') {
  if (actual >= expected) {
    throw new Error(`${formatMsg(msg)}expected: ${actual} to be less than: ${expected}`);
  }
}

export function assertEqualApproximately(actual, expected, range, msg = '') {
  const diff = Math.abs(actual - expected);
  if (diff > range) {
    throw new Error(`${formatMsg(msg)}expected: ${actual} to be less ${range} different than: ${expected}`);
  }
}

export function assertInstanceOf(actual, expectedType, msg = '') {
  if (!(actual instanceof expectedType)) {
    throw new Error(`${formatMsg(msg)}expected: ${actual} to be of type: ${expectedType.constructor.name}`);
  }
}

export function assertIsArray(actual, msg = '') {
  if (!Array.isArray(actual)) {
    throw new Error(`${formatMsg(msg)}expected: ${actual} to be an Array`);
  }
}

export function assertEqual(actual, expected, msg = '') {
  // I'm sure this is not sufficient
  if (actual.length && expected.length) {
    assertArrayEqual(actual, expected);
  } else if (actual !== expected) {
    throw new Error(`${formatMsg(msg)}expected: ${expected} to equal actual: ${actual}`);
  }
}

export function assertStrictEqual(actual, expected, msg = '') {
  if (actual !== expected) {
    throw new Error(`${formatMsg(msg)}expected: ${expected} to equal actual: ${actual}`);
  }
}

export function assertNotEqual(actual, expected, msg = '') {
  if (actual === expected) {
    throw new Error(`${formatMsg(msg)}expected: ${expected} to not equal actual: ${actual}`);
  }
}

export function assertStrictNotEqual(actual, expected, msg = '') {
  if (actual === expected) {
    throw new Error(`${formatMsg(msg)}expected: ${expected} to not equal actual: ${actual}`);
  }
}

export function assertArrayEqual(actual, expected, msg = '') {
  if (actual.length !== expected.length) {
    throw new Error(`${formatMsg(msg)}expected: array.length ${expected.length} to equal actual.length: ${actual.length}`);
  }
  const errors = [];
  for (let i = 0; i < actual.length; ++i) {
    if (actual[i] !== expected[i]) {
      errors.push(`${formatMsg(msg)}expected: expected[${i}] ${expected[i]} to equal actual[${i}]: ${actual[i]}`);
      if (errors.length === 10) {
        break;
      }
    }
  }
  if (errors.length > 0) {
    throw new Error(errors.join('\n'));
  }
}

export function assertThrowsWith(func, expectations, msg = '') {
  let error = '';
  if (config.throwOnError === false) {
    const origFn = console.error;
    const errors = [];
    console.error = function(...args) {
      errors.push(args.join(' '));
    };
    func();
    console.error = origFn;
    if (errors.length) {
      error = errors.join('\n');
      console.error(error);
    }
  } else {
    try {
      func();
    } catch (e) {
      console.error(e);  // eslint-disable-line
      error = e;
    }

  }

  if (config.noLint) {
    return;
  }

  assertStringMatchesREs(error.toString().replace(/\n/g, ' '), expectations, msg);
}

// check if it throws it throws with x
export function assertIfThrowsItThrowsWith(func, expectations, msg = '') {
  let error = '';
  let threw = false;
  if (config.throwOnError === false) {
    const origFn = console.error;
    const errors = [];
    console.error = function(...args) {
      errors.push(args.join(' '));
    };
    func();
    console.error = origFn;
    if (errors.length) {
      error = errors.join('\n');
      console.error(error);
    }
  } else {
    try {
      func();
    } catch (e) {
      console.error(e);  // eslint-disable-line
      error = e;
      threw = true;
    }

  }

  if (config.noLint) {
    return;
  }

  if (!threw) {
    return;
  }

  assertStringMatchesREs(error.toString().replace(/\n/g, ' '), expectations, msg);
}

function assertStringMatchesREs(actual, expectations, msg) {
  for (const expectation of expectations) {
    if (expectation instanceof RegExp) {
      if (!expectation.test(actual)) {
        throw new Error(`${formatMsg(msg)}expected: ${expectation}, actual: ${actual}`);
      }
    }
  }

}
export function assertWarnsWith(func, expectations, msg = '') {
  const warnings = [];
  const origWarnFn = console.warn;
  console.warn = function(...args) {
    origWarnFn.call(this, ...args);
    warnings.push(args.join(' '));
  };

  let error;
  try {
    func();
  } catch (e) {
    error = e;
  }

  console.warn = origWarnFn;

  if (error) {
    throw error;
  }

  if (config.noLint) {
    return;
  }

  assertStringMatchesREs(warnings.join(' '), expectations, msg);
}

export default {
  false: assertFalsy,
  equal: assertEqual,
  matchesRegEx: assertStringMatchesRegEx,
  notEqual: assertNotEqual,
  throwsWith: assertThrowsWith,
  true: assertTruthy,
};


text:
A SQL-to-coreutils interpreter for text data munging, written in Python.

## Overview
sqltxt will parse a (*very* limited) subset of SQL and translate it into functionally equivalent coreutils and awk calls.

## Requirements

* Python 2.7
* GNU coreutils (to run the interpreted output)
* awk

## Install

```bash
git clone https://github.com/shahin/sqltxt.git
cd sqltxt
pip install -e.
```

## Examples

### Fast random sample from a large file

### Print the last few lines (but keep the header)

### Count categories

### Join multiple data sources

```bash
# sqltxt "
select
  table_a.col_a,
  table_b.col_z
from
  tests/data/table_a.txt table_a
  join tests/data/table_b.txt table_b on (table_a.col_a = table_b.col_a)
where
  table_b.col_z = 'w'
"| bash
col_a,col_z
1,w
2,x
2,y
```

See more examples in the [functional tests](/tests/functional/sqltxt_test.py).


text:
        <button type="button" class="btn btn-danger btn-circle btn-lg" ui-sref="account.dashboard"></button>

      <button type="button" class="btn btn-danger xxxl" ui-sref="account.dashboard">
         {{'CANCEL'|translate}}
      </button>

        <button type="button" class="btn btn-default btn-circle btn-lg" ng-click="register.stepBack()"
          ng-disabled="register.stepIndex == 0;"></button>

{{register.stepTitle}}

        <button type="button" class="btn btn-default btn-circle btn-lg" ng-click="register.stepForward()"
          ng-show="register.showNext" ng-disabled="register.stepIsValid === false"></button>
        <button type="button" class="btn btn-default btn-circle btn-lg" ng-click="register.completeRegistration()"
          ng-hide="register.showNext" ng-disabled="register.completed"></button>

      <wizard class="registration-wizard" name="RegistrationWizard" hide-indicators="true">
        <wz-step wz-title="{{'STEP0' | translate}}" wz-data="{translation: 'STEP0'}">

                <input type="checkbox" name="provacy" id="privacy" ng-model="register.stepIsValid" />
                {{'AGREE'|translate}}

                <button class="btn btn-primary" type="submit" ng-click="register.setStepTitle()" wz-next
                  ng-disabled="register.stepIsValid === false">{{'NEXT'
                  | translate}}</button>

        </wz-step>
        <wz-step wz-title="{{'STEP2' | translate}}" wz-data="{translation: 'STEP2'}">
          <input type="checkbox" ng-checked="register.stepIsValidChange(senseboxForm.$valid)" ng-hide="true">

          <form class="tab-pane" id="sensebox" name="senseboxForm" ng-keypress="register.enterEvent($event)" novalidate>

{{ 'STEP2_SUB1' | translate }}

                {{'STEP2_SUB1_DESCRIPTION' | translate}}

                {{ 'NAME_YOUR_STATION' | translate}}*
                <input type="text" name="name" class="form-control" ng-model="register.newSenseBox.name"
                  title="{{ 'PLEASE_SPECIFY_FIRSTNAME' | translate }}" required>

                {{'STATION_PLACEMENT'|translate}}*

                  <input type="radio" name="exposure" id="indoor" value="indoor"
                    ng-model="register.newSenseBox.exposure" required>

                    {{'STATION_PLACEMENT_INDOOR'|translate}}

                  <input type="radio" name="exposure" id="outdoor" value="outdoor"
                    ng-model="register.newSenseBox.exposure" required>

                    {{'STATION_PLACEMENT_OUTDOOR'|translate}}

                  <input type="radio" name="exposure" id="mobile" value="mobile"
                    ng-model="register.newSenseBox.exposure" required>

                    {{'STATION_PLACEMENT_MOBILE'|translate}}

                {{'GROUP_NAME'|translate}}
                <input type="text" name="tag" class="form-control" ng-model="register.tag"
                  placeholder="{{'PLEASE_SPECIFY_GROUPID'|translate}}">

{{ 'STEP2_SUB2' | translate }}

                {{'STEP2_SUB2_DESCRIPTION' | translate}}

                <osem-map id="map_register" markers="register.markers" events="register.events"></osem-map>

                    {{'BOX_LATITUDE'|translate}}
                    <input name="boxLat" class="form-control" type="number" min="-85.06" max="85.06"
                      ng-model="register.editMarkerInput.box.lat" step="0.000001" required>

                    {{'BOX_LONGITUDE'|translate}}
                    <input name="boxLng" class="form-control" type="number" min="-180" max="180"
                      ng-model="register.editMarkerInput.box.lng" step="0.000001" required>

                    {{'BOX_HEIGHT'|translate}}
                    <input name="boxHeight" class="form-control" type="number"
                      ng-model="register.editMarkerInput.box.height" step="0.5">

{{ 'STEP2_SUB3' | translate }}

                {{'STEP2_SUB3_DESCRIPTION' | translate }}

              <uib-accordion close-others="true">

                  <uib-accordion-heading>
                    senseBox:home
                  </uib-accordion-heading>

Microcontroller

senseBox:home

{{'BASED_ARDUINO' | translate}}

                                <input type="radio" name="model" id="home" value="home"
                                  ng-model="register.modelSelected.id" required>

                                  {{'SELECT' | translate}}

senseBox:home V2

{{'BASED_MCU' | translate}}

                                <input type="radio" name="model" id="homeV2" value="homeV2"
                                  ng-model="register.modelSelected.id" required>

                                  {{'SELECT' | translate}}

{{'CONNECTION_TYPE' | translate}}

                          <input type="radio" name="connection" id="sensebox-ethernet" value="Ethernet"
                            ng-model="register.newModel.connection"
                            ng-required="register.modelSelected.id === 'home' || register.modelSelected.id === 'homeV2'">

                            Ethernet

                          <input type="radio" name="connection" id="sensebox-wifi" value="Wifi"
                            ng-model="register.newModel.connection"
                            ng-required="register.modelSelected.id === 'home' || register.modelSelected.id === 'homeV2'">

                            WiFi

                          <input type="radio" name="connection" id="sensebox-lora" value="Lora"
                            ng-model="register.newModel.connection"
                            ng-required="register.modelSelected.id === 'home' || register.modelSelected.id === 'homeV2'">

                            LoRa

{{'SENSORS' | translate}}

                                      <input type="checkbox" id="tempSensor" ng-model="register.newModel.sensors.temp">

                                    {{'SENSOR_TEMP_HUMI' | translate}}

                                      <input type="checkbox" id="pressureSensor"
                                        ng-model="register.newModel.sensors.pressure">

                                    {{'SENSOR_TEMP_PRESSURE' | translate}}

                                      <input type="checkbox" id="lightSensor"
                                        ng-model="register.newModel.sensors.light">

                                    {{'SENSOR_LIGHT_UV' | translate}}

                                      <input type="checkbox" id="bmeSensor" ng-true-value="'BME680'" ng-false-value="''"
                                        ng-model="register.newModel.sensors.bme680">

                                    BME680

                                      <input type="checkbox" id="pollutionSensor" ng-true-value="'Feinstaub'"
                                        ng-false-value="''" ng-model="register.extensions.feinstaub.id">

                                    {{'SENSOR_PM' | translate}}

                                    {{'CONNECTION' | translate}}

                                      <select id="groupTag" class="form-control" style="border-radius: 4px;"
                                        ng-model="register.newModel.serialPort">

                                        <option value="Serial1">Serial 1</option>
                                        <option value="Serial2">Serial 2</option>
                                      </select>

                                      <input type="checkbox" id="soilMoistureSensor" ng-true-value="'Bodenfeuchte'"
                                        ng-false-value="''" ng-model="register.extensions.soilMoisture.id">

                                    {{'SOIL_MOISTURE' | translate}}

                                    {{'DIGITAL_PORT' | translate}}

                                      <select id="groupTagSoilMoisture" class="form-control" style="border-radius: 4px;"
                                        ng-model="register.extensions.soilMoisture.port">

                                        <option value="A">A</option>
                                        <option value="B">B</option>
                                        <option value="C">C</option>
                                      </select>

                                      <input type="checkbox" id="soundLevelMeter" ng-true-value="'Lautstärke'"
                                        ng-false-value="''" ng-model="register.extensions.soundLevelMeter.id">

                                    {{'SOUND_LEVEL' | translate}}

                                    {{'DIGITAL_PORT' | translate}}

                                      <select id="groupTagSoundLevelMeter" class="form-control"
                                        style="border-radius: 4px;" ng-model="register.extensions.soundLevelMeter.port">
                                        <option value="A">A</option>
                                        <option value="B">B</option>
                                        <option value="C">C</option>
                                      </select>

                                      <input type="checkbox" id="windSpeed" ng-true-value="'Windgeschwindigkeit'"
                                        ng-false-value="''" ng-model="register.extensions.windSpeed.id">

                                    {{'WIND_SPEED' | translate}}

                                    {{'DIGITAL_PORT' | translate}}

                                      <select id="groupTagWindSpeed" class="form-control"
                                        style="border-radius: 4px;" ng-model="register.extensions.windSpeed.port">
                                        <option value="A">A</option>
                                        <option value="B">B</option>
                                        <option value="C">C</option>
                                      </select>

                                      <input type="checkbox" id="co2" ng-true-value="'CO₂'"
                                        ng-false-value="''" ng-model="register.newModel.sensors.co2">

                                    CO2

{{'EDIT_EXTENSIONS'|translate}}

                                      <input type="checkbox" id="homeExtensionsFeinstaub" ng-true-value="'Feinstaub'"
                                        ng-false-value="''" ng-model="register.extensions.feinstaub.id">

                                    {{'EXTENSIONS_FINE_PARTICULATE_MATTER'|translate}}

                  <uib-accordion-heading>
                    senseBox:edu
                  </uib-accordion-heading>

{{'TEMPERATURE' | translate}}

(HDC1080)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('HDC1080_TEMPERATURE')">{{'ADD_SENSOR'|translate}}</button>

{{'HUMIDITY' | translate}}

(HDC1080)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('HDC1080_HUMIDITY')">{{'ADD_SENSOR'|translate}}</button>

{{'AIRPRESSURE' | translate}}

(BMP280)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('BMP280_PRESSURE')">{{'ADD_SENSOR'|translate}}</button>

{{'TEMPERATURE' | translate}}

(BMP280)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('BMP280_TEMPERATURE')">{{'ADD_SENSOR'|translate}}</button>

{{'ILLUMINATION' | translate}}

(TSL45315)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('TSL45315')">{{'ADD_SENSOR'|translate}}</button>

{{'UV' | translate}}

(VEML6070)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('VEML6070')">{{'ADD_SENSOR'|translate}}</button>

{{'PARTICULLARMATTER' | translate}} PM2.5

(SDS011)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('PM25')">{{'ADD_SENSOR'|translate}}</button>

{{'PARTICULLARMATTER' | translate}} PM10

(SDS011)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('PM10')">{{'ADD_SENSOR'|translate}}</button>

{{'TEMPERATURE' | translate}}

(BME680)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('BME680_TEMPERATURE')">{{'ADD_SENSOR'|translate}}</button>

{{'HUMIDITY' | translate}}

(BME680)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('BME680_HUMIDITY')">{{'ADD_SENSOR'|translate}}</button>

{{'AIRPRESSURE' | translate}}

(BME680)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('BME680_PRESSURE')">{{'ADD_SENSOR'|translate}}</button>

VOC

(BME680)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('BME680_VOC')">{{'ADD_SENSOR'|translate}}</button>

Bodenfeuchte

(SMT50)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('smt50_soilmoisture')">{{'ADD_SENSOR'|translate}}</button>

Bodentemperatur

(SMT50)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('smt50_soiltemperature')">{{'ADD_SENSOR'|translate}}</button>

{{'SOUND_LEVEL'|translate}}

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('soundlevelmeter')">{{'ADD_SENSOR'|translate}}</button>

{{'WIND_SPEED'|translate}}

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('windspeed')">{{'ADD_SENSOR'|translate}}</button>

CO2

(SCD30)

                            <button type="button" class="btn btn-success"
                              ng-click="register.addSensorTemplate('scd30_co2')">{{'ADD_SENSOR'|translate}}</button>

                        {{'CONFIG_ICON'|translate}}
                        {{'CONFIG_PHENOMENON'|translate}}
                        {{'CONFIG_UNIT'|translate}}
                        {{'CONFIG_TYPE'|translate}}

                          <input type="text" name="icon{{sensor.id}}" ng-hide="true" ng-model="sensor.icon" required>

                              <button id="btn-append-to-body" type="button" class="form-control btn btn-default xxxl"
                                uib-dropdown-toggle>

                              </button>

                            <input name="phenomenom{{sensor.id}}" class="form-control" type="text"
                              ng-model="sensor.title" required>

                            <input name="unit{{sensor.id}}" class="form-control" type="text" ng-model="sensor.unit"
                              required>

                            <input name="sensorType{{sensor.id}}" class="form-control" type="text"
                              ng-model="sensor.sensorType" required>

                          <button type="button" class="btn btn-danger" ng-show="register.editing[sensor.id]"
                            ng-click="register.remove(sensor.id);">

                          </button>

{{
                    'CUSTOMBOX_SENSORINCOMPLETE'|translate }}

                    <button type="button" ng-click="register.add();" class="btn btn-default">
                      {{'ADD_SENSOR'|translate}}</button>

                  <uib-accordion-heading>
                    luftdaten.info
                  </uib-accordion-heading>

                    <input type="radio" name="model" id="luftdaten-sds011" value="luftdaten_sds011"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_SDS_WITHOUT_TEMP' | translate}}

                    <input type="radio" name="model" id="luftdaten-sds011-dht11" value="luftdaten_sds011_dht11"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_SDS_WITH' | translate}} DHT11

                    <input type="radio" name="model" id="luftdaten-sds011-dht22" value="luftdaten_sds011_dht22"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_SDS_WITH' | translate}} DHT22

                    <input type="radio" name="model" id="luftdaten-sds011-dmp180" value="luftdaten_sds011_bmp180"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_SDS_WITH' | translate}} BMP180

                    <input type="radio" name="model" id="luftdaten-sds011-bme280" value="luftdaten_sds011_bme280"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_SDS_WITH' | translate}} BME280

                    <input type="radio" name="model" id="luftdaten-pms7003-bme280" value="luftdaten_pms7003_bme280"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS7003_WITH_BME' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms7003" value="luftdaten_pms7003"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS7003_WITHOUT' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms5003-bme280" value="luftdaten_pms5003_bme280"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS5003_WITH_BME' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms5003" value="luftdaten_pms5003"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS5003_WITHOUT' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms3003-bme280" value="luftdaten_pms3003_bme280"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS3003_WITH_BME' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms3003" value="luftdaten_pms3003"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS3003_WITHOUT' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms1003-bme280" value="luftdaten_pms1003_bme280"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS1003_WITH_BME' | translate}}

                    <input type="radio" name="model" id="luftdaten-pms1003" value="luftdaten_pms1003"
                      ng-model="register.modelSelected.id" required>

                      {{'LD_INFO_PMS1003_WITHOUT' | translate}}

                  <uib-accordion-heading>
                    hackAIR
                  </uib-accordion-heading>

                    <input type="radio" name="model" id="hackair-home-v2" value="hackair_home_v2"
                      ng-model="register.modelSelected.id" required>

                      hackAIR home sensor V2

                  <uib-accordion-heading>
                    {{'MANUAL_CONFIGURATION'|translate}}
                  </uib-accordion-heading>

                      <input type="radio" name="model" id="optionsRadios2" value="custom"
                        ng-model="register.modelSelected.id" required>
                      {{'MANUAL_CONFIGURATION'|translate}}

                  <textarea ng-hide="true" name="sensorsetup" id="" cols="30" rows="10" required
                    ng-model="register.sensorSetup"></textarea>

                        {{'CONFIG_ICON'|translate}}
                        {{'CONFIG_PHENOMENON'|translate}}
                        {{'CONFIG_UNIT'|translate}}
                        {{'CONFIG_TYPE'|translate}}

                          <input type="text" name="icon{{sensor.id}}" ng-hide="true" ng-model="sensor.icon" required>

                              <button id="btn-append-to-body" type="button" class="form-control btn btn-default xxxl"
                                uib-dropdown-toggle>

                              </button>

                            <input name="phenomenom{{sensor.id}}" class="form-control" type="text"
                              ng-model="sensor.title" required>

                            <input name="unit{{sensor.id}}" class="form-control" type="text" ng-model="sensor.unit"
                              required>

                            <input name="sensorType{{sensor.id}}" class="form-control" type="text"
                              ng-model="sensor.sensorType" required>

                          <button type="button" class="btn btn-danger" ng-show="register.editing[sensor.id]"
                            ng-click="register.remove(sensor.id);">

                          </button>

{{
                    'CUSTOMBOX_SENSORINCOMPLETE'|translate }}

                    <button type="button" ng-click="register.add();" class="btn btn-default">
                      {{'ADD_SENSOR'|translate}}</button>

{{
                  'REG_HARDWAREINCOMPLETE'|translate }}

              </uib-accordion>

{{ 'STEP2_SUB4' | translate }}

              <uib-accordion close-others="true">

                  <uib-accordion-heading>
                    MQTT
                  </uib-accordion-heading>

                    <input type="checkbox" id="enableMQTT" ng-model="register.mqtt.enabled">
                    {{ 'MQTT_ENABLE' | translate }}

                    {{ 'MQTT_URL' | translate}}*
                    <input type="text" name="url" class="form-control" ng-model="register.mqtt.url"
                      ng-required="register.mqtt.enabled" ng-disabled="!register.mqtt.enabled">

                    {{ 'MQTT_TOPIC' | translate}}*
                    <input type="text" name="topic" class="form-control" ng-model="register.mqtt.topic"
                      ng-required="register.mqtt.enabled" ng-disabled="!register.mqtt.enabled">

                    {{'MQTT_MESSAGEFORMAT'|translate}}*

                      <input type="radio" name="messageFormat" id="mqtt-messageformat-json" value="json"
                        ng-model="register.mqtt.messageFormat" ng-required="register.mqtt.enabled"
                        ng-disabled="!register.mqtt.enabled">

                        {{'MQTT_MESSAGEFORMAT_JSON'|translate}}

                      <input type="radio" name="messageFormat" id="mqtt-messageformat-csv" value="csv"
                        ng-model="register.mqtt.messageFormat" ng-required="register.mqtt.enabled"
                        ng-disabled="!register.mqtt.enabled">

                        {{'MQTT_MESSAGEFORMAT_CSV'|translate}}

                    {{ 'MQTT_DECODEOPTIONS' | translate}}
                    <input type="text" name="decodeOptions" class="form-control" ng-model="register.mqtt.decodeOptions"
                      ng-disabled="!register.mqtt.enabled">

                    {{ 'MQTT_CONNECTIONOPTIONS' | translate}}
                    <input type="text" name="connectionOptions" class="form-control"
                      ng-model="register.mqtt.connectionOptions" ng-disabled="!register.mqtt.enabled">

{{ 'MQTT_INVALID_URL' |
                      translate }}

                  <uib-accordion-heading>
                    TheThingsNetwork - TTN
                  </uib-accordion-heading>

                    <input type="checkbox" id="enabledTTN" ng-model="register.ttnEnabled">
                    {{ 'EDIT_TTN' | translate }}

                    {{ 'TTN_PROFILE' | translate }}
                    <select name="ttn_profile" class="form-control" ng-model="register.ttn.profile"
                      ng-required="register.ttnEnabled" ng-disabled="!register.ttnEnabled">
                      <option value="sensebox/home">senseBox:home</option>
                      <option value="lora-serialization">LoRa serialization</option>
                      <option value="json">JSON</option>
                      <option value="cayenne-lpp">Cayenne LPP (beta)</option>
                    </select>

                    {{ 'TTN_APPID' | translate }}
                    <input type="text" name="ttn_app_id" class="form-control" ng-model="register.ttn.app_id"
                      ng-required="register.ttnEnabled" ng-disabled="!register.ttnEnabled">

                    {{ 'TTN_DEVID' | translate }}
                    <input type="text" name="ttn_dev_id" class="form-control" ng-model="register.ttn.dev_id"
                      ng-required="register.ttnEnabled" ng-disabled="!register.ttnEnabled">

                    {{ 'TTN_DECODEOPTIONS' | translate }}
                    <input type="text" name="ttn_decodeoptions" class="form-control monospace"
                      ng-model="register.ttn.decodeOptions" ng-disabled="register.ttn.profile === 'sensebox/home'"
                      ng-required="register.ttn.profile !== 'sensebox/home'"
                      ng-show="register.ttn.profile != 'cayenne-lpp'">

                          {{'CONFIG_PHENOMENON'|translate}}
                          {{'CONFIG_TYPE'|translate}}
                          Cayenne LPP {{'CONFIG_PHENOMENON'|translate}}
                          Cayenne LPP Channel

                              <input name="phenomenom{{sensor.id}}" class="form-control" type="text"
                                ng-model="sensor.title" required>

                              <input name="sensorType{{sensor.id}}" class="form-control" type="text"
                                ng-model="sensor.sensorType" required>

                              <select name="cayenne_lpp_settings" class="form-control"
                                ng-model="register.ttn.cayenneLppDecoding[sensor.id].decoder"
                                ng-change="register.cayenneLppDecodingChanged(sensor)">
                                <option value="temperature">{{'TEMPERATURE' | translate}}</option>
                                <option value="relative_humidity">{{'HUMIDITY' | translate}}</option>
                                <option value="barometric_pressure">{{'AIRPRESSURE' | translate}}</option>
                                <option value="luminosity">{{'ILLUMINATION' | translate}}</option>
                                <option value="analog_in">Analog In</option>
                              </select>

                              <input class="form-control" type="number" min="0" max="64" value="1"
                                ng-model="register.ttn.cayenneLppDecoding[sensor.id].channel"
                                ng-change="register.cayenneLppDecodingChanged(sensor)">

                    {{ 'TTN_PORT' | translate }} (optional)
                    <input type="number" name="ttn_decodeoptions" class="form-control monospace"
                      ng-model="register.ttn.port" min="1" max="65535">

{{ 'TTN_INVALID_DECODEOPTS' |
                    translate }}

              </uib-accordion>

                {{'PREVIOUS' | translate}}
                <button type="submit"
                  ng-disabled="(senseboxForm.$valid) ? (register.senseBoxSetupValid()) ? false : true : true"
                  ng-click="register.stepForward()" class="btn btn-primary">{{'NEXT' | translate}}</button>

          </form>
        </wz-step>
        <wz-step wz-title="{{'STEP3' | translate}}" wz-data="{translation: 'STEP3'}">

          <form class="tab-pane" id="confirmation" name="confirmationForm" ng-keypress="register.enterEvent($event)"
            novalidate>

              {{'STEP3_DESCRIPTION' | translate}}

{{alert.msg}}

senseBox

                    Hardware
                    {{register.modelSelected.name}}

                    {{'CONNECTION' | translate}}
                    {{register.newModel.connection}}

                    senseBox {{'EDIT_EXTENSIONS'|translate}}
                    {{'EXTENSIONS_FINE_PARTICULATE_MATTER'|translate}}

                    senseBox Name
                    {{register.newSenseBox.name}}

                    {{'GROUP_NAME'|translate}}
                    {{register.tag}}

                    {{'STATION_PLACEMENT'|translate}}
                    {{register.newSenseBox.exposure}}

{{'SENSORS' | translate}}

                    {{sensor.title}} ({{sensor.unit}}) - {{sensor.sensorType}}

                {{'PREVIOUS' | translate}}
                {{'CANCEL' | translate}}
                <button type="submit" ng-click="register.completeRegistration()" wz-next
                  ng-disabled="register.registering" class="btn btn-success">{{'FINISH' | translate}}

                  Loading...
                </button>

          </form>
        </wz-step>
        <wz-step wz-title="{{'STEP4' | translate}}" wz-data="{translation: 'STEP4'}">

          <form class="tab-pane" id="last" name="lastForm" rc-step>

            <input type="password" style="display:none;">

{{alert.msg}}

senseBox

                    senseBox Model
                    {{register.modelSelected.name}}

                    senseBox Name
                    {{register.newSenseBox.name}}

                    {{'GROUP_NAME'|translate}}
                    {{register.newSenseBox.grouptag}}

                    {{'STATION_PLACEMENT'|translate}}
                    {{register.newSenseBox.exposure}}

                    senseBox ID
                    {{register.newSenseBox.id}}

                    {{'ACCESS_TOKEN'|translate}}
                    {{register.newSenseBox.access_token}}

{{'SENSORS' | translate }} & IDs

                {{'PLEASE_WAIT_DATA'|translate}}

                    {{sensor.title}} ({{sensor.unit}}) - {{sensor.sensorType}}
                    {{sensor._id}}

Arduino Code

                      <input type="checkbox" id="display_enabled" ng-model="register.display_enabled" ng-change="register.generateScript()">

                    {{'DISPLAY_ENABLED' | translate}}

                  {{'PORT'|translate}}

                    <select type="text" class="form-control" id="serialport" ng-model="register.newSenseBox.serialPort"
                      ng-change="register.generateScript()">
                      <option value="Serial1">Serial 1</option>
                      <option value="Serial2">Serial 2</option>
                    </select>

                  {{'SOIL_MOISTURE'|translate}} {{'DIGITAL_PORT'|translate}}

                    <select type="text" class="form-control" id="soilDigitalPort"
                      ng-model="register.newSenseBox.soilDigitalPort" ng-change="register.generateScript()">
                      <option value="A">A</option>
                      <option value="B">B</option>
                      <option value="C">C</option>
                    </select>

                  {{'SOUND_LEVEL'|translate}} {{'DIGITAL_PORT'|translate}}

                    <select type="text" class="form-control" id="soundMeterPort"
                      ng-model="register.newSenseBox.soundMeterPort" ng-change="register.generateScript()">
                      <option value="A">A</option>
                      <option value="B">B</option>
                      <option value="C">C</option>
                    </select>

                  {{'WIND_SPEED'|translate}} {{'DIGITAL_PORT'|translate}}

                    <select type="text" class="form-control" id="windSpeedPort"
                      ng-model="register.newSenseBox.windSpeedPort" ng-change="register.generateScript()">
                      <option value="A">A</option>
                      <option value="B">B</option>
                      <option value="C">C</option>
                    </select>

                  WiFi SSID

                    <input type="text" class="form-control" id="ssid" ng-model="register.wifi.ssid"
                      ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()">

                  WiFi {{'ACCOUNT_PASSWORD'|translate}}

                    <input type="password" class="form-control" id="password" ng-model="register.wifi.password"
                      ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()" name="whatever"
                      autocomplete="new-password">

                  Device EUI

                    <input type="text" class="form-control" id="devEUI" ng-model="register.ttn.devEUI"
                      ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()">

                  Application EUI

                    <input type="text" class="form-control" id="appEUI" ng-model="register.ttn.appEUI"
                      ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()">

                  Application Key

                    <input type="text" class="form-control" id="appKey" ng-model="register.ttn.appKey"
                      ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()">

                <button type="button" class="btn btn-success" ng-click="register.compile()"
                  ng-disabled="register.compiling">
                   {{'COMPILE'|translate}}
                </button>

{{'PLEASE_WAIT_DATA'|translate}}

              <textarea ng-show="register.boxScript" class="form-control" ng-model="register.boxScript"
                onclick="this.select()" style="resize:none;height:200px;font-family:monospace;font-size:80%"></textarea>

{{'USEFUL_LINKS' | translate}}

{{'MANUAL' | translate}}

{{'YOUR_SENSEBOX' | translate}}

          </form>
        </wz-step>
      </wizard>


text:
We'd like to stamp out all the tests that have ordering dependencies. This helps
make the tests more reliable and, eventually, will make it so we can run tests
in a random order and avoid new ordering dependencies being introduced. To get
there, we need to weed out and fix all the existing ordering dependencies.

## Diagnosing test ordering flakiness

These are steps for diagnosing ordering flakiness once you have a test that you
believe depends on an earlier test running.

### Bisect test ordering

1. Run the tests such that the test in question fails.
2. Run `./Tools/Scripts/print-test-ordering` and save the output to a file. This
   outputs the tests run in the order they were run on each content_shell
   instance.
3. Create a file that contains only the tests run on that worker in the same
   order as in your saved output file. The last line in the file should be the
   failing test.
4. Run
   `./Tools/Scripts/bisect-test-ordering --test-list=path/to/file/from/step/3`

The bisect-test-ordering script should spit out a list of tests at the end that
causes the test to fail.

*** promo
At the moment bisect-test-ordering only allows you to find tests that fail due
to a previous test running. It's a small change to the script to make it work
for tests that pass due to a previous test running (i.e. to figure out which
test it depends on running before it). Contact ojan@chromium if you're
interested in adding that feature to the script.
***

### Manual bisect

Instead of running `bisect-test-ordering`, you can manually do the work of step
4 above.

1. `run-webkit-tests --child-processes=1 --order=none --test-list=path/to/file/from/step/3`
2. If the test doesn't fail here, then the test itself is probably just flaky.
   If it does, remove some lines from the file and repeat step 1. Continue
   repeating until you've found the dependency. If the test fails when run by
   itself, but passes on the bots, that means that it depends on another test to
   pass. In this case, you need to generate the list of tests run by
   `run-webkit-tests --order=natural` and repeat this process to find which test
   causes the test in question to *pass* (e.g.
   [crbug.com/262793](https://crbug.com/262793)).
3. File a bug and give it the
   [LayoutTestOrdering](https://crbug.com/?q=label:LayoutTestOrdering) label,
   e.g. [crbug.com/262787](https://crbug.com/262787) or
   [crbug.com/262791](https://crbug.com/262791).

### Finding test ordering flakiness

#### Run tests in a random order and diagnose failures

1. Run `run-webkit-tests --order=random --no-retry`
2. Run `./Tools/Scripts/print-test-ordering` and save the output to a file. This
   outputs the tests run in the order they were run on each content_shell
   instance.
3. Run the diagnosing steps from above to figure out which tests

Run `run-webkit-tests --run-singly --no-retry`. This starts up a new
content_shell instance for each test. Tests that fail when run in isolation but
pass when run as part of the full test suite represent some state that we're not
properly resetting between test runs or some state that we're not properly
setting when starting up content_shell. You might want to run with
`--time-out-ms=60000` to weed out tests that timeout due to waiting on
content_shell startup time.

#### Diagnose especially flaky tests

1. Load
   https://test-results.appspot.com/dashboards/overview.html#group=%40ToT%20Blink&flipCount=12
2. Tweak the flakiness threshold to the desired level of flakiness.
3. Click on *webkit_tests* to get that list of flaky tests.
4. Diagnose the source of flakiness for that test.


text:
package com.suitedslime.efficientcraft.connectedtexture;

import net.minecraft.util.Icon;

public enum ConnectedTexture {

    // Connected Textures go here.
    ClearGlass("clear_glass");

    public String name;
    public Icon[] textureList;
    public boolean isRegistered;

    private ConnectedTexture(String s) {
        this.name = s;
        this.textureList = new Icon[47];
        this.isRegistered = false;
    }
}


text:
PHP.Modules.prototype.getenv = function( name ) {
    var COMPILER = PHP.Compiler.prototype,
    variableValue = name[ COMPILER.VARIABLE_VALUE ];

    switch( variableValue ) {
        case "TEST_PHP_EXECUTABLE":
            return new PHP.VM.Variable( PHP.Constants.PHP_BINARY )
            break;
        default:
            return new PHP.VM.Variable( false );

    }
};


text:
using System;

namespace Custom.Algebra.QrCode.Encoding.Tests.ErrorCorrection
{
	internal static class VersionDetailExtension
	{
		internal static VersionDetail FromString(string line)
		{
			string[] splitResult = line.Split(new char[]{';'});
			if(splitResult.Length != 4)
				throw new ArgumentException("Given string does not contain int variable required by struct");
			int version = int.Parse(splitResult[0]);
			int numTotalBytes = int.Parse(splitResult[1]);
			int numDataBytes = int.Parse(splitResult[2]);
			int numECBlocks = int.Parse(splitResult[3]);

			return new VersionDetail(version, numTotalBytes, numDataBytes, numECBlocks);
		}
	}
}


text:
import React from 'react';
import ReactDOM from 'react-dom';

import Custom from '../Affix';
import { InputContext } from '../../InputContext';

const customDriverFactory = ({ element }) => {
  return {
    isEmpty: () => element.children.length === 0,
    hasChild: style => !!element.querySelector(style),
    getValue: () => element.textContent,
  };
};

const componentFactory = (props = {}, context = {}) => {
  let element;
  const wrapperDiv = document.createElement('div');
  ReactDOM.render(
    <div ref={r => (element = r)}>
      <InputContext.Provider value={context}>
        <Custom {...props} />
      </InputContext.Provider>
    </div>,
    wrapperDiv,
  );
  return { element: element.childNodes[0], wrapper: wrapperDiv };
};

const customTestkitFactory = ({ wrapper, dataHook }) => {
  const element = wrapper.querySelector(`[data-hook='${dataHook}']`);
  return customDriverFactory({ element, wrapper });
};

export { customTestkitFactory, componentFactory, customDriverFactory };


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".StartActivity"
    tools:deviceIds="wear_round"
    android:orientation="vertical"
    android:padding="12dp">

    <TextView
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:text="@string/app_name"
        android:textSize="24sp"
        android:textColor="@color/primary_text_dark"
        />

    <Button
        android:id="@+id/start_button"
        android:layout_gravity="center"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.4"
        android:text="Start"
        android:textSize="14sp"
        android:textColor="@color/primary_text_light"
        android:background="@drawable/white_btn"
        android:layout_margin="12dp"
        />

</LinearLayout>


text:
package org.optaplanner.examples.tsp.app;

import java.util.stream.Stream;

import org.optaplanner.examples.common.app.AbstractConstructionHeuristicTest;
import org.optaplanner.examples.common.app.CommonApp;
import org.optaplanner.examples.tsp.domain.TspSolution;

class TspConstructionHeuristicTest extends AbstractConstructionHeuristicTest<TspSolution> {

    @Override
    protected CommonApp<TspSolution> createCommonApp() {
        return new TspApp();
    }

    @Override
    protected Stream<String> unsolvedFileNames() {
        return Stream.of("europe40.xml");
    }
}


text:
"""
    gaefy.jinja2.code_loaders
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Set of Jinja2 loaders that use pre-compiled templates stored as Python code.
    It is indended to be used on Google App Engine, where bytecode cache can't
    be used.

    Using these loaders, templates won't be parsed at all, only compiled from
    the pre-generated Python code. This eliminates the biggest Jinja2 overhead
    due to App Engine limitations, and complex templates will render ten or more
    times faster.

    To pre-compile whole template directories, use gaefy.jinja2.compiler.

    :copyright: 2009 by tipfy.org.
    :license: BSD, see LICENSE.txt for more details.
"""
from jinja2.loaders import FileSystemLoader, PackageLoader, DictLoader, \
    FunctionLoader, PrefixLoader, ChoiceLoader

class BaseCodeLoader(object):
    """Base mixin class for loaders that use pre-parsed Jinja2 templates stored
    as Python code.
    """
    def load(self, environment, name, globals=None):
        """Loads a pre-parsed template, stored as Python code."""
        if globals is None:
            globals = {}

        # first we try to get the source for this template together
        # with the filename and the uptodate function.
        source, filename, uptodate = self.get_source(environment, name)

        # build a python code object.
        code = compile(source, filename, 'exec')

        return environment.template_class.from_code(environment, code,
                                                    globals, uptodate)

class FileSystemCodeLoader(BaseCodeLoader, FileSystemLoader):
    pass

class PackageCodeLoader(BaseCodeLoader, PackageLoader):
    pass

class DictCodeLoader(BaseCodeLoader, DictLoader):
    pass

class FunctionCodeLoader(BaseCodeLoader, FunctionLoader):
    pass

class PrefixCodeLoader(BaseCodeLoader, PrefixLoader):
    pass

class ChoiceCodeLoader(BaseCodeLoader, ChoiceLoader):
    pass


text:
<?xml version='1.0' encoding='utf-8'?>
<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="2ee27915-693a-451f-b01e-6eb6de87df55">
    <WebsiteUrl />
    <UserAgent />
    <UserNotes />
    <LastFileSize>46047232</LastFileSize>
    <LastFileDate>2015-09-02T15:22:16-06:00</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <DownloadDate xsi:nil="true" />
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <HashVariable />
    <HashType>None</HashType>
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>nopush</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>--nopush</TextualContent>
            <Name>nopush</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <Url />
            <TextualContent>{url:regex:[\d\.]{3,\}(?=-0\.msi)}</TextualContent>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>urlPath</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?<=//)[^ "'<>\*]+-0\.msi</Regex>
            <Url>http://www.monodevelop.com/download/</Url>
            <TextualContent />
            <Name>urlPath</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>cscript</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>2</TextualContent>
            <Name>cscript</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>urlProt</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>https://</TextualContent>
            <Name>urlProt</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>url</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{urlProt}{urlPath}</TextualContent>
            <Name>url</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category />
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>F:\exe\XamarinStudio-5.9.6.23-0.msi</PreviousLocation>
    <DeletePreviousFile>false</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2015-10-04T08:57:45.5014278-06:00</LastUpdated>
    <TargetPath>{workdir}\</TargetPath>
    <FixedDownloadUrl>{url}</FixedDownloadUrl>
    <Name>monodevelop</Name>
  </ApplicationJob>
</Jobs>


text:
<?php

declare(strict_types=1);

namespace Vonage\Client\Exception;

use Vonage\Entity\HasEntityTrait;
use Vonage\Entity\Psr7Trait;

class Request extends Exception
{
    use HasEntityTrait;
    use Psr7Trait;
}


text:
package tv.savageboy74.savagetech.blocks.solargenerator;

//public class ContainerSolarGenerator extends STContainerBase
//{
//    private TileEntitySolarGenerator tileSolarGenerator;
//    private EntityPlayer player;
//
//    public int pastInternalEnergyStored;
//
//    public ContainerSolarGenerator(EntityPlayer player, TileEntitySolarGenerator tileEntitySolarGenerator) {
//        this.tileSolarGenerator = tileEntitySolarGenerator;
//        this.player = player;
//
//        this.addSlotToContainer(new SlotEnergy(tileSolarGenerator, TileEntitySolarGenerator.ENERGY_OUTPUT_INDEX, 8, 65));
//
//        for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex) {
//            for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex) {
//                this.addSlotToContainer(new Slot(player.inventory, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 8 + inventoryColumnIndex * 18, 84 + inventoryRowIndex * 18));
//            }
//        }
//
//        for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex) {
//            this.addSlotToContainer(new Slot(player.inventory, actionBarSlotIndex, 8 + actionBarSlotIndex * 18, 142));
//        }
//    }
//
//    @Override
//    public void detectAndSendChanges() {
//        super.detectAndSendChanges();
//
//        // Does this fix the casting EntityPlayerMP -> EntityPlayerSP bug?
//        if(!tileSolarGenerator.getWorld().isRemote)
//            if (this.pastInternalEnergyStored != this.tileSolarGenerator.getEnergyStored()) {
//                MessageSolarGenerator message = new MessageSolarGenerator(tileSolarGenerator.x(), tileSolarGenerator.y(), tileSolarGenerator.z(), tileSolarGenerator.getEnergyStored(null));
//                PacketHandler.sendTo(message, (EntityPlayerMP) player);
//            }
//
//        this.pastInternalEnergyStored = this.tileSolarGenerator.getEnergyStored(null);
//    }
//
//    @Override
//    public ItemStack transferStackInSlot(EntityPlayer playerIn, int slotIndex) {
//        ItemStack newItemStack = null;
//        Slot slot = (Slot) inventorySlots.get(slotIndex);
//
//        if (slot != null && slot.getHasStack()) {
//            ItemStack itemStack = slot.getStack();
//            newItemStack = itemStack.copy();
//
//
//            if (slotIndex < PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS) {
//                if (!this.mergeItemStack(itemStack, PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS, inventorySlots.size(), false)) {
//                    return null;
//                }
//            } else if (!this.mergeItemStack(itemStack, 0, PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS, false)) {
//                return null;
//            }
//
//
//            if (itemStack.stackSize == 0) {
//                slot.putStack(null);
//            } else {
//                slot.onSlotChanged();
//            }
//        }
//
//        return newItemStack;
//    }
//
//    @Override
//    public void onContainerClosed(EntityPlayer playerIn) {
//        super.onContainerClosed(playerIn);
//        tileSolarGenerator.closeInventory(playerIn);
//    }
//
//    @Override
//    public boolean canInteractWith(EntityPlayer playerIn) {
//        return this.tileSolarGenerator.isUseableByPlayer(playerIn);
//    }
//
//    public class SlotEnergy extends Slot
//    {
//
//        public SlotEnergy(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) {
//            super(inventoryIn, slotIndex, xPosition, yPosition);
//        }
//
//        @Override
//        public boolean isItemValid(ItemStack stack) {
//            return ItemHelper.isValidEnergyItem(stack);
//        }
//    }
//}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syn. meth. fung. (Göttingen) 2: 414 (1801)

#### Original name
Agaricus boltonii Pers., 1801

### Remarks
null


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

namespace Neo4j.Driver
{
    /// <summary>
    ///  Common interface for components that can execute Neo4j statements.
    /// </summary>
    /// <remarks>
    /// <see cref="IAsyncSession"/> and <see cref="IAsyncTransaction"/>
    /// </remarks>
    public interface IStatementRunner : IDisposable
    {
        /// <summary>
        ///
        /// Run a statement and return a result stream.
        ///
        /// This method accepts a String representing a Cypher statement which will be
        /// compiled into a query object that can be used to efficiently execute this
        /// statement multiple times.
        /// </summary>
        /// <param name="statement">A Cypher statement.</param>
        /// <returns>A stream of result values and associated metadata.</returns>
        IStatementResult Run(string statement);

        /// <summary>
        /// Execute a statement and return a result stream.
        /// </summary>
        /// <param name="statement">A Cypher statement.</param>
        /// <param name="parameters">A parameter dictionary which is made of prop.Name=prop.Value pairs would be created.</param>
        /// <returns>A stream of result values and associated metadata.</returns>
        IStatementResult Run(string statement, object parameters);

        /// <summary>
        ///
        /// Run a statement and return a result stream.
        ///
        /// This method accepts a String representing a Cypher statement which will be
        /// compiled into a query object that can be used to efficiently execute this
        /// statement multiple times. This method optionally accepts a set of parameters
        /// which will be injected into the query object statement by Neo4j.
        ///
        /// </summary>
        /// <param name="statement">A Cypher statement.</param>
        /// <param name="parameters">Input parameters for the statement.</param>
        /// <returns>A stream of result values and associated metadata.</returns>
        IStatementResult Run(string statement, IDictionary<string, object> parameters);

        /// <summary>
        ///
        /// Execute a statement and return a result stream.
        ///
        /// </summary>
        /// <param name="statement">A Cypher statement, <see cref="Statement"/>.</param>
        /// <returns>A stream of result values and associated metadata.</returns>
        IStatementResult Run(Statement statement);
    }
}


text:
import * as React from 'react'
import * as enzyme from 'enzyme'
import Hello from './Hello'

it('render the correct text when no enthusiam level is given', () => {
	const hello = enzyme.shallow(<Hello name="Daniel" />)
	expect(hello.find('.greeting').text()).toEqual('Hello Daniel!')
})

it('renders the correct text with an explicit enthusiasm level of 5', () => {
	const hello = enzyme.shallow(<Hello name="Daniel" enthusiasmLevel={5} />)
	expect(hello.find('.greeting').text()).toEqual('Hello Daniel!!!!!')
})

it('throws when the enthusiasm level is 0', () => {
	expect(() => {
		enzyme.shallow(<Hello name="Daniel" enthusiasmLevel={0} />)
	}).toThrow()
})


text:
layout: page
title: Mcfarland Cube Global Seminar
date: 2016-05-24
author: Philip Krueger
tags: weekly links, java
status: published
summary: Praesent hendrerit imperdiet tortor, quis vulputate.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 07/06/2017
  endDate: 07/11/2017
  ctyhocn: OMABVHX
  groupCode: MCGS
published: true
---
Ut in consectetur mi, a fringilla nunc. Curabitur vitae magna nec risus mollis interdum. Praesent ultrices dui et lacus pretium, mattis porta nulla finibus. Proin nisl quam, rhoncus sit amet egestas at, consequat sit amet nisl. Ut eget neque risus. Nam vel mollis ligula. Vivamus suscipit porta magna sit amet aliquet. Duis dapibus massa elit, a dignissim risus mattis ultrices. Cras sed augue ut nisl consectetur efficitur. Cras egestas dignissim tincidunt. Fusce auctor laoreet mauris, nec dictum elit pellentesque in. Ut vitae molestie lacus.

* Aliquam aliquet dui vitae convallis pulvinar
* Donec ac elit eget quam volutpat porttitor
* Sed eu nulla vel magna venenatis elementum vel quis justo
* Sed ultricies enim et tempus porta
* Fusce finibus felis eget neque tempor, non maximus nunc cursus.

Integer at mauris iaculis, feugiat dui at, finibus justo. Integer fringilla tortor quis rutrum sagittis. Donec scelerisque, diam suscipit dapibus ullamcorper, dolor nunc tincidunt ante, sed egestas mi lectus sit amet mauris. Quisque varius ante pellentesque orci semper commodo. In hac habitasse platea dictumst. Aliquam convallis erat nec cursus pulvinar. Aliquam erat volutpat. Nulla faucibus consectetur turpis et malesuada. Sed rutrum vitae eros sit amet ornare. Aliquam ornare arcu erat, eu condimentum nulla congue non. Fusce augue sapien, egestas in metus at, efficitur rutrum mi. Curabitur maximus lacus ut tincidunt vehicula. Nunc a elit massa. Praesent ante purus, convallis ac nisi non, dapibus tincidunt arcu. Vestibulum in mollis mauris.
Nunc fringilla pellentesque felis sit amet eleifend. Quisque eros turpis, posuere non convallis vitae, scelerisque sit amet mauris. Cras congue ante eu cursus bibendum. Nulla ex ex, gravida et quam et, iaculis blandit erat. In venenatis interdum purus, ut faucibus mi lacinia quis. Etiam vitae metus at orci commodo lobortis. In euismod commodo lacus et scelerisque. Integer odio orci, molestie non interdum et, efficitur sollicitudin dui.


text:
<?php

namespace                           Core;

/**
 * Handles DB queries
 *
 * Class Db
 * @package Core
 */
class                               Db {
    /**
     * Calls the Factory of the configured driver. (\Drivers\Database\nomDuDriver\Factory::getInstance())
     *
     * @return mixed                The DB instance
     */
    public static function          getInstance() {
        $factory = '\Drivers\Database\\'. Site::get('database.type', 'PDO') .'\\Factory';
        if (class_exists($factory))
            return $factory::getInstance();
        return false;
    }

    /**
     * Format a date, with ou without time.
     *
     * @param bool|int $timestamp   Timestamp
     * @param bool $withTime        Include time
     * @return mixed                Formatted date
     */
    public static function          date($timestamp = false, $withTime = true) {
        $factory = '\Drivers\Database\\'. Site::get('database.type', 'PDO') .'\\Date';
        if (class_exists($factory))
            return $factory::format($timestamp === false ? time() : $timestamp, $withTime);
        return false;
    }

    /**
     * Format the document ID
     *
     * @param mixed $id             Document ID
     * @return mixed                Formatted ID
     */
    public static function          id($id = false) {
        $factory = '\Drivers\Database\\'. Site::get('database.type', 'PDO') .'\\Id';
        if (class_exists($factory))
            return $factory::format($id);
        return false;
    }

    /**
     * Format a regular expression
     *
     * @param string $regex     Regexp
     * @return mixed            Formatted Regexp
     */
    public static function          regex($regex) {
        $factory = '\Drivers\Database\\'. Site::get('database.type', 'PDO') .'\\Regex';
        if (class_exists($factory))
            return $factory::format($regex);
        return false;
    }
}


text:
/*
Theme Name: sobad
Theme URI: https://blog.burrito.sh
Description: I have no idea what i'm doing
Author: urmom
Author URI: https://github.com/fly/sobad
Version: 0.1
Tags: shitty, wordpress

License: BSD
License URI: https://github.com/fly/sobad/blob/master/LICENSE

General comments (optional).
*/
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400italic,400|Inconsolata);
::selection{background:#1070C0;color:#DBDBDB;}
::-moz-selection{background:#1070C0;color:#DBDBDB;}
::-webkit-selection{background:#1070C0;color:#DBDBDB;}
body{font-family: 'Source Sans Pro', sans-serif;font-size:90%;line-height:1.5;margin:0;padding:0;padding-top:4em;text-align:center;background-color:#EEEEEE;text-rendering:optimizeLegibility;height:100%;font-weight:300;}
#wrap{margin:0 auto;text-align:left;width:90em;}
#content{font-size:1.2em;float:left;padding:1em;width:58em;position:relative;padding-bottom:1.75em;}
#sidebar{font-size:1.1em;float:right;padding-top:2em;width:15em;text-transform:uppercase}
#header{padding:2em 1em;text-transform:uppercase;text-align:left}
#footer{color:#333;clear:both;font-size:1em;padding-top:1em;position:absolute;bottom:0;height:1.25em;}
h1, h2, h3{font-family:"Source Sans Pro", "Lucida Sans", "sans-serif", Arial;font-weight:400;letter-spacing:-1px;margin:0;}
#header h1{font-family:"Source Sans Pro", "Lucida Sans", "sans-serif", Arial;font-size:3em;margin:0;margin-right:0em;}
#header h1 a{color:#1070C0;}
#header h1 a:hover{color:#1cc644;}
#header p{color:#aaa;font-size:1.1em;margin:0;margin-top:-0.5em;}
.entrytitle h2{font-size:1.8em;}
.entrytitle h2 a{color:#555555;}
.entrytitle h2 a:hover{color:#1cc644;}
.entrytitle h3{font-size:1.2em;color:#555;}
#sidebar h3{color:#555;font-size:1.5em;margin:1em 0;}
.entry{margin-bottom:1em;}
.entrymeta{font-size:0.9em;}
#sidebar ul{list-style-type:none;margin:0;padding:0;}
#sidebar ul li{margin-bottom:0.3em;padding:0.3em;}
div.comment_header {}
div.comment_gravatar {float:left;width:50px;}
div.comment_author {float:left;width:100px;}
div.comment_moderation {float:left;}
.commentsblock{margin:0.5em;padding:1em;}
.commentsblock textarea{width:35em;}
.commentsblock input, .commentsblock textarea{border:1px solid #d1d1d1;}
.commentsblock textarea:focus{background:#eee;border:1px solid #a1a1a1;}
.commentsblock textarea:focus, .commentsblock input:focus{background:#eee;border:1px solid #a1a1a1;}
.commentauthor{display:block;font-size:1.5em;}
ol.commentlist{color:#777;font-size:0.9em;list-style-type:none;margin:0;margin-top:1.5em;padding:0;}
.commentlist li{margin-bottom:0.5em;padding:0.5em 1em;}
.alt{background:#f3f5e9;border:1px dotted #d1d1d1;padding:0.5em;}
h3#comments{font-size:1.6em;}
a{color:#1070C0;text-decoration:none;}
a:hover{color:#1CC644;}
code{font-family:"Inconsolata", "Menlo", "Monaco", "Lucida Console";font-size:90%;border:1px solid;border-radius:2px;display:block;margin-top:4px;margin-bottom:12px;padding:6px;line-height:1.5;border-radius:4px 4px 4px 4px;border:1px solid rgb(204,204,204);background-color:rgb(248,248,248);}
dt.about{font-size:1.5em;border-bottom:1px solid rgba(85, 85, 85, 0.5);width:10em;padding-bottom:0.10em;padding-top:3em;}
dd.about{padding-top:1em;}
dt.top_dt{padding-top:0;}
#about_container{overflow:hidden;text-align:left;margin:0px auto;padding:0px;border:0;width:100%;}
#about_right{float:left;width:75%;overflow:hidden;}
#about_left{float:left;width:25%;overflow:hidden;}
div.gravatar_w_caption{padding-bottom:0.5em;width:160px;background-color:#555555;color:#EEEEEE;}
div.gravatar_w_caption h2{text-align:center;}
.author_entry a{font-style:italic;color:#555555;}
.author_entry a:hover{color:#1CC644;}
.author_entry dd{padding-top:0em;padding:0em;}
div.author_entry{padding-top:1em;}