text:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 -->

<taeDescription xmlns="http://uima.apache.org/resourceSpecifier">
   <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
   <primitive>false</primitive>
   <delegateAnalysisEngineSpecifiers>
      <delegateAnalysisEngine key="annotator1">
         <import location="./Annotator1.xml"/>
      </delegateAnalysisEngine>
      <delegateAnalysisEngine key="annotator2">
         <import location="./Annotator2.xml"/>
      </delegateAnalysisEngine>
      <delegateAnalysisEngine key="annotator3">
         <import location="./Annotator3.xml"/>
      </delegateAnalysisEngine>
   </delegateAnalysisEngineSpecifiers>

   <analysisEngineMetaData>
      <name>Sequencer Test aggregate TAE</name>
      <description>SequencerTest runs same primitive annotator two times.</description>
      <version>1.0</version>
      <vendor>The Apache Software Foundation Corporation</vendor>

      <configurationParameters>
      </configurationParameters>

      <configurationParameterSettings>
      </configurationParameterSettings>

      <flowConstraints>
         <capabilityLanguageFlow>
            <node>annotator1</node>
            <node>annotator2</node>
            <node>annotator3</node>
         </capabilityLanguageFlow>
      </flowConstraints>

      <fsIndexes/>

      <capabilities>
         <capability>
            <inputs/>
            <outputs>
               <type>uima.tt.TokenAnnotation</type>
               <type>uima.tt.SentenceAnnotation</type>
               <type>uima.tt.ParagraphAnnotation</type>
               <feature>uima.tcas.DocumentAnnotation:categories</feature>
            </outputs>
            <languagesSupported>
                <language>x-unspecified</language>
            </languagesSupported>
         </capability>
         <capability>
            <inputs/>
            <outputs>
               <type>uima.tt.Lemma</type>
               <type>uima.tt.CompPartAnnotation</type>
            </outputs>
            <languagesSupported>
                <language>en</language>
                <language>de</language>
                <language>ja</language>
            </languagesSupported>
         </capability>
      </capabilities>

   </analysisEngineMetaData>
</taeDescription>


text:
Messages of transactional activities that result in log entries in the `mb-logging` database.

##### Consumer
Logging Consumer Application: [mbc-logging-gateway](https://github.com/DoSomething/Quicksilver-PHP/tree/master/mbc-logging-gateway).

##### Exchange
`transactionalExchange`

##### Binding Kyes
- `*.*.transactional`

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if !JSONNET_XMLDISABLE || UNITY_EDITOR
using System.Xml;
#endif
using System.Globalization;

namespace Newtonsoft.Json.Utilities
{
  internal static class DateTimeHelpers
  {
    public static string GetLocalOffset(this DateTime d)
    {
      TimeSpan utcOffset;
#if (UNITY_IOS || UNITY_WEBGL || UNITY_XBOXONE || UNITY_XBOX360 || UNITY_PS4 || UNITY_PS3 || UNITY_WII || UNITY_IPHONE)
      utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(d);
#else
      utcOffset = TimeZoneInfo.Local.GetUtcOffset(d);
#endif

      return utcOffset.Hours.ToString("+00;-00", CultureInfo.InvariantCulture) + ":" + utcOffset.Minutes.ToString("00;00", CultureInfo.InvariantCulture);
    }

#if !(JSONNET_XMLDISABLE || (UNITY_WP8 || UNITY_WP_8_1) || UNITY_WINRT) || UNITY_EDITOR
    public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind)
    {
      switch (kind)
      {
        case DateTimeKind.Local:
          return XmlDateTimeSerializationMode.Local;
        case DateTimeKind.Unspecified:
          return XmlDateTimeSerializationMode.Unspecified;
        case DateTimeKind.Utc:
          return XmlDateTimeSerializationMode.Utc;
        default:
          throw MiscellaneousUtils.CreateArgumentOutOfRangeException("kind", kind, "Unexpected DateTimeKind value.");
      }
    }
#endif
  }
}

#endif


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

namespace RandomCSharp
{
    class Program
    {
        static void Main(string[] args)
        {

            Random RandomNumber = new Random();

            for( int i = 0; i < 10; i++ )
            {
                // ULIMIT
                //int num = RandomNumber.Next();

                // ( FROM, TO (UNINCLUDED) )
                int num = RandomNumber.Next(1,11);

                Console.WriteLine(num);

            }

        }
    }
}


text:
package org.mcsoxford.rss;

/**
 * Data about an RSS item.
 *
 * @author Mr Horn
 */
public class RSSItem extends RSSBase {
  private final java.util.List<MediaThumbnail> thumbnails;

  /* Internal constructor for RSSHandler */
  RSSItem(byte categoryCapacity, byte thumbnailCapacity) {
    super(categoryCapacity);
    thumbnails = new java.util.ArrayList<MediaThumbnail>(thumbnailCapacity);
  }

  /* Internal method for RSSHandler */
  void addThumbnail(MediaThumbnail thumbnail) {
    thumbnails.add(thumbnail);
  }

  /**
   * Returns an unmodifiable list of thumbnails. The return value is never
   * {@code null}. Images are in order of importance.
   */
  public java.util.List<MediaThumbnail> getThumbnails() {
    return java.util.Collections.unmodifiableList(thumbnails);
  }
}


text:
package org.apache.camel.component.mapstruct.dto;

public class CarDto {

    private String brand;
    private String model;
    private int year;
    private boolean electric;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public boolean isElectric() {
        return electric;
    }

    public void setElectric(boolean electric) {
        this.electric = electric;
    }
}


text:
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]

Symfony Bundle for [jeremykendall/php-domain-parser](https://github.com/jeremykendall/php-domain-parser).

## Documentation

The source of the documentation is stored in the `Resources/doc/` folder in this bundle:

[Documentation](src/Resources/doc/index.rst)

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Testing

``` bash
$ composer test
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

## Security

If you discover any security related issues, please email minottoemanuele@gmail.com instead of using the issue tracker.

## Credits

- [Emanuele Minotto][link-author]
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

[ico-version]: https://img.shields.io/packagist/v/emanueleminotto/domain-parser-bundle.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/EmanueleMinotto/DomainParserBundle/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/EmanueleMinotto/DomainParserBundle.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/EmanueleMinotto/DomainParserBundle.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/emanueleminotto/domain-parser-bundle
[link-travis]: https://travis-ci.org/EmanueleMinotto/DomainParserBundle
[link-scrutinizer]: https://scrutinizer-ci.com/g/EmanueleMinotto/DomainParserBundle/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/EmanueleMinotto/DomainParserBundle
[link-author]: https://github.com/EmanueleMinotto
[link-contributors]: ../../contributors


text:
<?php
include '../core/config.php';
include '../core/RESTCalls.php';

$reset = $_GET['reset'];

if(!isset($_COOKIE['JEngine_ScenarioID']) || ($reset == "scenarioID")) {
	$scenarios = ShowScenarios();
	$ScenarioIDs = $scenarios["ids"];
	?>

 Please select your Scenario

		<form action='update_jcore_controller.php' method='post'>
		<select name="pcm_scenarioID">
		<option value=""></option>
		<?php
		    foreach($ScenarioIDs as $key => $value) {
		       $value = htmlspecialchars($value);
		       echo '<option value="'. $value .'">'. $value .'</option>';
		    }
		?>
		</select>
		<input type='submit' value='Submit'>
		</form>

<?php } elseif(!isset($_COOKIE['JEngine_ScenarioInstanceID']) || ($reset == "scenarioinstanceID")) {
	$scenarioinstances = ShowScenarioInstances($_COOKIE['JEngine_ScenarioID']);
	$scenarioinstanceIds = $scenarioinstances["ids"];
	?>

 Please select your ScenarioInstance

		<form action='update_jcore_controller.php' method='post'>
		<select name="pcm_scenarioinstances">
		<option value=""></option>
		<?php
		    foreach($scenarioinstanceIds as $key => $value) {
		       $category = htmlspecialchars($category);
		       echo '<option value="'. $value .'">'. $value .'</option>';
		    }
		?>
		</select>
		<input type='submit' value='Submit'>
		</form>

		<?php
        echo "<form action='update_jcore_controller.php' method='post'>
		            <input type='hidden' name='pcm_scenarioID_new_Instance' value='".$_COOKIE['JEngine_ScenarioID']."'>

		            <input type='submit' value='create new Instance'>
		        </form>
";

}

if((isset($_COOKIE['JEngine_ScenarioInstanceID'])) && (isset($_COOKIE['JEngine_ScenarioID']))) { ?>

        ×
        Current Working Set Scenario ID: <?php echo $_COOKIE['JEngine_ScenarioID']; ?> | Instance ID: <?php echo $_COOKIE['JEngine_ScenarioInstanceID']; ?> |
        <form action='update_jcore_controller.php' method='post'>
	            <input type='hidden' name='reset_scenarioID' value='true'>
	            <input type='submit' class="btn btn-link" value='change scenarioID'>
		</form>
		| <form action='update_jcore_controller.php' method='post'>
	            <input type='hidden' name='reset_scenarioinstanceID' value='true'>
	            <input type='submit' class="btn btn-link" value='change scenarioinstanceID'>
		</form>

<?php

	$enabled_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "enabled");

    echo "
enabled Activities

    				 ID
    				 Label
    				Action

";

    $amount_of_enabled_activities = count($enabled_activities["ids"]);
    for ($i = 0; $i < $amount_of_enabled_activities; $i++) {
    	 $key = $enabled_activities["ids"][$i];
    	 $label = $enabled_activities["label"][$key];
    	 if($key == "{" || $label == "{") {
    	 	continue;
    	 }
    //foreach($enabled_activities["label"] as $key => $value) {
			  echo "
";
			  echo "".$key."	";
			  echo "".$label."	";
			  echo "<form action='update_jcore_controller.php' method='post'>
	            			<input type='hidden' name='update_activity_status_begin' value='true'>
	            			<input type='hidden' name='pcm_scenarioID' value='".$_COOKIE['JEngine_ScenarioID']."'>
	            			<input type='hidden' name='pcm_scenarioinstances' value='".$_COOKIE['JEngine_ScenarioInstanceID']."'>
	            			<input type='hidden' name='pcm_activity' value='".$key."'>
	          				<input type='submit' class='btn btn-link' value='begin'>
						</form> 	";
			  echo "
";
	}
	echo "

";
	$running_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "running");

    echo "
running Activities

    				 ID
    				 Label

";

    $amount_of_running_activities = count($running_activities["ids"]);
    for ($i = 0; $i < $amount_of_running_activities; $i++) {
    	 $key = $running_activities["ids"][$i];
    	 $value = $running_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
	//}
    //foreach($running_activities["label"] as $key => $value) {
    	      echo "
";
			  echo "".$key."	";
			  echo "".$value."	";
			  echo "<form action='update_jcore_controller.php' method='post'>
	            			<input type='hidden' name='update_activity_status_terminate' value='true'>
	            			<input type='hidden' name='pcm_scenarioID' value='".$_COOKIE['JEngine_ScenarioID']."'>
	            			<input type='hidden' name='pcm_scenarioinstances' value='".$_COOKIE['JEngine_ScenarioInstanceID']."'>
	            			<input type='hidden' name='pcm_activity' value='".$key."'>
	          				<input type='submit' class='btn btn-link' value='terminate'>
						</form>	";
		      echo "
";
	}
	echo "

";

    $terminated_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "terminated");

    echo "
terminated Activities

    				 ID
    				 Label

";

    $amount_of_terminated_activities = count($terminated_activities["ids"]);
    for ($i = 0; $i < $amount_of_terminated_activities; $i++) {
    	 $key = $terminated_activities["ids"][$i];
    	 $value = $terminated_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($terminated_activities["label"] as $key => $value) {
    	      echo "
";
			  echo "".$key."	";
			  echo "".$value."	";
		      echo "
";
	}
	echo "

";

	$dataobjects = GetAllDataobject($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID']);

    echo "
Dataobject

    				 ID
    				 States
    				 Label

";

    $amount_of_dataobjects = count($dataobjects["ids"]);
    for ($i = 0; $i < $amount_of_dataobjects; $i++) {
    	 $key = $dataobjects["ids"][$i];
    	 $label = $dataobjects["label"][$key];
    	 $states = $dataobjects["states"][$key];
    	 if($key == "{" || $label == "{" || $states == "{") {
    	 	continue;
    	 }
    //foreach($terminated_activities["label"] as $key => $value) {
    	      echo "
";
			  echo "".$key."	";
			  echo "".$label."	";
			  echo "".$states."	";
		      echo "
";
	}
	echo "
";
} ?>


text:
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;

import com.google.common.io.CharStreams;
import com.inn.trusthings.integration.TrustFilterByExclusion;
import com.inn.trusthings.integration.TrustScorer;
import com.inn.trusthings.module.Factory;
import com.inn.trusthings.service.interfaces.TrustManager;

public class TrustEngineExample {

	public void runExample(){

		try {
			//create trust manager
			TrustManager trustManager =  Factory.createInstance(TrustManager.class);
			//load (from json file) and set trust criteria
			InputStream is = TrustEngineExample.class.getResourceAsStream("/criteria/criteria1.json");
			String	criteria = CharStreams.toString(new InputStreamReader(is));
			trustManager.setGlobalTrustCriteria(criteria);
			is.close();

			//add some descriptions (trust profiles)
			URI service_a = URI.create("http://localhost/services/CITY_TRAFFIC_SERVICE_A");
			URI service_b = URI.create("http://localhost/services/CITY_TRAFFIC_SERVICE_B");
			URI service_d = URI.create("http://localhost/services/CITY_TRAFFIC_SERVICE_D");
			InputStream r1is = TrustEngineExample.class.getResourceAsStream("/modelrepo/city_traffic_service_A.ttl");
			trustManager.addResourceDescription(service_a,r1is);
			r1is.close();
			InputStream r2is = TrustEngineExample.class.getResourceAsStream("/modelrepo/city_traffic_service_B.ttl");
			trustManager.addResourceDescription(service_b, r2is);
			r2is.close();
			InputStream r3is = TrustEngineExample.class.getResourceAsStream("/modelrepo/city_traffic_service_D.ttl");
			trustManager.addResourceDescription(service_d, r3is);
			r3is.close();
			/*
			 * SCORING
			 */
			//create trust scorer and pass trustManager
			TrustScorer s = new TrustScorer(trustManager);
			//obtain and print trust indexes for resources
			System.out.println(service_a.toASCIIString()+" has trust index value:"+s.apply(service_a));
			System.out.println(service_b.toASCIIString()+" has trust index value:"+s.apply(service_b));
			System.out.println(service_b.toASCIIString()+" has trust index value:"+s.apply(service_d));

			/*
			 * FILTERING
			 */
			//create trust filer to filter out those not trusted
			TrustFilterByExclusion f = new TrustFilterByExclusion(trustManager);
			//obtain trust indexes for resources
			System.out.println(service_a.toASCIIString()+" is trusted = "+f.apply(service_a));
			System.out.println(service_b.toASCIIString()+" is trusted = "+f.apply(service_b));
			System.out.println(service_b.toASCIIString()+" is trusted = "+f.apply(service_d));

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		new TrustEngineExample().runExample();
	}

}


text:
namespace GLIB.Libraries
{

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    /// <summary>
    /// Class modified from UnifyCommunity (wiki.unity3d.com)
    /// </summary>
    public class Toolbox : Singleton<Toolbox>
    {
        protected Toolbox() { } // guarantee this will be always a singleton only - can't use the constructor!

        void Awake()
        {
            // Your initialization code here
        }

        // (optional) allow runtime registration of global objects
        static public T ResolveComponent<T>() where T : Component
        {
            T component = Instance.gameObject.GetComponent<T>();

            if (component == null)
            {
                component = Instance.gameObject.AddComponent<T>();
            }

            return component;
        }

    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>GameObject</title>
<meta name="date" content="2015-07-26">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

bge.components

Class GameObject

java.lang.Object

bge.components.GameObject

public class GameObject
extends java.lang.Object

Created by Yannic Siebenhaar on 23.07.2015.

Constructor Summary

Constructors

Constructor and Description

GameObject()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
addComponent(Component component)

Component
getComponent(java.lang.String component)

Renderer
getRenderer()

Transform
getTransform()

void
setRenderer(Renderer renderer)

void
update()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GameObject

public GameObject()

Method Detail

getTransform

public Transform getTransform()

addComponent

public void addComponent(Component component)

getComponent

public Component getComponent(java.lang.String component)

getRenderer

public Renderer getRenderer()

setRenderer

public void setRenderer(Renderer renderer)

update

public void update()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
import { Options, TokenProps } from "./types";
declare const anchorme: {
    (arg: string | {
        input: string;
        options?: Partial<Options> | undefined;
        extensions?: {
            test: RegExp;
            transform: (string: string) => string;
        }[] | undefined;
    }): string;
    list(input: string): TokenProps[];
    validate: {
        ip: (input: string) => boolean;
        email: (input: string) => boolean;
        file: (input: string) => boolean;
        url: (input: string) => boolean;
    };
};
export default anchorme;


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

import java.util.concurrent.TimeUnit;

import org.junit.experimental.categories.Category;

import com.crawljax.browser.EmbeddedBrowser;
import com.crawljax.core.CrawljaxController;
import com.crawljax.core.configuration.CrawlSpecification;
import com.crawljax.core.configuration.CrawljaxConfiguration;
import com.crawljax.core.configuration.ThreadConfiguration;
import com.crawljax.test.BrowserTest;

/**
 * Test specification for crawling the wivet benchmark project.
 */
@Category(BrowserTest.class)
public class WivetTest {

	/**
	 * @return the crawljax specification
	 */
	private static CrawlSpecification getCrawlSpec() {
		CrawlSpecification crawler =
		        new CrawlSpecification("http://caos.uab.es/~gruiz/test/wivet/");
		crawler.setMaximumStates(0);
		crawler.setDepth(0);
		crawler.setRandomInputInForms(true);
		crawler.clickMoreElements();
		crawler.setClickOnce(true);
		crawler.setWaitTimeAfterReloadUrl(20, TimeUnit.MILLISECONDS);
		crawler.setWaitTimeAfterEvent(200, TimeUnit.MILLISECONDS);
		crawler.dontClick("a").withAttribute("href", "../innerpages/2_2.php");
		crawler.dontClick("a").withText("Logout");
		return crawler;
	}

	/**
	 * @return the crawljax thread configuration
	 */
	private static ThreadConfiguration getThreadConfiguration() {
		ThreadConfiguration tc = new ThreadConfiguration();
		tc.setBrowserBooting(true);
		tc.setNumberBrowsers(1);
		tc.setNumberThreads(1);
		return tc;
	}

	/**
	 * @return the crawljax configuration
	 */
	private static CrawljaxConfiguration getConfig() {
		CrawljaxConfiguration crawljaxConfiguration = new CrawljaxConfiguration();
		crawljaxConfiguration.setThreadConfiguration(getThreadConfiguration());
		crawljaxConfiguration.setBrowser(EmbeddedBrowser.BrowserType.firefox);
		crawljaxConfiguration.setCrawlSpecification(getCrawlSpec());
		/* proxy stuff */
		/*
		 * ProxyConfiguration p = new ProxyConfiguration(); p.setHostname("localhost");
		 * p.setPort(8080); crawljaxConfiguration.setProxyConfiguration(p);
		 */
		return crawljaxConfiguration;
	}

	/**
	 * @param args
	 *            none.
	 */
	public static void main(String[] args) {
		CrawljaxController crawljax = new CrawljaxController(getConfig());
		crawljax.run();
	}
}


text:
from FeatureExtractionAlgorithms import FEA
from pathlib import Path
import sys

class AutomizedFEA():

	"""
	Automatically applies FEA on a whole directory with some options

	@parameters:
	directory			string		directory for normalized files are stored
	target				string		directory where JSON files will be stored
	prefix				string		optional prefix, if passing a prefix, only files with that prefix will be used
									and the prefix is taken as classname for those files
	f_type[=txt]		string		file extention for files that are used, only files with that extension will be read
	use_json[=False]	bool		if set True, FEAs will use existing JSON files
	"""

	def __init__(self, directory, target, prefix="", f_type="txt", use_json=False):
		"""
		@attributes
		self.dir		string	directory where normalized source files are stored
		self.prefix		string	only files with that prefix will be used
		self.target		string	path where feature maps will be saved
		self.use_json	bool	use existing JSON info in FEAs
		self.f_type		string	only use files of that type
		self.files		list	all files as PosixPaths
		"""

		self.dir = directory
		self.prefix = prefix
		self.target = target

		self.use_json = use_json

		self.f_type = f_type
		self.files = list(Path(self.dir).rglob(self.prefix + "*." + self.f_type))

	def process(self):
		"""
		Processes all files in self.files by determining their classname from the filename or self.prefix
		and creating their FEA Object.

		@variables
		amount_of_vectors	int		tracks how many files where processed yet together with enumerate in for loop

		@returns	None
		"""
		if self.use_json:
			print("Using already calculated data...")

		amount_of_vectors = len(self.files)

		for pos, f in enumerate(self.files):
			if not self.prefix:
				class_name = f.name.split("_")[0]
			else:
				class_name = self.prefix

			fea = FEA(class_name, str(f), self.target, use_json=self.use_json)
			if fea.finalize():
				print(str(pos+1) + "/" + str(amount_of_vectors) + " processed files. (at " + f.name + ")")

if __name__ == '__main__':
	if len(sys.argv) == 3:
		afea = AutomizedFEA(sys.argv[1], sys.argv[2])
	elif len(sys.argv) == 4:
		afea = AutomizedFEA(sys.argv[1], sys.argv[2], use_json=sys.argv[3])
	elif len(sys.argv) == 5:
		afea = AutomizedFEA(sys.argv[1], sys.argv[2], use_json=sys.argv[3], prefix=sys.argv[4])
	else:
		print("USAGE: python3 AutomizedFEA.py [input] [target] [[prefix]] [[use_json]]")
		exit()

	afea.process()


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

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://ofbiz.apache.org/Widget-Screen" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Screen http://ofbiz.apache.org/dtds/widget-screen.xsd">

    <screen name="main-decorator">

            <actions>
                <property-map resource="IsMgrUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="AssetMaintUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="activeApp" value="ismgr" global="true"/>
                <set field="applicationMenuName" value="IsMgrAppBar" global="true"/>
                <set field="applicationMenuLocation" value="component://assetmaint/widget/ismgr/Menus.xml" global="true"/>
                <set field="layoutSettings.companyName" from-field="uiLabelMap.IsMgrCompanyName" global="true"/>
                <set field="layoutSettings.companySubtitle" from-field="uiLabelMap.IsMgrCompanySubtitle" global="true"/>

            </actions>
            <widgets>
                <include-screen name="ApplicationDecorator" location="component://commonext/widget/CommonScreens.xml"/>
            </widgets>

    </screen>

    <screen name="CommonFixedAssetDecorator">

            <actions>
                <set field="headerItem" value="ComputerHardware"/>
            </actions>
            <widgets>
                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="pre-body">

                            <condition>
                                <not><if-empty field="fixedAssetId"/></not>
                            </condition>
                            <widgets>
                                <include-menu name="ComputerHardwareTabBar" location="component://assetmaint/widget/ismgr/Menus.xml"/>
                            </widgets>

                        <decorator-section-include name="pre-body"/>
                    </decorator-section>
                    <decorator-section name="body">

                            <widgets>
                                <include-menu name="FixedAssetSubTabBar" location="component://assetmaint/widget/ismgr/Menus.xml"/>
                            </widgets>

                            <condition>
                                <if-service-permission service-name="fixedAssetPermissionCheck" main-action="VIEW"/>
                            </condition>
                            <widgets>

                                    <condition>
                                        <not><if-empty field="fixedAssetId"/></not>
                                    </condition>
                                    <widgets>
                                        <container style="h1"></container>
                                    </widgets>
                                    <fail-widgets>
                                        <container style="h1"></container>
                                    </fail-widgets>

                                <decorator-section-include name="body"/>
                            </widgets>
                            <fail-widgets>

                            </fail-widgets>

                    </decorator-section>
                </decorator-screen>
            </widgets>

    </screen>

    <screen name="CommonComputerSoftwareDecorator">

            <actions>
                <set field="headerItem" value="ComputerSoftware"/>
            </actions>
            <widgets>
                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">

                    <decorator-section name="body">

                            <widgets>
                                <include-menu name="FixedAssetSubTabBar" location="component://assetmaint/widget/ismgr/Menus.xml"/>
                            </widgets>

                            <condition>
                                <if-service-permission service-name="fixedAssetPermissionCheck" main-action="VIEW"/>
                            </condition>
                            <widgets>

                                    <condition>
                                        <not><if-empty field="fixedAssetId"/></not>
                                    </condition>
                                    <widgets>
                                        <container style="h1"></container>
                                    </widgets>
                                    <fail-widgets>
                                        <container style="h1"></container>
                                    </fail-widgets>

                                <decorator-section-include name="body"/>
                            </widgets>
                            <fail-widgets>

                            </fail-widgets>

                    </decorator-section>
                </decorator-screen>
            </widgets>

    </screen>
</screens>


text:
package org.apache.camel.management.event;

import java.util.EventObject;

import org.apache.camel.CamelContext;

/**
 * @version $Revision$
 */
public class CamelContextResumeFailureEvent extends EventObject {
    private static final long serialVersionUID = -4271899927507894566L;

    private CamelContext context;
    private Throwable cause;

    public CamelContextResumeFailureEvent(CamelContext context, Throwable cause) {
        super(context);
        this.context = context;
        this.cause = cause;
    }

    public CamelContext getContext() {
        return context;
    }

    public Throwable getCause() {
        return cause;
    }

    @Override
    public String toString() {
        return "Failed to resume Camel: " + context.getName() + " due to " + cause.getMessage();
    }
}


text:
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

/* BandLabel.cs --
 * Ars Magna project, http://arsmagna.ru
 * -------------------------------------------------------
 * Status: poor
 */

#region Using directives

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

using CodeJam;

using JetBrains.Annotations;

using ManagedIrbis.Reports;

using MoonSharp.Interpreter;

#endregion

namespace IrbisUI.Reports
{
    class BandLabel
    {
        #region Properties

        #endregion

        #region Construction

        #endregion

        #region Private members

        #endregion

        #region Public methods

        #endregion
    }
}


text:
<?php

namespace AppBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class FormularzControllerTest extends WebTestCase
{
    public function testShow()
    {
        $client = static::createClient();

        $crawler = $client->request('GET', '/show');
    }

}


text:
package org.springframework.jdbc.core.simple;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;

/**
 * JDBC operations interface usable on Java 5 and above, exposing a
 * set of common JDBC operations, whose interface is simplified
 * through the use of varargs and autoboxing.
 *
 * @author Rod Johnson
 * @author Rob Harrop
 * @author Thomas Risberg
 * @since 2.0
 * @see org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
 * @see SimpleJdbcTemplate
 * @see org.springframework.jdbc.core.JdbcOperations
 */
public interface SimpleJdbcOperations {

	/**
	 * Expose the classic Spring JdbcTemplate to allow invocation of less
	 * commonly used methods.
	 */
	JdbcOperations getJdbcOperations();

	/**
	 * Expose the Spring NamedParameterJdbcTemplate to allow invocation of less
	 * commonly used methods.
	 */
	NamedParameterJdbcOperations getNamedParameterJdbcOperations();

	/**
	 * Query for an int passing in a SQL query
	 * using the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * and a map containing the arguments.
	 * @param sql the SQL query to run.
	 * @param args the map containing the arguments for the query.
	 */
	int queryForInt(String sql, Map args) throws DataAccessException;

	/**
	 * Query for an int passing in a SQL query
	 * using the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * and a SqlParameterSource containing the arguments.
	 * @param sql the SQL query to run.
	 * @param args the SqlParameterSource containing the arguments for the query.
	 */
	int queryForInt(String sql, SqlParameterSource args) throws DataAccessException;

	/**
	 * Query for an int passing in a SQL query
	 * using the standard '?' placeholders for parameters
	 * and a variable number of arguments.
	 * @param sql the SQL query to run.
	 * @param args the variable number of arguments for the query.
	 */
	int queryForInt(String sql, Object... args) throws DataAccessException;

	/**
	 * Query for an long passing in a SQL query
	 * using the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * and a map containing the arguments.
	 * @param sql the SQL query to run.
	 * @param args the map containing the arguments for the query.
	 */
	long queryForLong(String sql, Map args) throws DataAccessException;

	/**
	 * Query for an long passing in a SQL query
	 * using the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * and a SqlParameterSource containing the arguments.
	 * @param sql the SQL query to run.
	 * @param args the SqlParameterSource containing the arguments for the query.
	 */
	long queryForLong(String sql, SqlParameterSource args) throws DataAccessException;

	/**
	 * Query for an long passing in a SQL query
	 * using the standard '?' placeholders for parameters
	 * and a variable number of arguments.
	 * @param sql the SQL query to run.
	 * @param args the variable number of arguments for the query.
	 */
	long queryForLong(String sql, Object... args) throws DataAccessException;

	/**
	 * Query for an object of type T identified by the supplied @{@link Class}.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param requiredType the required type of the return value.
	 * @param args the map containing the arguments for the query.
	 * @see JdbcOperations#queryForObject(String, Class)
	 * @see JdbcOperations#queryForObject(String, Object[], Class)
	 */
	<T> T queryForObject(String sql, Class<T> requiredType, Map args)
			throws DataAccessException;

	/**
	 * Query for an object of type T identified by the supplied @{@link Class}.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param requiredType the required type of the return value.
	 * @param args the SqlParameterSource containing the arguments for the query.
	 * @see JdbcOperations#queryForObject(String, Class)
	 * @see JdbcOperations#queryForObject(String, Object[], Class)
	 */
	<T> T queryForObject(String sql, Class<T> requiredType, SqlParameterSource args)
			throws DataAccessException;

	/**
	 * Query for an object of type T identified by the supplied @{@link Class}.
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL query to run.
	 * @param requiredType the required type of the return value.
	 * @param args the variable number of arguments for the query.
	 * @see JdbcOperations#queryForObject(String, Class)
	 * @see JdbcOperations#queryForObject(String, Object[], Class)
	 */
	<T> T queryForObject(String sql, Class<T> requiredType, Object... args)
			throws DataAccessException;

	/**
	 * Query for an object of type T using the supplied
	 * {@link ParameterizedRowMapper} to the query results to the object.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param rm the @{@link ParameterizedRowMapper} to use for result mapping
	 * @param args the map containing the arguments for the query.
	 * @see JdbcOperations#queryForObject(String, org.springframework.jdbc.core.RowMapper)
	 * @see JdbcOperations#queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
	 */
	<T> T queryForObject(String sql, ParameterizedRowMapper<T> rm, Map args)
			throws DataAccessException;

	/**
	 * Query for an object of type T using the supplied
	 * {@link ParameterizedRowMapper} to the query results to the object.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param rm the @{@link ParameterizedRowMapper} to use for result mapping
	 * @param args the SqlParameterSource containing the arguments for the query.
	 * @see JdbcOperations#queryForObject(String, org.springframework.jdbc.core.RowMapper)
	 * @see JdbcOperations#queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
	 */
	<T> T queryForObject(String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args)
			throws DataAccessException;

	/**
	 * Query for an object of type T using the supplied
	 * {@link ParameterizedRowMapper} to the query results to the object.
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL query to run.
	 * @param rm the @{@link ParameterizedRowMapper} to use for result mapping
	 * @param args the variable number of arguments for the query.
	 * @see JdbcOperations#queryForObject(String, org.springframework.jdbc.core.RowMapper)
	 * @see JdbcOperations#queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
	 */
	<T> T queryForObject(String sql, ParameterizedRowMapper<T> rm, Object... args)
			throws DataAccessException;

	/**
	 * Query for a {@link List} of Objects of type T using
	 * the supplied {@link ParameterizedRowMapper} to the query results to the object.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param rm the @{@link ParameterizedRowMapper} to use for result mapping
	 * @param args the map containing the arguments for the query.
	 * @see JdbcOperations#queryForObject(String, org.springframework.jdbc.core.RowMapper)
	 * @see JdbcOperations#queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
	 */
	<T> List<T> query(String sql, ParameterizedRowMapper<T> rm, Map args)
			throws DataAccessException;

	/**
	 * Query for a {@link List} of Objects of type T using
	 * the supplied {@link ParameterizedRowMapper} to the query results to the object.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param rm the @{@link ParameterizedRowMapper} to use for result mapping
	 * @param args the SqlParameterSource containing the arguments for the query.
	 * @see JdbcOperations#queryForObject(String, org.springframework.jdbc.core.RowMapper)
	 * @see JdbcOperations#queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
	 */
	<T> List<T> query(String sql, ParameterizedRowMapper<T> rm, SqlParameterSource args)
			throws DataAccessException;

	/**
	 * Query for a {@link List} of Objects of type T using
	 * the supplied {@link ParameterizedRowMapper} to the query results to the object.
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL query to run.
	 * @param rm the @{@link ParameterizedRowMapper} to use for result mapping
	 * @param args the variable number of arguments for the query.
	 * @see JdbcOperations#queryForObject(String, org.springframework.jdbc.core.RowMapper)
	 * @see JdbcOperations#queryForObject(String, Object[], org.springframework.jdbc.core.RowMapper)
	 */
	<T> List<T> query(String sql, ParameterizedRowMapper<T> rm, Object... args)
			throws DataAccessException;

	/**
	 * Execute the supplied query with the supplied arguments.
	 *
The query is expected to be a single row query; the result row will be
	 * mapped to a Map (one entry for each column, using the column name as the key).
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param args the map containing the arguments for the query.
	 * @see JdbcOperations#queryForMap(String)
	 * @see JdbcOperations#queryForMap(String, Object[])
	 */
	Map<String, Object> queryForMap(String sql, Map args)
			throws DataAccessException;

	/**
	 * Execute the supplied query with the supplied arguments.
	 *
The query is expected to be a single row query; the result row will be
	 * mapped to a Map (one entry for each column, using the column name as the key).
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param args the SqlParameterSource containing the arguments for the query.
	 * @see JdbcOperations#queryForMap(String)
	 * @see JdbcOperations#queryForMap(String, Object[])
	 */
	Map<String, Object> queryForMap(String sql, SqlParameterSource args)
			throws DataAccessException;

	/**
	 * Execute the supplied query with the (optional) supplied arguments.
	 *
The query is expected to be a single row query; the result row will be
	 * mapped to a Map (one entry for each column, using the column name as the key).
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL query to run.
	 * @param args the variable number of arguments for the query.
	 * @see JdbcOperations#queryForMap(String)
	 * @see JdbcOperations#queryForMap(String, Object[])
	 */
	Map<String, Object> queryForMap(String sql, Object... args)
			throws DataAccessException;

	/**
	 * Execute the supplied query with the supplied arguments.
	 *
Each element in the returned {@link List} is constructed as a {@link Map}
	 * as described in {@link #queryForMap}
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param args the map containing the arguments for the query.
	 * @see JdbcOperations#queryForList(String)
	 * @see JdbcOperations#queryForList(String, Object[])
	 */
	List<Map<String, Object>> queryForList(String sql, Map args)
			throws DataAccessException;

	/**
	 * Execute the supplied query with the supplied arguments.
	 *
Each element in the returned {@link List} is constructed as a {@link Map}
	 * as described in {@link #queryForMap}
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL query to run.
	 * @param args the SqlParameterSource containing the arguments for the query.
	 * @see JdbcOperations#queryForList(String)
	 * @see JdbcOperations#queryForList(String, Object[])
	 */
	List<Map<String, Object>> queryForList(String sql, SqlParameterSource args)
			throws DataAccessException;

	/**
	 * Execute the supplied query with the (optional) supplied arguments.
	 *
Each element in the returned {@link List} is constructed as a {@link Map}
	 * as described in {@link #queryForMap}
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL query to run.
	 * @param args the variable number of arguments for the query.
	 * @see JdbcOperations#queryForList(String)
	 * @see JdbcOperations#queryForList(String, Object[])
	 */
	List<Map<String, Object>> queryForList(String sql, Object... args)
			throws DataAccessException;

	/**
	 * Execute the supplied SQL statement with (optional) supplied arguments.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL statement to execute.
	 * @param args the map containing the arguments for the query.
	 * @return the numbers of rows affected by the update.
	 * @see NamedParameterJdbcOperations#update(String, Map)
	 */
	int update(String sql, Map args) throws DataAccessException;

	/**
	 * Execute the supplied SQL statement with supplied arguments.
	 * Uses sql with the named parameter support provided by the
	 * {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate}
	 * @param sql the SQL statement to execute.
	 * @param args the SqlParameterSource containing the arguments for the statement.
	 * @return the numbers of rows affected by the update.
	 * @see NamedParameterJdbcOperations#update(String, SqlParameterSource)
	 */
	int update(String sql, SqlParameterSource args) throws DataAccessException;

	/**
	 * Execute the supplied SQL statement with supplied arguments.
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL statement to execute.
	 * @param args the variable number of arguments for the query.
	 * @return the numbers of rows affected by the update.
	 * @see JdbcOperations#update(String)
	 * @see JdbcOperations#update(String, Object[])
	 */
	int update(String sql, Object... args) throws DataAccessException;

	/**
	 * Executes a batch using the supplied SQL statement with the batch of supplied arguments.
	 * Uses sql with the named parameter support.
	 * @param sql the SQL statement to execute.
	 * @param batchValues the array of Maps containing the batch of arguments for the query.
	 * @return an array containing the numbers of rows affected by each update in the batch.
	 */
	public int[] batchUpdate(String sql, Map[] batchValues);

	/**
	 * Execute a batch using the supplied SQL statement with the batch of supplied arguments.
	 * Uses sql with the named parameter support.
	 * @param sql the SQL statement to execute.
	 * @param batchArgs the array of {@link SqlParameterSource} containing the batch of arguments for the query.
	 * @return an array containing the numbers of rows affected by each update in the batch.
	 */
	public int[] batchUpdate(String sql, SqlParameterSource[] batchArgs);

	/**
	 * Execute a batch using the supplied SQL statement with the batch of supplied arguments.
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL statement to execute.
	 * @param batchArgs the List of Object arrays containing the batch of arguments for the query.
	 * @return an array containing the numbers of rows affected by each update in the batch.
	 */
	public int[] batchUpdate(String sql, List<Object[]> batchArgs);

	/**
	 * Execute a batch using the supplied SQL statement with the batch of supplied arguments.
	 * Uses sql with the standard '?' placeholders for parameters
	 * @param sql the SQL statement to execute.
	 * @param batchArgs the List of Object arrays containing the batch of arguments for the query.
	 * @param argTypes SQL types of the arguments
	 * (constants from java.sql.Types)
	 * @return an array containing the numbers of rows affected by each update in the batch.
	 */
	public int[] batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes);

}


text:
from ..helpers import nativestr

def list_to_dict(aList):
    return {nativestr(aList[i][0]): nativestr(aList[i][1]) for i in range(len(aList))}

def parse_range(response):
    """Parse range response. Used by TS.RANGE and TS.REVRANGE."""
    return [tuple((r[0], float(r[1]))) for r in response]

def parse_m_range(response):
    """Parse multi range response. Used by TS.MRANGE and TS.MREVRANGE."""
    res = []
    for item in response:
        res.append({nativestr(item[0]): [list_to_dict(item[1]), parse_range(item[2])]})
    return sorted(res, key=lambda d: list(d.keys()))

def parse_get(response):
    """Parse get response. Used by TS.GET."""
    if not response:
        return None
    return int(response[0]), float(response[1])

def parse_m_get(response):
    """Parse multi get response. Used by TS.MGET."""
    res = []
    for item in response:
        if not item[2]:
            res.append({nativestr(item[0]): [list_to_dict(item[1]), None, None]})
        else:
            res.append(
                {
                    nativestr(item[0]): [
                        list_to_dict(item[1]),
                        int(item[2][0]),
                        float(item[2][1]),
                    ]
                }
            )
    return sorted(res, key=lambda d: list(d.keys()))


text:
#ifndef P_SPLIT_FIRINGS_H
#define P_SPLIT_FIRINGS_H

#include <QStringList>

bool p_split_firings(QStringList timeseries_list, QString firings, QStringList firings_out_list);
bool p_extract_firings(QString firings, const QSet<int>& clusters, QString firings_out);

#endif // P_SPLIT_FIRINGS_H


text:
import factory
from django.contrib.auth import get_user_model
from django.utils import timezone

from . import models

class UserFactory(factory.DjangoModelFactory):
    """ This only supports the real factories """
    FACTORY_FOR = get_user_model()
    first_name = factory.Sequence(lambda n: 'first name {0}'.format(n))
    last_name = factory.Sequence(lambda n: 'last name {0}'.format(n))
    username = factory.Sequence(lambda n: 'user{0}'.format(n))
    password = factory.PostGenerationMethodCall('set_password', 'test_pass')

class SourceFactory(factory.DjangoModelFactory):
    FACTORY_FOR = models.Source
    name = factory.Sequence(lambda n: 'Source {0}'.format(n))

class WireFactory(factory.DjangoModelFactory):
    FACTORY_FOR = models.Wire
    name = factory.Sequence(lambda n: 'Wire {0}'.format(n))

class LinkFactory(factory.DjangoModelFactory):
    FACTORY_FOR = models.Link
    url = factory.Sequence(lambda n: 'http://example.com/{0}'.format(n))
    date_suggested = factory.LazyAttribute(lambda __: timezone.now())
    user = factory.SubFactory(UserFactory)
    source = factory.SubFactory(SourceFactory)

    @factory.post_generation
    def wires(self, create, extracted, **kwargs):
        if not create:
            return
        if extracted:
            for wire in extracted:
                self.wires.add(wire)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Html.Media.Graphics;
using System.Html;
using System.Net;

namespace wwtlib
{

    public class Dates
    {

        public Dates(double start, double end)
        {
            StartDate = start;
            EndDate = end;
        }
        public double StartDate;
        public double EndDate;

        public Dates Copy()
        {
            return new Dates(this.StartDate, this.EndDate);
        }
    }

    public class SimpleLineList
    {
        public SimpleLineList()
        {
        }

        bool zBuffer = true;

        public bool DepthBuffered
        {
            get { return zBuffer; }
            set { zBuffer = value; }
        }

        List<Vector3d> linePoints = new List<Vector3d>();

        public void AddLine(Vector3d v1, Vector3d v2)
        {

            linePoints.Add(v1);
            linePoints.Add(v2);
            EmptyLineBuffer();

        }

        public void Clear()
        {
            linePoints.Clear();
            EmptyLineBuffer();
        }

        bool usingLocalCenter = false;
        Vector3d localCenter;
        public bool Sky = true;
        public bool aaFix = true;

        public Matrix3d ViewTransform = Matrix3d.Identity;

        public void DrawLines(RenderContext renderContext, float opacity, Color color)
        {
            if (linePoints.Count < 2)
            {
                return;
            }

            InitLineBuffer(renderContext);

            int count = linePoints.Count;

            if (renderContext.gl == null)
            {
                Vector3d viewPoint = Vector3d.TransformCoordinate(renderContext.ViewPoint, ViewTransform);

                CanvasContext2D ctx = renderContext.Device;
                ctx.Save();

                ctx.StrokeStyle = color.ToString();
                ctx.LineWidth = 2;
                ctx.Alpha = .25;
                Vector3d firstPoint = new Vector3d();
                Vector3d secondPoint = new Vector3d();
                for (int i = 0; i < count; i += 2)
                {
                    firstPoint = renderContext.WVP.Transform(linePoints[i]);
                    secondPoint = renderContext.WVP.Transform(linePoints[i + 1]);
                    if (Vector3d.Dot(linePoints[i], viewPoint) > .60)
                    {
                        ctx.BeginPath();
                        ctx.MoveTo(firstPoint.X, firstPoint.Y);
                        ctx.LineTo(secondPoint.X, secondPoint.Y);

                        ctx.Stroke();

                    }
                }
                ctx.Restore();
            }
            else
            {
                foreach (PositionVertexBuffer lineBuffer in lineBuffers)
                {
                    SimpleLineShader.Use(renderContext, lineBuffer.VertexBuffer, color);
                    renderContext.gl.drawArrays(GL.LINES, 0, lineBuffer.Count);
                }
            }
        }

        //List<SharpDX.Direct3D11.VertexBufferBinding> lineBufferBindings = new List<SharpDX.Direct3D11.VertexBufferBinding>();

        List<PositionVertexBuffer> lineBuffers = new List<PositionVertexBuffer>();
        List<int> lineBufferCounts = new List<int>();

        public bool UseLocalCenters = false;
        void InitLineBuffer(RenderContext renderContext)
        {
            if (renderContext.gl != null)
            {
                if (lineBuffers.Count == 0)
                {
                    int count = linePoints.Count;

                    PositionVertexBuffer lineBuffer = null;

                    Vector3d[] linePointList = null;
                    localCenter = new Vector3d();
                    if (DepthBuffered)
                    {
                        // compute the local center..
                        foreach (Vector3d point in linePoints)
                        {
                            localCenter.Add(point);

                        }
                        localCenter.X /= count;
                        localCenter.Y /= count;
                        localCenter.Z /= count;
                    }

                    int countLeft = count;
                    int index = 0;
                    int counter = 0;
                    Vector3d temp;

                    foreach (Vector3d point in linePoints)
                    {
                        if (counter >= 100000 || linePointList == null)
                        {
                            if (lineBuffer != null)
                            {
                                lineBuffer.Unlock();
                            }
                            int thisCount = Math.Min(100000, countLeft);

                            countLeft -= thisCount;
                            lineBuffer = new PositionVertexBuffer(thisCount);

                            linePointList = (Vector3d[])lineBuffer.Lock(); // Lock the buffer (which will return our structs)

                            lineBuffers.Add(lineBuffer);
                            lineBufferCounts.Add(thisCount);
                            counter = 0;
                        }

                        if (UseLocalCenters)
                        {
                            temp = Vector3d.SubtractVectors(point, localCenter);
                            linePointList[counter] = temp;
                        }
                        else
                        {
                            linePointList[counter] = point;
                        }
                        index++;
                        counter++;
                    }

                    if (lineBuffer != null)
                    {
                        lineBuffer.Unlock();
                    }

                }
            }
        }

        void EmptyLineBuffer()
        {

        }

    }

    public class LineList
    {
        public LineList()
        {
        }
        bool zBuffer = true;

        public bool DepthBuffered
        {
            get { return zBuffer; }
            set { zBuffer = value; }
        }
        public bool TimeSeries = false;
        public bool ShowFarSide = true;
        public bool Sky = false;
        public double Decay = 0;
        public bool UseNonRotatingFrame = false;
        public double JNow = 0;

        List<Vector3d> linePoints = new List<Vector3d>();
        List<Color> lineColors = new List<Color>();
        List<Dates> lineDates = new List<Dates>();
        public void AddLine(Vector3d v1, Vector3d v2, Color color, Dates date)
        {

            linePoints.Add(v1);
            linePoints.Add(v2);
            lineColors.Add(color);
            lineDates.Add(date);
            EmptyLineBuffer();

        }

        public void AddLineNoDate(Vector3d v1, Vector3d v2, Color color)
        {

            linePoints.Add(v1);
            linePoints.Add(v2);
            lineColors.Add(color);
            lineDates.Add(new Dates(0,0));
            EmptyLineBuffer();

        }

        public void Clear()
        {
            linePoints.Clear();
            lineColors.Clear();
            lineDates.Clear();
        }
        bool usingLocalCenter = true;
        Vector3d localCenter;
        public void DrawLines(RenderContext renderContext, float opacity)
        {
            if (linePoints.Count < 2 || opacity <= 0)
            {
                return;
            }
            if (renderContext.gl == null)
            {
                //todo draw with HTML5
            }
            else
            {
                InitLineBuffer();
                //Matrix3d savedWorld = renderContext.World;
                //Matrix3d savedView = renderContext.View;
                //if (localCenter != Vector3d.Empty)
                //{
                //    usingLocalCenter = true;
                //    Vector3d temp = localCenter;
                //    if (UseNonRotatingFrame)
                //    {
                //        renderContext.World = Matrix3d.Translation(temp) * renderContext.WorldBaseNonRotating * Matrix3d.Translation(-renderContext.CameraPosition);
                //    }
                //    else
                //    {
                //        renderContext.World = Matrix3d.Translation(temp) * renderContext.WorldBase * Matrix3d.Translation(-renderContext.CameraPosition);
                //    }
                //    renderContext.View = Matrix3d.Translation(renderContext.CameraPosition) * renderContext.ViewBase;
                //}

                //DateTime baseDate = new DateTime(2010, 1, 1, 12, 00, 00);

                //renderContext.devContext.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.LineList;

                //LineShaderNormalDates11.Constants.JNow = (float)(SpaceTimeController.JNow - SpaceTimeController.UtcToJulian(baseDate));
                //LineShaderNormalDates11.Constants.Sky = Sky ? 1 : 0;
                //LineShaderNormalDates11.Constants.ShowFarSide = ShowFarSide ? 1 : 0;
                //if (TimeSeries)
                //{
                //    LineShaderNormalDates11.Constants.Decay = (float)Decay;
                //}
                //else
                //{
                //    LineShaderNormalDates11.Constants.Decay = 0;
                //}

                //LineShaderNormalDates11.Constants.Opacity = opacity;
                //LineShaderNormalDates11.Constants.CameraPosition = new SharpDX.Vector4(Vector3d.TransformCoordinate(renderContext.CameraPosition, Matrix3d.Invert(renderContext.World)).Vector311, 1);
                //SharpDX.Matrix mat = (renderContext.World * renderContext.View * renderContext.Projection).Matrix11;
                //mat.Transpose();

                //LineShaderNormalDates11.Constants.WorldViewProjection = mat;

                //LineShaderNormalDates11.Use(renderContext.devContext);

                //renderContext.DepthStencilMode = DepthBuffered ? DepthStencilMode.ZReadWrite : DepthStencilMode.Off;

                foreach (TimeSeriesLineVertexBuffer lineBuffer in lineBuffers)
                {
                    LineShaderNormalDates.Use(renderContext, lineBuffer.VertexBuffer, Color.FromArgb(255, 255, 255, 255), zBuffer, (float)JNow, (float)Decay);
                    renderContext.gl.drawArrays(GL.LINES, 0, lineBuffer.Count);
                }

                //renderContext.DepthStencilMode = DepthStencilMode.ZReadWrite;

                //if (usingLocalCenter)
                //{
                //    renderContext.World = savedWorld;
                //    renderContext.View = savedView;
                //}
            }

        }

        List<TimeSeriesLineVertexBuffer> lineBuffers = new List<TimeSeriesLineVertexBuffer>();
        List<int> lineBufferCounts = new List<int>();

        void InitLineBuffer()
        {
            if (lineBuffers.Count == 0)
            {
                int count = linePoints.Count;

                TimeSeriesLineVertexBuffer lineBuffer = null;

                TimeSeriesLineVertex[] linePointList = null;
                //localCenter = new Vector3d();
                //if (DepthBuffered)
                //{
                //    // compute the local center..
                //    foreach (Vector3d point in linePoints)
                //    {
                //        localCenter.Add(point);

                //    }
                //    localCenter.X /= count;
                //    localCenter.Y /= count;
                //    localCenter.Z /= count;
                //}

                int countLeft = count;
                int index = 0;
                int counter = 0;
                Vector3d temp;

                foreach (Vector3d point in linePoints)
                {
                    if (counter >= 100000 || linePointList == null)
                    {
                        if (lineBuffer != null)
                        {
                            lineBuffer.Unlock();
                        }
                        int thisCount = Math.Min(100000, countLeft);

                        countLeft -= thisCount;
                        lineBuffer = new TimeSeriesLineVertexBuffer(thisCount);

                        linePointList = (TimeSeriesLineVertex[])lineBuffer.Lock(); // Lock the buffer (which will return our structs)

                        lineBuffers.Add(lineBuffer);
                        lineBufferCounts.Add(thisCount);
                        counter = 0;
                    }
                    int div2 = (int)(index / 2);

                    temp = point; // -localCenter;
                    linePointList[counter] = new TimeSeriesLineVertex();
                    linePointList[counter].Position = temp;
                    linePointList[counter].Normal = point;
                    linePointList[counter].Tu = (float)lineDates[div2].StartDate;
                    linePointList[counter].Tv = (float)lineDates[div2].EndDate;
                    linePointList[counter].Color = lineColors[div2];
                    index++;
                    counter++;
                }

                if (lineBuffer != null)
                {
                    lineBuffer.Unlock();
                }

            }
        }

        void EmptyLineBuffer()
        {
            //if (lineBuffers != null)
            //{
            //    foreach (TimeSeriesLineVertexBuffer11 lineBuffer in lineBuffers)
            //    {
            //        lineBuffer.Dispose();
            //        GC.SuppressFinalize(lineBuffer);
            //    }
            //    lineBuffers.Clear();
            //    lineBufferCounts.Clear();
            //}

        }
    }

    public enum CullMode { None = 0, CounterClockwise = 2,Clockwise =1  };

    public class TriangleList
    {
        public TriangleList()
        {

        }

        List<Vector3d> trianglePoints = new List<Vector3d>();
        List<Color> triangleColors = new List<Color>();
        List<Dates> triangleDates = new List<Dates>();

        public bool TimeSeries = false;
        public bool ShowFarSide = false;
        public bool Sky = false;
        public bool DepthBuffered = true;
        public bool WriteZbuffer = false;
        public double Decay = 0;

        public bool AutoTime = true;
        public double JNow = 0;
        bool dataToDraw = false;

        public void AddTriangle(Vector3d v1, Vector3d v2, Vector3d v3, Color color, Dates date)
        {
            trianglePoints.Add(v1);
            trianglePoints.Add(v2);
            trianglePoints.Add(v3);
            triangleColors.Add(color);
            triangleDates.Add(date);
            EmptyTriangleBuffer();
        }

        public void AddSubdividedTriangles(Vector3d v1, Vector3d v2, Vector3d v3, Color color, Dates date, int subdivisions)
        {
            subdivisions--;

            if (subdivisions < 0)
            {
                AddTriangle(v1, v2, v3, color, date);
            }
            else
            {
                Vector3d v12;
                Vector3d v23;
                Vector3d v31;

                v12 = Vector3d.MidPointByLength(v1, v2);
                v23 = Vector3d.MidPointByLength(v2, v3);
                v31 = Vector3d.MidPointByLength(v3, v1);

                // Add 1st
                AddSubdividedTriangles(v1, v12, v31, color, date, subdivisions);
                // Add 2nd
                AddSubdividedTriangles(v12, v23, v31, color, date, subdivisions);
                // Add 3rd
                AddSubdividedTriangles(v12, v2, v23, color, date, subdivisions);
                // Add 4th
                AddSubdividedTriangles(v23, v3, v31, color, date, subdivisions);

            }
        }

        public void AddQuad(Vector3d v1, Vector3d v2, Vector3d v3, Vector3d v4, Color color, Dates date)
        {
            trianglePoints.Add(v1);
            trianglePoints.Add(v3);
            trianglePoints.Add(v2);
            trianglePoints.Add(v2);
            trianglePoints.Add(v3);
            trianglePoints.Add(v4);
            triangleColors.Add(color);
            triangleDates.Add(date);
            triangleColors.Add(color);
            triangleDates.Add(date);
            EmptyTriangleBuffer();
        }

        public void Clear()
        {

            triangleColors.Clear();
            trianglePoints.Clear();
            triangleDates.Clear();
            EmptyTriangleBuffer();

        }
        void EmptyTriangleBuffer()
        {
            //if (triangleBuffers != null)
            //{
            //    foreach (TimeSeriesLineVertexBuffer11 buf in triangleBuffers)
            //    {
            //        buf.Dispose();
            //        GC.SuppressFinalize(buf);
            //    }
            //    triangleBuffers.Clear();
            //    triangleBufferCounts.Clear();
            //    dataToDraw = false;
            //}

        }

        List<TimeSeriesLineVertexBuffer> triangleBuffers = new List<TimeSeriesLineVertexBuffer>();
        List<int> triangleBufferCounts = new List<int>();

        void InitTriangleBuffer()
        {

            if (triangleBuffers.Count == 0)
            {
                int count = trianglePoints.Count;

                TimeSeriesLineVertexBuffer triangleBuffer = null;

                TimeSeriesLineVertex[] triPointList = null;
                int countLeft = count;
                int index = 0;
                int counter = 0;
                foreach (Vector3d point in trianglePoints)
                {
                    if (counter >= 90000 || triangleBuffer == null)
                    {
                        if (triangleBuffer != null)
                        {
                            triangleBuffer.Unlock();
                        }
                        int thisCount = Math.Min(90000, countLeft);

                        countLeft -= thisCount;
                        triangleBuffer = new TimeSeriesLineVertexBuffer(thisCount);

                        triangleBuffers.Add(triangleBuffer);
                        triangleBufferCounts.Add(thisCount);
                        triPointList = (TimeSeriesLineVertex[])triangleBuffer.Lock(); // Lock the buffer (which will return our structs)
                        counter = 0;
                    }

                    triPointList[counter] = new TimeSeriesLineVertex();
                    triPointList[counter].Position = point;
                    triPointList[counter].Normal = point;
                    int div3 = (int)(index / 3);

                    triPointList[counter].Color = triangleColors[div3];
                    triPointList[counter].Tu = (float)triangleDates[div3].StartDate;
                    triPointList[counter].Tv = (float)triangleDates[div3].EndDate;
                    index++;
                    counter++;
                }
                if (triangleBuffer != null)
                {
                    triangleBuffer.Unlock();
                }

                triangleColors.Clear();
                triangleDates.Clear();
                trianglePoints.Clear();

                dataToDraw = true;
            }

        }

        public void Draw(RenderContext renderContext, float opacity, CullMode cull)
        {
            if (trianglePoints.Count < 1 && !dataToDraw)
            {
                return;
            }

            //renderContext.DepthStencilMode = DepthBuffered ? (WriteZbuffer ? DepthStencilMode.ZReadWrite : DepthStencilMode.ZReadOnly) : DepthStencilMode.Off;

            //renderContext.devContext.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList;

            //switch (cull)
            //{
            //    case CullMode.Clockwise:
            //        renderContext.setRasterizerState(TriangleCullMode.CullClockwise);
            //        break;
            //    case CullMode.CounterClockwise:
            //        renderContext.setRasterizerState(TriangleCullMode.CullCounterClockwise);
            //        break;
            //    case CullMode.None:
            //        renderContext.setRasterizerState(TriangleCullMode.Off);
            //        break;
            //    default:
            //        break;
            //}

            //if (AutoTime)
            //{
            //    DateTime baseDate = new DateTime(2010, 1, 1, 12, 00, 00);
            //    LineShaderNormalDates.Constants.JNow = (float)(SpaceTimeController.JNow - SpaceTimeController.UtcToJulian(baseDate));
            //}
            //else
            //{
            //    LineShaderNormalDates.Constants.JNow = (float)JNow;
            //}

            //LineShaderNormalDates.Constants.Sky = 0;
            //LineShaderNormalDates.Constants.ShowFarSide = ShowFarSide ? 1 : 0;
            //if (TimeSeries)
            //{
            //    LineShaderNormalDates.Constants.Decay = (float)Decay;
            //}
            //else
            //{
            //    LineShaderNormalDates.Constants.Decay = 0;
            //}
            //LineShaderNormalDates.Constants.Opacity = opacity;
            //LineShaderNormalDates.Constants.CameraPosition = new SharpDX.Vector4(Vector3d.TransformCoordinate(renderContext.CameraPosition, Matrix3d.Invert(renderContext.World)).Vector311, 1);

            //SharpDX.Matrix mat = (renderContext.World * renderContext.View * renderContext.Projection).Matrix11;
            //mat.Transpose();

            //LineShaderNormalDates.Constants.WorldViewProjection = mat;

            //LineShaderNormalDates.Use(renderContext.devContext);

            //foreach (TimeSeriesLineVertexBuffer vertBuffer in triangleBuffers)
            //{
            //    renderContext.SetVertexBuffer(vertBuffer);
            //    renderContext.devContext.Draw(vertBuffer.Count, 0);
            //}

            if (renderContext.gl == null)
            {
               //todo implement HTML5 version
            }
            else
            {

                InitTriangleBuffer();
                foreach (TimeSeriesLineVertexBuffer triBuffer in triangleBuffers)
                {
                    LineShaderNormalDates.Use(renderContext, triBuffer.VertexBuffer, Color.FromArgb(255, 255, 255, 255), DepthBuffered, (float)JNow, (float)Decay);
                    renderContext.gl.drawArrays(GL.TRIANGLES, 0, triBuffer.Count);
                }
            }

        }
    }

    public class PointList
    {
        public PointList(RenderContext device)
        {
            this.device = device;
        }

        RenderContext device;
        List<Vector3d> points = new List<Vector3d>();
        List<Color> colors = new List<Color>();
        List<Dates> dates = new List<Dates>();
        List<float> sizes = new List<float>();
        public bool TimeSeries = false;
        public bool ShowFarSide = false;
        public bool Sky = false;
        public bool DepthBuffered = true;
        public double Decay = 0;

        public bool AutoTime = true;
        public double JNow = 0;
        bool dataToDraw = false;

        public void AddPoint(Vector3d v1, Color color, Dates date, float size)
        {
            points.Add(v1);
            colors.Add(color.Clone());
            dates.Add(date);
            sizes.Add(size);
            EmptyPointBuffer();
        }

        public void Clear()
        {

            colors.Clear();
            points.Clear();
            dates.Clear();
            EmptyPointBuffer();

        }
        Vector3d[] transformedList;
        Vector3d[] worldList;

        void EmptyPointBuffer()
        {

            init = false;
        }

        public List<DataItem> items = new List<DataItem>();

        ImageElement starProfile;

        Texture starTexture;
        bool imageReady = false;
        bool init = false;

        List<TimeSeriesPointVertexBuffer> pointBuffers = new List<TimeSeriesPointVertexBuffer>();
        List<int> pointBufferCounts = new List<int>();
        //const double jBase = 2455198.0;
        void InitBuffer(RenderContext renderContext)
        {
            if (!init)
            {
                if (renderContext.gl == null)
                {
                    starProfile = (ImageElement)Document.CreateElement("img");
                    starProfile.AddEventListener("load", delegate(ElementEvent e)
                    {
                        imageReady = true;
                    }, false);

                    starProfile.Src = "/images/starProfile.png";

                    worldList = new Vector3d[points.Count];
                    transformedList = new Vector3d[points.Count];

                    int index = 0;
                    foreach (Vector3d pnt in points)
                    {
                        // todo filter by date
                        DataItem item = new DataItem();
                        item.Location = pnt;
                        item.Tranformed = new Vector3d();
                        item.Size = sizes[index];
                        item.Color = colors[index];
                        worldList[index] = item.Location;
                        transformedList[index] = item.Tranformed;
                        items.Add(item);
                        index++;
                    }
                }
                else
                {
                    if (pointBuffers.Count == 0)
                    {
                        if (starTexture == null)
                        {
                            starTexture = Planets.LoadPlanetTexture("/images/starProfile.png");
                        }

                        int count = this.points.Count;

                        TimeSeriesPointVertexBuffer pointBuffer = null;
                        TimeSeriesPointVertex[] pointList = null;

                        int countLeft = count;
                        int index = 0;
                        int counter = 0;
                        foreach (Vector3d point in points)
                        {
                            if (counter >= 100000 || pointList == null)
                            {
                                if (pointBuffer != null)
                                {
                                    pointBuffer.Unlock();
                                }
                                int thisCount = Math.Min(100000, countLeft);

                                countLeft -= thisCount;
                                pointBuffer = new TimeSeriesPointVertexBuffer(thisCount);

                                pointList = (TimeSeriesPointVertex[])pointBuffer.Lock(); // Lock the buffer (which will return our structs)

                                pointBuffers.Add(pointBuffer);
                                pointBufferCounts.Add(thisCount);
                                counter = 0;
                            }
                            pointList[counter] = new TimeSeriesPointVertex();
                            pointList[counter].Position = point;
                            pointList[counter].PointSize = sizes[index];
                            pointList[counter].Tu = (float)(dates[index].StartDate );
                            pointList[counter].Tv = (float)(dates[index].EndDate );
                            pointList[counter].Color = colors[index];
                            index++;
                            counter++;
                        }

                        if (pointBuffer != null)
                        {
                            pointBuffer.Unlock();
                        }
                    }
                }

                init = true;
            }
        }

        public void Draw(RenderContext renderContext, float opacity, bool cull)
        {
            InitBuffer(renderContext);

            if (renderContext.gl == null)
            {
                if (!imageReady)
                {
                    return;
                }
                renderContext.Device.Save();

                renderContext.WVP.ProjectArrayToScreen(worldList, transformedList);
                CanvasContext2D ctx = renderContext.Device;
                ctx.Alpha = .4;

                double width = renderContext.Width;
                double height = renderContext.Height;

                Vector3d viewPoint = Vector3d.MakeCopy(renderContext.ViewPoint);

                double scaleFactor = renderContext.FovScale / 100;
                foreach (DataItem item in items)
                {
                    // todo filter by date

                    // if (Vector3d.Dot(viewPoint, item.Location) < 0)
                    if (item.Tranformed.Z < 1)
                    {
                        double x = item.Tranformed.X;
                        double y = item.Tranformed.Y;
                        double size = .1 * item.Size / scaleFactor;
                        double half = size / 2;
                        if (x > -half && x < width + half && y > -half && y < height + half)
                        {
                            //ctx.DrawImage(starProfile, x - size / 2, y - size / 2, size, size);

                            ctx.BeginPath();
                            // ctx.FillStyle = "rgb(200,0,0)";
                            ctx.FillStyle = item.Color.ToFormat();
                            ctx.Arc(x, y, size, 0, Math.PI * 2, true);
                            ctx.Fill();
                        }
                    }

                }

                renderContext.Device.Restore();
            }
            else
            {
                foreach (TimeSeriesPointVertexBuffer pointBuffer in pointBuffers)
                {
                    TimeSeriesPointSpriteShader.Use(renderContext, pointBuffer.VertexBuffer, starTexture.Texture2d, Color.FromArgb(255, 255, 255, 255), DepthBuffered, (float)(this.JNow), (float)Decay);
                    renderContext.gl.drawArrays(GL.POINTS, 0, pointBuffer.Count);
                }

               // renderContext.gl.disable(0x8642);
            }
        }
    }

    public class TimeSeriesLineVertex
    {
        public Vector3d Position = new Vector3d();
        public Vector3d Normal = new Vector3d();
        public Color color;
        public Color Color
        {
            get
            {
                return color;
            }
            set
            {
                color = value;
            }
        }
        public float Tu;
        public float Tv;
        public static TimeSeriesLineVertex Create(Vector3d position, Vector3d normal, float time, Color color)
        {
            TimeSeriesLineVertex temp = new TimeSeriesLineVertex();

            temp.Position = position;
            temp.Normal = normal;
            temp.Tu = time;
            temp.Tv = 0;
            temp.color = color;

            return temp;
        }
    }

    public enum PointScaleTypes { Linear=0, Power=1, Log=2, Constant=3, StellarMagnitude=4 };
    public class TimeSeriesPointVertex
    {
        public Vector3d Position;
        public float PointSize;
        public Color color;
        public Color Color
        {
            get
            {
                return color;
            }
            set
            {
                color = value;
            }
        }
        public float Tu;
        public float Tv;
        public static TimeSeriesPointVertex Create(Vector3d position, float size, float time, Color color)
        {
            TimeSeriesPointVertex tmp = new TimeSeriesPointVertex();

            tmp.Position = position;
            tmp.PointSize = size;
            tmp.Tu = time;
            tmp.Tv = 0;
            tmp.color = color;
            return tmp;

        }
    }

}


text:
import fr.njin.playoauth.as.endpoints.Constraints._
import org.specs2.mutable.Specification
import org.specs2.specification.Fragment
import play.api.data.validation.{Valid, Invalid}

/**
 * User: bathily
 * Date: 19/09/13
 */
class ConstraintsSpec extends Specification {

  "URI Constraint should" ^ {

    Seq("http://www.google.com",
      "https://www.google.com",
      "file:///dir/file",
      "http://localhost:9000/"
    ).map(valid)

    Seq("www.google.com",
      "/search",
      "localhost",
      "localhost:9000",
      "file:/dir/file"
    ).map(invalid)
  }

  def valid(url:String): Fragment = {
    s"Validate `$url`" in {
      uri(url) must beAnInstanceOf[Valid.type]
    }
  }

  def invalid(url:String): Fragment = {
    s"Invalidate `$url`" in {
      uri(url) must beAnInstanceOf[Invalid]
    }
  }
}


text:
namespace sim {
	struct Body {
		Orbit orbit;
		double mass, radius, aop, lan, anomaly, time;
		std::string name, orb_desc;
		Body* central_mass;
		bool Sun;

		Body operator =(Body body);

		double grav_param() const;

		double period() const;

		void update(double delta_t);

		Vector pos();
		Vector vel();
	};
}


text:
package com.planet_ink.coffee_mud.core.collections;

import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import com.planet_ink.coffee_mud.core.interfaces.CMObject;

public class SortedStrSVector<T> extends SVector<T> implements SearchIDList<T>
{
	private static final long serialVersionUID = 6687178785122361992L;
	private final Str<T> stringer;

	public static interface Str<T>
	{
		public String toString(T t);
	}

	public SortedStrSVector(Str<T> stringer, int size)
	{
		super(size);
		this.stringer=stringer;
	}

	public SortedStrSVector(Str<T> stringer)
	{
		super();
		this.stringer=stringer;
	}

	private int compareTo(T arg0, String arg1)
	{
		return stringer.toString(arg0).compareToIgnoreCase(arg1);
	}

	private int compareTo(T arg0, T arg1)
	{
		return stringer.toString(arg0).compareToIgnoreCase(stringer.toString(arg1));
	}

	@Override
	public synchronized boolean add(T arg0)
	{
		if(arg0==null)
			return false;
		if(size()==0)
			return super.add(arg0);
		int start=0;
		int end=size()-1;
		int comp=-1;
		int mid=-1;
		while(start<=end)
		{
			mid=(end+start)/2;
			comp=compareTo(super.get(mid),arg0);
			if(comp==0)
				break;
			else
			if(comp>0)
				end=mid-1;
			else
				start=mid+1;
		}
		if(comp==0)
			super.add(mid,arg0);
		else
		if(comp>0)
		{
			while((mid>=0)&&(compareTo(super.get(mid),arg0)>0))
				mid--;
			if(mid>=size()-1)
				super.add(arg0);
			else
			if(mid<0)
				super.add(0,arg0);
			else
				super.add(mid+1,arg0);
		}
		else
		{
			while((mid<size())&&(compareTo(super.get(mid),arg0)<0))
				mid++;
			if(mid>=size())
				super.add(arg0);
			else
				super.add(mid,arg0);
		}
		return true;
	}

	@Override
	public void add(int arg0, T arg1)
	{
		throw new java.lang.UnsupportedOperationException();
	}

	@Override
	public boolean addAll(int arg0, Collection<? extends T> arg1)
	{
		throw new java.lang.UnsupportedOperationException();
	}
	@Override
	public boolean contains(Object arg0)
	{
		return indexOf(arg0)>=0;
	}

	@Override
	public boolean containsAll(Collection<?> arg0)
	{
		for(final Object o : arg0)
			if(!contains(o))
				return false;
		return true;
	}

	@Override
	public T get(int arg0)
	{
		return super.get(arg0);
	}

	public synchronized void reSort(T arg0)
	{
		if(super.contains(arg0))
		{
			super.remove(arg0);
			this.add(arg0);
		}
	}

	@SuppressWarnings("unchecked")
	@Override
	public synchronized int indexOf(Object arg0)
	{
		if(arg0==null)
			return -1;
		if(size()==0)
			return -1;
		int start=0;
		int end=size()-1;
		if(arg0 instanceof CMObject)
		{
			while(start<=end)
			{
				final int mid=(end+start)/2;
				final int comp=compareTo(super.get(mid),(T)arg0);
				if(comp==0)
					return mid;
				else
				if(comp>0)
					end=mid-1;
				else
					start=mid+1;

			}
		}
		else
		if(arg0 instanceof String)
		{
			while(start<=end)
			{
				final int mid=(end+start)/2;
				final int comp=compareTo(super.get(mid),(String)arg0);
				if(comp==0)
					return mid;
				else
				if(comp>0)
					end=mid-1;
				else
					start=mid+1;

			}
		}
		return -1;
	}

	@Override
	public synchronized T find(String arg0)
	{
		if(arg0==null)
			return null;
		if(size()==0)
			return null;
		int start=0;
		int end=size()-1;
		while(start<=end)
		{
			final int mid=(end+start)/2;
			final int comp=compareTo(super.get(mid),arg0);
			if(comp==0)
				return super.get(mid);
			else
			if(comp>0)
				end=mid-1;
			else
				start=mid+1;
		}
		return null;
	}

	@Override
	public synchronized T find(T arg0)
	{
		if(arg0==null)
			return null;
		if(size()==0)
			return null;
		int start=0;
		int end=size()-1;
		while(start<=end)
		{
			final int mid=(end+start)/2;
			final int comp=compareTo(super.get(mid),arg0);
			if(comp==0)
				return super.get(mid);
			else
			if(comp>0)
				end=mid-1;
			else
				start=mid+1;

		}
		return null;
	}

	@Override
	public synchronized int lastIndexOf(Object arg0)
	{
		return indexOf(arg0); // only holds one-of-a-kind, so all is well!
	}

	@Override
	public synchronized boolean remove(Object arg0)
	{
		final int index=indexOf(arg0);
		if(index >= 0)
			return remove(index)==arg0;
		return false;
	}

	@Override
	public T set(int arg0, T arg1)
	{
		throw new java.lang.UnsupportedOperationException();
	}
}


text:
@interface ViewController : UIViewController<OnContactsSelectedDelegate>

@end


text:
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI

class DistributedSillyMeterMgrAI(DistributedObjectAI):
    notify = DirectNotifyGlobal.directNotify.newCategory("DistributedSillyMeterMgrAI")


text:
#include "stdafx.h"
#include "WdfDevice.h"
#include "trace.h"
#include "WdfDevice.tmh"

CDeviceInit::~CDeviceInit()
{
    if (m_Attached)
    {
        Free();
    }
}

void CDeviceInit::Attach(PWDFDEVICE_INIT DevInit)
{
    m_Attached = true;
    CPreAllocatedDeviceInit::Attach(DevInit);
}

PWDFDEVICE_INIT CDeviceInit::Detach()
{
    m_Attached = false;
    return CPreAllocatedDeviceInit::Detach();
}

NTSTATUS CPreAllocatedDeviceInit::SetName(const UNICODE_STRING &Name)
{
    auto status = WdfDeviceInitAssignName(m_DeviceInit, &Name);

    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! failed %!STATUS!", status);
    }

    return status;
}

void CPreAllocatedDeviceInit::Free()
{
    WdfDeviceInitFree(m_DeviceInit);
}

void CPreAllocatedDeviceInit::SetPowerCallbacks(PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT SelfManagedIoFunc)
{
    WDF_PNPPOWER_EVENT_CALLBACKS  Callbacks;
    WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&Callbacks);
    Callbacks.EvtDeviceSelfManagedIoInit = SelfManagedIoFunc;
    WdfDeviceInitSetPnpPowerEventCallbacks(m_DeviceInit, &Callbacks);
}

void CPreAllocatedDeviceInit::Attach(PWDFDEVICE_INIT DeviceInit)
{
    m_DeviceInit = DeviceInit;
}

PWDFDEVICE_INIT CPreAllocatedDeviceInit::Detach()
{
    auto DevInit = m_DeviceInit;
    m_DeviceInit = nullptr;
    return DevInit;
}

NTSTATUS CPreAllocatedDeviceInit::SetPreprocessCallback(PFN_WDFDEVICE_WDM_IRP_PREPROCESS Callback,
                                                        UCHAR MajorFunction,
                                                        const PUCHAR MinorFunctions,
                                                        ULONG NumMinorFunctions)
{
    auto status = WdfDeviceInitAssignWdmIrpPreprocessCallback(m_DeviceInit,
                                                              Callback,
                                                              MajorFunction,
                                                              MinorFunctions,
                                                              NumMinorFunctions);
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! status: %!STATUS!", status);
    }
    return status;
}

NTSTATUS CWdfDevice::CreateSymLink(const UNICODE_STRING &Name)
{
    auto status = WdfDeviceCreateSymbolicLink(m_Device, &Name);
    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! failed %!STATUS!", status);
    }
    return status;
}

NTSTATUS CWdfDevice::Create(CPreAllocatedDeviceInit &DeviceInit, WDF_OBJECT_ATTRIBUTES &DeviceAttr)
{
    auto DevInitObj = DeviceInit.Detach();

    auto status = WdfDeviceCreate(&DevInitObj, &DeviceAttr, &m_Device);
    if (!NT_SUCCESS(status))
    {
        DeviceInit.Attach(DevInitObj);
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! failed %!STATUS!", status);
    }

    status = CacheDeviceName();
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! Device name caching failed %!STATUS!", status);
    }

    m_LowerDeviceObj = IoGetLowerDeviceObject(WdmObject());

    return status;
}

NTSTATUS CWdfQueue::Create(CWdfDevice &Device)
{
    WDF_IO_QUEUE_CONFIG      QueueConfig;
    WDF_OBJECT_ATTRIBUTES    Attributes;

    InitConfig(QueueConfig);
    SetCallbacks(QueueConfig);

    WDF_OBJECT_ATTRIBUTES_INIT(&Attributes);
    Attributes.ExecutionLevel = m_ExecutionLevel;

    auto status = Device.AddQueue(QueueConfig, Attributes, m_Queue);
    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! failed %!STATUS!", status);
    }

    return status;
}

NTSTATUS CWdfDevice::AddQueue(WDF_IO_QUEUE_CONFIG &Config, WDF_OBJECT_ATTRIBUTES &Attributes, WDFQUEUE &Queue)
{
    auto status = WdfIoQueueCreate(m_Device, &Config, &Attributes, &Queue);
    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! failed %!STATUS!", status);
    }

    return status;
}

void CWdfDefaultQueue::InitConfig(WDF_IO_QUEUE_CONFIG &QueueConfig)
{
    WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&QueueConfig, m_DispatchType);
}

void CWdfSpecificQueue::InitConfig(WDF_IO_QUEUE_CONFIG &QueueConfig)
{
    WDF_IO_QUEUE_CONFIG_INIT(&QueueConfig, m_DispatchType);
}

CWdfDevice::~CWdfDevice()
{
    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_WDFDEVICE, "%!FUNC! Deleting device %wZ", m_CachedName);
    if (m_LowerDeviceObj)
    {
        ObDereferenceObject(m_LowerDeviceObj);
    }
}

NTSTATUS CWdfDevice::CacheDeviceName()
{
    WDFSTRING deviceName;
    auto status = WdfStringCreate(NULL, WDF_NO_OBJECT_ATTRIBUTES, &deviceName);
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! WdfStringCreate failed. %!STATUS!", status);
        return status;
    }

    status = WdfDeviceRetrieveDeviceName(m_Device, deviceName);
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! WdfDeviceRetrieveDeviceName failed. %!STATUS!", status);
        WdfObjectDelete(deviceName);
        return status;
    }

    UNICODE_STRING UnicodeDeviceName;
    WdfStringGetUnicodeString(deviceName, &UnicodeDeviceName);

    status = m_CachedName.Create(&UnicodeDeviceName);
    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! CString creation failed. %!STATUS!", status);
        WdfObjectDelete(deviceName);
        return status;
    }

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_WDFDEVICE, "%!FUNC! Newly created device name is %wZ", &UnicodeDeviceName);
    WdfObjectDelete(deviceName);
    return STATUS_SUCCESS;
}

NTSTATUS CWdfDevice::CreateUserModeHandle(HANDLE RequestorProcess, PHANDLE ObjectHandle)
{
    IO_STATUS_BLOCK IoStatusBlock;
    PCUNICODE_STRING UniName = m_CachedName;

    OBJECT_ATTRIBUTES ObjectAttributes;
    InitializeObjectAttributes(&ObjectAttributes,
                               const_cast<PUNICODE_STRING>(UniName),
                               OBJ_KERNEL_HANDLE,
                               nullptr, nullptr);

    HANDLE KernelHandle;
    auto status = ZwOpenFile(&KernelHandle,
                             GENERIC_READ | GENERIC_WRITE,
                             &ObjectAttributes, &IoStatusBlock, 0,
                             FILE_NON_DIRECTORY_FILE | FILE_RANDOM_ACCESS);
    if (!NT_SUCCESS(status))
    {
        return status;
    }

    status = ZwDuplicateObject(ZwCurrentProcess(),
                               KernelHandle,
                               RequestorProcess,
                               ObjectHandle,
                               0,
                               0,
                               DUPLICATE_SAME_ACCESS |
                               DUPLICATE_SAME_ATTRIBUTES |
                               DUPLICATE_CLOSE_SOURCE);

    if (!NT_SUCCESS(status))
    {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! ZwDuplicateObject failed. %!STATUS!", status);
        ZwClose(KernelHandle);
    }

    return status;
}


text:
package eu.bcvsolutions.idm.core.api.dto;

import eu.bcvsolutions.idm.core.api.domain.Embedded;
import java.util.UUID;

/**
 * IdM role-system DTO - It is parent for SysRoleSystemDto in Acc module (we need to work with role-system also in the core module).
 *
 * @author Vít Švanda
 * @since 11.2.0
 *
 */
public class IdmRoleSystemDto extends AbstractDto {

	private static final long serialVersionUID = 8370614337014336679L;
	//
	@Embedded(dtoClass = IdmRoleDto.class)
	private UUID role;
	@Embedded(dtoClass = IdmSystemDto.class)
	private UUID system;
	private UUID systemMapping;

	public UUID getSystemMapping() {
		return systemMapping;
	}

	public void setSystemMapping(UUID systemMapping) {
		this.systemMapping = systemMapping;
	}

	public UUID getRole() {
		return role;
	}

	public void setRole(UUID role) {
		this.role = role;
	}

	public UUID getSystem() {
		return system;
	}

	public void setSystem(UUID system) {
		this.system = system;
	}
}