text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

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

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

<!-- Declare the contents of this Android application.  The namespace
     attribute brings in the Android platform namespace, and the package
     supplies a unique name for the application.  When writing your
     own application, the package name must be changed from "com.example.*"
     to come from a domain that you own or have control over. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.actionbarsherlock.sample.demos"
    android:versionCode="55"
    android:versionName="3.5.1">

    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.INTERNET" />

    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="13" />

    <application android:label="@string/activity_sample_code"
            android:icon="@drawable/icon"
            android:hardwareAccelerated="true">

        <activity android:name="Support4Demos">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".app.SendResult"
                android:theme="@style/ThemeDialogWhenLarge">
        </activity>

        <!-- ActionBar Support Samples -->

        <activity
            android:name=".app.ActionBarActionItemText"
            android:label="@string/actionbar_actionitemtext"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarActionItemCustomView"
            android:label="@string/actionbar_actionitemcustom"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarFeatureToggles"
            android:label="@string/actionbar_feature_toggles"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarTabsPager"
            android:label="@string/actionbar_tabs_pager"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarStyles"
            android:label="@string/actionbar_styles">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarPagerFragmentMenus"
            android:label="@string/actionbar_pagerfragmentmenus"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarSubMenus"
            android:label="@string/actionbar_submenus"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarListNavigation"
            android:label="@string/actionbar_list_navigation"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarCustomNavigation"
            android:label="@string/actionbar_customnavigation"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarMenuSupport"
            android:label="@string/actionbar_menu_support"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarTabNavigation"
            android:label="@string/actionbar_tab_navigation"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarOverlay"
            android:label="@string/actionbar_overlay"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarIndeterminateProgress"
            android:label="@string/actionbar_iprogress"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".app.ActionBarSimple"
            android:label="@string/actionbar_simple"
            android:theme="@style/Theme.Sherlock">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <!-- Fragment Support Samples -->

        <activity android:name=".app.FragmentAlertDialogSupport"
                android:label="@string/fragment_alert_dialog_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentArgumentsSupport"
                android:label="@string/fragment_arguments_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentCustomAnimationSupport"
                android:label="@string/fragment_custom_animation_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentHideShowSupport"
                android:label="@string/fragment_hide_show_support"
                android:windowSoftInputMode="stateUnchanged">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentContextMenuSupport"
                android:label="@string/fragment_context_menu_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentDialogSupport"
                android:label="@string/fragment_dialog_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentDialogOrActivitySupport"
                android:label="@string/fragment_dialog_or_activity_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentLayoutSupport"
                android:label="@string/fragment_layout_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentListArraySupport"
                android:label="@string/fragment_list_array_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentLayoutSupport$DetailsActivity" />

        <activity android:name=".app.FragmentMenuSupport"
                android:label="@string/fragment_menu_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentRetainInstanceSupport"
                android:label="@string/fragment_retain_instance_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentReceiveResultSupport"
                android:label="@string/fragment_receive_result_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentStackSupport"
                android:label="@string/fragment_stack_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentTabs"
                android:label="@string/fragment_tabs">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentTabsPager"
                android:label="@string/fragment_tabs_pager">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentPagerSupport"
                android:label="@string/fragment_pager_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentPagerMenus"
                android:label="@string/fragment_pagermenus">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.FragmentStatePagerSupport"
                android:label="@string/fragment_state_pager_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.LoaderCursorSupport"
                android:label="@string/loader_cursor_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.LoaderCustomSupport"
                android:label="@string/loader_custom_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>

        <activity android:name=".app.LoaderThrottleSupport"
                android:label="@string/loader_throttle_support">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>
        <provider android:name=".app.LoaderThrottleSupport$SimpleProvider"
                  android:authorities="com.actionbarsherlock.sample.demos.apis.LoaderThrottle" />

        <activity android:name=".content.LocalServiceBroadcaster"
                android:label="@string/local_service_broadcaster">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.actionbarsherlock.sample.demos.SUPPORT4_SAMPLE_CODE" />
            </intent-filter>
        </activity>
        <service android:name=".content.LocalServiceBroadcaster$LocalService" />
        <!-- android:stopWithTask="true" /> THIS WAS PART OF THE SUPPORT DEMOS? -->
    </application>
</manifest>


text:
module Itchy::Errors
  # Covers errors related to specific event handling.
  class EventHandleError < Itchy::Errors::EventProcessingError; end
end

redpajama_set_name: RedPajamaGithub


text:
title: "rclone sync"
description: "Make source and dest identical, modifying destination only."
slug: rclone_sync
url: /commands/rclone_sync/
# autogenerated - DO NOT EDIT, instead edit the source code in cmd/sync/ and as part of making a release run "make commanddocs"
---
# rclone sync

Make source and dest identical, modifying destination only.

## Synopsis

Sync the source to the destination, changing the destination
only.  Doesn't transfer unchanged files, testing by size and
modification time or MD5SUM.  Destination is updated to match
source, including deleting files if necessary.

**Important**: Since this can cause data loss, test first with the
`--dry-run` or the `--interactive`/`-i` flag.

    rclone sync -i SOURCE remote:DESTINATION

Note that files in the destination won't be deleted if there were any
errors at any point.

It is always the contents of the directory that is synced, not the
directory so when source:path is a directory, it's the contents of
source:path that are copied, not the directory name and contents.  See
extended explanation in the `copy` command above if unsure.

If dest:path doesn't exist, it is created and the source:path contents
go there.

**Note**: Use the `-P`/`--progress` flag to view real-time transfer statistics

```
rclone sync source:path dest:path [flags]
```

## Options

```
      --create-empty-src-dirs   Create empty source dirs on destination after sync
  -h, --help                    help for sync
```

See the [global flags page](/flags/) for global options not listed here.

## SEE ALSO

* [rclone](/commands/rclone/)	 - Show help for rclone commands, flags and backends.


text:
<?php

namespace EMC\TableBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class EMCTableExtension extends Extension {

    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container) {
        $configuration = new Configuration();

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

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        array_unshift($config['extensions'], $config['default_extensions']);
        $container->setParameter('emc_table.extensions', $config['extensions']);
        $container->setParameter('emc_table.template', $config['template']);
        $container->setParameter('emc_table.default_options', $config['options']);
        $container->setParameter('emc_table.default_column_options', $config['column']['options']);

        $loader->load('table.services.yml');
        $loader->load('column.services.yml');
        $loader->load('profiler.services.yml');

        if (isset($config['export'])) {
            $loader->load('export.services.yml');
            $container->setParameter('emc_table.export.template', $config['export']['template']);
        }

        if (isset($config['export']['csv'])) {
            $container->setParameter('emc_table.export.csv.delimiter', $config['export']['csv']['delimiter']);
            $container->setParameter('emc_table.export.csv.enclosure', $config['export']['csv']['enclosure']);
            $container->setParameter('emc_table.export.csv.escape', $config['export']['csv']['escape']);
            $loader->load('csv.export.services.yml');
        }

        if (isset($config['export']['pdf'])) {
            $container->setParameter('emc_table.export.pdf.bin', $config['export']['pdf']['bin']);
            $container->setParameter('emc_table.export.pdf.template', $config['export']['pdf']['template']);
            $container->setParameter('emc_table.export.pdf.options', $config['export']['pdf']['options']);
            $loader->load('pdf.export.services.yml');
        }

        if (isset($config['export']['xls'])) {
            $container->setParameter('emc_table.export.xls.template', $config['export']['xls']['template']);
            $loader->load('xls.export.services.yml');
        }
    }

}


text:
title: Ragnarök — Viking Browser With HTML5 Parser!
authors:
- stig-halvorsen
tags:
- opera-11
- html5
- core
- webstandards
- opera
- coreblog
license: cc-by-3.0
---

Making its debut in a Labs build this week is Ragnarök, our implementation of the HTML5 Parsing algorithm. We'd love you to try to break this and give us feedback, so please grab a copy to install on your machine from one of the download links below.

Opera 11 with new HTML 5 parser for Windows

Opera 11 with new HTML 5 parser for Mac

Opera 11 with new HTML 5 parser for Linux/FreeBSD

The coolest HTML5 demo you'll see this week

The Web is littered with <canvas> games, HTML5 video players, drag-and-drop whizz-bangs and other demos of HTML5 and "HTML5". But here's a really cool demo, probably the coolest you'll see this week. Are you ready? Here goes:

<b><i>Yo!</b></i>

I can tell you're impressed, so let's dig deeper to see exactly why it is so cool. The elements are incorrectly nested: the innermost element - in this case, the <i> - should be the first one closed. What does this do to the DOM in different browsers?

We can check this out using Opera Dragonfly and its equivalents, or Ian Hickson's DOM viewer. Internet Explorer 9 and Safari 5 result in this innerHTML:

<!DOCTYPE HTML>
<html><HEAD></HEAD><BODY>
<B><I>Yo!</I></B><I></I>
</BODY></html>

while Opera, Firefox and Chrome produce this:

<!DOCTYPE HTML>

<html><HEAD></HEAD><BODY>
<B><I>Yo!</I></B>
</BODY></html>

All the browsers have sorted out the mis-nesting, but inconsistently: note that IE and Safari have an additional empty <i> element that Opera, Firefox and Chrome don't have. Which is correct? In an HTML4 world, both are. The HTML4 spec describes what to do with good markup, but not what to do with bad markup - and we know that 95% of the Web doesn't validate. Therefore, browsers have traditionally been left to their own devices and forced to guess what to do with bad markup, as error-handling was never defined for HTML4.

Our simple markup above already produces very different DOMs, so imagine what would result from more real world examples of tag soup with dozens or hundreds of elements. Writing JavaScript that has to operate across browsers with such inconsistencies is a major cause of hair loss and weeping amongst web developers.

Luckily, there is now a solution to this.

The HTML5 parsing algorithm

The HTML5 specification defines a set of parsing rules for all markup, whether valid or invalid. Once all browsers have HTML5 parsers, the same markup will produce the same DOM across all conforming browsers. There are two main effects of this:

JavaScripters will sport cheerful grins and bouffant hair

Consumers can expect fewer interoperability problems when using their favourite site between browsers

So validation is a thing of the past, right?

Absolutely not. It's still a vital QA tool, and just because the HTML5 parser will produce an interoperable DOM, it doesn't mean it's the DOM you actually want!

Opera's implementation

Our old HTML parser has basically been the same since Opera began 15 years ago. It's been continually patched to keep up with changing standards and countless different ways people came up with to not follow the specifications. After all the changes here and there, the code really started to look like a over-decorated christmas tree, and adding more stuff without knocking over the tree was getting increasingly hard.

With the decision to rewrite the entire parser came the opportunity to clean up the design significantly.

We can now proudly say that the new Ragnarök parser has a 99.9% pass-rate on an extensive test suite based on the html5lib tests for the parser part of the HTML 5 specification. The missing last 0.1% is going to be fixed before Ragnarök's golden release. The test suite will also be publicly released once completed so that you can verify it yourself and compare Opera to the other browsers out there.

Ragnarök also scores 11 out of 11 (plus two bonus points) on the somewhat non-comprehensive (and therefore rather misleading) html5test.com. (The two bonus points are for parsing embedded SVG and MathML in HTML5.)

Memory consumption

The main reason we kept our old parser for so long was its efficient memory usage when handling bad markup. Instead of duplicating nodes like the HTML5 specification states, our parser had a intricate system of pointers that indicated which nodes should have been duplicated. This saved it from allocating memory to actually duplicating the element data, but also made the code that traversed the data structure more complex. Now we have switched to copying the nodes, it uses slightly more memory. Before the final release we will minimize that side effect — Opera has always been about memory efficiency, and working on smaller devices too.

Performance

It's not obvious now, because this technical preview isn't optimized for speed like the golden releases will be, but another advantage of the rewrite has been an  increase in parser performance. Since the time taken parsing the markup of a page is relatively small compared to loading and rendering, this will not affect benchmarks dramatically, but all performance improvements are for the better, right?

Get it while it's hot!

We have made some builds contain the new parser so that you can test it out, right now, and earn the right to brag to your friends that "Hah, I've been running that for quite some time now" when the final product is out in the stores in a short while.

Opera 11 with new HTML 5 parser for Windows

Opera 11 with new HTML 5 parser for Mac

Opera 11 with new HTML 5 parser for Linux/FreeBSD

Disclaimer: The builds are only meant as a technical preview of the new parser, and have not gone through the usual thorough testing our golden releases get, so they might be more unstable. The email client is not working properly so do not use it. Delayed Script Execution is also unstable at the moment. The builds are not optimized for speed so don't expect any useful results from performance benchmarks yet. Better stats will be available when the final version is out.


text:
require 'uri'

describe "URI#route_to" do

  #this could be split out a good bit better
  it "gives the minimal difference between the current URI and the target" do
    URI("http://example.com/a.html").route_to('http://example.com/a.html').to_s.should == ""
    URI("http://example.com/a.html").route_to('http://example.com/b.html').to_s.should == "b.html"
    URI("http://example.com/a/").route_to('http://example.com/b/').to_s.should == "../b/"
    URI("http://example.com/a/c").route_to('http://example.com/b/').to_s.should == "../b/"
    URI("http://example.com/a/b/").route_to('http://example.com/b/').to_s.should == "../../b/"
    URI("http://example.com/a/b/").route_to('http://EXAMPLE.cOm/b/').to_s.should == "../../b/"
    URI("http://example.com/a/b/").route_to('http://example.net/b/').to_s.should == "//example.net/b/"
    URI("mailto:foo@example.com").route_to('mailto:foo@example.com#bar').to_s.should == "#bar"

    #this was a little surprising to me
    URI("mailto:foo@example.com#bar").route_to('mailto:foo@example.com').to_s.should == ""
  end

  ruby_bug "redmine:3506", "1.9.2" do
    it "accepts a string-like argument" do
      str = mock('string-like')
      str.should_receive(:to_str).and_return("http://example.com/b.html")
      URI("http://example.com/a.html").route_to(str).to_s.should == "b.html"
    end
  end
end


text:
 View observation

<form novalidate name="entryForm" class="pure-form pure-form-stacked" ng-controller="NewObservationCtrl as entry" >

</form>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using cloudscribe.Pagination.Models;
using cloudscribe.Web.Pagination;
using PagingDemo.Web.Models;

namespace PagingDemo.Web.ViewModels
{
    public class ViewByCategoriesViewModel
    {
        public ViewByCategoriesViewModel()
        {
            Products = new PagedResult<Product>();

        }
        public PagedResult<Product> Products { get; set; }
        public string[] AvailableCategories { get; set; }
        public string[] Categories { get; set; }

    }
}


text:
from __future__ import unicode_literals, division, absolute_import

import pytest

from .conftest import MockManager

class TestMigrate(object):

    config = """
        tasks:
          test:
            mock:
              - {title: 'foobar'}
            accept_all: yes
    """

    @pytest.mark.filecopy('db-r1042.sqlite', '__tmp__/upgrade_test.sqlite')
    def test_upgrade(self, request, tmpdir):
        db_filename = tmpdir.join('upgrade_test.sqlite')
        # in case running on windows, needs double \\
        filename = db_filename.strpath.replace('\\', '\\\\')
        database_uri = 'sqlite:///%s' % filename
        # This will raise an error if the upgrade wasn't successful
        mockmanager = MockManager(self.config, request.cls.__name__, db_uri=database_uri)
        try:
            mockmanager.shutdown()
        finally:
            mockmanager.__del__()
        # TODO: verify we actually loaded the old config, and didn't just create a new one or something


text:
@implementation UpInfoModel

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/toolbar_height"
    android:background="@color/grey_color"
    android:orientation="horizontal">

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1">

        <Button
            android:id="@+id/btn_edit"
            style="@style/camera_tool"
            android:layout_gravity="center"
            android:text="Save" />
    </FrameLayout>

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1">

        <Button
            android:id="@+id/btn_share"
            style="@style/camera_tool"
            android:layout_gravity="center"
            android:text="Share" />
    </FrameLayout>

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:visibility="gone">

        <Button
            android:id="@+id/btn_save"
            style="@style/camera_tool"
            android:text="Save" />
    </FrameLayout>

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1">

        <Button
            android:id="@+id/btn_delete"
            style="@style/camera_tool"
            android:layout_gravity="center"
            android:text="Delete" />
    </FrameLayout>
</LinearLayout>


text:
<?xml version="1.0" encoding="utf-8" ?>
<Silk>
  <Prefixes>
	  <Prefix id="rdf" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
	  <Prefix id="rdfs" namespace="http://www.w3.org/2000/01/rdf-schema#" />
	  <Prefix id="foaf" namespace="http://xmlns.com/foaf/0.1/" />
	  <Prefix id="owl" namespace="http://www.w3.org/2002/07/owl#" />
	  <Prefix id="dbpedia-owl" namespace="http://dbpedia.org/ontology/" />
	  <Prefix id="dc" namespace="http://purl.org/dc/terms/" />
	  <Prefix id="movie" namespace="http://data.linkedmdb.org/resource/movie/" />
  </Prefixes>

  <DataSources>
    <DataSource id="dbpedia" type="sparqlEndpoint">
      <Param name="endpointURI" value="http://dbpedia.org/sparql" />
      <Param name="graph" value="http://dbpedia.org" />
    </DataSource>
    <DataSource id="linkedmdb" type="sparqlEndpoint">
      <Param name="endpointURI" value="http://data.linkedmdb.org/sparql" />
    </DataSource>
  </DataSources>

  <Interlinks>
	<Interlink id="movies">
		<LinkType>owl:sameAs</LinkType>

		<SourceDataset dataSource="dbpedia" var="a">
			<RestrictTo>
				?a rdf:type dbpedia-owl:Film
			</RestrictTo>
		</SourceDataset>

		<TargetDataset dataSource="linkedmdb" var="b">
			<RestrictTo>
				?b rdf:type movie:film
			</RestrictTo>
		</TargetDataset>

    <LinkageRule>
      <Aggregate type="average">
        <Aggregate type="max">
          <Compare metric="jaro">
            <Input path="?a/rdfs:label[@lang = 'en']" />
            <Input path="?b/rdfs:label" />
          </Compare>
          <Compare metric="jaro" >
            <Input path="?a/rdfs:label[@lang = 'en']" />
            <Input path="?b/dc:title" />
          </Compare>
          <Compare metric="jaro" >
            <Input path="?a/foaf:name" />
            <Input path="?b/dc:title" />
          </Compare>
        </Aggregate>
        <Aggregate type="max" >
          <Compare metric="jaro" >
            <Input path="?a/dbpedia-owl:director/foaf:name" />
            <Input path="?b/movie:director/movie:director_name" />
          </Compare>
          <Compare metric="jaro" >
            <Input path="?a/dbpedia-owl:director/rdfs:label" />
            <Input path="?b/movie:director/movie:director_name" />
          </Compare>
          <Compare metric="jaro" >
            <Input path="?a/dbpedia-owl:director" />
            <Input path="?b/movie:director/movie:director_name" />
          </Compare>
          <Compare metric="jaro" >
            <TransformInput function="regexReplace">
              <TransformInput function="stripUriPrefix">
                <Input path="?a/dbpedia-owl:director" />
              </TransformInput>
              <Param name="regex" value="_" />
              <Param name="replace" value=" " />
            </TransformInput>
            <Input path="?b/movie:director/movie:director_name" />
          </Compare>
        </Aggregate>
        <Aggregate type="max" >
          <Compare metric="date" >
            <Input path="?a/dbpedia-owl:releaseDate" />
            <Input path="?b/dc:date" />
            <Param name="max_days" value="20" />
          </Compare>
          <Compare metric="date" >
            <Input path="?a/dbpedia-owl:releaseDate" />
            <Input path="?b/movie:initial_release_date" />
            <Param name="max_days" value="20" />
          </Compare>
        </Aggregate>
        <Compare metric="num" >
          <Input path="?a/dbpedia-owl:runtime" />
          <Input path="?b/movie:runtime" />
          <Param name="threshold" value="100" />
        </Compare>
      </Aggregate>
    </LinkageRule>

    <Filter threshold="0.9" limit="1" />

    <Outputs>
      <Output minConfidence="0.9" type="file">
        <Param name="file" value="linkedmdb.nt"/>
        <Param name="format" value="ntriples"/>
      </Output>
    </Outputs>

	</Interlink>
  </Interlinks>
</Silk>


text:
ExerciseKanjiReading::ExerciseKanjiReading(const QString& categoryName, const QString& title, const std::vector<Hieroglyph*>& hieroglyphs) :
	Exercise(categoryName, title, KanjiReading, hieroglyphs)
{
	m_description = "Кандзи/чтения";
	m_taskFont = QFont(App::getHieroglyphsFont(), 40, 20);
	m_optionsFont = QFont(App::getKanaFont(), 20, 10);
}

void ExerciseKanjiReading::update()
{
	Exercise::update();

	Hieroglyph* hieroglyph = m_hieroglyphs[m_currentTaskNumber];
	std::vector<Hieroglyph*> otherHieroglyphs = m_hieroglyphs;
	otherHieroglyphs.erase(otherHieroglyphs.begin() + m_currentTaskNumber);
	std::random_shuffle(otherHieroglyphs.begin(), otherHieroglyphs.end());

	unsigned int maxAnswersSize = 3;
	unsigned int maxOptionsSize = 6;

	// Task
	m_currentTask = hieroglyph->getSymbol();

	// Answer
	std::vector<QString> kunyomi = hieroglyph->getRandomKunyomi(maxAnswersSize / 2);
	std::vector<QString> onyomi = hieroglyph->getRandomOnyomi(maxAnswersSize - maxAnswersSize / 2);

	m_currentAnswer = kunyomi;
	m_currentAnswer.insert(m_currentAnswer.end(), onyomi.begin(), onyomi.end());

	// Options
	m_currentOptions = m_currentAnswer;
	for (unsigned int i = 0; i < otherHieroglyphs.size() && m_currentOptions.size() < maxOptionsSize; ++i) {
		int readingType = rand() % 2;
		kunyomi = otherHieroglyphs[i]->getRandomKunyomi(readingType);
		onyomi = otherHieroglyphs[i]->getRandomOnyomi(1 - readingType);

		m_currentOptions.insert(m_currentOptions.end(), kunyomi.begin(), kunyomi.end());
		m_currentOptions.insert(m_currentOptions.end(), onyomi.begin(), onyomi.end());
	}
	std::random_shuffle(m_currentOptions.begin(), m_currentOptions.end());
}

QAbstractButton* ExerciseKanjiReading::createOptionItem(const QString& text) const
{
	auto item = new QCheckBox(text);
	item->setFont(m_optionsFont);
	return item;
}


text:
Publisher::Application.config.session_store :cookie_store,
  :key => '_publisher_session',
  :secure => (ENV['GOVUK_APP_DOMAIN'] != ENV['DEV_DOMAIN']),
  :http_only => true

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# Publisher::Application.config.session_store :active_record_store


text:
<?php

namespace Omnipay\Adyen\Message;

use Omnipay\Common\Message\AbstractRequest;

/**
 * Adyen Purchase Request
 */
class PurchaseRequest extends AbstractRequest
{
    protected $liveEndpoint = 'https://live.adyen.com/hpp/pay.shtml';
    protected $testEndpoint = 'https://test.adyen.com/hpp/pay.shtml';        // Hosted Payment Pages (Single):

    //~ protected $testEndpoint = 'https://test.adyen.com/hpp/select.shtml'; // Hosted Payment Pages (multiple)

    public function getMerchantAccount()
    {
        return $this->getParameter('merchantAccount');
    }

    /**
     * @param String $value The merchant account you want to process this payment with.
     */
    public function setMerchantAccount($value)
    {
        return $this->setParameter('merchantAccount', $value);
    }

    public function getSkinCode()
    {
        return $this->getParameter('skinCode');
    }

    /**
     * @param String $value The code of the skin to be used.
     * You can have more than one skin associated with your account if you require a different branding.
     */
    public function setSkinCode($value)
    {
        return $this->setParameter('skinCode', $value);
    }

    public function getSecret()
    {
        return $this->getParameter('secret');
    }

    /**
     * @param String $value A Secret known by You and Adyen, no one else.
     */
    public function setSecret($value)
    {
        return $this->setParameter('secret', $value);
    }

    public function getShipBeforeDate()
    {
        return $this->getParameter('shipBeforeDate');
    }

    /**
     * @param String $value The date by which the goods or services specified in the order must be shipped or rendered.
     */
    public function setShipBeforeDate($value)
    {
        return $this->setParameter('shipBeforeDate', $value);
    }

    public function getSessionValidity()
    {
        return $this->getParameter('sessionValidity');
    }

    /**
     * @param String $value The final time by which a payment needs to have been made. This is especially useful for
     * tickets/reservations, where you want to "lock" the item for sale for only a short time and payments made
     * after this time would lead to extra costs and administrative hassle. Format is YYYY-MM-DDThh:mm:ssTZD.
     * TZD is the Time Zone Designator which can either be the letter 'Z' or +hh:mm or -hh:mm.
     */
    public function setSessionValidity($value)
    {
        return $this->setParameter('sessionValidity', $value);
    }

    public function getMerchantReference()
    {
        return $this->getParameter('merchantReference');
    }

    /**
     * @param String $value The (merchant) reference for this payment.
     * This reference will be used in all communication to the merchant about the status of the payment.
     * Although it is a good idea to make sure it is unique, this is not a requirement.
     */
    public function setMerchantReference($value)
    {
        return $this->setParameter('merchantReference', $value);
    }

    public function getShopperLocale()
    {
        return $this->getParameter('shopperLocale');
    }

    /**
     * Set the langauge of the Payment Form on the Adyen site.
     *
     * The default locale is en_GB.
     * A combination of language code and country code to specify the language used in the session.
     * e.g. en_GB for (British) English).
     * Use just the language code when the country distinction is not required (i.e. fr, not fr_FR).
     *
     * @param String $value Optional locale of the payer e.g. "en_GB" or "fr".
     */
    public function setShopperLocale($value)
    {
        return $this->setParameter('shopperLocale', $value);
    }

    public function getAllowedMethods()
    {
        return $this->getParameter('allowedMethods');
    }

    /**
     * @param String $value A comma-separated list of allowed payment methods.
     * This acts as a filter on the payment methods which would normally be available in the skin.
     * Only the ones in this list will be shown (if available); all others will be ignored. No spaces are allowed.
     * Note that this parameter is optional.
     * If the parameter is not used the value for this field in the merchantSignature computation is an empty String.
     */
    public function setAllowedMethods($value)
    {
        return $this->setParameter('allowedMethods', $value);
    }

    public function getBlockedMethods()
    {
        return $this->getParameter('blockedMethods');
    }

    /**
     * @param String $value A comma-separated list of payment methods which should not be made available.
     * This acts as a filter on the payment methods which would normally be available in
     * the skin. The methods listed will be removed from the list of available payment methods. No spaces are
     * allowed. Note that this parameter is optional. If the parameter is not used the value for this field in the
     * merchantSignature computation is an empty String.
     */
    public function setBlockedMethods($value)
    {
        return $this->setParameter('blockedMethods', $value);
    }

    public function getShopperReference()
    {
        return $this->getParameter('shopperReference');
    }

    /**
     * Optional. An ID that uniquely identifies the shopper (e.g. a customer id in a shopping cart system).
     * Recommended as it is used in a velocity fraud check.
     */
    public function setShopperReference($value)
    {
        return $this->setParameter('shopperReference', $value);
    }

    public function getShopperEmail()
    {
        return $this->getParameter('shopperEmail');
    }

    /**
     * Optional. The email address of the shopper. Recommended as it is used in a velocity fraud check.
     */
    public function setShopperEmail($value)
    {
        return $this->setParameter('shopperEmail', $value);
    }

    public function getCountryCode()
    {
        return $this->getParameter('countryCode');
    }

    /**
     * Optional country code of shopper.
     * By default the payment methods offered to the shopper are filtered based on the country which the IP
     * address of the shopper is mapped to. This prevents a UK shopper from being presented with a German
     * payment method like ELV. This IP-to-country mapping is not 100% accurate so if you have already
     * established the country of the shopper you may set it explicitly using the countryCode parameter.
     * This parameter is optional and is not used as part of the signing data.
     */
    public function setCountryCode($value)
    {
        return $this->setParameter('countryCode', $value);
    }

    public function getBrandCode()
    {
        return $this->getParameter('brandCode');
    }

    /**
     * Optional payment method used to process the payment.
     */
    public function setBrandCode($value)
    {
        return $this->setParameter('brandCode', $value);
    }

    public function getIssuerId()
    {
        return $this->getParameter('issuerId');
    }

    /**
     * Optional issuer ID used to process the payment.
     */
    public function setIssuerId($value)
    {
        return $this->setParameter('issuerId', $value);
    }

    public function getShopperStatement()
    {
        return $this->getParameter('shopperStatement');
    }

    /**
     * Optional field in your payment request if you want to include a variable shopper statement.
     *
     * You can include placeholders for the references. For example:
     * ${reference} for the merchant reference
     * ${pspReference} for the psp reference.
     *
     * Note:
     * Not all acquirers support dynamic shopper statements.
     * Maximum allowed character length: 135 characters
     * Allowed characters: a-zA-Z0-9.,-?|
     * If you set the shopperStatement field, it is included in the HMAC calculation.
     * Not supported for all payments methods, for further information contact support.
     */
    public function setShopperStatement($value)
    {
        return $this->setParameter('shopperStatement', substr($value, 0, 135));
    }

    public function getOrderData()
    {
        return $this->getParameter('orderData');
    }

    public function getOfferEmail()
    {
        return $this->getParameter('offerEmail');
    }

    /**
     * Optional. The email address of the shopper.
     *
     * If offerEmail is set to prompt, an extra Pay by Email payment method is added to the available payment method list.
     *
     * If the shopper selects this option, they receive an email with a link that they can use to complete the payment.
     *
     * The sessionValidity time value determines the link validity.
     */
    public function setOfferEmail($value)
    {
        return $this->setParameter('offerEmail', $value);
    }

    /**
     * Optional  order details to display to the shopper on the payment review page.
     *
     * An HTML fragment containing the order details to display to the shopper on the payment review page,
     * just before the shopper proceeds to the final order confirmation.
     *
     * Data is compressed and encoded in the session to prevent data corruption,
     * for example in case the locale is set to non-Latin character sets.
     *
     * Compression: GZIP & Encoding: Base64
     */
    public function setOrderData($value)
    {
        return $this->setParameter('orderData', base64_encode(gzencode($value)));
    }

    public function getMerchantReturnData()
    {
        return $this->getParameter('merchantReturnData');
    }

    /**
     * Optional field value that will be appended as-is to the return URL.
     *
     * This field value is appended as-is to the return URL when the shopper completes, or abandons,
     * the payment process and is redirected to your web shop.
     *
     * Typically, this field is used to hold and transmit a session ID. Maximum allowed character length: 128 characters.
     *
     * Note:
     * When you include the merchantReturnData parameter in your request, Adyen cannot guarantee that a payment method works as expected.
     * Some redirect methods such as iDEAL apply size limitations to payment requests.
     * If by including merchantReturnData in a request causes it to exceed the allowed maximum size, the payment can fail.
     */
    public function setMerchantReturnData($value)
    {
        return $this->setParameter('merchantReturnData', substr($value, 0, 128));
    }

    public function getFraudOffset()
    {
        return $this->getParameter('fraudOffset');
    }

    /**
     * Optional fraud offset used to process the payment.
     *
     * An integer value that adds up to the normal fraud score.
     * The value can be either a positive or negative integer.
     */
    public function setFraudOffset($value)
    {
        return $this->setParameter('fraudOffset', $value);
    }

    private function getDataWithoutSignature()
    {
        $this->validate('secret', 'amount', 'currency', 'shipBeforeDate', 'merchantReference', 'skinCode', 'merchantAccount', 'sessionValidity');
        $data = array();

        // Compulsory fields (in the same order as listed on https://docs.adyen.com/display/TD/HPP+payment+fields)
        $data['merchantReference'] = $this->getMerchantReference();
        $data['paymentAmount'] = $this->getAmountInteger();
        $data['currencyCode'] = $this->getCurrency();
        $data['shipBeforeDate'] = $this->getShipBeforeDate();
        $data['skinCode'] = $this->getSkinCode();
        $data['merchantAccount'] = $this->getMerchantAccount();
        $data['sessionValidity'] = $this->getSessionValidity();
        // merchantSig will be set later

        // Optional fields (again in the same order as listed on https://docs.adyen.com/display/TD/HPP+payment+fields)
        $data['shopperLocale'] = $this->getShopperLocale();
        $data['orderData'] = $this->getOrderData();
        $data['merchantReturnData'] = $this->getMerchantReturnData();
        $data['countryCode'] = $this->getCountryCode();
        $data['shopperEmail'] = $this->getShopperEmail();
        $data['shopperReference'] = $this->getShopperReference();
        $data['allowedMethods'] = $this->getAllowedMethods();
        $data['blockedMethods'] = $this->getBlockedMethods();
        $data['offset'] = $this->getFraudOffset();
        $data['brandCode'] = $this->getBrandCode();
        $data['issuerId'] = $this->getIssuerId();
        $data['shopperStatement'] = $this->getShopperStatement();
        $data['offerEmail'] = $this->getOfferEmail();
        $data['resURL'] = $this->getReturnUrl();

        return $data;
    }

    public function getData()
    {
        $data = $this->getDataWithoutSignature();
        $data['merchantSig'] = $this->generateSignature(); // this field is also required

        return $data;
    }

    /**
     * The Adyen signature is computed using the HMAC algorithm with the SHA-256 hashing function using the shared
     * secret configured in the skin.
     * The input is the concatenated values of a number of the payment session fields.
     * It is in Base64 encoded format.
     */
    private function generateSignature()
    {
        $params = $this->getDataWithoutSignature();

        // The character escape function
        $escapeVal = function ($val) {
            return str_replace(':', '\\:', str_replace('\\', '\\\\', $val));
        };

        // Sort the array by key using SORT_STRING order
        ksort($params, SORT_STRING);

        // Generate the signing data string
        $signData = implode(':', array_map($escapeVal, array_merge(array_keys($params), array_values($params))));

        // base64-encode the binary result of the HMAC computation
        $merchantSig = base64_encode(hash_hmac('sha256', $signData, pack('H*', $this->getSecret()), true));

        return $merchantSig;
    }

    /**
     * Send the request with specified data.
     * Adyen is a Off-site gateway - No need to send request, instead we need to redirect customer to Adyen site
     *
     * @param  mixed $data The data to send
     * @return ResponseInterface
     */
    public function sendData($data)
    {
        return $this->response = new PurchaseResponse($this, $data);
    }

    /**
     * Optional custom endpoint that will be used to process the payment.
     */
    public function setCustomEndpoint($value)
    {
        return $this->setParameter('customEndpoint', $value);
    }

    private function getCustomEndpoint()
    {
        return $this->getParameter('customEndpoint');
    }

    public function getEndpoint()
    {
        if (!empty($this->getCustomEndpoint())) {
            return $this->getCustomEndpoint();
        }

        return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint;
    }
}


text:
//
// Copyright (c) Microsoft Corporation.    All rights reserved.
//

namespace Microsoft.Zelig.Runtime.TargetPlatform.ARMv7
{
    using System;
    using System.Runtime.InteropServices;

    public abstract partial class ProcessorARMv7MForLlvm_VFP : ProcessorARMv7M_VFP
    {

    }
}


text:
module PasswordCrack
  VERSION = "0.2.6"
end


text:
import actionTypes from './types';

export default function removeConnector (id) {
  return {
    type: actionTypes.removeConnector,
    id
  };
}


text:
package edu.cmu.ml.rtw.generic.model.annotator.nlp.stanford;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;

import org.bson.Document;

import edu.cmu.ml.rtw.generic.data.DataTools;
import edu.cmu.ml.rtw.generic.data.annotation.nlp.DocumentNLPInMemory;
import edu.cmu.ml.rtw.generic.data.annotation.nlp.DocumentNLPMutable;
import edu.cmu.ml.rtw.generic.data.annotation.nlp.SerializerDocumentNLPBSON;
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.Annotator;
import edu.stanford.nlp.util.CoreMap;

public class BSONTokenizer implements Annotator {
	private DataTools dataTools = new DataTools();

	public BSONTokenizer() {

	}

	public BSONTokenizer(String name, Properties properties) {

	}

	@Override
	public void annotate(Annotation annotation) {
		DocumentNLPMutable document = new DocumentNLPInMemory(this.dataTools);
		SerializerDocumentNLPBSON serializer = new SerializerDocumentNLPBSON(document);
		Document doc = Document.parse(annotation.toString());
		if (!doc.containsKey("name"))
			doc.put("name", "");
		document = serializer.deserialize(doc);

		List<CoreMap> sentences = new ArrayList<CoreMap>();
		int tokenOffset = 0;
		List<CoreLabel> allTokens = new ArrayList<CoreLabel>();
		for (int i = 0; i < document.getSentenceCount(); i++) {
			List<CoreLabel> tokens = new ArrayList<CoreLabel>();
			StringBuilder sentenceText = new StringBuilder();
			for (int j = 0; j < document.getSentenceTokenCount(i); j++) {
				CoreLabel token = new CoreLabel();
				token.setBeginPosition(document.getToken(i, j).getCharSpanStart());
				token.setEndPosition(document.getToken(i, j).getCharSpanEnd());
				token.setSentIndex(i);
				token.setIndex(j + 1);
				token.set(CoreAnnotations.TextAnnotation.class, document.getTokenStr(i, j));
				token.setValue(document.getTokenStr(i, j));
				tokens.add(token);
				sentenceText.append(document.getTokenStr(i, j)).append(" ");
			}

			Annotation sentence = new Annotation(sentenceText.toString().trim());
			sentence.set(CoreAnnotations.CharacterOffsetBeginAnnotation.class, document.getToken(i, 0).getCharSpanStart());
			sentence.set(CoreAnnotations.CharacterOffsetEndAnnotation.class, document.getToken(i, document.getSentenceTokenCount(i) - 1).getCharSpanEnd());
			sentence.set(CoreAnnotations.TokensAnnotation.class, tokens);
			sentence.set(CoreAnnotations.TokenBeginAnnotation.class, tokenOffset);
			tokenOffset += tokens.size();
			sentence.set(CoreAnnotations.TokenEndAnnotation.class, tokenOffset);
			sentence.set(CoreAnnotations.SentenceIndexAnnotation.class, sentences.size());

			sentences.add(sentence);
			allTokens.addAll(tokens);
		}

		annotation.set(CoreAnnotations.SentencesAnnotation.class, sentences);
		annotation.set(CoreAnnotations.TokensAnnotation.class, allTokens);
	}

	@Override
	public Set<Requirement> requirementsSatisfied() {
		return Annotator.TOKENIZE_AND_SSPLIT;
	}

	@Override
	public Set<Requirement> requires() {
		return new TreeSet<Requirement>();
	}
}


text:
:class:`style.Symbolizer`
=========================

.. class:: style.Symbolizer

    Instances of the symbolizer base class are not created directly.
    See the constructor details for one of the symbolizer subclasses.

Config Properties
-----------------

.. describe:: zIndex

    ``Number`` The zIndex determines draw order of symbolizers.  Symbolizers
    with higher zIndex values will be drawn over symbolizers with lower
    values.  By default, symbolizers have a zIndex of ``0``.

Properties
----------

.. attribute:: Symbolizer.filter

    :class:`filter.Filter`
    Optional filter that determines where this symbolizer applies.

Methods
-------

.. function:: Symbolizer.and

    :arg symbolizer: :class:`style.Symbolizer`
    :returns: :class:`style.Style`

    Generate a composite style from this symbolizer and the provided
    symbolizer.

.. function:: Symbolizer.range

    :arg config: ``Object`` An object with optional ``min`` and ``max``
        properties specifying the minimum and maximum scale denominators
        for applying this symbolizer.
    :returns: :class:`style.Symbolizer` This symbolizer.

.. function:: Symbolizer.where

    :arg filter: :class:`filter.Filter` or ``String`` A filter or CQL string that
        limits where this symbolizer applies.
    :returns: :class:`style.Symbolizer` This symbolizer.


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace GRA.SRP.Classes {

    public partial class ProgramBanner {

        /// <summary>
        /// pgmBanner control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlImage pgmBanner;
    }
}


text:
assert(not nn.Sequencer, "update nnx package : luarocks install nnx")
local Sequencer, parent = torch.class('nn.Sequencer', 'nn.AbstractSequencer')

function Sequencer:__init(module)
   parent.__init(self)
   if not torch.isTypeOf(module, 'nn.Module') then
      error"Sequencer: expecting nn.Module instance at arg 1"
   end
   self.module = module
   self.isRecurrent = torch.isTypeOf(module, "nn.AbstractRecurrent")
   self.modules[1] = module
   self.sharedClones = {}
   if not self.isRecurrent then
      self.sharedClones[1] = self.module
      -- test that it doesn't contain a recurrent module :
      local err = false
      for i,modula in ipairs(module:listModules()) do
         if torch.isTypeOf(modula, "nn.AbstractRecurrent") then
            err = modula
            break
         end
      end

      if err then
         error("Sequencer: non-recurrent Module should not contain a "..
         "nested recurrent Modules. Recurrent module is "..torch.type(err)..
         ". Use a Sequencer instance for each recurrent module. "..
         "And encapsulate the rest of the non-recurrent modules into "..
         "one or many Sequencers. Yes you can encapsulate many non-recurrent"..
         " modules in a single Sequencer (as long as they don't include recurrent modules.")
      end
   else
      self.module.copyInputs = false
      self.module.copyGradOutputs = false
   end
   self.output = {}

   -- table of buffers used for evaluation
   self._output = {}
   -- so that these buffers aren't serialized :
   self.dpnn_mediumEmpty = _.clone(self.dpnn_mediumEmpty)
   table.insert(self.dpnn_mediumEmpty, '_output')
   -- default is to forget previous inputs before each forward()
   self._remember = 'neither'
end

function Sequencer:updateOutput(inputTable)
   assert(torch.type(inputTable) == 'table', "expecting input table")
   if self.isRecurrent then
      -- Note that the Sequencer hijacks the rho attribute of the rnn
      self.module.rho = #inputTable
      if self.train ~= false then -- training
         if not (self._remember == 'train' or self._remember == 'both') then
            self.module:forget()
         end
         self.output = {}
         for step, input in ipairs(inputTable) do
            self.output[step] = self.module:updateOutput(input)
         end
      else -- evaluation
         if not (self._remember == 'eval' or self._remember == 'both') then
            self.module:forget()
         end
         -- during evaluation, recurrent modules reuse memory (i.e. outputs)
         -- so we need to copy each output into our own
         for step, input in ipairs(inputTable) do
            self.output[step] = nn.rnn.recursiveCopy(
               self.output[step] or table.remove(self._output, 1),
               self.module:updateOutput(input)
            )
         end
         -- remove extra output tensors (save for later)
         for i=#inputTable+1,#self.output do
            table.insert(self._output, self.output[i])
            self.output[i] = nil
         end
      end
   else
      self.output = {}
      for step, input in ipairs(inputTable) do
         -- set output states for this step
         local module = self:getStepModule(step)

         -- forward propagate this step
         self.output[step] = module:updateOutput(input)
      end
   end
   return self.output
end

function Sequencer:updateGradInput(inputTable, gradOutputTable)
   self.gradInput = {}
   if self.isRecurrent then
      assert(torch.type(gradOutputTable) == 'table', "expecting gradOutput table")
      assert(#gradOutputTable == #inputTable, "gradOutput should have as many elements as input")
      local i = 1
      for step=self.module.step-#inputTable+1,self.module.step do
         self.module.step = step
         self.module:updateGradInput(inputTable[i], gradOutputTable[i])
         i = i + 1
      end
      -- back-propagate through time (BPTT)
      self.module:updateGradInputThroughTime()
      assert(self.module.gradInputs, "recurrent module did not fill gradInputs")
      assert(#inputTable == #self.module.gradInputs, #inputTable.." ~= "..#self.module.gradInputs)
      for i=1,#inputTable do
         self.gradInput[i] = self.module.gradInputs[i]
      end
      assert(#self.gradInput == #inputTable, "missing gradInputs (rho is too low?)")
   else
      for step, input in ipairs(inputTable) do
         -- set the output/gradOutput states for this step
         local module = self:getStepModule(step)

         -- backward propagate this step
         self.gradInput[step] = module:updateGradInput(input, gradOutputTable[step])
      end
   end
   return self.gradInput
end

function Sequencer:accGradParameters(inputTable, gradOutputTable, scale)
   if self.isRecurrent then
      assert(torch.type(gradOutputTable) == 'table', "expecting gradOutput table")
      assert(#gradOutputTable == #inputTable, "gradOutput should have as many elements as input")
      local i = 1
      for step=self.module.step-#inputTable+1,self.module.step do
         self.module.step = step
         self.module:accGradParameters(inputTable[i], gradOutputTable[i], scale)
         i = i + 1
      end
      -- back-propagate through time (BPTT)
      self.module:accGradParametersThroughTime()
   else
      for step, input in ipairs(inputTable) do
         -- set the output/gradOutput states for this step
         local module = self:getStepModule(step)

         -- accumulate parameters for this step
         module:accGradParameters(input, gradOutputTable[step], scale)
      end
   end
end

function Sequencer:accUpdateGradParameters(inputTable, gradOutputTable, lr)
   if self.isRecurrent then
      assert(torch.type(gradOutputTable) == 'table', "expecting gradOutput table")
      assert(#gradOutputTable == #inputTable, "gradOutput should have as many elements as input")
      local i = 1
      for step=self.module.step-#inputTable+1,self.module.step do
         self.module.step = step
         self.module:accGradUpdateParameters(inputTable[i], gradOutputTable[i], lr)
         i = i + 1
      end
      -- back-propagate through time (BPTT)
      self.module:accUpdateGradParametersThroughTime(lr)
   else
      for step, input in ipairs(inputTable) do
         -- set the output/gradOutput states for this step
         local module = self:getStepModule(step)

         -- accumulate parameters for this step
         module:accUpdateGradParameters(input, gradOutputTable[step], lr)
      end
   end
end

-- Toggle to feed long sequences using multiple forwards.
-- 'eval' only affects evaluation (recommended for RNNs)
-- 'train' only affects training
-- 'neither' affects neither training nor evaluation
-- 'both' affects both training and evaluation (recommended for LSTMs)
-- Essentially, forget() isn't called on rnn module when remember is on
function Sequencer:remember(remember)
   self._remember = (remember == nil) and 'both' or remember
   assert(_.contains({'both','eval','train','neither'}, self._remember),
      "Sequencer : unrecognized value for remember : "..self._remember)
   return self
end

function Sequencer:training()
   if self.isRecurrent and self.train == false then
      -- empty output table (tensor mem was managed by seq)
      for i,output in ipairs(self.output) do
         table.insert(self._output, output)
         self.output[i] = nil
      end
      -- forget at the start of each training
      self:forget()
   end
   parent.training(self)
end

function Sequencer:evaluate()
   if self.isRecurrent and self.train ~= false then
      -- empty output table (tensor mem was managed by rnn)
      self.output = {}
      -- forget at the start of each evaluation
      self:forget()
   end
   parent.evaluate(self)
   assert(self.train == false)
end

function Sequencer:reinforce(reward)
   if torch.type(reward) == 'table' then
      error"Sequencer Error : step-wise rewards not yet supported"
   end
   return parent.reinforce(self, reward)
end

Sequencer.__tostring__ = nn.Decorator.__tostring__


text: Used to announce a change request on the tree


text:
<?php

namespace AppBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class SmotraRadovaControllerTest extends WebTestCase
{
    public function testIndex()
    {
        $client = static::createClient();

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

    public function testNew()
    {
        $client = static::createClient();

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

}


text:
require('../../tools/transpiler/index.js').init();

var Package = require('dgeni').Package;
var jsdocPackage = require('dgeni-packages/jsdoc');
var nunjucksPackage = require('dgeni-packages/nunjucks');
var path = require('canonical-path');

var PARTIAL_PATH = 'partials';
var MODULES_DOCS_PATH = PARTIAL_PATH + '/modules';
var GUIDES_PATH = PARTIAL_PATH + '/guides';

// Define the dgeni package for generating the docs
module.exports = new Package('angular', [jsdocPackage, nunjucksPackage])

// Register the services and file readers
.factory(require('./services/atParser'))
.factory(require('./services/getJSDocComment'))
.factory(require('./services/SourceFile'))
.factory(require('./services/TraceurParser'))
.factory(require('./services/traceurOptions'))
.factory(require('./services/ParseTreeVisitor'))
.factory(require('./services/AttachCommentTreeVisitor'))
.factory(require('./services/ExportTreeVisitor'))

.factory(require('./readers/atScript'))
.factory(require('./readers/ngdoc'))

// Register the processors
.processor(require('./processors/generateDocsFromComments'))
.processor(require('./processors/processModuleDocs'))
.processor(require('./processors/processClassDocs'))
.processor(require('./processors/generateNavigationDoc'))
.processor(require('./processors/extractTitleFromGuides'))

// Configure the log service
.config(function(log) {
  log.level = 'info';
})

// Configure file reading
.config(function(readFilesProcessor, atScriptFileReader, ngdocFileReader) {
  readFilesProcessor.fileReaders = [atScriptFileReader, ngdocFileReader];
  readFilesProcessor.basePath = path.resolve(__dirname, '../..');
  readFilesProcessor.sourceFiles = [
    { include: 'modules/*/src/**/*.js', basePath: 'modules' },
    { include: 'modules/*/docs/**/*.md', basePath: 'modules' },
    { include: 'docs/content/**/*.md', basePath: 'docs/content' }
  ];
})

// Configure file writing
.config(function(writeFilesProcessor) {
  writeFilesProcessor.outputFolder  = 'dist/docs';
})

// Configure rendering
.config(function(templateFinder, templateEngine) {

  // Nunjucks and Angular conflict in their template bindings so change Nunjucks
  templateEngine.config.tags = {
    variableStart: '{$',
    variableEnd: '$}'
  };

  templateFinder.templateFolders
      .unshift(path.resolve(__dirname, 'templates'));

  templateFinder.templatePatterns = [
    '${ doc.template }',
    '${ doc.id }.${ doc.docType }.template.html',
    '${ doc.id }.template.html',
    '${ doc.docType }.template.html',
    'common.template.html'
  ];
})

// Configure ids and paths
.config(function(computeIdsProcessor, computePathsProcessor) {

  computeIdsProcessor.idTemplates.push({
    docTypes: [
      'class',
      'function',
      'NAMED_EXPORT',
      'VARIABLE_STATEMENT'
    ],
    idTemplate: '${moduleDoc.id}.${name}',
    getAliases: function(doc) { return [doc.id]; }
  });

  computeIdsProcessor.idTemplates.push({
    docTypes: ['member'],
    idTemplate: '${classDoc.id}.${name}',
    getAliases: function(doc) { return [doc.id]; }
  });

  computeIdsProcessor.idTemplates.push({
    docTypes: ['guide'],
    getId: function(doc) {
      return doc.fileInfo.relativePath
                    // path should be relative to `modules` folder
                    .replace(/.*\/?modules\//, '')
                    // path should not include `/docs/`
                    .replace(/\/docs\//, '/')
                    // path should not have a suffix
                    .replace(/\.\w*$/, '');
    },
    getAliases: function(doc) { return [doc.id]; }
  });

  computePathsProcessor.pathTemplates.push({
    docTypes: ['module'],
    pathTemplate: '${id}',
    outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.html'
  });

  computePathsProcessor.pathTemplates.push({
    docTypes: [
      'class',
      'function',
      'NAMED_EXPORT',
      'VARIABLE_STATEMENT'
    ],
    pathTemplate: '${moduleDoc.path}/${name}',
    outputPathTemplate: MODULES_DOCS_PATH + '/${path}/index.html'
  });

  computePathsProcessor.pathTemplates.push({
    docTypes: ['member'],
    pathTemplate: '${classDoc.path}/${name}',
    getOutputPath: function() {} // These docs are not written to their own file, instead they are part of their class doc
  });

  computePathsProcessor.pathTemplates.push({
    docTypes: ['guide'],
    pathTemplate: '${id}',
    outputPathTemplate: GUIDES_PATH + '/${id}.html'
  });
});


text:
<?php

use yii\db\Migration;

class m170122_213852_featured_rest extends Migration
{
    public function up()
    {
        $sql = 'ALTER TABLE lb_restoraunts` ADD COLUMN `lb_featured` ENUM(\'1\', \'0\') NULL DEFAULT \'0\' AFTER `lb_total_tables`;';
        $this->execute($sql);
    }

    public function down()
    {
        echo "m170122_213852_featured_rest cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
package com.ciandt.techgallery.service.model;

import com.ciandt.techgallery.persistence.model.TechnologyLink;

import java.util.List;

/**
 * TechnologyLinksTO.
 *
 * @author Sidharta Noleto
 *
 */
public class TechnologyLinksTO implements Response {

  List<TechnologyLink> links;

  public List<TechnologyLink> getLinks() {
    return links;
  }

  public void setLinks(List<TechnologyLink> links) {
    this.links = links;
  }

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Zschokkea peruviana Van Heurck & Müll.Arg.

### Remarks
null


text:
package com.hxxc.huaxing.app.wedgit;

import android.content.Context;
import android.text.InputType;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.RelativeLayout;

import com.hxxc.huaxing.app.R;

/**
 * Created by houwen.lai on 2016/12/20.
 * <p>
 * if (hasFocus)scroll_login.smoothScrollTo(0,3*ed_user_phone.getMeasuredHeight());
 * //                handler.post(new Runnable() {
 * //                    @Override
 * //                    public void run() {
 * //                        scroll_login.smoothScrollTo(0,3*ed_user_phone.getMeasuredHeight());
 * ////                        scroll_login.fullScroll(ScrollView.FOCUS_DOWN);
 * //
 * //                    }
 * //                });
 */

public class CustomEdit extends RelativeLayout {

    public Context mContext;

    public View mView;
    public EditText ed_custom;
    public ImageButton imgbtn_close;

    public static final String type_clear = "clear";//账号清空
    public static final String type_display = "display";//密码显示
    public String type = type_clear;//类型

    public CustomEdit(Context context) {
        super(context);
        this.mContext = context;
        inintView();
    }

    public CustomEdit(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.mContext = context;
        inintView();
    }

    public CustomEdit(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.mContext = context;
        inintView();
    }

    public void inintView() {
//        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//        mView =
        View.inflate(mContext, R.layout.password_custom, this);

        ed_custom = (EditText) findViewById(R.id.ed_custom);
        imgbtn_close = (ImageButton) findViewById(R.id.imgbtn_close);

        //
        this.post(new Runnable() {
            @Override
            public void run() {
                imgbtn_close.setOnClickListener(new OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        if (type.equals(type_clear))
                            ed_custom.setText("");
                        else {
                            d(mFlag);
                        }
                    }
                });
            }
        });
    }

    public EditText getEditWedgit() {
        return ed_custom;
    }

    public void setEditTextColor(int color) {
        if (ed_custom != null) ed_custom.setTextColor(color);
    }

    public void setEditHintTextColor(int color) {
        if (ed_custom != null) ed_custom.setHintTextColor(color);
    }

    public void setEditTextSize(float size) {
        if (ed_custom != null) ed_custom.setTextSize(size);
    }

    /**
     * InputType.TYPE_CLASS_PHONE
     *
     * @param type
     */
    public void setEditTextType(int type) {
        if (ed_custom != null) ed_custom.setInputType(type);
    }

    public String getEditText() {
        if (ed_custom != null) return ed_custom.getText().toString().trim();
        else return "";
    }

    public void setEditText(CharSequence text) {
        if (ed_custom != null) {
            ed_custom.setText(text);
            ed_custom.setSelection(TextUtils.isEmpty(text) ? 0 : text.length());
        }
    }

    public void setHintEditText(CharSequence text) {
        if (ed_custom != null) ed_custom.setHint(text);
    }

    public void setImgBtnResouse(int resId) {
        if (imgbtn_close != null) imgbtn_close.setImageResource(resId);
    }

    public void setImgBtnBackgrount(int resId) {
        if (imgbtn_close != null) imgbtn_close.setBackgroundResource(resId);
    }

    public void setImgBtnBackgrountColor(int color) {
        if (imgbtn_close != null) imgbtn_close.setBackgroundColor(color);
    }

    public void setImgBtnResouse(int res_d, int res_f) {
        this.resId_d = res_d;
        this.resId_f = res_f;
    }

    /**
     * 对 edittext 操作的方式
     *
     * @param type
     */
    public void setType(String type) {
        this.type = type;
    }

    public int resId_d;
    public int resId_f;
    public boolean mFlag = false;

    public void d(boolean flag) {
        if (flag) {
            imgbtn_close.setImageResource(resId_d);
            mFlag = false;
            ed_custom.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        } else {
            imgbtn_close.setImageResource(resId_f);
            mFlag = true;
            ed_custom.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
        }
        ed_custom.setSelection(ed_custom.getText().toString().trim().length());
    }
}


text:
package net.jselby.escapists.game.events;

import net.jselby.escapists.game.EscapistsGame;
import net.jselby.escapists.game.ObjectInstance;
import net.jselby.escapists.game.Scene;

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

/**
 * Scope is the scope in which a condition/action can reach to.
 */
public class Scope {
    private final EscapistsGame game;
    private final Scene scene;
    private final List<ObjectInstance> objects = new ArrayList<ObjectInstance>();
    private final List<ObjectInstance> scopeObjects = new ArrayList<ObjectInstance>();
    private final Stack<Integer> groupStack = new Stack<Integer>();

    public Scope(EscapistsGame game, Scene scene) {
        this.game = game;
        this.scene = scene;
    }

    public Scope withObjects(int id) {
        objects.clear();

        boolean checkObjects = false;
        if (scopeObjects.size() > 0) {
            // An event has injected an object for us, lets see if its id matches
            for (ObjectInstance instance : scopeObjects) {
                if (instance.getObjectInfo() == id) {
                    checkObjects = true;
                    break;
                }
            }
        }

        if (checkObjects) {
            for (ObjectInstance instance : scopeObjects) {
                if (instance.getObjectInfo() == id) {
                    objects.add(instance);
                }
            }
        } else {
            for (ObjectInstance instance : scene.getObjects()) {
                if (instance.getObjectInfo() == id) {
                    objects.add(instance);
                }
            }
        }

        return this;
    }

    public ObjectInstance[] peekAtObjects() {
        return objects.toArray(new ObjectInstance[objects.size()]);
    }

    public ObjectInstance[] getObjects() {
        ObjectInstance[] dump = objects.toArray(new ObjectInstance[objects.size()]);
        objects.clear();
        return dump;
    }

    public Scene getScene() {
        return scene;
    }

    public EscapistsGame getGame() {
        return game;
    }

    public void addObjectToScope(ObjectInstance instance) {
        scopeObjects.add(instance);
    }

    public void clearScopeObjects() {
        scopeObjects.clear();
    }

    public Stack<Integer> getGroupStack() {
        return groupStack;
    }

}


text:
PREFIX=$1

bedtools bamtobed -i ${PREFIX}.bam > ${PREFIX}.bed


text:
using namespace mlir;
using namespace mlir::linalg;

mlir::linalg::LinalgDialect::LinalgDialect(MLIRContext *context)
    : Dialect(getDialectNamespace(), context) {
  addTypes<RangeType>();
  addOperations<
#define GET_OP_LIST
#include "mlir/Dialect/Linalg/IR/LinalgOps.cpp.inc"
      >();
  addOperations<
#define GET_OP_LIST
#include "mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc"
      >();
}
Type mlir::linalg::LinalgDialect::parseType(DialectAsmParser &parser) const {
  // Parse the main keyword for the type.
  StringRef keyword;
  if (parser.parseKeyword(&keyword))
    return Type();
  MLIRContext *context = getContext();

  // Handle 'range' types.
  if (keyword == "range")
    return RangeType::get(context);

  parser.emitError(parser.getNameLoc(), "unknown Linalg type: " + keyword);
  return Type();
}

/// RangeType prints as just "range".
static void print(RangeType rt, DialectAsmPrinter &os) { os << "range"; }

void mlir::linalg::LinalgDialect::printType(Type type,
                                            DialectAsmPrinter &os) const {
  switch (type.getKind()) {
  default:
    llvm_unreachable("Unhandled Linalg type");
  case LinalgTypes::Range:
    print(type.cast<RangeType>(), os);
    break;
  }
}


text:
require "spec_helper"
require_relative '../lib/graph'

RSpec.describe RandomNodeGenerate do
  describe '#new' do
    it "yields 1000 size node" do
      network = RandomNodeGenerate.new(nodes: 1000,edges: 10000,type: 'matrix')
      expect(network.network.size).to eq 1000
    end
    it "yields 1000 size node" do
      network = RandomNodeGenerate.new(nodes: 1000,edges: 10000,type: 'list')
      expect(network.network.size).to eq 1000
	end
    it "yields 1000 size node" do
      network = RandomNodeGenerate.new(nodes: 1000,edges: 10000,type: 'matrix')
      expect(network.network.list.split("\n").length).to be_within(200).of(10000)
    end
    it "yields 1000 size node" do
      network = RandomNodeGenerate.new(nodes: 1000,edges: 10000,type: 'list')
      expect(network.network.list.split("\n").length).to be_within(200).of(10000)
	end
  end
end


text:
/* Slider
----------------------------------*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 0.8em; height: 0.8em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }

.ui-slider-horizontal { height: 0.4em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -0.4em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }

.ui-slider-vertical { width: 0.4em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -0.3em; margin-left: 0; margin-bottom: -0.4em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }


text:
import {
  hasEmptyLine,
  optionsHaveException,
  optionsHaveIgnored,
  report,
  ruleMessages,
  validateOptions,
} from "../../utils"

export const ruleName = "comment-empty-line-before"

export const messages = ruleMessages(ruleName, {
  expected: "Expected empty line before comment",
  rejected: "Unexpected empty line before comment",
})

const stylelintCommandPrefix = "stylelint-"

export default function (expectation, options) {
  return (root, result) => {
    const validOptions = validateOptions(result, ruleName, {
      actual: expectation,
      possible: [
        "always",
        "never",
      ],
    }, {
      actual: options,
      possible: {
        except: ["first-nested"],
        ignore: [
          "stylelint-commands",
          "between-comments",
        ],
      },
      optional: true,
    })
    if (!validOptions) { return }

    root.walkComments(comment => {

      // Ignore the first node
      if (comment === root.first) { return }

      // Optionally ignore stylelint commands
      if (
        comment.text.indexOf(stylelintCommandPrefix) === 0
        && optionsHaveIgnored(options, "stylelint-commands")
      ) { return }

      // Optionally ignore newlines between comments
      const prev = comment.prev()
      if (
        prev && prev.type === "comment"
        && optionsHaveIgnored(options, "between-comments")
      ) { return }

      if (comment.raws.inline || comment.inline) { return }

      const before = comment.raw("before")

      // Ignore shared-line comments
      if (before.indexOf("\n") === -1) { return }

      const expectEmptyLineBefore = (() => {
        if (
          optionsHaveException(options, "first-nested")
          && comment.parent !== root
          && comment === comment.parent.first
        ) { return false }
        return expectation === "always"
      })()

      const hasEmptyLineBefore = hasEmptyLine(before)

      // Return if the expectation is met
      if (expectEmptyLineBefore === hasEmptyLineBefore) { return }

      const message = expectEmptyLineBefore ? messages.expected : messages.rejected

      report({
        message,
        node: comment,
        result,
        ruleName,
      })
    })
  }
}


text:
// flow-typed signature: c3d0bd194c6d5a94b63282344c85af34
// flow-typed version: <<STUB>>/gh-pages_v1/flow_v0.45.0

/**
 * This is an autogenerated libdef stub for:
 *
 *   'gh-pages'
 *
 * Fill this stub out by replacing all the `any` types.
 *
 * Once filled out, we encourage you to share your work with the
 * community by sending a pull request to:
 * https://github.com/flowtype/flow-typed
 */

declare module 'gh-pages' {
  declare module.exports: any;
}

/**
 * We include stubs for each file inside this npm package in case you need to
 * require those files directly. Feel free to delete any files that aren't
 * needed.
 */
declare module 'gh-pages/lib/git' {
  declare module.exports: any;
}

declare module 'gh-pages/lib/index' {
  declare module.exports: any;
}

declare module 'gh-pages/lib/util' {
  declare module.exports: any;
}

declare module 'gh-pages/plugin' {
  declare module.exports: any;
}

declare module 'gh-pages/test/bin/gh-pages.spec' {
  declare module.exports: any;
}

declare module 'gh-pages/test/helper' {
  declare module.exports: any;
}

declare module 'gh-pages/test/integration/basic.spec' {
  declare module.exports: any;
}

declare module 'gh-pages/test/integration/dest.spec' {
  declare module.exports: any;
}

declare module 'gh-pages/test/integration/fixtures/include/expected/good' {
  declare module.exports: any;
}

declare module 'gh-pages/test/integration/fixtures/include/local/good' {
  declare module.exports: any;
}

declare module 'gh-pages/test/integration/include.spec' {
  declare module.exports: any;
}

declare module 'gh-pages/test/lib/util.spec' {
  declare module.exports: any;
}

// Filename aliases
declare module 'gh-pages/lib/git.js' {
  declare module.exports: $Exports<'gh-pages/lib/git'>;
}
declare module 'gh-pages/lib/index.js' {
  declare module.exports: $Exports<'gh-pages/lib/index'>;
}
declare module 'gh-pages/lib/util.js' {
  declare module.exports: $Exports<'gh-pages/lib/util'>;
}
declare module 'gh-pages/plugin.js' {
  declare module.exports: $Exports<'gh-pages/plugin'>;
}
declare module 'gh-pages/test/bin/gh-pages.spec.js' {
  declare module.exports: $Exports<'gh-pages/test/bin/gh-pages.spec'>;
}
declare module 'gh-pages/test/helper.js' {
  declare module.exports: $Exports<'gh-pages/test/helper'>;
}
declare module 'gh-pages/test/integration/basic.spec.js' {
  declare module.exports: $Exports<'gh-pages/test/integration/basic.spec'>;
}
declare module 'gh-pages/test/integration/dest.spec.js' {
  declare module.exports: $Exports<'gh-pages/test/integration/dest.spec'>;
}
declare module 'gh-pages/test/integration/fixtures/include/expected/good.js' {
  declare module.exports: $Exports<'gh-pages/test/integration/fixtures/include/expected/good'>;
}
declare module 'gh-pages/test/integration/fixtures/include/local/good.js' {
  declare module.exports: $Exports<'gh-pages/test/integration/fixtures/include/local/good'>;
}
declare module 'gh-pages/test/integration/include.spec.js' {
  declare module.exports: $Exports<'gh-pages/test/integration/include.spec'>;
}
declare module 'gh-pages/test/lib/util.spec.js' {
  declare module.exports: $Exports<'gh-pages/test/lib/util.spec'>;
}


text:
<?php

namespace JMS\SecurityExtraBundle\DependencyInjection;

use Symfony\Component\Config\Definition\ConfigurationInterface;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;

/**
 * Enhances the access_control section configuration.
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */
class AccessControlConfiguration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     *
     * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
     */
    public function getConfigTreeBuilder()
    {
        $tb = new TreeBuilder();
        $rootNode = $tb->root('security');

        $rootNode
            ->ignoreExtraKeys()
            ->fixXmlConfig('rule', 'access_control')
            ->children()
                ->arrayNode('access_control')
                    ->cannotBeOverwritten()
                    ->prototype('array')
                        ->fixXmlConfig('role')
                        ->validate()
                            ->always(function($v) {
                                if (!empty($v['roles']) && isset($v['access'])) {
                                    throw new \Exception('"roles", and "access" cannot be set at the same time.');
                                }

                                if (empty($v['roles'])) {
                                    unset($v['roles']);
                                }

                                return $v;
                            })
                        ->end()
                        ->children()
                            ->scalarNode('requires_channel')->defaultNull()->end()
                            ->scalarNode('path')->defaultNull()->end()
                            ->scalarNode('host')->defaultNull()->end()
                            ->scalarNode('ip')->defaultNull()->end()
                            ->arrayNode('methods')
                                ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end()
                                ->prototype('scalar')->end()
                            ->end()
                            ->arrayNode('roles')
                                ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end()
                                ->prototype('scalar')->end()
                            ->end()
                            ->scalarNode('access')->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $tb;
    }
}


text:
'use strict';

import React from 'react';
import { connect } from 'react-redux'
import { createSelector } from 'reselect'

//var ReactTags = require('react-tag-input').WithOutContext;
import { WithOutContext as ReactTags } from 'react-tag-input';

import {getDefaultManager, drawFrame, throttle} from '../api/maggo';

import { actionWidgetTag } from '../actions/index';

const addToTag = actionWidgetTag.addToTag;

require('styles//Tags.scss');

class TagsComponent extends React.Component {
  constructor(props, context) {
    super(props, context);

    const {widgetBlocks} = props;
    const {tags} = widgetBlocks;

    let immutableTags = [];
    if(tags){
      immutableTags = tags.split(', ').map((item, index, arr) => ({
        id: index,
        text: arr.length-1 == index ? item : item+','
      }));
    }

    this.state = {
      tags: immutableTags,
      suggestions: ['']
    };

    this.throttleHandleDrag = throttle(this.handleDrag.bind(this), 400);
  }

  saveTags(objectTags){
    const {addToTag} = this.props;
    const arrTags = objectTags.tags.map(item=>(item.text.substring(0, item.text.length - 1)));
    const stringTag = arrTags.join(', ');
    addToTag(stringTag)
  }

  handleDelete(i) {
    const state = this.state;
    let prevTags = null;
    if(i == state.tags.length-1 && state.tags.length-1 !=0){
      prevTags = state.tags[i-1];
      prevTags.text = prevTags.text.substring(0, prevTags.text.length - 1);
    }
    const nextState = drawFrame(state)({
      tags: {
        $splice: prevTags ? [[i, 1],[i-1, 1, prevTags]] : [[i, 1],[0,0]]
      }
    });
    this.setState(nextState);
    this.saveTags.call(this, nextState);
  }
  handleAddition(tag) {
    const state = this.state;
    const tags = state.tags;
    let prevTags = null;
    if(tags.length){
      prevTags = tags[tags.length-1];
      prevTags.text = prevTags.text+',';
    }

    const nextState = drawFrame(state)({
      tags: {
        $splice: prevTags ? [[tags.length-1, 1, prevTags]] : [[0,0]],
        $push: [{
          id: tags.length + 1,
          text: tag
        }]
      }
    });

    this.setState(nextState);
    this.saveTags.call(this, nextState);
  }
  handleDrag(/*tag, currPos, newPos*/) {
    return false;

    //const state = this.state;
    //
    //const nextState = drawFrame(state)({
    //  tags: {
    //    $splice: [[currPos, 1], [newPos, 0, tag]]
    //  }
    //});
    //
    //this.setState(nextState);
    //this.saveTags.call(this, nextState);
  }

  render() {
    const {tags, suggestions} = this.state;
    return (
      <div className="tags-component">
        <ReactTags tags={tags}
                   autofocus={false}
                   suggestions={suggestions}
                   handleDelete={this.handleDelete.bind(this)}
                   handleAddition={this.handleAddition.bind(this)}
                   handleDrag={this.throttleHandleDrag.bind(this)}/>
      </div>
    );
  }
}

TagsComponent.displayName = 'TagsComponent';

// Uncomment properties you need
// TagsComponent.propTypes = {};
// TagsComponent.defaultProps = {};

const getWidgetBlocksState = state => state.WidgetBlocks;

const select = createSelector([getWidgetBlocksState], (widgetBlocks) => {
  return {widgetBlocks};
});

//const Backend = !!(md.mobile()|| md.phone() || md.tablet())? TouchBackend : HTML5Backend;

export default connect(select, {addToTag})(getDefaultManager()(TagsComponent));