text:
Client library for Run History APIs

## Installation and Usage
```bash
npm install --save @datafire/azure_machinelearningservices_runhistory
```
```js
let azure_machinelearningservices_runhistory = require('@datafire/azure_machinelearningservices_runhistory').create({
  access_token: "",
  refresh_token: "",
  client_id: "",
  client_secret: "",
  redirect_uri: ""
});

.then(data => {
  console.log(data);
});
```

## Description

## Actions

### Experiments_GetById
Get details of an Experiment with specific Experiment Id.

```js
azure_machinelearningservices_runhistory.Experiments_GetById({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentId **required** `string`: The identifier of the experiment.

#### Output
* output [Experiment](#experiment)

### Experiments_Update
Update details of an Experiment with specific Experiment Id.

```js
azure_machinelearningservices_runhistory.Experiments_Update({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentId **required** `string`: The identifier of the experiment.
  * modifyExperimentDto [ModifyExperiment](#modifyexperiment)

#### Output
* output [Experiment](#experiment)

### Experiments_DeleteTags
Delete list of Tags from a specific Experiment Id.

```js
azure_machinelearningservices_runhistory.Experiments_DeleteTags({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentId **required** `string`: The identifier of the experiment.
  * tags [DeleteTagsCommand](#deletetagscommand)

#### Output
* output [Experiment](#experiment)

### Experiments_Get
Get details of an Experiment with specific Experiment name.

```js
azure_machinelearningservices_runhistory.Experiments_Get({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.

#### Output
* output [Experiment](#experiment)

### Experiments_Create
Create a new Experiment.

```js
azure_machinelearningservices_runhistory.Experiments_Create({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.

#### Output
* output [Experiment](#experiment)

### Events_BatchPost
Post event data to a specific Run Id.

```js
azure_machinelearningservices_runhistory.Events_BatchPost({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * batchEventCommand [BatchEventCommand](#batcheventcommand)

#### Output
* output [BatchEventCommandResult](#batcheventcommandresult)

### Runs_BatchAddOrModify
Add or Modify a batch of Runs for a given experiment.

```js
azure_machinelearningservices_runhistory.Runs_BatchAddOrModify({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * requestDto [BatchAddOrModifyRunRequest](#batchaddormodifyrunrequest)

#### Output
* output [BatchAddOrModifyRunResult](#batchaddormodifyrunresult)

### RunMetrics_Get
Get Metric details for a specific Metric Id.

```js
azure_machinelearningservices_runhistory.RunMetrics_Get({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "metricId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * metricId **required** `string`: The identifier for a Metric.

#### Output
* output [RunMetric](#runmetric)

### RunMetrics_GetByQuery
Get all Run Metrics for the specific Experiment with the specified query filters.

```js
azure_machinelearningservices_runhistory.RunMetrics_GetByQuery({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * queryParams [QueryParams](#queryparams)
  * MergeStrategyType `string` (values: Default, None, MergeToVector): The type of merge strategy. Currently supported strategies are:
  * MergeStrategyOptions `string` (values: None, ReportUnmergedMetricsValues): Controls behavior of the merge strategy in certain cases; e.g. when a metric is not merged.
  * MergeStrategySettings.Version `string`: The strategy settings version.
  * MergeStrategySettings.SelectMetrics `string` (values: SelectAll, SelectByFirstValueSchema, SelectByFirstValueSchemaMergeNumericValues): Defines how to select metrics when merging them together.

#### Output
* output [PaginatedRunMetricList](#paginatedrunmetriclist)

### Runs_Get
Get Run details of a specific Run Id.

```js
azure_machinelearningservices_runhistory.Runs_Get({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.

#### Output
* output [Run](#run)

### Runs_Patch
Add a new Run or Modify an existing Run.

```js
azure_machinelearningservices_runhistory.Runs_Patch({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * createRunDto [CreateRun](#createrun)

#### Output
* output [Run](#run)

### RunArtifacts_ListInContainer
Get Artifacts in container for a specific Run Id.

```js
azure_machinelearningservices_runhistory.RunArtifacts_ListInContainer({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * continuationToken `string`: The Continuation Token.

#### Output
* output [PaginatedArtifactList](#paginatedartifactlist)

### RunArtifacts_GetSasUri
Get URI of an Artifact for a specific Run Id.

```js
azure_machinelearningservices_runhistory.RunArtifacts_GetSasUri({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * path `string`: The Artifact Path.

#### Output
* output `string`

### RunArtifacts_BatchCreateEmptyArtifacts
Create a batch of empty Artifacts in a specific Run.

```js
azure_machinelearningservices_runhistory.RunArtifacts_BatchCreateEmptyArtifacts({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * artifactPaths [ArtifactPathList](#artifactpathlist)

#### Output
* output [BatchArtifactContentInformationResult](#batchartifactcontentinformationresult)

### RunArtifacts_GetContentInformation
Get Artifact content information for give Run Id.

```js
azure_machinelearningservices_runhistory.RunArtifacts_GetContentInformation({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * path `string`: The Artifact Path.

#### Output
* output [ArtifactContentInformation](#artifactcontentinformation)

### RunArtifacts_GetById
Get Artifact for a specific Id.

```js
azure_machinelearningservices_runhistory.RunArtifacts_GetById({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * path `string`: The Artifact Path.

#### Output
* output [Artifact](#artifact)

### RunArtifacts_ListInPath
Get Artifacts in the provided path for a specific Run Id.

```js
azure_machinelearningservices_runhistory.RunArtifacts_ListInPath({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * path `string`: The Artifact Path.
  * continuationToken `string`: The Continuation Token.

#### Output
* output [PaginatedArtifactList](#paginatedartifactlist)

### RunArtifacts_ListSasByPrefix
Get SAS of an Artifact in the specified path.

```js
azure_machinelearningservices_runhistory.RunArtifacts_ListSasByPrefix({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * path `string`: The Artifact Path.
  * continuationToken `string`: The Continuation Token.

#### Output
* output [PaginatedArtifactContentInformationList](#paginatedartifactcontentinformationlist)

### RunMetrics_BatchPost
Post Metrics to a specific Run Id.

```js
azure_machinelearningservices_runhistory.RunMetrics_BatchPost({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier for a run.
  * batchMetricDto [BatchMetric](#batchmetric)

#### Output
*Output schema unknown*

### Runs_GetChild
Get details of all child runs for the specified Run Id with the specified filters.

```js
azure_machinelearningservices_runhistory.Runs_GetChild({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * $filter `string`: Allows for filtering the collection of resources.
  * $continuationtoken `string`: The continuation token to use for getting the next set of resources.
  * $orderby `array`: The list of resource properties to use for sorting the requested resources.
  * $sortorder `string` (values: Asc, Desc): The sort order of the returned resources. Not used, specify asc or desc after each property name in the OrderBy parameter.
  * $top `integer`: The maximum number of items in the resource collection to be included in the result.
  * $count `boolean`: Whether to include a count of the matching resources along with the resources returned in the response.

#### Output
* output [PaginatedRunList](#paginatedrunlist)

### Runs_GetDetails
Get Run Details for a specific Run Id.

```js
azure_machinelearningservices_runhistory.Runs_GetDetails({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.

#### Output
* output [RunDetails](#rundetails)

### Events_Post
Post event data to a specific Run Id.

```js
azure_machinelearningservices_runhistory.Events_Post({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * eventMessage [BaseEvent](#baseevent)

#### Output
*Output schema unknown*

### RunMetrics_Post
Post a Metric to a specific Run Id.

```js
azure_machinelearningservices_runhistory.RunMetrics_Post({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier for a run.
  * metricDto [Metric](#metric)

#### Output
*Output schema unknown*

### Runs_DeleteTags
Delete list of Tags from a specific Run Id.

```js
azure_machinelearningservices_runhistory.Runs_DeleteTags({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": "",
  "runId": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * runId **required** `string`: The identifier of the Run.
  * tags `array`
    * items `string`

#### Output
* output [Run](#run)

### Runs_GetByQuery
Get all Runs for a specific Experiment with the specified query filters.

```js
azure_machinelearningservices_runhistory.Runs_GetByQuery({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": "",
  "experimentName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * experimentName **required** `string`: The experiment name.
  * queryParams [QueryParams](#queryparams)

#### Output
* output [PaginatedRunList](#paginatedrunlist)

### Experiments_GetByQuery
Get all experiments in a specific workspace with the specified query filters.

```js
azure_machinelearningservices_runhistory.Experiments_GetByQuery({
  "subscriptionId": "",
  "resourceGroupName": "",
  "workspaceName": ""
}, context)
```

#### Input
* input `object`
  * subscriptionId **required** `string`: The Azure Subscription ID.
  * resourceGroupName **required** `string`: The Name of the resource group in which the workspace is located.
  * workspaceName **required** `string`: The name of the workspace.
  * queryParams [QueryParams](#queryparams)

#### Output
* output [PaginatedExperimentList](#paginatedexperimentlist)

## Definitions

### Artifact
* Artifact `object`: Details of an Artifact.
  * artifactId `string`: The identifier of an Artifact. Format of ArtifactId - {Origin}/{Container}/{Path}.
  * container **required** `string`: The name of container. Artifacts can be grouped by container.
  * createdTime `string`: The Date and Time at which the Artifact is created. The DateTime is in UTC.
  * dataPath [DataPath](#datapath)
  * etag `string`: The Etag of the Artifact.
  * origin **required** `string`: The origin of the Artifact creation request. Available origins are 'ExperimentRun', 'LocalUpload', 'WebUpload', 'Dataset' and 'Unknown'.
  * path **required** `string`: The path to the Artifact in a container.

### ArtifactContentInformation
* ArtifactContentInformation `object`: Details of an Artifact Content Information.
  * container `string`: The name of container. Artifacts can be grouped by container.
  * contentUri `string`: The URI of the content.
  * origin `string`: The origin of the Artifact creation request. Available origins are 'ExperimentRun', 'LocalUpload', 'WebUpload', 'Dataset', 'ComputeRecord', 'Metric', and 'Unknown'.
  * path `string`: The path to the Artifact in a container.

### ArtifactPath
* ArtifactPath `object`: Details of an Artifact Path.
  * path **required** `string`: The path to the Artifact in a container.

### ArtifactPathList
* ArtifactPathList `object`: Contains list of Artifact Paths.
  * paths **required** `array`: List of Artifact Paths.
    * items [ArtifactPath](#artifactpath)

### BaseEvent
* BaseEvent `object`: Base event is the envelope used to post event data to the Event controller
  * data `object`
  * name `string`
  * timestamp `string`

### BatchAddOrModifyRunRequest
* BatchAddOrModifyRunRequest `object`
  * runs `array`
    * items [CreateRun](#createrun)

### BatchAddOrModifyRunResult
* BatchAddOrModifyRunResult `object`
  * errors `object`
  * runs `object`

### BatchArtifactContentInformationResult
* BatchArtifactContentInformationResult `object`: Results of the Batch Artifact Content Information request.
  * artifactContentInformation `object`: Artifact Content Information details of the Artifact Ids requested.
  * artifacts `object`: Artifact details of the Artifact Ids requested.
  * errors `object`: Errors occurred while fetching the requested Artifact Ids.

### BatchEventCommand
* BatchEventCommand `object`
  * events `array`
    * items [BaseEvent](#baseevent)

### BatchEventCommandResult
* BatchEventCommandResult `object`
  * errors `array`
    * items [KeyValuePairBaseEventErrorResponse](#keyvaluepairbaseeventerrorresponse)

### BatchMetric
* BatchMetric `object`
  * values `array`
    * items [Metric](#metric)

### CreateRun
* CreateRun `object`
  * cancelUri `string`
  * createdFrom [CreatedFrom](#createdfrom)
  * dataContainerId `string`
  * description `string`
  * diagnosticsUri `string`
  * endTimeUtc `string`: The end time of the run in UTC.
  * heartbeatEnabled `boolean`
  * hidden `boolean`
  * name `string`
  * options [RunOptions](#runoptions)
  * parentRunId `string`: The parent of the run if the run is hierarchical; otherwise, Null.
  * properties `object`
  * runDefinition `object`
  * runId `string`: The identifier for the run. Run IDs must be less than 256 characters and contain only alphanumeric characters with dashes and underscores.
  * runType `string`
  * scriptName `string`
  * startTimeUtc `string`: The start time of the run in UTC.
  * status `string`: The status of the run. The Status string value maps to the RunStatus Enum.
  * tags `object`
  * target `string`

### CreatedBy
* CreatedBy `object`
  * userName `string`: A user's full name or a service principal's app ID.
  * userObjectId `string`: A user or service principal's object ID.
  * userTenantId `string`: A user or service principal's tenant ID.

### CreatedFrom
* CreatedFrom `object`
  * location `string`
  * locationType `string` (values: ArtifactId)
  * type `string` (values: Notebook)

### DataPath
* DataPath `object`
  * dataStoreName `string`
  * relativePath `string`
  * sqlDataPath [SqlDataPath](#sqldatapath)

### DeleteTagsCommand
* DeleteTagsCommand `object`
  * tags `array`
    * items `string`

### ErrorDetails
* ErrorDetails `object`: The error details.
  * code `string`: The error code.
  * message `string`: The error message.
  * target `string`: The target of the error (e.g., the name of the property in error).

### ErrorResponse
* ErrorResponse `object`: The error response.
  * correlation `object`: Dictionary containing correlation details for the error.
  * environment `string`: The hosting environment.
  * error [RootError](#rooterror)
  * location `string`: The Azure region.
  * time `string`: The time in UTC.

### Experiment
* Experiment `object`
  * archivedTime `string`
  * createdUtc `string`
  * description `string`
  * experimentId `string`
  * latestCreatedRunCreatedUtc `string`
  * latestCreatedRunId `string`
  * name `string`
  * tags `object`

### InnerErrorResponse
* InnerErrorResponse `object`: A nested structure of errors.
  * code `string`: The error code.
  * innerError [InnerErrorResponse](#innererrorresponse)

### KeyValuePairBaseEventErrorResponse
* KeyValuePairBaseEventErrorResponse `object`
  * key [BaseEvent](#baseevent)
  * value [ErrorResponse](#errorresponse)

### Metric
* Metric `object`
  * cells `array`
    * items `object`
  * createdUtc `string`
  * dataContainerId `string`
  * dataLocation `string`
  * description `string`
  * label `string`
  * metricId `string`
  * metricType `string`
  * name `string`
  * numCells `integer`
  * schema [MetricSchema](#metricschema)

### MetricSchema
* MetricSchema `object`
  * numProperties `integer`
  * properties `array`
    * items [MetricSchemaProperty](#metricschemaproperty)

### MetricSchemaProperty
* MetricSchemaProperty `object`
  * name `string`
  * propertyId `string`
  * type `string`

### ModifyExperiment
* ModifyExperiment `object`
  * archive `boolean`
  * description `string`
  * tags `object`

### PaginatedArtifactContentInformationList
* PaginatedArtifactContentInformationList `object`: A paginated list of ArtifactContentInformations.
  * continuationToken `string`: The token used in retrieving the next page.  If null, there are no additional pages.
  * nextLink `string`: The link to the next page constructed using the continuationToken.  If null, there are no additional pages.
  * value `array`: An array of objects of type ArtifactContentInformation.
    * items [ArtifactContentInformation](#artifactcontentinformation)

### PaginatedArtifactList
* PaginatedArtifactList `object`: A paginated list of Artifacts.
  * continuationToken `string`: The token used in retrieving the next page.  If null, there are no additional pages.
  * nextLink `string`: The link to the next page constructed using the continuationToken.  If null, there are no additional pages.
  * value `array`: An array of objects of type Artifact.
    * items [Artifact](#artifact)

### PaginatedExperimentList
* PaginatedExperimentList `object`: A paginated list of Experiments.
  * continuationToken `string`: The token used in retrieving the next page.  If null, there are no additional pages.
  * nextLink `string`: The link to the next page constructed using the continuationToken.  If null, there are no additional pages.
  * value `array`: An array of objects of type Experiment.
    * items [Experiment](#experiment)

### PaginatedRunList
* PaginatedRunList `object`: A paginated list of Runs.
  * continuationToken `string`: The token used in retrieving the next page.  If null, there are no additional pages.
  * nextLink `string`: The link to the next page constructed using the continuationToken.  If null, there are no additional pages.
  * value `array`: An array of objects of type Run.
    * items [Run](#run)

### PaginatedRunMetricList
* PaginatedRunMetricList `object`: A paginated list of RunMetrics.
  * continuationToken `string`: The token used in retrieving the next page.  If null, there are no additional pages.
  * nextLink `string`: The link to the next page constructed using the continuationToken.  If null, there are no additional pages.
  * value `array`: An array of objects of type RunMetric.
    * items [RunMetric](#runmetric)

### QueryParams
* QueryParams `object`: The set of supported filters.
  * continuationToken `string`: The continuation token to use for getting the next set of resources.
  * filter `string`: Allows for filtering the collection of resources.
  * orderBy `string`: The comma separated list of resource properties to use for sorting the requested resources.
  * top `integer`: The maximum number of items in the resource collection to be included in the result.

### RootError
* RootError `object`: The root error.
  * code `string`: The service-defined error code. Supported error codes: ServiceError, UserError, ValidationError, AzureStorageError, TransientError, RequestThrottled.
  * details `array`: The related errors that occurred during the request.
    * items [ErrorDetails](#errordetails)
  * innerError [InnerErrorResponse](#innererrorresponse)
  * message `string`: A human-readable representation of the error.
  * target `string`: The target of the error (e.g., the name of the property in error).

### Run
* Run `object`: The definition of a Run.
  * cancelUri `string`
  * createdBy [CreatedBy](#createdby)
  * createdFrom [CreatedFrom](#createdfrom)
  * createdUtc `string`: The time the run was created in UTC.
  * dataContainerId `string`
  * description `string`
  * diagnosticsUri `string`
  * endTimeUtc `string`: The end time of the run in UTC.
  * error [ErrorResponse](#errorresponse)
  * experimentId `string`: The Id of the experiment that created this run.
  * heartbeatEnabled `boolean`
  * hidden `boolean`
  * name `string`
  * options [RunOptions](#runoptions)
  * parentRunId `string`: The parent of the run if the run is hierarchical; otherwise, Null.
  * properties `object`
  * revision `integer`
  * rootRunId `string`
  * runDefinition `object`
  * runId `string`: The identifier for the run. Run IDs must be less than 256 characters and contain only alphanumeric characters with dashes and underscores.
  * runNumber `integer`
  * runType `string`
  * scriptName `string`
  * startTimeUtc `string`: The start time of the run in UTC.
  * status `string`: The status of the run. The Status string value maps to the RunStatus Enum.
  * tags `object`
  * target `string`
  * token `string`: A token used for authenticating a run.
  * tokenExpiryTimeUtc `string`: The Token expiration time in UTC.
  * userId `string`: The Id of the user that created the run.
  * warnings `array`: A list of warnings that occurred during the run.
    * items [RunDetailsWarning](#rundetailswarning)

### RunDetails
* RunDetails `object`: The details of the run.
  * endTimeUtc `string`: The end time of the run in UTC.
  * error [ErrorResponse](#errorresponse)
  * logFiles `object`
  * parentRunId `string`: The parent of the run if the run is hierarchical.
  * properties `object`: The properties dictionary for the run. Properties are immutable.
  * revision `integer`
  * runDefinition `object`: The run definition specification.
  * runId `string`: The identifier for the run.
  * startTimeUtc `string`: The start time of the run in UTC.
  * status `string`: The status of the run. The Status string value maps to the RunStatus Enum.
  * tags `object`: The tag dictionary for the run. Tags are mutable.
  * target `string`: The name of the compute target where the run is executed.
  * warnings `array`: A list of warnings that occurred during the run.
    * items [RunDetailsWarning](#rundetailswarning)

### RunDetailsWarning
* RunDetailsWarning `object`
  * message `string`
  * source `string`

### RunMetric
* RunMetric `object`
  * cells `array`
    * items `object`
  * createdUtc `string`
  * dataContainerId `string`
  * dataLocation `string`
  * description `string`
  * label `string`
  * metricId `string`
  * metricType `string`
  * name `string`
  * numCells `integer`
  * runId `string`
  * schema [MetricSchema](#metricschema)

### RunOptions
* RunOptions `object`
  * generateDataContainerIdIfNotSpecified `boolean`

### SqlDataPath
* SqlDataPath `object`
  * sqlQuery `string`
  * sqlStoredProcedureName `string`
  * sqlStoredProcedureParams `array`
    * items [StoredProcedureParameter](#storedprocedureparameter)
  * sqlTableName `string`

### StoredProcedureParameter
* StoredProcedureParameter `object`
  * name `string`
  * type `string` (values: String, Int, Decimal, Guid, Boolean, Date)
  * value `string`


text:
comments: true
date: 2014-05-29 14:18:43+00:00
layout: article
title: MySQL versus MariaDB
categories: mysql
tags: [mysql, mariadb]
ads: true
image:
  feature:
  teaser: mysql-maria.jpg
---

Berikut perbedaan fitur 2 MySQL dan MariaDB ... selain itu perintahnya gak begitu banyak perbedaan (pada dasarnya sama aja)

link [https://mariadb.com/products/mariadb/mariadb-vs-mysql](https://mariadb.com/products/mariadb/mariadb-vs-mysql)

[![](http://i713.photobucket.com/albums/ww134/upamisterlobal/timposu/1_zpsa077ab8b.png)](http://i713.photobucket.com/albums/ww134/upamisterlobal/timposu/1_zpsa077ab8b.png)

![](http://i713.photobucket.com/albums/ww134/upamisterlobal/timposu/2_zps9d15bf33.png)![](http://i713.photobucket.com/albums/ww134/upamisterlobal/timposu/3_zps974c64fe.png)

redpajama_set_name: RedPajamaGithub


text:
typedef void (*pfAlarmResponseCallback)(ALARM_RESPONSE_TYPE alarm_response);
typedef void (*pfControlPress)(const int& pos_x, const int& pos_y);

class CDisplayDeviceBase;
class CControlMgr
{
public:
    CControlMgr();
    virtual ~CControlMgr();

    bool Init(CDisplayDeviceBase* display_obj, pfControlPress ctrl_press_callback);
    void Deinit();

    //virtual void FireAlarmValue(const CTimeObj* timeValue);
    //virtual void StopAlarm();

    void ProcessCtrlLoop();

private:
    CDisplayDeviceBase* m_display_obj;
    pfAlarmResponseCallback m_pfnAlarm_response;
    CTimeObj* m_current_alarm;
    pfControlPress m_ctrl_press_callback;
};

#endif // __CONTROL_MGR_H__


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>LiSDKConstants (li-android-sdk-core 1.0 API)</title>
<meta name="date" content="2017-02-01">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

lithium.community.android.sdk.utils

Class LiSDKConstants

java.lang.Object

lithium.community.android.sdk.utils.LiCoreSDKConstants

public class LiSDKConstants
extends java.lang.Object

Created by sumit.pannalall on 1/16/17.

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
LI_AUTH_STATE

static java.lang.String
LI_DEFAULT_SDK_SETTINGS

static java.lang.String
LI_DEVICE_ID

static java.lang.String
LI_LOG_TAG

static java.lang.String
LI_RECEIVER_DEVICE_ID

static java.lang.String
LI_SHARED_PREFERENCES_NAME

static long
MAX_IMAGE_UPLOAD_SIZE

Constructor Summary

Constructors

Constructor and Description

LiSDKConstants()

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LI_SHARED_PREFERENCES_NAME

public static final java.lang.String LI_SHARED_PREFERENCES_NAME

See Also:

Constant Field Values

LI_AUTH_STATE

public static final java.lang.String LI_AUTH_STATE

See Also:

Constant Field Values

LI_DEFAULT_SDK_SETTINGS

public static final java.lang.String LI_DEFAULT_SDK_SETTINGS

See Also:

Constant Field Values

LI_DEVICE_ID

public static final java.lang.String LI_DEVICE_ID

See Also:

Constant Field Values

LI_LOG_TAG

public static final java.lang.String LI_LOG_TAG

See Also:

Constant Field Values

LI_RECEIVER_DEVICE_ID

public static final java.lang.String LI_RECEIVER_DEVICE_ID

See Also:

Constant Field Values

MAX_IMAGE_UPLOAD_SIZE

public static final long MAX_IMAGE_UPLOAD_SIZE

See Also:

Constant Field Values

Constructor Detail

LiSDKConstants

public LiSDKConstants()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
#ifndef __ARCH_MIPS_SRC_PIC32MZ_CHIP_PIC32MZ_PPS_H
#define __ARCH_MIPS_SRC_PIC32MZ_CHIP_PIC32MZ_PPS_H

/********************************************************************************************
 * Included Files
 ********************************************************************************************/

#include <nuttx/config.h>

/********************************************************************************************
 * Pre-processor Definitions
 ********************************************************************************************/
/* PPS Register Offsets/Addresses ***********************************************************/

/* Depends on the peripherals supported by the particular device */

#if defined(CONFIG_ARCH_CHIP_PIC32MZEC)
#  include "chip/pic32mzec-pps.h"
#else
#  error Unknown PIC32MZ family
#endif

/* PPS Register Bit Field Definitions *************************************(*****************/
/* All registers contain a single 4 bit field (bits 0-3) holding the peripheral pin
 * selection.
 */

#define PPS_MASK 0x0000000f

/* Pin Selection Helper Macros **************************************************************/
/* The encoding of the input pin selection is simple.  Since we know the devices, we also
 * can infer the register address so we need only the value for the register which is
 * exactly what is provided by macro definitions.
 *
 * The encoding of the output pin selection is a little more complex.  Knowing the device
 * does not provide sufficient information.  The output pin definitions include both the
 * register value and the register address and the following helper macros can be used
 * extract one or the other.
 *
 * NOTE: These odd macro forms are used to work around a pre-processor issue.  The argument
 * to PPS_OUTPUT_REGADDR is defined to have the form nn,xxxx but the preprocessor would
 * claim that only one parameter is passed.  The following version takes only one parameter
 * and keeps the pre-processor happy.
 */

#define __PPS_OUTPUT_REGADDR(a,b) ((uintptr_t)(b))
#define PPS_OUTPUT_REGADDR(a)  __PPS_OUTPUT_REGADDR(a)

#define __PPS_OUTPUT_REGVAL(a,b)  ((uint32_t)(a))
#define PPS_OUTPUT_REGVAL(a)  __PPS_OUTPUT_REGVAL(a)

/********************************************************************************************
 * Public Types
 ********************************************************************************************/

#ifndef __ASSEMBLY__

/********************************************************************************************
 * Public Data
 ********************************************************************************************/

#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif

/********************************************************************************************
 * Public Function Prototypes
 ********************************************************************************************/

#undef EXTERN
#ifdef __cplusplus
}
#endif

#endif /* __ASSEMBLY__ */
#endif /* __ARCH_MIPS_SRC_PIC32MZ_CHIP_PIC32MZ_PPS_H */


text:
.PHONY: build
build:
	mkdir -p output

	# generate pb.go inluding imported proto
	protoc --go_out=Mproto/common.proto=moul.io/protoc-gen-gotemplate/examples/import/output/models/common:./output proto/article.proto
	protoc --go_out=:./output proto/common.proto

	# build our go file based on our template
	protoc -I. --gotemplate_out=template_dir=templates,debug=true:output proto/article.proto

.PHONY: re
re: clean build

.PHONY: clean
clean:
	rm -rf output


text:
import classad
import json
import os
import posixpath
import requests
import shutil
import socket
import sys
import time

try:
    from urllib.parse import urlparse # Python 3
except ImportError:
    from urlparse import urlparse # Python 2

DEFAULT_TIMEOUT = 30
GLUSTER_PLUGIN_VERSION = '1.0.0'

def print_help(stream = sys.stderr):
    help_msg = '''Usage: {0} -infile <input-filename> -outfile <output-filename>
       {0} -classad

Options:
  -classad                    Print a ClassAd containing the capablities of this
                              file transfer plugin.
  -infile <input-filename>    Input ClassAd file
  -outfile <output-filename>  Output ClassAd file
  -upload                     Indicates this transfer is an upload (default is
                              download)
'''
    stream.write(help_msg.format(sys.argv[0]))

def print_capabilities():
    capabilities = {
         'MultipleFileSupport': True,
         'PluginType': 'FileTransfer',
         'SupportedMethods': 'gluster',
         'Version': GLUSTER_PLUGIN_VERSION,
    }
    sys.stdout.write(classad.ClassAd(capabilities).printOld())

def parse_args():
    '''The optparse library can't handle the types of arguments that the file
    transfer plugin sends, the argparse library can't be expected to be
    found on machines running EL 6 (Python 2.6), and a plugin should not
    reach outside the standard library, so the plugin must roll its own argument
    parser. The expected input is very rigid, so this isn't too awful.'''

    # The only argument lists that are acceptable are
    # <this> -classad
    # <this> -infile <input-filename> -outfile <output-filename>
    # <this> -outfile <output-filename> -infile <input-filename>
    if not len(sys.argv) in [2, 5, 6]:
        print_help()
        sys.exit(-1)

    # If -classad, print the capabilities of the plugin and exit early
    if (len(sys.argv) == 2) and (sys.argv[1] == '-classad'):
        print_capabilities()
        sys.exit(0)

    # If -upload, set is_upload to True and remove it from the args list
    is_upload = False
    if '-upload' in sys.argv[1:]:
        is_upload = True
        sys.argv.remove('-upload')

    # -infile and -outfile must be in the first and third position
    if not (
            ('-infile' in sys.argv[1:]) and
            ('-outfile' in sys.argv[1:]) and
            (sys.argv[1] in ['-infile', '-outfile']) and
            (sys.argv[3] in ['-infile', '-outfile']) and
            (len(sys.argv) == 5)):
        print_help()
        sys.exit(-1)
    infile = None
    outfile = None
    try:
        for i, arg in enumerate(sys.argv):
            if i == 0:
                continue
            elif arg == '-infile':
                infile = sys.argv[i+1]
            elif arg == '-outfile':
                outfile = sys.argv[i+1]
    except IndexError:
        print_help()
        sys.exit(-1)

    return {'infile': infile, 'outfile': outfile, 'upload': is_upload}

def format_error(error):
    return '{0}: {1}'.format(type(error).__name__, str(error))

def get_error_dict(error, url = ''):
    error_string = format_error(error)
    error_dict = {
        'TransferSuccess': False,
        'TransferError': error_string,
        'TransferUrl': url,
    }

    return error_dict

class GlusterPlugin:

    def __init__(self):
        self.gluster_root = "/mnt/gluster"

    # Extract whatever information we want from the url provided.
    # In the case of Gluster, convert the gluster://path/to/file url to a
    # path in the file system (ie. /path/to/file)
    def parse_url(self, url):
        url_path = url[(url.find("://") + 3):]
        return url_path

    def download_file(self, url, local_file_path):

        start_time = time.time()

        # Download transfer logic goes here
        gluster_file_path = self.gluster_root + "/" + self.parse_url(url)
        shutil.copy(gluster_file_path, local_file_path)
        file_size = os.stat(local_file_path).st_size

        end_time = time.time()

        # Get transfer statistics
        transfer_stats = {
            'TransferSuccess': True,
            'TransferProtocol': 'gluster',
            'TransferType': 'upload',
            'TransferFileName': local_file_path,
            'TransferFileBytes': file_size,
            'TransferTotalBytes': file_size,
            'TransferStartTime': int(start_time),
            'TransferEndTime': int(end_time),
            'ConnectionTimeSeconds': end_time - start_time,
            'TransferUrl': url,
        }

        return transfer_stats

    def upload_file(self, url, local_file_path):

        start_time = time.time()

        # Upload transfer logic goes here
        gluster_file_path = self.gluster_root + "/" + self.parse_url(url)
        shutil.copy(local_file_path, gluster_file_path)
        file_size = os.stat(local_file_path).st_size

        end_time = time.time()

        # Including TransferUrl makes little sense here, too.
        transfer_stats = {
            'TransferSuccess': True,
            'TransferProtocol': 'gluster',
            'TransferType': 'upload',
            'TransferFileName': local_file_path,
            'TransferFileBytes': file_size,
            'TransferTotalBytes': file_size,
            'TransferStartTime': int(start_time),
            'TransferEndTime': int(end_time),
            'ConnectionTimeSeconds': end_time - start_time,
            'TransferUrl': url,
        }

        return transfer_stats

if __name__ == '__main__':

    # Start by parsing input arguments
    try:
        args = parse_args()
    except Exception:
        sys.exit(-1)

    gluster = GlusterPlugin()

    # Parse in the classads stored in the input file.
    # Each ad represents a single file to be transferred.
    try:
        infile_ads = classad.parseAds(open(args['infile'], 'r'))
    except Exception as err:
        try:
            with open(args['outfile'], 'w') as outfile:
                outfile_dict = get_error_dict(err)
                outfile.write(str(classad.ClassAd(outfile_dict)))
        except Exception:
            pass
        sys.exit(-1)

    # Now iterate over the list of classads and perform the transfers.
    try:
        with open(args['outfile'], 'w') as outfile:
            for ad in infile_ads:
                try:
                    if not args['upload']:
                        outfile_dict = gluster.download_file(ad['Url'], ad['LocalFileName'])
                    else:
                        outfile_dict = gluster.upload_file(ad['Url'], ad['LocalFileName'])

                    outfile.write(str(classad.ClassAd(outfile_dict)))

                except Exception as err:
                    try:
                        outfile_dict = get_error_dict(err, url = ad['Url'])
                        outfile.write(str(classad.ClassAd(outfile_dict)))
                    except Exception:
                        pass
                    sys.exit(-1)

    except Exception:
        sys.exit(-1)


text:
package restlib.example.async;

import java.util.Timer;
import java.util.TimerTask;

import restlib.Request;
import restlib.Response;
import restlib.data.Form;
import restlib.data.Status;
import restlib.server.FutureResponses;
import restlib.server.Resource;
import restlib.server.Route;

import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;

public final class ContinuationResource implements Resource {
    public static ContinuationResource newInstance(final Route route) {
        Preconditions.checkNotNull(route);
        return new ContinuationResource(route);
    }

    private final Route route;

    private ContinuationResource(final Route route) {
        this.route = route;
    }

    @Override
    public ListenableFuture<Response> acceptMessage(final Request request, final Object message) {
        return delayedResponse(Status.SUCCESS_OK, 500);
    }

    private ListenableFuture<Response> delayedResponse(final Status status, final long waitTime) {
        final Timer timer = new Timer();
        final SettableFuture<Response> response = SettableFuture.create();
        final TimerTask task = new TimerTask() {
            @Override
            public void run() {
                timer.cancel();
                response.set(status.toResponse());
            }};
        timer.schedule(task, waitTime);
        return response;
    }

    @Override
    public ListenableFuture<Response> handle(final Request request) {
        final Multimap<String, String> form;
        try {
            form = Form.parse(request.uri().query());
        } catch (final IllegalArgumentException e) {
            return FutureResponses.CLIENT_ERROR_BAD_REQUEST;
        }

        final boolean timeout =
                Boolean.parseBoolean(Iterables.getFirst(form.get("timeout"), ""));
        final long waitTime = timeout ? 20000 : 500;

         return delayedResponse(Status.INFORMATIONAL_CONTINUE, waitTime);
    }

    @Override
    public Route route() {
        return this.route;
    }
}


text:
//
//  ATBrowserViewController.h
//  ADTECHMobileSDK
//
//  Created by ADTECH GmbH on 10/11/13.
//  Copyright (c) 2013 ADTECH GmbH. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 * Subclass this class to have your own ViewController shown when opening landing pages.
 *
 * @since 3.4
 */
@interface ATBrowserViewController : UIViewController

/**
 * Call this method on 'super' when you want to close your browser.
 *
 * @warning: If you don't call this method, the SDK won't know that it should resume its internal processes and this can lead to side effects.
 *
 * @since 3.4
 */
- (void)close;

@end


text:
import os

from myhdl import Cosimulation, Signal, delay, always, Simulation, _simulator

from gnuradio import uhd, gr

from fpga_sdrlib import config
from fpga_sdrlib import b100
from fpga_sdrlib.conversions import c_to_int, int_to_c
from fpga_sdrlib.message.msg_utils import stream_to_samples_and_packets

def flip_bits(seq, width):
    """
    Takes a sequence of integers.  For each integer the higher and lower
    bits are swapped round.  Necessary to work around a bug in
    gr-uhd.
    """
    out = []
    h = pow(2, width//2)
    for x in seq:
        high_bits = x//h
        low_bits = x % h
        out.append(high_bits + low_bits * h)
    return out

def unsigned_to_signed(seq, width):
    """
    Convert unsigned integer to signed.
    """
    out = []
    k = pow(2, width)
    for x in seq:
        if x >= k/2:
            x -= k
        out.append(x)
    return out

def compare_unaligned(xs, ys, tol):
    """
    Compare two unaligned sequences.

    Args:
       xs: the shorter sequence
       ys: the longer sequence (should contain xs somewhere within)
       tol: how close individual elements must be

    Returns:
       The maximum number of continuous matching elements starting from the
       beginning.
    """
    matched = False
    max_streak = 0
    N = len(xs)
    for offset in range(len(ys)-len(xs)):
        worked = True
        streak = N
        for i in range(N):
            if abs(xs[i] - ys[offset+i]) > tol:
                worked = False
                streak = i
                break
        max_streak = max(streak, max_streak)
        if worked:
            matched = True
            break
    return max_streak

"""
What testbenchs do I need:
  samples, msgs, ms (raw module)

  samples, msgs in -> into merged stream ->samples, msgs out
  raw 32 bit in and out

"""

class TestBenchIcarusBase(object):
    """
    A base class for TestBenchIcarusInner and TestBenchIcarusOuter.
    Holds common code.
    """

    def __init__(self):
        # The MyHDL Signals
        for sn in self.signal_names:
            if sn.endswith('_n'):
                setattr(self, sn, Signal(1))
            else:
                setattr(self, sn, Signal(0))

    def clk_driver(self):
        @always(delay(1))
        def run():
            """ Drives the clock."""
            self.clk.next = not self.clk
        return run

    def run(self, clks):
        """
        Run a test bench simulation.
        """
        myhdlvpi = os.path.join(config.verilogdir, 'myhdl.vpi')
        command = "vvp -m {myhdlvpi} {executable}".format(myhdlvpi=myhdlvpi, executable=self.executable)
        cosimdict = dict([(sn, getattr(self, sn)) for sn in self.signal_names])
        dut = Cosimulation(command, **cosimdict)
        drivers = [df() for df in self.drivers]
        sim = Simulation(dut, *drivers)
        sim.run(2*clks)
        dut.__del__()
        del dut

    def get_output(self):
        self.out_raw = []
        @always(self.clk.posedge)
        def run():
            """
            Receive output.
            """
            if self.out_nd:
                self.out_raw.append(int(self.out_data))
                if 'out_m' in self.signal_names:
                    self.out_ms.append(int(self.out_m))
        return run

    def send_input(self):
        self.count = 0
        self.first = True
        self.datapos = 0
        @always(self.clk.posedge)
        def run():
            """
            Sends input to our DUT (design-under-test) and
            receives output.
            """
            if not self.doing_prerun:
                # Send input.
                if self.count >= self.sendnth and self.datapos < len(self.in_raw):
                    if self.in_raw[self.datapos]is not None:
                        self.in_data.next = self.in_raw[self.datapos]
                        if 'in_m' in self.signal_names:
                            self.in_m.next = self.in_ms[self.datapos]
                        self.in_nd.next = 1
                        self.count = 0
                        self.datapos += 1
                    else:
                        self.datapos += 1
                        self.in_nd.next = 0
                else:
                    self.in_nd.next = 0
                    self.count += 1
        return run

    def check_error(self):
        self.error_count = 0
        @always(self.clk.posedge)
        def run():
            if self.error_count > 0:
                raise StandardError("The error wire is high.")
            if self.error:
                self.error_count += 1
        return run

class TestBenchIcarusInner(TestBenchIcarusBase):
    """
    A testbench to test a module using Icarus verilog.
    Separate sample, message and meta data connections.
    Message can only be sent before sending samples.

    Args:
        executable: The Icarus executable
        in_samples: The input samples.
        in_ms: The input meta data (same length as in_samples).
        start_msgs: Messages to send before sending samples.
        sendnth: How often to send a new sample.
        width: The width in bits of input data
        mwidth: The width of meta data
    """

    signal_names = ['clk', 'rst_n',
                    'in_data', 'in_nd', 'in_m', 'in_msg', 'in_msg_nd',
                    'out_data', 'out_nd', 'out_m', 'out_msg', 'out_msg_nd',
                    'error']

    def __init__(self, executable, in_samples, in_ms=None, start_msgs=None,
                 sendnth=config.default_sendnth, width=config.default_width,
                 mwidth=config.default_mwidth):
        TestBenchIcarusBase.__init__(self)
        self.executable = executable
        self.in_samples = in_samples
        if in_ms is not None:
            assert(len(in_samples) == len(in_ms))
            self.in_ms = in_ms
        else:
            self.in_ms = [0] * len(in_samples)
        self.start_msgs = start_msgs
        self.sendnth = sendnth
        self.width = width
        self.mwidth = mwidth
        # Output arrays
        self.out_samples = []
        self.out_ms = []
        self.out_msgs = []
        # Set the MyHDL drivers
        self.drivers = [self.clk_driver, self.get_output, self.check_error,
                        self.send_input, self.prerun, self.get_message_stream]
        # ???
        self.in_raw = [c_to_int(d, self.width/2) for d in self.in_samples]

    def get_message_stream(self):
        @always(self.clk.posedge)
        def run():
            """
            Receive messages.
            """
            if self.out_msg_nd:
                self.out_msgs.append(int(self.out_msg))
        return run

    def run(self, clks):
        """
        Run a test bench simulation.
        """
        TestBenchIcarusBase.run(self, clks)
        self.out_samples = [int_to_c(r, self.width/2) for r in self.out_raw]
        samples, packets = stream_to_samples_and_packets(self.out_msgs)
        if samples:
            raise StandardError("Found samples is message stream.")
        self.out_messages = packets

    def prerun(self):
        self.first = True
        self.done_header = False
        self.doing_prerun = True
        self.msg_pos = 0
        @always(self.clk.posedge)
        def run():
            """
            Sends a reset signal at start.
            The loads taps in.
            """
            if self.first:
                self.first = False
                self.rst_n.next = 0
            else:
                self.rst_n.next = 1
                if self.start_msgs and (self.msg_pos < len(self.start_msgs)):
                    self.in_msg.next = self.start_msgs[self.msg_pos]
                    self.in_msg_nd.next = 1
                    self.msg_pos += 1
                else:
                    self.doing_prerun = False
                    self.in_msg_nd.next = 0
        return run

class TestBenchIcarusOuter(TestBenchIcarusBase):
    """
    A testbench to test a module using Icarus verilog.
    Only a single data connection in and out.
    Shared by data and messages.
    No possibility to pass meta data currently.
    Message can only be sent before sending samples.

    Args:
        executable: The Icarus executable
        in_samples: The input samples.
        start_msgs: Messages to send before sending samples.
        in_raw: The raw input integers can be specified, instead of
                in_samples and start_msgs.
        sendnth: How often to send a new sample.
        width: The bit width of the input data
    """

    signal_names = ['clk', 'reset',
                    'in_data', 'in_nd',
                    'out_data', 'out_nd',
                    'error']

    def __init__(self, executable, in_samples=None, start_msgs=None, in_raw=None,
                 sendnth=config.default_sendnth, width=config.default_width,
                 output_msgs=True):
        super(TestBenchIcarusOuter, self).__init__()
        self.executable = executable
        self.in_samples = in_samples
        self.start_msgs = start_msgs
        self.in_raw = in_raw
        if (in_raw is not None) and (in_samples is not None or start_msgs is not None):
            raise ValueError("Cannot specify both (in_samples and/or start_msgs) and in_raw")
        self.sendnth = sendnth
        self.width = width
        self.output_msgs = output_msgs
        # Set the MyHDL drivers
        self.drivers = [self.clk_driver, self.get_output,
                        self.send_input, self.prerun, self.check_error]
        # Generate the raw data to send in.
        if self.in_raw is None:
            self.in_raw = []
            if self.start_msgs is not None:
                self.in_raw += self.start_msgs
            # Subtracting 1 from width since we use 1st bit as a header.
            self.in_raw += [c_to_int(d, self.width/2-1) for d in self.in_samples]

    def run(self, steps_rqd):
        super(TestBenchIcarusOuter, self).run(steps_rqd)
        header_shift = pow(2, self.width-1)
        if self.output_msgs:
            samples, packets = stream_to_samples_and_packets(self.out_raw)
            for s in samples:
                if s == config.errorcode:
                    raise ValueError("Errorcode detected.")
            self.out_samples = [int_to_c(s, self.width/2-1) for s in samples]
            self.out_messages = packets
        #for p in packets:
        #    if p[0] // header_shift:
        #        self.out_messages.append(p)
        #    else:
        #        # It is a sample
        #        assert(len(p) == 1)
        #        self.out_samples.append(int_to_c(p[0], self.width/2-1))

    def prerun(self):
        self.first = True
        self.done_header = False
        self.doing_prerun = True
        self.msg_pos = 0
        @always(self.clk.posedge)
        def run():
            """
            Sends a reset signal at start.
            """
            if self.first:
                self.first = False
                self.reset.next = 1
            else:
                self.reset.next = 0
                self.doing_prerun = False
        return run

class TestBenchB100(object):
    """
    A minimal TestBench to run the module on the B100 FPGA.

    Args:
        fpga_image: The filename of the fpga_image.
        in_samples: A list of complex points to send.
        start_msgs: A list of messages to send before sending samples.
        defines: Macro definitions (constants) used in verilog code
                 (just used for extracting width here).
        width: Width of input data.
        in_raw: Raw integers to send instead of in_samples and start_msgs.
        output_msgs: Parse the output for messages.
    """

    def __init__(self, fpgaimage, in_samples=None, start_msgs=None,
                 width=config.default_width, in_raw=None, output_msgs=True):
        self.fpgaimage = fpgaimage
        self.in_samples = in_samples
        self.start_msgs = start_msgs
        self.width = width
        self.in_raw = in_raw
        self.output_msgs = output_msgs
        # Generate the raw data to send in.
        if in_raw is None:
            if self.start_msgs is not None:
                self.in_raw = self.start_msgs
            else:
                self.in_raw = []
            # Subtracting 1 from width since we use 1st bit as a header.
            self.in_raw += [c_to_int(d, self.width/2-1) for d in self.in_samples]
        self.out_samples = []
        self.out_ms = []
        self.out_msgs = []

    def run(self, n_receive=None):
        """
        Run the simulation.

        Args:
            n_receive: Stop after receiving this many samples.
        """
        b100.set_image(self.fpgaimage)
        # steps_rqd only in for compatibility
        from gnuradio import gr, uhd
        if n_receive is None:
            n_receive = 10000
        # Flip high and low bits of in_raw
        flipped_raw = flip_bits(self.in_raw, self.width)
        flipped_raw = unsigned_to_signed(flipped_raw, self.width)
        stream_args = uhd.stream_args(cpu_format='sc16', channels=range(1))
        from_usrp = uhd.usrp_source(device_addr='', stream_args=stream_args)
        head = gr.head(4, n_receive)
        snk = gr.vector_sink_i()
        to_usrp = uhd.usrp_sink(device_addr='', stream_args=stream_args)
        src = gr.vector_source_i(flipped_raw)
        tb = gr.top_block()
        tb.connect(from_usrp, head, snk)
        tb.connect(src, to_usrp)
        tb.run()
        self.out_raw = snk.data()
        # Remove 0's
        start_offset = None
        stop_offset = None
        enumerated_raw = list(enumerate(self.out_raw))
        for i, r in enumerated_raw:
            if r != 0:
                start_offset = i
                break
        for i, r in reversed(enumerated_raw):
            if r != 0:
                stop_offset = i
                break
        if start_offset is None or stop_offset is None:
            raise StandardError("Could not find any non-zero returned data.")
        self.out_raw = self.out_raw[start_offset: stop_offset+1]
        # Shift to positive integers
        positive = []
        for r in self.out_raw:
            if r < 0:
                r += pow(2, self.width)
            positive.append(r)
        self.out_raw = positive
        # Flip bits in out_raw
        self.out_raw = flip_bits(self.out_raw, self.width)
        if self.output_msgs:
            header_shift = pow(2, self.width-1)
            samples, packets = stream_to_samples_and_packets(self.out_raw)
            self.out_samples = [int_to_c(s, self.width/2-1) for s in samples]
            self.out_messages = packets
            #self.out_samples = []
            #self.out_messages = []
            #for p in packets:
            #    if p[0] // header_shift:
            #        self.out_messages.append(p)
            #    else:
                    # It is a sample
            #        assert(len(p) == 1)
            #        self.out_samples.append(int_to_c(p[0], self.width/2-1))


text:
<?php

use Illuminate\Database\Seeder;

class SeoTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('seo')->insert(['tag'=>'keywords','value'=>'kenneth,pilgrim,kenneth pilgrim,belgium,full-stack,full,stack,developer,php,javascript,back,end,back-end,laravel,jquery,belgie,vlaanderen,mechelen,antwerpen',]);
        DB::table('seo')->insert(['tag'=>'name','value'=>'kenneth pilgrim',]);
        DB::table('seo')->insert(['tag'=>'description','value'=>'I\'m a full-stack developer from Belgium.',]);
        DB::table('seo')->insert(['tag'=>'url','value'=>'https://kennethpilgrim.be',]);
        DB::table('seo')->insert(['tag'=>'icon','value'=>'/img/k.png',]);
        DB::table('seo')->insert(['tag'=>'image','value'=>'/img/kenneth-pilgrim.png',]);
        DB::table('seo')->insert(['tag'=>'copyright','value'=>'copyright ©2017 kenneth pilgrim.',]);
        DB::table('seo')->insert(['tag'=>'themecolor','value'=>'RGB(140,60,25,1)',]);
        DB::table('seo')->insert(['tag'=>'twitter','value'=>'@kenneth_pilgrim',]);
        DB::table('seo')->insert(['tag'=>'sameas','value'=>'"https://www.linkedin.com/in/kennethpilgrim-eu","https://plus.google.com/u/0/111340358723834568911","https://www.facebook.com/kennethpilgrim.eu","https://www.instagram.com/kennethpilgrim/","https://www.pinterest.com/kenneth_pilgrim/","https://twitter.com/kenneth_pilgrim","https://gitlab.com/kennethpilgrim","https://github.com/rootland"',]);

    }
}


text:
using Microsoft.Extensions.Logging.Abstractions;
using Slp.Evi.Storage.Common.Algebra;
using Slp.Evi.Storage.Relational.PostProcess.Optimizers;
using Slp.Evi.Storage.Relational.Query.Conditions.Filter;
using Slp.Evi.Storage.Relational.Query.Expressions;
using Xunit;

namespace Slp.Evi.Test.Unit.Relational.PostProcess.Optimizers
{
    public class ConstantExpressionEqualityTest
        : BaseOptimizerTest<object>
    {
        private ConstantExpressionEqualityOptimizer _optimizer = new ConstantExpressionEqualityOptimizer(NullLogger<ConstantExpressionEqualityOptimizer>.Instance);

        [Fact]
        public void ConstantEquality_SameStrings_Prefix()
        {
            var queryContext = GenerateQueryContext();

            var left = new ConstantExpression("http://s.com/", queryContext);
            var right = new ConstantExpression("http://s.com/", queryContext);

            var condition = new ComparisonCondition(left, right, ComparisonTypes.EqualTo);

            var result = _optimizer.TransformFilterCondition(condition, GetContext(queryContext));

            var expected = new AlwaysTrueCondition();

            AssertFilterConditionsEqual(expected, result);
        }

        [Fact]
        public void ConstantEquality_StringDifferents_Prefix()
        {
            var queryContext = GenerateQueryContext();

            var left = new ConstantExpression("http://s.com/", queryContext);
            var right = new ConstantExpression("http://s.com/2", queryContext);

            var condition = new ComparisonCondition(left, right, ComparisonTypes.EqualTo);

            var result = _optimizer.TransformFilterCondition(condition, GetContext(queryContext));

            var expected = new AlwaysFalseCondition();

            AssertFilterConditionsEqual(expected, result);
        }

        [Fact]
        public void ConstantEquality_DifferentType_Prefix()
        {
            var queryContext = GenerateQueryContext();

            var left = new ConstantExpression("2", queryContext);
            var right = new ConstantExpression(2, queryContext);

            var condition = new ComparisonCondition(left, right, ComparisonTypes.EqualTo);

            var result = _optimizer.TransformFilterCondition(condition, GetContext(queryContext));

            var expected = new AlwaysFalseCondition();

            AssertFilterConditionsEqual(expected, result);
        }
    }
}


text:
package org.apache.camel.component.ehcache.processor.idempotent;

import org.apache.camel.api.management.ManagedAttribute;
import org.apache.camel.api.management.ManagedOperation;
import org.apache.camel.api.management.ManagedResource;
import org.apache.camel.component.ehcache.EhcacheManager;
import org.apache.camel.spi.IdempotentRepository;
import org.apache.camel.support.service.ServiceSupport;
import org.ehcache.Cache;
import org.ehcache.CacheManager;

@ManagedResource(description = "Ehcache based message id repository")
public class EhcacheIdempotentRepository extends ServiceSupport implements IdempotentRepository {

    private String cacheName;
    private Cache<String, Boolean> cache;
    private EhcacheManager cacheManager;

    public EhcacheIdempotentRepository(CacheManager cacheManager) {
        this(cacheManager, EhcacheIdempotentRepository.class.getSimpleName());
    }

    public EhcacheIdempotentRepository(CacheManager cacheManager, String repositoryName) {
        this.cacheName = repositoryName;
        this.cacheManager = new EhcacheManager(cacheManager, false, null);
    }

    @ManagedAttribute(description = "The processor name")
    public String getCacheName() {
        return cacheName;
    }

    @Override
    @ManagedOperation(description = "Adds the key to the store")
    public boolean add(String key) {
        return cache.putIfAbsent(key, false) == null;
    }

    @Override
    public boolean confirm(String key) {
        return cache.replace(key, false, true);
    }

    @Override
    @ManagedOperation(description = "Does the store contain the given key")
    public boolean contains(String key) {
        return this.cache.containsKey(key);
    }

    @Override
    @ManagedOperation(description = "Remove the key from the store")
    public boolean remove(String key) {
        cache.remove(key);
        return true;
    }

    @Override
    @ManagedOperation(description = "Clear the store")
    public void clear() {
        cache.clear();
    }

    @Override
    protected void doStart() throws Exception {
        cacheManager.start();
        cache = cacheManager.getCache(cacheName, String.class, Boolean.class);
    }

    @Override
    protected void doStop() throws Exception {
        cacheManager.stop();
    }
}


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">

        <title>Galería | Graciela Holguín</title>
        <meta name="description" content="Beautiful gallery of products.">
        <meta name="viewport" content="width=device-width, initial-scale=1">

            <meta property="fb:admins" content="YOUR_ID_ADMIN_OF_THE_APP" />
            <meta property="fb:app_id" content="PLACE_YOUR_ID" />

            <meta property="og:title" content="PLACE_YOUR_TITLE" />
            <meta property="og:site_name" content="PLACE_YOUR_SITE_NAME"/>
            <meta property="og:url" content="PLACE_YOUR_OFFICIAL_URL" />
            <meta property="og:description" content="This is a collaboration with 'Los Feos Studio'; a solution for small business who wants to promote their products online with an affordable but professional approach. The template is fully customizable in order to be flexible for all kind of industries." />

            <meta property="og:type" content="website" />

            <meta property="og:locale" content="es_MX" />

            <meta property="og:image" content="" />

        <link rel="apple-touch-icon" href="apple-touch-icon.png">

        <link rel="icon" type="image/png" href="favicon.png">

        <link rel="stylesheet" href="../css/normalize.css">
        <link rel="stylesheet" href="../css/main.css">
        <link rel="stylesheet" href="../css/styling.css">

Lookbook

Colección 1

Gotas

Colección 2

Dulce Noche

Shop

Chokers

Brazaletes

Anillos

About

Contact

Aretes

Aretes

$0.00

Aretes 2

$0.00

Aretes Cadena

$0.00

Aretes Cadena 2

$0.00

Aretes Gotas

$0.00

Aretes Gotas 2

$0.00

Colección 1

Gotas


text:
module Settings.StaticFiles where

import Prelude (IO)
import Yesod.Static
import qualified Yesod.Static as Static
import Core.Settings (staticDir)
import Settings.Development
import Language.Haskell.TH (Q, Exp, Name)
import Data.Default (def)

-- | use this to create your static file serving site
staticSite :: IO Static.Static
staticSite = if development then Static.staticDevel staticDir
                            else Static.static      staticDir

-- | This generates easy references to files in the static directory at compile time,
--   giving you compile-time verification that referenced files exist.
--   Warning: any files added to your static directory during run-time can't be
--   accessed this way. You'll have to use their FilePath or URL to access them.
$(staticFiles Core.Settings.staticDir)

combineSettings :: CombineSettings
combineSettings = def

-- The following two functions can be used to combine multiple CSS or JS files
-- at compile time to decrease the number of http requests.
-- Sample usage (inside a Widget):
--
-- > $(combineStylesheets 'StaticR [style1_css, style2_css])

combineStylesheets :: Name -> [Route Static] -> Q Exp
combineStylesheets = combineStylesheets' development combineSettings

combineScripts :: Name -> [Route Static] -> Q Exp
combineScripts = combineScripts' development combineSettings


text:
Before we WRITE our RESPONSE , let's WRITE to our RESPONSE the STATUS LINE and some REPONSE HEADERS. Remember the request line and status line:

REQUEST LINE
GET / HTTP/1.1
method SP request-target SP HTTP-version CRLF
https://tools.ietf.org/html/rfc7230#section-3.1.1

RESPONSE (STATUS) LINE
HTTP/1.1 302 Found
HTTP-version SP status-code SP reason-phrase CRLF
https://tools.ietf.org/html/rfc7230#section-3.1.2

Write the following strings to the response - use io.WriteString for all of the following except the second and third:

"HTTP/1.1 200 OK\r\n"

fmt.Fprintf(c, "Content-Length: %d\r\n", len(body))

fmt.Fprint(c, "Content-Type: text/plain\r\n")

"\r\n"

Look in your browser "developer tools" under the network tab. Compare the RESPONSE HEADERS from the previous file with the RESPONSE HEADERS in your new solution.


text:
#include "Bomb.h"
#include "Fire.h"
#include "src/common/GameEngine.h"

namespace common {
namespace entity {

Bomb::Bomb(QPoint position, quint32 set_time, quint32 explosion_time, int power)
 :  Entity(position, true, false, "res/bomb.png"),
    set_time_(set_time),
    explosion_time_(explosion_time),
    power_(power) {
}

quint32 Bomb::GetSetTime() const {
	return set_time_;
}

quint32 Bomb::GetExplosionTime() const {
	return explosion_time_;
}

void Bomb::HitByFire(GameEngine* game_engine) {
  /* Called when entity is hit by fire. */
  explode(game_engine);
}

void Bomb::explode(GameEngine* game_engine) {
	game_engine->AddFireFromAtoB(GetPosition(), GetPosition() + QPoint(0, -power_));
	game_engine->AddFireFromAtoB(GetPosition(), GetPosition() + QPoint(power_, 0));
	game_engine->AddFireFromAtoB(GetPosition(), GetPosition() + QPoint(0, power_));
	game_engine->AddFireFromAtoB(GetPosition(), GetPosition() + QPoint(-power_, 0));

  // remove the bomb
  should_be_removed_ = true;
}

void Bomb::Update(GameEngine* game_engine, int t) {
/* Method to be called at every frame.
   t : duration of the frame in ms */
  (void) t;
  if ((quint32) QTime::currentTime().msec() >= this->GetExplosionTime()) {// TODO : change to use the game clock
    this->explode(game_engine);
  }
}

bool Bomb::operator==(const Bomb& other) const {
  return Entity::operator==(other)&& set_time_ == other.set_time_ && explosion_time_ == other.explosion_time_ && power_ == other.power_;
}

void Bomb::Serialize(QDataStream& stream) const {
  SerializeBaseEntity(stream, EntityId::kBombId);
  stream << set_time_;
  stream << explosion_time_;
  stream << (quint8) power_;
}

}
}


text:
using System;

namespace Aidon.Tools.Gollum.Bugzilla
{
    [Serializable]
    public class BugzillaException : Exception
    {
        public BugzillaException(string message) : base(message) { }
        public BugzillaException(string message, Exception innerException) : base(message, innerException) { }
    }
}


text:
package main

import (
	"fmt"

	"github.com/davecgh/go-spew/spew"
	"github.com/ninjasphere/driver-block/arduino"
	"github.com/ninjasphere/go-ninja/config"
	"github.com/ninjasphere/go-ninja/devices"
	"github.com/ninjasphere/go-ninja/model"
)

func NewLight(driver *Driver, D int, name string, port *arduino.Arduino) error {
	light, err := devices.CreateLightDevice(driver, &model.Device{
		NaturalID:     fmt.Sprintf("%s-%d", config.Serial(), D),
		NaturalIDType: "block-arduino",
		Name:          &name,
		Signatures: &map[string]string{
			"ninja:manufacturer": "Ninja Blocks Inc",
			"ninja:productType":  "Light",
			"ninja:thingType":    "light",
		},
	}, driver.Conn)

	if err != nil {
		log.FatalError(err, "Could not create light device")
	}

	if err := light.EnableOnOffChannel(); err != nil {
		log.FatalError(err, "Could not enable hue on-off channel")
	}

	if err := light.EnableBrightnessChannel(); err != nil {
		log.FatalError(err, "Could not enable hue brightness channel")
	}

	if err := light.EnableColorChannel("temperature", "hue"); err != nil {
		log.FatalError(err, "Could not enable color channel")
	}

	port.OnDeviceData(func(data arduino.DeviceData) {
		if data.D == D {
			spew.Dump("Light Data!", data)
		}
	})

	return nil
}


text:
package org.innovateuk.ifs.management.review.controller;

import org.innovateuk.ifs.BaseControllerMockMVCTest;
import org.innovateuk.ifs.competition.resource.CompetitionResource;
import org.innovateuk.ifs.invite.resource.AssessorInviteSendResource;
import org.innovateuk.ifs.invite.resource.AssessorInvitesToSendResource;
import org.innovateuk.ifs.management.invite.form.ResendInviteForm;
import org.innovateuk.ifs.management.invite.form.SendInviteForm;
import org.innovateuk.ifs.management.invite.viewmodel.SendInvitesViewModel;
import org.innovateuk.ifs.management.review.form.ReviewOverviewSelectionForm;
import org.innovateuk.ifs.review.service.ReviewInviteRestService;
import org.innovateuk.ifs.util.CompressedCookieService;
import org.innovateuk.ifs.util.JsonUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.test.context.TestPropertySource;

import javax.servlet.http.Cookie;
import java.util.Arrays;
import java.util.List;

import static com.google.common.primitives.Longs.asList;
import static java.lang.String.format;
import static java.util.Collections.singletonList;
import static org.innovateuk.ifs.commons.rest.RestResult.restSuccess;
import static org.innovateuk.ifs.competition.builder.CompetitionResourceBuilder.newCompetitionResource;
import static org.innovateuk.ifs.competition.resource.CompetitionStatus.IN_ASSESSMENT;
import static org.innovateuk.ifs.invite.builder.AssessorInviteSendResourceBuilder.newAssessorInviteSendResource;
import static org.innovateuk.ifs.invite.builder.AssessorInvitesToSendResourceBuilder.newAssessorInvitesToSendResource;
import static org.innovateuk.ifs.util.CollectionFunctions.asLinkedSet;
import static org.innovateuk.ifs.util.CompressionUtil.getCompressedString;
import static org.innovateuk.ifs.util.CookieTestUtil.setupCompressedCookieService;
import static org.mockito.Mockito.*;
import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

@RunWith(MockitoJUnitRunner.Silent.class)
public class ReviewSendInviteControllerTest extends BaseControllerMockMVCTest<ReviewSendInviteController> {

    private CompetitionResource competition;

    @Mock
    private CompressedCookieService cookieUtil;

    @Mock
    private ReviewInviteRestService reviewInviteRestService;

    @Override
    protected ReviewSendInviteController supplyControllerUnderTest() {
        return new ReviewSendInviteController();
    }

    @Before
    public void setUp() {
        setupCompressedCookieService(cookieUtil);

        competition = newCompetitionResource()
                .withCompetitionStatus(IN_ASSESSMENT)
                .withName("Technology inspired")
                .withInnovationSectorName("Infrastructure systems")
                .withInnovationAreaNames(asLinkedSet("Transport Systems", "Urban living"))
                .build();
    }

    @Test
    public void getInvitesToSend() throws Exception {
        long competitionId = 1L;

        AssessorInvitesToSendResource invites = newAssessorInvitesToSendResource()
                .withRecipients(singletonList("Jessica Doe"))
                .withCompetitionId(competitionId)
                .withCompetitionName("Photonics for health")
                .withContent("Readonly content")
                .build();

        when(reviewInviteRestService.getAllInvitesToSend(competitionId)).thenReturn(restSuccess(invites));

        SendInviteForm expectedForm = new SendInviteForm();
        expectedForm.setSubject("Invitation to assessment panel for 'Photonics for health'");

        SendInvitesViewModel expectedViewModel = new SendInvitesViewModel(competitionId, "Photonics for health", singletonList( "Jessica Doe"), "Readonly content");

        mockMvc.perform(get("/panel/competition/{competitionId}/assessors/invite/send", competitionId))
                .andExpect(status().isOk())
                .andExpect(model().attribute("form", expectedForm))
                .andExpect(model().attribute("model", expectedViewModel))
                .andExpect(view().name("assessors/panel-send-invites"));

        verify(reviewInviteRestService, only()).getAllInvitesToSend(competitionId);
    }

    @Test
    public void getInvitesToResend() throws Exception {
        List<Long> inviteIds = asList(1L, 2L);
        List<String> recipients = Arrays.asList("Jessica Doe", "Fred Smith");
        AssessorInvitesToSendResource invite = newAssessorInvitesToSendResource()
                .withRecipients(recipients)
                .withCompetitionId(competition.getId())
                .withCompetitionName("Photonics for health")
                .withContent("Readonly content")
                .build();

        ReviewOverviewSelectionForm expectedSelectionForm = new ReviewOverviewSelectionForm();
        expectedSelectionForm.setSelectedInviteIds(inviteIds);
        Cookie selectionFormCookie = createFormCookie(expectedSelectionForm);

        when(reviewInviteRestService.getAllInvitesToResend(competition.getId(), inviteIds)).thenReturn(restSuccess(invite));

        ResendInviteForm expectedForm = new ResendInviteForm();
        expectedForm.setSubject("Invitation to assessment panel for 'Photonics for health'");
        expectedForm.setInviteIds(inviteIds);

        SendInvitesViewModel expectedViewModel = new SendInvitesViewModel(competition.getId(), "Photonics for health", recipients, "Readonly content");

        mockMvc.perform(post("/panel/competition/{competitionId}/assessors/invite/reviewResend", competition.getId())
                .cookie(selectionFormCookie))
                .andExpect(status().isOk())
                .andExpect(model().attribute("form", expectedForm))
                .andExpect(model().attribute("model", expectedViewModel))
                .andExpect(view().name("assessors/panel-resend-invites"));

        verify(reviewInviteRestService, only()).getAllInvitesToResend(competition.getId(), inviteIds);
    }

    @Test
    public void sendInvites() throws Exception {
        long competitionId = 5L;

        AssessorInviteSendResource expectedAssessorInviteSendResource = newAssessorInviteSendResource()
                .withSubject("Subject...")
                .withContent("Editable content...")
                .build();

        when(reviewInviteRestService.sendAllInvites(competitionId, expectedAssessorInviteSendResource)).thenReturn(restSuccess());

        mockMvc.perform(post("/panel/competition/{competitionId}/assessors/invite/send", competitionId)
                .contentType(APPLICATION_FORM_URLENCODED)
                .param("subject", "Subject...")
                .param("content", "Editable content..."))
                .andExpect(status().is3xxRedirection())
                .andExpect(redirectedUrl(format("/assessment/panel/competition/%s/assessors/pending-and-declined", competitionId)));

        InOrder inOrder = inOrder(reviewInviteRestService);
        inOrder.verify(reviewInviteRestService).sendAllInvites(competitionId, expectedAssessorInviteSendResource);
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void resendInvites() throws Exception {
        List<Long> inviteIds = asList(1L, 2L);

        AssessorInvitesToSendResource invite = newAssessorInvitesToSendResource().withCompetitionId(competition.getId()).build();

        AssessorInviteSendResource expectedAssessorInviteSendResource = newAssessorInviteSendResource()
                .withSubject("Subject...")
                .withContent("Editable content...")
                .build();

        when(reviewInviteRestService.resendInvites(inviteIds, expectedAssessorInviteSendResource)).thenReturn(restSuccess());

        mockMvc.perform(post("/panel/competition/{competitionId}/assessors/invite/resend", competition.getId())
                .contentType(APPLICATION_FORM_URLENCODED)
                .param("inviteIds[0]", inviteIds.get(0).toString())
                .param("inviteIds[1]", inviteIds.get(1).toString())
                .param("subject", "Subject...")
                .param("content", "Editable content..."))
                .andExpect(status().is3xxRedirection())
                .andExpect(redirectedUrl(format("/assessment/panel/competition/%s/assessors/pending-and-declined?page=0", competition.getId())));

        InOrder inOrder = inOrder(reviewInviteRestService);
        inOrder.verify(reviewInviteRestService).resendInvites(inviteIds, expectedAssessorInviteSendResource);
        inOrder.verifyNoMoreInteractions();
    }

    private Cookie createFormCookie(ReviewOverviewSelectionForm form) throws Exception {
        String cookieContent = JsonUtil.getSerializedObject(form);
        return new Cookie(format("assessorPanelOverviewSelectionForm_comp_%s", competition.getId()), getCompressedString(cookieContent));
    }
}


text:
package main

import (
	"flag"
	"fmt"
	"math"

	"github.com/hyperledger/fabric/orderer/common/bootstrap/provisional"
	"github.com/hyperledger/fabric/orderer/localconfig"
	cb "github.com/hyperledger/fabric/protos/common"
	ab "github.com/hyperledger/fabric/protos/orderer"
	"github.com/hyperledger/fabric/protos/utils"
	"golang.org/x/net/context"
	"google.golang.org/grpc"
)

type deliverClient struct {
	client  ab.AtomicBroadcast_DeliverClient
	chainID string
}

func newDeliverClient(client ab.AtomicBroadcast_DeliverClient, chainID string) *deliverClient {
	return &deliverClient{client: client, chainID: chainID}
}

func seekHelper(chainID string, start *ab.SeekPosition) *cb.Envelope {
	return &cb.Envelope{
		Payload: utils.MarshalOrPanic(&cb.Payload{
			Header: &cb.Header{
				ChainHeader: &cb.ChainHeader{
					ChainID: chainID,
				},
				SignatureHeader: &cb.SignatureHeader{},
			},

			Data: utils.MarshalOrPanic(&ab.SeekInfo{
				Start:    &ab.SeekPosition{Type: &ab.SeekPosition_Oldest{Oldest: &ab.SeekOldest{}}},
				Stop:     &ab.SeekPosition{Type: &ab.SeekPosition_Specified{Specified: &ab.SeekSpecified{Number: math.MaxUint64}}},
				Behavior: ab.SeekInfo_BLOCK_UNTIL_READY,
			}),
		}),
	}
}

func (r *deliverClient) seekOldest() error {
	return r.client.Send(seekHelper(r.chainID, &ab.SeekPosition{Type: &ab.SeekPosition_Oldest{Oldest: &ab.SeekOldest{}}}))
}

func (r *deliverClient) seekNewest() error {
	return r.client.Send(seekHelper(r.chainID, &ab.SeekPosition{Type: &ab.SeekPosition_Newest{Newest: &ab.SeekNewest{}}}))
}

func (r *deliverClient) seek(blockNumber uint64) error {
	return r.client.Send(seekHelper(r.chainID, &ab.SeekPosition{Type: &ab.SeekPosition_Specified{Specified: &ab.SeekSpecified{Number: blockNumber}}}))
}

func (r *deliverClient) readUntilClose() {
	for {
		msg, err := r.client.Recv()
		if err != nil {
			fmt.Println("Error receiving:", err)
			return
		}

		switch t := msg.Type.(type) {
		case *ab.DeliverResponse_Status:
			fmt.Println("Got status ", t)
			return
		case *ab.DeliverResponse_Block:
			fmt.Println("Received block: ", t.Block)
		}
	}
}

func main() {
	config := config.Load()

	var chainID string
	var serverAddr string

	flag.StringVar(&serverAddr, "server", fmt.Sprintf("%s:%d", config.General.ListenAddress, config.General.ListenPort), "The RPC server to connect to.")
	flag.StringVar(&chainID, "chainID", provisional.TestChainID, "The chain ID to deliver from.")
	flag.Parse()

	conn, err := grpc.Dial(serverAddr, grpc.WithInsecure())
	if err != nil {
		fmt.Println("Error connecting:", err)
		return
	}
	client, err := ab.NewAtomicBroadcastClient(conn).Deliver(context.TODO())
	if err != nil {
		fmt.Println("Error connecting:", err)
		return
	}

	s := newDeliverClient(client, chainID)
	err = s.seekOldest()
	if err != nil {
		fmt.Println("Received error:", err)
	}

	s.readUntilClose()
}


text:
namespace Lucene.Net.Facet.SortedSet
{

    using Field = Lucene.Net.Documents.Field;
    using FieldType = Lucene.Net.Documents.FieldType;

    /// <summary>
    /// Add an instance of this to your <see cref="Documents.Document"/> for every facet
    /// label to be indexed via <see cref="Index.SortedSetDocValues"/>.
    /// </summary>
    public class SortedSetDocValuesFacetField : Field
    {
        /// <summary>
        /// Indexed <see cref="FieldType"/>. </summary>
        public static readonly FieldType TYPE = new FieldType();
        static SortedSetDocValuesFacetField()
        {
            TYPE.IsIndexed = true;
            TYPE.Freeze();
        }

        /// <summary>
        /// Dimension. </summary>
        public string Dim { get; private set; }

        /// <summary>
        /// Label. </summary>
        public string Label { get; private set; }

        /// <summary>
        /// Sole constructor. </summary>
        public SortedSetDocValuesFacetField(string dim, string label)
            : base("dummy", TYPE)
        {
            FacetField.VerifyLabel(label);
            FacetField.VerifyLabel(dim);
            this.Dim = dim;
            this.Label = label;
        }

        public override string ToString()
        {
            return "SortedSetDocValuesFacetField(dim=" + Dim + " label=" + Label + ")";
        }
    }
}


text:
<?php

/**
 * Module Name: Comments
 * Module Description: Let readers comment with WordPress.com, Twitter, Facebook, or Google+ accounts.
 * First Introduced: 1.4
 * Sort Order: 20
 * Requires Connection: Yes
 * Auto Activate: No
 * Module Tags: Social
 */

require dirname( __FILE__ ) . '/comments/comments.php';

if ( is_admin() ) {
	require dirname( __FILE__ ) . '/comments/admin.php';
}

Jetpack_Sync::sync_options( __FILE__,
	'comment_registration',
	'require_name_email',
	'show_avatars',
	'avatar_default',
	'highlander_comment_form_prompt',
	'jetpack_comment_form_color_scheme'
);

function jetpack_comments_load() {
	Jetpack::enable_module_configurable( __FILE__ );
	Jetpack::module_configuration_load( __FILE__, 'jetpack_comments_configuration_load' );
}

function jetpack_comments_configuration_load() {
	wp_safe_redirect( admin_url( 'options-discussion.php#jetpack-comments-settings' ) );
	exit;
}

add_action( 'jetpack_modules_loaded', 'jetpack_comments_load' );

Jetpack::dns_prefetch( array(
	'//jetpack.wordpress.com',
	'//s0.wp.com',
	'//s1.wp.com',
	'//s2.wp.com',
	'//public-api.wordpress.com',
	'//0.gravatar.com',
	'//1.gravatar.com',
	'//2.gravatar.com',
) );