text:
import {container} from './inversify.config';
import {CommanderStatic} from 'commander';
import {Subscription} from 'rxjs/Subscription';
import * as http from 'http';
import * as https from 'https';
import {TestSuiteConfig} from './regression/suite/config/test-suite-config';
import {RegressionResultSet} from './regression/result/regression-result-set';
import {TestSuiteFactory} from './regression/suite/test-suite-factory';
import {SiregExecutor} from './regression/flow/sireg-executor';
import {TestSuiteConfigFactory} from './regression/suite/config/test-suite-config-factory';
import strftime = require('strftime');
import winston = require('winston');
import {SiregError} from './exception/sireg-error';

// == configure logger
winston.remove(winston.transports.Console);
winston.add(winston.transports.Console, {
    prettyPrint: true,
    level: process.env.LOG_LEVEL || 'debug',
    colorize: true,
    silent: false,
    stderrLevels: [],
    timestamp: () => strftime('%F %T.%L')
});

const sireg: CommanderStatic = require('commander');

// == define CLI commands
sireg
    .version('0.3.1');

sireg.command('test <config>')
    .description('Execute the given test suite JSON file')
    .action(async (configFile: string) => {
        const config: TestSuiteConfig = TestSuiteConfigFactory.fromFile(configFile);
        await handleCommand(config);
    });

const execCmd: any = sireg.command('exec');
execCmd
    .description('Define a simple test suite through CLI options')

    // loaders
    .option('--loader-sitemap', '[Loader/Sitemap] Enable the sitemap loader')
    .option('--loader-sitemap-sitemap <sitemap>', '[Loader/Sitemap] The URL to the sitemap')
    .option('--loader-file', '[Loader/File] Enable the file loader')
    .option('--loader-file-path <path>', '[Loader/File] The path to the file containing the URLs to be tested')
    .option('--loader-csv', '[Loader/CSV] Enable the CSV loader')
    .option('--loader-csv-path <path>', '[Loader/CSV] The path to the CSV file containing the URLs to be tested')

    // replacers
    .option('--replacer-static', '[Replacer/Static] Enable the static replacer')
    .option('--replacer-static-replace <replace>', '[Replacer/Static] The string to replace in each URL being tested')
    .option('--replacer-static-with <with>', '[Replacer/Static] The value to replace each match of the URLs being tested')

    .action(async () => {
        const config: TestSuiteConfig = TestSuiteConfigFactory.fromCommanderOptions(execCmd.opts()) as any;
        await handleCommand(config);

    });

if (!process.argv.slice(2).length) {
    sireg.outputHelp();
}
sireg.parse(process.argv);

async function handleCommand(config: TestSuiteConfig): Promise<void> {
    try {
        await siregExec(config);
    } catch (e) {
        if (e instanceof SiregError) {
            winston.error(`${e.message}`);
        } else {
            winston.error(`Unexpected critical error occucured. Stack trace:\n ${e.stack}`);
        }
        process.exit(1);
    }
}

async function siregExec(config: TestSuiteConfig): Promise<void> {
    winston.info('Starting sireg');

    // load config
    http.globalAgent.maxSockets = config.settings.concurrentRequests;
    https.globalAgent.maxSockets = config.settings.concurrentRequests;
    const testFactory: TestSuiteFactory = container.get(TestSuiteFactory);

    // find violations
    let resultSet: RegressionResultSet;
    let subscription: Subscription;
    await new Promise((acc, err) => {
        subscription = new SiregExecutor()
            .regressionTest(testFactory.factory(config))
            .subscribe(
                (result: RegressionResultSet) => resultSet = result,
                (err: any) => { throw err; },
                () => acc()
            );
    });
    subscription.unsubscribe();

    // print violations
    if (resultSet && (resultSet.hasViolations || resultSet.hasErrors)) {
        process.exit(1);
    } else {
        process.exit(0);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.Contracts;
using System.IO;
using System.Text;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.Linq.Expressions
{
  sealed public partial class SwitchCase
  {
    #region Methods and constructors
    private SwitchCase() {}

    [Pure]
    public SwitchCase Update (IEnumerable<Expression> testValues, Expression body)
    {
      Contract.Requires(body != null);
      Contract.Requires(testValues != null);
      Contract.Ensures(Contract.Result<SwitchCase>() != null);
      return default(SwitchCase);
    }
    #endregion

    #region Properties and indexers
    public Expression Body
    {
      get
      {
        Contract.Ensures(Contract.Result<Expression>() != null);
        return default(Expression);
      }
    }

    public ReadOnlyCollection<Expression> TestValues
    {
      get
      {
        Contract.Ensures(Contract.Result<ReadOnlyCollection<Expression>>() != null);
        Contract.Ensures(Contract.Result<ReadOnlyCollection<Expression>>().Count >= 1);
        return default(ReadOnlyCollection<Expression>);
      }
    }
    #endregion
  }
}
#endif

redpajama_set_name: RedPajamaGithub


text:
package gudusoft.gsqlparser.sql2xml.model;

import org.simpleframework.xml.Element;

public class window_partition_column_reference
{

	@Element
	private column_reference column_reference = new column_reference( );

	@Element(required = false)
	private collate_clause collate_clause;

	public collate_clause getCollate_clause( )
	{
		return collate_clause;
	}

	public void setCollate_clause( collate_clause collate_clause )
	{
		this.collate_clause = collate_clause;
	}

	public column_reference getColumn_reference( )
	{
		return column_reference;
	}

}


text:
BigQuery ThreadPoolExecutor Example Code
==========================

[![Build
Status](https://api.travis-ci.org/cobookman/bigquery-threadpool-example.svg?branch=master)](https://travis-ci.org/cobookman/bigquery-threadpool-example)

Example code on using a ThreadPoolExecutor to have a First in First Out Queue of Queries
which are handled by N worker threads.

This is not an official Google product. This is not covered by Google Support,
and comes with no SLA / Warrenty. Its been provided as an example / starting
point for limiting the number of concurrent BigQuery Queries through use of a
ThreadPool & FIFO Queue.

Quickstart
----------

1) Clone this repo and copy the all files in `src/main/com/google/bqq/` to your project source directory,
   under the same path.

2) Add the Google [Cloud BigQuery Java SDK](https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-bigquery)
   to your Maven or gradle build. You can find instructions on how to do this [here](https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-bigquery#quickstart).

3) If you'd like to use a service account, make sure to create one and download it and keep tabs on the path its stored in.

Example Applications
--------------------

* [Async Query Execution](https://github.com/cobookman/bigquery-threadpool-example/blob/master/src/main/java/com/google/bqqexamples/ExampleAsync.java):
  Queues up many queries to be executed, and then blocks until all queries are done. It also checks on the status of queries while they run to handle results. This is also possible using a [CompletionService](http://stackoverflow.com/questions/19348248/waiting-on-a-list-of-future)

* [Sync Query Execution](https://github.com/cobookman/bigquery-threadpool-example/blob/master/src/main/java/com/google/bqqexamples/ExampleSync.java):
  Queues up a query then blocks til completion.

* [Stress Test](https://github.com/cobookman/bigquery-threadpool-example/blob/master/src/main/java/com/google/bqqexamples/ExampleStressTest.java):
  Queues up many queries, and many worker threads to stress test this library. In this example there's 100 BQ Queries and 40 concurrent workers.

# How to Use

## Creating a Client:

### Using a service account

Both a project Id and absolute path to a service account need to be provided

```java
BQQClient c = new BQQClient("my-awesome-project", "/home/bookman/service_account.json");
```

### Using a default credentials

Here is some information on (Application Default Credentials)[https://developers.google.com/identity/protocols/application-default-credentials].

Basically when running this library on a Computer that has the gcloud utility installed, you do not need to specify a
service account to run against the same project Id that the gcloud utility is running against.

To setup the client simply run:

```java
BQQClient c = new BQQClient();
```

## Starting up the client

The BQQClient uses a [ThreadPoolExecutor](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html)
underneath to queue up BigQuery Requests. Before any jobs can be run the client needs to be started up.

This will also do a sanity check to make sure that either both a project Id & Service account are set, or that neither are set and
default credentials will be used instead.

Here is an example of us Starting up a Client with a maximum of 40 concurrent queries.

```java
BQQClient c = new BQQClient();
try {
    c.startup(numberOfConcurrentQueries);
} catch (IOException e) {
    // handle issue with loading credentials
    e.printStackTrace();
}
```

## Building a QueryRequest

The BigQuery SDK has a class called [QueryRequest](http://googlecloudplatform.github.io/google-cloud-java/0.10.0/apidocs/com/google/cloud/bigquery/QueryRequest.html).

These QueryRequest objects can be build using the QueryRequest factory method as shown below:

```java
QueryRequest queryRequest = QueryRequest.newBuilder("SELECT * FROM [bigquery-public-data:samples.shakespeare]")
    .setUseLegacySql(true)
    .setUseQueryCache(true)
    .build()
```

You can use this class to build [Parameterized Queries](https://cloud.google.com/bigquery/querying-data#running_parameterized_queries),
which prevent SQL injections:

```java
int minWordCount = 10;
String corpus = "tempest";
String parameterizedSql = "SELECT word, word_count "
    + "FROM `bigquery-public-data.samples.shakespeare` "
    + "WHERE corpus = @corpus "
    + "AND word_count >= @min_word_count "
    + "ORDER BY word_count DESC";

QueryRequest queryRequest = QueryRequest.newBuilder(parameterizedSql)
    .addNamedParameter("corpus", QueryParameterValue.string(corpus))
    .addNamedParameter("min_word_count", QueryParameterValue.int64(minWordCount))
    .setUseLegacySql(false)
    .build();
```

## Queuing a Query

All Queries that are queued return a [Future](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html). This allows you to do work while you wait for the response.

### Using a QueryRequest

Here's how to queue up a QueryRequest. The Returned

```java
QueryRequest queryRequest = QueryRequest.newBuilder("SELECT * FROM [bigquery-public-data:samples.shakespeare]")
    .setUseLegacySql(true)
    .build()

Future<QueryResult> queryResultFuture = c.queue(queryRequest);
```

### Using a SQL Statement String

If you just want to queue up a SQL statement and you are ok with the default QueryRequest options,
then you can...

```java
Future<QueryResult> queryResultFuture = c.queue("SELECT * FROM [bigquery-public-data:samples.shakespeare]", true);
```

## Resolving a Future<QueryResult>

You can pass the `Future<QueryResult>` to the `BQQClient.getQueryResult` method.
This method deals with cleaning up exceptions thrown by the worker threads.
It will also block until a response is ready.

```java
Future<QueryResult> queryResultFuture = c.queue("SELECT * FROM [bigquery-public-data:samples.shakespeare]", true);
QueryResult queryResult = BQQClient.getQueryResult(queryResultFuture);
```

## Shutting down Client

Before shutting down the client you'll want to wait till all running jobs are completed.
This can be done by using the `BQQClient.shutdown` method.

You can specify a time to wait till forcing the threads to be killed by JVM

```java
c.shutdown(3000); // give threads 3000ms (3 second) to finish their task before forcing a shutdown
```

Or you can just use the default timeout time of 1000ms

```java
c.shutdown();
```

## Handling Exceptions

Let's say you ended up running into a BigQuery Error. Maybe due to an invalid query, auth issue, or exceeding
2000 slots. These errors are all captured by this client and easily handled.

You can find a [list of error codes in our docs](https://cloud.google.com/bigquery/troubleshooting-errors).
In the `BigQueryError` class the method `getReason()` will
return an Error Code such-as `accessDenied` or `quotaExceeded`.

In this case there is a missing parameter in the query.

```java
BQQClient c = new BQQClient();
c.startup(1);

// this should be a failing query, parameters not all set, missing corpus.
int minWordCount = 10;
String parameterizedSql = "SELECT word, word_count "
    + "FROM `bigquery-public-data.samples.shakespeare` "
    + "WHERE corpus = @corpus "
    + "AND word_count >= @min_word_count "
    + "ORDER BY word_count DESC";

QueryRequest parameterizedQueryRequest = QueryRequest
    .newBuilder(parameterizedSql)

    // Missing the @corpus parameter
    .addNamedParameter("min_word_count", QueryParameterValue.int64(minWordCount))
    .setUseLegacySql(false)
    .build();

Future<QueryResult> f = c.queueQuery(parameterizedQueryRequest);

try {
    BQQClient.getQueryResult(f);
} catch (BQQException e) {
for (BigQueryError be : errs.getBQErrors()) {
        if (be.getReason().contains("invalidQuery")) {
            ...
        } else if (be.getReason().contains("quotaExceeded")) {
            ...
        } else if (be.getReason().contains("rateLimitExceeded")) {
            ...
        } else if (be.getReason().contains("resourcesExceeded")) {
            ...
        }
    }
}
```

## A Complete Example

Here's this all put together in a complete example:

```java
BQQClient c = new BQQClient();
c.startup(10);

int minWordCount = 10;
String corpus = "tempest";
String parameterizedSql = "SELECT word, word_count "
    + "FROM `bigquery-public-data.samples.shakespeare` "
    + "WHERE corpus = @corpus "
    + "AND word_count >= @min_word_count "
    + "ORDER BY word_count DESC";

QueryRequest queryRequest1 = QueryRequest.newBuilder(parameterizedSql)
    .addNamedParameter("corpus", QueryParameterValue.string(corpus))
    .addNamedParameter("min_word_count", QueryParameterValue.int64(minWordCount))
    .setUseLegacySql(false)
    .build();

Future<QueryResult> qrf1 = qc.queue(queryRequest);
Future<QueryResult> qrf2 = c.queue("SELECT * FROM [bigquery-public-data:samples.shakespeare]", true);

/**
 * do some work, such-as render some HTML
 */

QueryResult queryResult1 = BQQClient.getQueryResult(qrf1);
QueryResult queryResult2 = BQQClient.getQueryResult(qrf2);

// Print out results
Iterator<List<FieldValue>> it = queryResult1.iterateAll();
System.out.println("First 100 Rows");
int maxRows = 100;
while (it.hasNext() && maxRows-- > 0) {
    List<FieldValue> row = iter.next();
    System.out.println(row);
}

/**
 * Do more work
 */

c.shutdown();
```

# Example Code

* [Example
  Async](https://github.com/cobookman/bigquery-threadpool-example/blob/master/src/main/java/com/google/bqqexamples/ExampleAsync.java)
  * This example queues up a bunch of queries, and then pulls the query results
    as they come in
* [Example
  Sync](https://github.com/cobookman/bigquery-threadpool-example/blob/master/src/main/java/com/google/bqqexamples/ExampleSync.java)
  * This example queues up a query, then blocks until it finishes.
* [Example Stress
  Test](https://github.com/cobookman/bigquery-threadpool-example/blob/master/src/main/java/com/google/bqqexamples/ExampleStressTest.java)
  * This example spins up 40 concurrent workers, and queues up 100 queries. It
    then blocks until its done. Testing that the code can indeed handle this
    kind of query volume, and allowing you to profile how many workers you'd
    want for a given query kind. Warning this example when run can incur
    significant billing.

# Building & Running Samples

To run the test suite simply run from the root folder:

```bash
$ gradle test --info
```

To run the samples (Warning can incur significant billing):

```bash
$ gradle run --info
```


text:
All Notable changes to `Albert221/blog` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [Unreleased]

### Added
- Nothing

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- Nothing

### Security
- Nothing


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if MONOMAC
using MonoMac.OpenAL;
#else
using OpenTK.Audio.OpenAL;
#endif

namespace Microsoft.Xna.Framework.Audio
{
    public sealed class DynamicSoundEffectInstance : SoundEffectInstance
    {
        private AudioChannels channels;
        private int sampleRate;
        private ALFormat format;
        private bool looped;
        private int pendingBufferCount;
        // Events
        public event EventHandler<EventArgs> BufferNeeded;

        internal void OnBufferNeeded(EventArgs args)
        {
            if (BufferNeeded != null)
            {
                BufferNeeded(this, args);
            }
        }

        public DynamicSoundEffectInstance(int sampleRate, AudioChannels channels)
        {
            this.sampleRate = sampleRate;
            this.channels = channels;
            switch (channels)
            {
                case AudioChannels.Mono:
                    this.format = ALFormat.Mono16;
                    break;
                case AudioChannels.Stereo:
                    this.format = ALFormat.Stereo16;
                    break;
                default:
                    break;
            }
        }

        public TimeSpan GetSampleDuration(int sizeInBytes)
        {
            throw new NotImplementedException();
        }

        public int GetSampleSizeInBytes(TimeSpan duration)
        {
            throw new NotImplementedException();
        }

        public override void Play()
        {
            throw new NotImplementedException();
        }

        public void SubmitBuffer(byte[] buffer)
        {
            this.SubmitBuffer(buffer, 0, buffer.Length);
        }

        public void SubmitBuffer(byte[] buffer, int offset, int count)
        {
            BindDataBuffer(buffer, format, count, sampleRate);
        }

        public override bool IsLooped
        {
            get
            {
                return looped;
            }

            set
            {
                looped = value;
            }
        }

        public int PendingBufferCount
        {
            get
            {
                return pendingBufferCount;
            }
            private set
            {
                pendingBufferCount = value;
            }
        }
    }

}


text:
.. list-table::

 * -  .. image:: images/nipype_architecture_overview2.png
         :width: 100 %
   -  .. container::

      Current neuroimaging software offer users an incredible opportunity to
      analyze data using a variety of different algorithms. However, this has
      resulted in a heterogeneous collection of specialized applications
      without transparent interoperability or a uniform operating interface.

      *Nipype*, an open-source, community-developed initiative under the
      umbrella of NiPy_, is a Python project that provides a uniform interface
      to existing neuroimaging software and facilitates interaction between
      these packages within a single workflow. Nipype provides an environment
      that encourages interactive exploration of algorithms from different
      packages (e.g., SPM_, FSL_, FreeSurfer_, Camino_, MRtrix_, MNE_, AFNI_,
      Slicer_), eases the design of workflows within and between packages, and
      reduces the learning curve necessary to use different packages. Nipype is
      creating a collaborative platform for neuroimaging software development
      in a high-level language and addressing limitations of existing pipeline
      systems.

      *Nipype* allows you to:

      * easily interact with tools from different software packages
      * combine processing steps from different software packages
      * develop new workflows faster by reusing common steps from old ones
      * process data faster by running it in parallel on many cores/machines
      * make your research easily reproducible
      * share your processing workflows with the community

.. admonition:: Reference

   Gorgolewski K, Burns CD, Madison C, Clark D, Halchenko YO, Waskom ML, Ghosh SS.
   (2011). Nipype: a flexible, lightweight and extensible neuroimaging data
   processing framework in Python. Front. Neuroimform. 5:13. `Download`__

   __ paper_

.. tip::

   To get started, click Quickstart above. The Links box on the right is
   available on any page of this website.

.. include:: links_names.txt