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

<!--
	Medius is the central city of the game world. It is a relatively large city
	that is known for its temples, trade houses, unique stone architecture and
	also for its three awe inspiring obelisks: Equitas, Otium, and Prosperitas.
	There are three major districts in the city, each named after the obelisk
	around which they are centered.

	The city rests against a bay known as the "Median Bay". The Imbrium river
	runs through the center of the prosperity district. Along with two major
	aqueducts that run water from the mountains from the north and south this
	river supplies much of the city's fresh water.
-->
<area id="medius" title="The city of Medius" author="Ryan Sandor Richards">

	<!-- Prosperitus Square -->
	<room id="prosperitas">
		<title>Prosperitas Square</title>

		<describe>
			Ornate copper statues depicting wealth, abundance, and health dot the well
			groomed gardens of the square. At its center towering two hundred feet
			above the square stands the <look>Prosperity Obelisk</look>.

			Various shops and trade houses lie on the edges of the square. They
			include, <exit>Contego Protectives</exit> the local armor stop, a quality
			weapons shop called <exit>Arma Armarium</exit>, and an old inn known as
			<exit>The Argentum</exit>. Two major streets run through the square, Dito
			Lane running <exit>north</exit> and <exit>south</exit>, and Median Avenue
			running <exit>east</exit>
			and <exit>west</exit>.
		</describe>

		<describe names="prosperitas obelisk">
			The obelisk is built of thousands of smoothed deep blue stone blocks, and
			its base is surrounded by ziggurat of eleven perfectly square marble
			steps. The southern side of the obelisk contains a large copper
			<look>dedication plaque</look>.
		</describe>

		<describe names="dedication plaque">
			The plaque reads: Dedicated to the prosperity of all Medius, General
			Xavier IV
		</describe>

		<describe names="contego protectives">
			The building is build of solid gray bricks and is adorned with decorative
			copper shields, armors, and helms. The sign that hangs above two heavy
			ironbound wooden doors reads: Contego Protectives, Quality Armors Since
			142.
		</describe>

		<describe names="arma armarium">
			Images of various spatas, maces, chains, and whips are engraved into stone
			on the face of this building. A large single door is flanked by two full
			scale statures of soldiers holding long copper spears. The sign that hangs
			above the door reads: Arma Armarium - exquisite weapons, exceptional
			prices.
		</describe>

		<describe names="argentum">
			This old yet warm inn is one of the only buildings in the square
			completely made of wood. It has been painted a deep regal purple with pale
			yellow trim surrounding its multitude of expertly placed leaded glass
			windows. The sign above the cozy double doors simply reads: The Argentum.
		</describe>

		<exit names="contego protectives" to="contego protectives">
			Contego Protectives (Armorer)
		</exit>
		<exit names="arma armarium" to="arma armarium">
			Arma Armarium (Weaponsmith)
		</exit>
		<exit names="argentum inn" to="argentum">The Argentum (Inn)</exit>
		<exit names="north" to="prosperitas north">Dito Lane</exit>
		<exit names="south" to="prosperitas south">Dito Lane</exit>
		<exit names="east" to="prosperitas east">Median Avenue</exit>
		<exit names="west" to="prosperitas west">Median Avenue</exit>

		<instance type="item" id="yarn" />
		<instance type="item" id="wooden-sword" />
		<instance type="item" id="steel-longsword" />
		<instance type="mobile" id="pauper" />
	</room>

	<room id="contego protectives">
		<title>Contego Protectives</title>

		<describe>
			The armor shop has a large open structure with tall gray stone
			<look>pillars</look> to support the ceiling. Between the pillars
			<look>display dummies</look> sit donning the finest bronze, iron, and
			steel armors. The smell of protective oils and cold metal pervade every
			nook and crany of the dimly torchlit space. Against the wall opposite the
			<exit>door</exit> rests a large <look>wooden counter</look>. To the left
			of the counter is an <exit>archway</exit> leading to the famed Contego
			Testing Grounds.
		</describe>

		<describe names="pillars">
			The pillars are sqauare and constructed of finely masoned medium gray
			stone. Small dim torches hang on each side lending their light to the
			space around them.
		</describe>

		<describe names="display dummies dummy">
			Wooden dummies ranging from disembodied heads, to whole human figures
			occupy the spaces between pillars. The armor they wear looks legitimate
			as the wood sags a bit under the heavy weight of the composite metals
			and leathers.
		</describe>

		<describe names="wooden counter">
			The counter's sides are ornately carved and depict an epic battle between
			two armies of men on a sparsely wooded hillside. A large metal plaque
			affixed to its front plainly reads "CONTEGO"
		</describe>

		<shop id="contego-shop" name="Contego Protectives" sell="1.5" buy="0.5">
			<!-- Both of these items are unlimited -->
			<stock id="leather-helm" />
			<stock id="leather-jerkin" />

			<!--
			Stocked items can be restocked if given a quantity. Here's a rundown of
			the expected attributes:

				restock: 			  The restocking interval in game ticks.
				restock-freq:   A number between 1 and 100 that gives the percentage
				                chance an item will be restocked.
				restock-amount: How many items should be added upon a restock event.

			-->
			<stock id="nickle" quantity="10" restock="1800"
				     restock-freq="100" restock-amount="5" />
		</shop>

		<instance type="mobile" id="duke" />

		<exit names="door" to="prosperitas">Door to Prosperitas Square</exit>
		<exit names="archway" to="contego testing grounds">
			Archway to the testing grounds
		</exit>
	</room>

	<room id="contego testing grounds">
		<title>Contego Protectives Testing Grounds</title>

		<describe>
			The testing grounds are a miniaturized version of the Great Colliseum
			in Medius. The dirt floor appears to be stained with the
			sweat and <look>blood</look> of countless battles. Crudely painted
			<look>wooden spectators</look> are affixed to the walls. An
			<exit>archway</exit> leads to the Contego Protectives store and showroom.
		</describe>

		<describe names="blood">
			While at first glance the blood appears as real as would be seen in the
			real colliseum a quick sniff reveals it to be nothing more than some
			disgusting mixture of tomato paste and sugar.
		</describe>

		<describe names="wooden spectators">
			The poorly painted wooden cutouts of spectators range widly in their
			lifeless and uninspired expressions.
		</describe>

		<instance type="mobile" id="dummy-weak" />
		<instance type="mobile" id="dummy" />
		<instance type="mobile" id="dummy-strong" />
		<instance type="mobile" id="dummy-super" />
		<instance type="mobile" id="dummy-greater" />

		<instance type="item" id="master-sword" />

		<exit names="archway" to="contego protectives">
			Archway to the contego protectives
		</exit>
	</room>

	<room id="arma armarium">
		<title>Arma Armarium</title>
		<exit names="door" to="prosperitas">Door to Prosperitas Square</exit>
	</room>

	<room id="argentum">
		<title>The Argentum Inn</title>
		<exit names="up" to="argentum second floor">
			Stairs to the second floor
		</exit>
		<exit names="door" to="prosperitas">Door to Prosperitas Square</exit>
	</room>

	<room id="argentum second floor">
		<title>Second floor of the Argentum Inn</title>
		<exit names="down" to="argentum">down</exit>
	</room>

	<room id="prosperitas north">
		<title>North of Prosperitas Square along Dito Lane</title>
		<exit names="south" to="prosperitas">Prosperitas Square</exit>
		<instance type="mobile" id="pauper" />
		<instance type="mobile" id="dummy" />
	</room>

	<room id="prosperitas south">
		<title>South of Prosperitas Square along Dito Lane</title>
		<exit names="north" to="prosperitas">Prosperitas Square</exit>
	</room>

	<room id="prosperitas east">
		<title>East of Prosperitas Square along Median Avenue</title>
		<exit names="west" to="prosperitas">Prosperatas Square</exit>
	</room>

	<room id="prosperitas west">
		<title>West of Prosperitas Square along Median Avenue</title>
		<exit names="east" to="prosperitas">Prosperitas Square</exit>
	</room>

	<!-- Items -->
	<item id="yarn" names="ball yarn">
		<property key="description">
			A length of yellow yarn that that has been neatly and tightly
			wound into a small ball.
		</property>
		<property key="description.inventory">A ball of yarn.</property>
		<property key="description.room">A ball of yarn rests here.</property>
		<property key="weight">1</property>
	</item>

	<item id="nickle" names="wooden nickle">
		<property key="description">
			A small round coin made from a light softwood. Each side contains an
			intricate script which reads: Contego Protectives: Celebrating a Century
			of fine Armors.
		</property>
		<property key="description.inventory">wooden nickle</property>
		<property key="description.room">A small wooden nickle lies here.</property>
		<property key="weight">1</property>
	</item>

	<item id="wooden-sword" names="wooden sword">
		<property key="type">equipment</property>
		<property key="slot">weapon</property>
		<property key="proficiency">shortsword</property>
		<property key="weight">2</property>
		<property key="level">1</property>
		<property key="value">5</property>
		<property key="description">
			A wooden practice sword made of sturdy oak. The blade has been carved
			with intricate patterns and its hilt wrapped in soft supple leather.
		</property>
		<property key="description.inventory">wooden sword</property>
		<property key="description.room">
			A sturdy wooden sword rests here.
		</property>
	</item>

	<item id="steel-longsword" names="steel sword longsword">
		<property key="type">equipment</property>
		<property key="slot">weapon</property>
		<property key="proficiency">longsword</property>
		<property key="weight">2</property>
		<property key="level">10</property>
		<property key="value">50</property>
		<property key="description">
			A longsword made of the finest steel.
		</property>
		<property key="description.inventory">steel longsword</property>
		<property key="description.room">
			A steel longsword rests here.
		</property>
	</item>

	<item id="leather-helm" names="leather helm">
		<property key="type">equipment</property>
		<property key="slot">head</property>
		<property key="skill">light-armor</property>
		<property key="weight">3</property>
		<property key="level">1</property>
		<property key="value">20</property>
		<property key="description">
			A simple leather helmet made from cow's hide. The helmet is sturdy but
			flexible allowing it to fit a variety of head sizes.
		</property>
		<property key="description.inventory">leather helm</property>
		<property key="description.room">
			A leather helmet lies here.
		</property>
	</item>

	<item id="leather-jerkin" names="leather jerkin">
		<property key="type">equipment</property>
		<property key="slot">body</property>
		<property key="skill">light-armor</property>
		<property key="weight">10</property>
		<property key="level">1</property>
		<property key="value">75</property>
		<property key="description">
			A leather jerkin for protecting the body. Made of cow's hide this jerkin
			seems sturdy and sure to deflect a blow or two. Small rivets of metal
			affixed to long iron strips have been sewn into the top layers of of the
			jerkin and add extra protection to the chest, back, and shoulders.
		</property>
		<property key="description.inventory">leather jerkin</property>
		<property key="description.room">
			A leather jerkin lies here.
		</property>
	</item>

	<item id="master-sword" names="master sword">
		<property key="type">equipment</property>
		<property key="slot">weapon</property>
		<property key="proficiency">longsword</property>
		<property key="weight">10</property>
		<property key="level">100</property>
		<property key="value">50000</property>
		<property key="description">
			The master sword of Hyrulian legend.
		</property>
		<property key="description.inventory">master sword</property>
		<property key="description.room">
			The master sword lies here.
		</property>
	</item>

	<!-- Mobiles -->
	<mobile id="duke" names="duke stabilis" state="stationary" protected="true">
		<property key="description">
			Dressed in a dark heavy shirt and trousers, Duke is a tall and sturdy man.
			His short dusty gray hair connects to a trim but thick beard, which nearly
			conceals a serious grimace. Gray blue eyes peer calmly about the
			establishment from sunken pits on his hard and worn face.
		</property>
		<property key="level">55</property>
		<property key="power">75</property>
		<property key="description.name">Duke Stabilis</property>
		<property key="description.spawn">
			Duke Stabilis, the proprieter of Contego Protectives, enters the shop.
		</property>
		<property key="shop-owner">contego-shop</property>
	</mobile>

	<mobile id="pauper" names="pauper" state="wandering">
		<property key="description">
			A thin and poorly kept man with hollow brown eyes. His clothes are mere
			white stained rags that cling to his fragile frame.
		</property>
		<property key="description.name">Pauper</property>
		<property key="description.spawn">
			A pauper shambles slowly into the vicinity.
		</property>
		<property key="level">1</property>

		<property key="stat.major">speed</property>
		<property key="stat.minor">vitality</property>

		<!--
			Mobiles have a power rating from 1 to 100 that determines, along with
			level, how tough they are in combat. An average mobile will have a power
			of 25, a very weak mobile has a power of 1, and an incredibly stong mobile
			will have a power of 100.
		-->
		<property key="power">10</property>
	</mobile>

	<mobile id="dummy-weak" names="weak dummy">
		<property key="description">
			A test dummy made of shoddy materials. It is formed much like a human and
			wears a green jumpsuit. It doesn't look too menacing.
		</property>
		<property key="description.name">Weak Dummy</property>
		<property key="description.spawn">
			A weak dummy pops into existence.
		</property>
		<property key="level">2</property>
		<property key="power">8</property>
		<property key="stat.major">speed</property>
		<property key="stat.minor">vitality</property>
	</mobile>

	<mobile id="dummy" names="test dummy" state="stationary">
		<property key="description">
			A test dummy made of standard materials. It is formed much like a human
			and wears a gray jumpsuit.
		</property>
		<property key="description.name">Test Dummy</property>
		<property key="description.spawn">
			A test dummy pops into existence.
		</property>
		<property key="level">5</property>
		<property key="power">35</property>
		<property key="stat.major">strength</property>
		<property key="stat.minor">magic</property>
	</mobile>

	<mobile id="dummy-strong" names="strong dummy" state="stationary">
		<property key="description">
			A test dummy made of very durable materials. It is formed much like a
			human and wears a red jumpsuit.
		</property>
		<property key="description.name">Strong Dummy</property>
		<property key="description.spawn">
			A stong dummy pops into existence.
		</property>
		<property key="level">7</property>
		<property key="power">35</property>
		<property key="stat.major">strength</property>
		<property key="stat.minor">speed</property>
		<property key="attack.type">bludgeoning,fire</property>
	</mobile>

	<mobile id="dummy-super" names="super dummy" state="stationary">
		<property key="description">
			A test dummy made of diamond. It is formed much like a human and wears a
			nothing but its diamond skin.
		</property>
		<property key="description.name">Super Dummy</property>
		<property key="description.spawn">
			A super dummy pops into existence.
		</property>
		<property key="level">20</property>
		<property key="power">35</property>
		<property key="stat.major">strength</property>
		<property key="stat.minor">speed</property>
		<property key="attack.type">piercing</property>
	</mobile>

	<mobile id="dummy-greater" names="greater dummy" state="stationary">
		<property key="description">
			A test dummy made of god flesh. It is the greater dummy, the dummy to end
			all dummies.
		</property>
		<property key="description.name">Greater Dummy</property>
		<property key="description.spawn">
			A greater dummy pops into existence.
		</property>
		<property key="level">100</property>
		<property key="power">100</property>
		<property key="stat.major">strength</property>
		<property key="stat.minor">speed</property>
		<property key="attack.type">slashing</property>
	</mobile>
</area>


text:
package app.components.learncards

import app.components.WindowFunc
import japgolly.scalajs.react.vdom.html_<^._
import japgolly.scalajs.react.{BackendScope, Callback, ScalaComponent}

object LearnCardCmp {

  case class Props(key: String,
                   ctx: WindowFunc,
                   question: TagMod,
                   answer: TagMod,
                   scoreSelected: String => Callback
                   ) {
    @inline def render = comp.withKey(key)(this)
  }

  protected case class State(answerIsHidden: Boolean = true)

  private lazy val comp = ScalaComponent.builder[Props](this.getClass.getName)
    .initialState(State())
    .renderBackend[Backend]
    .build

  protected class Backend($: BackendScope[Props, State]) {
    def render(implicit p: Props, s: State) = <.div(^.`class`:=LearnCardCmp.getClass.getSimpleName,
      <.div(^.key:="question",
        p.question
      ),
      <.div(^.key:="answer-block",
        if (!s.answerIsHidden) {
          TagMod(
            EmptyVdom,
            <.div(
              p.answer
            )
          )
        } else {
          EmptyVdom
        }
      )
    )

  }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef __VC_INCLUDE_COMMON_H__
#define __VC_INCLUDE_COMMON_H__

#include "interface/vcos/vcos_stdint.h"
#include "interface/vctypes/vc_image_types.h"

#if defined(__HIGHC__) && defined(_VIDEOCORE) && !defined(_I386)
// __HIGHC__ is only available with MW
// The scvc plugins are compiled (bizarrely) on an x86 with _VIDEOCORE set!
#include <vc/intrinsics.h>
#endif

#ifdef __COVERITY__
#ifndef _Rarely
#define _Rarely(x) (x)
#endif
#ifndef _Usually
#define _Usually(x) (x)
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __SYMBIAN32__
# ifndef INLINE
#  define INLINE __inline
# endif

/* Align a pointer/integer by rounding up/down */
#define ALIGN_DOWN(p, n)   ((uint32_t)(p) - ( (uint32_t)(p) % (uint32_t)(n) ))
#define ALIGN_UP(p, n)     ALIGN_DOWN((uint32_t)(p) + (uint32_t)(n) - 1, (n))

#elif defined (VCMODS_LCC)
#include <limits.h>

#elif !defined(__KERNEL__)
#include <limits.h>

#endif

/*}}}*/

/* Fixed-point types */
typedef unsigned short uint8p8_t;
typedef signed short sint8p8_t;
typedef unsigned short uint4p12_t;
typedef signed short sint4p12_t;
typedef signed short sint0p16_t;
typedef signed char sint8p0_t;
typedef unsigned char uint0p8_t;
typedef signed long int24p8_t;

/*{{{ Common typedefs */

typedef enum bool_e
{
   VC_FALSE = 0,
   VC_TRUE = 1,
} bool_t;

/*}}}*/

/*{{{ Common macros */

/* Align a pointer/integer by rounding up/down */
#define ALIGN_DOWN(p, n)   ((uintptr_t)(p) - ( (uintptr_t)(p) % (uintptr_t)(n) ))
#define ALIGN_UP(p, n)     ALIGN_DOWN((uintptr_t)(p) + (uintptr_t)(n) - 1, (n))

#define CLIP(lower, n, upper) _min((upper), _max((lower), (n)))

/*}}}*/

/*{{{ Debugging and profiling macros */

#if 0
/* There's already an assert_once in <logging/logging.h> */
#ifdef DEBUG
#define assert_once(x) \
   { \
      static uint8_t ignore = 0; \
      if(!ignore) \
      { \
         assert(x); \
         ignore++; \
      } \
   }
#else
#define assert_once(x) (void)0
#endif
#endif /* 0 */

#if defined(__HIGHC__) && !defined(NDEBUG)
/* HighC lacks a __FUNCTION__ preproc symbol... :( */
#define profile_rename(name) _ASM(".global " name "\n" name ":\n")
#else
#define profile_rename(name) (void)0
#endif

/*}}}*/
#ifdef __cplusplus
 }
#endif
#endif /* __VCINCLUDE_COMMON_H__ */


text:
layout: homeblog
title: <i class="fa fa-info-circle" aria-hidden="true"></i> Blog
---

## • January 2018: [Spring Boot Security: choose spring-webmvc-pac4j over Spring Security](/blog/spring-boot-security-choose-spring-webmvc-pac4j.html)

## • September 2017: [Yet another JWT library (pac4j-jwt) for Java](/blog/yet-another-jwt-library-pac4j-jwt-for-java.html)


text:
package com.kawansoft.aceql.gui.util;
/**
 * File Filter for PDF Like files
 */

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class PropertiesFileFilter extends FileFilter {

    /** The array of Word like extensions (common known usage) */
    public static final String[] PROPERTIES_LIKE_EXTENSIONS =
    {
        ".properties",
    };

    /**
     * Accept all directories and all Word Like extensions
     */
    @Override
    public boolean accept(File f)
    {
        if (f.isDirectory())
        {
            return true;
        }
        return PropertiesFileFilter.isPropertiesLikeExtension(f);

    }

    /**
     * @return The description of this filter
     */

    @Override
    public String getDescription()
    {
        String extensions = "";
        for (int i = 0; i < PropertiesFileFilter.PROPERTIES_LIKE_EXTENSIONS.length; i++)
        {
            extensions += "*" + PropertiesFileFilter.PROPERTIES_LIKE_EXTENSIONS[i];

            if ( i != PropertiesFileFilter.PROPERTIES_LIKE_EXTENSIONS.length - 1)
            {
                extensions += ", ";
            }
        }

        return "Propertie: (" + extensions + ")";

    }

    /**
     * @param file  the Properties file
     * @return  true if the extension is one of a Word type : .properties
     */
    public static boolean isPropertiesLikeExtension(File file)
    {
        if (file == null)
        {
            throw new IllegalArgumentException("File is null!");
        }

        String fileName = file.getName();
        fileName = fileName.toLowerCase();

        for (int i = 0; i < PROPERTIES_LIKE_EXTENSIONS.length; i++)
        {
            if (fileName.endsWith(PROPERTIES_LIKE_EXTENSIONS[i]))
            {
                return true;
            }
        }

        return false;
    }
}


text:
<?php

$applicationWidget = new CWidget();
$applicationWidget->addPageHeader(_('CONFIGURATION OF APPLICATIONS'));

// append host summary to widget header
$applicationWidget->addItem(get_header_host_table('applications', $this->data['hostid']));

// create form
$applicationForm = new CForm();
$applicationForm->setName('applicationForm');
$applicationForm->addVar('form', $this->data['form']);
$applicationForm->addVar('hostid', $this->data['hostid']);
if (!empty($this->data['applicationid'])) {
	$applicationForm->addVar('applicationid', $this->data['applicationid']);
}

// create form list
$applicationFormList = new CFormList('applicationFormList');
$nameTextBox = new CTextBox('appname', $this->data['appname'], ZBX_TEXTBOX_STANDARD_SIZE);
$nameTextBox->attr('autofocus', 'autofocus');
$applicationFormList->addRow(_('Name'), $nameTextBox);

// append tabs to form
$applicationTab = new CTabView();
$applicationTab->addTab('applicationTab', _('Application'), $applicationFormList);
$applicationForm->addItem($applicationTab);

// append buttons to form
if (!empty($this->data['applicationid'])) {
	$applicationForm->addItem(makeFormFooter(
		new CSubmit('update', _('Update')),
		array(
			new CSubmit('clone', _('Clone')),
			new CButtonDelete(_('Delete application?'), url_params(array('config', 'hostid', 'form', 'applicationid'))),
			new CButtonCancel(url_param('config').url_param('hostid'))
		)
	));
}
else {
	$applicationForm->addItem(makeFormFooter(
		new CSubmit('add', _('Add')),
		new CButtonCancel(url_param('config').url_param('hostid'))
	));
}

// append form to widget
$applicationWidget->addItem($applicationForm);

return $applicationWidget;


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

namespace NuGet.Common
{
    internal class MSBuildSolutionParser : ISolutionParser
    {
        public IEnumerable<string> GetAllProjectFileNames(IFileSystem fileSystem, string solutionFile)
        {
            var solution = new Solution(fileSystem, solutionFile);
            var solutionDirectory = Path.GetDirectoryName(fileSystem.GetFullPath(solutionFile));

            return solution.Projects.Where(p => !p.IsSolutionFolder)
                .Select(p => Path.Combine(solutionDirectory, p.RelativePath));
        }
    }
}


text:
from casexml.apps.stock.models import StockTransaction, StockReport
from corehq.apps.commtrack.models import StockState
from corehq.form_processor.tests.utils import FormProcessorTestUtils
from custom.ewsghana.tests.handlers.utils import EWSScriptTest, TEST_DOMAIN

class TestUndo(EWSScriptTest):

    def tearDown(self):
        FormProcessorTestUtils.delete_all_xforms(TEST_DOMAIN, self.user1._id)

    def test_no_product_reports(self):
        a = """
            5551234 > undo
            5551234 < You have not submitted any product reports yet.
        """
        self.run_script(a)

    def test_undo_messages(self):
        a = """
           5551234 > soh ov 16.0
           5551234 < Dear test1 test1, thank you for reporting the commodities you have in stock.
           5551234 > undo
           5551234 < Success. Your previous report has been removed. It was: soh ov 16.0
           5551234 > undo
           5551234 < You have not submitted any product reports yet.
           """
        self.run_script(a)

    def test_undo_data1(self):
        a = """
           5551234 > soh ov 16.0
           5551234 < Dear test1 test1, thank you for reporting the commodities you have in stock.
           5551234 > soh ov 10.0
           5551234 < Dear test1 test1, thank you for reporting the commodities you have in stock.
           """
        self.run_script(a)

        transactions_count = StockTransaction.objects.filter(
            type='stockonhand', report__domain=TEST_DOMAIN
        ).count()
        reports = StockReport.objects.filter(domain=TEST_DOMAIN).count()

        a = """
           5551234 > undo
           5551234 < Success. Your previous report has been removed. It was: soh ov 10.0
           """
        self.run_script(a)

        self.assertEqual(
            StockTransaction.objects.filter(type='stockonhand', report__domain=TEST_DOMAIN).count(),
            transactions_count - 1
        )

        self.assertEqual(
            StockReport.objects.filter(domain=TEST_DOMAIN).count(), reports - 2
        )

        self.assertEqual(int(StockState.objects.get(sql_product__code='ov').stock_on_hand), 16)

    def test_undo_data2(self):
        a = """
           5551234 > soh ov 16.0 ml 8.0
           5551234 < Dear test1 test1, thank you for reporting the commodities you have in stock.
           5551234 > soh ov 10.0 ml 5.0
           5551234 < Dear test1 test1, thank you for reporting the commodities you have in stock.
           """
        self.run_script(a)

        transactions_count = StockTransaction.objects.filter(
            type='stockonhand', report__domain=TEST_DOMAIN
        ).count()
        reports = StockReport.objects.filter(domain=TEST_DOMAIN).count()

        a = """
           5551234 > undo
           5551234 < Success. Your previous report has been removed. It was: soh ml 5.0 ov 10.0
           """
        self.run_script(a)

        self.assertEqual(
            StockTransaction.objects.filter(type='stockonhand', report__domain=TEST_DOMAIN).count(),
            transactions_count - 2
        )

        self.assertEqual(
            StockReport.objects.filter(domain=TEST_DOMAIN).count(), reports - 2
        )

        self.assertEqual(int(StockState.objects.get(sql_product__code='ml').stock_on_hand), 8)


text:
[![GoDoc](https://godoc.org/github.com/skidder/gifs-client-go/gifs?status.svg)](https://godoc.org/github.com/skidder/gifs-client-go/gifs) [![Circle CI](https://circleci.com/gh/skidder/gifs-client-go.svg?style=svg)](https://circleci.com/gh/skidder/gifs-client-go)

Go Client for the [GIFS API](http://docs.gifs.com/v1.0/docs).

# Installation

```shell
go get -u github.com/skidder/gifs-client-go/gifs
```

# Operations

## Import from URL
Invokes the [Import](http://docs.gifs.com/docs/mediaimport) endpoint in the GIFS API.  Sample client code follows:

```go
package main

import (
	"fmt"
	"os"

	"github.com/skidder/gifs-client-go/gifs"
)

func main() {
	client := gifs.NewGIFSClient(os.Getenv("GIFS_API_KEY"))

	request := &gifs.ImportRequest{
		Title:     os.Args[1],
		SourceURL: os.Args[2],
	}
	err := client.Import(request)
	if err != nil {
		fmt.Printf("Error importing file: %s\n", err.Error())
		return
	}
}
```

## Upload File
Invokes the [Upload](http://docs.gifs.com/docs/mediaupload) endpoint on the GIFS API.  Sample code follows:

```go
package main

import (
	"fmt"
	"os"

	"github.com/skidder/gifs-client-go/gifs"
)

func main() {
	client := gifs.NewGIFSClient(os.Getenv("GIFS_API_KEY"))

	title := os.Args[1]
	filename := os.Args[2]
	inputFile, err := os.OpenFile(filename, os.O_RDONLY, os.FileMode(666))
	if err != nil {
		fmt.Printf("Error opening file: %s\n", err.Error())
		return
	}
	defer inputFile.Close()

	request := &gifs.UploadRequest{
		Title:    title,
		Filename: filename,
	}
	err = client.Upload(request, inputFile)
	if err != nil {
		fmt.Printf("Error uploading file: %s\n", err.Error())
		return
	}
}
```


text:
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>cannon.js cloth simulation</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #000;
                color: #000;
                margin: 0px;
                overflow: hidden;
            }
            #info {
                text-align: center;
                padding: 10px;
                z-index: 10;
                width: 100%;
                position: absolute;
            }
            a {
                text-decoration: underline;
                cursor: pointer;
            }
        </style>
    </head>

    <body>
        <script src="../libs/Three.js"></script>
        <script src="../libs/Detector.js"></script>
        <script src="../build/cannon.js"></script>
        <script>

            var dt = 1/60, R = 0.2;

            var clothMass = 1;  // 1 kg in total
            var clothSize = 1; // 1 meter
            var Nx = 12;
            var Ny = 12;
            var mass = clothMass / Nx*Ny;

            var restDistance = clothSize/Nx;

            var ballSize = 0.1;

            var clothFunction = plane(restDistance * Nx, restDistance * Ny);

            function plane(width, height) {
                return function(u, v) {
                    var x = (u-0.5) * width;
                    var y = (v+0.5) * height;
                    var z = 0;
                    return new THREE.Vector3(x, y, z);
                };
            }

            if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

            var container, stats;
            var camera, scene, renderer;

            var clothGeometry;
            var sphereMesh, sphereBody;
            var object;
            var particles = [];
            var world;

            initCannon();
            init();
            animate();

            function initCannon(){
                world = new CANNON.World();
                world.broadphase = new CANNON.NaiveBroadphase();
                world.gravity.set(0,-9.82,0);
                world.solver.iterations = 20;

                // Materials
                var clothMaterial = new CANNON.Material();
                var sphereMaterial = new CANNON.Material();
                var clothSphereContactMaterial = new CANNON.ContactMaterial(  clothMaterial,
                                                                              sphereMaterial,
                                                                              0.0, // friction coefficient
                                                                              0.0  // restitution
                                                                              );
                // Adjust constraint equation parameters for ground/ground contact
                clothSphereContactMaterial.contactEquationStiffness = 1e9;
                clothSphereContactMaterial.contactEquationRegularizationTime = 3;

                // Add contact material to the world
                world.addContactMaterial(clothSphereContactMaterial);

                // Create sphere
                var sphereShape = new CANNON.Sphere(ballSize*1.3);
                sphereBody = new CANNON.RigidBody(0,sphereShape);
                sphereBody.position.set(0,0,0);
                world.add(sphereBody);

                // Create cannon particles
                for ( var i = 0, il = Nx+1; i !== il; i++ ) {
                    particles.push([]);
                    for ( var j = 0, jl = Ny+1; j !== jl; j++ ) {
                        var idx = j*(Nx+1) + i;
                        var p = clothFunction(i/(Nx+1), j/(Ny+1));
                        var particle = new CANNON.Particle(j==Ny ? 0 : mass);
                        particle.linearDamping = 0.5;
                        particle.position.set(
                            p.x,
                            p.y-Ny*0.9*restDistance,
                            p.z
                        );
                        particles[i].push(particle);
                        world.add(particle);
                        particle.velocity.set(0,0,-0.1*(Ny-j));
                    }
                }
                function connect(i1,j1,i2,j2){
                    world.addConstraint( new CANNON.DistanceConstraint(particles[i1][j1],particles[i2][j2],restDistance) );
                }
                for(var i=0; i<Nx+1; i++){
                    for(var j=0; j<Ny+1; j++){
                        if(i<Nx) connect(i,j,i+1,j);
                        if(j<Ny) connect(i,j,i,j+1);
                    }
                }
            }

            function init() {

                container = document.createElement( 'div' );
                document.body.appendChild( container );

                // scene

                scene = new THREE.Scene();

                scene.fog = new THREE.Fog( 0x000000, 500, 10000 );

                // camera

                camera = new THREE.PerspectiveCamera( 30, window.innerWidth / window.innerHeight, 0.5, 10000 );

                camera.position.set(Math.cos( Math.PI/4 ) * 3,
                                    0,
                                    Math.sin( Math.PI/4 ) * 3);

                scene.add( camera );

                // Controls
                controls = new THREE.TrackballControls( camera );

                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;

                controls.noZoom = false;
                controls.noPan = false;

                controls.staticMoving = true;
                controls.dynamicDampingFactor = 0.3;

                controls.keys = [ 65, 83, 68 ];

                // lights
                var light, materials;
                scene.add( new THREE.AmbientLight( 0x666666 ) );

                light = new THREE.DirectionalLight( 0xffffff, 1.75 );
                var d = 5;

                light.position.set( d, d, d );

                light.castShadow = true;
                //light.shadowCameraVisible = true;

                light.shadowMapWidth = 1024*2;
                light.shadowMapHeight = 1024*2;

                light.shadowCameraLeft = -d;
                light.shadowCameraRight = d;
                light.shadowCameraTop = d;
                light.shadowCameraBottom = -d;

                light.shadowCameraFar = 3*d;
                light.shadowCameraNear = d;
                light.shadowDarkness = 0.5;

                scene.add( light );

                /*
                light = new THREE.DirectionalLight( 0xffffff, 0.35 );
                light.position.set( 0, -1, 0 );

                scene.add( light );
                */

                // cloth material

                var clothTexture = THREE.ImageUtils.loadTexture( 'sunflower.jpg' ); // circuit_pattern.png
                clothTexture.wrapS = clothTexture.wrapT = THREE.RepeatWrapping;
                clothTexture.anisotropy = 16;

                var clothMaterial = new THREE.MeshPhongMaterial( {
                    alphaTest: 0.5,
                    ambient: 0x000000,
                    color: 0xffffff,
                    specular: 0x333333,
                    emissive: 0x222222,
                    //shininess: 5,
                    map: clothTexture,
                    side: THREE.DoubleSide
                } );

                // cloth geometry
                clothGeometry = new THREE.ParametricGeometry( clothFunction, Nx, Ny, true );
                clothGeometry.dynamic = true;
                clothGeometry.computeFaceNormals();

                // cloth mesh
                object = new THREE.Mesh( clothGeometry, clothMaterial );
                object.position.set( 0, 0, 0 );
                object.castShadow = true;
                object.receiveShadow = true;
                scene.add( object );

                // sphere
                var ballGeo = new THREE.SphereGeometry( ballSize, 20, 20 );
                var ballMaterial = new THREE.MeshPhongMaterial( { color: 0x888888 } );

                sphereMesh = new THREE.Mesh( ballGeo, ballMaterial );
                sphereMesh.castShadow = true;
                sphereMesh.receiveShadow = true;
                scene.add( sphereMesh );

                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.setClearColor( scene.fog.color );

                container.appendChild( renderer.domElement );

                renderer.gammaInput = true;
                renderer.gammaOutput = true;
                renderer.physicallyBasedShading = true;

                renderer.shadowMapEnabled = true;

                window.addEventListener( 'resize', onWindowResize, false );

                camera.lookAt( sphereMesh.position );
            }

            //

            function onWindowResize() {

                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                controls.handleResize();

                renderer.setSize( window.innerWidth, window.innerHeight );

            }

            function animate() {
                requestAnimationFrame( animate );
                controls.update();
                world.step(dt);
                var t = world.time;
                sphereBody.position.set(R*Math.sin(2*t),0,R*Math.cos(2*t));
                render();
            }

            function render() {

                for ( var i = 0, il = Nx+1; i !== il; i++ ) {
                    for ( var j = 0, jl = Ny+1; j !== jl; j++ ) {
                        var idx = j*(Nx+1) + i;
                        particles[i][j].position.copy( clothGeometry.vertices[ idx ] );
                    }
                }

                clothGeometry.computeFaceNormals();
                clothGeometry.computeVertexNormals();

                clothGeometry.normalsNeedUpdate = true;
                clothGeometry.verticesNeedUpdate = true;

                sphereBody.position.copy(sphereMesh.position);

                renderer.render( scene, camera );

            }

        </script>
    </body>
</html>


text:
// Artificial Rotator|ArtificialControllables|120020
namespace VRTK.Controllables.ArtificialBased
{
    using UnityEngine;
    using VRTK.GrabAttachMechanics;
    using VRTK.SecondaryControllerGrabActions;

    /// <summary>
    /// A artificially simulated openable rotator.
    /// </summary>
    /// <remarks>
    /// **Required Components:**
    ///  * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
    ///
    /// **Script Usage:**
    ///  * Create a rotator container GameObject and set the GameObject that is to become the rotator as a child of the newly created container GameObject.
    ///  * Place the `VRTK_ArtificialRotator` script onto the GameObject that is to become the rotatable object and ensure the Transform rotation is `0, 0, 0`.
    ///  * Create a nested GameObject under the rotator GameObject and position it where the hinge should operate.
    ///  * Apply the nested hinge GameObject to the `Hinge Point` parameter on the Artificial Rotator script.
    ///
    ///   > The rotator GameObject must not be at the root level and needs to have the Transform rotation set to `0,0,0`. This is the reason for the container GameObject requirement. Any positioning of the rotator must be set on the parent container GameObject.
    ///   > The Artificial Rotator script GameObject will become the child of a runtime created GameObject that determines the rotational offset for the rotator.
    /// </remarks>
    [AddComponentMenu("VRTK/Scripts/Interactables/Controllables/Artificial/VRTK_ArtificialRotator")]
    public class VRTK_ArtificialRotator : VRTK_BaseControllable
    {
        [Header("Hinge Settings")]

        [Tooltip("A Transform that denotes the position where the rotator will rotate around.")]
        public Transform hingePoint;
        [Tooltip("The minimum and maximum angle the rotator can rotate to.")]
        public Limits2D angleLimits = new Limits2D(-180f, 180f);
        [Tooltip("The angle at which the rotator rotation can be within the minimum or maximum angle before the minimum or maximum angles are considered reached.")]
        public float minMaxThresholdAngle = 1f;
        [Tooltip("The angle at which will be considered as the resting position of the rotator.")]
        public float restingAngle = 0f;
        [Tooltip("The threshold angle from the `Resting Angle` that the current angle of the rotator needs to be within to snap the rotator back to the `Resting Angle`.")]
        public float forceRestingAngleThreshold = 1f;
        [Tooltip("The target angle to rotate the rotator to.")]
        [SerializeField]
        protected float angleTarget = 0f;
        [Tooltip("If this is checked then the rotator Rigidbody will have all rotations frozen.")]
        public bool isLocked = false;

        [Header("Value Step Settings")]

        [Tooltip("The minimum and the maximum step values for the rotator to register along the `Operate Axis`.")]
        public Limits2D stepValueRange = new Limits2D(0f, 1f);
        [Tooltip("The increments the rotator value will change in between the `Step Value Range`.")]
        public float stepSize = 0.1f;
        [Tooltip("If this is checked then the value for the rotator will be the step value and not the absolute rotation of the rotator Transform.")]
        public bool useStepAsValue = true;

        [Header("Snap Settings")]

        [Tooltip("If this is checked then the rotator will snap to the angle of the nearest step along the value range.")]
        public bool snapToStep = false;
        [Tooltip("The speed in which the rotator will snap to the relevant angle along the `Operate Axis`")]
        public float snapForce = 10f;

        [Header("Interaction Settings")]

        [Tooltip("If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.")]
        public bool precisionGrab = true;
        [Tooltip("The maximum distance the grabbing object is away from the rotator before it is automatically released.")]
        public float detachDistance = 1f;
        [Tooltip("Determines how the rotation of the object is calculated based on the action of the grabbing object.")]
        public VRTK_RotateTransformGrabAttach.RotationType rotationAction = VRTK_RotateTransformGrabAttach.RotationType.FollowAttachPoint;
        [Tooltip("The simulated friction when the rotator is grabbed.")]
        public float grabbedFriction = 1f;
        [Tooltip("The simulated friction when the rotator is released.")]
        public float releasedFriction = 1f;
        [Tooltip("A collection of GameObjects that will be used as the valid collisions to determine if the rotator can be interacted with.")]
        public GameObject[] onlyInteractWith = new GameObject[0];

        protected VRTK_InteractableObject controlInteractableObject;
        protected VRTK_RotateTransformGrabAttach controlGrabAttach;
        protected VRTK_SwapControllerGrabAction controlSecondaryGrabAction;
        protected bool createInteractableObject;
        protected GameObject rotatorContainer;
        protected bool rotationReset;
        protected bool stillResting;
        protected float previousValue;
        protected float previousAngleTarget;

        /// <summary>
        /// The GetValue method returns the current rotation value of the rotator.
        /// </summary>
        /// <returns>The actual rotation of the rotator.</returns>
        public override float GetValue()
        {
            return (controlGrabAttach != null ? controlGrabAttach.GetAngle() : 0f);
        }

        /// <summary>
        /// The GetNormalizedValue method returns the current rotation value of the rotator normalized between `0f` and `1f`.
        /// </summary>
        /// <returns>The normalized rotation of the rotator.</returns>
        public override float GetNormalizedValue()
        {
            return VRTK_SharedMethods.NormalizeValue(GetValue(), angleLimits.minimum, angleLimits.maximum);
        }

        /// <summary>
        /// The GetContainer method returns the GameObject that is generated to hold the rotator control.
        /// </summary>
        /// <returns>The GameObject container of the rotator control.</returns>
        public virtual GameObject GetContainer()
        {
            return rotatorContainer;
        }

        /// <summary>
        /// The GetStepValue method returns the current angle of the rotator based on the step value range.
        /// </summary>
        /// <param name="currentValue">The current angle value of the rotator to get the Step Value for.</param>
        /// <returns>The current Step Value based on the rotator angle.</returns>
        public virtual float GetStepValue(float currentValue)
        {
            float step = Mathf.Lerp(stepValueRange.minimum, stepValueRange.maximum, VRTK_SharedMethods.NormalizeValue(currentValue, angleLimits.minimum, angleLimits.maximum));
            return Mathf.Round(step / stepSize) * stepSize;
        }

        /// <summary>
        /// The SetAngleTargetWithStepValue sets the `Angle Target` parameter but uses a value within the `Step Value Range`.
        /// </summary>
        /// <param name="givenStepValue">The step value within the `Step Value Range` to set the `Angle Target` parameter to.</param>
        public virtual void SetAngleTargetWithStepValue(float givenStepValue)
        {
            angleTarget = VRTK_SharedMethods.NormalizeValue(givenStepValue, stepValueRange.minimum, stepValueRange.maximum);
            SetAngleWithNormalizedValue(angleTarget);
            previousAngleTarget = angleTarget;
        }

        /// <summary>
        /// The SetRestingAngleWithStepValue sets the `Resting Angle` parameter but uses a value within the `Step Value Range`.
        /// </summary>
        /// <param name="givenStepValue">The step value within the `Step Value Range` to set the `Resting Angle` parameter to.</param>
        public virtual void SetRestingAngleWithStepValue(float givenStepValue)
        {
            restingAngle = VRTK_SharedMethods.NormalizeValue(givenStepValue, stepValueRange.minimum, stepValueRange.maximum);
        }

        /// <summary>
        /// The GetAngleFromStepValue returns the angle the rotator would be at based on the given step value.
        /// </summary>
        /// <param name="givenStepValue">The step value to check the angle for.</param>
        /// <returns>The angle the rotator would be at based on the given step value.</returns>
        public virtual float GetAngleFromStepValue(float givenStepValue)
        {
            float normalizedStepValue = VRTK_SharedMethods.NormalizeValue(givenStepValue, stepValueRange.minimum, stepValueRange.maximum);
            return (controlGrabAttach != null ? Mathf.Lerp(controlGrabAttach.angleLimits.minimum, controlGrabAttach.angleLimits.maximum, Mathf.Clamp01(normalizedStepValue)) : 0f);
        }

        /// <summary>
        /// The SetAngleTarget method sets a target angle to rotate the rotator to.
        /// </summary>
        /// <param name="newAngle">The angle in which to rotate the rotator to.</param>
        public virtual void SetAngleTarget(float newAngle)
        {
            if (controlGrabAttach != null)
            {
                newAngle = Mathf.Clamp(newAngle, angleLimits.minimum, angleLimits.maximum);
                angleTarget = newAngle;
                controlGrabAttach.SetRotation(angleTarget);
            }
        }

        /// <summary>
        /// The IsResting method returns whether the rotator is at the resting angle or within the resting angle threshold.
        /// </summary>
        /// <returns>Returns `true` if the rotator is at the resting angle or within the resting angle threshold.</returns>
        public override bool IsResting()
        {
            float currentValue = GetValue();
            return (!IsGrabbed() && (currentValue <= (restingAngle + minMaxThresholdAngle) && currentValue >= (restingAngle - minMaxThresholdAngle)));
        }

        /// <summary>
        /// The GetControlInteractableObject method returns the Interactable Object associated with the control.
        /// </summary>
        /// <returns>The Interactable Object associated with the control.</returns>
        public virtual VRTK_InteractableObject GetControlInteractableObject()
        {
            return controlInteractableObject;
        }

        protected override void OnDrawGizmosSelected()
        {
            base.OnDrawGizmosSelected();
            if (hingePoint != null)
            {
                Bounds rotatorBounds = VRTK_SharedMethods.GetBounds(transform, transform);
                Vector3 limits = transform.rotation * ((AxisDirection() * rotatorBounds.size[(int)operateAxis]) * 0.53f);
                Vector3 hingeStart = hingePoint.transform.position - limits;
                Vector3 hingeEnd = hingePoint.transform.position + limits;
                Gizmos.DrawLine(hingeStart, hingeEnd);
                Gizmos.DrawSphere(hingeStart, 0.01f);
                Gizmos.DrawSphere(hingeEnd, 0.01f);
            }
        }

        protected override void OnEnable()
        {
            base.OnEnable();
            rotatorContainer = gameObject;
            rotationReset = false;
            previousValue = float.MaxValue;
            SetupParentContainer();
            SetupInteractableObject();
            SetAngleTarget(angleTarget);
        }

        protected override void OnDisable()
        {
            base.OnDisable();
            ManageInteractableListeners(false);
            ManageGrabbableListeners(false);
            if (createInteractableObject)
            {
                Destroy(controlInteractableObject);
            }
            RemoveParentContainer();
        }

        protected override void EmitEvents()
        {
            bool valueChanged = Mathf.Abs(GetValue() - previousValue) >= equalityFidelity;

            if (valueChanged)
            {
                ControllableEventArgs payload = EventPayload();
                float currentAngle = GetValue();
                float minThreshold = angleLimits.minimum + minMaxThresholdAngle;
                float maxThreshold = angleLimits.maximum - minMaxThresholdAngle;
                stillResting = false;

                OnValueChanged(payload);

                if (currentAngle >= maxThreshold && !AtMaxLimit())
                {
                    atMaxLimit = true;
                    OnMaxLimitReached(payload);
                }
                else if (currentAngle <= (angleLimits.minimum + minMaxThresholdAngle) && !AtMinLimit())
                {
                    atMinLimit = true;
                    OnMinLimitReached(payload);
                }
                else if (currentAngle > minThreshold && currentAngle < maxThreshold)
                {
                    if (AtMinLimit())
                    {
                        OnMinLimitExited(payload);
                    }
                    if (AtMaxLimit())
                    {
                        OnMaxLimitExited(payload);
                    }
                    atMinLimit = false;
                    atMaxLimit = false;
                }

                previousValue = GetValue();
            }

            if (!stillResting && IsResting() && !valueChanged)
            {
                OnRestingPointReached(EventPayload());
                stillResting = true;
            }
        }

        protected override ControllableEventArgs EventPayload()
        {
            ControllableEventArgs e = base.EventPayload();
            e.value = (useStepAsValue ? GetStepValue(GetValue()) : GetValue());
            return e;
        }

        protected virtual void SetupParentContainer()
        {
            if (hingePoint != null)
            {
                hingePoint.transform.SetParent(transform.parent);
                Vector3 storedScale = transform.localScale;
                rotatorContainer = new GameObject(VRTK_SharedMethods.GenerateVRTKObjectName(true, name, "Controllable", "ArtificialBased", "RotatorContainer"));
                rotatorContainer.transform.SetParent(transform.parent);
                rotatorContainer.transform.localPosition = transform.localPosition;
                rotatorContainer.transform.localRotation = transform.localRotation;
                rotatorContainer.transform.localScale = Vector3.one;
                transform.SetParent(rotatorContainer.transform);
                rotatorContainer.transform.localPosition = hingePoint.localPosition;
                transform.localPosition = -hingePoint.localPosition;
                transform.localScale = storedScale;
                hingePoint.transform.SetParent(transform);
            }
        }

        protected virtual void RemoveParentContainer()
        {
            if (rotatorContainer != null && gameObject.activeInHierarchy)
            {
                transform.SetParent(rotatorContainer.transform.parent);
                Destroy(rotatorContainer);
            }
        }

        protected virtual void SetupInteractableObject()
        {
            controlInteractableObject = GetComponent<VRTK_InteractableObject>();
            if (controlInteractableObject == null)
            {
                controlInteractableObject = rotatorContainer.AddComponent<VRTK_InteractableObject>();
                controlInteractableObject.isGrabbable = true;
                controlInteractableObject.ignoredColliders = (onlyInteractWith.Length > 0 ? VRTK_SharedMethods.ColliderExclude(GetComponentsInChildren<Collider>(true), VRTK_SharedMethods.GetCollidersInGameObjects(onlyInteractWith, true, true)) : new Collider[0]);
                SetupGrabMechanic();
                SetupSecondaryAction();
            }
            ManageInteractableListeners(true);
        }

        protected virtual void SetupGrabMechanic()
        {
            if (controlInteractableObject != null)
            {
                controlGrabAttach = controlInteractableObject.gameObject.AddComponent<VRTK_RotateTransformGrabAttach>();
                SetGrabMechanicParameters();
                controlInteractableObject.grabAttachMechanicScript = controlGrabAttach;
                ManageGrabbableListeners(true);
            }
        }

        protected virtual void SetGrabMechanicParameters()
        {
            if (controlGrabAttach != null)
            {
                controlGrabAttach.precisionGrab = precisionGrab;
                controlGrabAttach.detachDistance = detachDistance;
                controlGrabAttach.rotationAction = rotationAction;
                controlGrabAttach.rotateAround = (VRTK_RotateTransformGrabAttach.RotationAxis)operateAxis;
                controlGrabAttach.rotationFriction = grabbedFriction;
                controlGrabAttach.releaseDecelerationDamper = releasedFriction;
                controlGrabAttach.angleLimits = angleLimits;
            }
        }

        protected virtual void SetupSecondaryAction()
        {
            if (controlInteractableObject != null)
            {
                controlSecondaryGrabAction = controlInteractableObject.gameObject.AddComponent<VRTK_SwapControllerGrabAction>();
                controlInteractableObject.secondaryGrabActionScript = controlSecondaryGrabAction;
            }
        }

        protected virtual void ManageInteractableListeners(bool state)
        {
            if (controlInteractableObject != null)
            {
                if (state)
                {
                    controlInteractableObject.InteractableObjectGrabbed += InteractableObjectGrabbed;
                    controlInteractableObject.InteractableObjectUngrabbed += InteractableObjectUngrabbed;
                }
                else
                {
                    controlInteractableObject.InteractableObjectGrabbed -= InteractableObjectGrabbed;
                    controlInteractableObject.InteractableObjectUngrabbed -= InteractableObjectUngrabbed;
                }
            }
        }

        protected virtual void InteractableObjectGrabbed(object sender, InteractableObjectEventArgs e)
        {
            CheckLock();
        }

        protected virtual void InteractableObjectUngrabbed(object sender, InteractableObjectEventArgs e)
        {
            rotationReset = false;
            ForceRestingPosition();
            ForceSnapToStep();
        }

        protected virtual void CheckLock()
        {
            if (controlGrabAttach != null)
            {
                SetGrabMechanicParameters();
                controlGrabAttach.angleLimits = (isLocked ? Limits2D.zero : angleLimits);
            }
        }

        protected virtual void ManageGrabbableListeners(bool state)
        {
            if (controlGrabAttach != null)
            {
                if (state)
                {
                    controlGrabAttach.AngleChanged += GrabMechanicAngleChanged;
                }
                else
                {
                    controlGrabAttach.AngleChanged -= GrabMechanicAngleChanged;
                }
            }
        }

        protected virtual void GrabMechanicAngleChanged(object sender, RotateTransformGrabAttachEventArgs e)
        {
            if (controlInteractableObject != null && !controlInteractableObject.IsGrabbed())
            {
                ForceRestingPosition();
                ForceSnapToStep();
            }
            if (processAtEndOfFrame == null)
            {
                EmitEvents();
            }
        }

        protected virtual void SetAngleWithNormalizedValue(float normalizedTargetAngle)
        {
            if (controlGrabAttach != null)
            {
                float positionOnAxis = Mathf.Lerp(controlGrabAttach.angleLimits.minimum, controlGrabAttach.angleLimits.maximum, Mathf.Clamp01(normalizedTargetAngle));
                SetRotation(positionOnAxis, releasedFriction * 0.1f);
            }
        }

        protected virtual void ForceRestingPosition()
        {
            if (!rotationReset && controlGrabAttach != null)
            {
                float currentValue = GetValue();
                if (currentValue <= (restingAngle + forceRestingAngleThreshold) && currentValue >= (restingAngle - forceRestingAngleThreshold))
                {

                    SetRotation(restingAngle, releasedFriction * 0.1f);
                }
            }
        }

        protected virtual void ForceSnapToStep()
        {
            bool validSnap = (snapToStep && controlGrabAttach != null && !IsGrabbed() && !rotationReset);
            bool notAtSnapValue = (Mathf.Abs(GetValue() - GetAngleFromStepValue(GetStepValue(GetValue()))) >= equalityFidelity);
            if (validSnap && notAtSnapValue)
            {
                SetAngleTargetWithStepValue(GetStepValue(GetValue()));
            }
        }

        protected virtual void SetRotation(float newAngle, float speed)
        {
            rotationReset = true;
            controlGrabAttach.SetRotation(newAngle, speed);
        }

        protected virtual bool IsGrabbed()
        {
            return (controlInteractableObject != null && controlInteractableObject.IsGrabbed());
        }
    }
}


text:
require 'spec_helper'

describe Line do

  it "positive outcome if the lines are same" do
    first_line = Line.new(Coordinate.new(1,1),Coordinate.new(1,2))
    second_line = Line.new(Coordinate.new(1,1),Coordinate.new(1,2))
    expect(first_line).to eq(second_line)
  end

  it "works fine when the coordinates are swapped" do
    first_line = Line.new(Coordinate.new(1,1),Coordinate.new(1,2))
    second_line = Line.new(Coordinate.new(1,2),Coordinate.new(1,1))
    expect(first_line).to eq(second_line)
  end

  it "negative outcome when coordinates are not same" do
    first_line = Line.new(Coordinate.new(10,1),Coordinate.new(1,2))
    second_line = Line.new(Coordinate.new(1,11),Coordinate.new(1,2))
    expect(first_line == second_line).to eq(false)
  end
  it "checks if object_id's are same and states the two lines same " do
  first_line = Line.new(Coordinate.new(10,1),Coordinate.new(1,2))
  expect(first_line).to eq(first_line)
  end

  it "should give length as 5 for line from (0,0) to (3,4)" do
    line = Line.new(Coordinate.new(0,0),Coordinate.new(3,4))
    expect(line.length).to eq(5.0)
  end

end


text:
/**
 * NETCONF controller implementations.
 */
package org.onosproject.netconf.ctl.impl;


text:
"""Common functions used by tests"""

import tempfile

import omnilint
import omnilint.reporters as reporters

def checkthis(checkername, fileext, contents):
    ol = omnilint.Omnilint()
    ol.checker_load(checkername)
    with tempfile.NamedTemporaryFile(suffix=fileext) as tmp:
        tmp.write(contents.encode("utf-8"))
        tmp.flush()
        with reporters.ReporterList() as reporter:
            ol.analyse_file(reporter, tmp.name)
            for e in reporter.list:
                e.pop("file")
            return reporter.list


text:
package uk.ac.ebi.fgpt.lode.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.ac.ebi.fgpt.lode.utils.DatasourceProvider;
import virtuoso.jdbc4.VirtuosoConnectionPoolDataSource;
import virtuoso.jdbc4.VirtuosoDataSource;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.ConnectionPoolDataSource;
import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * @author Simon Jupp
 * @date 19/07/2013
 * Functional Genomics Group EMBL-EBI
 */
public class VirtuosoDatasourceProvider implements DatasourceProvider {

    private Logger logger = LoggerFactory.getLogger(getClass());

    private VirtuosoDataSource virtuosoSource = null;

    public VirtuosoDatasourceProvider(){

        // Get the DataSource
        if (virtuosoSource == null) {
            try {
                Context context = (Context) (new InitialContext()).lookup("java:comp/env");
                virtuosoSource = (VirtuosoDataSource) context.lookup("jdbc/virtuoso");

            } catch (NamingException e) {
                throw new IllegalStateException("Virtuoso JNDI datasource not configured: " + e.getMessage());
            }
        }
    }

    public VirtuosoDatasourceProvider(String endpointUrl, int port){

        // Get the DataSource
        if (virtuosoSource == null) {
            try {
                Context context = (Context) (new InitialContext()).lookup("java:comp/env");
                virtuosoSource = (VirtuosoDataSource) context.lookup("jdbc/virtuoso");

                virtuosoSource.setServerName(endpointUrl);
                virtuosoSource.setPortNumber(port);
            } catch (NamingException e) {
                throw new IllegalStateException("Virtuoso JNDI datasource not configured: " + e.getMessage());
            }
        }
    }

    public DataSource getDataSource() throws SQLException {
        return virtuosoSource;
    }

}


text:
set -e -u -x

## Variables -----------------------------------------------------------------
export BOOTSTRAP_ANSIBLE=${BOOTSTRAP_ANSIBLE:-"yes"}
export BOOTSTRAP_AIO=${BOOTSTRAP_AIO:-"yes"}
export RUN_PLAYBOOKS=${RUN_PLAYBOOKS:-"yes"}
export RUN_TEMPEST=${RUN_TEMPEST:-"yes"}
# Ansible options
export ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-"-v"}
# Deployment options
export DEPLOY_HOST=${DEPLOY_HOST:-"yes"}
export DEPLOY_LB=${DEPLOY_LB:-"yes"}
export DEPLOY_INFRASTRUCTURE=${DEPLOY_INFRASTRUCTURE:-"yes"}
export DEPLOY_LOGGING=${DEPLOY_LOGGING:-"yes"}
export DEPLOY_OPENSTACK=${DEPLOY_OPENSTACK:-"yes"}
export DEPLOY_SWIFT=${DEPLOY_SWIFT:-"yes"}
export DEPLOY_TEMPEST=${DEPLOY_TEMPEST:-"yes"}
# Limit the gate check to only performing one attempt, unless already set
export MAX_RETRIES=${MAX_RETRIES:-"2"}
# tempest and testr options, default is to run tempest in serial
export RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS:-'--serial'}
export TESTR_OPTS=${TESTR_OPTS:-''}

## Functions -----------------------------------------------------------------
info_block "Checking for required libraries." 2> /dev/null || source $(dirname ${0})/scripts-library.sh

## Main ----------------------------------------------------------------------

# Adjust settings based on the Cloud Provider info in OpenStack-CI
if [ -f /etc/nodepool/provider -a -s /etc/nodepool/provider ]; then
  source /etc/nodepool/provider

  if [[ ${NODEPOOL_PROVIDER} == "rax"* ]]; then

    # Set the Ubuntu Repository to the RAX Mirror
    export UBUNTU_REPO="http://mirror.rackspace.com/ubuntu"
    export UBUNTU_SEC_REPO="${UBUNTU_REPO}"

  elif [[ ${NODEPOOL_PROVIDER} == "hpcloud"* ]]; then

    # Set the Ubuntu Repository to the HP Cloud Mirror
    export UBUNTU_REPO="http://${NODEPOOL_AZ}.clouds.archive.ubuntu.com/ubuntu"
    export UBUNTU_SEC_REPO="${UBUNTU_REPO}"

  fi

  # Reduce container affinities as Liberty appears to consume
  #  a greater volume of resources, causing greater numbers
  #  of failures with the default affinities.
  for container_type in rabbit_mq repo horizon keystone; do
    export "NUM_${container_type}_CONTAINER=1"
  done

fi

# Bootstrap an AIO setup if required
if [ "${BOOTSTRAP_AIO}" == "yes" ]; then
  source $(dirname ${0})/bootstrap-aio.sh
fi

# Bootstrap ansible if required
if [ "${BOOTSTRAP_ANSIBLE}" == "yes" ]; then
  source $(dirname ${0})/bootstrap-ansible.sh
fi

# Make the /openstack/log directory for openstack-infra gate check log publishing
mkdir -p /openstack/log

# Implement the log directory link for openstack-infra log publishing
ln -sf /openstack/log $(dirname ${0})/../logs

# Create ansible logging directory and add in a log file entry into ansible.cfg
mkdir -p /openstack/log/ansible-logging
sed -i '/\[defaults\]/a log_path = /openstack/log/ansible-logging/ansible.log' $(dirname ${0})/../playbooks/ansible.cfg

# Enable detailed task profiling
sed -i '/\[defaults\]/a callback_plugins = plugins/callbacks' $(dirname ${0})/../playbooks/ansible.cfg

# Disable Ansible color output
sed -i 's/nocolor.*/nocolor = 1/' $(dirname ${0})/../playbooks/ansible.cfg

# Enable debug logging for all services to make failure debugging easier
echo "debug: True" | tee -a /etc/openstack_deploy/user_variables.yml

# NOTE: hpcloud-b4's eth0 uses 10.0.3.0/24, which overlaps with the
#       lxc_net_address default
# TODO: We'll need to implement a mechanism to determine valid lxc_net_address
#       value which will not overlap with an IP already assigned to the host.
echo "lxc_net_address: 10.255.255.1" | tee -a /etc/openstack_deploy/user_variables.yml
echo "lxc_net_netmask: 255.255.255.0" | tee -a /etc/openstack_deploy/user_variables.yml
echo "lxc_net_dhcp_range: 10.255.255.2,10.255.255.253" | tee -a /etc/openstack_deploy/user_variables.yml

# Disable the python output buffering so that jenkins gets the output properly
export PYTHONUNBUFFERED=1

# Run the ansible playbooks if required
if [ "${RUN_PLAYBOOKS}" == "yes" ]; then
  # Set-up our tiny awk script.
  strip_debug="
    !/(^[ 0-9|:.-]+<[0-9.]|localhost+>)|Extracting/ {
      gsub(/{.*/, \"\");
      gsub(/\\n.*/, \"\");
      gsub(/\=\>.*/, \"\");
      print
    }
  "
  set -o pipefail
  bash $(dirname ${0})/run-playbooks.sh | awk "${strip_debug}"
  set +o pipefail
fi

# Log some data about the instance and the rest of the system
log_instance_info

# Run the tempest tests if required
if [ "${RUN_TEMPEST}" == "yes" ]; then
  source $(dirname ${0})/run-tempest.sh
fi

exit_success


text:
package org.jb2011.lnf.beautyeye.table;

import java.awt.Dimension;

import javax.swing.JComponent;
import javax.swing.UIDefaults;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTableUI;

/**
 * JTable的UI实现类.
 *
 * @author Jack Jiang(jb2011@163.com)
 */
public class BETableUI extends BasicTableUI {

    UIDefaults defaultRenderersByColumnClass;

    public static ComponentUI createUI(JComponent c) {
        return new BETableUI();
    }

    /**
     * Initialize JTable properties, e.g. font, foreground, and background. The
     * font, foreground, and background properties are only set if their current
     * value is either null or a UIResource, other properties are set if the
     * current value is null.
     *
     * @see #installUI
     */
    @Override
    protected void installDefaults() {
        super.installDefaults();
        //行高设置为25看起来会舒服些
        table.setRowHeight(25);
        //不显示垂直的网格线
        table.setShowVerticalLines(false);
        //设置单元格间的空白(默认是1个像素宽和高)
        //说明:设置本参数可以实现单元格间的间隔空制,间隔里通常是实现网格线的绘制,但
        //网格维绘制与否并不影响间隔的存在(如果间隔存在但网格线不绘的话它就是是透明的空
        //间),参数中width表示水平间隔,height表示垂直间隔,为0则表示没有间隔
        table.setIntercellSpacing(new Dimension(0, 1));
    }
}


text:
ENT.Type			= "anim"
ENT.Base			= "base_anim"--"base_gmodentity"

ENT.PrintName		= "Billboard"
ENT.Author			= "Lexi"
ENT.Contact			= ""
ENT.Purpose			= ""
ENT.Instructions	= ""

ENT.Spawnable		= true
ENT.AdminSpawnable	= true
ENT.RenderGroup		= RENDERGROUP_TRANSLUCENT;
ENT.Category		= "Lexi's Dev Stuff"

if SERVER then
	AddCSLuaFile( "shared.lua" )
	AddCSLuaFile( "cl_init.lua" )
	function ENT:SpawnFunction( ply, tr )
		if not ( tr.Hit and IsValid(tr.Entity) and tr.Entity:GetModel():find"billboard") then return end
		local ent = ents.Create"sent_billboard"
		ent:SetPos( tr.Entity:GetPos() + tr.Entity:GetForward() * 3)
		ent:SetAngles( tr.Entity:GetAngles() )
		ent:Spawn()
		ent:Activate()
		local phys = ent:GetPhysicsObject()
		if (phys:IsValid()) then
			phys:EnableMotion(false)
		end
		--ent:SetParent(tr.Entity)
		return ent
	end

	function ENT:Initialize()
		self:SetModel"models/props_wasteland/interior_fence002d.mdl"
		self:PhysicsInit( SOLID_VPHYSICS)--NONE )
		self:SetMoveType( MOVETYPE_VPHYSICS)--NONE )
		self:SetSolid( SOLID_VPHYSICS)--NONE )
		--self:SetCollisionGroup(COLLISION_GROUP_WORLD)
		self:DrawShadow(false)
		self:SetNWString("bb_Text1","WARNING! Idiot in charge!")
		self:SetNWString("bb_Text2","He forgot to set the text!")
	end
	function ENT:SetText(line1,line2)
		self:SetNWString("bb_Text1",line1)
		self:SetNWString("bb_Text2",line2)
	end
	return
end
for i = 50,25,-1 do
	surface.CreateFont("bb"..i, {font="Impact", size=i*2, weight=400})
end
local rot = Vector(-90, 90, 0)
ENT.Scale	  = 0.5
ENT.Width	  = 225
ENT.Height	  = 122
ENT.ScreenPos = 0-- -2.6
ENT.BackgroundMaterial = surface.GetTextureID "paperboy"--"Brick/brickfloor001a"--
ENT.vals = {}
function ENT:Initialize()
	self.Width  = self.Width  * 1/self.Scale
	self.Height = self.Height * 1/self.Scale
end
function ENT:GetTextSize(text,pos,new,force)
	local w,h,n = 0,0,0
	if not self.vals[pos] or new then
		if force then
			surface.SetFont("bb"..force)
			w,h = surface.GetTextSize(text)
			n = force
		else
			for i = 50,25,-1 do
				n = i
				--surface.CreateFont("Trebuchet", i, 400, true,false, "bb"..i )
				surface.SetFont("bb"..i)
				w,h = surface.GetTextSize(text)
				if not (w and h) then
					error("wtf? ",w," ",h," ",n)
				end
				if w < self.Width - 5 then
					break
				end
			end
		end
		self.vals[pos] = {w,h,n}
	else
		w,h,n = self.vals[pos][1],self.vals[pos][2],force and force or self.vals[pos][3]
	end
	if not (w and h and n) then
		print(w,h,n)
	end
	return w,h,n
end
function ENT:CheckTextLength(text)
	surface.SetFont("bb25")
	return surface.GetTextSize(text) > self.Width - 5
end
function ENT:GetMaxTextLength(text)
	for i = text:len() -1,1,-1 do
		text = text:sub(1,-2)
		if not self:CheckTextLength(text) then
			return i
		end
	end
end
--local maxWidth = 21
function ENT:ProcessText(text,new,pos)
	if text == "" then text = " " end
	pos = pos or 1
	if self:CheckTextLength(text) then
		local text1,text2
		local maxWidth = self:GetMaxTextLength(text)
		text1,text2 = text:sub(1,maxWidth),text:sub(maxWidth+1,-1)
		if self:CheckTextLength(text2)then
			local maxWidth = self:GetMaxTextLength(text2)
			text2 = text2:sub(1,maxWidth)
		end
		local w1,h1,n1 = self:GetTextSize(text1,pos,new)
		local w2,h2,n2 = self:GetTextSize(text2,pos*2,new,n1)
		surface.SetFont("bb"..n1)
		if pos < 0 then
			surface.SetTextPos(w1 * -0.5, self.Height * -0.25 - h1 )
		else
			surface.SetTextPos(w1 * -0.5, self.Height *  0.25 - h1 )
		end
		surface.DrawText(text1)
		surface.SetFont("bb"..n2)
		if pos < 0 then
			surface.SetTextPos(w2 * -0.5,self.Height * -0.25)
		else
			surface.SetTextPos(w2 * -0.5,self.Height *  0.25)
		end
		surface.DrawText(text2)
	else
		local w1,h1,n1 = self:GetTextSize(text,pos,new)
		if pos < 0 then
			surface.SetTextPos(w1 * -0.5,self.Height * -0.25 - h1 * 0.5)
		else
			surface.SetTextPos(w1 * -0.5,self.Height *  0.25 - h1 * 0.5)
		end
		surface.DrawText(text)
	end
end
function ENT:Think()
	if self.MyNextThink and self.MyNextThink > CurTime() then return end
	if self:GetNWString "bb_Text1" ~= self.text1 then
		self.text1 = self:GetNWString "bb_Text1"
		self.text1U = true
	end
	if self:GetNWString "bb_Text2" ~= self.text2 then
		self.text2 = self:GetNWString "bb_Text2"
		self.text2U = true
	end
	self.MyNextThink = CurTime() + 1
end
function ENT:Draw()
	--self:DrawModel()
	local pos = self:GetPos() + self:GetForward() * self.ScreenPos
	local ang = self:GetAngles()
	ang:RotateAroundAxis(ang:Right(), 	rot.x)
	ang:RotateAroundAxis(ang:Up(), 		rot.y)
	ang:RotateAroundAxis(ang:Forward(), rot.z)
--	self:SetRenderBounds(self.Width*-0.5
	cam.Start3D2D(pos, ang,self.Scale)
		--render.SuppressEngineLighting( true )
		surface.SetDrawColor(220, 220, 220, 255)
		surface.DrawRect(self.Width * -0.5,self.Height * -0.5,self.Width,self.Height)
		--[
		surface.SetDrawColor(225, 225, 225, 255)
		surface.SetTexture(self.BackgroundMaterial)
		surface.DrawTexturedRect(self.Width * -0.5,self.Height * -0.5,self.Width,self.Height)
		--]]
		--[[
		surface.SetDrawColor(0,0,0,255)
		surface.DrawLine(self.Width * -0.5,0,self.Width*0.5,0)
		surface.SetDrawColor(255,0,0,255)
		surface.DrawLine(self.Width * -0.5,self.Height *0.25,self.Width*0.5,self.Height *0.25)
		surface.DrawLine(self.Width * -0.5,self.Height *-0.25,self.Width*0.5,self.Height *-0.25)
		--]]
		surface.SetTextColor(0,0,0,255)
		self:ProcessText(self.text1,self.text1U,-1)
	--	surface.SetTextColor(0,255,0,255)
		self:ProcessText(self.text2,self.text2U,1)
		--render.SuppressEngineLighting( false )
	cam.End3D2D()

end


text:
#region MIT License

#endregion

namespace System.Data.H2.Api
{

    [Serializable,Flags]
    public enum TriggerTypes
    {
        /// <summary>
        /// The trigger is called for Insert statements.
        /// </summary>
        Insert = 1,
        /// <summary>
        /// The trigger is called for Update statements.
        /// </summary>
        Update = 2,
        /// <summary>
        /// The trigger is called for Delete statements.
        /// </summary>
        Delete = 4,
    }

    /// <summary>
    /// A class that implements this abstract class can be used as a trigger.
    /// </summary>
    public abstract class H2Trigger : org.h2.api.Trigger
    {
        void org.h2.api.Trigger.fire(java.sql.Connection conn, object[] oldRow, object[] newRow)
        {
            H2Connection connection = new H2Connection(conn);
            OnFire(connection, oldRow, newRow);
        }

		protected abstract void OnClose();

		void org.h2.api.Trigger.close()
		{
			OnClose();
		}

		protected abstract void OnRemove();

		void org.h2.api.Trigger.remove()
		{
			OnRemove();
		}

        /// <summary>
        /// This method is called for each triggered action.
        /// </summary>
        /// <param name="connection"> a connection to the database</param>
        /// <param name="oldRow">the old row, or null if no old row is available (for INSERT)</param>
        /// <param name="newRow">the new row, or null if no new row is available (for DELETE)</param>
        /// <remarks>throw SQLException if the operation must be undone</remarks>
        protected abstract void OnFire(H2Connection connection, object[] oldRow, object[] newRow);

        void org.h2.api.Trigger.init(java.sql.Connection conn, String schemaName, String triggerName, String tableName, bool before, int type)
        {
            H2Connection connection = new H2Connection(conn);
            OnInit(connection, schemaName, triggerName, tableName, before, (TriggerTypes)type);
        }
        /// <summary>
        /// This method is called by the database engine once when initializing the trigger.
        /// </summary>
        /// <param name="connection">a connection to the database</param>
        /// <param name="schemaName">the name of the schema</param>
        /// <param name="triggerName">the name of the trigger used in the CREATE TRIGGER statement</param>
        /// <param name="tableName">the name of the table</param>
        /// <param name="before">whether the fire method is called before or after the operation is performed</param>
        /// <param name="type">the operation type: INSERT, UPDATE, or DELETE</param>
        protected abstract void OnInit(H2Connection connection, String schemaName, String triggerName, String tableName, bool before, TriggerTypes type);
    }

}


text:
'use strict';

var _ = require('lodash');

module.exports = function(grunt) {

    // Please see the Grunt documentation for more information regarding task
    // creation: http://gruntjs.com/creating-tasks

    grunt.registerMultiTask('node_startup', 'Generates a unix startup file for your node application.', function() {

        //Merge default options with custom ones
        var pkg = grunt.config.get('pkg') || {
            main: "appR.js",
            name: "app"
        };
        var node_app = pkg.main || "app.js",
            node_name = pkg.name || "app";

        var app_dir = process.cwd(),
            pid_dir = app_dir + "/pid",
            pid_file = node_name + ".pid",
            log_dir = app_dir + "/log",
            log_file = node_name + ".log",
            node_exec = "$(which node)";
        var options = this.options({
                node_app: node_app,
                app_dir: app_dir,
                pid_dir: pid_dir,
                pid_file: pid_file,
                log_dir: log_dir,
                log_file: log_file,
                node_exec: node_exec,
                shebang: "/bin/sh",
                vars: {
                    CONFIG_DIR: app_dir,
                    PORT: 3000,
                    NODE_ENV: "production",
                }
        });

        _.extend(options, this.options());

        //Reads the startup sh template file
        var data = grunt.file.read('template/node-app');
        var re = null;
        grunt.log.subhead("Generating startup script...");
        // for each options, replace by the value in the file
        for (var key in options) {
            if (key !== 'vars') {
                grunt.log.writeln(key + " set to " + options[key]);
                re = new RegExp("{{"+key+"}}", 'g');
                data = data.replace(re, options[key]);
            }
        }
        //Generates a string with the env vars and put it in the right place
        var vars_str = "";
        grunt.log.subhead("Configuring env vars...");
        for (var key in options.vars) {
            grunt.log.writeln(key + " = " + options.vars[key]);
            vars_str += key + "=" + "\"" + options.vars[key] + "\" ";
        }
        data = data.replace("[[vars]]", vars_str);

        //Gets the dest folder and writes the generated file
        var dest = this.files[0] ? this.files[0].orig.dest : null;
        if (dest) {
            grunt.file.write(dest + "/" + node_name, data);
        } else {
            grunt.log.error("No destination folder in options");
            return false;
        }
    });
};


text:
I tried poking about with docker based SuperTidebox and variants for a long time but could never become comfortable with the emacs bindings. In the end I decided to setup a little plain and simple VM for myself.

Following instructions from [Installing arch on a Virtualbox VM](https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/)

The only change is that I used GPT

which requires additional steps in the form of

> Create a mebibyte partition (+1M with fdisk or gdisk) on the disk with no file system and with partition type GUID 21686148-6449-6E6F-744E-656564454649.

> Select partition type BIOS boot for cfdisk

from https://wiki.archlinux.org/index.php/GRUB

## Installing SC

sudo pacman -S supercollider sc3-plugins git

## Haskell install

http://nanxiao.me/en/set-up-haskell-development-environment-on-arch-linux/

sudo pacman -S cabal-install


text:
import autoslug.fields
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ("cases", "0009_auto_20200222_1648"),
    ]

    operations = [
        migrations.AlterField(
            model_name="case",
            name="name",
            field=models.CharField(max_length=100, verbose_name="Name"),
        ),
        migrations.AlterField(
            model_name="case",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                editable=False,
                max_length=110,
                populate_from="name",
                unique=True,
                verbose_name="Slug",
            ),
        ),
    ]


text:
**see migration notes below**

* [check types when parsing assignments and equality operations](https://github.com/getquill/quill/pull/532)
* [Update finagle-mysql to finagle 6.37.0](https://github.com/getquill/quill/pull/549/files)
* [Split quill-async into quill-async-mysql and quill-async-postgres](https://github.com/getquill/quill/pull/540)
* [cql: support `+` operator](https://github.com/getquill/quill/pull/530)
* [cassandra context constructor with ready-made Cluster](https://github.com/getquill/quill/pull/529)
* [support forced nested queries](https://github.com/getquill/quill/pull/527)
* [support mapped encoding definition without a context instance](https://github.com/getquill/quill/pull/526)
* [fix class cast exception for returned values](https://github.com/getquill/quill/pull/536)
* [fix free variables detection for the rhs of joins](https://github.com/getquill/quill/pull/528)

### Migration notes

- `mappedEncoding` has been renamed to `MappedEncoding`.
- The way we add async drivers has been changed. To add mysql async to your project use `quill-async-mysql` and for postgre async `quill-async-postgres`. It is no longer necessary to add `quill-async` by yourself.
- Action assignments and equality operations are now typesafe. If there's a type mismatch between the operands, the quotation will not compile.

# 0.9.0 - 22-Aug-2016

**see migration notes below**

* [new encoding, macros refactoring, and additional fixes](https://github.com/getquill/quill/pull/512)
* [Refactor generated to returning keyword in order to return the correct type](https://github.com/getquill/quill/pull/444)
* [Allow finagle-mysql to use Long with INT columns](https://github.com/getquill/quill/pull/467)
* [create sub query if aggregation on distinct query](https://github.com/getquill/quill/pull/472)
* [upgrade dependency to finagle 6.36.0](https://github.com/getquill/quill/pull/479)
* [Make decoder function public](https://github.com/getquill/quill/pull/487)
* [set the scope of all cassandra context type definitions to public](https://github.com/getquill/quill/pull/492)
* [make the cassandra decoder fail when encountering a column with value null](https://github.com/getquill/quill/pull/499)
* [fix Option.{isEmpty, isDefined, nonEmpty} show on action.filter](https://github.com/getquill/quill/pull/505)
* [Encoder fix](https://github.com/getquill/quill/pull/503/files)
* [enclose operand-queries of SetOperation in parentheses](https://github.com/getquill/quill/pull/510)

### Migration notes

* The fallback mechanism that looks for implicit encoders defined in the context instance has been removed. This means that if you don't `import context._`, you have to change the specific imports to include the encoders in use.
* `context.run` now receives only one parameter. The second parameter that used to receive runtime values now doesn't exist any more. Use [`lift` or `liftQuery`](https://github.com/getquill/quill/#bindings) instead.
* Use [`liftQuery` + `foreach`](https://github.com/getquill/quill/#bindings) to perform batch actions and define contains/in queries.
* `insert` now always receives a parameter, that [can be a case class](https://github.com/getquill/quill/#actions).
- Non-lifted collections aren't supported anymore. Example: `query[Person].filter(t => List(10, 20).contains(p.age))`. Use `liftQuery` instead.
* `schema(_.generated())` has been replaced by [`returning`](https://github.com/getquill/quill/#schema).

# 0.8.0 / 17-Jul-2016

**see migration notes below**

* [introduce contexts](https://github.com/getquill/quill/pull/417)
* [sqlite support](https://github.com/getquill/quill/pull/449)
* [scala.js support](https://github.com/getquill/quill/pull/452)
* [support `toInt` and `toLong`](https://github.com/getquill/quill/pull/428)
* [quill-jdbc: support nested `transaction` calls](https://github.com/getquill/quill/pull/430)
* [fix bind order for take/drop with extra param](https://github.com/getquill/quill/pull/429)
* [quotation: allow lifting of `AnyVal`s ](https://github.com/getquill/quill/pull/421)
* [make liftable values work for the cassandra module](https://github.com/getquill/quill/pull/425)
* [apply intermediate map before take/drop](https://github.com/getquill/quill/pull/419)
* [support decoding of optional single-value case classes](https://github.com/getquill/quill/pull/420)
* [make type aliases for `run` results public](https://github.com/getquill/quill/pull/440)
* [fail compilation if query is defined outside a `quote`](https://github.com/getquill/quill/pull/433)
* [fix empty sql string](https://github.com/getquill/quill/pull/443)

### Migration notes

This version [introduces `Context`](https://github.com/getquill/quill/pull/417) as a relacement for `Source`. This change makes the quotation creation dependent on the context to open the path for a few refactorings and improvements we're planning to work on before the `1.0-RC1` release.

Migration steps:

- Remove any import that is not `import io.getquill._`
- Replace the `Source` creation by a `Context` creation. See the [readme](https://github.com/getquill/quill#contexts) for more details. All types necessary to create the context instances are provided by `import io.getquill._`.
- Instead of importing from `io.getquill._` to create quotations, import from you context instance `import myContext._`. The context import will provide all types and methods to interact with quotations and the database.
- See the documentation about [dependent contexts](https://github.com/getquill/quill#dependent-contexts) in case you get compilation errors because of type mismatches.

# 0.7.0 / 2-Jul-2016

* [transform quoted reference](https://github.com/getquill/quill/pull/416)
* [simplify `finagle-mysql` action result type](https://github.com/getquill/quill/pull/358)
* [provide default values for plain-sql query execution](https://github.com/getquill/quill/pull/360)
* [quotation: fix binding conflict](https://github.com/getquill/quill/pull/363)
* [don't consider `?` a binding if inside a quote](https://github.com/getquill/quill/pull/361)
* [fix query generation for wrapped types](https://github.com/getquill/quill/pull/364)
* [use querySingle/query for parametrized query according to return type](https://github.com/getquill/quill/pull/375)
* [remove implicit ordering](https://github.com/getquill/quill/pull/378)
* [remove implicit from max and min](https://github.com/getquill/quill/pull/384)
* [support explicit `Predef.ArrowAssoc` call](https://github.com/getquill/quill/pull/386)
* [added handling for string lists in ClusterBuilder](https://github.com/getquill/quill/pull/395)
* [add naming strategy for pluralized table names](https://github.com/getquill/quill/pull/396)
* [transform ConfiguredEntity](https://github.com/getquill/quill/pull/409)

# 0.6.0 / 9-May-2016

* [explicit bindings using `lift`](https://github.com/getquill/quill/pull/335/files#diff-04c6e90faac2675aa89e2176d2eec7d8R157)
* [Code of Conduct](https://github.com/getquill/quill/pull/296)
* [dynamic type parameters](https://github.com/getquill/quill/pull/351)
* [support contains for Traversable](https://github.com/getquill/quill/pull/290)
* [`equals` support](https://github.com/getquill/quill/pull/328)
* [Always return List for any type of query](https://github.com/getquill/quill/pull/324)
* [quilll-sql: support value queries](https://github.com/getquill/quill/pull/354)
* [quill-sql: `in`/`contains` - support empty sets](https://github.com/getquill/quill/pull/329)
* [Support `Ord` quotation](https://github.com/getquill/quill/pull/301)
* [`blockParser` off-by-one error](https://github.com/getquill/quill/pull/292)
* [show ident instead of indent.toString](https://github.com/getquill/quill/pull/307)
* [decode bit as boolean](https://github.com/getquill/quill/pull/308)

# 0.5.0 / 17-Mar-2016

* [Schema mini-DSL and generated values](https://github.com/getquill/quill/pull/226/files#diff-04c6e90faac2675aa89e2176d2eec7d8R212)
* [Support for inline vals in quotation blocks](https://github.com/getquill/quill/pull/271/files#diff-02749abf4d0d51be99715cff7074bc9eR775)
* [Support for Option.{isEmpty, nonEmpty, isDefined}](https://github.com/getquill/quill/pull/238/files#diff-02749abf4d0d51be99715cff7074bc9eR688)
* [Tolerant function parsing in option operation](https://github.com/getquill/quill/pull/243/files#diff-6858983f3617753cfb9852426edaa121R481)
* [quill-sql: rename properties and assignments](https://github.com/getquill/quill/pull/250)
* [quill-cassandra: rename properties and assignments](https://github.com/getquill/quill/pull/254)
* [Fix log category](https://github.com/getquill/quill/pull/259)
* [Accept unicode arrows](https://github.com/getquill/quill/pull/257)
* [Add set encoder to SqlSource](https://github.com/getquill/quill/pull/258)
* [Don't quote the source creation tree if query probing is disabled](https://github.com/getquill/quill/pull/268)
* [Bind `drop.take` according to the sql terms order](https://github.com/getquill/quill/pull/278)
* [Avoid silent error when importing the source's implicits for the encoding fallback resolution](https://github.com/getquill/quill/pull/279)
* [Quotation: add identifier method to avoid wrong type refinement inference](https://github.com/getquill/quill/pull/280)
* [Unquote multi-param quoted function bodies automatically](https://github.com/getquill/quill/pull/277)

# 0.4.1 / 28-Feb-2016

* [quill-sql: h2 dialect](https://github.com/getquill/quill/pull/189)
* [support for auto encoding of wrapped types](https://github.com/getquill/quill/pull/199/files#diff-04c6e90faac2675aa89e2176d2eec7d8R854)
* [non-batched actions](https://github.com/getquill/quill/pull/202/files#diff-04c6e90faac2675aa89e2176d2eec7d8L485)
* `distinct` support [[0]](https://github.com/getquill/quill/pull/186/files#diff-02749abf4d0d51be99715cff7074bc9eR38) [[1]](https://github.com/getquill/quill/pull/212)
* [postgres naming strategy](https://github.com/getquill/quill/pull/218)
* [quill-core: unquote quoted function bodies automatically](https://github.com/getquill/quill/pull/222)
* [don't fail if the source annotation isn't available](https://github.com/getquill/quill/pull/210)
* [fix custom aggregations](https://github.com/getquill/quill/pull/207)
* [quill-finagle-mysql: fix finagle mysql execute result loss](https://github.com/getquill/quill/pull/197)
* [quill-cassandra: stream source - avoid blocking queries](https://github.com/getquill/quill/pull/185)

# 0.4.0 / 19-Feb-2016

* [new sources creation mechanism](https://github.com/getquill/quill/pull/136)
* [simplified join syntax](https://github.com/getquill/quill/commit/bfcfe49fbdbda04cce7fe7e7d382fb1adbfcbd7f)
* [Comparison between Quill and other alternatives for CQL](https://github.com/getquill/quill/pull/164)
* [`contains` operator (sql `in`)](https://github.com/getquill/quill/pull/165/files#diff-04c6e90faac2675aa89e2176d2eec7d8R377)
* [unary sql queries](https://github.com/getquill/quill/pull/179/files#diff-02749abf4d0d51be99715cff7074bc9eR207)
* [query probing is now opt-in](https://github.com/getquill/quill/pull/176/files#diff-04c6e90faac2675aa89e2176d2eec7d8R453)
* [quill-cassandra: upgrade Datastax Java Driver to version 3.0.0](https://github.com/getquill/quill/pull/171)
* [support implicit quotations with type parameters](https://github.com/getquill/quill/pull/163)
* [quill-cassandra: UUID support](https://github.com/getquill/quill/pull/142)
* [quill-async: more reasonable numeric type decodes](https://github.com/getquill/quill/pull/139)

# 0.3.1 / 01-Feb-2016

* [fix #134 - ignore the property `queryProbing` when creating the hikari data source](https://github.com/getquill/quill/issues/134)

# 0.3.0 / 26-Jan-2016

* [quill-cassandra: first version of the module featuring async and sync sources](https://github.com/getquill/quill/#cassandra-sources)
* [quill-cassandra: reactive streams support via Monix](https://github.com/getquill/quill/#cassandra-sources)
* [quill-core: updates using table columns](https://github.com/getquill/quill/commit/0681b21aad8d75cb7793840c4f905b80645872cc#diff-04c6e90faac2675aa89e2176d2eec7d8R458)
* [quill-core: explicit inner joins](https://github.com/getquill/quill/commit/902eb858e0e844f41978f8179156da9c69f2d847#diff-2e097508346e0e431a36abcb2c1cc4cbR270)
* [quill-core: configuration option to disable the compile-time query probing](https://github.com/getquill/quill/commit/130919d62a1f852c2d26203c035361ccb3284e53#diff-04c6e90faac2675aa89e2176d2eec7d8L840)
* [quill-core: `if/`else` support (sql `case`/`when`)](https://github.com/getquill/quill/commit/16674ba77fdc880a64af719d150560351ac6a8f6#diff-2e097508346e0e431a36abcb2c1cc4cbR598)
* [quill-async: uuid encoding](https://github.com/getquill/quill/commit/743227aaa3ec76cefcffb405ac658069d90118fc#diff-7bfbe03bba9c515d3f16f88115eb2f9fR24)
* [quill-core: custom ordering](https://github.com/getquill/quill/commit/2fe7556279c5919aa9c1e22bf9c8caf4c67e53e7#diff-04c6e90faac2675aa89e2176d2eec7d8R257)
* [quill-core: expressions in sortBy](https://github.com/getquill/quill/commit/0dbb492de7334cb8ad34dc5c6246ec6908d328bc#diff-2e097508346e0e431a36abcb2c1cc4cbR107)

# 0.2.1 / 28-Dec-2015

* [expire and close compile-time sources automatically](https://github.com/getquill/quill/issues/10)
* [Aggregation sum should return an Option](https://github.com/getquill/quill/pull/69)
* [Changed min/max implicit from Numeric to Ordering](https://github.com/getquill/quill/pull/70)
* [provide implicit to query case class companion objects directly](https://github.com/getquill/quill/pull/73)
* [don't fuse multiple `sortBy`s](https://github.com/getquill/quill/issues/71)
* [actions now respect the naming strategy](https://github.com/getquill/quill/issues/74)

# 0.2.0 / 24-Dec-2015

* [Insert/update using case class instances](https://github.com/getquill/quill/commit/aed630bdb514b3d71a3a3cc47299ff28c0472023)
* [Better IntelliJ IDEA support](https://github.com/getquill/quill/issues/23)
* [Implicit quotations](https://github.com/getquill/quill/commit/1991d694a2bdad645d6d169acefba51f90acde62#diff-6858983f3617753cfb9852426edaa121R491)
* [`like` operator](https://github.com/getquill/quill/commit/f05763ff6cfbe850d7cab2e15d570603cad194c4#diff-04c6e90faac2675aa89e2176d2eec7d8R420)
* [string interpolation support](https://github.com/getquill/quill/commit/c510ee8a6daa98caf45743fd7fc75230cbb3d71e#diff-6858983f3617753cfb9852426edaa121R290)
* [Finagle pool configuration](https://github.com/getquill/quill/pull/60)
* [Allow empty password in Finagle Mysql client](https://github.com/getquill/quill/pull/59)
* Bug fixes:
	* https://github.com/getquill/quill/issues/53
	* https://github.com/getquill/quill/issues/62
	* https://github.com/getquill/quill/issues/63

# 0.1.0 / 27-Nov-2015

* Initial release


text:
package org.spongepowered.common.mixin.plugin;

public class CorePlugin extends AbstractMixinConfigPlugin {

}