text:
myapp.controller('NameController', function($scope, $http) {
    $scope.resultajax;
    $scope.inputname;
    $scope.dialogs = {};

    ons.ready(function() {
        console.log("NameController is ready!");

        var parameter = {
            Employee_ID:"1",
        }
        console.log("start ajax!");
        console.log("user_uid = " + $scope.user_uid);

        $http({
            method: 'POST',
            url:"https://labo.ef-4.co.jp/deepblue/kintaiApp/profile_call_name/",
            data:{
                "Employee_ID":$scope.user_uid,
            }
        }).
        success(function(data) {
            console.log(data);
            //console.log(status);
            //console.log(headers);
            console.log("ajax successed");
            $scope.resultajax="success";
            var prenamae = data.Namae;
            console.log(prenamae);
            //$scope.$apply(function () {
                $scope.preusername = prenamae;
            //});

          }).
          error(function(data, status, headers, config) {
             console.log(status);
             console.log(data);
             console.log(headers);
             console.log("ajax failed");
             $scope.resultajax="failed";
          });
    });

    this.click = function(){
        console.log("inputname = " + $scope.inputname);
        var inputname = $scope.inputname
        $http({
             method: 'POST',
               url:"https://labo.ef-4.co.jp/deepblue/kintaiApp/profile_sub_name/",
               data:{
                        "Employee_ID":$scope.user_uid,"Profile_Data_Name_Changed":inputname
        }
               }
          ).
          success(function(data) {
             console.log(data);
             //console.log(status);
             //console.log(headers);
             console.log("ajax successed");
             console.log(data);
             $scope.resultajax="変更に成功しました。";
             console.log("resultajax=" + $scope.resultajax);
             ons.createDialog('view/d_name.html', {parentScope: $scope}).then(function(dialog) {
                dialog.show();
            });
            $scope.tabNavigator.pushPage("index.html");
          }).
          error(function(data, status, headers, config) {
             console.log(status);
             console.log(data);
             console.log(headers);
             $scope.resultajax="変更に失敗しました。もう一度お試しください。";
             console.log("resultajax=" + $scope.resultajax);
             ons.createDialog('view/d_name.html', {parentScope: $scope}).then(function(dialog) {
                dialog.show();
            });
          });

    };

});

//console.log("NameController is ready!");


text:
class ConnectionPool
  class Wrapper < ::BasicObject
    METHODS = [:with, :pool_shutdown, :wrapped_pool]

    def initialize(options = {}, &block)
      @pool = options.fetch(:pool) { ::ConnectionPool.new(options, &block) }
    end

    def wrapped_pool
      @pool
    end

    def with(&block)
      @pool.with(&block)
    end

    def pool_shutdown(&block)
      @pool.shutdown(&block)
    end

    def pool_size
      @pool.size
    end

    def pool_available
      @pool.available
    end

    def respond_to?(id, *args)
      METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
    end

    # rubocop:disable Style/MethodMissingSuper
    # rubocop:disable Style/MissingRespondToMissing
    if ::RUBY_VERSION >= "3.0.0"
      def method_missing(name, *args, **kwargs, &block)
        with do |connection|
          connection.send(name, *args, **kwargs, &block)
        end
      end
    elsif ::RUBY_VERSION >= "2.7.0"
      ruby2_keywords def method_missing(name, *args, &block)
        with do |connection|
          connection.send(name, *args, &block)
        end
      end
    else
      def method_missing(name, *args, &block)
        with do |connection|
          connection.send(name, *args, &block)
        end
      end
    end
    # rubocop:enable Style/MethodMissingSuper
    # rubocop:enable Style/MissingRespondToMissing
  end
end

redpajama_set_name: RedPajamaGithub


text:
export default class Action {

	static blah = 'blah';

	static doSomethingThatSucceeds() {
	    return 'success';
	}

	static doSomethingThatFails() {
	    throw new Error();
	}

	static doSomethingAsynchronouslyThatSucceeds() {
		return new Promise(resolve => {
			resolve('success');
		});
	}

	static doSomethingAsynchronouslyThatFails() {
		return new Promise(resolve => {
			throw new Error();
		});
	}

	static somethingThatRequiresArgs(arg1, arg2, options = {fail:false}) {
		if(options.fail) {
			throw new Error();
		}
		return `${this.blah} ${arg1} ${arg2}`;
	}

	static somethingAsynchronousThatRequiresArgs(arg1, arg2, options = {fail:false}) {
		return new Promise((resolve, reject) => {
			if(options.fail) {
				reject(new Error());
			}
			resolve(`${this.blah} ${arg1} ${arg2}`);
		});

	}
}


text:
<?php

/**
 * Bundle configuration
 *
 * @author Andrey F. Mindubaev <covex.mobile@gmail.com>
 * @license http://opensource.org/licenses/MIT  MIT License
 */
namespace Apnet\LayoutBundle\DependencyInjection;

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

/**
 * Bundle configuration
 *
 * @link http://symfony.com/doc/current/cookbook/bundles/extension.html
 */
class Configuration implements ConfigurationInterface
{

  /**
   * {@inheritdoc}
   */
  public function getConfigTreeBuilder()
  {
    $treeBuilder = new TreeBuilder();
    /* $rootNode = */$treeBuilder->root('apnet_layout');

    return $treeBuilder;
  }
}


text:
from captcha.conf import settings
from captcha.models import CaptchaStore
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse

import datetime

class CaptchaCase(TestCase):
    urls = 'captcha.tests.urls'

    def setUp(self):
        self.default_challenge = settings.get_challenge()()
        self.math_challenge = settings._callable_from_string('captcha.helpers.math_challenge')()
        self.chars_challenge = settings._callable_from_string('captcha.helpers.random_char_challenge')()
        self.unicode_challenge = settings._callable_from_string('captcha.helpers.unicode_challenge')()

        self.default_store, created =  CaptchaStore.objects.get_or_create(challenge=self.default_challenge[0],response=self.default_challenge[1])
        self.math_store, created = CaptchaStore.objects.get_or_create(challenge=self.math_challenge[0],response=self.math_challenge[1])
        self.chars_store, created = CaptchaStore.objects.get_or_create(challenge=self.chars_challenge[0],response=self.chars_challenge[1])
        self.unicode_store, created = CaptchaStore.objects.get_or_create(challenge=self.unicode_challenge[0],response=self.unicode_challenge[1])

    def testImages(self):
        for key in (self.math_store.hashkey, self.chars_store.hashkey, self.default_store.hashkey, self.unicode_store.hashkey):
            response = self.client.get(reverse('captcha-image',kwargs=dict(key=key)))
            self.failUnlessEqual(response.status_code, 200)
            self.assertTrue(response.has_header('content-type'))
            self.assertEquals(response._headers.get('content-type'), ('Content-Type', 'image/png'))

    def testAudio(self):
        if not settings.CAPTCHA_FLITE_PATH:
            return
        for key in (self.math_store.hashkey, self.chars_store.hashkey, self.default_store.hashkey, self.unicode_store.hashkey):
            response = self.client.get(reverse('captcha-audio',kwargs=dict(key=key)))
            self.failUnlessEqual(response.status_code, 200)
            self.assertTrue(len(response.content) > 1024)
            self.assertTrue(response.has_header('content-type'))
            self.assertEquals(response._headers.get('content-type'), ('Content-Type', 'audio/x-wav'))

    def testFormSubmit(self):
        r = self.client.get(reverse('captcha-test'))
        self.failUnlessEqual(r.status_code, 200)
        hash_ = r.content[r.content.find('value="')+7:r.content.find('value="')+47]
        try:
            response = CaptchaStore.objects.get(hashkey=hash_).response
        except:
            self.fail()

        r = self.client.post(reverse('captcha-test'), dict(captcha_0=hash_,captcha_1=response, subject='xxx', sender='asasd@asdasd.com'))
        self.failUnlessEqual(r.status_code, 200)
        self.assertTrue(r.content.find('Form validated') > 0)

        r = self.client.post(reverse('captcha-test'), dict(captcha_0=hash_,captcha_1=response, subject='xxx', sender='asasd@asdasd.com'))
        self.failUnlessEqual(r.status_code, 200)
        self.assertFalse(r.content.find('Form validated') > 0)

    def testWrongSubmit(self):
        r = self.client.get(reverse('captcha-test'))
        self.failUnlessEqual(r.status_code, 200)
        r = self.client.post(reverse('captcha-test'), dict(captcha_0='abc',captcha_1='wrong response', subject='xxx', sender='asasd@asdasd.com'))
        self.assertFormError(r,'form','captcha',_('Invalid CAPTCHA'))

    def testDeleteExpired(self):
        self.default_store.expiration = datetime.datetime.now() - datetime.timedelta(minutes=5)
        self.default_store.save()
        hash_ = self.default_store.hashkey
        r = self.client.post(reverse('captcha-test'), dict(captcha_0=hash_,captcha_1=self.default_store.response, subject='xxx', sender='asasd@asdasd.com'))

        self.failUnlessEqual(r.status_code, 200)
        self.assertFalse(r.content.find('Form validated') > 0)

        # expired -> deleted
        try:
            CaptchaStore.objects.get(hashkey=hash_)
            self.fail()
        except:
            pass

    def testCustomErrorMessage(self):
        r = self.client.get(reverse('captcha-test-custom-error-message'))
        self.failUnlessEqual(r.status_code, 200)

        # Wrong answer
        r = self.client.post(reverse('captcha-test-custom-error-message'), dict(captcha_0='abc',captcha_1='wrong response'))
        self.assertFormError(r,'form','captcha','TEST CUSTOM ERROR MESSAGE')
        # empty answer
        r = self.client.post(reverse('captcha-test-custom-error-message'), dict(captcha_0='abc',captcha_1=''))
        self.assertFormError(r,'form','captcha',_('This field is required.'))

    def testRepeatedChallenge(self):
        store = CaptchaStore.objects.create(challenge='xxx',response='xxx')
        try:
            store2 = CaptchaStore.objects.create(challenge='xxx',response='xxx')
        except Exception:
            self.fail()

    def testRepeatedChallengeFormSubmit(self):
        settings.CAPTCHA_CHALLENGE_FUNCT = 'captcha.tests.trivial_challenge'

        r1 = self.client.get(reverse('captcha-test'))
        r2 = self.client.get(reverse('captcha-test'))
        self.failUnlessEqual(r1.status_code, 200)
        self.failUnlessEqual(r2.status_code, 200)
        hash_1 = r1.content[r1.content.find('value="')+7:r1.content.find('value="')+47]
        hash_2 = r2.content[r2.content.find('value="')+7:r2.content.find('value="')+47]
        try:
            store_1 = CaptchaStore.objects.get(hashkey=hash_1)
            store_2 = CaptchaStore.objects.get(hashkey=hash_2)
        except:
            self.fail()

        self.assertTrue(store_1.pk != store_2.pk)
        self.assertTrue(store_1.response == store_2.response)
        self.assertTrue(hash_1 != hash_2)

        r1 = self.client.post(reverse('captcha-test'), dict(captcha_0=hash_1,captcha_1=store_1.response, subject='xxx', sender='asasd@asdasd.com'))
        self.failUnlessEqual(r1.status_code, 200)
        self.assertTrue(r1.content.find('Form validated') > 0)

        try:
            store_2 = CaptchaStore.objects.get(hashkey=hash_2)
        except:
            self.fail()

        r2 = self.client.post(reverse('captcha-test'), dict(captcha_0=hash_2,captcha_1=store_2.response, subject='xxx', sender='asasd@asdasd.com'))
        self.failUnlessEqual(r2.status_code, 200)
        self.assertTrue(r2.content.find('Form validated') > 0)

    def testOutputFormat(self):
        settings.CAPTCHA_OUTPUT_FORMAT =  u'%(image)s
Hello, captcha world
%(hidden_field)s%(text_field)s'
        r = self.client.get(reverse('captcha-test'))
        self.failUnlessEqual(r.status_code, 200)
        self.assertTrue('
Hello, captcha world
' in r.content)

    def testInvalidOutputFormat(self):
        settings.CAPTCHA_OUTPUT_FORMAT =  u'%(image)s'
        try:
            r = self.client.get(reverse('captcha-test'))
            self.fail()
        except ImproperlyConfigured,e:
            self.failUnless('CAPTCHA_OUTPUT_FORMAT' in unicode(e))

    def testPerFormFormat(self):
        settings.CAPTCHA_OUTPUT_FORMAT =  u'%(image)s testCustomFormatString %(hidden_field)s %(text_field)s'
        r = self.client.get(reverse('captcha-test'))
        self.failUnless('testCustomFormatString' in r.content)
        r = self.client.get(reverse('test_per_form_format'))
        self.failUnless('testPerFieldCustomFormatString' in r.content)

def trivial_challenge():
    return 'trivial','trivial'


text:
namespace ag
{

Scene::Scene(EntityManager& entityManager) : entityManager_{entityManager}
{
}

void Scene::registerComponentManager(ComponentManagerBase& componentManager)
{
	componentManagers_.insert(&componentManager);
}

void Scene::unregisterComponentManager(ComponentManagerBase& componentManager)
{
	componentManagers_.erase(&componentManager);
}

void Scene::showGUI(ID id)
{
	for (auto& man : componentManagers_) {
		man->showGUI(id);
	}
}

ComponentManagerBase* Scene::getComponentManager(std::type_index ti)
{
	for (auto man : componentManagers_) {
		if (ti == typeid(*man)) {
			return man;
		}
	}
	return nullptr;
}

}


text:
Monitoring DataHub's system components is critical for operating and improving DataHub. This doc explains how to add
tracing and metrics measurements in the DataHub containers.

## Tracing

Traces let us track the life of a request across multiple components. Each trace is consisted of multiple spans, which
are units of work, containing various context about the work being done as well as time taken to finish the work. By
looking at the trace, we can more easily identify performance bottlenecks.

We enable tracing by using
the [OpenTelemetry java instrumentation library](https://github.com/open-telemetry/opentelemetry-java-instrumentation).
This project provides a Java agent JAR that is attached to java applications. The agent injects bytecode to capture
telemetry from popular libraries.

Using the agent we are able to

1) Plug and play different tracing tools based on the user's setup: Jaeger, Zipkin, or other tools
2) Get traces for Kafka, JDBC, and Elasticsearch without any additional code
3) Track traces of any function with a simple `@WithSpan` annotation

You can enable the agent by setting env variable `ENABLE_OTEL` to `true` for GMS and MAE/MCE consumers. In our
example [docker-compose](../../docker/monitoring/docker-compose.monitoring.yml), we export metrics to a local Jaeger
instance by setting env variable `OTEL_TRACES_EXPORTER` to `jaeger`
and `OTEL_EXPORTER_JAEGER_ENDPOINT` to `http://jaeger-all-in-one:14250`, but you can easily change this behavior by
setting the correct env variables. Refer to
this [doc](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md) for
all configs.

Once the above is set up, you should be able to see a detailed trace as a request is sent to GMS. We added
the `@WithSpan` annotation in various places to make the trace more readable. You should start to see traces in the
tracing collector of choice. Our example [docker-compose](../../docker/monitoring/docker-compose.monitoring.yml) deploys
an instance of Jaeger with port 16686. The traces should be available at http://localhost:16686.

## Metrics

With tracing, we can observe how a request flows through our system into the persistence layer. However, for a more
holistic picture, we need to be able to export metrics and measure them across time. Unfortunately, OpenTelemetry's java
metrics library is still in active development.

As such, we decided to use [Dropwizard Metrics](https://metrics.dropwizard.io/4.2.0/) to export custom metrics to JMX,
and then use [Prometheus-JMX exporter](https://github.com/prometheus/jmx_exporter) to export all JMX metrics to
Prometheus. This allows our code base to be independent of the metrics collection tool, making it easy for people to use
their tool of choice. You can enable the agent by setting env variable `ENABLE_PROMETHEUS` to `true` for GMS and MAE/MCE
consumers. Refer to this example [docker-compose](../../docker/monitoring/docker-compose.monitoring.yml) for setting the
variables.

In our example [docker-compose](../../docker/monitoring/docker-compose.monitoring.yml), we have configured prometheus to
scrape from 4318 ports of each container used by the JMX exporter to export metrics. We also configured grafana to
listen to prometheus and create useful dashboards. By default, we provide two
dashboards: [JVM dashboard](https://grafana.com/grafana/dashboards/14845) and DataHub dashboard.

In the JVM dashboard, you can find detailed charts based on JVM metrics like CPU/memory/disk usage. In the DataHub
dashboard, you can find charts to monitor each endpoint and the kafka topics. Using the example implementation, go
to http://localhost:3001 to find the grafana dashboards! (Username: admin, PW: admin)

To make it easy to track various metrics within the code base, we created MetricUtils class. This util class creates a
central metric registry, sets up the JMX reporter, and provides convenient functions for setting up counters and timers.
You can run the following to create a counter and increment.

```java
MetricUtils.counter(this.getClass(),"metricName").increment();
```

You can run the following to time a block of code.

```java
try(Timer.Context ignored=MetricUtils.timer(this.getClass(),"timerName").timer()){
    ...block of code
    }
```

## Enable monitoring through docker-compose

We provide some example configuration for enabling monitoring in
this [directory](https://github.com/linkedin/datahub/tree/master/docker/monitoring). Take a look at the docker-compose
files, which adds necessary env variables to existing containers, and spawns new containers (Jaeger, Prometheus,
Grafana).

You can add in the above docker-compose using the `-f <<path-to-compose-file>>` when running docker-compose commands.
For instance,

```shell
docker-compose \
  -f quickstart/docker-compose.quickstart.yml \
  -f monitoring/docker-compose.monitoring.yml \
  pull && \
docker-compose -p datahub \
  -f quickstart/docker-compose.quickstart.yml \
  -f monitoring/docker-compose.monitoring.yml \
  up
```

We set up quickstart.sh, dev.sh, and dev-without-neo4j.sh to add the above docker-compose when MONITORING=true. For
instance `MONITORING=true ./docker/quickstart.sh` will add the correct env variables to start collecting traces and
metrics, and also deploy Jaeger, Prometheus, and Grafana. We will soon support this as a flag during quickstart.


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/dl_left"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <!--主布局-->

    <!--    水波纹点击效果的button

    <scrm.view.Button.Button
            style="@style/RaiseWaveColorButtonRippleStyle"
            android:id="@+id/button_bt_raise_wave_color"
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:textColor="#FFFFFFFF"
            android:textAppearance="@style/Base.TextAppearance.AppCompat.Button"
            android:text="BUTTON"
            app:rd_delayClick="afterRelease"/>
    -->

    <FrameLayout
        android:id="@+id/fl_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </FrameLayout>
    <!--侧滑菜单-->
    <RelativeLayout
        android:layout_width="280dp"
        android:layout_height="match_parent"
        android:background="@color/draw_left_bacground"
        android:orientation="vertical"
        android:layout_gravity="start"
        >
        <ListView
            android:id="@+id/lv_left_menu"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:text="DrawerLayout" />
        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="@dimen/drawerlayout_left_item_height"
            android:background="@color/black"/>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="54dp"
            android:orientation="horizontal"
            android:layout_alignParentBottom="true"
            >

            <LinearLayout
                android:id="@+id/account_sync"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:orientation="vertical">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="@dimen/drawerlayout_left_reflush_text_size"
                    android:textColor="@color/white"
                    android:text="账户同步"
                    android:layout_marginLeft="@dimen/drawerlayout_left_reflush_text_left"
                    android:layout_marginTop="@dimen/drawerlayout_left_reflush_text_top"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="@dimen/drawerlayout_left_reflush_time_size"
                    android:textColor="@color/white"
                    android:text="10分钟前"
                    android:layout_marginLeft="@dimen/drawerlayout_left_reflush_text_left"
                    android:layout_gravity="bottom"
                    android:layout_marginBottom="@dimen/drawerlayout_left_reflush_text_top"/>
            </LinearLayout>

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="-100dp"
                android:src="@drawable/draw_left_header_reflush"/>
        </LinearLayout>
    </RelativeLayout>
</android.support.v4.widget.DrawerLayout>


text:
from tornadotoad import my
from tornadotoad import mixin
from tornadotoad import api

def register(api_key=None, environment="production",
             project_root=None, app_version=None,
             log_403=False, log_404=False, log_405=False,
             use_ssl=False):
    """Register a Airbrake API key along with other run-time options.

    Needs to be called early, usually when creating Tornado Application.
    """
    my.registered = True
    my.api_key = api_key
    my.environment = environment
    my.log_403 = log_403
    my.log_404 = log_404
    my.log_405 = log_405
    my.use_ssl = use_ssl
    my.project_root = project_root
    my.app_version = app_version


text:
namespace YAF.UrlRewriter.Parsers;

using System;
using System.Xml;

using YAF.UrlRewriter.Actions;
using YAF.UrlRewriter.Configuration;
using YAF.UrlRewriter.Extensions;
using YAF.UrlRewriter.Utilities;

/// <summary>
/// Action parser for the add-header action.
/// </summary>
public sealed class AddHeaderActionParser : RewriteActionParserBase
{
    /// <summary>
    /// The name of the action.
    /// </summary>
    public override string Name => Constants.ElementAdd;

    /// <summary>
    /// Whether the action allows nested actions.
    /// </summary>
    public override bool AllowsNestedActions => false;

    /// <summary>
    /// Whether the action allows attributes.
    /// </summary>
    public override bool AllowsAttributes => true;

    /// <summary>
    /// Parses the node.
    /// </summary>
    /// <param name="node">The node to parse.</param>
    /// <param name="config">The rewriter configuration.</param>
    /// <returns>The parsed action, or null if no action parsed.</returns>
    public override IRewriteAction Parse(XmlNode node, IRewriterConfiguration config)
    {
        if (node == null)
        {
            throw new ArgumentNullException(nameof(node));
        }

        if (config == null)
        {
            throw new ArgumentNullException(nameof(config));
        }

        var headerName = node.GetOptionalAttribute(Constants.AttrHeader);
        if (headerName == null)
        {
            return null;
        }

        var headerValue = node.GetRequiredAttribute(Constants.AttrValue, true);

        return new AddHeaderAction(headerName, headerValue);
    }
}


text:
<?php

namespace Jojoee\Mediumm\Page404;

get_template_part( 'templates/page', 'header' );

?>

    <?php _e( 'Sorry, but the page you were trying to view does not exist.', 'mediumm' ); ?>

  <?php get_search_form(); ?>


text:
In summary:

- [`byo`](byo) (_Bring Your Own_ hosts) has the most actively maintained
  playbooks for installing, upgrading and performing others tasks on OpenShift
  clusters.
- [`common`](common) has a set of playbooks that are included by playbooks in
  `byo` and others.

And:

- [`adhoc`](adhoc) is a generic home for playbooks and tasks that are community
  supported and not officially maintained.
- [`aws`](aws), [`gce`](gce), [`libvirt`](libvirt) and [`openstack`](openstack)
  are related to the [`bin/cluster`](../bin) tool and its usage is deprecated.

Refer to the `README.md` file in each playbook directory for more information
about them.


text:
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<script src="../../bower_components/page/page.js"></script>
<script>
  window.addEventListener('WebComponentsReady', function() {

    // We use Page.js for routing. This is a Micro
    // client-side router inspired by the Express router
    // More info: https://visionmedia.github.io/page.js/
    page('/', function () {
      app.route = 'home';
    });

    page('/exibir-professores', function () {
      app.route = 'exibir-professores';
    });

    page('/exibir-cursos', function () {
      app.route = 'exibir-cursos';
    });

    page('/exibir-disciplinas', function () {
      app.route = 'exibir-disciplinas';
    });

    page('/exibir-salas', function () {
      app.route = 'exibir-salas';
    });

    page('/exibir-turmas', function () {
      app.route = 'exibir-turmas';
    });

    page('/form-professor', function () {
      app.route = 'form-professor';
    });

    page('/form-disponibilidade', function () {
      app.route = 'form-disponibilidade';
    });

    page('/form-curso', function () {
      app.route = 'form-curso';
    });

    page('/form-disciplina', function () {
      app.route = 'form-disciplina';
    });

    page('/form-sala', function () {
      app.route = 'form-sala';
    });

    page('/form-turma', function () {
      app.route = 'form-turma';
    });

    // add #! before urls
    page({
      hashbang: true
    });

  });
</script>


text:
#include <aws/datapipeline/model/Selector.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::DataPipeline::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

Selector::Selector() :
    m_fieldNameHasBeenSet(false),
    m_operatorHasBeenSet(false)
{
}

Selector::Selector(const JsonValue& jsonValue) :
    m_fieldNameHasBeenSet(false),
    m_operatorHasBeenSet(false)
{
  *this = jsonValue;
}

Selector& Selector::operator =(const JsonValue& jsonValue)
{
  if(jsonValue.ValueExists("fieldName"))
  {
    m_fieldName = jsonValue.GetString("fieldName");

    m_fieldNameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("operator"))
  {
    m_operator = jsonValue.GetObject("operator");

    m_operatorHasBeenSet = true;
  }

  return *this;
}

JsonValue Selector::Jsonize() const
{
  JsonValue payload;

  if(m_fieldNameHasBeenSet)
  {
   payload.WithString("fieldName", m_fieldName);

  }

  if(m_operatorHasBeenSet)
  {
   payload.WithObject("operator", m_operator.Jsonize());

  }

  return std::move(payload);
}


text:
The **J** [programming language][0], developed in the early 1990s by [Kenneth E. Iverson][1] and [Roger Hui][2],[\[4\]][3][\[5\]][4] is a synthesis of [APL][5] (also by Iverson) and the [FP][6] and [FL][7] [function-level][8] languages created by [John Backus][9].[\[6\]][10]

To avoid repeating the APL special-character problem, J uses only the basic [ASCII][11] character set, resorting to the use of the dot and colon as _inflections_[\[7\]][12] to form short words similar to _[digraphs][13]_. Most such "primary" (or "primitive") J words serve as mathematical symbols, with the dot or colon extending the meaning of the basic characters available. Also, many characters which in other languages often must be paired (such as `[] {} "" \`\`` or `<>`) are treated by J as stand-alone words or, when inflected, as single-character roots of multi-character words.

J is a very terse [array programming language][14], and is most suited to [mathematical][15] and [statistical][16] programming, especially when performing operations on [matrices][17]. It has also been used in [extreme programming][18][\[8\]][19] and [network performance][20] analysis.[\[9\]][21]

Like the original FP/FL languages, J supports [function-level programming][22] via its _[tacit programming][23]_ features.

Unlike most languages that support [object-oriented programming][24], J's flexible hierarchical [namespace][25] scheme (where every name exists in a specific _locale_) can be effectively used as a framework for both [class-based][26] and [prototype-based][27] object-oriented programming.

Since March 2011, J is [free and open-source software][28] under the [GPLv3][29] license.[\[10\]][30][\[11\]][31][\[12\]][32] One may also purchase source for commercial use under a negotiated license.[\[13\]][33]

## Examples

J permits [point-free style][23] and [function composition][34]. Thus, its programs can be very terse and are [considered difficult to read][35] by some programmers.

The ["Hello, World!" program][36] in J is

This implementation of hello world reflects the traditional use of J -- programs are entered into a J interpreter session, and the results of expressions are displayed. It's also possible to arrange for J scripts to be executed as standalone programs. Here's how this might look on a [Unix][37] system:

Historically, APL used `/` to indicate the [fold][38], so `+/1 2 3` was equivalent to `1+2+3`. Meanwhile, division was represented with the classic mathematical division symbol (the [obelus][39], ÷), which was implemented by [overstriking][40] a minus sign and a colon (on both EBCDIC and ASCII paper [text terminals][41]). Because ASCII in general does not support overstrikes in a device-independent way, and does not include a division symbol per se, J uses % to represent division, as a visual approximation or reminder. (This illustrates something of the mnemonic character of J's tokens, and some of the quandaries imposed by the use of ASCII.)

Defining a J function named `avg` to calculate the average of a list of numbers yields:

This is a test execution of the function:

`#` counts the number of items in the array. `+/` sums the items of the array.` %` divides the sum by the number of items. Note: _avg_ is defined above using a train of three verbs (`+/`, `%`, and `#`) known as a _fork_. Specifically `(V0 V1 V2) Ny` is the same as `(V0(Ny)) V1 (V2(Ny))` which shows some of the power of J. (Here V0, V1, and V2 denote verbs and Ny denotes a noun.)

Some examples of using `avg`:

[Rank][42] is a crucial concept in J. Its significance in J is similar to the significance of `select` in [SQL][43] and of `while` in [C][44].

Implementing [quicksort][45], from the J Dictionary yields:

The following is an implementation of quicksort demonstrating [tacit programming][23]. Tacit programming involves composing functions together and not referring explicitly to any variables. J's support for _forks_ and _hooks_ dictates rules on how arguments applied to this function will be applied to its component functions.

Sorting in J is usually accomplished using the built-in (primitive) verbs `/:` (sort up) and `\:` (sort down). User-defined sorts such as quicksort, above, typically are for illustration only.

The following expression exhibits [pi][46] with n digits and demonstrates the extended precision abilities of J:

## Data types and structures

J supports three simple types:

Of these, numeric has the most variants.

One of J's numeric types is the _bit_. There are two bit values: _0_, and _1_. Also, bits can be formed into lists. For example, `1 0 1 0 1 1 0 0` is a list of eight bits. Syntactically, the J parser treats that as one word. (The space character is recognized as a word-forming character between what would otherwise be numeric words.) Lists of arbitrary length are supported.

Furthermore, J supports all the usual binary operations on these lists, such as _and_, _or_, _exclusive or_, _rotate_, _shift_, _not_, etc. For example,

Note that J also supports higher order arrays of bits---they can be formed into two-dimensional, three-dimensional, etc. arrays. The above operations perform equally well on these arrays.

Other numeric types include integer (e.g. 3, 42), floating point (3.14, 8.8e22), complex (0j1, 2.5j3e88), extended precision integer (12345678901234567890x), and (extended precision) rational fraction (1r2, 3r4). As with bits, these can be formed into lists or arbitrarily dimensioned arrays. As with bits, operations are performed on all numbers in an array.

Lists of bits can be converted to integer using the `#.` verb. Integers can be converted to lists of bits using the `#:` verb. (When parsing J, `.` (period) and `:` (colon) are word-forming characters. They are never tokens alone, unless preceded by [whitespace characters][47].)

J also supports the literal (character) type. Literals are enclosed in quotes, for example, `'a'` or `'b'`. Lists of literals are also supported using the usual convention of putting multiple characters in quotes, such as `'abcdefg'`. Typically, individual literals are 8-bits wide (ASCII), but J also supports other literals ([Unicode][48]). Numeric and boolean operations are not supported on literals, but collection-oriented operations (such as rotate) are supported.

Finally, there is a boxed data type. Typically, data is put in a box using the `<` operation (with no left argument; if there's a left argument, this would be the _less than_ operation). This is analogous to [C][44]'s `&` operation (with no left argument). However, where the result of C's `&` has reference semantics, the result of J's `<` has value semantics. In other words, < is a function and it produces a result. The result has 0 dimensions, regardless of the structure of the contained data. From the viewpoint of a J programmer, `<` _puts the data into a box_ and allows working with an array of boxes (it can be assembled with other boxes, and/or more copies can be made of the box).

The only collection type offered by J is the arbitrarily dimensioned array. Most algorithms can be expressed very concisely using operations on these arrays.

J's arrays are homogeneously typed, for example the list `1 2 3` is a list of integers despite `1` being a bit. For the most part, these sorts of type issues are transparent to programmers. Only certain specialized operations reveal differences in type. For example, the list `1.0 0.0 1.0 0.0` would be treated exactly the same, by most operations, as the list `1 0 1 0` .

J also supports sparse numeric arrays where non-zero values are stored with their indices. This is an efficient mechanism where relatively few values are non-zero.

J also supports objects and classes,[\[14\]][49] but these are an artifact of the way things are named, and are not data types. Instead, boxed literals are used to refer to objects (and classes). J data has value semantics, but objects and classes need reference semantics.

Another pseudo-type---associated with name, rather than value---is the memory mapped file.

## Documentation

J's documentation includes a [dictionary][50], with words in J identified as [nouns][51], [verbs][52], [modifiers][53], and so on. Primary words are listed in the [vocabulary][54], in which their respective [parts of speech][55] are indicated using markup. Note that verbs have two forms: [monadic][56] (arguments only on the right) and [dyadic][56] (arguments on the left and on the right). For example, in '`-1`' the hyphen is a monadic verb, and in '`3-2`' the hyphen is a dyadic verb. The monadic definition is mostly independent of the dyadic definition, regardless of whether the verb is a primitive verb or a derived verb.

## Control structures

J provides control structures [(details here)][57] similar to other procedural languages. Prominent control words in each category include:

## See also

## References

## External links

[0]: /wiki/Programming_language "Programming language"
[1]: /wiki/Kenneth_E._Iverson "Kenneth E. Iverson"
[2]: /wiki/Roger_Hui "Roger Hui"
[3]: #cite_note-4
[4]: #cite_note-5
[5]: /wiki/APL_(programming_language) "APL (programming language)"
[6]: /wiki/FP_(programming_language) "FP (programming language)"
[7]: /wiki/FL_(programming_language) "FL (programming language)"
[8]: /wiki/Function-level "Function-level"
[9]: /wiki/John_Backus "John Backus"
[10]: #cite_note-6
[11]: /wiki/ASCII "ASCII"
[12]: #cite_note-7
[13]: /wiki/Digraph_(computing) "Digraph (computing)"
[14]: /wiki/Array_programming_language "Array programming language"
[15]: /wiki/Mathematical "Mathematical"
[16]: /wiki/Statistical "Statistical"
[17]: /wiki/Matrix_(mathematics) "Matrix (mathematics)"
[18]: /wiki/Extreme_Programming "Extreme Programming"
[19]: #cite_note-8
[20]: /wiki/Network_performance "Network performance"
[21]: #cite_note-9
[22]: /wiki/Function-level_programming "Function-level programming"
[23]: /wiki/Tacit_programming "Tacit programming"
[24]: /wiki/Object-oriented_programming "Object-oriented programming"
[25]: /wiki/Namespace "Namespace"
[26]: /wiki/Class-based_programming "Class-based programming"
[27]: /wiki/Prototype-based_programming "Prototype-based programming"
[28]: /wiki/Free_and_open-source_software "Free and open-source software"
[29]: /wiki/GNU_General_Public_License "GNU General Public License"
[30]: #cite_note-j_source_download-10
[31]: #cite_note-j_gpl-11
[32]: #cite_note-12
[33]: #cite_note-j_source-13
[34]: /wiki/Function_composition_(computer_science) "Function composition (computer science)"
[35]: /wiki/Write-only_language "Write-only language"
[36]: /wiki/%22Hello,_World!%22_program ""Hello, World!" program"
[37]: /wiki/Unix "Unix"
[38]: /wiki/Fold_(higher-order_function) "Fold (higher-order function)"
[39]: /wiki/Obelus "Obelus"
[40]: /wiki/Overstrike "Overstrike"
[41]: /wiki/Text_terminal "Text terminal"
[42]: /wiki/Rank_(J_programming_language) "Rank (J programming language)"
[43]: /wiki/SQL "SQL"
[44]: /wiki/C_(programming_language) "C (programming language)"
[45]: /wiki/Quicksort "Quicksort"
[46]: /wiki/Pi "Pi"
[47]: /wiki/Whitespace_character "Whitespace character"
[48]: /wiki/Unicode "Unicode"
[49]: #cite_note-14
[50]: http://code.jsoftware.com/wiki/NuVoc
[51]: http://code.jsoftware.com/wiki/Vocabulary/Nouns
[52]: http://code.jsoftware.com/wiki/Vocabulary/Verbs
[53]: http://code.jsoftware.com/wiki/Vocabulary/Modifiers,
[54]: http://code.jsoftware.com/wiki/Vocabulary/Words
[55]: http://code.jsoftware.com/wiki/Vocabulary/PartsOfSpeech
[56]: /wiki/Arity "Arity"
[57]: http://jsoftware.com/help/dictionary/ctrl.htm


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

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

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->
<!DOCTYPE Test SYSTEM "test.dtd">
<!--
Author: Vera Y.Petrashkova
Version: $Revision: 1.5 $
-->
<Test
	ID="testLargeClassName_W1"
        date-of-creation="2005-11-09"
        timeout="1">
    	<Copyright value="apache"/>
        <Author value="Vera Y. Petrashkova"/>
        <Description>
	        Load a lot of classes with wrong large class name;
	        NoClassDefFoundError must be thrown.
        	This performance is repeated several times.
        	Parameters: 0 - wrong or right test
        	            1 - number of iterations
        	            2 - number of used threads
        	            3 - number of iterations
        	            4 - number of used classes
        	            5 - mode (one classloader or many will be used)
        </Description>
        <Keyword name="stress"/>
        <Source name="testLCN.java"/>
        <Source name="../../share/LargeClassName/testLCN_W.java"/>
        <Source name="../../share/LargeClassName/testLCN_0.ccode"/>
        <Source name="../../share/LargeClassName/testLCN.ccode"/>
        <Runner ID="Runtime">
            <Option value="-Dorg.apache.harmony.test.share.stress.ReliabilityRunner.params=
					org.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN {}"/>
            <Option value="-Dorg.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN.arg0=1"/>
            <Option value="-Dorg.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN.arg1=2"/>
            <Option value="-Dorg.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN.arg2=5"/>
            <Option value="-Dorg.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN.arg3=10"/>
            <Option value="-Dorg.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN.arg4=10"/>
            <Option value="-Dorg.apache.harmony.test.stress.classloader.NotSynchThreads.LargeClassName.testLCN.arg5=0"/>
		<Param name="toRun" value="org.apache.harmony.test.share.stress.ReliabilityRunner">
		</Param>
		</Runner>
		<Restriction name="OtherVMOnly"/>
</Test>


text:
/*!
** @file EInt1.h
** @version 01.02
** @brief
**         This component, "ExtInt_LDD", provide a low level API
**         for unified access of external interrupts handling
**         across various device designs.
**         The component uses one pin which generates interrupt on
**         selected edge.
*/
/*!
**  @addtogroup EInt1_module EInt1 module documentation
**  @{
*/

#ifndef __EInt1_H
#define __EInt1_H

/* MODULE EInt1. */

#include "Cpu.h"
/* Include shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
/* Include inherited beans */
#include "GPIO_PDD.h"
#include "PORT_PDD.h"

#include "Cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

/*! Peripheral base address of a device allocated by the component. This constant can be used directly in PDD macros. */
#define EInt1_PRPH_BASE_ADDRESS  0x400FF000U

/* Methods configuration constants - generated for all enabled component's methods */
#define EInt1_Init_METHOD_ENABLED      /*!< Init method of the component EInt1 is enabled (generated) */

/* Events configuration constants - generated for all enabled component's events */
#define EInt1_OnInterrupt_EVENT_ENABLED /*!< OnInterrupt event of the component EInt1 is enabled (generated) */

/* Definition of implementation constants */
#define EInt1_PIN_INDEX 0x0AU          /*!< Index of the used pin from the port */
#define EInt1_PIN_MASK 0x0400U         /*!< Mask of the used pin from the port */

/*
** ===================================================================
**     Method      :  EInt1_Init (component ExtInt_LDD)
*/
/*!
**     @brief
**         This method initializes the associated peripheral(s) and the
**         component internal variables. The method is called
**         automatically as a part of the application initialization
**         code.
**     @param
**         UserDataPtr     - Pointer to the RTOS device
**                           structure. This pointer will be passed to
**                           all events as parameter.
**     @return
**                         - Pointer to the dynamically allocated private
**                           structure or NULL if there was an error.
*/
/* ===================================================================*/
LDD_TDeviceData* EInt1_Init(LDD_TUserData *UserDataPtr);

/*
** ===================================================================
**     Method      :  EInt1_Interrupt (component ExtInt_LDD)
**
**     Description :
**         The method services the interrupt of the selected peripheral(s)
**         and eventually invokes event(s) of the component.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
/* {Default RTOS Adapter} ISR function prototype */
void EInt1_Interrupt(void);

/* END EInt1. */

#ifdef __cplusplus
}  /* extern "C" */
#endif

#endif
/* ifndef __EInt1_H */
/*!
** @}
*/
/*
** ###################################################################
**
**     This file was created by Processor Expert 10.5 [05.21]
**     for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/


text:
<?php

namespace Symfony\Component\EventDispatcher;

use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

trigger_deprecation('symfony/event-dispatcher', '5.1', '%s is deprecated, use the event dispatcher without the proxy.', LegacyEventDispatcherProxy::class);

/**
 * A helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch().
 *
 * @author Nicolas Grekas <p@tchwork.com>
 *
 * @deprecated since Symfony 5.1
 */
final class LegacyEventDispatcherProxy
{
    public static function decorate(?EventDispatcherInterface $dispatcher): ?EventDispatcherInterface
    {
        return $dispatcher;
    }
}


text:
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.home, name='home'),
    url(r'^style-guide/', views.styleguide, name='styleguide'),
]


text:
struct dummy_mutex
{
	bool is_locked;

	dummy_mutex() :
	    is_locked( false)
	{}

	void lock()
	{ is_locked = true; }

	bool try_lock()
	{
	    if ( is_locked)
	        return false;
	    is_locked = true;
	    return true;
	}

	void unlock()
	{ is_locked = false; }
};

void test_lock()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	boost::unique_lock< boost::fibers::mutex > lk( mtx);

	BOOST_CHECK( lk);
	BOOST_CHECK( lk.owns_lock() );

	lk.unlock();

	BOOST_CHECK( ! lk);
	BOOST_CHECK( ! lk.owns_lock() );
}

void test_defer_lock()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	boost::unique_lock< boost::fibers::mutex > lk( mtx, boost::defer_lock);

	BOOST_CHECK( ! lk);
	BOOST_CHECK( ! lk.owns_lock() );

	lk.lock();

	BOOST_CHECK( lk);
	BOOST_CHECK( lk.owns_lock() );
}

void test_adopt_lock()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	mtx.lock();
	boost::unique_lock< boost::fibers::mutex > lk( mtx, boost::adopt_lock);

	BOOST_CHECK( lk);
	BOOST_CHECK( lk.owns_lock() );
}

void test_try_lock()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	boost::unique_lock< boost::fibers::mutex > lk( mtx, boost::defer_lock);

	BOOST_CHECK( ! lk);
	BOOST_CHECK( ! lk.owns_lock() );

	lk.try_lock();

	BOOST_CHECK( lk);
	BOOST_CHECK( lk.owns_lock() );
}

void test_lock_twice()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	boost::unique_lock< boost::fibers::mutex > lk( mtx);

	BOOST_CHECK_THROW( lk.lock(), boost::lock_error);
}

void test_try_lock_twice()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	boost::unique_lock< boost::fibers::mutex > lk( mtx);

	BOOST_CHECK_THROW( lk.try_lock(), boost::lock_error);
}

void test_unlock_twice()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx( sched);
	boost::unique_lock< boost::fibers::mutex > lk( mtx);
	lk.unlock();

	BOOST_CHECK_THROW( lk.unlock(), boost::lock_error);
}

void test_default_ctor()
{
	boost::unique_lock< boost::fibers::mutex > lk;

	BOOST_CHECK( ! lk);
	BOOST_CHECK( ! lk.owns_lock() );
}

void test_lock_concept()
{
	boost::fibers::scheduler<> sched;
    boost::fibers::mutex mtx1( sched), mtx2( sched), mtx3( sched);

    boost::fibers::mutex::scoped_lock lk1( mtx1, boost::defer_lock),
        lk2( mtx2, boost::defer_lock),
        lk3( mtx3, boost::defer_lock);

    BOOST_CHECK( ! lk1.owns_lock() );
    BOOST_CHECK( ! lk2.owns_lock() );
    BOOST_CHECK( ! lk3.owns_lock() );

    boost::lock( lk1, lk2, lk3);

    BOOST_CHECK( lk1.owns_lock() );
    BOOST_CHECK( lk2.owns_lock() );
    BOOST_CHECK( lk3.owns_lock() );
}

void test_try_lock_concept()
{
    dummy_mutex mtx1, mtx2;
    mtx2.lock();

    boost::unique_lock< dummy_mutex > lk1( mtx1, boost::defer_lock),
        lk2( mtx2, boost::defer_lock);

    int res = boost::try_lock( lk1, lk2);

    BOOST_CHECK( res == 1);
    BOOST_CHECK( ! mtx1.is_locked);
    BOOST_CHECK( mtx2.is_locked);
    BOOST_CHECK( ! lk1.owns_lock() );
    BOOST_CHECK( ! lk2.owns_lock() );
}

void test_swap()
{
	boost::fibers::scheduler<> sched;
	boost::fibers::mutex mtx1( sched), mtx2( sched);

	boost::unique_lock< boost::fibers::mutex > lk1( mtx1), lk2( mtx2);

	BOOST_CHECK_EQUAL( lk1.mutex(), & mtx1);
	BOOST_CHECK_EQUAL( lk2.mutex(), & mtx2);

	lk1.swap( lk2);

	BOOST_CHECK_EQUAL( lk1.mutex(), & mtx2);
	BOOST_CHECK_EQUAL( lk2.mutex(), & mtx1);
}

boost::unit_test::test_suite * init_unit_test_suite( int, char* [])
{
    boost::unit_test_framework::test_suite * test =
		BOOST_TEST_SUITE("Boost.Fiber: lock test suite");

    test->add( BOOST_TEST_CASE( & test_lock) );
    test->add( BOOST_TEST_CASE( & test_defer_lock) );
    test->add( BOOST_TEST_CASE( & test_adopt_lock) );
    test->add( BOOST_TEST_CASE( & test_try_lock) );
    test->add( BOOST_TEST_CASE( & test_lock_twice) );
    test->add( BOOST_TEST_CASE( & test_try_lock_twice) );
    test->add( BOOST_TEST_CASE( & test_unlock_twice) );
    test->add( BOOST_TEST_CASE( & test_default_ctor) );
    test->add( BOOST_TEST_CASE( & test_lock_concept) );
    test->add( BOOST_TEST_CASE( & test_try_lock_concept) );
    test->add( BOOST_TEST_CASE( & test_swap) );

	return test;
}


text:
using UnityEngine;
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_PhysicMaterial : LuaObject {
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int constructor(IntPtr l) {
		try {
			int argc = LuaDLL.lua_gettop(l);
			UnityEngine.PhysicMaterial o;
			if(argc==1){
				o=new UnityEngine.PhysicMaterial();
				pushValue(l,o);
				return 1;
			}
			else if(argc==2){
				System.String a1;
				checkType(l,2,out a1);
				o=new UnityEngine.PhysicMaterial(a1);
				pushValue(l,o);
				return 1;
			}
			LuaDLL.luaL_error(l,"New object failed.");
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_dynamicFriction(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushValue(l,self.dynamicFriction);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_dynamicFriction(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.dynamicFriction=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_staticFriction(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushValue(l,self.staticFriction);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_staticFriction(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.staticFriction=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_bounciness(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushValue(l,self.bounciness);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_bounciness(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.bounciness=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_frictionDirection2(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushValue(l,self.frictionDirection2);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_frictionDirection2(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			UnityEngine.Vector3 v;
			checkType(l,2,out v);
			self.frictionDirection2=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_dynamicFriction2(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushValue(l,self.dynamicFriction2);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_dynamicFriction2(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.dynamicFriction2=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_staticFriction2(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushValue(l,self.staticFriction2);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_staticFriction2(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.staticFriction2=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_frictionCombine(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushEnum(l,(int)self.frictionCombine);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_frictionCombine(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			UnityEngine.PhysicMaterialCombine v;
			checkEnum(l,2,out v);
			self.frictionCombine=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_bounceCombine(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			pushEnum(l,(int)self.bounceCombine);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_bounceCombine(IntPtr l) {
		try {
			UnityEngine.PhysicMaterial self=(UnityEngine.PhysicMaterial)checkSelf(l);
			UnityEngine.PhysicMaterialCombine v;
			checkEnum(l,2,out v);
			self.bounceCombine=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	static public void reg(IntPtr l) {
		getTypeTable(l,"UnityEngine.PhysicMaterial");
		addMember(l,"dynamicFriction",get_dynamicFriction,set_dynamicFriction,true);
		addMember(l,"staticFriction",get_staticFriction,set_staticFriction,true);
		addMember(l,"bounciness",get_bounciness,set_bounciness,true);
		addMember(l,"frictionDirection2",get_frictionDirection2,set_frictionDirection2,true);
		addMember(l,"dynamicFriction2",get_dynamicFriction2,set_dynamicFriction2,true);
		addMember(l,"staticFriction2",get_staticFriction2,set_staticFriction2,true);
		addMember(l,"frictionCombine",get_frictionCombine,set_frictionCombine,true);
		addMember(l,"bounceCombine",get_bounceCombine,set_bounceCombine,true);
		createTypeMetatable(l,constructor, typeof(UnityEngine.PhysicMaterial),typeof(UnityEngine.Object));
	}
}


text:
<?php

namespace RM\MailPanel\DI;

use Nette\Configurator;
use Nette\DI\Compiler;
use Nette\DI\CompilerExtension;
use Nette\DI\Helpers;

class MailPanelExtension extends CompilerExtension
{
	/** @var [] */
	public $defaults = [
		'newMessageTime' => '-2 seconds',
		'show' => ['subject', 'from', 'to'],
		'autoremove' => '-5 seconds',
		'hideEmpty' => TRUE,
		'debugger' => TRUE,
		'tempDir' => '%tempDir%/mails',
	];

	/**
	 * Method setings extension.
	 */
	public function beforeCompile()
	{
		$builder = $this->getContainerBuilder();

		$this->validateConfig($this->defaults);
		$config = $this->getConfig($this->defaults);

		foreach ($builder->findByType('Nette\Mail\IMailer') as $name => $def) {
			$builder->removeDefinition($name);
		}

		if ($config['debugger'] && interface_exists('Tracy\IBarPanel')) {
			$builder->addDefinition($this->prefix('panel'))
				->setClass('RM\MailPanel')
				->addSetup('$newMessageTime', [$config['newMessageTime']])
				->addSetup('$show', [array_unique($config['show'])])
				->addSetup('$autoremove', [$config['autoremove']])
				->addSetup('$hideEmpty', [$config['hideEmpty']]);
		}

		$builder->addDefinition($this->prefix('mailer'))
			->setClass('RM\FileMailer', [Helpers::expand($config['tempDir'], $builder->parameters)])
			->addSetup('@RM\MailPanel::setFileMailer', ['@self'])
			->addSetup('@Tracy\Bar::addPanel', [$this->prefix('@panel')]);
	}

	/**
	 * Register extension to DI Container.
	 * @param  Configurator $config
	 */
	public static function register(Configurator $config)
	{
		$config->onCompile[] = function (Configurator $config, Compiler $compiler) {
			$compiler->addExtension('mailPanel', new MailPanelExtension());
		};
	}

}