text:
<!DOCTYPE HTML>

  <title>
   Werner Family Recipes
  </title>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1" name="viewport"/>

  <link href="../../assets/css/main.css" rel="stylesheet"/>

  <link href="../../../generator/templates/images/touch/chrome-touch-icon-192x192.png" rel="icon" sizes="192x192"/>
  <link href="../../../generator/templates/images/touch/apple-touch-icon.png" rel="apple-touch-icon"/>

         Menu

     Menu

    <button id="searchButton" onclick="enterKeyRedirect()" style="float:right">
     Search
    </button>

     <input class="searchField" id="searchTxt" maxlength="512" name="searchTxt" placeholder="Search Here..." style="width: 100%" type="text"/>

    <button id="scalingButton" onclick="rescaleRecipe()">
     1X
    </button>

       Home

       Appetizer

       Bread

       Breakfast

       Cocktail

       Dessert

       Entree

       Hotdish

       Instant Pot

       Meat

       Pasta

       Side Dish

       Soup

      Chicken Alfredo Spaghetti Squash

        Ingredients

          1

          Whole

          Spaghetti Squash

          2

          Cloves

          Garlic

          1

          Tablespoon

          Olive Oil

          3/4

          Cup

          Chicken Stock

          2

          Teaspoons

          Cornstarch

          1/2

          Teaspoon

          Salt

          1/2

          Teaspoon

          Pepper

          1/2

          Cup

          Grated Parmesan Cheese

          3/4

          Cup

          Plain Greek Yogurt

          2

          Cups

          Cooked Chicken Breast, Shredded

          1/4

          Cup

          Shredded Mozzarella Cheese

        Directions

         Preheat oven to 400 F° F. Cut spaghetti squash in half lengthwise and scoop the seeds out. Place cut side down on a baking sheet lined with parchment paper and bake for 30 minutes. Remove from the oven and let cool until safe to the touch, about 15 minutes.

         In the meanwhile, preheat large skillet on medium heat and add olive oil. Add garlic and saute for a minute or two or until fragrant, stirring frequently. Add chicken stock, cornstarch, salt, pepper and whisk until smooth. Bring to a boil, reduce heat to low and simmer for a few minutes until sauce has thickened a bit.

         Remove from heat, add Parmesan cheese and stir until smooth and cheese has melted. Add Greek yogurt and stir again until smooth. Add chicken and stir to combine. Set aside.

         Reduce oven temperature to 375° F. Using a fork, separate spaghetti squash into strands leaving them inside the shells. Scoop Chicken Alfredo sauce on top of each shell and gently move around with a fork to make the sauce settle deeper into the spaghetti squash.

         Top each shell with 2 tbsp Mozzarella, place in a baking dish and bake for 10 - 12 minutes and then broil on High for 5 more minutes. Stir the squash with a sauce a bit before serving and serve hot.

    <scaling_button_goes_here>
    </scaling_button_goes_here>

       All recipes subject to cooking skill

        Contact the Administrator


text:
package au.org.garvan.phenomics.cr.testsuites.serializer;

import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import au.org.garvan.phenomics.cr.testsuites.common.api.serializer.ITestSuiteSerializer;
import au.org.garvan.phenomics.cr.testsuites.log.TestSuitesLogger;
import au.org.garvan.phenomics.cr.testsuites.serializer.util.SerializerUtil;

public class SerializerResourceLoader {

	@SuppressWarnings("unchecked")
	private static TestSuitesLogger<SerializerResourceLoader> logger = (TestSuitesLogger<SerializerResourceLoader>) TestSuitesLogger
			.getLogger(SerializerResourceLoader.class);

	private Map<String, ITestSuiteSerializer> serializers;

	public SerializerResourceLoader(Properties properties) {
		serializers = new HashMap<String, ITestSuiteSerializer>();
		loadSerializers(properties);
	}

	private void loadSerializers(Properties properties) {
		Map<Integer, Map<String, String>> propValues = new HashMap<Integer, Map<String,String>>();

		for (Object key : properties.keySet()) {
			String propName = (String) key;

			int index = propName.indexOf("[");
			int index2 = propName.indexOf("]");

			int idx = Integer.parseInt(propName.substring(index + 1, index2));
			String actualProperty = propName.substring(index2 + 2);

			Map<String, String> map = propValues.containsKey(idx) ? propValues.get(idx) : new HashMap<String, String>();
			map.put(actualProperty, properties.getProperty(propName));
			propValues.put(idx, map);
		}

		for (int idx : propValues.keySet()) {
			instatiateSerializer(propValues.get(idx));
		}
	}

	@SuppressWarnings("unchecked")
	private void instatiateSerializer(Map<String, String> map) {
		if (!map.containsKey(SerializerUtil.P_CLASS) &&
				!map.containsKey(SerializerUtil.P_NAME)) {
			return;
		}

		logger.info("Instantiating serializer (" + map.get(SerializerUtil.P_NAME) + "): " + map.get(SerializerUtil.P_CLASS));
		Properties properties = retrieveProperties(map);

		try {
			Class<ITestSuiteSerializer> serializerCls = (Class<ITestSuiteSerializer>) Class
					.forName(map.get(SerializerUtil.P_CLASS));
			ITestSuiteSerializer serializer = null;
			serializer = serializerCls.getConstructor(Properties.class).newInstance(properties);
			serializers.put(serializer.getName(), serializer);
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | IllegalArgumentException
				| InvocationTargetException | NoSuchMethodException
				| SecurityException e) {

			logger.error("Unable to instantiate serializer: " + map.get(SerializerUtil.P_NAME) + " ...");
			logger.error(e.getMessage());
		}

		logger.info("Serializer: " + map.get(SerializerUtil.P_NAME) + " successfully instatiated ...");

	}

	private Properties retrieveProperties(Map<String, String> map) {
		Properties properties = new Properties();

		for (String key : map.keySet()) {
			String value = map.get(key);
			if (key.startsWith(SerializerUtil.P_PROPERTY)) {
				int index = key.indexOf("[");
				String tmp = key.substring(index + 1).trim();
				index = tmp.indexOf("]");
				String actualProperty = tmp.substring(0, index).trim();
				properties.put(actualProperty, value);
			}
		}

		return properties;
	}

	public Map<String, ITestSuiteSerializer> getSerializers() {
		return serializers;
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<document>
    <annotations>
        <annotation>
            <id>360833</id>
            <start>2085</start>
            <end>2092</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360787</id>
            <start>995</start>
            <end>998</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360799</id>
            <start>2031</start>
            <end>2033</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360864</id>
            <start>422</start>
            <end>425</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360819</id>
            <start>283</start>
            <end>287</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360842</id>
            <start>1206</start>
            <end>1209</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360854</id>
            <start>689</start>
            <end>697</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360827</id>
            <start>2719</start>
            <end>2726</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360795</id>
            <start>3589</start>
            <end>3591</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360848</id>
            <start>250</start>
            <end>253</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360849</id>
            <start>1961</start>
            <end>1964</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360809</id>
            <start>727</start>
            <end>731</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>360815</id>
            <start>334</start>
            <end>340</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360852</id>
            <start>2336</start>
            <end>2340</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360847</id>
            <start>2059</start>
            <end>2064</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360867</id>
            <start>2201</start>
            <end>2203</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360798</id>
            <start>1997</start>
            <end>2005</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>360838</id>
            <start>2537</start>
            <end>2542</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360829</id>
            <start>3331</start>
            <end>3334</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360786</id>
            <start>2612</start>
            <end>2617</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360791</id>
            <start>3397</start>
            <end>3405</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360792</id>
            <start>2761</start>
            <end>2766</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360828</id>
            <start>1492</start>
            <end>1495</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360865</id>
            <start>1591</start>
            <end>1596</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360788</id>
            <start>1891</start>
            <end>1893</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360859</id>
            <start>3140</start>
            <end>3147</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360843</id>
            <start>118</start>
            <end>121</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360785</id>
            <start>231</start>
            <end>239</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360826</id>
            <start>2975</start>
            <end>2979</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360805</id>
            <start>2468</start>
            <end>2475</end>
            <targetType>None</targetType>
        </annotation>
        <annotation>
            <id>360802</id>
            <start>501</start>
            <end>505</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360793</id>
            <start>3192</start>
            <end>3196</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360794</id>
            <start>3670</start>
            <end>3675</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360837</id>
            <start>2738</start>
            <end>2742</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360851</id>
            <start>3744</start>
            <end>3748</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>360810</id>
            <start>407</start>
            <end>411</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360823</id>
            <start>1055</start>
            <end>1058</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360868</id>
            <start>3105</start>
            <end>3113</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360807</id>
            <start>3475</start>
            <end>3482</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360816</id>
            <start>2254</start>
            <end>2260</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360820</id>
            <start>2241</start>
            <end>2246</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360821</id>
            <start>48</start>
            <end>51</end>
            <targetType>None</targetType>
        </annotation>
        <annotation>
            <id>360808</id>
            <start>3351</start>
            <end>3354</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360836</id>
            <start>3041</start>
            <end>3044</end>
            <targetType>None</targetType>
        </annotation>
        <annotation>
            <id>360844</id>
            <start>2503</start>
            <end>2507</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360789</id>
            <start>2868</start>
            <end>2872</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360850</id>
            <start>979</start>
            <end>988</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360832</id>
            <start>2516</start>
            <end>2521</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360801</id>
            <start>717</start>
            <end>719</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360857</id>
            <start>1796</start>
            <end>1798</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360853</id>
            <start>2959</start>
            <end>2964</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360860</id>
            <start>3729</start>
            <end>3731</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360797</id>
            <start>781</start>
            <end>788</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360861</id>
            <start>2129</start>
            <end>2131</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360866</id>
            <start>1079</start>
            <end>1086</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>360845</id>
            <start>1735</start>
            <end>1742</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360862</id>
            <start>3289</start>
            <end>3295</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360812</id>
            <start>2374</start>
            <end>2378</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360811</id>
            <start>3782</start>
            <end>3784</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360856</id>
            <start>1813</start>
            <end>1817</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360813</id>
            <start>3159</start>
            <end>3165</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360804</id>
            <start>2707</start>
            <end>2710</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360825</id>
            <start>3807</start>
            <end>3811</end>
            <targetType>None</targetType>
        </annotation>
        <annotation>
            <id>360869</id>
            <start>464</start>
            <end>471</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360806</id>
            <start>3381</start>
            <end>3389</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360855</id>
            <start>1510</start>
            <end>1516</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360790</id>
            <start>1251</start>
            <end>1255</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360831</id>
            <start>2661</start>
            <end>2668</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360822</id>
            <start>1153</start>
            <end>1160</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360835</id>
            <start>1842</start>
            <end>1844</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360824</id>
            <start>910</start>
            <end>912</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360863</id>
            <start>3545</start>
            <end>3554</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360817</id>
            <start>142</start>
            <end>149</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360803</id>
            <start>2805</start>
            <end>2809</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360796</id>
            <start>2411</start>
            <end>2414</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360841</id>
            <start>536</start>
            <end>542</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360840</id>
            <start>839</start>
            <end>843</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360858</id>
            <start>2645</start>
            <end>2651</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360830</id>
            <start>2435</start>
            <end>2438</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>360834</id>
            <start>2226</start>
            <end>2229</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360800</id>
            <start>3486</start>
            <end>3488</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360839</id>
            <start>3561</start>
            <end>3565</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360814</id>
            <start>1239</start>
            <end>1246</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>360818</id>
            <start>1533</start>
            <end>1540</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>360846</id>
            <start>3514</start>
            <end>3517</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
    </annotations>
    <links/>
</document>


text:
package org.workcraft.plugins.fst.interop;

import java.io.File;
import java.io.InputStream;

import org.workcraft.exceptions.DeserialisationException;
import org.workcraft.exceptions.FormatException;
import org.workcraft.interop.Importer;
import org.workcraft.plugins.fst.Fst;
import org.workcraft.plugins.fst.FstDescriptor;
import org.workcraft.plugins.fst.jj.SgParser;
import org.workcraft.plugins.fst.jj.ParseException;
import org.workcraft.plugins.shared.CommonDebugSettings;
import org.workcraft.util.FileUtils;
import org.workcraft.workspace.ModelEntry;

public class SgImporter implements Importer {

    private static final String STATEGRAPH_KEYWORD = ".state graph";

    @Override
    public SgFormat getFormat() {
        return SgFormat.getInstance();
    }

    @Override
    public boolean accept(File file) {
        return file.getName().endsWith(".sg")
                && FileUtils.fileContainsKeyword(file, STATEGRAPH_KEYWORD);
    }

    @Override
    public ModelEntry importFrom(InputStream in) throws DeserialisationException {
        return new ModelEntry(new FstDescriptor(), importSG(in));
    }

    public Fst importSG(InputStream in) throws DeserialisationException {
        try {
            SgParser parser = new SgParser(in);
            if (CommonDebugSettings.getParserTracing()) {
                parser.enable_tracing();
            } else {
                parser.disable_tracing();
            }
            return parser.parse();
        } catch (FormatException e) {
            throw new DeserialisationException(e);
        } catch (ParseException e) {
            throw new DeserialisationException(e);
        }
    }
}


text:
import Radium from "radium";
import React, { Component, PropTypes } from "react";

import Barcode from "./Barcode";

@Radium
export default class BarcodeRenderer extends Component {
  static propTypes = {
    barcodes: PropTypes.arrayOf(PropTypes.string).isRequired,
    style: PropTypes.object,
  };

  render() {
    const { barcodes, style } = this.props;

    const nonEmpty = barcodes.filter((x) => !!x);

    const elements = nonEmpty.map((barcode, n) => {
      return (
        <Barcode key={`${n}_${barcode}`} value={barcode} style={styles.barcode} />
      );
    });

    return (
      <div style={[styles.container, style]}>
        {elements}
      </div>
    );
  }
}

const styles = {
  container: {
    display: "flex",
    flexDirection: "row",
    flexWrap: "wrap",
    justifyContent: "space-around",
  },

  barcode: {
    margin: "8px",
  },
};


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

define(['dojo/_base/declare',
  'dojo/_base/lang',
  'dojo/_base/html',
  'dojo/on',
  'dojo/Deferred',
  'dijit/_WidgetBase',
  'dojo/Evented',
  'esri/geometry/Extent',
  'jimu/portalUrlUtils',
  'jimu/dijit/LoadingShelter',
  'jimu/utils'
],
function(declare, lang, html, on, Deferred, _WidgetBase,
  Evented, Extent, portalUrlUtils,
  LoadingShelter, jimuUtils) {
  /* global esriConfig */

  return declare([_WidgetBase, Evented], {
    baseClass: 'jimu-extent-chooser',
    declaredClass: 'jimu.dijit.ExtentChooser',

    //portalUrl: String
    //  the portalUrl of webmap. Such as 'http://www.arcgis.com'.
    portalUrl: null,

    //itemId: String
    //  the webmap item id. For now, we only support webmap
    itemId: null,

    initExtent: null,
    //bingMapsKey: String
    //  required if working with Microsoft Bing Maps
    bingMapsKey: '',

    geometryServiceURL: null,

    shelter: null,

    postCreate:function(){
      this.inherited(arguments);

      if(!this.geometryServiceURL){
        if(esriConfig.defaults.geometryService){
          this.geometryServiceURL = esriConfig.defaults.geometryService.url;
        }
      }

      if(!this.geometryServiceURL){
        var servicesObj = jimuUtils.getServices();
        this.geometryServiceURL = servicesObj.geometryService;
      }

      this.shelter = new LoadingShelter({
        hidden: true
      });
      this.shelter.placeAt(this.domNode);
      this.shelter.startup();
      this.shelter.show();

      var mapNode = html.create('div', {
        style: {
          width: '100%',
          height: '100%'
        }
      }, this.domNode);

      if(!this.portalUrl || !this.itemId){
        return;
      }

      this.portalUrl = portalUrlUtils.getStandardPortalUrl(this.portalUrl);

      var args = {
        geometryServiceURL: this.geometryServiceURL,
        bingMapsKey: this.bingMapsKey
      };

      if(this.initExtent){
        if(this.initExtent.declaredClass !== "esri.geometry.Extent"){
          this.initExtent = new Extent(this.initExtent);
        }
        args.mapOptions = {
          extent:this.initExtent
        };
      }
      if(this.lods){
        if(typeof args.mapOptions === 'object'){
          args.mapOptions.lods = this.lods;
        }else{
          args.mapOptions = {
            lods: this.lods
          };
        }
      }

      var mapDeferred = jimuUtils.createWebMap(this.portalUrl, this.itemId, mapNode, args);

      mapDeferred.then(lang.hitch(this, function(response) {
        this.map = response.map;
        this.map.webMapResponse = response;
        this.own(on(this.map, 'extent-change', lang.hitch(this, function(evt){
          this.onExtentChange(evt.extent);
        })));

        if(!this.initExtent){
          this.onExtentChange(this.map.extent); // send map default extent
        }else {
          this.onExtentChange(this.initExtent);
        }
        this.shelter.hide();
        this.emit('map-load', this.map);
      }), lang.hitch(this, function(err){
        console.error(err);
      }));
    },

    getExtent: function(){
      return this.map && this.map.extent;
    },

    setExtent: function(extent){
      if(this.map){
        return this.map.setExtent(extent);
      }
      else{
        var def = new Deferred();
        setTimeout(lang.hitch(this, function(){
          def.reject('map is null.');
        }), 0);
        return def;
      }
    },

    restoreToDefaultWebMapExtent:function(){
      jimuUtils.restoreToDefaultWebMapExtent(this.map,
                                             this.map.webMapResponse,
                                             this.geometryServiceURL);
    },

    onExtentChange: function(extent){
      this.emit('extent-change', extent);
    }

  });
});


text:
var user = require('../app/models/user'),
    md5 = require('MD5');

module.exports = {
    index: function(req, res, done) {
        console.log("user index: " + req.body);
        if(!done) {
            done = this.done;
        }
        user.UserType.find({}, function(err, data) {
            done(res, err, item, 'Error adding item');
        });
    },
    getById: function(req, res, done) {
        console.log("user getById: " + req.body);
        if(!done) {
            done = this.done;
        }
        user.UserType.find({ _id: req.params.id }, function(err, user) {
            done(res, err, item, 'Error adding item');
        });
    },
    add: function(req, res, done) {
        console.log("user add: " + req.body);
        if(!done) {
            done = this.done;
        }
        var newUser = new user.createUserFromJSON(req.body,false);
        newUser.gravatar = md5(newUser.email);
        newUser.save(function(err, user) {
            done(res, err, item, 'Error adding item');
        });
    },
    update: function(req, res, done) {
        console.log("user update: " + req.body);
        if(!done) {
            done = this.done;
        }
        user.UserType.update({ _id: req.body.id }, req.body, function(err, updated) {
            done(res, err, item, 'Error adding item');
         })
    },
    delete: function(req, res, done) {
        console.log("user delete: " + req.body);
        if(!done) {
            done = this.done;
        }
        user.UserType.findOne({ _id: req.params.id }, function(err, user) {
            if (err) {
                res.json({error: 'User not found.'});
            } else {
                contact.remove(function(err, user){
                    done(res, err, item, 'Error adding item');
                })
            }
        });
    },
    done: function(res, err, item, message) {
        if (err) {
            console.log("item done err: " + err + " " + message);
            res.json({error: message});
        } else if(item) {
            console.log("item done item: " + JSON.stringify(item));
            res.json(item);
        } else {
            console.log("item done: ");
            res.json(200, {status: 'Success'});
        }
    }
};


text:
| Variable | Default | Explanation |
|----------|---------|-------------|
| `MY_HIDE_GAME_WEBVIEW` | `false` | Whether or not to hide the game `webview` component. Useful while using HMR and editing UI. _Requires `NODE_ENV === 'development'` |


text:
<?hh // strict

namespace Titon\Http\Exception;

use Titon\Http\Http;
use \Exception;

/**
 * Represents an HTTP 401 error.
 *
 * @package Titon\Http\Exception
 */
class UnauthorizedException extends HttpException {

    /**
     * {@inheritdoc}
     */
    public function __construct(string $message = 'Unauthorized', int $code = Http::UNAUTHORIZED, ?Exception $previous = null) {
        parent::__construct($message, $code, $previous);
    }

}


text:
import { Injectable, NgZone } from '@angular/core';
import { List } from './model/list';
import { combineLatest, concat, Observable, of } from 'rxjs';
import { ListRow } from './model/list-row';
import { DataService } from '../../core/api/data.service';
import { I18nToolsService } from '../../core/tools/i18n-tools.service';
import { Ingredient } from '../../model/garland-tools/ingredient';
import { DataExtractorService } from './data/data-extractor.service';
import { catchError, filter, first, map, skip, switchMap, tap } from 'rxjs/operators';
import { GarlandToolsService } from '../../core/api/garland-tools.service';
import { ItemData } from '../../model/garland-tools/item-data';
import { DiscordWebhookService } from '../../core/discord/discord-webhook.service';
import { TeamsFacade } from '../teams/+state/teams.facade';
import { Team } from '../../model/team/team';
import { environment } from '../../../environments/environment';
import { CustomItemsFacade } from '../custom-items/+state/custom-items.facade';
import { CustomItem } from '../custom-items/model/custom-item';

@Injectable({
  providedIn: 'root'
})
export class ListManagerService {

  private customItemsSync: CustomItem[] = [];

  constructor(protected db: DataService,
              private gt: GarlandToolsService,
              protected i18n: I18nToolsService,
              private extractor: DataExtractorService,
              private zone: NgZone,
              private discordWebhookService: DiscordWebhookService,
              private teamsFacade: TeamsFacade,
              private customItemsFacade: CustomItemsFacade) {

    this.customItemsFacade.loadAll();
    this.customItemsFacade.allCustomItems$.subscribe(items => this.customItemsSync = items);

  }

  public addToList(itemId: number | string, list: List, recipeId: string | number, amount = 1, collectible = false, ignoreHooks = false, upgradeCustom = false): Observable<List> {
    let team$ = of(null);
    if (list.teamId && !ignoreHooks) {
      this.teamsFacade.loadTeam(list.teamId);
      team$ = this.teamsFacade.allTeams$
        .pipe(
          map(teams => teams.find(team => list.teamId && team.$key === list.teamId)),
          filter(team => team !== undefined),
          first()
        );
    }
    const dataSource$ = +itemId === itemId ? this.db.getItem(itemId).pipe(catchError(() => of(undefined))) : of(this.customItemsSync.find(i => i.$key === itemId));
    return combineLatest([team$, dataSource$])
      .pipe(
        tap(([team, itemData]) => {
          if (team && team.webhook !== undefined && amount !== 0) {
            if (+itemId === itemId) {
              if (amount > 0) {
                this.discordWebhookService.notifyItemAddition(itemId, amount, list, team);
              } else {
                this.discordWebhookService.notifyItemDeletion(itemId, Math.abs(amount), list, team);
              }
            } else {
              if (amount > 0) {
                this.discordWebhookService.notifyCustomItemAddition((<CustomItem>itemData).name, (<ItemData>itemData).item.id, amount, list, team);
              } else {
                this.discordWebhookService.notifyCustomItemDeletion((<CustomItem>itemData).name, (<ItemData>itemData).item.id, Math.abs(amount), list, team);
              }
            }
          }
        }),
        switchMap(([, data]: [Team, ItemData | CustomItem]) => {
          if (data === undefined) {
            return of(new List());
          }
          // If it's a standard item, add it with the classic implementation.
          if (data instanceof ItemData) {
            return this.processItemAddition(data, +itemId, amount, collectible, recipeId);
          } else {
            if (data.realItemId !== undefined && upgradeCustom) {
              return this.db.getItem(data.realItemId).pipe(
                switchMap(itemData => {
                  return this.processItemAddition(itemData, data.realItemId, amount, collectible, recipeId);
                }),
                catchError(() => {
                  return this.processCustomItemAddition(data as CustomItem, amount);
                })
              );
            } else {
              return this.processCustomItemAddition(data as CustomItem, amount);
            }
          }
        }),
        // merge the addition list with the list we want to add items in.
        map(addition => list.merge(addition))
      );
  }

  private processCustomItemAddition(item: CustomItem, amount: number): Observable<List> {
    const addition = new List();
    const itemClone = new CustomItem();
    Object.assign(itemClone, item);
    itemClone.amount = amount;
    itemClone.done = 0;
    itemClone.used = 0;
    itemClone.usePrice = true;
    itemClone.id = itemClone.$key;
    const added = addition.addToFinalItems(itemClone);
    if (itemClone.requires.length > 0) {
      return addition.addCraft([
        {
          amount: added,
          data: itemClone,
          item: null
        }
      ], this.gt, this.customItemsSync, this.db, this);
    }
    return of(addition);
  }

  private processItemAddition(data: ItemData, itemId: number, amount: number, collectible: boolean, recipeId: string | number): Observable<List> {
    const crafted = this.extractor.extractCraftedBy(+itemId, data);
    const addition = new List();
    const toAdd: ListRow = new ListRow();
    // If this is a craft
    if (data.isCraft()) {
      if (!recipeId) {
        const firstCraft = data.item.craft[0];
        if (firstCraft.id !== undefined) {
          recipeId = firstCraft.id.toString();
        } else {
          recipeId = data.item.craft[0].toString();
        }
      }
      const craft = data.getCraft(recipeId.toString());
      // We have to remove unused ingredient properties.
      craft.ingredients.forEach(i => {
        delete i.quality;
        delete i.stepid;
        delete i.part;
        delete i.phase;
      });
      craft.ingredients = craft.ingredients.reduce((uniq: Ingredient[], ing) => {
        const row = uniq.find(r => r.id === ing.id);
        if (row === undefined) {
          uniq.push(ing);
          return uniq;
        }
        row.amount += ing.amount;
        return uniq;
      }, []);
      const yields = collectible ? 1 : (craft.yield || 1);
      // Then we prepare the list row to add.
      Object.assign(toAdd, {
        id: data.item.id,
        icon: data.item.icon,
        amount: amount,
        done: 0,
        used: 0,
        yield: yields,
        recipeId: recipeId.toString(),
        requires: craft.ingredients,
        craftedBy: crafted,
        usePrice: true
      });
    } else {
      // If it's not a recipe, add as item
      Object.assign(toAdd, {
        id: data.item.id,
        icon: data.item.icon,
        amount: amount,
        done: 0,
        used: 0,
        yield: 1,
        usePrice: true
      });
    }
    // We add the row to recipes.
    const added = addition.addToFinalItems(toAdd);
    let addition$: Observable<List>;
    if (data.isCraft()) {
      // Then we add the craft to the addition list.
      addition$ = addition.addCraft([{
        item: data.item,
        data: data,
        amount: added
      }], this.gt, this.customItemsSync, this.db, this, recipeId.toString());
    } else {
      addition$ = of(addition);
    }
    return addition$.pipe(
      map(wipList => {
        return this.addDetails(wipList, data, recipeId);
      })
    );
  }

  public addDetails(list: List, data: ItemData, recipeId?: string | number): List {
    list.forEach(item => {
      // If it's not inside data and it isn't a crystal, we can already skip.
      if (item.id > 20 && data.item.id !== item.id && !data.ingredients.some(i => i.id === item.id)) {
        return;
      }
      if (data.isCraft()) {
        if (recipeId !== undefined && data.item.id === item.id) {
          item.craftedBy = this.extractor.extractCraftedBy(item.id, data).filter(row => {
            return row.recipeId.toString() === recipeId.toString();
          });
        } else {
          item.craftedBy = this.extractor.extractCraftedBy(item.id, data);
        }
      }
      item = this.extractor.addDataToItem(item, data, true);
    });
    return list;
  }

  public upgradeList(list: List): Observable<List> {
    const permissions = list.registry;
    const backup = [];
    if (list.finalItems.length === 0) {
      return of(list);
    }
    list.items.forEach(item => {
      backup.push({ array: 'items', item: { ...item } });
    });
    list.finalItems.forEach(item => {
      backup.push({ array: 'finalItems', item: { ...item } });
    });
    const add: Observable<List>[] = [];
    list.finalItems.forEach((recipe) => {
      add.push(this.addToList(recipe.id, list, recipe.recipeId, recipe.amount, false, true, true));
    });
    list.items = [];
    list.finalItems = [];
    list.version = environment.version;
    return concat(...add)
      .pipe(
        // Only apply backup at last iteration, to avoid unnecessary slow process.
        skip(add.length - 1),
        map((resultList: List) => {
          backup.forEach(row => {
            const listRow = resultList[row.array].find(item => item.id === row.item.id || item.id === row.realItemId);
            if (listRow !== undefined) {
              listRow.$key = row.item.$key;
              if (row.item.comments !== undefined) {
                listRow.comments = row.item.comments;
              }
              listRow.done = row.item.done || 0;
              listRow.used = row.item.used || 0;
              if (row.item.craftedBy !== undefined && row.item.craftedBy.length > 0) {
                if (listRow.done > listRow.amount) {
                  listRow.done = listRow.amount;
                }
              } else {
                if (listRow.done > listRow.amount_needed) {
                  listRow.done = listRow.amount_needed;
                }
              }
            }
          });
          resultList.updateAllStatuses();
          resultList.registry = permissions;
          return resultList;
        })
      );
  }
}


text:
#pragma once

#include <stdbool.h>
#include "graphics.h"
#include "image.h"
#include "quad.h"
#include "batch.h"

struct graphics_Particle;
typedef struct graphics_Particle graphics_Particle;

typedef enum {
  graphics_ParticleInsertMode_top,
  graphics_ParticleInsertMode_bottom,
  graphics_ParticleInsertMode_random
} graphics_ParticleInsertMode;

typedef enum {
  graphics_AreaSpreadDistribution_uniform,
  graphics_AreaSpreadDistribution_normal,
  graphics_AreaSpreadDistribution_none
} graphics_AreaSpreadDistribution;

typedef struct {
  graphics_Particle *pMem;
  graphics_Particle *pFree;
  graphics_Particle *pHead;
  graphics_Particle *pTail;

  graphics_Image const* texture;
  graphics_Batch batch;
  bool active;

  graphics_ParticleInsertMode insertMode;

  size_t maxParticles;
  size_t activeParticles;

  float emissionRate;
  float emitCounter;

  float position[2];
  float prevPosition[2];

  graphics_AreaSpreadDistribution areaSpreadDistribution;
  float areaSpread[2];

  float lifetime;
  float life;

  float particleLifeMin;
  float particleLifeMax;

  float direction;
  float spread;

  float speedMin;
  float speedMax;

  float linearAccelerationMin[2];
  float linearAccelerationMax[2];

  float radialAccelerationMin;
  float radialAccelerationMax;

  float tangentialAccelerationMin;
  float tangentialAccelerationMax;

  float linearDampingMin;
  float linearDampingMax;

  float *sizes;
  size_t sizeCount;
  float sizeVariation;

  float rotationMin;
  float rotationMax;

  float spinStart;
  float spinEnd;
  float spinVariation;

  float offsetX;
  float offsetY;

  graphics_Color *colors;
  size_t colorCount;

  graphics_Quad const **quads;
  size_t quadCount;

  bool relativeRotation;
} graphics_ParticleSystem;

void graphics_ParticleSystem_new(graphics_ParticleSystem *ps, graphics_Image const *texture, size_t buffer);
void graphics_ParticleSystem_free(graphics_ParticleSystem *ps);

void graphics_ParticleSystem_setAreaSpread(graphics_ParticleSystem *ps, graphics_AreaSpreadDistribution mode, float dx, float dy);
void graphics_ParticleSystem_getAreaSpread(graphics_ParticleSystem const *ps, graphics_AreaSpreadDistribution *mode, float *dx, float *dy);
void graphics_ParticleSystem_setBufferSize(graphics_ParticleSystem *ps, size_t size);
size_t graphics_ParticleSystem_getBufferSize(graphics_ParticleSystem const *ps);
void graphics_ParticleSystem_setColors(graphics_ParticleSystem *ps, size_t count, graphics_Color const *colors);
graphics_Color const* graphics_ParticleSystem_getColors(graphics_ParticleSystem const *ps, size_t *count);
void graphics_ParticleSystem_setTexture(graphics_ParticleSystem *ps, graphics_Image const* texture);
graphics_Image const* graphics_ParticleSystem_getTexture(graphics_ParticleSystem const *ps);
float const *graphics_ParticleSystem_getSizes(graphics_ParticleSystem const *ps, size_t *count);
void graphics_ParticleSystem_setSizes(graphics_ParticleSystem *ps, size_t count, float const *sizes);
void graphics_ParticleSystem_setQuads(graphics_ParticleSystem *ps, size_t count, graphics_Quad const * const *quads);
void graphics_ParticleSystem_setRelativeRotation(graphics_ParticleSystem *ps, bool enable);
void graphics_ParticleSystem_setInsertMode(graphics_ParticleSystem *ps, graphics_ParticleInsertMode mode);
graphics_ParticleInsertMode graphics_ParticleSystem_getInsertMode(graphics_ParticleSystem const *ps);

size_t graphics_ParticleSystem_getCount(graphics_ParticleSystem const *ps);

void graphics_ParticleSystem_setDirection(graphics_ParticleSystem *ps, float dir);
void graphics_ParticleSystem_setEmissionRate(graphics_ParticleSystem *ps, float rate);
void graphics_ParticleSystem_setEmitterLifetime(graphics_ParticleSystem *ps, float lifetime);
void graphics_ParticleSystem_setSizeVariation(graphics_ParticleSystem *ps, float variation);
void graphics_ParticleSystem_setSpinVariation(graphics_ParticleSystem *ps, float variation);
void graphics_ParticleSystem_setSpread(graphics_ParticleSystem *ps, float spread);

float graphics_ParticleSystem_getDirection(graphics_ParticleSystem const *ps);
float graphics_ParticleSystem_getEmissionRate(graphics_ParticleSystem const *ps);
float graphics_ParticleSystem_getEmitterLifetime(graphics_ParticleSystem const *ps);
float graphics_ParticleSystem_getSizeVariation(graphics_ParticleSystem const *ps);
float graphics_ParticleSystem_getSpinVariation(graphics_ParticleSystem const *ps);
float graphics_ParticleSystem_getSpread(graphics_ParticleSystem const *ps);

void graphics_ParticleSystem_setOffset(graphics_ParticleSystem *ps, float x, float y);
void graphics_ParticleSystem_setParticleLifetime(graphics_ParticleSystem *ps, float min, float max);
void graphics_ParticleSystem_setPosition(graphics_ParticleSystem *ps, float x, float y);
void graphics_ParticleSystem_setRadialAcceleration(graphics_ParticleSystem *ps, float min, float max);
void graphics_ParticleSystem_setRotation(graphics_ParticleSystem *ps, float min, float max);
void graphics_ParticleSystem_setSpeed(graphics_ParticleSystem *ps, float min, float max);
void graphics_ParticleSystem_setSpin(graphics_ParticleSystem *ps, float min, float max);
void graphics_ParticleSystem_setTangentialAcceleration(graphics_ParticleSystem *ps, float min, float max);
void graphics_ParticleSystem_setLinearDamping(graphics_ParticleSystem *ps, float min, float max);

void graphics_ParticleSystem_getOffset(graphics_ParticleSystem const *ps, float *x, float *y);
void graphics_ParticleSystem_getParticleLifetime(graphics_ParticleSystem const *ps, float *min, float *max);
void graphics_ParticleSystem_getPosition(graphics_ParticleSystem const *ps, float *x, float *y);
void graphics_ParticleSystem_getRadialAcceleration(graphics_ParticleSystem const *ps, float *min, float *max);
void graphics_ParticleSystem_getRotation(graphics_ParticleSystem const *ps, float *min, float *max);
void graphics_ParticleSystem_getSpeed(graphics_ParticleSystem const *ps, float *min, float *max);
void graphics_ParticleSystem_getSpin(graphics_ParticleSystem const *ps, float *min, float *max);
void graphics_ParticleSystem_getTangentialAcceleration(graphics_ParticleSystem const *ps, float *min, float *max);
void graphics_ParticleSystem_getLinearDamping(graphics_ParticleSystem const *ps, float *min, float *max);

bool graphics_ParticleSystem_isActive(graphics_ParticleSystem const *ps);
bool graphics_ParticleSystem_isPaused(graphics_ParticleSystem const *ps);
bool graphics_ParticleSystem_isStopped(graphics_ParticleSystem const *ps);
bool graphics_ParticleSystem_hasRelativeRotation(graphics_ParticleSystem const *ps);

void graphics_ParticleSystem_start(graphics_ParticleSystem *ps);
void graphics_ParticleSystem_stop(graphics_ParticleSystem *ps);
void graphics_ParticleSystem_reset(graphics_ParticleSystem *ps);
void graphics_ParticleSystem_pause(graphics_ParticleSystem *ps);

void graphics_ParticleSystem_emit(graphics_ParticleSystem *ps, size_t count);
void graphics_ParticleSystem_update(graphics_ParticleSystem *ps, float dt);
void graphics_ParticleSystem_moveTo(graphics_ParticleSystem *ps, float x, float y);

void graphics_ParticleSystem_clone(graphics_ParticleSystem const* ps, graphics_ParticleSystem *psNew);

void graphics_ParticleSystem_draw(graphics_ParticleSystem * ps, float x, float y, float r, float sx, float sy, float ox, float oy, float kx, float ky);
void graphics_ParticleSystem_setLinearAcceleration(graphics_ParticleSystem *ps, float xmin, float ymin, float xmax, float ymax);
void graphics_ParticleSystem_getLinearAcceleration(graphics_ParticleSystem const *ps, float *xmin, float *ymin, float *xmax, float *ymax);

void graphics_particlesystem_init();


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<conference>
    <name>International Workshop on Emotion Representations and Modelling for HCI Systems</name>
    <acronym>ERM4HCI2013</acronym>
    <description>This workshop complements the ICMI 2013 by offering a platform that focuses on emotion representations and modelling for Human-Computer Interaction (HCI) systems. Emotion representations and models are often both modality and discipline specific and hence hardly interoperable. The workshop encourages the discussion of both technical and theoretical approaches to emotion modelling and representations in order to aid in the development of efficient, verifiable and implementable emotion models for affective systems.
URL of homepage: http://erm4hci.kognitivesysteme.de/
</description>
    <homepage>http://senldogo0039.springer-sbm.com</homepage>
    <pc-chairs>
        <pc-chair-id>person-32701425</pc-chair-id>
        <pc-chair-id>person-32863611</pc-chair-id>
        <pc-chair-id>person-32911671</pc-chair-id>
        <pc-chair-id>person-32913454</pc-chair-id>
        <pc-chair-id>person-32913567</pc-chair-id>
        <pc-chair-id>person-32931198</pc-chair-id>
    </pc-chairs>
    <pc-members>
        <pc-member-id>person-32630921</pc-member-id>
        <pc-member-id>person-32704045</pc-member-id>
        <pc-member-id>person-32712997</pc-member-id>
        <pc-member-id>person-32911621</pc-member-id>
        <pc-member-id>person-32911641</pc-member-id>
        <pc-member-id>person-32911677</pc-member-id>
        <pc-member-id>person-32911974</pc-member-id>
        <pc-member-id>person-32913488</pc-member-id>
        <pc-member-id>person-32913496</pc-member-id>
        <pc-member-id>person-32915628</pc-member-id>
        <pc-member-id>person-32917472</pc-member-id>
        <pc-member-id>person-32927093</pc-member-id>
        <pc-member-id>person-32927488</pc-member-id>
        <pc-member-id>person-32927585</pc-member-id>
        <pc-member-id>person-32929162</pc-member-id>
        <pc-member-id>person-32929261</pc-member-id>
        <pc-member-id>person-33059808</pc-member-id>
    </pc-members>
    <proceedings-list>
        <proceedings id="proceedings-0">
            <title>no-proceedings-present</title>
            <series>no-proceedings-present</series>
        </proceedings>
    </proceedings-list>
    <sessions>
        <session id="session-0" inProceedings="proceedings-0">
            <name>no-session-present</name>
            <papers>
                <paper-id>paper-0</paper-id>
            </papers>
            <pc-chairs>
                <pc-chair-id>person-32701425</pc-chair-id>
                <pc-chair-id>person-32863611</pc-chair-id>
                <pc-chair-id>person-32911671</pc-chair-id>
                <pc-chair-id>person-32913454</pc-chair-id>
                <pc-chair-id>person-32913567</pc-chair-id>
                <pc-chair-id>person-32931198</pc-chair-id>
            </pc-chairs>
            <pc-members>
                <pc-member-id>person-32630921</pc-member-id>
                <pc-member-id>person-32704045</pc-member-id>
                <pc-member-id>person-32712997</pc-member-id>
                <pc-member-id>person-32911621</pc-member-id>
                <pc-member-id>person-32911641</pc-member-id>
                <pc-member-id>person-32911677</pc-member-id>
                <pc-member-id>person-32911974</pc-member-id>
                <pc-member-id>person-32913488</pc-member-id>
                <pc-member-id>person-32913496</pc-member-id>
                <pc-member-id>person-32915628</pc-member-id>
                <pc-member-id>person-32917472</pc-member-id>
                <pc-member-id>person-32927093</pc-member-id>
                <pc-member-id>person-32927488</pc-member-id>
                <pc-member-id>person-32927585</pc-member-id>
                <pc-member-id>person-32929162</pc-member-id>
                <pc-member-id>person-32929261</pc-member-id>
                <pc-member-id>person-33059808</pc-member-id>
            </pc-members>
        </session>
    </sessions>
    <persons>
        <person id="person-32701425">
            <firstname>Christian</firstname>
            <lastname>Becker-Asano</lastname>
            <country>Germany</country>
            <organization-id>organisation-1126351405</organization-id>
            <email>basano@informatik.uni-freiburg.de</email>
        </person>
        <person id="person-32863611">
            <firstname>Kim</firstname>
            <lastname>Hartmann</lastname>
            <country>Germany</country>
            <organization-id>organisation-1131269827</organization-id>
            <email>kim.hartmann@ovgu.de</email>
        </person>
        <person id="person-32911671">
            <firstname>Jonathan</firstname>
            <lastname>Gratch</lastname>
            <country>United States</country>
            <organization-id>organisation-1688659916</organization-id>
            <email>gratch@ict.usc.edu</email>
        </person>
        <person id="person-32913454">
            <firstname>Björn</firstname>
            <lastname>Schuller</lastname>
            <country>Germany</country>
            <organization-id>organisation-3772194885</organization-id>
            <email>schuller@tum.de</email>
        </person>
        <person id="person-32913567">
            <firstname>Ronald</firstname>
            <lastname>Böck</lastname>
            <organization-id>no-organization-present</organization-id>
            <email>ronald.boeck@ovgu.de</email>
        </person>
        <person id="person-32931198">
            <firstname>Klaus</firstname>
            <lastname>Scherer</lastname>
            <organization-id>no-organization-present</organization-id>
            <email>klaus.scherer@unige.ch</email>
        </person>
        <person id="person-32630921">
            <firstname>Jonas</firstname>
            <lastname>Beskow</lastname>
            <country>Sweden</country>
            <organization-id>organisation-2147558398</organization-id>
            <email>beskow@kth.se</email>
        </person>
        <person id="person-32704045">
            <firstname>Jens</firstname>
            <lastname>Edlund</lastname>
            <country>Sweden</country>
            <organization-id>no-organization-present</organization-id>
            <email>edlund@speech.kth.se</email>
        </person>
        <person id="person-32712997">
            <firstname>Matthieu</firstname>
            <lastname>Courgeon</lastname>
            <organization-id>organisation-1917362183</organization-id>
            <email>courgeon@gmail.com</email>
            <email>courgeon@limsi.fr</email>
        </person>
        <person id="person-32911621">
            <firstname>Nadia</firstname>
            <lastname>Berthouze</lastname>
            <organization-id>organisation-2147567485</organization-id>
            <email>nadia.berthouze@ucl.ac.uk</email>
        </person>
        <person id="person-32911641">
            <firstname>Sidney</firstname>
            <lastname>DMello</lastname>
            <country>United States</country>
            <organization-id>no-organization-present</organization-id>
            <email>sdmello@nd.edu</email>
        </person>
        <person id="person-32911677">
            <firstname>Dirk</firstname>
            <lastname>Reichardt</lastname>
            <country>Germany</country>
            <organization-id>organisation-3496831656</organization-id>
            <email>reichardt@dhbw-stuttgart.de</email>
        </person>
        <person id="person-32911974">
            <firstname>Jianhua</firstname>
            <lastname>Tao</lastname>
            <country>China</country>
            <organization-id>organisation-3847237552</organization-id>
            <email>jhtao@nlpr.ia.ac.cn</email>
        </person>
        <person id="person-32913488">
            <firstname>Khiet</firstname>
            <lastname>Truong</lastname>
            <organization-id>organisation-683272563</organization-id>
            <email>K.P.Truong@utwente.nl</email>
        </person>
        <person id="person-32913496">
            <firstname>Michel</firstname>
            <lastname>Valstar</lastname>
            <organization-id>no-organization-present</organization-id>
            <email>michel.valstar@nottingham.ac.uk</email>
        </person>
        <person id="person-32915628">
            <firstname>Hazim Kemal</firstname>
            <lastname>Ekenel</lastname>
            <organization-id>no-organization-present</organization-id>
            <email>ekenel@kit.edu</email>
        </person>
        <person id="person-32917472">
            <firstname>Gary</firstname>
            <lastname>McKeown</lastname>
            <organization-id>organisation-2084356988</organization-id>
            <email>g.mckeown@qub.ac.uk</email>
        </person>
        <person id="person-32927093">
            <firstname>Andreas</firstname>
            <lastname>Wendemuth</lastname>
            <organization-id>organisation-1639127604</organization-id>
            <email>andreas.wendemuth@ovgu.de</email>
        </person>
        <person id="person-32927488">
            <firstname>Roland</firstname>
            <lastname>Goecke</lastname>
            <country>Australia</country>
            <organization-id>organisation-2127837956</organization-id>
            <email>roland.goecke@anu.edu.au</email>
        </person>
        <person id="person-32927585">
            <firstname>Karla</firstname>
            <lastname>Welch</lastname>
            <country>United States</country>
            <organization-id>organisation-781240556</organization-id>
            <email>karla.welch@louisville.edu</email>
        </person>
        <person id="person-32929162">
            <firstname>Marcello</firstname>
            <lastname>Mortillaro</lastname>
            <organization-id>no-organization-present</organization-id>
            <email>marcello.mortillaro@unige.ch</email>
        </person>
        <person id="person-32929261">
            <firstname>Carlos</firstname>
            <lastname>Busso</lastname>
            <country>United States</country>
            <organization-id>organisation-1815102030</organization-id>
            <email>busso@utdallas.edu</email>
        </person>
        <person id="person-33059808">
            <firstname>Marc</firstname>
            <lastname>Cavazza</lastname>
            <country>United Kingdom</country>
            <organization-id>organisation-92266551</organization-id>
            <email>M.O.Cavazza@tees.ac.uk</email>
        </person>
        <person id="person-0">
            <firstname>no-person-present</firstname>
            <lastname>no-person-present</lastname>
            <organization-id>no-organization-present</organization-id>
        </person>
    </persons>
    <papers>
        <paper id="paper-0">
            <title>no-paper-present</title>
            <abstract>no-paper-present</abstract>
            <keywords>
                <keyword></keyword>
            </keywords>
            <authors>
                <author-id>person-0</author-id>
            </authors>
        </paper>
    </papers>
    <organizations>
        <organization id="organisation-1126351405">
            <name>Albert-Ludwigs-Universität Freiburg</name>
            <country>Germany</country>
        </organization>
        <organization id="organisation-1131269827">
            <name>Institute for Information Technology and Communications</name>
            <country>Germany</country>
        </organization>
        <organization id="organisation-1688659916">
            <name>University of Southern California</name>
            <country>United States</country>
        </organization>
        <organization id="organisation-3772194885">
            <name>Technische Universität München</name>
            <country>Germany</country>
        </organization>
        <organization id="no-organization-present">
            <name>no-organization-present</name>
        </organization>
        <organization id="organisation-2147558398">
            <name>KTH</name>
            <country>Sweden</country>
        </organization>
        <organization id="organisation-1917362183">
            <name>Lab-STICC</name>
        </organization>
        <organization id="organisation-2147567485">
            <name>UCL</name>
        </organization>
        <organization id="organisation-3496831656">
            <name>DHBW Stuttgart</name>
            <country>Germany</country>
        </organization>
        <organization id="organisation-3847237552">
            <name>Chinese Academy of Sciences</name>
            <country>China</country>
        </organization>
        <organization id="organisation-683272563">
            <name>University of Twente</name>
        </organization>
        <organization id="organisation-2084356988">
            <name>Queen's University Belfast</name>
        </organization>
        <organization id="organisation-1639127604">
            <name>OvGU FEIT</name>
        </organization>
        <organization id="organisation-2127837956">
            <name>University of Canberra</name>
            <country>Australia</country>
        </organization>
        <organization id="organisation-781240556">
            <name>University of Louisville</name>
            <country>United States</country>
        </organization>
        <organization id="organisation-1815102030">
            <name>The University of Texas at Dallas</name>
            <country>United States</country>
        </organization>
        <organization id="organisation-92266551">
            <name>Teesside University</name>
            <country>United Kingdom</country>
        </organization>
    </organizations>
</conference>


text:
package com.bagri.xquery.saxon;

import static com.bagri.core.Constants.*;
import static com.bagri.xquery.saxon.SaxonUtils.*;
import static javax.xml.xquery.XQConstants.*;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.nio.charset.Charset;
import java.util.Collection;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TimeZone;

import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xquery.XQException;
import javax.xml.xquery.XQItem;
import javax.xml.xquery.XQSequence;
import javax.xml.xquery.XQStaticContext;

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;

import com.bagri.core.api.SchemaRepository;
import com.bagri.core.xquery.api.XQProcessorBase;
import com.bagri.support.util.XMLUtils;
import com.bagri.support.util.XQUtils;

import net.sf.saxon.Configuration;
import net.sf.saxon.dom.DocumentOverNodeInfo;
import net.sf.saxon.dom.NodeOverNodeInfo;
import net.sf.saxon.expr.instruct.GlobalParameterSet;
import net.sf.saxon.expr.instruct.GlobalVariable;
import net.sf.saxon.lib.Logger;
import net.sf.saxon.lib.StandardLogger;
import net.sf.saxon.lib.Validation;
import net.sf.saxon.om.DocumentInfo;
import net.sf.saxon.om.Item;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.query.DynamicQueryContext;
import net.sf.saxon.query.QueryResult;
import net.sf.saxon.query.StaticQueryContext;
import net.sf.saxon.query.XQueryExpression;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.value.DateTimeValue;
import net.sf.saxon.value.EmptySequence;
import net.sf.saxon.value.ObjectValue;

public abstract class XQProcessorImpl extends XQProcessorBase {

    protected Configuration config;
    protected StaticQueryContext sqc;
    //protected DynamicQueryContext dqc;

    protected Properties properties = new Properties();

    public XQProcessorImpl() {
        config = Configuration.newConfiguration();
        //config.setSchemaValidationMode(Validation.STRIP);
        //config.setConfigurationProperty(FeatureKeys.PRE_EVALUATE_DOC_FUNCTION, Boolean.TRUE);
        sqc = config.newStaticQueryContext();
        // supported in Saxon-EE only
        //sqc.setUpdatingEnabled(true);
	    //dqc = new DynamicQueryContext(config);
        //dqc.setApplyFunctionConversionRulesToExternalVariables(false);
        //sqc. cvr = new StandardObjectConverter();
        //JPConverter.allocate(XQItem.class, null, config);
        //config.setConfigurationProperty(FeatureKeys.LAZY_CONSTRUCTION_MODE, true);
    }

    protected abstract DynamicQueryContext getDynamicContext();

    public String getProperty(String propName) {
    	return properties.getProperty(propName);
    }

    public Properties getProperties() {
    	return properties;
    }

    public void setProperties(Properties props) {
    	this.properties.clear();
    	properties.putAll(props);
    	try {
    		setStaticContext(sqc, properties);
    	} catch (XQException ex) {
    		logger.error("setProperties.error", ex);
    	}
    }

	public boolean isFeatureSupported(int feature) {

		switch (feature) {
			case xqf_Module:
			case xqf_Update:
			case xqf_Full_Axis:
			case xqf_Serialization:
			case xqf_Transaction:
			case xqf_XQuery_Encoding_Decl: return true;

			case xqf_XQueryX:
			case xqf_Schema_Import:
			case xqf_Schema_Validation:
			case xqf_User_Defined_XML_Schema_Type:
			// next two not supported by Saxon itself :(
			case xqf_Static_Typing:
			case xqf_Static_Typing_Extensions:

			// next four from MetaData2 interface
			case xqf_XQuery_Update_Facility:
			case xqf_XQuery_Full_Text:
			case xqf_XQuery_30:
			case xqf_XA: return false;
		}
		return false;
	}

	public boolean isQueryReadOnly(final String query) throws XQException {
   	    return (query.indexOf(bg_remove_cln_documents) < 0) && (query.indexOf(bg_remove_document) < 0)
   	    		&& (query.indexOf(bg_store_document) < 0);
	}

    protected void setStaticContext(StaticQueryContext sqc, XQStaticContext ctx) throws XQException {
    	// !!
        sqc.setSchemaAware(false);
    	sqc.setBaseURI(ctx.getBaseURI());
    	//ctx.getBindingMode()
    	sqc.setPreserveBoundarySpace(ctx.getBoundarySpacePolicy() == BOUNDARY_SPACE_PRESERVE);
    	if (ctx.getConstructionMode() == CONSTRUCTION_MODE_PRESERVE) {
    		sqc.setConstructionMode(Validation.PRESERVE);
    	} else {
    		sqc.setConstructionMode(Validation.STRIP);
    	}
    	// ctx.getContextItemStaticType() -> contextItemStaticType
        //if (contextItemStaticType != null) {
        //    sqc.setRequiredContextItemType(contextItemStaticType.getSaxonItemType());
        //}
    	sqc.setInheritNamespaces(ctx.getCopyNamespacesModeInherit() == COPY_NAMESPACES_MODE_INHERIT);
    	sqc.setPreserveNamespaces(ctx.getCopyNamespacesModePreserve() == COPY_NAMESPACES_MODE_PRESERVE);
    	sqc.declareDefaultCollation(ctx.getDefaultCollation());
    	sqc.setDefaultElementNamespace(ctx.getDefaultElementTypeNamespace());
    	sqc.setDefaultFunctionNamespace(ctx.getDefaultFunctionNamespace());
        sqc.setEmptyLeast(ctx.getDefaultOrderForEmptySequences() == DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST);
    	sqc.clearNamespaces();
    	String[] prefixes = ctx.getNamespacePrefixes();
    	for (String prefix: prefixes) {
    		sqc.declareNamespace(prefix, ctx.getNamespaceURI(prefix));
    	}
    	//ctx.getHoldability()
    	//ctx.getOrderingMode()
    	if (ctx.getQueryLanguageTypeAndVersion() == LANGTYPE_XQUERY) {
    		sqc.setLanguageVersion(saxon_xquery_version);
    	}
    	//ctx.getQueryTimeout()
    	//ctx.getScrollability()
        //config.setConfigurationProperty(FeatureKeys.PRE_EVALUATE_DOC_FUNCTION, Boolean.TRUE);
    }

    protected void setStaticContext(StaticQueryContext sqc, Properties props) throws XQException {
		logger.trace("setStaticContext.enter; got props: {}", props);
       	// !!
        sqc.setSchemaAware(false);
        String value = props.getProperty(pn_xqj_baseURI);
        if (value != null && !value.isEmpty()) {
        	sqc.setBaseURI(value);
        }
    	//props.getProperty(pn_bindingMode)
        value = props.getProperty(pn_xqj_boundarySpacePolicy);
        if (value != null) {
        	sqc.setPreserveBoundarySpace(String.valueOf(BOUNDARY_SPACE_PRESERVE).equals(value));
        }
        value = props.getProperty(pn_xqj_constructionMode);
        if (value != null) {
        	if (String.valueOf(CONSTRUCTION_MODE_PRESERVE).equals(value)) {
        		sqc.setConstructionMode(Validation.PRESERVE);
        	} else {
        		sqc.setConstructionMode(Validation.STRIP);
        	}
        }
    	// ctx.getContextItemStaticType() -> contextItemStaticType
        //if (contextItemStaticType != null) {
        //    sqc.setRequiredContextItemType(contextItemStaticType.getSaxonItemType());
        //}
        value = props.getProperty(pn_xqj_defaultCollationUri);
        if (value != null) {
        	sqc.declareDefaultCollation(value);
        }
        value = props.getProperty(pn_xqj_defaultElementTypeNamespace);
        if (value != null) {
        	sqc.setDefaultElementNamespace(value);
        }
        value = props.getProperty(pn_xqj_defaultFunctionNamespace);
        if (value != null) {
        	sqc.setDefaultFunctionNamespace(value);
        }
    	value = props.getProperty(pn_xqj_defaultOrderForEmptySequences);
    	if (value != null) {
    		sqc.setEmptyLeast(String.valueOf(DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST).equals(value));
    	}
        value = props.getProperty(pn_xqj_copyNamespacesModeInherit);
        if (value != null) {
        	sqc.setInheritNamespaces(String.valueOf(COPY_NAMESPACES_MODE_INHERIT).equals(value));
        }
        value = props.getProperty(pn_xqj_copyNamespacesModePreserve);
        if (value != null) {
        	sqc.setPreserveNamespaces(String.valueOf(COPY_NAMESPACES_MODE_PRESERVE).equals(value));
        }
        value = props.getProperty(pn_xqj_defaultNamespaces);
        if (value != null) {
        	sqc.clearNamespaces();
        	StringTokenizer st = new StringTokenizer(value, " ");
        	while (st.hasMoreTokens()) {
        		String namespace = st.nextToken();
        		int idx = namespace.indexOf(":");
        		sqc.declareNamespace(namespace.substring(0, idx), namespace.substring(idx + 1));
        	}
    	}
    	//props.getProperty(pn_holdability)
    	//props.getProperty(pn_orderingMode)
        value = props.getProperty(pn_xqj_queryLanguageTypeAndVersion);
        if (value != null) {
        	if (String.valueOf(LANGTYPE_XQUERY).equals(value)) {
        		sqc.setLanguageVersion(saxon_xquery_version);
        	}
    	}
    	//props.getProperty(pn_queryTimeout)
    	//props.getProperty(pn_scrollability)
        if (logger.isTraceEnabled()) {
        	StringBuilder ns = new StringBuilder();
        	Iterator<String> itr = sqc.iterateDeclaredPrefixes();
        	while (itr.hasNext()) {
        		String prefix = itr.next();
        		ns.append(prefix).append(":").append(sqc.getNamespaceForPrefix(prefix)).append(" ");
        	}
        	if (ns.length() > 1) {
        		ns.deleteCharAt(ns.length() - 1);
        	}
        	logger.trace("setStaticContext.exit; built context: [baseURI: {}; preserveBoundarySpace: {}; constructionMode: {}; defaultCollationName: {}; " +
        			"defaultElementTypeNamespace: {}; defaultFunctionNamespace: {}; emptyLeast: {}; inheritNamespaces: {}; " +
        			"preserveNamespaces: {}; defaultNamespaces: {}; queryLanguageTypeAndVersion: {}]",
        			sqc.getBaseURI(), sqc.isPreserveBoundarySpace(), sqc.getConstructionMode(), sqc.getDefaultCollationName(), sqc.getDefaultElementNamespace(),
        			sqc.getDefaultFunctionNamespace(), sqc.isEmptyLeast(), sqc.isInheritNamespaces(), sqc.isPreserveNamespaces(), ns.toString(), sqc.getLanguageVersion());
        }
    }

    @Override
    public void setRepository(SchemaRepository xRepo) {
    	super.setRepository(xRepo);
        registerExtensions(config, xRepo);
        if (xRepo instanceof com.bagri.core.server.api.SchemaRepository) {
        	logger.debug("setRepository; registering extensions");
        	XQCompilerImpl.registerExtensions(config, ((com.bagri.core.server.api.SchemaRepository) xRepo).getLibraries());
        } else {
        	logger.debug("setRepository; client side repo - has no access to extensions");
        }
    }

    public Document convertToDocument(String xml) throws XQException {

    	String baseURI = sqc.getBaseURI();
        StringReader sr = new StringReader(xml);
        InputSource is = new InputSource(sr);
        is.setSystemId(baseURI);
        Source source = new SAXSource(is);
        source.setSystemId(baseURI);

        try {
        	DocumentInfo doc = config.buildDocument(source);
        	return (Document) DocumentOverNodeInfo.wrap(doc);
		} catch (XPathException ex) {
			throw new XQException(ex.getMessage());
		}
    }

	public String convertToString(Object item, Properties props) throws XQException {

		if (item instanceof NodeOverNodeInfo) {
			try {
				if (props == null) {
					return QueryResult.serialize(((NodeOverNodeInfo) item).getUnderlyingNodeInfo());
				} else {
					Writer writer = new StringWriter();
					QueryResult.serialize(((NodeOverNodeInfo) item).getUnderlyingNodeInfo(), new StreamResult(writer), props);
					writer.close();
					return writer.toString();
				}
			} catch (IOException | XPathException ex) {
				throw new XQException(ex.getMessage());
			}
		} else if (item instanceof Node) {
			try {
				return XMLUtils.nodeToString((Node) item, props);
			} catch (Exception ex) {
				throw new XQException(ex.getMessage());
			}
		} else if (item instanceof ObjectValue) {
			return convertToString(((ObjectValue) item).getObject(), props);
		} else if (item instanceof XQSequence) {
			// TODO: do this via standard Saxon plugins?!
			String method = props.getProperty(OutputKeys.METHOD);
			if (method != null && method.equalsIgnoreCase("map")) {
				Map<String, Object> result = XQUtils.mapFromSequence((XQSequence) item);
				return result.toString();
			}

			Writer writer = new StringWriter();
			SequenceIterator itr = new XQSequenceIterator((XQSequence) item, config);
			try {
				QueryResult.serializeSequence(itr, config, writer, props);
				writer.close();
			} catch (IOException | XPathException ex) {
				throw new XQException(ex.getMessage());
			}
			return writer.toString();
		} else if (item instanceof XQItem) {
			return ((XQItem) item).getItemAsString(props);
		} else {
			return item.toString();
		}
	}

	//@Override
    public void bindVariable(String varName, Object var) throws XQException {
    	try {
    		DynamicQueryContext dqc = getDynamicContext();
    		if (var == null) {
        		dqc.setParameter(getStructuredQName(varName), EmptySequence.getInstance());
    		} else {
        		Item item;
	    		if (var instanceof XQItem) {
	    			item = convertXQItem((XQItem) var, config);
	    		} else {
	    			item = objectToItem(var, config);
	    		}
	    		dqc.setParameter(getStructuredQName(varName), item);
    		}
    	} catch (XPathException ex) {
    		throw new XQException(ex.getMessage());
    	}
    }

	//@Override
    public void unbindVariable(String varName) throws XQException {
		DynamicQueryContext dqc = getDynamicContext();
        dqc.setParameter(getStructuredQName(varName), null);
    }

    private static StructuredQName getStructuredQName(String vName) {
    	//return new StructuredQName(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart());
    	return StructuredQName.fromClarkName(vName);
    }

    // why it is not <QName, Object> ??
    // because it is used in QueryBuilder where params identified by plain Strings
    protected Map<String, Object> getObjectParams() throws XPathException {
		DynamicQueryContext dqc = getDynamicContext();
    	GlobalParameterSet params = dqc.getParameters();
    	// got params.getNumberOfKeys() = -1 at one test!
    	//Map<String, Object> bindings = new HashMap<>(params.getNumberOfKeys());
    	Map<String, Object> bindings = new HashMap<>();
    	for (StructuredQName name: params.getKeys()) {
    		Object value = params.get(name);
    		if (value instanceof EmptySequence) {
    			value = null;
    		} else {
    			value = itemToObject((Item) value);
				//value = SequenceTool.convertToJava((Item) value);
    		}
    		bindings.put(name.getClarkName(), value);
    	}
		logger.trace("getObjectParams; returning: {}", bindings);
    	return bindings;
    }

    protected String explainQuery(XQueryExpression exp) throws XPathException {
    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
    	PrintStream ps = new PrintStream(baos);
    	Logger log = new StandardLogger(ps);
        exp.getExpression().explain(log);
        String res = new String(baos.toByteArray(), Charset.defaultCharset());
        log.close();
        ps.close();
        try {
			baos.close();
		} catch (IOException ex) {
			throw new XPathException(ex);
		}
        return res;
    }

    // this is for test only?
    public void parseXQuery(String query) throws XQException {
		DynamicQueryContext dqc = getDynamicContext();
        try {
	        final XQueryExpression exp = sqc.compileQuery(query);
	        // why do we do this? to populate dqc with params??
	        List results = exp.evaluate(dqc);
	        for (Object result: results) {
	            logger.trace("result: {}; class: {}", result, result.getClass().getName());
	        }
        } catch (XPathException ex) {
        	logger.error("parseXQuery.error: ", ex);
        	throw new XQException(ex.getMessage());
        }
    }

	//@Override
    public Collection<String> prepareXQuery(String query, XQStaticContext ctx) throws XQException {

        setStaticContext(sqc, ctx);
        try {
	        final XQueryExpression exp = sqc.compileQuery(query);
	        if (logger.isTraceEnabled()) {
	        	logger.trace("prepareXQuery; query: \n{}", explainQuery(exp));
	        }

	        Set<String> result = new HashSet<>();
	        Iterator<GlobalVariable> itr = exp.getMainModule().getModuleVariables();
	        while (itr.hasNext()) {
	        	result.add(itr.next().getVariableQName().getClarkName());
	        }
	        return result;
        } catch (XPathException ex) {
        	logger.error("prepareXQuery.error: ", ex);
        	throw new XQException(ex.getMessage());
        }
    }

    public void setTimeZone(TimeZone timeZone) throws XQException {

        GregorianCalendar now = new GregorianCalendar(timeZone);
		DynamicQueryContext dqc = getDynamicContext();
        try {
            dqc.setCurrentDateTime(new DateTimeValue(now, true));
        } catch (XPathException ex) {
            throw new XQException(ex.getMessage());
        }
    }

    public void close() {
    	//config.clearSchemaCache();
    }
}


text:
#ifndef _ACOLYTE_H_
#define _ACOLYTE_H_

#include <ostream>
#include <string>
#include "Skill.h"
#include "Novice.h"
using std::string;
using std::ostream;

class Acolyte : public Novice
{
	//Defined operator output
	friend ostream &operator<<(ostream &, const Acolyte &);
public:
	// Default constructor
	Acolyte();
	// Constructor
	Acolyte(const string &, const string &, const Date &, const Skill &, int, int, const Skill &);
	// Copy constructor
	Acolyte(const Acolyte &);
	// Destructor
	~Acolyte();
	// Defined operator ==
	bool operator== (const Acolyte &) const;
	// Defined operator !=
	bool operator!= (const Acolyte &acolyte) const
	{
		return ! (*this == acolyte);
	}
	// Defined = operator
	const Acolyte &operator= (const Acolyte &);
	// Print acolyte info
	void printInfo() const;
	// Skill cure
	void cure() const;
	// Skill blessing
	void blessing() const;
	// Add skill of acolyte skill list
	void addSkill(const Skill &);
	// User acolyte mount
	void useMount() const;
	// List additive skill
	void listAvailableSkill() const;
private:
	int skillNumber;
	Skill *yourAcolyteSkillList;
	static const string AVAILABLE_ACOLYTE_SKILLS[2];
};

#endif /* _ACOLYTE_H__*/


text:
layout: default
title: hust-latex | FAQs
---

Q: What's LaTeX? How can I learn it?

LaTeX is a document preparation system and document markup language. It is widely used for the communication and publication of scientific documents in many fields, including mathematics, physics, and computer science. [Source:  Wikipedia]

For beginners,  lshort is the best book to begin with. Also there's  a tutorial slide which introduces LaTeX and these templates.

Q: How to install these templates?

Firstly, you need to install the latest version of  TeXLive,  MikTeX or  MacTeX. Please ensure that all the packages are up-to-date.

Then you need to install following Chinese fonts:

AdobeSongStd-Light

AdobeKaitiStd-Regular

AdobeHeitiStd-Regular

AdobeFangsongStd-Regular

Finally, download the template, run below command to install it:

For Linux and Mac users, run sudo make install.

For Windows users, run makewin32.bat install.

If you want to uninstall the template, run below command:

For Linux and Mac users, run sudo make uninstall.

For Windows users, run makewin32.bat uninstall.

Q: I get below errors during installation, how to solve it?

This is LuaTeX, Version beta-0.71.1-2011082016 (rev 4277)
(C:/Users/Administrator/hustthesis-master/hustthesis/hustthesis.ins)
LaTeX2e <2011/06/27>
LuaTeX adaptation of babel <v3.81-luatex-1.4> and hypenation patterns for loaded.
! I can't find file `l3docstrip.tex'.
l.22 \input l3docstrip.tex

Please type another input file name:

This is because your LaTeX version is way too old. It's more than likely that you installed the  CTeX  which has not been updated for years. I strongly recommend that you install  TeXLive,  MikTeX or  MacTeX insteadly.

Q: I get below errors during compilation, how to solve it?

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.180 \changefont{linespread=1.3}

?

This has been fixed in the latest version of the templates. Please update your templates

Q: I get other errors than mentioned above, what should I do?

Please report your problem in correspond Github issues page.

Q: I want to contribute to this project, what should I do?

If you were a huster and willing to contribute to this project, please contact  Prof. Hei Xiaojun.

Also this is a list of materials you may find helpful for developing LaTeX templates:

 LaTeX2e for class and package writers.

 How to Package Your LaTeX Package.