text:
from flask import Flask, redirect, url_for, render_template, flash, request, session, abort, jsonify, Response
from werkzeug.utils import secure_filename
import os
import pickle
import genomedb
import glob
import runner, runnable

app = Flask(__name__)
app.config.from_object(__name__)
app.config.update(dict(
    DEBUG=True,
    SECRET_KEY='development key',
    DATA_PATH='data',
    UPLOAD_FOLDER = 'data',
    HOST='0.0.0.0',
    PORT=5000
))

ALLOWED_EXTENSIONS = set(['fasta', 'gff', 'gz'])
def allowed_file(filename):
    return '.' in filename and \
           filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS

''' Jinja2 extensions '''
@app.context_processor
def utility_processor():
    def basename(path):
        return os.path.basename(path)
    return dict(basename = basename)

g_searches = {}
g_runner = runner.Runner()
g_datadb = genomedb.GenomeDB(app.config['DATA_PATH'])

def search_filename(uuid):
    ''' Assume uuid is safe as it was found in the g_searches map. '''
    return '%s/%s.pkl' % (runnable.RESULT_PATH, uuid)

def find_task(uuid):
    for search in g_searches.values():
        for task in search.task_list:
            if task.uid == uuid:
                return task
    return None

def remove_task(uuid):
    for search in g_searches.values():
        for task in search.task_list:
            if task.uid == uuid:
                # @todo Some destructor to remove data as well
                search.task_list.remove(task)
                if search.task_list == 0:
                    del g_searches[search.uid]
                return True
    return False

def make_search_persistent(uuid):
    if uuid in g_searches:
        search = g_searches[uuid]
        search.persistent = True
        pickle.dump(search, open(search_filename(uuid), 'wb'))

def make_search_volatile(uuid):
    if uuid in g_searches:
        search = g_searches.pop(uuid, None)
        os.remove(search_filename(uuid))

def load_persistent():
    for pkl in glob.glob(runnable.RESULT_PATH + '/*.pkl'):
        search = pickle.load(open(pkl, 'rb'))
        if len(search.task_list) > 0:
            g_searches[search.uid] = search

@app.errorhandler(404)
def page_not_found(error):
    return render_template('404.html'), 404

@app.route("/")
def index():
    if 'search_id' in session:
        if session['search_id'] in g_searches:
            return redirect(url_for('search', search_id = session['search_id']))
    return render_template('query.html', datasets = g_datadb.list(), runnables = g_runner.info_list())

@app.route('/upload_file', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        file = request.files['file']
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            return index()
    abort(404)

@app.route("/examples")
def examples():
    return render_template('examples.html', datasets = g_datadb.list(), runnables = g_runner.info_list())

@app.route("/saved")
def saved():
    return render_template('saved.html', searches = filter(lambda k: k.persistent, g_searches.values()), \
                           datasets = g_datadb.list(), runnables = g_runner.info_list())

@app.route('/query', methods=['POST'])
def query():
    # Decide if refining current search
    dataset = None
    if 'dataset' in request.form:
        dataset = request.form['dataset']
    elif 'uuid' in request.form:
        task = find_task(request.form['uuid'])
        if task is None:
            abort(404)
        dataset = task.data_out
    else:
        abort(404)

    # Run a new task
    task = g_runner.run(request.form['runner'], dataset, request.form)

    # Start a new session if not exists
    if ('search_id' not in session) or (session['search_id'] not in g_searches):
        session['search_id'] = task.uid
        g_searches[task.uid] = runnable.Search(task.uid)

    g_searches[ session['search_id'] ].task_list.insert(0, task)
    return redirect(url_for('search', search_id = session['search_id']))

@app.route('/reset')
def reset():
    if 'search_id' in session:
        uuid = session['search_id']
        if uuid in g_searches:
            if not g_searches[uuid].persistent:
                g_searches.pop(uuid, None)
    session.clear()
    return redirect(url_for('index'))

@app.route('/search/<search_id>')
def search(search_id):
    if not search_id in g_searches:
        abort(404)
    else:
        session['search_id'] = search_id
    return render_template('search.html', search = g_searches[search_id], datasets = g_datadb.list(), runnables = g_runner.info_list())

@app.route('/_result')
def _result():
    uuid = request.args.get('uuid', '', type=str)
    task = find_task(uuid)
    if not task:
        abort(404)
    return jsonify(task = task.pickle())

@app.route('/_remove')
def _remove():
    uuid = request.args.get('uuid', '', type=str)
    task_removed = remove_task(uuid)
    if not task_removed:
        abort(404)
    return jsonify(result = True)

@app.route('/_persist')
def _persist():
    uuid = request.args.get('uuid', '', type=str)
    state = request.args.get('state', 1, type=int)
    if state:
        make_search_persistent(uuid)
    else:
        make_search_volatile(uuid)
    return jsonify(result = True)

@app.route('/_call')
def _call():
    runner = request.args.get('runner', '', type=str)
    method = request.args.get('method', '', type=str)
    param  = request.args.getlist('param[]')
    param  = [str(item) for item in param]

    # Fetch a runnable instance
    runnable = g_runner.runnable(runner)
    callable = getattr(runnable, method)
    if not callable:
        abort(404)
    # Execute and return
    result = callable(param)
    return jsonify(result = result)

@app.route('/result/<uuid>')
def result(uuid):
    task = find_task(uuid)
    if not task:
        abort(404)
    return render_template('result.html', task = task)

@app.route('/getfile/<uuid>/<inout>')
def getfile(uuid, inout):
    task = find_task(uuid)
    if not task:
        abort(404)
    file_name = task.data_in
    if 'out' in inout:
        file_name = task.data_out
    file_object = open(file_name)
    def generate():
        yield file_object.read(4096)
    return Response(generate(), mimetype='text/plain')

if __name__ == "__main__":

    # Load pickled searches
    load_persistent()

    # Run app
    app.run(host = app.config['HOST'], port = app.config['PORT'])


text:
<?php

class Google_Service_AdExchangeBuyer_PerformanceReportList extends Google_Collection
{
  protected $collection_key = 'performanceReport';
  public $kind;
  protected $performanceReportType = 'Google_Service_AdExchangeBuyer_PerformanceReport';
  protected $performanceReportDataType = 'array';

  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setPerformanceReport($performanceReport)
  {
    $this->performanceReport = $performanceReport;
  }
  public function getPerformanceReport()
  {
    return $this->performanceReport;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Test\Functional\Endpoint\Profile;

use Test\Functional\AbstractFunctional;

class GatesTest extends AbstractFunctional {
    protected function setUp() {
        parent::setUp();
    }

    public function testListAll() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test 1', true);
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test 2', false);

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->listAll();

        foreach ($response['data'] as $gate) {
            if ($gate['name'] === 'Name Test 1') {
                $this->assertSame('name-test-1', $gate['slug']);
                $this->assertTrue($gate['pass']);
            }

            if ($gate['name'] === 'Name Test 2') {
                $this->assertSame('name-test-2', $gate['slug']);
                $this->assertFalse($gate['pass']);
            }
        }
    }

    public function testCreateNew() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test', true, 'confidence-level');

        $this->assertTrue($response['status']);
        $this->assertNotEmpty($response['data']);
        $this->assertNotEmpty($response['data']['creator']);
        $this->assertSame('Name Test', $response['data']['name']);
        $this->assertSame('name-test-confidence-level', $response['data']['slug']);
        $this->assertTrue($response['data']['pass']);
    }

    public function testCreateNewUtf8() {
        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Náme Tést', true);

        $this->assertFalse($response['status']);
        $this->assertNotEmpty($response['error']);
    }

    public function testGetOne() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test', true);

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->getOne('name-test');

        $this->assertTrue($response['status']);
        $this->assertNotEmpty($response['data']);
        $this->assertNotEmpty($response['data']['creator']);
        $this->assertSame('Name Test', $response['data']['name']);
        $this->assertSame('name-test', $response['data']['slug']);
        $this->assertTrue($response['data']['pass']);
    }

    public function testUpdateOne() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test', true, 'confidence-level');

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->updateOne('name-test-confidence-level', false);

        $this->assertTrue($response['status']);
        $this->assertNotEmpty($response['data']);
        $this->assertNotEmpty($response['data']['creator']);
        $this->assertSame('Name Test', $response['data']['name']);
        $this->assertSame('name-test-confidence-level', $response['data']['slug']);
        $this->assertFalse($response['data']['pass']);
    }

    public function testUpsertOne() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->upsertOne('Name Test', true);

        $this->assertTrue($response['status']);
        $this->assertNotEmpty($response['data']);
        $this->assertNotEmpty($response['data']['creator']);
        $this->assertSame('Name Test', $response['data']['name']);
        $this->assertSame('name-test', $response['data']['slug']);
        $this->assertTrue($response['data']['pass']);

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->upsertOne('Name Test1', true);

        $this->assertTrue($response['status']);
        $this->assertNotEmpty($response['data']);
        $this->assertNotEmpty($response['data']['creator']);
        $this->assertSame('Name Test1', $response['data']['name']);
        $this->assertSame('name-test1', $response['data']['slug']);
        $this->assertTrue($response['data']['pass']);
    }

    public function testDeleteOne() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test', true);

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteOne('name-test');

        $this->assertTrue($response['status']);
    }

    public function testDeleteAll() {
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test 1', true);
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test 2', false);
        $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->createNew('Name Test 3', true);

        $response = $this->sdk
            ->Profile($this->credentials['username'])
            ->Gates->deleteAll();

        $this->assertTrue($response['status']);
        $this->assertSame(3, $response['deleted']);
    }
}


text:
namespace ns_log { class LLParser; }

namespace config::sentinel {

class OutputConnection {
private:
    int _fd;
    LineSplitter _lines;
    ns_log::LLParser *_parser;

    // Unused constructors/assignment operator:
    OutputConnection();
    OutputConnection(const OutputConnection&);
    OutputConnection& operator =(const OutputConnection&);

public:
    explicit OutputConnection(int fd, ns_log::LLParser *p);
    ~OutputConnection();
    bool isFinished() const;
    void handleOutput();
    int fd() const { return _fd; }
};

}


text:
'use strict';

var gutil = require('gulp-util');
var exec = require('child_process').exec;
var escape = require('any-shell-escape');

module.exports = function (branch, opt, cb) {
  if (!cb && typeof opt === 'function') {
    // optional options
    cb = opt;
    opt = {};
  }
  if (!cb || typeof cb !== 'function') cb = function () {};
  if (!opt) opt = {};
  if (!branch) throw new Error('gulp-git: Branch name is require git.checkout("name")');
  if (!opt.args) opt.args = ' ';
  if (!opt.cwd) opt.cwd = process.cwd();

  var maxBuffer = opt.maxBuffer || 200*1024;

  var cmd = 'git checkout ' + opt.args + ' ' + escape([branch]);
  exec(cmd, {cwd: opt.cwd, maxBuffer: maxBuffer}, function(err, stdout, stderr){
    if (err) return cb(err);
    if (!opt.quiet) gutil.log(stdout, stderr);
    cb(null);
  });
};


text:
package com.amebame.triton.service.cassandra.method;

import java.util.List;

import javax.inject.Inject;

import com.amebame.triton.client.cassandra.entity.TritonCassandraKeyspace;
import com.amebame.triton.client.cassandra.method.CreateKeyspace;
import com.amebame.triton.client.cassandra.method.DescribeKeyspace;
import com.amebame.triton.client.cassandra.method.DropKeyspace;
import com.amebame.triton.client.cassandra.method.ListKeyspace;
import com.amebame.triton.server.TritonMethod;
import com.amebame.triton.service.cassandra.CassandraConverter;
import com.amebame.triton.service.cassandra.TritonCassandraClient;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Metadata;
import com.datastax.driver.core.Session;

public class TritonCassandraKeyspaceMethods {

	private TritonCassandraClient client;

	@Inject
	public TritonCassandraKeyspaceMethods(TritonCassandraClient client) {
		this.client = client;
	}

	@TritonMethod("cassandra.keyspace.list")
	public List<TritonCassandraKeyspace> listKeyspaces(ListKeyspace data) {
		Cluster cluster = client.getCluster(data.getCluster());
		return CassandraConverter.toKeyspaceList(cluster.getMetadata().getKeyspaces(), true);
	}

	@TritonMethod("cassandra.keyspace.detail")
	public TritonCassandraKeyspace describeKeyspace(DescribeKeyspace describe) {
		Cluster cluster = client.getCluster(describe.getCluster());
		Metadata meta = cluster.getMetadata();
		return CassandraConverter.toKeyspace(meta.getKeyspace(describe.getKeyspace()));
	}

	@TritonMethod("cassandra.keyspace.create")
	public boolean createKeyspace(CreateKeyspace create) {

		StringBuilder query = new StringBuilder("CREATE KEYSPACE ")
		.append(create.getKeyspace())
		.append(" WITH REPLICATION = ");

		if (create.getReplication() == null) {
			query.append("{'class':'SimpleStrategy','replication_factor':3}");
		} else {
			query.append(CassandraConverter.toCqlOptions(create.getReplication()));
		}

		Session session = client.getSession(create.getCluster());
		session.execute(query.toString());
		return true;

	}

	@TritonMethod("cassandra.keyspace.drop")
	public boolean dropKeyspace(DropKeyspace drop) {
		Session session = client.getSession(drop.getCluster());
		session.execute("DROP KEYSPACE " + drop.getKeyspace());
		return true;

	}

}


text:
<?php
require_once 'load_model.php';

//TODO: remove $db once we update all pages to use eloquent
function orgTimezone($db,$org_id)
{
 $org = App\Models\Organisation::find($org_id);
 if($org) {
  return $org->timezone;
 }
 return 'UTC';
}
function timeLocalFormat($d,$strTimeZone,$strFormat)
{
 if ($strTimeZone==NULL || strlen($strTimeZone)==0)
   $strTimeZone = 'UTC';
 $date = new DateTime();
 $date = $d;
 $date->setTimezone(new DateTimeZone($strTimeZone));
 return $date->format($strFormat);
}
function timeLocalSQL($sql,$strTimeZone,$strFormat)
{
 if ($strTimeZone==NULL || strlen($strTimeZone)==0)
   $strTimeZone = 'UTC';
 $date = new DateTime($sql);
 $date->setTimezone(new DateTimeZone($strTimeZone));
 return $date->format($strFormat);
}
function timestampSQL($sql)
{
 $date = new DateTime($sql);
 return $date->getTimestamp();
}
?>


text: require 'store_observer'


text:
@font-face {
  font-family: 'filter';
  font-style: normal;
  font-weight: normal;
  src: url("./fonts/filter_de356ac816c37844619223686e4eb1f2.eot?#iefix") format("embedded-opentype"), url("./fonts/filter_de356ac816c37844619223686e4eb1f2.woff") format("woff"), url("./fonts/filter_de356ac816c37844619223686e4eb1f2.ttf") format("truetype"), url("./fonts/filter_de356ac816c37844619223686e4eb1f2.svg#filter") format("svg"); }

@media screen {
  @font-face {
    font-family: 'filter';
    src: url("./fonts/filter_de356ac816c37844619223686e4eb1f2.svg#filter") format("svg"); } }

[data-icon]::before {
  content: attr(data-icon); }

[data-icon]::before,
.icon-hex::before,
.icon-square::before {
  display: inline-block;
  font-family: 'filter', sans-serif;
  font-style: normal;
  font-variant: normal;
  font-weight: normal;
  line-height: 1;
  text-decoration: inherit;
  text-rendering: optimizeLegibility;
  text-transform: none; }

.icon-hex::before {
  content: '\f100'; }

.icon-square::before {
  content: '\f101'; }

.leaflet-draw-toolbar.leaflet-fa-toolbar a {
  background-image: none; }

.leaflet-marker-icon {
  height: 12px !important;
  margin-left: -6px !important;
  margin-top: -6px !important;
  width: 12px !important; }

@font-face {
  font-family: 'filter';
  font-style: normal;
  font-weight: normal;
  src: url("./fonts/filter_de356ac816c37844619223686e4eb1f2.eot?#iefix") format("embedded-opentype"), url("./fonts/filter_de356ac816c37844619223686e4eb1f2.woff") format("woff"), url("./fonts/filter_de356ac816c37844619223686e4eb1f2.ttf") format("truetype"), url("./fonts/filter_de356ac816c37844619223686e4eb1f2.svg#filter") format("svg"); }

@media screen {
  @font-face {
    font-family: 'filter';
    src: url("./fonts/filter_de356ac816c37844619223686e4eb1f2.svg#filter") format("svg"); } }

[data-icon]::before {
  content: attr(data-icon); }

[data-icon]::before,
.icon-hex::before,
.icon-square::before {
  display: inline-block;
  font-family: 'filter', sans-serif;
  font-style: normal;
  font-variant: normal;
  font-weight: normal;
  line-height: 1;
  text-decoration: inherit;
  text-rendering: optimizeLegibility;
  text-transform: none; }

.icon-hex::before {
  content: '\f100'; }

.icon-square::before {
  content: '\f101'; }

/*# sourceMappingURL=leaflet-filter.css.map */


text:
#pragma once
#include <aws/storagegateway/StorageGateway_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/storagegateway/model/FileShareInfo.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace StorageGateway
{
namespace Model
{
  /**
   *
ListFileShareOutput

See Also:
   AWS
   * API Reference

   */
  class AWS_STORAGEGATEWAY_API ListFileSharesResult
  {
  public:
    ListFileSharesResult();
    ListFileSharesResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ListFileSharesResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline const Aws::String& GetMarker() const{ return m_marker; }

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline void SetMarker(const Aws::String& value) { m_marker = value; }

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline void SetMarker(Aws::String&& value) { m_marker = std::move(value); }

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline void SetMarker(const char* value) { m_marker.assign(value); }

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline ListFileSharesResult& WithMarker(const Aws::String& value) { SetMarker(value); return *this;}

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline ListFileSharesResult& WithMarker(Aws::String&& value) { SetMarker(std::move(value)); return *this;}

    /**
     *
If the request includes Marker, the response returns that value
     * in this field.

     */
    inline ListFileSharesResult& WithMarker(const char* value) { SetMarker(value); return *this;}

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline const Aws::String& GetNextMarker() const{ return m_nextMarker; }

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline void SetNextMarker(const Aws::String& value) { m_nextMarker = value; }

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline void SetNextMarker(Aws::String&& value) { m_nextMarker = std::move(value); }

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline void SetNextMarker(const char* value) { m_nextMarker.assign(value); }

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline ListFileSharesResult& WithNextMarker(const Aws::String& value) { SetNextMarker(value); return *this;}

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline ListFileSharesResult& WithNextMarker(Aws::String&& value) { SetNextMarker(std::move(value)); return *this;}

    /**
     *
If a value is present, there are more file shares to return. In a subsequent
     * request, use NextMarker as the value for Marker to
     * retrieve the next set of file shares.

     */
    inline ListFileSharesResult& WithNextMarker(const char* value) { SetNextMarker(value); return *this;}

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline const Aws::Vector<FileShareInfo>& GetFileShareInfoList() const{ return m_fileShareInfoList; }

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline void SetFileShareInfoList(const Aws::Vector<FileShareInfo>& value) { m_fileShareInfoList = value; }

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline void SetFileShareInfoList(Aws::Vector<FileShareInfo>&& value) { m_fileShareInfoList = std::move(value); }

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline ListFileSharesResult& WithFileShareInfoList(const Aws::Vector<FileShareInfo>& value) { SetFileShareInfoList(value); return *this;}

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline ListFileSharesResult& WithFileShareInfoList(Aws::Vector<FileShareInfo>&& value) { SetFileShareInfoList(std::move(value)); return *this;}

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline ListFileSharesResult& AddFileShareInfoList(const FileShareInfo& value) { m_fileShareInfoList.push_back(value); return *this; }

    /**
     *
An array of information about the file gateway's file shares.

     */
    inline ListFileSharesResult& AddFileShareInfoList(FileShareInfo&& value) { m_fileShareInfoList.push_back(std::move(value)); return *this; }

  private:
    Aws::String m_marker;
    Aws::String m_nextMarker;
    Aws::Vector<FileShareInfo> m_fileShareInfoList;
  };

} // namespace Model
} // namespace StorageGateway
} // namespace Aws


text:
<?php

namespace ApiGen\Templating\Filters;

abstract class Filters
{

	/**
	 * Calls public method with args if exists and passes args.
	 *
	 * @param string $name
	 * @throws \Exception
	 * @return mixed
	 */
	public function loader($name)
	{
		if (method_exists($this, $name)) {
			$args = array_slice(func_get_args(), 1);
			return call_user_func_array([$this, $name], $args);
		}
		return NULL;
	}

	/**
	 * @param string $string
	 * @return string
	 */
	public static function urlize($string)
	{
		return preg_replace('~[^\w]~', '.', $string);
	}

	/**
	 * @param string $name
	 * @param bool $trimNamespaceSeparator
	 * @return string
	 */
	protected function getTypeName($name, $trimNamespaceSeparator = TRUE)
	{
		$names = [
			'int' => 'integer',
			'bool' => 'boolean',
			'double' => 'float',
			'void' => '',
			'FALSE' => 'false',
			'TRUE' => 'true',
			'NULL' => 'null',
			'callback' => 'callable'
		];

		// Simple type
		if (isset($names[$name])) {
			return $names[$name];
		}

		// Class, constant or function
		return $trimNamespaceSeparator ? ltrim($name, '\\') : $name;
	}

	/**
	 * @param string $url
	 * @return string
	 */
	private function url($url)
	{
		return rawurlencode($url);
	}

}


text:
export * from "./Canvas";
export * from "./Create";
export * from "./Form";
export * from "./LinearAlgebra";
export * from "./Num";
export * from "./Op";
export * from "./Pt";
export * from "./Space";
export * from "./Color";
export * from "./Util";
export * from "./Dom";
export * from "./Svg";
export * from "./Typography";
export * from "./Physics";
export * from "./Play";
export * from "./UI";
export * from "./Image";
export * from "./Types";


text:
import time, sys, serial
import collections
import re

### GENERAL SETTINGS ###
SERIALPORT = "COM100"  # the default com/serial port the receiver is connected to
BAUDRATE = 115200      # default baud rate we talk to Moteino
TARGET=0               # Node ID of the Target that is being OTA reflashed
HEX = "flash.hex"      # the HEX file containing the new program for the Target
LINESPERPACKET = 3     # HEX lines to send per RF packet (1,2 or 3)
retries = 2
DEBUG = False

# Read command line arguments
if (sys.argv and len(sys.argv) > 1):
  if len(sys.argv)==2 and (sys.argv[1] == "-h" or sys.argv[1] == "-help" or sys.argv[1] == "?"):
    #print " -d or -debug         Turn debugging ON (verbose output)"
    print " -f or -file          HEX file to upload (Default: ", HEX, ")"
    print " -t or -target {ID}   Specify WirelessProgramming node target"
    print " -l or -lines {1,2,3} HEX lines per RF packet (Default: 3)"
    print " -s or -serial {port} Specify serial port of WirelessProgramming gateway (Default: ", SERIALPORT, ")"
    print " -b or -baud {baud}   Specify serial port baud rate (Default: ", BAUDRATE, ")"
    print " -h or -help or ?     Print this message"
    exit(0)

  for i in range(len(sys.argv)):
  #{
    #if sys.argv[i] == "-d" or sys.argv[i] == "-debug":
    #  DEBUG = True
    if (sys.argv[i] == "-s" or sys.argv[i] == "-serial") and len(sys.argv) >= i+2:
      SERIALPORT = sys.argv[i+1]
    if (sys.argv[i] == "-b" or sys.argv[i] == "-baud") and len(sys.argv) >= i+2:
      BAUD = sys.argv[i+1]
    if (sys.argv[i] == "-f" or sys.argv[i] == "-file") and len(sys.argv) >= i+2:
      HEX = sys.argv[i+1].strip()
    if (sys.argv[i] == "-t" or sys.argv[i] == "-target") and len(sys.argv) >= i+2:
      if sys.argv[i+1].isdigit() and int(sys.argv[i+1])>0 and int(sys.argv[i+1])<=255:
        TARGET = int(sys.argv[i+1])
      else:
        print "TARGET invalid  (", sys.argv[i+1], "), must be 1-255."
        exit(1)
    if (sys.argv[i] == "-l" or sys.argv[i] == "-lines") and len(sys.argv) >= i+2:
      if sys.argv[i+1].isdigit() and int(sys.argv[i+1])>0 and int(sys.argv[i+1])<=3:
        LINESPERPACKET = int(sys.argv[i+1])
      else:
        print "LINESPERPACKET invalid  (", sys.argv[i+1], "), must be 1-3."
        exit(1)
  #}

def millis():
  return int(round(time.time() * 1000))

def serWriteln(ser, msg):
  #ser.write(msg + '\n')
  ser.write(bytes((msg+'\n').encode('utf-8')))

HANDSHAKE_OK            = 0
HANDSHAKE_FAIL          = 1
HANDSHAKE_FAIL_TIMEOUT  = 2
HANDSHAKE_ERROR         = 3

def waitForHandshake(isEOF=False):
  now = millis()
  while True:
    if millis()-now < 4000:
    #{
      if isEOF:
        serWriteln(ser, "FLX?EOF")
      else:
        serWriteln(ser, "FLX?")
        print "FLX?\n"
      ser.flush()
      rx = ser.readline().rstrip().upper()

      if len(rx) > 0:
      #{
        print "Moteino: [" + rx + "]"
        if rx == "FLX?OK":
          print "HANDSHAKE OK!"
          return HANDSHAKE_OK
        elif rx == "FLX?NOK":
          print "HANDSHAKE FAIL [TIMEOUT]: " + rx
          return HANDSHAKE_FAIL
        elif (len(rx)>7 and rx.startswith("FLX?NOK") or rx.startswith("FLX?ERR")):
          print "HANDSHAKE FAIL [HEX IMG refused by target node], reason: " + rx
          return HANDSHAKE_FAIL_ERROR
      #}
    #}
    else: return HANDSHAKE_FAIL_TIMEOUT

def waitForTargetSet(targetNode):
  now = millis()
  to = "TO:" + str(TARGET)
  print to
  serWriteln(ser, to)
  ser.flush()
  while True:
  #{
    if millis()-now < 3000:
    #{
      rx = ser.readline().rstrip()
      if len(rx) > 0:
      #{
        print "Moteino: [" + rx + "]"
        if rx == to + ":OK":
          return True
        else: return False
      #}
    #}
  #}
  return False

# return 0:timeout, 1:OK!, 2:match but out of synch
def waitForSEQ(seq):
  now = millis()
  while True:
    if millis()-now < 3000:
      rx = ser.readline().strip()

      if (rx.upper().startswith("RFTX >") or rx.upper().startswith("RFACK >")):
      #{
          print "Moteino DEBUG: " + rx
          rx = ""
          continue
      #}

      if len(rx) > 0:
      #{
        print "Moteino: " + rx
        result = re.match("FLX:([0-9]*):OK", rx)
        if result != None:
          if int(result.group(1)) == seq:
            return 1
          else: return 2
      #}
    else: return 0

# MAIN()
#if __name__ == "__main__":
try:
  start = millis();
  # open up the serial port to get data transmitted to Programmer Moteino
  ser = serial.Serial(SERIALPORT, BAUDRATE, timeout=1) #timeout=0 means nonblocking
  ser.setDTR(False)
  ser.setRTS(False)
  time.sleep(2) #wait for Programmer Moteino reset after port open and potential bootloader time (~1.6s)
  ser.flushInput();
except IOError as e:
  print "COM Port [", SERIALPORT, "] not found, exiting..."
  exitNow(1)

try:
  if not 0<TARGET<= 255:
    print "TARGET not provided (use -h for help), now exiting..."
    exit(1)

  #send target ID first
  if waitForTargetSet(TARGET):
    print "TARGET SET OK"
  else:
    print "TARGET SET FAIL, exiting..."
    exit(1)

  with open(HEX) as f:
    print "File found, passing to Moteino..."

    handshakeResponse = waitForHandshake()
    if (handshakeResponse == HANDSHAKE_OK):
      seq = 0
      packetCounter = 0
      content = f.readlines()

      while seq < len(content):
      #{
        currentLine = content[seq].strip()
        isEOF = (content[seq].strip() == ":00000001FF") #this should be the last line in any valid intel HEX file
        result = -1
        bundledLines = 1

        if isEOF==False:
        #{
          hexDataToSend = currentLine

          #bundle 2 or 3 HEX lines in 1 RF packet (assuming: 1 HEX line has 16 bytes of data, following HEX lines also each being 16 bytes)
          if LINESPERPACKET > 1 and currentLine[1:3] == '10' and len(currentLine)==43:
          #{
            #check if next line != EOF, so we can bundle 2 lines
            nextLine = content[seq+1].strip()
            if nextLine != ":00000001FF" and nextLine[1:3] == "10" and len(nextLine) == 43:
            #{
              #need to sum: the 2 lines checksums + address bytes of nextLine (to arrive at a correct final checksum of combined 2 lines
              checksum = int(currentLine[41:43], 16) + int(nextLine[41:43], 16) + int(nextLine[3:5], 16) + int(nextLine[5:7], 16)

              #check if a third line != EOF, so we can bundle 3 lines
              nextLine2 = content[seq+2].strip()
              if LINESPERPACKET==3 and nextLine2 != ":00000001FF" and nextLine2[1:3] == "10" and len(nextLine2) == 43:
              #{
                #need to sum: the previous checksum + address bytes of nextLine2 (to arrive at a correct final checksum of combined 3 lines
                checksum += int(nextLine2[41:43], 16) + int(nextLine2[3:5], 16) + int(nextLine2[5:7], 16)
                hexDataToSend = ":3" + hexDataToSend[2:(len(hexDataToSend)-2)] + nextLine[9:41] + nextLine2[9:41] + ('%0*X' % (2,checksum%256))
                bundledLines=3
              #}
              else:
              #{
                hexDataToSend = ":2" + hexDataToSend[2:(len(hexDataToSend)-2)] + nextLine[9:41] + ('%0*X' % (2,checksum%256))
                bundledLines=2;
              #}
            #}
          #}
          tx = "FLX:" + str(packetCounter) + hexDataToSend
          print "TX > " + tx
          serWriteln(ser, tx)
          result = waitForSEQ(packetCounter)
        #}
        elif waitForHandshake(True) == HANDSHAKE_OK:
        #{
          print "SUCCESS! (time elapsed: " + ("%.2f" % ((millis()-start)/1000.0)) + "s)"
          exit(0);
        #}
        else:
        #{
          print "FAIL, IMG REFUSED BY TARGET (size exceeded? verify target MCU matches compiled target)"
          exit(99)
        #}

        if result == 1:
        #{
          seq+=bundledLines
          packetCounter+=1
        #}
        elif result == 2: # out of synch, retry
        #{
          if retries > 0:
            retries-=1
            print "OUT OF SYNC: retrying...\n"
            continue
          else:
            print "FAIL: out of sync (are you running the latest OTA libs/sources?)"
            exit(1)
        #}
        else:
        #{
          if retries > 0:
            retries-=1
            print "Timeout, retry...\n"
            continue
          else:
          #{
            print "FAIL: timeout (are you running the latest OTA libs/sources?)"
            exit(1)
          #}
        #}
      #}

      while 1:
      #{
        rx = ser.readline()
        if (len(rx) > 0): print rx.strip()
      #}

    elif (handshakeResponse == HANDSHAKE_FAIL_TIMEOUT):
      print "FAIL: No response from Moteino programmer, is it connected to " + port
      exit(1)
    elif (handshakeResponse == HANDSHAKE_FAIL_TIMEOUT):
      print "FAIL: No response from Moteino programmer, is it connected to " + port
      exit(1)
    else:
      print "FAIL: No response from Moteino Target, is Target listening on same Freq/NetworkID & OTA enabled?"
      exit(1)

except IOError:
  print "File [", HEX, "] not found, exiting..."
  exit(1)

finally:
  #print 'FINALLY' + '\n'
  ser.close()


text:
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("d3"), require("d3Kit"));
	else if(typeof define === 'function' && define.amd)
		define(["d3", "d3Kit"], factory);
	else if(typeof exports === 'object')
		exports["d3KitGridmap"] = factory(require("d3"), require("d3Kit"));
	else
		root["d3KitGridmap"] = factory(root["d3"], root["d3Kit"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	var d3 = __webpack_require__(1);
	var d3Kit = __webpack_require__(2);

	var DEFAULT_OPTIONS = {
	  margin: {left: 10, right: 10, top: 10, bottom: 10},
	  initialWidth: 500,
	  initialHeight: 340,
	  keyFn: undefined,
	  transitionDuration: 250,
	  row: function(d){return d.row;},
	  col: function(d){return d.col;},
	  text: function(d){return d.key;},
	  textColor: '#222',
	  stroke: '#222',
	  fill: '#ccc',
	  opacity: 1,
	  textAnchor: 'middle',
	  tileWidth: 40,
	  tileHeight: 40,
	  textSize: '12px',
	  textYOffset: '0.35em'
	};

	var CUSTOM_EVENTS = [
	  'tileClick',
	  'tileMouseover',
	  'tileMousemove',
	  'tileMouseout'
	];

	module.exports = d3Kit.factory.createChart(DEFAULT_OPTIONS, CUSTOM_EVENTS,
	function constructor(skeleton){
	  // alias
	  var options = skeleton.options();
	  var dispatch = skeleton.getDispatcher();
	  var layers = skeleton.getLayerOrganizer();

	  dispatch.on('resize',  visualize);
	  dispatch.on('options', visualize);
	  dispatch.on('data', visualize);

	  layers.create(['tile']);

	  function visualize(){
	    if(!skeleton.hasData()){
	      layers.get('tile').selectAll('g').remove();
	      return;
	    }

	    var data = skeleton.data();

	    var selection = layers.get('tile').selectAll('g')
	        .data(data, options.keyFn);

	    var sEnter = selection.enter().append('g')
	      .on('click', function(d, i){
	        dispatch.tileClick(d, i);
	      })
	      .on('mouseover', function(d, i){
	        dispatch.tileMouseover(d, i);
	      })
	      .on('mousemove', function(d, i){
	        dispatch.tileMousemove(d, i);
	      })
	      .on('mouseout', function(d, i){
	        dispatch.tileMouseout(d, i);
	      })
	      .attr('transform', function(d){
	        return 'translate('+(options.col(d)*options.tileWidth)+','+(options.row(d)*options.tileHeight)+')';}
	      );

	    sEnter.append('rect')
	      .attr('vector-effect', 'non-scaling-stroke')
	      .attr('width', options.tileWidth)
	      .attr('height', options.tileHeight)
	      .style('opacity', options.opacity)
	      .style('stroke', options.stroke)
	      .style('fill', options.fill);

	    sEnter.append('text')
	      .attr('x', options.tileWidth/2)
	      .attr('y', options.tileHeight/2)
	      .attr('dy', options.textYOffset)
	      .style('fill', options.textColor)
	      .style('font-size', options.textSize)
	      .style('text-anchor', options.textAnchor)
	      .text(options.text);

	    var sTrans = selection.transition().duration(options.transitionDuration)
	      .attr('transform', function(d){
	        return 'translate('+(options.col(d)*options.tileWidth)+','+(options.row(d)*options.tileHeight)+')';}
	      );

	    sTrans.select('rect')
	      .attr('width', options.tileWidth)
	      .attr('height', options.tileHeight)
	      .style('opacity', options.opacity)
	      .style('stroke', options.stroke)
	      .style('fill', options.fill);

	    sTrans.select('text')
	      .attr('x', options.tileWidth/2)
	      .attr('y', options.tileHeight/2)
	      .attr('dy', options.textYOffset)
	      .style('fill', options.textColor)
	      .style('font-size', options.textSize)
	      .style('text-anchor', options.textAnchor)
	      .text(options.text);

	    selection.exit().remove();
	  }

	  function resizeToFitMap(){
	    if(!skeleton.hasData()){
	      layers.get('tile').selectAll('g').remove();
	      return skeleton;
	    }

	    var data = skeleton.data();

	    var maxCol = d3.max(data, options.col) + 1;
	    var maxRow = d3.max(data, options.row) + 1;
	    var w = maxCol * options.tileWidth + options.margin.left + options.margin.right;
	    var h = maxRow * options.tileHeight + options.margin.top + options.margin.bottom;

	    skeleton.dimension([w, h]);
	    return skeleton;
	  }

	  return skeleton.mixin({
	    visualize: visualize,
	    resizeToFitMap: resizeToFitMap
	  });
	});

/***/ },
/* 1 */
/***/ function(module, exports) {

	module.exports = __WEBPACK_EXTERNAL_MODULE_1__;

/***/ },
/* 2 */
/***/ function(module, exports) {

	module.exports = __WEBPACK_EXTERNAL_MODULE_2__;

/***/ }
/******/ ])
});
;


text:
/* context menu item */
.contextmenu #bigbox_of_samples > .image {
    background-image: url('${ImgUrl}box-16x16.png');
}

/* main icon in full ribbon mode */
.ribbontoolbar #BigBoxRibbonToolbarSingleButton.button .image, .ribbontoolbar #BigBoxRibbonButtonDropDownControl.button .image
{
    background-image: url('${ImgUrl}box-32x32.png');
}

/* main icon in minimized ribbon mode */
.ribbontoolbar.minimized #BigBoxRibbonToolbarSingleButton.button .image, .ribbontoolbar.minimized #BigBoxRibbonButtonDropDownControl.button .image
{
    background-image: url('${ImgUrl}box-16x16.png');
}


text:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Report_bank_statement extends CI_Controller
{
    public $permissions;
    public $controller_name;
    public $model_name;
    public $grid_link;
    public $view_link;
    public $add_edit_link;

    function __construct()
    {
        parent::__construct();

        $user=User_helper::get_user();

        if(!$user)
        {
            redirect(base_url()."dashboard");
        }

        $this->controller_name = $this->uri->segment(2);
        $this->model_name = $this->uri->segment(2) . "_model";
        $this->grid_link = "tasks/" . $this->controller_name . "/list";
        $this->add_edit_link = "tasks/" . $this->controller_name . "/search";

        $this->load->model("tasks/" . $this->model_name);
        $this->lang->load($this->controller_name);
        $this->permissions=Menu_helper::get_permission($this->controller_name);
    }

    public function index($task="search",$id=0)
    {
        if($task=="search")
        {
            $this->search();
        }
        else if($task=="list")
        {
            $this->report_list();
        }
        else if($task=="pdf")
        {
            $this->report_list("pdf");
        }
        else
        {
            $this->search();
        }
    }
    private function search()
    {
        if($this->permissions['view']=="YES")
        {
            $this->load->model('tasks/common_model');
            $this->template->set_template('dashboard');
            $this->template->write('title', $this->lang->line("TASK_TITLE"));
            $data['banks'] = $this->common_model->get_bank_list();
            $this->template->write_view("content", $this->add_edit_link, $data);
            $this->template->render();
        }
        else
        {
            System_helper::set_system_message($this->lang->line("MSG_NO_ACCESS"),0);
            redirect(base_url());
        }

    }
    private function report_list($format="")
    {
        $model=$this->model_name;
        if($this->permissions['view']=="YES")
        {
            $form_date=$this->input->get('form_date');
            $to_date=$this->input->get('to_date');
            $account_head_id=$this->input->get('account_head_id');
            $this->template->set_template('report');
            $this->template->write('title', $this->lang->line("TASK_TITLE"));
            $data['results'] = $this->$model->get_report_result($form_date, $to_date, $account_head_id);

            $this->template->write_view("content", $this->grid_link, $data);

            if($format!="pdf")
            {
                $this->template->render();
            }
            else
            {
                $html=$this->template->render(NULL,TRUE,FALSE);
                System_helper::get_pdf($html);
            }
        }
        else
        {
            System_helper::set_system_message($this->lang->line("MSG_NO_ACCESS"),0);
            redirect(base_url());
        }

    }

}


text:
using System;
using System.Runtime.Serialization;

namespace ReportingService.Faults
{
    [DataContract]
    [Serializable]
    public class ReportFault
    {
        [DataMember]
        public string  Message { get; set; }

        [DataMember]
        public long Id { get; set; }
    }
}


text:
namespace BashSoft
{
    using System;
    using System.Collections.Generic;
    using System.IO;

    public static class IOManager
    {
        public static void TraverseDirectorty(int depth)
        {
            OutputWriter.WriteEmptyLine();
            int initialIndentation = SessionData.currentPath.Split('\\').Length;
            var subFolders = new Queue<string>();
            subFolders.Enqueue(SessionData.currentPath);

            while (subFolders.Count != 0)
            {
                var currentPath = subFolders.Dequeue();
                int identation = currentPath.Split('\\').Length - initialIndentation;
                OutputWriter.WriteMessageOnNewLine(string.Format("{0}{1}", new string('-', identation), currentPath));

                try
                {
                    foreach (var file in Directory.GetFiles(currentPath))
                    {
                        var indexOfLastSlash = file.LastIndexOf("\\");
                        var fileName = file.Substring(indexOfLastSlash);
                        OutputWriter.WriteMessageOnNewLine(new string('-', indexOfLastSlash) + fileName);

                        //It page 8 of 03-Document(First Part)
                        //It should be depth - identation
                        if (depth - identation < 0)
                        {
                            break;
                        }
                    }
                    foreach (var directoryPath in Directory.GetDirectories(currentPath))
                    {
                        subFolders.Enqueue(directoryPath);
                    }
                }
                catch (UnauthorizedAccessException)
                {
                    OutputWriter.WriteMessageOnNewLine(ExceptionMessages.UnauthorizedAccessException);
                }
            }

        }

        public static void CreateDirectoryInCurrentFolder(string name)
        {
            string path = Directory.GetCurrentDirectory() + "\\" + name;
            try
            {
                Directory.CreateDirectory(path);
            }
            catch (ArgumentException)
            {

                OutputWriter.DisplayExceptions(ExceptionMessages.ForbiddenSymbolsContainedInName);
            }

        }

        public static void ChangeCurrentDirectoryRelative(string relativePath)
        {
            if (relativePath == "..")
            {
                try
                {
                    var currentPath = SessionData.currentPath;
                    var indexOfLastSlash = currentPath.LastIndexOf("\\");
                    var newPath = currentPath.Substring(0, indexOfLastSlash);
                    SessionData.currentPath = newPath;
                }
                catch (ArgumentOutOfRangeException)
                {
                    OutputWriter.DisplayExceptions(ExceptionMessages.UnabelToGoHigherInPartitionHierarchy);
                }

            }
            else
            {
                var currentPath = SessionData.currentPath;
                currentPath += "\\" + relativePath;
                ChangeCurrentDirectoryRelative(currentPath);
            }
        }
        public static void ChangeCurrentDirecotryAbsolute(string absolutePath)
        {
            if (!Directory.Exists(absolutePath))
            {
                OutputWriter.DisplayExceptions(ExceptionMessages.InvalidPath);
                return;
            }
            SessionData.currentPath = absolutePath;
        }
    }
}


text:
// This class has been generated, DO NOT EDIT!

package org.tensorflow.op.nn;

import java.util.Arrays;
import java.util.List;
import org.tensorflow.GraphOperation;
import org.tensorflow.Operand;
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.RawOpInputs;
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Endpoint;
import org.tensorflow.op.annotation.OpInputsMetadata;
import org.tensorflow.op.annotation.OpMetadata;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.proto.framework.DataType;
import org.tensorflow.types.family.TNumber;

/**
 * Computes the gradient of morphological 2-D dilation with respect to the filter.
 *
 * @param <T> data type for {@code filter_backprop} output
 */
@OpMetadata(
    opType = Dilation2dBackpropFilter.OP_NAME,
    inputsClass = Dilation2dBackpropFilter.Inputs.class
)
@Operator(
    group = "nn"
)
public final class Dilation2dBackpropFilter<T extends TNumber> extends RawOp implements Operand<T> {
  /**
   * The name of this op, as known by TensorFlow core engine
   */
  public static final String OP_NAME = "Dilation2DBackpropFilter";

  private Output<T> filterBackprop;

  public Dilation2dBackpropFilter(Operation operation) {
    super(operation, OP_NAME);
    int outputIdx = 0;
    filterBackprop = operation.output(outputIdx++);
  }

  /**
   * Factory method to create a class wrapping a new Dilation2DBackpropFilter operation.
   *
   * @param scope current scope
   * @param input 4-D with shape {@code [batch, in_height, in_width, depth]}.
   * @param filter 3-D with shape {@code [filter_height, filter_width, depth]}.
   * @param outBackprop 4-D with shape {@code [batch, out_height, out_width, depth]}.
   * @param strides 1-D of length 4. The stride of the sliding window for each dimension of
   * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}.
   * @param rates 1-D of length 4. The input stride for atrous morphological dilation.
   * Must be: {@code [1, rate_height, rate_width, 1]}.
   * @param padding The type of padding algorithm to use.
   * @param <T> data type for {@code Dilation2DBackpropFilter} output and operands
   * @return a new instance of Dilation2dBackpropFilter
   */
  @Endpoint(
      describeByClass = true
  )
  public static <T extends TNumber> Dilation2dBackpropFilter<T> create(Scope scope,
      Operand<T> input, Operand<T> filter, Operand<T> outBackprop, List<Long> strides,
      List<Long> rates, String padding) {
    OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dilation2dBackpropFilter");
    opBuilder.addInput(input.asOutput());
    opBuilder.addInput(filter.asOutput());
    opBuilder.addInput(outBackprop.asOutput());
    long[] stridesArray = new long[strides.size()];
    for (int i = 0 ; i < stridesArray.length ; i++) {
      stridesArray[i] = strides.get(i);
    }
    opBuilder.setAttr("strides", stridesArray);
    long[] ratesArray = new long[rates.size()];
    for (int i = 0 ; i < ratesArray.length ; i++) {
      ratesArray[i] = rates.get(i);
    }
    opBuilder.setAttr("rates", ratesArray);
    opBuilder.setAttr("padding", padding);
    return new Dilation2dBackpropFilter<>(opBuilder.build());
  }

  /**
   * Gets filterBackprop.
   * 3-D with shape {@code [filter_height, filter_width, depth]}.
   * @return filterBackprop.
   */
  public Output<T> filterBackprop() {
    return filterBackprop;
  }

  @Override
  public Output<T> asOutput() {
    return filterBackprop;
  }

  @OpInputsMetadata(
      outputsClass = Dilation2dBackpropFilter.class
  )
  public static class Inputs<T extends TNumber> extends RawOpInputs<Dilation2dBackpropFilter<T>> {
    /**
     * 4-D with shape {@code [batch, in_height, in_width, depth]}.
     */
    public final Operand<T> input;

    /**
     * 3-D with shape {@code [filter_height, filter_width, depth]}.
     */
    public final Operand<T> filter;

    /**
     * 4-D with shape {@code [batch, out_height, out_width, depth]}.
     */
    public final Operand<T> outBackprop;

    /**
     * The T attribute
     */
    public final DataType T;

    /**
     * 1-D of length 4. The stride of the sliding window for each dimension of
     * the input tensor. Must be: `[1, stride_height, stride_width, 1]`.
     */
    public final long[] strides;

    /**
     * 1-D of length 4. The input stride for atrous morphological dilation.
     * Must be: `[1, rate_height, rate_width, 1]`.
     */
    public final long[] rates;

    /**
     * The type of padding algorithm to use.
     */
    public final String padding;

    public Inputs(GraphOperation op) {
      super(new Dilation2dBackpropFilter<>(op), op, Arrays.asList("T", "strides", "rates", "padding"));
      int inputIndex = 0;
      input = (Operand<T>) op.input(inputIndex++);
      filter = (Operand<T>) op.input(inputIndex++);
      outBackprop = (Operand<T>) op.input(inputIndex++);
      T = op.attributes().getAttrType("T");
      strides = op.attributes().getAttrIntList("strides");
      rates = op.attributes().getAttrIntList("rates");
      padding = op.attributes().getAttrString("padding");
    }
  }
}


text:
bool extractTar(QIODevice *in, QDir extractLoc);

#endif // TAREXTRACTOR_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--äöüÄÖÜß
    Specific data for a German Bankleitzahl
    @(#)$Id: IBANDetailBean.xml 50 2008-09-26 15:18:32Z gfis $
    2014-01-20, Georg Fischer
-->
<!--
 * Copyright 2006 Dr. Georg Fischer <punctum at punctum dot kom>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<record name="BlzDetail" version="1.0"
        xmlns="http://www.teherba.org/2006/xtrans/Record"
        package="org.teherba.checkdig.account"
        type="Bean" code="ASCII" length="18"
        rem="Attribute einer deutschen Bankleitzahl"
        sql="true" >
    <field name="blz"           rem="Bankleitzahl"              type="String" key="1" />
    <field name="fuehrend"      rem="1(2) = (nicht) führend"    type="String"     />
    <field name="institut"      rem="Kreditinstitut"            type="String"     />
    <field name="plz"           rem="Postleitzahl"              type="String"     />
    <field name="ort"           rem="Ort"                       type="String"     />
    <field name="inst"          rem="Institutskurzname"         type="String"     />
    <field name="instNr"        rem="Institutsnummer"           type="String"     />
    <field name="bic"           rem="Bank Identifier Code"      type="String"     />
    <field name="pzMethode"     rem="Prüfziffernmethode"        type="String"     />
    <field name="satzNr"        rem="seq  Satznummer"           type="String" key="2"    />
    <field name="aendKnz"       rem="(A)dd,(D)el,(U)nch,(M)od"  type="String"     />
    <field name="loeschung"     rem="1 (0) fuer zuk  Löschung"  type="String"     />
    <field name="folgeBlz"      rem="Folge-BLZ (wenn Löschg=1)" type="String"     />
    <field name="ibanRegel"     rem="Nummer der IBAN-Regel"     type="String"     />
    <field name="ibanVersion"   rem="Version der Regel"         type="String"     />
    <field name="okey"          rem="original access key"       type="String"     />
</record>


text:
shared_examples_for :select_accessor do |tags|
  tags.each do |tag|
    context tag do
      def accessor(tag, index, *args)
        page.send :"#{tag}#{index}=", *args
      end

      it 'selects option for element with no locators' do
        expect(watir).to receive(tag).with(no_args).and_return(element)
        expect(element).to receive(:select).with('value')
        accessor(tag, 1, 'value')
      end

      it 'selects option for element with single watir locator' do
        expect(watir).to receive(tag).with(id: tag).and_return(element)
        expect(element).to receive(:select).with('value')
        accessor(tag, 2, 'value')
      end

      it 'selects option for element with multiple watir locator' do
        expect(watir).to receive(tag).with(id: tag, class: /#{tag}/).and_return(element)
        expect(element).to receive(:select).with('value')
        accessor(tag, 3, 'value')
      end

      it 'selects option for element with custom locator' do
        element2 = double('element', visible?: false)
        plural = Watirsome.pluralize(tag)
        expect(watir).to receive(plural).with(id: tag, class: tag).and_return([element, element2])
        expect(element).to receive(:select).with('value')
        accessor(tag, 4, 'value')
      end

      it 'selects option for element with proc' do
        expect(watir).to receive(tag).with(id: tag).and_return(element)
        expect(element).to receive(:select).with('value')
        accessor(tag, 5, 'value')
      end

      it 'selects option for element with lambda' do
        expect(watir).to receive(tag).with(id: tag).and_return(element)
        expect(element).to receive(:select).with('value')
        accessor(tag, 6, 'value')
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
    android:background="#820000"
    android:stretchColumns="1" >

    <LinearLayout
        android:id="@+id/about_top"
        android:layout_width="fill_parent"
        android:layout_height="30dp"
        android:background="#e6e6e6"
        android:orientation="vertical" >
    </LinearLayout>

    <TableRow
        android:layout_height="60dp"
        android:layout_marginTop="3dp"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="当前用户"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/useracc"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="15dp"
            android:paddingRight="15dp"
            android:paddingTop="15dp"
            android:text="默认用户"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="fill_parent"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="系统用户个数"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/countuser"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:text="1个"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="fill_parent"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="支出记录"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/countpay"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:text="0条"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="fill_parent"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="收入记录"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/countincome"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:text="0条"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="fill_parent"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="手势密码"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/gesturepw"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:text="关"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:id="@+id/gesturepwmd"
        android:layout_height="fill_parent"
        android:background="#e6e6e6"
        android:visibility="gone" >

        <TextView
            android:id="@+id/gesturepwmdtext"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="修改手势密码"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:drawableRight="@drawable/hint"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="fill_parent"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="发送错误日志功能"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/sendlog"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:text="关"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="fill_parent"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="用户反馈"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/feedback"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:text="点此进入"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:id="@+id/description"
        android:layout_height="fill_parent"
        android:layout_marginBottom="2dp"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="系统使用说明书"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:layout_height="match_parent"
            android:layout_marginRight="1dp"
            android:layout_marginTop="1dp"
            android:background="#ffffff"
            android:drawableRight="@drawable/hint"
            android:gravity="right"
            android:paddingBottom="13dp"
            android:paddingRight="15dp"
            android:paddingTop="9dp"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="60dp"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:text="系统版本"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/app_version"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="15dp"
            android:paddingRight="15dp"
            android:paddingTop="15dp"
            android:text="1.0.0.1"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

    <TableRow
        android:layout_height="60dp"
        android:layout_marginBottom="3dp"
        android:background="#e6e6e6" >

        <TextView
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="1dp"
            android:background="#ffffff"
            android:paddingBottom="13dp"
            android:paddingLeft="15dp"
            android:paddingTop="13dp"
            android:textColor="#500000"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/updateapp"
            android:layout_height="match_parent"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="1dp"
            android:background="#ffffff"
            android:gravity="right"
            android:paddingBottom="15dp"
            android:paddingRight="15dp"
            android:paddingTop="15dp"
            android:text="检查更新"
            android:textColor="#464646"
            android:textSize="14sp" />
    </TableRow>

</TableLayout>


text:
package org.qi4j.entitystore.prefs;

import org.qi4j.api.concern.Concerns;
import org.qi4j.api.mixin.Mixins;
import org.qi4j.api.service.Activatable;
import org.qi4j.api.service.ServiceComposite;
import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern;
import org.qi4j.spi.entitystore.EntityStateVersions;
import org.qi4j.spi.entitystore.EntityStore;

/**
 * EntityStore backed by Preferences API.
 *

 * A root node is created in the System preferences, whose name
 * is the same as the Application name (default:"Application").
 *

 * Each entity is stored under its identity name.
 *

 * Property types are converted to native Preferences API types
 * as much as possible. All others will be serialized to a string using JSON.
 *

 * ManyAssociations are stored as multi-line strings (one identity
 * per line), and Associations are stored as the identity
 * of the referenced Entity.
 *

 * The main use of the EntityStore is for storage of ConfigurationComposites for ServiceComposites.
 *
 * @see ServiceComposite
 * @see org.qi4j.api.configuration.Configuration
 */
@Concerns( ConcurrentModificationCheckConcern.class )
@Mixins( PreferencesEntityStoreMixin.class )
public interface PreferencesEntityStoreService
    extends EntityStore, ServiceComposite, EntityStateVersions, Activatable
{
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <link href="http://gmpg.org/xfn/11" rel="profile">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>

      Antonio Scatoloni · Information Technoogy and Beyond 2.0

  </title>

 <link rel="stylesheet" href="/public/css/poole.css">
 <link rel="stylesheet" href="/public/css/syntax.css">
 <link rel="stylesheet" href="/public/css/ascatox.css">
 <link rel="stylesheet" href="/public/font-awesome/css/font-awesome.min.css">

 <link href='http://fonts.googleapis.com/css?family=PT+Serif:400,700italic,700,400italic' rel='stylesheet' type='text/css' />
 <link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css' />

 <link rel="apple-touch-icon-precomposed" sizes="144x144" href="public/apple-touch-icon-precomposed.png">
 <link rel="shortcut icon" href="public/favicon.ico">

  <link rel="alternate" type="application/atom+xml" title="Antonio Scatoloni" href="/atom.xml">

        Antonio Scatoloni

          About

          Archive

          Tags

          Feed

        Rebirth

    <time datetime="2011-06-16T08:35:28+02:00" class="post-date">16 Jun 2011</time>

Dopo un lungo periodo, quasi due anni che non posto regolarmente (i links non valgono :-D), provo a ricominciare sul serio.

Molte cose sono cambiate dal 2010, provo ad elencare le principali:

mi sono sposato

ho visto la Cina

ho cambiato lavoro

ho acquistato un'iPhone 4 ed un'iPad

sono ritornato studente, frequentando un master MBA

vivo in un'altra casa

ho ricominciato a scrivere nel mio Blog

Come ai vecchi tempi

Stay Tuned!!!

        Terremoto Haiti!!!

    <time datetime="2010-01-17T14:14:34+01:00" class="post-date">17 Jan 2010</time>

Per Tutti coloro che come me hanno un account su iTunes Store, Apple fornisce la possibilità di donare tramite il conto che usate sullo Store. Per chi vuole utilizzare questo modo per aiutare questo paese martoriato, questo è il link all'iTunes Store. La donazione verrà inviata alla Croce Rossa Americana, in prima linea nella grande tragedia.

Non dimentichiamoli!!!

        Tanti Auguri !!!

    <time datetime="2009-12-24T11:48:06+01:00" class="post-date">24 Dec 2009</time>

Eccomi di nuovo qui, rinasco dalle ceneri come l'araba fenice, purtroppo in questo ultimo periodo sono stato molto impegnato, con un nuovo lavoro ed i viaggi per raggiungere la città dove si trova la mia nuova occupazione sempre da consulente informatico, per i più curiosi date un'occhiata a Linkedin per i dettagli.

Comunque vada:

Buone Feste a Tutti !!!

Nel nuovo anno prometto di riempire maggiormente il blog,

come sempre Stay Tuned!!!!

        iCan

    <time datetime="2009-11-01T15:04:01+01:00" class="post-date">01 Nov 2009</time>

        Snow Leopard e NTFS

    <time datetime="2009-10-27T17:33:43+01:00" class="post-date">27 Oct 2009</time>

Quante volte è venuto a casa vostra un amico, col suo mega disco esterno sul quale dovete copiare dei dati dal vostro Mac?
A me è successo ieri sera, e non sono riuscito a scriverci ben nulla, senza utilizzare una macchina virtuale con Parallels e Windows 7 a bordo.
Il mio macbook infatti direttamente da Snow Leopard non può scrivere su dischi formattati con file system NTFS,
ma da  questo file system purtroppo riesce solo a leggere.
La soluzione al problema è l'acquisto del software shareware NTFS for MAC OS X 7.0 della Paragon Software Group, che permette l'accesso totale al file system di Microsoft al costo di 30$.

Direi che il costo del programma visto il cambio euro-dollaro non è assolutamente elevato.

Stay Tuned!!!

        © Antonio Scatoloni Weblog made with Jekyll, under CC BY-NC.


text:
require 'spec_helper'

describe Cocina do
  it 'has a version number' do
    expect(Cocina::VERSION).not_to be nil
  end

  describe '.version' do
    it 'returns the version number' do
      expect(Cocina.version).to eq(Cocina::VERSION)
    end
  end
end


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "device/usb/usb_service_impl.h"

#include <stdint.h>
#include <list>
#include <set>
#include <utility>

#include "base/barrier_closure.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "components/device_event_log/device_event_log.h"
#include "device/usb/usb_device_handle.h"
#include "device/usb/usb_error.h"
#include "device/usb/webusb_descriptors.h"
#include "net/base/io_buffer.h"
#include "third_party/libusb/src/libusb/libusb.h"

#if defined(OS_WIN)
#include <setupapi.h>
#include <usbiodef.h>

#include "base/strings/string_util.h"
#include "device/core/device_info_query_win.h"
#endif  // OS_WIN

#if defined(USE_UDEV)
#include "device/udev_linux/scoped_udev.h"
#endif  // USE_UDEV

using net::IOBufferWithSize;

namespace device {

namespace {

// Standard USB requests and descriptor types:
const uint16_t kUsbVersion2_1 = 0x0210;

#if defined(OS_WIN)

bool IsWinUsbInterface(const std::string& device_path) {
  DeviceInfoQueryWin device_info_query;
  if (!device_info_query.device_info_list_valid()) {
    USB_PLOG(ERROR) << "Failed to create a device information set";
    return false;
  }

  // This will add the device so we can query driver info.
  if (!device_info_query.AddDevice(device_path.c_str())) {
    USB_PLOG(ERROR) << "Failed to get device interface data for "
                    << device_path;
    return false;
  }

  if (!device_info_query.GetDeviceInfo()) {
    USB_PLOG(ERROR) << "Failed to get device info for " << device_path;
    return false;
  }

  std::string buffer;
  if (!device_info_query.GetDeviceStringProperty(SPDRP_SERVICE, &buffer)) {
    USB_PLOG(ERROR) << "Failed to get device service property";
    return false;
  }

  USB_LOG(DEBUG) << "Driver for " << device_path << " is " << buffer << ".";
  if (base::StartsWith(buffer, "WinUSB", base::CompareCase::INSENSITIVE_ASCII))
    return true;
  return false;
}

#endif  // OS_WIN

void GetDeviceListOnBlockingThread(
    const std::string& new_device_path,
    scoped_refptr<UsbContext> usb_context,
    scoped_refptr<base::SequencedTaskRunner> task_runner,
    base::Callback<void(libusb_device**, size_t)> callback) {
#if defined(OS_WIN)
  if (!new_device_path.empty()) {
    if (!IsWinUsbInterface(new_device_path)) {
      // Wait to call libusb_get_device_list until libusb will be able to find
      // a WinUSB interface for the device.
      task_runner->PostTask(FROM_HERE, base::Bind(callback, nullptr, 0));
      return;
    }
  }
#endif  // defined(OS_WIN)

  libusb_device** platform_devices = NULL;
  const ssize_t device_count =
      libusb_get_device_list(usb_context->context(), &platform_devices);
  if (device_count < 0) {
    USB_LOG(ERROR) << "Failed to get device list: "
                   << ConvertPlatformUsbErrorToString(device_count);
    task_runner->PostTask(FROM_HERE, base::Bind(callback, nullptr, 0));
    return;
  }

  task_runner->PostTask(FROM_HERE,
                        base::Bind(callback, platform_devices, device_count));
}

void CloseHandleAndRunContinuation(scoped_refptr<UsbDeviceHandle> device_handle,
                                   const base::Closure& continuation) {
  device_handle->Close();
  continuation.Run();
}

void SaveStringsAndRunContinuation(
    scoped_refptr<UsbDeviceImpl> device,
    uint8_t manufacturer,
    uint8_t product,
    uint8_t serial_number,
    const base::Closure& continuation,
    scoped_ptr<std::map<uint8_t, base::string16>> string_map) {
  if (manufacturer != 0)
    device->set_manufacturer_string((*string_map)[manufacturer]);
  if (product != 0)
    device->set_product_string((*string_map)[product]);
  if (serial_number != 0)
    device->set_serial_number((*string_map)[serial_number]);
  continuation.Run();
}

void OnReadBosDescriptor(scoped_refptr<UsbDeviceHandle> device_handle,
                         const base::Closure& barrier,
                         scoped_ptr<WebUsbAllowedOrigins> allowed_origins,
                         const GURL& landing_page) {
  scoped_refptr<UsbDeviceImpl> device =
      static_cast<UsbDeviceImpl*>(device_handle->GetDevice().get());

  if (allowed_origins)
    device->set_webusb_allowed_origins(std::move(allowed_origins));
  if (landing_page.is_valid())
    device->set_webusb_landing_page(landing_page);

  barrier.Run();
}

void OnDeviceOpenedReadDescriptors(
    uint8_t manufacturer,
    uint8_t product,
    uint8_t serial_number,
    bool read_bos_descriptors,
    const base::Closure& success_closure,
    const base::Closure& failure_closure,
    scoped_refptr<UsbDeviceHandle> device_handle) {
  if (device_handle) {
    scoped_ptr<std::map<uint8_t, base::string16>> string_map(
        new std::map<uint8_t, base::string16>());
    if (manufacturer != 0)
      (*string_map)[manufacturer] = base::string16();
    if (product != 0)
      (*string_map)[product] = base::string16();
    if (serial_number != 0)
      (*string_map)[serial_number] = base::string16();

    int count = 0;
    if (!string_map->empty())
      count++;
    if (read_bos_descriptors)
      count++;
    DCHECK_GT(count, 0);

    base::Closure barrier =
        base::BarrierClosure(count, base::Bind(&CloseHandleAndRunContinuation,
                                               device_handle, success_closure));

    if (!string_map->empty()) {
      scoped_refptr<UsbDeviceImpl> device =
          static_cast<UsbDeviceImpl*>(device_handle->GetDevice().get());

      ReadUsbStringDescriptors(
          device_handle, std::move(string_map),
          base::Bind(&SaveStringsAndRunContinuation, device, manufacturer,
                     product, serial_number, barrier));
    }

    if (read_bos_descriptors) {
      ReadWebUsbDescriptors(device_handle, base::Bind(&OnReadBosDescriptor,
                                                      device_handle, barrier));
    }
  } else {
    failure_closure.Run();
  }
}

#if defined(USE_UDEV)

void EnumerateUdevDevice(scoped_refptr<UsbDeviceImpl> device,
                         bool read_bos_descriptors,
                         scoped_refptr<base::SequencedTaskRunner> task_runner,
                         const base::Closure& success_closure,
                         const base::Closure& failure_closure) {
  ScopedUdevPtr udev(udev_new());
  ScopedUdevEnumeratePtr udev_enumerate(udev_enumerate_new(udev.get()));

  udev_enumerate_add_match_subsystem(udev_enumerate.get(), "usb");
  if (udev_enumerate_scan_devices(udev_enumerate.get()) != 0) {
    task_runner->PostTask(FROM_HERE, failure_closure);
    return;
  }

  std::string bus_number =
      base::UintToString(libusb_get_bus_number(device->platform_device()));
  std::string device_address =
      base::UintToString(libusb_get_device_address(device->platform_device()));
  udev_list_entry* devices =
      udev_enumerate_get_list_entry(udev_enumerate.get());
  for (udev_list_entry* i = devices; i != NULL;
       i = udev_list_entry_get_next(i)) {
    ScopedUdevDevicePtr udev_device(
        udev_device_new_from_syspath(udev.get(), udev_list_entry_get_name(i)));
    if (udev_device) {
      const char* value =
          udev_device_get_sysattr_value(udev_device.get(), "busnum");
      if (!value || bus_number != value) {
        continue;
      }
      value = udev_device_get_sysattr_value(udev_device.get(), "devnum");
      if (!value || device_address != value) {
        continue;
      }

      value = udev_device_get_sysattr_value(udev_device.get(), "manufacturer");
      if (value) {
        device->set_manufacturer_string(base::UTF8ToUTF16(value));
      }
      value = udev_device_get_sysattr_value(udev_device.get(), "product");
      if (value) {
        device->set_product_string(base::UTF8ToUTF16(value));
      }
      value = udev_device_get_sysattr_value(udev_device.get(), "serial");
      if (value) {
        device->set_serial_number(base::UTF8ToUTF16(value));
      }

      value = udev_device_get_devnode(udev_device.get());
      if (value) {
        device->set_device_path(value);

        if (read_bos_descriptors) {
          task_runner->PostTask(
              FROM_HERE,
              base::Bind(&UsbDevice::Open, device,
                         base::Bind(&OnDeviceOpenedReadDescriptors, 0, 0, 0,
                                    true, success_closure, failure_closure)));
        } else {
          task_runner->PostTask(FROM_HERE, success_closure);
        }
        return;
      }

      break;
    }
  }

  task_runner->PostTask(FROM_HERE, failure_closure);
}

#endif  // USE_UDEV

}  // namespace

UsbServiceImpl::UsbServiceImpl(
    scoped_refptr<base::SequencedTaskRunner> blocking_task_runner)
    : task_runner_(base::ThreadTaskRunnerHandle::Get()),
      blocking_task_runner_(blocking_task_runner),
#if defined(OS_WIN)
      device_observer_(this),
#endif
      weak_factory_(this) {

  PlatformUsbContext platform_context = nullptr;
  int rv = libusb_init(&platform_context);
  if (rv != LIBUSB_SUCCESS || !platform_context) {
    USB_LOG(DEBUG) << "Failed to initialize libusb: "
                   << ConvertPlatformUsbErrorToString(rv);
    return;
  }
  context_ = new UsbContext(platform_context);

  rv = libusb_hotplug_register_callback(
      context_->context(),
      static_cast<libusb_hotplug_event>(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
                                        LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT),
      static_cast<libusb_hotplug_flag>(0), LIBUSB_HOTPLUG_MATCH_ANY,
      LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY,
      &UsbServiceImpl::HotplugCallback, this, &hotplug_handle_);
  if (rv == LIBUSB_SUCCESS) {
    hotplug_enabled_ = true;
  }

  RefreshDevices();
#if defined(OS_WIN)
  DeviceMonitorWin* device_monitor = DeviceMonitorWin::GetForAllInterfaces();
  if (device_monitor) {
    device_observer_.Add(device_monitor);
  }
#endif  // OS_WIN
}

UsbServiceImpl::~UsbServiceImpl() {
  if (hotplug_enabled_) {
    libusb_hotplug_deregister_callback(context_->context(), hotplug_handle_);
  }
  for (const auto& map_entry : devices_) {
    map_entry.second->OnDisconnect();
  }
}

scoped_refptr<UsbDevice> UsbServiceImpl::GetDevice(const std::string& guid) {
  DCHECK(CalledOnValidThread());
  DeviceMap::iterator it = devices_.find(guid);
  if (it != devices_.end()) {
    return it->second;
  }
  return NULL;
}

void UsbServiceImpl::GetDevices(const GetDevicesCallback& callback) {
  DCHECK(CalledOnValidThread());

  if (!context_) {
    task_runner_->PostTask(
        FROM_HERE,
        base::Bind(callback, std::vector<scoped_refptr<UsbDevice>>()));
    return;
  }

  if (hotplug_enabled_ && !enumeration_in_progress_) {
    // The device list is updated live when hotplug events are supported.
    std::vector<scoped_refptr<UsbDevice>> devices;
    for (const auto& map_entry : devices_) {
      devices.push_back(map_entry.second);
    }
    task_runner_->PostTask(FROM_HERE, base::Bind(callback, devices));
  } else {
    pending_enumeration_callbacks_.push_back(callback);
    RefreshDevices();
  }
}

#if defined(OS_WIN)

void UsbServiceImpl::OnDeviceAdded(const GUID& class_guid,
                                   const std::string& device_path) {
  // Only the root node of a composite USB device has the class GUID
  // GUID_DEVINTERFACE_USB_DEVICE but we want to wait until WinUSB is loaded.
  // This first pass filter will catch anything that's sitting on the USB bus
  // (including devices on 3rd party USB controllers) to avoid the more
  // expensive driver check that needs to be done on the FILE thread.
  if (device_path.find("usb") != std::string::npos) {
    pending_path_enumerations_.push(device_path);
    RefreshDevices();
  }
}

void UsbServiceImpl::OnDeviceRemoved(const GUID& class_guid,
                                     const std::string& device_path) {
  // The root USB device node is removed last.
  if (class_guid == GUID_DEVINTERFACE_USB_DEVICE) {
    RefreshDevices();
  }
}

#endif  // OS_WIN

void UsbServiceImpl::RefreshDevices() {
  DCHECK(CalledOnValidThread());
  DCHECK(context_);

  if (enumeration_in_progress_) {
    return;
  }

  enumeration_in_progress_ = true;
  DCHECK(devices_being_enumerated_.empty());

  std::string device_path;
  if (!pending_path_enumerations_.empty()) {
    device_path = pending_path_enumerations_.front();
    pending_path_enumerations_.pop();
  }

  blocking_task_runner_->PostTask(
      FROM_HERE,
      base::Bind(&GetDeviceListOnBlockingThread, device_path, context_,
                 task_runner_, base::Bind(&UsbServiceImpl::OnDeviceList,
                                          weak_factory_.GetWeakPtr())));
}

void UsbServiceImpl::OnDeviceList(libusb_device** platform_devices,
                                  size_t device_count) {
  DCHECK(CalledOnValidThread());
  if (!platform_devices) {
    RefreshDevicesComplete();
    return;
  }

  base::Closure refresh_complete =
      base::BarrierClosure(static_cast<int>(device_count),
                           base::Bind(&UsbServiceImpl::RefreshDevicesComplete,
                                      weak_factory_.GetWeakPtr()));
  std::list<PlatformUsbDevice> new_devices;

  // Look for new and existing devices.
  for (size_t i = 0; i < device_count; ++i) {
    PlatformUsbDevice platform_device = platform_devices[i];
    auto it = platform_devices_.find(platform_device);

    if (it == platform_devices_.end()) {
      libusb_ref_device(platform_device);
      new_devices.push_back(platform_device);
    } else {
      it->second->set_visited(true);
      refresh_complete.Run();
    }
  }

  // Remove devices not seen in this enumeration.
  for (PlatformDeviceMap::iterator it = platform_devices_.begin();
       it != platform_devices_.end();
       /* incremented internally */) {
    PlatformDeviceMap::iterator current = it++;
    const scoped_refptr<UsbDeviceImpl>& device = current->second;
    if (device->was_visited()) {
      device->set_visited(false);
    } else {
      RemoveDevice(device);
    }
  }

  for (PlatformUsbDevice platform_device : new_devices) {
    EnumerateDevice(platform_device, refresh_complete);
  }

  libusb_free_device_list(platform_devices, true);
}

void UsbServiceImpl::RefreshDevicesComplete() {
  DCHECK(CalledOnValidThread());
  DCHECK(enumeration_in_progress_);

  enumeration_ready_ = true;
  enumeration_in_progress_ = false;
  devices_being_enumerated_.clear();

  if (!pending_enumeration_callbacks_.empty()) {
    std::vector<scoped_refptr<UsbDevice>> devices;
    for (const auto& map_entry : devices_) {
      devices.push_back(map_entry.second);
    }

    std::vector<GetDevicesCallback> callbacks;
    callbacks.swap(pending_enumeration_callbacks_);
    for (const GetDevicesCallback& callback : callbacks) {
      callback.Run(devices);
    }
  }

  if (!pending_path_enumerations_.empty()) {
    RefreshDevices();
  }
}

void UsbServiceImpl::EnumerateDevice(PlatformUsbDevice platform_device,
                                     const base::Closure& refresh_complete) {
  DCHECK(context_);
  devices_being_enumerated_.insert(platform_device);

  libusb_device_descriptor descriptor;
  int rv = libusb_get_device_descriptor(platform_device, &descriptor);
  if (rv == LIBUSB_SUCCESS) {
    if (descriptor.bDeviceClass == LIBUSB_CLASS_HUB) {
      // Don't try to enumerate hubs. We never want to connect to a hub.
      refresh_complete.Run();
      return;
    }

    scoped_refptr<UsbDeviceImpl> device(new UsbDeviceImpl(
        context_, platform_device, descriptor, blocking_task_runner_));
    base::Closure add_device =
        base::Bind(&UsbServiceImpl::AddDevice, weak_factory_.GetWeakPtr(),
                   refresh_complete, device);
    bool read_bos_descriptors = descriptor.bcdUSB >= kUsbVersion2_1;

#if defined(USE_UDEV)
    blocking_task_runner_->PostTask(
        FROM_HERE,
        base::Bind(&EnumerateUdevDevice, device, read_bos_descriptors,
                   task_runner_, add_device, refresh_complete));
#else
    if (descriptor.iManufacturer == 0 && descriptor.iProduct == 0 &&
        descriptor.iSerialNumber == 0 && !read_bos_descriptors) {
      // Don't bother disturbing the device if it has no descriptors to offer.
      add_device.Run();
    } else {
      device->Open(base::Bind(&OnDeviceOpenedReadDescriptors,
                              descriptor.iManufacturer, descriptor.iProduct,
                              descriptor.iSerialNumber, read_bos_descriptors,
                              add_device, refresh_complete));
    }
#endif
  } else {
    USB_LOG(EVENT) << "Failed to get device descriptor: "
                   << ConvertPlatformUsbErrorToString(rv);
    refresh_complete.Run();
  }
}

void UsbServiceImpl::AddDevice(const base::Closure& refresh_complete,
                               scoped_refptr<UsbDeviceImpl> device) {
  auto it = devices_being_enumerated_.find(device->platform_device());
  if (it == devices_being_enumerated_.end()) {
    // Device was removed while being enumerated.
    refresh_complete.Run();
    return;
  }

  platform_devices_[device->platform_device()] = device;
  DCHECK(!ContainsKey(devices_, device->guid()));
  devices_[device->guid()] = device;

  USB_LOG(USER) << "USB device added: vendor=" << device->vendor_id() << " \""
                << device->manufacturer_string()
                << "\", product=" << device->product_id() << " \""
                << device->product_string() << "\", serial=\""
                << device->serial_number() << "\", guid=" << device->guid();

  if (enumeration_ready_) {
    NotifyDeviceAdded(device);
  }

  refresh_complete.Run();
}

void UsbServiceImpl::RemoveDevice(scoped_refptr<UsbDeviceImpl> device) {
  platform_devices_.erase(device->platform_device());
  devices_.erase(device->guid());

  USB_LOG(USER) << "USB device removed: guid=" << device->guid();

  NotifyDeviceRemoved(device);
  device->OnDisconnect();
}

// static
int LIBUSB_CALL UsbServiceImpl::HotplugCallback(libusb_context* context,
                                                PlatformUsbDevice device,
                                                libusb_hotplug_event event,
                                                void* user_data) {
  // It is safe to access the UsbServiceImpl* here because libusb takes a lock
  // around registering, deregistering and calling hotplug callback functions
  // and so guarantees that this function will not be called by the event
  // processing thread after it has been deregistered.
  UsbServiceImpl* self = reinterpret_cast<UsbServiceImpl*>(user_data);
  switch (event) {
    case LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED:
      libusb_ref_device(device);  // Released in OnPlatformDeviceAdded.
      if (self->task_runner_->BelongsToCurrentThread()) {
        self->OnPlatformDeviceAdded(device);
      } else {
        self->task_runner_->PostTask(
            FROM_HERE, base::Bind(&UsbServiceImpl::OnPlatformDeviceAdded,
                                  base::Unretained(self), device));
      }
      break;
    case LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT:
      libusb_ref_device(device);  // Released in OnPlatformDeviceRemoved.
      if (self->task_runner_->BelongsToCurrentThread()) {
        self->OnPlatformDeviceRemoved(device);
      } else {
        self->task_runner_->PostTask(
            FROM_HERE, base::Bind(&UsbServiceImpl::OnPlatformDeviceRemoved,
                                  base::Unretained(self), device));
      }
      break;
    default:
      NOTREACHED();
  }

  return 0;
}

void UsbServiceImpl::OnPlatformDeviceAdded(PlatformUsbDevice platform_device) {
  DCHECK(CalledOnValidThread());
  DCHECK(!ContainsKey(platform_devices_, platform_device));
  EnumerateDevice(platform_device, base::Bind(&base::DoNothing));
  libusb_unref_device(platform_device);
}

void UsbServiceImpl::OnPlatformDeviceRemoved(
    PlatformUsbDevice platform_device) {
  DCHECK(CalledOnValidThread());
  PlatformDeviceMap::iterator it = platform_devices_.find(platform_device);
  if (it != platform_devices_.end()) {
    RemoveDevice(it->second);
  } else {
    devices_being_enumerated_.erase(platform_device);
  }
  libusb_unref_device(platform_device);
}

}  // namespace device


text:
@class MSURLSessionDataTask;

#import "MSRequest.h"

@interface MSGraphDriveItemCopyRequest : MSRequest

@property (readonly) NSMutableURLRequest *mutableRequest;

- (instancetype)initWithName:(NSString *)name parentReference:(MSGraphItemReference *)parentReference URL:(NSURL *)url options:(NSArray *)options client:(ODataBaseClient*)client;

- (MSURLSessionDataTask *)executeWithCompletion:(void (^)(MSGraphDriveItem *response, NSError *error))completionHandler;

@end


text:
declare module 'prosemirror-model' {
  export interface Fragment {
    textBetween(from: number, to: number, blockSeparator?: string, leafText?: string): string;
  }
}