text:
import tensorflow as tf
from ._dataset import DataSet, DataSource
from ._schema import SchemaFieldType

class CsvDataSet(DataSet):
  """A DataSet representing data in csv format.
  """
  def __init__(self, schema, metadata=None, features=None, **kwargs):
    """Initializes a CsvDataSet with the specified DataSource instances.

    Arguments:
      schema: the description of the source data.
      metadata: additional per-field information associated with the data.
      features: the optional description of the transformed data.
      kwargs: the set of CsvDataSource instances or csv paths to populate this DataSet with.
    """
    datasources = {}
    for name, value in kwargs.iteritems():
      if isinstance(value, str):
        value = CsvDataSource(value)

      if isinstance(value, CsvDataSource):
        datasources[name] = value
      else:
        raise ValueError('The specified DataSource is not a CsvDataSource')

    if not len(datasources):
      raise ValueError('At least one DataSource must be specified.')

    super(CsvDataSet, self).__init__(datasources, schema, metadata, features)

  def parse_instances(self, instances, prediction=False):
    """Parses input instances according to the associated schema.

    Arguments:
      instances: The tensor containing input strings.
      prediction: Whether the instances are being parsed for producing predictions or not.
    Returns:
      A dictionary of tensors key'ed by field names.
    """
    return parse_csv(self.schema, instances, prediction)

class CsvDataSource(DataSource):
  """A DataSource representing one or more csv files.
  """
  def __init__(self, path, delimiter=','):
    """Initializes an instance of a CsvDataSource with the specified csv file(s).

    Arguments:
      path: the csv file containing the data. This can be a pattern to represent a set of files.
      delimiter: the delimiter character used.
    """
    super(CsvDataSource, self).__init__()
    self._path = path
    self._delimiter = delimiter

  @property
  def path(self):
    """Retrives the path represented by the DataSource.
    """
    return self._path

  def read_instances(self, count, shuffle, epochs):
    """Reads the data represented by this DataSource using a TensorFlow reader.

    Arguments:
      epochs: The number of epochs or passes over the data to perform.
    Returns:
      A tensor containing instances that are read.
    """
    # None implies unlimited; switch the value to None when epochs is 0.
    epochs = epochs or None

    files = tf.train.match_filenames_once(self._path, name='files')
    queue = tf.train.string_input_producer(files, num_epochs=epochs, shuffle=shuffle,
                                           name='queue')
    reader = tf.TextLineReader(name='reader')
    _, instances = reader.read_up_to(queue, count, name='read')

    return instances

def parse_csv(schema, instances, prediction):
  """A wrapper around decode_csv that parses csv instances based on provided Schema information.
  """
  if prediction:
    # For training and evaluation data, the expectation is the target column is always present.
    # For prediction however, the target may or may not be present.
    # - In true prediction use-cases, the target is unknown and never present.
    # - In prediction for model evaluation use-cases, the target is present.
    # To use a single prediction graph, the missing target needs to be detected by comparing
    # number of columns in instances with number of columns defined in the schema. If there are
    # fewer columns, then prepend a ',' (with assumption that target is always the first column).
    #
    # To get the number of columns in instances, split on the ',' on the first instance, and use
    # the first dimension of the shape of the resulting substring values.
    columns = tf.shape(tf.string_split([instances[0]], delimiter=',').values)[0]
    instances = tf.cond(tf.less(columns, len(schema)),
                        lambda: tf.string_join([tf.constant(','), instances]),
                        lambda: instances)

  # Convert the schema into a set of tensor defaults, to be used for parsing csv data.
  defaults = []
  for field in schema:
    if field.length != 1:
      # TODO: Support variable length, and list columns in csv.
      raise ValueError('Unsupported schema field "%s". Length must be 1.' % field.name)

    if field.type == SchemaFieldType.integer:
      field_default = tf.constant(0, dtype=tf.int64)
    elif field.type == SchemaFieldType.real:
      field_default = tf.constant(0.0, dtype=tf.float32)
    else:
      # discrete, text, binary
      field_default = tf.constant('', dtype=tf.string)
    defaults.append([field_default])

  values = tf.decode_csv(instances, defaults, name='csv')

  parsed_instances = {}
  for field, value in zip(schema, values):
    # The parsed values are scalars, so each tensor is of shape (None,); turn them into tensors
    # of shape (None, 1).
    parsed_instances[field.name] = tf.expand_dims(value, axis=1, name=field.name)

  return parsed_instances


text:
Event::Event(int key, int scancode, int action, int mods) :
	type(EventType::KEY), key(key), scancode(scancode), action(action), mods(mods)
{
}

Event::Event(double xpos, double ypos, bool isScroll) : x(xpos), y(ypos)
{
	if (isScroll)
		type = EventType::SCROLL;
	else
		type = EventType::MOUSE;
}

Event::~Event()
{
}

redpajama_set_name: RedPajamaGithub


text:
package org.keycloak.testsuite.adapter.example.authorization;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm;

import javax.ws.rs.core.Response;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.keycloak.admin.client.resource.AuthorizationResource;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.representations.idm.UserRepresentation;
import org.keycloak.representations.idm.authorization.PolicyRepresentation;
import org.keycloak.representations.idm.authorization.ResourceRepresentation;
import org.keycloak.testsuite.adapter.page.PhotozClientAuthzTestApp;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
import org.keycloak.testsuite.util.javascript.ResponseValidator;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
import org.keycloak.util.JsonSerialization;

/**
 * @author Pedro Igor
 */
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY)
@AppServerContainer(ContainerConstants.APP_SERVER_WILDFLY_DEPRECATED)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP6)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP71)
@AppServerContainer(ContainerConstants.APP_SERVER_UNDERTOW)
public class LifespanAdapterTest extends AbstractPhotozExampleAdapterTest {

    @Deployment(name = PhotozClientAuthzTestApp.DEPLOYMENT_NAME)
    public static WebArchive deploymentClient() throws IOException {
        return exampleDeployment(PhotozClientAuthzTestApp.DEPLOYMENT_NAME);
    }

    @Deployment(name = RESOURCE_SERVER_ID, managed = false, testable = false)
    public static WebArchive deploymentResourceServer() throws IOException {
        return exampleDeployment(RESOURCE_SERVER_ID,
              webArchive -> webArchive.addAsWebInfResource(new File(TEST_APPS_HOME_DIR + "/photoz/keycloak-cache-lifespan-authz-service.json"), "keycloak.json"));
    }

    @Override
    public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
        RealmRepresentation realm = loadRealm(new File(TEST_APPS_HOME_DIR + "/photoz/photoz-realm.json"));
        realm.setAccessTokenLifespan(70); // must increase lifespan of access token in order to use bigger offset in test cases
        testRealms.add(realm);
    }

    @Test
    public void testPathConfigInvalidation() throws Exception {
        loginToClientPage(aliceUser);
        assertSuccess();

        ResourceRepresentation resource = getAuthorizationResource().resources().findByName("Profile Resource").get(0);
        AuthorizationResource authorizationResource = getAuthorizationResource();

        authorizationResource.resources().resource(resource.getId()).remove();
        assertThat(getAuthorizationResource().resources().findByName("Profile Resource").isEmpty(), Matchers.is(true));

        loginToClientPage(aliceUser);

        // should throw an error because the resource was removed and cache entry did not expire yet
        assertFailure();

        setTimeOffsetOfAdapter(40);

        loginToClientPage(aliceUser);
        assertSuccess();
        setTimeOffsetOfAdapter(0);

        try (Response response = authorizationResource.resources().create(resource)) {
            resource = response.readEntity(ResourceRepresentation.class);
        }

        loginToClientPage(aliceUser);
        assertSuccess();

        RealmResource realm = this.realmsResouce().realm(REALM_NAME);
        UserRepresentation userRepresentation = realm.users().search(aliceUser.getUsername()).get(0);
        UserResource userResource = realm.users().get(userRepresentation.getId());

        userRepresentation.setEmail("alice@anotherdomain.org");

        userResource.update(userRepresentation);
        loginToClientPage(aliceUser);
        assertTicket();

        try {
            PolicyRepresentation resourceInstancePermission = new PolicyRepresentation();

            resourceInstancePermission.setName("View User Permission");
            resourceInstancePermission.setType("resource");

            Map<String, String> config = new HashMap<>();

            config.put("resources", JsonSerialization.writeValueAsString(Collections.singletonList(resource.getId())));
            config.put("applyPolicies", JsonSerialization.writeValueAsString(Collections.singletonList("Only From @keycloak.org or Admin")));

            resourceInstancePermission.setConfig(config);
            authorizationResource.policies().create(resourceInstancePermission);
        } catch (IOException e) {
            throw new RuntimeException("Error creating policy.", e);
        }

        loginToClientPage(aliceUser);
        // should throw an error because the resource was removed and cache entry did not expire yet
        assertFailure();

        userRepresentation.setEmail("alice@keycloak.org");

        userResource.update(userRepresentation);
        loginToClientPage(aliceUser);
        assertSuccess();
    }

    private void assertSuccess() {
        assertState(true);
    }

    private void assertFailure() {
        assertState(false);
    }

    private void assertState(boolean state) {
        clientPage.viewProfile((ResponseValidator) response -> {
            Object res = response.get("res");
            assertThat(res, Matchers.notNullValue());
            Matcher<String> matcher = Matchers.containsString("userName");
            assertThat(res.toString(), state ? matcher : Matchers.not(matcher));
        });
    }

    private void assertTicket() {
        clientPage.viewProfile((ResponseValidator) response -> {
            Object headers = response.get("responseHeaders");
            assertThat(headers, Matchers.notNullValue());

            List<String> headersList = Arrays.asList(headers.toString().split("\r\n"));
            String wwwAuthenticate = headersList.stream()
                    .filter(s -> s.toLowerCase().startsWith("www-authenticate:"))
                    .findFirst()
                    .orElse(null);

            assertThat(wwwAuthenticate, Matchers.notNullValue());
            assertThat(wwwAuthenticate, Matchers.containsString("UMA"));
        });
    }

    public void setTimeOffsetOfAdapter(int offset) {
        this.driver.navigate().to(clientPage.getInjectedUrl() + "timeOffset.jsp?offset=" + offset);
    }
}


text:
FROM postgres:10.3

RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8


text:
@extends('site.layouts.default')

@section('content')

About {{{env('APP_NAME')}}}

                Environment : {{{App::environment()}}}

                Laravel :{{{App::version()}}}

                Version : {{{env('APP_VERSION')}}}

                PHP :  {{ phpversion() }}

@endsection


text:
BEGIN;

CREATE OR REPLACE VIEW "liquid_feedback_version" AS
  SELECT * FROM (VALUES ('1.2.8', 1, 2, 8))
  AS "subquery"("string", "major", "minor", "revision");

ALTER TABLE "delegation" DROP CONSTRAINT "delegation_area_id_key";
ALTER TABLE "delegation" DROP CONSTRAINT "delegation_issue_id_key";
DROP INDEX "delegation_global_truster_id_trustee_id_unique_idx";

ALTER TABLE "delegation" ADD UNIQUE ("area_id", "truster_id");
ALTER TABLE "delegation" ADD UNIQUE ("issue_id", "truster_id");
CREATE UNIQUE INDEX "delegation_global_truster_id_unique_idx"
  ON "delegation" ("truster_id") WHERE "scope" = 'global';

COMMIT;


text:
<?php

include('db.inc.php');

//This function cleans the input from
// malicious strings and returns the clean
// version.  There might be a better way
// to do this but this works for the most
// part.  :/
function testInput($data)
{
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
}

//This function takes in an RFID alpha numeric string
//and a comma separated list of field names to return.
//The RFID belongs to the member and the fields are the
//ones you want to have back.
function getMemberInfoByRFID($rfid,$fieldNames)
{
  global $con;

  $rfid = testInput($rfid);
  $fieldNames = testInput($fieldNames);

  $memberInfo = array();

  if($fieldNames == "")
  {
	$fieldNames = "*";
  }

  //first build the query
  $query = "SELECT " . $fieldNames . " FROM
			(
			`key` k
			LEFT JOIN  `contact` c ON k.cid = c.cid
			)
			WHERE k.serial = '" . $rfid . "'";

  //then get the matching member
  $result = mysqli_query($con, $query)
		  or die(json_encode(array("getMemberInfoByRFIDQueryERROR" => mysql_error())));

  //then stick the member info into an assoc array
  $memberInfo = mysqli_fetch_assoc($result);

  return $memberInfo;
}

//This function returns the unix timestamp of the last payment made
// for the member with the given RFID.
function getMemberLastPaymentTimestamp($rfid)
{
  global $con;

  $rfid = testInput($rfid);

  $memberInfo = array();

  //first see if the key is even in the system.
  //We could just do a big join all at once but we wouldn't know
  // if the key or the member was not found, etc.
  $query = "SELECT cid FROM `key` WHERE serial = '" . $rfid . "'";

  //then get the matching member
  $result = mysqli_query($con, $query)
		  or die(json_encode(array("getKeyQueryERROR"=>mysql_error())));

  $keyRow = mysqli_fetch_assoc($result);

  if($keyRow == 0)
  {
	return array("ERROR"=>"No key found for RFID: " . $rfid);
  }

  //then get the last payment entered for this member
  $query = "SELECT UNIX_TIMESTAMP(MAX(date)) FROM payment WHERE value > 0 and credit = " . $keyRow['cid'];

  $result = mysqli_query($con, $query)
		  or die(json_encode(array("getPaymentQueryERROR"=>mysql_error())));

  $paymentInfo = mysqli_fetch_array($result);

  $timestamp = $paymentInfo[0];

  if($timestamp == NULL)
  {
	return array("ERROR"=>"No payments found for key owner.");
  }

  $iso8601 = date('c', $timestamp);

  $jsonResponse = array("timestamp"=>$timestamp,"iso8601"=>$iso8601);
  return $jsonResponse;
}

//action=getRFIDWhitelist
//returns JSON array of all key serial values for all members who owe less than 2 months
// of their monthly plan's dues.
function getRFIDWhitelist()
{
	global $con;

	$whiteList = array();

	//get everyone's plan prices and balances and check here
	$balances = payment_accounts();
	foreach ($balances as $cid => $bal) {
		//now get this member's monthly plan amount
		$memberData = member_data(array("cid"=>$cid));
		$planAmount = $memberData[0]["membership"][0]["plan"]["price"];
		$firstName = $memberData[0]["contact"]["firstName"];
		$lastName = $memberData[0]["contact"]["lastName"];
		$memberBalance = $bal['value'] / 100;
		if ($memberBalance <= ($planAmount * 2) || $memberBalance == 0) {
			//this member has paid their dues. Add to whitelist.
			//get their key serial and add that too!
			$query = "SELECT serial FROM `key` WHERE char_length(serial) > 5 and cid = " . $cid;
			$result = mysqli_query($con, $query)
				or die(json_encode(array("getRFIDWhitelistQueryERROR"=>mysqli_error($con))));
			$r = mysqli_fetch_assoc($result);
			$serial = $r["serial"];
			if ($serial != NULL)
			{
				$whiteList[] = array("firstName"=>$firstName,"lastName"=>$lastName,"serial"=>$serial);
			}
		}
	}

	return $whiteList;
}

//action=doorLockCheck&rfid=<scanned RFID>
//returns JSON string TRUE if key owner has a balance less than 2 times
// their current montly plan price, FALSE or error string if not.
function doorLockCheck($rfid)
{
	global $con;

	$rfid = testInput($rfid);

	//get the key owner and their current membership plan
	$query = "SELECT c.cid, p.price
				FROM ((
				`key` k
				LEFT JOIN  `contact` c ON k.cid = c.cid
				)
				LEFT JOIN `membership` m ON m.cid = c.cid
				)
				LEFT JOIN `plan` p ON p.pid = m.pid
				where k.serial = '" . $rfid . "'";

	$result = mysqli_query($con, $query)
		  or die(json_encode(array("doorLockCheckQueryERROR"=>mysqli_error($con))));

	//if no rows returned then that key wasn't even found in the DB
	if(mysqli_num_rows($result) == 0)
	{
		$jsonResponse = array("key " . $rfid . " not found in db");
	}
	else
	{
		$row = mysqli_fetch_assoc($result);

		$memberID = $row["cid"];
		$planPrice = $row["price"];

		$accountData = payment_accounts(array("cid" => $memberID));
		//{"2":{"credit":"2","code":"USD","value":5000}}

		$memberBalance = $accountData[$memberID]["value"] / 100;

		//if the current key owner's balance is
		// greater than 2 months of dues then access is denied!
		// Unless thier plan price is zero then 0 balance == 0 price is OK.
		if ($memberBalance > ($planPrice * 2) && $memberBalance > 0)
		{
			$jsonResponse = array("member balance = " . $memberBalance);
		}
		else
		{
			$jsonResponse = array("True");
		}
	}

	return $jsonResponse;
}

// ------------------------------------------------------------------------------
//
// Checkin Process and Hackerspace Status functions
//
// ------------------------------------------------------------------------------

// GetActiveMembersNames
// This funcion gets a list of names that are in the hackerspace, basically all users that are checked in.
function getActiveMembersNames()
{

	global $con;

	$query = "SELECT firstName FROM contact WHERE active = '1'";

	$result = mysqli_query($con, $query)
		  or die(json_encode(array("getActiveMembersNames" => mysql_error())));
	$array = array();

	$i=0;
	while($row = mysqli_fetch_array($result)) {
	  $name = $row['firstName'];
	  $array[$i] = $name . ', ';
	  $i++;
	}

	$var="";
	for ($item=0 ; $item<$i ; $item++)
	{
		$var.=$array[$item];
	}
	return $var;
}

// getActiveMembersTotal
// Gets a number of total active users / checked in users
function getActiveMembersTotal()
{

	global $con;

	$query = "SELECT COUNT(*) AS count FROM contact WHERE active = '1'";

	//then get the matching members
	$result = mysqli_query($con, $query)
		  or die(json_encode(array("getActiveMembersTotal" => mysql_error())));

	$row = mysqli_fetch_array($result);

	return $row['count'];
}

// Create a log in the logs table when a member does a check in
function createLog($contactId, $currentDate)
{

	global $con;

	$query = "INSERT INTO checkin_logs (lid, cid, check_in, check_out) VALUES ('', '$contactId', '$currentDate', '0000-00-00 00:00:00')";

	if (!mysqli_query($con,$query)) {
		return mysqli_error($con);
	}else{
		return true;
	}

}

// Update a log in the logs table
// Close the log when member is checked out
function updateLog($contactId, $currentDate, $contactLastCheckinTime)
{

	global $con;

	$query = "UPDATE checkin_logs SET check_out='$currentDate', log_closed=1 WHERE cid='$contactId' AND check_in='$contactLastCheckinTime'";

	if (!mysqli_query($con,$query)) {
		return mysqli_error($con);
	}else{
		return true;
	}

}

// Update Contact in contact table
// Set them active or non active, and update the last checkin and last checkout time.
function updateContactCheckinStatus($date, $userId, $active)
{

	global $con;

	if ($active == 1) {
		$query = "UPDATE contact SET active=$active, last_checkin_time='$date' WHERE cid='$userId'";
	}else{
		$query = "UPDATE contact SET active=$active, last_checkout_time='$date' WHERE cid='$userId'";
	}

	if (!mysqli_query($con,$query)) {
		return mysqli_error($con);
	}else{
		return true;
	}
}

//action=isUserCheckedIn&rfid=<scanned RFID>
//returns JSON string True if member is checked in, False if checked out
function isUserCheckedIn($rfid)
{
	global $con;

	$rfid = testInput($rfid);

	$query = "SELECT contact.cid, `key`.serial, contact.active, contact.last_checkin_time, contact.last_checkout_time
				FROM contact
				INNER JOIN `key`
				ON contact.cid=`key`.cid
				WHERE serial = '" . $rfid . "'";

	$result = mysqli_query($con, $query)
		  or die(json_encode(array("isUserCheckedInERROR"=>mysqli_error($con))));

	//if no rows returned then that key wasn't even found in the DB
	if(mysqli_num_rows($result) == 0)
	{
		$jsonResponse = array("key " . $rfid . " not found in db");
	}
	else
	{
		$row = mysqli_fetch_assoc($result);

		$checkinStatus = $row["active"];

		if ($checkinStatus == 0) {
			$jsonResponse = array("False");
		}else{
			$jsonResponse = array("True");
		}
	}

	return $jsonResponse;
}

//action=processCheckIn&rfid=<scanned RFID>
// Process the checkin or checkout process, checks user in out.
function processCheckIn($rfid)
{

	$errors = 0;
	$processCheckInMessage = "";

	$rfid = testInput($rfid);
	$date = date('Y-m-d H:i:s');

	if (getMemberInfoByRFID($rfid, 'k.serial')["serial"] != null) {

		if (getMemberInfoByRFID($rfid, "c.active")["active"] == 0) { // check if user is active

			if (!createLog(getMemberInfoByRFID($rfid, "c.cid")["cid"], $date)) { // create a log with the current date
			  $errors = 1;
			  $processCheckInMessage .= 'Could not create a new log in the database!';
			  die();
			}else{
				if (!updateContactCheckinStatus($date, getMemberInfoByRFID($rfid, "c.cid")["cid"], 1)) { // update user table, set active to 1 and insert last checkin time

					$errors = 1;
					$processCheckInMessage .= 'Could not update member status when checking in!';
					die();
				}else{
					$processCheckInMessage .= "Checkin successful!";
				}
			}

		}else{

			if (!updateContactCheckinStatus($date, getMemberInfoByRFID($rfid, "c.cid")["cid"], 0)) { // update user table, set active to 0 and insert last checkout time
			  $errors = 1;
			  $processCheckInMessage .= 'Could not update member status when checking out!';
			  die();
			}else{
				if (!updateLog(getMemberInfoByRFID($rfid, "c.cid")["cid"], $date, getMemberInfoByRFID($rfid, "c.last_checkin_time")["last_checkin_time"])) { // close log, insert checkout time (current date time)
					$errors = 1;
					$processCheckInMessage .= 'Could not close the log for user check out!';
					die();
				}else{
					$processCheckInMessage .= "Checkout successful!";
				}
			}

		}

	}else{
		$errors = 1;
		$processCheckInMessage .= "RFID key not found in the database!";
	}

	if ($errors == 1) {
		$processCheckInMessage = 'ERROR: ' . $processCheckInMessage; // in case there are errors, add 'ERROR: ' at the beginning of a status message.
		$response['hasErrors'] = $errors;
		$response['message'] = $processCheckInMessage;
	}else{
		$response['hasErrors'] = $errors;
		$response['message'] = $processCheckInMessage;
		$response['firstName'] = getMemberInfoByRFID($rfid, 'c.firstName')["firstName"];
		$response['lastName'] = getMemberInfoByRFID($rfid, 'c.lastName')["lastName"];
		$response['lastCheckInTime'] = getMemberInfoByRFID($rfid, 'c.last_checkin_time')["last_checkin_time"];
		$response['lastCheckOutTime'] = getMemberInfoByRFID($rfid, 'c.last_checkout_time')["last_checkout_time"];
	}

	return $response;

}

function hackerspaceStatus()
{
	$names = Array('Goddesses on Throne', 'Aliens', 'Nyan cats', 'Unicorns', 'Capacitors', 'Ghosts', 'Resistors', 'Astronauts','Code Knights','Serfs','Guardians','Haluca');

	if ((int)getActiveMembersTotal() == 1) {

		$message = getActiveMembersTotal().' Hacker and '.rand(2, 5).' '.$names[array_rand($names)].' in the space, means that the hackerspace is now open!';

	}elseif((int)getActiveMembersTotal() > 1){

		$message = getActiveMembersTotal().' Hackers and '.rand(2, 5).' '.$names[array_rand($names)].' in the space, means that the hackerspace is now open!';

	}else{

		$message = '0 Hackers and '.rand(2, 5).' '.$names[array_rand($names)].'  in the space, means that the hackerspace is now closed!';

	}

	$response['hackersInSpace'] = (int)getActiveMembersTotal();
	$response['message'] = $message;
	$response['memberNames'] = getActiveMembersNames();

	return $response;

}

//////////////////////////////////////
//other functions for service go here.
// don't forget to add the action to the
// $possible_url array in query.php file!!!!!
//You will then have to add the entry for
// the switch case in as well.
//////////////////////////////////////

?>


text: export * from './parliament.component';


text:
title:  Veľký národ vďaka Hospodinovi
date:  30/10/2021
---

### Texty na tento týždeň
5Moj 4,1–9

>
Základný text

> Má nejaký veľký národ také spravodlivé ustanovenia a právne predpisy, ako celý tento zákon, ktorý vám dnes predkladám?  (5Moj 4,8)

Prvé tri kapitoly Deuteronómia sú v podstate ponaučením z dejín. Pripomínali ľudom, čo až doteraz prežili ako národ. Od štvrtej kapitoly tieto príbehy z dejín dostávajú postupne čoraz viac formu kázania. Pripomenutie uplynulých dejov nie je určené len pre nadšencov dejepisu. Ich hlavným zmyslom je ukázať Božiu moc a milosť, ktoré sa prejavili v ich životoch. A hoci ako národ mnohokrát zlyhali, Hospodin stojí za zmluvou, ktorú s nimi uzavrel.

Štvrtá kapitola sa začína hebrejským výrazom ve-ata, ktorý sa prekladá ako "a teraz". Doteraz počúvali o udalostiach, ktoré sa odohrali v minulosti a ktoré im mali pripomenúť, že Boh ich priviedol až do tohto bodu. "A teraz" mali začať konať podľa toho, čo im Hospodin povedal (pozri aj 5Moj 10,12). Ich konanie malo byť odpoveďou na Božie skutky.

To je aj dôvod, prečo prvé sloveso nasledujúce po "a teraz" je práve "počúvaj". V hebrejčine je to presne to isté sloveso (aj v rovnakom tvare), aké zaznieva na začiatku modlitby Šema. Ono "počúvaj" znamená nielen vnímať ušami, ale aj "venovať pozornosť" a "poslúchať". Toto sloveso nachádzame v Deuteronómiu často (v uvedenom tvare šesťdesiatpäť ráz).

Úvod štvrtej kapitoly by sme teda mohli zhrnúť nasledovne: A teraz, Izrael, pre všetko, čo som pre teba urobil, musíš poslúchať nasledovné...

**Osnova lekcie**

V tejto lekcii budeme spoločne uvažovať nad štvrtou kapitolou knihy Deuteronómium. Mojžiš najprv pripomenul Izraelitom, čo už pre nich Boh v minulosti urobil (5. Mojžišova 1–3). Teraz bude hovoriť o tom, čo od nich (a všeobecne od všetkých svojich detí) očakáva v prostredí, kde majú byť "svetlom".

`5Moj 4,1.2: Dôsledne rešpektovať, čo Hospodin nariadil (nedeľa)`

`5Moj 4,3.4: Dávať si pozor na negatívny vplyv pohanského okolia (pondelok)`

`5Moj 4,3.4: Primknúť sa k Hospodinovi (utorok)`

`5Moj 4,5–9: Byť dobrým príkladom a požehnaním pre svoje okolie (streda a štvrtok)`


text:
ACCEPTED

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

#### Published in
Monograph of Clavaria and allied Genera (Annals of Botany Memoirs No. 1) 645 (1950)

#### Original name
Clavaria pulchella Boud., 1887

### Remarks
null


text:
module VORLON {

    export class XHRPanelClient extends ClientPlugin {
        public hooked: boolean = false;
        public cache: Array<NetworkEntry> = [];
        private _previousOpen;
        private _previousSetRequestHeader;
        private _xhrSource;
        private _hookAlreadyDone;

        constructor() {
            super("xhrPanel");
            this._id = "XHRPANEL";
            this._ready = false;
        }

        public refresh(): void {
            this.sendStateToDashboard();
            this.sendCacheToDashboard();
        }

        public sendStateToDashboard() {
            this.sendCommandToDashboard('state', { hooked: this.hooked });
        }

        public sendCacheToDashboard() {
            for (var i = 0, l = this.cache.length; i < l; i++) {
                this.sendCommandToDashboard('xhr', this.cache[i]);
            }
        }

        public clearClientCache() {
            this.cache = [];
        }

        // This code will run on the client //////////////////////

        public startClientSide(): void {
            //this.setupXMLHttpRequestHook();
        }

        public onRealtimeMessageReceivedFromDashboardSide(receivedObject: any): void {
        }

        private _hookPrototype(that, xhrSource) {
            var data = {
                id: VORLON.Tools.CreateGUID(),
                url: null,
                status : null,
                statusText : null,
                method: null,
                responseType: null,
                responseHeaders : null,
                requestHeaders : [],
                readyState: 0,
            }
            this.cache.push(data);

            if(!this._previousOpen){
                this._previousOpen = xhrSource.prototype.open;
                this._previousSetRequestHeader = xhrSource.prototype.setRequestHeader;
            }

            //todo catch send to get posted data
            //see https://msdn.microsoft.com/en-us/library/hh772834(v=vs.85).aspx

            xhrSource.prototype.open = function() {
                data.id = VORLON.Tools.CreateGUID();
                data.method = arguments[0];
                data.url = arguments[1];
                that.trace('request for ' + data.url);
                that.sendCommandToDashboard('xhr', data);

                this.addEventListener('readystatechange', function() {
                    var xhr = this;

                    data.readyState = xhr.readyState;
                    that.trace('STATE CHANGED ' + data.readyState);

                    if (data.readyState === 4){
                        data.responseType = xhr.responseType;
                        data.status = xhr.status;
                        data.statusText = xhr.statusText;

                        if (xhr.getAllResponseHeaders)
                            data.responseHeaders = xhr.getAllResponseHeaders();

                        that.trace('LOADED !!!');
                    }
                    that.sendCommandToDashboard('xhr', data);
                });

                return that._previousOpen.apply(this, arguments);
            }

            xhrSource.prototype.setRequestHeader = function() {
                var header = {
                    name : arguments[0],
                    value : arguments[1]
                }
                data.requestHeaders.push(header);
                return this._previousSetRequestHeader.apply(this, arguments);
            }

        }

        public setupXMLHttpRequestHook(){
            var xhrSource;

            if (!Tools.IsWindowAvailable) {
                if (!this._hookAlreadyDone) {
                    this._hookAlreadyDone = true;
                    var path = require("path");
                    var requireHook = require("require-hook");
                    requireHook.attach(path.resolve())
                    var that = this;
                    requireHook.setEvent(function(result, e){
                        if (that.hooked && e.require === "xhr2") {
                            that._xhrSource = result;
                            that._hookPrototype(that, result);
                        }
                        return result;
                    });
                }
            } else {
                this._xhrSource = XMLHttpRequest;
                this._hookPrototype(this, XMLHttpRequest);
            }

            this.hooked = true;
            this.sendStateToDashboard();
        }

        public removeXMLHttpRequestHook() {
            if (this.hooked) {
                this.trace('xhrPanel remove hook');

                var xhrSource = this._xhrSource;
                xhrSource.prototype.open = this._previousOpen;
                xhrSource.prototype.setRequestHeader = this._previousSetRequestHeader;

                this.hooked = false;
                this.sendStateToDashboard();
            }
        }

        private _render(tagname: string, parentNode:HTMLElement, classname?:string, value?: string): HTMLElement {
            var elt = document.createElement(tagname);
            elt.className = classname || '';
            if (value)
                elt.innerHTML = value;
            parentNode.appendChild(elt);
            return elt;
        }
    }

    XHRPanelClient.prototype.ClientCommands = {
        start: function (data: any) {
            var plugin = <XHRPanelClient>this;
            plugin.setupXMLHttpRequestHook();
        },
        stop: function (data: any) {
            var plugin = <XHRPanelClient>this;
            plugin.removeXMLHttpRequestHook();
        },
        getState: function (data: any) {
            var plugin = <XHRPanelClient>this;
            plugin.sendStateToDashboard();
        },
        clear: function (data: any) {
            var plugin = <XHRPanelClient>this;
            plugin.clearClientCache();
        }
    };

    //Register the plugin with vorlon core
    Core.RegisterClientPlugin(new XHRPanelClient());
}


text:
::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: ============================================================================
::
:: runnativetests.cmd
::
:: ============================================================================
@echo off
setlocal

goto :main

:: ============================================================================
:: Print usage
:: ============================================================================
:printUsage

  echo runnativetests.cmd -x86^|-x64 -debug^|-test [--help]
  echo.
  echo Required switches:
  echo.
  echo   Specify architecture of jsrt binaries (required):
  echo.
  echo   -x86           Build arch of binaries is x86
  echo   -x64           Build arch of binaries is x64
  echo.
  echo   Specify type of jsrt binaries (required):
  echo.
  echo   -debug         Build type of binaries is debug
  echo   -test          Build type of binaries is test
  echo.
  echo   --help         Print help from nativetests (note, arch/type still required)
  echo.
  echo   Shorthand combinations can be used, e.g. -x64debug
  echo.

  goto :eof

:: ============================================================================
:: Print how to get help
:: ============================================================================
:printGetHelp

  echo For help use runnativetests.cmd -?

  goto :eof

:: ============================================================================
:: Main script
:: ============================================================================
:main

  call :initVars
  call :parseArgs %*

  if not "%fShowUsage%" == "" (
    call :printUsage
    goto :eof
  )

  call :validateArgs

  if not "%fShowGetHelp%" == "" (
    call :printGetHelp
    goto :eof
  )

  call :configureVars

  call :copyScriptsAndBinaries

  call :runtest

  call :cleanup

  echo -- runnativetests.cmd ^>^> Exiting with exit code %_HadFailures%
  exit /b %_HadFailures%

:: ============================================================================
:: Parse the user arguments into environment variables
:: ============================================================================
:parseArgs

  :NextArgument

  if "%1" == "-?" set fShowUsage=1& goto :ArgOk
  if "%1" == "/?" set fShowUsage=1& goto :ArgOk

  if /i "%1" == "-x86"              set _BuildArch=x86&                                         goto :ArgOk
  if /i "%1" == "-x64"              set _BuildArch=x64&                                         goto :ArgOk
  if /i "%1" == "-debug"            set _BuildType=debug&                                       goto :ArgOk
  if /i "%1" == "-test"             set _BuildType=test&                                        goto :ArgOk

  if /i "%1" == "-x86debug"         set _BuildArch=x86&set _BuildType=debug&                    goto :ArgOk
  if /i "%1" == "-x64debug"         set _BuildArch=x64&set _BuildType=debug&                    goto :ArgOk
  if /i "%1" == "-x86test"          set _BuildArch=x86&set _BuildType=test&                     goto :ArgOk
  if /i "%1" == "-x64test"          set _BuildArch=x64&set _BuildType=test&                     goto :ArgOk

  if /i "%1" == "-binDir"           set _BinDirBase=%~f2&                                       goto :ArgOkShift2

  rem Store unrecognized args in this var for when we later call the executable
  if not "%1" == ""                 set _NativeTestArgs=%_NativeTestArgs%%1 &                  goto :ArgOk

  goto :eof

  :ArgOkShift2
  shift

  :ArgOk
  shift

  goto :NextArgument

:: ============================================================================
:: Initialize batch script variables to defaults
:: ============================================================================
:initVars

  set _HadFailures=0
  set _RootDir=%~dp0..
  set _BinDirBase=%_RootDir%\Build\VcBuild\Bin
  set _BinDir=
  set _TestTempDir=
  set _BuildArch=
  set _BuildType=
  set _NativeTestArgs=

  goto :eof

:: ============================================================================
:: Validate that required arguments were specified
:: ============================================================================
:validateArgs

  if "%_BuildArch%" == "" (
    echo Error missing required build architecture or build type switch
    set fShowGetHelp=1
    goto :eof
  )

  if "%_BuildType%" == "" (
    echo Error missing required build architecture or build type switch
    set fShowGetHelp=1
  )

  goto :eof

:: ============================================================================
:: Configure the script variables and environment based on parsed arguments
:: ============================================================================
:configureVars

  set _BinDir=%_BinDirBase%\%_BuildArch%_%_BuildType%\
  rem Use %_BinDir% as the root for %_TestTempDir% to ensure that running jsrt
  rem native tests from multiple repos simultaneously do not clobber each other.
  rem This means we need to delete the temp directory afterwards to clean up.
  set _TestTempDir=%_BinDir%\jsrttest\
  if not exist %_TestTempDir% mkdir %_TestTempDir%

  echo -- runnativetests.cmd ^>^> #### BinDir: %_BinDir%
  echo -- runnativetests.cmd ^>^> #### TestTempDir: %_TestTempDir%

  goto :eof

:: ============================================================================
:: Copying javascript files from source location to temp test location and test
:: binaries from binary location to test temp location.
:: ============================================================================
:copyScriptsAndBinaries
  echo -- runnativetests.cmd ^>^> copying scripts from '%_RootDir%\bin\nativetests\Scripts' to '%_TestTempDir%'
  copy /y %_RootDir%\bin\nativetests\Scripts\*.js %_TestTempDir%

  copy /y %_BinDir%ChakraCore.dll %_TestTempDir%
  copy /y %_BinDir%nativetests.exe %_TestTempDir%

  goto :eof

:: ============================================================================
:: Running tests using nativetests.exe
:: ============================================================================
:runtest
  pushd %_TestTempDir%
  echo -- runnativetests.cmd ^>^> Calling %cd%\nativetests.exe with additional args: %_NativeTestArgs%
  call :do nativetests.exe %_NativeTestArgs%
  if "%_error%" NEQ "0" (
    set _HadFailures=1
    echo -- runnativetests.cmd ^>^> nativetests.exe exited with non-zero exit code %_error%
  )
  popd

  goto :eof

:: ============================================================================
:: Clean up left over files
:: ============================================================================
:cleanUp

  call :do rd /s/q %_TestTempDir%

  goto :eof

:: ============================================================================
:: Echo a command line before executing it
:: ============================================================================
:do

  echo ^>^> %*
  cmd /s /c "%*"
  set _error=%ERRORLEVEL%

  goto :eof

:: ============================================================================
:: Echo a command line before executing it and redirect the command's output
:: to nul
:: ============================================================================
:doSilent

  echo ^>^> %* ^> nul 2^>^&1
  cmd /s /c "%* > nul 2>&1"

  goto :eof


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>FOODTODO</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="favicon" href="favicon.ico">

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <link rel="stylesheet/less" href="css/index.less">

Food Todo

INBOX

                <input class="todo-input" placeholder="투두 입력 인풋" autofocus>
                <input type="button" class="add-btn" value="ADD" />

                <input class="toggle" type="checkbox" checked>
                푸드투두 설계
                <button class="destroy-btn">X</button>

URGENT

TODAY

        <input type="button" class="clear-btn" value="CLEAR DONE" />
        <input type="button" class="clear-btn" value="DELETE ALL" />


text:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                          http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd">

    <embeddable name="Kreta\TaskManager\Domain\Model\Project\Task\TaskProgress">
        <field name="progress" type="string" length="100" nullable="false"/>
    </embeddable>
</doctrine-mapping>


text:
package org.kie.server.ext.prometheus;

import io.prometheus.client.Gauge;
import org.jbpm.services.api.DeploymentEvent;
import org.jbpm.services.api.DeploymentEventListener;

public class DeploymentCustomPrometheusMetricListener implements DeploymentEventListener {

    private static final Gauge randomGauge = Gauge.build()
                                                  .name("random_gauge_deployment_count")
                                                  .help("Random gauge as an example of custom KIE Prometheus metric")
                                                  .register();

    @Override
    public void onDeploy(DeploymentEvent event) {
        randomGauge.inc();
    }

    @Override
    public void onUnDeploy(DeploymentEvent event) {
        randomGauge.dec();
    }

    @Override
    public void onActivate(DeploymentEvent event) {
        // Not measured
    }

    @Override
    public void onDeactivate(DeploymentEvent event) {
        // Not measured
    }
}


text:
package uk.gov.nationalarchives.droid.signature;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import uk.gov.nationalarchives.droid.core.interfaces.config.DroidGlobalConfig;
import uk.gov.nationalarchives.droid.core.interfaces.config.DroidGlobalProperty;
import uk.gov.nationalarchives.droid.core.interfaces.signature.ErrorCode;
import uk.gov.nationalarchives.droid.core.interfaces.signature.ProxySettings;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureFileException;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureFileInfo;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureManager;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureManagerException;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureServiceException;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureType;
import uk.gov.nationalarchives.droid.core.interfaces.signature.SignatureUpdateService;

/**
 * @author rflitcroft
 *
 */
public class SignatureManagerImpl implements SignatureManager {

    private static final String INVALID_SIGNATURE_FILE = "Invalid signature file [%s]";

    private static Map<SignatureType, DroidGlobalProperty> defaultVersionProperties =
        new HashMap<SignatureType, DroidGlobalProperty>();
    static {
        defaultVersionProperties.put(SignatureType.BINARY, DroidGlobalProperty.DEFAULT_BINARY_SIG_FILE_VERSION);
        defaultVersionProperties.put(SignatureType.CONTAINER, DroidGlobalProperty.DEFAULT_CONTAINER_SIG_FILE_VERSION);
        defaultVersionProperties.put(SignatureType.TEXT, DroidGlobalProperty.DEFAULT_TEXT_SIG_FILE_VERSION);
    }

    private final Log log = LogFactory.getLog(getClass());

    private DroidGlobalConfig config;
    private Map<SignatureType, SignatureUpdateService> signatureUpdateServices;
    private ProxySettings proxySettings = new ProxySettings();

    /**
     * Initailisation post-construct.
     */
    public void init() {
        config.getProperties().addConfigurationListener(proxySettings);
        Configuration configuration = config.getProperties();

        proxySettings = new ProxySettings();
        proxySettings.setEnabled(configuration.getBoolean(DroidGlobalProperty.UPDATE_USE_PROXY.getName()));
        proxySettings.setProxyHost(configuration.getString(DroidGlobalProperty.UPDATE_PROXY_HOST.getName()));
        proxySettings.setProxyPort(configuration.getInt(DroidGlobalProperty.UPDATE_PROXY_PORT.getName()));
        proxySettings.setEnabled(configuration.getBoolean(DroidGlobalProperty.UPDATE_USE_PROXY.getName()));

        config.getProperties().addConfigurationListener(proxySettings);

        for (SignatureUpdateService subscriber : signatureUpdateServices.values()) {
            subscriber.init(config);
            proxySettings.addProxySubscriber(subscriber);
            config.getProperties().addConfigurationListener(subscriber);
        }

        proxySettings.notifyProxySubscribers();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Map<SignatureType, SortedMap<String, SignatureFileInfo>> getAvailableSignatureFiles() {

        File binSigFileDir = config.getSignatureFileDir();
        File containerSigFileDir = config.getContainerSignatureDir();
        //File textSigFileDir = config.getTextSignatureFileDir();

        FileFilter xmlExtensionFilter = new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.isFile() && "xml".equals(FilenameUtils.getExtension(pathname.getName()));
            }
        };

        Map<SignatureType, SortedMap<String, SignatureFileInfo>> availableSigFiles =
            new HashMap<SignatureType, SortedMap<String, SignatureFileInfo>>();

        SignatureInfoParser parser = new SignatureInfoParser();

        final String errorMessagePattern = "Unreadable signature file [%s]";

        SortedMap<String, SignatureFileInfo> binSigFiles = new TreeMap<String, SignatureFileInfo>();
        for (File file : binSigFileDir.listFiles(xmlExtensionFilter)) {
            String fileName = FilenameUtils.getBaseName(file.getName());
            try {
                binSigFiles.put(fileName, forBinarySigFile(file, parser));
            } catch (SignatureFileException e) {
                log.warn(String.format(errorMessagePattern, file));
            }
        }

        SortedMap<String, SignatureFileInfo> containerSigFiles = new TreeMap<String, SignatureFileInfo>();
        for (File file : containerSigFileDir.listFiles(xmlExtensionFilter)) {
            String fileName = FilenameUtils.getBaseName(file.getName());
            try {
                containerSigFiles.put(fileName, forSimpleVersionedFile(file, SignatureType.CONTAINER));
            } catch (SignatureFileException e) {
                log.warn(String.format(errorMessagePattern, file));
            }
        }

        /*
        SortedMap<String, SignatureFileInfo> textSigFiles = new TreeMap<String, SignatureFileInfo>();
        for (File file : textSigFileDir.listFiles(xmlExtensionFilter)) {
            String fileName = FilenameUtils.getBaseName(file.getName());
            try {
                textSigFiles.put(fileName, forSimpleVersionedFile(file, SignatureType.TEXT));
            } catch (SignatureFileException e) {
                log.warn(String.format(errorMessagePattern, file));
            }
        }
        */

        availableSigFiles.put(SignatureType.BINARY, binSigFiles);
        availableSigFiles.put(SignatureType.CONTAINER, containerSigFiles);
        //availableSigFiles.put(SignatureType.TEXT, textSigFiles);

        return availableSigFiles;
    }

    private static SignatureFileInfo forBinarySigFile(File file, SignatureInfoParser parser)
        throws SignatureFileException {
        final SignatureFileInfo signatureFileInfo = parser.parse(file);
        signatureFileInfo.setFile(file);
        return signatureFileInfo;
    }

    private static SignatureFileInfo forSimpleVersionedFile(File file, SignatureType type)
        throws SignatureFileException {
        // parse the version from the filename
        String filename = FilenameUtils.getBaseName(file.getName());
        try {
            int version = Integer.valueOf(StringUtils.substringAfterLast(filename, "-"));
            final SignatureFileInfo signatureFileInfo = new SignatureFileInfo(version, false, type);
            signatureFileInfo.setFile(file);
            return signatureFileInfo;
        } catch (NumberFormatException e) {
            String message = String.format("Invalid signature filename [%s]", file.getName());
            throw new SignatureFileException(message, e, ErrorCode.INVALID_SIGNATURE_FILE);
        }
    }

    /**
     * @param config the config to set
     */
    public void setConfig(DroidGlobalConfig config) {
        this.config = config;
    }

    private static final class SignatureInfoParser {

        SignatureFileInfo parse(File sigFile) throws SignatureFileException {

            SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            final SignatureFileVersionHandler handler = new SignatureFileVersionHandler();
            try {
                SAXParser saxParser = saxParserFactory.newSAXParser();
                saxParser.parse(sigFile, handler);
                throw new SignatureFileException(String.format(
                        INVALID_SIGNATURE_FILE, sigFile), ErrorCode.INVALID_SIGNATURE_FILE);
            } catch (ValidSignatureFileException e) {
                return e.getInfo();
            } catch (SAXException e) {
                throw new SignatureFileException(String.format(
                        INVALID_SIGNATURE_FILE, sigFile), e,
                        ErrorCode.INVALID_SIGNATURE_FILE);
            } catch (ParserConfigurationException e) {
                throw new RuntimeException(e.getMessage(), e);
            } catch (IOException e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        }
    }

    /**
     * Handler for <FFSignatureFile> elements.
     *
     */
    private static final class SignatureFileVersionHandler extends DefaultHandler {

        private static final String ROOT_ELEMENT = "FFSignatureFile";

        @Override
        public void startElement(String uri, String localName, String qName,
                Attributes attributes) throws SAXException {

            if (ROOT_ELEMENT.equals(qName)) {
                int version = Integer.valueOf(attributes.getValue("Version"));
                SignatureFileInfo info = new SignatureFileInfo(version, false, SignatureType.BINARY);
                throw new ValidSignatureFileException(info);
            }

            throw new SAXException(
                    String.format("Invalid signature file - root element was not [%s]", ROOT_ELEMENT));
        }

    }

    /**
     * Exception thrown purely to stop SAX parsing when a valid signature file is found.
     * @author rflitcroft
     *
     */
    private static final class ValidSignatureFileException extends RuntimeException {

        private static final long serialVersionUID = 5955330716555328779L;
        private final SignatureFileInfo info;

        /**
         * @param info the signature file info
         */
        ValidSignatureFileException(SignatureFileInfo info) {
            this.info = info;
        }

        /**
         * @return the info
         */
        public SignatureFileInfo getInfo() {
            return info;
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Map<SignatureType, SignatureFileInfo> getLatestSignatureFiles() {

        final Configuration properties = config.getProperties();
        properties.setProperty(DroidGlobalProperty.LAST_UPDATE_CHECK.getName(), System.currentTimeMillis());

        Map<SignatureType, SignatureFileInfo> latestSigFiles = new HashMap<SignatureType, SignatureFileInfo>();

        final Map<SignatureType, SortedMap<String, SignatureFileInfo>> availableSignatureFiles =
            getAvailableSignatureFiles();

        for (Map.Entry<SignatureType, SignatureUpdateService> entry : signatureUpdateServices.entrySet()) {
            SignatureType type = entry.getKey();
            SignatureUpdateService updateService = entry.getValue();
            final Map<String, SignatureFileInfo> signaturesForType = availableSignatureFiles.get(type);
            try {
                int latestVersionForType = getLatestVersionForType(type, signaturesForType);
                SignatureFileInfo latestUpdate = updateService.getLatestVersion(latestVersionForType);
                if (latestUpdate != null
                    && latestUpdate.getVersion() > 0
                    && !signaturesForType.containsValue(latestUpdate)) {
                    latestSigFiles.put(type, latestUpdate);
                }
            } catch (SignatureServiceException e) {
                latestSigFiles.put(type, new SignatureFileInfo(e));
            }
        }

        return latestSigFiles;
    }

    private int getLatestVersionForType(SignatureType type, Map<String, SignatureFileInfo> signatures) {
        int result = 0;
        for (String key : signatures.keySet()) {
            SignatureFileInfo info = signatures.get(key);
            if (info.getVersion() > result) {
                result = info.getVersion();
            }
        }
        return result;
    }

    /**
     * @param signatureUpdateServices the signatureUpdateServices to set
     */
    public void setSignatureUpdateServices(Map<SignatureType, SignatureUpdateService> signatureUpdateServices) {
        this.signatureUpdateServices = signatureUpdateServices;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public SignatureFileInfo downloadLatest(SignatureType type) throws SignatureManagerException {

        File sigFileDir;
        switch (type) {
            case BINARY:
                sigFileDir = config.getSignatureFileDir();
                break;
            case CONTAINER:
                sigFileDir = config.getContainerSignatureDir();
                break;
            case TEXT:
                sigFileDir = config.getTextSignatureFileDir();
                break;
            default:
                throw new IllegalArgumentException("Invalid signature type : " + type);
        }

        try {
            SignatureFileInfo info = signatureUpdateServices.get(type).importSignatureFile(sigFileDir);
            final boolean autoSetDefaultSigFile = config.getBooleanProperty(DroidGlobalProperty.UPDATE_AUTOSET_DEFAULT);
            if (autoSetDefaultSigFile) {
                PropertiesConfiguration props = config.getProperties();
                props.setProperty(defaultVersionProperties.get(type).getName(),
                        FilenameUtils.getBaseName(info.getFile().getName()));
                try {
                    config.getProperties().save();
                } catch (ConfigurationException e) {
                    log.error(e);
                    throw new SignatureManagerException(e);
                }
            }
            return info;
        } catch (SignatureServiceException e) {
            throw new SignatureManagerException(e);
        }
    }

    /**
     * {@inheritDoc}
     * @throws SignatureFileException
     */
    @Override
    public Map<SignatureType, SignatureFileInfo> getDefaultSignatures() throws SignatureFileException {

        Map<SignatureType, SignatureFileInfo> defaultSignatures = new HashMap<SignatureType, SignatureFileInfo>();

        final Map<SignatureType, SortedMap<String, SignatureFileInfo>>
            availableSignatureFiles = getAvailableSignatureFiles();

        final String errorMessagePattern =
            "Default signature file %s could not be found. Please check your signature settings.";

        for (Map.Entry<SignatureType, SortedMap<String, SignatureFileInfo>> sigFileEntry
                : availableSignatureFiles.entrySet()) {
            SignatureType type = sigFileEntry.getKey();
            Map<String, SignatureFileInfo> sigs = sigFileEntry.getValue();
            DroidGlobalProperty defaultSigFile = defaultVersionProperties.get(type);

            String defaultSigFileKey = config.getProperties().getString(defaultSigFile.getName());
            if (StringUtils.isNotBlank(defaultSigFileKey)) {
                SignatureFileInfo sigFileInfo = sigs.get(defaultSigFileKey);
                if (sigFileInfo == null) {
                    String errorMessage = String.format(errorMessagePattern, config.getProperties()
                            .getString(defaultVersionProperties.get(type).getName()));
                    throw new SignatureFileException(errorMessage, ErrorCode.FILE_NOT_FOUND);
                }
                defaultSignatures.put(type, sigFileInfo);
            }
        }

        return defaultSignatures;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public SignatureFileInfo install(SignatureType type, File signatureFile, boolean setDefault)
        throws SignatureFileException {

        SignatureInfoParser parser = new SignatureInfoParser();
        SignatureFileInfo sigFileInfo = forBinarySigFile(signatureFile, parser);

        try {
            FileUtils.copyFileToDirectory(signatureFile, config.getSignatureFileDir(), true);
            File newSignatureFile = new File(config.getSignatureFileDir(), signatureFile.getName());

            sigFileInfo.setFile(newSignatureFile);

            if (setDefault) {
                config.getProperties().setProperty(defaultVersionProperties.get(type).getName(),
                        FilenameUtils.getBaseName(newSignatureFile.getName()));
            }

            return sigFileInfo;
        } catch (IOException e) {
            log.error(e);
            throw new SignatureFileException(e.getMessage(), e, ErrorCode.FILE_NOT_FOUND);
        }
    }

}


text:
using System;
using Azure.Core.Pipeline;
using Azure.Identity;
using NUnit.Framework;

namespace Azure.Core.Tests
{
    public class ClientOptionsTests
    {
#if NETCOREAPP
        [Test]
        public void DefaultTransportIsHttpClientTransport()
        {
            var options = new TestClientOptions();

            Assert.IsInstanceOf<HttpClientTransport>(options.Transport);
        }
#else
        [Test]
        public void DefaultTransportIsHttpWebRequestTransport()
        {
            var options = new TestClientOptions();

            Assert.IsInstanceOf<HttpWebRequestTransport>(options.Transport);
        }

        [Test]
        public void DefaultTransportIsHttpClientTransportIfEnvVarSet()
        {
            string oldValue = Environment.GetEnvironmentVariable("AZURE_CORE_DISABLE_HTTPWEBREQUESTTRANSPORT");

            try
            {
                Environment.SetEnvironmentVariable("AZURE_CORE_DISABLE_HTTPWEBREQUESTTRANSPORT", "true");

                var options = new TestClientOptions();

                Assert.IsInstanceOf<HttpClientTransport>(options.Transport);

            }
            finally
            {
                Environment.SetEnvironmentVariable("AZURE_CORE_DISABLE_HTTPWEBREQUESTTRANSPORT", oldValue);
            }
        }

        [Test]
        public void DefaultTransportIsHttpClientTransportIfSwitchIsSet()
        {
            AppContext.TryGetSwitch("Azure.Core.Pipeline.DisableHttpWebRequestTransport", out bool oldSwitch);

            try
            {
                AppContext.SetSwitch("Azure.Core.Pipeline.DisableHttpWebRequestTransport", true);

                var options = new TestClientOptions();

                Assert.IsInstanceOf<HttpClientTransport>(options.Transport);

            }
            finally
            {
                AppContext.SetSwitch("Azure.Core.Pipeline.DisableHttpWebRequestTransport", oldSwitch);
            }
        }

#endif

        private class TestClientOptions : ClientOptions
        {
        }
    }
}


text:
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "match.h"
#include "tty_interface.h"
#include "../config.h"

static int isprint_unicode(char c) {
	return isprint(c) || c & (1 << 7);
}

static int is_boundary(char c) {
	return ~c & (1 << 7) || c & (1 << 6);
}

static void clear(tty_interface_t *state) {
	tty_t *tty = state->tty;

	tty_setcol(tty, 0);
	size_t line = 0;
	while (line++ < state->options->num_lines + (state->options->show_info ? 1 : 0)) {
		tty_newline(tty);
	}
	tty_clearline(tty);
	if (state->options->num_lines > 0) {
		tty_moveup(tty, line - 1);
	}
	tty_flush(tty);
}

static void draw_match(tty_interface_t *state, const char *choice, int selected) {
	tty_t *tty = state->tty;
	options_t *options = state->options;
	char *search = state->last_search;

	int n = strlen(search);
	size_t positions[MATCH_MAX_LEN];
	for (int i = 0; i < n + 1 && i < MATCH_MAX_LEN; i++)
		positions[i] = -1;

	score_t score = match_positions(search, choice, &positions[0]);

	if (options->show_scores) {
		if (score == SCORE_MIN) {
			tty_printf(tty, "(     ) ");
		} else {
			tty_printf(tty, "(%5.2f) ", score);
		}
	}

	if (selected)
#ifdef TTY_SELECTION_UNDERLINE
		tty_setunderline(tty);
#else
		tty_setinvert(tty);
#endif

	tty_setnowrap(tty);
	for (size_t i = 0, p = 0; choice[i] != '\0'; i++) {
		if (positions[p] == i) {
			tty_setfg(tty, TTY_COLOR_HIGHLIGHT);
			p++;
		} else {
			tty_setfg(tty, TTY_COLOR_NORMAL);
		}
		if (choice[i] == '\n') {
			tty_putc(tty, ' ');
		} else {
			tty_printf(tty, "%c", choice[i]);
		}
	}
	tty_setwrap(tty);
	tty_setnormal(tty);
}

static void draw(tty_interface_t *state) {
	tty_t *tty = state->tty;
	choices_t *choices = state->choices;
	options_t *options = state->options;

	unsigned int num_lines = options->num_lines;
	size_t start = 0;
	size_t current_selection = choices->selection;
	if (current_selection + options->scrolloff >= num_lines) {
		start = current_selection + options->scrolloff - num_lines + 1;
		size_t available = choices_available(choices);
		if (start + num_lines >= available && available > 0) {
			start = available - num_lines;
		}
	}

	tty_setcol(tty, 0);
	tty_printf(tty, "%s%s", options->prompt, state->search);
	tty_clearline(tty);

	if (options->show_info) {
		tty_printf(tty, "\n[%lu/%lu]", choices->available, choices->size);
		tty_clearline(tty);
	}

	for (size_t i = start; i < start + num_lines; i++) {
		tty_printf(tty, "\n");
		tty_clearline(tty);
		const char *choice = choices_get(choices, i);
		if (choice) {
			draw_match(state, choice, i == choices->selection);
		}
	}

	if (num_lines + options->show_info)
		tty_moveup(tty, num_lines + options->show_info);

	tty_setcol(tty, 0);
	fputs(options->prompt, tty->fout);
	for (size_t i = 0; i < state->cursor; i++)
		fputc(state->search[i], tty->fout);
	tty_flush(tty);
}

static void update_search(tty_interface_t *state) {
	choices_search(state->choices, state->search);
	strcpy(state->last_search, state->search);
}

static void update_state(tty_interface_t *state) {
	if (strcmp(state->last_search, state->search)) {
		update_search(state);
		draw(state);
	}
}

static void action_emit(tty_interface_t *state) {
	update_state(state);

	/* Reset the tty as close as possible to the previous state */
	clear(state);

	/* ttyout should be flushed before outputting on stdout */
	tty_close(state->tty);

	const char *selection = choices_get(state->choices, state->choices->selection);
	if (selection) {
		/* output the selected result */
		printf("%s\n", selection);
	} else {
		/* No match, output the query instead */
		printf("%s\n", state->search);
	}

	state->exit = EXIT_SUCCESS;
}

static void action_del_char(tty_interface_t *state) {
	size_t length = strlen(state->search);
	if (state->cursor == 0) {
		return;
	}
	size_t original_cursor = state->cursor;

	do {
		state->cursor--;
	} while (!is_boundary(state->search[state->cursor]) && state->cursor);

	memmove(&state->search[state->cursor], &state->search[original_cursor], length - original_cursor + 1);
}

static void action_del_word(tty_interface_t *state) {
	size_t original_cursor = state->cursor;
	size_t cursor = state->cursor;

	while (cursor && isspace(state->search[cursor - 1]))
		cursor--;

	while (cursor && !isspace(state->search[cursor - 1]))
		cursor--;

	memmove(&state->search[cursor], &state->search[original_cursor], strlen(state->search) - original_cursor + 1);
	state->cursor = cursor;
}

static void action_del_all(tty_interface_t *state) {
	memmove(state->search, &state->search[state->cursor], strlen(state->search) - state->cursor + 1);
	state->cursor = 0;
}

static void action_prev(tty_interface_t *state) {
	update_state(state);
	choices_prev(state->choices);
}

static void action_ignore(tty_interface_t *state) {
	(void)state;
}

static void action_next(tty_interface_t *state) {
	update_state(state);
	choices_next(state->choices);
}

static void action_left(tty_interface_t *state) {
	if (state->cursor > 0) {
		state->cursor--;
		while (!is_boundary(state->search[state->cursor]) && state->cursor)
			state->cursor--;
	}
}

static void action_right(tty_interface_t *state) {
	if (state->cursor < strlen(state->search)) {
		state->cursor++;
		while (!is_boundary(state->search[state->cursor]))
			state->cursor++;
	}
}

static void action_beginning(tty_interface_t *state) {
	state->cursor = 0;
}

static void action_end(tty_interface_t *state) {
	state->cursor = strlen(state->search);
}

static void action_pageup(tty_interface_t *state) {
	update_state(state);
	for (size_t i = 0; i < state->options->num_lines && state->choices->selection > 0; i++)
		choices_prev(state->choices);
}

static void action_pagedown(tty_interface_t *state) {
	update_state(state);
	for (size_t i = 0; i < state->options->num_lines && state->choices->selection < state->choices->available - 1; i++)
		choices_next(state->choices);
}

static void action_autocomplete(tty_interface_t *state) {
	update_state(state);
	const char *current_selection = choices_get(state->choices, state->choices->selection);
	if (current_selection) {
		strncpy(state->search, choices_get(state->choices, state->choices->selection), SEARCH_SIZE_MAX);
		state->cursor = strlen(state->search);
	}
}

static void action_exit(tty_interface_t *state) {
	clear(state);
	tty_close(state->tty);

	state->exit = EXIT_FAILURE;
}

static void append_search(tty_interface_t *state, char ch) {
	char *search = state->search;
	size_t search_size = strlen(search);
	if (search_size < SEARCH_SIZE_MAX) {
		memmove(&search[state->cursor+1], &search[state->cursor], search_size - state->cursor + 1);
		search[state->cursor] = ch;

		state->cursor++;
	}
}

void tty_interface_init(tty_interface_t *state, tty_t *tty, choices_t *choices, options_t *options) {
	state->tty = tty;
	state->choices = choices;
	state->options = options;
	state->ambiguous_key_pending = 0;

	strcpy(state->input, "");
	strcpy(state->search, "");
	strcpy(state->last_search, "");

	state->exit = -1;

	if (options->init_search)
		strncpy(state->search, options->init_search, SEARCH_SIZE_MAX);

	state->cursor = strlen(state->search);

	update_search(state);
}

typedef struct {
	const char *key;
	void (*action)(tty_interface_t *);
} keybinding_t;

#define KEY_CTRL(key) ((const char[]){((key) - ('@')), '\0'})

static const keybinding_t keybindings[] = {{"\x1b", action_exit},       /* ESC */
					   {"\x7f", action_del_char},	/* DEL */

					   {KEY_CTRL('H'), action_del_char}, /* Backspace (C-H) */
					   {KEY_CTRL('W'), action_del_word}, /* C-W */
					   {KEY_CTRL('U'), action_del_all},  /* C-U */
					   {KEY_CTRL('I'), action_autocomplete}, /* TAB (C-I ) */
					   {KEY_CTRL('C'), action_exit},	 /* C-C */
					   {KEY_CTRL('D'), action_exit},	 /* C-D */
					   {KEY_CTRL('G'), action_exit},	 /* C-G */
					   {KEY_CTRL('M'), action_emit},	 /* CR */
					   {KEY_CTRL('P'), action_prev},	 /* C-P */
					   {KEY_CTRL('N'), action_next},	 /* C-N */
					   {KEY_CTRL('K'), action_prev},	 /* C-K */
					   {KEY_CTRL('J'), action_next},	 /* C-J */
					   {KEY_CTRL('A'), action_beginning},    /* C-A */
					   {KEY_CTRL('E'), action_end},		 /* C-E */

					   {"\x1bOD", action_left}, /* LEFT */
					   {"\x1b[D", action_left}, /* LEFT */
					   {"\x1bOC", action_right}, /* RIGHT */
					   {"\x1b[C", action_right}, /* RIGHT */
					   {"\x1b[1~", action_beginning}, /* HOME */
					   {"\x1b[H", action_beginning}, /* HOME */
					   {"\x1b[4~", action_end}, /* END */
					   {"\x1b[F", action_end}, /* END */
					   {"\x1b[A", action_prev}, /* UP */
					   {"\x1bOA", action_prev}, /* UP */
					   {"\x1b[B", action_next}, /* DOWN */
					   {"\x1bOB", action_next}, /* DOWN */
					   {"\x1b[5~", action_pageup},
					   {"\x1b[6~", action_pagedown},
					   {"\x1b[200~", action_ignore},
					   {"\x1b[201~", action_ignore},
					   {NULL, NULL}};

#undef KEY_CTRL

static void handle_input(tty_interface_t *state, const char *s, int handle_ambiguous_key) {
	state->ambiguous_key_pending = 0;

	char *input = state->input;
	strcat(state->input, s);

	/* Figure out if we have completed a keybinding and whether we're in the
	 * middle of one (both can happen, because of Esc). */
	int found_keybinding = -1;
	int in_middle = 0;
	for (int i = 0; keybindings[i].key; i++) {
		if (!strcmp(input, keybindings[i].key))
			found_keybinding = i;
		else if (!strncmp(input, keybindings[i].key, strlen(state->input)))
			in_middle = 1;
	}

	/* If we have an unambiguous keybinding, run it.  */
	if (found_keybinding != -1 && (!in_middle || handle_ambiguous_key)) {
		keybindings[found_keybinding].action(state);
		strcpy(input, "");
		return;
	}

	/* We could have a complete keybinding, or could be in the middle of one.
	 * We'll need to wait a few milliseconds to find out. */
	if (found_keybinding != -1 && in_middle) {
		state->ambiguous_key_pending = 1;
		return;
	}

	/* Wait for more if we are in the middle of a keybinding */
	if (in_middle)
		return;

	/* No matching keybinding, add to search */
	for (int i = 0; input[i]; i++)
		if (isprint_unicode(input[i]))
			append_search(state, input[i]);

	/* We have processed the input, so clear it */
	strcpy(input, "");
}

int tty_interface_run(tty_interface_t *state) {
	draw(state);

	for (;;) {
		do {
			while(!tty_input_ready(state->tty, -1, 1)) {
				/* We received a signal (probably WINCH) */
				draw(state);
			}

			char s[2] = {tty_getchar(state->tty), '\0'};
			handle_input(state, s, 0);

			if (state->exit >= 0)
				return state->exit;

			draw(state);
		} while (tty_input_ready(state->tty, state->ambiguous_key_pending ? KEYTIMEOUT : 0, 0));

		if (state->ambiguous_key_pending) {
			char s[1] = "";
			handle_input(state, s, 1);

			if (state->exit >= 0)
				return state->exit;
		}

		update_state(state);
	}

	return state->exit;
}


text:
var Mydataspace = new MDSClient({
  clientId: 'de96bb70-29b2-454f-8813-ea6e4769414a',
  permission: 'admin'
});

MDSConsole.run = function(optionsOrAction, action) {
  if (typeof optionsOrAction === 'function') {
    action = optionsOrAction;
    optionsOrAction = {};
  }
  var options = MDSCommon.extend({
    simpleFormat: true,
    connectAndLogin: true
  }, optionsOrAction);

  if (options.simpleFormat) {
    Mydataspace.registerFormatter('entities.get.res', new EntitySimplifier());
    Mydataspace.registerFormatter('entities.change.res', new EntitySimplifier());
    Mydataspace.registerFormatter('entities.create.res', new EntitySimplifier());
    Mydataspace.registerFormatter('entities.getRoots.res', new EntitySimplifier());
    Mydataspace.registerFormatter('entities.getMyRoots.res', new EntitySimplifier());
  }

  var self = MDSConsole;

  if (options.connectAndLogin && !Mydataspace.isLoggedIn()) {
    self.log('Connecting...');
    Mydataspace.connect().then(function () {
      self.log('Connected! Logging in...');
      return new Promise(function (resolve, reject) {
        Mydataspace.on('login', function () {
          self.log('Logged In!');
          resolve();
        });
        Mydataspace.on('unauthorized', function () {
          reject(new Error('Unauthorized'));
        });
      });
    }).then(function () {
      return action(Mydataspace.getRoot(self.root), self.event || {});
    }).then(function (res) {
      self.success(res);
    }, function (err) {
      self.fail(err.message);
    });
  }
};


text:
/**
 * Symboliverse
 *
 * @author Henrik Samuelsson, henrik.samuelsson(at)gmail.com
 */
package com.samdide.desktop.symboliverse;

import javafx.application.Application;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.stage.Stage;

public class Symboliverse extends Application {
	final static int CANVAS_WIDTH = 400;
	final static int CANVAS_HEIGHT = 300;
	final static int GRID_LINE_WIDTH = 1;
	/** distance between grid lines in pixels */
	final static int GRID_DISTANCE = 20;

	@Override
	public void start(Stage primaryStage) {
		primaryStage.setTitle("Symboliverse");

		Group root = new Group();
		Canvas canvas = new Canvas(CANVAS_WIDTH, CANVAS_HEIGHT);

		GraphicsContext gc = canvas.getGraphicsContext2D();

		canvas.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {

			@Override
			public void handle(MouseEvent arg0) {
				System.out.println("Event mouse clicked");

			}

		});

		drawGrid(gc);
		drawShapes(gc);
		root.getChildren().add(canvas);
		primaryStage.setScene(new Scene(root));
		primaryStage.show();
	}

	private void drawGrid(GraphicsContext gc) {
		gc.setStroke(Color.LIGHTSTEELBLUE);
		gc.setLineWidth(GRID_LINE_WIDTH);
		for ( int i = GRID_DISTANCE; i < CANVAS_WIDTH; i += GRID_DISTANCE ) {
			gc.strokeLine(i, 0, i, CANVAS_HEIGHT);
			gc.strokeLine(0, i, CANVAS_WIDTH, i);
		}
	}

	private void drawShapes(GraphicsContext gc) {
		gc.setStroke(Color.BLUE);
		gc.setLineWidth(2);
		gc.strokeRect(100, 60, 150, 130);
		gc.strokeLine(100, 90, 250, 90);
		gc.strokeLine(100, 120, 250, 120);
		gc.setLineWidth(1);
		gc.setFont(new Font("Consolas", 14));
		gc.fillText("BankAccount", 120, 80);
	}

	public static void main(String[] args) {
		Application.launch(args);
	}

}


text:
include $(TOPDIR)/rules.mk

PKG_NAME:=libwilddog
PKG_VERSION:=2.0.0
PKG_RELEASE:=5

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://cdn.wilddog.com/sdk/c/$(PKG_VERSION)/

PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/libwilddog
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=A Library for real-time commuication.
  DEPENDS:=+libpthread
endef

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

TARGET_CFLAGS += $(FPIC)

define Build/Configure
  $(call Build/Configure/Default,--with-endian=big)
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include/libwilddog
	$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/libwilddog
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_BUILD_DIR)/libwilddog.a $(1)/usr/lib/
endef

define Package/libwilddog/install
	$(INSTALL_DIR) $(1)/usr/lib
endef

$(eval $(call BuildPackage,libwilddog))


text:
layout: categories_list
cat_name: 'Seafood'
---

{% for post in site.categories.['seafood'] %}

  {% include categoryandtags.html %}

{% endfor %}


text:
class Author < ActiveRecord::Base
  has_many :books
  default_serialize_options :all => {:dasherize => false}
end