text:
[![CircleCI](https://circleci.com/gh/AMCN41R/harness.svg?style=shield)](https://circleci.com/gh/AMCN41R/harness)
[![NuGet version](https://badge.fury.io/nu/harness.svg)](https://badge.fury.io/nu/harness)

Harness is a .NET library designed to manage the state of a Mongo database during testing.

## About
Harness is designed to aid unit and integration testing by putting a Mongo database in a known state at the beginning of a test, or suite of tests. The framework allows you to control your code's dependency on a Mongo database, therefore increasing test consistency and repeat-ability.

Harness is an open source project, licensed under the [MIT License](https://github.com/AMCN41R/Harness/blob/dev/LICENSE)

## API Documentation
You can find the API documentation [here](http://amcn41r.github.io/harness).

## Getting Harness
Harness is availble on [nuget](https://www.nuget.org/packages/Harness) and can be installed with...
```
Install-Package Harness
```

## Basic Usage
Harness will put one or more Mongo databases into a state defined by a json settings file and one or more json data files.

### Settings File
The settings file must have a `.json` extension. It is a json object that contains a `databases` property that is an array of `database` objects.

#### Database Object
- **databseName**: The name of the database that will be used.
- **connectionString**: The connection string of the mongo server where the database should be created.
- **collectionNameSuffix**: A string that will be added to the end of each collection name specified in the collections array.
- **dropFirst**: A boolean value that indicates whether or not this database should be dropped if it already exists, and re-created.
- **collections**: An array of `collection` objects.

#### Collection Object
- **collectionName**: The name of the collection that will be used.
- **dropFirst**: A boolean value that indicates whether or not this collection should be dropped if it already exists, and re-created.
- **dataFileLocation**: The path to the json file that contains the data that should be inserted into this collection.

#### Example settings file, 'ExampleSettings.json'
```
{
    "databases": [
        {
            "databaseName": "TestDb1",
            "connectionString": "mongodb://localhost:27017",
            "collectionNameSuffix": "",
            "dropFirst": true,
            "collections": [
                {
                    "collectionName": "TestCollection1",
                    "dataFileLocation": "Collection1.json",
                    "dropFirst": false
                },
                {
                    "collectionName": "TestCollection2",
                    "dataFileLocation": "Collection2.json",
                    "dropFirst": false
                }
            ]
        }
    ]
}
```

### Data File
Test data files must have a `.json` extension and contain an array of json objects.

#### Example data file, 'Collection1.json'
```
[
    {
        "_id": { "$oid": "56a69c36d1894801d0ce3d05" },
        "Col1b": "Value1b",
        "Col2b": "Value2b"
    },
    {
        "_id": { "$oid": "56a69c36d1894801d0ce3d06" },
        "Col1b": "Value3b",
        "Col2b": "Value4b"
    }
]
```

Point your test class at the settings file using the `HarnessConfig` attribute, and extend `HarnessBase` to have the database configuration run before each test.

### Example test class using XUnit
```csharp
[HarnessConfig(ConfigFilePath = "ExampleSettings.json")]
public class AutoConfigureDatabase : HarnessBase
{
    [Fact]
    public void Test1()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();

        // Act
        var result = classUnderTest.GetCollectionRecordCount("TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }
}
```

## HarnessBase Class
The `HarnessBase` class is an abstract class that, during construction, loads the Harness settings and data files, and configures the Mongo instance defined inside the settings file.
Using the `HarnessBase` class with a Harness Settings file and Harness Data file(s) is the simplest and easiest way to configure a Mongo instance...

1.	Create a json file containing an array of json objects (one file per mongo collection)
2.	Create a settings file
3.	Make your test class extend `HarnessBase`
4.	Optionally annotate your test class with the `HarnessConfig` attribute to specify the file path of your settings file. If the attribute is not present, or a configuration file path is not specified on the attribute, a default value of [ClassName].json will be used.

## XUnit Examples

### Auto Configuration
To use Harness:
- add the `HarnessConfig` attribute to the class that contains the tests
- specify the relative path to the Harness settings file by setting the ConfigFilePath variable
- have the class that contains the tests extend `HarnessBase`

When a test is run, the `HarnessBase` class will use the settings file to put the Mongo databases specified within it into the desired state. This will happen automatically when the class is constructed.

The `HarnessBase` class exposes the `IMongoClient` objects that it created while setting up the databases so that, if required, they can be re-used in the tests. This is exposed as a `Dictionary<string, IMongoClient>` where the dictionary key is the mongo server connection string.

```csharp
[HarnessConfig(ConfigFilePath = "ExampleSettings.json")]
public class AutoConfigureDatabase : HarnessBase
{
    [Fact]
    public void Test1()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();

        // Act
        var result = classUnderTest.GetCollectionRecordCount("TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }

    [Fact]
    public void Test2()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();

        // The method we are testing needs an instance of IMongoClient.
        // Rather than create a new one, we can re-use the one that was
        // created by the HarnessBase class when it was setting up the
        // databases.
        var mongoClient = this.MongoConnections["mongodb://localhost:20719"];

        // Act
        var result = classUnderTest.GetCollectionRecordCount(mongoClient, "TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }
}
```

### Manual Configuration
To use Harness:
- add the `HarnessConfig` attribute to the class that contains the tests
- specify the relative path to the Harness settings file by setting the ConfigFilePath variable
- specify `AutoRun = false` to stop the databases being created
- have the class that contains the tests extend `HarnessBase` on class construction

Setting AutoRun = false, tells the `HarnessBase` class not to setup the databases until the BuildDatabase() method is called.

The `HarnessBase` class exposes the IMongoClient objects that it created while setting up the databases so that, if required, they can be re-used in the tests. This is exposed as a `Dictionary<string, IMongoClient>` where the dictionary key is the mongo server connection string.

```csharp
[HarnessConfig(ConfigFilePath = "ExampleSettings.json", AutoRun = false)]
public class ManuallyConfigureDatabase : HarnessBase
{
    [Fact]
    public void Test1()
    {
        // Arrange

        // As AutoRun is set to false on the class attribute, the BuildDatabase()
        // must be called to tell the HarnessBase class to setup the databases.
        this.BuildDatabase();

        var classUnderTest = new ClassUnderTest();

        // Act
        var result = classUnderTest.GetCollectionRecordCount("TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }

    [Fact]
    public void Test2()
    {
        // Arrange

        // As AutoRun is set to false on the class attribute, the BuildDatabase()
        // must be called to tell the HarnessBase class to setup the databases.
        this.BuildDatabase();

        var classUnderTest = new ClassUnderTest();
        var mongoClient = this.MongoConnections["mongodb://localhost:20719"];

        // Act
        var result = classUnderTest.GetCollectionRecordCount(mongoClient, "TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }
}
```

### Test Fixture Configuration
To use Harness with an XUnit ClassFixture:
- add the `HarnessConfig` attribute to the class fixture.
- specify the relative path to the Harness settings file by setting the ConfigFilePath variable
- have the class fixture extend `HarnessBase`

When a test is run, the `HarnessBase` class will use the settings file to
put the mongo databases specified within it into the desired state.
This will happen automatically when the class constructor is called.

The `HarnessBase` class exposes the IMongoClient objects that it created
while setting up the databases so that, if required, they can be re-used
in the tests. This is exposed as a `Dictionary<string, IMongoClient>`
where the dictionary key is the mongo server connection string.

```csharp
[HarnessConfig(ConfigFilePath = "ExampleSettings.json")]
public class DatabaseFixture : HarnessBase, IDisposable
{
    public DatabaseFixture()
    {
        // Any other setup stuff...
    }

    public void Dispose()
    {
        // Any cleaning up...
    }
}

public class UsingTheBaseClassWithClassFixture : IClassFixture<DatabaseFixture>
{
    public UsingTheBaseClassWithClassFixture(DatabaseFixture fixture)
    {
        this.Fixture = fixture;
    }

    private DatabaseFixture Fixture { get; }

    [Fact]
    public void Test1()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();

        // Act
        var result = classUnderTest.GetCollectionRecordCount("TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }

    [Fact]
    public void Test2()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();
        var mongoClient = this.Fixture.MongoConnections["mongodb://localhost:27017"];

        // Act
        var result = classUnderTest.GetCollectionRecordCount(mongoClient, "TestCollection1");

        // Assert
        Assert.Equal(2, result);
    }
}
```

## Fluent Configuration with the SettingsBuilder and HarnessManager classes
With the `SettingsBuilder` and `HarnessManager` classes you can use Harness to setup your Mongo databases without the need for configuration files.

### SettingsBuilder
The `SettingsBuilder` class provides a fluent api to build a configuration object for the `HarnessManager`. You can continue to use json files to load test data, or implement the `IDataProvider` interface to give Harness the data from code.

#### Example using json files
This example creates a configuration for one database called 'TestDb1', that has two collections...
```csharp
var settings =
    new SettingsBuilder()
        .AddDatabase("TestDb1")
        .WithConnectionString("mongodb://localhost:27017")
        .DropDatabaseFirst()
        .AddCollection("col1", true, "path/to/Collection1.json")
        .AddCollection("col2", true, "path/to/Collection2.json")
        .Build();
```

#### Example using IDataProvider
This example creates a configuration for a database called 'TestDb2', that has one collection...
```csharp
var settings =
    new SettingsBuilder()
        .AddDatabase("TestDb2")
        .WithConnectionString("mongodb://localhost:27017")
        .DropDatabaseFirst()
        .AddCollection<Person>("people", true, new PersonDataProvider())
        .Build();

public class PersonDataProvider : IDataProvider
{
    public IEnumerable<object> GetData()
    {
        return new List<Person>
        {
            new Person {FirstName = "Peter", LastName = "Venkman", Age = 31},
            new Person {FirstName = "Ray", LastName = "Stantz", Age = 32},
            new Person {FirstName = "Egon", LastName = "Spengler", Age = 33}
        };
    }
}

public class Person
{
    public ObjectId Id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public int Age { get; set; }
}
```

#### Adding Mongo Conventions
The `SettingsBuilder` api also allows you to register global Mongo conventions before the configuration is run. This example shows how to add the `CamelCaseElementNameConvention` to all classes whose namespace starts with "MyProject"...
```csharp
var settings =
    new SettingsBuilder()
        .AddConvention(new CamelCaseElementNameConvention(), x => x.Namespace.StartsWith("MyProject"))
        .AddDatabase("TestDb1")
        .WithConnectionString("mongodb://localhost:27017")
        .DropDatabaseFirst()
        .AddCollection("col1", true, "path/to/Collection1.json")
        .Build();
```

### HarnessManager
Once you have your settings object, you can pass it to the `HarnessManager` and use it to setup the database. The `build()` method returns a `Dictionary<string, IMongoClient>` containing the MongoClient instances (one per unique connection string in the settings) for re-use. The dictionary key if the connection string.

```csharp
var mongoClients =
    new HarnessManager()
        .UsingSettings(settings) // the settings object built using the SettingsBuilder
        .Build();
```

### XUnit Example
Here, we call `build()` in the test class constructor which means the configuration will run before each test in the class is executed...
```csharp
public class SettingsBuilderWithDataFiles
{
    public SettingsBuilderWithDataFiles()
    {
        var settings =
            new SettingsBuilder()
                .AddDatabase("TestDb1")
                .WithConnectionString("mongodb://localhost:27017")
                .DropDatabaseFirst()
                .AddCollection("col1", true, "path/to/Collection1.json")
                .AddCollection("col2", true, "path/to/Collection2.json")
                .Build();

        this.MongoConnections =
            new HarnessManager()
                .UsingSettings(settings)
                .Build();
    }

    private Dictionary<string, IMongoClient> MongoConnections { get; }

    [Fact]
    public void Test1()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();

        // Act
        var result = classUnderTest.GetCollectionRecordCount("col1");

        // Assert
        Assert.Equal(2, result);
    }

    [Fact]
    public void Test2()
    {
        // Arrange
        var classUnderTest = new ClassUnderTest();
        var mongoClient = this.MongoConnections["mongodb://localhost:27017"];

        // Act
        var result = classUnderTest.GetCollectionRecordCount(mongoClient, "col1");

        // Assert
        Assert.Equal(2, result);
    }
}
```


text: NSArray *rt_methods(id obj);

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Drupal\commerce;

use Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface;
use Drupal\Component\Plugin\Exception\PluginException;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;

/**
 * Manages discovery and instantiation of entity trait plugins.
 *
 * @see \Drupal\commerce\Annotation\CommerceEntityTrait
 * @see plugin_api
 */
class EntityTraitManager extends DefaultPluginManager implements EntityTraitManagerInterface {

  /**
   * The configurable field manager.
   *
   * @var \Drupal\commerce\ConfigurableFieldManagerInterface
   */
  protected $configurableFieldManager;

  /**
   * Constructs a new EntityTraitManager object.
   *
   * @param \Traversable $namespaces
   *   An object that implements \Traversable which contains the root paths
   *   keyed by the corresponding namespace to look for plugin implementations.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
   *   The cache backend.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   * @param \Drupal\commerce\ConfigurableFieldManagerInterface $configurable_field_manager
   *   The configurable field manager.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigurableFieldManagerInterface $configurable_field_manager) {
    parent::__construct('Plugin/Commerce/EntityTrait', $namespaces, $module_handler, 'Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface', 'Drupal\commerce\Annotation\CommerceEntityTrait');

    $this->alterInfo('commerce_entity_trait_info');
    $this->setCacheBackend($cache_backend, 'commerce_entity_trait_plugins');
    $this->configurableFieldManager = $configurable_field_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function processDefinition(&$definition, $plugin_id) {
    parent::processDefinition($definition, $plugin_id);

    foreach (['id', 'label'] as $required_property) {
      if (empty($definition[$required_property])) {
        throw new PluginException(sprintf('The entity trait %s must define the %s property.', $plugin_id, $required_property));
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getDefinitionsByEntityType($entity_type_id) {
    $definitions = $this->getDefinitions();
    $definitions = array_filter($definitions, function ($definition) use ($entity_type_id) {
      return empty($definition['entity_types']) || in_array($entity_type_id, $definition['entity_types']);
    });

    return $definitions;
  }

  /**
   * {@inheritdoc}
   */
  public function detectConflicts(EntityTraitInterface $trait, array $installed_traits) {
    $field_names = array_keys($trait->buildFieldDefinitions());
    if (!$field_names) {
      return [];
    }

    $conflicting_traits = [];
    foreach ($installed_traits as $installed_trait) {
      $installed_field_names = array_keys($installed_trait->buildFieldDefinitions());
      if (array_intersect($field_names, $installed_field_names)) {
        $conflicting_traits[] = $installed_trait;
      }
    }

    return $conflicting_traits;
  }

  /**
   * {@inheritdoc}
   */
  public function installTrait(EntityTraitInterface $trait, $entity_type_id, $bundle) {
    // The fields provided by an entity trait are maintained as locked
    // configurable fields, for simplicity.
    foreach ($trait->buildFieldDefinitions() as $field_name => $field_definition) {
      $field_definition->setTargetEntityTypeId($entity_type_id);
      $field_definition->setTargetBundle($bundle);
      $field_definition->setName($field_name);

      $this->configurableFieldManager->createField($field_definition);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function canUninstallTrait(EntityTraitInterface $trait, $entity_type_id, $bundle) {
    foreach ($trait->buildFieldDefinitions() as $field_name => $field_definition) {
      $field_definition->setTargetEntityTypeId($entity_type_id);
      $field_definition->setTargetBundle($bundle);
      $field_definition->setName($field_name);

      if ($this->configurableFieldManager->hasData($field_definition)) {
        return FALSE;
      }
    }
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function uninstallTrait(EntityTraitInterface $trait, $entity_type_id, $bundle) {
    foreach ($trait->buildFieldDefinitions() as $field_name => $field_definition) {
      $field_definition->setTargetEntityTypeId($entity_type_id);
      $field_definition->setTargetBundle($bundle);
      $field_definition->setName($field_name);

      $this->configurableFieldManager->deleteField($field_definition);
    }
  }

}


text:
package httpbin

import "testing"

// Silly test just to satisfy coverage
func TestMustStaticAsset(t *testing.T) {
	defer func() {
		// recover from panic if one occured. Set err to nil otherwise.
		if err := recover(); err == nil {
			t.Fatalf("expected to recover from panic, got nil")
		}
	}()
	mustStaticAsset("xxxyyyzzz")
}


text:
A Java implemented web crawler framework
distributed crawler accept remote submit using class name and params;

## License
MIT License


text:
#include <dae/daeAtomicType.h>
#include <dae/daeElement.h>
#include <dae/daeURI.h>
#include <dae/daeIDRef.h>
#include <dae/daeMetaElement.h>
#include <dae/daeDatabase.h>
#include <dae/daeErrorHandler.h>

daeAtomicTypeArray* daeAtomicType::_Types = NULL;
daeBool daeAtomicType::_TypesInitialized = false;

void
daeAtomicType::initializeKnownTypes()
{
	_Types = new daeAtomicTypeArray;
	initializeKnownBaseTypes();
	//mandatory to set here, because the array types are querying the atomic types
	_TypesInitialized = true;
}

void
daeAtomicType::uninitializeKnownTypes()
{
	if ( _TypesInitialized )
		{
		_TypesInitialized = false;
		unsigned int i;
		for (i=0;i<_Types->getCount();i++)
		{
			daeAtomicType* type = _Types->get(i);
			delete type;
		}
		delete _Types;
	}
}

void
daeAtomicType::initializeKnownBaseTypes()
{
	_Types->append(new daeUIntType);
	_Types->append(new daeIntType);
	_Types->append(new daeLongType);
	_Types->append(new daeShortType);
	_Types->append(new daeUIntType);
	_Types->append(new daeULongType);
	_Types->append(new daeFloatType);
	_Types->append(new daeDoubleType);
	_Types->append(new daeStringRefType);
	_Types->append(new daeElementRefType);
	_Types->append(new daeEnumType);
	_Types->append(new daeRawRefType);
	_Types->append(new daeResolverType);
	_Types->append(new daeIDResolverType);
	_Types->append(new daeBoolType);
	_Types->append(new daeTokenType);
}

daeAtomicType*
daeAtomicType::get(daeStringRef typeString)
{
	if (!_TypesInitialized)
		daeAtomicType::initializeKnownTypes();

	int tCount = (int)_Types->getCount();
	int i;
	for(i=0; i<tCount; i++) {
		daeAtomicType* type = _Types->get(i);
		daeStringRefArray& nameBindings = type->getNameBindings();
		int count = (int)nameBindings.getCount();
		int j;
		for(j=0;j<count;j++)
			if (!strcmp(nameBindings[j],typeString))
				break;
		if (j!=count)
			return type;
	}
	return NULL;
}
daeAtomicType::daeAtomicType()
{
	_size = -1;
	_alignment = -1;
	_typeEnum = -1;
	_typeString = "notype";
	_printFormat = "badtype";
	_scanFormat = "";
	_maxStringLength = -1;
}

daeAtomicType*
daeAtomicType::get(daeEnum typeEnum)
{
	if (!_TypesInitialized)
		daeAtomicType::initializeKnownTypes();

	int tCount = (int)_Types->getCount();
	int i;
	for(i=0; i<tCount; i++) {
		daeAtomicType* type = _Types->get(i);
		if (type->getTypeEnum() == typeEnum)
			return type;
	}
	return NULL;
}

daeBool
daeAtomicType::stringToMemory(daeChar *src, daeChar* dstMemory)
{
	sscanf(src, _scanFormat, dstMemory);
	return true;
}

daeBool
daeAtomicType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	// just to remove the warnings
	(void)src;

	if (dstSize > 32)
		sprintf(dst,"unknown type string conversion\n");
	return true;
}

daeInt
daeAtomicType::append(daeAtomicType* t) {
	if (!_TypesInitialized)
		daeAtomicType::initializeKnownTypes();
	return (daeInt)_Types->append(t);
}

const daeAtomicType*
daeAtomicType::getByIndex(daeInt index) {
	return _Types->get(index);
}

daeInt
daeAtomicType::getCount() {
	return (daeInt)_Types->getCount();
}

daeEnumType::daeEnumType()
{
	_size = sizeof(daeEnum);
	_alignment = sizeof(daeEnum);
	_typeEnum = EnumType;
	_nameBindings.append("enum");
	_printFormat = "%s";//"%%.%ds";
	_scanFormat = "%s";
	_strings = NULL;
	_values = NULL;
	_typeString = "enum";
}

daeEnumType::~daeEnumType() {
	if ( _strings ) {
		delete _strings;
		_strings = NULL;
	}
	if ( _values ) {
		delete _values;
		_values = NULL;
	}
}

daeBoolType::daeBoolType()
{
	_size = sizeof(daeBool);
	_alignment = sizeof(daeBool);
	_typeEnum = BoolType;
	_printFormat = "%d";
	_scanFormat = "%d";
	_typeString = "bool";
	_maxStringLength = (daeInt)strlen("false")+1;
	_nameBindings.append("bool");
	//_nameBindings.append("xsBool");
	_nameBindings.append("xsBoolean");
}

daeIntType::daeIntType()
{
	_size = sizeof(daeInt);
	_alignment = sizeof(daeInt);
	_typeEnum = IntType;
	_maxStringLength = 16;
	_nameBindings.append("int");
	_nameBindings.append("xsInteger");
	_nameBindings.append("xsHexBinary");
	_nameBindings.append("xsIntegerArray");
	_nameBindings.append("xsHexBinaryArray");
	_nameBindings.append("xsByte");
	_nameBindings.append("xsInt");
	_printFormat = "%d";
	_scanFormat = "%d";
	_typeString = "int";
}
daeLongType::daeLongType()
{
	_size = sizeof(daeLong);
	_alignment = sizeof(daeLong);
	_typeEnum = LongType;
	_maxStringLength = 32;
	_nameBindings.append("xsLong");
	_nameBindings.append("xsLongArray");
	_printFormat = "%lld";
	_scanFormat = "%lld";
	_typeString = "long";
}
daeShortType::daeShortType()
{
	_maxStringLength = 8;
	_size = sizeof(daeShort);
	_alignment = sizeof(daeShort);
	_typeEnum = ShortType;
	_nameBindings.append("short");
	_nameBindings.append("xsShort");
	_printFormat = "%hd";
	_scanFormat = "%hd";
	_typeString = "short";
}
daeUIntType::daeUIntType()
{
	_maxStringLength = 16;
	_size = sizeof(daeUInt);
	_alignment = sizeof(daeUInt);
	_typeEnum = UIntType;
	_nameBindings.append("uint");
	_nameBindings.append("xsNonNegativeInteger");
	_nameBindings.append("xsUnsignedByte");
	_nameBindings.append("xsUnsignedInt");
	_nameBindings.append("xsPositiveInteger");
	_printFormat = "%u";
	_scanFormat = "%u";
	_typeString = "uint";
}
daeULongType::daeULongType()
{
	_size = sizeof(daeULong);
	_alignment = sizeof(daeULong);
	_typeEnum = ULongType;
	_maxStringLength = 32;
	_nameBindings.append("ulong");
	_nameBindings.append("xsUnsignedLong");
	_printFormat = "%llu";
	_scanFormat = "%llu";
	_typeString = "ulong";
}
daeFloatType::daeFloatType()
{
	_maxStringLength = 64;
	_size = sizeof(daeFloat);
	_alignment = sizeof(daeFloat);
	_typeEnum = FloatType;
	_nameBindings.append("float");
	_nameBindings.append("xsFloat");
	_printFormat = "%g";
	_scanFormat = "%g";
	_typeString = "float";
}
daeDoubleType::daeDoubleType()
{
	_size = sizeof(daeDouble);
	_alignment = sizeof(daeDouble);
	_typeEnum = DoubleType;
	_nameBindings.append("double");
	_nameBindings.append("xsDouble");
	_nameBindings.append("xsDecimal");
	_printFormat = "%lg";
	_scanFormat = "%lg";
	_typeString = "double";
	_maxStringLength = 64;
}

daeStringRefType::daeStringRefType()
{
	_size = sizeof(daeStringRef);
	_alignment = sizeof(daeStringRef);
	_typeEnum = StringRefType;
	_nameBindings.append("string");
	_nameBindings.append("xsString");
	_nameBindings.append("xsDateTime");
	_printFormat = "%s";
	_scanFormat = "%s";
	_typeString = "string";
}

daeTokenType::daeTokenType()
{
	_size = sizeof(daeStringRef);
	_alignment = sizeof(daeStringRef);
	_typeEnum = TokenType;
	_nameBindings.append("token");
	_nameBindings.append("xsID");
	_nameBindings.append("xsNCName");
	_nameBindings.append("xsNMTOKEN");
	_nameBindings.append("xsName");
	_nameBindings.append("xsToken");
	_nameBindings.append("xsNameArray");
	_nameBindings.append("xsTokenArray");
	_nameBindings.append("xsNCNameArray");
	_printFormat = "%s";
	_scanFormat = "%s";
	_typeString = "token";
}

daeElementRefType::daeElementRefType()
{
	_size = sizeof(daeElementRef);
	_alignment = sizeof(daeElementRef);
	_typeEnum = ElementRefType;
	_nameBindings.append("element");
	_nameBindings.append("Element");
	_nameBindings.append("TrackedElement");
	_printFormat = "%p";
	_scanFormat = "%p";
	_typeString = "element";
	_maxStringLength = 64;
}

daeRawRefType::daeRawRefType()
{
	_size = sizeof(daeRawRef);
	_alignment = sizeof(daeRawRef);
	_typeEnum = RawRefType;
	_nameBindings.append("raw");
	_printFormat = "%p";
	_scanFormat = "%p";
	_typeString = "raw";
	_maxStringLength = 64;
}

daeResolverType::daeResolverType()
{
	_size = sizeof(daeURI);
	_alignment = sizeof(daeURI);
	_typeEnum = ResolverType;
	_nameBindings.append("resolver");
	_nameBindings.append("xsAnyURI");
	_printFormat = "%s";
	_scanFormat = "%s";
	_typeString = "resolver";
}
daeIDResolverType::daeIDResolverType()
{
	_size = sizeof(daeIDRef);
	_alignment = sizeof(daeIDRef);
	_typeEnum = IDResolverType;
	_nameBindings.append("xsIDREF");
	_nameBindings.append("xsIDREFS");
	_printFormat = "%s";
	_scanFormat = "%s";
	_typeString = "idref_resolver";
}
daeBool
	daeIntType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	sprintf(dst,_printFormat,*((daeInt*)src));
	return true;
}
daeBool
	daeLongType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	sprintf(dst,_printFormat,*((daeLong*)src));
	return true;
}
daeBool
	daeShortType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	sprintf(dst,_printFormat,*((daeShort*)src));
	return true;
}
daeBool
	daeUIntType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	sprintf(dst,_printFormat,*((daeUInt*)src));
	return true;
}
daeBool
	daeULongType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	sprintf(dst,_printFormat,*((daeULong*)src));
	return true;
}
daeBool
	daeFloatType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	if ( *(daeFloat*)src != *(daeFloat*)src ) //NAN
	{
		strcpy( dst, "NaN" );
	}
	else if ( *(daeUInt*)src == 0x7f800000 ) //+INF
	{
		strcpy( dst, "INF" );
	}
	else if ( *(daeUInt*)src == 0xff800000 ) //-INF
	{
		strcpy( dst, "-INF" );
	}
	else
	{
		sprintf(dst,_printFormat,*((daeFloat*)src));
	}
	return true;
}

daeBool
daeFloatType::stringToMemory(daeChar *src, daeChar* dstMemory)
{
	if ( strcmp(src, "NaN") == 0 ) {
		daeErrorHandler::get()->handleWarning("NaN encountered while setting an attribute or value\n");
		*(daeInt*)(dstMemory) = 0x7f800002;
	}
	else if ( strcmp(src, "INF") == 0 ) {
		daeErrorHandler::get()->handleWarning( "INF encountered while setting an attribute or value\n" );
		*(daeInt*)(dstMemory) = 0x7f800000;
	}
	else if ( strcmp(src, "-INF") == 0 ) {
		daeErrorHandler::get()->handleWarning( "-INF encountered while setting an attribute or value\n" );
		*(daeInt*)(dstMemory) = 0xff800000;
	}
	else
	{
		sscanf(src, _scanFormat, dstMemory);
	}
	return true;
}

daeBool
	daeDoubleType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	if ( *(daeDouble*)src != *(daeDouble*)src ) //NAN
	{
		strcpy( dst, "NaN" );
	}
#if !(defined (_MSC_VER) && _MSC_VER < 1300)
	//this breaks visual studio 2006, so ignore NaN/INF rather then break the build
	else if ( *(daeULong*)src == 0x7ff0000000000000LL ) //+INF
	{
		strcpy( dst, "INF" );
	}
	else if ( *(daeULong*)src == 0xfff0000000000000LL ) //-INF
	{
		strcpy( dst, "-INF" );
	}
#endif
	else
	{
		sprintf(dst,_printFormat,*((daeDouble*)src));
	}
	return true;
}

daeBool
daeDoubleType::stringToMemory(daeChar *src, daeChar* dstMemory)
{
#if !(defined (_MSC_VER) && _MSC_VER < 1300)
	//this breaks visual studio 2006, so ignore NaN/INF rather then break the build
	if ( strcmp(src, "NaN") == 0 ) {
		daeErrorHandler::get()->handleWarning( "NaN encountered while setting an attribute or value\n" );
		*(daeLong*)(dstMemory) = 0x7ff0000000000002LL;
	}
	else if ( strcmp(src, "INF") == 0 ) {
		daeErrorHandler::get()->handleWarning( "INF encountered while setting an attribute or value\n" );
		*(daeLong*)(dstMemory) = 0x7ff0000000000000LL;
	}
	else if ( strcmp(src, "-INF") == 0 ) {
		daeErrorHandler::get()->handleWarning( "-INF encountered while setting an attribute or value\n" );
		*(daeLong*)(dstMemory) = 0xfff0000000000000LL;
	}
	else
#endif
	{
		sscanf(src, _scanFormat, dstMemory);
	}
	return true;
}

daeBool
	daeRawRefType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (_maxStringLength > dstSize) return false;
	sprintf(dst,"%p",(void *)(*((daeRawRef*)src)));
	return true;
}

daeBool
daeStringRefType::getUsesStrings()
{
	return true;
}
daeBool
daeTokenType::getUsesStrings()
{
	return false;
}
daeBool
daeStringRefType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	daeString s = *((daeStringRef *)src);
	if (!s || strlen(s) == 0)
		dst[0] = '\0';
	else {
		char tmp[64];
		sprintf(tmp,"%%.%ds",dstSize-1);
		sprintf(dst,tmp,(const char*)s);

		if ((daeInt)(strlen(s)+1) > dstSize)
			return false;
	}
	return true;
}

daeBool
daeResolverType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
#if 1
	// Get the URI we are trying to write
	daeURI *thisURI = ((daeURI *)src);
	daeString s;

	// !!!GAC We may want to re-resolve the URI before writing, if so call thisURI->resolveURI() here
	// !!!GAC if you're willing to trust that everything is properly resolved, this isn't needed

	// Was this URI successfully resolved ?  (if element or collection is null, we can't write the URI correctly)
	if(thisURI->getState() != daeURI::uri_success || !(thisURI->getElement()) || !(thisURI->getContainer()))
	{
		// This URI was never successfully resolved, so write out it's original value
		s = thisURI->getOriginalURI();
		if ( s == NULL ) s = "";
	}
	else
	{
		// This URI was successfully resolved, we need to determine if it is referencing this document (the one being written)
		// or some other document so we know what URI to write out.
		// !!!GAC this approach should be safe, if the collection pointer of our document matches the collection pointer
		// !!!GAC of the element our URI is pointing at, we are pointing at our own doc.
		if(thisURI->getElement()->getDocument() == thisURI->getContainer()->getDocument())
		{
			// we will send back the original URI if we're pointing at ourselves
			s = thisURI->getOriginalURI();
			if ( s == NULL ) s = "";
		}
		else
		{
			// !!!GAC change this to test outputting of relative URIs, NOT FULLY TESTED!!!
#if 1
			// we will send back the full resolved URI
			s = thisURI->getURI();
			if ( s == NULL ) s = "";
#else
			// Makes the URI relative to the document being written, EXPERIMENTAL, not fully tested!!!
			thisURI->makeRelativeTo(thisURI->getDocument()->getCollection()->getDocumentURI());
			s = thisURI->getOriginalURI();
			if ( s == NULL ) s = "";
#endif
		}
	}
	// Copy at most dstSize-1 characters, null terminate and return error if the string was too long
	daeChar *d;
	int i;
	for(d = dst, i = 1; *s != 0 && i<dstSize; s++, d++, i++)
	{
		// If the URI contains spaces, substitute %20
		if(*s == ' ')
		{
			if( (i+2)<dstSize)
			{
				*(d++)='%';
				*(d++)='2';
				*d = '0';
			}
			else
			{
				// not enough space to escape the string so null terminate and return error
				*d = 0;
				return(false);
			}
		}
		else
		{
			*d = *s;
		}
	}
	*d = 0;
	if( *s == 0)
		return(true);
	else
		return(false);
#else
	// !!!GAC This is the old code which doesn't work for cross document references
	//	((daeURI*)src)->resolveURI();

	// Get the URI String as set, not the composited one from the base
	// as per SCEA request
	daeString s = ((daeURI *)src)->getOriginalURI();
	char tmp[64];
	sprintf(tmp,"%%.%ds",dstSize-1);
	sprintf(dst,tmp,s);

	if ((daeInt)(strlen(s)+1) > dstSize)
		return false;
	return true;
#endif
}
daeBool
daeIDResolverType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	((daeIDRef*)src)->resolveID();

	daeString s = ((daeIDRef *)src)->getID();
	char tmp[64];
	sprintf(tmp,"%%.%ds",dstSize-1);
	sprintf(dst,tmp,s);

	if ((daeInt)(strlen(s)+1) > dstSize)
		return false;
	return true;
}

void
daeAtomicType::resolve(daeElementRef element, daeChar* src)
{
	// just to remove the warnings
	(void)element;
	(void)src;
}

void
daeResolverType::resolve(daeElementRef element, daeChar* src)
{
	daeURI* resolver = (daeURI*)src;
	resolver->setContainer(element);
	resolver->resolveElement();
}

daeBool
daeResolverType::stringToMemory(daeChar* src, daeChar* dstMemory)
{
#define MAX_PATH 1024
	daeChar tempstr[MAX_PATH];
	memset(tempstr,0,MAX_PATH);
	daeChar* s;
	daeChar* t;
	for(s=src, t=tempstr; *s!=0; s++,t++)
	{
		if (*s == '%') {
			if ((*(s+1) == '2') && (*(s+2) == '0'))
			{
				(*t)=' ';
				s+=2;
				continue;
			}
		} else if (*s == ' ') {
			char err[512];
			memset( err, 0, 512 );
			sprintf(err,"uri contains white space, dom will convert them to %%20 in output files!\n  uri=%s", src);
			daeErrorHandler::get()->handleWarning( err );
		}
		*t=*s;
	}
	((daeURI*)dstMemory)->setURI(tempstr);
	return true;
}
void
daeIDResolverType::resolve(daeElementRef element, daeChar* src)
{
	daeIDRef* resolver = (daeIDRef*)src;
	resolver->setContainer( element );
	resolver->resolveElement();
}

daeBool
daeIDResolverType::stringToMemory(daeChar* src, daeChar* dstMemory)
{
	((daeIDRef*)dstMemory)->setID(src);
	return true;
}

daeBool
daeStringRefType::stringToMemory(daeChar* srcChars, daeChar* dstMemory)
{
	*((daeStringRef*)dstMemory) = srcChars;
	return true;
}

daeBool
daeEnumType::stringToMemory(daeChar* src, daeChar* dst )
{
	size_t index(0);
	if ( _strings->find(src,index) == DAE_ERR_QUERY_NO_MATCH ) return false;
	daeEnum val = _values->get( index );
	*((daeEnum*)dst) = val;

	return true;
}

daeBool
daeEnumType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	daeStringRef s = "unknown";
	if (_strings != NULL) {
		size_t index;
		if (_values->find(*((daeEnum*)src), index) == DAE_OK)
			s = _strings->get(index);
	}
	sprintf(dst,_printFormat,(const char*)s);
	(void)dstSize;
	return true;
}
daeBool
daeBoolType::stringToMemory(daeChar* srcChars, daeChar* dstMemory)
{
	if (strncmp(srcChars,"true",4)==0 || strncmp(srcChars,"1",1)==0)
		*((daeBool*)dstMemory) = true;
	else
		*((daeBool*)dstMemory) = false;
	return true;
}

daeBool
daeBoolType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	if (*((daeBool*)src)) {
		if (dstSize < 5)
			return false;
		else
			sprintf(dst,"true");
	}
	else {
		if (dstSize < 6)
			return false;
		else
			sprintf(dst,"false");
	}
	return true;
}
//!!!ACL added for 1.4 complex types and groups

//unImplemented
daeBool
daeElementRefType::memoryToString(daeChar* src, daeChar* dst, daeInt dstSize)
{
	/*if (*((daeBool*)src)) {
		if (dstSize < 5)
			return false;
		else
			sprintf(dst,"true");
	}
	else {
		if (dstSize < 6)
			return false;
		else
			sprintf(dst,"false");
	}*/
	(void)src;
	(void)dst;
	(void)dstSize;
	return false;
}


text:
(function (__global) {

  var customModules = {};
  var customFactories = {};

  var executeModule = function (name) {
    if (!customFactories[name]) {
      return;
    }
    var module = customFactories[name].apply(null, []);
    customModules[name] = module;
    return module;
  };

  function CustomLoader(baseURL) {
    System.constructor.call(this, baseURL);
  }

  // inline Object.create-style class extension
  function CustomLoaderProto() {}
  CustomLoaderProto.prototype = System.constructor.prototype;
  CustomLoader.prototype = new CustomLoaderProto();

  CustomLoader.prototype.normalize = function (name, parentName, parentAddress) {
    return new Promise(function(resolve, reject) {
      if (name == 'asdfasdf') {
        return setTimeout(function () {
          resolve('test/loader/async-norm.js');
        }, 500);
      }

      if (name == 'error1') {
        return setTimeout(function () { reject('error1'); }, 100);
      }

      var normalized = System.normalize(name, parentName, parentAddress);
      resolve(normalized);
    });
  };

  CustomLoader.prototype.locate = function (load) {
    if (load.name == 'error2') {
      return new Promise(function (resolve, reject) {
        setTimeout(function () { reject('error2'); }, 100);
      });
    }

    if (load.name.match(/path\//))
      load.name = load.name.replace(/path\//, 'test/loader/');

    return System.locate(load);
  };

  CustomLoader.prototype.fetch = function (load) {
    if (load.name == 'error3') {
      throw 'error3';
    }
    if (load.name == 'error4' || load.name == 'error5') {
      return 'asdf';
    }
    return System.fetch.apply(this, arguments);
  };

  CustomLoader.prototype.translate = function (load) {
    if (load.name == 'error4') {
      return new Promise(function (resolve, reject) {
        setTimeout(function () { reject('error4'); }, 100);
      });
    }
    return System.translate.apply(this, arguments);
  };

  CustomLoader.prototype.instantiate = function (load) {
    if (load.name.match(/(traceur|babel.+\/browser).js$/)) {
      var transpiler = this.transpiler;
      return System['import'](transpiler).then(function() {
        return {
          deps: [],
          execute: function() {
            return System.get(System.normalize(transpiler));
          }
        };
      });
    }

    if (load.name == 'error5') {
      return new Promise(function (resolve, reject) {
        setTimeout(function () { reject('error5'); }, 100);
      });
    }
    // very bad AMD support
    if (load.source.indexOf('define') == -1) {
      return System.instantiate(load);
    }

    var factory, deps;
    var define = function (_deps, _factory) {
      deps = _deps;
      factory = _factory;
    };
    eval(load.source);

    customFactories[load.name] = factory;

    // normalize all dependencies now
    var normalizePromises = [];
    for (var i = 0; i < deps.length; i++) {
      normalizePromises.push(Promise.resolve(System.normalize(deps[i], load.name, load.address)));
    }

    return Promise.all(normalizePromises).then(function (resolvedDeps) {

      return {
        deps: deps,
        execute: function () {
          if (customModules[load.name]) {
            return System.newModule(customModules[load.name]);
          }

          // first ensure all dependencies have been executed
          for (var i = 0; i < resolvedDeps.length; i++) {
            resolvedDeps[i] = executeModule(resolvedDeps[i]);
          }

          var module = factory.apply(null, resolvedDeps);

          customModules[load.name] = module;
          return System.newModule(module);
        }
      };
    });
  };

  var customLoader = new CustomLoader(System.baseURL);
  customLoader.transpiler = System.transpiler;

  if (typeof exports === 'object')
    module.exports = customLoader;

  __global.customLoader = customLoader;
}(typeof window != 'undefined' ? window : global));


text:
package ie.dit;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import javax.sql.rowset.WebRowSet;

public class WebcoursesGitClone
{
	private String src;
	private String dest;

	public WebcoursesGitClone(String src, String dest)
	{
		this.src = src;
		this.dest = dest;
	}

	public static void main(String[] args)
	{
		if (args.length != 2)
		{
			System.out.println("Usage: java ie.dit.WebcoursesGitClone SOURCE_PATH DESTINATION_PATH");
			return;
		}

		WebcoursesGitClone wgc = new WebcoursesGitClone(args[0], args[1]);

		wgc.doWork();

	}

	private void doWork()
	{
		File[] files = new File(src).listFiles(new FileFilter()
		{
			public boolean accept(File f)
			{
				return (f.getName().toLowerCase().endsWith(".txt"));
			}
		});
		if (files == null)
		{
			System.out.println("No files found");
			return;
		}
		for (File file : files)
		{
		    if (file.isFile())
		    {
		        processFile(file);
		    }
		}
	}

	private void processFile(File file)
	{
		String studentNumber = "";
		String studentName = "";
		String url = "";
		try
		{
			int start_ = file.getName().indexOf("_");
			int end_ = file.getName().indexOf("_", start_ + 1);
			studentNumber = file.getName().substring(start_ + 1, end_);
			String current;

			BufferedReader reader = new BufferedReader(new FileReader(file));

			while ((current = reader.readLine()) != null)
			{
				if (current.contains("Name: "))
				{
					int i = current.indexOf("(");
					studentName = current.substring(6, i - 1);
				}
				if (current.contains("http"))
				{
					current = current.replaceAll("\\<[^>]*>","");
					int i = current.indexOf("http");
					url = current.substring(i, current.length());
					System.out.println(studentNumber + "\t" + current);
					cloneRepo(studentNumber, studentName, url);
					break;
				}
			}
			reader.close();
			studentNumber = "";
			studentName = "";
			url = "";
		}
		catch (Exception e)
		{
			System.out.println("Error cloning:  " + url + " Student: " + studentNumber + " Name: " + studentName);
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	private void cloneRepo(String studentNumber, String studentName, String url)
	{
		int i = url.lastIndexOf("/");
		String projectName = url.substring(i + 1, url.length());
		String destPath = dest + "\\" + studentNumber + " " + studentName + "\\" + projectName;
		String[] cmd = {
				"git"
				, "clone"
				, url
				, destPath
		};

		File test = new File(destPath);
		if (test.exists())
		{
			System.out.println("Skipping: " + destPath);
			return;
		}

		try
		{
			Process process;
			process = Runtime.getRuntime().exec(cmd,null);

			InputStream in = process.getErrorStream();
	        int c;
	        while ((c = in.read()) != -1) {
	            System.out.print((char)c);
	        }
	        in.close();

			/*InputStream stream = process.getInputStream();
			BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
			String line;
			while ((line = reader.readLine()) != null)
			{
				System.out.println(line);
			}
			reader.close();
			*/
			while(process.isAlive())
			{
				Thread.sleep(1000);
			}

		}
		catch (Exception e)
		{
			System.out.println("Could not spawn git process");
			e.printStackTrace();
			return;
		}
	}
}


text:
package org.apache.jackrabbit.core.observation;

import javax.jcr.RepositoryException;
import javax.jcr.Node;
import javax.jcr.Workspace;
import javax.jcr.observation.Event;

import org.apache.jackrabbit.test.api.observation.AbstractObservationTest;
import org.apache.jackrabbit.test.api.observation.EventResult;
import org.apache.jackrabbit.core.NodeImpl;

/**
 * ShareableNodesTest...
 */
public class ShareableNodesTest extends AbstractObservationTest {

    public void testAddShareableMixin() throws RepositoryException {
        Node n1 = testRootNode.addNode(nodeName1);
        testRootNode.save();

        EventResult result = new EventResult(log);
        addEventListener(result);

        n1.addMixin(mixShareable);
        testRootNode.save();

        Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
        for (int i = 0; i < events.length; i++) {
            assertFalse("must not contain node added event", events[i].getType() == Event.NODE_ADDED);
            assertFalse("must not contain node removed event", events[i].getType() == Event.NODE_REMOVED);
        }
    }

    public void testAddShare() throws RepositoryException {
        Node n1 = testRootNode.addNode(nodeName1);
        Node n2 = testRootNode.addNode(nodeName2);
        Node s = n1.addNode(nodeName3);
        s.addMixin(mixShareable);
        testRootNode.save();

        EventResult result = new EventResult(log);
        addEventListener(result);

        Workspace wsp = superuser.getWorkspace();
        wsp.clone(wsp.getName(), s.getPath(), n2.getPath() + "/" + s.getName(), false);

        checkNodeAdded(result.getEvents(DEFAULT_WAIT_TIMEOUT),
                new String[]{nodeName2 + "/" + nodeName3},
                new String[0]);
    }

    public void testRemoveShare() throws RepositoryException {
        Node n1 = testRootNode.addNode(nodeName1);
        Node n2 = testRootNode.addNode(nodeName2);
        Node s = n1.addNode(nodeName3);
        s.addMixin(mixShareable);
        testRootNode.save();

        Workspace wsp = superuser.getWorkspace();
        wsp.clone(wsp.getName(), s.getPath(), n2.getPath() + "/" + s.getName(), false);

        EventResult result = new EventResult(log);
        addEventListener(result);

        removeFromSharedSet(n2.getNode(nodeName3));
        testRootNode.save();

        checkNodeRemoved(result.getEvents(DEFAULT_WAIT_TIMEOUT),
                new String[]{nodeName2 + "/" + nodeName3},
                new String[0]);
    }

    protected void removeFromSharedSet(Node node) throws RepositoryException {
        node.removeShare();
    }
}


text:
import privateRouting from "./private.routes";

//we are not using angular modules system, it's obsolete while having webpack
export default ngModule => {
  ngModule.config(privateRouting);
};


text:
class Email {
  constructor(sender, senderArn, subject, recipients, params) {
    this.Source = this._source(sender, senderArn);
    this.ReplyToAddresses = recipients.replyTo;
    this.Destination = {
      ToAddresses: [recipients.to],
      CcAddresses: recipients.cc,
      BccAddresses: recipients.bcc,
    };
    this.Message = {
      Subject: {
        Data: subject,
      },
      Body: {
        Text: {
          Data: this._messageBody(params),
        },
      },
    };
  }

  _source(sender, senderArn) {
    const senderArnAsArray = (senderArn ?? "").split("/");
    const email = senderArnAsArray[senderArnAsArray.length - 1];
    return `${sender} <${email}>`;
  }

  _messageBody(requestBody) {
    return Object.keys(requestBody ?? {})
      .filter(function (param) {
        // don't send private variables
        return param.substring(0, 1) !== "_";
      })
      .reduce(function (message, param) {
        // uppercase the field names and add each parameter value
        message += param.toUpperCase() + ": " + requestBody[param] + "\r\n";
        return message;
      }, "");
  }
}

module.exports = Email;


text:
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// 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.

// Author: kenton@google.com (Kenton Varda)
//  Based on original Protocol Buffers design by
//  Sanjay Ghemawat, Jeff Dean, and others.

// Modified to implement C code by Dave Benson.

#include <google/protobuf/compiler/c/c_message_field.h>
#include <google/protobuf/compiler/c/c_helpers.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/wire_format.h>

namespace google {
namespace protobuf {
namespace compiler {
namespace c {

using internal::WireFormat;

// ===================================================================

MessageFieldGenerator::
MessageFieldGenerator(const FieldDescriptor* descriptor)
  : FieldGenerator(descriptor) {
}

MessageFieldGenerator::~MessageFieldGenerator() {}

void MessageFieldGenerator::GenerateStructMembers(io::Printer* printer) const
{
  map<string, string> vars;
  vars["name"] = FieldName(descriptor_);
  vars["type"] = FullNameToC(descriptor_->message_type()->full_name());
  vars["deprecated"] = FieldDeprecated(descriptor_);
  switch (descriptor_->label()) {
    case FieldDescriptor::LABEL_REQUIRED:
    case FieldDescriptor::LABEL_OPTIONAL:
      printer->Print(vars, "$type$ *$name$$deprecated$;\n");
      break;
    case FieldDescriptor::LABEL_REPEATED:
      printer->Print(vars, "size_t n_$name$$deprecated$;\n");
      printer->Print(vars, "$type$ **$name$$deprecated$;\n");
      break;
  }
}
string MessageFieldGenerator::GetDefaultValue(void) const
{
  /* XXX: update when protobuf gets support
   *   for default-values of message fields.
   */
  return "NULL";
}
void MessageFieldGenerator::GenerateStaticInit(io::Printer* printer) const
{
  switch (descriptor_->label()) {
    case FieldDescriptor::LABEL_REQUIRED:
    case FieldDescriptor::LABEL_OPTIONAL:
      printer->Print("NULL");
      break;
    case FieldDescriptor::LABEL_REPEATED:
      printer->Print("0,NULL");
      break;
  }
}
void MessageFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const
{
  string addr = "&" + FullNameToLower(descriptor_->message_type()->full_name()) + "__descriptor";
  GenerateDescriptorInitializerGeneric(printer, false, "MESSAGE", addr);
}

}  // namespace c
}  // namespace compiler
}  // namespace protobuf
}  // namespace google


text:
require "spec_helper"

describe NumberNameString do
  it "has a version number" do
    expect(NumberNameString::VERSION).not_to be nil
  end

  it "does something useful" do
    expect(false).to eq(true)
  end
end


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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="8dp"
    android:paddingBottom="8dp">

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/lighter_gray" />

    <TextView
        android:textStyle="bold"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="@android:style/TextAppearance.Medium"
        android:text="Trigger Name"
        android:id="@+id/tvTriggerName"
        android:fontFamily="sans-serif-light"
        android:paddingTop="8dp"
        android:paddingBottom="8dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="Trigger actions"
        android:id="@+id/tvTriggerActions"
        android:fontFamily="sans-serif-light" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rule_remove"
        android:background="?android:attr/selectableItemBackground"
        android:textColor="@android:color/holo_red_dark"
        android:id="@+id/btnRemoveRuleFromPuck"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:paddingLeft="@dimen/card_listview_horizontal_padding"
        android:paddingRight="@dimen/card_listview_horizontal_padding"
        android:layout_gravity="center_horizontal" />

</LinearLayout>


text:
package server

import (
	"github.com/cloudsecurityalliance/ctpd/server/ctp"
	"net/http"
)

type TaggedResource ctp.Resource

func (res *TaggedResource)Super() *ctp.Resource {
    return (*ctp.Resource)(res)
}

func (res *TaggedResource) BuildLinks(context *ctp.ApiContext) {
    res.Self = ctp.NewLink(context.CtpBase, "@/$/$?x=tags", context.Params[0], res.Id)
}

func (res *TaggedResource) Load(context *ctp.ApiContext) *ctp.HttpError {
	if !ctp.LoadResource(context, context.Params[0], ctp.Base64Id(context.Params[1]), res) {
		return ctp.NewHttpError(http.StatusNotFound, "Not Found")
	}
    res.BuildLinks(context)
	return nil
}

func (res *TaggedResource) Update(context *ctp.ApiContext, update ctp.ResourceUpdater) *ctp.HttpError {
	res.BuildLinks(context)
	if !ctp.UpdateResourcePart(context, context.Params[0], ctp.Base64Id(context.Params[1]), "accessTags", update.Super().AccessTags) {
		return ctp.NewHttpError(http.StatusInternalServerError, "Could not update object")
	}
    res.AccessTags = update.Super().AccessTags
	return nil
}

////////////////////////////////////////////////////////////////////////////

func HandleGETTags(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext) {
	var res TaggedResource

	handler := ctp.NewGETHandler(ctp.AdminRoleTag)

    handler.ShowTags = true

	handler.Handle(w, r, context, &res)
}

func HandlePUTTags(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext) {
	var res TaggedResource
    var update TaggedResource

	handler := ctp.NewPUTHandler(ctp.AdminRoleTag)

    handler.ShowTags = true

	handler.Handle(w, r, context, &res, &update)
}


text:
package org.estatio.module.capex.integtests.project;

import org.junit.Before;
import org.junit.Test;

import org.apache.isis.applib.fixturescripts.FixtureScript;
import org.apache.isis.applib.services.wrapper.InvalidException;

import org.estatio.module.capex.dom.project.Project;
import org.estatio.module.capex.fixtures.project.enums.Project_enum;
import org.estatio.module.capex.integtests.CapexModuleIntegTestAbstract;

import static org.assertj.core.api.Assertions.assertThat;

public class Project_IntegTest extends CapexModuleIntegTestAbstract {

    @Before
    public void setupData() {
        runFixtureScript(new FixtureScript() {
            @Override
            protected void execute(ExecutionContext executionContext) {
                executionContext.executeChild(this, Project_enum.KalProject1.builder());
                executionContext.executeChild(this, Project_enum.KalProject2.builder());
            }
        });
    }

    @Test
    public void create_parent_project_works() throws Exception {

        // given
        Project child = Project_enum.KalProject1.findUsing(serviceRegistry);

        // when
        final String reference = "KAL-PARENT";
        final String name = "Kal Parent Project";
        Project parent = wrap(child).createParentProject(reference, name, null, null);

        // then
        assertThat(child.getParent()).isEqualTo(parent);
        assertThat(parent.getChildren()).contains(child);
        assertThat(parent.getReference()).isEqualTo(reference);
        assertThat(parent.getName()).isEqualTo(name);

    }

    @Test
    public void addChildProject_works() throws Exception {

        // given
        Project parent = Project_enum.KalProject1.findUsing(serviceRegistry);
        Project child = Project_enum.KalProject2.findUsing(serviceRegistry);

        // when
        wrap(parent).addChildProject(child);
        transactionService.nextTransaction();

        // then
        assertThat(child.getParent()).isEqualTo(parent);
        assertThat(parent.getChildren()).contains(child);

    }

    @Test
    public void parent_project_cannot_add_itself_as_a_child() throws Exception {

        // given
        Project parent = Project_enum.KalProject1.findUsing(serviceRegistry);

        // expect
        expectedExceptions.expect(InvalidException.class);
        expectedExceptions.expectMessage("Reason: A project cannot have itself as a child.");

        // when
        wrap(parent).addChildProject(parent);

    }

    @Test
    public void parent_project_cannot_add_a_child_that_already_has_a_parent() throws Exception {

        // given
        Project parent = Project_enum.KalProject1.findUsing(serviceRegistry);
        Project child = Project_enum.KalProject2.findUsing(serviceRegistry);
        wrap(child).createParentProject("Some ref", "some name", null, null);

        // expect
        expectedExceptions.expect(InvalidException.class);
        expectedExceptions.expectMessage("Reason: The child project is linked to a parent already.");

        // when
        wrap(parent).addChildProject(child);

    }

}


text:
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Total Downloads][ico-downloads]][link-downloads]
[![Build Status][ico-travis]][link-travis]
[![Quality Score][ico-scrutinizer]][link-scrutinizer]
[![Coveralls Status][ico-coveralls]][link-coveralls]
[![Codeship Status][ico-codeship]][link-codeship]

PHP wrapper for the iTraq API.

iTraq is a celluar GPS tracking device which can be purchased at [itraq.com](http://www.itraq.com?rfsn=623933.74aa8)

## Install

Via [Composer][link-composer]

``` bash
$ composer require zembrowski/itraq-php
```

## Usage

With [Composer][link-composer]
``` php
require_once 'vendor/autoload.php';

$email = 'name@domain.com';
$password = 'pa$$word';
$apiKey = '{apiKey given by iTraq}';

try {
  $itraq = new iTraq\User($apiKey);
  $token = $itraq->login($email, $password);
  $itraq = new iTraq\Devices($token);
  $devices = $itraq->devices();
  echo $devices;
} catch (Exception $e) {
  echo '[ERROR] ' . $e->getMessage();
}
```

See [examples.php](examples.php) for an advanced example.

## Change log

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

## Contributing

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

## Credits

- [Krzysztof Tomasz Zembrowski][link-author]
- [All Contributors][link-contributors]

## Licenses

The [MIT License](LICENSE) and [DBAD Public License](link-dbad) apply. Please see [LICENSE](LICENSE) for more information.

[ico-version]: https://img.shields.io/packagist/v/zembrowski/itraq-php.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/zembrowski/itraq-php.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/zembrowski/itraq-php/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/g/zembrowski/itraq-php.svg?style=flat-square
[ico-coveralls]: https://coveralls.io/repos/github/zembrowski/itraq-php/badge.svg?branch=master
[ico-codeship]: https://codeship.com/projects/ID/status?branch=master

[link-packagist]: https://packagist.org/packages/zembrowski/itraq-php
[link-downloads]: https://packagist.org/packages/zembrowski/itraq-php
[link-travis]: https://travis-ci.org/zembrowski/itraq-php
[link-scrutinizer]: https://scrutinizer-ci.com/g/zembrowski/itraq-php
[link-coveralls]: https://coveralls.io/github/zembrowski/itraq-php
[link-codeship]: https://codeship.com/projects/ID

[link-composer]: https://getcomposer.org
[link-author]: https://github.com/zembrowski
[link-contributors]: ../../contributors
[link-dbad]: http://www.dbad-license.org/


text:
package agent.actuator;

public class MyAction {
	private String name;

	public MyAction(String name){
		this.name = name;
		//more data
	}

	public boolean run(){
		System.out.println("action!");
		return true;
	}

	public String getName(){
		return name;
	}
}


text:
<?php

namespace Cupon\TiendaBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class DefaultController extends Controller
{
    public function portadaAction($ciudad, $tienda)
    {
    $em = $this->getDoctrine()->getEntityManager();

    $ciudad = $em->getRepository('CiudadBundle:Ciudad')
            ->findOneBySlug($ciudad);
    $tienda = $em->getRepository('TiendaBundle:Tienda')->findOneBy(array(
        'slug' => $tienda,
        'ciudad' => $ciudad->getId()
        ));

        if (!$tienda) {
            throw $this->createNotFoundException('No existe esta tienda');
        }

        $ofertas = $em->getRepository('TiendaBundle:Tienda')
                ->findUltimasOfertasPublicadas($tienda->getId());

        $cercanas = $em->getRepository('TiendaBundle:Tienda')->findCercanas(
                $tienda->getSlug(),
                $tienda->getCiudad()->getSlug()
            );

        return $this->render('TiendaBundle:Default:portada.html.twig', array(
            'tienda' => $tienda,
            'ofertas' => $ofertas,
            'cercanas' => $cercanas
        ));
    }

}

?>


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:id="@+id/welcome_image_view"
        android:src="@drawable/logo"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="210dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="互助,你的生活更加便捷"
        android:layout_marginBottom="36dp"
        android:id="@+id/textView"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true" />
</RelativeLayout>


text:
declare namespace javax {
  namespace lang {
    namespace model {
      namespace util {

        abstract class AbstractAnnotationValueVisitor9<R,P> extends javax.lang.model.util.AbstractAnnotationValueVisitor8<R,P> {
          protected constructor()
        }

      }
    }
  }
}


text:
package com.theironyard.controllers;

import com.theironyard.entities.Item;
import com.theironyard.entities.User;
import com.theironyard.entities.Work;
import com.theironyard.services.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;

/**
 * Created by jeffryporter on 8/6/16.
 */

@Controller
public class VSWorkController
{
    @Autowired
    UserRepository users;

    @Autowired
    WorkRepository works;

    @Autowired
    ItemRepository items;

    @Autowired
    MessageaRepository messages;

    @Autowired
    PhotoRepository photos;

    //***************************************************************************************
    //
    //                   WORK ROUTES
    //
    //***************************************************************************************
    @RequestMapping(path = "/work-create", method = RequestMethod.POST)
    public String createWork(HttpSession session, String jobTitle, String description)
    {
        String username = (String) session.getAttribute("username");
        if (username == null) {
            return "home";
        }
        User user = users.findByUsername(username);
        Work w = new Work(jobTitle, description, user);
        works.save(w);
        session.setAttribute("username", user.getUsername());
        return "redirect:/work-history";
    }

    @RequestMapping(path = "/work-read", method = RequestMethod.GET)
    public String getWork(HttpSession session)
    {
        String username = (String) session.getAttribute("username");
        if (username == null) {
            return "home";
        }
        User user = users.findByUsername(username);
        Iterable<Work> workList = works.findByUser(user);
        session.setAttribute("username", user.getUsername());
        return"";
    }

    @RequestMapping(path = "/work-update", method = RequestMethod.POST)
    public String updateWork(HttpSession session, int id, String jobTitle, String description)
    {
        String username = (String) session.getAttribute("username");
        if (username == null) {
            return "home";
        }
        User user = users.findByUsername(username);
        Work w = new Work(jobTitle, description, user);
        w.setId(id);
        works.save(w);
        session.setAttribute("username", user.getUsername());
        return "redirect:/work-history";
    }

    @RequestMapping(path = "/work-delete", method = RequestMethod.POST)
    public String deleteWork(HttpSession session, int id)
    {
        String username = (String) session.getAttribute("username");
        if (username == null) {
            return "home";
        }
        User user = users.findByUsername(username);
        Work work = works.findOne(id);
        Iterable<Item> removeWorksList = new ArrayList<>();
        removeWorksList = items.findByWork(work);
        for(Item i : removeWorksList)
        {
            i.setWork(null);
            items.save(i);
        }
        works.delete(id);
        session.setAttribute("username", user.getUsername());
        return "redirect:/work-history";
    }

    @RequestMapping(path = "/update-work", method = RequestMethod.GET)
    public String updateWork(HttpSession session, Model model, int id) {
        String username = (String) session.getAttribute("username");
        if (username == null) {
            return "home";
        }
        Work work = works.findOne(id);
        model.addAttribute("jobTitle", work.getJobTitle());
        model.addAttribute("description", work.getDescription());
        model.addAttribute("id", work.getId());
        return "update-work";
    }

    @RequestMapping(path = "/work-history", method = RequestMethod.GET)
    public String workHistory(HttpSession session, Model model) {
        String username = (String) session.getAttribute("username");
        if (username == null) {
            return "home";
        }
        User user = users.findByUsername(username);
        Iterable<Work> workList = works.findByUser(user);
        model.addAttribute("workList", workList);
        model.addAttribute("username", username);
        return "work-history";
    }

}


text:
/**
 * Extension import/upload
 *
 * @module	Sysmanager
 */
Todoyu.Ext.sysmanager.Extensions.Import = {

	/**
	 * Reference to extension
	 *
	 * @property	ext
	 * @type		Object
	 */
	ext: Todoyu.Ext.sysmanager,

	/**
	 * Show for for extension upload
	 *
	 * @method	showImportDialog
	 */
	showImportDialog: function() {
		var url		= Todoyu.getUrl('sysmanager', 'extensions');
		var options	= {
			parameters: {
				action: 'dialogImport'
			},
			onComplete: this.onImportShowed.bind(this)
		};

		Todoyu.Ui.updateContentBody(url, options);
	},

	/**
	 * Show extensions list
	 *
	 * @method	showList
	 */
	showList: function() {
		this.ext.Extensions.showTab('', 'imported');
	},

	/**
	 * Handler when extension upload form is showed
	 *
	 * @method	onImportShowed
	 * @param	{Ajax.Response}		response
	 */
	onImportShowed: function(response) {

	},

	/**
	 * Start extension upload (uses iframe to submit the file upload)
	 *
	 * @method	startUpload
	 */
	startUpload: function() {
		if( $F('importExtension-field-file') !== '' ) {
			Todoyu.Form.submitToIFrame('importExtension-form', 'import');
		} else {
			alert('[LLL:sysmanager.extension.upload.noArchiveSelected]');
		}
	},

	/**
	 * Handler when upload is finished
	 * Function is called from the iFrame which submitted the file
	 *
	 * @method	uploadFinished
	 * @param	{String}	ext
	 * @param	{Boolean}	success
	 * @param	{String}	message
	 */
	importFinished: function(ext, success, message) {
		var notificationIdentifier	= 'sysmanager.extensions.import.finished';

		if( success === true ) {
			Todoyu.notifySuccess('[LLL:sysmanager.extension.upload.ok]: ' + ext, notificationIdentifier);

			this.ext.Extensions.Install.showList();
		} else {
			Todoyu.notifyError('[LLL:sysmanager.extension.upload.error]: ' + ext + ' (' + message + ')', notificationIdentifier);
		}
	},

	/**
	 * Handler when extension import has failed
	 *
	 * @method	{importFailed}
	 * @param	{String}		message
	 */
	importFailed: function(message) {
		Todoyu.notifyError('[LLL:sysmanager.extension.upload.error]: ' + message, 'sysmanager.extensions.import.finished');
	}

};


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable enable

using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Formatting.Rules;

namespace Microsoft.CodeAnalysis.CSharp.Formatting
{
    internal class StructuredTriviaFormattingRule : BaseFormattingRule
    {
        internal const string Name = "CSharp Structured Trivia Formatting Rule";

        public override AdjustNewLinesOperation? GetAdjustNewLinesOperation(in SyntaxToken previousToken, in SyntaxToken currentToken, in NextGetAdjustNewLinesOperation nextOperation)
        {
            if (previousToken.Parent is StructuredTriviaSyntax || currentToken.Parent is StructuredTriviaSyntax)
            {
                return null;
            }

            return nextOperation.Invoke(in previousToken, in currentToken);
        }

        public override AdjustSpacesOperation? GetAdjustSpacesOperation(in SyntaxToken previousToken, in SyntaxToken currentToken, in NextGetAdjustSpacesOperation nextOperation)
        {
            if (previousToken.Parent is StructuredTriviaSyntax || currentToken.Parent is StructuredTriviaSyntax)
            {
                // this doesn't take care of all cases where tokens belong to structured trivia. this is only for cases we care
                if (previousToken.Kind() == SyntaxKind.HashToken && SyntaxFacts.IsPreprocessorKeyword(currentToken.Kind()))
                {
                    return CreateAdjustSpacesOperation(space: 0, option: AdjustSpacesOption.ForceSpacesIfOnSingleLine);
                }

                if (previousToken.Kind() == SyntaxKind.RegionKeyword && currentToken.Kind() == SyntaxKind.EndOfDirectiveToken)
                {
                    return CreateAdjustSpacesOperation(space: 0, option: AdjustSpacesOption.PreserveSpaces);
                }

                if (currentToken.Kind() == SyntaxKind.EndOfDirectiveToken)
                {
                    return CreateAdjustSpacesOperation(space: 0, option: AdjustSpacesOption.ForceSpacesIfOnSingleLine);
                }
            }

            return nextOperation.Invoke(in previousToken, in currentToken);
        }
    }
}


text:
package geometry;

public class Utility {
  private String name;

  public class InnerClass {
    private void doSomething() {
      name = "Pesho";
    }
  }
}


text:
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "/opt/android/ndk/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/user")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
  if(BUILD_TYPE)
    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
  else()
    set(CMAKE_INSTALL_CONFIG_NAME "Release")
  endif()
  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()

# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
  if(COMPONENT)
    message(STATUS "Install component: \"${COMPONENT}\"")
    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
  else()
    set(CMAKE_INSTALL_COMPONENT)
  endif()
endif()

# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
  set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()

if(NOT CMAKE_INSTALL_LOCAL_ONLY)
  # Include the install script for each subdirectory.
  include("/home/sarthak/Desktop/ORB-SLAM-Android/slam_ext/build.android/clapack/build/F2CLIBS/libf2c/cmake_install.cmake")

endif()


text:
package hassutsanat;

import org.junit.Assert;
import org.junit.Test;

public class FunninessCounterTest {

  private FunninessCounter counter = new FunninessCounter("");

  @Test
  public void funninessScoreOfEmptyStringShouldBeZero() {
    Assert.assertEquals(0, counter.countFunninessScore(""));
  }

  @Test
  public void funninessScoreOfSingleVowelShouldBeTwo() {
    Assert.assertEquals(2, counter.countFunninessScore("a"));
  }

  @Test
  public void funninessScoreOfThreeVowelChainShouldBe24() {
    Assert.assertEquals(24, counter.countFunninessScore("aei"));
  }

  @Test
  public void funninessScoreOfSeveralVowelChainsShouldBeSumOfChainScores() {
    Assert.assertEquals(24 + 2, counter.countFunninessScore("aeixo"));
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2009 The Kuali Foundation

 Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php

 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.
-->
<data xmlns="ns:workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ns:workflow resource:WorkflowData">
  <documentTypes xmlns="ns:workflow/DocumentType" xsi:schemaLocation="ns:workflow/DocumentType resource:DocumentType">
    <documentType overwriteMode="true">
      <name>LoadRoutePathOnlyAdjustsDocument</name>
      <blanketApproveGroupName namespace="KR-WKFLW">WorkflowAdmin</blanketApproveGroupName>
      <routePaths>
        <routePath>
          <start name="First" nextNode="Second" />
          <requests name="Second" />
        </routePath>
      </routePaths>
      <routeNodes>
        <start name="First">
          <exceptionGroupName namespace="KR-WKFLW">TestWorkgroup</exceptionGroupName>
          <activationType>S</activationType>
        </start>
        <requests name="Second">
          <activationType>S</activationType>
          <ruleTemplate>TestRuleTemplate</ruleTemplate>
          <mandatoryRoute>false</mandatoryRoute>
          <finalApproval>false</finalApproval>
        </requests>
      </routeNodes>
    </documentType>
  </documentTypes>
</data>


text:
'use strict';

var should = require('should');
var utils = require('./utilsCtrl.js');

describe('utils module tests', function() {

  it('should find list with some id', function(done) {
    var lists = {
      listContainer1: [ {id: 'idlist1'}, {id: 'idlist2'}, {id: 'idlist3'} ],
      listContainer2: [ {id: 'idlist4'}, {id: 'idlist5'}, {id: 'idlist6'} ],
      listContainer3: [ {id: 'idlist7'}, {id: 'idlist8'}, {id: 'idlist9'} ]
    };

    var successSearch = utils.searchList('idlist8', lists);
    var falseSearch = utils.searchList('idlist10', lists);

    should(successSearch).be.ok();
    should(falseSearch).not.be.ok();

    done();
  });

  it('should get diff of dates', function(done) {
    var dateDiff = utils.getDateDiff('2016-01-08', '2016-01-10');
    should(dateDiff).be.eql(172800000);
    done();
  });

  it('should convert unix date to human readable date', function(done) {
    var unixDate = 172800000;

    var humanReadable = utils.getHumanReadableTime(unixDate);

    should(humanReadable).have.property('time');
    should(humanReadable).have.property('format');
    should(humanReadable.time).be.eql(2);
    should(humanReadable.format).be.eql('days');

    done();
  });
});


text:
package org.kuali.rice.edl.impl.components;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.kuali.rice.edl.impl.EDLContext;
import org.kuali.rice.edl.impl.EDLModelComponent;
import org.kuali.rice.edl.impl.EDLXmlUtils;
import org.kuali.rice.edl.impl.RequestParser;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * Matches request params to fields defined in edl configs.  Places matched value on the dom for rendering.  Places
 * currentDefinitionElement definition ( the element used to get the param from the request) element on the
 * dom for rendering.
 *
 * This is the base EDL Config Component for dealing with defined elements in an edl definition.  Most
 * custom edl element behavior can be achieved by subclassing this.
 *
 * @author Kuali Rice Team (rice.collab@kuali.org)
 *
 */
public class SimpleWorkflowEDLConfigComponent implements EDLModelComponent {

	protected Element definitionElement;
	private EDLContext edlContext;

	public void updateDOM(Document dom, Element currentDefinitionElement, EDLContext edlContext) {

		RequestParser requestParser = edlContext.getRequestParser();
		this.edlContext = edlContext;

		this.definitionElement = currentDefinitionElement;
		Element configElementForDOM = getReplacementConfigElement(currentDefinitionElement);
		if (configElementForDOM == null) {
			configElementForDOM = currentDefinitionElement;
		}

		Element edlContentElement = EDLXmlUtils.getEDLContent(dom, false);
		edlContentElement.appendChild(configElementForDOM);

		Element currentVersion = VersioningPreprocessor.findCurrentVersion(dom);

		List matchingParams = getMatchingParams(configElementForDOM, requestParser, edlContext);
		for (Iterator iter = matchingParams.iterator(); iter.hasNext();) {
			MatchingParam matchingParam = (MatchingParam) iter.next();
			EDLXmlUtils.createFieldDataElement(currentVersion, matchingParam);
		}
	}

	public Element getReplacementConfigElement(Element element) {
		return null;
	}

	public List getMatchingParams(Element originalConfigElement, RequestParser requestParser, EDLContext edlContext) {
		List params = new ArrayList();
		String paramName = originalConfigElement.getAttribute("name");
		String[] paramValues = requestParser.getParameterValues(paramName);
		if (paramValues == null) {
			return params;
		}
		for (int i = 0; i < paramValues.length; i++) {
			String value = paramValues[i];
			MatchingParam matchingParam = new MatchingParam();
			matchingParam.setParamName(paramName);
			matchingParam.setParamValue(value);
			String errorMessage = getErrorMessage(originalConfigElement, requestParser, matchingParam);
			if (errorMessage != null) {
				matchingParam.setError(Boolean.TRUE);
				matchingParam.setErrorMessage(errorMessage);
				edlContext.setInError(true);
			}
			params.add(matchingParam);
		}
		return params;
	}

	public String getErrorMessage(Element originalConfigElement, RequestParser requestParser, MatchingParam matchingParam) {
		return null;
	}

	public Element getDefinitionElement() {
		return definitionElement;
	}

	public void setDefinitionElement(Element definitionElement) {
		this.definitionElement = definitionElement;
	}

	public EDLContext getEdlContext() {
		return edlContext;
	}

	public void setEdlContext(EDLContext edlContext) {
		this.edlContext = edlContext;
	}
}


text:
> see https://aka.ms/autorest

This is the AutoRest configuration file for adp.

## Getting Started

To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run:

> `autorest readme.md`

To see additional help and options, run:

> `autorest --help`

For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page.

---

## Configuration

### Basic Information

These are the global settings for the adp.

```yaml
title: AdpManagementClient
openapi-type: arm
openapi-subtype: rpaas
tag: package-2021-02-01-preview
```

### Tag: package-2020-07-01-preview

```yaml $(tag) == 'package-2020-07-01-preview'
version: 2020-07-01-preview
version-with-underscores: 2020_07_01_preview
input-file:
  - Microsoft.AutonomousDevelopmentPlatform/preview/2020-07-01-preview/adp.json
```

### Tag: package-2021-02-01-preview

```yaml $(tag) == 'package-2021-02-01-preview'
version: 2021-02-01-preview
version-with-underscores: 2021_02_01_preview
input-file:
  - Microsoft.AutonomousDevelopmentPlatform/preview/2021-02-01-preview/adp.json
```

---

# Code Generation

## Swagger to SDK

This section describes what SDK should be generated by the automatic system.
This is not used by Autorest itself.

```yaml $(swagger-to-sdk)
swagger-to-sdk:
  - repo: azure-sdk-for-python-track2
  - repo: azure-sdk-for-java
  - repo: azure-sdk-for-go
  - repo: azure-sdk-for-js
  - repo: azure-sdk-for-ruby
    after_scripts:
      - bundle install && rake arm:regen_all_profiles['azure_mgmt_adp']
  - repo: azure-cli-extensions
  - repo: azure-resource-manager-schemas
```

## Go

See configuration in [readme.go.md](./readme.go.md)

## Python

See configuration in [readme.python.md](./readme.python.md)

## Ruby

See configuration in [readme.ruby.md](./readme.ruby.md)

## TypeScript

See configuration in [readme.typescript.md](./readme.typescript.md)

## CSharp

See configuration in [readme.csharp.md](./readme.csharp.md)


text:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="maven-antrun-" default="main"  >
<target name="main">
  <mkdir dir="/root/dsx/bahir/sql-cloudant/target/tmp"/>
</target>
</project>


text:
package de.eich.rewriter.derivation.operations;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import org.javatuples.Pair;

import de.eich.rewriter.FunctionalBasis.FlowLabel;
import de.eich.rewriter.FunctionalBasis.FunctionLabel;
import de.eich.rewriter.derivation.DirectDerivation;
import de.eich.rewriter.derivation.Occurrence;
import de.eich.rewriter.derivation.Rule;
import de.eich.rewriter.functionstructure.Edge;
import de.eich.rewriter.functionstructure.FunctionStructure;
import de.eich.rewriter.functionstructure.Label;
import de.eich.rewriter.functionstructure.Node;

/**
 *
 */
public class GetGaps extends AbstractParametrizedOperation {

	protected GetGaps(Rule rule, OperationType operation) {
		super(rule, operation);
	}

	private void initDirectDerivation(DirectDerivation directDerivation, Pair<Node, Node> gap){
		Node sourceNode = directDerivation.target.getFunction(gap.getValue0().id);
		Node targetNode = directDerivation.target.getFunction(gap.getValue1().id);

		if(FunctionStructure.isNonterminalFunction(sourceNode)){
			Node nonterminal = sourceNode;
			sourceNode = sourceNode.incomingEdges.iterator().next().sourceNode;

			directDerivation.left.add(nonterminal.id);
			directDerivation.left.add(sourceNode.id);
			directDerivation.gluing.add(sourceNode.id);
			directDerivation.right.add(sourceNode.id);

			directDerivation.target.removeFunction(nonterminal);

			rule.setNode(parameters.get(0), directDerivation, sourceNode.id);
		} else {
			directDerivation.left.add(sourceNode.id);
			directDerivation.gluing.add(sourceNode.id);
			directDerivation.right.add(sourceNode.id);
			rule.setNode(parameters.get(0), directDerivation, sourceNode.id);
		}

		if(FunctionStructure.isNonterminalFunction(targetNode)){
			Node nonterminal = targetNode;
			targetNode = targetNode.outgoingEdges.iterator().next().targetNode;

			directDerivation.left.add(nonterminal.id);
			directDerivation.left.add(targetNode.id);
			directDerivation.gluing.add(targetNode.id);
			directDerivation.right.add(targetNode.id);

			directDerivation.target.removeFunction(nonterminal);

			rule.setNode(parameters.get(1), directDerivation, targetNode.id);
			rule.setFlow(parameters.get(2), directDerivation, (FlowLabel) targetNode.labels.get(1).content);
		} else {
			directDerivation.left.add(targetNode.id);
			directDerivation.gluing.add(targetNode.id);
			directDerivation.right.add(targetNode.id);
			rule.setNode(parameters.get(1), directDerivation, targetNode.id);
			rule.setFlow(parameters.get(2), directDerivation, (FlowLabel) targetNode.labels.get(1).content);
		}
	}

	private void getDirectDerivationsForNodes(DirectDerivation prototypeDirectDerivation, Set<Pair<Node, Node>> gaps, Set<DirectDerivation> directDerivations, boolean addPrototype){
		int i = 0;
		DirectDerivation directDerivation;
		for(Pair<Node, Node> gap : gaps){
			if(++i == gaps.size()){
				directDerivation = prototypeDirectDerivation;
				if(addPrototype) directDerivations.add(directDerivation);
			} else {
				directDerivations.add(directDerivation = prototypeDirectDerivation.copy());
			}
			initDirectDerivation(directDerivation, gap);
			addToCache(directDerivation, gaps, gap);
		}
	}

	private Map<DirectDerivation, Set<Pair<Node, Node>>> nextGapsCache = new HashMap<DirectDerivation, Set<Pair<Node, Node>>>();

	private synchronized void addToCache(DirectDerivation directDerivation, Set<Pair<Node, Node>> gaps, Pair<Node, Node> usedGap){
		Set<Pair<Node, Node>> nextGaps = new TreeSet<Pair<Node, Node>>(gaps);
		for(Iterator<Pair<Node, Node>> iterator = nextGaps.iterator(); iterator.hasNext();){
			Pair<Node, Node> nextGap = iterator.next();
			if(nextGap.getValue0() == usedGap.getValue0() || nextGap.getValue1() == usedGap.getValue1())
				iterator.remove();
		}
		nextGapsCache.put(directDerivation, nextGaps);
	}

	public void filterAvoidOccurrences(Set<Pair<Node, Node>> nodes, DirectDerivation directDerivation, Set<Occurrence> avoidOccurrences){ // TODO untested
		if(avoidOccurrences == null) return;

		if(directDerivation == null){
			for (Iterator<Pair<Node, Node>> iterator = nodes.iterator(); iterator.hasNext();) {
				Pair<Node, Node> nodePair = iterator.next();
				Node node1 = nodePair.getValue0();
				Node node2 = nodePair.getValue1();
				int i = FunctionStructure.isNonterminalFunction(node1) ? 2 : 1;
				int size = FunctionStructure.isNonterminalFunction(node2) ? i + 2 : i + 1;
				for(Occurrence occurrence : avoidOccurrences)
					if(occurrence.size() == size && occurrence.get(0) == node1.id && occurrence.get(i) == node2.id)
						iterator.remove();
			}
		} else {
			for (Iterator<Pair<Node, Node>> iterator = nodes.iterator(); iterator.hasNext();) {
				Pair<Node, Node> nodePair = iterator.next();
				int added = 2;
				Node node1 = nodePair.getValue0();
				directDerivation.left.add(node1.id);
				if(FunctionStructure.isNonterminalFunction(node1)){
					directDerivation.left.add(node1.incomingEdges.iterator().next().sourceNode.id);
					added++;
				}
				Node node2 = nodePair.getValue1();
				directDerivation.left.add(node2.id);
				if(FunctionStructure.isNonterminalFunction(node2)){
					directDerivation.left.add(node2.outgoingEdges.iterator().next().targetNode.id);
					added++;
				}
				if(avoidOccurrences.contains(directDerivation.left))
					iterator.remove();
				for(int i = 0; i < added; i++)
					directDerivation.left.remove(directDerivation.left.size() -1);
			}
		}
	}

	private synchronized Set<Pair<Node, Node>> getGaps(FunctionStructure target, FlowLabel flow, DirectDerivation precedingDirectDerivationOfSameRule){
		Set<Pair<Node, Node>> gaps;
		if(precedingDirectDerivationOfSameRule != null){
			gaps = nextGapsCache.get(precedingDirectDerivationOfSameRule);
			if(gaps != null) return gaps;
		}

		gaps = new TreeSet<Pair<Node, Node>>();

//		Set<Node> nodes = new TreeSet<Node>();
//		Set<Node> nonterminalNodes = new TreeSet<Node>();
//		for(Node node : target.graph.nodes.values())
//			if(target.isNonterminalFunction(node))
//				nonterminalNodes.add(node);
//			else
//				nodes.add(node);

		Collection<Node> allNodes = target.graph.nodes.values();

		for(Node sourceNode : allNodes){

			Label sourceNodeLabel = null;
//			Node a = null;

			if(FunctionStructure.isNonterminalFunction(sourceNode)){
				if(sourceNode.incomingEdges.isEmpty()) continue;

				Edge edge = sourceNode.incomingEdges.iterator().next();
				sourceNodeLabel = edge.labels.get(0);

//				a = edge.sourceNode;

			} else {
				if(sourceNode.labels.get(0).content == FunctionLabel.EXPORT) continue;

				sourceNodeLabel = sourceNode.labels.get(2);

				if(!sourceNode.outgoingEdges.isEmpty()) {
					boolean outgoingEdgeWithLabel = false;
					for(Edge edge : sourceNode.outgoingEdges){
						if(edge.labels.contains(sourceNodeLabel)){
							outgoingEdgeWithLabel = true;
							break;
						}
					}
					if(outgoingEdgeWithLabel) continue;
				}

//				a = sourceNode;
			}

			for(Node targetNode : allNodes){
				if(targetNode == sourceNode) continue;

				Label targetNodeLabel = null;
//				Node b = null;

				if(FunctionStructure.isNonterminalFunction(targetNode)){
					if(targetNode.outgoingEdges.isEmpty()) continue;

					Edge edge = targetNode.outgoingEdges.iterator().next();
					targetNodeLabel = edge.labels.get(0);

					if(!targetNodeLabel.equals(sourceNodeLabel)) continue;

//					b = edge.targetNode;

				} else {
					if(targetNode.labels.get(0).content == FunctionLabel.IMPORT) continue;

					targetNodeLabel = targetNode.labels.get(1);

					if(!targetNodeLabel.equals(sourceNodeLabel)) continue;

					if(!targetNode.incomingEdges.isEmpty()) {
						boolean incomingEdgeWithLabel = false;
						for(Edge edge : targetNode.incomingEdges){
							if(edge.labels.contains(targetNodeLabel)){
								incomingEdgeWithLabel = true;
								break;
							}
						}
						if(incomingEdgeWithLabel) continue;
					}

//					b = targetNode;
				}

//				if(target.getFlow(a,b,(FlowLabel) sourceNodeLabel.content) != null) continue;
//				if(target.getFlow(b,a,(FlowLabel) sourceNodeLabel.content) != null) continue;

				gaps.add(new Pair<Node, Node>(sourceNode, targetNode));
			}

		}

//		System.out.println(gaps);

		return gaps;
	}

	public void invoke(Rule rule, FunctionStructure source, Set<DirectDerivation> directDerivations, Set<Occurrence> avoidOccurrences, DirectDerivation precedingDirectDerivationOfSameRule) {
		if(source != null){
			FunctionStructure target = source.copy(false);
			FlowLabel flow = rule.getFlow(parameters.get(2), null);
			Set<Pair<Node, Node>> gaps = getGaps(target, flow, precedingDirectDerivationOfSameRule);
			filterAvoidOccurrences(gaps, null, avoidOccurrences);
			// TODO: sometimes nullpointer gaps is null! (multithreaded)
			if(!gaps.isEmpty()){
				DirectDerivation directDerivation = new DirectDerivation(rule, source, target);
				getDirectDerivationsForNodes(directDerivation, gaps, directDerivations, true);
			}
		} else {
			Set<DirectDerivation> additionalDirectDerivations = new HashSet<DirectDerivation>();
			for (Iterator<DirectDerivation> iterator = directDerivations.iterator(); iterator.hasNext();) {
				DirectDerivation directDerivation = iterator.next();
				FlowLabel flow = rule.getFlow(parameters.get(2), directDerivation);
				Set<Pair<Node, Node>> gaps = getGaps(directDerivation.target, flow, precedingDirectDerivationOfSameRule);
				filterAvoidOccurrences(gaps, directDerivation, avoidOccurrences);
				if(!gaps.isEmpty()){
					getDirectDerivationsForNodes(directDerivation, gaps, additionalDirectDerivations, false);
				} else {
					iterator.remove();
				}
			}
			directDerivations.addAll(additionalDirectDerivations);
		}
	}

	public void invoke(Rule rule, FunctionStructure source, Occurrence occurrence, Set<DirectDerivation> directDerivations, DirectDerivation precedingDirectDerivationOfSameRule) { // TODO untested
		if(source != null){
			if(occurrence.size() < 2) return;

			int nodeID1 = occurrence.get(0);
			FunctionStructure target = source.copy(false);
			Node sourceNode = target.getFunction(nodeID1);
			if(sourceNode == null) return;
			boolean sourceNodeIsNonterminal = FunctionStructure.isNonterminalFunction(sourceNode);

			if(sourceNodeIsNonterminal && occurrence.size() < 3) return;

			int nodeID2 = occurrence.get(sourceNodeIsNonterminal ? 2 : 1);
			Node targetNode = target.getFunction(nodeID2);
			if(targetNode == null) return;
			boolean targetNodeIsNonterminal = FunctionStructure.isNonterminalFunction(targetNode);

			if(sourceNodeIsNonterminal && targetNodeIsNonterminal && occurrence.size() < 4) return;
			else if(targetNodeIsNonterminal && occurrence.size() < 3) return;

			Set<Pair<Node, Node>> gaps = new TreeSet<Pair<Node, Node>>();
			gaps.add(new Pair<Node,Node>(sourceNode, targetNode));
			DirectDerivation directDerivation = new DirectDerivation(rule, source, target);
			directDerivation.occurrenceIndex = sourceNodeIsNonterminal && targetNodeIsNonterminal ? 4 : sourceNodeIsNonterminal || targetNodeIsNonterminal ? 3 : 2;
			getDirectDerivationsForNodes(directDerivation, gaps, directDerivations, true);
		} else {
			Set<DirectDerivation> additionalDirectDerivations = new HashSet<DirectDerivation>();
			for (Iterator<DirectDerivation> iterator = directDerivations.iterator(); iterator.hasNext();) {
				DirectDerivation directDerivation = iterator.next();
				if(directDerivation.occurrenceIndex +1 >= occurrence.size()){
					iterator.remove();
					continue;
				}

				int nodeID1 = occurrence.get(directDerivation.occurrenceIndex++);
				Node sourceNode = directDerivation.target.getFunction(nodeID1);
				if(sourceNode == null){
					iterator.remove();
					continue;
				}
				if(FunctionStructure.isNonterminalFunction(sourceNode)){
					if(directDerivation.occurrenceIndex +1 >= occurrence.size()){
						iterator.remove();
						continue;
					}
					directDerivation.occurrenceIndex++;
				}

				int nodeID2 = occurrence.get(directDerivation.occurrenceIndex++);
				Node targetNode = directDerivation.target.getFunction(nodeID2);
				if(targetNode == null){
					iterator.remove();
					continue;
				}
				if(FunctionStructure.isNonterminalFunction(targetNode)){
					if(directDerivation.occurrenceIndex +1 >= occurrence.size()){
						iterator.remove();
						continue;
					}
					directDerivation.occurrenceIndex++;
				}

				Set<Pair<Node, Node>> gaps = new TreeSet<Pair<Node, Node>>();
				gaps.add(new Pair<Node,Node>(sourceNode, targetNode));
				getDirectDerivationsForNodes(directDerivation, gaps, additionalDirectDerivations, false);
			}
			directDerivations.addAll(additionalDirectDerivations);
		}
	}

	public synchronized void reset(){
		nextGapsCache.clear();
	};

}