text:
+++
title = "Spring Boot Starter Configuration"
weight = 4
+++

## 5.0.0-beta

### Sharding

#### Configuration Item Explanation

```properties
spring.shardingsphere.datasource.names= # Omit the data source configuration, please refer to the usage

# Standard sharding table configuration
spring.shardingsphere.rules.sharding.tables.<table-name>.actual-data-nodes= # Describe data source names and actual tables, delimiter as point, multiple data nodes separated with comma, support inline expression. Absent means sharding databases only.

# Databases sharding strategy, use default databases sharding strategy if absent. sharding strategy below can choose only one.

# For single sharding column scenario
spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.standard.<sharding-algorithm-name>.sharding-column= # Sharding column name
spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.standard.<sharding-algorithm-name>.sharding-algorithm-name= # Sharding algorithm name

# For multiple sharding columns scenario
spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.complex.<sharding-algorithm-name>.sharding-columns= # Sharding column names, multiple columns separated with comma
spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.complex.<sharding-algorithm-name>.sharding-algorithm-name= # Sharding algorithm name

# Sharding by hint
spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.hint.<sharding-algorithm-name>.sharding-algorithm-name= # Sharding algorithm name

# Tables sharding strategy, same as database sharding strategy
spring.shardingsphere.rules.sharding.tables.<table-name>.table-strategy.xxx= # Omitted

# Auto sharding table configuraiton
spring.shardingsphere.rules.sharding.auto-tables.<auto-table-name>.actual-data-sources= # data source names

spring.shardingsphere.rules.sharding.auto-tables.<auto-table-name>.sharding-strategy.standard.sharding-column= # Sharding column name
spring.shardingsphere.rules.sharding.auto-tables.<auto-table-name>.sharding-strategy.standard.sharding-algorithm= # Auto sharding algorithm name

# Key generator strategy configuration
spring.shardingsphere.rules.sharding.tables.<table-name>.key-generate-strategy.column= # Column name of key generator
spring.shardingsphere.rules.sharding.tables.<table-name>.key-generate-strategy.key-generator-name= # Key generator name

spring.shardingsphere.rules.sharding.binding-tables[0]= # Binding table name
spring.shardingsphere.rules.sharding.binding-tables[1]= # Binding table name
spring.shardingsphere.rules.sharding.binding-tables[x]= # Binding table name

spring.shardingsphere.rules.sharding.broadcast-tables[0]= # Broadcast tables
spring.shardingsphere.rules.sharding.broadcast-tables[1]= # Broadcast tables
spring.shardingsphere.rules.sharding.broadcast-tables[x]= # Broadcast tables

spring.shardingsphere.sharding.default-database-strategy.xxx= # Default strategy for database sharding
spring.shardingsphere.sharding.default-table-strategy.xxx= # Default strategy for table sharding
spring.shardingsphere.sharding.default-key-generate-strategy.xxx= # Default Key generator strategy

# Sharding algorithm configuration
spring.shardingsphere.rules.sharding.sharding-algorithms.<sharding-algorithm-name>.type= # Sharding algorithm type
spring.shardingsphere.rules.sharding.sharding-algorithms.<sharding-algorithm-name>.props.xxx=# Sharding algorithm properties

# Key generate algorithm configuration
spring.shardingsphere.rules.sharding.key-generators.<key-generate-algorithm-name>.type= # Key generate algorithm type
spring.shardingsphere.rules.sharding.key-generators.<key-generate-algorithm-name>.props.xxx= # Key generate algorithm properties
```

Please refer to [Built-in sharding Algorithm List](/en/user-manual/shardingsphere-jdbc/builtin-algorithm/sharding) and [Built-in keygen Algorithm List](/en/user-manual/shardingsphere-jdbc/builtin-algorithm/keygen)。

### Readwrite-splitting

#### Configuration Item Explanation

```properties
spring.shardingsphere.datasource.names= # Omit the data source configuration, please refer to the usage

spring.shardingsphere.rules.readwrite-splitting.data-sources.<readwrite-splitting-data-source-name>.primary-data-source-name= # Write data source name
spring.shardingsphere.rules.readwrite-splitting.data-sources.<readwrite-splitting-data-source-name>.replica-data-source-names= # Read data source names, multiple data source names separated with comma
spring.shardingsphere.rules.readwrite-splitting.data-sources.<readwrite-splitting-data-source-name>.load-balancer-name= # Load balance algorithm name

# Load balance algorithm configuration
spring.shardingsphere.rules.readwrite-splitting.load-balancers.<load-balance-algorithm-name>.type= # Load balance algorithm type
spring.shardingsphere.rules.readwrite-splitting.load-balancers.<load-balance-algorithm-name>.props.xxx= # Load balance algorithm properties
```

Please refer to [Built-in Load Balance Algorithm List](/en/user-manual/shardingsphere-jdbc/builtin-algorithm/load-balance) for more details about type of algorithm.

### Encryption

#### Configuration Item Explanation

```properties
spring.shardingsphere.datasource.names= # Omit the data source configuration, please refer to the usage

spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.cipher-column= # Cipher column name
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.assisted-query-column= # Assisted query column name
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.plain-column= # Plain column name
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.encryptor-name= # Encrypt algorithm name

# Encrypt algorithm configuration
spring.shardingsphere.rules.encrypt.encryptors.<encrypt-algorithm-name>.type= # Encrypt algorithm type
spring.shardingsphere.rules.encrypt.encryptors.<encrypt-algorithm-name>.props.xxx= # Encrypt algorithm properties
```

### Shadow DB

#### Configuration Item Explanation

```properties
spring.shardingsphere.datasource.names= # Omit the data source configuration, please refer to the usage

spring.shardingsphere.rules.shadow.column= # Shadow column name
spring.shardingsphere.rules.shadow.shadow-mappings.<product-data-source-name>= # Shadow data source name
```

### Governance

#### Configuration Item Explanation

##### Management

```properties
spring.shardingsphere.governance.name= # Governance name
spring.shardingsphere.governance.registry-center.type= # Governance instance type. Example:Zookeeper, etcd, Apollo, Nacos
spring.shardingsphere.governance.registry-center.server-lists= # The list of servers that connect to governance instance, including IP and port number; use commas to separate
spring.shardingsphere.governance.registry-center.props= # Other properties
spring.shardingsphere.governance.overwrite= # Whether to overwrite local configurations with config center configurations; if it can, each initialization should refer to local configurations
```

### Mixed Rules

#### Configuration Item Explanation

```properties
# data source configuration
spring.shardingsphere.datasource.names= write-ds0,write-ds1,write-ds0-read0,write-ds1-read0

spring.shardingsphere.datasource.write-ds0.url= # Database URL connection
spring.shardingsphere.datasource.write-ds0.type=  # Database connection pool type name
spring.shardingsphere.datasource.write-ds0.driver-class-name= # Database driver class name
spring.shardingsphere.datasource.write-ds0.username= # Database username
spring.shardingsphere.datasource.write-ds0.password= # Database password
spring.shardingsphere.datasource.write-ds0.xxx=  # Other properties of database connection pool

spring.shardingsphere.datasource.write-ds1.url= # Database URL connection
# ...Omit specific configuration.

spring.shardingsphere.datasource.write-ds0-read0.url= # Database URL connection
# ...Omit specific configuration.

spring.shardingsphere.datasource.write-ds1-read0.url= # Database URL connection
# ...Omit specific configuration.

# Sharding rules configuration
# Databases sharding strategy
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=default-database-strategy-inline
# Binding table rules configuration ,and multiple groups of binding-tables configured with arrays
spring.shardingsphere.rules.sharding.binding-tables[0]=t_user,t_user_detail
spring.shardingsphere.rules.sharding.binding-tables[1]= # Binding table names,multiple table name are separated by commas
spring.shardingsphere.rules.sharding.binding-tables[x]= # Binding table names,multiple table name are separated by commas
# Broadcast table rules configuration
spring.shardingsphere.rules.sharding.broadcast-tables= # Broadcast table names,multiple table name are separated by commas

# Table sharding strategy
# The enumeration value of `ds_$->{0..1}` is the name of the logical data source configured with readwrite-splitting
spring.shardingsphere.rules.sharding.tables.t_user.actual-data-nodes=ds_$->{0..1}.t_user_$->{0..1}
spring.shardingsphere.rules.sharding.tables.t_user.table-strategy.standard.sharding-column=user_id
spring.shardingsphere.rules.sharding.tables.t_user.table-strategy.standard.sharding-algorithm-name=user-table-strategy-inline

# Data encrypt configuration
# Table `t_user` is the name of the logical table that uses for data sharding configuration.
spring.shardingsphere.rules.encrypt.tables.t_user.columns.username.cipher-column=username
spring.shardingsphere.rules.encrypt.tables.t_user.columns.username.encryptor-name=name-encryptor
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.cipher-column=pwd
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.encryptor-name=pwd-encryptor

# Data encrypt algorithm configuration
spring.shardingsphere.rules.encrypt.encryptors.name-encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.name-encryptor.props.aes-key-value=123456abc
spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.props.aes-key-value=123456abc

# Key generate strategy configuration
spring.shardingsphere.rules.sharding.tables.t_user.key-generate-strategy.column=user_id
spring.shardingsphere.rules.sharding.tables.t_user.key-generate-strategy.key-generator-name=snowflake

# Sharding algorithm configuration
spring.shardingsphere.rules.sharding.sharding-algorithms.default-database-strategy-inline.type=INLINE
# The enumeration value of `ds_$->{user_id % 2}` is the name of the logical data source configured with readwrite-splitting
spring.shardingsphere.rules.sharding.sharding-algorithms.default-database-strategy-inline.algorithm-expression=ds$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.user-table-strategy-inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.user-table-strategy-inline.props.algorithm-expression=t_user_$->{user_id % 2}

# Key generate algorithm configuration
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE

# read query configuration
# ds_0,ds_1 is the logical data source name of the readwrite-splitting
spring.shardingsphere.rules.readwrite-splitting.data-sources.ds_0.write-data-source-name=write-ds0
spring.shardingsphere.rules.readwrite-splitting.data-sources.ds_0.read-data-source-names=write-ds0-read0
spring.shardingsphere.rules.readwrite-splitting.data-sources.ds_0.load-balancer-name=read-random
spring.shardingsphere.rules.readwrite-splitting.data-sources.ds_1.write-data-source-name=write-ds1
spring.shardingsphere.rules.readwrite-splitting.data-sources.ds_1.read-data-source-names=write-ds1-read0
spring.shardingsphere.rules.readwrite-splitting.data-sources.ds_1.load-balancer-name=read-random

# Load balance algorithm configuration
spring.shardingsphere.rules.readwrite-splitting.load-balancers.read-random.type=RANDOM
```

## Shardingsphere-4.x

### Data Sharding

#### Configuration Item Explanation

```properties
spring.shardingsphere.datasource.names= #Data source name; multiple data sources are separated by commas

spring.shardingsphere.datasource.<data-source-name>.type= #Database connection pool type name
spring.shardingsphere.datasource.<data-source-name>.driver-class-name= #Database driver class name
spring.shardingsphere.datasource.<data-source-name>.url= #Database url connection
spring.shardingsphere.datasource.<data-source-name>.username= #Database username
spring.shardingsphere.datasource.<data-source-name>.password= #Database password
spring.shardingsphere.datasource.<data-source-name>.xxx= #Other properties of database connection pool

spring.shardingsphere.sharding.tables.<logic-table-name>.actual-data-nodes= #It is consisted of data source name + table name, separated by decimal points; multiple tables are separated by commas and support inline expressions; default means using existing data sources and logic table names to generate data nodes; it can be applied in broadcast tables (each database needs a same table for relevance query, dictionary table mostly) or the situation with sharding database but without sharding table (table structures of all the databases are consistent)

#Database sharding strategy; default means using default database sharding strategy; it can only choose one of the following sharding strategies

#It is applied in standard sharding situation of single-sharding key
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.standard.sharding-column= #Sharding column name
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.standard.precise-algorithm-class-name= #Precise algorithm class name, applied in = and IN; the class needs to implement PreciseShardingAlgorithm interface and provide parameter-free constructor
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.standard.range-algorithm-class-name= #Range sharding algorithm class name, applied in BETWEEN, optional; the class should implement RangeShardingAlgorithm interface and provide parameter-free constructor

#It is applied in complex sharding situations with multiple sharding keys
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.complex.sharding-columns= #Sharding column name, with multiple columns separated by commas
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.complex.algorithm-class-name= #Complex sharding algorithm class name; the class needs to implement ComplexKeysShardingAlgorithm interface and provide parameter-free constructor

#Inline expression sharding strategy
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.inline.sharding-column= #Sharding column name
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.inline.algorithm-expression= #Inline expression of sharding algorithm, which needs to conform to groovy statements

#Hint Sharding Strategy
spring.shardingsphere.sharding.tables.<logic-table-name>.database-strategy.hint.algorithm-class-name= #Hint algorithm class name;  the class needs to implement HintShardingAlgorithm interface and provide parameter-free constructor

#Table sharding strategy, same as database sharding strategy
spring.shardingsphere.sharding.tables.<logic-table-name>.table-strategy.xxx= #Omitted

spring.shardingsphere.sharding.tables.<logic-table-name>.key-generator.column= #Auto-increment column name; default means not using auto-increment key generator
spring.shardingsphere.sharding.tables.<logic-table-name>.key-generator.type= #Auto-increament key generator type; default means using default auto-increament key generator; user defined generator or internal generator (SNOWFLAKE, UUID) can both be selected
spring.shardingsphere.sharding.tables.<logic-table-name>.key-generator.props.<property-name>= #Properties, Notice: when use SNOWFLAKE, `max.tolerate.time.difference.milliseconds` for `SNOWFLAKE` need to be set. To use the generated value of this algorithm as sharding value, it is recommended to configure `max.vibration.offset`

spring.shardingsphere.sharding.binding-tables[0]= #Binding table rule list
spring.shardingsphere.sharding.binding-tables[1]= #Binding table rule list
spring.shardingsphere.sharding.binding-tables[x]= #Binding table rule list

spring.shardingsphere.sharding.broadcast-tables[0]= #Broadcast table rule list
spring.shardingsphere.sharding.broadcast-tables[1]= #Broadcast table rule list
spring.shardingsphere.sharding.broadcast-tables[x]= #Broadcast table rule list

spring.shardingsphere.sharding.default-data-source-name= #Tables without sharding rules will be located through default data source
spring.shardingsphere.sharding.default-database-strategy.xxx= #Default database sharding strategy
spring.shardingsphere.sharding.default-table-strategy.xxx= #Default table sharding strategy
spring.shardingsphere.sharding.default-key-generator.type= #Default auto-increament key generator of type; it will use org.apache.shardingsphere.core.keygen.generator.impl.SnowflakeKeyGenerator in default; user defined generator or internal generator (SNOWFLAKE or UUID) can both be used
spring.shardingsphere.sharding.default-key-generator.props.<property-name>= #Auto-increament key generator property configuration, such as max.tolerate.time.difference.milliseconds of SNOWFLAKE algorithm

spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.master-data-source-name= #Refer to readwrite-splitting part for more details
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[0]= #Refer to readwrite-splitting part for more details
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[1]= #Refer to readwrite-splitting part for more details
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[x]= #Refer to readwrite-splitting part for more details
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-class-name= #Refer to readwrite-splitting part for more details
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-type= #Refer to readwrite-splitting part for more details

spring.shardingsphere.props.sql.show= #Show SQL or not; default value: false
spring.shardingsphere.props.executor.size= #Executing thread number; default value: CPU core number
```

### Readwrite Split

#### Configuration Item Explanation

```properties
#Omit data source configurations; keep it consistent with data sharding

spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.master-data-source-name= #Data source name of master database
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[0]= #Data source name list of slave database
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[1]= #Data source name list of slave database
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[x]= #Data source name list of slave database
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-class-name= #Load balance algorithm class name; the class needs to implement MasterSlaveLoadBalanceAlgorithm interface and provide parameter-free constructor
spring.shardingsphere.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-type= #Load balance algorithm class of slave database; optional value: ROUND_ROBIN and RANDOM; if there is load-balance-algorithm-class-name, the configuration can be omitted

spring.shardingsphere.props.sql.show= #Show SQL or not; default value: false
spring.shardingsphere.props.executor.size= #Executing thread number; default value: CPU core number
spring.shardingsphere.props.check.table.metadata.enabled= #Whether to check meta-data consistency of sharding table when it initializes; default value: false
```
### Data Masking

#### Configuration Item Explanation

```properties
#Omit data source configurations; keep it consistent with data sharding

spring.shardingsphere.encrypt.encryptors.<encryptor-name>.type= #Type of encryptor,use user-defined ones or built-in ones, e.g. MD5/AES
spring.shardingsphere.encrypt.encryptors.<encryptor-name>.props.<property-name>= #Properties, Notice: when use AES encryptor, `aes.key.value` for AES encryptor need to be set
spring.shardingsphere.encrypt.tables.<table-name>.columns.<logic-column-name>.plainColumn= #Plain column name
spring.shardingsphere.encrypt.tables.<table-name>.columns.<logic-column-name>.cipherColumn= #Cipher column name
spring.shardingsphere.encrypt.tables.<table-name>.columns.<logic-column-name>.assistedQueryColumn= #AssistedColumns for query,when use ShardingQueryAssistedEncryptor, it can help query encrypted data
spring.shardingsphere.encrypt.tables.<table-name>.columns.<logic-column-name>.encryptor= #Encryptor name
```

### Orchestration

#### Configuration Item Explanation

```properties
#Omit data source, data sharding, readwrite split and data masking configurations

spring.shardingsphere.orchestration.name= #Orchestration instance name
spring.shardingsphere.orchestration.overwrite= #Whether to overwrite local configurations with registry center configurations; if it can, each initialization should refer to local configurations
spring.shardingsphere.orchestration.registry.type= #Registry center type. Example:zookeeper
spring.shardingsphere.orchestration.registry.server-lists= #The list of servers that connect to registry center, including IP and port number; use commas to separate
spring.shardingsphere.orchestration.registry.namespace= #Registry center namespace
spring.shardingsphere.orchestration.registry.digest= #The token that connects to the registry center; default means there is no need for authentication
spring.shardingsphere.orchestration.registry.operation-timeout-milliseconds= #The millisecond number for operation timeout; default value: 500 milliseconds
spring.shardingsphere.orchestration.registry.max-retries= #Maximum retry time after failing; default value: 3 times
spring.shardingsphere.orchestration.registry.retry-interval-milliseconds= #Interval time to retry; default value: 500 milliseconds
spring.shardingsphere.orchestration.registry.time-to-live-seconds= #Living time of temporary nodes; default value: 60 seconds
spring.shardingsphere.orchestration.registry.props= #Customize registry center props.
```

## shardingsphere-3.x

### Sharding

#### Configuration Item Explanation

```properties
sharding.jdbc.datasource.names= #Names of data sources. Multiple data sources separated with comma

sharding.jdbc.datasource.<data-source-name>.type= #Class name of data source pool
sharding.jdbc.datasource.<data-source-name>.driver-class-name= #Class name of database driver
sharding.jdbc.datasource.<data-source-name>.url= #Database URL
sharding.jdbc.datasource.<data-source-name>.username= #Database username
sharding.jdbc.datasource.<data-source-name>.password= #Database password
sharding.jdbc.datasource.<data-source-name>.xxx= #Other properties for data source pool

sharding.jdbc.config.sharding.tables.<logic-table-name>.actual-data-nodes= #Describe data source names and actual tables, delimiter as point, multiple data nodes separated with comma, support inline expression. Absent means sharding databases only. Example: ds${0..7}.tbl${0..7}

#Databases sharding strategy, use default databases sharding strategy if absent. sharding strategy below can choose only one.

#Standard sharding scenario for single sharding column
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.standard.sharding-column= #Name of sharding column
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.standard.precise-algorithm-class-name= #Precise algorithm class name used for `=` and `IN`. This class need to implements PreciseShardingAlgorithm, and require a no argument constructor
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.standard.range-algorithm-class-name= #Range algorithm class name used for `BETWEEN`. This class need to implements RangeShardingAlgorithm, and require a no argument constructor

#Complex sharding scenario for multiple sharding columns
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.complex.sharding-columns= #Names of sharding columns. Multiple columns separated with comma
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.complex.algorithm-class-name= #Complex sharding algorithm class name. This class need to implements ComplexKeysShardingAlgorithm, and require a no argument constructor

#Inline expression sharding scenario for si-gle s-arding column
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.inline.sharding-column= #Name of sharding column
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.inline.algorithm-expression= #Inline expression for sharding algorithm

#Hint sharding strategy
sharding.jdbc.config.sharding.tables.<logic-table-name>.database-strategy.hint.algorithm-class-name= #Hint sharding algorithm class name. This class need to implements HintShardingAlgorithm, and require a no argument constructor

#Tables sharding strategy, Same as database- shar-ing strategy
sharding.jdbc.config.sharding.tables.<logic-table-name>.table-strategy.xxx= #Ignore

sharding.jdbc.config.sharding.tables.<logic-table-name>.key-generator-column-name= #Column name of key generator, do not use Key generator if absent
sharding.jdbc.config.sharding.tables.<logic-table-name>.key-generator-class-name= #Key generator, use default key generator if absent. This class need to implements KeyGenerator, and require a no argument constructor

sharding.jdbc.config.sharding.tables.<logic-table-name>.logic-index= #Name if logic index. If use `DROP INDEX XXX` SQL in Oracle/PostgreSQL, This property needs to be set for finding the actual tables

sharding.jdbc.config.sharding.binding-tables[0]= #Binding table rule configurations
sharding.jdbc.config.sharding.binding-tables[1]= #Binding table rule configurations
sharding.jdbc.config.sharding.binding-tables[x]= #Binding table rule configurations

sharding.jdbc.config.sharding.broadcast-tables[0]= #Broadcast table rule configurations
sharding.jdbc.config.sharding.broadcast-tables[1]= #Broadcast table rule configurations
sharding.jdbc.config.sharding.broadcast-tables[x]= #Broadcast table rule configurations

sharding.jdbc.config.sharding.default-data-source-name= #If table not configure at table rule, will route to defaultDataSourceName
sharding.jdbc.config.sharding.default-database-strategy.xxx= #Default strategy for sharding databases, same as databases sharding strategy
sharding.jdbc.config.sharding.default-table-strategy.xxx= #Default strategy for sharding tables, same as tables sharding strategy
sharding.jdbc.config.sharding.default-key-generator-class-name= #Default key generator class name, default value is `io.shardingsphere.core.keygen.DefaultKeyGenerator`. This class need to implements KeyGenerator, and require a no argument constructor

sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.master-data-source-name= #more details can reference readwrite-splitting part
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[0]= #more details can reference readwrite-splitting part
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[1]= #more details can reference readwrite-splitting part
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[x]= #more details can reference readwrite-splitting part
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-class-name= #more details can reference readwrite-splitting part
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-type= #more details can reference readwrite-splitting part
sharding.jdbc.config.config.map.key1= #more details can reference Readwrite-splitting part
sharding.jdbc.config.config.map.key2= #more details can reference Readwrite-splitting part
sharding.jdbc.config.config.map.keyx= #more details can reference Readwrite-splitting part

sharding.jdbc.config.props.sql.show= #To show SQLS or not, default value: false
sharding.jdbc.config.props.executor.size= #The number of working threads, default value: CPU count

sharding.jdbc.config.config.map.key1= #User-defined arguments
sharding.jdbc.config.config.map.key2= #User-defined arguments
sharding.jdbc.config.config.map.keyx= #User-defined arguments
```

### Readwrite-splitting

#### Configuration Item Explanation

```properties
#Ignore data sources configuration, same as sharding

sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.master-data-source-name= #Name of master data source
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[0]=  #Name of master data source
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[1]= #Names of Slave data sources
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.slave-data-source-names[x]= #Names of Slave data sources
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-class-name= #Load balance algorithm class name. This class need to implements MasterSlaveLoadBalanceAlgorithm, and require a no argument constructor
sharding.jdbc.config.sharding.master-slave-rules.<master-slave-data-source-name>.load-balance-algorithm-type= #Load balance algorithm type, values should be: `ROUND_ROBIN` or `RANDOM`. Ignore if `load-balance-algorithm-class-name` is present

sharding.jdbc.config.config.map.key1= #User-defined arguments
sharding.jdbc.config.config.map.key2= #User-defined arguments
sharding.jdbc.config.config.map.keyx= #User-defined arguments

sharding.jdbc.config.props.sql.show= #To show SQLS or not, default value: false
sharding.jdbc.config.props.executor.size= #The number of working threads, default value: CPU count
sharding.jdbc.config.props.check.table.metadata.enabled= #Check the metadata consistency of all the tables, default value: false
```

### Orchestration

#### Configuration Item Explanation

```properties
#Ignore data sources, sharding and readwrite splitting configuration

sharding.jdbc.config.sharding.orchestration.name= #Name of orchestration instance
sharding.jdbc.config.sharding.orchestration.overwrite= #Use local configuration to overwrite registry center or not
sharding.jdbc.config.sharding.orchestration.registry.server-lists= #Rgistry servers list, multiple split as comma. Example: host1:2181,host2:2181
sharding.jdbc.config.sharding.orchestration.registry.namespace= #Namespace of registry
sharding.jdbc.config.sharding.orchestration.registry.digest= #Digest for registry. Default is not need digest.
sharding.jdbc.config.sharding.orchestration.registry.operation-timeout-milliseconds= #Operation timeout time in milliseconds, default value is 500 milliseconds
sharding.jdbc.config.sharding.orchestration.registry.max-retries= #Max number of times to retry, default value is 3
sharding.jdbc.config.sharding.orchestration.registry.retry-interval-milliseconds= #Time interval in milliseconds on each retry, default value is 500 milliseconds
sharding.jdbc.config.sharding.orchestration.registry.time-to-live-seconds= #Time to live in seconds of ephemeral keys, default value is 60 seconds
```

## Shardingsphere-2.x

### Sharding

#### Configuration Item Explanation

```properties
# Ignore data sources configuration
sharding.jdbc.config.sharding.default-data-source-name= #Tables without sharding rules will be located through default data source
sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column= #Name of database sharding column
sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-expression= #Inline expression for database sharding algorithm
sharding.jdbc.config.sharding.tables.t_order.actualDataNodes= #Describe data source names and actual tables, delimiter as point, multiple data nodes separated with comma, support inline expression. Absent means sharding databases only. Example: ds${0..7}.tbl${0..7}
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.shardingColumn= #Name of table sharding column
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.algorithmInlineExpression= #Inline expression for table sharding algorithm
sharding.jdbc.config.sharding.tables.t_order.keyGeneratorColumnName= #Column name of key generator, do not use Key generator if absent

sharding.jdbc.config.sharding.tables.<logic-table-name>.key-generator-column-name= #Column name of key generator, do not use Key generator if absent
sharding.jdbc.config.sharding.tables.<logic-table-name>.key-generator-class-name= #Key generator, use default key generator if absent. This class need to implements KeyGenerator, and require a no argument constructor

```

### Readwrite-splitting

#### Configuration Item Explanation

```properties
# Ignore data sources configuration

sharding.jdbc.config.masterslave.load-balance-algorithm-type= #Load balance algorithm class of slave database; optional value: ROUND_ROBIN and RANDOM; if there is load-balance-algorithm-class-name, the configuration can be omitted
sharding.jdbc.config.masterslave.name= # master name
sharding.jdbc.config.masterslave.master-data-source-name= #Name of master data source
sharding.jdbc.config.masterslave.slave-data-source-names= #Name of master data source
```

### Orchestration

#### Configuration Item Explanation

```properties
# Ignore data sources configuration
sharding.jdbc.config.orchestration.name= #Name of orchestration instance
sharding.jdbc.config.orchestration.overwrite= #Use local configuration to overwrite registry center or not

sharding.jdbc.config.sharding.orchestration.name= #Name of orchestration instance
sharding.jdbc.config.sharding.orchestration.overwrite= #Use local configuration to overwrite registry center or not
sharding.jdbc.config.sharding.orchestration.registry.server-lists= #Rgistry servers list, multiple split as comma. Example: host1:2181,host2:2181
sharding.jdbc.config.sharding.orchestration.registry.namespace= #Namespace of registry
sharding.jdbc.config.sharding.orchestration.registry.digest= #Digest for registry. Default is not need digest.
sharding.jdbc.config.sharding.orchestration.registry.operation-timeout-milliseconds= #Operation timeout time in milliseconds, default value is 500 milliseconds
sharding.jdbc.config.sharding.orchestration.registry.max-retries= #Max number of times to retry, default value is 3
sharding.jdbc.config.sharding.orchestration.registry.retry-interval-milliseconds= #Time interval in milliseconds on each retry, default value is 500 milliseconds
sharding.jdbc.config.sharding.orchestration.registry.time-to-live-seconds= #Time to live in seconds of ephemeral keys, default value is 60 seconds

# The configuration in Zookeeper
sharding.jdbc.config.orchestration.zookeeper.namespace= #Namespace of zookeeper registry
sharding.jdbc.config.orchestration.zookeeper.server-lists= #Zookeeper Rgistry servers list, multiple split as comma. Example: host1:2181,host2:2181

# The configuration in Etcd
sharding.jdbc.config.orchestration.etcd.server-lists= #Etcd Rgistry servers list, multiple split as comma. Example: host1:2181,host2:2181
```


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="user-scalable=yes, width=600" />
    <link href="http://fonts.googleapis.com/css?family=Lato:300,300italic" rel="stylesheet" type="style.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">

    <link rel="stylesheet" href="style.css">

    <title>Euclidean Algorithm</title>

Modular Arithmetic

History of Modular Arithmetic

        Modular arithmetic's foundations were first introduced in the third century BCE by an Greek mathematician named Euclid in the 7th book of his book Elements.

        In Elements (The seventh book), Euclid discusses divisibility, prime numbers, and his algorithm for finding GCDs of large numbers. The book also starts to introduce what we now know as "The fundemental theorum of arithmetic", which in number theory states that every positive number (greater than 1) can be written out as a product of primes in an unique way.

        This new way of finding GCDs, LCMs, and prime number factorization of large numbers was a huge step forward in the world of math and cryptography.

        Modular arithmetic focuses on the quotients and operaters or division operations.
In modular arithmetic, the remainder is especially important when dividing two numbers, and when focusing on the remainder, an operater called the "modulo" operater is used. Mod operaters and moduar arithmetic are used often in cryptography, but we'll get to that later.

Modulo Basics

When dividing numbers, the basic equation outline looks like this:

A ÷ B = Q remainder R

A is the dividend

B is the divisor

Q is the quotient

R is the remainder

        When using the modular operator, we are mainly focusing on the remainder. Using A, B, Q, and R, we can conclude that A ≡ R (mod B) (you would pronounce this "A is equivalent to R, mod B").

        For example:

        16 ÷ 5 = 3 remainder 1, therefore 16 ≡ 1 (mod 5).

One Step Further

        Did you know that not only is 16 ≡ 1 (mod 5) true, but that 16 ≡ 31 (mod 5) as well? How does this work? Well, 31 ÷ 5 has a remainder of 1, and we've established that 16 ÷ 5 also has a remainder of 1, so 16 actually is equivalent to 31, mod 5 (of course)! Even 1 ÷ 5 has a remainder of 1.

        Mod 5 can be thought of as a sort-of circular counting sytem. It goes 0, 1, 2, 3, 4, and then 5, which is actually the same as 0. 1 is the same as 6, 2 is the same as 7, 3 is the same as 8, and 4 is the same as 9. Remember, though, that 5 is just an example; the same concept applies to every single counting number out there.

0

seconds

      <button onclick="startTimer();" id="start-timer" type="button" class="btn btn-primary">Begin solving modular arithmetic problem</button>

Find the greatest common divisor (GCD) of  and .

      Your answer:
      <input type="text" class="form-control" id="answer">

      <button type="button" class="btn btn-primary" onclick="submitAnswer();">Submit answer</button>

Drawing pad

Draw your calculations here.

        Created by GitHub users @eaw20024 and @eaw5117. Used with permission.

Euclidean algorithm

        The answer to the previous problem can be solved very quickly using the Euclidean algorithm.

      Click here

redpajama_set_name: RedPajamaGithub


text:
require "dm-is-friendly/is/friendly"

# Include the plugin in Model
DataMapper::Model.append_extensions(DataMapper::Is::Friendly)


text:
import need from './need'
import once from './once'
import reset from './reset'
import temp from './temp'

export default function install (Vuet) {
  Vuet
    .rule('need', need)
    .rule('once', once)
    .rule('temp', temp)
    .rule('reset', reset)
}


text:
package machinelearning.general.lossfunction;

public abstract class BinaryLossFunction extends LossFunction<Boolean> {

    @Override
    public double lossFunctionValue(Boolean predictionValue, Boolean realityValue) {
        if(!predictionValue.equals(realityValue))
            return getValue(0);
        else
            return getValue(1);
    }

    public abstract double getValue(double value);
}


text:
<?php

namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;

use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;

/**
 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
 *
 * @internal
 */
class MarkdownDescriptor extends Descriptor
{
    /**
     * {@inheritdoc}
     */
    protected function describeRouteCollection(RouteCollection $routes, array $options = array())
    {
        $first = true;
        foreach ($routes->all() as $name => $route) {
            if ($first) {
                $first = false;
            } else {
                $this->write("\n\n");
            }
            $this->describeRoute($route, array('name' => $name));
        }
        $this->write("\n");
    }

    /**
     * {@inheritdoc}
     */
    protected function describeRoute(Route $route, array $options = array())
    {
        $output = '- Path: '.$route->getPath()
            ."\n".'- Path Regex: '.$route->compile()->getRegex()
            ."\n".'- Host: '.('' !== $route->getHost() ? $route->getHost() : 'ANY')
            ."\n".'- Host Regex: '.('' !== $route->getHost() ? $route->compile()->getHostRegex() : '')
            ."\n".'- Scheme: '.($route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY')
            ."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
            ."\n".'- Class: '.get_class($route)
            ."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
            ."\n".'- Requirements: '.($route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM')
            ."\n".'- Options: '.$this->formatRouterConfig($route->getOptions());

        $this->write(isset($options['name'])
            ? $options['name']."\n".str_repeat('-', strlen($options['name']))."\n\n".$output
            : $output);
        $this->write("\n");
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerParameters(ParameterBag $parameters, array $options = array())
    {
        $this->write("Container parameters\n====================\n");
        foreach ($this->sortParameters($parameters) as $key => $value) {
            $this->write(sprintf("\n- `%s`: `%s`", $key, $this->formatParameter($value)));
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerTags(ContainerBuilder $builder, array $options = array())
    {
        $showPrivate = isset($options['show_private']) && $options['show_private'];
        $this->write("Container tags\n==============");

        foreach ($this->findDefinitionsByTag($builder, $showPrivate) as $tag => $definitions) {
            $this->write("\n\n".$tag."\n".str_repeat('-', strlen($tag)));
            foreach ($definitions as $serviceId => $definition) {
                $this->write("\n\n");
                $this->describeContainerDefinition($definition, array('omit_tags' => true, 'id' => $serviceId));
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerService($service, array $options = array())
    {
        if (!isset($options['id'])) {
            throw new \InvalidArgumentException('An "id" option must be provided.');
        }

        $childOptions = array('id' => $options['id'], 'as_array' => true);

        if ($service instanceof Alias) {
            $this->describeContainerAlias($service, $childOptions);
        } elseif ($service instanceof Definition) {
            $this->describeContainerDefinition($service, $childOptions);
        } else {
            $this->write(sprintf('**`%s`:** `%s`', $options['id'], get_class($service)));
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerServices(ContainerBuilder $builder, array $options = array())
    {
        $showPrivate = isset($options['show_private']) && $options['show_private'];

        $title = $showPrivate ? 'Public and private services' : 'Public services';
        if (isset($options['tag'])) {
            $title .= ' with tag `'.$options['tag'].'`';
        }
        $this->write($title."\n".str_repeat('=', strlen($title)));

        $serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds();
        $showPrivate = isset($options['show_private']) && $options['show_private'];
        $services = array('definitions' => array(), 'aliases' => array(), 'services' => array());

        foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
            $service = $this->resolveServiceDefinition($builder, $serviceId);

            if ($service instanceof Alias) {
                $services['aliases'][$serviceId] = $service;
            } elseif ($service instanceof Definition) {
                if (($showPrivate || $service->isPublic())) {
                    $services['definitions'][$serviceId] = $service;
                }
            } else {
                $services['services'][$serviceId] = $service;
            }
        }

        if (!empty($services['definitions'])) {
            $this->write("\n\nDefinitions\n-----------\n");
            foreach ($services['definitions'] as $id => $service) {
                $this->write("\n");
                $this->describeContainerDefinition($service, array('id' => $id));
            }
        }

        if (!empty($services['aliases'])) {
            $this->write("\n\nAliases\n-------\n");
            foreach ($services['aliases'] as $id => $service) {
                $this->write("\n");
                $this->describeContainerAlias($service, array('id' => $id));
            }
        }

        if (!empty($services['services'])) {
            $this->write("\n\nServices\n--------\n");
            foreach ($services['services'] as $id => $service) {
                $this->write("\n");
                $this->write(sprintf('- `%s`: `%s`', $id, get_class($service)));
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerDefinition(Definition $definition, array $options = array())
    {
        $output = '- Class: `'.$definition->getClass().'`'
            ."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no')
            ."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no')
            ."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
        ;

        if (method_exists($definition, 'isShared')) {
            $output .= "\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no');
        }

        $output .= "\n".'- Abstract: '.($definition->isAbstract() ? 'yes' : 'no');

        if (method_exists($definition, 'isAutowired')) {
            $output .= "\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no');

            foreach ($definition->getAutowiringTypes() as $autowiringType) {
                $output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
            }
        }

        if ($definition->getFile()) {
            $output .= "\n".'- File: `'.$definition->getFile().'`';
        }

        if ($factory = $definition->getFactory()) {
            if (is_array($factory)) {
                if ($factory[0] instanceof Reference) {
                    $output .= "\n".'- Factory Service: `'.$factory[0].'`';
                } elseif ($factory[0] instanceof Definition) {
                    throw new \InvalidArgumentException('Factory is not describable.');
                } else {
                    $output .= "\n".'- Factory Class: `'.$factory[0].'`';
                }
                $output .= "\n".'- Factory Method: `'.$factory[1].'`';
            } else {
                $output .= "\n".'- Factory Function: `'.$factory.'`';
            }
        }

        $calls = $definition->getMethodCalls();
        foreach ($calls as $callData) {
            $output .= "\n".'- Call: `'.$callData[0].'`';
        }

        if (!(isset($options['omit_tags']) && $options['omit_tags'])) {
            foreach ($definition->getTags() as $tagName => $tagData) {
                foreach ($tagData as $parameters) {
                    $output .= "\n".'- Tag: `'.$tagName.'`';
                    foreach ($parameters as $name => $value) {
                        $output .= "\n".'    - '.ucfirst($name).': '.$value;
                    }
                }
            }
        }

        $this->write(isset($options['id']) ? sprintf("%s\n%s\n\n%s\n", $options['id'], str_repeat('~', strlen($options['id'])), $output) : $output);
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerAlias(Alias $alias, array $options = array())
    {
        $output = '- Service: `'.$alias.'`'
            ."\n".'- Public: '.($alias->isPublic() ? 'yes' : 'no');

        $this->write(isset($options['id']) ? sprintf("%s\n%s\n\n%s\n", $options['id'], str_repeat('~', strlen($options['id'])), $output) : $output);
    }

    /**
     * {@inheritdoc}
     */
    protected function describeContainerParameter($parameter, array $options = array())
    {
        $this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', strlen($options['parameter'])), $this->formatParameter($parameter)) : $parameter);
    }

    /**
     * {@inheritdoc}
     */
    protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = array())
    {
        $event = array_key_exists('event', $options) ? $options['event'] : null;

        $title = 'Registered listeners';
        if (null !== $event) {
            $title .= sprintf(' for event `%s` ordered by descending priority', $event);
        }

        $this->write(sprintf('# %s', $title)."\n");

        $registeredListeners = $eventDispatcher->getListeners($event);
        if (null !== $event) {
            foreach ($registeredListeners as $order => $listener) {
                $this->write("\n".sprintf('## Listener %d', $order + 1)."\n");
                $this->describeCallable($listener);
                $this->write(sprintf('- Priority: `%d`', $eventDispatcher->getListenerPriority($event, $listener))."\n");
            }
        } else {
            ksort($registeredListeners);

            foreach ($registeredListeners as $eventListened => $eventListeners) {
                $this->write("\n".sprintf('## %s', $eventListened)."\n");

                foreach ($eventListeners as $order => $eventListener) {
                    $this->write("\n".sprintf('### Listener %d', $order + 1)."\n");
                    $this->describeCallable($eventListener);
                    $this->write(sprintf('- Priority: `%d`', $eventDispatcher->getListenerPriority($eventListened, $eventListener))."\n");
                }
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function describeCallable($callable, array $options = array())
    {
        $string = '';

        if (is_array($callable)) {
            $string .= "\n- Type: `function`";

            if (is_object($callable[0])) {
                $string .= "\n".sprintf('- Name: `%s`', $callable[1]);
                $string .= "\n".sprintf('- Class: `%s`', get_class($callable[0]));
            } else {
                if (0 !== strpos($callable[1], 'parent::')) {
                    $string .= "\n".sprintf('- Name: `%s`', $callable[1]);
                    $string .= "\n".sprintf('- Class: `%s`', $callable[0]);
                    $string .= "\n- Static: yes";
                } else {
                    $string .= "\n".sprintf('- Name: `%s`', substr($callable[1], 8));
                    $string .= "\n".sprintf('- Class: `%s`', $callable[0]);
                    $string .= "\n- Static: yes";
                    $string .= "\n- Parent: yes";
                }
            }

            return $this->write($string."\n");
        }

        if (is_string($callable)) {
            $string .= "\n- Type: `function`";

            if (false === strpos($callable, '::')) {
                $string .= "\n".sprintf('- Name: `%s`', $callable);
            } else {
                $callableParts = explode('::', $callable);

                $string .= "\n".sprintf('- Name: `%s`', $callableParts[1]);
                $string .= "\n".sprintf('- Class: `%s`', $callableParts[0]);
                $string .= "\n- Static: yes";
            }

            return $this->write($string."\n");
        }

        if ($callable instanceof \Closure) {
            $string .= "\n- Type: `closure`";

            return $this->write($string."\n");
        }

        if (method_exists($callable, '__invoke')) {
            $string .= "\n- Type: `object`";
            $string .= "\n".sprintf('- Name: `%s`', get_class($callable));

            return $this->write($string."\n");
        }

        throw new \InvalidArgumentException('Callable is not describable.');
    }

    /**
     * @param array $array
     *
     * @return string
     */
    private function formatRouterConfig(array $array)
    {
        if (!count($array)) {
            return 'NONE';
        }

        $string = '';
        ksort($array);
        foreach ($array as $name => $value) {
            $string .= "\n".'    - `'.$name.'`: '.$this->formatValue($value);
        }

        return $string;
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.CodeAnalysis.Internal.Log
{
    /// <summary>
    /// Defines logging severity levels. Each logger may choose to report differently based on the level of the message being logged.
    ///
    /// Copied from Microsoft.Extensions.Logging https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel
    ///
    /// </summary>
    internal enum LogLevel
    {
        /// <summary>
        /// Logs that contain the most detailed messages. These messages may contain sensitive application data. These messages are disabled by default and should never be enabled in a production environment.
        /// </summary>
        Trace = 0,

        /// <summary>
        /// Logs that are used for interactive investigation during development. These logs should primarily contain information useful for debugging and have no long-term value.
        /// </summary>
        Debug = 1,

        /// <summary>
        /// Logs that track the general flow of the application. These logs should have long-term value.
        /// </summary>
        Information = 2,

        /// <summary>
        /// Logs that highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop.
        /// </summary>
        Warning = 3,

        /// <summary>
        /// Logs that highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure.
        /// </summary>
        Error = 4,

        /// <summary>
        /// Logs that describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention.
        /// </summary>
        Critical = 5,

        /// <summary>
        /// Not used for writing log messages. Specifies that a logging category should not write any messages.
        /// </summary>
        None = 6
    }
}


text:
<?php
include("database.php");

session_start();

//echo var_dump($_SESSION);

if ( $_SESSION["email"] != null
    && $_SESSION["username"]!= null) {

  	$email = $_SESSION["email"];
  	$pdo = new PDO($database_conexao, $database_username, $database_senha);

    if (!getSemaforoProfessor($email, $pdo)) {
  		echo "Aguarde o professor liberar o experimento";
  	} else if (!getSemaforoGrupo($email, $pdo)) {
  		echo "Aguarde os demais alunos do grupo iniciarem Randori";
  	} else {

      if(setPiloto($email, $pdo));
      else if (setCopiloto($email, $pdo));
 		  //else
  	 echo "randori-oficial.php";
    }
} else {
    header("location:login.php");
}

function setPiloto($email, $pdo) {
  $query = "SELECT * FROM grupo_randori WHERE grupo_randori.nome = (SELECT user.fk_grupo_randori FROM user WHERE EMAIL=:email)";

  $statement = $pdo->prepare($query);
  $statement->bindValue(":email",$email);
  $statement->execute();
  $grupo = $statement->fetch(\PDO::FETCH_ASSOC);

  if ($grupo["piloto"] == NULL && $grupo["copiloto"] == NULL) {
    $query = "SELECT * FROM user WHERE user.fk_grupo_randori = :grupo AND flag_piloto = 0 ORDER BY user.username ASC";
    $statement = $pdo->prepare($query);
    $statement->bindValue(":grupo",$grupo["nome"]);
    $statement->execute();
    $user = $statement->fetch(\PDO::FETCH_ASSOC);
    if ($user["flag_piloto"] == 0){

      date_default_timezone_set('America/Manaus');
      $date = date('Y-m-d H:i:s');

      $query = "UPDATE grupo_randori SET piloto = :email, tempo = :data  WHERE nome = :nome_grupo";
      $statement = $pdo->prepare($query);
      $statement->bindValue(":email",$user["email"]);
      $statement->bindValue(":nome_grupo",$grupo["nome"]);
      $statement->bindValue(":data",$date);
      $statement->execute();

      $query = "UPDATE user SET flag_piloto = 1 WHERE email = :email";
      $statement = $pdo->prepare($query);
      $statement->bindValue(":email",$user["email"]);
      $statement->execute();
      return True;
    }
    return False;
  }
  else return False;
}

function setCopiloto($email, $pdo) {
  $query = "SELECT * FROM grupo_randori WHERE grupo_randori.nome = (SELECT user.fk_grupo_randori FROM user WHERE EMAIL=:email)";

  $statement = $pdo->prepare($query);
  $statement->bindValue(":email",$email);
  $statement->execute();
  $grupo = $statement->fetch(\PDO::FETCH_ASSOC);

  if ($grupo["copiloto"] == NULL) {
    $query = "SELECT * FROM user WHERE user.fk_grupo_randori = :grupo AND flag_piloto = 0 AND flag_copiloto = 0 ORDER BY user.username ASC";
    $statement = $pdo->prepare($query);
    $statement->bindValue(":grupo",$grupo["nome"]);
    $statement->execute();
    $user = $statement->fetch(\PDO::FETCH_ASSOC);
    if ($user["flag_copiloto"] == 0){
      $query = "UPDATE grupo_randori SET copiloto = :email WHERE nome = :nome_grupo";
      $statement = $pdo->prepare($query);
      $statement->bindValue(":email",$user["email"]);
      $statement->bindValue(":nome_grupo",$grupo["nome"]);
      $statement->execute();

      $query = "UPDATE user SET flag_copiloto = 1 WHERE email = :email";
      $statement = $pdo->prepare($query);
      $statement->bindValue(":email",$user["email"]);
      $statement->execute();
      return True;
    }
    return False;
  }
  else return False;
}

function getSemaforoProfessor($email, $pdo) {
  $query = "SELECT * FROM experimento WHERE id_experimento=1";

  $statement = $pdo->prepare($query);
  $statement->execute();
  $experimento = $statement->fetch(\PDO::FETCH_ASSOC);
	if ($experimento["randori_semaforo"] == 1)
    return True;
  else return False;
}

function getSemaforoGrupo($email, $pdo) {

  $query = "SELECT * FROM user WHERE user.fk_grupo_randori = (SELECT user.fk_grupo_randori FROM user WHERE EMAIL=:email)";

  $statement = $pdo->prepare($query);
  $statement->bindValue(":email",$email);
  $statement->execute();

  //$user = $statement->fetch(\PDO::FETCH_ASSOC);
  while ($user = $statement->fetch(\PDO::FETCH_ASSOC)) {
    $_SESSION["grupo"] = $user["fk_grupo_randori"];
    if ($user["randori_semaforo"] == 0)
      return False;
  }
	return True;
}
?>


text:
(function() {
  var $, $$, cloneContents, el, getContents, hofOf, hofOver, i, j, len, len1, ref, ref1;

  $ = document.querySelector.bind(document);

  $$ = document.querySelectorAll.bind(document);

  getContents = function(el) {
    var range;
    range = document.createRange();
    range.selectNodeContents(el);
    return range.extractContents();
  };

  cloneContents = function(el) {
    var range;
    range = document.createRange();
    range.selectNodeContents(el);
    return range.cloneContents();
  };

  hofOf = function(el) {
    var contents, field, listener;
    field = el.getAttribute('field');
    contents = getContents(el);
    el.innerHTML = field;
    listener = function() {
      return el.parentNode.replaceChild(contents, el);
    };
    return el.addEventListener('click', listener);
  };

  hofOver = function(el) {
    var definitions, expandAll, fn, hof, hofOpener, hout, i, j, l, len, len1, len2, len3, m, names, outputs, ref, ref1, ref2, ref3, t, updateOutputs;
    definitions = {};
    ref = el.querySelectorAll('hof-of');
    for (i = 0, len = ref.length; i < len; i++) {
      hof = ref[i];
      definitions[hof.getAttribute('field')] = cloneContents(hof);
    }
    names = {};
    ref1 = el.querySelectorAll('hof-on');
    for (j = 0, len1 = ref1.length; j < len1; j++) {
      t = ref1[j];
      names[t.innerHTML] = true;
    }
    outputs = [];
    ref2 = el.querySelectorAll('hof-output');
    fn = function(hout) {
      var fun;
      fun = new Function(Object.keys(names), 'return ' + hout.getAttribute('function'));
      return outputs.push(function(counts) {
        return hout.innerHTML = fun.apply(null, counts);
      });
    };
    for (l = 0, len2 = ref2.length; l < len2; l++) {
      hout = ref2[l];
      fn(hout);
    }
    updateOutputs = function() {
      var counts, countsList, hon, k, key, len3, len4, len5, m, n, o, out, ref3, ref4, results, v;
      counts = {};
      for (k in names) {
        counts[k] = 0;
      }
      ref3 = el.querySelectorAll('hof-on');
      for (m = 0, len3 = ref3.length; m < len3; m++) {
        hon = ref3[m];
        key = hon.innerHTML;
        if (counts[key] != null) {
          counts[key]++;
        }
      }
      ref4 = el.querySelectorAll('hof-of');
      for (n = 0, len4 = ref4.length; n < len4; n++) {
        hof = ref4[n];
        key = hof.getAttribute('field');
        if (counts[key]) {
          counts[key]++;
        }
      }
      countsList = (function() {
        var results;
        results = [];
        for (k in counts) {
          v = counts[k];
          results.push(v);
        }
        return results;
      })();
      results = [];
      for (o = 0, len5 = outputs.length; o < len5; o++) {
        out = outputs[o];
        results.push(out(countsList));
      }
      return results;
    };
    setTimeout(updateOutputs, 0);
    expandAll = function() {
      var hofs, len3, m, replacement;
      hofs = el.querySelectorAll('hof-of');
      if (hofs.length === 0) {
        return;
      }
      for (m = 0, len3 = hofs.length; m < len3; m++) {
        hof = hofs[m];
        if (replacement = definitions[hof.getAttribute('field')]) {
          hof.parentNode.replaceChild(replacement.cloneNode(true), hof);
        }
      }
      return expandAll();
    };
    ref3 = el.querySelectorAll('hof-open-full');
    for (m = 0, len3 = ref3.length; m < len3; m++) {
      hofOpener = ref3[m];
      hofOpener.addEventListener('click', expandAll);
    }
    return el.addEventListener('click', function(ev) {
      var clone, len4, len5, len6, n, newel, o, oldel, p, ref4, ref5, ref6, replacement, results, subEl;
      updateOutputs();
      if (el.querySelector('hof-of')) {
        return;
      }
      if (el.hasAttribute('factory')) {
        clone = el.cloneNode(true);
        ref4 = clone.querySelectorAll('hof-open-full');
        for (n = 0, len4 = ref4.length; n < len4; n++) {
          subEl = ref4[n];
          subEl.remove();
        }
        el.parentNode.insertBefore(clone, el);
      }
      ref5 = el.querySelectorAll('hof-on');
      results = [];
      for (o = 0, len5 = ref5.length; o < len5; o++) {
        oldel = ref5[o];
        if (replacement = definitions[oldel.innerHTML]) {
          newel = document.createElement('hof-of');
          newel.setAttribute('field', oldel.innerHTML);
          newel.appendChild(replacement.cloneNode(true));
          ref6 = newel.querySelectorAll('hof-of');
          for (p = 0, len6 = ref6.length; p < len6; p++) {
            subEl = ref6[p];
            hofOf(subEl);
          }
          hofOf(newel);
          results.push(oldel.parentNode.replaceChild(newel, oldel));
        } else {
          results.push(void 0);
        }
      }
      return results;
    });
  };

  ref = $$('hof-over');
  for (i = 0, len = ref.length; i < len; i++) {
    el = ref[i];
    hofOver(el);
  }

  ref1 = $$('hof-of');
  for (j = 0, len1 = ref1.length; j < len1; j++) {
    el = ref1[j];
    hofOf(el);
  }

}).call(this);


text:
package com.hotels.bdp.waggledance.server.security;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import com.hotels.bdp.waggledance.api.federation.service.FederationService;
import com.hotels.bdp.waggledance.api.model.PrimaryMetaStore;

@RunWith(MockitoJUnitRunner.class)
public class ReadWriteCreateAccessControlHandlerTest {

  private ReadWriteCreateAccessControlHandler handler;
  private @Mock PrimaryMetaStore primaryMetaStore;
  private @Mock FederationService federationService;
  private @Captor ArgumentCaptor<PrimaryMetaStore> captor;
  private String database = "database";

  @Before
  public void setUp() {
    handler = new ReadWriteCreateAccessControlHandler(primaryMetaStore, federationService);
  }

  @Test
  public void hasWritePermission() {
    assertTrue(handler.hasWritePermission("db"));
    assertTrue(handler.hasWritePermission(null));
  }

  @Test
  public void hasCreatePermission() {
    assertTrue(handler.hasCreatePermission());
  }

  @Test
  public void databaseCreatedNotificationPrimaryNoMapped() {
    handler.databaseCreatedNotification(database);

    verify(federationService).update(eq(primaryMetaStore), captor.capture());
    PrimaryMetaStore newPrimaryMetaStore = captor.getValue();
    assertThat(newPrimaryMetaStore.getMappedDatabases().size(), is(1));
    assertThat(newPrimaryMetaStore.getMappedDatabases().get(0), is(database));
  }

  @Test
  public void databaseCreatedNotificationPrimaryHasEmptyMapped() {
    when(primaryMetaStore.getMappedDatabases()).thenReturn(Collections.emptyList());
    handler.databaseCreatedNotification(database);

    verify(federationService).update(eq(primaryMetaStore), captor.capture());
    PrimaryMetaStore newPrimaryMetaStore = captor.getValue();
    assertThat(newPrimaryMetaStore.getMappedDatabases().size(), is(1));
    assertThat(newPrimaryMetaStore.getMappedDatabases().get(0), is(database));
  }

  @Test
  public void databaseCreatedNotificationPrimaryHasNonEmptyMapped() {
    List<String> mappedDatabases = Arrays.asList("db1", "db2", "db3");
    when(primaryMetaStore.getMappedDatabases()).thenReturn(mappedDatabases);
    handler.databaseCreatedNotification(database);

    verify(federationService).update(eq(primaryMetaStore), captor.capture());
    PrimaryMetaStore newPrimaryMetaStore = captor.getValue();
    assertThat(newPrimaryMetaStore.getMappedDatabases().size(), is(mappedDatabases.size() + 1));
    assertThat(newPrimaryMetaStore.getMappedDatabases().get(mappedDatabases.size()), is(database));
  }

}


text:
/**
 * Temporary - The lord of tmp.
 *
 * Author: Veselin Todorov <hi@vesln.com>
 * Licensed under the MIT License.
 */

/**
 * Dependencies.
 */
var fs = require('fs');
var path = require('path');
var generator = require('./generator');
var detector = require('./detector');
var Base = require('./base');

/**
 * File constructor.
 *
 * @param {String|null} name
 */
function File(name) {
  this.init(name);
};

/**
 * File extends from tmp.
 */
File.prototype.__proto__ = Base.prototype;

/**
 * Creates new file.
 *
 * @param {String} filename
 */
File.prototype.create = function(filename) {
  return fs.writeFileSync(path.normalize(filename), '');
};

/**
 * Asynchronously reads the entire contents of a file.
 */
File.prototype.readFile = function() {
  fs.readFile.apply(fs, this.prepareArgs(arguments));
};

/**
 * Synchronous read.
 */
File.prototype.readFileSync = function() {
  return fs.readFileSync.apply(fs, this.prepareArgs(arguments));
};

/**
 * Asynchronously writes data to a file.
 */
File.prototype.writeFile = function() {
  fs.writeFile.apply(fs, this.prepareArgs(arguments));
};

/**
 * Synchronous writes data to a file.
 */
File.prototype.writeFileSync = function() {
  return fs.writeFileSync.apply(fs, this.prepareArgs(arguments));
};

/**
 * Asynchronous file open.
 */
File.prototype.open = function() {
  fs.open.apply(fs, this.prepareArgs(arguments));
};

/**
 * Synchronous open.
 */
File.prototype.openSync = function() {
  return fs.openSync.apply(fs, this.prepareArgs(arguments));
};

/**
 * Asynchronous close.
 */
File.prototype.close = function() {
  fs.close.apply(fs, Array.prototype.slice.call(arguments));
};

/**
 * Synchronous close.
 */
File.prototype.closeSync = function() {
  return fs.closeSync.apply(fs, Array.prototype.slice.call(arguments));
};

/**
 * Asynchronous unlink.
 */
File.prototype.unlink = function() {
  fs.unlink.apply(fs, this.prepareArgs(arguments));
};

/**
 * Synchronous unlink.
 */
File.prototype.unlinkSync = function() {
  return fs.unlinkSync.apply(fs, this.prepareArgs(arguments));
};

/**
 * Exporting the lib.
 */
module.exports = File;


text:
class PageRankReduceFunction : public ReduceFunction {
public:
  void reduce(
    const uint8_t* key, uint64_t keyLength, KVPairIterator& iterator,
    KVPairWriterInterface& writer);
};

#endif // MAPRED_PAGE_RANK_REDUCE_FUNCTION_H


text:
package steps

import (
	"github.com/bitrise-io/bitrise-yml-converter/utils"
	bitriseModels "github.com/bitrise-io/bitrise/models"
	stepmanModels "github.com/bitrise-io/stepman/models"
)

const (
	// OldFtpUploadStepID ...
	OldFtpUploadStepID = "ftp-upload"
	// NewFtpUploadStepID ...
	NewFtpUploadStepID = "ftp-upload"
)

//----------------------
// old name: amazon-s3-uploader
// new name: amazon-s3-upload

/*
old version source: https://github.com/bitrise-io/steps-ftp-upload.git

inputs:
- FTP_HOSTNAME
- FTP_USERNAME
- FTP_PASSWORD
- FTP_UPLOAD_SOURCE_PATH
- FTP_UPLOAD_TARGET_PATH
*/

/*
new version source: https://github.com/bitrise-io/steps-ftp-upload.git

inputs:
- hostname
- username
- password
- upload_source_path
- upload_target_path
*/

// ConvertFtpUpload ...
func ConvertFtpUpload(convertedWorkflowStep stepmanModels.StepModel) ([]bitriseModels.StepListItemModel, error) {
	newStepID := NewFtpUploadStepID
	inputConversionMap := map[string]string{
		"hostname":           "FTP_HOSTNAME",
		"username":           "FTP_USERNAME",
		"password":           "FTP_PASSWORD",
		"upload_source_path": "FTP_UPLOAD_SOURCE_PATH",
		"upload_target_path": "FTP_UPLOAD_TARGET_PATH",
	}

	return utils.ConvertStepAndCreateStepListItem(convertedWorkflowStep, newStepID, inputConversionMap)
}


text:
package headfirst.designpatterns.decorator.starbuzz;

public abstract class CondimentDecorator extends Beverage {
	public abstract String getDescription();
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

'use strict';

var util = require('util');
var msRest = require('ms-rest');
var msRestAzure = require('ms-rest-azure');
var ServiceClient = msRest.ServiceClient;
var WebResource = msRest.WebResource;

var models = require('../models');

/**
 * @class
 * HttpSuccess
 * __NOTE__: An instance of this class is automatically created for an
 * instance of the AutoRestHeadTestService.
 * Initializes a new instance of the HttpSuccess class.
 * @constructor
 *
 * @param {AutoRestHeadTestService} client Reference to the service client.
 */
function HttpSuccess(client) {
  this.client = client;
}

/**
 * Return 204 status code if successful
 * @param {object} [options]
 *
 * @param {object} [options.customHeaders] headers that will be added to
 * request
 *
 * @param {function} callback
 *
 * @returns {Stream} The Response stream
 */
HttpSuccess.prototype.head204 = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  var requestUrl = this.client.baseUri +
                   '//http/success/204';
  var queryParameters = [];
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }
  // trim all duplicate forward slashes in the url
  var regex = /([^:]\/)\/+/gi;
  requestUrl = requestUrl.replace(regex, '$1');

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'HEAD';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  if (this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  httpRequest.body = null;
  httpRequest.headers['Content-Length'] = 0;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 204 && statusCode !== 404) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = httpRequest;
      error.response = response;
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        error.body = parsedErrorResponse;
        if (error.body !== null && error.body !== undefined) {
          error.body = client._models['CloudError'].deserialize(error.body);
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody - "%s" for the default response.', defaultError, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = new msRest.HttpOperationResponse();
    result.request = httpRequest;
    result.response = response;
    if (responseBody === '') responseBody = null;
    result.body = (statusCode === 204);
    result.requestId = response.headers['x-ms-request-id'];

    return callback(null, result);
  });
};

/**
 * Return 404 status code if successful
 * @param {object} [options]
 *
 * @param {object} [options.customHeaders] headers that will be added to
 * request
 *
 * @param {function} callback
 *
 * @returns {Stream} The Response stream
 */
HttpSuccess.prototype.head404 = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  var requestUrl = this.client.baseUri +
                   '//http/success/404';
  var queryParameters = [];
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }
  // trim all duplicate forward slashes in the url
  var regex = /([^:]\/)\/+/gi;
  requestUrl = requestUrl.replace(regex, '$1');

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'HEAD';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  if (this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  httpRequest.body = null;
  httpRequest.headers['Content-Length'] = 0;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 204 && statusCode !== 404) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = httpRequest;
      error.response = response;
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        error.body = parsedErrorResponse;
        if (error.body !== null && error.body !== undefined) {
          error.body = client._models['CloudError'].deserialize(error.body);
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody - "%s" for the default response.', defaultError, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = new msRest.HttpOperationResponse();
    result.request = httpRequest;
    result.response = response;
    if (responseBody === '') responseBody = null;
    result.body = (statusCode === 204);
    result.requestId = response.headers['x-ms-request-id'];

    return callback(null, result);
  });
};

module.exports = HttpSuccess;


text:
<?php

/**
 * Skeleton subclass for performing query and update operations on the 'template' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.pan
 */
class Pan_Db_TemplatePeer extends Pan_Db_Propel_TemplatePeer {

	public static function retrieveByPath($path) {

		$pieces = explode('/', $path);

		Pan :: $logger->log('pieces : ' . print_r($pieces, 1));

		$templateName = array_pop($pieces);

		array_shift($pieces);

		$level = count($pieces);
		$name = array_pop($pieces);

		if ($level > 0) {
			Pan :: $logger->log("Looking for dir $name at level $level");
			// Several dirs with the same name can be at the same level !
			$directories = Pan_Db_TemplateDirectoryQuery :: create()
				->filterByNodeLevel($level)
				->filterByName($name)
				->find()
				;
		} else {
			$directories = array(Pan_Db_TemplateDirectoryQuery :: create()->findRoot());
		}

		foreach ($directories as $directory) {

			$templateQuery = Pan_Db_TemplateQuery :: create()
				->filterByIdTemplateDirectory($directory->getIdTemplateDirectory())
				->filterByName($templateName)
				;

			if ($template = $templateQuery->findOne()) {
				return $template;
			}
		}

		return null;

	}

} // Pan_Db_TemplatePeer


text:
package com.jagex.runescape;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

final class RSSocket implements Runnable {

    private final InputStream inputStream;

    private final OutputStream outputStream;

    private final Socket socket;

    private boolean closed;

    private final RSApplet rsApplet;

    private byte[] buffer;

    private int writeIndex;

    private int buffIndex;

    private boolean isWriter;
    private boolean hasIOError;

    public RSSocket(final RSApplet RSApplet_, final Socket socket1) throws IOException {
        this.closed = false;
        this.isWriter = false;
        this.hasIOError = false;
        this.rsApplet = RSApplet_;
        this.socket = socket1;
        this.socket.setSoTimeout(30000);
        this.socket.setTcpNoDelay(true);
        this.inputStream = this.socket.getInputStream();
        this.outputStream = this.socket.getOutputStream();
    }

    public int available() throws IOException {
        if (this.closed) {
            return 0;
        } else {
            return this.inputStream.available();
        }
    }

    public void close() {
        this.closed = true;
        try {
            if (this.inputStream != null) {
                this.inputStream.close();
            }
            if (this.outputStream != null) {
                this.outputStream.close();
            }
            if (this.socket != null) {
                this.socket.close();
            }
        } catch (final IOException _ex) {
            System.out.println("Error closing stream");
        }
        this.isWriter = false;
        synchronized (this) {
            this.notify();
        }
        this.buffer = null;
    }

    public void printDebug() {
        System.out.println("dummy:" + this.closed);
        System.out.println("tcycl:" + this.writeIndex);
        System.out.println("tnum:" + this.buffIndex);
        System.out.println("writer:" + this.isWriter);
        System.out.println("ioerror:" + this.hasIOError);
        try {
            System.out.println("available:" + this.available());
        } catch (final IOException _ex) {
        }
    }

    public int read() throws IOException {
        if (this.closed) {
            return 0;
        } else {
            return this.inputStream.read();
        }
    }

    public void read(final byte[] abyte0, int j) throws IOException {
        int i = 0;// was parameter
        if (this.closed) {
            return;
        }
        int k;
        for (; j > 0; j -= k) {
            k = this.inputStream.read(abyte0, i, j);
            if (k <= 0) {
                throw new IOException("EOF");
            }
            i += k;
        }

    }

    @Override
    public void run() {
        while (this.isWriter) {
            final int i;
            final int j;
            synchronized (this) {
                if (this.buffIndex == this.writeIndex) {
                    try {
                        this.wait();
                    } catch (final InterruptedException _ex) {
                    }
                }
                if (!this.isWriter) {
                    return;
                }
                j = this.writeIndex;
                if (this.buffIndex >= this.writeIndex) {
                    i = this.buffIndex - this.writeIndex;
                } else {
                    i = 5000 - this.writeIndex;
                }
            }
            if (i > 0) {
                try {
                    this.outputStream.write(this.buffer, j, i);
                } catch (final IOException _ex) {
                    this.hasIOError = true;
                }
                this.writeIndex = (this.writeIndex + i) % 5000;
                try {
                    if (this.buffIndex == this.writeIndex) {
                        this.outputStream.flush();
                    }
                } catch (final IOException _ex) {
                    this.hasIOError = true;
                }
            }
        }
    }

    public void write(final int i, final byte[] abyte0) throws IOException {
        if (this.closed) {
            return;
        }
        if (this.hasIOError) {
            this.hasIOError = false;
            throw new IOException("Error in writer thread");
        }
        if (this.buffer == null) {
            this.buffer = new byte[5000];
        }
        synchronized (this) {
            for (int l = 0; l < i; l++) {
                this.buffer[this.buffIndex] = abyte0[l];
                this.buffIndex = (this.buffIndex + 1) % 5000;
                if (this.buffIndex == (this.writeIndex + 4900) % 5000) {
                    throw new IOException("buffer overflow");
                }
            }

            if (!this.isWriter) {
                this.isWriter = true;
                this.rsApplet.startRunnable(this, 3);
            }
            this.notify();
        }
    }
}


text:
using PcapDotNet.Base;
using PcapDotNet.Packets.IpV4;

namespace PcapDotNet.Packets.IpV6
{
    /// <summary>
    /// RFC 6275.
    /// <pre>
    /// +-----+-------------+-------------------------+
    /// | Bit | 0-7         | 8-15                    |
    /// +-----+-------------+-------------------------+
    /// | 0   | Next Header | Header Extension Length |
    /// +-----+-------------+-------------------------+
    /// | 16  | MH Type     | Reserved                |
    /// +-----+-------------+-------------------------+
    /// | 32  | Checksum                              |
    /// +-----+---------------------------------------+
    /// | 48  | Home Nonce Index                      |
    /// +-----+---------------------------------------+
    /// | 64  | Home Init Cookie                      |
    /// |     |                                       |
    /// |     |                                       |
    /// |     |                                       |
    /// +-----+---------------------------------------+
    /// | 128 | Home Keygen Token                     |
    /// |     |                                       |
    /// |     |                                       |
    /// |     |                                       |
    /// +-----+---------------------------------------+
    /// | 192 | Mobility Options                      |
    /// | ... |                                       |
    /// +-----+---------------------------------------+
    /// </pre>
    /// </summary>
    public sealed class IpV6ExtensionHeaderMobilityHomeTest : IpV6ExtensionHeaderMobility
    {
        private static class MessageDataOffset
        {
            public const int HomeNonceIndex = 0;
            public const int HomeInitCookie = HomeNonceIndex + sizeof(ushort);
            public const int HomeKeygenToken = HomeInitCookie + sizeof(ulong);
            public const int Options = HomeKeygenToken + sizeof(ulong);
        }

        /// <summary>
        /// The minimum number of bytes the message data takes.
        /// </summary>
        public const int MinimumMessageDataLength = MessageDataOffset.Options;

        /// <summary>
        /// Creates an instance from next header, checksum, home nonce index, home init cookie, home keygen token and options.
        /// </summary>
        /// <param name="nextHeader">Identifies the type of header immediately following this extension header.</param>
        /// <param name="checksum">
        /// Contains the checksum of the Mobility Header.
        /// The checksum is calculated from the octet string consisting of a "pseudo-header"
        /// followed by the entire Mobility Header starting with the Payload Proto field.
        /// The checksum is the 16-bit one's complement of the one's complement sum of this string.
        /// </param>
        /// <param name="homeNonceIndex">Will be echoed back by the mobile node to the correspondent node in a subsequent Binding Update.</param>
        /// <param name="homeInitCookie">Contains the home init cookie.</param>
        /// <param name="homeKeygenToken">Contains the 64-bit home keygen token used in the return routability procedure.</param>
        /// <param name="options">Zero or more TLV-encoded mobility options.</param>
        public IpV6ExtensionHeaderMobilityHomeTest(IpV4Protocol? nextHeader, ushort checksum, ushort homeNonceIndex, ulong homeInitCookie, ulong homeKeygenToken,
                                                   IpV6MobilityOptions options)
            : base(nextHeader, checksum, options, MessageDataOffset.Options)
        {
            HomeNonceIndex = homeNonceIndex;
            HomeInitCookie = homeInitCookie;
            HomeKeygenToken = homeKeygenToken;
        }

        /// <summary>
        /// Identifies the particular mobility message in question.
        /// An unrecognized MH Type field causes an error indication to be sent.
        /// </summary>
        public override IpV6MobilityHeaderType MobilityHeaderType
        {
            get { return IpV6MobilityHeaderType.HomeTest; }
        }

        /// <summary>
        /// Will be echoed back by the mobile node to the correspondent node in a subsequent Binding Update.
        /// </summary>
        public ushort HomeNonceIndex { get; private set; }

        /// <summary>
        /// Contains the home init cookie.
        /// </summary>
        public ulong HomeInitCookie { get; private set; }

        /// <summary>
        /// Contains the 64-bit home keygen token used in the return routability procedure.
        /// </summary>
        public ulong HomeKeygenToken { get; private set; }

        internal override int MessageDataLength
        {
            get { return MinimumMessageDataLength + MobilityOptions.BytesLength; }
        }

        internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
        {
            return EqualsMessageData(other as IpV6ExtensionHeaderMobilityHomeTest);
        }

        internal override int GetMessageDataHashCode()
        {
            return Sequence.GetHashCode(HomeNonceIndex, HomeInitCookie, HomeKeygenToken);
        }

        internal static IpV6ExtensionHeaderMobilityHomeTest ParseMessageData(IpV4Protocol nextHeader, ushort checksum, DataSegment messageData)
        {
            if (messageData.Length < MinimumMessageDataLength)
                return null;

            ushort homeNonceIndex = messageData.ReadUShort(MessageDataOffset.HomeNonceIndex, Endianity.Big);
            ulong homeInitCookie = messageData.ReadULong(MessageDataOffset.HomeInitCookie, Endianity.Big);
            ulong homeKeygenToken = messageData.ReadULong(MessageDataOffset.HomeKeygenToken, Endianity.Big);
            IpV6MobilityOptions options = new IpV6MobilityOptions(messageData.Subsegment(MessageDataOffset.Options, messageData.Length - MessageDataOffset.Options));
            return new IpV6ExtensionHeaderMobilityHomeTest(nextHeader, checksum, homeNonceIndex, homeInitCookie, homeKeygenToken, options);
        }

        internal override void WriteMessageData(byte[] buffer, int offset)
        {
            buffer.Write(offset + MessageDataOffset.HomeNonceIndex, HomeNonceIndex, Endianity.Big);
            buffer.Write(offset + MessageDataOffset.HomeInitCookie, HomeInitCookie, Endianity.Big);
            buffer.Write(offset + MessageDataOffset.HomeKeygenToken, HomeKeygenToken, Endianity.Big);
            MobilityOptions.Write(buffer, offset + MessageDataOffset.Options);
        }

        private bool EqualsMessageData(IpV6ExtensionHeaderMobilityHomeTest other)
        {
            return other != null &&
                   HomeNonceIndex == other.HomeNonceIndex && HomeInitCookie == other.HomeInitCookie && HomeKeygenToken == other.HomeKeygenToken;
        }
    }
}


text:
<?php

use Illuminate\Database\Seeder;

class NodesSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

    }
}


text:
<?php

class Google_Service_CloudMachineLearningEngine_GoogleIamV1Policy extends Google_Collection
{
  protected $collection_key = 'bindings';
  protected $auditConfigsType = 'Google_Service_CloudMachineLearningEngine_GoogleIamV1AuditConfig';
  protected $auditConfigsDataType = 'array';
  protected $bindingsType = 'Google_Service_CloudMachineLearningEngine_GoogleIamV1Binding';
  protected $bindingsDataType = 'array';
  public $etag;
  public $iamOwned;
  public $version;

  /**
   * @param Google_Service_CloudMachineLearningEngine_GoogleIamV1AuditConfig
   */
  public function setAuditConfigs($auditConfigs)
  {
    $this->auditConfigs = $auditConfigs;
  }
  /**
   * @return Google_Service_CloudMachineLearningEngine_GoogleIamV1AuditConfig
   */
  public function getAuditConfigs()
  {
    return $this->auditConfigs;
  }
  /**
   * @param Google_Service_CloudMachineLearningEngine_GoogleIamV1Binding
   */
  public function setBindings($bindings)
  {
    $this->bindings = $bindings;
  }
  /**
   * @return Google_Service_CloudMachineLearningEngine_GoogleIamV1Binding
   */
  public function getBindings()
  {
    return $this->bindings;
  }
  public function setEtag($etag)
  {
    $this->etag = $etag;
  }
  public function getEtag()
  {
    return $this->etag;
  }
  public function setIamOwned($iamOwned)
  {
    $this->iamOwned = $iamOwned;
  }
  public function getIamOwned()
  {
    return $this->iamOwned;
  }
  public function setVersion($version)
  {
    $this->version = $version;
  }
  public function getVersion()
  {
    return $this->version;
  }
}