text:
Executing queries from Arangosh
===============================

Within the ArangoDB shell, the *_query* and *_createStatement* methods of the
*db* object can be used to execute AQL queries. This chapter also describes
how to use bind parameters, counting, statistics and cursors.

### with db._query

One can execute queries with the *_query* method of the *db* object.
This will run the specified query in the context of the currently
selected database and return the query results in a cursor. The results of the cursor
can be printed using its *toArray* method:

    @startDocuBlockInline 01_workWithAQL_all
    @EXAMPLE_ARANGOSH_OUTPUT{01_workWithAQL_all}
    ~addIgnoreCollection("mycollection")
    db._create("mycollection")
    db.mycollection.save({ _key: "testKey", Hello : "World" })
    db._query('FOR my IN mycollection RETURN my._key').toArray()
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 01_workWithAQL_all

#### db._query Bind parameters

To pass bind parameters into a query, they can be specified as second argument to the
*_query* method:

    @startDocuBlockInline 02_workWithAQL_bindValues
    @EXAMPLE_ARANGOSH_OUTPUT{02_workWithAQL_bindValues}
    |db._query(
    | 'FOR c IN @@collection FILTER c._key == @key RETURN c._key', {
    |   '@collection': 'mycollection',
    |   'key': 'testKey'
    }).toArray();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 02_workWithAQL_bindValues

#### ES6 template strings

It is also possible to use ES6 template strings for generating AQL queries. There is
a template string generator function named *aql*; we call it once to demonstrate
its result, and once putting it directly into the query:

```js
var key = 'testKey';
aql`FOR c IN mycollection FILTER c._key == ${key} RETURN c._key`;
{
  "query" : "FOR c IN mycollection FILTER c._key == @value0 RETURN c._key",
  "bindVars" : {
    "value0" : "testKey"
  }
}
```

    @startDocuBlockInline 02_workWithAQL_aqlQuery
    @EXAMPLE_ARANGOSH_OUTPUT{02_workWithAQL_aqlQuery}
      var key = 'testKey';
      |db._query(
      | aql`FOR c IN mycollection FILTER c._key == ${key} RETURN c._key`
        ).toArray();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 02_workWithAQL_aqlQuery

Arbitrary JavaScript expressions can be used in queries that are generated with the
*aql* template string generator. Collection objects are handled automatically:

    @startDocuBlockInline 02_workWithAQL_aqlCollectionQuery
    @EXAMPLE_ARANGOSH_OUTPUT{02_workWithAQL_aqlCollectionQuery}
      var key = 'testKey';
      |db._query(aql`FOR doc IN ${ db.mycollection } RETURN doc`
          ).toArray();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 02_workWithAQL_aqlCollectionQuery

Note: data-modification AQL queries normally do not return a result (unless the AQL query
contains an extra *RETURN* statement). When not using a *RETURN* statement in the query, the
*toArray* method will return an empty array.

#### Statistics and extra Information

It is always possible to retrieve statistics for a query with the *getExtra* method:

    @startDocuBlockInline 03_workWithAQL_getExtra
    @EXAMPLE_ARANGOSH_OUTPUT{03_workWithAQL_getExtra}
    |db._query(`FOR i IN 1..100
    |             INSERT { _key: CONCAT('test', TO_STRING(i)) }
    |                INTO mycollection`
      ).getExtra();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 03_workWithAQL_getExtra

The meaning of the statistics values is described in [Execution statistics](../ExecutionAndPerformance/QueryStatistics.md).
You also will find warnings in here; If you're designing queries on the shell be sure to also look at it.

#### Setting a memory limit

To set a memory limit for the query, pass *options* to the *_query* method.
The memory limit specifies the maximum number of bytes that the query is
allowed to use. When a single AQL query reaches the specified limit value,
the query will be aborted with a *resource limit exceeded* exception. In a
cluster, the memory accounting is done per shard, so the limit value is
effectively a memory limit per query per shard.

    @startDocuBlockInline 02_workWithAQL_memoryLimit
    @EXAMPLE_ARANGOSH_OUTPUT{02_workWithAQL_memoryLimit}
    |db._query(
    | 'FOR i IN 1..100000 SORT i RETURN i', {}, {
    |   memoryLimit: 100000
    }).toArray(); // xpError(ERROR_RESOURCE_LIMIT)
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 02_workWithAQL_memoryLimit

If no memory limit is specified, then the server default value (controlled by
startup option *--query.memory-limit* will be used for restricting the maximum amount
of memory the query can use. A memory limit value of *0* means that the maximum
amount of memory for the query is not restricted.

#### Setting options

There are further options that can be passed in the *options* attribute of the *_query* method:

- *failOnWarning*: when set to *true*, this will make the query throw an exception and
  abort in case a warning occurs. This option should be used in development to catch
  errors early. If set to *false*, warnings will not be propagated to exceptions and
  will be returned with the query results. There is also a server configuration option
  `--query.fail-on-warning` for setting the default value for *failOnWarning* so it does
  not need to be set on a per-query level.

- *cache*: if set to *true*, this will put the query result into the query result cache
  if the query result is eligible for caching and the query cache is running in demand
  mode. If set to *false*, the query result will not be inserted into the query result
  cache. Note that query results will never be inserted into the query result cache if
  the query result cache is disabled, and that they will be automatically inserted into
  the query result cache when it is active in non-demand mode.

- *profile*: if set to *true*, returns extra timing information for the query. The timing
  information is accessible via the *getExtra* method of the query result.

- *maxWarningCount*: limits the number of warnings that are returned by the query if
  *failOnWarning* is not set to *true*. The default value is *10*.

- *maxNumberOfPlans*: limits the number of query execution plans the optimizer will
  create at most. Reducing the number of query execution plans may speed up query plan
  creation and optimization for complex queries, but normally there is no need to adjust
  this value.

The following additional attributes can be passed to queries in the RocksDB storage engine:

- *maxTransactionSize*: transaction size limit in bytes

- *intermediateCommitSize*: maximum total size of operations after which an intermediate
  commit is performed automatically

- *intermediateCommitCount*: maximum number of operations after which an intermediate
  commit is performed automatically

In the ArangoDB Enterprise Edition there is an additional parameter:

- *skipInaccessibleCollections* AQL queries (especially graph traversals) will treat
  collection to which a user has **no access** rights as if these collections were empty.
  Instead of returning a *forbidden access* error, your queries will execute normally.
  This is intended to help with certain use-cases: A graph contains several collections
  and different users execute AQL queries on that graph. You can now naturally limit the
  accessible results by changing the access rights of users on collections.

### with _createStatement (ArangoStatement)

The *_query* method is a shorthand for creating an ArangoStatement object,
executing it and iterating over the resulting cursor. If more control over the
result set iteration is needed, it is recommended to first create an
ArangoStatement object as follows:

    @startDocuBlockInline 04_workWithAQL_statements1
    @EXAMPLE_ARANGOSH_OUTPUT{04_workWithAQL_statements1}
    |stmt = db._createStatement( {
        "query": "FOR i IN [ 1, 2 ] RETURN i * 2" } );
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 04_workWithAQL_statements1

To execute the query, use the *execute* method of the statement:

    @startDocuBlockInline 05_workWithAQL_statements2
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements2}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ 1, 2 ] RETURN i * 2" } );
    c = stmt.execute();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements2

#### Cursors

Once the query executed the query results are available in a cursor.
The cursor can return all its results at once using the *toArray* method.
This is a short-cut that you can use if you want to access the full result
set without iterating over it yourself.

    @startDocuBlockInline 05_workWithAQL_statements3
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements3}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ 1, 2 ] RETURN i * 2" } );
    ~var c = stmt.execute();
    c.toArray();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements3

Cursors can also be used to iterate over the result set document-by-document.
To do so, use the *hasNext* and *next* methods of the cursor:

    @startDocuBlockInline 05_workWithAQL_statements4
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements4}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ 1, 2 ] RETURN i * 2" } );
    ~var c = stmt.execute();
    while (c.hasNext()) { require("@arangodb").print(c.next()); }
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements4

Please note that you can iterate over the results of a cursor only once, and that
the cursor will be empty when you have fully iterated over it. To iterate over
the results again, the query needs to be re-executed.

Additionally, the iteration can be done in a forward-only fashion. There is no
backwards iteration or random access to elements in a cursor.

#### ArangoStatement parameters binding

To execute an AQL query using bind parameters, you need to create a statement first
and then bind the parameters to it before execution:

    @startDocuBlockInline 05_workWithAQL_statements5
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements5}
    |var stmt = db._createStatement( {
        "query": "FOR i IN [ @one, @two ] RETURN i * 2" } );
    stmt.bind("one", 1);
    stmt.bind("two", 2);
    c = stmt.execute();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements5

The cursor results can then be dumped or iterated over as usual, e.g.:

    @startDocuBlockInline 05_workWithAQL_statements6
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements6}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ @one, @two ] RETURN i * 2" } );
    ~stmt.bind("one", 1);
    ~stmt.bind("two", 2);
    ~var c = stmt.execute();
    c.toArray();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements6

or

    @startDocuBlockInline 05_workWithAQL_statements7
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements7}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ @one, @two ] RETURN i * 2" } );
    ~stmt.bind("one", 1);
    ~stmt.bind("two", 2);
    ~var c = stmt.execute();
    while (c.hasNext()) { require("@arangodb").print(c.next()); }
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements7

Please note that bind parameters can also be passed into the *_createStatement* method directly,
making it a bit more convenient:

    @startDocuBlockInline 05_workWithAQL_statements8
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements8}
    |stmt = db._createStatement( {
    |  "query": "FOR i IN [ @one, @two ] RETURN i * 2",
    |  "bindVars": {
    |    "one": 1,
    |    "two": 2
    |  }
    } );
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements8

#### Counting with a cursor

Cursors also optionally provide the total number of results. By default, they do not.
To make the server return the total number of results, you may set the *count* attribute to
*true* when creating a statement:

    @startDocuBlockInline 05_workWithAQL_statements9
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements9}
    |stmt = db._createStatement( {
    | "query": "FOR i IN [ 1, 2, 3, 4 ] RETURN i",
      "count": true } );
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements9

After executing this query, you can use the *count* method of the cursor to get the
number of total results from the result set:

    @startDocuBlockInline 05_workWithAQL_statements10
    @EXAMPLE_ARANGOSH_OUTPUT{05_workWithAQL_statements10}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ 1, 2, 3, 4 ] RETURN i", "count": true } );
    var c = stmt.execute();
    c.count();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 05_workWithAQL_statements10

Please note that the *count* method returns nothing if you did not specify the *count*
attribute when creating the query.

This is intentional so that the server may apply optimizations when executing the query and
construct the result set incrementally. Incremental creation of the result sets
is no possible
if all of the results need to be shipped to the client anyway. Therefore, the client
has the choice to specify *count* and retrieve the total number of results for a query (and
disable potential incremental result set creation on the server), or to not retrieve the total
number of results and allow the server to apply optimizations.

Please note that at the moment the server will always create the full result set for each query so
specifying or omitting the *count* attribute currently does not have any impact on query execution.
This may change in the future. Future versions of ArangoDB may create result sets incrementally
on the server-side and may be able to apply optimizations if a result set is not fully fetched by
a client.

#### Using cursors to obtain additional information on internal timings

Cursors can also optionally provide statistics of the internal execution phases. By default, they do not.
To get to know how long parsing, otpimisation, instanciation and execution took,
make the server return that by setting the *profile* attribute to
*true* when creating a statement:

    @startDocuBlockInline 06_workWithAQL_statements11
    @EXAMPLE_ARANGOSH_OUTPUT{06_workWithAQL_statements11}
    |stmt = db._createStatement( {
    | "query": "FOR i IN [ 1, 2, 3, 4 ] RETURN i",
      options: {"profile": true}} );
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 06_workWithAQL_statements11

After executing this query, you can use the *getExtra()* method of the cursor to get the
produced statistics:

    @startDocuBlockInline 06_workWithAQL_statements12
    @EXAMPLE_ARANGOSH_OUTPUT{06_workWithAQL_statements12}
    ~var stmt = db._createStatement( { "query": "FOR i IN [ 1, 2, 3, 4 ] RETURN i", options: {"profile": true}} );
    var c = stmt.execute();
    c.getExtra();
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock 06_workWithAQL_statements12


text:
from __future__ import unicode_literals

import datetime

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('api', '0002_auto_20150616_0732'),
    ]

    operations = [
        migrations.AddField(
            model_name='check',
            name='name',
            field=models.CharField(max_length=100, blank=True),
        ),
        migrations.AlterField(
            model_name='check',
            name='alert_after',
            field=models.DateTimeField(editable=False, null=True, blank=True),
        ),
        migrations.AlterField(
            model_name='check',
            name='timeout',
            field=models.DurationField(default=datetime.timedelta(1)),
        ),
    ]

redpajama_set_name: RedPajamaGithub


text:
//  Copyright 2004 The Apache Software Foundation
//
// 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.

package org.apache.tapestry.vlib.ejb;

import java.rmi.RemoteException;

/**
 *  Remote interface for the Publisher entity bean.
 *
 *  @author Howard Lewis Ship
 *  @version $Id$
 *
 **/

public interface IPublisher extends IEntityBean
{
    public void setName(String value) throws RemoteException;

    public String getName() throws RemoteException;
}


text:
class Visa::Engine < Rails::Engine
  engine_name :visa
end


text:
/*
 *
 * 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.
 *
 */

package com.github.mysqlbinlog.model.event.extra;

import java.io.Serializable;
import java.util.Arrays;

public final class Metadata implements Serializable {
    private static final long serialVersionUID = 4634414541769527837L;

    private final byte[] type;
    private final int[] metadata;

    public Metadata(byte[] type, int[] metadata) {
        this.type = type;
        this.metadata = metadata;
    }

    public byte getType(int column) {
        return this.type[column];
    }

    public int getMetadata(int column) {
        return this.metadata[column];
    }

    @Override
    public String toString() {
        return "Metadata [type=" + Arrays.toString(type) + ", metadata="
                + Arrays.toString(metadata) + "]";
    }
}


text:
package esendex.sdk.java.service.impl;

import esendex.sdk.java.EsendexException;
import esendex.sdk.java.ServiceFactory;
import esendex.sdk.java.service.SessionServiceFactory;
import esendex.sdk.java.service.auth.SessionAuthenticator;
import esendex.sdk.java.service.auth.UserPassword;

/**
 * The Class SessionServiceFactoryImpl.
 */
public class SessionServiceFactoryImpl extends ServiceFactory implements SessionServiceFactory {

	/**
	 * Instantiates a new session service factory impl.
	 * @param userPassword the user password
	 * @throws EsendexException the esendex exception
	 */
	public SessionServiceFactoryImpl(UserPassword userPassword) throws EsendexException {
		super(new SessionAuthenticator(userPassword));
	}

}


text:
'use strict'

import React         from 'react'
import PropTypes     from 'prop-types'
import Component     from 'react-pure-render/component'
import DocumentTitle from 'react-document-title'
import {inject}      from 'mobx-react'

@inject('messages')
export default class NotFoundPage extends Component {

    static propTypes = {
        messages: PropTypes.object.isRequired
    }

    render() {
        const {messages: {404: msg}} = this.props

        return (
            <DocumentTitle title="404: Not Found">

{msg.headline}

            </DocumentTitle>
        )
    }

}


text:
(function () {
    var facebookPagesPattern = /https?.\/\/.+facebook[^\/]*/gi;

    var isFacebook = document.location.href.match(facebookPagesPattern);

    if (!isFacebook) {
        return;
    }

    var facebookScript = (function () {
        var timeoutId = 0;
        window.addEventListener("scroll", function () {
            if (timeoutId) clearTimeout(timeoutId)
            timeoutId = setTimeout(fixAll, 500);
        });

        fixAll();

        function fixAll() {
            var anchorTags = Array.from(document.getElementsByTagName("a"));
            anchorTags.forEach(fix);
        }

        function fix(anchorTag) {
            if (!anchorTag.href || !anchorTag.href.contains("//l.facebook"))
                return;

            anchorTag.href = getParameterByName("u", anchorTag.href);
        }

        function getParameterByName(name, url) {
            name = name.replace(/[\[\]]/g, "\\$&");
            var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
                results = regex.exec(url);
            if (!results) return null;
            if (!results[2]) return '';
            return decodeURIComponent(results[2].replace(/\+/g, " "));
        }
    });

    var script = facebookScript;

    // Write script to page - since plugins often work in an isolated world, this gives us the
    // ability to replace javascript added by the page
    var fnContents = script.toString();
    var executeFnScript = '(' + fnContents + ')();';

    var script = document.createElement('script');
    script.textContent = executeFnScript;
    (document.head || document.documentElement).appendChild(script);
    script.parentNode.removeChild(script);
})();


text:
/* ListaNumero.java
 * Listar os N primeiros números naturais separados por vírgula
 * Entrada: N (int)
 * Saída: lista separado por vírgula
 *
 * Autor: Fabrício Olivetti de França
 * Disciplina Processamento da Informação
 * Universidade Federal do ABC
 */

import java.util.Scanner;

class ListaNumero{
	public static void main(String[] args) {
    Scanner leitor = new Scanner(System.in);
    int N;
    N = leitor.nextInt();
    for( int i = 0; i<=N; i++ ){
      System.out.print(i);
      if( i == N ) break;  // se só tem uma instrução não preciso de {}
      System.out.print(",");
    }
    System.out.println("");

	}
}


text:
import re
import time
from datetime import date

from lxml import html

from juriscraper.OpinionSite import OpinionSite

class Site(OpinionSite):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # This is a special backscraper to deal with problems on the 2003 page.
        self.url = "http://www.cit.uscourts.gov/SlipOpinions/SlipOps-2003.html"
        self.court_id = self.__module__

    def _get_download_urls(self):
        return [
            t
            for t in self.html.xpath(
                "//table[3]//tr[position() > 1]/td//font//a/@href"
            )
        ]

    def _get_citations(self):
        neutral_citations = []
        for e in self.html.xpath(
            "//table[3]//tr[position() > 1]/td[1]//font//a"
        ):
            s = html.tostring(e, method="text", encoding="unicode").strip()
            if s == "03-59":
                continue
            else:
                neutral_citations.append(s)
        return neutral_citations

    def _get_case_names(self):
        case_names = []
        for e in self.html.xpath("//table[3]//tr[position() > 1]/td[2]/*"):
            s = html.tostring(e, method="text", encoding="unicode").strip()
            # We strip "erratum: mm/dd/yyyy" from the case names of errata docs.
            if "errat" in s:
                case_names.append(s.strip()[:-20])
            elif s == "VACATED":
                continue
            else:
                case_names.append(s.strip())
        return case_names

    def _get_precedential_statuses(self):
        return ["Published"] * len(self.case_names)

    def _get_case_dates(self):
        case_dates = []
        for e in self.html.xpath("//table[3]//tr[position() > 1]/td[3]//font"):
            s = html.tostring(e, method="text", encoding="unicode").strip()
            if s == "11/18/2003":
                continue
            elif s == "08//08/2003":
                case_dates.append(
                    date.fromtimestamp(
                        time.mktime(time.strptime("08/08/2003", "%m/%d/%Y"))
                    )
                )
            else:
                case_dates.append(
                    date.fromtimestamp(
                        time.mktime(time.strptime(s.strip(), "%m/%d/%Y"))
                    )
                )
        return case_dates

    # Because there can be multiple docket numbers we have to replace some newlines.
    def _get_docket_numbers(self):
        docket_numbers = []
        for e in self.html.xpath("//table[3]//tr[position() > 1]/td[4]//font"):
            s = html.tostring(e, method="text", encoding="unicode").strip()
            if s == "01-00745":
                continue
            else:
                docket_numbers.append(s.replace("\r\n", " &"))
        return docket_numbers


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <summaries>
      <billSummaries>
        <item>
          <versionCode>00</versionCode>
          <actionDate>2017-04-06</actionDate>
          <name>Introduced in House</name>
          <actionDesc>Introduced in House</actionDesc>
          <lastSummaryUpdateDate>2017-07-20T17:39:58Z</lastSummaryUpdateDate>
          <text><![CDATA[
Fostering Stable Housing Opportunities Act of 2017

This bill amends the United States Housing Act of 1937 to include within the definition of "families" a child who is in foster care and has attained an age such that the provision of foster care for such child will end by reason of the age of the child within six months.

Preference is given, subject to certain terms and conditions, for public housing occupancy and section 8 housing assistance under such Act to certain otherwise eligible children who are aging out of foster care and are at-risk for homelessness.

The bill amends the Housing Act of 1949 to give preference for rural rental assistance to certain otherwise eligible children who are aging out of foster care and are at-risk of homelessness.
]]></text>
          <updateDate>2017-04-06T04:00:00Z</updateDate>
        </item>
      </billSummaries>
    </summaries>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. TURNER:H.R. 2069.Congress has the power to enact this legislation pursuantto the following:Article I, Section 8, Clause 1 of the United StatesConstitution, to ``provide for the common Defence and generalWelfare of the United States . . . .''Article I, Section 8, Clause 3 (the Commerce Clause) ofthe United States Constitution, to ``regulate Commerce withforeign Nations, and among the several States, and with theIndian Tribes.''Article I, Section 8, Clause 18 of the United StatesConstitution, ``To make all Laws which shall be necessary andproper for carrying into Execution the foregoing Powers, andall other Powers vested by this Constitution in theGovernment of the United States, or in any Department orOfficer thereof.''[Page H2792]
]]></constitutionalAuthorityStatementText>
    <congress>115</congress>
    <cboCostEstimates />
    <updateDate>2017-10-13T07:16:31Z</updateDate>
    <latestAction>
      <actionDate>2017-04-06</actionDate>
      <text>Referred to the House Committee on Financial Services.</text>
      <links />
    </latestAction>
    <committees>
      <billCommittees>
        <item>
          <activities>
            <item>
              <name>Referred to</name>
              <date>2017-04-06T13:08:10Z</date>
            </item>
          </activities>
          <subcommittees />
          <name>Financial Services Committee</name>
          <type>Standing</type>
          <systemCode>hsba00</systemCode>
          <chamber>House</chamber>
        </item>
      </billCommittees>
    </committees>
    <cosponsors>
      <item>
        <bioguideId>K000380</bioguideId>
        <middleName>T.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2134</lisID>
          <bioguideId>K000380</bioguideId>
          <gpoId />
        </identifiers>
        <firstName>Daniel</firstName>
        <lastName>Kildee</lastName>
        <state>MI</state>
        <party>D</party>
        <fullName>Rep. Kildee, Daniel T. [D-MI-5]</fullName>
        <district>5</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <sponsorshipDate>2017-04-06</sponsorshipDate>
      </item>
      <item>
        <bioguideId>L000559</bioguideId>
        <middleName>R.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1668</lisID>
          <bioguideId>L000559</bioguideId>
          <gpoId>8140</gpoId>
        </identifiers>
        <firstName>JAMES</firstName>
        <lastName>LANGEVIN</lastName>
        <state>RI</state>
        <party>D</party>
        <fullName>Rep. Langevin, James R. [D-RI-2]</fullName>
        <district>2</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <sponsorshipDate>2017-04-06</sponsorshipDate>
      </item>
      <item>
        <bioguideId>M001179</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2053</lisID>
          <bioguideId>M001179</bioguideId>
          <gpoId>8128</gpoId>
        </identifiers>
        <firstName>Tom</firstName>
        <lastName>Marino</lastName>
        <state>PA</state>
        <party>R</party>
        <fullName>Rep. Marino, Tom [R-PA-10]</fullName>
        <district>10</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <sponsorshipDate>2017-04-06</sponsorshipDate>
      </item>
      <item>
        <bioguideId>H001072</bioguideId>
        <middleName>French</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2223</lisID>
          <bioguideId>H001072</bioguideId>
          <gpoId />
        </identifiers>
        <firstName>J.</firstName>
        <lastName>Hill</lastName>
        <state>AR</state>
        <party>R</party>
        <fullName>Rep. Hill, J. French [R-AR-2]</fullName>
        <district>2</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <sponsorshipDate>2017-04-06</sponsorshipDate>
      </item>
      <item>
        <bioguideId>M001160</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1811</lisID>
          <gpoId>8217</gpoId>
          <bioguideId>M001160</bioguideId>
        </identifiers>
        <firstName>Gwen</firstName>
        <lastName>Moore</lastName>
        <state>WI</state>
        <party>D</party>
        <fullName>Rep. Moore, Gwen [D-WI-4]</fullName>
        <district>4</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <sponsorshipDate>2017-04-06</sponsorshipDate>
      </item>
      <item>
        <bioguideId>B001270</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>B001270</bioguideId>
          <gpoId>7838</gpoId>
          <lisID>1996</lisID>
        </identifiers>
        <firstName>Karen</firstName>
        <lastName>Bass</lastName>
        <state>CA</state>
        <party>D</party>
        <fullName>Rep. Bass, Karen [D-CA-37]</fullName>
        <district>37</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <sponsorshipDate>2017-04-06</sponsorshipDate>
      </item>
      <item>
        <bioguideId>S001187</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2047</lisID>
          <bioguideId>S001187</bioguideId>
          <gpoId>8105</gpoId>
        </identifiers>
        <firstName>Steve</firstName>
        <lastName>Stivers</lastName>
        <state>OH</state>
        <party>R</party>
        <fullName>Rep. Stivers, Steve [R-OH-15]</fullName>
        <district>15</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-04-25</sponsorshipDate>
      </item>
      <item>
        <bioguideId>C001084</bioguideId>
        <middleName>N.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>C001084</bioguideId>
          <lisID>2055</lisID>
          <gpoId>8139</gpoId>
        </identifiers>
        <firstName>David</firstName>
        <lastName>Cicilline</lastName>
        <state>RI</state>
        <party>D</party>
        <fullName>Rep. Cicilline, David N. [D-RI-1]</fullName>
        <district>1</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-06-07</sponsorshipDate>
      </item>
      <item>
        <bioguideId>C001053</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1742</lisID>
          <bioguideId>C001053</bioguideId>
          <gpoId>8112</gpoId>
        </identifiers>
        <firstName>Tom</firstName>
        <lastName>Cole</lastName>
        <state>OK</state>
        <party>R</party>
        <fullName>Rep. Cole, Tom [R-OK-4]</fullName>
        <district>4</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-06-13</sponsorshipDate>
      </item>
      <item>
        <bioguideId>H000324</bioguideId>
        <middleName>L.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>511</lisID>
          <bioguideId>H000324</bioguideId>
          <gpoId>7895</gpoId>
        </identifiers>
        <firstName>ALCEE</firstName>
        <lastName>HASTINGS</lastName>
        <state>FL</state>
        <party>D</party>
        <fullName>Rep. Hastings, Alcee L. [D-FL-20]</fullName>
        <district>20</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-06-13</sponsorshipDate>
      </item>
      <item>
        <bioguideId>K000387</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>K000387</bioguideId>
          <gpoId />
          <lisID>2228</lisID>
        </identifiers>
        <firstName>Stephen</firstName>
        <lastName>Knight</lastName>
        <state>CA</state>
        <party>R</party>
        <fullName>Rep. Knight, Stephen [R-CA-25]</fullName>
        <district>25</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-06-15</sponsorshipDate>
      </item>
      <item>
        <bioguideId>E000296</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2298</lisID>
          <bioguideId>E000296</bioguideId>
          <gpoId />
        </identifiers>
        <firstName>Dwight</firstName>
        <lastName>Evans</lastName>
        <state>PA</state>
        <party>D</party>
        <fullName>Rep. Evans, Dwight [D-PA-2]</fullName>
        <district>2</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-06-29</sponsorshipDate>
      </item>
      <item>
        <bioguideId>D000096</bioguideId>
        <middleName>K.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1477</lisID>
          <gpoId>7927</gpoId>
          <bioguideId>D000096</bioguideId>
        </identifiers>
        <firstName>DANNY</firstName>
        <lastName>DAVIS</lastName>
        <state>IL</state>
        <party>D</party>
        <fullName>Rep. Davis, Danny K. [D-IL-7]</fullName>
        <district>7</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-11</sponsorshipDate>
      </item>
      <item>
        <bioguideId>C001105</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>C001105</bioguideId>
          <gpoId />
          <lisID>2273</lisID>
        </identifiers>
        <firstName>Barbara</firstName>
        <lastName>Comstock</lastName>
        <state>VA</state>
        <party>R</party>
        <fullName>Rep. Comstock, Barbara [R-VA-10]</fullName>
        <district>10</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-11</sponsorshipDate>
      </item>
      <item>
        <bioguideId>F000464</bioguideId>
        <middleName>J.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>F000464</bioguideId>
          <lisID>2343</lisID>
          <gpoId />
        </identifiers>
        <firstName>John</firstName>
        <lastName>Faso</lastName>
        <state>NY</state>
        <party>R</party>
        <fullName>Rep. Faso, John J. [R-NY-19]</fullName>
        <district>19</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-17</sponsorshipDate>
      </item>
      <item>
        <bioguideId>M001137</bioguideId>
        <middleName>W.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>M001137</bioguideId>
          <gpoId>8067</gpoId>
          <lisID>1506</lisID>
        </identifiers>
        <firstName>GREGORY</firstName>
        <lastName>MEEKS</lastName>
        <state>NY</state>
        <party>D</party>
        <fullName>Rep. Meeks, Gregory W. [D-NY-5]</fullName>
        <district>5</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-20</sponsorshipDate>
      </item>
      <item>
        <bioguideId>M001193</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>M001193</bioguideId>
          <lisID>2258</lisID>
          <gpoId />
        </identifiers>
        <firstName>Thomas</firstName>
        <lastName>MacArthur</lastName>
        <state>NJ</state>
        <party>R</party>
        <fullName>Rep. MacArthur, Thomas [R-NJ-3]</fullName>
        <district>3</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-20</sponsorshipDate>
      </item>
      <item>
        <bioguideId>R000606</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2332</lisID>
          <gpoId />
          <bioguideId>R000606</bioguideId>
        </identifiers>
        <firstName>Jamie</firstName>
        <lastName>Raskin</lastName>
        <state>MD</state>
        <party>D</party>
        <fullName>Rep. Raskin, Jamie [D-MD-8]</fullName>
        <district>8</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-26</sponsorshipDate>
      </item>
      <item>
        <bioguideId>B001298</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2337</lisID>
          <bioguideId>B001298</bioguideId>
          <gpoId />
        </identifiers>
        <firstName>Don</firstName>
        <lastName>Bacon</lastName>
        <state>NE</state>
        <party>R</party>
        <fullName>Rep. Bacon, Don [R-NE-2]</fullName>
        <district>2</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-07-26</sponsorshipDate>
      </item>
      <item>
        <bioguideId>P000608</bioguideId>
        <middleName>H.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2113</lisID>
          <bioguideId>P000608</bioguideId>
          <gpoId />
        </identifiers>
        <firstName>Scott</firstName>
        <lastName>Peters</lastName>
        <state>CA</state>
        <party>D</party>
        <fullName>Rep. Peters, Scott H. [D-CA-52]</fullName>
        <district>52</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-09-27</sponsorshipDate>
      </item>
      <item>
        <bioguideId>R000586</bioguideId>
        <middleName>B.</middleName>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2048</lisID>
          <bioguideId>R000586</bioguideId>
          <gpoId>8106</gpoId>
        </identifiers>
        <firstName>James</firstName>
        <lastName>Renacci</lastName>
        <state>OH</state>
        <party>R</party>
        <fullName>Rep. Renacci, James B. [R-OH-16]</fullName>
        <district>16</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-09-27</sponsorshipDate>
      </item>
      <item>
        <bioguideId>U000031</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1177</lisID>
          <bioguideId>U000031</bioguideId>
          <gpoId>7991</gpoId>
        </identifiers>
        <firstName>FRED</firstName>
        <lastName>UPTON</lastName>
        <state>MI</state>
        <party>R</party>
        <fullName>Rep. Upton, Fred [R-MI-6]</fullName>
        <district>6</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-10-11</sponsorshipDate>
      </item>
      <item>
        <bioguideId>K000389</bioguideId>
        <middleName />
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2308</lisID>
          <gpoId />
          <bioguideId>K000389</bioguideId>
        </identifiers>
        <firstName>Ro</firstName>
        <lastName>Khanna</lastName>
        <state>CA</state>
        <party>D</party>
        <fullName>Rep. Khanna, Ro [D-CA-17]</fullName>
        <district>17</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-10-12</sponsorshipDate>
      </item>
    </cosponsors>
    <introducedDate>2017-04-06</introducedDate>
    <subjects>
      <billSubjects>
        <legislativeSubjects>
          <item>
            <name>Adoption and foster care</name>
          </item>
          <item>
            <name>Congressional oversight</name>
          </item>
          <item>
            <name>Homelessness and emergency shelter</name>
          </item>
          <item>
            <name>Housing and community development funding</name>
          </item>
          <item>
            <name>Low- and moderate-income housing</name>
          </item>
          <item>
            <name>Public housing</name>
          </item>
          <item>
            <name>Rural conditions and development</name>
          </item>
        </legislativeSubjects>
        <policyArea>
          <name>Housing and Community Development</name>
        </policyArea>
      </billSubjects>
    </subjects>
    <notes />
    <billType>HR</billType>
    <policyArea>
      <name>Housing and Community Development</name>
    </policyArea>
    <laws />
    <billNumber>2069</billNumber>
    <actions>
      <actionByCounts>
        <houseOfRepresentatives>3</houseOfRepresentatives>
      </actionByCounts>
      <actionTypeCounts>
        <introducedInHouse>1</introducedInHouse>
        <introducedInTheHouse>1</introducedInTheHouse>
        <billReferrals>1</billReferrals>
      </actionTypeCounts>
      <item>
        <actionDate>2017-04-06</actionDate>
        <actionCode>H11100</actionCode>
        <sourceSystem>
          <name>House floor actions</name>
          2
        </sourceSystem>
        <text>Referred to the House Committee on Financial Services.</text>
        <links />
        <type>IntroReferral</type>
        <committee>
          <name>Financial Services Committee</name>
          <systemCode>hsba00</systemCode>
        </committee>
      </item>
      <item>
        <actionDate>2017-04-06</actionDate>
        <actionCode>Intro-H</actionCode>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <text>Introduced in House</text>
        <links />
        <type>IntroReferral</type>
        <committee />
      </item>
      <item>
        <actionDate>2017-04-06</actionDate>
        <actionCode>1000</actionCode>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <text>Introduced in House</text>
        <links />
        <type>IntroReferral</type>
        <committee />
      </item>
    </actions>
    <committeeReports />
    <title>Fostering Stable Housing Opportunities Act of 2017</title>
    <createDate>2017-04-07T03:12:01Z</createDate>
    <version>1.0.0</version>
    <recordedVotes />
    <originChamber>House</originChamber>
    <calendarNumbers />
    <titles>
      <item>
        <chamberName />
        <chamberCode />
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <parentTitleType />
        <title>Fostering Stable Housing Opportunities Act of 2017</title>
      </item>
      <item>
        <chamberName />
        <chamberCode />
        <titleType>Short Titles as Introduced</titleType>
        <parentTitleType />
        <title>Fostering Stable Housing Opportunities Act of 2017</title>
      </item>
      <item>
        <chamberName />
        <chamberCode />
        <titleType>Official Title as Introduced</titleType>
        <parentTitleType />
        <title>To provide priority under certain federally assisted housing programs to assist youths who are aging out of foster care, and for other purposes.</title>
      </item>
      <item>
        <chamberName />
        <chamberCode />
        <titleType>Display Title</titleType>
        <parentTitleType />
        <title>Fostering Stable Housing Opportunities Act of 2017</title>
      </item>
    </titles>
    <relatedBills>
      <item>
        <latestTitle>Fostering Stable Housing Opportunities Act of 2017</latestTitle>
        <type>S</type>
        <congress>115</congress>
        <latestAction>
          <actionDate>2017-07-26</actionDate>
          <text>Read twice and referred to the Committee on Banking, Housing, and Urban Affairs.</text>
        </latestAction>
        <relationshipDetails>
          <item>
            <identifiedBy>CRS</identifiedBy>
            <type>Related bill</type>
          </item>
        </relationshipDetails>
        <number>1638</number>
      </item>
    </relatedBills>
    <sponsors>
      <item>
        <party>R</party>
        <state>OH</state>
        <byRequestType />
        <bioguideId>T000463</bioguideId>
        <firstName>Michael</firstName>
        <identifiers>
          <bioguideId>T000463</bioguideId>
          <lisID>1741</lisID>
          <gpoId>8093</gpoId>
        </identifiers>
        <middleName>R.</middleName>
        <district>10</district>
        <lastName>Turner</lastName>
        <fullName>Rep. Turner, Michael R. [R-OH-10]</fullName>
      </item>
    </sponsors>
    <amendments />
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
using System.Web;

namespace Eisk
{
    public class DataInitializer
    {
        public static void Init()
        {
            if (HttpContext.Current.IsDebuggingEnabled)
                TestDataHelper.InitializeSchemaAndData(HttpContext.Current.Server.MapPath("~/App_Data/TestData.xml"));
        }
    }
}


text:
#ifndef BASE64_HH
#define BASE64_HH

#include <string>

namespace stuff {

class Base64 {
public:
    static bool decode(const std::string& input, std::string* output);

private:
    Base64() = delete;
    ~Base64() = delete;
    Base64(Base64&) = delete;
    Base64& operator=(Base64&) = delete;
};

}  // namespace stuff

#endif /* BASE64_HH */


text:
<?php
namespace Neos\Flow\Http\Component;

use Neos\Flow\Annotations as Flow;

/**
 * HTTP component that makes sure that the current response is standards-compliant. It is usually the last component in the chain.
 */
class StandardsComplianceComponent implements ComponentInterface
{
    /**
     * @var array
     */
    protected $options;

    /**
     * @param array $options
     */
    public function __construct(array $options = [])
    {
        $this->options = $options;
    }

    /**
     * Just call makeStandardsCompliant on the Response for now
     *
     * @param ComponentContext $componentContext
     * @return void
     */
    public function handle(ComponentContext $componentContext)
    {
        $response = $componentContext->getHttpResponse();
        $response->makeStandardsCompliant($componentContext->getHttpRequest());
    }
}


text:
Cygnite Framework query builder currently supports the well know MySql database by default. Since we are using PDO as database abstraction layer, you can also write PDO queries to handle other databases. We are actively working on ActiveRecord to support other databases as well.

###Write raw queries

Cygnite Framework gives you flexibility to write your own raw queries alongside the query builder. Setup your database configuration in apps/configs/database.php file. You need to provide your database connection name and primary key in model, Let ActiveRecord to know against which database you want to run queries. Let us see now how to fetch data using raw queries.

  ```php
 // Return mulltiple users from table
 public function getUsers()
 {
     return $this->query("SELECT * FROM `guest_book`")->getAll(\PDO::FETCH_ASSOC);
 }

 public function getUser()
 {
     return $this->query("SELECT * FROM ".$this->tableName)->fetch();
 }

 public function save()
 {
     return $this->query("Your INSERT query")->execute();
 }
```
###Call Function Using Model Instance

```php
 use Apps\Models\Users;

 $users = new Users();
 $users->getUsers();
```
o need to worry Cygnite will autoload all your models in runtime, so just create an object and concentrate on doing your application stuffs. Similarly you can execute your insert, update, delete queries using query() function.

You can also take an advantage of all PDO methods by using $this->pdo inside your model function and run queries.


text:
using namespace reflectionzeug;
using namespace propertyguizeug;
using namespace widgetzeug;

enum class MyEnum { One, Two, Three };

template <typename T>
std::function<T()> getter(const T & value)
{
    return [&value]() { return value; };
}

template <typename T>
std::function<void(const T &)> setter(T & value)
        {
    return [&value](const T & newValue) { value = newValue; };
}

template <typename T>
Property<T> * newProperty(const std::string & name, T & value)
                {
    return new Property<T>(name, getter(value), setter(value));
}

void addFlagProperty(PropertyGroup * group, bool & flagValue, const std::string & flag)
{
    group->addProperty<bool>(flag, getter(flagValue), setter(flagValue))->valueChanged.connect(
        [&flag, group] (bool b)
        {
            group->forEachGroup(
                [&flag, b] (PropertyGroup & subGroup)
                {
                    if (b)
                        subGroup.setOption(flag, true);
                    else
                        subGroup.setOption(flag, false);
                });
        });
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QApplication::setApplicationName("property_editors");
    QApplication::setOrganizationName("hpicgs_libzeug");

    enableDarkFusionStyle();

    PropertyGroup group;

    auto readonlyValue = false;
    auto disabledValue = false;
    addFlagProperty(&group, readonlyValue, "readonly");
    addFlagProperty(&group, disabledValue, "disabled");

    PropertyGroup * subGroup;

    subGroup = group.addGroup("floating_point");

    auto floatValue = 2.0f;
    auto floatProperty = newProperty("float", floatValue);
    floatProperty->setOptions({
        { "minimum", Variant(1.2f) },
        { "maximum", Variant(13.0f) },
        { "step", Variant(0.5f) },
        { "precision", Variant(1u) }
    });
    subGroup->addProperty(floatProperty);

    auto doubleValue = 0.0;
    auto doubleProperty = newProperty("double", doubleValue);
    doubleProperty->setOptions({
        { "minimum", Variant(-1.0) },
        { "maximum", Variant(1.0) },
        { "step", Variant(0.01) },
        { "precision", Variant(2u) }
    });
    subGroup->addProperty(doubleProperty);

    subGroup = group.addGroup("signed_integrals");

    auto charValue = static_cast<char>(1);
    auto charProperty = newProperty("char", charValue);
    charProperty->setOptions({
        { "minimum", Variant(-1) },
        { "maximum", Variant(2) },
        { "step", Variant(1) }
    });
    subGroup->addProperty(charProperty);

    auto shortValue = static_cast<short>(2);
    auto shortProperty = newProperty("short", shortValue);
    shortProperty->setOptions({
        { "minimum", Variant(-2) },
        { "maximum", Variant(3) },
        { "step", Variant(1) }
    });
    subGroup->addProperty(shortProperty);

    auto intValue = 3;
    auto intProperty = newProperty("int", intValue);
    shortProperty->setOptions({
        { "minimum", Variant(-3) },
        { "maximum", Variant(4) },
        { "step", Variant(1) }
    });
    subGroup->addProperty(intProperty);

    auto longValue = 4l;
    auto longProperty = newProperty("long", longValue);
    longProperty->setOptions({
        { "minimum", Variant(-4l) },
        { "maximum", Variant(5l) },
        { "step", Variant(1l) }
    });
    subGroup->addProperty(longProperty);

    auto longLongValue = 5ll;
    auto longLongProperty = newProperty("longlong", longLongValue);
    longLongProperty->setOptions({
        { "minimum", Variant(-5ll) },
        { "maximum", Variant(6ll) },
        { "step", Variant(1ll) }
    });
    subGroup->addProperty(longLongProperty);

    subGroup = group.addGroup("unsigned_integrals");

    auto uCharValue = static_cast<unsigned char>(0u);
    auto uCharProperty = newProperty("uchar", uCharValue);
    uCharProperty->setOptions({
        { "minimum", Variant(0u) },
        { "maximum", Variant(10u) },
        { "step", Variant(1u) }
    });
    subGroup->addProperty(uCharProperty);

    auto uShortValue = static_cast<unsigned short>(0u);
    auto uShortProperty = newProperty("ushort", uShortValue);
    uShortProperty->setOptions({
        { "minimum", Variant(0u) },
        { "maximum", Variant(20u) },
        { "step", Variant(2u) }
    });
    subGroup->addProperty(uShortProperty);

    auto uIntValue = 0u;
    auto uIntProperty = newProperty("uint", uIntValue);
    uIntProperty->setOptions({
        { "minimum", Variant(0u) },
        { "maximum", Variant(30u) },
        { "step", Variant(3u) }
    });
    subGroup->addProperty(uIntProperty);

    auto uLongValue = 0ul;
    auto uLongProperty = newProperty("ulong", uLongValue);
    uLongProperty->setOptions({
        { "minimum", Variant(0ul) },
        { "maximum", Variant(40ul) },
        { "step", Variant(4ul) }
    });
    subGroup->addProperty(uLongProperty);

    auto uLongLongValue = 0ull;
    auto uLongLongProperty = newProperty("ulonglong", uLongLongValue);
    uLongLongProperty->setOptions({
        { "minimum", Variant(0ull) },
        { "maximum", Variant(50ull) },
        { "step", Variant(5ull) }
    });
    subGroup->addProperty(uLongLongProperty);

    subGroup = group.addGroup("string");

    auto stringValue = std::string{"Hallo Welt!"};
    auto stringProperty = newProperty("std_string", stringValue);
    subGroup->addProperty(stringProperty);

    auto choicesValue = false;
    auto choicesProperty = newProperty("choices", choicesValue);
    choicesProperty->valueChanged.connect(
        [stringProperty] (bool b)
        {
            if (b)
                stringProperty->setOption("choices", std::vector<std::string>({ "blau", "rot", "grün" }));
            else
                stringProperty->removeOption("choices");
        });
    subGroup->addProperty(choicesProperty);

    subGroup = group.addGroup("other");

    auto filePathValue = FilePath{};
    auto filePathProperty = newProperty("file_path", filePathValue);
    filePathProperty->setOptions({
        { "uniqueidentifier", "filePath" }
    });
    subGroup->addProperty(filePathProperty);

    auto colorValue = Color{128, 128, 128};
    auto colorProperty = newProperty("color", colorValue);
    subGroup->addProperty(colorProperty);

    auto enumValue = MyEnum::One;
    auto enumProperty = newProperty("enum", enumValue);
    enumProperty->setStrings({
        { MyEnum::One, "One" },
        { MyEnum::Two, "Two" },
        { MyEnum::Three, "Three" }
    });
    subGroup->addProperty(enumProperty);

    //auto colorGradientValue = ColorGradient::fromList({ QColor{Qt::black}, QColor{Qt::white} });
    //auto colorGradientProperty = newProperty("gradient", colorGradientValue);
    //subGroup->addProperty(colorGradientProperty);

    PropertyBrowser browser;
    browser.setRoot(&group);
    browser.show();

    return a.exec();
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Title</title>

<form name="editForm" role="form" novalidate>

        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                ng-click="vm.clear()">×</button>

LTI Configuration

        <jhi-alert-error></jhi-alert-error>

            LTI ID
            <input type="text" class="form-control"
                   ng-model="vm.configuration.ltiId" readonly />

            LTI Passport
            <input type="text" class="form-control"
                   ng-model="vm.configuration.ltiPassport" readonly />

            LTI URL
            <input type="text" class="form-control"
                   ng-model="vm.configuration.launchUrl" readonly />

            LTI Launch Target
            <input type="text" class="form-control"
                   value="New Window" readonly />

            Custom Parameters
            <input type="text" class="form-control"
                   value='["require_existing_user=true", "lookup_user_by_email=true"]' readonly />

                require_existing_user: If true, launching the exercise requires an existing user on JIRA. If false, a user will be created on first launch.

                lookup_user_by_email: If true, it will try to find a matching JIRA user by the LTI email address.

            Scored
            <input type="text" class="form-control"
                   value="Yes" readonly />

            Request user's username
            <input type="text" class="form-control"
                   value="True" readonly />

            Request user's email
            <input type="text" class="form-control"
                   value="True" readonly />

        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()">
             Cancel
        </button>

</form>


text: module.exports = require("inherits-ex/lib/isMixinedFrom")


text:
package net.minecraft.src.nuclearcontrol;

public interface IRedstoneConsumer
{
    boolean getPowered();
    void setPowered(boolean value);

}


text:
require 'dm-core'
require 'dm-types'
require 'dm-migrations'
require 'dm-validations'

DataMapper::Logger.new(STDOUT, :debug) if ENV['DEBUG']
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3:///#{Dir.pwd}/devel.db")

class Language
  include DataMapper::Resource
#  property :id      , Serial
  property :name    , String        , :key => true

  has n, :films, :through => Resource

  def to_s
    "#{name}"
  end
end

class Subtitle
  include DataMapper::Resource
  property :name    , String  , :key => true

  has n, :films

  def to_s
    "#{name}"
  end
end

=begin
class Person
  include DataMapper::Resource
  property :name    , String        , :key => true
  property :role    , Discriminator , :key => true

  has n, :films, :through => Resource

  def to_s
    "#{name}"
  end
end
=end
class Director
  include DataMapper::Resource
  property :name    , String        , :key => true

  has n, :films, :through => Resource

  def to_s
    "#{name}"
  end
end
class Producer
  include DataMapper::Resource
  property :name    , String        , :key => true

  has n, :films, :through => Resource

  def to_s
    "#{name}"
  end
end
class Writer
  include DataMapper::Resource
  property :name    , String        , :key => true

  has n, :films, :through => Resource

  def to_s
    "#{name}"
  end
end

class Country
  include DataMapper::Resource
  property :name    , String , :key => true

  has n, :films, :through => Resource

  def to_s
    "#{name}" #+ " (#{films.count} film#{'s' unless films.count == 1})"
  end
end

class Distributor
  include DataMapper::Resource
  property :name , String  , :key => true

  has n, :films

  def to_s
    name
  end
end

class Section
  include DataMapper::Resource
  property :name    , String , :key => true

  has n, :films

  def to_s
    "#{name}" #+ " (#{films.count} film#{'s' unless films.count == 1})"
  end
end

class Category
  include DataMapper::Resource
  property :name    , String , :key => true

  has n, :films

  def to_s
    "#{name}" #+ " (#{films.count} film#{'s' unless films.count == 1})"
  end
end

class Venue
  include DataMapper::Resource
  property :name    , String , :key => true

  has n, :sessions
  has n, :films    , :through => :sessions

  def to_s
    "#{name}"
  end
end

class Session
  include DataMapper::Resource
  property :id      , Serial
  property :date    , Date
  property :time    , Time

  belongs_to :venue
  has n    , :films , :through => Resource

  def to_s
    "#{id}"
  end
end

class Year
  include DataMapper::Resource
  property :name , Integer , :key => true

  has n, :films

  def to_s
    "#{name}"
  end
end

class Medium
  include DataMapper::Resource
  property :name , String  , :length => (1..32) , :key => true

  has n, :films

  def to_s
    "#{name}"
  end
end

class Film
  include DataMapper::Resource
  property :id               , Serial
  property :title            , String  , :length => (1..128)  , :required => true
  #property :year             , Integer
  property :three_d          , Boolean
  property :still_url        , String  , :length => (10..128)
  property :thumb_url        , String  , :length => (10..128)
  property :trailer_url      , String  , :length => (10..128)
  property :tagline          , Text    , :length => (0..512)
  property :synopsis         , Text    , :length => (0..8192)
  property :duration         , Integer #, :nullable => true
  property :distributor_type , String  , :length => (0..8)
  #property :rating      , String

  default_scope(:default).update(:order => [:title])

  belongs_to :year               , :required => false
  belongs_to :medium             , :required => false
  belongs_to :category           , :required => false
  belongs_to :section            , :required => false
  belongs_to :distributor        , :required => false
  belongs_to :subtitle           , :required => false
  has n    , :countries          , :through => Resource
  has n    , :sessions           , :through => Resource
  has n    , :languages          , :through => Resource
  has n    , :directors          , :through => Resource
  has n    , :producers          , :through => Resource
  has n    , :writers            , :through => Resource

  def to_s
    "#{title}" #+ (countries ? ", #{countries.join('/')}": '') + ", #{year} (#{section})"
  end
end

DataMapper.auto_upgrade!
#DataMapper.auto_migrate!


text:
#include <fstream>

#include "../../common/file.h"

#include "../BaseTestFixture.h"

/**
 * Tests BLOB functionality in the driver.
 *
 * @author Mark Matthews
 * @version $Id: BlobTest.java 6707 2008-01-04 22:06:31Z mmatthews $
 */

namespace testsuite
{
namespace simple
{
  class BlobTest : public BaseTestFixture
  {
  private:
    typedef BaseTestFixture super;

    std::auto_ptr<FileUtils::ccppFile> testBlobFile;

    bool realFrameworkTiming;

  /**
	 * Tests inserting blob data as a stream
	 *
	 * @throws std::exception *
	 *             if an error occurs
	 */

    /* throws std::exception * */
    void testBlobInsert( Connection & c, bool asString= false );

    /* throws std::exception * */
    bool checkBlob( const String & retrBytes );

    /* throws std::exception * */
    void createTestTable();

  /**
	 * Mark this as deprecated to avoid warnings from compiler...
	 *
	 * @deprecated
	 *
	 * @throws std::exception *
	 *             if an error occurs retrieving the value
	 */
    /* throws std::exception * */
    void doRetrieval();

    static const String TEST_BLOB_FILE_PREFIX;

    void createBlobFile(int size) ;

  protected:

  public:
    TEST_FIXTURE( BlobTest )
    {
		TEST_CASE( testBlobStreamInsert );
		TEST_CASE( testBlobStringInsert );
    }

  /**
	 * Setup the test case
	 *
	 * @throws std::exception *
	 *             if an error occurs
	 */
    void setUp() ;

  /**
	 * Destroy resources created by test case
	 *
	 * @throws std::exception *
	 *             if an error occurs
	 */
    void tearDown() ;

    /* throws std::exception * */
    void testBlobStreamInsert();
    void testBlobStringInsert();

  };

  REGISTER_FIXTURE( BlobTest );

}
}


text:
<?php

namespace EmailMarketing\Application\Action\Cliente;

use EmailMarketing\Application\Form\ClienteForm;
use EmailMarketing\Application\Form\HttpMethodElement;
use EmailMarketing\Domain\Persistence\ClienteRepositoryInterface;
use EmailMarketing\Domain\Persistence\EnderecoRepositoryInterface;
use EmailMarketing\Domain\Service\FlashMessageInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\Response\RedirectResponse;
use Zend\Expressive\Router\RouterInterface;
use Zend\Expressive\Template;

class ClienteUpdatePageAction
{

    private $template;

    private $repository;

    private $repositoryEndereco;

    private $router;

    private $form;

    public function __construct(
            ClienteRepositoryInterface $repository,
            EnderecoRepositoryInterface $repositoryEndereco,
            Template\TemplateRendererInterface $template,
            RouterInterface $router,
            ClienteForm $form
    ) {
        $this->template = $template;
        $this->repository = $repository;
        $this->repositoryEndereco = $repositoryEndereco;
        $this->router = $router;
        $this->form = $form;
    }

    public function __invoke(
            ServerRequestInterface $request,
            ResponseInterface $response,
            callable $next = null
    ) {
        $id = $request->getAttribute('id');
        $entity = $this->repository->find($id);

        $this->form->add(new HttpMethodElement('PUT'));
        $this->form->bind($entity);

        if ( $request->getMethod() == "PUT" ){

            $flash = $request->getAttribute('flash');
            $dataForm = $request->getParsedBody();
            $this->form->setData($dataForm);

            if ( $this->form->isValid() ){
                $entity = $this->form->getData();

                try {
                    $this->repository->update($entity);
                    $flash->setMessage(FlashMessageInterface::MESSAGE_SUCCESS, "Cliente cadastrado com sucesso");
                    $uri = $this->router->generateUri('cliente.list');
                    return new RedirectResponse( $uri );
                } catch (Exception $ex) {
                    $flash->setMessage(FlashMessageInterface::MESSAGE_ERROR, "Erro no cadastrado do cliente");
                }
            }
        }

        return new HtmlResponse(
            $this->template->render('app::cliente/update', [
                'cliente' => $entity,
                'form' => $this->form,
            ])
        );
    }
}


text:
import markdown from "../../markdown";

export const title = "Heart animation";

export const desc = markdown`
gl-react can be used with any React library.
For instance, [react-motion](https://github.com/chenglou/react-motion)'s spring animation.
`;

export const descAfter = markdown`
If you click fastly on the Heart, react-motion nicely
continue the animation without jump interruption.
We can just trust [react-motion](https://github.com/chenglou/react-motion) to solve this for us :)
`;


text:
package com.intellij.ui.roots;

import consulo.awt.TargetAWT;
import consulo.ui.image.Image;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

/**
 * @author Eugene Zhuravlev
 *         Date: Oct 29
 * @author 2003
 */
public class ScalableIconComponent extends JComponent {
  private final Image myIcon;
  private final Image mySelectedIcon;
  private boolean myIsSelected = false;

  public ScalableIconComponent(Image icon) {
    this(icon, icon);
  }

  public ScalableIconComponent(Image icon, Image selectedIcon) {
    myIcon = icon;
    mySelectedIcon = selectedIcon != null? selectedIcon : icon;
    if (icon != null) {
      final Dimension size = new Dimension(icon.getWidth(), icon.getHeight());
      this.setPreferredSize(size);
      this.setMinimumSize(size);
    }
  }

  @Override
  protected void paintComponent(Graphics g) {
    final consulo.ui.image.Image icon = myIsSelected? mySelectedIcon : myIcon;
    if (icon != null) {
      final Graphics2D g2 = (Graphics2D)g;

      g2.setBackground(getBackground());
      final AffineTransform savedTransform = g2.getTransform();

      g2.scale(((double)getWidth()) / icon.getWidth(), ((double)getHeight()) / icon.getHeight());
      TargetAWT.to(icon).paintIcon(this, g2, 0, 0);

      g2.setTransform(savedTransform);
    }

    super.paintComponent(g);
  }

  public final void setSelected(boolean isSelected) {
    myIsSelected = isSelected;
    this.revalidate();
    this.repaint();
  }
}


text:
<?php
require('global.php');

class skin_home
{
	function home()
	{
		global $icebb;

		//$this->global		= new skin_global;
	}

	function display($server_info=array(), $notes='', $show_updates = true, $recent_actions='')
	{
		global $icebb;

		if($show_updates)
		{
			$updates		= <<<EOF

EOF;
		}

		$code				= skin_global::header();
		$code			   .= <<<EOF

			<form action='index.php' method='post'>
			<input type='hidden' name='act' value='home' />
			<input type='hidden' name='save_notes' value='1' />
			<input type='hidden' name='s' value='{$icebb->adsess['asid']}' />

Message Box

					<textarea name='message_box' rows='5' cols='30'  id='notes_box'>{$notes}</textarea>
					<input type='submit' value='Save' class='button' />

			</form>

			{$updates}
			{$messages}

Quick Tools

							Edit member:

							<form action='{$icebb->base_url}act=users' method='post'>
							<input type='hidden' name='func' value='search' />
							<input type='hidden' name='search_how' value='co' />
							<input type='text' name='username' value='' class='textbox' size='20' />
							<input type='submit' value='Go' class='button' />
							</form>

							Find IP:

							<form action='{$icebb->base_url}act=users&func=iptools' method='post'>
							<input type='text' name='ipaddr' value='' class='textbox' size='20' />
							<input type='submit' value='Go' class='button' />
							</form>

Server Information

							IceBB Version:

							{$server_info['icebb_ver']}

							PHP Version:

							base_url}act=home&phpinfo=1'>{$server_info['php_ver']}

							MySQL Version:

							{$server_info['mysql_ver']}

{$recent_actions}

EOF;
		$code			   .= skin_global::footer();

		return $code;
	}

	function registration_info($license,$expired=false)
	{
		global $icebb;

		if($expired)
		{
			$code			= <<<EOF

License Expired

The license key for this board has expired. You may still continue to use this board, but you won't get
	priority support or a registered message. To remove this message, simply remove customer.php from your board
	directory. To renew your license, please visit the customer area.

	Customer Area

EOF;
		}
		else {
			$code			= <<<EOF

Registered Board

Thank you for supporting IceBB. If you need to change this license or need support, please visit the
	customer area below.

	Customer Area

EOF;
		}

		return $code;
	}

	function updates_box($update)
	{
		global $icebb;

		$code			   .= <<<EOF

New Version Available!

	{$update}

	Download Now

EOF;

		return $code;
	}

	function security_updates($updates)
	{
		global $icebb;

		$code			   .= <<<EOF

Security Warning

You can safely ignore these if you have already applied the patches.

	{$updates}

EOF;

		return $code;
	}

	function message_box($msg)
	{
		global $icebb;

		$code			   .= <<<EOF

Message

	{$msg}

EOF;

		return $code;
	}

	function recent_actions($actions)
	{
		global $icebb;

		$code			   .= <<<EOF

Recent Actions

		Date
		Username
		IP
		Action

EOF;

		foreach($actions as $log)
		{
			$time			= date('n/d/Y g:i A',$log['time']);
			$code		   .= <<<EOF

				{$time}
				{$log['user']}
				{$log['ip']}
				{$log['action']}

EOF;
		}

		$code			   .= <<<EOF

EOF;

		return $code;
	}
}
?>


text:
//-----------------------------------------------------------------------
// <copyright file="LegacyRestApiReadOnlyCallsTest.cs" company="The Outercurve Foundation">
//    Copyright (c) 2011, The Outercurve Foundation.
//
//    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.
// </copyright>
// <author>Nathan Totten (ntotten.com), Jim Zimmerman (jimzimmerman.com) and Prabir Shrestha (prabir.me)</author>
// <website>https://github.com/facebook-csharp-sdk/facbook-csharp-sdk</website>
//-----------------------------------------------------------------------

namespace Facebook.Tests.FacebookClient
{
    using System.Linq;
    using Facebook;
    using Xunit;

    public class LegacyRestApiReadOnlyCallsTest
    {
        [Fact]
        public void LengthIs60()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Length;

            Assert.Equal(60, result);
        }

        [Fact]
        public void ContainsAdminGetAllocation()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("admin.getallocation");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAdminGetAppProperties()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("admin.getappproperties");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAdminGetBannedUsers()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("admin.getbannedusers");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAdminGetLiveStreamViaLink()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("admin.getlivestreamvialink");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAdminGetMetrics()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("admin.getmetrics");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAdminGetRestrictionInfo()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("admin.getrestrictioninfo");

            Assert.True(result);
        }

        [Fact]
        public void ContainsApplicationGetPublicInfo()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("application.getpublicinfo");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAuthGetPublicKey()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("auth.getapppublickey");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAuthGetSession()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("auth.getsession");

            Assert.True(result);
        }

        [Fact]
        public void ContainsAuthGetSignedPublicSessionData()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("auth.getsignedpublicsessiondata");

            Assert.True(result);
        }

        [Fact]
        public void ContainsCommentsGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("comments.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsGetUnconnectedFriendsCount()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("connect.getunconnectedfriendscount");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDashboardGetActivity()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("dashboard.getactivity");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDashboardGetCount()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("dashboard.getcount");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDashboardGetGlobalNews()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("dashboard.getglobalnews");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDashboardGetNews()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("dashboard.getnews");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDashboardMultiGetCount()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("dashboard.multigetcount");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDashboardMultiGetNews()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("dashboard.multigetnews");

            Assert.True(result);
        }

        [Fact]
        public void ContainsDataGetCookies()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("data.getcookies");

            Assert.True(result);
        }

        [Fact]
        public void ContainsEventsGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("events.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsEventsGetMembers()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("events.getmembers");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFbmlGetCustomTags()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("fbml.getcustomtags");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFeedGetAppFirendStories()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("feed.getappfriendstories");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFeedGetrEgisteredTemplateBundleById()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("feed.getregisteredtemplatebundlebyid");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFeedGetrEgisteredTemplateBundles()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("feed.getregisteredtemplatebundles");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFqlMultiQuery()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("fql.multiquery");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFqlQuery()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("fql.query");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFriendsAreFriends()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("friends.arefriends");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFriendsGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("friends.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFriendsGetApUsers()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("friends.getappusers");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFriendsGetLists()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("friends.getlists");

            Assert.True(result);
        }

        [Fact]
        public void ContainsFriendsGetMultualFriends()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("friends.getmutualfriends");

            Assert.True(result);
        }

        [Fact]
        public void ContainsGiftsGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("gifts.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsGroupsGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("groups.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsGroupsGetMembers()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("groups.getmembers");

            Assert.True(result);
        }

        [Fact]
        public void ContainsIntlGetTranslations()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("intl.gettranslations");

            Assert.True(result);
        }

        [Fact]
        public void ContainsLinksGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("links.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsNotesGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("notes.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsNotificationsGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("notifications.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPagesGetInfo()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("pages.getinfo");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPagesIsAdmin()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("pages.isadmin");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPagesIsAppAdded()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("pages.isappadded");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPagesIsFan()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("pages.isfan");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPermissionsCheckAvailableApiAccess()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("permissions.checkavailableapiaccess");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPermissionsCheckGrantedApiAccess()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("permissions.checkgrantedapiaccess");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPhotosGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("photos.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPhotosGetAlbums()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("photos.getalbums");

            Assert.True(result);
        }

        [Fact]
        public void ContainsPhotosGetTags()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("photos.gettags");

            Assert.True(result);
        }

        [Fact]
        public void ContainsProfileGetInfo()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("profile.getinfo");

            Assert.True(result);
        }

        [Fact]
        public void ContainsProfileGetInfoOptions()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("profile.getinfooptions");

            Assert.True(result);
        }

        [Fact]
        public void ContainsStreamGet()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("stream.get");

            Assert.True(result);
        }

        [Fact]
        public void ContainsStreamGetComments()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("stream.getcomments");

            Assert.True(result);
        }

        [Fact]
        public void ContainsStreamGetFilters()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("stream.getfilters");

            Assert.True(result);
        }

        [Fact]
        public void ContainsUsersGetInfo()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("users.getinfo");

            Assert.True(result);
        }

        [Fact]
        public void ContainsUsersGetLoggedInUser()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("users.getloggedinuser");

            Assert.True(result);
        }

        [Fact]
        public void ContainsUsersGetStandardInfo()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("users.getstandardinfo");

            Assert.True(result);
        }

        [Fact]
        public void ContainsUsersHasAppPermission()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("users.hasapppermission");

            Assert.True(result);
        }

        [Fact]
        public void ContainsUsersIsAppUser()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("users.isappuser");

            Assert.True(result);
        }

        [Fact]
        public void ContainsUsersIsVerified()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("users.isverified");

            Assert.True(result);
        }

        [Fact]
        public void ContainsVideGetUploadLimits()
        {
            var result = FacebookClient.LegacyRestApiReadOnlyCalls.Contains("video.getuploadlimits");

            Assert.True(result);
        }
    }
}


text:
import django.db.models.deletion
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [("site", "0016_auto_20180719_0520")]

    operations = [
        migrations.CreateModel(
            name="SiteSettingsTranslation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("language_code", models.CharField(max_length=10)),
                ("header_text", models.CharField(blank=True, max_length=200)),
                ("description", models.CharField(blank=True, max_length=500)),
                (
                    "site_settings",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="translations",
                        to="site.SiteSettings",
                    ),
                ),
            ],
        ),
        migrations.AlterUniqueTogether(
            name="sitesettingstranslation",
            unique_together={("language_code", "site_settings")},
        ),
    ]


text:
function create_truststore {
   keytool -keystore $1 -storepass $2 -noprompt -alias $4 -import -file $3 -storetype PKCS12
}

# Parameters:
# $1: Path to the new keystore
# $2: Truststore password
# $3: Public key to be imported
# $4: Private key to be imported
# $5: Alias of the certificate
function create_keystore {
   RANDFILE=/tmp/.rnd openssl pkcs12 -export -in $3 -inkey $4 -name $5 -password pass:$2 -out $1
}

# $1 = trusted certs, $2 = TLS auth cert, $3 = TLS auth key, $4 = truststore path, $5 = keystore path, $6 = certs and key path
trusted_certs=$1
tls_auth_cert=$2
tls_auth_key=$3
truststore_path=$4
keystore_path=$5
certs_key_path=$6

if [ -n "$trusted_certs" ]; then
    echo "Preparing truststore"
    IFS=';' read -ra CERTS <<< ${trusted_certs}
    for cert in "${CERTS[@]}"
    do
        create_truststore $truststore_path $CERTS_STORE_PASSWORD $certs_key_path/$cert $cert
    done
    echo "Preparing truststore is complete"
fi

if [ -n "$tls_auth_cert" ] && [ -n "$tls_auth_key" ]; then
    echo "Preparing keystore"
    create_keystore $keystore_path $CERTS_STORE_PASSWORD $certs_key_path/$tls_auth_cert $certs_key_path/$tls_auth_key $tls_auth_cert
    echo "Preparing keystore is complete"
fi


text:
package mobilita.esecuzione;

import mobilita.Automobile;
import mobilita.Bicicletta;
import mobilita.Carrozza;
import mobilita.Veicolo;

public class ProgrammaPrincipale {

	public static void main(String[] args) {
		Veicolo v = new Bicicletta();

		// queste sono le istruzioni che voglio
		// impedire di eseguire
		//c.tipoTrazione.trazioneAnimale = false;
		//c.getTipoTrazione().trazioneAnimale = false;

		System.out.println(v.getTipoTrazione().isTrazioneAnimale());

	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SpirvNet.DotNet.SSA
{
    /// <summary>
    /// Phi function merging a set of locations into another one
    /// </summary>
    public class PhiFunction
    {
        /// <summary>
        /// Target location
        /// </summary>
        public readonly TypedLocation Target;

        /// <summary>
        /// Source locations
        /// </summary>
        public readonly TypedLocation[] Sources;

        public PhiFunction(TypedLocation target, params TypedLocation[] sources)
        {
            Target = target;
            Sources = sources;
        }
    }
}


text:
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
from .models import Lekarstv
from Dj_Learn_start.forms import OrderForm

# Create your views here.
def list(request):
    lekarstvL = Lekarstv.objects.all()
    return render(request, "lekarstv/lekarstv_list.html", {"lekarstvL": lekarstvL})

def detail(request, lekarstv_id):
    form = OrderForm(request.POST or None)
    lekarstvD = get_object_or_404(Lekarstv, id=lekarstv_id)
    if request.method == "POST":
        if form.is_valid():
            name_lekarstvo = form.cleaned_data['name']
            #form.save()
            return HttpResponseRedirect('{}?sent=True'.format(reverse("detail", kwargs={'lekarstv_id': lekarstvD.id})))

    return render(request, "lekarstv/lekarstv_detail.html", {
        "lekarstvD": lekarstvD,
        "form": form,
        "sent": request.GET.get('sent', False)
    })


text:
//
//  ZFView.h
//  ZFDropDownDemo
//
//  Created by apple on 2017/1/5.
//  Copyright © 2017年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ZFView : UIView

/** 点击状态 */
@property (nonatomic, assign) BOOL isSelected;

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.afqa123.shareplay"
      android:versionName="1.21" android:versionCode="15">
    <uses-sdk android:targetSdkVersion="5" android:minSdkVersion="5"/>
	<uses-permission android:name="android.permission.INTERNET" />
	<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"></uses-permission>
	<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
	<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <application android:label="@string/app_name"
        		 android:icon="@drawable/icon64_app"
        		 android:theme="@android:style/Theme.NoTitleBar"
        		 android:allowBackup="false">
        <activity android:name=".SharePlayActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".SelectionActivity" />
		<service android:name=".MediaPlayerService"
				 android:enabled="true" />
    </application>
</manifest>


text:
package com.epam.ta.reportportal.ws.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author Pavel Bortnik
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Position {

	@JsonProperty(value = "positionX")
	private int x;

	@JsonProperty(value = "positionY")
	private int y;

	public Position() {
	}

	public Position(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}

		Position position = (Position) o;

		if (x != position.x) {
			return false;
		}
		return y == position.y;
	}

	@Override
	public int hashCode() {
		int result = x;
		result = 31 * result + y;
		return result;
	}
}


text:
from .. import authz
from . import v1_core

@authz.needs_authorization("list", "core", "v1", "namespaces")
def list_namespaces():
    return v1_core.list_namespace()


text:
[![Stability: Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html)
![Build Status](https://github.com/zalando/opentracing-toolbox/workflows/build/badge.svg)
[![Coverage Status](https://img.shields.io/coveralls/zalando/opentracing-toolbox/main.svg)](https://coveralls.io/r/zalando/opentracing-toolbox)
[![Code Quality](https://img.shields.io/codacy/grade/69e173024eec403797466e147a2051a3/main.svg)](https://www.codacy.com/app/whiskeysierra/opentracing-toolbox)
[![Release](https://img.shields.io/github/release/zalando/opentracing-toolbox.svg)](https://github.com/zalando/opentracing-toolbox/releases)
[![Maven Central](https://img.shields.io/maven-central/v/org.zalando/opentracing-toolbox.svg)](https://maven-badges.herokuapp.com/maven-central/org.zalando/opentracing-toolbox)
[![OpenTracing](https://img.shields.io/badge/OpenTracing-enabled-blue.svg)](http://opentracing.io)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/zalando/opentracing-toolbox/main/LICENSE)

*OpenTracing Toolbox* is a collection of libraries that build on top of [OpenTracing](https://opentracing.io/) and provide extensions and plugins to existing instrumentations.

- **Status**: Under development and used in production

## Features

- Legacy [FlowID](#flowid) compatibility support
- JDBC support
- Extensible [OpenTracing Proxy](#proxy) (wrapper) w/ support for listeners and interceptors
- Servlet support
- Spring Web and Webflux support
- Sensible defaults

## Modules

### FlowID

The `opentracing-flowid` module replaces the former [`zalando/tracer`](https://github.com/zalando/tracer) library by providing support for the `X-Flow-ID` header propagation on top of OpenTracing.

Go checkout out its [README](opentracing-flowid) for details.

### JDBC

The `opentracing-jdbc` module is a direct **competitor** to [opentracing-contrib/java-jdbc](https://github.com/opentracing-contrib/java-jdbc).

Go checkout out its [README](opentracing-jdbc) for details.

### Proxy

The `opentracing-proxy` module is a direct **competitor** to [opentracing-contrib/java-api-extensions](https://github.com/opentracing-contrib/java-api-extensions).

Go checkout out its [README](opentracing-proxy) for details.

### Servlet Extension

The `opentracing-servlet-extension` module is an **extension** to `io.opentracing.contrib:opentracing-web-servlet-filter` and only useful if used in conjunction.

Go checkout out its [README](opentracing-servlet-extension) for details.

### Spring Web Extension

The `opentracing-spring-web-extension` module is an **extension** to `io.opentracing.contrib:opentracing-spring-web` and only useful if used in conjunction.

Go checkout out its [README](opentracing-spring-extension/opentracing-spring-web-extension) for details.

### Spring Webflux Extension

The `opentracing-spring-webflux-extension` module is an **extension** to `io.opentracing.contrib:opentracing-spring-web` and only useful if used in conjunction.

Go checkout out its [README](opentracing-spring-extension/opentracing-spring-webflux-extension) for details.

## Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's [Issue Tracker](../../issues).

## Getting Involved/Contributing

To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For
more details, check the [contribution guidelines](.github/CONTRIBUTING.md).

## Alternatives

Tracer, by design, does not provide sampling, metrics or annotations. Neither does it use the semantics of spans as
most of the following projects do. If you require any of these, you're highly encouraged to try them.

- [The OpenTracing Project](http://opentracing.io/)
- [Apache HTrace](http://htrace.incubator.apache.org/)
- [Spring Cloud Sleuth](http://cloud.spring.io/spring-cloud-sleuth/)
- [Zipkin](http://zipkin.io/)


text:
import { combineReducers } from 'redux';
// import multireducer from 'multireducer';
import { routerStateReducer } from 'redux-router';

import projects from './projects';
import project from './project';

export default combineReducers({
  router: routerStateReducer,
  projects,
  project
});