text:
<bill session="111" type="h" number="495" updated="2009-03-07T10:45:49-05:00">
	<status><introduced date="1231909200" datetime="2009-01-14"/></status>

	<introduced date="1231909200" datetime="2009-01-14"/>
	<titles>
		<title type="short" as="introduced">Southwest Border Violence Reduction Act of 2009</title>
		<title type="official" as="introduced">To authorize additional resources to identify and eliminate illicit sources of firearms smuggled into Mexico for use by violent drug trafficking organizations, and for other purposes.</title>
	</titles>
	<sponsor id="400339"/>
	<cosponsors>
		<cosponsor id="400337" joined="2009-01-14"/>
		<cosponsor id="400657" joined="2009-01-23"/>
		<cosponsor id="400122" joined="2009-01-14"/>
		<cosponsor id="412316" joined="2009-01-14"/>
	</cosponsors>
	<actions>
		<action date="1231909200" datetime="2009-01-14"><text>Referred to the Committee on the Judiciary, and in addition to the Committee on Foreign Affairs, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text></action>
		<action date="1231909200" datetime="2009-01-14"><text>Referred to House Judiciary</text></action>
		<action date="1231909200" datetime="2009-01-14"><text>Referred to House Foreign Affairs</text></action>
	</actions>
	<committees>
		<committee name="House Judiciary" subcommittee="" activity="Referral, In Committee" />
		<committee name="House Foreign Affairs" subcommittee="" activity="Referral, In Committee" />
	</committees>
	<relatedbills>
		<bill relation="identical" session="111" type="s" number="205" />
	</relatedbills>
	<subjects>
		<term name="Crime and law enforcement"/>
		<term name="Border security and unlawful immigration"/>
		<term name="Firearms"/>
		<term name="International organizations and cooperation"/>
		<term name="Investigation, prosecution, interrogation methods"/>
		<term name="Latin America"/>
		<term name="Law enforcement officers"/>
		<term name="Mexico"/>
		<term name="Organized crime"/>
		<term name="Smuggling and trafficking"/>
	</subjects>
	<amendments>

	</amendments>

	1/14/2009--Introduced.
Southwest Border Violence Reduction Act of 2009 - Directs the Attorney General to: (1) to expand resources for the Project Gunrunner initiative of the Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF) to identify, investigate, and prosecute firearms trafficking across the U.S.- Mexico border; and (2) provide ATF agents, equipment, and training to assist Mexican law enforcement officers in combating firearms trafficking and other criminal enterprises.

</bill>


text:
[Apache Spark](https://spark.apache.org/) is a general-purpose data processing engine. It supports batch and stream processing and comes with built-in APIs for SQL, machine learning and graph workloads. Spark is storage-layer agnostic, meaning it doesn't come with its own storage system but provides connectors to read data from and write data into, for example, the local filesystem, HDFS, Kafka, Cassandra, Elasticsearch, and HBase.

- Estimated time for completion: 10 minutes
- Target audience: Anyone interested in a data processing engine.
- Scope: Learn how to install Spark on DC/OS and how to launch a Spark job.

**Terminology**:

- **Application** ... A program built on Spark, consisting of a driver program and executors in the cluster.
- **Driver** ... A process running the `main()` function of the application (and providing the SparkContext).
- **Executor** ... A process launched for an application on a worker node.
- **Mesos run modes** ... Spark can run in Mesos using two modes: `coarse-grained` (default) and `fine-grained`. The `coarse-grained` mode has a lower startup overhead and is good for interactive sessions; it launches one long-running Spark task on each worked node at the cost of reserving the resources for the complete duration of the application. The `fine-grained` mode shows better resource utilization and is good for batch and certain streaming jobs; it launches each Spark task as a separate Mesos task. Note that `fine-grained` mode was [deprecated](https://spark.apache.org/docs/latest/running-on-mesos.html#fine-grained-deprecated) as of Spark 2.0.0.

**Table of Contents**:

- [Prerequisites](#prerequisites)
- [Install Spark](#install-spark)
- [Launch a Spark job](#launch-a-spark-job)
- [Uninstall Spark](#uninstall-spark)

## Prerequisites

- A running DC/OS 1.11 cluster with at least 3 nodes with each 2 CPUs and 2 GB of RAM available.
- [DC/OS CLI](https://dcos.io/docs/1.11/cli/install/) installed.

## Install Spark

Assuming you have a DC/OS cluster up and running, the first step is to install Spark:

```bash
$ dcos package install spark
By Deploying, you agree to the Terms and Conditions https://mesosphere.com/catalog-terms-conditions/#certified-services
Continue installing? [yes/no] yes
Installing Marathon app for package [spark] version [2.3.1-2.2.1-2]
Installing CLI subcommand for package [spark] version [2.3.1-2.2.1-2]
New command available: dcos spark
DC/OS Spark is being installed!

        Documentation: https://docs.mesosphere.com/service-docs/spark/
        Issues: https://docs.mesosphere.com/support/
```

If the spark service is already installed and you only wish to install the CLI subcommand on your client, simply do:

```bash
$ dcos package install spark --cli
By Deploying, you agree to the Terms and Conditions https://mesosphere.com/catalog-terms-conditions/#certified-services
Continue installing? [yes/no] yes
Installing CLI subcommand for package [spark] version [2.3.1-2.2.1-2]
New command available: dcos spark
```

Note that while the DC/OS CLI subcommand `spark` is immediately available, it takes a few moments for Spark to start running in the cluster.

To see the new possible with the new `spark` subcommand, you can use the following command:

```bash
$ dcos spark --help
```

Now, we can validate if Spark is running and healthy, in the cluster itself. For this, go to the DC/OS UI and you should see Spark there under the `Services` tab:

![Services](img/services.png)

You can see the SparkUI page if you use the `dcos spark webui` command:

![Spark Drivers page](img/spark-drivers.png)

This page contains all the datas about jobs which are launched in the Spark cluster. We will see later how to get jobs' logs from their.

## Launch a Spark job

Now that you've set up Spark, it's time to launch your first Spark job. We will use one of the [existing examples](https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/SparkPi.scala) that comes with Spark.

```bash
$ dcos spark run --submit-args='--driver-cores 1 --driver-memory 1024M --class org.apache.spark.examples.SparkPi https://downloads.mesosphere.com/spark/assets/spark-examples_2.10-1.4.0-SNAPSHOT.jar 30'
2018/04/26 23:09:07 Using mesosphere/spark:2.3.1-2.2.1-2-hadoop-2.6 as the image for the driver
2018/04/26 23:09:07 Pulling image mesosphere/spark:2.3.1-2.2.1-2-hadoop-2.6 for executors, by default. To bypass set spark.mesos.executor.docker.forcePullImage=false
2018/04/26 23:09:07 Setting DCOS_SPACE to /spark
Run job succeeded. Submission id: driver-20180426210908-0001
```

Note the submission ID in the last line, above, in our example `driver-20180426210908-0001`: this allows to track the job via the CLI as we will see below. When you look at the Spark drivers page you should see the job as well:

![Spark finished job](img/spark-finished-job.png)

Alternatively, you can use the CLI to verify (as shown in the example below) the completion of the job.  This will change based on when you run the status command:

```bash
$ dcos spark status driver-20180426210908-0001
{
  "action": "SubmissionStatusResponse",
  "driverState": "FINISHED",
  "message": "task_id {\n  value: \"driver-20180426210908-0001\"\n}\nstate: TASK_FINISHED\nmessage: \"Container exited with status 0\"\nslave_id {\n  value: \"490c8a83-7aa4-4af2-a870-e2e8644eba2e-S3\"\n}\ntimestamp: 1.524777016359243E9\nexecutor_id {\n  value: \"driver-20180426210908-0001\"\n}\nsource: SOURCE_EXECUTOR\nuuid: \"\\303\\271\\nh\\t\\276IK\\204\\334\\336T\\\"Y\\214)\"\ncontainer_status {\n  network_infos {\n    ip_addresses {\n      ip_address: \"10.0.3.177\"\n    }\n  }\n  container_id {\n    value: \"7013ccb9-2f0d-4ce4-b9f8-764140647150\"\n  }\n}\n",
  "serverSparkVersion": "2.2.1",
  "submissionId": "driver-20180426210908-0001",
  "success": true
}

Message:
task_id {
    value: "driver-20180426210908-0001"
}
state: TASK_FINISHED
message: "Container exited with status 0"
slave_id {
    value: "490c8a83-7aa4-4af2-a870-e2e8644eba2e-S3"
}
timestamp: 1.524777016359243E9
executor_id {
    value: "driver-20180426210908-0001"
}
source: SOURCE_EXECUTOR
uuid: "\303\271\nh\t\276IK\204\334\336T\"Y\214)"
container_status {
    network_infos {
    ip_addresses {
      ip_address: "10.0.3.177"
    }
  }
  container_id {
    value: "7013ccb9-2f0d-4ce4-b9f8-764140647150"
  }
}

```

Now let's use `dcos spark log` to verify the execution on the CLI. While this is probably not that useful for very short-running batch jobs, it's beneficial for long-running jobs as well as Spark Streaming jobs:

```bash
$ dcos spark log driver-20180426210908-0001
Pi is roughly 3.14102
```

So it turns out to be useful to use the `dcos spark log` command: we get the result of the computation, that is, an approximation for π, without having to dig into the logs.

You can access to the cluster logs by using the SparkUI too. To do this, you just have to click in the `sandbox` button on the right of you job. It will permit to check the logs of your spark job from the MesosUI.

![Spark sandbox](img/spark-sandbox.png)

![Mesos UI](img/mesos-ui.png)

## Uninstall Spark

To uninstall Spark:

```bash
$ dcos package uninstall spark
```

## Further resources

- [DC/OS Spark Official Documentation](https://docs.mesosphere.com/service-docs/spark/)
- [Mesos-specific](https://spark.apache.org/docs/latest/running-on-mesos.html#configuration) configuration options for Spark
- [Mesos run modes](https://spark.apache.org/docs/latest/running-on-mesos.html#mesos-run-modes) for Spark
- A gentle introduction into [Spark on Mesos](http://www.slideshare.net/Typesafe_Inc/how-to-deploy-apache-spark-to-mesosdcos) by Lightbend

redpajama_set_name: RedPajamaGithub


text:
package edu.kit.dama.authorization.entities;

/**
 *
 * @author jejkal
 */
public interface ISimpleSecurableResource {

    /**
     * Get the id.
     *
     * @return The id.
     */
    Long getId();
}


text:
package org.hibernate.envers.test.integration.modifiedflags;

import java.util.List;
import javax.persistence.EntityManager;

import org.junit.Test;

import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.envers.test.Priority;
import org.hibernate.envers.test.entities.StrTestEntity;
import org.hibernate.envers.test.integration.collection.mapkey.IdMapKeyEntity;

import static junit.framework.Assert.assertEquals;
import static org.hibernate.envers.test.tools.TestTools.extractRevisionNumbers;
import static org.hibernate.envers.test.tools.TestTools.makeList;

/**
 * @author Adam Warski (adam at warski dot org)
 * @author Michal Skowronek (mskowr at o2 dot pl)
 */
public class HasChangedIdMapKey extends AbstractModifiedFlagsEntityTest {
    private Integer imke_id;

	public void configure(Ejb3Configuration cfg) {
        cfg.addAnnotatedClass(IdMapKeyEntity.class);
        cfg.addAnnotatedClass(StrTestEntity.class);
    }

    @Test
    @Priority(10)
    public void initData() {
        EntityManager em = getEntityManager();

        IdMapKeyEntity imke = new IdMapKeyEntity();

        // Revision 1 (intialy 1 mapping)
        em.getTransaction().begin();

        StrTestEntity ste1 = new StrTestEntity("x");
        StrTestEntity ste2 = new StrTestEntity("y");

        em.persist(ste1);
        em.persist(ste2);

        imke.getIdmap().put(ste1.getId(), ste1);

        em.persist(imke);

        em.getTransaction().commit();

        // Revision 2 (sse1: adding 1 mapping)
        em.getTransaction().begin();

        ste2 = em.find(StrTestEntity.class, ste2.getId());
        imke = em.find(IdMapKeyEntity.class, imke.getId());

        imke.getIdmap().put(ste2.getId(), ste2);

        em.getTransaction().commit();

        //

        imke_id = imke.getId();

	}

	@Test
	public void testHasChanged() throws Exception {
		List list = queryForPropertyHasChanged(IdMapKeyEntity.class, imke_id,
				"idmap");
		assertEquals(2, list.size());
		assertEquals(makeList(1, 2), extractRevisionNumbers(list));

		list = queryForPropertyHasNotChanged(IdMapKeyEntity.class, imke_id,
				"idmap");
		assertEquals(0, list.size());
	}
}


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public int Collation { get; set; }
```

### Property Value
Type: System.Int32

## See also
- [RegionalSettings](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.RegionalSettings.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)


text:
package server

import "github.com/packet-guardian/pg-dhcp/dhcp"

type multiple int // How many of a token type are allowed
type length int   // The number of bytes an option can be in length

const (
	oneOrMore multiple = -1 // One or more of a token are allowed

	unlimited length = 0 // The option may be as long as needed (within spec)
)

var (
	// The following are all the schemas used in the options defined below
	booleanSchema  = &optionSchema{token: BOOLEAN, multi: 1, maxlen: 1, multipleOf: 1}
	singleIPSchema = &optionSchema{token: IP_ADDRESS, multi: 1, maxlen: 4, multipleOf: 4}
	multiIPSchema  = &optionSchema{token: IP_ADDRESS, multi: oneOrMore, maxlen: unlimited, multipleOf: 4}
	stringSchema   = &optionSchema{token: STRING, multi: 1, maxlen: unlimited, multipleOf: 1}
	int8Schema     = &optionSchema{token: NUMBER, multi: 1, maxlen: 1, multipleOf: 1}
	int16Schema    = &optionSchema{token: NUMBER, multi: 1, maxlen: 2, multipleOf: 2}
	int32Schema    = &optionSchema{token: NUMBER, multi: 1, maxlen: 4, multipleOf: 4}
	anySchema      = &optionSchema{token: ANY, multi: oneOrMore, maxlen: unlimited, multipleOf: 1}
)

type optionSchema struct {
	token      token
	multi      multiple // How many of the token are allowed
	multipleOf int
	maxlen     length // Maximum number of bytes the option can be
}

type dhcpOptionBlock struct {
	code   dhcp4.OptionCode
	schema *optionSchema
}

var options = map[string]*dhcpOptionBlock{
	// Standard BOOTP options
	"subnet-mask": &dhcpOptionBlock{
		code:   dhcp4.OptionSubnetMask,
		schema: singleIPSchema,
	},
	"time-offset": &dhcpOptionBlock{
		code:   dhcp4.OptionTimeOffset,
		schema: int32Schema,
	},
	"router": &dhcpOptionBlock{
		code:   dhcp4.OptionRouter,
		schema: multiIPSchema,
	},
	"time-server": &dhcpOptionBlock{
		code:   dhcp4.OptionTimeServer,
		schema: multiIPSchema,
	},
	"name-server": &dhcpOptionBlock{
		code:   dhcp4.OptionNameServer,
		schema: multiIPSchema,
	},
	"domain-name-server": &dhcpOptionBlock{
		code:   dhcp4.OptionDomainNameServer,
		schema: multiIPSchema,
	},
	"log-server": &dhcpOptionBlock{
		code:   dhcp4.OptionLogServer,
		schema: multiIPSchema,
	},
	"cookie-server": &dhcpOptionBlock{
		code:   dhcp4.OptionCookieServer,
		schema: multiIPSchema,
	},
	"lpr-server": &dhcpOptionBlock{
		code:   dhcp4.OptionLPRServer,
		schema: multiIPSchema,
	},
	"impress-server": &dhcpOptionBlock{
		code:   dhcp4.OptionImpressServer,
		schema: multiIPSchema,
	},
	"resource-location-server": &dhcpOptionBlock{
		code:   dhcp4.OptionResourceLocationServer,
		schema: multiIPSchema,
	},
	"hostname": &dhcpOptionBlock{
		code:   dhcp4.OptionHostName,
		schema: stringSchema,
	},
	"boot-file-size": &dhcpOptionBlock{
		code:   dhcp4.OptionBootFileSize,
		schema: int16Schema,
	},
	"merit-dump-file": &dhcpOptionBlock{
		code:   dhcp4.OptionMeritDumpFile,
		schema: stringSchema,
	},
	"domain-name": &dhcpOptionBlock{
		code:   dhcp4.OptionDomainName,
		schema: stringSchema,
	},
	"swap-server": &dhcpOptionBlock{
		code:   dhcp4.OptionSwapServer,
		schema: singleIPSchema,
	},
	"root-path": &dhcpOptionBlock{
		code:   dhcp4.OptionRootPath,
		schema: stringSchema,
	},
	"extensions-path": &dhcpOptionBlock{
		code:   dhcp4.OptionExtensionsPath,
		schema: stringSchema,
	},

	// IP Layer Parameters per Host
	"ip-forwarding-toggle": &dhcpOptionBlock{
		code:   dhcp4.OptionIPForwardingEnableDisable,
		schema: booleanSchema,
	},
	"non-local-source-routing-toggle": &dhcpOptionBlock{
		code:   dhcp4.OptionNonLocalSourceRoutingEnableDisable,
		schema: booleanSchema,
	},
	"policy-filter": &dhcpOptionBlock{
		code:   dhcp4.OptionPolicyFilter,
		schema: multiIPSchema,
	},
	"max-datagram-reassembly-size": &dhcpOptionBlock{
		code:   dhcp4.OptionMaximumDatagramReassemblySize,
		schema: int16Schema,
	},
	"default-ip-ttl": &dhcpOptionBlock{
		code:   dhcp4.OptionDefaultIPTimeToLive,
		schema: int8Schema,
	},
	"path-mtu-aging-timeout": &dhcpOptionBlock{
		code:   dhcp4.OptionPathMTUAgingTimeout,
		schema: int32Schema,
	},
	"path-mtu-plateau-table": &dhcpOptionBlock{
		code:   dhcp4.OptionPathMTUPlateauTable,
		schema: &optionSchema{token: NUMBER, multi: oneOrMore, maxlen: unlimited},
	},

	// IP Layer Parameters per Interface
	"interface-mtu": &dhcpOptionBlock{
		code:   dhcp4.OptionInterfaceMTU,
		schema: int16Schema,
	},
	"all-subnets-are-local": &dhcpOptionBlock{
		code:   dhcp4.OptionAllSubnetsAreLocal,
		schema: booleanSchema,
	},
	"broadcast-address": &dhcpOptionBlock{
		code:   dhcp4.OptionBroadcastAddress,
		schema: singleIPSchema,
	},
	"perform-mask-discovery": &dhcpOptionBlock{
		code:   dhcp4.OptionPerformMaskDiscovery,
		schema: booleanSchema,
	},
	"mask-supplier": &dhcpOptionBlock{
		code:   dhcp4.OptionMaskSupplier,
		schema: booleanSchema,
	},
	"perform-router-discovery": &dhcpOptionBlock{
		code:   dhcp4.OptionPerformRouterDiscovery,
		schema: booleanSchema,
	},
	"router-solicitation-address": &dhcpOptionBlock{
		code:   dhcp4.OptionRouterSolicitationAddress,
		schema: singleIPSchema,
	},
	"static-route": &dhcpOptionBlock{
		code:   dhcp4.OptionStaticRoute,
		schema: multiIPSchema,
	},

	// Link Layer Parameters per Interface
	"trailer-encapsulation": &dhcpOptionBlock{
		code:   dhcp4.OptionTrailerEncapsulation,
		schema: booleanSchema,
	},
	"arp-cache-timeout": &dhcpOptionBlock{
		code:   dhcp4.OptionARPCacheTimeout,
		schema: int32Schema,
	},
	"ethernet-encapsulation": &dhcpOptionBlock{
		code:   dhcp4.OptionEthernetEncapsulation,
		schema: booleanSchema,
	},

	// TCP Parameters
	"tcp-default-ttl": &dhcpOptionBlock{
		code:   dhcp4.OptionTCPDefaultTTL,
		schema: int8Schema,
	},
	"tcp-keepalive-interval": &dhcpOptionBlock{
		code:   dhcp4.OptionTCPKeepaliveInterval,
		schema: int32Schema,
	},
	"tcp-keepalive-garbage": &dhcpOptionBlock{
		code:   dhcp4.OptionTCPKeepaliveGarbage,
		schema: booleanSchema,
	},

	// Application and Service Parameters
	"network-information-service-domain": &dhcpOptionBlock{
		code:   dhcp4.OptionNetworkInformationServiceDomain,
		schema: stringSchema,
	},
	"network-information-servers": &dhcpOptionBlock{
		code:   dhcp4.OptionNetworkInformationServers,
		schema: multiIPSchema,
	},
	"network-time-protocol-servers": &dhcpOptionBlock{
		code:   dhcp4.OptionNetworkTimeProtocolServers,
		schema: multiIPSchema,
	},
	// "vendor-specific-information": &dhcpOptionBlock{
	// 	code:   dhcp4.OptionVendorSpecificInformation,
	// 	schema: stringSchema,
	// },
	"netbios-over-tcpip-name-server": &dhcpOptionBlock{
		code:   dhcp4.OptionNetBIOSOverTCPIPNameServer,
		schema: multiIPSchema,
	},
	"netbios-over-tcpip-datagram-distribution-server": &dhcpOptionBlock{
		code:   dhcp4.OptionNetBIOSOverTCPIPDatagramDistributionServer,
		schema: multiIPSchema,
	},
	"netbios-over-tcpip-node-type": &dhcpOptionBlock{
		code:   dhcp4.OptionNetBIOSOverTCPIPNodeType,
		schema: int8Schema,
	},
	"netbios-over-tcpip-scope": &dhcpOptionBlock{
		code:   dhcp4.OptionNetBIOSOverTCPIPScope,
		schema: stringSchema,
	},
	"xwindow-system-font-server": &dhcpOptionBlock{
		code:   dhcp4.OptionXWindowSystemFontServer,
		schema: multiIPSchema,
	},
	"xwindow-system-display-manager": &dhcpOptionBlock{
		code:   dhcp4.OptionXWindowSystemDisplayManager,
		schema: multiIPSchema,
	},
	"nis+-Domain": &dhcpOptionBlock{
		code:   dhcp4.OptionNetworkInformationServicePlusDomain,
		schema: stringSchema,
	},
	"nis+-Servers": &dhcpOptionBlock{
		code:   dhcp4.OptionNetworkInformationServicePlusServers,
		schema: multiIPSchema,
	},
	"mobile-ip-home-agent": &dhcpOptionBlock{
		code:   dhcp4.OptionMobileIPHomeAgent,
		schema: multiIPSchema,
	},
	"simple-mail-transport-protocol": &dhcpOptionBlock{
		code:   dhcp4.OptionSimpleMailTransportProtocol,
		schema: multiIPSchema,
	},
	"post-office-protocol-server": &dhcpOptionBlock{
		code:   dhcp4.OptionPostOfficeProtocolServer,
		schema: multiIPSchema,
	},
	"network-news-transport-protocol": &dhcpOptionBlock{
		code:   dhcp4.OptionNetworkNewsTransportProtocol,
		schema: multiIPSchema,
	},
	"default-www-server": &dhcpOptionBlock{
		code:   dhcp4.OptionDefaultWorldWideWebServer,
		schema: multiIPSchema,
	},
	"default-finger-server": &dhcpOptionBlock{
		code:   dhcp4.OptionDefaultFingerServer,
		schema: multiIPSchema,
	},
	"default-irc-server": &dhcpOptionBlock{
		code:   dhcp4.OptionDefaultInternetRelayChatServer,
		schema: multiIPSchema,
	},
	"street-talk-server": &dhcpOptionBlock{
		code:   dhcp4.OptionStreetTalkServer,
		schema: multiIPSchema,
	},
	"street-talk-directory-assistance": &dhcpOptionBlock{
		code:   dhcp4.OptionStreetTalkDirectoryAssistance,
		schema: multiIPSchema,
	},

	// DHCP Extensions
	"tftp-server-name": &dhcpOptionBlock{
		code:   dhcp4.OptionTFTPServerName,
		schema: stringSchema,
	},
	"renewal-time-value": &dhcpOptionBlock{
		code:   dhcp4.OptionRenewalTimeValue,
		schema: int32Schema,
	},
	"rebinding-time-value": &dhcpOptionBlock{
		code:   dhcp4.OptionRebindingTimeValue,
		schema: int32Schema,
	},
}


text:
from .test_agents.python.agent import agent_fn as random_agent
all_agents = {
    "random_agent": random_agent,
}


text:
#include <iostream>
#include <fstream>

int main(int argc, char** argv) {
  std::ifstream input(argv[1]);
  double total = 0.0;
  double average = 0.0;
  int counter = 0; /* Must init to 0 */
  int value;

  if (!input) {
    std::cout << "Specify a filename as argv[1]" << std::endl;
    return 1;
  }

  while (input >> value) {
    if (value) {
      total += value;
      counter += 1;
      average = total / counter;
    }
  }
  std::cout << "Average is: " << average << std::endl;

  /* Explicit > implicit */
  return 0;
}


text:
@interface UITableViewSection : NSObject {
@public
    idretaintype(NSString) _headerTitle;
    idretaintype(NSArray) _rows;
}
-(id) initWithCoder:(NSCoder*)coder;
-(unsigned) numberOfRows;
-(NSString*) title;
-(void) dealloc;
-(UITableViewRow*) rowForIndex:(unsigned)idx;
@end


text:
        <button class="btn btn-default dropdown-toggle btn-block" type="button" data-toggle="dropdown"> {{currency.label}}: {{currency.text}} </button>

                <input type="text" class="form-control" placeholder="Search..." ng-model="vm.query"></input>

                 {{currentCurrency.label}}: {{currentCurrency.text}}

    <input type="text" class="form-control" aria-label="..." placeholder="{{currency.text}}" ng-model="input" ng-focus="vm.takeFocus()" ng-blur="vm.releaseFocus()" tabindex="{{tabIndex}}">


text:
import React from 'react';

class Progress extends React.Component {
    componentDidMount() {

    }

    render() {
        return (null)
    }
}

export default Progress


text:
FROM frolvlad/alpine-oraclejdk8:slim
VOLUME /tmp
ADD airlane-admin-0.0.1-SNAPSHOT.jar app.jar
RUN sh -c 'touch /app.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=docker","-jar","/app.jar"]


text:
//
//  XVimTextView.h
//  XVim

//
//  Created by Suzuki Shuichiro on 9/19/12.
//
//

#import "XVim.h"
#import "XVimMotion.h"
#import "XVimRegister.h"
#import <Foundation/Foundation.h>

/**
 * This is the interface to operate on text view used in XVim.
 * Text views want to communicate with XVim handlers(evaluators) must implement this protocol.
 **/

@protocol XVimTextViewDelegateProtocol
- (void)textView:(NSTextView*)view didYank:(NSString*)yankedText withType:(TEXT_TYPE)type;
- (void)textView:(NSTextView*)view didDelete:(NSString*)deletedText withType:(TEXT_TYPE)type;
@end

typedef enum {
    CURSOR_MODE_INSERT,
    CURSOR_MODE_COMMAND
}CURSOR_MODE;

typedef enum {
    OPTION_NONE,
}OPERATION_OPTION;

@protocol XVimTextViewProtocol <NSObject>
@property(readonly) NSUInteger insertionPoint;
@property(readonly) NSUInteger insertionColumn;
@property(readonly) NSUInteger insertionLine;
@property(readonly) NSUInteger selectionBegin;
@property(readonly) XVIM_VISUAL_MODE selectionMode;
@property(readonly) NSUInteger selectedLines;  // Number of lines selected (0 if not in selection mode)
@property(readonly) NSUInteger selectedColumns; // Number of columns selected (0 if not in selection mode)
@property(readonly) CURSOR_MODE cursorMode;
@property(readonly) NSUInteger preservedColumn;

// Selection Mode
- (void)changeSelectionMode:(XVIM_VISUAL_MODE)mode;

// Top Level Operation Interface
- (void)move:(XVimMotion*)motion;
- (void)delete:(XVimMotion*)motion;
- (void)change:(XVimMotion*)motion;
- (void)yank:(XVimMotion*)motion;
- (void)put:(NSString*)text withType:(TEXT_TYPE)type afterCursor:(bool)after count:(NSUInteger)times;
- (void)swapCase:(XVimMotion*)motion; // Previously this is named "toggleCase" in XVim
- (void)makeLowerCase:(XVimMotion*)motion; // Previously this is named "lowerCase" in XVim
- (void)makeUpperCase:(XVimMotion*)motion; // Previously this is named "lowerCase" in XVim
- (void)filter:(XVimMotion*)motion;
- (void)shiftRight:(XVimMotion*)motion;
- (void)shiftLeft:(XVimMotion*)motion;
- (void)join:(NSUInteger)count;
- (void)insertNewlineBelowLine:(NSUInteger)line;
- (void)insertNewlineAboveLine:(NSUInteger)line;
- (void)insertNewlineAbove;
- (void)insertNewlineBelow;
- (void)insertNewlineAboveAndInsert;
- (void)insertNewlineBelowAndInsert;
- (void)insertText:(NSString*)str line:(NSUInteger)line column:(NSUInteger)column;
- (BOOL)replaceCharacters:(unichar)c count:(NSUInteger)count;

// Insert or Command
- (void)escapeFromInsert;
- (void)append;
- (void)insert;
- (void)appendAtEndOfLine;
- (void)insertBeforeFirstNonblank;

// for keydown in insertion
- (void)passThroughKeyDown:(NSEvent*)event;

// Premitive Operations ( Avoid using following. Consider use or make Top Level Operation Interface instead )
- (void)moveBack:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveFoward:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveDown:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveUp:(NSUInteger)count option:(MOTION_OPTION)opt;
//- (void)wordsForward:(NSUInteger)index count:(NSUInteger)count option:(MOTION_OPTION)opt info:(XVimWordInfo*)info;
- (void)moveWordsBackward:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveSentencesForward:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveSentencesBackward:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveParagraphsForward:(NSUInteger)count option:(MOTION_OPTION)opt;
- (void)moveParagraphsBackward:(NSUInteger)count option:(MOTION_OPTION)opt;

- (void)overwriteCharacter:(unichar)c;

- (void)moveToPosition:(XVimPosition)pos;

// Scrolls
- (void)scrollPageForward:(NSUInteger)count;
- (void)scrollPageBackward:(NSUInteger)count;
- (void)scrollHalfPageForward:(NSUInteger)count;
- (void)scrollHalfPageBackward:(NSUInteger)count;
- (void)scrollLineForward:(NSUInteger)count;
- (void)scrollLineBackward:(NSUInteger)count;
- (void)scrollBottom:(NSUInteger)lineNumber firstNonblank:(BOOL)fnb;
- (void)scrollTop:(NSUInteger)lineNumber firstNonblank:(BOOL)fnb;;
- (void)scrollCenter:(NSUInteger)lineNumber firstNonblank:(BOOL)fnb;;

@end


text:
package org.cloudfoundry.client.v3.processes;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.cloudfoundry.AllowNulls;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.client.v3.Link;

import java.util.List;
import java.util.Map;

/**
 * Base class for responses that are processes
 */
public abstract class Process {

    /**
     * The command
     */
    @JsonProperty("command")
    @Nullable
    public abstract String getCommand();

    /**
     * The created at
     */
    @JsonProperty("created_at")
    @Nullable
    public abstract String getCreatedAt();

    /**
     * The disk in megabytes
     */
    @JsonProperty("disk_in_mb")
    @Nullable
    public abstract Integer getDiskInMb();

    /**
     * The health check
     */
    @JsonProperty("health_check")
    @Nullable
    public abstract HealthCheck getHealthCheck();

    /**
     * The id
     */
    @JsonProperty("guid")
    @Nullable
    public abstract String getId();

    /**
     * The instances
     */
    @JsonProperty("instances")
    @Nullable
    public abstract Integer getInstances();

    /**
     * The links
     */
    @AllowNulls
    @JsonProperty("links")
    @Nullable
    public abstract Map<String, Link> getLinks();

    /**
     * The memory in megabytes
     */
    @JsonProperty("memory_in_mb")
    @Nullable
    public abstract Integer getMemoryInMb();

    /**
     * The ports opened to the application
     */
    @JsonProperty("ports")
    @Nullable
    public abstract List<Integer> getPorts();

    /**
     * The type
     */
    @JsonProperty("type")
    @Nullable
    public abstract String getType();

    /**
     * The updated at
     */
    @JsonProperty("updated_at")
    @Nullable
    public abstract String getUpdatedAt();

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MIT License ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~
 ~ Copyright (c) 2017-2022 SNF4J contributors
 ~
 ~ Permission is hereby granted, free of charge, to any person obtaining a copy
 ~ of this software and associated documentation files (the "Software"), to deal
 ~ in the Software without restriction, including without limitation the rights
 ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 ~ copies of the Software, and to permit persons to whom the Software is
 ~ furnished to do so, subject to the following conditions:
 ~
 ~ The above copyright notice and this permission notice shall be included in all
 ~ copies or substantial portions of the Software.
 ~
 ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 ~ SOFTWARE.
 ~
 ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.snf4j</groupId>
    <artifactId>snf4j-project</artifactId>
    <version>1.11.0-SNAPSHOT</version>
  </parent>

  <artifactId>snf4j-core</artifactId>
  <packaging>jar</packaging>
  <name>SNF4J/Core</name>
  <description>The SNF4J Core</description>
  <url>http://snf4j.org</url>

  <build>
    <plugins>

     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jar-plugin</artifactId>
       <version>${version.jar.plugin}</version>
       <executions>
         <execution>
           <goals>
             <goal>test-jar</goal>
           </goals>
         </execution>
       </executions>
     </plugin>

     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.surefire.plugin}</version>
        <configuration>
          <systemProperties>
            <property>
              <name>org.snf4j.LoggerFactory</name>
              <value>org.snf4j.core.logger.TestingLoggerFactory</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${version.antrun.plugin}</version>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <tasks>
            <delete dir="${project.build.outputDirectory}/org/snf4j/core/logger/impl" />
          </tasks>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>


text:
{
'!=': '!=',
'!langcode!': 'pt-br',
'!langname!': 'Português (do Brasil)',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novovalor\'". Você não pode atualizar ou apagar os resultados de um JOIN',
'%(nrows)s records found': '%(nrows)s records found',
'%s %%{row} deleted': '%s linhas apagadas',
'%s %%{row} updated': '%s linhas atualizadas',
'%s selected': '%s selecionado',
'%Y-%m-%d': '%d-%m-%Y',
'%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%S',
'+ And': '+ And',
'+ Or': '+ Or',
'<': '<',
'<=': '<=',
'=': '=',
'>': '>',
'>=': '>=',
'@markmin\x01An error occured, please [[reload %s]] the page': 'Ocorreu um erro, por favor [[reload %s]] a página',
'About': 'Sobre',
'Access Control': 'Controle de Acesso',
'Add Record': 'Add Record',
'Add record to database': 'Add record to database',
'Add this to the search as an AND term': 'Add this to the search as an AND term',
'Add this to the search as an OR term': 'Add this to the search as an OR term',
'Add to cart': 'Add to cart',
'Address': 'Address',
'Admin Panel': 'Admin Panel',
'Administrative Interface': 'Interface Administrativa',
'Administrative interface': 'Interface administrativa',
'Adminstration': 'Adminstration',
'Ajax Recipes': 'Receitas de Ajax',
'appadmin is disabled because insecure channel': 'Administração desativada porque o canal não é seguro',
'Are you sure you want to delete this object?': 'Você está certo que deseja apagar este objeto?',
'Availability': 'Availability',
'Available Databases and Tables': 'Bancos de dados e tabelas disponíveis',
'Back': 'Back',
'Birth Date': 'Birth Date',
'Business Name': 'Business Name',
'Buy this book': 'Compre o livro',
'cache': 'cache',
'Cache': 'Cache',
'Cache Keys': 'Chaves de cache',
'Cannot be empty': 'Não pode ser vazio',
'Carrier ID': 'Carrier ID',
'Carriers': 'Carriers',
'Carriers Tax': 'Carriers Tax',
'Catalog': 'Catalog',
'Categories': 'Categories',
'CFOP Code': 'CFOP Code',
'change password': 'modificar senha',
'Check to delete': 'Marque para apagar',
'Clear': 'Clear',
'Clear CACHE?': 'Limpar CACHE?',
'Clear DISK': 'Limpar DISCO',
'Clear RAM': 'Limpar memória RAM',
'Client IP': 'IP do cliente',
'Close': 'Close',
'Code': 'Code',
'Comma-separated export including columns not shown; fields from other tables are exported as raw values for faster export': 'Comma-separated export including columns not shown; fields from other tables are exported as raw values for faster export',
'Comma-separated export of visible columns. Fields from other tables are exported as they appear on-screen but this may be slow for many rows': 'Comma-separated export of visible columns. Fields from other tables are exported as they appear on-screen but this may be slow for many rows',
'Community': 'Comunidade',
'Components and Plugins': 'Componentes e Plugins',
'Confirm Password': 'Confirm Password',
'contains': 'contains',
'Controller': 'Controlador',
'Copyright': 'Copyright',
'Cost': 'Cost',
'Costumer Groups': 'Costumer Groups',
'Costumers': 'Costumers',
'CSV': 'CSV',
'CSV (hidden cols)': 'CSV (hidden cols)',
'Current request': 'Requisição atual',
'Current response': 'Resposta atual',
'Current session': 'Sessão atual',
'customize me!': 'Personalize-me!',
'Dashboard': 'Dashboard',
'data uploaded': 'dados enviados',
'Database': 'banco de dados',
'Database %s select': 'Selecionar banco de dados %s',
'db': 'bd',
'DB Model': 'Modelo BD',
'Default Category': 'Default Category',
'Default Supplier': 'Default Supplier',
'Delete': 'Delete',
'delete': 'delete',
'Delete:': 'Apagar:',
'Demo': 'Demo',
'Deployment Recipes': 'Receitas de deploy',
'Description': 'Descrição',
'design': 'projeto',
'Details': 'Details',
'DISK': 'DISK',
'Disk Cache Keys': 'Chaves do Cache de Disco',
'Disk Cleared': 'Disco Limpo',
'Documentation': 'Documentação',
"Don't know what to do?": 'Não sabe o que fazer?',
'done!': 'concluído!',
'Download': 'Download',
'E-mail': 'E-mail',
'Edit': 'Editar',
'Edit current record': 'Editar o registro atual',
'edit profile': 'editar perfil',
'Edit This App': 'Editar esta aplicação',
'Email': 'Email',
'Email and SMS': 'Email e SMS',
'Enter a number between %(min)g and %(max)g': 'Enter a number between %(min)g and %(max)g',
'Enter a value': 'Enter a value',
'Enter an integer between %(min)g and %(max)g': 'Informe um valor inteiro entre %(min)g e %(max)g',
'Enter date as %(format)s': 'Enter date as %(format)s',
'Errors': 'Erros',
'export as csv file': 'exportar como um arquivo csv',
'Export:': 'Export:',
'FAQ': 'Perguntas frequentes',
'Featured Image': 'Featured Image',
'Federal Id': 'Federal Id',
'Female': 'Female',
'file': 'file',
'file ## download': 'file ',
'First name': 'Nome',
'Forms and Validators': 'Formulários e Validadores',
'Free Applications': 'Aplicações gratuitas',
'Genre': 'Genre',
'Group ID': 'ID do Grupo',
'Groups': 'Grupos',
'Hello World': 'Olá Mundo',
'Home': 'Principal',
'How did you get here?': 'Como você chegou aqui?',
'HTML': 'HTML',
'HTML export of visible columns': 'HTML export of visible columns',
'Id': 'Id',
'ID do Grupo': 'ID do Grupo',
'ID do Usuário': 'ID do Usuário',
'import': 'importar',
'Import/Export': 'Importar/Exportar',
'in': 'in',
'In Stock': 'In Stock',
'Index': 'Início',
'insert new': 'inserir novo',
'insert new %s': 'inserir novo %s',
'Internal State': 'Estado Interno',
'Introduction': 'Introdução',
'Invalid email': 'Email inválido',
'Invalid login': 'Invalid login',
'Invalid Query': 'Consulta Inválida',
'invalid request': 'requisição inválida',
'Invalid username': 'Invalid username',
'Invoices': 'Invoices',
'JSON': 'JSON',
'JSON export of visible columns': 'JSON export of visible columns',
'Key': 'Chave',
'Kg': 'Kg',
'kg': 'kg',
'Last name': 'Sobrenome',
'Latest Products': 'Latest Products',
'Layout': 'Layout',
'Layout Plugins': 'Plugins de Layout',
'Layouts': 'Layouts',
'Live chat': 'Chat ao vivo',
'Live Chat': 'Chat ao vivo',
'Log In': 'Log In',
'Logged in': 'Logged in',
'Logged out': 'Logged out',
'login': 'Entrar',
'Login': 'Autentique-se',
'logout': 'Sair',
'Logout': 'Logout',
'Lost Password': 'Esqueceu sua senha?',
'lost password?': 'esqueceu sua senha?',
'Main Menu': 'Menu Principal',
'Male': 'Male',
'Manage Cache': 'Gerenciar Cache',
'Menu Model': 'Modelo de Menu',
'Merchandise Returns': 'Merchandise Returns',
'My Sites': 'Meus sites',
'Name': 'Nome',
'NCM Code': 'NCM Code',
'New Record': 'Novo Registro',
'new record inserted': 'novo registro inserido',
'New Search': 'New Search',
'next 100 rows': 'próximas 100 linhas',
'No databases in this application': 'Não há bancos de dados nesta aplicação',
'No records found': 'No records found',
'Nome': 'Nome',
'not in': 'not in',
'Não pode ser vazio': 'Não pode ser vazio',
'Object or table name': 'Nome do objeto do da tabela',
'Online examples': 'Exemplos online',
'or import from csv file': 'ou importar de um arquivo csv',
'Order Messages': 'Order Messages',
'Orders': 'Orders',
'Origin': 'Origem',
'Other': 'Other',
'Other Plugins': 'Outros Plugins',
'Other Recipes': 'Outras Receitas',
'Overview': 'Visão Geral',
'Parent Category': 'Parent Category',
'Password': 'Senha',
"Password fields don't match": "Password fields don't match",
'Peça': 'Peça',
'Phone': 'Phone',
'Piece': 'Piece',
'Plugins': 'Plugins',
'Powered by': 'Desenvolvido com',
'Preface': 'Prefácio',
'Preferences': 'Preferences',
'previous 100 rows': '100 linhas anteriores',
'Price': 'Price',
'Product Categories': 'Product Categories',
'Products': 'Products',
'Products Categories': 'Products Categories',
'Products in the category': 'Products in the category',
'Profit Percentage': 'Profit Percentage',
'Python': 'Python',
'Quantity': 'Quantity',
'Query:': 'Consulta:',
'Quick Examples': 'Exemplos rápidos',
'R$': 'R$',
'RAM': 'RAM',
'RAM Cache Keys': 'RAM Cache Keys',
'Ram Cleared': 'Ram Cleared',
'Recipes': 'Receitas',
'Record': 'Registro',
'record does not exist': 'registro não existe',
'Record ID': 'ID do Registro',
'Record id': 'id do registro',
'REF.': 'REF.',
'REF.:': 'REF.:',
'Register': 'Registre-se',
'register': 'Registre-se',
'Registration identifier': 'Idenficador de registro',
'Registration key': 'Chave de registro',
'Remember me (for 30 days)': 'Remember me (for 30 days)',
'Reset Password key': 'Resetar chave de senha',
'Resources': 'Recursos',
'Reviews': 'Reviews',
'Role': 'Papel',
'Rows in Table': 'Linhas na tabela',
'Rows selected': 'Linhas selecionadas',
'Search': 'Search',
'Select one': 'Select one',
'Semantic': 'Semântico',
'Services': 'Serviço',
'Shipping': 'Shipping',
'Shipping Carriers': 'Shipping Carriers',
'Shopping Cart': 'Shopping Cart',
'Shopping Carts': 'Shopping Carts',
'Short description': 'Short description',
'Sign Up': 'Sign Up',
'Size of cache:': 'Tamanho do cache:',
'Sobrenome': 'Sobrenome',
'Spreadsheet-optimised export of tab-separated content including hidden columns. May be slow': 'Spreadsheet-optimised export of tab-separated content including hidden columns. May be slow',
'Spreadsheet-optimised export of tab-separated content, visible columns only. May be slow.': 'Spreadsheet-optimised export of tab-separated content, visible columns only. May be slow.',
'Start building a new search': 'Start building a new search',
'starts with': 'starts with',
'state': 'estado',
'State Id': 'State Id',
'Statistics': 'Estatísticas',
'Statuses': 'Statuses',
'Stock': 'Stock',
'Store Info': 'Store Info',
'Store Users': 'Store Users',
'Stylesheet': 'Folha de estilo',
'submit': 'enviar',
'Submit': 'Submit',
'Supplier Info': 'Supplier Info',
'Suppliers': 'Suppliers',
'Support': 'Suporte',
'Sure you want to delete this object?': 'Está certo(a) que deseja apagar este objeto?',
'Table': 'Tabela',
'Table name': 'Nome da tabela',
'Tax': 'Tax',
'Tax Id': 'Tax Id',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'Uma "consulta" é uma condição como "db.tabela1.campo1==\'valor\'". Expressões como "db.tabela1.campo1==db.tabela2.campo2" resultam em um JOIN SQL.',
'The Core': 'The Core',
'The output of the file is a dictionary that was rendered by the view %s': 'A saída do arquivo é um dicionário que foi apresentado pela visão %s',
'The Views': 'As views',
'This App': 'Esta aplicação',
'This email already has an account': 'Este email já tem uma conta',
'This is a copy of the scaffolding application': 'Isto é uma cópia da aplicação modelo',
'Time in Cache (h:m:s)': 'Tempo em Cache (h:m:s)',
'Timestamp': 'Timestamp',
'Too short': 'Too short',
'Traceback': 'Traceback',
'TSV (Spreadsheets)': 'TSV (Spreadsheets)',
'TSV (Spreadsheets, hidden cols)': 'TSV (Spreadsheets, hidden cols)',
'Twitter': 'Twitter',
'Type': 'Type',
'unable to parse csv file': 'não foi possível analisar arquivo csv',
'Unidade': 'Unidade',
'Unit': 'Unit',
'Update:': 'Atualizar:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...)  for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, e ~(...)  para NOT para construir consultas mais complexas.',
'Use the left navigation to manage your store': 'Use the left navigation to manage your store',
'User Groups': 'User Groups',
'User ID': 'ID do Usuário',
'User SSC (social security card)': 'User SSC (social security card)',
'User Voice': 'Opinião dos usuários',
'Username': 'Username',
'Username already taken': 'Username already taken',
'Value not allowed': 'Value not allowed',
'Value not in database': 'Value not in database',
'Videos': 'Vídeos',
'View': 'Visualização',
'View More': 'View More',
'View the site': 'View the site',
'Web2py': 'Web2py',
'Welcome': 'Bem-vindo',
'Welcome %s': 'Bem-vindo %s',
'Welcome to web2py': 'Bem-vindo ao web2py',
'Welcome to web2py!': 'Bem-vindo ao web2py!',
'Which called the function %s located in the file %s': 'Que chamou a função %s localizada no arquivo %s',
'Working...': 'Trabalhando...',
'XML': 'XML',
'XML export of columns shown': 'XML export of columns shown',
'You are successfully running web2py': 'Você está executando o web2py com sucesso',
'You are successfully running web2py.': 'Você está executando o web2py com sucesso.',
'You can modify this application and adapt it to your needs': 'Você pode modificar esta aplicação e adaptá-la às suas necessidades',
'You visited the url %s': 'Você acessou a url %s',
}


text:
<?php
require_once 'unit/SyndNodeTestCase.class.inc';

class _model_DatabaseStorage extends SyndNodeTestCase {
	var $_errors = 0;

	function testInstance() {
		global $synd_maindb;
		$sql = "
			INSERT INTO synd_unit_test (node_id)
			VALUES ('unit_test.1')";
		$synd_maindb->query($sql);

		$sql = "
			INSERT INTO synd_unit_test2 (node_id, info_head)
			VALUES ('unit_test.1', 'Test')";
		$synd_maindb->query($sql);

		$storage = $this->getDatabaseStorage();
		$node = $storage->getInstance('unit_test.1');

		$this->assertEquals('unit_test.1', $node->data['NODE_ID']);
		$this->assertEquals('Test', $node->data['INFO_HEAD']);

		$nodes = $storage->getInstances(array('unit_test.1'));
		$this->assertEquals(1, count($nodes));

		if (!empty($nodes)) {
			$node = $nodes[key($nodes)];
			$this->assertEquals('unit_test.1', $node->data['NODE_ID']);
			$this->assertEquals('Test', $node->data['INFO_HEAD']);
		}

		// Test write to storage
		$node->data['INFO_HEAD'] = 'Test2';
		$node->save();
		$storage->flush();

		$node = $storage->getInstance('unit_test.1');
		$this->assertEquals('Test2', $node->data['INFO_HEAD']);

		$sql = "
			SELECT t2.info_head FROM synd_unit_test2 t2
			WHERE t2.node_id = 'unit_test.1'";
		$this->assertEquals('Test2', $synd_maindb->getOne($sql));

		// Test delete from storage
		$node->delete();
		$storage->flush();

		$node = $storage->getInstance('unit_test.1');
		$this->assertNull($node);

		$sql = "
			SELECT t2.info_head FROM synd_unit_test2 t2
			WHERE t2.node_id = 'unit_test.1'";
		$this->assertNull($synd_maindb->getOne($sql));
	}

	function testFactory() {
		global $synd_maindb;
		$storage = $this->getDatabaseStorage();
		$node = $storage->factory('unit_test');

		$this->assertTrue($node->isNew());
		$this->assertEquals('Test', $node->data['INFO_HEAD']);

		$node->save();
		$storage->flush();

		$this->assertFalse($node->isNew());
		$sql = "
			SELECT t.node_id FROM synd_unit_test t
			WHERE t.node_id = ".$synd_maindb->quote($node->nodeId);

		$this->assertNotNull($node->nodeId);
		$this->assertEquals($node->nodeId, $synd_maindb->getOne($sql));

		$node2 = $storage->getInstance($node->nodeId);
		$this->assertNotNull($node2);
		$this->assertEquals($node->nodeId, $node2->nodeId);
	}

	function testAutoIncrement() {
		$node = SyndNodeLib::factory('unit_test');
		$this->assertNull($node->data['SEQUENCE_ID']);

		$node->save();
		$node->flush();

		$this->assertNotNull($node->data['SEQUENCE_ID']);
	}

	function testBatchSize() {
		$storage = $this->getDatabaseStorage();
		$node = $storage->factory('unit_test');
		$node->save();
		$node->flush();

		$ids = array($node->nodeId);
		for ($i=0, $oid=$node->objectId(); $i<1500; $i++)
			$storage->preload('unit_test.'.($oid+$i));

		$node2 = $storage->getInstance($node->nodeId);
		$this->assertEquals($node->nodeId, $node2->nodeId);

	}

	function testReferences() {
		$storage = $this->getDatabaseStorage();
		$node = $storage->factory('unit_test');
		$node->data['INFO_HEAD'] = 'Test';

		$node->save();
		$node->flush();

		$data = $node->data;
		$head = $node->data['INFO_HEAD'];

		$data['INFO_HEAD'] = 'Test2';
		$this->assertEquals($head, $node->data['INFO_HEAD']);
	}

	function testDatabaseCollection() {
		$storage = $this->getDatabaseStorage();
		$node1 = $storage->factory('unit_test');
		$node2 = clone $node1;

		$node1->save();
		$node2->save();
		$storage->flush();

		$query = synd_node_unit_test::getEntityQuery($storage);
		$query->addIdentifier($node1->nodeId);
		$query->addIdentifier($node2->nodeId);
		$query->order($query->getPrimaryKey());

		$collection = new DatabaseEntityCollection($storage, $query);
		$expected = array($node1->nodeId, $node2->nodeId);

		$actual = count($collection);
		$this->assertEquals(count($expected), $actual);

		$actual = array_values(SyndLib::collect(iterator_to_array($collection->getIterator()), 'nodeId'));
		$this->assertEquals($expected, $actual);

		// Test limit iterator
		$iter = $collection->getIterator(1, 250);
		$expected = array($node2->nodeId);
		$actual = array_values(SyndLib::collect(iterator_to_array($iter), 'nodeId'));
		$this->assertEquals($expected, $actual);

		$node1->delete();
		$node2->delete();
	}
}


text:
package org.apache.kerberos.kerb.server.preauth;

import org.apache.kerberos.kerb.preauth.PaFlags;
import org.apache.kerberos.kerb.preauth.PluginRequestContext;
import org.apache.kerberos.kerb.preauth.PreauthPluginMeta;
import org.apache.kerberos.kerb.server.KdcContext;
import org.apache.kerberos.kerb.server.request.KdcRequest;
import org.apache.kerberos.kerb.KrbException;
import org.apache.kerberos.kerb.spec.pa.PaData;
import org.apache.kerberos.kerb.spec.pa.PaDataEntry;
import org.apache.kerberos.kerb.spec.pa.PaDataType;

/**
 * KDC side preauth plugin module
 */
public interface KdcPreauth extends PreauthPluginMeta {

    /**
     * Initializing plugin context for each realm
     */
    public void initWith(KdcContext context);

    /**
     * Initializing request context
     */
    public PluginRequestContext initRequestContext(KdcRequest kdcRequest);

    /**
     * Optional: provide pa_data to send to the client as part of the "you need to
     * use preauthentication" error.
     */
    public void provideEdata(KdcRequest kdcRequest, PluginRequestContext requestContext,
                             PaData outPaData) throws KrbException;

    /**
     * Optional: verify preauthentication data sent by the client, setting the
     * TKT_FLG_PRE_AUTH or TKT_FLG_HW_AUTH flag in the enc_tkt_reply's "flags"
     * field as appropriate.
     */
    public boolean verify(KdcRequest kdcRequest, PluginRequestContext requestContext,
                          PaDataEntry paData) throws KrbException;

    /**
     * Optional: generate preauthentication response data to send to the client as
     * part of the AS-REP.
     */
    public void providePaData(KdcRequest kdcRequest, PluginRequestContext requestContext,
                              PaData paData);

    /**
     * Return PA_REAL if pa_type is a real preauthentication type or PA_INFO if it is
     * an informational type.
     */
    public PaFlags getFlags(KdcRequest kdcRequest, PluginRequestContext requestContext,
                            PaDataType paType);

    /**
     * When exiting...
     */
    public void destroy();

}


text:
<?php
class Kwf_Assets_Loader
{
    static public function load($url)
    {
        if (strpos($url, '?') !== false) {
            $url = substr($url, 0, strpos($url, '?'));
        }
        Kwf_Assets_Dispatcher::dispatch($url);
        try {
            $l = new self();
            $out = $l->getFileContents(substr($url, 8));
            Kwf_Media_Output::output($out);
        } catch (Kwf_Assets_NotFoundException $e) {
            throw new Kwf_Exception_NotFound();
        }
    }

    public function getFileContents($file, $language = null)
    {
        $ret = array();
        if (substr($file, -4)=='.gif') {
            $ret['mimeType'] = 'image/gif';
        } else if (substr($file, -4)=='.png') {
            $ret['mimeType'] = 'image/png';
        } else if (substr($file, -4)=='.jpg') {
            $ret['mimeType'] = 'image/jpeg';
        } else if (substr($file, -4)=='.mp4') {
            $ret['mimeType'] = 'video/mp4';
        } else if (substr($file, -5)=='.webm') {
            $ret['mimeType'] = 'video/webm';
        } else if (substr($file, -4)=='.css' || substr($file, -5)=='.scss') {
            $ret['mimeType'] = 'text/css; charset=utf-8';
            if (!Kwf_Assets_Dispatcher::allowSourceAccess()) throw new Kwf_Exception_AccessDenied();
        } else if (substr($file, -9)=='.printcss') {
            $ret['mimeType'] = 'text/css; charset=utf-8';
            if (!Kwf_Assets_Dispatcher::allowSourceAccess()) throw new Kwf_Exception_AccessDenied();
        } else if (substr($file, -3)=='.js') {
            $ret['mimeType'] = 'text/javascript; charset=utf-8';
            if (!Kwf_Assets_Dispatcher::allowSourceAccess()) throw new Kwf_Exception_AccessDenied();
        } else if (substr($file, -4)=='.swf') {
            $ret['mimeType'] = 'application/flash';
        } else if (substr($file, -4)=='.ico') {
            $ret['mimeType'] = 'image/x-icon';
        } else if (substr($file, -5)=='.html') {
            $ret['mimeType'] = 'text/html; charset=utf-8';
        } else if (substr($file, -4)=='.otf') { // für Schriften
            $ret['mimeType'] = 'application/octet-stream';
        } else if (substr($file, -4)=='.eot') { // für Schriften
            $ret['mimeType'] = 'application/vnd.ms-fontobject';
        } else if (substr($file, -4)=='.svg') { // für Schriften
            $ret['mimeType'] = 'image/svg+xml';
        } else if (substr($file, -4)=='.ttf') { // für Schriften
            $ret['mimeType'] = 'application/octet-stream';
        } else if (substr($file, -5)=='.woff') { // für Schriften
            $ret['mimeType'] = 'application/font-woff';
        } else if (substr($file, -4)=='.htc') { // für ie css3
            $ret['mimeType'] = 'text/x-component';
        } else if (substr($file, -4)=='.pdf') {
            $ret['mimeType'] = 'application/pdf';
        } else {
            throw new Kwf_Assets_NotFoundException("Invalid filetype ($file)");
        }

        if (substr($ret['mimeType'], 0, 5) == 'text/') {
            $ret['mtime'] = time();
            $file = new Kwf_Assets_Dependency_File($file);
            if (!$file->getAbsoluteFileName() || !file_exists($file->getAbsoluteFileName())) throw new Kwf_Exception_NotFound();
            $ret['contents'] = $file->getContents(null);
        } else {
            $fx = substr($file, 0, strpos($file, '/'));
            if (substr($fx, 0, 3) == 'fx_') {
                $cache = Kwf_Assets_Cache::getInstance();
                $cacheId = 'fileContents'.str_replace(array('/', '.', '-', ':'), array('_', '_', '_', '_'), $file);
                if (!$cacheData = $cache->load($cacheId)) {
                    if (substr($ret['mimeType'], 0, 6) != 'image/') {
                        throw new Kwf_Exception("Fx is only possible for images");
                    }
                    $im = new Imagick();
                    if (substr($file, -4)=='.ico') $im->setFormat('ico'); //required because imagick can't autodetect ico format
                    $file = new Kwf_Assets_Dependency_File(substr($file, strpos($file, '/')+1));
                    $im->readImage($file->getAbsoluteFileName());
                    $fx = explode('_', substr($fx, 3));
                    foreach ($fx as $i) {
                        $params = array();
                        if (($pos = strpos($i, '-')) !== false) {
                            $params = explode('-', substr($i, $pos + 1));
                            $i = substr($i, 0, $pos);
                        }
                        call_user_func(array('Kwf_Assets_Effects', $i), $im, $params);
                    }
                    $cacheData['mtime'] = $file->getMTime();
                    $cacheData['contents'] = $im->getImagesBlob();;
                    $im->destroy();
                    $cache->save($cacheData, $cacheId);
                }
                $ret['contents'] = $cacheData['contents'];
                $ret['mtime'] = time();
            } else {
                $ret['mtime'] = time();
                $file = new Kwf_Assets_Dependency_File($file);
                if (!file_exists($file->getAbsoluteFileName())) {
                    throw new Kwf_Exception_NotFound();
                }
                $ret['contents'] = $file->getContents(null);
            }
        }

        return $ret;
    }
}


text:
package com.crassirostris.cache;

import com.crassirostris.cache.controller.AbstractCacheController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * User: crassirostris
 * Date: 2015-09-09
 * Time: 오후 1:06
 */
@Configuration
@EnableScheduling
@Slf4j
public class ScheduleConfiguration {
	@Qualifier("cacheManager")
	@Autowired
	private CacheManager cacheManager;
	@Scheduled(fixedRate = AbstractCacheController.CACHE_REFRESH_DURATION)
	public void expireSimpleCache() {
		Cache simpleCache = cacheManager.getCache("simpleCache");
		log.info("simple Cache clear");
		simpleCache.clear();
	}
}


text:
#pragma once

extern void GetKey(LPCWSTR pBase, LPCWSTR pGroup, LPCWSTR pApp, LPCWSTR pFolder, LPWSTR pRet);
extern bool GetRegistryInt(LPCWSTR pFolder, LPCWSTR pEntry, int* pDefault, int& ret);
extern bool WriteRegistryInt (LPCWSTR pFolder, LPCWSTR pEntry, int val);


text:
package com.vector.model;

import java.util.ArrayList;

import com.google.gson.annotations.SerializedName;

public class ContactsData {

	public static ContactsData contacts = null;

	public static ContactsData getInstance() {
		if (contacts == null) {
			contacts = new ContactsData();
		}
		return contacts;
	}

	public void setList(ContactsData obj) {
		contacts = obj;
	}

		@SerializedName("contacts")
		public ArrayList<Contacts> contactsList = new ArrayList<Contacts>();

		public class Contacts {
			@SerializedName("contact_id")
			public String id;
			@SerializedName("first_name")
			public String firstName;
			@SerializedName("last_name")
			public String lastName;
			@SerializedName("profile_image")
			public String profileImage;

	}
}


text:
FROM damsl/k3-base:latest

### Build K3
WORKDIR /k3/K3
RUN git pull && git checkout development

RUN cabal sandbox init && \
    cabal install --only-dependencies --disable-documentation -j

RUN cabal configure --ghc-options="-DDEBUG" && \
    cabal build -j

### Build K3-Mosaic
WORKDIR /k3/K3-Mosaic
RUN ./build_opt.sh && \
    ./build_utils.sh


text:
const express = require('express');
const app = express();
const exphbs = require('express-handlebars');
const cookieParser = require('cookie-parser');
const session = require('express-session');
const MongoDBStore = require('connect-mongodb-session')(session);
const flash = require('connect-flash');
const fs = require('fs');
const bodyParser = require('body-parser');
const handyUtils = require('handyutils');
// Dot Env File Loader
if (!process.env.PORT) {
  require('dotenv').load();
}
// session storage with mongodb
const sessionStore = new MongoDBStore({
  uri: process.env.MONGODB_URI,
  collection: 'userSessions',
});
// Configuration for express
app.engine('handlebars', exphbs({ defaultLayout: 'main' }));
app.set('view engine', 'handlebars');
app.use(express.static(__dirname + '/public'));
// App config
app.use(bodyParser.urlencoded({ extended: true }));
app.use(session({ secret: 'gn',
resave: false, saveUninitialized: false,
maxAge: 9000000, cookie: { secure: false }, store: sessionStore }));
app.use(flash());
app.use(cookieParser('gn'));
// =-=-=-=-=-=-=-=-=-= Keys =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Public key
const publicKey = fs.readFileSync('./keys/public.pub');
// Private Key
const privateKey = fs.readFileSync('./keys/private.pem');
//hold global reference to root folder
// app.locals.root_dir = __dirname;
// =-=-=-=-=-=-=-=-=-= Config vars =-=-=-=-=-=-=-=-=-=-=-=
const port = process.env.PORT || 8080;

// =-=-=-=-=-=-=-=-=-= Routes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
require('./routes/routes')(app, publicKey, privateKey);
// Start up the Server
const server = app.listen(port, () => {
  if (process.env.DEBUG) handyUtils.debug('Server Active On', port);
});
module.exports = server;


text:
if(global.production) return;

const browserSync         = require('browser-sync');
const gulp                = require('gulp');
const webpack             = require('webpack');
const webpackMultiConfig  = require('../lib/webpack-multi-config');
const pathToUrl           = require('../lib/pathToUrl');
const path                = require('path');

const resolvePath = function(glob) {
  return path.resolve(process.env.PWD, glob);
};

const browserSyncTask = function() {

  const webpackConfig = webpackMultiConfig('development');
  const compiler      = webpack(webpackConfig);
  const proxyConfig   = TASK_CONFIG.browserSync.proxy || null;

  if (typeof proxyConfig === 'string') {
    TASK_CONFIG.browserSync.proxy = {
      target : proxyConfig
    };
  }

  // Resolve path from PWD
  if(TASK_CONFIG.browserSync.server && TASK_CONFIG.browserSync.server.baseDir) {

    TASK_CONFIG.browserSync.server.baseDir = Array.isArray( TASK_CONFIG.browserSync.server.baseDir )
                                            ? TASK_CONFIG.browserSync.server.baseDir.map( resolvePath )
                                            : resolvePath( TASK_CONFIG.browserSync.server.baseDir );
  }

  // Resolve files from PWD
  if(TASK_CONFIG.browserSync.files) {
    TASK_CONFIG.browserSync.files = TASK_CONFIG.browserSync.files.map( resolvePath );
  }

  const server = TASK_CONFIG.browserSync.proxy || TASK_CONFIG.browserSync.server;

  server.middleware = [
    require('webpack-dev-middleware')(compiler, {
      stats: 'errors-only',
      watchOptions: TASK_CONFIG.browserSync.watchOptions || {},
      publicPath: pathToUrl('/', webpackConfig.output.publicPath)
    }),
    require('webpack-hot-middleware')(compiler)
  ];

  browserSync.init(TASK_CONFIG.browserSync);
};

gulp.task('browserSync', browserSyncTask);
module.exports = browserSyncTask;


text:
RUNTIME_LIST = []

def lambda_handler(event, context):
    import sys
    import json
    import os
    import datetime

    # global RUNTIME_LIST

    # system_infos = {}

    # print("makefile test version2")

    # print(sys.version)

    # iuid = os.getuid()

    # print("Event Data")
    # system_infos["event_data"] = event
    # # for e in event:
    # #     print(e)

    # print("UID: {}".format(iuid))

    # system_infos["environ"] = []
    # print("Environment variables")
    # for ev in os.environ:
    #     print("Name: '{evn}', Value: '{evv}'".format(evn=ev, evv=os.environ[ev]))
    #     system_infos["environ"].append("Name: '{evn}', Value: '{evv}'".format(evn=ev, evv=os.environ[ev]))

    # # system_infos["files"] = []
    # # items = get_files_recursiv("/")
    # # for i in items:
    # #     system_infos["files"].append(i)

    # system_infos["pwd"] = []
    # with open("/etc/passwd", "r") as passwd_file:
    #     for l in passwd_file.readlines():
    #         system_infos["pwd"].append(l)

    # runtime_string = "UID: '{uid}'; Datetime: '{dt}'".format(uid=iuid, dt=str(datetime.datetime.now()))

    # RUNTIME_LIST.append(runtime_string)

    # for i in RUNTIME_LIST:
    #     print(i)

    #with open("/etc")

    #return json.dumps(system_infos, indent=4, separators=(',', ': '))

    import urllib.request
    urllib.request.urlretrieve("https://raw.githubusercontent.com/Miserlou/Mackenzie/master/README.md", "/tmp/test.txt")

    import glob
    items = glob.glob("/tmp/*")

    for i in items:
        print(i)

    with open("/tmp/test.txt", "r") as f:
        for c in f.readlines():
            print(c)

    return "hey"

def get_files_recursiv(folder_path):
    import glob
    import os

    files = []

    absolute_path = os.path.abspath(folder_path)

    if not absolute_path.endswith("/"):
        absolute_path = absolute_path + "/"

    items = glob.glob("{}*".format(absolute_path))

    for item in items:
        if item.startswith(("/usr", "/var", "/proc", "/dev")):
            continue

        if os.path.isdir(item):
            f = get_files_recursiv(item)
            files.append(f)
        else:
            files.append(item)

    return files


text:
package endpointslice

import (
	"context"

	apiequality "k8s.io/apimachinery/pkg/api/equality"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/validation/field"
	"k8s.io/apiserver/pkg/storage/names"
	"k8s.io/kubernetes/pkg/api/legacyscheme"
	"k8s.io/kubernetes/pkg/apis/discovery"
	"k8s.io/kubernetes/pkg/apis/discovery/validation"
)

// endpointSliceStrategy implements verification logic for Replication.
type endpointSliceStrategy struct {
	runtime.ObjectTyper
	names.NameGenerator
}

// Strategy is the default logic that applies when creating and updating Replication EndpointSlice objects.
var Strategy = endpointSliceStrategy{legacyscheme.Scheme, names.SimpleNameGenerator}

// NamespaceScoped returns true because all EndpointSlices need to be within a namespace.
func (endpointSliceStrategy) NamespaceScoped() bool {
	return true
}

// PrepareForCreate clears the status of an EndpointSlice before creation.
func (endpointSliceStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
	endpointSlice := obj.(*discovery.EndpointSlice)
	endpointSlice.Generation = 1
}

// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
func (endpointSliceStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
	newEPS := obj.(*discovery.EndpointSlice)
	oldEPS := old.(*discovery.EndpointSlice)

	// Increment generation if anything other than meta changed
	// This needs to be changed if a status attribute is added to EndpointSlice
	ogNewMeta := newEPS.ObjectMeta
	ogOldMeta := oldEPS.ObjectMeta
	newEPS.ObjectMeta = v1.ObjectMeta{}
	oldEPS.ObjectMeta = v1.ObjectMeta{}

	if !apiequality.Semantic.DeepEqual(newEPS, oldEPS) {
		ogNewMeta.Generation = ogOldMeta.Generation + 1
	}

	newEPS.ObjectMeta = ogNewMeta
	oldEPS.ObjectMeta = ogOldMeta
}

// Validate validates a new EndpointSlice.
func (endpointSliceStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	endpointSlice := obj.(*discovery.EndpointSlice)
	err := validation.ValidateEndpointSlice(endpointSlice)
	return err
}

// Canonicalize normalizes the object after validation.
func (endpointSliceStrategy) Canonicalize(obj runtime.Object) {
}

// AllowCreateOnUpdate is false for EndpointSlice; this means POST is needed to create one.
func (endpointSliceStrategy) AllowCreateOnUpdate() bool {
	return false
}

// ValidateUpdate is the default update validation for an end user.
func (endpointSliceStrategy) ValidateUpdate(ctx context.Context, new, old runtime.Object) field.ErrorList {
	newEPS := new.(*discovery.EndpointSlice)
	oldEPS := old.(*discovery.EndpointSlice)
	return validation.ValidateEndpointSliceUpdate(newEPS, oldEPS)
}

// AllowUnconditionalUpdate is the default update policy for EndpointSlice objects.
func (endpointSliceStrategy) AllowUnconditionalUpdate() bool {
	return true
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<schema
		xmlns="http://www.concrete5.org/doctrine-xml/0.5"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://www.concrete5.org/doctrine-xml/0.5 http://concrete5.github.io/doctrine-xml/doctrine-xml-0.5.xsd">
	<table name="btCommunityStoreProduct">
		<field name="bID" type="integer"  size="10">
			<unsigned />
			<key />
		</field>
		<field name="productLocation" type="string" size="10"></field>
		<field name="pID" type="integer"></field>
		<field name="showProductName" type="boolean"></field>
		<field name="showProductSKU" type="boolean"><unsigned/></field>
		<field name="showManufacturer" type="boolean"></field>
		<field name="showManufacturerDescription" type="boolean"></field>
		<field name="showProductDescription" type="boolean"></field>
		<field name="showProductDetails" type="boolean"></field>
		<field name="showProductPrice" type="boolean"></field>
		<field name="showWeight" type="boolean"></field>
		<field name="showImage" type="boolean"></field>
		<field name="showCartButton" type="boolean"></field>
		<field name="showIsFeatured" type="boolean"></field>
		<field name="showGroups" type="boolean"></field>
		<field name="showDimensions" type="boolean"></field>
		<field name="showQuantity" type="boolean"><unsigned/></field>
		<field name="btnText" type="string" size="255"></field>
	</table>
</schema>


text:
package terraform

import (
	"fmt"
	"strings"

	"github.com/hashicorp/terraform/config"
	"github.com/hashicorp/terraform/dag"
)

// ResourceCountTransformer is a GraphTransformer that expands the count
// out for a specific resource.
type ResourceCountTransformer struct {
	Resource *config.Resource
	Destroy  bool
	Targets  []ResourceAddress
}

func (t *ResourceCountTransformer) Transform(g *Graph) error {
	// Expand the resource count
	count, err := t.Resource.Count()
	if err != nil {
		return err
	}

	// Don't allow the count to be negative
	if count < 0 {
		return fmt.Errorf("negative count: %d", count)
	}

	// For each count, build and add the node
	nodes := make([]dag.Vertex, 0, count)
	for i := 0; i < count; i++ {
		// Set the index. If our count is 1 we special case it so that
		// we handle the "resource.0" and "resource" boundary properly.
		index := i
		if count == 1 {
			index = -1
		}

		// Save the node for later so we can do connections. Make the
		// proper node depending on if we're just a destroy node or if
		// were a regular node.
		var node dag.Vertex = &graphNodeExpandedResource{
			Index:    index,
			Resource: t.Resource,
			Path:     g.Path,
		}
		if t.Destroy {
			node = &graphNodeExpandedResourceDestroy{
				graphNodeExpandedResource: node.(*graphNodeExpandedResource),
			}
		}

		// Skip nodes if targeting excludes them
		if !t.nodeIsTargeted(node) {
			continue
		}

		// Add the node now
		nodes = append(nodes, node)
		g.Add(node)
	}

	// Make the dependency connections
	for _, n := range nodes {
		// Connect the dependents. We ignore the return value for missing
		// dependents since that should've been caught at a higher level.
		g.ConnectDependent(n)
	}

	return nil
}

func (t *ResourceCountTransformer) nodeIsTargeted(node dag.Vertex) bool {
	// no targets specified, everything stays in the graph
	if len(t.Targets) == 0 {
		return true
	}
	addressable, ok := node.(GraphNodeAddressable)
	if !ok {
		return false
	}

	addr := addressable.ResourceAddress()
	for _, targetAddr := range t.Targets {
		if targetAddr.Equals(addr) {
			return true
		}
	}
	return false
}

type graphNodeExpandedResource struct {
	Index    int
	Resource *config.Resource
	Path     []string
}

func (n *graphNodeExpandedResource) Name() string {
	if n.Index == -1 {
		return n.Resource.Id()
	}

	return fmt.Sprintf("%s #%d", n.Resource.Id(), n.Index)
}

// GraphNodeAddressable impl.
func (n *graphNodeExpandedResource) ResourceAddress() *ResourceAddress {
	// We want this to report the logical index properly, so we must undo the
	// special case from the expand
	index := n.Index
	if index == -1 {
		index = 0
	}
	return &ResourceAddress{
		Path:         n.Path[1:],
		Index:        index,
		InstanceType: TypePrimary,
		Name:         n.Resource.Name,
		Type:         n.Resource.Type,
	}
}

// graphNodeConfig impl.
func (n *graphNodeExpandedResource) ConfigType() GraphNodeConfigType {
	return GraphNodeConfigTypeResource
}

// GraphNodeDependable impl.
func (n *graphNodeExpandedResource) DependableName() []string {
	return []string{
		n.Resource.Id(),
		n.stateId(),
	}
}

// GraphNodeDependent impl.
func (n *graphNodeExpandedResource) DependentOn() []string {
	configNode := &GraphNodeConfigResource{Resource: n.Resource}
	result := configNode.DependentOn()

	// Walk the variables to find any count-specific variables we depend on.
	configNode.VarWalk(func(v config.InterpolatedVariable) {
		rv, ok := v.(*config.ResourceVariable)
		if !ok {
			return
		}

		// We only want ourselves
		if rv.ResourceId() != n.Resource.Id() {
			return
		}

		// If this isn't a multi-access (which shouldn't be allowed but
		// is verified elsewhere), then we depend on the specific count
		// of this resource, ignoring ourself (which again should be
		// validated elsewhere).
		if rv.Index > -1 {
			id := fmt.Sprintf("%s.%d", rv.ResourceId(), rv.Index)
			if id != n.stateId() && id != n.stateId()+".0" {
				result = append(result, id)
			}
		}
	})

	return result
}

// GraphNodeProviderConsumer
func (n *graphNodeExpandedResource) ProvidedBy() []string {
	return []string{resourceProvider(n.Resource.Type, n.Resource.Provider)}
}

func (n *graphNodeExpandedResource) StateDependencies() []string {
	depsRaw := n.DependentOn()
	deps := make([]string, 0, len(depsRaw))
	for _, d := range depsRaw {
		// Ignore any variable dependencies
		if strings.HasPrefix(d, "var.") {
			continue
		}

		// This is sad. The dependencies are currently in the format of
		// "module.foo.bar" (the full field). This strips the field off.
		if strings.HasPrefix(d, "module.") {
			parts := strings.SplitN(d, ".", 3)
			d = strings.Join(parts[0:2], ".")
		}
		deps = append(deps, d)
	}

	return deps
}

// GraphNodeEvalable impl.
func (n *graphNodeExpandedResource) EvalTree() EvalNode {
	var diff *InstanceDiff
	var provider ResourceProvider
	var resourceConfig *ResourceConfig
	var state *InstanceState

	// Build the resource. If we aren't part of a multi-resource, then
	// we still consider ourselves as count index zero.
	index := n.Index
	if index < 0 {
		index = 0
	}
	resource := &Resource{
		Name:       n.Resource.Name,
		Type:       n.Resource.Type,
		CountIndex: index,
	}

	seq := &EvalSequence{Nodes: make([]EvalNode, 0, 5)}

	// Validate the resource
	vseq := &EvalSequence{Nodes: make([]EvalNode, 0, 5)}
	vseq.Nodes = append(vseq.Nodes, &EvalGetProvider{
		Name:   n.ProvidedBy()[0],
		Output: &provider,
	})
	vseq.Nodes = append(vseq.Nodes, &EvalInterpolate{
		Config:   n.Resource.RawConfig.Copy(),
		Resource: resource,
		Output:   &resourceConfig,
	})
	vseq.Nodes = append(vseq.Nodes, &EvalValidateResource{
		Provider:     &provider,
		Config:       &resourceConfig,
		ResourceName: n.Resource.Name,
		ResourceType: n.Resource.Type,
	})

	// Validate all the provisioners
	for _, p := range n.Resource.Provisioners {
		var provisioner ResourceProvisioner
		vseq.Nodes = append(vseq.Nodes, &EvalGetProvisioner{
			Name:   p.Type,
			Output: &provisioner,
		}, &EvalInterpolate{
			Config:   p.RawConfig.Copy(),
			Resource: resource,
			Output:   &resourceConfig,
		}, &EvalValidateProvisioner{
			Provisioner: &provisioner,
			Config:      &resourceConfig,
		})
	}

	// Add the validation operations
	seq.Nodes = append(seq.Nodes, &EvalOpFilter{
		Ops:  []walkOperation{walkValidate},
		Node: vseq,
	})

	// Build instance info
	info := n.instanceInfo()
	seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})

	// Refresh the resource
	seq.Nodes = append(seq.Nodes, &EvalOpFilter{
		Ops: []walkOperation{walkRefresh},
		Node: &EvalSequence{
			Nodes: []EvalNode{
				&EvalGetProvider{
					Name:   n.ProvidedBy()[0],
					Output: &provider,
				},
				&EvalReadState{
					Name:   n.stateId(),
					Output: &state,
				},
				&EvalRefresh{
					Info:     info,
					Provider: &provider,
					State:    &state,
					Output:   &state,
				},
				&EvalWriteState{
					Name:         n.stateId(),
					ResourceType: n.Resource.Type,
					Provider:     n.Resource.Provider,
					Dependencies: n.StateDependencies(),
					State:        &state,
				},
			},
		},
	})

	// Diff the resource
	seq.Nodes = append(seq.Nodes, &EvalOpFilter{
		Ops: []walkOperation{walkPlan},
		Node: &EvalSequence{
			Nodes: []EvalNode{
				&EvalInterpolate{
					Config:   n.Resource.RawConfig.Copy(),
					Resource: resource,
					Output:   &resourceConfig,
				},
				&EvalGetProvider{
					Name:   n.ProvidedBy()[0],
					Output: &provider,
				},
				&EvalReadState{
					Name:   n.stateId(),
					Output: &state,
				},
				&EvalDiff{
					Info:        info,
					Config:      &resourceConfig,
					Provider:    &provider,
					State:       &state,
					Output:      &diff,
					OutputState: &state,
				},
				&EvalCheckPreventDestroy{
					Resource: n.Resource,
					Diff:     &diff,
				},
				&EvalIgnoreChanges{
					Resource: n.Resource,
					Diff:     &diff,
				},
				&EvalWriteState{
					Name:         n.stateId(),
					ResourceType: n.Resource.Type,
					Provider:     n.Resource.Provider,
					Dependencies: n.StateDependencies(),
					State:        &state,
				},
				&EvalDiffTainted{
					Diff: &diff,
					Name: n.stateId(),
				},
				&EvalWriteDiff{
					Name: n.stateId(),
					Diff: &diff,
				},
			},
		},
	})

	// Diff the resource for destruction
	seq.Nodes = append(seq.Nodes, &EvalOpFilter{
		Ops: []walkOperation{walkPlanDestroy},
		Node: &EvalSequence{
			Nodes: []EvalNode{
				&EvalReadState{
					Name:   n.stateId(),
					Output: &state,
				},
				&EvalDiffDestroy{
					Info:   info,
					State:  &state,
					Output: &diff,
				},
				&EvalCheckPreventDestroy{
					Resource: n.Resource,
					Diff:     &diff,
				},
				&EvalWriteDiff{
					Name: n.stateId(),
					Diff: &diff,
				},
			},
		},
	})

	// Apply
	var diffApply *InstanceDiff
	var err error
	var createNew, tainted bool
	var createBeforeDestroyEnabled bool
	var wasChangeType DiffChangeType
	seq.Nodes = append(seq.Nodes, &EvalOpFilter{
		Ops: []walkOperation{walkApply, walkDestroy},
		Node: &EvalSequence{
			Nodes: []EvalNode{
				// Get the saved diff for apply
				&EvalReadDiff{
					Name: n.stateId(),
					Diff: &diffApply,
				},

				// We don't want to do any destroys
				&EvalIf{
					If: func(ctx EvalContext) (bool, error) {
						if diffApply == nil {
							return true, EvalEarlyExitError{}
						}

						if diffApply.Destroy && len(diffApply.Attributes) == 0 {
							return true, EvalEarlyExitError{}
						}

						wasChangeType = diffApply.ChangeType()
						diffApply.Destroy = false
						return true, nil
					},
					Then: EvalNoop{},
				},

				&EvalIf{
					If: func(ctx EvalContext) (bool, error) {
						destroy := false
						if diffApply != nil {
							destroy = diffApply.Destroy || diffApply.RequiresNew()
						}

						createBeforeDestroyEnabled =
							n.Resource.Lifecycle.CreateBeforeDestroy &&
								destroy

						return createBeforeDestroyEnabled, nil
					},
					Then: &EvalDeposeState{
						Name: n.stateId(),
					},
				},

				&EvalInterpolate{
					Config:   n.Resource.RawConfig.Copy(),
					Resource: resource,
					Output:   &resourceConfig,
				},
				&EvalGetProvider{
					Name:   n.ProvidedBy()[0],
					Output: &provider,
				},
				&EvalReadState{
					Name:   n.stateId(),
					Output: &state,
				},

				&EvalDiff{
					Info:     info,
					Config:   &resourceConfig,
					Provider: &provider,
					State:    &state,
					Output:   &diffApply,
				},
				&EvalIgnoreChanges{
					Resource:      n.Resource,
					Diff:          &diffApply,
					WasChangeType: &wasChangeType,
				},

				// Get the saved diff
				&EvalReadDiff{
					Name: n.stateId(),
					Diff: &diff,
				},

				// Compare the diffs
				&EvalCompareDiff{
					Info: info,
					One:  &diff,
					Two:  &diffApply,
				},

				&EvalGetProvider{
					Name:   n.ProvidedBy()[0],
					Output: &provider,
				},
				&EvalReadState{
					Name:   n.stateId(),
					Output: &state,
				},
				&EvalApply{
					Info:      info,
					State:     &state,
					Diff:      &diffApply,
					Provider:  &provider,
					Output:    &state,
					Error:     &err,
					CreateNew: &createNew,
				},
				&EvalWriteState{
					Name:         n.stateId(),
					ResourceType: n.Resource.Type,
					Provider:     n.Resource.Provider,
					Dependencies: n.StateDependencies(),
					State:        &state,
				},
				&EvalApplyProvisioners{
					Info:           info,
					State:          &state,
					Resource:       n.Resource,
					InterpResource: resource,
					CreateNew:      &createNew,
					Tainted:        &tainted,
					Error:          &err,
				},
				&EvalIf{
					If: func(ctx EvalContext) (bool, error) {
						if createBeforeDestroyEnabled {
							tainted = err != nil
						}

						failure := tainted || err != nil
						return createBeforeDestroyEnabled && failure, nil
					},
					Then: &EvalUndeposeState{
						Name: n.stateId(),
					},
				},

				// We clear the diff out here so that future nodes
				// don't see a diff that is already complete. There
				// is no longer a diff!
				&EvalWriteDiff{
					Name: n.stateId(),
					Diff: nil,
				},

				&EvalIf{
					If: func(ctx EvalContext) (bool, error) {
						return tainted, nil
					},
					Then: &EvalSequence{
						Nodes: []EvalNode{
							&EvalWriteStateTainted{
								Name:         n.stateId(),
								ResourceType: n.Resource.Type,
								Provider:     n.Resource.Provider,
								Dependencies: n.StateDependencies(),
								State:        &state,
								Index:        -1,
							},
							&EvalIf{
								If: func(ctx EvalContext) (bool, error) {
									return !n.Resource.Lifecycle.CreateBeforeDestroy, nil
								},
								Then: &EvalClearPrimaryState{
									Name: n.stateId(),
								},
							},
						},
					},
					Else: &EvalWriteState{
						Name:         n.stateId(),
						ResourceType: n.Resource.Type,
						Provider:     n.Resource.Provider,
						Dependencies: n.StateDependencies(),
						State:        &state,
					},
				},
				&EvalApplyPost{
					Info:  info,
					State: &state,
					Error: &err,
				},
				&EvalUpdateStateHook{},
			},
		},
	})

	return seq
}

// instanceInfo is used for EvalTree.
func (n *graphNodeExpandedResource) instanceInfo() *InstanceInfo {
	return &InstanceInfo{Id: n.stateId(), Type: n.Resource.Type}
}

// stateId is the name used for the state key
func (n *graphNodeExpandedResource) stateId() string {
	if n.Index == -1 {
		return n.Resource.Id()
	}

	return fmt.Sprintf("%s.%d", n.Resource.Id(), n.Index)
}

// GraphNodeStateRepresentative impl.
func (n *graphNodeExpandedResource) StateId() []string {
	return []string{n.stateId()}
}

// graphNodeExpandedResourceDestroy represents an expanded resource that
// is to be destroyed.
type graphNodeExpandedResourceDestroy struct {
	*graphNodeExpandedResource
}

func (n *graphNodeExpandedResourceDestroy) Name() string {
	return fmt.Sprintf("%s (destroy)", n.graphNodeExpandedResource.Name())
}

// graphNodeConfig impl.
func (n *graphNodeExpandedResourceDestroy) ConfigType() GraphNodeConfigType {
	return GraphNodeConfigTypeResource
}

// GraphNodeEvalable impl.
func (n *graphNodeExpandedResourceDestroy) EvalTree() EvalNode {
	info := n.instanceInfo()

	var diffApply *InstanceDiff
	var provider ResourceProvider
	var state *InstanceState
	var err error
	return &EvalOpFilter{
		Ops: []walkOperation{walkApply, walkDestroy},
		Node: &EvalSequence{
			Nodes: []EvalNode{
				// Get the saved diff for apply
				&EvalReadDiff{
					Name: n.stateId(),
					Diff: &diffApply,
				},

				// Filter the diff so we only get the destroy
				&EvalFilterDiff{
					Diff:    &diffApply,
					Output:  &diffApply,
					Destroy: true,
				},

				// If we're not destroying, then compare diffs
				&EvalIf{
					If: func(ctx EvalContext) (bool, error) {
						if diffApply != nil && diffApply.Destroy {
							return true, nil
						}

						return true, EvalEarlyExitError{}
					},
					Then: EvalNoop{},
				},

				&EvalGetProvider{
					Name:   n.ProvidedBy()[0],
					Output: &provider,
				},
				&EvalReadState{
					Name:   n.stateId(),
					Output: &state,
				},
				&EvalRequireState{
					State: &state,
				},
				&EvalApply{
					Info:     info,
					State:    &state,
					Diff:     &diffApply,
					Provider: &provider,
					Output:   &state,
					Error:    &err,
				},
				&EvalWriteState{
					Name:         n.stateId(),
					ResourceType: n.Resource.Type,
					Provider:     n.Resource.Provider,
					Dependencies: n.StateDependencies(),
					State:        &state,
				},
				&EvalApplyPost{
					Info:  info,
					State: &state,
					Error: &err,
				},
			},
		},
	}
}


text:
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using System;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;

namespace Mosa.Tool.XmlTo
{
	internal class Program
	{
		private static int Main(string[] args)
		{
			Console.WriteLine();
			Console.WriteLine("XMLTo v0.1 [www.mosa-project.org]");
			Console.WriteLine("Copyright 2010. New BSD License.");
			Console.WriteLine("Written by Philipp Garcia (phil@thinkedge.com)");
			Console.WriteLine();

			if (args.Length < 3)
			{
				Console.WriteLine("Usage: XMLTo <xml file> <xsl file> <output file>");
				Console.Error.WriteLine("ERROR: Missing arguments");
				return -1;
			}

			try
			{
				XPathDocument myXPathDoc = new XPathDocument(args[0]);
				XslCompiledTransform myXslTrans = new XslCompiledTransform();
				myXslTrans.Load(args[1]);
				XmlTextWriter myWriter = new XmlTextWriter(args[2], null);
				myXslTrans.Transform(myXPathDoc, null, myWriter);

				return 0;
			}
			catch (Exception e)
			{
				Console.Error.WriteLine("Exception: {0}", e.ToString());
				return -1;
			}
		}
	}
}


text:
#include "vislib/Listenable.h"

/*
 * This file is intentionally empty.
 */


text:
[![Gem Version](https://badge.fury.io/rb/network-client.svg)](https://rubygems.org/gems/network-client)
[![Gem](https://img.shields.io/gem/dt/network-client.svg?colorB=8b0000)](https://rubygems.org/gems/network-client)
[![Build Status](https://www.travis-ci.com/abarrak/network-client.svg?branch=master)](https://www.travis-ci.com/abarrak/network-client)
[![Test Coverage](https://codeclimate.com/github/abarrak/network-client/badges/coverage.svg)](https://codeclimate.com/github/abarrak/network-client/coverage)
[![Code Climate](https://lima.codeclimate.com/github/abarrak/network-client/badges/gpa.svg)](https://lima.codeclimate.com/github/abarrak/network-client)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'network-client'
```

And then execute:

```sh
$ bundle
```

Or install the gem directly:

```sh
$ gem install network-client
```

## Usage

#### Making JSON requests
Given this client set up:

```ruby
require "network-client"

client = Network::Client.new(endpoint: 'https://jsonplaceholder.typicode.com')
```

We can perform the following requests:

  * **GET**

  ```ruby
  client.get '/todos/10'

  #=> #<struct Network::Client::Response code=200, body={"userId"=>1, "id"=>10, "title"=>"illo est ...", "completed"=>true}>
  ```

  * **POST**

  ```ruby
  client.post '/todos', params: { title: 'foo bar', completed: 'false', userId: 1 }.to_json

  #=> #<struct Network::Client::Response code=201, body={"title"=>"foo bar", "completed"=>false, "userId"=>1, "id"=>201}>
  ```

  * **PATCH**

  ```ruby
  client.patch '/todos/10', params: { title: 'new title' }.to_json

  #=> #<struct Network::Client::Response code=200, body={"userId"=>1, "id"=>10, "title"=>"new title", "completed"=>true}>
  ```

  * **PUT**

  ```ruby
    client.put '/todos/43', params: { completed: false }.to_json

    #=> #<struct Network::Client::Response code=200, body={"completed"=>false, "id"=>43}>
  ```

  * **DELETE**

  ```ruby
  client.delete '/todos/25'

  #=> #<struct Network::Client::Response code=200, body={}>
  ```

#### Returned Response

As appears in previous examples, the returned value of each successful request is a `Response` struct.
It holds the response's HTTP code and body parsed as JSON.

```ruby
response = client.get '/posts/30'
response.code  #=> 200
response.body  #=> { "userId"=>3, "id"=>30, "title"=>"a quo magni similique perferendis", "body"=>"alias dolor cumque ..." }
```

#### Setting Request Headers
Since this is mainly JSON web client, `Accept` and `Content-Type` headers are set to json by default.

You can override them and set extra headers during initialization by providing `headers:` argument:

```ruby
headers = { 'X-SPECIAL-KEY' => '123456' }
client = Network::Client.new(endpoint: 'https://api.example.com', headers: headers)
```

Or on request basis with the `headers:` argument too:

```ruby
client.get 'posts/', headers: { 'X-SPECIAL-KEY' => '123456' }
```

#### HTTP Authentication

  1. **Basic:**
  ```ruby
  # using `username` and `password` named parameters when initialized:

  client = Network::Client.new(endpoint: 'https://api.example.com',
                               username: 'ABC',
                               password: '999')
  client.username  #=> "ABC"
  client.password  #=> "999"

  # or via `#set_basic_auth`:

  client.set_basic_auth('John Doe', '112233')
  client.username  #=> "John Doe"
  client.password  #=> "112233"
  ```

  2. **OAuth Bearer:**
  ```ruby
  client.set_bearer_auth(token: 'e08f7739c3abb78c')
  client.bearer_token
  #=> "e08f7739c3abb78c"
  ```

  3. **Token Based:**
  ```ruby
  client.set_token_auth(header_value: 'Token token=sec_key_aZcNRzoCMpmdMEP4OEeDUQ==')
  client.auth_token_header
  #=> "Token token=sec_key_aZcNRzoCMpmdMEP4OEeDUQ=="
  ```

#### Customizing User Agent
You can set the user agent header during initialization:

```ruby
client = Network::Client.new(endpoint: 'https://maps.googleapis.com', user_agent: 'App Service')
client.user_agent  #=> "App Service"
```

Or later on via `#set_user_agent` method:

```ruby
client.set_user_agent('Gateway Server')
client.user_agent  #=> "Gateway Server"
```

The default user agent is `Network Client`.

#### Retry and Error Handling
Set the `tries:` named argument to define the number of tries when request fails with one of the retryable errors.

```ruby
client = Network::Client.new(endpoint: 'https://api.foursquare.com', tries: 3)
client.tries  #=> 3
```

The default `#tries` is 2.

To retrieve or extend the list of triable errors through `#errors_to_recover`:

```ruby
client.errors_to_recover

#=> [Net::HTTPTooManyRequests, Net::HTTPServerError, Net::ProtocolError, Net::HTTPBadResponse,Net::ReadTimeout, Net::OpenTimeout, Errno::ECONNREFUSED, Errno::ETIMEDOUT, OpenSSL::SSL::SSLError, SocketError]

client.errors_to_recover << Net::HTTPRequestTimeOut

#=> [Net::HTTPTooManyRequests, Net::HTTPServerError, Net::ProtocolError, Net::HTTPBadResponse,Net::ReadTimeout, Net::OpenTimeout, Errno::ECONNREFUSED, Errno::ETIMEDOUT, OpenSSL::SSL::SSLError, SocketError, Net::HTTPRequestTimeOut]
```

The list of `errors_to_propagate` takes precedence over `errors_to_recover`, and they are not retried.

You can retrieve them for rescue in your application layer, and extend them too.

```ruby
client.errors_to_propagate
#=> [Net::HTTPRequestURITooLong, Net::HTTPMethodNotAllowed]

client.errors_to_propagate << Net::HTTPNotAcceptable
#=> [Net::HTTPRequestURITooLong, Net::HTTPMethodNotAllowed, Net::HTTPNotAcceptable]
```

*Be careful not to add ancestor error class (higher in the inheritance chain) as it will prevent any of it's descendant classes from getting retried. Unless this is an intended behavior, of course.*

#### Logger
When `Rails` is in scope, it's logger will be used by default.

If not, then it defaults to a fallback logger that writes to `STDOUT`.

Additionally, you can override with your custom logger by supplying block to `#set_logger` like so:

```ruby
client = Network::Client.new(endpoint: 'https://api.foursquare.com')

client.set_logger { Logger.new(STDERR) }
client.logger
#=> #<Logger:0x007fb3cd136d38 @progname=nil, @level=0, @default_formatter=#<Logger::Formatter:0x007fb3cd136d10 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x007fb3cd136c98 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDERR>>, @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x007fb3cd136c70>>>
```

## Documentation
For more details, please refer to [the API documentation](http://www.rubydoc.info/gems/network-client/2.0.1/Network/Client).

## Contributing
Bug reports and pull requests are very much appreciated at [Github](https://github.com/abarrak/network-client).

  - Fork The repository.
  - Create a branch with the fix or feature name.
  - Make your changes (with test or README changes/additions if applicable).
  - Push changes to the created branch.
  - Create an Pull Request.
  - That's it!

## License
[MIT](http://opensource.org/licenses/MIT).


text:
namespace content {
class BrowserContext;
}

namespace media_router {

class MediaRouter;

// A factory that lazily returns a MediaRouter implementation for a given
// BrowserContext.
class MediaRouterFactory : public BrowserContextKeyedServiceFactory {
 public:
  static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context);

 protected:
  // We override the shutdown method for the factory to give the Media Router a
  // chance to remove off the record media routes.
  void BrowserContextShutdown(content::BrowserContext* context) override;

 private:
  friend struct base::DefaultLazyInstanceTraits<MediaRouterFactory>;

  MediaRouterFactory();
  ~MediaRouterFactory() override;

  // BrowserContextKeyedServiceFactory interface.
  content::BrowserContext* GetBrowserContextToUse(
      content::BrowserContext* context) const override;

  KeyedService* BuildServiceInstanceFor(
      content::BrowserContext* context) const override;

  DISALLOW_COPY_AND_ASSIGN(MediaRouterFactory);
};

}  // namespace media_router

#endif  // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_