text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <link rel="stylesheet" href="../bower_components/leaflet/dist/leaflet.css" />

    <leaflet lf-center="center" layers="layers" width="100%" height="480px"></leaflet>

Esri ArcGIS Image Layer

        Display NAIP imagery from an ArcGIS image service and use the band IDs parameter to show the near infrared band in a
        false color composite. Vegetated areas are highlighted in red.

redpajama_set_name: RedPajamaGithub


text:
import { GameManager } from "./controller/controller";

var gameManager: GameManager = new GameManager();


text:
sh_unstuck.lua

Main file for configuration and message handling.

--]]

Unstuck = {}

--[[---------------------------
		CONFIGURATION
--]]---------------------------
Unstuck.Configuration = {

	// The chat command for players to use.
	Command = {
		Prefix = { "!", "/" },
		String = { "stuck", "unstuck" },
	},

	// Admins will be notified when a player attemps to use the Unstuck function.
	AdminRanks = {
		"moderator",
		"admin",
		"superadmin",
		"owner",
	},

	// Allow the debug information to be sent only to the ranked admins.
	DebugAdminRanksOnly = true,

	// If the unstuck fails, the player will be be respawned.
	RespawnOnFail = true,
	// The time in seconds between the failed message and respawning the player.
	RespawnTimer = 3,

	// Cooldown between each unstuck attempt in seconds.
	Cooldown = 5,

	// How many iterations of position checking. Initial iteration is to check the surrounding player.
	// Every iteration after that checks the surrounding checked positions.
	// This has an exponential curve of run time needed and would be advised of no more than 4.
	MaxIteration = 3,

	// The minimum distance from the player when checking for new positions to move to.
	// The addon would otherwise use a value based on the players hull if it's greater than this value.
	MinCheckRange = 32,
}

--[[---------------------------
		ENUMERATION
--]]---------------------------
Unstuck.Enumeration = {

	Message = {
		UNSTUCK = 1,
		UNSTUCK_ATTEMPT = 2,
		ADMIN_NOTIFY = 3,
		NOT_ALIVE = 4,
		ARRESTED = 5,
		COOLDOWN = 6,
		FAILED = 7,
		RESPAWNING = 8,
		RESPAWN_FAILED = 9,
	},

	PositionTesting = {
		PASSED = 1,
		FAILED = 2,
	},

	Debug = {
		COMMAND_ADD = 1,
		COMMAND_CLEAR = 2,
		NOUN_BOX = 3,
		NOUN_LINE = 4
	}
}

--[[---------------------------
		DICTIONARY FOR MESSAGES
--]]---------------------------
Unstuck.Dictionary = {
	[Unstuck.Enumeration.Message.UNSTUCK] = "You should be unstuck!",
	[Unstuck.Enumeration.Message.UNSTUCK_ATTEMPT] = "You are stuck, trying to free you...",
	[Unstuck.Enumeration.Message.ADMIN_NOTIFY] = " used the Unstuck command.", // The players name will be prefixed with this string
	[Unstuck.Enumeration.Message.NOT_ALIVE] = "You must be alive and out of vehicles to use this command!",
	[Unstuck.Enumeration.Message.ARRESTED] = "You are arrested!",
	[Unstuck.Enumeration.Message.COOLDOWN] = "Cooldown period still active! Wait a bit!",
	[Unstuck.Enumeration.Message.FAILED] = "Sorry, I failed.",
	[Unstuck.Enumeration.Message.RESPAWNING] = "Respawning in "..Unstuck.Configuration.RespawnTimer.." seconds.",
	[Unstuck.Enumeration.Message.RESPAWN_FAILED] = "Respawn canceled. Your are dead.",
}

--[[---------------------------
		Message handling below.
--]]---------------------------
if SERVER then

	util.AddNetworkString( "Unstuck.Message" )
	util.AddNetworkString( "Unstuck.Debug" )
	local Player = FindMetaTable( "Player" )

	--[[------------------------------------------------
		Name: PlayerMessage()
		Desc: Sends a message to a single player.
			2nd argument used with Admin Notify
	--]]------------------------------------------------
	function Player:UnstuckMessage( enumMessage, ply )
		net.Start( "Unstuck.Message" )
		net.WriteInt( enumMessage, 8 )

		-- Also send the target player if notifying admins.
		if ( enumMessage == Unstuck.Enumeration.Message.ADMIN_NOTIFY ) then
			net.WriteEntity( ply )
		end

		net.Send( self )
	end

end

if CLIENT then

	net.Receive( "Unstuck.Message", function()
		local enumMessage = net.ReadInt( 8 )
		local message = {Color(255,255,0), "[Unstuck] "}

		if enumMessage == Unstuck.Enumeration.Message.ADMIN_NOTIFY then
			local ply = net.ReadEntity()
			table.Add( message, {Color(255,0,0), ply:Nick()} )
		end

		table.Add( message, {Color(255,255,255), Unstuck.Dictionary[enumMessage]} )
		chat.AddText( unpack( message ) )
	end)

end


text:
package org.springframework.web.reactive.function;

import java.net.InetSocketAddress;
import java.net.URI;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalLong;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpRange;
import org.springframework.http.MediaType;
import org.springframework.http.codec.BodyExtractor;
import org.springframework.http.server.reactive.ServerHttpRequest;

/**
 * Represents a server-side HTTP request, as handled by a {@code HandlerFunction}.
 * Access to headers and body is offered by {@link Headers} and
 * {@link #body(BodyExtractor)} respectively.
 *
 * @author Arjen Poutsma
 * @since 5.0
 */
public interface ServerRequest {

	/**
	 * Return the HTTP method.
	 */
	HttpMethod method();

	/**
	 * Return the request URI.
	 */
	URI uri();

	/**
	 * Return the request path.
	 */
	default String path() {
		return uri().getPath();
	}

	/**
	 * Return the headers of this request.
	 */
	Headers headers();

	/**
	 * Extract the body with the given {@code BodyExtractor}.
	 * @param extractor the {@code BodyExtractor} that reads from the request
	 * @param <T> the type of the body returned
	 * @return the extracted body
	 */
	<T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor);

	/**
	 * Extract the body to a {@code Mono}.
	 * @param elementClass the class of element in the {@code Mono}
	 * @param <T> the element type
	 * @return the body as a mono
	 */
	<T> Mono<T> bodyToMono(Class<? extends T> elementClass);

	/**
	 * Extract the body to a {@code Flux}.
	 * @param elementClass the class of element in the {@code Flux}
	 * @param <T> the element type
	 * @return the body as a flux
	 */
	<T> Flux<T> bodyToFlux(Class<? extends T> elementClass);

	/**
	 * Return the request attribute value if present.
	 * @param name the attribute name
	 * @param <T> the attribute type
	 * @return the attribute value
	 */
	<T> Optional<T> attribute(String name);

	/**
	 * Return the first query parameter with the given name, if present.
	 * @param name the parameter name
	 * @return the parameter value
	 */
	default Optional<String> queryParam(String name) {
		List<String> queryParams = this.queryParams(name);
		return !queryParams.isEmpty() ? Optional.of(queryParams.get(0)) : Optional.empty();
	}

	/**
	 * Return all query parameter with the given name. Returns an empty list if no values could
	 * be found.
	 * @param name the parameter name
	 * @return the parameter values
	 */
	List<String> queryParams(String name);

	/**
	 * Return the path variable with the given name, if present.
	 * @param name the variable name
	 * @return the variable value
	 * @throws IllegalArgumentException if there is no path variable with the given name
	 */
	default String pathVariable(String name) {
		Map<String, String> pathVariables = pathVariables();
		if (pathVariables.containsKey(name)) {
			return pathVariables().get(name);
		}
		else {
			throw new IllegalArgumentException(
					"No path variable with name \"" + name + "\" available");
		}
	}

	/**
	 * Return all path variables.
	 * @return the path variables
	 */
	Map<String, String> pathVariables();

	/**
	 * Represents the headers of the HTTP request.
	 * @see ServerRequest#headers()
	 */
	interface Headers {

		/**
		 * Return the list of acceptable {@linkplain MediaType media types},
		 * as specified by the {@code Accept} header.
		 *
Returns an empty list when the acceptable media types are unspecified.
		 */
		List<MediaType> accept();

		/**
		 * Return the list of acceptable {@linkplain Charset charsets},
		 * as specified by the {@code Accept-Charset} header.
		 */
		List<Charset> acceptCharset();

		/**
		 * Return the length of the body in bytes, as specified by the
		 * {@code Content-Length} header.
		 */
		OptionalLong contentLength();

		/**
		 * Return the {@linkplain MediaType media type} of the body, as specified
		 * by the {@code Content-Type} header.
		 */
		Optional<MediaType> contentType();

		/**
		 * Return the value of the required {@code Host} header.
		 *
If the header value does not contain a port, the returned
		 * {@linkplain InetSocketAddress#getPort() port} will be {@code 0}.
		 */
		InetSocketAddress host();

		/**
		 * Return the value of the {@code Range} header.
		 *
Returns an empty list when the range is unknown.
		 */
		List<HttpRange> range();

		/**
		 * Return the header value(s), if any, for the header of the given name.
		 *
Return an empty list if no header values are found.
		 *
		 * @param headerName the header name
		 */
		List<String> header(String headerName);

		/**
		 * Return the headers as a {@link HttpHeaders} instance.
		 */
		HttpHeaders asHttpHeaders();

	}

}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Carrotware.CMS.Mvc.UI.Admin.Models {

	public class FileUpModel {

		public FileUpModel() { }

		[DataType(DataType.Upload)]
		[Display(Name = "Posted File")]
		public HttpPostedFileBase PostedFile { get; set; }
	}
}


text:
<?php

if(!defined('IN_FUSION') || !checkrights('I')) {
	die;
}

require_once(INFUSIONS.'reviews_panel/include/core.php');

$infusion = array(
	'title'		=> 'Professional Review System',
	'description'	=> 'Professional Review System',
	'version'	=> '1.8.4',
	'developer'	=> 'Artur Wiebe',
	'email'		=> 'wibix@gmx.de',
	'weburl'	=> 'http://wibix.de',
);

$admin_links = array();
$admin_links[] = array(
	'title'		=> $infusion['title'],
	'image'		=> '',
	'url'		=> 'admin/admin.php',
	'rights'	=> 'PRP',
);

$site_links = array();
$site_links[] = array(
	'title'		=> $infusion['title'],
	'image'		=> '',
	'url'		=> 'review.php',
	'visibility'	=> '0',
);

/* TABLE STUFF */
$new_tables = array();
$alter_tables = array();
$new_rows = array();
$del_rows = array();

$new_tables['prp_reviews'] = "(
	review_id smallint(5) unsigned NOT NULL auto_increment,
	cat_id smallint(5) unsigned NOT NULL default '0',
	license_id smallint(5) unsigned NOT NULL default '0',
	dl_name varchar(100) NOT NULL default '',
	dl_desc text NOT NULL,
	dl_abstract varchar(255) NOT NULL default '',
	dl_copyright varchar(200) NOT NULL default '',
	lizenz_okay char(1) NOT NULL default '',
	lizenz_packet char(1) NOT NULL default '',
	lizenz_url varchar(255) NOT NULL default '',
	dl_count int(10) NOT NULL default '0',
	user_id smallint(5) unsigned NOT NULL default '0',
	hide_user enum('yes', 'no') NOT NULL default 'no',
	dl_ctime int(10) unsigned NOT NULL default '0',
	dl_mtime int(10) unsigned NOT NULL default '0',
	dl_homepage varchar(255) NOT NULL default '',
	dl_status char(1) NOT NULL default 'N',

	down varchar(255) NOT NULL default '',
	link_extern varchar(255) NOT NULL default '',
	version varchar(20) NOT NULL default '',
	dl_size varchar(20) NOT NULL default '',
	dl_pic varchar(255) NOT NULL default '',

	dl_broken_count tinyint(1) unsigned NOT NULL default '0',

	count_comments int(10) unsigned NOT NULL default '0',
	count_votes int(10) unsigned NOT NULL default '0',
	count_visitors int(10) unsigned NOT NULL default '0',
	count_subscribers int(10) unsigned NOT NULL default '0',
	avg_vote float(3,2) unsigned NOT NULL default '0.00',

	max_pics tinyint(1) NOT NULL default '5',

	dir_files varchar(255) NOT NULL default '',

	PRIMARY KEY (review_id),
	KEY (cat_id),
	KEY (user_id),
	KEY (license_id)
) TYPE=MyISAM;";

$new_tables['prp_cats'] = "(
	cat_id smallint(5) unsigned NOT NULL auto_increment,
	top_cat smallint(5) unsigned NOT NULL default '0',
	cat_name varchar(50) NOT NULL default '',
	cat_desc varchar(255) NOT NULL default '',
	cat_sorting varchar(50) NOT NULL default 'name ASC',
	cat_access tinyint(3) unsigned NOT NULL default '0',
	cat_upload_access tinyint(3) unsigned NOT NULL default '103',
	cat_review_access tinyint(3) unsigned NOT NULL default '0',
	cat_order smallint(5) unsigned NOT NULL default '0',
	count_reviews int(10) unsigned NOT NULL default '0',
	PRIMARY KEY (cat_id)
) TYPE=MyISAM;";

$new_tables['prp_votes'] = "(
	review_id smallint(5) unsigned NOT NULL default '0',
	user_id smallint(5) unsigned NOT NULL default '0',
	vote_opt tinyint(1) unsigned NOT NULL default '0',
	PRIMARY KEY (review_id, user_id)
) TYPE=MyISAM;";

$new_tables['prp_comments'] = "(
	comment_id int(10) unsigned NOT NULL auto_increment,
	review_id smallint(5) unsigned NOT NULL default '0',
	user_id smallint(5) unsigned NOT NULL default '0',
	comment_user_name varchar(50) NOT NULL default '',
	comment_text text NOT NULL,
	comment_timestamp int(10) unsigned NOT NULL default '0',
	comment_ip varchar(20) NOT NULL default '0.0.0.0',
	comment_smileys tinyint(1) unsigned NOT NULL default '1',
	PRIMARY KEY (comment_id),
	KEY (review_id)
) TYPE=MyISAM;";

$new_tables['prp_licenses'] = "(
	license_id smallint(5) unsigned NOT NULL auto_increment,
	license_name varchar(100) NOT NULL default '',
	license_text text NOT NULL,
	PRIMARY KEY (license_id)
) TYPE=MyISAM;";

$new_tables['prp_settings'] = "(
	id tinyint(1) unsigned NOT NULL auto_increment,
	title varchar(100) NOT NULL default '$inf_title',
	neupm smallint(5) unsigned NOT NULL default '1',
	defektpm smallint(5) unsigned NOT NULL default '1',
	image_ext varchar(200) NOT NULL default 'jpg,jpeg,gif,png',
	upload_image varchar(200) NOT NULL default 'infusions/reviews_panel/images/',
	image_max int(12) unsigned NOT NULL default '1048576',
	file_ext varchar(200) NOT NULL default 'zip,rar,tar,exe,tar.gz',
	upload_file varchar(200) NOT NULL default 'infusions/reviews_panel/reviews/',
	file_max int(12) unsigned NOT NULL default '2097152',
	downbereich tinyint(3) unsigned NOT NULL default '101',
	uploadbereich tinyint(3) unsigned NOT NULL default '103',
	kommentare tinyint(3) unsigned NOT NULL default '101',
	bewertungen tinyint(3) unsigned NOT NULL default '101',
	per_page tinyint(3) unsigned NOT NULL default '10',
	user_edit tinyint(1) unsigned NOT NULL default '0',
	hide_user_allow enum('yes', 'no') NOT NULL default 'no',
	version varchar(10) NOT NULL default '".$infusion['version']."',
	new_comm_pm tinyint(1) unsigned NOT NULL default '0',
	hide_cats tinyint(1) unsigned NOT NULL default '0',

	broken_text text NOT NULL,
	broken_count tinyint(1) unsigned NOT NULL default '0',
	broken_access tinyint(3) unsigned NOT NULL default '0',

	review_restricted text NOT NULL,

	new_days_long tinyint(1) unsigned NOT NULL default '0',
	pm_after_changes tinyint(1) unsigned NOT NULL default '5',
	do_log tinyint(1) unsigned NOT NULL default '1',
	theme varchar(50) NOT NULL default '',
	side_latest tinyint(1) unsigned NOT NULL default '5',
	side_top tinyint(1) unsigned NOT NULL default '5',
	mod_grp tinyint(3) unsigned NOT NULL default '103',
	need_verify enum('yes','no') NOT NULL default 'yes',
	image_max_w smallint(5) unsigned NOT NULL default '0',
	image_max_h smallint(5) unsigned NOT NULL default '0',
	image_scale enum('yes','no') NOT NULL default 'no',
	allow_notify enum('yes','no') NOT NULL default 'no',
	default_max_pics tinyint(1) NOT NULL default '5',

	PRIMARY KEY (id)
) TYPE=MyISAM;";

$new_tables['prp_files'] = "(
	file_id int(10) unsigned NOT NULL auto_increment,
	review_id smallint(5) unsigned NOT NULL default '0',
	file_version varchar(20) NOT NULL default '',
	file_desc varchar(100) NOT NULL default '',
	file_url varchar(255) NOT NULL default '',
	file_size varchar(20) NOT NULL default '',
	file_timestamp int(10) unsigned NOT NULL default '0',
	file_status tinyint(1) unsigned NOT NULL default '0',
	review_count int(10) unsigned NOT NULL default '0',
	PRIMARY KEY (file_id),
	KEY (review_id)
) TYPE=MyISAM;";

$new_tables['prp_log'] = "(
	log_id int(10) unsigned NOT NULL auto_increment,
	review_id smallint(5) unsigned NOT NULL default '0',
	user_id smallint(5) unsigned NOT NULL default '0',
	log_timestamp int(10) unsigned NOT NULL default '0',
	log_type tinyint(1) unsigned NOT NULL default '0',
	log_errno tinyint(1) unsigned NOT NULL default '0',
	PRIMARY KEY (log_id),
	KEY (review_id)
) TYPE=MyISAM;";

$new_tables['prp_images'] = "(
	pic_id int(10) unsigned NOT NULL auto_increment,
	review_id smallint(5) unsigned NOT NULL default '0',
	pic_desc varchar(100) NOT NULL default '',
	pic_url varchar(255) NOT NULL default '',
	pic_status tinyint(1) unsigned NOT NULL default '0',
	PRIMARY KEY (pic_id),
	KEY (review_id)
) TYPE=MyISAM;";

$new_tables['prp_notify'] = "(
	user_id smallint(5) unsigned NOT NULL default '0',
	review_id smallint(5) unsigned NOT NULL default '0',
	visited enum('yes', 'no') NOT NULL default 'yes',
	details tinyint unsigned NOT NULL default '0',
	PRIMARY KEY (user_id, review_id)
) TYPE=MyISAM;";

$new_rows[] = "prp_settings
SET
id=1,
broken_text='".stripinput($locale['PRP143'])."',
review_restricted='".stripinput($locale['PRP407'])."'";

include('ff/pf_conv.php');

?>


text:
import React from 'react'
import { render, screen } from '@testing-library/react'
import { axe } from 'jest-axe'

import { Sidebar } from '../Sidebar'

describe('Sidebars', () => {
  describe('sidebar:header', () => {
    test('renders sidebar with header with horizontal divider', () => {
      render(
        <Sidebar data-testid="list-id" header="Title">
          Children :)
        </Sidebar>
      )

      const titleElement = screen.queryByText('Title')
      expect(titleElement).toBeDefined()

      const dividerElement = screen.getByRole('separator')
      expect(dividerElement).toHaveAttribute('aria-orientation', 'horizontal')
    })

    test('contains no axe violations', async () => {
      const { container } = render(
        <Sidebar data-testid="list-id" header="Title">
          Children :)
        </Sidebar>
      )

      expect(await axe(container)).toHaveNoViolations()
    })
  })

  describe('sidebar:header', () => {
    test('renders the sidebar without header and vertical divider', () => {
      render(<Sidebar data-testid="list-id">Children :)</Sidebar>)

      const titleElement = screen.queryByText('Title')
      expect(titleElement).not.toBeInTheDocument()

      const dividerElement = screen.getByRole('separator')
      expect(dividerElement).toHaveAttribute('aria-orientation', 'vertical')
    })

    test('contains no axe violations', async () => {
      const { container } = render(
        <Sidebar data-testid="list-id">Children :)</Sidebar>
      )

      expect(await axe(container)).toHaveNoViolations()
    })
  })
})


text:
<?php

namespace poggit\japi\ci;

use poggit\japi\ApiException;
use poggit\japi\ApiHandler;
use poggit\japi\ApiModule;
use poggit\utils\internet\Curl;
use poggit\utils\internet\GitHubAPIException;
use poggit\utils\internet\Mysql;

class BuildInfoApi extends ApiHandler {
    public function process(\stdClass $request) {
        $buildId = (int) $request->buildId;
        $rows = Mysql::query("SELECT
            r.repoId, r.owner AS rowner, r.name AS rname, p.name AS pname, b.class, b.internal, b.created
            FROM builds b INNER JOIN projects p ON p.projectId = b.projectId INNER JOIN repos r ON r.repoId = p.repoId
            WHERE b.buildId = ?", "i", $buildId);
        if(count($rows) === 0) throw new ApiException("Build not found");
        $row = (object) $rows[0];
        try {
            Curl::ghApiGet("repositories/$row->repoId", ApiModule::$token);
        } catch(GitHubAPIException $e) {
            throw new ApiException("You have no access to this private repo");
        }
        return $row;
    }
}


text:
/*
 * @name Ray Casting
 * @arialabel White square in the middle of a screen split diagonally between light pink and dark pink. The white square is a back wall and the pinks form 4 other walls. The user's mouse controls a circle which turns into a 3D bump as it moves along the walls close to the front.
 * @description Original example by Jonathan Watson.
 *

Detecting the position of the mouse in 3D space with ray casting.
 */
const objects = [];
let eyeZ;

function setup() {
  createCanvas(710, 400, WEBGL);

  eyeZ = height / 2 / tan((30 * PI) / 180); // The default distance the camera is away from the origin.

  objects.push(new IntersectPlane(1, 0, 0, -100, 0, 0)); // Left wall
  objects.push(new IntersectPlane(1, 0, 0, 100, 0, 0)); // Right wall
  objects.push(new IntersectPlane(0, 1, 0, 0, -100, 0)); // Bottom wall
  objects.push(new IntersectPlane(0, 1, 0, 0, 100, 0)); // Top wall
  objects.push(new IntersectPlane(0, 0, 1, 0, 0, 0)); // Back wall

  noStroke();
  ambientMaterial(250);
}

function draw() {
  background(0);

  // Lights
  pointLight(255, 255, 255, 0, 0, 400);
  ambientLight(244, 122, 158);

  // Left wall
  push();
  translate(-100, 0, 200);
  rotateY((90 * PI) / 180);
  plane(400, 200);
  pop();

  // Right wall
  push();
  translate(100, 0, 200);
  rotateY((90 * PI) / 180);
  plane(400, 200);
  pop();

  // Bottom wall
  push();
  translate(0, 100, 200);
  rotateX((90 * PI) / 180);
  plane(200, 400);
  pop();

  // Top wall
  push();
  translate(0, -100, 200);
  rotateX((90 * PI) / 180);
  plane(200, 400);
  pop();

  plane(200, 200); // Back wall

  const x = mouseX - width / 2;
  const y = mouseY - height / 2;

  const Q = createVector(0, 0, eyeZ); // A point on the ray and the default position of the camera.
  const v = createVector(x, y, -eyeZ); // The direction vector of the ray.

  let intersect; // The point of intersection between the ray and a plane.
  let closestLambda = eyeZ * 10; // The draw distance.

  for (let x = 0; x < objects.length; x += 1) {
    let object = objects[x];
    let lambda = object.getLambda(Q, v); // The value of lambda where the ray intersects the object

    if (lambda < closestLambda && lambda > 0) {
      // Find the position of the intersection of the ray and the object.
      intersect = p5.Vector.add(Q, p5.Vector.mult(v, lambda));
      closestLambda = lambda;
    }
  }

  // Cursor
  push();
  translate(intersect);
  fill(237, 34, 93);
  sphere(10);
  pop();
}

// Class for a plane that extends to infinity.
class IntersectPlane {
  constructor(n1, n2, n3, p1, p2, p3) {
    this.normal = createVector(n1, n2, n3); // The normal vector of the plane
    this.point = createVector(p1, p2, p3); // A point on the plane
    this.d = this.point.dot(this.normal);
  }

  getLambda(Q, v) {
    return (-this.d - this.normal.dot(Q)) / this.normal.dot(v);
  }
}


text:
//////////////////////////////////////////////////////////////////////////
//                                                                      //
// This is a generated file. You can view the original                  //
// source in your browser if your browser supports source maps.         //
//                                                                      //
// If you are using Chrome, open the Developer Tools and click the gear //
// icon in its lower right corner. In the General Settings panel, turn  //
// on 'Enable source maps'.                                             //
//                                                                      //
// If you are using Firefox 23, go to `about:config` and set the        //
// `devtools.debugger.source-maps-enabled` preference to true.          //
// (The preference should be on by default in Firefox 24; versions      //
// older than 23 do not support source maps.)                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

(function () {

/* Imports */
var Meteor = Package.meteor.Meteor;
var TAPi18next = Package['tap:i18n'].TAPi18next;
var TAPi18n = Package['tap:i18n'].TAPi18n;
var Router = Package['iron:router'].Router;
var RouteController = Package['iron:router'].RouteController;
var postStatuses = Package['telescope-base'].postStatuses;
var STATUS_PENDING = Package['telescope-base'].STATUS_PENDING;
var STATUS_APPROVED = Package['telescope-base'].STATUS_APPROVED;
var STATUS_REJECTED = Package['telescope-base'].STATUS_REJECTED;
var adminMenu = Package['telescope-base'].adminMenu;
var viewsMenu = Package['telescope-base'].viewsMenu;
var userMenu = Package['telescope-base'].userMenu;
var addToPostSchema = Package['telescope-base'].addToPostSchema;
var addToCommentsSchema = Package['telescope-base'].addToCommentsSchema;
var addToSettingsSchema = Package['telescope-base'].addToSettingsSchema;
var addToUserSchema = Package['telescope-base'].addToUserSchema;
var registerPostProperty = Package['telescope-base'].registerPostProperty;
var registerCommentProperty = Package['telescope-base'].registerCommentProperty;
var registerSetting = Package['telescope-base'].registerSetting;
var registerUserProperty = Package['telescope-base'].registerUserProperty;
var preloadSubscriptions = Package['telescope-base'].preloadSubscriptions;
var primaryNav = Package['telescope-base'].primaryNav;
var secondaryNav = Package['telescope-base'].secondaryNav;
var mobileNav = Package['telescope-base'].mobileNav;
var viewParameters = Package['telescope-base'].viewParameters;
var footerModules = Package['telescope-base'].footerModules;
var heroModules = Package['telescope-base'].heroModules;
var threadModules = Package['telescope-base'].threadModules;
var postListTopModules = Package['telescope-base'].postListTopModules;
var postModules = Package['telescope-base'].postModules;
var postThumbnail = Package['telescope-base'].postThumbnail;
var postHeading = Package['telescope-base'].postHeading;
var postMeta = Package['telescope-base'].postMeta;
var postClassCallbacks = Package['telescope-base'].postClassCallbacks;
var postSubmitRenderedCallbacks = Package['telescope-base'].postSubmitRenderedCallbacks;
var postSubmitClientCallbacks = Package['telescope-base'].postSubmitClientCallbacks;
var postSubmitMethodCallbacks = Package['telescope-base'].postSubmitMethodCallbacks;
var postAfterSubmitMethodCallbacks = Package['telescope-base'].postAfterSubmitMethodCallbacks;
var postApproveCallbacks = Package['telescope-base'].postApproveCallbacks;
var postEditRenderedCallbacks = Package['telescope-base'].postEditRenderedCallbacks;
var postEditClientCallbacks = Package['telescope-base'].postEditClientCallbacks;
var postEditMethodCallbacks = Package['telescope-base'].postEditMethodCallbacks;
var postAfterEditMethodCallbacks = Package['telescope-base'].postAfterEditMethodCallbacks;
var commentClassCallbacks = Package['telescope-base'].commentClassCallbacks;
var commentSubmitRenderedCallbacks = Package['telescope-base'].commentSubmitRenderedCallbacks;
var commentSubmitClientCallbacks = Package['telescope-base'].commentSubmitClientCallbacks;
var commentSubmitMethodCallbacks = Package['telescope-base'].commentSubmitMethodCallbacks;
var commentAfterSubmitMethodCallbacks = Package['telescope-base'].commentAfterSubmitMethodCallbacks;
var commentEditRenderedCallbacks = Package['telescope-base'].commentEditRenderedCallbacks;
var commentEditClientCallbacks = Package['telescope-base'].commentEditClientCallbacks;
var commentEditMethodCallbacks = Package['telescope-base'].commentEditMethodCallbacks;
var commentAfterEditMethodCallbacks = Package['telescope-base'].commentAfterEditMethodCallbacks;
var upvoteCallbacks = Package['telescope-base'].upvoteCallbacks;
var downvoteCallbacks = Package['telescope-base'].downvoteCallbacks;
var cancelUpvoteCallbacks = Package['telescope-base'].cancelUpvoteCallbacks;
var cancelDownvoteCallbacks = Package['telescope-base'].cancelDownvoteCallbacks;
var upvoteMethodCallbacks = Package['telescope-base'].upvoteMethodCallbacks;
var downvoteMethodCallbacks = Package['telescope-base'].downvoteMethodCallbacks;
var cancelUpvoteMethodCallbacks = Package['telescope-base'].cancelUpvoteMethodCallbacks;
var cancelDownvoteMethodCallbacks = Package['telescope-base'].cancelDownvoteMethodCallbacks;
var userEditRenderedCallbacks = Package['telescope-base'].userEditRenderedCallbacks;
var userEditClientCallbacks = Package['telescope-base'].userEditClientCallbacks;
var userProfileCompleteChecks = Package['telescope-base'].userProfileCompleteChecks;
var userProfileDisplay = Package['telescope-base'].userProfileDisplay;
var userProfileEdit = Package['telescope-base'].userProfileEdit;
var userCreatedCallbacks = Package['telescope-base'].userCreatedCallbacks;
var getTemplate = Package['telescope-base'].getTemplate;
var templates = Package['telescope-base'].templates;
var getIcon = Package['telescope-base'].getIcon;
var icons = Package['telescope-base'].icons;
var colorTable = Package['telescope-base'].colorTable;
var registerElementColor = Package['telescope-base'].registerElementColor;
var themeSettings = Package['telescope-base'].themeSettings;
var getVotePower = Package['telescope-base'].getVotePower;
var deepExtend = Package['telescope-lib'].deepExtend;
var camelToDash = Package['telescope-lib'].camelToDash;
var dashToCamel = Package['telescope-lib'].dashToCamel;
var camelCaseify = Package['telescope-lib'].camelCaseify;
var removeSetting = Package['telescope-lib'].removeSetting;
var getThemeSetting = Package['telescope-lib'].getThemeSetting;
var getSiteUrl = Package['telescope-lib'].getSiteUrl;
var trimWords = Package['telescope-lib'].trimWords;
var can = Package['telescope-lib'].can;
var _ = Package.underscore._;
var capitalise = Package['telescope-lib'].capitalise;
var i18n = Package['telescope-i18n'].i18n;
var setLanguage = Package['telescope-i18n'].setLanguage;
var $ = Package.jquery.$;
var jQuery = Package.jquery.jQuery;
var Template = Package.templating.Template;
var Iron = Package['iron:core'].Iron;
var SimpleSchema = Package['aldeed:simple-schema'].SimpleSchema;
var MongoObject = Package['aldeed:simple-schema'].MongoObject;
var Blaze = Package.blaze.Blaze;
var UI = Package.blaze.UI;
var Handlebars = Package.blaze.Handlebars;
var HTML = Package.htmljs.HTML;

/* Package-scope variables */
var Releases, __, registerI18nTemplate, registerTemplate, non_package_templates, translations;

(function () {

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/telescope-releases/package-i18n.js                                                                       //
//                                                                                //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
TAPi18n.packages["telescope-releases"] = {"translation_function_name":"__","helper_name":"_","namespace":"project"}; // 1
                                                                                // 2
// define package's translation function (proxy to the i18next)                                                      // 3
__ = TAPi18n._getPackageI18nextProxy("project");                                                                     // 4
// define the package's templates registrar                                                                          // 5
registerI18nTemplate = TAPi18n._getRegisterHelpersProxy("telescope-releases");                                       // 6
registerTemplate = registerI18nTemplate; // XXX OBSOLETE, kept for backward compatibility will be removed in the future
                                                                                // 8
// Record the list of templates prior to package load                                                                // 9
var _ = Package.underscore._;                                                                                // 10
non_package_templates = _.keys(Template);                                                                            // 11
                                                                                // 12
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/telescope-releases/lib/releases.js                                                                       //
//                                                                                //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
Releases = new Meteor.Collection('releases');                                                                        // 1
                                                                                // 2
heroModules.push({                                                                                // 3
  template: 'currentRelease'                                                                                // 4
});                                                                                // 5
                                                                                // 6
preloadSubscriptions.push('currentRelease');                                                                         // 7
                                                                                // 8
Meteor.startup(function () {                                                                                // 9
  Releases.allow({                                                                                // 10
    insert: isAdminById,                                                                                // 11
    update: isAdminById,                                                                                // 12
    remove: isAdminById                                                                                // 13
  });                                                                                // 14
});                                                                                // 15
                                                                                // 16
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/telescope-releases/lib/client/templates/template.current_release.js                                      //
//                                                                                //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
                                                                                // 1
Template.__checkName("currentRelease");                                                                              // 2
Template["currentRelease"] = new Template("Template.currentRelease", (function() {                                   // 3
  var view = this;                                                                                // 4
  return Spacebars.With(function() {                                                                                // 5
    return Spacebars.call(view.lookup("currentRelease"));                                                            // 6
  }, function() {                                                                                // 7
    return [ "\n    ", HTML.DIV({                                                                                // 8
      "class": "current-release grid-module grid banner"                                                             // 9
    }, "\n      ", HTML.H4({                                                                                // 10
      "class": "banner-heading"                                                                                // 11
    }, Blaze.View("lookup:_", function() {                                                                           // 12
      return Spacebars.mustache(view.lookup("_"), "telescope_has_been_updated");                                     // 13
    })), "\n      ", HTML.DIV({                                                                                // 14
      "class": "markdown"                                                                                // 15
    }, "\n        ", Spacebars.include(view.lookupTemplate("markdown"), function() {                                 // 16
      return Blaze.View("lookup:notes", function() {                                                                 // 17
        return Spacebars.mustache(view.lookup("notes"));                                                             // 18
      });                                                                                // 19
    }), "\n      "), "\n      ", HTML.A({                                                                            // 20
      href: "#",                                                                                // 21
      "class": "release-dismiss banner-dismiss"                                                                      // 22
    }, "×"), "\n    "), "\n  " ];                                                                                // 23
  });                                                                                // 24
}));                                                                                // 25
                                                                                // 26
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/telescope-releases/lib/client/templates/current_release.js                                               //
//                                                                                //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
Meteor.startup(function () {                                                                                // 1
                                                                                // 2
  Template[getTemplate('currentRelease')].created = function () {                                                    // 3
    this.release = function () {                                                                                // 4
      return Releases.find({read: false}).fetch()[0];                                                                // 5
    }                                                                                // 6
  };                                                                                // 7
                                                                                // 8
  Template[getTemplate('currentRelease')].helpers({                                                                  // 9
    currentRelease: function () {                                                                                // 10
      return Template.instance().release();                                                                          // 11
    }                                                                                // 12
  });                                                                                // 13
                                                                                // 14
  Template[getTemplate('currentRelease')].events({                                                                   // 15
    'click .release-dismiss': function (event, instance) {                                                           // 16
      event.preventDefault();                                                                                // 17
      Releases.update(instance.release()._id, {$set: {read: true}});                                                 // 18
    }                                                                                // 19
  })                                                                                // 20
                                                                                // 21
});                                                                                // 22
                                                                                // 23
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

(function () {

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// packages/telescope-releases/Users/lukasfeitsma/Documents/Studie/CMD/Jaar2/Blok4/Project-X/klussenbank/packages/te //
//                                                                                //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                //
var _ = Package.underscore._,                                                                                // 1
    package_name = "telescope-releases",                                                                             // 2
    namespace = "telescope-releases";                                                                                // 3
                                                                                // 4
if (package_name != "project") {                                                                                // 5
    namespace = TAPi18n.packages[package_name].namespace;                                                            // 6
}                                                                                // 7
// integrate the fallback language translations                                                                      // 8
translations = {};                                                                                // 9
translations[namespace] = {"telescope_has_been_updated":"Telescope has been updated."};                              // 10
TAPi18n._loadLangFileObject("en", translations);                                                                     // 11
var package_templates = _.difference(_.keys(Template), non_package_templates);                                       // 12
                                                                                // 13
for (var i = 0; i < package_templates.length; i++) {                                                                 // 14
  var package_template = package_templates[i];                                                                       // 15
                                                                                // 16
  registerI18nTemplate(package_template);                                                                            // 17
}                                                                                // 18
                                                                                // 19
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}).call(this);

/* Exports */
if (typeof Package === 'undefined') Package = {};
Package['telescope-releases'] = {
  Releases: Releases
};

})();


text:
<?php

namespace Picqer\Financials\Exact;

/**
 * Class SalesPriceListPeriod.
 *
 * @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=SalesSalesPriceListPeriods
 *
 * @property string $ID Primary key. Price list period ID
 * @property string $Created Creation date
 * @property string $Creator User ID of creator
 * @property string $CreatorFullName Name of creator
 * @property string $Currency All prices in the price list are stored in this currency
 * @property int $Division Division code
 * @property string $EndDate Date when the price list should become inactive
 * @property string $Modified Last modified date
 * @property string $Modifier User ID of modifier
 * @property string $ModifierFullName Name of modifier
 * @property string $PriceList Price list ID
 * @property string $StartDate Date for the price list start activate
 * @property int $Type Indicate the type of price list : 1-Basic, 2-Special offer
 */
class SalesPriceListPeriod extends Model
{
    use Query\Findable;

    protected $fillable = [
        'ID',
        'Created',
        'Creator',
        'CreatorFullName',
        'Currency',
        'Division',
        'EndDate',
        'Modified',
        'Modifier',
        'ModifierFullName',
        'PriceList',
        'StartDate',
        'Type',
    ];

    protected $url = 'sales/SalesPriceListPeriods';
}


text:
<!DOCTYPE html>

  <title>Something went wrong (500)</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">

Error (500)

We're sorry, something went wrong.  :(

The developers have been alerted automatically.

If you need help immediately, open a GitHub issue or email them directly.

Back to Student Insights Home.


text:
[react-babylonjs](../../README.md) / [Exports](../../modules.md) / [loaders/loadedModel](../../modules/loaders_loadedmodel.md) / LoaderStatus

# Enumeration: LoaderStatus

[loaders/loadedModel](../../modules/loaders_loadedmodel.md).LoaderStatus

## Table of contents

### Enumeration members

- [Error](loadedmodel.loaderstatus.md#error)
- [Loaded](loadedmodel.loaderstatus.md#loaded)
- [Loading](loadedmodel.loaderstatus.md#loading)

## Enumeration members

### Error

• **Error**: = "Error"

Defined in: [loaders/loadedModel.ts:6](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L6)

___

### Loaded

• **Loaded**: = "Loaded"

Defined in: [loaders/loadedModel.ts:5](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L5)

___

### Loading

• **Loading**: = "Loading"

Defined in: [loaders/loadedModel.ts:4](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/loadedModel.ts#L4)


text:
pasten
======

pasten is a Go implementation of a Cassandra backed pastebin.
It stores its data in cassandra in the most simple way you could think of:

* Paste IDs are implemented as row keys.
* Paste properties such as owner, title, content or syntax are columns.

Multiple pastebins are supported by specifying separate column families, or,
if desired, entirely separate keyspaces.

Requirements
------------

In order to install pasten, you need to install a few prerequisites:

* golang-go
* golang-ancientauth
* golang-doozer-exportedservice
* golang-cassandra

Installation
------------

Once you have these, just run

    go build

 to complete the build process. You will then receive a binary called pasten
 which implements the pastebin service.

To set up the database, use cassandra-cli to connect to a local Cassandra
instance, then run the commands from the cassandra-schema file. Change them
as appropriate (e.g. if you want to use different settings for the keyspace
which is created).

You will need a certificate signed by the authority which your instance of
the Ancient Login Service runs. If you store the certificate as pasten.pem
and the key as pasten.key in DER format in your running directory, you don't
need to specify the key path flags.

Once this is done, just invoke the binary like:

    ./pasten --template-dir=templates --bind="[::]:8888"

Point your browser to http://localhost:8888/ to see if it worked.

Performance
-----------

On a test, 100 serial requests for a single paste took about 1 seconds.
Response times are typically somewhere around 1 millisecond.

Monitoring
----------

Like any good Go program, pasten exports a few variables under
/debug/vars:

* ancientauth-expired-requests: number of redirected requests from AncientAuth
  which have already expired; if this number is very high, it's possible that
  the system clock is not in sync.
* ancientauth-unknown-root-ca: the AncientAuth server signed the request with
  a CA this service doesn't recognize. Is the --cacert path set correctly?
* ancientauth-broken-requests: number of AncientAuth request packages which
  could not be parsed.
* ancientauth-forged-requests: number of AncientAuth authentication claims
  whose signature could not be verified.
* ancientauth-cert-expired: number of AncientAuth authentication claims signed
  by an expired certificate. If you see this, check the  certificate of the
  login server as well as the local clock on the server running pasten.
* ancientauth-unsupported-algos: number of AncientAuth authentication claims
  which could not be verified because they used an unsupported signature
  algorithm. If this number is higher than 0, this might mean that the
  AncientAuth server and client version diverged too far.
* ancientauth-unauthorized-requests: number of requests to add/edit a paste
  which came from users which were not logged in yet and were redirected to
  the login server.
* ancientauth-login-requests: number of times a requestor was sent to the
  login service.
* ancientauth-login-passed: number of requests which successfully logged in an
  user which was not logged in before.
* ancientauth-generic-errors: unspecified type of AncientAuth errors, check
  the logs.
* cassandra-not-found: number of records which Cassandra couldn't find in the
  database.
* cassandra-found: number of times a record was found successfully in the
  Cassandra database.
* cassandra-errors: number of errors, mapped by type, which ocurred talking
  to the Cassandra server.
* num-requests: total number of HTTP requests received by the binary.
* num-notfounds: total number of paste lookups which could not be retrieved as
  they didn't exist.
* num-views: number of times a paste was requested for viewing.
* num-edits: number of times a paste was added or edited.

Roadmap
-------

For future releases, we are planning to add the following features:

Version 1.0 will feature better web design and pastes which can be set to
expire after a given time.

There are also vague plans to add syntax highlighting for different
languages.

BUGS
----

Bugs for this project are tracked using ditz in the source code tree itself.
The current state of bug squashing can be viewed at
<http://pasten.ancient-solutions.com/bugtracker/>

To report bugs, please send a pull request with the ditz bug added to the
project
[caoimhechaos/pasten](https://github.com/caoimhechaos/pasten/) on GitHub.


text:
package com.mossle.internal.whitelist.persistence.domain;

// Generated by Hibernate Tools
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * WhitelistHost .
 *
 * @author Lingo
 */
@Entity
@Table(name = "WHITELIST_HOST")
public class WhitelistHost implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

    /** null. */
    private Long id;

    /** null. */
    private WhitelistApp whitelistApp;

    /** null. */
    private String value;

    /** null. */
    private Integer priority;

    public WhitelistHost() {
    }

    public WhitelistHost(WhitelistApp whitelistApp, String value,
            Integer priority) {
        this.whitelistApp = whitelistApp;
        this.value = value;
        this.priority = priority;
    }

    /** @return null. */
    @Id
    @GeneratedValue
    @Column(name = "ID", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    /**
     * @param id
     *            null.
     */
    public void setId(Long id) {
        this.id = id;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "APP_ID")
    public WhitelistApp getWhitelistApp() {
        return this.whitelistApp;
    }

    /**
     * @param whitelistApp
     *            null.
     */
    public void setWhitelistApp(WhitelistApp whitelistApp) {
        this.whitelistApp = whitelistApp;
    }

    /** @return null. */
    @Column(name = "VALUE", length = 50)
    public String getValue() {
        return this.value;
    }

    /**
     * @param value
     *            null.
     */
    public void setValue(String value) {
        this.value = value;
    }

    /** @return null. */
    @Column(name = "PRIORITY")
    public Integer getPriority() {
        return this.priority;
    }

    /**
     * @param priority
     *            null.
     */
    public void setPriority(Integer priority) {
        this.priority = priority;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="km_object_mapper.instantiator.doctrine.class">Doctrine\Instantiator\Instantiator</parameter>
        <parameter key="km_object_mapper.instantiator.doctrine_adapter.class">KrzysztofMazur\ObjectMapper\Integration\DoctrineInstantiatorAdapter</parameter>
        <parameter key="km_object_mapper.callback_builder.class">KrzysztofMazur\ObjectMapperBundle\ObjectMapperBuilder\FieldCallbackBuilder</parameter>
        <parameter key="km_object_mapper.configuration_loader.class">KrzysztofMazur\ObjectMapperBundle\ObjectMapperBuilder\ConfigurationLoader</parameter>
        <parameter key="km_object_mapper.mapper.builder.class">KrzysztofMazur\ObjectMapperBundle\ObjectMapperBuilder</parameter>
        <parameter key="km_object_mapper.mapper.class">KrzysztofMazur\ObjectMapper\ObjectMapper</parameter>
    </parameters>

    <services>
        <service id="km_object_mapper.instantiator.doctrine" class="%km_object_mapper.instantiator.doctrine.class%" public="false"/>
        <service id="km_object_mapper.instantiator.doctrine_adapter" class="%km_object_mapper.instantiator.doctrine_adapter.class%" public="false">
            <argument type="service" id="km_object_mapper.instantiator.doctrine"/>
        </service>

        <service id="km_object_mapper.callback_builder" class="%km_object_mapper.callback_builder.class%">
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="km_object_mapper.configuration_loader" class="%km_object_mapper.configuration_loader.class%">
            <argument>%km_object_mapper.configuration_locations%</argument>
            <argument type="service" id="km_object_mapper.callback_builder"/>
        </service>

        <service id="km_object_mapper.mapper.builder" class="%km_object_mapper.mapper.builder.class%" public="false">
            <call method="setConfigurationLoader">
                <argument type="service" id="km_object_mapper.configuration_loader"/>
            </call>
            <call method="setStopwatch">
                <argument type="service" id="debug.stopwatch"/>
            </call>
            <call method="setDebug">
                <argument>%kernel.debug%</argument>
            </call>
        </service>
        <service id="km_object_mapper.mapper" class="%km_object_mapper.mapper.class%">
            <factory service="km_object_mapper.mapper.builder" method="build"/>
        </service>
    </services>
</container>


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.camunda.bpm.engine.impl.persistence.entity;

import org.camunda.bpm.engine.history.HistoricActivityStatistics;

/**
 *
 * @author Roman Smirnov
 *
 */
public class HistoricActivityStatisticsImpl implements HistoricActivityStatistics {

  protected String id;
  protected long instances;
  protected long finished;
  protected long canceled;
  protected long completeScope;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public long getInstances() {
    return instances;
  }

  public void setInstances(long instances) {
    this.instances = instances;
  }

  public long getFinished() {
    return finished;
  }

  public void setFinished(long finished) {
    this.finished = finished;
  }

  public long getCanceled() {
    return canceled;
  }

  public void setCanceled(long canceled) {
    this.canceled = canceled;
  }

  public long getCompleteScope() {
    return completeScope;
  }

  public void setCompleteScope(long completeScope) {
    this.completeScope = completeScope;
  }

}


text:
import { KubernetesKeyValueObject } from './KubernetesResource';

export type ClusterIssuer = {
  kind: string;
  apiVersion: string;
  metadata: ClusterIssuerMetadata;
  spec: ClusterIssuerSpec;
};

export type ClusterIssuerMetadata = {
  name: string;
  namespace?: string;
  labels?: KubernetesKeyValueObject;
  annotations?: KubernetesKeyValueObject;
};

export type ClusterIssuerSpec = {
  acme: ACMEIssuer;
};

export type ACMEIssuer = {
  server: string;
  email?: string;
  privateKeySecretRef?: ACMEIssuerPrivateKeySecretRef;
};

export type ACMEIssuerPrivateKeySecretRef = {
  name: string;
};


text:
<?xml version="1.0" encoding="utf-8"?>

<resources>
  <dimen name="main_button_width">150dp</dimen>
  <dimen name="apod_image_width">90dp</dimen>
  <dimen name="apod_image_height">90dp</dimen>
</resources>


text:
class SymbolIterator {
    next() {
        return {
            value: Symbol(),
            done: false
        };
    }

    [Symbol.iterator]() {
        return this;
    }
}

var array = [...new SymbolIterator];

//// [iteratorSpreadInArray.js]
class SymbolIterator {
    next() {
        return {
            value: Symbol(),
            done: false
        };
    }
    [Symbol.iterator]() {
        return this;
    }
}
var array = [...new SymbolIterator];


text:
//
// System-Win32.cpp
//
// Copyright (c) 2013-2017 Tomas Palazuelos
//
// Distributed under the MIT Software License. (See accompanying file LICENSE.md)
//
#include <orion/System.h>

#include <orion/Log.h>

#include <host/win32/COM.h>
#include <host/win32/Registry.h>
#include <host/win32/String.h>

#include <fmt/format.h>

#ifndef WIN32_LEAN_AND_MEAN
#   define WIN32_LEAN_AND_MEAN
#endif
#include <lmcons.h> /* For UNLEN */
#include <process.h>
#include <windows.h>
#include <winternl.h>

#include <crtdbg.h>
#include <psapi.h>

#include <array>

namespace orion
{
namespace sys
{

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

void get_loaded_modules(unsigned long process_id, ModuleList& modules)
{
   DWORD cbNeeded;

   // Get a list of all the modules in this process.
   HANDLE handle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, process_id);
   if (handle == nullptr)
      return;

   HMODULE module_handles[1024];

   if (EnumProcessModulesEx(
          handle, module_handles, sizeof(module_handles), &cbNeeded, LIST_MODULES_ALL))
   {
      int count = static_cast<int>(cbNeeded / sizeof(HMODULE));

      for (int i = 0; i < count; i++)
      {
         wchar_t module_name[MAX_PATH];

         // Get the full path to the module's file.
         if (GetModuleFileNameExW(handle, module_handles[i], module_name, sizeof(module_name)))
         {
            // Print the module name and handle value.
            modules.push_back(win32::wstring_to_utf8(module_name));
         }
      }
   }
   CloseHandle(handle);
}

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

// The number of physical CPU cores (hyper-thread CPU count excluded)
static uint32_t get_cpu_count_phys()
{
   PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX buffer = nullptr;
   DWORD length                                    = 0;

   for (;;)
   {
      // GetLogicalProcessorInformationEx() is available from Windows 7
      // onward.
      if (GetLogicalProcessorInformationEx(RelationAll, buffer, &length) == TRUE)
         break;

      if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
      {
         if (buffer != nullptr)
            free(buffer);

         buffer = static_cast<PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(malloc(length));
         if (buffer == nullptr)
         {
            std::string error_message;

            win32::format_error_message(GetLastError(), error_message);
            log::error(error_message, DbgSrcLoc);
            return 0;
         }
         continue;
      }
      std::string error_message;

      win32::format_error_message(GetLastError(), error_message);
      log::error(error_message, DbgSrcLoc);
      return 0;
   }

   Span<SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX> slpi = make_span(buffer, sizeof(buffer));

   uint32_t ncpus = 0;

   for (auto item : slpi)
   {
      if (item.Relationship == RelationProcessorCore)
         ++ncpus;
   }
   return ncpus;
}

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

// Windows example values:
//
// struct CpuInfo
// {
//    std::string id;             Identifier:          Intel64 Family 6 Model 60 Stepping 3
//    std::string name;           ProcessorNameString: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
//    std::string vendor;         VendorIdentifier:    GenuineIntel
//    uint32_t    speed;          ~MHz:                3392
//    uint32_t    cpu_count;      The number of logical, active CPUs.
//    uint32_t    cpu_count_phys; The number of physical CPU cores (hyper-thread CPU count excluded)
// };
//
CpuInfo get_cpu_info()
{
   const char* key_to_open = R"(HARDWARE\DESCRIPTION\System\CentralProcessor\0)";

   win32::Registry reg;

   std::error_code ec = reg.open_key(HKEY_LOCAL_MACHINE, key_to_open, KEY_READ);
   log::error_if(ec, DbgSrcLoc);

   std::wstring value;
   value.reserve(4096);

   //
   // Id
   //

   ec = reg.query_value("Identifier", value);
   log::error_if(ec, DbgSrcLoc);

   CpuInfo cpu;

   cpu.id = win32::wstring_to_utf8(value);

   //
   // Name
   //

   ec = reg.query_value("ProcessorNameString", value);
   log::error_if(ec, DbgSrcLoc);

   cpu.name = win32::wstring_to_utf8(value);

   //
   // Vendor
   //

   ec = reg.query_value("VendorIdentifier", value);
   log::error_if(ec, DbgSrcLoc);

   cpu.vendor = win32::wstring_to_utf8(value);

   //
   // Speed
   //

   ec = reg.query_value("~MHz", cpu.speed);
   log::error_if(ec, DbgSrcLoc);

   //
   // Number of logical, active CPUs
   //

   // GetActiveProcessorCount is available only on 64 bit versions
   // of Windows from Windows 7 onward.
   cpu.cpu_count = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);

   //
   // Number of physical CPU cores
   //

   // GetLogicalProcessorInformationEx() is available from Windows 7
   // onward.
   cpu.cpu_count_phys = get_cpu_count_phys();

   return cpu;
}

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

CpuTimes get_cpu_times()
{
   CpuTimes cpu_times{};

   SYSTEM_INFO system_info;
   ZeroMemory(&system_info, sizeof(SYSTEM_INFO));

   GetSystemInfo(&system_info);

   uint32_t cpu_count = system_info.dwNumberOfProcessors;
   ULONG result_size  = 0u;
   DWORD sppi_size    = cpu_count * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);

   std::vector<SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION> sppi{cpu_count};

   NTSTATUS status = NtQuerySystemInformation(
      SystemProcessorPerformanceInformation, sppi.data(), sppi_size, &result_size);

   if (not NT_SUCCESS(status))
   {
      // err = RtlNtStatusToDosError(status);
      RtlNtStatusToDosError(status);
      return cpu_times;
   }

   for (const auto& item : sppi)
   {
      cpu_times.user += item.UserTime.QuadPart / 10000;
      cpu_times.nice += 0;
      cpu_times.sys += (item.KernelTime.QuadPart - item.IdleTime.QuadPart) / 10000;
      cpu_times.idle += item.IdleTime.QuadPart / 10000;
#if 0 // ndef __MINGW64__
      cpu_times.irq  += item.InterruptTime.QuadPart / 10000;
#else
      cpu_times.irq += item.Reserved1[0].QuadPart / 10000;
#endif
   }

   return cpu_times;
}

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

std::string get_os_version()
{
   DWORD size = GetFileVersionInfoSizeW(L"C:\\windows\\System32\\version.dll", nullptr);
   if (size == 0)
   {
      return "Microsoft Windows (Unkown version)";
   }

   std::unique_ptr<BYTE> data(new BYTE[size]);

   if (GetFileVersionInfoW(L"C:\\windows\\System32\\version.dll", 0, size, data.get()) == 0)
   {
      return "Microsoft Windows (Unkown version)";
   }

   VS_FIXEDFILEINFO* file_info = nullptr;
   UINT len                    = 0;

   if (not VerQueryValueW(data.get(), TEXT("\\"), reinterpret_cast<LPVOID*>(&file_info), &len))
   {
      return "Microsoft Windows (Unkown version)";
   }

   if (len == 0)
   {
      return "Microsoft Windows (Unkown version)";
   }

   int major  = HIWORD(file_info->dwProductVersionMS);
   int minor  = LOWORD(file_info->dwProductVersionMS);
   int hotfix = HIWORD(file_info->dwProductVersionLS);
   int other  = LOWORD(file_info->dwProductVersionLS);

   return fmt::format("Microsoft Windows {0}.{1}.{2}.{3}", major, minor, hotfix, other);
}

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

std::string get_host_name()
{
   wchar_t hostname[100];
   DWORD size         = sizeof(hostname);
   bool hostname_fail = GetComputerNameW(hostname, &size) == 0;

   return hostname_fail ? "localhost" : win32::wstring_to_utf8(hostname);
}

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

std::string get_user_name()
{
   std::string user_name;

   uint32_t len = UNLEN + 1;
   wchar_t buffer[UNLEN + 1];

   if (GetUserNameW(buffer, reinterpret_cast<LPDWORD>(&len)) != 0)
   {
      user_name = win32::wstring_to_utf8(buffer);
   }
   return user_name;
}

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

int get_process_id()
{
   return GetCurrentProcessId();
}

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

std::string get_program_name()
{
   HANDLE ph = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, get_process_id());
   if (ph == nullptr)
   {
      return "";
   }

   wchar_t module_name[MAX_PATH];

   GetModuleFileNameExW(ph, nullptr, module_name, sizeof(module_name));

   CloseHandle(ph);

   return win32::wstring_to_utf8(module_name);
}

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

void get_loadavg(double avg[3])
{
   avg[0] = avg[1] = avg[2] = 0;
}

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

Size<si::Byte> get_free_memory()
{
   MEMORYSTATUSEX memory_status;
   memory_status.dwLength = sizeof(memory_status);

   if (GlobalMemoryStatusEx(&memory_status) == 0)
   {
      return {};
   }

   return Size<si::Byte>{static_cast<uintmax_t>(memory_status.ullAvailPhys)};
}

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

Size<si::Byte> get_total_memory()
{
   MEMORYSTATUSEX memory_status;
   memory_status.dwLength = sizeof(memory_status);

   if (GlobalMemoryStatusEx(&memory_status) == 0)
   {
      return {};
   }

   return Size<si::Byte>{static_cast<uintmax_t>(memory_status.ullTotalPhys)};
}

} // namespace sys
} // namespace orion


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@drawable/profile_toolbar_button_talk_bubble_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/profile_toolbar_button_talk_bubble" android:state_pressed="false"/>

</selector>


text:
<?php
    session_start();

    if(!isset($_SESSION['user_id'])){
        require('../../../../assets/php/redirect.php');
        redirectUser('../../../../index.php');
    }

    $PageTitle = 'Wave';
    $SelectedHand = $_COOKIE["SelectedHand"];
    $Exercise = str_replace("%20", " ",$_COOKIE["SelectedExercise"]);
    $ID = $_SESSION['user_id'];

    include_once('../../Common/php/wristExerciseInformation.php');

    include('../../Common/html/header.html');
    include('../html/instructions.html');
    include('../../Common/html/gameStage.html');

    echo "<script type='text/javascript'>";
    echo "var targets = ".json_encode($results).";\n\r";
    echo "var movementKeys = Object.keys(targets);";
    echo "var repsToDo = ". $reps. ";". "\n\r";
    echo "var seqsToDo = ". $seq.";\n\r";
    echo "var selectedHand = '".$SelectedHand."';\n\r";
    echo "</script>";

    include('../html/resourcesToLoad.html');

    include('../../Common/html/footer.html');


text:
const StoreUpdate = require('nativescript-store-update')
const LocalesHelper = StoreUpdate.LocalesHelper
const testConstants = require('./tests.constants.spec')

describe('LocalesHelper ', () => {
  describe('translate function', () => {
    it('returns a translation if it exists', () => {
      expect(LocalesHelper.translate(testConstants.translation.key)).toEqual(
        testConstants.translation.value
      )
    })

    it('returns a translation if it exists', () => {
      expect(LocalesHelper.translate('NOPE')).toEqual('')
    })
  })

  describe('changeLang function', () => {
    it(`changes active lang if it's available`, () => {
      expect(LocalesHelper.currentLang).toEqual('en')
      LocalesHelper.changeLang('fr')
      expect(LocalesHelper.currentLang).toEqual('fr')
    })

    it(`changes use non regionalized version if it necessary`, () => {
      LocalesHelper.changeLang('en')
      expect(LocalesHelper.currentLang).toEqual('en')
      LocalesHelper.changeLang('fr-NOPE')
      expect(LocalesHelper.currentLang).toEqual('fr')
    })

    it(`does not change active lang if translation is not available`, () => {
      LocalesHelper.changeLang('en')
      expect(LocalesHelper.currentLang).toEqual('en')
      LocalesHelper.changeLang('nope')
      expect(LocalesHelper.currentLang).toEqual('en')
    })
  })
})


text:
package org.sagebionetworks.web.unitclient.widget.entity.tabs;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.sagebionetworks.repo.model.EntityHeader;
import org.sagebionetworks.repo.model.EntityPath;
import org.sagebionetworks.repo.model.Project;
import org.sagebionetworks.repo.model.auth.UserEntityPermissions;
import org.sagebionetworks.repo.model.docker.DockerRepository;
import org.sagebionetworks.repo.model.entitybundle.v2.EntityBundle;
import org.sagebionetworks.web.client.EntityTypeUtils;
import org.sagebionetworks.web.client.PortalGinInjector;
import org.sagebionetworks.web.client.place.Synapse;
import org.sagebionetworks.web.client.place.Synapse.EntityArea;
import org.sagebionetworks.web.client.utils.CallbackP;
import org.sagebionetworks.web.client.widget.breadcrumb.Breadcrumb;
import org.sagebionetworks.web.client.widget.breadcrumb.LinkData;
import org.sagebionetworks.web.client.widget.docker.DockerRepoListWidget;
import org.sagebionetworks.web.client.widget.docker.DockerRepoWidget;
import org.sagebionetworks.web.client.widget.entity.controller.StuAlert;
import org.sagebionetworks.web.client.widget.entity.menu.v2.ActionMenuWidget;
import org.sagebionetworks.web.client.widget.entity.tabs.DockerTab;
import org.sagebionetworks.web.client.widget.entity.tabs.DockerTabView;
import org.sagebionetworks.web.client.widget.entity.tabs.Tab;
import com.google.gwt.user.client.ui.Widget;

@RunWith(MockitoJUnitRunner.class)
public class DockerTabTest {
	@Mock
	Tab mockTab;
	@Mock
	DockerTabView mockView;
	@Mock
	DockerRepoListWidget mockDockerRepoListWidget;
	@Mock
	DockerRepoWidget mockDockerRepoWidget;
	@Mock
	Breadcrumb mockBreadcrumb;
	@Mock
	StuAlert mockSynAlert;
	@Mock
	PortalGinInjector mockGinInjector;

	@Mock
	CallbackP<Tab> mockOnClickCallback;
	@Mock
	CallbackP<String> mockUpdateEntityCallback;
	@Mock
	UserEntityPermissions mockPermissions;
	@Mock
	EntityBundle mockProjectEntityBundle;
	@Mock
	DockerRepository mockDockerRepoEntity;
	@Mock
	Project mockProjectEntity;
	@Mock
	Throwable mockProjectBundleLoadError;
	@Mock
	EntityBundle mockDockerRepoEntityBundle;
	@Mock
	EntityPath path;
	@Captor
	ArgumentCaptor<CallbackP> callbackPCaptor;
	@Mock
	CallbackP<String> mockEntitySelectedCallback;
	@Mock
	ActionMenuWidget mockActionMenuWidget;
	DockerTab tab;

	String projectEntityId = "syn123";
	String projectName = "test project";
	String dockerRepoEntityId = "syn170";
	String dockerRepoName = "test repository";

	@Before
	public void setUp() {
		tab = new DockerTab(mockTab, mockGinInjector);

		when(mockTab.getEntityActionMenu()).thenReturn(mockActionMenuWidget);
		when(mockGinInjector.getDockerTabView()).thenReturn(mockView);
		when(mockGinInjector.getDockerRepoListWidget()).thenReturn(mockDockerRepoListWidget);
		when(mockGinInjector.getBreadcrumb()).thenReturn(mockBreadcrumb);
		when(mockGinInjector.getStuAlert()).thenReturn(mockSynAlert);

		when(mockProjectEntityBundle.getEntity()).thenReturn(mockProjectEntity);
		when(mockProjectEntityBundle.getPermissions()).thenReturn(mockPermissions);
		when(mockProjectEntity.getName()).thenReturn(projectName);
		when(mockProjectEntity.getId()).thenReturn(projectEntityId);
		when(mockDockerRepoEntity.getId()).thenReturn(dockerRepoEntityId);
		when(mockDockerRepoEntity.getName()).thenReturn(dockerRepoName);
		when(mockDockerRepoEntityBundle.getEntity()).thenReturn(mockDockerRepoEntity);
		when(mockDockerRepoEntity.getRepositoryName()).thenReturn(dockerRepoName);
		when(mockGinInjector.createNewDockerRepoWidget()).thenReturn(mockDockerRepoWidget);

		List<EntityHeader> pathHeaders = new ArrayList<EntityHeader>();

		EntityHeader rootHeader = new EntityHeader();
		rootHeader.setId("1");
		rootHeader.setName("root");
		pathHeaders.add(rootHeader);

		EntityHeader projHeader = new EntityHeader();
		projHeader.setId("123");
		projHeader.setName(projectName);
		pathHeaders.add(projHeader);

		EntityHeader dsHeader = new EntityHeader();
		dsHeader.setId("170");
		dsHeader.setName("syn170");
		pathHeaders.add(dsHeader);

		path = new EntityPath();
		path.setPath(pathHeaders);
		when(mockDockerRepoEntityBundle.getPath()).thenReturn(path);
		tab.lazyInject();
	}

	@SuppressWarnings("unchecked")
	@Test
	public void testConstruction() {
		verify(mockView).setPresenter(tab);
		verify(mockView).setBreadcrumb(any(Widget.class));
		verify(mockView).setDockerRepoList(any(Widget.class));
		verify(mockView).setSynapseAlert(any(Widget.class));
		verify(mockView).setActionMenu(any(Widget.class));
		verify(mockTab).configure(anyString(), anyString(), anyString(), anyString(), any(EntityArea.class));
		verify(mockBreadcrumb).setLinkClickedHandler(callbackPCaptor.capture());
		verify(mockTab).setContent(any(Widget.class));

		// test click on breadcrumb
		String newEntityId = "syn9898989822";
		tab.setEntitySelectedCallback(mockEntitySelectedCallback);
		callbackPCaptor.getValue().invoke(new Synapse(newEntityId));
		verify(mockEntitySelectedCallback).invoke(newEntityId);
	}

	@Test
	public void testAsTab() {
		assertEquals(mockTab, tab.asTab());
	}

	@Test
	public void testSetTabClickedCallback() {
		tab.setTabClickedCallback(mockOnClickCallback);
		verify(mockTab).addTabClickedCallback(mockOnClickCallback);
	}

	@Test
	public void testConfigureWithProject() {
		String areaToken = null;
		tab.setEntitySelectedCallback(mockUpdateEntityCallback);
		tab.setProject(projectEntityId, mockProjectEntityBundle, null);
		tab.configure(mockProjectEntityBundle, areaToken);
		verify(mockSynAlert, atLeastOnce()).clear();
		verify(mockTab).setEntityNameAndPlace(eq(projectName), any(Synapse.class));
		verify(mockView, times(2)).setBreadcrumbVisible(false);
		verify(mockView).setDockerRepoListVisible(true);
		verify(mockView, times(2)).clearDockerRepoWidget();
		verify(mockUpdateEntityCallback, never()).invoke(anyString());
		verify(mockDockerRepoListWidget).configure(projectEntityId);
	}

	@Test
	public void testConfigureWithProjectFailure() {
		String areaToken = null;
		mockProjectEntityBundle = null;
		tab.setEntitySelectedCallback(mockUpdateEntityCallback);
		tab.setProject(projectEntityId, mockProjectEntityBundle, mockProjectBundleLoadError);
		tab.configure(mockProjectEntityBundle, areaToken);
		verify(mockSynAlert, atLeastOnce()).clear();
		verify(mockTab).setEntityNameAndPlace(eq(projectEntityId), any(Synapse.class));
		verify(mockDockerRepoListWidget, never()).configure(projectEntityId);
		verify(mockSynAlert).handleException(mockProjectBundleLoadError);
	}

	@SuppressWarnings("unchecked")
	@Test
	public void testConfigureWithDockerRepoEntity() {
		String areaToken = null;
		tab.setEntitySelectedCallback(mockUpdateEntityCallback);
		tab.setProject(projectEntityId, mockProjectEntityBundle, mockProjectBundleLoadError);
		tab.configure(mockDockerRepoEntityBundle, areaToken);
		verify(mockTab).setEntityNameAndPlace(eq(dockerRepoName), any(Synapse.class));
		verify(mockTab).showTab();
		verify(mockView).setBreadcrumbVisible(true);
		verify(mockView, times(2)).setDockerRepoListVisible(false);
		verify(mockView).setDockerRepoUIVisible(true);
		verify(mockView, atLeastOnce()).clearDockerRepoWidget();
		ArgumentCaptor<List> listCaptor = ArgumentCaptor.forClass(List.class);
		verify(mockBreadcrumb).configure(listCaptor.capture(), eq(dockerRepoName));
		List<LinkData> list = listCaptor.getValue();
		assertNotNull(list);
		assertEquals(1, list.size());
		assertEquals(list.get(0).getPlace(), new Synapse(projectEntityId, null, EntityArea.DOCKER, null));
		assertEquals(list.get(0).getText(), DockerTab.DOCKER);
		assertEquals(list.get(0).getEntityType(), EntityTypeUtils.getEntityTypeForEntityClassName(DockerRepository.class.getName()));
		verify(mockGinInjector).createNewDockerRepoWidget();
		verify(mockView).setDockerRepoWidget(any(Widget.class));
		verify(mockDockerRepoListWidget, never()).configure(projectEntityId);
	}

	@Test
	public void testShowError() {
		Throwable error = new Throwable();
		tab.showError(error);
		verify(mockSynAlert).clear();
		verify(mockSynAlert).handleException(error);
	}

	@Test
	public void testResetView() {
		tab.resetView();
		verify(mockView).setBreadcrumbVisible(false);
		verify(mockView).setDockerRepoListVisible(false);
		verify(mockView).setDockerRepoUIVisible(false);
		verify(mockView).clearDockerRepoWidget();
		verify(mockSynAlert, never()).handleException(any(Throwable.class));
	}
}


text:
package org.kuali.rice.ken.service.impl;

import org.apache.commons.lang.StringUtils;
import org.kuali.rice.ken.bo.NotificationMessageDelivery;
import org.kuali.rice.ken.document.kew.NotificationWorkflowDocument;
import org.kuali.rice.ken.service.NotificationMessageContentService;
import org.kuali.rice.ken.service.NotificationWorkflowDocumentService;
import org.kuali.rice.ken.util.NotificationConstants;
import org.kuali.rice.kew.api.WorkflowDocument;
import org.kuali.rice.kew.api.WorkflowRuntimeException;
import org.kuali.rice.kew.api.action.ActionRequest;
import org.kuali.rice.kew.api.action.ActionRequestType;
import org.kuali.rice.kim.api.identity.principal.Principal;
import org.kuali.rice.kim.api.services.KimApiServiceLocator;

import java.util.List;

/**
 * This class is responsible for interacting with KEW - this is the default implementation that
 * leverages the KEW client API.
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class NotificationWorkflowDocumentServiceImpl implements NotificationWorkflowDocumentService {
    private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
            .getLogger(NotificationWorkflowDocumentServiceImpl.class);

    private NotificationMessageContentService messageContentService;

    /**
     * Constructs a NotificationWorkflowDocumentServiceImpl instance.
     * @param messageContentService
     */
    public NotificationWorkflowDocumentServiceImpl(NotificationMessageContentService messageContentService) {
        this.messageContentService = messageContentService;
    }

    /**
     * Implements by instantiating a NotificationWorkflowDocument, which in turn interacts with
     * Workflow to set it up with an initiator of the passed in user id.
     * @see org.kuali.rice.ken.service.NotificationWorkflowDocumentService#createAndAdHocRouteNotificationWorkflowDocument(org.kuali.rice.ken.bo.NotificationMessageDelivery,
     *      java.lang.String, java.lang.String, java.lang.String)
     */
    public String createAndAdHocRouteNotificationWorkflowDocument(NotificationMessageDelivery messageDelivery,
            String initiatorUserId,
            String recipientUserId, String annotation) {
        // obtain a workflow user object first
        //WorkflowIdDTO initiator = new WorkflowIdDTO(initiatorUserId);

        // now construct the workflow document, which will interact with workflow
        WorkflowDocument document;
        if (StringUtils.isNotBlank(messageDelivery.getNotification().getDocTypeName())) {
            document = NotificationWorkflowDocument.createNotificationDocument(initiatorUserId,
                    messageDelivery.getNotification().getDocTypeName());
        } else {
            document = NotificationWorkflowDocument.createNotificationDocument(initiatorUserId);
        }

        // this is our loose foreign key to our message delivery record in notification
        document.setApplicationDocumentId(messageDelivery.getId().toString());
        //document.setAppDocId(messageDelivery.getId().toString());

        // now add the content of the notification as XML to the document
        document.setApplicationContent(messageContentService.generateNotificationMessage(
                messageDelivery.getNotification(), messageDelivery.getUserRecipientId()));

        if (!StringUtils.isBlank(messageDelivery.getNotification().getTitle())) {
            document.setTitle(messageDelivery.getNotification().getTitle());
        } else {
            LOG.error("Encountered notification with no title set: Message Delivery #" + messageDelivery.getId()
                    + ", Notification #" + messageDelivery.getNotification().getId());
        }

        // now set up the ad hoc route
        String actionRequested;
        if (NotificationConstants.DELIVERY_TYPES.ACK.equals(messageDelivery.getNotification().getDeliveryType())) {
            actionRequested = NotificationConstants.KEW_CONSTANTS.ACK_AD_HOC_ROUTE;
        } else {
            actionRequested = NotificationConstants.KEW_CONSTANTS.FYI_AD_HOC_ROUTE;
        }

        // Clarification of ad hoc route call
        // param 1 - actionRequested will be either ACK or FYI
        // param 2 - annotation is whatever text we pass in to describe the transaction - this will be system generated
        // param 3 - recipient is the person who will receive this request
        // param 4 - this is the responsibilityParty (a.k.a the system that produced this request), so we'll put the producer name in there
        // param 5 - this is the "force action" requests - if set to true, this will be delivered to the recipients list regardless of
        //           whether the recipient has already taken action on this request; in our case, this doesn't really apply at this point in time,
        //           so we'll set to true just to be safe

        // recipientUserId will always be a principal ID due to code changes in NotificationMessageDeliveryResolverServiceImpl.buildCompleteRecipientList()
        Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(recipientUserId);

        document.adHocToPrincipal(ActionRequestType.fromCode(actionRequested), annotation, principal.getPrincipalId(),
                messageDelivery.getNotification().getProducer().getName(), true);

        // now actually route it along its way
        document.route(annotation);

        return document.getDocumentId();
    }

    /**
     * This service method is implemented by constructing a NotificationWorkflowDocument using the
     * pre-existing document Id that is passed in.
     * @see org.kuali.rice.ken.service.NotificationWorkflowDocumentService#findNotificationWorkflowDocumentByDocumentId(java.lang.String,
     *      java.lang.String)
     */
    public WorkflowDocument getNotificationWorkflowDocumentByDocumentId(String initiatorUserId,
            String workflowDocumentId) {
        // construct the workflow id value object
        //WorkflowIdDTO initiator = new WorkflowIdDTO(initiatorUserId);

        // now return the actual document instance
        // this handles going out and getting the workflow document
        return NotificationWorkflowDocument.loadNotificationDocument(initiatorUserId, workflowDocumentId);
    }

    /**
     * @see org.kuali.rice.ken.service.NotificationWorkflowDocumentService#clearAllFyisAndAcknowledgeNotificationWorkflowDocument(java.lang.String,
     *      org.kuali.rice.ken.document.kew.NotificationWorkflowDocument, java.lang.String)
     */
    public void clearAllFyisAndAcknowledgeNotificationWorkflowDocument(String initiatorUserId,
            WorkflowDocument workflowDocument, String annotation) {
        List<ActionRequest> reqs = workflowDocument.getRootActionRequests();
        for (int i = 0; i < reqs.size(); i++) {
            LOG.info("Action Request[" + i + "] = " + reqs.get(i).getActionRequested());
            if (reqs.get(i).getActionRequested().equals(ActionRequestType.ACKNOWLEDGE)) {
                workflowDocument.acknowledge(annotation);
            } else if (reqs.get(i).getActionRequested().equals(ActionRequestType.FYI)) {
                workflowDocument.logAnnotation(annotation);
                workflowDocument.fyi();
            } else {
                throw new WorkflowRuntimeException("Invalid notification action request in workflow document ("
                        + workflowDocument.getDocumentId()
                        + ") was encountered.  Should be either an acknowledge or fyi and was not.");
            }
        }
    }

    /**
     * @see org.kuali.rice.ken.service.NotificationWorkflowDocumentService#terminateWorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument)
     */
    public void terminateWorkflowDocument(WorkflowDocument document) {
        document.superUserCancel("terminating document: documentId=" + document.getDocumentId() + ", appDocId="
                + document.getApplicationDocumentId());
    }
}


text:
package sorting;

public final class SelectionSortIntroduction {

	private SelectionSortIntroduction(){}

	private static void selectionSort(int[] x) {
	    for (int i=0; i<x.length-1; i++) {
	        int minIndex = i; // Index of smallest remaining value.
	        for (int j=i+1; j<x.length; j++)
	            if (x[minIndex] > x[j])
	                minIndex = j; // Remember index of new minimum
	        if (minIndex != i) {
	            // Exchange current element with smallest remaining.
	            int temp = x[i];
	            x[i] = x[minIndex];
	            x[minIndex] = temp;
	        }
	    }
	}

	private static void printIt(int[] ia){
		String sIa="";
		for (int i = 0; i < ia.length; i++) sIa +=(ia[i] + " ");
		System.out.println(sIa);
	}

	public static void main(String[] l){
		int[] ia = Tools.genArray(10);
		selectionSort(ia);
		printIt(ia);
	}
}


text:
var notification = null;
var chromeExtensionsUrl = "chrome://extensions/";

// Shows the notification window using the specified URL.
// Control continues at onNotificationDone().
function showNotification(url) {
  notification = window.webkitNotifications.createHTMLNotification(url);
  notification.onerror = function() {
    chrome.test.fail("Failed to show notification.");
  };
  notification.show();
}

// Called by the notification when it is done with its tests.
function onNotificationDone() {
  var views = chrome.extension.getViews();
  chrome.test.assertEq(2, views.length);
  notification.cancel();

  // This last step tests that crbug.com/40967 stays fixed.
  var listener = function(tabId, changeInfo, tab) {
    if (changeInfo.status != 'complete')
      return;
    // web_page1 loaded, open extension page to inject script
    if (tab.url == chromeExtensionsUrl) {
      console.log(chromeExtensionsUrl + ' finished loading.');
      chrome.tabs.onUpdated.removeListener(listener);
      chrome.test.succeed();
    }
  };

  chrome.tabs.onUpdated.addListener(listener);
  chrome.tabs.create({ url: chromeExtensionsUrl });
}

chrome.test.runTests([
  function hasPermission() {
    chrome.test.assertEq(0,  // allowed
                         webkitNotifications.checkPermission());
    chrome.test.succeed();
  },
  function absoluteURL() {
    showNotification(chrome.extension.getURL("notification.html"));
  },
  function relativeURL() {
    showNotification('notification.html');
  }
]);


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

namespace WireMock.Admin.Mappings
{
    /// <summary>
    /// RequestModel
    /// </summary>
    [FluentBuilder.AutoGenerateBuilder]
    public class WebhookRequestModel
    {
        /// <summary>
        /// Gets or sets the Url.
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// The methods
        /// </summary>
        public string Method { get; set; }

        /// <summary>
        /// Gets or sets the headers.
        /// </summary>
        public IDictionary<string, string> Headers { get; set; }

        /// <summary>
        /// Gets or sets the body.
        /// </summary>
        public string Body { get; set; }

        /// <summary>
        /// Gets or sets the body (as JSON object).
        /// </summary>
        public object BodyAsJson { get; set; }

        /// <summary>
        /// Use ResponseMessage Transformer.
        /// </summary>
        public bool? UseTransformer { get; set; }

        /// <summary>
        /// Gets the type of the transformer.
        /// </summary>
        public string TransformerType { get; set; }

        /// <summary>
        /// The ReplaceNodeOptions to use when transforming a JSON node.
        /// </summary>
        public string TransformerReplaceNodeOptions { get; set; }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>XLabs: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

XLabs

Cross-platform reusable C# libraries

Main Page

Packages

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

XLabs.Platform.Services.INetwork Member List

This is the complete list of members for XLabs.Platform.Services.INetwork, including all inherited members.

InternetConnectionStatus()	XLabs.Platform.Services.INetwork

IsReachable(string host, TimeSpan timeout)	XLabs.Platform.Services.INetwork

IsReachableByWifi(string host, TimeSpan timeout)	XLabs.Platform.Services.INetwork

ReachabilityChanged	XLabs.Platform.Services.INetwork

Generated by

     1.8.10


text:
package org.greencheek.spray.cache.memcached

import org.greencheek.util.memcached.{WithMemcached, MemcachedBasedSpec}
import akka.actor.ActorSystem
import net.spy.memcached.ConnectionFactoryBuilder.Protocol
import org.junit.runner.RunWith
import org.specs2.runner.JUnitRunner
import scala.concurrent._
import ExecutionContext.Implicits.global
import spray.util._
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.Duration

/**
 * Created by dominictootell on 22/06/2014.
 */
@RunWith(classOf[JUnitRunner])
class StaleCacheSpec extends MemcachedBasedSpec {

  val largeContent = LargeString.string
  val largeContent2 = "LARGE2"+ LargeString.string

  implicit val system = ActorSystem()

  override def useBinary = false

  "A Memcached cache" >> {
    "can store a piece of content, which is retrieved from stale cache" in {

      val hosts = "localhost:"+memcachedDport

      val cache = new MemcachedCache[String] ( memcachedHosts = hosts, protocol = Protocol.TEXT,
        doHostConnectionAttempt = true, waitForMemcachedSet = true,
        useStaleCache = true, timeToLive = Duration(1,TimeUnit.SECONDS),
        staleCacheAdditionalTimeToLive = Duration(4,TimeUnit.SECONDS))

      cache("content")( Future {
        Thread.sleep(1000)
        "WILL BE STALE"
      }).await === "WILL BE STALE"

      cache("content")("B").await === "WILL BE STALE"
      cache("content")("B").await === "WILL BE STALE"

      Thread.sleep(2500)

      val passThrough = cache("content")( Future {
        Thread.sleep(1000)
        "NEW VALUE"
      })

      cache("content")("B")
      cache("content")("B")
      cache("content")("B")
      cache("content")("B").await === "WILL BE STALE"
      cache("content")("B").await === "WILL BE STALE"

      passThrough.await === "NEW VALUE"

      cache("content")("B").await === "NEW VALUE"

    }
    "can store a piece of content, which is not retrieved from stale cache on timeout" in {

      val hosts = "localhost:"+memcachedDport

      val cache = new MemcachedCache[String] ( memcachedHosts = hosts, protocol = Protocol.TEXT,
        doHostConnectionAttempt = true, waitForMemcachedSet = true,
        useStaleCache = true, timeToLive = Duration(1,TimeUnit.SECONDS),
        staleCacheAdditionalTimeToLive = Duration(4,TimeUnit.SECONDS),
        staleCacheMemachedGetTimeout = Duration(1,TimeUnit.NANOSECONDS)
      )

      cache("content2")( Future {
        Thread.sleep(1000)
        "WILL BE STALE"
      }).await === "WILL BE STALE"

      cache("content2")("B").await === "WILL BE STALE"
      cache("content2")("B").await === "WILL BE STALE"

      Thread.sleep(2500)

      val passThrough = cache("content2")( Future {
        Thread.sleep(1000)
        "NEW VALUE"
      })

      cache("content2")("B")
      cache("content2")("B")
      cache("content2")("B")
      cache("content2")("B").await === "NEW VALUE"
      cache("content2")("B").await === "NEW VALUE"

      passThrough.await === "NEW VALUE"

      cache("content2")("B").await === "NEW VALUE"

    }
    "can store a piece of content, which is not retrieved from stale cache, when element is not present" in {

      val hosts = "localhost:"+memcachedDport

      val cache = new MemcachedCache[String] ( memcachedHosts = hosts, protocol = Protocol.TEXT,
        doHostConnectionAttempt = true, waitForMemcachedSet = true,
        useStaleCache = true, timeToLive = Duration(1,TimeUnit.SECONDS),
        staleCacheAdditionalTimeToLive = Duration(4,TimeUnit.SECONDS),
        staleCacheMemachedGetTimeout = Duration(100,TimeUnit.MILLISECONDS),
        waitForMemcachedRemove = true
      )

      cache("content3")( Future {
        Thread.sleep(1000)
        "WILL BE STALE"
      }).await === "WILL BE STALE"

      cache("content3")("B").await === "WILL BE STALE"
      cache("content3")("B").await === "WILL BE STALE"

      Thread.sleep(2500)

      val passThrough = cache("content3")( Future {
        Thread.sleep(5000)
        "NEW VALUE"
      })

      cache.remove("content3")

      cache("content3")("B")
      cache("content3")("B")
      cache("content3")("B")
      cache("content3")("B").await === "B"
      cache("content3")("B").await === "B"

      passThrough.await === "NEW VALUE"

      Thread.sleep(2500)

      cache("content3")(Future {
        Thread.sleep(1000)
        "B"
      })

      cache("content3")("B")
      cache("content3")("B")
      cache("content3")("B").await === "NEW VALUE"

    }
  }

}