text:
<!DOCTYPE html>
<!--
 * Copyright 2012 Research In Motion Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<html>
<head>
	<title>Sensors</title>
	<script type="text/javascript" src="cordova.js"></script>
	<link rel="stylesheet" type="text/css" href="bbUI/bbui-min.css">
	<link rel="stylesheet" type="text/css" href="css/styles.css">
	<script type="text/javascript" src="bbUI/bbui-min.js"></script>
	<script type="text/javascript" src="Flotr2/flotr2.min.js"></script>
	<script type="text/javascript">
	var rippleLoaded = false;
	window.addEventListener('load',function() {
		document.addEventListener('deviceready', function(e) {
			// This is a hack for Ripple calling webworksready multiple times
			if (rippleLoaded) return;
			rippleLoaded = true;

			bb.init({actionBarDark: true,
				controlsDark: true,
				listsDark: true,
				// Fires "before" styling is applied and "before" the screen is inserted in the DOM
				onscreenready: function(element, id) {
					// Choose the sensor based on ID of the link selected, and start listening
					var sensor = bbsensors[id];
					if (sensor && sensor.name) {
						bbsensors.listen(sensor);
					} else {
						bbsensors.listen('');
					}
				},
				// Fires "after" styling is applied and "after" the screen is inserted in the DOM
				ondomready: function(element, id) {
					// Reset graph and painting loop
					bbsensors.container = null;
					bbsensors.stopPainting();
					if (id == 'options') {
						// Options values need to be updated in the controls after they appear
						document.getElementById('opt_delay').setSelectedText(bbsensors.options.delay.toString());
						document.getElementById('opt_background').setChecked(bbsensors.options.background);
						document.getElementById('opt_batching').setChecked(bbsensors.options.batching);
						document.getElementById('opt_queue').setChecked(bbsensors.options.queue);
						document.getElementById('opt_reducedReporting').setChecked(bbsensors.options.reducedReporting);
					} else if (id == 'menu') {
						// do nothing for menu
					} else {
						bbsensors.startPainting();
					}
				}
			});
			blackberry.event.addEventListener("pause", bbsensors.stopPainting);
			blackberry.event.addEventListener("resume", bbsensors.startPainting);
			bb.pushScreen('menu.html', 'menu');
		}, false);
	});

	// The bbsensors object will hold all our sensor settings and methods for the application.
	var bbsensors = {
		// This object is passed to the Sensor API just before listening starts
		options: {
			delay: 20000,
			background: false,
			batching: true,
			queue: false,
			reducedReporting: false
		},
		currentSensor: null,
		// Sets the sensor event listener keyed off the objects defined later
		listen: function(sensor) {
			if (bbsensors.currentSensor !== null && bbsensors.currentSensor !== "") {
				blackberry.event.removeEventListener(bbsensors.currentSensor.name, bbsensors.currentSensor.callback);
			}
			bbsensors.currentSensor = sensor;
			if (bbsensors.currentSensor) {
				bbsensors.graphOptions.title = sensor.title;
				bbsensors.pieOptions.title = sensor.title;
				bbsensors.clear();
				blackberry.sensors.setOptions(bbsensors.currentSensor.name, bbsensors.options);
				blackberry.event.addEventListener(bbsensors.currentSensor.name, bbsensors.currentSensor.callback);
			}
		},
		// Acceleration in xyz axes in m/s/s
		deviceaccelerometer: {
			name: 'deviceaccelerometer',
			title: 'Accelerometer',
			dataPoints: ['x', 'y', 'z'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Magnetic Flux in xyz axes in uT (micro Teslas)
		devicemagnetometer: {
			name: 'devicemagnetometer',
			title: 'Magnetometer',
			dataPoints: ['x', 'y', 'z'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Device movement in xyz in radians/s
		// Also returns temperature of the sensor
		devicegyroscope: {
			name: 'devicegyroscope',
			title: 'Gyroscope',
			dataPoints: ['x', 'y', 'z', 'temperature'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Azimuth from Magnetic North
		// Also returns 'isFaceDown' property, not used here
		devicecompass: {
			name: 'devicecompass',
			title: 'Compass',
			dataPoints: ['value'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Proximity reading where value is 0 (close) or 1 (far)
		// and normalized provides a range of values between 0 and 1
		// to describe the proximity
		deviceproximity: {
			name: 'deviceproximity',
			title: 'Proximity',
			dataPoints: ['value', 'normalized'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Ambient light in lux
		devicelight: {
			name: 'devicelight',
			title: 'Luminosity',
			dataPoints: ['value'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Acceleration of the device only caused by gravity
		devicegravity: {
			name: 'devicegravity',
			title: 'Gravity',
			dataPoints: ['x', 'y', 'z'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Acceleration of the device without gravity impacts
		devicelinearacceleration: {
			name: 'devicelinearacceleration',
			title: 'Linear Acceleration',
			dataPoints: ['x', 'y', 'z'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// 3x3 Rotation Matrix to describe the orientation of the device
		devicerotationmatrix: {
			name: 'devicerotationmatrix',
			title: 'Rotation Matrix',
			dataPoints: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// Screen orientation data in angles that the screen is rotated,
		// and description of screen 'face' orientation, ie: 'FACE_UP'
		deviceorientation: {
			name: 'deviceorientation',
			title: 'Orientation',
			dataPoints: ['screen', 'face'],
			labels: ['0', '90', '180', '270'],
			callback: function (data) {
				bbsensors.pushPie(data);
			}
		},
		// Device orientation Angles in Azimuth from Magnetic North,
		// Pitch from -180 to 180, and Roll from -90 to 90 degrees.
		deviceazimuthpitchroll: {
			name: 'deviceazimuthpitchroll',
			title: 'Azimuth Pitch Roll',
			dataPoints: ['azimuth', 'pitch', 'roll'],
			callback: function (data) {
				bbsensors.pushValue(data);
			}
		},
		// 1 if Holstered, 0 if not
		deviceholster: {
			name: 'deviceholster',
			title: 'Holster',
			dataPoints: ['value'],
			labels: ['0', '1'],
			callback: function (data) {
				bbsensors.pushPie(data);
			}
		},
		// data object holds our cache of sensor readings
		data: {},
		// reference to the Canvas element to paint on
		container: null,
		// These are Flotr2 settings for the Line Graphs
		graphOptions: {
			title: '',
			subtitle: '',
			// colors: ['#00A8F0', '#C0D800', '#CB4B4B', '#4DA74D', '#9440ED'],
			xaxis: {
				showLabels: false,
			},
			yaxis: {
				autoscale: true
			},
			grid: {
				tickColor: '#545454'
			},
			legend: {
				backgroundOpacity: 0,
				labelBoxBorderColor: '#262626',
				position: 'sw'
			}
		},
		// Flotr2 settings for the Pie Graphs
		pieOptions: {
			title: '',
			subtitle: '',
			xaxis: {
				showLabels: false,
			},
			yaxis: {
				showLabels: false
			},
			grid: {
				verticalLines: false,
	            horizontalLines: false
			},
			pie: {
				show: true,
				explode: 10
			},
			legend: {
				backgroundOpacity: 0,
				labelBoxBorderColor: '#262626',
				position: 'sw'
			}
		},
		// Limit the cache of data readings to this value
		// Has performance impacts the higher you go
		maxDataElements: 400,
		// Refernce to our painter Timeout function
		timeout: null,
		// Used in Pie Charts to determine elapsed time
		lastTimeStamp: 0,
		// Push the data values into the cache for the Line Graph
		// Uses each bbsensors sensor definition to determine what values to capture
		pushValue: function (data) {
			var dataValue;
			for (point in bbsensors.currentSensor.dataPoints) {
				label = bbsensors.currentSensor.dataPoints[point];
				if (bbsensors.currentSensor == bbsensors.devicerotationmatrix) {
					dataValue = data.matrix[point];
				} else {
					dataValue = data[label];
				}
				bbsensors.data[label].push([data.timestamp, dataValue]);
			}
			bbsensors.graphOptions.subtitle = data.accuracy;
			bbsensors.truncateValue();
		},
		// Push the data values into the cache for the Pie Chart
		// Uses each bbsensors sensor definition to determine what values to capture
		// Adds up the time since the last reading to create the pie slices
		pushPie: function (data) {
			var value = bbsensors.currentSensor.dataPoints[0];
			if (bbsensors.lastTimeStamp == 0) {
				for (label in bbsensors.currentSensor.labels) {
					bbsensors.data[value][bbsensors.currentSensor.labels[label]] = [0, 0];
				}
				bbsensors.data[value][0][1] += 1;
			} else {
				bbsensors.data[value][data[value]][1] += (data.timestamp - bbsensors.lastTimeStamp);
			}
			if (data.face) {
				bbsensors.pieOptions.subtitle = data.face;
			} else {
				bbsensors.pieOptions.subtitle = bbsensors.currentSensor.labels[data[value]];
			}
			bbsensors.lastTimeStamp = data.timestamp;
		},
		// Reset all data values to an empty array
		clear: function () {
			bbsensors.lastTimeStamp = 0;
			bbsensors.data = {};
			var label;
			for (point in bbsensors.currentSensor.dataPoints) {
				label = bbsensors.currentSensor.dataPoints[point];
				bbsensors.data[label] = [];
			}
		},
		// Trim the cache to keep under our maxDataElements setting
		truncateValue: function () {
			var toRemove = 0;
			for (point in bbsensors.currentSensor.dataPoints) {
				label = bbsensors.currentSensor.dataPoints[point];
				toRemove = bbsensors.data[label].length - bbsensors.maxDataElements;
				if (toRemove > 0) {
					bbsensors.data[label].splice(0, toRemove);
				}
			}
		},
		// Format the data points and send to Flotr2 for painting as a Line Graph
		// Sets a timeout to paint itself again rapidly
		paintGraph: function () {
			var drawData = [];
			for (point in bbsensors.currentSensor.dataPoints) {
				label = bbsensors.currentSensor.dataPoints[point];
				drawData.push({ data: bbsensors.data[label], label: label });
			}
			Flotr.draw(bbsensors.container, drawData, bbsensors.graphOptions);
			bbsensors.timeout = setTimeout(function() { bbsensors.paintGraph() }, 4);
		},
		// Format the data points and send to Flotr2 for painting as a Pie Chart
		// Sets a timeout to paint itself again rapidly
		paintPie: function () {
			var drawData = [];
			var value = bbsensors.currentSensor.dataPoints[0];
			for (slice in bbsensors.data[value]) {
				drawData.push({ data: [bbsensors.data[value][slice]], label: slice });
			}
			Flotr.draw(bbsensors.container, drawData, bbsensors.pieOptions);
			bbsensors.timeout = setTimeout(function() { bbsensors.paintPie() }, 4);
		},
		// Initiate the painting loop
		// Called when switching to the graph screen and on a resume
		startPainting: function () {
			// Capture our canvas element for painting and start the right paint function
			bbsensors.container = document.getElementById('graph');
			if (bbsensors.container) {
				if (bbsensors.currentSensor.name == 'deviceorientation' || bbsensors.currentSensor.name == 'deviceholster') {
					bbsensors.paintPie();
				} else {
					bbsensors.paintGraph();
				}
			}
		},
		// Stop the painting loop
		// Called on application pause and when changing screens
		stopPainting: function () {
			clearTimeout(bbsensors.timeout);
		}
	};
	</script>
</head>
<body></body>
</html>


text:
<?php

namespace Lanin\Laravel\ApiExceptions\Contracts;

interface ShowsPrevious
{

}

redpajama_set_name: RedPajamaGithub


text: Code stubs and samples for building microservices with gRPC


text:
// JSDoc plugin to customize jsdoc for Shaka Player

'use strict';

// Define custom tags.
exports.defineTags = function(dictionary) {
  let exportOpts = {
    mustNotHaveValue: true,
    onTagged: function(doclet, tag) {
      doclet.access = 'export';
    },
  };

  // Truly exported by the compiler.
  dictionary.defineTag('export', exportOpts);
  // Interface exported in the generated externs only.
  dictionary.defineTag('exportInterface', exportOpts);
  // A namespace, event, etc. exported only in the docs.
  dictionary.defineTag('exportDoc', exportOpts);

  // For use @namespace should be treated like @class, except that we don't
  // want to show the non-existent constructor.
  let classOpts = dictionary.lookUp('class');
  dictionary.defineTag('namespace', {
    onTagged: function(doclet, tag) {
      classOpts.onTagged(doclet, tag);
      doclet.hideconstructor = true;
    },
  });
};

exports.handlers = {
  processingComplete: function(e) {
    // Fill out the "implementations" field so that interface implementations
    // can be listed on the interface docs.

    let doclets = e.doclets;
    let map = {};
    doclets.forEach(function(doc) {
      map[doc.longname] = doc;
    });

    doclets.forEach(function(doc) {
      // Skip things that do not implement an interface.
      if (!doc.implements) return;
      // Skip things which are not classes (such as methods).
      if (doc.kind != 'class') return;

      doc.implements.forEach(function(interfaceName) {
        // If the interface is a template, strip the template type.
        interfaceName = interfaceName.split('.<')[0];

        var interfaceDoc = map[interfaceName];
        // Skip unknown interfaces, which occurs for externs like MediaKeys.
        if (!interfaceDoc) return;

        interfaceDoc.implementations = interfaceDoc.implementations || [];
        interfaceDoc.implementations.push(doc.longname);
      });
    });
  },
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<ac:application xmlns:ac="http://tel.dur.ac.uk/xml/schemas/synergynetappconfig"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://tel.dur.ac.uk/xml/schemas/synergynetappconfig ../../../../config/schemas/synergynetapplication.xsd ">
	<ac:info name="Presence Detection" author="TEL Durham"
		uuid="4e1cff84-9a86-4687-8c03-32c4a16ec6ec" version="0.1" />
	<ac:clientcomponent
		classname="apps.presence.TablePresenceApp"
		iconresource="pd.png" showicon="true">
		<ac:reactivatepolicy>resume</ac:reactivatepolicy>
	</ac:clientcomponent>
</ac:application>


text:
define([
    'dojo/_base/declare',
    'dojo/_base/array',
    "dojo/_base/lang",
    'dojo/_base/Color',
    'dojo/on',
    "dojo/query",
    "dojo/_base/html",
    'dijit/_WidgetBase',
    'dijit/_TemplatedMixin',
    'dijit/_WidgetsInTemplateMixin',
    'dojo/text!../templates/ColorPickerEditor.html',
    "dijit/form/HorizontalSlider",
    'jimu/dijit/ColorPickerPopup',
    "dijit/form/NumberSpinner"
  ],
  function (declare, array, lang, Color, on, query, html,
    _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template,
    HorizontalSlider, ColorPicker) {
    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
      _defaultColor: '#485566',
      templateString: template,
      nls: null,

      postCreate: function () {
        this.colorPicker = new ColorPicker({
          color: this._defaultColor,
          tabindex: "0",
          "aria-label": this.nls.colorPicker
        }, this.colorPicker);
        this.colorPicker.startup();

        this.slider = new HorizontalSlider({
          name: "slider",
          value: 100,
          minimum: 0,
          maximum: 100,
          discreteValues: 101,
          intermediateChanges: true,
          showButtons: false,
          style: "display: inline-block;",
          "aria-label": this.nls.transparency
        }, this.sliderBar);
        this.slider.startup();

        var options = [],
          option;
        var lineStyles = [
          "esriSLSDash",
          "esriSLSDashDot",
          "esriSLSDashDotDot",
          "esriSLSDot",
          "esriSLSLongDash",
          "esriSLSLongDashDot",
          "esriSLSNull",
          "esriSLSShortDash",
          "esriSLSShortDashDot",
          "esriSLSShortDashDotDot",
          "esriSLSShortDot",
          "esriSLSSolid"
        ];
        var fillStyles = [
          "esriSFSBackwardDiagonal",
          "esriSFSCross",
          "esriSFSDiagonalCross",
          "esriSFSForwardDiagonal",
          "esriSFSHorizontal",
          "esriSFSNull",
          "esriSFSSolid",
          "esriSFSVertical"
        ];
        if (this.type === 'line') {
          array.forEach(lineStyles, lang.hitch(this, function (style) {
            option = {
              value: style,
              label: this.nls.lineStyles[style]
            };
            options.push(option);
          }));
        } else {
          array.forEach(fillStyles, lang.hitch(this, function (style) {
            option = {
              value: style,
              label: this.nls.fillStyles[style]
            };
            options.push(option);
          }));
        }
        this.dropdown.addOption(options);

        this.inherited(arguments);
      },

      startup: function () {
        this.own(on(this.slider, 'change', lang.hitch(this, function (val) {
          if (false === this._isSameVal()) {
            this.spinner.setValue(val);
          }
        })));

        this.own(on(this.spinner, 'change', lang.hitch(this, function (val) {
          if (val <= this.slider.maximum) {
            this.slider.setValue(val);
          }
        })));

        this._stylePolyfill();
        this.inherited(arguments);
      },

      _isSameVal: function () {
        return this.slider.getValue() === this.spinner.getValue();
      },

      getValues: function () {
        var rgb = null,
          a = null;
        var bgColor = this.colorPicker.getColor();
        if (bgColor && bgColor.toHex) {
          rgb = bgColor.toHex();
        }
        a = this.spinner.getValue() / 100;

        return {
          color: rgb,
          transparency: a
        };
      },

      setValues: function (obj) {
        if (typeof obj === "object" || typeof obj === "string") {
          this.colorPicker.setColor(new Color(obj.color));

          if (typeof obj.transparency === "undefined") {
            obj.transparency = 0;
          } else {
            obj.transparency = obj.transparency * 100;
          }
          this.slider.setValue(obj.transparency);
          this.spinner.setValue(obj.transparency);
        }
      },
      _stylePolyfill: function () {
        var leftBumper = query('.dijitSliderLeftBumper', this.domNode)[0];
        if (leftBumper && leftBumper.parentNode) {
          html.setStyle(leftBumper.parentNode, 'background-color', "#24b5cc");
        }
      },

      validateSpinner: function () {
        var isValid = true;
        if (!this.spinner.isValid()) {
          this._shake(this.spinner.domNode, 16);
          this.spinner.focus();
          isValid = false;
        }
        return isValid;
      },

      //Source: https://stackoverflow.com/questions/36962903/javascript-shake-html-element
      _shake: function (element, magnitude) {
        //A counter to count the number of shakes
        var counter = 1;
        //The total number of shakes (there will be 1 shake per frame)
        var numberOfShakes = 15;
        //Capture the element's position and angle so you can
        //restore them after the shaking has finished
        var startX = 0,
          startY = 0;
        // Divide the magnitude into 10 units so that you can
        // reduce the amount of shake by 10 percent each frame
        var magnitudeUnit = magnitude / numberOfShakes;
        //The `randomInt` helper function
        var randomInt = function (min, max) {
          return Math.floor(Math.random() * (max - min + 1)) + min;
        };
        //Add the element to the `shakingElements` array if it
        //isn't already there
        if (!this._shakingElements) {
          this._shakingElements = [];
        }
        if (this._shakingElements.indexOf(element) === -1) {
          //console.log("added")
          this._shakingElements.push(element);
          //Add an `updateShake` method to the element.
          //The `updateShake` method will be called each frame
          //in the game loop. The shake effect type can be either
          //up and down (x/y shaking) or angular (rotational shaking).
          var self = this;
          _upAndDownShake();
        }

        function _upAndDownShake() {
          //Shake the element while the `counter` is less than
          //the `numberOfShakes`
          if (counter < numberOfShakes) {
            //Reset the element's position at the start of each shake
            element.style.transform = 'translate(' + startX + 'px, ' + startY + 'px)';
            //Reduce the magnitude
            magnitude -= magnitudeUnit;
            //Randomly change the element's position
            var randomX = randomInt(-magnitude, magnitude);
            var randomY = randomInt(-magnitude, magnitude);
            element.style.transform = 'translate(' + randomX + 'px, ' + randomY + 'px)';
            //Add 1 to the counter
            counter += 1;
            requestAnimationFrame(_upAndDownShake);
          }
          //When the shaking is finished, restore the element to its original
          //position and remove it from the `shakingElements` array
          if (counter >= numberOfShakes) {
            element.style.transform = 'translate(' + startX + ', ' + startY + ')';
            self._shakingElements.splice(self._shakingElements.indexOf(element), 1);
          }
        }
      }
    });
  });


text:
import sbt.Keys.version
import sbt._

object Common {
  val versionString = "1.46"
  val scalaVersionString = "2.11.8"
  val organisationString = "dvla"
  val organisationNameString = "Driver & Vehicle Licensing Agency"
  val nexus = "http://rep002-01.skyscape.preview-dvla.co.uk:8081/nexus/content/repositories"

  val scalaOptionsSeq = Seq(
    "-deprecation",
    "-unchecked",
    "-feature",
    "-Xlint",
    "-language:reflectiveCalls",
    "-Xmax-classfile-name", "128"
  )

  val projectResolvers = Seq(
    "typesafe repo" at "http://repo.typesafe.com/typesafe/releases",
    "spray repo" at "http://repo.spray.io/",
    "local nexus snapshots" at s"$nexus/snapshots",
    "local nexus releases" at s"$nexus/releases"
  )

  val publishResolver: sbt.Def.Initialize[Option[sbt.Resolver]] = version { v: String =>
    if (v.trim.endsWith("SNAPSHOT"))
      Some("snapshots" at s"$nexus/snapshots")
    else
      Some("releases" at s"$nexus/releases")
  }

  val sbtCredentials = Credentials(Path.userHome / ".sbt/.credentials")
}


text:
#ifndef XENIA_CPU_BACKEND_X64_X64_BACKEND_H_
#define XENIA_CPU_BACKEND_X64_X64_BACKEND_H_

#include <gflags/gflags.h>

#include <memory>

#include "xenia/cpu/backend/backend.h"

DECLARE_bool(enable_haswell_instructions);

namespace xe {
class Exception;
}  // namespace xe
namespace xe {
namespace cpu {
namespace backend {
namespace x64 {

class X64CodeCache;

#define XENIA_HAS_X64_BACKEND 1

typedef void* (*HostToGuestThunk)(void* target, void* arg0, void* arg1);
typedef void* (*GuestToHostThunk)(void* target, void* arg0, void* arg1);
typedef void (*ResolveFunctionThunk)();

class X64Backend : public Backend {
 public:
  static const uint32_t kForceReturnAddress = 0x9FFF0000u;

  explicit X64Backend(Processor* processor);
  ~X64Backend() override;

  X64CodeCache* code_cache() const { return code_cache_.get(); }
  uint32_t emitter_data() const { return emitter_data_; }

  // Call a generated function, saving all stack parameters.
  HostToGuestThunk host_to_guest_thunk() const { return host_to_guest_thunk_; }
  // Function that guest code can call to transition into host code.
  GuestToHostThunk guest_to_host_thunk() const { return guest_to_host_thunk_; }
  // Function that thunks to the ResolveFunction in X64Emitter.
  ResolveFunctionThunk resolve_function_thunk() const {
    return resolve_function_thunk_;
  }

  bool Initialize() override;

  void CommitExecutableRange(uint32_t guest_low, uint32_t guest_high) override;

  std::unique_ptr<Assembler> CreateAssembler() override;

  std::unique_ptr<GuestFunction> CreateGuestFunction(Module* module,
                                                     uint32_t address) override;

  bool InstallBreakpoint(Breakpoint* bp) override;
  bool InstallBreakpoint(Breakpoint* bp, Function* func) override;
  bool UninstallBreakpoint(Breakpoint* bp) override;

 private:
  static bool ExceptionCallbackThunk(Exception* ex, void* data);
  bool ExceptionCallback(Exception* ex);

  std::unique_ptr<X64CodeCache> code_cache_;

  uint32_t emitter_data_;

  HostToGuestThunk host_to_guest_thunk_;
  GuestToHostThunk guest_to_host_thunk_;
  ResolveFunctionThunk resolve_function_thunk_;
};

}  // namespace x64
}  // namespace backend
}  // namespace cpu
}  // namespace xe

#endif  // XENIA_CPU_BACKEND_X64_X64_BACKEND_H_


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityGenerator.Core
{
    /// <summary>
    /// Contains the metadata needed by the <see cref="ITypeGenerator"/> for generating a property.
    /// </summary>
    public abstract class PropertyDefinition
    {
        /// <summary>
        /// Creates a new instance of <seealso cref="PropertyDefinition"/>.
        /// </summary>
        public PropertyDefinition() { }

        /// <summary>
        /// Creates a new instance of <seealso cref="PropertyDefinition"/> using the given <paramref name="name"/> and <paramref name="type"/>.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <param name="type">The <seealso cref="Type"/> of the property.</param>
        public PropertyDefinition(string name, Type type)
        {
            Name = name;
            Type = type;
        }

        /// <summary>
        /// The name of the property.
        /// </summary>
        public string Name { get; private set; }
        /// <summary>
        /// The <see cref="Type"/> of the property.
        /// </summary>
        public Type Type { get; private set; }
    }

    /// <summary>
    /// Contains the metadata needed by the <see cref="ITypeGenerator"/> for generating a property.
    /// </summary>
    /// <typeparam name="TType">The <seealso cref="Type"/> of the property.</typeparam>
    public class PropertyDefinition<TType> : PropertyDefinition
    {
        /// <summary>
        /// Creates a new instance of <seealso cref="PropertyDefinition"/> using the given <paramref name="name"/> and <typeparamref name="TType"/> as the <see cref="Type"/> of the property.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        public PropertyDefinition(string name)
            : base(name, typeof(TType)) { }
    }
}


text:
/**
 * Module: TYPO3/CMS/Backend/ValueSlider
 */
define(['jquery', 'twbs/bootstrap-slider'], function($) {
	/**
	 * ValueSlider object
	 *
	 * @type {{selector: string}}
	 * @exports TYPO3/CMS/Backend/ValueSlider
	 */
	var ValueSlider = {
		selector: '[data-slider-id]'
	};

	/**
	 * Initialize all slider elements
	 */
	ValueSlider.initializeSlider = function() {
		var $sliders = $(ValueSlider.selector);
		if ($sliders.length > 0) {
			$sliders.slider({
				formatter: ValueSlider.renderTooltipValue
			});
			$sliders.on('change', ValueSlider.updateValue);
		}
	};

	/**
	 * Update value of slider element
	 *
	 * @param {Event} e
	 */
	ValueSlider.updateValue = function(e) {
		var $slider = $(e.currentTarget),
			$foreignField = $('[data-formengine-input-name="' + $slider.data('sliderItemName') + '"]'),
			elementType = $slider.data('sliderElementType'),
			sliderField = $slider.data('sliderField'),
			sliderCallbackParams = $slider.data('sliderCallbackParams');

		switch (elementType) {
			case 'input':
				$foreignField.val(e.value.newValue);
				break;
			case 'select':
				$foreignField.find('option').eq(e.value.newValue).prop('selected', true);
				break;
		}

		TBE_EDITOR.fieldChanged.apply(TBE_EDITOR, sliderCallbackParams);
	};

	/**
	 *
	 * @param {Number} value
	 * @returns {*}
	 */
	ValueSlider.renderTooltipValue = function(value) {
		var renderedValue,
			$slider = $('[data-slider-id="' + this.id + '"]'),
			data = $slider.data();
		switch (data.sliderValueType) {
			case 'array':
				var $foreignField = $('[data-formengine-input-name="' + data.sliderItemName + '"]');
				renderedValue = $foreignField.find('option').eq(value).text();
				break;
			case 'double':
				renderedValue = parseFloat(value).toFixed(2);
				break;
			case 'int':
			default:
				renderedValue = parseInt(value);
		}

		return renderedValue;
	};

	// init if document is ready
	$(document).ready(function() {
		ValueSlider.initializeSlider();
	});

	return ValueSlider;
});


text:
{% extends "base.html" %}
{% load account %}

{% block head_title %}New login link{% endblock %}

{% block content %}

Request a new login link

      Need a new login link to access your account? Enter your email address
      below and we'll send you a fresh link to login.

    <form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
        {% csrf_token %}
        {{ form.as_p }}
        <input type="submit" value="Send a new login link" />
    </form>

      Our email may take a few minutes to arrive. Please contact us if you
      have trouble logging in to the site.

{% endblock %}


text:
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
taskqueue_sid = 'WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::TaskRouterClient.new account_sid,
                                            auth_token,
                                            workspace_sid

statistics = client.workspace.task_queues.get(taskqueue_sid).statistics
puts statistics.cumulative['reservations_accepted']


text:
<?php

namespace Oro\Bundle\EntityConfigBundle\Tests\Unit\Form\EventListener;

use Doctrine\Common\Collections\ArrayCollection;
use Oro\Bundle\EntityConfigBundle\Config\Config;
use Oro\Bundle\EntityConfigBundle\Config\ConfigManager;
use Oro\Bundle\EntityConfigBundle\Config\Id\EntityConfigId;
use Oro\Bundle\EntityConfigBundle\Entity\ConfigModel;
use Oro\Bundle\EntityConfigBundle\Entity\EntityConfigModel;
use Oro\Bundle\EntityConfigBundle\Entity\FieldConfigModel;
use Oro\Bundle\EntityConfigBundle\Form\EventListener\ConfigSubscriber;
use Oro\Bundle\EntityConfigBundle\Provider\PropertyConfigContainer;
use Oro\Bundle\EntityConfigBundle\Tests\Unit\ReflectionUtil;
use Oro\Bundle\EntityConfigBundle\Translation\ConfigTranslationHelper;
use Oro\Bundle\TranslationBundle\Translation\Translator;
use Symfony\Component\Form\FormEvents;

class ConfigSubscriberTest extends \PHPUnit\Framework\TestCase
{
    /** @var ConfigManager|\PHPUnit\Framework\MockObject\MockObject */
    protected $configManager;

    /** @var Translator|\PHPUnit\Framework\MockObject\MockObject */
    protected $translator;

    /** @var ConfigTranslationHelper|\PHPUnit\Framework\MockObject\MockObject */
    protected $translationHelper;

    /** @var ConfigSubscriber */
    protected $subscriber;

    protected function setUp()
    {
        $this->configManager = $this->createMock(ConfigManager::class);
        $this->translator = $this->createMock(Translator::class);
        $this->translationHelper = $this->createMock(ConfigTranslationHelper::class);

        $this->subscriber = new ConfigSubscriber(
            $this->translationHelper,
            $this->configManager,
            $this->translator
        );
    }

    public function testGetSubscribedEvents()
    {
        $this->assertEquals(
            [
                FormEvents::POST_SUBMIT  => ['postSubmit', -10],
                FormEvents::PRE_SET_DATA => 'preSetData'
            ],
            ConfigSubscriber::getSubscribedEvents()
        );
    }

    /**
     * @dataProvider preSetDataProvider
     * @param array $data
     * @param ConfigModel $model
     * @param array $trans
     * @param array $expectedData
     */
    public function testPreSetData(array $data, ConfigModel $model, array $trans, array $expectedData = null)
    {
        $provider1 = $this->getConfigProvider(
            'entity',
            [
                'entity' => [
                    'items' => [
                        'icon'  => [],
                        'label' => ['options' => ['translatable' => true]]
                    ]
                ],
                'field'  => [
                    'items' => [
                        'attr'  => [],
                        'label' => ['options' => ['translatable' => true]]
                    ]
                ]
            ],
            isset($data['entity'])
        );
        $provider1->expects($this->once())
            ->method('getConfigById')
            ->will($this->returnValue(new Config(new EntityConfigId('extend'))));
        $provider2 = $this->getConfigProvider(
            'test',
            [
                'entity' => [
                    'items' => [
                        'attr1' => []
                    ]
                ]
            ],
            isset($data['test'])
        );
        $providers = new ArrayCollection();
        $providers->add($provider1);
        $providers->add($provider2);

        $this->configManager->expects($this->any())
            ->method('getConfigIdByModel')
            ->will(
                $this->returnCallback(
                    function ($configModel, $scope) {
                        return new EntityConfigId($scope, 'Entity\Test');
                    }
                )
            );
        $this->configManager->expects($this->once())
            ->method('getProvider')
            ->with('extend')
            ->will($this->returnValue($provider1));
        $this->translationHelper->expects($this->any())
            ->method('translateWithFallback')
            ->willReturnCallback(
                function ($id, $fallback) use (&$trans) {
                    return isset($trans[$id]) ? $trans[$id] : $fallback;
                }
            );

        $event = $this->getFormEvent($data, $model);
        $this->configManager->expects($this->once())
            ->method('getProviders')
            ->will($this->returnValue($providers));

        $event->expects($this->once())
            ->method('setData')
            ->with($expectedData ?: $data);

        $this->subscriber->preSetData($event);
    }

    /**
     * @dataProvider postSubmitProvider
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     * @param array $data
     * @param bool $isValid
     * @param ConfigModel $model
     * @param array $trans
     * @param array|null $expectedConfigData
     * @param array $expectedTrans
     */
    public function testPostSubmit(
        array $data,
        $isValid,
        ConfigModel $model,
        array $trans,
        $expectedConfigData,
        array $expectedTrans
    ) {
        $extendProvider = $this->getConfigProvider('extend', [], false);
        $config = new Config(new EntityConfigId('extend'));
        $extendProvider->expects($this->once())
            ->method('getConfigById')
            ->will($this->returnValue($config));

        $provider1 = $this->getConfigProvider(
            'entity',
            [
                'entity' => [
                    'items' => [
                        'icon'  => [],
                        'label' => ['options' => ['translatable' => true]]
                    ]
                ]
            ],
            isset($data['entity'])
        );
        $config1   = new Config(new EntityConfigId('entity', 'Entity\Test'));
        $config1->set('label', 'label_key');
        if (isset($data['entity'])) {
            $provider1->expects($this->once())
                ->method('getConfigById')
                ->with($config1->getId())
                ->will($this->returnValue($config1));
        } else {
            $provider1->expects($this->never())
                ->method('getConfigById');
        }
        $providers = new ArrayCollection();
        $providers->add($provider1);

        $this->configManager->expects($this->any())
            ->method('getConfigIdByModel')
            ->will(
                $this->returnCallback(
                    function ($configModel, $scope) {
                        return new EntityConfigId($scope, 'Entity\Test');
                    }
                )
            );
        $this->configManager->expects($this->once())
            ->method('getProvider')
            ->with('extend')
            ->will($this->returnValue($extendProvider));
        $this->translator->expects($this->any())
            ->method('trans')
            ->will(
                $this->returnCallback(
                    function ($id) use (&$trans) {
                        if (isset($trans[$id])) {
                            return $trans[$id];
                        } else {
                            return $id;
                        }
                    }
                )
            );

        $form  = $this->createMock('Symfony\Component\Form\Test\FormInterface');
        $event = $this->getFormEvent($data, $model, $form);
        $this->configManager->expects($this->once())
            ->method('getProviders')
            ->will($this->returnValue($providers));

        if (null === $expectedConfigData) {
            $this->configManager->expects($this->never())
                ->method('persist');
        } else {
            $expectedConfig = new Config(new EntityConfigId('entity', 'Entity\Test'));
            foreach ($expectedConfigData as $code => $val) {
                $expectedConfig->set($code, $val);
            }
            $this->configManager->expects($this->exactly(1))
                ->method('persist')
                ->withConsecutive(
                    [$expectedConfig]
                );
        }

        $form->expects($this->once())
            ->method('isValid')
            ->will($this->returnValue($isValid));

        if ($isValid) {
            $this->translationHelper->expects($this->once())
                ->method('saveTranslations')
                ->with($expectedTrans);
            $this->configManager->expects($this->once())
                ->method('flush');
        } else {
            $this->translationHelper->expects($this->never())
                ->method('saveTranslations');
            $this->configManager->expects($this->never())
                ->method('flush');
        }

        $this->configManager->expects($this->any())->method('calculateConfigChangeSet')->with($config1);
        $this->configManager->expects($this->any())->method('getConfigChangeSet')->with($config1)->willReturn([
            'state' => ['Active', 'Requires update']
        ]);

        $this->subscriber->postSubmit($event);
    }

    /**
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function preSetDataProvider()
    {
        $existingFieldConfigModel = new FieldConfigModel('testField', 'string');
        ReflectionUtil::setId($existingFieldConfigModel, 1);

        return [
            'empty data (entity)'                                => [
                [],
                new EntityConfigModel('Entity\Test'),
                [],
                null
            ],
            'empty data (field)'                                 => [
                [],
                new FieldConfigModel('testField', 'string'),
                [],
                null
            ],
            'new model without trans (entity)'                   => [
                [
                    'entity' => [
                        'label' => 'testLabel',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                new EntityConfigModel('Entity\Test'),
                [],
                [
                    'entity' => [
                        'label' => '',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
            ],
            'new model without trans (field)'                    => [
                [
                    'entity' => [
                        'label' => 'testLabel'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                new FieldConfigModel('testField', 'string'),
                [],
                [
                    'entity' => [
                        'label' => 'testField',
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
            ],
            'existing model without trans (field)'               => [
                [
                    'entity' => [
                        'label' => 'testLabel'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                $existingFieldConfigModel,
                [],
                [
                    'entity' => [
                        'label' => '',
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
            ],
            'new model without translatable attributes (entity)' => [
                [
                    'entity' => [
                        'icon' => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                new EntityConfigModel('Entity\Test'),
                [],
                null
            ],
            'new model with trans (entity)'                      => [
                [
                    'entity' => [
                        'label' => 'testLabel',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                new EntityConfigModel('Entity\Test'),
                [
                    'testLabel' => 'translated label'
                ],
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ]
            ],
            'new model with trans (field)'                       => [
                [
                    'entity' => [
                        'label' => 'testLabel',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                new FieldConfigModel('testField', 'string'),
                [
                    'testLabel' => 'translated label'
                ],
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ]
            ],
            'existing model with trans (field)'                  => [
                [
                    'entity' => [
                        'label' => 'testLabel',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ],
                $existingFieldConfigModel,
                [
                    'testLabel' => 'translated label'
                ],
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ],
                    'test'   => [
                        'attr1' => 'testAttr'
                    ]
                ]
            ],
        ];
    }

    /**
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function postSubmitProvider()
    {
        $existingConfigModel = new EntityConfigModel('Entity\Test');
        ReflectionUtil::setId($existingConfigModel, 1);

        return [
            'empty data'                                         => [
                [],
                false,
                new EntityConfigModel('Entity\Test'),
                [],
                null,
                []
            ],
            'new model without trans (isValid=false)'            => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ]
                ],
                false,
                new EntityConfigModel('Entity\Test'),
                [],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon'
                ],
                []
            ],
            'new model without trans (isValid=true)'             => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ]
                ],
                true,
                new EntityConfigModel('Entity\Test'),
                [],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon'
                ],
                [
                    'label_key' => 'translated label',
                ]
            ],
            'existing model without trans (isValid=true)'        => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ]
                ],
                true,
                $existingConfigModel,
                [],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon'
                ],
                [
                    'label_key' => 'translated label',
                ]
            ],
            'new model with trans (isValid=true)'                => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ]
                ],
                true,
                new EntityConfigModel('Entity\Test'),
                [
                    'label_key' => 'translated label'
                ],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon'
                ],
                [
                    'label_key' => 'translated label',
                ]
            ],
            'existing model with trans (isValid=true)'           => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ]
                ],
                true,
                $existingConfigModel,
                [
                    'label_key' => 'translated label'
                ],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon'
                ],
                []
            ],
            'existing model with different trans (isValid=true)' => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon'
                    ]
                ],
                true,
                $existingConfigModel,
                [
                    'label_key' => 'translated label 1'
                ],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon',
                ],
                [
                    'label_key' => 'translated label',
                ]
            ],
            'existing model updated field' => [
                [
                    'entity' => [
                        'label' => 'translated label',
                        'icon'  => 'testIcon',
                        'state' => 'Active',
                    ]
                ],
                true,
                $existingConfigModel,
                [
                    'label_key' => 'translated label'
                ],
                [
                    'label' => 'label_key',
                    'icon'  => 'testIcon',
                    'state' => 'Active',
                ],
                []
            ],
        ];
    }

    /**
     * @param array                                    $data
     * @param FieldConfigModel|ConfigModel             $model
     * @param \PHPUnit\Framework\MockObject\MockObject $form
     * @return \PHPUnit\Framework\MockObject\MockObject
     */
    protected function getFormEvent($data, $model, $form = null)
    {
        $fieldName = '';
        if ($model instanceof FieldConfigModel && !$model->getId()) {
            $fieldName = $model->getFieldName();
        }

        $formConfig = $this->createMock('Symfony\Component\Form\FormConfigInterface');
        $formConfig->expects($this->any())
            ->method('getOption')
            ->withConsecutive(
                ['config_model'],
                ['field_name']
            )
            ->willReturnOnConsecutiveCalls(
                $model,
                $fieldName
            );

        if (null === $form) {
            $form = $this->createMock('Symfony\Component\Form\Test\FormInterface');
        }
        $form->expects($this->once())
            ->method('getConfig')
            ->will($this->returnValue($formConfig));

        $event = $this->getMockBuilder('Symfony\Component\Form\FormEvent')
            ->disableOriginalConstructor()
            ->getMock();
        $event->expects($this->once())
            ->method('getForm')
            ->will($this->returnValue($form));
        $event->expects($this->once())
            ->method('getData')
            ->will($this->returnValue($data));

        return $event;
    }

    /**
     * @param string $scope
     * @param array  $configs
     * @param bool   $isGetPropertyConfigExpected
     * @return \PHPUnit\Framework\MockObject\MockObject
     */
    protected function getConfigProvider($scope, $configs, $isGetPropertyConfigExpected)
    {
        $provider = $this->getMockBuilder('Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider')
            ->disableOriginalConstructor()
            ->getMock();
        $provider->expects($this->any())
            ->method('getScope')
            ->will($this->returnValue($scope));
        if ($isGetPropertyConfigExpected) {
            $propertyConfig = new PropertyConfigContainer($configs);
            $provider->expects($this->once())
                ->method('getPropertyConfig')
                ->will($this->returnValue($propertyConfig));
        } else {
            $provider->expects($this->never())
                ->method('getPropertyConfig');
        }

        return $provider;
    }
}


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public Preferences()
```
## See also
- [Preferences](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.Preferences.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)


text:
package egressselector

import (
	"fmt"
	"io/ioutil"
	"strings"

	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/validation/field"
	"k8s.io/apiserver/pkg/apis/apiserver"
	"k8s.io/apiserver/pkg/apis/apiserver/install"
	"k8s.io/apiserver/pkg/apis/apiserver/v1alpha1"
	"k8s.io/utils/path"
	"sigs.k8s.io/yaml"
)

var cfgScheme = runtime.NewScheme()

func init() {
	install.Install(cfgScheme)
}

// ReadEgressSelectorConfiguration reads the egress selector configuration at the specified path.
// It returns the loaded egress selector configuration if the input file aligns with the required syntax.
// If it does not align with the provided syntax, it returns a default configuration which should function as a no-op.
// It does this by returning a nil configuration, which preserves backward compatibility.
// This works because prior to this there was no egress selector configuration.
// It returns an error if the file did not exist.
func ReadEgressSelectorConfiguration(configFilePath string) (*apiserver.EgressSelectorConfiguration, error) {
	if configFilePath == "" {
		return nil, nil
	}
	// a file was provided, so we just read it.
	data, err := ioutil.ReadFile(configFilePath)
	if err != nil {
		return nil, fmt.Errorf("unable to read egress selector configuration from %q [%v]", configFilePath, err)
	}
	var decodedConfig v1alpha1.EgressSelectorConfiguration
	err = yaml.Unmarshal(data, &decodedConfig)
	if err != nil {
		// we got an error where the decode wasn't related to a missing type
		return nil, err
	}
	if decodedConfig.Kind != "EgressSelectorConfiguration" {
		return nil, fmt.Errorf("invalid service configuration object %q", decodedConfig.Kind)
	}
	config, err := cfgScheme.ConvertToVersion(&decodedConfig, apiserver.SchemeGroupVersion)
	if err != nil {
		// we got an error where the decode wasn't related to a missing type
		return nil, err
	}
	if internalConfig, ok := config.(*apiserver.EgressSelectorConfiguration); ok {
		return internalConfig, nil
	}
	return nil, fmt.Errorf("unable to convert %T to *apiserver.EgressSelectorConfiguration", config)
}

// ValidateEgressSelectorConfiguration checks the apiserver.EgressSelectorConfiguration for
// common configuration errors. It will return error for problems such as configuring mtls/cert
// settings for protocol which do not support security. It will also try to catch errors such as
// incorrect file paths. It will return nil if it does not find anything wrong.
func ValidateEgressSelectorConfiguration(config *apiserver.EgressSelectorConfiguration) field.ErrorList {
	allErrs := field.ErrorList{}
	if config == nil {
		return allErrs // Treating a nil configuration as valid
	}
	for _, service := range config.EgressSelections {
		base := field.NewPath("service", "connection")
		switch service.Connection.Type {
		case "direct":
			allErrs = append(allErrs, validateDirectConnection(service.Connection, base)...)
		case "http-connect":
			allErrs = append(allErrs, validateHTTPConnection(service.Connection, base)...)
		default:
			allErrs = append(allErrs, field.NotSupported(
				base.Child("type"),
				service.Connection.Type,
				[]string{"direct", "http-connect"}))
		}
	}

	return allErrs
}

func validateDirectConnection(connection apiserver.Connection, fldPath *field.Path) field.ErrorList {
	if connection.HTTPConnect != nil {
		return field.ErrorList{field.Invalid(
			fldPath.Child("httpConnect"),
			"direct",
			"httpConnect config should be absent for direct connect"),
		}
	}
	return nil
}

func validateHTTPConnection(connection apiserver.Connection, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if connection.HTTPConnect == nil {
		allErrs = append(allErrs, field.Invalid(
			fldPath.Child("httpConnect"),
			"nil",
			"httpConnect config should be present for http-connect"))
	} else if strings.HasPrefix(connection.HTTPConnect.URL, "https://") {
		if connection.HTTPConnect.CABundle == "" {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "caBundle"),
				"nil",
				"http-connect via https requires caBundle"))
		} else if exists, err := path.Exists(path.CheckFollowSymlink, connection.HTTPConnect.CABundle); exists == false || err != nil {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "caBundle"),
				connection.HTTPConnect.CABundle,
				"http-connect ca bundle does not exist"))
		}
		if connection.HTTPConnect.ClientCert == "" {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "clientCert"),
				"nil",
				"http-connect via https requires clientCert"))
		} else if exists, err := path.Exists(path.CheckFollowSymlink, connection.HTTPConnect.ClientCert); exists == false || err != nil {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "clientCert"),
				connection.HTTPConnect.ClientCert,
				"http-connect client cert does not exist"))
		}
		if connection.HTTPConnect.ClientKey == "" {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "clientKey"),
				"nil",
				"http-connect via https requires clientKey"))
		} else if exists, err := path.Exists(path.CheckFollowSymlink, connection.HTTPConnect.ClientKey); exists == false || err != nil {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "clientKey"),
				connection.HTTPConnect.ClientKey,
				"http-connect client key does not exist"))
		}
	} else if strings.HasPrefix(connection.HTTPConnect.URL, "http://") {
		if connection.HTTPConnect.CABundle != "" {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "caBundle"),
				connection.HTTPConnect.CABundle,
				"http-connect via http does not support caBundle"))
		}
		if connection.HTTPConnect.ClientCert != "" {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "clientCert"),
				connection.HTTPConnect.ClientCert,
				"http-connect via http does not support clientCert"))
		}
		if connection.HTTPConnect.ClientKey != "" {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Child("httpConnect", "clientKey"),
				connection.HTTPConnect.ClientKey,
				"http-connect via http does not support clientKey"))
		}
	} else {
		allErrs = append(allErrs, field.Invalid(
			fldPath.Child("httpConnect", "url"),
			connection.HTTPConnect.URL,
			"supported connection protocols are http:// and https://"))
	}
	return allErrs
}


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

namespace Swashbuckle.SwaggerUi
{
    public static class StreamExtensions
    {
        public static Stream FindAndReplace(this Stream stream, IDictionary<string, string> replacements)
        {
            var originalText = new StreamReader(stream).ReadToEnd();
            var outputBuilder = new StringBuilder(originalText);

            foreach (var replacement in replacements)
            {
                outputBuilder.Replace(replacement.Key, replacement.Value);
            }

            return new MemoryStream(Encoding.UTF8.GetBytes(outputBuilder.ToString()));
        }
    }
}


text:
import * as React from 'react';
import { DimVersions } from './versions';
import Link from '../shell/Link';
import { alerts$ } from './BungieAlerts';
import { GlobalAlert } from '../bungie-api/bungie-core-api';
import './WhatsNewLink.scss';
import { Subscription } from 'rxjs/Subscription';
import { t } from 'i18next';
import { dimNeedsUpdate$ } from '../../register-service-worker';

interface State {
  dimNeedsUpdate: boolean;
  alerts: GlobalAlert[];
  showChangelog: boolean;
}

/**
 * A link/button to the "What's New" page that highlights the most important action.
 */
export default class WhatsNewLink extends React.Component<{}, State> {
  private subscriptions = [] as Subscription[];

  constructor(props) {
    super(props);
    this.state = {
      dimNeedsUpdate: false,
      alerts: [],
      showChangelog: false
    };
  }

  componentDidMount() {
    this.subscriptions = [
      DimVersions.showChangelog$.subscribe((showChangelog) => this.setState({ showChangelog })),
      alerts$.subscribe((alerts) => this.setState({ alerts })),
      dimNeedsUpdate$.subscribe((dimNeedsUpdate) => this.setState({ dimNeedsUpdate }))
    ];
  }

  componentWillUnmount() {
    this.subscriptions.forEach((s) => s.unsubscribe());
    this.subscriptions = [];
  }

  render(): JSX.Element | null {
    const { dimNeedsUpdate, alerts, showChangelog } = this.state;

    // TODO: use presstip/tooltip to help?
    // TODO: try dots and bottom-borders

    if (dimNeedsUpdate) {
      return (

          {t('Header.UpgradeDIM')}

      );
    }

    if (alerts.length) {
      return (
        <Link state="whats-new" text="Header.BungieNetAlert">
          <span className={`badge-new bungie-alert-${alerts[0].type}`} />
        </Link>
      );
    }

    if (showChangelog) {
      return (
        <Link state="whats-new" text="Header.WhatsNew">

        </Link>
      );
    }

    return <Link state="whats-new" text="Header.WhatsNew" />;
  }
}

function reloadDIM() {
  window.location.reload();
}


text:
package org.assertj.core.util;

import static java.lang.Math.abs;

import java.util.Comparator;

public class AbsValueComparator<NUMBER extends Number> implements Comparator<NUMBER> {

  @Override
  public int compare(NUMBER i1, NUMBER i2) {
    double diff = abs(i1.doubleValue()) - abs(i2.doubleValue());
    if (diff == 0.0) return 0;
    return diff < 0.0 ? -1 : 1;
  }

  @Override
  public String toString() {
    return "AbsValueComparator";
  }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datastream/v1/datastream_resources.proto

namespace Google\Cloud\Datastream\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * BigQuery warehouse profile.
 *
 * Generated from protobuf message google.cloud.datastream.v1.BigQueryProfile
 */
class BigQueryProfile extends \Google\Protobuf\Internal\Message
{

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

}


text:
module.exports = function getEnsureRole (role) {
  return function ensureRole (req, res, next) {
    if (req.user.role.indexOf(role) !== -1) {
      next();
    } else {
      next({status: 403, message: 'not authorized'});
    }
  };
};


text:
module.exports = function(config) {
  var options = {
    frameworks: [
      'jasmine'
    ],

    files: [
      'node_modules/babel-polyfill/dist/polyfill.js',
      'node_modules/sinon/pkg/sinon.js',
      'karma.entry.js'
    ],

    preprocessors: {
      'karma.entry.js': ['webpack', 'sourcemap']
    },

    // webpack config
    webpack: require('./webpack.config.test'),

    // webpack server config
    webpackServer: {
      noInfo: true
    },

    reporters: ['dots'],

    logLevel: config.LOG_INFO,

    autoWatch: true,

    singleRun: false,

    browserNoActivityTimeout: 180000, // 3 mins

    customLaunchers: {
      TRAVIS_CHROME: {
        base: 'Chrome',
        flags: ['--no-sandbox']
      }
    },

    browsers: process.env.TRAVIS ? ['TRAVIS_CHROME'] : ['Chrome']
  };

  // additional options for coverage
  if (process.argv.indexOf('--coverage') !== -1) {
    options.singleRun = true;
    options.reporters.push('coverage');

    options.coverageReporter = {
      type : 'lcov',
      dir  : 'tmp/coverage'
    };

    options.webpack.module.preLoaders = [
      { exclude: /(karma|node_modules|spec|vendor)/, loader: 'isparta', test: /\.js$/ }
    ];
  }

  config.set(options);
};


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.karaf.cellar.bundle;

/**
 * Cellar bundle constants.
 */
public class Constants {

    public static final String CATEGORY = "bundle";
    public static final String BUNDLE_MAP = "org.apache.karaf.cellar.bundle.map";

}


text:
from imapclient import IMAPClient
from time import sleep
import getpass
import aamnotifs

class Notifier:
    def __init__(self, server, username, password):
        self.server = server
        self.username = username
        self.password = password
        self.ssl = True
        self.frequency = 3

        self.imap_connection = IMAPClient(self.server, use_uid=True, ssl=self.ssl)
        self.seen_unread = []

        self.imap_connection.login(self.username, self.password)
        self.notifier = aamnotifs.Notifs(
            "amqps://user:password@domain.tld:5673/%2F")

        while True:
            self.check_unread()
            sleep(self.frequency)

    def check_unread(self):
        try:
            self.imap_connection.select_folder("INBOX")
            unread_list = self.imap_connection.search("UNSEEN")
        except:
            self.__init__(self.server, self.username, self.password)
            self.imap_connection.select_folder("INBOX")
            unread_list = self.imap_connection.search("UNSEEN")

        for unread in unread_list:
            if unread not in self.seen_unread:
                self.seen_unread.append(unread)
                envelope = self.imap_connection.fetch(
                    [unread], ["ENVELOPE"])[unread]["ENVELOPE"]
                subject = envelope[1]
                from_name = envelope[2][0][0]

                if not from_name:
                    if envelope[2][0][2] and envelope[2][0][3]:
                        from_name = envelope[2][0][2] + "@" + envelope[2][0][3]
                    else:
                        from_name = "(unknown)"

                if not subject:
                    subject = "(no subject)"

                self.notifier.send("mails", from_name, subject)

if __name__ == '__main__':
    server = raw_input("IMAP server: ")
    username = raw_input("Username: ")
    password = getpass.getpass()
    no = Notifier(server, username, password)


text:
class Course::Assessment::Question::TextResponseSolution < ApplicationRecord
  enum solution_type: [:exact_match, :keyword]

  before_validation :strip_whitespace
  before_save :sanitize_explanation
  validate :validate_grade
  validates :solution_type, presence: true
  validates :solution, presence: true
  validates :grade, numericality: { greater_than: -1000, less_than: 1000 }, presence: true
  validates :question, presence: true

  belongs_to :question, class_name: Course::Assessment::Question::TextResponse.name,
                        inverse_of: :solutions

  def initialize_duplicate(duplicator, other)
    self.question = duplicator.duplicate(other.question)
  end

  private

  def strip_whitespace
    solution&.strip!
  end

  def validate_grade
    errors.add(:grade, :invalid_grade) if grade > question.maximum_grade
  end

  def sanitize_explanation
    self.explanation = ApplicationController.helpers.format_ckeditor_rich_text(explanation)
  end
end


text:
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Orleans
{
    internal class MultiTaskCompletionSource
    {
        private readonly TaskCompletionSource<bool> tcs;
        private int count;
        private readonly object lockable;

        public MultiTaskCompletionSource(int count)
        {
            if (count <= 0)
            {
                throw new ArgumentOutOfRangeException("count", "count has to be positive.");
            }
            tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
            this.count = count;
            lockable = new object();
        }

        public Task Task
        {
            get { return tcs.Task; }
        }

        public void SetOneResult()
        {
            lock (lockable)
            {
                if (count <= 0)
                {
                    throw new InvalidOperationException("SetOneResult was called more times than initialy specified by the count argument.");
                }
                count--;
                if (count == 0)
                {
                    tcs.SetResult(true);
                }
            }
        }

        public void SetMultipleResults(int num)
        {
            lock (lockable)
            {
                if (num <= 0)
                {
                    throw new ArgumentOutOfRangeException("num", "num has to be positive.");
                }
                if (count - num < 0)
                {
                    throw new ArgumentOutOfRangeException("num", "num is too large, count - num < 0.");
                }
                count = count - num;
                if (count == 0)
                {
                    tcs.SetResult(true);
                }
            }
        }
    }
}


text:
<?php

namespace yiiunit\extensions\elasticsearch\data\ar;

/**
 * Class Animal
 *
 * @author Jose Lorente <jose.lorente.martin@gmail.com>
 * @since 2.0
 */
class Animal extends ActiveRecord
{

    public $does;

    public static function primaryKey()
    {
        return ['id'];
    }

    public static function type()
    {
        return 'test_animals';
    }

    public function attributes()
    {
        return ['id', 'type'];
    }

    /**
     * sets up the index for this record
     * @param Command $command
     */
    public static function setUpMapping($command)
    {
        $command->deleteMapping(static::index(), static::type());
        $command->setMapping(static::index(), static::type(), [
            static::type() => [
                "_id" => ["path" => "id", "index" => "not_analyzed", "store" => "yes"],
                "properties" => [
                    "type" => ["type" => "string", "index" => "not_analyzed"]
                ]
            ]
        ]);
    }

    public function init()
    {
        parent::init();
        $this->type = get_called_class();
    }

    public function getDoes()
    {
        return $this->does;
    }

    /**
     *
     * @param type $row
     * @return \yiiunit\data\ar\elasticsearch\Animal
     */
    public static function instantiate($row)
    {
        $class = $row['_source']['type'];
        return new $class;
    }

}


text:
#include <jni.h>

#include <android/log.h>

#include <cstdlib>

#include "opus.h"  // NOLINT
#include "opus_multistream.h"  // NOLINT

#define LOG_TAG "libopus_native"
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, \
                                             __VA_ARGS__))

#define FUNC(RETURN_TYPE, NAME, ...) \
  extern "C" { \
  JNIEXPORT RETURN_TYPE \
    Java_com_google_android_exoplayer_ext_opus_OpusDecoder_ ## NAME \
      (JNIEnv* env, jobject thiz, ##__VA_ARGS__);\
  } \
  JNIEXPORT RETURN_TYPE \
    Java_com_google_android_exoplayer_ext_opus_OpusDecoder_ ## NAME \
      (JNIEnv* env, jobject thiz, ##__VA_ARGS__)\

// JNI references for OpusOutputBuffer class.
static jmethodID initOpusOutputBuffer;
static jfieldID opusDataField;

jint JNI_OnLoad(JavaVM* vm, void* reserved) {
  JNIEnv* env;
  if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
    return -1;
  }
  return JNI_VERSION_1_6;
}

static const int kBytesPerSample = 2;  // opus fixed point uses 16 bit samples.
static int channelCount;

FUNC(jlong, opusInit, jint sampleRate, jint channelCount, jint numStreams,
     jint numCoupled, jint gain, jbyteArray jStreamMap) {
  int status = OPUS_INVALID_STATE;
  ::channelCount = channelCount;
  jbyte* streamMapBytes = env->GetByteArrayElements(jStreamMap, 0);
  uint8_t* streamMap = reinterpret_cast<uint8_t*>(streamMapBytes);
  OpusMSDecoder* decoder = opus_multistream_decoder_create(
      sampleRate, channelCount, numStreams, numCoupled, streamMap, &status);
  env->ReleaseByteArrayElements(jStreamMap, streamMapBytes, 0);
  if (!decoder || status != OPUS_OK) {
    LOGE("Failed to create Opus Decoder; status=%s", opus_strerror(status));
    return 0;
  }
  status = opus_multistream_decoder_ctl(decoder, OPUS_SET_GAIN(gain));
  if (status != OPUS_OK) {
    LOGE("Failed to set Opus header gain; status=%s", opus_strerror(status));
    return 0;
  }

  // Populate JNI References.
  const jclass outputBufferClass = env->FindClass(
      "com/google/android/exoplayer/ext/opus/OpusOutputBuffer");
  initOpusOutputBuffer = env->GetMethodID(outputBufferClass, "init", "(I)V");
  opusDataField =
      env->GetFieldID(outputBufferClass, "data", "Ljava/nio/ByteBuffer;");

  return reinterpret_cast<intptr_t>(decoder);
}

FUNC(jint, opusDecode, jlong jDecoder, jobject jInputBuffer, jint inputSize,
     jobject jOpusOutputBuffer, jint sampleRate) {
  OpusMSDecoder* decoder = reinterpret_cast<OpusMSDecoder*>(jDecoder);
  const uint8_t* inputBuffer =
      reinterpret_cast<const uint8_t*>(
          env->GetDirectBufferAddress(jInputBuffer));

  const int32_t inputSampleCount =
      opus_packet_get_nb_samples(inputBuffer, inputSize, sampleRate);
  const jint outputSize = inputSampleCount * kBytesPerSample * channelCount;

  // resize buffer:
  env->CallVoidMethod(jOpusOutputBuffer, initOpusOutputBuffer, outputSize);
  const jobject jOutputBuffer =
      env->GetObjectField(jOpusOutputBuffer, opusDataField);

  int16_t* outputBuffer = reinterpret_cast<int16_t*>(
      env->GetDirectBufferAddress(jOutputBuffer));
  int sampleCount = opus_multistream_decode(decoder, inputBuffer, inputSize,
                                            outputBuffer, outputSize, 0);
  return (sampleCount < 0) ? sampleCount
                           : sampleCount * kBytesPerSample * channelCount;
}

FUNC(void, opusClose, jlong jDecoder) {
  OpusMSDecoder* decoder = reinterpret_cast<OpusMSDecoder*>(jDecoder);
  opus_multistream_decoder_destroy(decoder);
}

FUNC(void, opusReset, jlong jDecoder) {
  OpusMSDecoder* decoder = reinterpret_cast<OpusMSDecoder*>(jDecoder);
  opus_multistream_decoder_ctl(decoder, OPUS_RESET_STATE);
}

FUNC(jstring, getLibopusVersion) {
  return env->NewStringUTF(opus_get_version_string());
}

FUNC(jstring, opusGetErrorMessage, jint errorCode) {
  return env->NewStringUTF(opus_strerror(errorCode));
}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1815ce712">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Northern District of Ohio</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2012-01-03</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2010-01-13</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-3_09-cr-00062</identifier>
<identifier type="local">P0b002ee1815ce712</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2012-01-03</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2012-01-03</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ohnd-3_09-cr-00062</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ohnd-3_09-cr-00062</accessId>
 <courtType>District</courtType>
 <courtCode>ohnd</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Ohio</courtState>
 <courtSortOrder>2392</courtSortOrder>
 <caseNumber>3:09-cr-00062</caseNumber>
 <caseOffice>Toledo</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="Robin" fullName="Robin M. Lee" lastName="Lee" middleName="M." role="Defendant"></party>
 <party fullName="United States of America" lastName="United States of America" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>United States of America v. Lee</title>
 <partNumber>3:09-cr-00062</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-3_09-cr-00062/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">3:09-cr-00062;09-062</identifier>
<name type="corporate">
 <namePart>United States District Court Northern District of Ohio</namePart>
 <namePart>6th Circuit</namePart>
 <namePart>Toledo</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Robin M. Lee</displayForm>
 <namePart type="family">Lee</namePart>
 <namePart type="given">Robin</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>United States of America</displayForm>
 <namePart type="family">United States of America</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ohnd-3_09-cr-00062</accessId>
 <courtType>District</courtType>
 <courtCode>ohnd</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Ohio</courtState>
 <courtSortOrder>2392</courtSortOrder>
 <caseNumber>3:09-cr-00062</caseNumber>
 <caseOffice>Toledo</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="Robin" fullName="Robin M. Lee" lastName="Lee" middleName="M." role="Defendant"></party>
 <party fullName="United States of America" lastName="United States of America" role="Plaintiff"></party>
 <state>Ohio</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ohnd-3_09-cr-00062-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-3_09-cr-00062/USCOURTS-ohnd-3_09-cr-00062-0/mods.xml">
 <titleInfo>
  <title>United States of America v. Lee</title>
  <subTitle>Amended Report and Recommendation to reflect 14 days for filing objections and reply to Plea of Guilty re 23. Objections to R&R due by 12/25/2009. Magistrate Judge Vernelis K. Armstrong on 12/11/09. (A,P)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2009-12-11</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ohnd-3_09-cr-00062-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1816bfdf2</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-3_09-cr-00062/USCOURTS-ohnd-3_09-cr-00062-0</identifier>
 <identifier type="former granule identifier">ohnd-3_09-cr-00062_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-3_09-cr-00062/USCOURTS-ohnd-3_09-cr-00062-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-3_09-cr-00062/pdf/USCOURTS-ohnd-3_09-cr-00062-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 3:09-cr-00062; United States of America v. Lee; </searchTitle>
  <courtName>United States District Court Northern District of Ohio</courtName>
  <state>Ohio</state>
  <accessId>USCOURTS-ohnd-3_09-cr-00062-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2009-12-11</dateIssued>
  <docketText>Amended Report and Recommendation to reflect 14 days for filing objections and reply to Plea of Guilty re 23. Objections to R&R due by 12/25/2009. Magistrate Judge Vernelis K. Armstrong on 12/11/09. (A,P)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ohnd-3_09-cr-00062-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-3_09-cr-00062/USCOURTS-ohnd-3_09-cr-00062-1/mods.xml">
 <titleInfo>
  <title>United States of America v. Lee</title>
  <subTitle>Order Adopting Report and Recommendation as to Robin M. Lee. The defendant's plea of guilty is accepted and a finding of guilty shall be entered. re 24. Judge James G. Carr on 1/13/10. (S,AL)</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2010-01-13</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ohnd-3_09-cr-00062-1.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1816bfdf3</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-3_09-cr-00062/USCOURTS-ohnd-3_09-cr-00062-1</identifier>
 <identifier type="former granule identifier">ohnd-3_09-cr-00062_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-3_09-cr-00062/USCOURTS-ohnd-3_09-cr-00062-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-3_09-cr-00062/pdf/USCOURTS-ohnd-3_09-cr-00062-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 3:09-cr-00062; United States of America v. Lee; </searchTitle>
  <courtName>United States District Court Northern District of Ohio</courtName>
  <state>Ohio</state>
  <accessId>USCOURTS-ohnd-3_09-cr-00062-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2010-01-13</dateIssued>
  <docketText>Order Adopting Report and Recommendation as to Robin M. Lee. The defendant's plea of guilty is accepted and a finding of guilty shall be entered. re 24. Judge James G. Carr on 1/13/10. (S,AL)</docketText>
</extension>
</relatedItem>
</mods>


text:
<?php

namespace CAII\PortadaBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class PortadaBundle extends Bundle
{
}


text:
class CreateApps < ActiveRecord::Migration
  def change
    create_table :apps do |t|
      t.references :user, index: true
      t.string :name
      t.string :description

      t.timestamps
    end
  end
end


text:
package com.example.listviewdemo;

import android.os.Debug;
import android.os.Environment;
import android.util.Log;

public class MLog {
	private static String TAG = tag(MLog.class);

	public static final String TRACE = "Trace";

	public static final boolean DEBUG_MODE = true;

	private static final String DEFAULT_TRACE_PATH = Environment
			.getExternalStorageDirectory().getPath() + "/trace/";
	private static final String DEFAULT_TRACE_NAME = "trace.log";

	private static Boolean mLogEnabled;
	private static Boolean mTraceEnabled;

	private static long mLogTime = 0;

	private static String mCurrentTraceName;

	static {
		if (DEBUG_MODE) {
			enableLog();
			enableTrace();
		} else {
			disableLog();
			disableTrace();
		}
	}

	public static void d(String tag, String msg) {
		if (mLogEnabled) {
			Log.d(tag, msg);
		}
	}

	public static void d(String tag, String msg, Object... args) {
		if (mLogEnabled) {
			try {
				Log.d(tag, String.format(msg, args));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	public static void d(String tag, String msg, Throwable tr) {
		if (mLogEnabled) {
			Log.d(tag, msg, tr);
		}
	}

	public static void disableLog() {
		mLogEnabled = false;
	}

	public static void disableTrace() {
		mTraceEnabled = false;
	}

	public static void e(String tag, String msg) {
		Log.e(tag, msg);
	}

	public static void e(String tag, String msg, Object... args) {
		try {
			Log.e(tag, String.format(msg, args));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void e(String tag, String msg, Throwable tr) {
		Log.e(tag, msg, tr);
	}

	public static void enableLog() {
		mLogEnabled = true;
	}

	public static void enableTrace() {
		mTraceEnabled = true;
	}

	public static void end(String msg) {
		if (mLogEnabled) {
			long cost = System.currentTimeMillis() - mLogTime;
			d(TAG, String.format("%d ms for %s", cost, msg));
		}
	}

	public static void i(String tag, String msg) {
		if (mLogEnabled) {
			Log.i(tag, msg);
		}
	}

	public static void i(String tag, String msg, Object... args) {
		if (mLogEnabled) {
			try {
				Log.i(tag, String.format(msg, args));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	public static void i(String tag, String msg, Throwable tr) {
		if (mLogEnabled) {
			Log.i(tag, msg, tr);
		}
	}

	public static void start() {
		mLogTime = System.currentTimeMillis();
	}

	/**
	 * The trace file will be put under {@value #DEFAULT_TRACE_PATH} unless an
	 * absolute path is given.
	 *
	 * @param traceName
	 *            Name for the trace log file to create. This could be a simple
	 *            name, or a absolute path of trace file name. If @param
	 *            traceName is empty, the trace file will be
	 *            DEFAULT_TRACE_PATH/dmtrace.trace
	 */
	public static void startTrace(String traceName) {
		if (mTraceEnabled) {
			mCurrentTraceName = traceName;

			if (mCurrentTraceName == "") {
				mCurrentTraceName = DEFAULT_TRACE_PATH + DEFAULT_TRACE_NAME;
			} else if (!mCurrentTraceName.startsWith("/")) {
				mCurrentTraceName = DEFAULT_TRACE_PATH + mCurrentTraceName;
			}

			Debug.startMethodTracing(mCurrentTraceName);
		}
	}

	public static void stopTrace() {
		if (mTraceEnabled) {
			Debug.stopMethodTracing();
			d(TRACE, "trace file is generated at /sdcard/%s", mCurrentTraceName);
		}
	}

	public static String tag(Class<?> clazz) {
		return clazz.getName();
	}

	public static void v(String tag, String msg) {
		if (mLogEnabled) {
			Log.v(tag, msg);
		}
	}

	public static void v(String tag, String msg, Object... args) {
		if (mLogEnabled) {
			try {
				Log.v(tag, String.format(msg, args));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	public static void v(String tag, String msg, Throwable tr) {
		if (mLogEnabled) {
			Log.v(tag, msg, tr);
		}
	}

	public static void w(String tag, String msg) {
		if (mLogEnabled) {
			Log.w(tag, msg);
		}
	}

	public static void w(String tag, String msg, Object... args) {
		if (mLogEnabled) {
			try {
				Log.w(tag, String.format(msg, args));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	public static void w(String tag, String msg, Throwable tr) {
		if (mLogEnabled) {
			Log.w(tag, msg, tr);
		}
	}
}


text:
require 'term/ansicolor'

class Color
  extend Term::ANSIColor
end


text:
var common = require('../common');
var assert = require('assert');
var path = require('path');
var testTxt = path.join(common.fixturesDir, 'x.txt');
var fs = require('fs');

setTimeout(function() {
  // put this in a timeout, just so it doesn't get bunched up with the
  // require() calls..
  var N = 30;
  for (var i = 0; i < N; i++) {
    console.log('start ' + i);
    fs.readFile(testTxt, function(err, data) {
      if (err) {
        console.log('error! ' + e);
        process.exit(1);
      } else {
        console.log('finish');
      }
    });
  }
}, 100);


text:
const mongoose = require('mongoose');
var Schema = mongoose.Schema;
var schema = new Schema({
  	avID: {type: Number, default: 0},
    value: String

});

var atDefault = mongoose.model("atDefault",schema);
module.exports = atDefault;


text:
<?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

if(!class_exists('VmTableData'))require(VMPATH_ADMIN.DS.'helpers'.DS.'vmtabledata.php');

/**
 * Coupon table class
 * The class is is used to manage the coupons in the shop.
 *
 * @package	VirtueMart
 * @subpackage Config
 * @author RickG
 */
class TableConfigs extends VmTableData {

	/** @var int Primary key */
	var $virtuemart_config_id			= 0;
	/** @var config */
	var $config       		= 0;

	/**
	 * @author RickG
	 * @param JDataBase $db
	 */
	function __construct(&$db)
	{
		parent::__construct('#__virtuemart_configs', 'virtuemart_config_id', $db);

		$this->setLoggable();

	}

}
// pure php no closing tag


text:
package net.janvsmachine.fpinscala

//
// For this one, I've written the functions in the style where each operation
// is defined in a base trait and implemented in derived objects/classes.
// It's only a stylistic difference, though looing at it, I do find it neat avoiding
// the pattern match on the None vs Some cases in each method - and calling the method
// on values instead of passing values in as the first argument to each function seems neater too.
//
// Functions on multiple Options are still defined as free-standing functions, of course.
//

sealed trait Option[+A] {
  def map[B](f: A => B): Option[B]
  def flatMap[B](f: A => Option[B]): Option[B]
  def getOrElse[B >: A](default: B): B
  def orElse[B >: A](default: B): Option[B]
  def filter(f: A => Boolean): Option[A]
}

// Exercise 4.1

case class Some[+A](value: A) extends Option[A] {
  def map[B](f: A => B): Option[B] = Some(f(value))
  def flatMap[B](f: A => Option[B]): Option[B] = f(value)
  def getOrElse[B >: A](default: B): B = value
  def orElse[B >: A](default: B): Option[B] = this
  def filter(f: A => Boolean): Option[A] = if (f(value)) Some(value) else None
}

object None extends Option[Nothing] {
  def map[B](f: Nothing => B): Option[B] = None
  def flatMap[B](f: Nothing => Option[B]): Option[B] = None
  def getOrElse[B >: Nothing](default: B): B = default
  def orElse[B >: Nothing](default: B): Option[B] = Some(default)
  def filter(f: Nothing => Boolean): Option[Nothing] = None
}

object Option {

  import List._

  // From book.
  def mean(xs: Seq[Double]): Option[Double] =
    if (xs.isEmpty) None
    else Some(xs.sum / xs.length)

  // Exercise 4.2
  def variance(xs: Seq[Double]): Option[Double] =
    mean(xs).flatMap(m => mean(xs.map(x => Math.pow(x - m, 2))))

  // Exercise 4.3
  def map2a[A, B, C](a: Option[A], b: Option[B])(f: (A, B) => C): Option[C] = (a, b) match {
    case (Some(x), Some(y)) => Some(f(x, y))
    case _                  => None
  }

  def map2[A, B, C](a: Option[A], b: Option[B])(f: (A, B) => C): Option[C] =
    a.flatMap(x => b.map(y => f(x, y)))

  def sequence[A](xs: List[Option[A]]): Option[List[A]] =
    foldRight[Option[A], Option[List[A]]](xs, Some(Nil))((x, acc) => (x, acc) match {
      case (Some(v), Some(acc)) => Some(Cons(v, acc))
      case _                    => None
    })

  def traverse[A, B](xs: List[Option[A]])(f: A => B): Option[List[B]] =
    foldRight[Option[A], Option[List[B]]](xs, Some(Nil))((x, acc) => (x, acc) match {
      case (Some(v), Some(acc)) => Some(Cons(f(v), acc))
      case _                    => None
    })

  def sequence2[A](xs: List[Option[A]]): Option[List[A]] = traverse(xs)(x => x)

}


text:
- Upgrade Handlebars version

# Version 5.1.0
- Fix #81 Add support for object.pattern

# Version 5.0.2
- Fix #57: Support most of Joi 4.x features
- Fix #45: Show authentication configuration
- Show additional routes parameters (vhost, cors, jsonp)

# Version 5.0.1
- Fix #75: make correct use of basePath option
- Allow for partials setting override

# Version 5.0.0
- Fix #71: Hide parameters that accept anything
- Fix #69: Now working with Hapi >= 6.x
- Show "false" validation rule as denied

# Version 4.2.1
- Make entire row a link instead of route

# Version 4.2.0
- Fix #68: Support unescaped notes
- Fix #40: Support Joi.example()
- Fix #52: Unescape description

# Version 4.1.0
- Support Joi 4.3

# Version 4.0.0
- Fix #67: support Hapi 5.x

# Version 3.1.3
- Fix #64: a regression was introduced in 3.1.1 on arrays' rules
- Fix example in the readme

# Version 3.1.2
- Fix #62: fix unnecessary containers around the navbar list
- Fix #63: make css path relative

# Version 3.1.1
- Fix #60: correctly describe POJOs in arrays

# Version 3.1.0
- Fix and support more array constraints

# Version 3.0.0
- Only support hapi 4.x and up

# Version 2.2.0
- Upgrade test suite to Lab 3.x and reach 100% coverage
- Add support for Joi.alternatives()

# Version 2.1.1
- Mark as compatible with Hapi 3.x

# Version 2.1.0
- Fix #47: setting custom basePath makes lout not finding its helpers folder
- Fix #48: add simple way to provide custom CSS

# Version 2.0.1
- Fix #41: css route didn't handle authentication properly
- Fix #43: '/' as endpoint didn't work

# Version 2.0.0
- Support for Hapi 2.x.x
- Beginning of a makeover to have a cleaner default look
- Support for array type in the validation rules

# Version 1.1.1
- Fixes a crash on empty objects

# Version 1.1.0
- Show path parameters
- Upgrade to twitter bootstrap 3.x
- Fix Handlebars dependency

# Version 1.0.1
- Because lout can be installed on a hapi 1.x, check for joi version to alert on incompatibility

# Version 1.0.0

- Support for joi 2.x
- Drop support for joi 1.x (evolution to 2.x is considered easy enough)
- Changes in rendering to account for possible joi objects as the validation root


text: .nav-text-link:not(.header.popover-link) { margin: 10px; }


text:
require 'ebay/types/category_item_specifics'

module Ebay # :nodoc:
  module Requests # :nodoc:
    # == Attributes
    #  value_array_node :category_ids, 'CategoryID', :default_value => []
    #  time_node :last_update_time, 'LastUpdateTime', :optional => true
    #  numeric_node :max_names, 'MaxNames', :optional => true
    #  numeric_node :max_values_per_name, 'MaxValuesPerName', :optional => true
    #  text_node :name, 'Name', :optional => true
    #  array_node :category_specifics, 'CategorySpecific', :class => CategoryItemSpecifics, :default_value => []
    #  boolean_node :exclude_relationships, 'ExcludeRelationships', 'true', 'false', :optional => true
    #  boolean_node :include_confidence, 'IncludeConfidence', 'true', 'false', :optional => true
    #  boolean_node :category_specifics_file_info, 'CategorySpecificsFileInfo', 'true', 'false', :optional => true
    class GetCategorySpecifics < Abstract
      include XML::Mapping
      include Initializer
      root_element_name 'GetCategorySpecificsRequest'
      value_array_node :category_ids, 'CategoryID', :default_value => []
      time_node :last_update_time, 'LastUpdateTime', :optional => true
      numeric_node :max_names, 'MaxNames', :optional => true
      numeric_node :max_values_per_name, 'MaxValuesPerName', :optional => true
      text_node :name, 'Name', :optional => true
      array_node :category_specifics, 'CategorySpecific', :class => CategoryItemSpecifics, :default_value => []
      boolean_node :exclude_relationships, 'ExcludeRelationships', 'true', 'false', :optional => true
      boolean_node :include_confidence, 'IncludeConfidence', 'true', 'false', :optional => true
      boolean_node :category_specifics_file_info, 'CategorySpecificsFileInfo', 'true', 'false', :optional => true
    end
  end
end


text:
{% extends "layout.html" %}
{% block body %}

  {% if error %}

  Error: {{ error }}{% endif %}

  <form action="{{ url_for('login') }}" method=post>

Username:

<input type=text name=username>

Password:

<input type=password name=password>

<input type=submit value=Login>

  </form>

{% endblock %}