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

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.apex</groupId>
    <artifactId>malhar-examples</artifactId>
    <version>4.0.0-SNAPSHOT</version>
  </parent>

  <artifactId>malhar-examples-filter</artifactId>
  <packaging>jar</packaging>

  <!-- change these to the appropriate values -->
  <name>Apache Apex Malhar Filter Example</name>
  <description>Apex application demonstrating filter operator</description>

  <dependencies>
    <dependency>
      <groupId>org.apache.apex</groupId>
      <artifactId>malhar-contrib</artifactId>
      <version>${project.version}</version>
      <!--
           If you know that your application does not need transitive dependencies pulled in by malhar-library,
           uncomment the following to reduce the size of your app package.
      -->
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>net.sf.supercsv</groupId>
      <artifactId>super-csv</artifactId>
      <version>2.4.0</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.apex</groupId>
      <artifactId>apex-engine</artifactId>
      <version>${apex.core.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>commons-compiler</artifactId>
      <version>2.7.8</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>janino</artifactId>
      <version>2.7.8</version>
    </dependency>
  </dependencies>
</project>


text: Check [the demo here](http://www.barbarianmeetscoding.com/LeanUXAtomicDesignAndAngular/)!

redpajama_set_name: RedPajamaGithub


text: A Source code of the Website Spoorthiusha.com


text:
import { createStore, applyMiddleware, compose } from 'redux';
import promiseMiddleware from 'redux-promise';
import thunk from 'redux-thunk';
import createLogger from 'redux-logger';
import undoable from 'redux-undo';
import { reducer } from './reducers';
import { UPDATE_SEARCH_KEYWORD } from './actions';

const process = global.require('process');

let middlewares = [thunk, promiseMiddleware];

if (process.env.NODE_ENV !== "production") {
  middlewares.push(createLogger());
}

var createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore);
export default function configureStore(initialState) {
  const store = createStoreWithMiddleware(undoable(reducer, {
    limit: 10,
    filter: (action, currentState, previousState) => {
      return action.type === UPDATE_SEARCH_KEYWORD;
    }
  }));

  if (module.onReload) {
    module.onReload(() => {
      const nextReducer = undoable(require('./reducers').reducer, {
        limit: 10,
        filter: (action, currentState, previousState) => {
          return action.type === UPDATE_SEARCH_KEYWORD;
        }
      });
      store.replaceReducer(nextReducer);
    });
  }

  return store;
}


text:
<?php

namespace Drupal\Tests\slick\Kernel;

use Drupal\Tests\blazy\Kernel\BlazyKernelTestBase;
use Drupal\Tests\slick\Traits\SlickUnitTestTrait;

/**
 * Tests the Slick field rendering using the image field type.
 *
 * @coversDefaultClass \Drupal\slick\Plugin\Field\FieldFormatter\SlickImageFormatter
 * @group slick
 */
class SlickFormatterTest extends BlazyKernelTestBase {

  use SlickUnitTestTrait;

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = [
    'system',
    'user',
    'field',
    'file',
    'image',
    'filter',
    'node',
    'text',
    'blazy',
    'slick',
    'slick_ui',
    'slick_test',
  ];

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();

    $this->installConfig(static::$modules);
    $this->installEntitySchema('slick');

    $this->testFieldName  = 'field_image_multiple';
    $this->testEmptyName  = 'field_image_multiple_empty';
    $this->testPluginId   = 'slick_image';
    $this->maxItems       = 7;
    $this->maxParagraphs  = 2;
    $this->slickAdmin     = $this->container->get('slick.admin');
    $this->slickManager   = $this->container->get('slick.manager');
    $this->slickFormatter = $this->container->get('slick.formatter');

    $data['fields'] = [
      'field_video'                => 'text',
      'field_image'                => 'image',
      'field_image_multiple_empty' => 'image',
    ];

    // Create contents.
    $bundle = $this->bundle;
    $this->setUpContentTypeTest($bundle, $data);

    $settings = [
      'optionset' => 'test',
      'optionset_thumbnail' => 'test_nav',
    ] + $this->getFormatterSettings();

    $data['settings'] = $settings;
    $this->display = $this->setUpFormatterDisplay($bundle, $data);

    $data['plugin_id'] = $this->testPluginId;
    $this->displayEmpty = $this->setUpFormatterDisplay($bundle, $data);

    $this->formatterInstance = $this->getFormatterInstance();
    $this->skins = $this->slickManager->getSkins();

    $this->setUpContentWithItems($bundle);
    $this->setUpRealImage();
  }

  /**
   * Tests the Slick formatters.
   */
  public function testSlickFormatter() {
    $bundle = $this->bundle;
    $entity = $this->entity;

    // Generate the render array to verify if the cache tags are as expected.
    $build = $this->display->build($entity);
    $build_empty = $this->displayEmpty->build($entity);

    $render = $this->slickManager->getRenderer()->renderRoot($build);
    $this->assertNotEmpty($render);

    $render_empty = $this->slickManager->getRenderer()->renderRoot($build_empty[$this->testEmptyName]);
    $this->assertEmpty($render_empty);

    $this->assertInstanceOf('\Drupal\Core\Field\FieldItemListInterface', $this->testItems);
    $this->assertInstanceOf('\Drupal\slick\Form\SlickAdminInterface', $this->formatterInstance->admin());
    $this->assertInstanceOf('\Drupal\slick\SlickFormatterInterface', $this->formatterInstance->formatter());
    $this->assertInstanceOf('\Drupal\slick\SlickManagerInterface', $this->formatterInstance->manager());

    $component = $this->display->getComponent($this->testFieldName);
    $this->assertEquals($this->testPluginId, $component['type']);
    $this->assertEquals($this->testPluginId, $build[$this->testFieldName]['#formatter']);

    $scopes = $this->formatterInstance->getScopedFormElements();
    $this->assertEquals('slick', $scopes['namespace']);
    $this->assertArrayHasKey('optionset', $scopes['settings']);

    $summary = $this->formatterInstance->settingsSummary();
    $this->assertNotEmpty($summary);
  }

  /**
   * Tests for \Drupal\slick\SlickFormatter::testGetThumbnail().
   *
   * @param string $uri
   *   The uri being tested.
   * @param bool $expected
   *   The expected output.
   *
   * @covers \Drupal\slick\SlickFormatter::getThumbnail
   * @dataProvider providerTestGetThumbnail
   */
  public function testGetThumbnail($uri, $expected) {
    $settings = $this->getFormatterSettings();
    $settings['uri'] = empty($uri) ? '' : $this->uri;

    $thumbnail = $this->slickFormatter->getThumbnail($settings, $this->image);
    $this->assertEquals($expected, !empty($thumbnail));
  }

  /**
   * Provide test cases for ::testGetThumbnail().
   *
   * @return array
   *   An array of tested data.
   */
  public function providerTestGetThumbnail() {
    $data[] = [
      '',
      FALSE,
    ];
    $data[] = [
      'public://example.jpg',
      TRUE,
    ];

    return $data;
  }

  /**
   * Tests for \Drupal\slick\SlickFormatter.
   *
   * @param array $settings
   *   The settings being tested.
   * @param mixed|bool|string $expected
   *   The expected output.
   *
   * @covers \Drupal\slick\SlickFormatter::buildSettings
   * @dataProvider providerTestBuildSettings
   */
  public function testBuildSettings(array $settings, $expected) {
    $format['settings'] = array_merge($this->getFormatterSettings(), $settings);

    $this->slickFormatter->buildSettings($format, $this->testItems);
    $this->assertArrayHasKey('bundle', $format['settings']);
  }

  /**
   * Provide test cases for ::testBuildSettings().
   *
   * @return array
   *   An array of tested data.
   */
  public function providerTestBuildSettings() {
    $breakpoints = $this->getDataBreakpoints(TRUE);

    $data[] = [
      [
        'vanilla'     => TRUE,
        'breakpoints' => [],
      ],
      FALSE,
    ];
    $data[] = [
      [
        'vanilla'     => FALSE,
        'breakpoints' => [],
        'blazy'       => FALSE,
        'ratio'       => 'fluid',
      ],
      TRUE,
    ];
    $data[] = [
      [
        'vanilla'     => FALSE,
        'breakpoints' => $breakpoints,
        'blazy'       => TRUE,
      ],
      TRUE,
    ];

    return $data;
  }

  /**
   * Tests for \Drupal\slick\Form\SlickAdmin.
   *
   * @covers \Drupal\slick\Form\SlickAdmin::buildSettingsForm
   * @covers \Drupal\slick\Form\SlickAdmin::openingForm
   * @covers \Drupal\slick\Form\SlickAdmin::imageStyleForm
   * @covers \Drupal\slick\Form\SlickAdmin::fieldableForm
   * @covers \Drupal\slick\Form\SlickAdmin::mediaSwitchForm
   * @covers \Drupal\slick\Form\SlickAdmin::gridForm
   * @covers \Drupal\slick\Form\SlickAdmin::closingForm
   * @covers \Drupal\slick\Form\SlickAdmin::finalizeForm
   * @covers \Drupal\slick\Form\SlickAdmin::getOverridableOptions
   * @covers \Drupal\slick\Form\SlickAdmin::getLayoutOptions
   * @covers \Drupal\slick\Form\SlickAdmin::getOptionsetsByGroupOptions
   * @covers \Drupal\slick\Form\SlickAdmin::getSkinsByGroupOptions
   * @covers \Drupal\slick\Form\SlickAdmin::getSettingsSummary
   * @covers \Drupal\slick\Form\SlickAdmin::getFieldOptions
   */
  public function testAdminOptions() {
    $definition = $this->getSlickFormatterDefinition();
    $form['test'] = ['#type' => 'hidden'];

    $this->slickAdmin->buildSettingsForm($form, $definition);
    $this->assertArrayHasKey('optionset', $form);

    $options = $this->slickAdmin->getOverridableOptions();
    $this->assertArrayHasKey('arrows', $options);

    $options = $this->slickAdmin->getLayoutOptions();
    $this->assertArrayHasKey('bottom', $options);

    $options = $this->slickAdmin->getOptionsetsByGroupOptions();
    $this->assertArrayHasKey('default', $options);

    $options = $this->slickAdmin->getOptionsetsByGroupOptions('main');
    $this->assertArrayHasKey('test', $options);

    $options = $this->slickAdmin->getSkinsByGroupOptions('main');
    $this->assertArrayHasKey('classic', $options);

    $summary = $this->slickAdmin->getSettingsSummary($definition);
    $this->assertNotEmpty($summary);

    $options = $this->slickAdmin->getFieldOptions([], [], 'node');
    $this->assertArrayHasKey($this->testFieldName, $options);
  }

}


text:
'use strict';
var grunt = require('grunt');

/*
  ======== A Handy Little Nodeunit Reference ========
  https://github.com/caolan/nodeunit

  Test methods:
    test.expect(numAssertions)
    test.done()
  Test assertions:
    test.ok(value, [message])
    test.equal(actual, expected, [message])
    test.notEqual(actual, expected, [message])
    test.deepEqual(actual, expected, [message])
    test.notDeepEqual(actual, expected, [message])
    test.strictEqual(actual, expected, [message])
    test.notStrictEqual(actual, expected, [message])
    test.throws(block, [error], [message])
    test.doesNotThrow(block, [error], [message])
    test.ifError(value)
*/

// module import
var longestPalindrome = require('./solution.js').solution; // output function of problem
var Alert = require('./alert.js'); // alert output module
var Helper = require('./test_helper.js'); // helper module

// Macro
var TEST_EACH_CASE = 1;

// Test Data
var datas = [['a', 'a'],
            ['aba', 'aba'],
            ['aaabba', 'abba'],
            ['aaaaaa', 'aaaaaa'],
            ['abb', 'bb']
            ];

exports.situation = {
    setUp: function (done) {
        // setup here if necessary
        done();
    },

    data_test: function (test) {
        var len = datas.length;
        test.expect(TEST_EACH_CASE * len);
        grunt.log.writeln('Situation test entered');

        for (var i = 0; i < len; i++) {
            // generate the input and target
            var str = datas[i][0];
            var par = datas[i][1];

            var result = longestPalindrome(str);

            test.equal(par, result, Alert.strNotEqual(str, par, result));
        }
        test.done();
    },
};


text:
<?php

namespace tests\Providers;

class Ipv4UrlDataProvider extends AsciiUrlDataProvider {

    public $subdomain = '';
    public $domain = '127.0.0.1';

}


text:
Write games with Javascript code in the browser. Login and save your project.
Share it with others. Discover other's projects, fork them and improve.

Permanently under construction!

Currently not ready for easy game development yet. Feel free to try it anyway and
help us improve.

Try it: http://write-a-game.herokuapp.com

Please find the "Project" menu in the top left corner!

My goal is to make it possible to create games like Pacman with ease.

## How-To

Upload your own image using the Upload feature on the bottom of the page.

Create a game figure and set its position

```js
// Figure with an image
var bird = new Figure("lintu1.png")

// Figure that consists of text
var text = new Figure("Hello world")

// Set position of figure
text.setPos(300, 200)
```

Rotate a figure 1 degree each 10 milliseconds

```js
interval(10, function() {
  text.rotate(1);
})
```

Make a figure move in a circle

```js
interval(10, function() {
  text.rotate(1);
  text.moveForward(1)
})
```

Control a figure based on whether SPACE and A keys are down

```js
interval(100, function() {
  var spaceDown = Keyboard.isKeyDown(Keyboard.SPACE)
  var aDown = Keyboard.isKeyDown("a")
  mila.move({x: spaceDown ? -2 : 2, y: aDown ? 1 : 0})
})
```

Instead of `Keyboard.SPACE` you can use `Keyboard.UP`, `Keyboard.DOWN`, `Keyboard.LEFT`, `Keyboard.RIGHT`
or any plain string, such as `"a"` or `"b"`, as shown in the example above.

Or you can use the `direction()` and `direction2()` functions instead for controlling game figures using
the arrow keys and the WDSA keys respectively.

```js
interval(10, function() {
  mila.move(Keyboard.direction())
  ella.move(Keyboard.direction2())
})
```

Set size of a figure:

```js
figure.setSize(100, 100)
```

Double the size of a figure:

```js
figure.setSize(figure.getSize().times(2))
```

## For developers

Instructions for the developers of the programming environment.

## Build & run

    npm install -g coffee-script
    npm install
    ./server.coffee
    open http://localhost:3000

## What's inside

The main/editor application is in the [editor-app](editor-app) directory, from where the application is built
into the `output` directory using Grunt and [browserify](http://browserify.org/). So have a look at
[Gruntfile](Gruntfile.coffee), [editor-app/app.coffee](editor-app/app.coffee) and
[editor-app/index.html](editor-app/index.html) for starters.

All content is served using an [Express](http://expressjs.com/) server that's bootstrapped
in [server.coffee](server.coffee) and launched on Heroku using [Procfile](Procfile). The server mainly just serves
content from the [output](output) directory but also provides a thin layer on top of a MongoDB server,
where user's applications/games are stored.

The editor application uses the excellent [CodeMirror](http://codemirror.net/) editor for manipulating
Javascript code, which it executes in an `<iframe>` that's reloaded each time the code is run.
The contents to the iframe are served from `output/game` directory and generated from files in
[game-app](game-app) directory. In addition to the static content, the user's uploaded assets (images) are encoded
as Base64 data urls into a `<script>` element and the user's Javascript code is `eval`'ed in the iframe
context.

All code is written in Coffeescript. No frontend frameworks are used. Instead, we rely on libraries
like [JQuery](http://jquery.com/), [lodash](https://lodash.com/) and [Bacon.js](http://baconjs.github.io/).

## Backlog

Things we're going to do next.

- Make menu more inviting, prettier and easier to use
- Autosave to localstorage (smart)
- Collision detection
- Write simple game
- Walls / maze for pacman type games
- Sound effects as assets
- Move assets to menu
- Authentication
- Automatic tests

## Contributing

Please join us!

If you want to contribute, make a [Pull Request](https://github.com/raimohanska/write-a-game/pulls) on Github.
If you have an idea, suggestion or a problem, make an [Issue](https://github.com/raimohanska/write-a-game/issues).


text:
require_relative 'integration_helper'
require 'json'

module OctocatalogDiff
  class Spec
    def self.reference_validation_catalog(role, validations)
      argv = ['--catalog-only', '-n', 'rspec-node.github.net', '--to-fact-override', "reference_validation_role=#{role}"]
      validations.each { |v| argv.concat ['--validate-references', v] }
      OctocatalogDiff::Integration.integration(
        hiera_config: 'hiera.yaml',
        spec_fact_file: 'facts.yaml',
        spec_repo: 'reference-validation',
        argv: argv
      )
    end

    def self.reference_validation_catalog_diff(catalog1, catalog2, validations)
      argv = ['-n', 'rspec-node.github.net', '--no-parallel']
      validations.each { |v| argv.concat ['--validate-references', v] }
      OctocatalogDiff::Integration.integration(
        spec_catalog_old: "reference-validation-#{catalog1}.json",
        spec_catalog_new: "reference-validation-#{catalog2}.json",
        argv: argv
      )
    end

    def self.catalog_contains_resource(result, type, title)
      catalog = OctocatalogDiff::Catalog.create(json: result.output)
      !catalog.resource(type: type, title: title).nil?
    end
  end
end

describe 'validation specifically disabled' do
  before(:all) do
    argv = ['--catalog-only', '-n', 'rspec-node.github.net', '--no-validate-references']
    @result = OctocatalogDiff::Integration.integration(
      hiera_config: 'hiera.yaml',
      spec_fact_file: 'facts.yaml',
      spec_repo: 'reference-validation',
      argv: argv
    )
  end

  it 'should return the valid catalog' do
    expect(@result.exitcode).to eq(0), OctocatalogDiff::Integration.format_exception(@result)
  end
end

describe 'validation of sample catalog' do
  before(:all) do
    @result = OctocatalogDiff::Spec.reference_validation_catalog('valid', [])
  end

  it 'should return the valid catalog' do
    expect(@result.exitcode).to eq(0)
  end

  it 'should not raise any exceptions' do
    expect(@result.exception).to be_nil, OctocatalogDiff::Integration.format_exception(@result)
  end

  it 'should contain representative resources' do
    pending 'Catalog failed' unless @result.exitcode.zero?
    expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'File', '/tmp/test-main')).to eq(true)
  end
end

describe 'validation of references in computed catalog' do
  context 'with valid catalog' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('all', %w(before require subscribe notify))
    end

    it 'should succeed' do
      expect(@result.exitcode).to eq(0)
    end

    it 'should not raise any exceptions' do
      expect(@result.exception).to be_nil, OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should contain representative resources' do
      pending 'Catalog failed' unless @result.exitcode.zero?
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'Exec', 'subscribe caller 1')).to eq(true)
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'Exec', 'subscribe target')).to eq(true)
    end
  end

  context 'with valid files that have trailing slashes' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('working-file', %w(require))
    end

    it 'should succeed' do
      expect(@result.exitcode).to eq(0)
    end

    it 'should not raise any exceptions' do
      expect(@result.exception).to be_nil, OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should contain representative resources' do
      pending 'Catalog failed' unless @result.exitcode.zero?
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'File', '/foo')).to eq(true)
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'File', '/bar')).to eq(true)
    end
  end

  context 'with broken subscribe' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('broken-subscribe', %w(subscribe))
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    if OctocatalogDiff::Spec.major_version >= 5
      it 'should pass through the error messages from Puppet' do
        msg = @result.exception.message
        expect(msg).to match(/Error: Could not find resource 'Exec\[subscribe target\]' in parameter 'subscribe'/)
      end
    else
      # Multiple line numbers given because Puppet 4.x and 3.8 correspond to first and last line of resource, respectively.
      # rubocop:disable Metrics/LineLength
      it 'should have formatted error messages' do
        msg = @result.exception.message
        expect(msg).to match(%r{exec\[subscribe caller 1\]\(modules/test/manifests/subscribe_callers.pp:(2|5)\) -> subscribe\[Exec\[subscribe target\]\]})
        expect(msg).to match(%r{exec\[subscribe caller 2\]\(modules/test/manifests/subscribe_callers.pp:(7|13)\) -> subscribe\[Exec\[subscribe target\]\]})
        expect(msg).to match(%r{exec\[subscribe caller 2\]\(modules/test/manifests/subscribe_callers.pp:(7|13)\) -> subscribe\[Exec\[subscribe target 2\]\]})
        expect(msg).to match(%r{exec\[subscribe caller 3\]\(modules/test/manifests/subscribe_callers.pp:(15|21)\) -> subscribe\[Exec\[subscribe target\]\]})
        expect(msg).not_to match(/exec\[subscribe caller 3\].+subscribe\[Exec\[subscribe caller 1\]\]/)
      end
      # rubocop:enable Metrics/LineLength
    end
  end

  context 'with broken before' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('broken-before', %w(before))
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    if OctocatalogDiff::Spec.major_version >= 5
      it 'should pass through the error messages from Puppet' do
        msg = @result.exception.message
        expect(msg).to match(/Error: Could not find resource 'Exec\[before target\]' in parameter 'before'/)
      end
    else
      # rubocop:disable Metrics/LineLength
      it 'should have formatted error messages' do
        msg = @result.exception.message
        expect(msg).to match(%r{Catalog has broken reference: exec\[before caller\]\(modules/test/manifests/before_callers.pp:(2|5)\) -> before\[Exec\[before target\]\]})
      end
      # rubocop:enable Metrics/LineLength
    end
  end

  context 'with broken notify' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('broken-notify', %w(notify))
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    if OctocatalogDiff::Spec.major_version >= 5
      it 'should pass through the error messages from Puppet' do
        msg = @result.exception.message
        expect(msg).to match(/Error: Could not find resource 'Test::Foo::Bar\[notify target\]' in parameter 'notify'/)
      end
    else
      # rubocop:disable Metrics/LineLength
      it 'should have formatted error messages' do
        msg = @result.exception.message
        expect(msg).to match(%r{exec\[notify caller\]\(modules/test/manifests/notify_callers.pp:(2|4)\) -> notify\[Test::Foo::Bar\[notify target\]\]})
      end
      # rubocop:enable Metrics/LineLength
    end
  end

  context 'with broken require' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('broken-require', %w(require))
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    if OctocatalogDiff::Spec.major_version >= 5
      it 'should pass through the error messages from Puppet' do
        msg = @result.exception.message
        expect(msg).to match(/Error: Could not find resource 'Exec\[require target\]' in parameter 'require'/)
      end
    else
      # rubocop:disable Metrics/LineLength
      it 'should have formatted error messages' do
        msg = @result.exception.message
        expect(msg).to match(%r{exec\[require caller\]\(modules/test/manifests/require_callers.pp:(2|5)\) -> require\[Exec\[require target\]\]})
        expect(msg).to match(%r{exec\[require caller 3\]\(modules/test/manifests/require_callers.pp:(12|18)\) -> require\[Exec\[require target\]\]})
        expect(msg).to match(%r{exec\[require caller 4\]\(modules/test/manifests/require_callers.pp:(12|18)\) -> require\[Exec\[require target\]\]})
        expect(msg).not_to match(/exec\[require caller 2\]/)
        expect(msg).not_to match(/-> require\[Exec\[require caller\]\]/)
      end
      # rubocop:enable Metrics/LineLength
    end
  end

  context 'with broken subscribe but subscribe not checked' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('broken-subscribe', %w(before notify require))
    end

    if OctocatalogDiff::Spec.major_version >= 5
      it 'should raise CatalogError' do
        expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
      end

      it 'should pass through the error messages from Puppet' do
        msg = @result.exception.message
        expect(msg).to match(/Error: Could not find resource 'Exec\[subscribe target\]' in parameter 'subscribe'/)
      end
    else
      it 'should succeed' do
        expect(@result.exitcode).to eq(0), OctocatalogDiff::Integration.format_exception(@result)
      end

      it 'should not raise error' do
        expect(@result.exception).to be_nil
      end
    end
  end
end

describe 'validation of alias references' do
  context 'with valid catalog' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('working-alias', %w(before require subscribe notify))
    end

    it 'should succeed' do
      expect(@result.exitcode).to eq(0)
    end

    it 'should not raise any exceptions' do
      expect(@result.exception).to be_nil, OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should contain representative resources' do
      pending 'Catalog failed' unless @result.exitcode.zero?
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'Exec', 'before alias caller')).to eq(true)
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'Exec', 'before alias target')).to eq(true)
      expect(OctocatalogDiff::Spec.catalog_contains_resource(@result, 'Exec', 'the before alias target')).to eq(true)
    end
  end

  context 'with broken references' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog('broken-alias', %w(before require subscribe notify))
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    if OctocatalogDiff::Spec.major_version >= 5
      it 'should pass through the error messages from Puppet' do
        msg = @result.exception.message
        expect(msg).to match(/Error: Could not find resource 'Exec\[before alias target\]' in parameter 'before'/)
      end
    else
      # rubocop:disable Metrics/LineLength
      it 'should have formatted error messages' do
        msg = @result.exception.message
        expect(msg).to match(%r{exec\[before alias caller\]\(modules/test/manifests/alias_callers.pp:(2|5)\) -> before\[Exec\[before alias target\]\]})
        expect(msg).to match(%r{exec\[notify alias caller\]\(modules/test/manifests/alias_callers.pp:(7|10)\) -> before\[Exec\[notify alias target\]\]})
        expect(msg).to match(%r{exec\[require alias caller\]\(modules/test/manifests/alias_callers.pp:(12|15)\) -> before\[Exec\[require alias target\]\]})
        expect(msg).to match(%r{exec\[subscribe alias caller\]\(modules/test/manifests/alias_callers.pp:(17|20)\) -> before\[Exec\[subscribe alias target\]\]})
      end
      # rubocop:enable Metrics/LineLength
    end
  end
end

# There are no conditionals for puppet 5 here, because all of these catalogs come from JSON
# files and not from actual puppet compilations.
describe 'validation of references in catalog-diff' do
  context 'with valid catalog' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog_diff(
        'ok',
        'ok-2',
        %w(before notify require subscribe)
      )
    end

    it 'should succeed' do
      expect(@result.exitcode).to eq(2), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should not raise error' do
      expect(@result.exception).to be_nil
    end

    it 'should have expected diffs' do
      diffs = @result.diffs
      expect(diffs).to be_a_kind_of(Array)
      expect(diffs.size).to eq(1)
      resource = { diff_type: '-', type: 'Exec', title: 'before caller' }
      expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true)
    end
  end

  context 'with broken references in to-catalog' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog_diff(
        'ok',
        'broken',
        %w(before notify require subscribe)
      )
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    # rubocop:disable Metrics/LineLength
    it 'should have formatted error messages' do
      msg = @result.exception.message
      expect(msg).to match(%r{exec\[subscribe caller 1\]\(.+/modules/test/manifests/subscribe_callers.pp:(2|5)\) -> subscribe\[Exec\[subscribe target\]\]})
      expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:(7|13)\) -> subscribe\[Exec\[subscribe target\]\]})
      expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:(7|13)\) -> subscribe\[Exec\[subscribe target 2\]\]})
      expect(msg).to match(%r{exec\[subscribe caller 3\]\(.+/modules/test/manifests/subscribe_callers.pp:(15|21)\) -> subscribe\[Exec\[subscribe target\]\]})
    end
    # rubocop:enable Metrics/LineLength
  end

  context 'with broken references in from-catalog' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog_diff(
        'broken',
        'ok',
        %w(before notify require subscribe)
      )
    end

    it 'should succeed' do
      expect(@result.exitcode).to eq(2), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should not raise error' do
      expect(@result.exception).to be_nil
    end
  end

  context 'with broken references in from- and to- catalogs' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog_diff(
        'broken-2',
        'broken',
        %w(before notify require subscribe)
      )
    end

    it 'should not succeed' do
      expect(@result.exitcode).to eq(-1), @result.logs
    end

    it 'should raise CatalogError' do
      expect(@result.exception).to be_a_kind_of(OctocatalogDiff::Errors::CatalogError)
    end

    # rubocop:disable Metrics/LineLength
    it 'should have formatted error messages from to-catalog only' do
      msg = @result.exception.message
      expect(msg).to match(%r{exec\[subscribe caller 1\]\(.+/modules/test/manifests/subscribe_callers.pp:(2|5)\) -> subscribe\[Exec\[subscribe target\]\]})
      expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:(7|13)\) -> subscribe\[Exec\[subscribe target\]\]})
      expect(msg).to match(%r{exec\[subscribe caller 2\]\(.+/modules/test/manifests/subscribe_callers.pp:(7|13)\) -> subscribe\[Exec\[subscribe target 2\]\]})
      expect(msg).to match(%r{exec\[subscribe caller 3\]\(.+/modules/test/manifests/subscribe_callers.pp:(15|21)\) -> subscribe\[Exec\[subscribe target\]\]})
      expect(msg).not_to match(/require target/)
    end
    # rubocop:enable Metrics/LineLength
  end

  context 'with broken references, but checking not enabled' do
    before(:all) do
      @result = OctocatalogDiff::Spec.reference_validation_catalog_diff(
        'broken',
        'broken-2',
        %w()
      )
    end

    it 'should succeed' do
      expect(@result.exitcode).to eq(2), OctocatalogDiff::Integration.format_exception(@result)
    end

    it 'should not raise error' do
      expect(@result.exception).to be_nil
    end
  end
end


text:
package org.wildfly.security.audit;

import java.io.Closeable;
import java.io.IOException;

import org.wildfly.common.function.ExceptionBiConsumer;

/**
 * An endpoint that receives audit messages.
 *
 * @author Darran Lofthouse
 */
@FunctionalInterface
public interface AuditEndpoint extends ExceptionBiConsumer<EventPriority, String, IOException>, Closeable {

    /**
     * Close the endpoint and stop handling further events immediately.
     *
     * @throws IOException if an error occurs closing the endpoint.
     */
    default void close() throws IOException {}

}


text:
package mods.belgabor.amtweaker.mods.emt.configuration;

import cpw.mods.fml.common.registry.GameRegistry;
import defeatedcrow.addonforamt.economy.api.order.IOrder;
import defeatedcrow.addonforamt.economy.api.order.OrderBiome;
import defeatedcrow.addonforamt.economy.api.order.OrderSeason;
import defeatedcrow.addonforamt.economy.api.order.OrderType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;

/**
 * Created by Belgabor on 27.05.2016.
 */
public class OrderData {
    public String request = "";
    public Integer amount = 0;
    public Integer reward = 0;
    public String type = "";
    public String season = "none";
    public String biome = "none";
    public String name = "";

    public OrderData(IOrder order) {
        Object req = order.getRequest();
        if (req instanceof String) {
            request = (String) req;
        } else if (req instanceof ItemStack) {
            ItemStack item = (ItemStack) req;
            request = String.format("%s:%d", Item.itemRegistry.getNameForObject(item.getItem()), item.getItemDamage());
        } else {
            request = "INVALID";
        }
        amount = order.getRequestNum();
        reward = order.getReward();
        type = getTypeName(order.getType());
        season = getSeasonName(order.getSeason());
        biome = getBiomeTypeName(order.getBiome());
        name = order.getName();
    }

    public OrderType getType() {
        switch (type) {
            case "single":
                return OrderType.SINGLE;
            case "short":
                return OrderType.SHORT;
            case "middle":
                return OrderType.MIDDLE;
            case "long":
                return OrderType.LONG;
            default:
                return null;
        }
    }

    public OrderSeason getSeason() {
        if (season == null)
            return OrderSeason.NONE;
        switch (season) {
            case "spring":
                return OrderSeason.SPRING;
            case "summer":
                return OrderSeason.SUMMER;
            case "autumn":
                return OrderSeason.AUTUMN;
            case "winter":
                return OrderSeason.WINTER;
            case "none":
                return OrderSeason.NONE;
            default:
                return null;
        }
    }

    public OrderBiome getBiome() {
        if (biome == null)
            return OrderBiome.NONE;
        switch (biome) {
            case "plane":
                return OrderBiome.PLANE;
            case "cold":
                return OrderBiome.COLD;
            case "arid":
                return OrderBiome.ARID;
            case "damp":
                return OrderBiome.DAMP;
            case "hell":
                return OrderBiome.HELL;
            case "none":
                return OrderBiome.NONE;
            default:
                return null;
        }
    }

    public Object getRequest() {
        if (request.equals(""))
            return null;
        if (request.contains(":")) {
            String[] split = request.split(":");
            if (split.length !=3)
                return null;
            Item item = GameRegistry.findItem(split[0], split[1]);
            int m;
            try {
                m = Integer.parseInt(split[2]);
            } catch (NumberFormatException e) {
                return null;
            }
            if (item != null)
                return new ItemStack(item, 1, m);
        } else {
            if (OreDictionary.doesOreNameExist(request)) {
                return request;
            }
        }
        return null;
    }

    public static String getBiomeTypeName(OrderBiome biome) {
        switch (biome) {
            case ARID:
                return "arid";
            case COLD:
                return "cold";
            case DAMP:
                return "damp";
            case HELL:
                return "hell";
            case PLANE:
                return "plane";
            case NONE:
                return "none";
            default:
                return "UNKNOWN";
        }
    }

    public static String getSeasonName(OrderSeason season) {
        switch (season) {
            case AUTUMN:
                return "autumn";
            case SPRING:
                return "spring";
            case SUMMER:
                return "summer";
            case WINTER:
                return "winter";
            case NONE:
                return "none";
            default:
                return "UNKNOWN";
        }
    }

    public static String getTypeName(OrderType type) {
        switch (type) {
            case SINGLE:
                return "single";
            case SHORT:
                return "short";
            case MIDDLE:
                return "middle";
            case LONG:
                return "long";
            default:
                return "UNKNOWN";
        }
    }
}


text:
package consulo.builtInServer.json;

import com.google.gson.Gson;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.util.ExceptionUtil;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.QueryStringDecoder;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @author VISTALL
 * @since 27.10.2015
 */
public abstract class JsonPostRequestHandler<Request> extends JsonBaseRequestHandler {
  private Class<Request> myRequestClass;

  protected JsonPostRequestHandler(@Nonnull String apiUrl, @Nonnull Class<Request> requestClass) {
    super(apiUrl);
    myRequestClass = requestClass;
  }

  @Nonnull
  @Override
  protected HttpMethod getMethod() {
    return HttpMethod.POST;
  }

  @Nonnull
  public abstract JsonResponse handle(@Nonnull Request request);

  @Nonnull
  public Class<Request> getRequestClass() {
    return myRequestClass;
  }

  @Override
  public boolean process(@Nonnull QueryStringDecoder urlDecoder, @Nonnull FullHttpRequest request, @Nonnull ChannelHandlerContext context) throws IOException {
    Object handle = null;
    try {
      String json = request.content().toString(StandardCharsets.UTF_8);

      final Request body = new Gson().fromJson(json, myRequestClass);

      handle = handle(body);
    }
    catch (Exception e) {
      handle = JsonResponse.asError(ExceptionUtil.getThrowableText(e));
    }
    return writeResponse(handle, request, context);
  }
}


text:
package com.github.srec.rec.component;

import com.github.srec.command.method.MethodCallEventCommand;
import com.github.srec.rec.EventRecorder;
import com.github.srec.util.Utils;
import org.apache.log4j.Logger;

import javax.swing.*;
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.awt.event.AWTEventListener;
import java.awt.event.KeyEvent;
import java.util.HashMap;
import java.util.Map;

import static com.github.srec.util.Utils.createParameterMap;

/**
 * Understands recording text entered in text fields.
 *
 * @author Vivek Prahlad
 * @author Victor Tatai
 */
public class TextFieldRecorder extends AbstractComponentRecorder {
    private static final Logger logger = Logger.getLogger(TextFieldRecorder.class);
    private Map<JTextComponent, DocumentListener> listenerMap = new HashMap<JTextComponent, DocumentListener>();
    private ComponentVisibility visibility;

    public TextFieldRecorder(EventRecorder recorder, ComponentVisibility visibility) {
        super(recorder, JTextField.class);
        this.visibility = visibility;
    }

    @Override
    public void register() {
        super.register();
        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
            @Override
            public void eventDispatched(AWTEvent event) {
                if (event.getID() != KeyEvent.KEY_TYPED) return;
                if (!(event.getSource() instanceof JTextField)) return;
                JTextField tf = (JTextField) event.getSource();
                String locator = getLocator(tf);
                if (locator == null) return;
                logger.debug("TextField event registered: '" + locator + "', value: '" + tf.getText() + "'");
                if (((KeyEvent) event).getKeyChar() == '\t') {
                    recorder.record(new MethodCallEventCommand("type_special", tf, null,
                            createParameterMap("locator", locator, "text", "Tab")));
                } else {
                    recorder.record(new MethodCallEventCommand("type", tf, null, createParameterMap(
                            "locator", locator, "text", tf.getText() + ((KeyEvent) event).getKeyChar()), true));
                }
            }
        }, AWTEvent.KEY_EVENT_MASK);
    }

    private String getLocator(JTextField tf) {
        if (!visibility.isShowingAndHasFocus(tf)) return null;
        String locator = Utils.getLocator(tf);
        if (locator == null) {
            logger.warn("No locator could be determined for text field");
            return null;
        }
        return locator;
    }

    void componentShown(Component component) {
    }

    void componentHidden(Component component) {
    }

    private JTextComponent textField(Component component) {
        return (JTextComponent) component;
    }
}


text:
using System;
using System.Collections.Generic;
using OpenQA.Selenium.Remote;

namespace Stubbornium.Configuration
{
    public class StubbornConfiguration
    {
        public static StubbornConfiguration Default { get; } = new StubbornConfiguration();

        public List<Action<RemoteWebDriver>> BeforeDoActions { get; } = new List<Action<RemoteWebDriver>>();

        public List<Action<RemoteWebDriver>> BetweenDoActions { get; } = new List<Action<RemoteWebDriver>>();

        public ILogger Log { get; set; } = new EmptyLogger();
    }
}


text:
<?php

namespace Ifschleife\Bundle\AutowiringBundle\DependencyInjection;

use Ifschleife\Bundle\AutowiringBundle\Autowiring\ServiceBuilder;

use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Finder\Finder;

/**
 * IfschleifeAutowiringExtension.
 *
 * @author joshi
 */
class AutowiringExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $loader->load('autowiring.xml');

        $processor = new Processor();

        $bundles = $container->getParameter('kernel.bundles');

        $configuration = new Configuration($container->getParameter('kernel.debug'), $bundles);

        $config = $processor->processConfiguration($configuration, $configs);

        $container->setParameter('autowiring.config.enabled', $config['enabled']);

        $container->setParameter('autowiring.config.build_definitions.enabled', $config['build_definitions']['enabled']);
        $container->setParameter('autowiring.config.build_definitions.paths', $config['build_definitions']['paths']);

        $container->setParameter('autowiring.config.property_injection.enabled', $config['property_injection']['enabled']);
        $container->setParameter('autowiring.config.property_injection.wire_by_name', $config['property_injection']['wire_by_name']);
        $container->setParameter('autowiring.config.property_injection.service_name_suffix', $config['property_injection']['service_name_suffix']);
        $container->setParameter('autowiring.config.property_injection.parameter_name_suffix', $config['property_injection']['service_name_suffix']);

        $container->setParameter('autowiring.config.setter_injection.enabled', $config['setter_injection']['enabled']);
        $container->setParameter('autowiring.config.setter_injection.wire_by_type', $config['setter_injection']['wire_by_type']);

        $container->setParameter('autowiring.config.constructor_injection.enabled', $config['constructor_injection']['enabled']);
        $container->setParameter('autowiring.config.constructor_injection.wire_by_type', $config['constructor_injection']['wire_by_type']);

        $this->loadServices($container, $bundles);
    }

    /**
     * Loads the @Service defined services.
     * @todo configure this stuff.
     */
    public function loadServices(ContainerBuilder $container, array $bundles)
    {
        if($container->getParameter('autowiring.config.enabled') && $container->getParameter('autowiring.config.build_definitions.enabled'))
        {
            $serviceBuilder = $container->get('autowiring.service_builder');

            $iterator = new \AppendIterator();

            foreach($container->getParameter('autowiring.config.build_definitions.paths') as $parameters)
            {
                $iterator->append($this->loadPath($parameters['pathname'], $parameters['recursive'], array_key_exists('filename_pattern', $parameters) ? $parameters['filename_pattern'] : null));
            }
            $serviceBuilder->setFiles($iterator);
            $serviceBuilder->build();
        }
    }

    /**
     * Loads a path to register as services.
     *
     * @param string $path: An absolute path
     * @param boolean $recursive: Whether to search subdirectories
     * @param string $filename_pattern: A regular expression/glob filename pattern.
     * @return Iterator
     */
    private function loadPath($path, $recursive = null, $filename_pattern = null)
    {
        if(is_dir($path))
        {
            $finder = new Finder();
            $finder->files()->in($path)->name($filename_pattern);

            if( ! $recursive)
            {
              $finder->depth(0);
            }

            return $finder->getIterator();
        }
        elseif(is_file($path))
        {
            return new \ArrayIterator(array($path));
        }

        throw new Loader\FileNotFoundException(sprintf('File or directory "%s" could not be found or is read protected.', $path));
    }

    /**
     * Returns the base path for the XSD files.
     *
     * @return string The XSD base path
     */
    public function getXsdValidationBasePath()
    {
        return __DIR__ . '/../Resources/config/schema';
    }

    /**
     * Returns the configuration extension namespace.
     *
     * @return string
     */
    public function getNamespace()
    {
        return 'http://ifschleife.de/schema/dic/autowiring';
    }
}


text:
module Web.Socdiff.LinkedIn.LinkedIn where

import qualified Data.Text as T
import Haxl.Core
import Web.Socdiff.LinkedIn.DataSource

-- | Get a list of connection names for the given username.
getConnections :: T.Text -> GenHaxl u [T.Text]
getConnections u = dataFetch (GetConnections u)


text:
/*
 *  This file is automatically generated and does not require a license
 *
 *  ==== WARNING: CHANGES TO THIS GENERATED FILE WILL BE OVERWRITTEN ====
 *
 *  To make changes to the generated code, use the space between existing
 *      "USER CODE START (section: <name>)"
 *  and
 *      "USER CODE END (section: <name>)"
 *  comments, where <name> is a single word identifying the section.
 *  Only these sections will be preserved.
 *
 *  Do not move these sections within this file or change the START and
 *  END comments in any way.
 *  ==== ALL OTHER CHANGES WILL BE OVERWRITTEN WHEN IT IS REGENERATED ====
 *
 *  This file was generated from
 *      C:/ti/grace_2_20_01_12/packages/ti/mcu/msp430/csl/system/templates/System_2xx_init.xdt
 */

#include <msp430.h>

/* USER CODE START (section: System_init_c_prologue) */
/* User defined includes, defines, global variables and functions */
/* USER CODE END (section: System_init_c_prologue) */

/*
 *  ======== System_graceInit ========
 *  Initialize MSP430 Status Register
 */
void System_graceInit(void)
{
    /* USER CODE START (section: System_graceInit_prologue) */
    /* User initialization code */
    /* USER CODE END (section: System_graceInit_prologue) */

    /*
     * IFG2, Interrupt Flag Register 2
     *
     * ~UCB0TXIFG -- No interrupt pending
     * ~UCB0RXIFG -- No interrupt pending
     * ~UCA0TXIFG -- No interrupt pending
     * UCA0RXIFG -- Interrupt pending
     *
     * Note: ~<BIT> indicates that <BIT> has value zero
     */
    IFG2 &= ~(UCA0RXIFG);

    /*
     * IE2, Interrupt Enable Register 2
     *
     * ~UCB0TXIE -- Interrupt disabled
     * ~UCB0RXIE -- Interrupt disabled
     * ~UCA0TXIE -- Interrupt disabled
     * UCA0RXIE -- Interrupt enabled
     *
     * Note: ~<BIT> indicates that <BIT> has value zero
     */
    IE2 |= UCA0RXIE;

    /*
     * SR, Status Register
     *
     * ~SCG1 -- Disable System clock generator 1
     * ~SCG0 -- Disable System clock generator 0
     * ~OSCOFF -- Oscillator On
     * ~CPUOFF -- CPU On
     * GIE -- General interrupt enable
     *
     * Note: ~<BIT> indicates that <BIT> has value zero
     */
    __bis_SR_register(GIE);

    /* USER CODE START (section: System_graceInit_epilogue) */
    /* User code */
    /* USER CODE END (section: System_graceInit_epilogue) */
}


text:
file '/etc/motd' do
   content node['motd']['sysadmin']
   mode '644'
   owner 'root'
   group 'root'
end


text:
package manifold.api.fs.def;

import java.io.File;
import java.io.IOException;
import java.net.JarURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import manifold.api.fs.IDirectory;
import manifold.api.fs.IFile;
import manifold.api.fs.IFileSystem;
import manifold.api.fs.IResource;
import manifold.api.fs.jar.JarFileDirectoryImpl;
import manifold.api.fs.url.URLFileImpl;
import manifold.api.host.IManifoldHost;
import manifold.api.service.BaseService;
import manifold.rt.api.util.ManStringUtil;

public class FileSystemImpl extends BaseService implements IFileSystem
{
  private final IManifoldHost _host;
  private Map<File, IDirectory> _cachedDirInfo;
  private CachingMode _cachingMode;

  private FileSystemImpl.IDirectoryResourceExtractor _iDirectoryResourceExtractor;
  private FileSystemImpl.IFileResourceExtractor _iFileResourceExtractor;

  private final ReentrantLock _lock;

  public FileSystemImpl( IManifoldHost host, CachingMode cachingMode )
  {
    _host = host;
    _cachedDirInfo = new HashMap<>();
    _cachingMode = cachingMode;
    _iDirectoryResourceExtractor = new IDirectoryResourceExtractor();
    _iFileResourceExtractor = new IFileResourceExtractor();
    _lock = new ReentrantLock();
  }

  public IManifoldHost getHost()
  {
    return _host;
  }

  @Override
  public IDirectory getIDirectory( File dir )
  {
    if( dir == null )
    {
      return null;
    }

    dir = normalizeFile( dir );

    IDirectory directory = _cachedDirInfo.get( dir );
    if( directory == null )
    {
      _lock.lock();
      try
      {
        directory = _cachedDirInfo.get( dir );
        if( directory == null )
        {
          directory = createDir( dir );
          _cachedDirInfo.put( dir, directory );
        }
      }
      finally
      {
        _lock.unlock();
      }
    }
    return directory;
  }

  @Override
  public IFile getIFile( File file )
  {
    return file == null ? null : new JavaFileImpl( this, normalizeFile( file ) );
  }

  private static File normalizeFile( File file )
  {
    String absolutePath = file.getAbsolutePath();
    List<String> components = new ArrayList<>();

    boolean reallyNormalized = false;
    int lastIndex = 0;
    for( int i = 0; i < absolutePath.length(); i++ )
    {
      char c = absolutePath.charAt( i );
      if( c == '/' || c == '\\' )
      {
        String component = absolutePath.substring( lastIndex, i );
        if( component.equals( "." ) )
        {
          reallyNormalized = true;
        }
        else if( component.equals( ".." ) )
        {
          components.remove( components.size() - 1 );
          reallyNormalized = true;
        }
        else
        {
          components.add( component );
        }
        lastIndex = i + 1;
      }
    }

    String component = absolutePath.substring( lastIndex );
    if( component.equals( "." ) )
    {
      reallyNormalized = true;
    }
    else if( component.equals( ".." ) )
    {
      components.remove( components.size() - 1 );
      reallyNormalized = true;
    }
    else
    {
      components.add( component );
    }

    return reallyNormalized ? new File( ManStringUtil.join( components, "/" ) ) : file;
  }

  @Override
  public void setCachingMode( CachingMode cachingMode )
  {
    _lock.lock();
    try
    {
      _cachingMode = cachingMode;
      for( IDirectory dir: _cachedDirInfo.values() )
      {
        if( dir instanceof JavaDirectoryImpl )
        {
          ((JavaDirectoryImpl)dir).setCachingMode( cachingMode );
        }
      }
    }
    finally
    {
      _lock.unlock();
    }
  }

  private IDirectory createDir( File dir )
  {
    // PL-21817 in OSGi/Equinox JAR could be named as "bundlefile"
    if( (dir.getName().toLowerCase().endsWith( ".jar" ) || dir.getName().toLowerCase().endsWith( ".zip" ) || dir.getName().equals( "bundlefile" )) && dir.isFile() )
    {
      return new JarFileDirectoryImpl( this, dir );
    }
    else
    {
      return new JavaDirectoryImpl( this, dir, _cachingMode );
    }
  }

  public void clearAllCaches()
  {
    _lock.lock();
    try
    {
      for( IDirectory dir: _cachedDirInfo.values() )
      {
        dir.clearCaches();
      }
    }
    finally
    {
      _lock.unlock();
    }
  }

  static boolean isDirectory( File f )
  {
    return f.isDirectory();
  }

  @Override
  public IDirectory getIDirectory( URL url )
  {
    if( url == null )
    {
      return null;
    }

    return _iDirectoryResourceExtractor.getClassResource( url );
  }

  @Override
  public IFile getIFile( URL url )
  {
    if( url == null )
    {
      return null;
    }

    return _iFileResourceExtractor.getClassResource( url );
  }

  @Override
  public ReentrantLock getLock()
  {
    return _lock;
  }

  private abstract class ResourceExtractor<J extends IResource>
  {
    J getClassResource( URL _url )
    {
      if( _url == null )
      {
        return null;
      }

      switch( _url.getProtocol() )
      {
        case "file":
          return getIResourceFromJavaFile( _url );

        case "jar":
        {
          JarURLConnection urlConnection;
          URL jarFileUrl;
          try
          {
            urlConnection = (JarURLConnection)_url.openConnection();
            jarFileUrl = urlConnection.getJarFileURL();
          }
          catch( IOException e )
          {
            throw new RuntimeException( e );
          }
          File dir = new File( jarFileUrl.getFile() );

          IDirectory jarFileDirectory;

          jarFileDirectory = _cachedDirInfo.get( dir );
          if( jarFileDirectory == null )
          {
            _lock.lock();
            try
            {
              jarFileDirectory = _cachedDirInfo.get( dir );
              if( jarFileDirectory == null )
              {
                jarFileDirectory = createDir( dir );
                _cachedDirInfo.put( dir, jarFileDirectory );
              }
            }
            finally
            {
              _lock.unlock();
            }
          }

          return getIResourceFromJarDirectoryAndEntryName( jarFileDirectory, urlConnection.getEntryName() );
        }

        case "http":
        {
          J res = getIResourceFromURL( _url );
          if( res != null )
          {
            return res;
          }
          break;
        }
      }
      throw new RuntimeException( "Unrecognized protocol: " + _url.getProtocol() );
    }

    abstract J getIResourceFromURL( URL location );

    abstract J getIResourceFromJarDirectoryAndEntryName( IDirectory jarFS, String entryName );

    abstract J getIResourceFromJavaFile( URL location );

    File getFileFromURL( URL url )
    {
      try
      {
        URI uri = url.toURI();
        if( uri.getFragment() != null )
        {
          uri = new URI( uri.getScheme(), uri.getSchemeSpecificPart(), null );
        }
        return new File( uri );
      }
      catch( URISyntaxException ex )
      {
        throw new RuntimeException( ex );
      }
      catch( IllegalArgumentException ex )
      {
        // debug getting IAE only in TH - unable to parse URL with fragment identifier
        throw new IllegalArgumentException( "Unable to parse URL " + url.toExternalForm(), ex );
      }
    }

  }

  private class IFileResourceExtractor extends ResourceExtractor<IFile>
  {

    IFile getIResourceFromJarDirectoryAndEntryName( IDirectory jarFS, String entryName )
    {
      return jarFS.file( entryName );
    }

    IFile getIResourceFromJavaFile( URL location )
    {
      return getHost().getFileSystem().getIFile( getFileFromURL( location ) );
    }

    @Override
    IFile getIResourceFromURL( URL location )
    {
      return new URLFileImpl( FileSystemImpl.this, location );
    }
  }

  private class IDirectoryResourceExtractor extends ResourceExtractor<IDirectory>
  {
    protected IDirectory getIResourceFromJarDirectoryAndEntryName( IDirectory jarFS, String entryName )
    {
      return jarFS.dir( entryName );
    }

    protected IDirectory getIResourceFromJavaFile( URL location )
    {
      return getHost().getFileSystem().getIDirectory( getFileFromURL( location ) );
    }

    @Override
    IDirectory getIResourceFromURL( URL location )
    {
      return null;
    }
  }
}


text:
<TITLE>Review for Alaska (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Alaska (1996)

reviewed by
Scott Renshaw

                                  ALASKA
                       A film review by Scott Renshaw
                        Copyright 1996 Scott Renshaw

Starring:  Thora Birch, Vincent Kartheiser, Dirk Benedict, Charlton
Heston.
Screenplay:  Andy Burg, Scott Myers.
Director:  Fraser C. Heston.
Reviewed by Scott Renshaw.

     ALASKA is about as basic as film-making gets, and that is not
entirely a criticism.  Disney used to make a series of films called "True
Life Adventures," wilderness yarns chock full of great scenery, cute
critters and just enough Darwinian conflict not to be alarming to the
little ones in the audience.  Those films were basic -- a vista, an
animal, a fight, repeat -- but most of the time they were also effective.
That is the vibe ALASKA is looking for, and might actually have matched if
it hadn't had so many darned humans.  There is some lively adventure in
ALASKA, but when most of the real fun comes on four legs, it is difficult
not to lose patience with the two-legged cast members.

     ALASKA stars Thora Birch and Vincent Kartheiser as Jessie and Sean
Barnes, teen-aged siblings recently re-located from Chicago to the small
Alaskan fishing village of Quincy after the death of their mother.  Their
father Jake (Dirk Benedict), a former commercial airline pilot, now runs
an air taxi service, and it is on one of his runs that he encounters a
fierce storm and crashes.  Search and rescue teams are unable to locate
him, but Sean and Jessie refuse to give up on their father, and set out
themselves determined to find him.  What they find first is a wilderness
full of dangers, including treacherous climbs, white waters and a nasty
wildlife poacher named Perry (Charlton Heston).  They also find a friend
in an orphaned polar bear cub who joins them on their journey and becomes
a sort of spirit guide.

     I won't waste too much time on the trite and silly elements of
ALASKA, because fortunately scripters Andy Burg and Scott Myers do us the
same favor.  The film's set-up is a riff on FREE WILLY, with a troubled
youth (Sean is annoyed about his new home), a bond with a lovable animal
and even a dash of Native American mysticism; it also provides the
well-worn trope of the lost parent.  Vincent Kartheiser does the surly bit
with a bit more obnoxiousness than one might hope for, and Thora Birch
(the young Melanie Griffith in NOW AND THEN) makes a generic smarter
younger sister, but they are on a par with the rest of the acting in
ALASKA.  It even has the best bad actor in screen history as its villain
(who, coincidentally enough, happens to be the director's father).  And
yes, it does perplex me how Sean made it through three days of rock
climbing, wading in icy rivers and plodding through the frozen tundra in
his Adidas high-tops.

     No, the problem with ALASKA isn't that the people are one-dimensional
characters or mediocre actors.  The problem is that they are people.  The
reactions of the children (and parents) all around me told me exactly what
they wanted to see every time Cubby the polar bear was on the screen.
Even after Coke has turned computer-generated frolicking polar bears into
a corporate logo, the real thing is still adorable; I dare anyone not to
smile ad a cuddly cub doing a belly slide down a snowy embankment.  That
bear is sympathetic and entertaining in a way his human co-stars can never
hope to be, and he is the real star of ALASKA.  He just doesn't have any
supporting players.

     That points up a significant drawback in a film which is supposed to
be a wilderness adventure, namely that there is not enough wilderness,
especially in the first half.  There is plenty of photography of majestic
locations (of a strangely flat variety by cinematographer Tony Westman),
but Fraser C. Heston doesn't quite know what to do with it.  It is fine
for a family adventure like ALASKA to turn in only a rudimentary plot
provided it delivers the thrills, and they finally start coming with about
half an hour left.  That last half hour is very exciting, though, with a
white water sequence as impressive as anything in THE RIVER WILD and a
literal cliff-hanger of a climax.  By then, over 70 minutes into ALASKA,
young viewers could be getting might restless.

     The last shots in ALASKA find our polar bear hero trotting off with
two other bears to form a happy adoptive family.  _That's_ a story I
really would have enjoyed, and I couldn't help wondering why ALASKA hadn't
tripled its polar bear content much earlier.

     On the Renshaw scale of 0 to 10 bear necessities:  5.

--
Scott Renshaw
Stanford University
http://www-leland.stanford.edu/~srenshaw

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
var myWindow=null;

var OptionButton=function(){
    this.routeList='_admin_tcp_list';
    this.routeNew='_admin_td_new';
    this.routeSave='_admin_td_save';
    this.routeEdit='_admin_td_edit';
    this.routeUpdate='_admin_td_update';
    this.routeDelete='_admin_td_delete';

}
OptionButton.prototype={
    New:function(){
        this.Window=new BootstrapWindow({id:"winForm",title:"Nuevo Tipo Contacto Postulante"});
        var url=Routing.generate(this.routeNew,{codcat:"TCP"}); //:Tipo Contacto Postulante
        this.Window.Load(url,"");
        this.Window.Show();
         var parent=this;
        this.Window.AddButton('btn-td-cancel',{
            label:'Cancelar',
            'class':'btn-default',
            fn:function(){
                parent.Window.Hide();
            }

        })

        this.Window.AddButton('btn-td-save',{
            label:'Grabar',
            'class':'btn-success',
            fn:function(){
                parent.Save();
                parent.Window.Hide();
            }
        });
    },
    Save:function(){
            var url=Routing.generate(this.routeSave,{codcat:"TCP"});
            params = $('#myform').serializeObject();

            console.log(params);

            $.ajax({
                    type:'POST',
                    url:url,
                    data:params,
                    dataType:"html",
                    success:function(datos){
                            //parent.Window.AddHTML(datos);
                            new OptionButton().Refresh();
                    },
                    error:function(objeto, quepaso, otroobj){

                    }
            });

    },
    Edit:function(id){
        this.IdEntity=id;
        this.Window=new BootstrapWindow({id:"winForm",title:"Tipo Contacto Postulante"});
        var url=Routing.generate(this.routeEdit,{id:id});
        this.Window.Load(url,"");
        this.Window.Show();
        var parent=this;
        this.Window.AddButton('btn-td-cancel',{
            label:'Cancelar',
            'class':'btn-default',
            fn:function(){
                parent.Window.Hide();
            }

        })

        this.Window.AddButton('btn-td-save',{
            label:'Grabar',
            'class':'btn-success',
            fn:function(){
                parent.Update();
                parent.Window.Hide();
            }
        });
    },
    Update:function(){
            console.log("actualizando  con id:"+this.IdEntity);
            var parent=this;
            var url=Routing.generate(this.routeUpdate,{id:this.IdEntity});
            params = $('#myform').serializeObject();

            $.ajax({
                    type:'POST',
                    url:url,
                    data:params,
                    dataType:"html",
                    success:function(datos){

                            new OptionButton().Refresh();
                    },
                    error:function(objeto, quepaso, otroobj){

                    }
            });
    },
    Delete:function(id){
        this.IdEntity=id;
        if(confirm("Desea eliminar el tipo contacto seleccionado?")){
             var url=Routing.generate(this.routeDelete,{id:this.IdEntity});
             $.ajax({
                    type:'DELETE',
                    url:url,
                    dataType:"html",
                    success:function(datos){

                            new OptionButton().Refresh();
                    },
                    error:function(objeto, quepaso, otroobj){

                    }
            });
        }
    },
    Refresh:function(){
        var url=Routing.generate(this.routeList);
        new jAjax().Load(url,'main-body','get','TCP','');
    }
}

//al leer el documento
$(document).ready(function() {

  $("#btnNew").click(function(){
      var id=$(this).attr("data-id");
      new OptionButton().New(id);
  });

  $(".row-edit").click(function(){
      var id=$(this).attr("data-id");
      new OptionButton().Edit(id);
  });
   $(".row-delete").click(function(){
      var id=$(this).attr("data-id");
      new OptionButton().Delete(id);
  });
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Metrodiana 15(2): 38 (1987)

#### Original name
Lepiota bulbipes Henn.

### Remarks
null


text:
using DomainValidation.Validation;
using RR.PedidoVendas.Domain.Models;
using RR.PedidoVendas.Domain.Specification.Produtos;

namespace RR.PedidoVendas.Domain.Validation.Produtos
{
    public class ProdutoConsistenteValidation : Validator<Produto>
    {
        public ProdutoConsistenteValidation()
        {
            var produtoDescricaoMaiorQueValida = new ProdutoDescricaoMaiorQueValidaSpecification();
            var produtoValorMaiorQueValido = new ProdutoValorMaiorQueValidoSpecification();

            Add("produtoDescricaoMaiorQueValida", new Rule<Produto>(produtoDescricaoMaiorQueValida, "A descrição do produto deve conter no mínimo 3 caracteres."));
            Add("produtoValorMaiorQueValido", new Rule<Produto>(produtoValorMaiorQueValido, "O valor do produto deve ser maior que R$ -0.01."));
        }
    }
}


text:
#ifndef QmitkBooleanOperationsWidget_h
#define QmitkBooleanOperationsWidget_h

#include "../QmitkSegmentationUtilityWidget.h"
#include <ui_QmitkBooleanOperationsWidgetControls.h>
#include <mitkBooleanOperation.h>

class QmitkBooleanOperationsWidget : public QmitkSegmentationUtilityWidget
{
  Q_OBJECT

public:
  explicit QmitkBooleanOperationsWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = NULL);
  ~QmitkBooleanOperationsWidget();

private slots:
  void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection);
  void OnDifferenceButtonClicked();
  void OnIntersectionButtonClicked();
  void OnUnionButtonClicked();

private:
  void EnableButtons(bool enable = true);
  void DoBooleanOperation(mitk::BooleanOperation::Type type);

  Ui::QmitkBooleanOperationsWidgetControls m_Controls;
};

#endif