text:
package com.surfapi.db.post;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

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

import org.junit.Rule;
import org.junit.Test;

import com.surfapi.junit.CaptureSystemOutRule;
import com.surfapi.log.Log;

public class CustomIndexTest {

    /**
     * Capture and suppress stdout unless the test fails.
     */
    @Rule
    public CaptureSystemOutRule systemOutRule  = new CaptureSystemOutRule( );

    @Test
    public void testGetAllIndexes() {

        List<CustomIndex<?>> indexes = CustomIndex.getAllIndexes();

        assertEquals(4, indexes.size());

        // Map to class names and verify
        List<String> classNames = new ArrayList<String>();
        for (CustomIndex<?> customIndex : indexes) {
            classNames.add( customIndex.getClass().getSimpleName() );
        }

        Log.trace(this, "testGetAllIndexes: simple name: ", classNames);

        assertTrue( classNames.contains("AutoCompleteIndex") );
        assertTrue( classNames.contains("ReferenceNameQuery") );
        assertTrue( classNames.contains("AllKnownSubclassesQuery") );
        assertTrue( classNames.contains("AllKnownImplementorsQuery") );

    }

    @Test
    public void testGetIndexes() {

        List<CustomIndex<?>> indexes = CustomIndex.getIndexes("AutoCompleteIndex");
        assertEquals(1, indexes.size());
        assertEquals("AutoCompleteIndex", indexes.get(0).getClass().getSimpleName());

        indexes = CustomIndex.getIndexes("ReferenceNameQuery");
        assertEquals(1, indexes.size());
        assertEquals("ReferenceNameQuery", indexes.get(0).getClass().getSimpleName());

        indexes = CustomIndex.getIndexes("AllKnownSubclassesQuery");
        assertEquals(1, indexes.size());
        assertEquals("AllKnownSubclassesQuery", indexes.get(0).getClass().getSimpleName());

        indexes = CustomIndex.getIndexes("AllKnownImplementorsQuery");
        assertEquals(1, indexes.size());
        assertEquals("AllKnownImplementorsQuery", indexes.get(0).getClass().getSimpleName());

    }

    @Test
    public void testGetIndexesEmptyFilter() {

        List<CustomIndex<?>> indexes = CustomIndex.getIndexes("");
        assertEquals(4, indexes.size());

        indexes = CustomIndex.getIndexes(null);
        assertEquals(4, indexes.size());
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Groep.js
 *
 * @description :: TODO: You might write a short summary of how this model works and what it represents here.
 * @docs        :: http://sailsjs.org/documentation/concepts/models-and-orm/models
 */

module.exports = {

  attributes: {

    // naam van de groep/ klas
  	naam: {
    	type: 'string',
    	required: true
    },

    // beschrijving vb leeftijd 60 +
  	beschrijving: {
    	type: 'string'
    },

    // leden die in groep horen
    deelnemers: {
    	collection: 'user',
    	via: 'groepen',
    	dominant: true
    },

    agendaPunt: {
    	collection: 'agenda',
    	via: 'groep'
    },

    getAgendaPunten: function(){
    	return this.agendaPunt;
    },

    getDeelnemers: function(){
        return this.deelnemers;
    }
  }
};


text:
<?php

namespace PhpUnitGen\Console;

use PhpUnitGen\Configuration\AbstractConsoleConfigFactory;
use PhpUnitGen\Configuration\ConfigurationInterface\ConsoleConfigInterface;
use PhpUnitGen\Configuration\DefaultConsoleConfigFactory;
use PhpUnitGen\Configuration\JsonConsoleConfigFactory;
use PhpUnitGen\Configuration\PhpConsoleConfigFactory;
use PhpUnitGen\Configuration\YamlConsoleConfigFactory;
use PhpUnitGen\Container\ContainerInterface\ConsoleContainerFactoryInterface;
use PhpUnitGen\Exception\Exception;
use PhpUnitGen\Exception\InvalidConfigException;
use PhpUnitGen\Executor\ExecutorInterface\ConsoleExecutorInterface;
use Respect\Validation\Validator;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Stopwatch\Stopwatch;

/**
 * Class GenerateCommand.
 *
 * @author     Paul Thébaud <paul.thebaud29@gmail.com>.
 * @copyright  2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>.
 * @license    https://opensource.org/licenses/MIT The MIT license.
 * @link       https://github.com/paul-thebaud/phpunit-generator
 * @since      Class available since Release 2.0.0.
 */
class GenerateCommand extends Command
{
    public const STOPWATCH_EVENT = 'command';

    /**
     * @var string[] CONSOLE_CONFIG_FACTORIES Mapping array between file extension and configuration factories.
     */
    protected const CONSOLE_CONFIG_FACTORIES = [
        'yml'  => YamlConsoleConfigFactory::class,
        'json' => JsonConsoleConfigFactory::class,
        'php'  => PhpConsoleConfigFactory::class
    ];

    /**
     * @var ConsoleContainerFactoryInterface $containerFactory A container factory to create container.
     */
    protected $containerFactory;

    /**
     * @var ConsoleExecutorInterface $consoleExecutor A executor to execute PhpUnitGen task.
     */
    protected $consoleExecutor;

    /**
     * @var Stopwatch $stopwatch The stopwatch to measure duration and memory usage.
     */
    protected $stopwatch;

    /**
     * GenerateCommand constructor.
     *
     * @param ConsoleContainerFactoryInterface $containerFactory A container factory to create container.
     * @param Stopwatch                        $stopwatch        The stopwatch component for execution stats.
     */
    public function __construct(ConsoleContainerFactoryInterface $containerFactory, Stopwatch $stopwatch)
    {
        parent::__construct();

        $this->containerFactory = $containerFactory;
        $this->stopwatch        = $stopwatch;
    }

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this->setName('generate')
            ->setAliases(['gen'])
            ->setDescription('Generate unit tests skeletons.')
            ->setHelp(
                'Use it to generate your unit tests skeletons. See documentation on ' .
                'https://github.com/paul-thebaud/phpunit-generator/blob/master/DOCUMENTATION.md'
            )
            ->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'The configuration file path.', 'phpunitgen.yml')
            ->addOption('file', 'f', InputOption::VALUE_NONE, 'If you want file parsing.')
            ->addOption('dir', 'd', InputOption::VALUE_NONE, 'If you want directory parsing.')
            ->addOption('default', 'D', InputOption::VALUE_NONE, 'If you want to use the default configuration.')
            ->addArgument('source', InputArgument::OPTIONAL, 'The source path (directory if "dir" option set).')
            ->addArgument('target', InputArgument::OPTIONAL, 'The target path (directory if "dir" option set).');
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->stopwatch->start(GenerateCommand::STOPWATCH_EVENT);

        $styledIO = $this->getStyledIO($input, $output);
        try {
            $config = $this->getConfiguration($input);

            $container = $this->containerFactory->invoke($config, $styledIO, $this->stopwatch);

            $this->consoleExecutor = $container->get(ConsoleExecutorInterface::class);

            $this->consoleExecutor->invoke();
        } catch (Exception $exception) {
            $styledIO->error($exception->getMessage());
            return -1;
        }

        return 0;
    }

    /**
     * Build a new instance of SymfonyStyle.
     *
     * @param InputInterface  $input  The input.
     * @param OutputInterface $output The output.
     *
     * @return SymfonyStyle The created symfony style i/o.
     */
    protected function getStyledIO(InputInterface $input, OutputInterface $output): SymfonyStyle
    {
        return new SymfonyStyle($input, $output);
    }

    /**
     * Build a configuration from a configuration file path.
     *
     * @param InputInterface $input An input interface to retrieve command argument.
     *
     * @return ConsoleConfigInterface The created configuration.
     *
     * @throws Exception If an error occurs during process.
     */
    protected function getConfiguration(InputInterface $input): ConsoleConfigInterface
    {
        // If the configuration to use is the default.
        if ($input->getOption('default')) {
            $this->validatePathsExist($input);
            // If it is a directory.
            if ($input->getOption('dir')) {
                return (new DefaultConsoleConfigFactory())
                    ->invokeDir($input->getArgument('source'), $input->getArgument('target'));
            }
            return (new DefaultConsoleConfigFactory())
                ->invokeFile($input->getArgument('source'), $input->getArgument('target'));
        }

        $path = $input->getOption('config');
        // If we have a "=" at the beginning of the option value
        $path = preg_replace('/^\=/', '', $path);

        $factory = $this->getConfigurationFactory($path);

        if ($input->getOption('dir')) {
            $this->validatePathsExist($input);
            return $factory->invokeDir(
                $path,
                $input->getArgument('source'),
                $input->getArgument('target')
            );
        }
        if ($input->getOption('file')) {
            $this->validatePathsExist($input);
            return $factory->invokeFile(
                $path,
                $input->getArgument('source'),
                $input->getArgument('target')
            );
        }
        return $factory->invoke($path);
    }

    /**
     * Get the configuration factory depending on configuration path.
     *
     * @param string $path The configuration file path.
     *
     * @return AbstractConsoleConfigFactory The configuration factory.
     *
     * @throws InvalidConfigException If the configuration is invalid.
     */
    protected function getConfigurationFactory(string $path): AbstractConsoleConfigFactory
    {
        if (! file_exists($path)) {
            throw new InvalidConfigException(sprintf('Config file "%s" does not exists', $path));
        }

        $extension = pathinfo($path, PATHINFO_EXTENSION);
        if (! Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) {
            throw new InvalidConfigException(
                sprintf('Config file "%s" must have .yml, .json or .php extension', $path)
            );
        }

        /** @var AbstractConsoleConfigFactory $factory */
        $factoryClass = static::CONSOLE_CONFIG_FACTORIES[$extension];
        return new $factoryClass();
    }

    /**
     * Throw an exception if the source or the target path is missing.
     *
     * @param InputInterface $input The input interface to check.
     *
     * @throws Exception If the source or the target path is missing.
     */
    protected function validatePathsExist(InputInterface $input): void
    {
        if (! is_string($input->getArgument('source'))) {
            throw new Exception('Missing the source path');
        }
        if (! is_string($input->getArgument('target'))) {
            throw new Exception('Missing the target path');
        }
    }
}


text:
import _ from 'lodash';
import assert from 'assert';
import feathers from 'feathers';
import hooks from 'feathers-hooks';

import mixin from '../../src/sam';
import classify from '../../src/services/classify';

describe('BrainJS classifier', () => {
  const app = _.extend(feathers().configure(hooks()), mixin);
  const fixture = [{
    _id: 0,
    text: 'can you hear me',
    action: {
      type: 'reply',
      text: 'Loud and clear'
    }
  }, {
    _id: 1,
    text: 'say hi to david',
    tags: [{
      label: 'subject',
      start: 3,
      end: -1
    }],
    action: {
      type: 'reply',
      text: 'Hi {{subject}}'
    }
  }, {
    _id: 2,
    text: 'the meaning of life',
    action: {
      type: 'reply',
      text: '42. Six times seven.'
    }
  }];

  before(function() {
    app.use('/classify', classify())
      .use('/actions', {
        find(params, callback) {
          callback(null, fixture);
        },

        get(id, params, callback) {
          callback(null, _.find(fixture, '_id', parseInt(id, 10)));
        },

        create(data, params, callback) {
          data._id = 23;
          fixture.push(data);
          this.emit('created', data);
          callback(null, data);
        }
      });

    app.service('classify').setup(app);
  });

  it('classifies actions', done => {
    app.service('classify').create({
      input: 'hey you hear me'
    }, {}, (error, data) => {
      assert.equal(data._id, 0);
      assert.deepEqual(data.action, fixture[0].action);
      assert.equal(data.classifications.length, 3);
      assert.deepEqual(data.pos, {
        tokens: [ 'hey', 'you', 'hear', 'me' ],
        tags: [ 'UH', 'PRP', 'VB', 'PRP' ]
      });

      app.service('classify').create({
        input: 'What\'s the meaning of my life?'
      }, {}, (error, data) => {
        assert.equal(data._id, 2);
        assert.deepEqual(data.action, fixture[2].action);
        done();
      });
    });
  });

  it('extracts tags', done => {
    app.service('classify').create({
      input: 'Can you please say hi to Gabe'
    }, {}, (error, data) => {
      assert.equal(data._id, 1);
      assert.deepEqual(data.extracted, { subject: ['Gabe'] });
      done();
    });
  });

  it('runs registered actions', done => {
    app.action('reply', function(classification) {
      assert.equal(classification._id, 1);
      assert.deepEqual(classification.extracted, { subject: ['Gabe'] });
      done();
    });

    app.service('classify').create({ input: 'Can you please say hi to Gabe' }, () => {});
  });

  it('adding a new action re-trains', done => {
    const newAction = {
      text: 'play some music',
      action: {
        type: 'music',
        mode: 'play'
      }
    };

    app.service('actions').create(newAction, (error, action) => {
      app.service('classify').create({
        input: 'Can you play music for us?'
      }, {}, (error, data) => {
        assert.equal(data._id, action._id);
        assert.equal(data.text, action.text);
        assert.deepEqual(data.action, action.action);
        done();
      });
    });
  });
});


text:
package com.github.scribejava.core.model;

import java.util.Objects;

/**
 * Represents an OAuth 1 Access Token http://tools.ietf.org/html/rfc5849#section-2.3
 */
public class OAuth1AccessToken extends OAuth1Token {

    private static final long serialVersionUID = -103999293167210966L;

    public OAuth1AccessToken(String token, String tokenSecret) {
        this(token, tokenSecret, null);
    }

    public OAuth1AccessToken(String token, String tokenSecret, String rawResponse) {
        super(token, tokenSecret, rawResponse);
    }

    /**
     * The token identifier.
     *
     * @return oauth_token
     */
    @Override
    public String getToken() {
        return super.getToken();
    }

    /**
     * The token shared-secret.
     *
     * @return oauth_token_secret
     */
    @Override
    public String getTokenSecret() {
        return super.getTokenSecret();
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 73 * hash + Objects.hashCode(getToken());
        hash = 73 * hash + Objects.hashCode(getTokenSecret());
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final OAuth1AccessToken other = (OAuth1AccessToken) obj;
        if (!Objects.equals(getToken(), other.getToken())) {
            return false;
        }
        return Objects.equals(getTokenSecret(), other.getTokenSecret());
    }

    @Override
    public String toString() {
        return "OAuth1AccessToken{"
                + "oauth_token=" + getToken()
                + ", oauth_token_secret=" + getTokenSecret() + '}';
    }
}


text:
import {
  ComponentHarness,
  ComponentHarnessConstructor,
  ContentContainerComponentHarness,
  HarnessPredicate,
  parallel,
} from '@angular/cdk/testing';
import {TableHarnessFilters, RowHarnessFilters} from './table-harness-filters';
import {
  MatRowHarness,
  MatHeaderRowHarness,
  MatFooterRowHarness,
  MatRowHarnessColumnsText,
} from './row-harness';

/** Text extracted from a table organized by columns. */
export interface MatTableHarnessColumnsText {
  [columnName: string]: {
    text: string[];
    headerText: string[];
    footerText: string[];
  };
}

interface RowBase extends ComponentHarness {
  getCellTextByColumnName(): Promise<MatRowHarnessColumnsText>;
  getCellTextByIndex(): Promise<string[]>;
}

export abstract class _MatTableHarnessBase<
  HeaderRowType extends (ComponentHarnessConstructor<HeaderRow> & {
    with: (options?: RowHarnessFilters) => HarnessPredicate<HeaderRow>}),
  HeaderRow extends RowBase,
  RowType extends (ComponentHarnessConstructor<Row> & {
    with: (options?: RowHarnessFilters) => HarnessPredicate<Row>}),
  Row extends RowBase,
  FooterRowType extends (ComponentHarnessConstructor<FooterRow> & {
    with: (options?: RowHarnessFilters) => HarnessPredicate<FooterRow>}),
  FooterRow extends RowBase
> extends ContentContainerComponentHarness<string> {
  protected abstract _headerRowHarness: HeaderRowType;
  protected abstract _rowHarness: RowType;
  protected abstract _footerRowHarness: FooterRowType;

  /** Gets all of the header rows in a table. */
  async getHeaderRows(filter: RowHarnessFilters = {}): Promise<HeaderRow[]> {
    return this.locatorForAll(this._headerRowHarness.with(filter))();
  }

  /** Gets all of the regular data rows in a table. */
  async getRows(filter: RowHarnessFilters = {}): Promise<Row[]> {
    return this.locatorForAll(this._rowHarness.with(filter))();
  }

  /** Gets all of the footer rows in a table. */
  async getFooterRows(filter: RowHarnessFilters = {}): Promise<FooterRow[]> {
    return this.locatorForAll(this._footerRowHarness.with(filter))();
  }

  /** Gets the text inside the entire table organized by rows. */
  async getCellTextByIndex(): Promise<string[][]> {
    const rows = await this.getRows();
    return parallel(() => rows.map(row => row.getCellTextByIndex()));
  }

  /** Gets the text inside the entire table organized by columns. */
  async getCellTextByColumnName(): Promise<MatTableHarnessColumnsText> {
    const [headerRows, footerRows, dataRows] = await parallel(() => [
      this.getHeaderRows(),
      this.getFooterRows(),
      this.getRows()
    ]);

    const text: MatTableHarnessColumnsText = {};
    const [headerData, footerData, rowsData] = await parallel(() => [
      parallel(() => headerRows.map(row => row.getCellTextByColumnName())),
      parallel(() => footerRows.map(row => row.getCellTextByColumnName())),
      parallel(() => dataRows.map(row => row.getCellTextByColumnName())),
    ]);

    rowsData.forEach(data => {
      Object.keys(data).forEach(columnName => {
        const cellText = data[columnName];

        if (!text[columnName]) {
          text[columnName] = {
            headerText: getCellTextsByColumn(headerData, columnName),
            footerText: getCellTextsByColumn(footerData, columnName),
            text: []
          };
        }

        text[columnName].text.push(cellText);
      });
    });

    return text;
  }
}

/** Harness for interacting with a standard mat-table in tests. */
export class MatTableHarness extends _MatTableHarnessBase<
  typeof MatHeaderRowHarness, MatHeaderRowHarness,
  typeof MatRowHarness, MatRowHarness,
  typeof MatFooterRowHarness, MatFooterRowHarness
> {
  /** The selector for the host element of a `MatTableHarness` instance. */
  static hostSelector = '.mat-table';
  protected _headerRowHarness = MatHeaderRowHarness;
  protected _rowHarness = MatRowHarness;
  protected _footerRowHarness = MatFooterRowHarness;

  /**
   * Gets a `HarnessPredicate` that can be used to search for a table with specific attributes.
   * @param options Options for narrowing the search
   * @return a `HarnessPredicate` configured with the given options.
   */
  static with(options: TableHarnessFilters = {}): HarnessPredicate<MatTableHarness> {
    return new HarnessPredicate(MatTableHarness, options);
  }
}

/** Extracts the text of cells only under a particular column. */
function getCellTextsByColumn(rowsData: MatRowHarnessColumnsText[], column: string): string[] {
  const columnTexts: string[] = [];

  rowsData.forEach(data => {
    Object.keys(data).forEach(columnName => {
      if (columnName === column) {
        columnTexts.push(data[columnName]);
      }
    });
  });

  return columnTexts;
}


text:
angular.module('uiRouterSample.contacts', [
  'ui.router.modal',
  'ui.bootstrap'
])

.config(
  [          '$stateProvider', '$urlRouterProvider',
    function ($stateProvider,   $urlRouterProvider) {
      $stateProvider
        //////////////
        // Contacts //
        //////////////
        .state('contacts', {

          // With abstract set to true, that means this state can not be explicitly activated.
          // It can only be implicitly activated by activating one of its children.
          abstract: true,

          // This abstract state will prepend '/contacts' onto the urls of all its children.
          url: '/contacts',

          // Example of loading a template from a file. This is also a top level state,
          // so this template file will be loaded and then inserted into the ui-view
          // within index.html.
          templateUrl: 'app/contacts/contacts.html',

          // Use `resolve` to resolve any asynchronous controller dependencies
          // *before* the controller is instantiated. In this case, since contacts
          // returns a promise, the controller will wait until contacts.all() is
          // resolved before instantiation. Non-promise return values are considered
          // to be resolved immediately.
          resolve: {
            contacts: ['contacts',
              function( contacts){
                return contacts.all();
              }]
          },

          // You can pair a controller to your template. There *must* be a template to pair with.
          controller: ['$scope', '$state', 'contacts', 'utils',
            function (  $scope,   $state,   contacts,   utils) {

              // Add a 'contacts' field in this abstract parent's scope, so that all
              // child state views can access it in their scopes. Please note: scope
              // inheritance is not due to nesting of states, but rather choosing to
              // nest the templates of those states. It's normal scope inheritance.
              $scope.contacts = contacts;

              $scope.goToRandom = function () {
                var randId = utils.newRandomKey($scope.contacts, "id", $state.params.contactId);

                // $state.go() can be used as a high level convenience method
                // for activating a state programmatically.
                $state.go('contacts.detail', { contactId: randId });
              };
            }]
        })

        /////////////////////
        // Contacts > List //
        /////////////////////

        // Using a '.' within a state name declares a child within a parent.
        // So you have a new state 'list' within the parent 'contacts' state.
        .state('contacts.list', {

          // Using an empty url means that this child state will become active
          // when its parent's url is navigated to. Urls of child states are
          // automatically appended to the urls of their parent. So this state's
          // url is '/contacts' (because '/contacts' + '').
          url: '',

          // IMPORTANT: Now we have a state that is not a top level state. Its
          // template will be inserted into the ui-view within this state's
          // parent's template; so the ui-view within contacts.html. This is the
          // most important thing to remember about templates.
          templateUrl: 'app/contacts/contacts.list.html'
        })

        ///////////////////////
        // Contacts > Detail //
        ///////////////////////

        // You can have unlimited children within a state. Here is a second child
        // state within the 'contacts' parent state.
        .state('contacts.detail', {

          // Urls can have parameters. They can be specified like :param or {param}.
          // If {} is used, then you can also specify a regex pattern that the param
          // must match. The regex is written after a colon (:). Note: Don't use capture
          // groups in your regex patterns, because the whole regex is wrapped again
          // behind the scenes. Our pattern below will only match numbers with a length
          // between 1 and 4.

          // Since this state is also a child of 'contacts' its url is appended as well.
          // So its url will end up being '/contacts/{contactId:[0-9]{1,4}}'. When the
          // url becomes something like '/contacts/42' then this state becomes active
          // and the $stateParams object becomes { contactId: 42 }.
          url: '/{contactId:[0-9]{1,4}}',

          resolve: {
            contact: ['utils', 'contacts', '$stateParams', function(utils, contacts, $stateParams) {
              return utils.findById(contacts, $stateParams.contactId);
            }]
          },

          // If there is more than a single ui-view in the parent template, or you would
          // like to target a ui-view from even higher up the state tree, you can use the
          // views object to configure multiple views. Each view can get its own template,
          // controller, and resolve data.

          // View names can be relative or absolute. Relative view names do not use an '@'
          // symbol. They always refer to views within this state's parent template.
          // Absolute view names use a '@' symbol to distinguish the view and the state.
          // So 'foo@bar' means the ui-view named 'foo' within the 'bar' state's template.
          views: {

            // So this one is targeting the unnamed view within the parent state's template.
            '': {
              templateUrl: 'app/contacts/contacts.detail.html',
              controller: ['$scope', 'contact',
                function (  $scope,   contact) {
                  $scope.contact = contact;
                }]
            },

            // This one is targeting the ui-view="hint" within the unnamed root, aka index.html.
            // This shows off how you could populate *any* view within *any* ancestor state.
            'hint@': {
              template: 'This is contacts.detail populating the "hint" ui-view'
            },

            // This one is targeting the ui-view="menuTip" within the parent state's template.
            'menuTip': {
              // templateProvider is the final method for supplying a template.
              // There is: template, templateUrl, and templateProvider.
              templateProvider: ['$stateParams',
                function (        $stateParams) {
                  // This is just to demonstrate that $stateParams injection works for templateProvider.
                  // $stateParams are the parameters for the new state we're transitioning to, even
                  // though the global '$stateParams' has not been updated yet.
                  return '
Contact ID: ' + $stateParams.contactId + '';
                }]
            }
          }
        })

        //////////////////////////////
        // Contacts > Detail > Item //
        //////////////////////////////

        .state('contacts.detail.item', {

          // So following what we've learned, this state's full url will end up being
          // '/contacts/{contactId}/item/:itemId'. We are using both types of parameters
          // in the same url, but they behave identically.
          url: '/item/:itemId',

          resolve: {
            item:      ['$stateParams', 'contact', 'utils',
              function ( $stateParams,   contact,   utils) {
                return utils.findById(contact.items, $stateParams.itemId);
              }]
          },

          views: {

            // This is targeting the unnamed ui-view within the parent state 'contact.detail'
            // We wouldn't have to do it this way if we didn't also want to set the 'hint' view below.
            // We could instead just set templateUrl and controller outside of the view obj.
            '': {
              templateUrl: 'app/contacts/contacts.detail.item.html',
              controller: ['$scope', '$stateParams', '$state', 'item',
                function (  $scope,   $stateParams,   $state,   item) {
                  $scope.item = item;

                  $scope.edit = function () {
                    // Here we show off go's ability to navigate to a relative state. Using '^' to go upwards
                    // and '.' to go down, you can navigate to any relative state (ancestor or descendant).
                    // Here we are going down to the child state 'edit' (full name of 'contacts.detail.item.edit')
                    $state.go('.edit', $stateParams);
                  };
                }]
            },

            // Here we see we are overriding the template that was set by 'contacts.detail'
            'hint@': {
              template: ' This is contacts.detail.item overriding the "hint" ui-view'
            }
          }
        })

        /////////////////////////////////////
        // Contacts > Detail > Item > Edit //
        /////////////////////////////////////

        // Notice that this state has no 'url'. States do not require a url. You can use them
        // simply to organize your application into "places" where each "place" can configure
        // only what it needs. The only way to get to this state is via $state.go (or transitionTo)
        .state('contacts.detail.item.edit', {
          // This is targeting the unnamed view within the 'contacts.detail' state
          // essentially swapping out the template that 'contacts.detail.item' had
          // inserted with this state's template.
          url: '/edit',
          templateUrl: 'app/contacts/contacts.detail.item.edit.html',
          modal: ["item"],
          controller: ['$scope', '$state', 'item',
            function (  $scope,   $state,   item) {
              $scope.item = item;
              $scope.done = function () {
                // Go back up. '^' means up one. '^.^' would be up twice, to the grandparent.
                $state.go('^');
              };
            }]
        });
    }
  ]
);


text:
            Formularul a fost completat cu succes!

            Salvați ?

        <button type="submit" class="btn btn-success">Salvează</button>


text: module.exports=require('./lib/controller')


text:
package com.makeagame.core.plugin.libgdx;

import java.util.ArrayList;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.makeagame.core.Bootstrap;
import com.makeagame.core.Driver;
import com.makeagame.core.Engine;
import com.makeagame.core.view.RenderEvent;
import com.makeagame.core.view.SignalEvent;
import com.makeagame.core.view.SignalEvent.MouseEvent;
import com.makeagame.tools.MathTools;

public class LibgdxDriver extends ApplicationAdapter implements Driver{

    SpriteBatch batch;
    BitmapFont gameLable;
    Engine engine;

    myInputAdapter inputAdapter;

    @Override
    public void init() {
        System.out.println("game start");
        if (Engine.LOG) {
            Gdx.app.setLogLevel(Application.LOG_DEBUG);
        }
        batch = new SpriteBatch();
        gameLable = new BitmapFont();
        gameLable.setColor(new Color(1, 0, 0, 1));

    }

    @Override
    public ArrayList<SignalEvent> signal(ArrayList<SignalEvent> signalList) {
        if(inputAdapter == null){
            inputAdapter = new myInputAdapter(signalList);
            Gdx.input.setInputProcessor(inputAdapter);
        }

        System.out.println("signalList size: " + signalList.size());

        return inputAdapter.getList();
    }

    @Override
    public ArrayList<RenderEvent> render(ArrayList<RenderEvent> renderList) {
        Engine.logD("batch begine time " + System.currentTimeMillis());
        batch.begin();
        // batch.enableBlending();

        for (RenderEvent e : renderList) {

            System.out.println("enter point render list");

            // if (e.useBlend) {
            // batch.enableBlending();
            // batch.setBlendFunction(e.srcFunc, e.dstFunc);
            // } else {
            // batch.disableBlending();
            // }

            // if (e.useBlend) {
            // batch.setBlendFunction(e.srcFunc, e.dstFunc);
            // } else {
            // batch.setBlendFunction(GL30.GL_SRC_ALPHA, GL30.GL_ONE_MINUS_SRC_ALPHA);
            // }
            batch.setColor(e.color);

            switch (e.type) {
            case RenderEvent.IMAGE:

                Texture texture = null;
                try {
                    texture = e.res.getPayload().get();
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
                if(texture == null){
                    System.out.println("texture is null");
                    return renderList;
                }

//                 Engine.logI("x: " + e.x + "y: " + e.y);

                int dim[] = e.res.getSrcDim();
                int dim2[] = new int[] { e.srcX, e.srcY, e.srcW, e.srcH };
                dim2[0] = dim2[0] + dim[0];
                dim2[1] = dim2[1] + dim[1];
                dim2[2] = dim2[2] == -1 ? dim[2] : dim2[2];
                dim2[3] = dim2[3] == -1 ? dim[3] : dim2[3];

                dim = MathTools.inner(dim, dim2);
                int srcX = dim[0];
                int srcY = dim[1];
                int srcW = dim[2];
                int srcH = dim[3];

//                 Engine.logI("src: (" + srcX + ","
//                 + srcY + ","
//                 + srcW + ","
//                 + srcH + ")");

                float x = e.x;
                float y = Bootstrap.screamHeight() - e.y - srcH;
//                Engine.logI("render x " + x + ", y " + y);
                batch.draw(texture, x, y, (float) srcW, (float) srcH, srcX, srcY, srcW, srcH, e.flipX, e.flipY);
                // }
                break;
            case RenderEvent.LABEL:
                gameLable.draw(batch, e.s, e.x, Bootstrap.screamHeight() - e.y);
                break;
//            case RenderEvent.SOUND:
//                InternalResource payload = e.res.getPayload();
//                if(payload instanceof LibgdxResSound){
//                    Sound sound = payload.get();
//                    sound.play(e.vol);
//                }
//                break;
            }
        }
        batch.end();
        Engine.logD("batch end time " + System.currentTimeMillis());
        try {
            Thread.sleep((long) (1000 / Bootstrap.FPS - Gdx.graphics.getDeltaTime()));
        } catch (InterruptedException e1) {
            e1.printStackTrace();
        }
        return renderList;
    }

    @Override
    public void create() {
        super.create();
        init();
    }

    @Override
    public void render() {
        engine.tickOne();
    }

    @Override
    public Driver setEngine(Engine engine){
        this.engine = engine;
        return this;
    }

    public LibgdxDriver getApplication(){
        return this;
    }

    class myInputAdapter extends InputAdapter{

        private ArrayList<SignalEvent> signalList;

        myInputAdapter(ArrayList<SignalEvent> list){
            this.signalList = list;
        }

        ArrayList<SignalEvent> getList(){
            return signalList;
        }

        @Override
        public boolean touchUp(int screenX, int screenY, int pointer, int button) {
            signalList.add(new SignalEvent(SignalEvent.MOUSE_EVENT, SignalEvent.ACTION_UP, new int[] { button, screenX, screenY }));
            return super.touchUp(screenX, screenY, pointer, button);
        }

        @Override
        public boolean touchDragged(int screenX, int screenY, int pointer) {
            signalList.add(new SignalEvent(SignalEvent.MOUSE_EVENT, SignalEvent.ACTION_DRAG, new int[] { SignalEvent.MouseEvent.ANY_KEY, screenX, screenY }));
            return super.touchDragged(screenX, screenY, pointer);
        }

        @Override
        public boolean mouseMoved(int screenX, int screenY) {
            signalList.add(new SignalEvent(SignalEvent.MOUSE_EVENT, SignalEvent.ACTION_MOVE, new int[] { MouseEvent.ANY_KEY, screenX, screenY }));
            return super.mouseMoved(screenX, screenY);
        }

        public boolean touchDown(int screenX, int screenY, int pointer, int button) {
            Engine.logD("touch " + screenX + " " + screenY);
            signalList.add(new SignalEvent(SignalEvent.MOUSE_EVENT, SignalEvent.ACTION_DOWN, new int[] { button, screenX, screenY }));
            return super.touchDown(screenX, screenY, pointer, button);
        }

        @Override
        public boolean keyDown(int keycode) {
            signalList.add(new SignalEvent(SignalEvent.KEY_EVENT, SignalEvent.ACTION_DOWN, new int[] { keycode }));
            return super.keyDown(keycode);
        }

        @Override
        public boolean keyUp(int keycode) {
            signalList.add(new SignalEvent(SignalEvent.KEY_EVENT, SignalEvent.ACTION_UP, new int[] { keycode }));
            return super.keyUp(keycode);
        }
    }

}


text:
**************
Georeferencing
**************

=======
Preface
=======

Preface should cover overwiev of:

* need of georeferencing
* gdal as the main dependency for gis in wradlib
* georeferencing of polar radar data
* possibly gridding
* georeferencing of gridded radar data
* projections, spatial reference systems, coordinate transforms
* handling raster data
* handling vector data
* visualizing georeferenced data

================
Polar Radar Data
================

==================
Gridded Radar Data
==================

===================
Data Over-/Underlay
===================

Adding Raster Data
==================

Adding Vector Data
==================


text:
using Microsoft.Extensions.FileProviders;
using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Extensions.Configuration.Encryption
{
    public static class EncryptionConfigurationExtensions
    {
        public static IConfigurationBuilder AddEncryptionFile(this IConfigurationBuilder builder, string path)
        {
            return AddEncryptionFile(builder, provider: null, path: path, password: path, optional: false, reloadOnChange: false);
        }
        public static IConfigurationBuilder AddEncryptionFile(this IConfigurationBuilder builder, string path, bool optional)
        {
            return AddEncryptionFile(builder, provider: null, path: path, password: path, optional: optional, reloadOnChange: false);
        }
        public static IConfigurationBuilder AddEncryptionFile(this IConfigurationBuilder builder, string path, bool optional, bool reloadOnChange)
        {
            return AddEncryptionFile(builder, provider: null, path: path, password: path, optional: optional, reloadOnChange: reloadOnChange);
        }
        public static IConfigurationBuilder AddEncryptionFile(this IConfigurationBuilder builder, IFileProvider provider, string path, string password, bool optional, bool reloadOnChange)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentException("File path must be a non-empty string.", nameof(path));
            }
            if (string.IsNullOrEmpty(password))
            {
                password = path;
            }
            return builder.AddEncryptionFile(s =>
            {
                s.Password = password;
                s.FileProvider = provider;
                s.Path = path;
                s.Optional = optional;
                s.ReloadOnChange = reloadOnChange;
                s.ResolveFileProvider();
            });
        }
        public static IConfigurationBuilder AddEncryptionFile(this IConfigurationBuilder builder, Action<EncryptionConfigurationSource> configureSource)
            => builder.Add(configureSource);
    }
}


text:
from uuid imort uuid4
from datetime import datetime

from myapp.extensions import db

def _uuid_str():
    return str(uuid4())

class IdentifierMixin(object):
    identifier = db.Column(db.String(36), default=_uuid_str)

class TimestampMixin(object):
    created_at = db.Column(db.DateTime, default=datetime.now)
    updated_at = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now)


text:
<?php
// Heading
$_['heading_title']    = 'Affiliate';

// Text
$_['text_extension']   = 'Extensions';
$_['text_success']     = 'Success: You have modified affiliate module!';
$_['text_edit']        = 'Edit Affiliate Module';

// Entry
$_['entry_status']     = 'Status';

// Error
$_['error_permission'] = 'Warning: You do not have permission to modify affiliate module!';


text:
<component name="libraryTable">
  <library name="com.android.support:support-media-compat-25.3.1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.android/build-cache/705023240c6ddca0107fa32353f12cdcbae4d899/output/jars/classes.jar!/" />
      <root url="file://$USER_HOME$/.android/build-cache/705023240c6ddca0107fa32353f12cdcbae4d899/output/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-media-compat/25.3.1/support-media-compat-25.3.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
using System.Collections.Generic;
using Azure.Core;

namespace Azure.ResourceManager.CosmosDB.Models
{
    /// <summary> A list of private endpoint connections. </summary>
    internal partial class PrivateEndpointConnectionListResult
    {
        /// <summary> Initializes a new instance of PrivateEndpointConnectionListResult. </summary>
        internal PrivateEndpointConnectionListResult()
        {
            Value = new ChangeTrackingList<PrivateEndpointConnectionAutoGenerated>();
        }

        /// <summary> Initializes a new instance of PrivateEndpointConnectionListResult. </summary>
        /// <param name="value"> Array of private endpoint connections. </param>
        internal PrivateEndpointConnectionListResult(IReadOnlyList<PrivateEndpointConnectionAutoGenerated> value)
        {
            Value = value;
        }

        /// <summary> Array of private endpoint connections. </summary>
        public IReadOnlyList<PrivateEndpointConnectionAutoGenerated> Value { get; }
    }
}


text:
<!DOCTYPE html>

{% load rango_extras %}
{% load staticfiles %}

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="http://getbootstrap.com/favicon.ico">

    <title>Rango - {% block title %}How to Tango with Django!{% endblock %}</title>

    <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://getbootstrap.com/examples/dashboard/dashboard.css" rel="stylesheet">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            Toggle navigation

          </button>
          Rango

Home

                    {% if user.is_authenticated %}

Restricted Page

Logout

Add a New Category

Edit Profile

View Profile

View Users Profiles

                    {% else %}

Register Here

Login

                    {% endif %}

About

Find a Category

                <form>

<input class="search-query span10" type="text"
                        name="suggestion" value="" id="suggestion" data-catid="{{category.id}}"/>

                </form>

            {% block side_block %}
		    {% get_category_list category %}
		    {% endblock %}

                {% block body_block %}{% endblock %}


text:
module Awesome
  module Definitions
    module Bits

      def self.included(base)
        base.extend ClassMethods
      end

      module ClassMethods

        def get_class(name)
          const_get(name) unless name.blank?
        end

        def modifier_regex_from_array(arr, whitespace = false)
          self.modifier_regex(self.array_to_middle_regex(arr, whitespace))
        end

        def array_to_middle_regex(arr, whitespace = false)
          return '' if arr.empty?
          arr = whitespace ?
            arr.map {|x| '(\s*' + x + '\s*)'} :
            arr.map {|x| '(' + x + ')'}
          arr.join('|')
        end

        def modifier_regex(middle)
          Regexp.new(middle)
        end

        # In dealing with symbols and strings and params from requests
        #  comparisons can fail even when we want them to pass.
        # This prevents those unwanted failures
        # We will compare strings of this format ":ebay"
        def symring_equalizer(one, two)
          return self.make_symring(one) == self.make_symring(two)
        end

        def make_symring(var)
          if var.is_a?(Symbol)
            return ":#{var}"
          elsif var.is_a?(String)
            var.include?(':') ? var.strip : ":#{var.strip}"
          end
        end

        def unmake_symring(var)
          return "#{var}".delete(':')
        end

        #def modifier_regex_from_arrays(arr, whitespace = false)
        #  self.modifier_regex(array_of_arrays_to_middle_regex(arr, whitespace))
        #end

        #Returns a string of a partial regex
        #def array_of_arrays_to_middle_regex(arr, whitespace = false)
        #  arr = arr.map do |array|
        #    "(" + self.array_to_middle_regex(array, whitespace) + ")"
        #  end
        #  arr.join('|')
        #end

        #def looped_array(a)
        #  b = []
        #  a.length.times do
        #    b << Array.new(a.insert(0,a.pop))
        #  end
        #  b
        #end

      end
    end
  end
end


text:
namespace serial
{
class GeometryCodingParams;
}  // namespace serial

namespace feature
{
class FeatureBuilder
{
public:
  using PointSeq = std::vector<m2::PointD>;
  using Geometry = std::list<PointSeq>;
  using Buffer = std::vector<char>;
  using Offsets = std::vector<uint32_t>;

  struct SupportingData
  {
    Offsets m_ptsOffset;
    Offsets m_trgOffset;
    uint8_t m_ptsMask = 0;
    uint8_t m_trgMask = 0;
    uint32_t m_ptsSimpMask = 0;
    PointSeq m_innerPts;
    PointSeq m_innerTrg;
    Buffer m_buffer;
  };

  FeatureBuilder();
  // Checks for equality. The error of coordinates is allowed.
  bool operator==(FeatureBuilder const & fb) const;
  // Checks for equality. The error of coordinates isn't allowed. Binary equality check of
  // coordinates is used.
  bool IsExactEq(FeatureBuilder const & fb) const;

  // To work with geometry.
  void AddPoint(m2::PointD const & p);
  void SetHoles(Geometry const & holes);
  void AddPolygon(std::vector<m2::PointD> & poly);
  void ResetGeometry();
  m2::RectD const & GetLimitRect() const { return m_limitRect; }
  Geometry const & GetGeometry() const { return m_polygons; }
  PointSeq const & GetOuterGeometry() const { return m_polygons.front(); }
  GeomType GetGeomType() const { return m_params.GetGeomType(); }
  bool IsGeometryClosed() const;
  m2::PointD GetGeometryCenter() const;
  m2::PointD GetKeyPoint() const;
  size_t GetPointsCount() const;
  size_t GetPolygonsCount() const { return m_polygons.size(); }
  size_t GetTypesCount() const { return m_params.m_types.size(); }

  template <class ToDo>
  void ForEachGeometryPointEx(ToDo && toDo) const
  {
    if (IsPoint())
    {
      toDo(m_center);
    }
    else
    {
      for (PointSeq const & points : m_polygons)
      {
        for (auto const & pt : points)
        {
          if (!toDo(pt))
            return;
        }
        toDo.EndRegion();
      }
    }
  }

  template <class ToDo>
  void ForEachGeometryPoint(ToDo && toDo) const
  {
    ToDoWrapper<ToDo> wrapper(std::forward<ToDo>(toDo));
    ForEachGeometryPointEx(std::move(wrapper));
  }

  template <class ToDo>
  bool ForAnyGeometryPointEx(ToDo && toDo) const
  {
    if (IsPoint())
      return toDo(m_center);

    for (PointSeq const & points : m_polygons)
    {
      for (auto const & pt : points)
      {
        if (toDo(pt))
          return true;
      }
      toDo.EndRegion();
    }
    return false;
  }

  template <class ToDo>
  bool ForAnyGeometryPoint(ToDo && toDo) const
  {
    ToDoWrapper<ToDo> wrapper(std::forward<ToDo>(toDo));
    return ForAnyGeometryPointEx(std::move(wrapper));
  }

  // To work with geometry type.
  void SetCenter(m2::PointD const & p);
  void SetLinear(bool reverseGeometry = false);
  void SetArea() { m_params.SetGeomType(GeomType::Area); }
  bool IsPoint() const { return GetGeomType() == GeomType::Point; }
  bool IsLine() const { return GetGeomType() == GeomType::Line; }
  bool IsArea() const { return GetGeomType() == GeomType::Area; }

  // To work with types.
  void SetType(uint32_t type) { m_params.SetType(type); }
  void AddType(uint32_t type) { m_params.AddType(type); }
  bool PopExactType(uint32_t type) { return m_params.PopExactType(type); }

  template <class Fn>
  bool RemoveTypesIf(Fn && fn)
  {
    base::EraseIf(m_params.m_types, std::forward<Fn>(fn));
    return m_params.m_types.empty();
  }

  bool HasType(uint32_t t) const { return m_params.IsTypeExist(t); }
  bool HasType(uint32_t t, uint8_t level) const { return m_params.IsTypeExist(t, level); }
  uint32_t FindType(uint32_t comp, uint8_t level) const { return m_params.FindType(comp, level); }
  FeatureParams::Types const & GetTypes() const { return m_params.m_types; }

  // To work with additional information.
  void SetRank(uint8_t rank);
  void AddHouseNumber(std::string const & houseNumber);
  void AddStreet(std::string const & streetName);
  void AddPostcode(std::string const & postcode);
  bool AddName(std::string const & lang, std::string const & name);
  void SetParams(FeatureParams const & params) { m_params.SetParams(params); }

  FeatureParams const & GetParams() const { return m_params; }
  FeatureParams & GetParams() { return m_params; }
  std::string GetName(int8_t lang = StringUtf8Multilang::kDefaultCode) const;
  StringUtf8Multilang const & GetMultilangName() const { return m_params.name; }
  uint8_t GetRank() const { return m_params.rank; }
  bool FormatFullAddress(std::string & res) const;
  AddressData const & GetAddressData() const { return m_params.GetAddressData(); }

  Metadata const & GetMetadata() const { return m_params.GetMetadata(); }
  Metadata & GetMetadata() { return m_params.GetMetadata(); }

  // To work with types and names based on drawing.
  // Check classificator types for their compatibility with feature geometry type.
  // Need to call when using any classificator types manipulating.
  // Return false If no any valid types.
  bool RemoveInvalidTypes();
  // Clear name if it's not visible in scale range [minS, maxS].
  void RemoveNameIfInvisible(int minS = 0, int maxS = 1000);
  void RemoveUselessNames();
  int GetMinFeatureDrawScale() const;
  bool IsDrawableInRange(int lowScale, int highScale) const;

  // Serialization.
  bool PreSerialize();
  void SerializeBase(Buffer & data, serial::GeometryCodingParams const & params,
                     bool saveAddInfo) const;

  bool PreSerializeAndRemoveUselessNamesForIntermediate();
  void SerializeForIntermediate(Buffer & data) const;
  void SerializeBorderForIntermediate(serial::GeometryCodingParams const & params,
                                      Buffer & data) const;
  void DeserializeFromIntermediate(Buffer & data);

  // These methods use geometry without loss of accuracy.
  void SerializeAccuratelyForIntermediate(Buffer & data) const;
  void DeserializeAccuratelyFromIntermediate(Buffer & data);

  bool PreSerializeAndRemoveUselessNamesForMwm(SupportingData const & data);
  void SerializeLocalityObject(serial::GeometryCodingParams const & params,
                               SupportingData & data) const;
  void SerializeForMwm(SupportingData & data, serial::GeometryCodingParams const & params) const;

  // Get common parameters of feature.
  TypesHolder GetTypesHolder() const;

  // To work with osm ids.
  void AddOsmId(base::GeoObjectId id);
  void SetOsmId(base::GeoObjectId id);
  base::GeoObjectId GetFirstOsmId() const;
  base::GeoObjectId GetLastOsmId() const;
  // Returns an id of the most general element: node's one if there is no area or relation,
  // area's one if there is no relation, and relation id otherwise.
  base::GeoObjectId GetMostGenericOsmId() const;
  bool HasOsmId(base::GeoObjectId const & id) const;
  bool HasOsmIds() const { return !m_osmIds.empty(); }
  std::vector<base::GeoObjectId> const & GetOsmIds() const { return m_osmIds; }

  // To work with coasts.
  void SetCoastCell(int64_t iCell) { m_coastCell = iCell; }
  bool IsCoastCell() const { return (m_coastCell != -1); }

protected:
  template <class ToDo>
  class ToDoWrapper
  {
  public:
    ToDoWrapper(ToDo && toDo) : m_toDo(std::forward<ToDo>(toDo)) {}
    bool operator()(m2::PointD const & p) { return m_toDo(p); }
    void EndRegion() {}

  private:
    ToDo && m_toDo;
  };

  // Can be one of the following:
  // - point in point-feature
  // - origin point of text [future] in line-feature
  // - origin point of text or symbol in area-feature
  m2::PointD m_center;  // Check  HEADER_HAS_POINT
  // List of geometry polygons.
  Geometry m_polygons;  // Check HEADER_IS_AREA
  m2::RectD m_limitRect;
  std::vector<base::GeoObjectId> m_osmIds;
  FeatureParams m_params;
  /// Not used in GEOM_POINTs
  int64_t m_coastCell;
};

void Check(FeatureBuilder const fb);
std::string DebugPrint(FeatureBuilder const & fb);

// SerializationPolicy serialization and deserialization.
namespace serialization_policy
{
enum class SerializationVersion : uint32_t
{
  Undefined,
  MinSize,
  MaxAccuracy
};

using TypeSerializationVersion = typename std::underlying_type<SerializationVersion>::type;

struct MinSize
{
  auto static const kSerializationVersion = static_cast<TypeSerializationVersion>(SerializationVersion::MinSize);

  static void Serialize(FeatureBuilder const & fb, FeatureBuilder::Buffer & data)
  {
    fb.SerializeForIntermediate(data);
  }

  static void Deserialize(FeatureBuilder & fb, FeatureBuilder::Buffer & data)
  {
    fb.DeserializeFromIntermediate(data);
  }
};

struct MaxAccuracy
{
  auto static const kSerializationVersion = static_cast<TypeSerializationVersion>(SerializationVersion::MinSize);

  static void Serialize(FeatureBuilder const & fb, FeatureBuilder::Buffer & data)
  {
    fb.SerializeAccuratelyForIntermediate(data);
  }

  static void Deserialize(FeatureBuilder & fb, FeatureBuilder::Buffer & data)
  {
    fb.DeserializeAccuratelyFromIntermediate(data);
  }
};
}  // namespace serialization_policy

// TODO(maksimandrianov): I would like to support the verification of serialization versions,
// but this requires reworking of FeatureCollector class and its derived classes. It is in future plans

//template <class SerializationPolicy, class Source>
//void TryReadAndCheckVersion(Source & src)
//{
//  if (src.Size() - src.Pos() >= sizeof(serialization_policy::TypeSerializationVersion))
//  {
//    auto const type = ReadVarUint<serialization_policy::TypeSerializationVersion>(src);
//    CHECK_EQUAL(type, SerializationPolicy::kSerializationVersion, ());
//  }
//  else
//  {
//    LOG(LWARNING, ("Unable to read file version."))
//  }
//}

// Read feature from feature source.
template <class SerializationPolicy = serialization_policy::MinSize, class Source>
void ReadFromSourceRawFormat(Source & src, FeatureBuilder & fb)
{
  uint32_t const sz = ReadVarUint<uint32_t>(src);
  typename FeatureBuilder::Buffer buffer(sz);
  src.Read(&buffer[0], sz);
  SerializationPolicy::Deserialize(fb, buffer);
}

// Process features in .dat file.
template <class SerializationPolicy = serialization_policy::MinSize, class ToDo>
void ForEachFromDatRawFormat(std::string const & filename, ToDo && toDo)
{
  FileReader reader(filename);
  ReaderSource<FileReader> src(reader);
  // TryReadAndCheckVersion<SerializationPolicy>(src);
  auto const fileSize = reader.Size();
  auto currPos = src.Pos();
  // read features one by one
  while (currPos < fileSize)
  {
    FeatureBuilder fb;
    ReadFromSourceRawFormat<SerializationPolicy>(src, fb);
    toDo(fb, currPos);
    currPos = src.Pos();
  }
}

/// Parallel process features in .dat file.
template <class SerializationPolicy = serialization_policy::MinSize, class ToDo>
void ForEachParallelFromDatRawFormat(size_t threadsCount, std::string const & filename,
                                     ToDo && toDo)
{
  CHECK_GREATER_OR_EQUAL(threadsCount, 1, ());
  if (threadsCount == 1)
    return ForEachFromDatRawFormat(filename, std::forward<ToDo>(toDo));

  FileReader reader(filename);
  ReaderSource<FileReader> src(reader);
//  TryReadAndCheckVersion<SerializationPolicy>(src);
  auto const fileSize = reader.Size();
  auto currPos = src.Pos();
  std::mutex readMutex;
  auto concurrentProcessor = [&] {
    for (;;)
    {
      FeatureBuilder fb;
      uint64_t featurePos;

      {
        std::lock_guard<std::mutex> lock(readMutex);

        if (fileSize <= currPos)
          break;

        ReadFromSourceRawFormat<SerializationPolicy>(src, fb);
        featurePos = currPos;
        currPos = src.Pos();
      }

      toDo(fb, featurePos);
    }
  };

  std::vector<std::thread> workers;
  for (size_t i = 0; i < threadsCount; ++i)
    workers.emplace_back(concurrentProcessor);
  for (auto & thread : workers)
    thread.join();
}
template <class SerializationPolicy = serialization_policy::MinSize>
std::vector<FeatureBuilder> ReadAllDatRawFormat(std::string const & fileName)
{
  std::vector<FeatureBuilder> fbs;
  ForEachFromDatRawFormat<SerializationPolicy>(fileName, [&](auto && fb, auto const &) {
    fbs.emplace_back(std::move(fb));
  });
  return fbs;
}

template <class SerializationPolicy = serialization_policy::MinSize, class Writer = FileWriter>
class FeatureBuilderWriter
{
public:
  explicit FeatureBuilderWriter(std::string const & filename,
                                FileWriter::Op op = FileWriter::Op::OP_WRITE_TRUNCATE)
    : m_writer(filename, op)
  {
    // TODO(maksimandrianov): I would like to support the verification of serialization versions,
    // but this requires reworking of FeatureCollector class and its derived classes. It is in future plans
    // WriteVarUint(m_writer, static_cast<serialization_policy::TypeSerializationVersion>(SerializationPolicy::kSerializationVersion));
  }

  void Write(FeatureBuilder const & fb)
  {
    FeatureBuilder::Buffer buffer;
    SerializationPolicy::Serialize(fb, buffer);
    WriteVarUint(m_writer, static_cast<uint32_t>(buffer.size()));
    m_writer.Write(buffer.data(), buffer.size() * sizeof(FeatureBuilder::Buffer::value_type));
  }

private:
  Writer m_writer;
};
}  // namespace feature


text:
package it.poliba.sisinflab.simlib.datamodel;

import java.util.HashSet;
import java.util.Objects;

/**
 * A single relation between two nodes, with a given {@link #direction} attribute
 *
 * @author Giorgio Basile
 * @since 1.0
 */
public class Arrow {

    public static final String DIR_OUT = "out";
    public static final String DIR_IN = "in";
    public static final String DIR_UND = "und";

    private Node property;
    private String direction;

    /**
     * TODO: explain why property is instance of Node
     * @param property
     * @param direction
     */
    protected Arrow(Node property, String direction){
        this.property = property;
        if(isValidDirection(direction)){
            this.direction = direction;
        }else{
            throw new IllegalArgumentException("Wrong direction value: " + direction);
        }
    }

    public Node getProperty() {
        return property;
    }

    public void setProperty(Node property) {
        this.property = property;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public boolean isValidDirection(String direction){
        return direction.equals(DIR_IN) || direction.equals(DIR_OUT) || direction.equals(DIR_UND);
    }

    /**
     * Creates a new {@link Arrow} object with the opposite direction with respect to this arrow's direction
     *
     * @return the inverted arrow
     */
    public Arrow getInvertedArrow(){
        if(direction.equals(DIR_OUT)) {
            return new Arrow(property, DIR_IN);
        }else if(direction.equals(DIR_IN)) {
            return new Arrow(property, DIR_OUT);
        }else
            throw new IllegalArgumentException("You can't invert a undirected edge");
    }

    @Override
    public int hashCode(){
        return Objects.hash(property, direction);
    }

    @Override
    public boolean equals(Object o) {
        if(o instanceof Arrow){
            Arrow e = (Arrow) o;
            return e.getProperty().equals(property) && e.getDirection().equals(direction);
        }
        return false;
    }

    @Override
    public String toString() {
        return property.toString() + " - " + direction;
    }
}


text:
/* Author: Martin Pecka */

#include <moveit/robot_model/aabb.h>
#include <geometric_shapes/check_isometry.h>

void moveit::core::AABB::extendWithTransformedBox(const Eigen::Isometry3d& transform, const Eigen::Vector3d& box)
{
  // Method adapted from FCL src/shape/geometric_shapes_utility.cpp#computeBV<AABB, Box>(...) (BSD-licensed code):
  // https://github.com/flexible-collision-library/fcl/blob/fcl-0.4/src/shape/geometric_shapes_utility.cpp#L292
  // We don't call their code because it would need creating temporary objects, and their method is in floats.
  //
  // Here's a nice explanation why it works: https://zeuxcg.org/2010/10/17/aabb-from-obb-with-component-wise-abs/

  ASSERT_ISOMETRY(transform)  // unsanitized input, could contain non-isometry
  const Eigen::Matrix3d& r = transform.linear();
  const Eigen::Vector3d& t = transform.translation();

  double x_range = 0.5 * (fabs(r(0, 0) * box[0]) + fabs(r(0, 1) * box[1]) + fabs(r(0, 2) * box[2]));
  double y_range = 0.5 * (fabs(r(1, 0) * box[0]) + fabs(r(1, 1) * box[1]) + fabs(r(1, 2) * box[2]));
  double z_range = 0.5 * (fabs(r(2, 0) * box[0]) + fabs(r(2, 1) * box[1]) + fabs(r(2, 2) * box[2]));

  const Eigen::Vector3d v_delta(x_range, y_range, z_range);
  extend(t + v_delta);
  extend(t - v_delta);
}


text:
namespace CGAL { namespace POLYNOMIAL { namespace internal {

template<class Polynomial, class M_t = CGAL::Field_tag>
class Root_bound_evaluator
{
    public:
        typedef typename Polynomial::NT   NT;
        typedef M_t              Method_tag;

        typedef NT               result_type;
        typedef bool             argument_type;
        typedef Method_tag       argument_type1;
        typedef bool             argument_type2;

    private:
        static NT
            compute_bound(const NT& max_abs, const NT& abs_lead_cf,
        CGAL::Field_tag) {
            NT bound = max_abs / abs_lead_cf + NT(1);
//    bound = NT( ceil(CGAL::to_double(bound)) );
            return bound;
        }

        static NT
            compute_bound(const NT& max_abs, const NT& abs_lead_cf,
			  CGAL::Integral_domain_without_division_tag) {
#if 1
            double d1 = to_double(max_abs);
            double d2 = to_double(abs_lead_cf);
            double bound = std::ceil(d1 / d2) + 1.0;
#else
// MK: I MAY WANT TO CHANGE TO THE FOLLOWING CODE OR EVEN DO
//     COMPUTATIONS WITH INTERVALS
            double d1 = POLYNOMIAL_NS::to_interval(max_abs).second;
            double d2 = POLYNOMIAL_NS::to_interval(abs_lead_cf).first;
            double bound = std::ceil(d1 / d2) + 1.0;
#endif
            return NT(bound);
        }

    public:
        Root_bound_evaluator( bool pow= true,
            Method_tag t = Method_tag()): power_of_2(pow), tag(t) {}

        result_type operator()(const Polynomial& p) const
        {
            if ( p.is_zero() ) { return NT(0); }

            int deg = p.degree();

            NT M = CGAL::abs( p[0] );

            for (int i = 1; i < deg; i++) {
                NT abs = CGAL::abs( p[i] );
                if ( abs > M ) { M = abs; }
            }

            NT abs_lead_cf = CGAL::abs( p[deg] );

            NT bound = compute_bound(M, abs_lead_cf, tag);

            if ( power_of_2 ) {
                NT pow2 = NT(2);
                while ( bound >= pow2 ) {
                    pow2 *= NT(2);
                }
                return pow2;
            }

            return bound;
        }
    protected:
        bool power_of_2;
        Method_tag tag;
};

#if 0
template<class Kernel, class M_t = CGAL::Field_tag>
class Filtered_root_bound_evaluator
{
    public:
        typedef typename Kernel::Function Polynomial;
        typedef typename Polynomial::NT   NT;
        typedef M_t              Method_tag;

        typedef NT result_type;
        typedef Method_tag       second_argument_type;
        typedef bool             first_argument_type;

    private:
        template <class NTT>
            static NTT
            compute_bound(const NTT& max_abs, const NTT& abs_lead_cf,
        CGAL::Field_tag) {
            NTT bound = max_abs / abs_lead_cf + NTT(1);
//    bound = NT( ceil(CGAL::to_double(bound)) );
            return bound;
        }

        template <class NTT>
            static NTT
            compute_bound(const NTT& max_abs, const NTT& abs_lead_cf,
        CGAL::Integral_domain_without_division_tag) {
#if 1
            double d1 = CGAL::to_double(max_abs);
            double d2 = CGAL::to_double(abs_lead_cf);
            double bound = ceil(d1 / d2) + 1.0;
#else
// MK: I MAY WANT TO CHANGE TO THE FOLLOWING CODE OR EVEN DO
//     COMPUTATIONS WITH INTERVALS
            double d1 = CGAL::to_interval(max_abs).second;
            double d2 = CGAL::to_interval(abs_lead_cf).first;
            double bound = ceil(d1 / d2) + 1.0;
#endif
            return NTT(bound);
        }

        template <class Poly>
        static typename Poly::NT do_stuff(const Poly &pp, bool power_of_2, Method_tag tag) {
            typedef typename Poly::NT NT;
            int deg = pp.degree();

            NT M = CGAL::abs( pp[0] );

            for (int i = 1; i < deg; i++) {
                NT abs = CGAL::abs( pp[i] );
                if ( abs > M ) { M = abs; }
            }

            NT abs_lead_cf = CGAL::abs( pp[deg] );

            NT bound = compute_bound(M, abs_lead_cf, tag);

            if ( power_of_2 ) {
                NT pow2 = NT(2);
                while ( bound >= pow2 ) {
                    pow2 *= NT(2);
                }
                return pow2;
            } else return bound;

        }

    public:
        Filtered_root_bound_evaluator(bool pow = true,
            Method_tag t = Method_tag()): power_of_2(pow), tag(t)  {}

        result_type operator()(const Polynomial& p) const
        {
            if ( p.degree() ==-1) { return result_type(0); }

            FPU_CW_t backup = FPU_get_and_set_cw(CGAL_FE_UPWARD);
            typename Kernel::Interval_kernel::Function::NT db= do_stuff(p.interval_function(), power_of_2, tag);
            FPU_set_cw(backup);

            double rub= db.sup();
            if (rub == infinity<double>()) {
                return result_type(do_stuff(p.exact_function(), power_of_2, tag));
            }
            else {
                return result_type(rub);
            }
        }
    protected:
        bool power_of_2;
        Method_tag tag;
};
#endif

} } } //namespace CGAL::POLYNOMIAL::internal
#endif                                            // CGAL_POLYNOMIAL_ROOT_BOUND_EVALUATOR_H


text:
MojoResult MojoMain(MojoHandle request) {
  mojo::ApplicationRunner runner(new filesystem::FileSystemApp());
  return runner.Run(request);
}


text:
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ""
---

<!--
Thanks for submitting a bug report or featureq request to help us improve.

If you have a support question about how to use the module, no one is monitoring the issues
to answer those. Consider posting on StackOverflow instead using the "passport-saml" tag.
-->

** Spec-driven development **

This project is focused on compliance with the SAML 2.0 specification. For any bug report that
involves the SAML spec, please link to the related parts of the spec and quote the passages too.

Start here: http://saml.xml.org/saml-specifications

You might also check the spec to confirm that it doesn't address your particular bug and mention
that you found no references in the spec concerning your issue.

** Community development model **

passport-saml is maintained by a number of current users. There is no author or primary maintainer
waiting to write your tests and documentation for you. To increase the odds that your issue
is promptly dealt with, consider a pull request to address the issue that includes test coverage
and updated documentation.

**To Reproduce**

Steps to reproduce the behavior. Ideally, expressesd through an automated test.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment**

- Node.js version:
- passport-saml version:


text:
package in.wptrafficanalyzer.viewflipperdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ViewFlipper;

public class MainActivity extends Activity {

	int mFlipping = 0 ; // Initially flipping is off
	Button mButton ; // Reference to button available in the layout to start and stop the flipper

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        /** Click event handler for button */
        OnClickListener listener = new OnClickListener() {

			@Override
			public void onClick(View v) {
				ViewFlipper flipper = (ViewFlipper) findViewById(R.id.flipper1);

				if(mFlipping==0){
					/** Start Flipping */
					flipper.startFlipping();
					mFlipping=1;
					mButton.setText(R.string.str_btn_stop);
				}
				else{
					/** Stop Flipping */
					flipper.stopFlipping();
					mFlipping=0;
					mButton.setText(R.string.str_btn_start);
				}
			}
		};

		/** Getting a reference to the button available in the resource */
        mButton = (Button) findViewById(R.id.btn);

        /** Setting click event listner for the button */
        mButton.setOnClickListener(listener);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}


text:
'use strict';

const log = require('./log');

log.info(require('./util/ac'));

require('./testbed-bootstrap')(log);

const express = require('express');
const app = express();

const graphRoutes = require('./services/graph');

(async () => {
    await graphRoutes({
        app, log
    });

    const host = process.env.HOST || '0.0.0.0';
    const port = process.env.PORT || 3000;

    app.listen(port, host, () =>
        log.info({type: 'server'}, `Online: ${host} ${port}`)
    );
})().catch(err => log.fatal(err));


text:
NSString * const RAGE_DownloadManagerCacheFolder = @"RAGE.DownloadManager/Downloads/Cache/";

@interface RAGE_DownloadManagerTests : XCTestCase
@property RAGE_DownloadManager * manager;
@end

@implementation RAGE_DownloadManagerTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
    self.manager = [RAGE_DownloadManager requestManager];
    [self prepareTestCaches];
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [self.manager clearCaches];
    [self.manager.defaultSession invalidateAndCancel];
    [self setManager:nil];
    [super tearDown];
}

- (void)prepareTestCaches {
    NSFileManager * fm = [NSFileManager defaultManager];

    NSURL * cacheURL = [fm URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask].firstObject;

    NSURL * folderURL = [cacheURL URLByAppendingPathComponent:RAGE_DownloadManagerCacheFolder];

    for (NSInteger idx = 0; idx < 20; idx ++) {
        NSString * fileName = [folderURL URLByAppendingPathComponent:[NSString stringWithFormat:@"TestingCache#%zd.rage",arc4random()]].path;
        NSData *fileData = [NSData dataWithBytes:(__bridge const void * _Nullable)(fileName) length:fileName.length];
        [fm createFileAtPath:fileName contents:fileData attributes:nil];
    }
}

//- (void)testExample {

//}

- (void)testPerformanceExample {
//     This is an example of a performance test case.
    [self measureBlock:^{
//         Put the code you want to measure the time of here.
    }];
}

- (void)testAutoCacheCleaning {

//    self.manager = nil;
    [self.manager cancelAllDownloadRequestWithoutProducingResumeData];
    [self.manager.defaultSession invalidateAndCancel];

    [self setManager:nil];

    NSFileManager * fm = [NSFileManager defaultManager];

    NSURL * cacheURL = [fm URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask].firstObject;

    NSURL * folderURL = [cacheURL URLByAppendingPathComponent:RAGE_DownloadManagerCacheFolder];

    NSArray <NSURL*> * possibleCaches = [fm contentsOfDirectoryAtURL:folderURL includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles error:nil];

    XCTAssertEqual(possibleCaches.count, 0);
}

- (void)testManualCacheCleaning {
    [self.manager clearCaches];
    NSFileManager * fm = [NSFileManager defaultManager];
    NSURL * cacheURL = [fm URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask].firstObject;
    NSURL * folderURL = [cacheURL URLByAppendingPathComponent:RAGE_DownloadManagerCacheFolder];
    NSArray <NSURL*> * possibleCaches = [fm contentsOfDirectoryAtURL:folderURL includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles error:nil];
    XCTAssertEqual(possibleCaches.count, 0);
}

- (void)testFilteringUnsupportedURLs {

    NSURL * url1 = [NSURL URLWithString:@"http://www.operations.com/index.html"];
    NSURL * url2 = [NSURL URLWithString:@"ftp://www.operations.com/unsupported.php"];
    NSURL * url3 = [NSURL URLWithString:@"https://www.rage.as/hs.mp3"];

    NSArray * urls = @[url1,url2,url3];
    NSArray * identifier = @[@"U1",@"U2",@"U3"];

    __weak typeof (self) weak_self = self;
    [self.manager addDownloadRequestsWithURLs:urls withIdentifiers:identifier completeHandler:^(NSArray *failedURLs) {
        _XCTPrimitiveAssertNotEqual(weak_self, failedURLs.count, "failed Urls", 0, "non errors");
    }];
}

- (void)testIdentifierGenerateIsUnique_200Loops {
    NSMutableArray <NSString*> * samples = [NSMutableArray arrayWithCapacity:200];

    for (NSInteger idx = 0; idx < 200; idx ++)
    {
        [samples addObject:[self.manager requestUniqueIdentifier]];
    }

    for (NSInteger idx_ = 0; idx_ < samples.count; idx_++)
    {
        __block NSString * sample = samples[idx_];
        __block NSInteger counter = 0;
        [samples enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            if ([obj isEqualToString:sample])
            {
                counter += 1;
            }
            dispatch_async(dispatch_get_main_queue(), ^{
                XCTAssertLessThanOrEqual(counter, 1);
            });

        }];
    }
}

- (void)testIdentifierGenerateIsUnique_400Loops {
    NSMutableArray <NSString*> * samples = [NSMutableArray arrayWithCapacity:400];

    for (NSInteger idx = 0; idx < 400; idx ++)
    {
        [samples addObject:[self.manager requestUniqueIdentifier]];
    }

    for (NSInteger idx_ = 0; idx_ < samples.count; idx_++)
    {
        __block NSString * sample = samples[idx_];
        __block NSInteger counter = 0;
        [samples enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            if ([obj isEqualToString:sample])
            {
                counter += 1;
            }
            dispatch_async(dispatch_get_main_queue(), ^{
                XCTAssertLessThanOrEqual(counter, 1);
            });

        }];
    }
}

- (void)testIdentifierGenerateIsUnique_1kLoops {
    NSMutableArray <NSString*> * samples = [NSMutableArray arrayWithCapacity:1000];

    for (NSInteger idx = 0; idx < 1000; idx ++)
    {
        [samples addObject:[self.manager requestUniqueIdentifier]];
    }

    for (NSInteger idx_ = 0; idx_ < samples.count; idx_++)
    {
        __block NSString * sample = samples[idx_];
        __block NSInteger counter = 0;
        [samples enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            if ([obj isEqualToString:sample])
            {
                counter += 1;
            }
            dispatch_async(dispatch_get_main_queue(), ^{
                XCTAssertLessThanOrEqual(counter, 1);
            });

        }];
    }
}

@end


text:
DELIMITER /

INSERT INTO PROTOCOL_ACTION_TYPE (PROTOCOL_ACTION_TYPE_CODE, DESCRIPTION, TRIGGER_SUBMISSION, TRIGGER_CORRESPONDENCE, FINAL_ACTION_FOR_BATCH_CORRESP, UPDATE_TIMESTAMP,UPDATE_USER, obj_id)
VALUES ('903', 'Return to Reviewer', 'N', 'N', 'N', now(), 'admin', UUID())
/

insert into SEQ_NOTIFICATION_TYPE_ID values (NULL)
/
insert into notification_type
(NOTIFICATION_TYPE_ID,MODULE_CODE,ACTION_CODE,DESCRIPTION,SUBJECT,MESSAGE,PROMPT_USER,SEND_NOTIFICATION,SYSTEM_GENERATED,UPDATE_USER,
 UPDATE_TIMESTAMP,VER_NBR,OBJ_ID ) values(
 last_insert_id(),7,903,'Reject Review','{MESSAGE_SUBJECT}','{MESSAGE_BODY}',  'N','Y','Y','admin',NOW(),1,
UUID())
/

insert into SEQ_NOTIFICATION_TYPE_ID values(NULL)
/
insert into NOTIFICATION_TYPE_RECIPIENT(
NOTIFICATION_TYPE_RECIPIENT_ID,NOTIFICATION_TYPE_ID,ROLE_name,ROLE_QUALIFIER,TO_OR_CC,UPDATE_USER,UPDATE_TIMESTAMP,VER_NBR,OBJ_ID)
values(last_insert_id(),(select NOTIFICATION_TYPE_ID from notification_type where DESCRIPTION = 'Reject Review'),'KC-PROTOCOL:IRB Online Reviewer','submissionId', 'T','admin',NOW(),1,
UUID())
/

insert into SEQ_NOTIFICATION_TYPE_ID values(NULL)
/
insert into NOTIFICATION_TYPE_RECIPIENT(
NOTIFICATION_TYPE_RECIPIENT_ID,NOTIFICATION_TYPE_ID,ROLE_name,ROLE_QUALIFIER,TO_OR_CC,UPDATE_USER,UPDATE_TIMESTAMP,VER_NBR,OBJ_ID)
values(last_insert_id(),(select NOTIFICATION_TYPE_ID from notification_type where DESCRIPTION = 'Reject Review'),'KC-PROTOCOL:IRB Online Reviewer','protocolOnlineReviewId', 'T','admin',NOW(),1,
UUID())
/

insert into SEQ_NOTIFICATION_TYPE_ID values(NULL)
/
insert into NOTIFICATION_TYPE_RECIPIENT(
NOTIFICATION_TYPE_RECIPIENT_ID,NOTIFICATION_TYPE_ID,ROLE_name,ROLE_QUALIFIER,TO_OR_CC,UPDATE_USER,UPDATE_TIMESTAMP,VER_NBR,OBJ_ID)
values(last_insert_id(),(select NOTIFICATION_TYPE_ID from notification_type where DESCRIPTION = 'Reject Review'),'KC-PROTOCOL:IRB Online Reviewer','protocolLeadUnitNumber', 'T','admin',NOW(),1,
UUID())
/

DELIMITER ;


text:
<?php

namespace DevAnalyzer\Controller;

use DevAnalyzer\Analysis\Analyzer;
use DevAnalyzer\Mapper\ArrayMapper;
use DevAnalyzer\Model\Analysis\DeveloperQuery as AnalysisDeveloperQuery;
use DevAnalyzer\Model\Search\DeveloperQuery as SearchDeveloperQuery;
use DevAnalyzer\Search\SearchEngine;
use Symfony\Component\HttpFoundation\Request;

class DevAnalyzerController
{
    /**
     * @var \Twig_Environment
     */
    private $twig;

    /**
     * @var Analyzer
     */
    private $analyzer;
    /**
     * @var ArrayMapper
     */
    private $mapper;
    /**
     * @var SearchEngine
     */
    private $searchEngine;

    public function __construct(
        SearchEngine $searchEngine,
        Analyzer $analyzer,
        \Twig_Environment $twig,
        ArrayMapper $mapper
    )
    {
        $this->twig = $twig;
        $this->analyzer = $analyzer;
        $this->mapper = $mapper;
        $this->searchEngine = $searchEngine;
    }

    public function searchAction(Request $request)
    {
        /** @var SearchDeveloperQuery $searchQuery */
        $searchQuery = $this->mapper->createFromArray(SearchDeveloperQuery::class, $request->query->all());
        $limit = $request->query->getInt('limit', 5);

        $searchResult = null;
        if ($valid = $searchQuery->isValid()) {
            $searchResult = $this->searchEngine->search($searchQuery, $limit);
        }

        return $this->twig->render(
            'index.html.twig',
            compact('valid', 'limit', 'searchQuery', 'searchResult')
        );
    }

    public function reportAction(Request $request)
    {
        $analysisQuery = new AnalysisDeveloperQuery($request->query->get('developer', []));

        $summaryReport = null;
        if ($valid = $analysisQuery->isValid()) {
            $summaryReport = $this->analyzer->analyzeAndBuildSummaryReport($analysisQuery);
        }

        return $this->twig->render(
            'summary_report.html.twig',
            compact('valid', 'summaryReport')
        );

    }
}


text:
export default class Map<T> {
   private items: {[key: string]: T};

   constructor() {
      this.items = {};
   }

   set(key: string, value: T): void {
      this.items[key] = value;
   }

   has(key: string): boolean {
      return key in this.items;
   }

   get(key: string): T {
      return this.items[key];
   }

   delete(key: string): T {
      let T = this.items[key];
      delete this.items[key];
      return T;
   }

   keys(): string[] {
      const array: string[] = [];
      for (const name in this.items) {
         array.push(name);
      }
      return array;
   }

   values(): T[] {
      const array: T[] = [];
      for (const name in this.items) {
         array.push(this.items[name]);
      }
      return array;
   }
}


text:
import { NgModule }            from '@angular/core';
import { BrowserModule  }      from '@angular/platform-browser';
import { AUTH_PROVIDERS }      from 'angular2-jwt';

import { AppComponent }        from './app.component';
import { HomeComponent }       from './Components/homeComponent/home.component';
import { routing,
         appRoutingProviders } from './app.routes';
import {RouterModule} from '@angular/router';
import {dashboardComponent }                from './Components/dashboard/dashboard';
import { UploadModal } from './Modals/UploadModal/uploadModal';
@NgModule({
    declarations: [
        AppComponent,
        HomeComponent,
        dashboardComponent
    ],
    providers:    [
        appRoutingProviders,
        AUTH_PROVIDERS
    ],
    imports:      [
        BrowserModule,
        routing,
    ],
    bootstrap:    [AppComponent],
})
export class AppModule {}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#607D8B</color>
    <color name="colorPrimaryDark">#455A64</color>
    <color name="colorAccent">#FF4081</color>

    <color name="black_overlay">#66000000</color>

    <color name="transparent">#00000000</color>

    <color name="background_normal">#FF4CAF50</color>
    <color name="background_tip">#FFFFEB3B</color>
    <color name="background_waring">#FFF44336</color>
</resources>


text:
// Deployment Framework for BizTalk
// Copyright (C) 2008-14 Thomas F. Abraham, 2004-08 Scott Colestock
// This source file is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html.
// All other rights reserved.

using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;

using log4net;
using log4net.Core;
using log4net.Repository;
using log4net.Repository.Hierarchy;

/*
 * Custom Logging Classes to support serializable loggers
 */
namespace log4net.Ext.Serializable
{
	public class SLogManager
	{
		#region Static Member Variables

		///
		/// The wrapper map to use to hold the <see cref="EventIDLogImpl"/> objects
		///
		private static InjectableWrapperMap s_wrapperMap = new InjectableWrapperMap(new WrapperCreationHandler(WrapperCreationHandler));
		private static ArrayList _createdDomains = new ArrayList();

		#endregion

		#region Constructor

		///
		/// Private constructor to prevent object creation
		///
		private SLogManager() { }

		#endregion

		#region Type Specific Manager Methods

		///
		/// Returns the named logger if it exists
		///
		/// <remarks>
		/// <para>If the named logger exists (in the default hierarchy) then it
		/// returns a reference to the logger, otherwise it returns
		/// <c>null</c>.</para>
		/// </remarks>
		/// <param name="name">The fully qualified logger name to look for</param>
		/// <returns>The logger found, or null</returns>
		public static SLog Exists(string name)
		{
			return Exists(Assembly.GetCallingAssembly(), name);
		}

		///
		/// Returns the named logger if it exists
		///
		/// <remarks>
		/// <para>If the named logger exists (in the specified domain) then it
		/// returns a reference to the logger, otherwise it returns
		/// <c>null</c>.</para>
		/// </remarks>
		/// <param name="domain">the domain to lookup in</param>
		/// <param name="name">The fully qualified logger name to look for</param>
		/// <returns>The logger found, or null</returns>
		public static SLog Exists(string domain, string name)
		{
			return WrapLogger(LoggerManager.Exists(domain, name));
		}

		///
		/// Returns the named logger if it exists
		///
		/// <remarks>
		/// <para>If the named logger exists (in the specified assembly's domain) then it
		/// returns a reference to the logger, otherwise it returns
		/// <c>null</c>.</para>
		/// </remarks>
		/// <param name="assembly">the assembly to use to lookup the domain</param>
		/// <param name="name">The fully qualified logger name to look for</param>
		/// <returns>The logger found, or null</returns>
		public static SLog Exists(Assembly assembly, string name)
		{
			return WrapLogger(LoggerManager.Exists(assembly, name));
		}

		///
		/// Returns all the currently defined loggers in the default domain.
		///
		/// <remarks>
		/// <para>The root logger is not included in the returned array.</para>
		/// </remarks>
		/// <returns>All the defined loggers</returns>
		public static SLog[] GetCurrentLoggers()
		{
			return GetCurrentLoggers(Assembly.GetCallingAssembly());
		}

		///
		/// Returns all the currently defined loggers in the specified domain.
		///
		/// <param name="domain">the domain to lookup in</param>
		/// <remarks>
		/// The root logger is not included in the returned array.
		/// </remarks>
		/// <returns>All the defined loggers</returns>
		public static SLog[] GetCurrentLoggers(string domain)
		{
			return WrapLoggers(LoggerManager.GetCurrentLoggers(domain));
		}

		///
		/// Returns all the currently defined loggers in the specified assembly's domain.
		///
		/// <param name="assembly">the assembly to use to lookup the domain</param>
		/// <remarks>
		/// The root logger is not included in the returned array.
		/// </remarks>
		/// <returns>All the defined loggers</returns>
		public static SLog[] GetCurrentLoggers(Assembly assembly)
		{
			return WrapLoggers(LoggerManager.GetCurrentLoggers(assembly));
		}

		///
		/// Retrieve or create a named logger.
		///
		/// <remarks>
		/// <para>Retrieve a logger named as the <paramref name="name"/>
		/// parameter. If the named logger already exists, then the
		/// existing instance will be returned. Otherwise, a new instance is
		/// created.</para>
		///
		/// <para>By default, loggers do not have a set level but inherit
		/// it from the hierarchy. This is one of the central features of
		/// log4net.</para>
		/// </remarks>
		/// <param name="name">The name of the logger to retrieve.</param>
		/// <returns>the logger with the name specified</returns>
		public static SLog GetLogger(string name)
		{
			return GetLogger(Assembly.GetCallingAssembly(), name);
		}

		///
		/// Retrieve or create a named logger.
		///
		/// <remarks>
		/// <para>Retrieve a logger named as the <paramref name="name"/>
		/// parameter. If the named logger already exists, then the
		/// existing instance will be returned. Otherwise, a new instance is
		/// created.</para>
		///
		/// <para>By default, loggers do not have a set level but inherit
		/// it from the hierarchy. This is one of the central features of
		/// log4net.</para>
		/// </remarks>
		/// <param name="domain">the domain to lookup in</param>
		/// <param name="name">The name of the logger to retrieve.</param>
		/// <returns>the logger with the name specified</returns>
		public static SLog GetLogger(string domain, string name)
		{
			CreateDomainIfNeeded(domain);
			return WrapLogger(LoggerManager.GetLogger(domain, name));
		}

		///
		/// Retrieve or create a named logger.
		///
		/// <remarks>
		/// <para>Retrieve a logger named as the <paramref name="name"/>
		/// parameter. If the named logger already exists, then the
		/// existing instance will be returned. Otherwise, a new instance is
		/// created.</para>
		///
		/// <para>By default, loggers do not have a set level but inherit
		/// it from the hierarchy. This is one of the central features of
		/// log4net.</para>
		/// </remarks>
		/// <param name="assembly">the assembly to use to lookup the domain</param>
		/// <param name="name">The name of the logger to retrieve.</param>
		/// <returns>the logger with the name specified</returns>
		public static SLog GetLogger(Assembly assembly, string name)
		{
			return WrapLogger(LoggerManager.GetLogger(assembly, name));
		}

		///
		/// Shorthand for <see cref="LogManager.GetLogger(string)"/>.
		///
		/// <remarks>
		/// Get the logger for the fully qualified name of the type specified.
		/// </remarks>
		/// <param name="type">The full name of <paramref name="type"/> will
		/// be used as the name of the logger to retrieve.</param>
		/// <returns>the logger with the name specified</returns>
		public static SLog GetLogger(Type type)
		{
			return GetLogger(Assembly.GetCallingAssembly(), type.FullName);
		}

		///
		/// Shorthand for <see cref="LogManager.GetLogger(string)"/>.
		///
		/// <remarks>
		/// Get the logger for the fully qualified name of the type specified.
		/// </remarks>
		/// <param name="domain">the domain to lookup in</param>
		/// <param name="type">The full name of <paramref name="type"/> will
		/// be used as the name of the logger to retrieve.</param>
		/// <returns>the logger with the name specified</returns>
		public static SLog GetLogger(string domain, Type type)
		{
			CreateDomainIfNeeded(domain);
			return WrapLogger(LoggerManager.GetLogger(domain, type));
		}

		///
		/// Shorthand for <see cref="LogManager.GetLogger(string)"/>.
		///
		/// <remarks>
		/// Get the logger for the fully qualified name of the type specified.
		/// </remarks>
		/// <param name="assembly">the assembly to use to lookup the domain</param>
		/// <param name="type">The full name of <paramref name="type"/> will
		/// be used as the name of the logger to retrieve.</param>
		/// <returns>the logger with the name specified</returns>
		public static SLog GetLogger(Assembly assembly, Type type)
		{
			return WrapLogger(LoggerManager.GetLogger(assembly, type));
		}

		#endregion

		#region Extension Handlers

		///
		/// Because LogManager does not offer us a away to determine if a domain has already been created,
		/// we have this helper method to accomplish that.  To avoid relying on an exception being thrown/caught
		/// as the only mechanism for seeing if a logging domain is created, we keep our own list.
		///
		/// <param name="domainName"></param>
		public static void CreateDomainIfNeeded(string domainName)
		{
			try
			{
				if(!_createdDomains.Contains(domainName))
				{
					log4net.LogManager.CreateRepository(domainName);
					_createdDomains.Add(domainName);
				}

			}
			catch (log4net.Core.LogException)
			{
				// Exception is expected if the domain has already been created.
			}
		}

		///
		/// Lookup the wrapper object for the logger specified
		///
		/// <param name="logger">the logger to get the wrapper for</param>
		/// <returns>the wrapper for the logger specified</returns>
		public static SLog WrapLogger(ILogger logger)
		{
			return (SLog)s_wrapperMap[logger];
		}

		///
		/// Lookup the wrapper objects for the loggers specified
		///
		/// <param name="loggers">the loggers to get the wrappers for</param>
		/// <returns>Lookup the wrapper objects for the loggers specified</returns>
		public static SLog[] WrapLoggers(ILogger[] loggers)
		{
			SLog[] results = new SLog[loggers.Length];
			for(int i=0; i<loggers.Length; i++)
			{
				results[i] = WrapLogger(loggers[i]);
			}
			return results;
		}

		///
		/// Method to create the <see cref="ILoggerWrapper"/> objects used by
		/// this manager.
		///
		/// <param name="logger">The logger to wrap</param>
		/// <returns>The wrapper for the logger specified</returns>
		private static ILoggerWrapper WrapperCreationHandler(ILogger logger)
		{
			return new SLog(logger);
		}

		internal static void AddToMap(ILogger logger,SLog logImpl)
		{
			s_wrapperMap[logger] = logImpl;
		}

		#endregion
	}
}


text:
<?php

class Translation_Service_Info {

	function __construct() {

		add_action( 'installer_fetched_subscription_data', array( $this, 'save_info' ), 10, 2 );

	}

	function save_info( $data, $repository_id ) {

		$ts_info = isset( WP_Installer()->settings['repositories'][ $repository_id ]['ts_info'] ) ?
			WP_Installer()->settings['repositories'][ $repository_id ]['ts_info'] : false;

		$save_settings = false;
		if ( isset( $data->ts_info['preferred'] ) && empty( $ts_info['preferred'] ) ) {
			WP_Installer()->settings['repositories'][ $repository_id ]['ts_info']['preferred'] = $data->ts_info['preferred'];
			$save_settings                                                                     = true;
		}

		if ( isset( $data->ts_info['referal'] ) && empty( $ts_info['referal'] ) ) {
			WP_Installer()->settings['repositories'][ $repository_id ]['ts_info']['referal'] = $data->ts_info['referal'];
			$save_settings                                                                   = true;
		}

		if ( ! empty( $data->ts_info['client_id'] ) ) { // can be updated
			WP_Installer()->settings['repositories'][ $repository_id ]['ts_info']['client_id'] = $data->ts_info['client_id'];
			$save_settings                                                                     = true;
		}

		if ( $save_settings ) {
			WP_Installer()->save_settings();
		}

	}

}

new Translation_Service_Info();