text:
#import <Kiwi/Kiwi.h>
#import "DigitalOcean.h"
#import "DOEndpointConstants.h"
#import "DOInternal.h"

@interface DODropletConfiguration (Private)
@property (nonatomic, strong) NSDictionary *attributes;
@end

SPEC_BEGIN(DOInsertQuerySpec)

describe(@"DOQuery", ^{

  __block DOQuery *query = nil;

  context(@"Droplet", ^{

    __block DODropletConfiguration *config = nil;

    NSString *hostname = @"shaps.me";
    NSUInteger imageID = 10322623;
    NSString *sizeSlug = @"512mb";
    NSString *regionSlug = @"lon1";
    BOOL enableBackups = YES;
    BOOL enableIPv6 = YES;
    BOOL enablePrivateNetworking = YES;
    NSArray *keys = @[ @"f7:18:b8:e2:44:6e:1a:07:9f:8d:d3:2e:1d:95:89:54" ];

    query = [DOQuery insertDropletWithConfiguration:^(DODropletConfiguration *configuration) {
      configuration.hostname = hostname;
      configuration.imageID = imageID;
      configuration.sizeSlug = sizeSlug;
      configuration.regionSlug = regionSlug;
      configuration.enableBackups = enableBackups;
      configuration.enableIPv6 = enableIPv6;
      configuration.enablePrivateNetworking = enablePrivateNetworking;
      configuration.sshKeys = keys;
      config = configuration;
    }];

    it(@"should create a valid configuration", ^{
      [[config.attributes[@"name"] should] equal:hostname];
      [[config.attributes[@"image"] should] equal:@(imageID)];
      [[config.attributes[@"size"] should] equal:sizeSlug];
      [[config.attributes[@"region"] should] equal:regionSlug];
      [[config.attributes[@"backups"] should] equal:@(enableBackups)];
      [[config.attributes[@"ipv6"] should] equal:@(enableIPv6)];
      [[config.attributes[@"private_networking"] should] equal:@(enablePrivateNetworking)];
      [[config.attributes[@"ssh_keys"] should] equal:keys];
      [[config.attributes[@"user_data"] should] beNil];
    });

    it(@"should create a valid query", ^{
      [[query.HTTPMethod should] equal:@"POST"];
      [[theValue(query.objectClass) should] equal:theValue(DODroplet.class)];
      [[query.path should] equal:DOURL(@"droplets?region=lon1&ipv6=1&size=512mb&private_networking=1&ssh_keys=f7:18:b8:e2:44:6e:1a:07:9f:8d:d3:2e:1d:95:89:54&image=10322623&backups=1&name=shaps.me").absoluteString];
    });

  });

  context(@"Domain", ^{

    it(@"should create a valid query to create a new domain", ^{
      query = [DOQuery insertDomainNamed:@"shaps.me" ipAddress:@"10.0.0.0"];
      [[query.HTTPMethod should] equal:@"POST"];
      [[theValue(query.objectClass) should] equal:theValue(DODomain.class)];
      [[query.path should] equal:DOURL(@"domains?name=shaps.me&ip_address=10.0.0.0").absoluteString];
    });

  });

  context(@"Domain Record", ^{

    it(@"should create a valid query to create a new record for a domain", ^{
      query = [DOQuery insertRecordForDomainNamed:@"shaps.me" attributes:DODomainRecordTypeA(@"@", @"10.0.0.0")];
      [[query.HTTPMethod should] equal:@"POST"];
      [[theValue(query.objectClass) should] equal:theValue(DODomainRecord.class)];
      [[query.path should] equal:DOURL(@"domains/shaps.me/records?name=@&type=A&data=10.0.0.0").absoluteString];
    });

  });

  context(@"SSH Keys", ^{

    it(@"should create a valid query to create a new SSH Key", ^{
      NSString *key = @"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC680qx9VjT77l+OhPcb0CbRe3pw1jWa0UBLrcPM2T8Zxf+acIz7V3AowsCk5XHtsM1fKs0LH3bJqp9kTZoAwX3JOjGXE3JyXglRUcybS2ay059KP0ySorvXHfHUl1lwZvwGfeABqVtCKHrkJw4Q0etI8Xdf0F6WXyPlHyERWI1Iwzml1o1RtAkJ92OqkQKfps0VgxwYHxXcppf2IsqvDv9NMOVHp15G3/is3irP1JQj7BxXe6OvT3a2XWJZtaC55pJWhD787MgfOwuyGEe/Y8jD66OuycNA5yvCkKEZTcqvvuIFiFSHISoV2ahtUv7MQuB6rEoR6c2OZvljq6sBfc1 DO@DO-rMBP.local";

      query = [DOQuery insertSSHKeyNamed:@"My Key" publicKey:key];
      [[query.HTTPMethod should] equal:@"POST"];
      [[theValue(query.objectClass) should] equal:theValue(DOSSHKey.class)];
      [[query.path should] equal:DOURL(@"account/keys?name=My%20Key&public_key=ssh-rsa%20AAAAB3NzaC1yc2EAAAADAQABAAABAQC680qx9VjT77l+OhPcb0CbRe3pw1jWa0UBLrcPM2T8Zxf+acIz7V3AowsCk5XHtsM1fKs0LH3bJqp9kTZoAwX3JOjGXE3JyXglRUcybS2ay059KP0ySorvXHfHUl1lwZvwGfeABqVtCKHrkJw4Q0etI8Xdf0F6WXyPlHyERWI1Iwzml1o1RtAkJ92OqkQKfps0VgxwYHxXcppf2IsqvDv9NMOVHp15G3/is3irP1JQj7BxXe6OvT3a2XWJZtaC55pJWhD787MgfOwuyGEe/Y8jD66OuycNA5yvCkKEZTcqvvuIFiFSHISoV2ahtUv7MQuB6rEoR6c2OZvljq6sBfc1%20DO@DO-rMBP.local").absoluteString];
    });

  });

});

SPEC_END


text:
package com.yeyu.dearinformaton.interactor.impl;

import com.socks.library.KLog;
import com.yeyu.dearinformaton.Constant.HostType;
import com.yeyu.dearinformaton.MyApplication;
import com.yeyu.dearinformaton.entity.NewsDetail;
import com.yeyu.dearinformaton.interactor.NewsDetailInteractor;
import com.yeyu.dearinformaton.listener.RequestCallBack;
import com.yeyu.dearinformaton.respository.network.RetrofitManager;
import com.yeyu.dearinformaton.utils.MyUtils;
import com.yeyu.dearinformaton.utils.TransformUtils;

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

import javax.inject.Inject;

import rx.Observer;
import rx.Subscription;
import rx.functions.Func1;

/**
 * Created by gaoyehua on 2016/9/8.
 */
public class NewsDetailInteractorImpl implements NewsDetailInteractor<NewsDetail> {

    @Inject
    public NewsDetailInteractorImpl() {
    }

    @Override
    public Subscription loadNewsDetail(final RequestCallBack<NewsDetail> callBack, final String postId) {
        return RetrofitManager.getInstance(HostType.NETEASE_NEWS_VIDEO).getNewsDetailObservable(postId)
                .map(new Func1<Map<String, NewsDetail>, NewsDetail>() {
                    @Override
                    public NewsDetail call(Map<String, NewsDetail> map) {
                        KLog.d(Thread.currentThread().getName());

                        NewsDetail newsDetail = map.get(postId);
                        changeNewsDetail(newsDetail);
                        return newsDetail;
                    }
                })
                .compose(TransformUtils.<NewsDetail>defaultSchedulers())
                .subscribe(new Observer<NewsDetail>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                        KLog.e(e.toString());
                        callBack.onError(MyUtils.analyzeNetworkError(e));
                    }

                    @Override
                    public void onNext(NewsDetail newsDetail) {
                        callBack.success(newsDetail);
                    }
                });
    }

    private void changeNewsDetail(NewsDetail newsDetail) {
        List<NewsDetail.ImgBean> imgSrcs = newsDetail.getImg();
        if (isChange(imgSrcs)) {
            String newsBody = newsDetail.getBody();
            newsBody = changeNewsBody(imgSrcs, newsBody);
            newsDetail.setBody(newsBody);
        }
    }

    private boolean isChange(List<NewsDetail.ImgBean> imgSrcs) {
        return imgSrcs != null && imgSrcs.size() >= 2 && MyApplication.isHavePhoto();
    }

    private String changeNewsBody(List<NewsDetail.ImgBean> imgSrcs, String newsBody) {
        for (int i = 0; i < imgSrcs.size(); i++) {
            String oldChars = "<!--IMG#" + i + "-->";
            String newChars;
            if (i == 0) {
                newChars = "";
            } else {
                newChars = "<img src=\"" + imgSrcs.get(i).getSrc() + "\" />";
            }
            newsBody = newsBody.replace(oldChars, newChars);

        }
        return newsBody;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/include/autoprepend.php');

/**
 *  File: calendar.php | (c) dynarch.com 2004
 *  Distributed as part of "The Coolest DHTML Calendar"
 *  under the same terms.
 *  -----------------------------------------------------------------
 *  This file implements a simple PHP wrapper for the calendar.  It
 *  allows you to easily include all the calendar files and setup the
 *  calendar by instantiating and calling a PHP object.
 */

define('NEWLINE', "\n");

class DHTML_Calendar {
    var $calendar_lib_path;

    var $calendar_file;
    var $calendar_lang_file;
    var $calendar_setup_file;
    var $calendar_theme_file;
    var $calendar_options;

    function DHTML_Calendar($calendar_lib_path = '/calendar/',
                            $lang              = 'en',
                            $theme             = 'calendar-win2k-1',
                            $stripped          = true) {
        if ($stripped) {
            $this->calendar_file = 'calendar_stripped.js';
            $this->calendar_setup_file = 'calendar-setup_stripped.js';
        } else {
            $this->calendar_file = 'calendar.js';
            $this->calendar_setup_file = 'calendar-setup.js';
        }
        $this->calendar_lang_file = 'lang/calendar-' . $lang . '.js';
        $this->calendar_theme_file = $theme.'.css';
        $this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path);
        $this->calendar_options = array('ifFormat' => '%Y/%m/%d',
                                        'daFormat' => '%Y/%m/%d');
    }

    function set_option($name, $value) {
        $this->calendar_options[$name] = $value;
    }

    function load_files() {
        echo $this->get_load_files_code();
    }

    function get_load_files_code() {
        $code  = ( '<link rel="stylesheet" type="text/css" media="all" href="' .
                   $this->calendar_lib_path . $this->calendar_theme_file .
                   '" />' . NEWLINE );
        $code .= ( '' . NEWLINE );
        $code .= ( '' . NEWLINE );
        $code .= ( '' );
        return $code;
    }

    function _make_calendar($other_options = array()) {
        $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
        $code  = ( '' );
        return $code;
    }

    function make_input_field($cal_options = array(), $field_attributes = array()) {
        $id = $this->_gen_id();
        $attrstr = $this->_make_html_attr(array_merge($field_attributes,
                                                      array('id'   => $this->_field_id($id),
                                                            'type' => 'text')));
        echo '<input ' . $attrstr .'/>';
        echo '_trigger_id($id) . '">' .
            'calendar_lib_path . 'img.gif" alt="" />';

        $options = array_merge($cal_options,
                               array('inputField' => $this->_field_id($id),
                                     'button'     => $this->_trigger_id($id)));
        echo $this->_make_calendar($options);
    }

    /// PRIVATE SECTION

    function _field_id($id) { return 'f-calendar-field-' . $id; }
    function _trigger_id($id) { return 'f-calendar-trigger-' . $id; }
    function _gen_id() { static $id = 0; return ++$id; }

    function _make_js_hash($array) {
        $jstr = '';
        reset($array);
        while (list($key, $val) = each($array)) {
            if (is_bool($val))
                $val = $val ? 'true' : 'false';
            else if (!is_numeric($val))
                $val = '"'.$val.'"';
            if ($jstr) $jstr .= ',';
            $jstr .= '"' . $key . '":' . $val;
        }
        return $jstr;
    }

    function _make_html_attr($array) {
        $attrstr = '';
        reset($array);
        while (list($key, $val) = each($array)) {
            $attrstr .= $key . '="' . $val . '" ';
        }
        return $attrstr;
    }
};

?>


text:
.pointer{
	cursor:pointer;
}


text:
module GraphQL
  module StaticValidation
    # Default rules for {GraphQL::StaticValidation::Validator}
    #
    # Order is important here. Some validators return {GraphQL::Language::Visitor::SKIP}
    # which stops the visit on that node. That way it doesn't try to find fields on types that
    # don't exist, etc.
    ALL_RULES = [
      GraphQL::StaticValidation::NoDefinitionsArePresent,
      GraphQL::StaticValidation::DirectivesAreDefined,
      GraphQL::StaticValidation::DirectivesAreInValidLocations,
      GraphQL::StaticValidation::UniqueDirectivesPerLocation,
      GraphQL::StaticValidation::OperationNamesAreValid,
      GraphQL::StaticValidation::FragmentNamesAreUnique,
      GraphQL::StaticValidation::FragmentsAreFinite,
      GraphQL::StaticValidation::FragmentsAreNamed,
      GraphQL::StaticValidation::FragmentsAreUsed,
      GraphQL::StaticValidation::FragmentTypesExist,
      GraphQL::StaticValidation::FragmentsAreOnCompositeTypes,
      GraphQL::StaticValidation::FragmentSpreadsArePossible,
      GraphQL::StaticValidation::FieldsAreDefinedOnType,
      GraphQL::StaticValidation::FieldsWillMerge,
      GraphQL::StaticValidation::FieldsHaveAppropriateSelections,
      GraphQL::StaticValidation::ArgumentsAreDefined,
      GraphQL::StaticValidation::ArgumentLiteralsAreCompatible,
      GraphQL::StaticValidation::RequiredArgumentsArePresent,
      GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent,
      GraphQL::StaticValidation::ArgumentNamesAreUnique,
      GraphQL::StaticValidation::VariableNamesAreUnique,
      GraphQL::StaticValidation::VariablesAreInputTypes,
      GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped,
      GraphQL::StaticValidation::VariablesAreUsedAndDefined,
      GraphQL::StaticValidation::VariableUsagesAreAllowed,
      GraphQL::StaticValidation::MutationRootExists,
      GraphQL::StaticValidation::QueryRootExists,
      GraphQL::StaticValidation::SubscriptionRootExists,
      GraphQL::StaticValidation::InputObjectNamesAreUnique,
      GraphQL::StaticValidation::OneOfInputObjectsAreValid,
    ]
  end
end


text:
var gulp = require("gulp");
var tslint = require("gulp-tslint");
var config = require("./config");

gulp.task("lint:ts", function() {
    return gulp.src(config.paths.src.root)
        .pipe(tslint({
            configuration: {
                rules: config.linting.rules.ts
            },
            formatter: "prose"
        }))
        .pipe(tslint.report({
            emitError: false
        }));
});

gulp.task("lint", ["lint:ts"]);


text:
import os

from indra.sources.gnbr.processor import *
import indra.sources.gnbr.api as api
from indra.statements.validate import assert_valid_statements

def test_standardize_agent():
    agent = get_std_gene('xxx', '673')
    assert isinstance(agent[0], Agent)
    assert agent[0].name == 'BRAF'
    assert agent[0].db_refs.get('TEXT') == 'xxx'
    assert agent[0].db_refs.get('EGID') == '673'
    assert agent[0].db_refs.get('HGNC') == '1097'

def test_multiple_genes():
    agents = get_std_gene('Erk1/2', '5594;5595')
    assert agents[0].name == 'MAPK1'
    assert agents[1].name == 'MAPK3'
    assert agents[0].db_refs['TEXT'] == 'Erk1/2'
    assert agents[1].db_refs['TEXT'] == 'Erk1/2'
    assert agents[0].db_refs['HGNC'] == '6871'
    assert agents[1].db_refs['HGNC'] == '6877'

def test_process_gene_gene():
    test_path1: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_gene_gene_part1_test.tsv')
    test_path2: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_gene_gene_part2_test.tsv')
    gp = api.process_gene_gene(test_path1, test_path2)
    assert len(gp.statements) != 0
    assert isinstance(gp, GnbrProcessor)
    assert gp.first_type == 'gene'
    assert gp.second_type == 'gene'
    assert isinstance(gp.statements[0], Activation)
    assert isinstance(gp.statements[1], Activation)
    assert isinstance(gp.statements[2], IncreaseAmount)
    assert isinstance(gp.statements[3], IncreaseAmount)
    assert isinstance(gp.statements[4], Complex)
    assert_valid_statements(gp.statements)

def test_process_chemical_gene():
    test_path1: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_chemical_gene_part1_test.tsv')
    test_path2: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_chemical_gene_part2_test.tsv')
    gp = api.process_chemical_gene(test_path1, test_path2)
    assert len(gp.statements) != 0
    assert isinstance(gp, GnbrProcessor)
    assert gp.first_type == 'chemical'
    assert gp.second_type == 'gene'
    assert isinstance(gp.statements[0], Activation)
    assert isinstance(gp.statements[1], Inhibition)
    assert isinstance(gp.statements[2], Complex)
    assert isinstance(gp.statements[3], DecreaseAmount)
    assert_valid_statements(gp.statements)

def test_process_gene_disease():
    test_path1: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_gene_disease_part1_test.tsv')
    test_path2: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_gene_disease_part2_test.tsv')
    gp = api.process_gene_disease(test_path1, test_path2)
    assert len(gp.statements) != 0
    assert isinstance(gp, GnbrProcessor)
    assert gp.first_type == 'gene'
    assert gp.second_type == 'disease'
    assert isinstance(gp.statements[0], Inhibition)
    assert isinstance(gp.statements[1], Activation)
    assert_valid_statements(gp.statements)

def test_process_chemical_disease():
    test_path1: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_chemical_disease_part1_test.tsv')
    test_path2: str = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   'gnbr_chemical_disease_part2_test.tsv')
    gp = api.process_chemical_disease(test_path1, test_path2)
    assert len(gp.statements) != 0
    assert isinstance(gp, GnbrProcessor)
    assert gp.first_type == 'chemical'
    assert gp.second_type == 'disease'
    assert isinstance(gp.statements[0], Inhibition)
    assert isinstance(gp.statements[1], Inhibition)
    assert isinstance(gp.statements[2], Inhibition)
    assert isinstance(gp.statements[3], Inhibition)
    assert isinstance(gp.statements[4], Inhibition)
    assert_valid_statements(gp.statements)


text:
package leap.web.api.annotation;

import java.lang.annotation.*;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(Responses.class)
public @interface Response {

    /**
     * The response http status.
     */
    int status() default 200;

    /**
     * The type of response data.
     */
    Class<?> type() default Void.class;

    /**
     * The generic type of response data.
     */
    Class<?> genericType() default Object.class;

}


text:
#include <QNetworkInterface>
#include <QSet>

#include "../util/json.h"
#include "devicelistener.h"

DeviceListener::DeviceListener()
{
    connect(&mTimer, &QTimer::timeout, this, &DeviceListener::sendPings);
    connect(&mSocket, &QUdpSocket::readyRead, this, &DeviceListener::processPings);
    connect(Settings::instance(), &Settings::settingsChanged, this, &DeviceListener::onSettingsChanged);

    // Load the initial settings
    onSettingsChanged();

    // Immediately announce the device on the network and start the timer
    sendPings();
    mTimer.start();
}

void DeviceListener::processPings()
{
    while(mSocket.hasPendingDatagrams()) {

        // Capture both the data and the address
        QByteArray data;
        QHostAddress address;

        data.resize(mSocket.pendingDatagramSize());
        mSocket.readDatagram(data.data(), data.size(), &address);

        // Extract the data from the packet
        QJsonDocument document = QJsonDocument::fromJson(data);
        QJsonObject object;
        QString uuid;
        QString name;
        QString operatingSystemName;
        int port;

        if(Json::isObject(document, object) &&
                Json::objectContains(object, "uuid", uuid) &&
                Json::objectContains(object, "name", name) &&
                Json::objectContains(object, "operating_system", operatingSystemName) &&
                Json::objectContains(object, "port", port)) {

            // Double-check that the port is valid and convert the operating system
            if(port > 0 && port < 65536) {

                Platform::OperatingSystem operatingSystem = Platform::operatingSystemForName(operatingSystemName);
                emit pingReceived(uuid, name, operatingSystem, address, port);
            }
        }
    }
}

void DeviceListener::sendPings()
{
    // TODO: when switching to Qt 5.4, switch to using QJsonObject's
    // initializer instead of converting a QVariantMap

    Settings *settings = Settings::instance();

    QJsonObject object(QJsonObject::fromVariantMap({
        { "uuid", settings->get(Settings::Key::DeviceUUID).toString() },
        { "name", settings->get(Settings::Key::DeviceName).toString() },
        { "operating_system", Platform::operatingSystemName() },
        { "port", QString::number(settings->get(Settings::Key::TransferPort).toInt()) }
    }));

    // Build a list of all unique addresses (since we are
    // sending broadcast packets, these will always be IPv4)
    QSet<QHostAddress> addresses;
    foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces()) {
        if(interface.flags() & QNetworkInterface::CanBroadcast) {
            foreach(QNetworkAddressEntry entry, interface.addressEntries()) {
                if(!entry.broadcast().isNull()) {
                    addresses.insert(entry.broadcast());
                }
            }
        }
    }

    // Build the packet and send it on all of the addresses
    QByteArray data(QJsonDocument(object).toJson(QJsonDocument::Compact));
    foreach(QHostAddress address, addresses) {
        mSocket.writeDatagram(data, address, mSocket.localPort());
    }
}

void DeviceListener::onSettingsChanged(const QList<Settings::Key> &keys)
{
    Settings *settings = Settings::instance();

    if(keys.empty() || keys.contains(Settings::Key::BroadcastInterval)) {
        mTimer.setInterval(settings->get(Settings::Key::BroadcastInterval).toInt());
    }

    if(keys.empty() || keys.contains(Settings::Key::BroadcastPort)) {
        mSocket.close();
        mSocket.bind(settings->get(Settings::Key::BroadcastPort).toInt(), QUdpSocket::ShareAddress);
    }
}


text:
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

use Laracasts\TestDummy\Factory as TestDummy;

class FunctionalHelper extends \Codeception\Module
{

	public function haveLink($overrides = [])
	{
		return $this->have('UrlShortener\Links\Link', $overrides);
	}

	public function haveAccount($overrides = [])
	{
		return $this->have('UrlShortener\Users\User', $overrides);
	}

	private function have($model, $overrides = [])
	{
		return TestDummy::create($model, $overrides);
	}
}


text:
function Controller() {
    require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
    arguments[0] ? arguments[0]["__parentSymbol"] : null;
    arguments[0] ? arguments[0]["$model"] : null;
    var $ = this;
    var exports = {};
    $.__views.DetailAlumno = Ti.UI.createWindow({
        backgroundColor: "white",
        id: "DetailAlumno"
    });
    $.__views.DetailAlumno && $.addTopLevelView($.__views.DetailAlumno);
    $.__views.__alloyId3 = Ti.UI.createLabel({
        text: "Detalle de alumno",
        top: "2%",
        width: "20%",
        id: "__alloyId3"
    });
    $.__views.DetailAlumno.add($.__views.__alloyId3);
    exports.destroy = function() {};
    _.extend($, $.__views);
    _.extend($, exports);
}

var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._;

module.exports = Controller;


text:
[![Latest Stable Version](https://poser.pugx.org/fleshgrinder/assertion/v/stable)](https://packagist.org/packages/fleshgrinder/assertion)
[![Latest Unstable Version](https://poser.pugx.org/fleshgrinder/assertion/v/unstable)](https://packagist.org/packages/fleshgrinder/assertion)
[![Travis](https://img.shields.io/travis/Fleshgrinder/php-assertion.svg)](https://travis-ci.org/Fleshgrinder/php-assertion)
[![Build status](https://ci.appveyor.com/api/projects/status/dfyfacv59mpmmhdt/branch/master?svg=true)](https://ci.appveyor.com/project/Fleshgrinder/php-assertion/branch/master)
[![License](https://poser.pugx.org/fleshgrinder/assertion/license)](https://packagist.org/packages/fleshgrinder/assertion)
[![Total Downloads](https://poser.pugx.org/fleshgrinder/assertion/downloads)](https://packagist.org/packages/fleshgrinder/assertion)

[![Coveralls branch](https://img.shields.io/coveralls/Fleshgrinder/php-assertion/master.svg)](https://coveralls.io/github/Fleshgrinder/php-assertion)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/Fleshgrinder/php-assertion.svg)](https://scrutinizer-ci.com/g/Fleshgrinder/php-assertion/)
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/61540e8e-2ca9-4102-bd43-3b9c5a0a38e2.svg)](https://insight.sensiolabs.com/projects/61540e8e-2ca9-4102-bd43-3b9c5a0a38e2)
[![Code Climate: GPA](https://img.shields.io/codeclimate/github/Fleshgrinder/php-assertion.svg)](https://codeclimate.com/github/Fleshgrinder/php-assertion)
[![Code Climate: Issues](https://img.shields.io/codeclimate/issues/github/Fleshgrinder/php-assertion.svg)](https://codeclimate.com/github/Fleshgrinder/php-assertion/issues)
# PHP Assertions
Library to ease defensive and design by contract (DbC) programming with
[`assert()`][assert] in PHP.

## Installation
Open a terminal, enter your project directory and execute the following command
to add this package to your dependencies:

```bash
$ composer require fleshgrinder/assertion
```

This command requires you to have Composer installed globally, as explained in
the [installation chapter][composer-intro] of the Composer documentation.

**NOTE:** Do not install the library as a development requirement because
composer does not install them when a library is installed as a dependency of
another library. You want your assertions to be executed at all times, except
when the full application goes into production; which is managed through the
[configuration](#configuration).

## Usage
This library provides a single purely static class that can be used in
assertions to ease repetitive scalar inspections as well as writing custom
inspections on top of it. The following code example illustrates the basic
usage:

```php
// Use built-in functions whenever possible.
assert(is_string($var), 'variable must be of type string.');
assert(Variable::isStringWithContent($var), 'variable must be of type string with content');
assert(Variable::isStringable($var), 'variable must be of type string or a convertible object');
assert(Variable::isStringableWithContent($var), 'variable must be of type string or a convertible object with content');

// Again, use built-in functions whenever possible.
assert($var === null || Variable::isInteger($var), 'variable must be NULL or an integer (ℤ)');
assert($var === null || Variable::isNaturalNumber($var), 'variable must be NULL or a natural number (ℕ₀)');
assert($var === null || Variable::isScalarPositiveNaturalNumber($var), 'variable must be NULL or a positive natural number (ℕ₁) of type int');
```

### Big Floats
The PHP extension [BC Math][bcmath] is required to validate big float numbers.
It is not required but a `E_USER_NOTICE` error is triggered if a big float is
encountered and the extension is not available. PHP must be compiled with the
`--enable-bcmath` flag and the extension is always loaded on Windows systems.

### Defensive Programming / Design by Contract
> "**Be polite, Never Assert**
>
> Avoid the `assert()` mechanism, because it could turn a three-day debug fest
> into a ten minute one."
>
> — [How to Write Unmaintainable Code][unmaintain], Roedy Green.

Be sure to check the [Weblinks](#Weblinks) section and read through all the
sources to find out what assertions are good for, when to use them, and when
not. Feel free to open an issue if you are still in doubt.

### Configuration
Assertions need to be configured appropriately in order to be useful during
[Development](#Development) as well as in [Production](#Production).

#### Development
```ini
assert.exception = 1
zend.assertions  = 1
```

#### Production
```ini
assert.exception = 0
zend.assertions  = -1
```

### Note
Default functions that are already provided by PHP are not redefined in this
library. Use the language functions whenever possible, e.g.: `is_string`,
`is_int`, `is_float`, `is_numeric`, …

However, many of the filter functions are exposed via methods that do not
require additional arguments, for instance the integer and float assertions pass
their arguments to the filter function with the appropriate filter and options
set. Be careful and consider using `is_int` and `is_float` if you actually need
the correct type but be even more careful if you need to handle very big
numbers, in these cases use this library again since it will fall back to bcmath
functions as needed while ensuring best performance by using the most
appropriate library in the background.

### FAQ
> _Why is the class called Variable?_

In order to result in nice English sentences, just look at the following:

```php
assert(Variable::isPositiveNaturalNumber($id));
// Assert variable (id) is (a) positive natural number.
```

> _Why is it a class in the first place and not a collection of procedural
> functions?_

Because PHP (composer) does not support lazy loading of procedural functions and
it makes no sense to include the file in production. Using a class on the other
hand makes lazy loading possible.

> _Why does the class not follow PSR-4 (and the associated vendor prefixing to
> avoid conflicts) while the tests do?_

To minimize noise within the _assert_ calls and possible extra work with IDEs
(like PhpStorm) that automatically import classes with _use_ statements that do
not work nicely together with _assert_. I consider the likelihood of another
class being named after something generic as _variable_ to be very low and thus
concluded that above arguments are reason enough to put it in the global
namespace.

## Credits
Credit where credit is due: this library was inspired by [Drupal's][drupal]
[Inspector class][drupal-inspector].

## Weblinks
- The PHP Group: "[_`assert()`_](https://secure.php.net/assert)"
- Steve McConnell: "[_Code Complete: 2nd Edition_](http://www.stevemcconnell.com/cc.htm),"
  2004, Microsoft Press, 960 pages. ISBN: 0735619670. _Section 8.2 in particular
  but there is more general advice in regards to defensive programming and how
  to use `assert()` effectively._
- Aki Tendo, et al.: "[_Adding Assertions to Drupal - Test Tools._](https://www.drupal.org/node/2408013)"
- Jess (xjm), et al.: "[_[policy, no patch] Define best practices for using and testing assertions and document them before adding assertions to core_](https://www.drupal.org/node/2548671)"
- Aki Tendo: "[_Runtime Assertions have been added to Drupal core_](https://www.drupal.org/node/2569701)," September 29, 2015.
- Drupal contributors: "[_Well Formed Errors Initiative_](https://www.drupal.org/node/2412507)," March 6, 2015.
- Stackoverflow contributors: "[_When should assertions stay in production code?_](http://stackoverflow.com/questions/17732)"
- Wikipedia contributors: "[_Assertion (software development)_](https://en.wikipedia.org/wiki/Assertion_%28software_development%29)"
- Wikipedia contributors: "[_Design by contract_](https://en.wikipedia.org/wiki/Design_by_contract)"
- Wikipedia contributors: "[_Exception handling_](https://en.wikipedia.org/wiki/Exception_handling)"

## License
[![MIT License](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/License_icon-mit.svg/48px-License_icon-mit.svg.png)](https://opensource.org/licenses/MIT)

[assert]: https://secure.php.net/assert
[composer-intro]: https://getcomposer.org/doc/00-intro.md
[bcmath]: https://secure.php.net/bcmath
[unmaintain]: https://thc.org/root/phun/unmaintain.html
[drupal]: https://www.drupal.org/
[drupal-inspector]: https://github.com/drupal/drupal/blob/8.0.x/core/lib/Drupal/Component/Assertion/Inspector.php


text:
<resources>

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    -->
    <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

    <!-- Side menu -->
    <style name="SideMenuTextView">
        <item name="android:background">?android:attr/selectableItemBackground</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">56dip</item>
        <item name="android:paddingLeft">22dip</item>
        <item name="android:paddingTop">8dip</item>
        <item name="android:paddingBottom">8dip</item>
        <item name="android:drawablePadding">16dip</item>
        <item name="android:gravity">left|center_vertical</item>
        <item name="android:textColor">@drawable/side_menu_text_color</item>
        <item name="android:textSize">20sp</item>
    </style>

</resources>


text:
namespace Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// VirtualNetworkGatewaySku details
    /// </summary>
    public partial class VirtualNetworkGatewaySku
    {
        /// <summary>
        /// Initializes a new instance of the VirtualNetworkGatewaySku class.
        /// </summary>
        public VirtualNetworkGatewaySku()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the VirtualNetworkGatewaySku class.
        /// </summary>
        /// <param name="name">Gateway SKU name. Possible values include:
        /// 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance',
        /// 'VpnGw1', 'VpnGw2', 'VpnGw3'</param>
        /// <param name="tier">Gateway SKU tier. Possible values include:
        /// 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance',
        /// 'VpnGw1', 'VpnGw2', 'VpnGw3'</param>
        /// <param name="capacity">The capacity.</param>
        public VirtualNetworkGatewaySku(string name = default(string), string tier = default(string), int? capacity = default(int?))
        {
            Name = name;
            Tier = tier;
            Capacity = capacity;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets gateway SKU name. Possible values include: 'Basic',
        /// 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1',
        /// 'VpnGw2', 'VpnGw3'
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets gateway SKU tier. Possible values include: 'Basic',
        /// 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1',
        /// 'VpnGw2', 'VpnGw3'
        /// </summary>
        [JsonProperty(PropertyName = "tier")]
        public string Tier { get; set; }

        /// <summary>
        /// Gets or sets the capacity.
        /// </summary>
        [JsonProperty(PropertyName = "capacity")]
        public int? Capacity { get; set; }

    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>FindwxWidgets — CMake 3.7.1 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="top" title="CMake 3.7.1 Documentation" href="../index.html" />
    <link rel="up" title="cmake-modules(7)" href="../manual/cmake-modules.7.html" />
    <link rel="next" title="FindwxWindows" href="FindwxWindows.html" />
    <link rel="prev" title="FindWish" href="FindWish.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.7.1 Documentation »

cmake-modules(7) »

FindwxWidgets¶

Find a wxWidgets (a.k.a., wxWindows) installation.

This module finds if wxWidgets is installed and selects a default
configuration to use.  wxWidgets is a modular library.  To specify the
modules that you will use, you need to name them as components to the
package:

find_package(wxWidgets COMPONENTS core base ...)

There are two search branches: a windows style and a unix style.  For
windows, the following variables are searched for and set to defaults
in case of multiple choices.  Change them if the defaults are not
desired (i.e., these are the only variables you should change to
select a configuration):

wxWidgets_ROOT_DIR      - Base wxWidgets directory
                          (e.g., C:/wxWidgets-2.6.3).
wxWidgets_LIB_DIR       - Path to wxWidgets libraries
                          (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
wxWidgets_CONFIGURATION - Configuration to use
                          (e.g., msw, mswd, mswu, mswunivud, etc.)
wxWidgets_EXCLUDE_COMMON_LIBRARIES
                        - Set to TRUE to exclude linking of
                          commonly required libs (e.g., png tiff
                          jpeg zlib regex expat).

For unix style it uses the wx-config utility.  You can select between
debug/release, unicode/ansi, universal/non-universal, and
static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
the following variables:

wxWidgets_USE_DEBUG
wxWidgets_USE_UNICODE
wxWidgets_USE_UNIVERSAL
wxWidgets_USE_STATIC

There is also a wxWidgets_CONFIG_OPTIONS variable for all other
options that need to be passed to the wx-config utility.  For example,
to use the base toolkit found in the /usr/local path, set the variable
(before calling the FIND_PACKAGE command) as such:

set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)

The following are set after the configuration is done for both windows
and unix style:

wxWidgets_FOUND            - Set to TRUE if wxWidgets was found.
wxWidgets_INCLUDE_DIRS     - Include directories for WIN32
                             i.e., where to find "wx/wx.h" and
                             "wx/setup.h"; possibly empty for unices.
wxWidgets_LIBRARIES        - Path to the wxWidgets libraries.
wxWidgets_LIBRARY_DIRS     - compile time link dirs, useful for
                             rpath on UNIX. Typically an empty string
                             in WIN32 environment.
wxWidgets_DEFINITIONS      - Contains defines required to compile/link
                             against WX, e.g. WXUSINGDLL
wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
                             against WX debug builds, e.g. __WXDEBUG__
wxWidgets_CXX_FLAGS        - Include dirs and compiler flags for
                             unices, empty on WIN32. Essentially
                             "`wx-config --cxxflags`".
wxWidgets_USE_FILE         - Convenience include file.

Sample usage:

# Note that for MinGW users the order of libs is important!
find_package(wxWidgets COMPONENTS net gl core base)
if(wxWidgets_FOUND)
  include(${wxWidgets_USE_FILE})
  # and for each of your dependent executable/library targets:
  target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
endif()

If wxWidgets is required (i.e., not an optional part):

find_package(wxWidgets REQUIRED net gl core base)
include(${wxWidgets_USE_FILE})
# and for each of your dependent executable/library targets:
target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})

Previous topic

FindWish

Next topic

FindwxWindows

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          next |

          previous |

    CMake »

    3.7.1 Documentation »

cmake-modules(7) »

        © Copyright 2000-2016 Kitware, Inc. and Contributors.
      Created using Sphinx 1.4a0+.


text:
package de.tuberlin.uebb.sl2.tests.specs

import org.scalatest.matchers._
import org.scalatest.FunSpec
import de.tuberlin.uebb.sl2.modules._
import de.tuberlin.uebb.sl2.specs.SLPrelude
import de.tuberlin.uebb.sl2.modules.Syntax._

trait TypeCheckerSpec extends FunSpec with ShouldMatchers with SLPrelude {

  this: TypeChecker with Syntax with Context with Type with NameSupply with EnrichedLambdaCalculus with ELCExpressions with Errors =>

  def testedImplementationName(): String

  /*
   * Custom Matcher handling the Either values returned by the 'checkType' function.
   */
  case class TypeCheckMatcher(expected: Type) extends Matcher[ELC] {

    def apply(expr: ELC) = {
      val result = checkTypes(initialContext, expr)

      val failureMessageSuffix = (for (resType <- result.right) yield "'" + expr + "' resulted in " + resType + " which did not equal " + expected).fold("failed: %s".format(_), _.toString)

      val negatedFailureMessageSuffix = "'" + expr + "' yielded " + expected

      val equals = (for (resType <- result.right) yield resType == expected).right.toOption.getOrElse(false)

      MatchResult(equals,
        "Type checking " + failureMessageSuffix,
        "Type checking " + negatedFailureMessageSuffix,
        "Type checking " + failureMessageSuffix,
        "Type checking " + negatedFailureMessageSuffix)
    }
  }

  def haveType(ty: Type) = TypeCheckMatcher(ty)

  def checking(expr: ELC): Either[Error, Type] = for (ty <- checkTypes(initialContext, expr).right) yield ty

  def fail(err: Error): Matcher[Either[Error, Type]] = be(Left(err))

  describe(testedImplementationName() + ": Built-in values") {
    it("Should type check Integer values") {
      EInt(42) should haveType(int)
    }

    it("Should type check Real values") {
      EReal(2.0) should haveType(real)
    }

    it("Should type check Character values") {
      EChar('c') should haveType(char)
    }

    it("Should type check String values") {
      EStr("Test") should haveType(BaseType.String)
    }

    it("Should type check JavaScript quote without type ascription") {
      EJavaScript("", None) should haveType(BaseType.Dom(BaseType.Void))
    }

    it("Should type check JavaScript quote with type ascription") {
      EJavaScript("", Some(int)) should haveType(int)
    }

    it("Should fail on JavaScript quote with invalid type ascription") {
      val invalidType = TypeConstructor(TConVar("InvalidType"), Nil)
      checking(EJavaScript("", Some(invalidType))) should fail(AttributedError("Invalid type in type ascription for JavaScript quote: `InvalidType'", EmptyAttribute))
    }
  }

  describe(testedImplementationName() + ": Lambda abstraction") {
    it("Should type check lambda abstractions over variable patterns") {
      reset() // Reset name supply
      (pVar("x") :=> eVar("x")) should haveType(tv("$0") --> tv("$0"))
    }

    it("Should type check lambda abstractions over constructor patterns") {
      reset() // Reset name supply
      val expr = pApp("Cons", pVar("x"), pVar("xs")) :=> eVar("x")
      expr should haveType(list(tv("$1")) --> tv("$1"))
    }
  }

  describe(testedImplementationName() + ": Application") {
    it("Should type check application of built-in function 'chr'") {
      (eVar("chr") :@ EInt(42)) should haveType(char)
    }

    it("Should type check application of built-in function 'ord'") {
      (eVar("ord") :@ EChar('c')) should haveType(int)
    }

    it("Should type check application of built-in function '+'") {
      ((eVar("+") :@ EInt(1)) :@ EInt(1)) should haveType(int)
    }

    it("Should type check application of built-in function '=='") {
      ((eVar("==") :@ EInt(1)) :@ EInt(1)) should haveType(bool)
    }

    it("Should type check function application '(λ x.x) (λ x.x)'") {
      reset() // Reset name supply
      val id = pVar("x") :=> eVar("x")
      (id :@ id) should haveType(tv("$1") --> tv("$1"))
    }

    it("Should type check application of built-in monadic function yield") {
      (eVar("yield") :@ EInt(5)) should haveType(dom(int))
    }

    it("Should type check application of monadic bind '(yield 5) & {| |}'") {
      ((eVar("&") :@ (eVar("yield") :@ EInt(5))) :@ EJavaScript("", None)) should haveType(BaseType.Dom(BaseType.Void))
    }
  }

  describe(testedImplementationName() + ": Let-bindings") {
    it("Should type check monomorphic let-binding") {
      ELet(idDef, eVar("id") :@ EInt(5)) should haveType(int)
    }

    it("Should type check polymorphic let-binding") {
      val body = (eCon("Pair") :@ (eVar("id") :@ EInt(5))) :@ (eVar("id") :@ eCon("True"))
      ELet(idDef, body) should haveType(TypeConstructor(Syntax.TConVar("Pair"), List(int, bool)))
    }
  }

  describe(testedImplementationName() + ": Recursive let-bindings") {
    it("Should type check CASE-based 'map' definition") {
      reset() // Reset name supply
      val mapType = (tv("$14") --> tv("$15")) --> (list(tv("$14")) --> list(tv("$15")))
      ELetRec(List(mapDef), eVar("map")) should haveType(mapType)
    }

    it("Should type check CHOICE-based 'map' definition") {
      reset() // Reset name supply
      val mapType = (tv("$14") --> tv("$15")) --> (list(tv("$14")) --> list(tv("$15")))
      ELetRec(List(mapChoiceDef), eVar("map")) should haveType(mapType)
    }

    it("Should type check 'append' definition") {
      reset() // Reset name supply
      val appendType = list(tv("$12")) --> (list(tv("$12")) --> list(tv("$12")))
      ELetRec(List(appendDef), eVar("append")) should haveType(appendType)
    }

    it("Should type check 'length' definition") {
      reset() // Reset name supply
      ELetRec(List(lengthDef), eVar("length")) should haveType(list(tv("$8")) --> int)
    }

    it("Should type check 'sum' definition") {
      ELetRec(List(sumDef), eVar("sum")) should haveType(list(int) --> int)
    }
  }

  describe(testedImplementationName() + ": Mutually recursive let-bindings") {
    it("Should type check {'even', 'odd'} definitions") {
      ELetRec(List(evenDef, oddDef), eVar("even") :@ EInt(42)) should haveType(bool)
    }
  }

  describe(testedImplementationName() + ": Multiple definitions in let-bindings") {
    it("Should type check {'map', 'append', 'even', 'length', 'odd', 'sum'} definitions") {
      ELetRec(List(mapDef, appendDef, evenDef, lengthDef, oddDef, sumDef), eVar("odd") :@ EInt(42)) should haveType(bool)
    }
  }
}


text:
<!---
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->

Near real time rsync replicated file system
===========================================

Quickdemo
=========

* This demo starts 3 instances with id's as ```localhost_12001, localhost_12002, localhost_12003```
* Each instance stores its files under /tmp/<id>/filestore
* ``` localhost_12001 ``` is designated as the master and ``` localhost_12002 and localhost_12003``` are the slaves.
* Files written to master are replicated to the slaves automatically. In this demo, a.txt and b.txt are written to ```/tmp/localhost_12001/filestore``` and it gets replicated to other folders.
* When the master is stopped, ```localhost_12002``` is promoted to master.
* The other slave ```localhost_12003``` stops replicating from ```localhost_12001``` and starts replicating from new master ```localhost_12002```
* Files written to new master ```localhost_12002``` are replicated to ```localhost_12003```
* In the end state of this quick demo, ```localhost_12002``` is the master and ```localhost_12003``` is the slave. Manually create files under ```/tmp/localhost_12002/filestore``` and see that appears in ```/tmp/localhost_12003/filestore```
* Ignore the interrupted exceptions on the console :-).

```
git clone https://git-wip-us.apache.org/repos/asf/helix.git
cd recipes/rsync-replicated-file-system/
mvn clean install package -DskipTests
cd target/rsync-replicated-file-system-pkg/bin
./quickdemo

```

See [rsync_replicated_file_store](http://helix.apache.org/0.6.2-incubating-docs/recipes/rsync_replicated_file_store.html) for more information


text:
package april.bustabobble;
import android.graphics.*;
import game.engine.*;

public class ReboundBehavior extends Animation {
    private RectF p_bounds;
    private Vec2 p_velocity;
    private Point p_size;

    public ReboundBehavior(RectF bounds, Point size, Vec2 velocity) {
        animating = true;
        p_bounds = bounds;
        p_velocity = velocity;
        p_size = size;
    }

    @Override
    public Vec2 adjustPosition(Vec2 original) {
        Vec2 modified = original;
        modified.x += p_velocity.x;
        modified.y += p_velocity.y;

        if (modified.x < p_bounds.left)
            p_velocity.x *= -1;
        else if (modified.x > p_bounds.right-p_size.x)
            p_velocity.x *= -1;

        if (modified.y < p_bounds.top) {
           // Stick to Top
            p_velocity = new Vec2(0,0);
            modified.y = p_bounds.top;
        }
        else if (modified.y > p_bounds.bottom-p_size.y)
            p_velocity.y *= -1;

        return modified;
    }

}


text:
import sys
import os
import time
import subprocess
import logging
import argparse

from . import util
from . import endpoint

def send_snapshot(snapshot, dest_endpoint, parent=None, clones=None,
                  no_progress=False):
    """
    Sends snapshot to destination endpoint, using given parent and clones.
    It connects the pipes of source and destination together and shows
    progress data using the pv command.
    """

    # Now we need to send the snapshot (incrementally, if possible)
    logging.info("Sending {} ...".format(snapshot))
    if parent:
        logging.info("  Using parent: {}".format(parent))
    else:
        logging.info("  No parent snapshot available, sending in full mode.")
    if clones:
        logging.info("  Using clones: {}".format(clones))

    pv = False
    if not no_progress:
        # check whether pv is available
        logging.debug("Checking for pv ...")
        cmd = ["pv", "--help"]
        logging.debug("Executing: {}".format(cmd))
        try:
            subprocess.call(cmd, stdout=subprocess.DEVNULL,
                            stderr=subprocess.DEVNULL)
        except FileNotFoundError as e:
            logging.debug("  -> got exception: {}".format(e))
            logging.debug("  -> pv is not available")
        else:
            logging.debug("  -> pv is available")
            pv = True

    pipes = []
    pipes.append(snapshot.endpoint.send(snapshot, parent=parent, clones=clones))

    if pv:
        cmd = ["pv"]
        logging.debug("Executing: {}".format(cmd))
        pipes.append(subprocess.Popen(cmd, stdin=pipes[-1].stdout,
                                      stdout=subprocess.PIPE))

    pipes.append(dest_endpoint.receive(pipes[-1].stdout))

    pids = [pipe.pid for pipe in pipes]
    while pids:
        pid, retcode = os.wait()
        if pid in pids:
            logging.debug("  -> PID {} exited with return code "
                          "{}".format(pid, retcode))
            pids.remove(pid)
        if retcode != 0:
            logging.error("Error during btrfs send / receive")
            raise util.SnapshotTransferError()

def sync_snapshots(src_endpoint, dest_endpoint, keep_num_backups=0,
                   no_incremental=False, **kwargs):
    """
    Synchronizes snapshots from source to destination. Takes care
    about locking and deletion of corrupt snapshots from failed transfers.
    It never transfers snapshots that would anyway be deleted afterwards
    due to retention policy.
    """

    logging.info(util.log_heading("  To {} ...".format(dest_endpoint)))

    src_snapshots = src_endpoint.list_snapshots()
    dest_snapshots = dest_endpoint.list_snapshots()
    dest_id = dest_endpoint.get_id()

    # delete corrupt snapshots from destination
    to_remove = []
    for snapshot in src_snapshots:
        if snapshot in dest_snapshots and dest_id in snapshot.locks:
            # seems to have failed previously and is present at
            # destination; delete corrupt snapshot there
            dest_snapshot = dest_snapshots[dest_snapshots.index(snapshot)]
            logging.info("Potentially corrupt snapshot {} found at "
                         "{}".format(dest_snapshot, dest_endpoint))
            to_remove.append(dest_snapshot)
    if to_remove:
        dest_endpoint.delete_snapshots(to_remove)
        # refresh list of snapshots at destination to have deleted ones
        # disappear
        dest_snapshots = dest_endpoint.list_snapshots()
    # now that deletion worked, remove all locks for this destination
    for snapshot in src_snapshots:
        if dest_id in snapshot.locks:
            src_endpoint.set_lock(snapshot, dest_id, False)
        if dest_id in snapshot.parent_locks:
            src_endpoint.set_lock(snapshot, dest_id, False, parent=True)

    logging.debug("Planning transmissions ...")
    to_consider = src_snapshots
    if keep_num_backups > 0:
        # it wouldn't make sense to transfer snapshots that would be deleted
        # afterwards anyway
        to_consider = to_consider[-keep_num_backups:]
    to_transfer = [snap for snap in to_consider if snap not in dest_snapshots]

    if not to_transfer:
        logging.info("No snapshots need to be transferred.")
        return

    logging.info("Going to transfer {} snapshot(s):".format(len(to_transfer)))
    for snapshot in to_transfer:
        logging.info("  {}".format(snapshot))

    while to_transfer:
        if no_incremental:
            # simply choose the last one
            best_snapshot = to_transfer[-1]
            parent = None
            clones = []
        else:
            # pick the snapshots common among source and dest,
            # exclude those that had a failed transfer before
            present_snapshots = [s for s in src_snapshots
                                 if s in dest_snapshots and
                                    dest_id not in s.locks]
            # choose snapshot with smallest distance to its parent
            def key(s):
                p = s.find_parent(present_snapshots)
                if p is None:
                    return 999999999
                d = src_snapshots.index(s) - src_snapshots.index(p)
                return -d if d < 0 else d
            best_snapshot = min(to_transfer, key=key)
            parent = best_snapshot.find_parent(present_snapshots)
            # we don't use clones at the moment, because they don't seem
            # to speed things up
            #clones = present_snapshots
            clones = []
        src_endpoint.set_lock(best_snapshot, dest_id, True)
        if parent:
            src_endpoint.set_lock(parent, dest_id, True, parent=True)
        try:
            send_snapshot(best_snapshot, dest_endpoint, parent=parent,
                          clones=clones, **kwargs)
        except util.SnapshotTransferError:
            logging.info("Keeping {} locked to prevent it from getting "
                         "removed.".format(best_snapshot))
        else:
            src_endpoint.set_lock(best_snapshot, dest_id, False)
            if parent:
                src_endpoint.set_lock(parent, dest_id, False, parent=True)
            dest_endpoint.add_snapshot(best_snapshot)
            dest_snapshots = dest_endpoint.list_snapshots()
        to_transfer.remove(best_snapshot)

    logging.info(util.log_heading("Transfers to {} "
                                  "complete!".format(dest_endpoint)))

def run(argv):
    """Run the program. Items in ``argv`` are treated as command line
       arguments."""

    description = """\
This provides incremental backups for btrfs filesystems. It can be
used for taking regular backups of any btrfs subvolume and syncing them
with local and/or remote locations. Multiple targets are supported as
well as retention settings for both source snapshots and backups. If
a snapshot transfer fails for any reason (e.g. due to network outage),
btrfs-backup will notice it and prevent the snapshot from being deleted
until it finally maked it over to its destination."""

    epilog = """\
You may also pass one or more file names prefixed with '@' at the
command line. Arguments are then read from these files, treating each
line as a flag or '--arg value'-style pair you would normally
pass directly. Note that you must not escape whitespaces (or anything
else) within argument values. Lines starting with '#' are treated
as comments and silently ignored. Blank lines and indentation are allowed
and have no effect. Argument files can be nested, meaning you may include
a file from another one. When doing so, make sure to not create infinite
loops by including files mutually. Mixing of direct arguments and argument
files is allowed as well."""

    # Parse command line arguments
    parser = util.MyArgumentParser(description=description, epilog=epilog,
                                   add_help=False, fromfile_prefix_chars="@",
                                   formatter_class=util.MyHelpFormatter)

    group = parser.add_argument_group("Display settings")
    group.add_argument("-h", "--help", action="help",
                       help="Show this help message and exit.")
    group.add_argument("-v", "--verbosity", default="info",
                       choices=["debug", "info", "warning", "error"],
                       help="Set verbosity level. Default is 'info'.")
    group.add_argument("-q", "--quiet", action="store_true",
                       help="Shortcut for '--no-progress --verbosity "
                            "warning'.")
    group.add_argument("-d", "--btrfs-debug", action="store_true",
                       help="Enable debugging on btrfs send / receive.")
    group.add_argument("-P", "--no-progress", action="store_true",
                       help="Don't display progress and stats during backup.")

    group = parser.add_argument_group("Retention settings",
                                      description="By default, snapshots are "
                                                  "kept forever at both source "
                                                  "and destination. With these "
                                                  "settings you may specify an "
                                                  "alternate retention policy.")
    group.add_argument("-N", "--num-snapshots", type=int, default=0,
                       help="Only keep latest n snapshots on source "
                            "filesystem.")
    group.add_argument("-n", "--num-backups", type=int, default=0,
                       help="Only keep latest n backups at destination. "
                            "This option is not supported for 'shell://' "
                            "storage.")

    group = parser.add_argument_group("Snapshot creation settings")
    group.add_argument("-S", "--no-snapshot", action="store_true",
                       help="Don't take a new snapshot, just transfer "
                            "existing ones.")
    group.add_argument("-f", "--snapshot-folder",
                       help="Snapshot folder in source filesystem; "
                            "either relative to source or absolute. "
                            "Default is 'snapshot'.")
    group.add_argument("-p", "--snapshot-prefix",
                       help="Prefix for snapshot names. Default is ''.")

    group = parser.add_argument_group("Transfer related options")
    group.add_argument("-T", "--no-transfer", action="store_true",
                       help="Don't transfer any snapshot.")
    group.add_argument("-I", "--no-incremental", action="store_true",
                       help="Don't ever try to send snapshots incrementally. "
                            "This might be useful when piping to a file for "
                            "storage.")

    group = parser.add_argument_group("SSH related options")
    group.add_argument("--ssh-opt", action="append", default=[],
                       help="N|Pass extra ssh_config options to ssh(1).\n"
                            "Example: '--ssh-opt Cipher=aes256-ctr --ssh-opt "
                            "IdentityFile=/root/id_rsa'\n"
                            "would result in 'ssh -o Cipher=aes256-ctr "
                            "-o IdentityFile=/root/id_rsa'.")
    group.add_argument("--ssh-sudo", action="store_true",
                       help="Execute commands with sudo on the remote host.")

    group = parser.add_argument_group("Miscellaneous options")
    group.add_argument("-s", "--sync", action="store_true",
                       help="Run 'btrfs subvolume sync' after deleting "
                            "subvolumes.")
    group.add_argument("-w", "--convert-rw", action="store_true",
                       help="Convert read-only snapshots to read-write "
                            "before deleting them. This allows regular users "
                            "to delete subvolumes when mount option "
                            "user_subvol_rm_allowed is enabled.")
    group.add_argument("--remove-locks", action="store_true",
                       help="Remove locks for all given destinations from all "
                            "snapshots present at source. You should only use "
                            "this flag if you can assure that no partially "
                            "transferred snapshot is left at any given "
                            "destination. It might be useful together with "
                            "'--no-snapshot --no-transfer --locked-dests' "
                            "in order to clean up any existing lock without "
                            "doing anything else.")
    group.add_argument("--skip-fs-checks", action="store_true",
                       help="Don't check whether source / destination is a "
                            "btrfs subvolume / filesystem. Normally, you "
                            "shouldn't need to use this flag. If it is "
                            "necessary in a working setup, please consider "
                            "filing a bug.")

    # for backwards compatibility only
    group = parser.add_argument_group("Deprecated options",
                                      description="These options are available "
                                                  "for backwards compatibility "
                                                  "only and might be removed "
                                                  "in future releases. Please "
                                                  "stop using them.")
    group.add_argument("--latest-only", action="store_true",
                       help="Shortcut for '--num-snapshots 1'.")

    group = parser.add_argument_group("Source and destination")
    group.add_argument("--locked-dests", action="store_true",
                       help="Automatically add all destinations for which "
                            "locks exist at any source snapshot.")
    group.add_argument("source",
                       help="N|Subvolume to backup.\n"
                            "The following schemes are possible:\n"
                            " - /path/to/subvolume\n"
                            " - ssh://[user@]host[:port]/path/to/subvolume\n"
                            "Specifying a source is mandatory.")
    group.add_argument("dest", nargs="*", default=[],
                       help="N|Destination to send backups to.\n"
                            "The following schemes are possible:\n"
                            " - /path/to/backups\n"
                            " - ssh://[user@]host[:port]/path/to/backups\n"
                            " - 'shell://cat > some-file'\n"
                            "You may use this argument multiple times to "
                            "transfer backups to multiple locations. "
                            "You may even omit it completely in what case "
                            "no snapshot is transferred at all. That allows, "
                            "for instance, for well-organized local "
                            "snapshotting without backing up.")

    try:
        args = parser.parse_args(argv)
    except RecursionError as e:
        print("Recursion error while parsing arguments.\n"
              "Maybe you produced a loop in argument files?", file=sys.stderr)
        raise util.AbortError()

    # applying shortcuts
    if args.quiet:
        args.no_progress = True
        args.verbosity = "warning"
    if args.latest_only:
        args.num_snapshots = 1

    logging.basicConfig(format="%(asctime)s  [%(levelname)-5s]  %(message)s",
                        datefmt="%H:%M:%S",
                        level=getattr(logging, args.verbosity.upper()))

    logging.info(util.log_heading("Started at {}".format(time.ctime())))

    logging.debug(util.log_heading("Settings"))
    if args.snapshot_folder:
        snapdir = args.snapshot_folder
    else:
        snapdir = "snapshot"

    if args.snapshot_prefix:
        snapprefix = args.snapshot_prefix
    else:
        snapprefix = ""

    logging.debug("Enable btrfs debugging: {}".format(args.btrfs_debug))
    logging.debug("Don't display progress: {}".format(args.no_progress))
    logging.debug("Don't take a new snapshot: {}".format(args.no_snapshot))
    logging.debug("Number of snapshots to keep: {}".format(args.num_snapshots))
    logging.debug("Number of backups to keep: "
                  "{}".format(args.num_backups if args.num_backups > 0
                              else "Any"))
    logging.debug("Snapshot folder: {}".format(snapdir))
    logging.debug("Snapshot prefix: "
                  "{}".format(snapprefix if snapprefix else None))
    logging.debug("Don't transfer snapshots: {}".format(args.no_transfer))
    logging.debug("Don't send incrementally: {}".format(args.no_incremental))
    logging.debug("Extra SSH config options: {}".format(args.ssh_opt))
    logging.debug("Use sudo at SSH remote host: {}".format(args.ssh_sudo))
    logging.debug("Run 'btrfs subvolume sync' afterwards: {}".format(args.sync))
    logging.debug("Convert subvolumes to read-write before deletion: "
                  "{}".format(args.convert_rw))
    logging.debug("Remove locks for given destinations: "
                  "{}".format(args.remove_locks))
    logging.debug("Skip filesystem checks: {}".format(args.skip_fs_checks))
    logging.debug("Auto add locked destinations: {}".format(args.locked_dests))

    # kwargs that are common between all endpoints
    endpoint_kwargs = {"snapprefix": snapprefix,
                       "convert_rw": args.convert_rw,
                       "subvolume_sync": args.sync,
                       "btrfs_debug": args.btrfs_debug,
                       "fs_checks": not args.skip_fs_checks,
                       "ssh_opts": args.ssh_opt,
                       "ssh_sudo": args.ssh_sudo}

    logging.debug("Source: {}".format(args.source))
    src_endpoint_kwargs = dict(endpoint_kwargs)
    src_endpoint_kwargs["path"] = snapdir
    try:
        src_endpoint = endpoint.choose_endpoint(args.source,
                                                src_endpoint_kwargs,
                                                source=True)
    except ValueError as e:
        logging.error("Couldn't parse source specification: {}".format(e))
        raise util.AbortError()
    logging.debug("Source endpoint: {}".format(src_endpoint))
    src_endpoint.prepare()

    # add endpoint creation strings for locked destinations, if desired
    if args.locked_dests:
        for snapshot in src_endpoint.list_snapshots():
            for lock in snapshot.locks:
                if lock not in args.dest:
                    args.dest.append(lock)

    if args.remove_locks:
        logging.info("Removing locks (--remove-locks) ...")
        for snapshot in src_endpoint.list_snapshots():
            for dest in args.dest:
                if dest in snapshot.locks:
                    logging.info("  {} ({})".format(snapshot, dest))
                    src_endpoint.set_lock(snapshot, dest, False)
                if dest in snapshot.parent_locks:
                    logging.info("  {} ({}) [parent]".format(snapshot, dest))
                    src_endpoint.set_lock(snapshot, dest, False, parent=True)

    dest_endpoints = []
    # only create destination endpoints if they are needed
    if args.no_transfer and args.num_backups <= 0:
        logging.debug("Don't creating destination endpoints because they "
                      "won't be needed (--no-transfer and no --num-backups).")
    else:
        for dest in args.dest:
            logging.debug("Destination: {}".format(dest))
            try:
                dest_endpoint = endpoint.choose_endpoint(dest, endpoint_kwargs,
                                                         source=False)
            except ValueError as e:
                logging.error("Couldn't parse destination specification: "
                              "{}".format(e))
                raise util.AbortError()
            dest_endpoints.append(dest_endpoint)
            logging.debug("Destination endpoint: {}".format(dest_endpoint))
            dest_endpoint.prepare()

    if args.no_snapshot:
        logging.info("Taking no snapshot (--no-snapshot).")
    else:
        # First we need to create a new snapshot on the source disk
        logging.info(util.log_heading("Snapshotting ..."))
        src_endpoint.snapshot()

    if args.no_transfer:
        logging.info(util.log_heading("Not transferring (--no-transfer)."))
    else:
        logging.info(util.log_heading("Transferring ..."))
        for dest_endpoint in dest_endpoints:
            try:
                sync_snapshots(src_endpoint, dest_endpoint,
                               keep_num_backups=args.num_backups,
                               no_incremental=args.no_incremental,
                               no_progress=args.no_progress)
            except util.AbortError as e:
                logging.error("Aborting snapshot transfer to {} due to "
                              " exception.".format(dest_endpoint))
                logging.debug("Exception was: {}".format(e))
        if not dest_endpoints:
            logging.info("No destination configured, don't sending anything.")

    logging.info(util.log_heading("Cleaning up ..."))
    # cleanup snapshots > num_snapshots in snapdir
    if args.num_snapshots > 0:
        try:
            src_endpoint.delete_old_snapshots(args.num_snapshots)
        except util.AbortError as e:
            logging.debug("Got AbortError while deleting source snapshots at "
                          "{}".format(src_endpoint))
    # cleanup backups > num_backups in backup target
    if args.num_backups > 0:
        for dest_endpoint in dest_endpoints:
            try:
                dest_endpoint.delete_old_snapshots(args.num_backups)
            except util.AbortError as e:
                logging.debug("Got AbortError while deleting backups at "
                              "{}".format(dest_endpoint))

    logging.info(util.log_heading("Finished at {}".format(time.ctime())))

def main():
    try:
        run(sys.argv[1:])
    except (util.AbortError, KeyboardInterrupt):
        sys.exit(1)

if __name__ == "__main__":
    main()


text:
package org.n52.youngs.validation;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Test;
import org.n52.youngs.harvest.InMemoryStreamSource;
import org.n52.youngs.harvest.NodeSourceRecord;
import org.n52.youngs.harvest.Source;
import org.n52.youngs.harvest.SourceException;
import org.n52.youngs.harvest.SourceRecord;
import org.n52.youngs.impl.ReportImpl;
import org.xml.sax.SAXException;

/**
 *
 * @author Matthes Rieke
 */
public class XmlSchemaValidatorTest {

    @Test
    public void testValidXmlFile() throws SAXException, SourceException, IOException {
        XmlSchemaValidator val = new XmlSchemaValidator("https://dummy.schema",
                getClass().getResource("/schemas/dummy-schema.xsd"));
        Source source = new InMemoryStreamSource(getClass().getResourceAsStream("/schemas/dummy-doc1.xml"));
        Collection<SourceRecord> records = source.getRecords(new ReportImpl());
        NodeSourceRecord record1 = (NodeSourceRecord) records.iterator().next();

        Assert.assertTrue(val.matchesNamespace(record1.getRecord().getNamespaceURI()));
        Assert.assertTrue(val.validate(record1.getRecord()).isEmpty());
    }

    @Test
    public void testInvalidXmlFile() throws SourceException, IOException, SAXException {
        XmlSchemaValidator val = new XmlSchemaValidator("https://dummy.schema",
                getClass().getResource("/schemas/dummy-schema.xsd"));
        Source source = new InMemoryStreamSource(getClass().getResourceAsStream("/schemas/dummy-doc2_invalid.xml"));
        Collection<SourceRecord> records = source.getRecords(new ReportImpl());
        NodeSourceRecord record1 = (NodeSourceRecord) records.iterator().next();

        Assert.assertTrue(val.matchesNamespace(record1.getRecord().getNamespaceURI()));
        try {
            Assert.assertTrue(val.validate(record1.getRecord()).isEmpty());
            // we should not get here
            Assert.assertThat("No exception was thrown", CoreMatchers.equalTo(""));
        } catch (SAXException ex) {
            Assert.assertThat(ex.getMessage(), CoreMatchers.containsString(" is not a valid value for "));
        }
    }

    @Test
    public void testMultiSchemaXmlFile() throws SAXException, SourceException, IOException {
        XmlSchemaValidator val;
        try {
            val = new XmlSchemaValidator("http://www.isotc211.org/2005/gmi",
                    Paths.get(getClass().getResource("/schemas/gmi/gmi.xsd").toURI()).toFile()
            );
        } catch (URISyntaxException ex) {
            throw new IOException(ex);
        }
        Source source = new InMemoryStreamSource(getClass().getResourceAsStream("/schemas/complex_doc.xml"));
        Collection<SourceRecord> records = source.getRecords(new ReportImpl());
        NodeSourceRecord record1 = (NodeSourceRecord) records.iterator().next();

        Assert.assertTrue(val.matchesNamespace(record1.getRecord().getNamespaceURI()));
        Assert.assertTrue(val.validate(record1.getRecord()).isEmpty());
    }

}


text:
package com.dianping.daogen.db.parser;

import com.dianping.daogen.db.model.Table;

/**
 * @author code4crafer@gmail.com
 */
public interface DBParser {

    public Table parse(String schema);
}


text:
if( NOT "$ENV{PARQUET_HOME}" STREQUAL "")
    file( TO_CMAKE_PATH "$ENV{PARQUET_HOME}" _native_path )
    list( APPEND _parquet_roots ${_native_path} )
elseif ( Parquet_HOME )
    list( APPEND _parquet_roots ${Parquet_HOME} )
endif()

# Try the parameterized roots, if they exist
if ( _parquet_roots )
  find_path( PARQUET_INCLUDE_DIR NAMES parquet/api/reader.h
    PATHS ${_parquet_roots} NO_DEFAULT_PATH
    PATH_SUFFIXES "include" )
  find_library( PARQUET_LIBRARIES NAMES parquet
    PATHS ${_parquet_roots} NO_DEFAULT_PATH
    PATH_SUFFIXES "lib" )

  find_library(PARQUET_ARROW_LIBRARIES NAMES parquet_arrow
    PATHS ${_parquet_roots} NO_DEFAULT_PATH
    PATH_SUFFIXES "lib")
else ()
    find_path(PARQUET_INCLUDE_DIR NAMES parquet/api/reader.h )
    find_library(PARQUET_LIBRARIES NAMES parquet)
    find_library(PARQUET_ARROW_LIBRARIES NAMES parquet_arrow)
endif ()

if (PARQUET_INCLUDE_DIR AND PARQUET_LIBRARIES)
  set(PARQUET_FOUND TRUE)
  get_filename_component( PARQUET_LIBS ${PARQUET_LIBRARIES} PATH )
  set(PARQUET_LIB_NAME libparquet)
  set(PARQUET_STATIC_LIB ${PARQUET_LIBS}/${PARQUET_LIB_NAME}.a)
  set(PARQUET_SHARED_LIB ${PARQUET_LIBS}/${PARQUET_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
else ()
  set(PARQUET_FOUND FALSE)
endif ()

if (PARQUET_INCLUDE_DIR AND PARQUET_ARROW_LIBRARIES)
  set(PARQUET_ARROW_FOUND TRUE)
  get_filename_component(PARQUET_ARROW_LIBS ${PARQUET_ARROW_LIBRARIES} PATH)
  set(PARQUET_ARROW_LIB_NAME libparquet_arrow)
  set(PARQUET_ARROW_STATIC_LIB
    ${PARQUET_ARROW_LIBS}/${PARQUET_ARROW_LIB_NAME}.a)
  set(PARQUET_ARROW_SHARED_LIB
    ${PARQUET_ARROW_LIBS}/${PARQUET_ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
else ()
  set(PARQUET_ARROW_FOUND FALSE)
endif ()

if (PARQUET_FOUND AND PARQUET_ARROW_FOUND)
  if (NOT Parquet_FIND_QUIETLY)
    message(STATUS "Found the Parquet library: ${PARQUET_LIBRARIES}")
    message(STATUS "Found the Parquet Arrow library: ${PARQUET_ARROW_LIBS}")
  endif ()
else ()
  if (NOT Parquet_FIND_QUIETLY)
    if (NOT PARQUET_FOUND)
      set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} Could not find the parquet library.")
    endif()

    if (NOT PARQUET_ARROW_FOUND)
      set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} Could not find the parquet_arrow library. Did you build with -DPARQUET_ARROW=on?")
    endif()
    set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} Looked in ")
    if ( _parquet_roots )
      set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} in ${_parquet_roots}.")
    else ()
      set(PARQUET_ERR_MSG "${PARQUET_ERR_MSG} system search paths.")
    endif ()
    if (Parquet_FIND_REQUIRED)
      message(FATAL_ERROR "${PARQUET_ERR_MSG}")
    else (Parquet_FIND_REQUIRED)
      message(STATUS "${PARQUET_ERR_MSG}")
    endif (Parquet_FIND_REQUIRED)
  endif ()
endif ()

mark_as_advanced(
  PARQUET_FOUND
  PARQUET_INCLUDE_DIR
  PARQUET_LIBS
  PARQUET_LIBRARIES
  PARQUET_STATIC_LIB
  PARQUET_SHARED_LIB

  PARQUET_ARROW_FOUND
  PARQUET_ARROW_LIBS
  PARQUET_ARROW_STATIC_LIB
  PARQUET_ARROW_SHARED_LIB
)


text:
require "spec/support/test_data_builder"

describe "Get version" do

  let(:path) { "/pacticipants/Consumer/versions/1.2.3" }
  let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) }

  subject { get path; last_response }

  context "when the version exists" do

    before do
      TestDataBuilder.new
        .create_consumer("Another Consumer")
        .create_consumer("Consumer")
        .create_consumer_version("1.2.3")
        .create_consumer_version_tag("prod")
        .create_consumer_version("1.2.4")
    end

    it "returns a 200 HAL JSON response" do
      expect(subject).to be_a_hal_json_success_response
    end

    it "returns the JSON representation of the version" do
      expect(last_response_body).to include number: "1.2.3"
    end

  end

  context "when the version does not exist" do

    before do
      TestDataBuilder.new
        .create_consumer("Consumer")
        .create_version("1.2.4")
    end

    it "returns a 404 response" do
      expect(subject).to be_a_404_response
    end

  end
end


text:
* [Implementation Visualization][implementation]
* [Hash Routing][hash-routing]
* [Server-side Rendering][server-side]
* [Multiple Routers][multiple]
* [Contextual Routers][contextual]
* [Asynchronous Routes][async]
* [Capturing Clicks on anchor elements][a-elements]
* [A custom Link component][rec-custom-link]
* [A custom Router component][rec-custom-router]
* [An animated Router with ES6][rec-es6-custom-router]

React router component allows you to define routes in your [React][] application
in a declarative manner, directly as a part of your component hierarchy.

Usage is as simple as just returning a configured router component from your
component's `render()` method:

    <Locations>
      <Location path="/" handler={MainPage} />
      <Location path="/users/:username" handler={UserPage} />
      <Location path="/search/*" handler={SearchPage} />
      <Location path={/\/product\/([0-9]*)/} handler={ProductPage} />
    </Locations>

Alternatively, if you don't prefer JSX:

    var Locations = React.createFactory(Router.Locations);
    var Location = React.createFactory(Router.Location);
    Locations(null,
      Location({path: "/", handler: MainPage}),
      Location({path: "/users/:username", handler: UserPage}))
      Location({path: "/search/*", handler: SearchPage}))
      Location({path: /\/product\/([0-9]*)/, handler: ProductPage}))

Having routes defined as a part of your component hierarchy allows to
dynamically reconfigure routing based on your application state. For example you
can return a different set of allowed locations for anonymous and signed-in
users.

React router component can dispatch based on `location.pathname` or
`location.hash` if browser doesn't support History API.

Furthermore it provides advanced features like support for [full page server
side rendering][server-side], [multiple routers][multiple] on the same page,
[querystring parsing][querystring],
[contextual routers][contextual], support for [async components][async] and
[optional handling of normal `<a>` elements][a-elements].

Its functionality is tested using [Saucelabs][] on all modern browsers (IE >= 9,
Chrome >= 27, Firefox >= 25, Safari >= 6 and Mobile Safari on iPhone and iPad >=
6).

Its size is about 3.5kb gzipped.

## Installation

React router component is packaged on npm:

    % npm install react-router-component

## Basic usage

First you require `react-router-component` library:

    var React = require('react')
    var Router = require('react-router-component')

If you are using JSX, don't forget to bring components from a library into
scope, cause JSX doesn't support namespaces yet:

    var Locations = Router.Locations
    var Location = Router.Location

Otherwise, as of React 0.12, you must create factories:

    var Locations = React.createFactory(Router.Locations)
    var Location = React.createFactory(Router.Location)

Now you can define your application as a regular React component which renders
into `Locations` router:

    var App = React.createClass({

      render: function() {
        return (
          <Locations>
            <Location path="/" handler={MainPage} />
            <Location path="/users/:username" handler={UserPage} />
            <Location path={/\/friends\/(\d+)\/(photos|wall)/} handler={FriendsPage}
              matchKeys={['id', 'pageName']} />
          </Locations>
        )
      }
    })

**Note:** See [hash routing][hash-routing] to enable `location.hash`.

Direct children of `Locations` router must be `Location` route descriptors.

Each descriptor accepts a `path` property which specifies URL pattern and a
`handler` property which declares a component which should render in case
corresponding `path` is matched.

Parameters extracted from a `path` will be passed to a `handler` as props. In
the example above, `UserPage` component will receive `username` prop on a
successful location match.

The final part is to render your `App` component which activates your router:

    React.render(React.createElement(App), document.body)

In case no location is matched router would render into an empty set of
elements.

## Regular expressions

Regular expressions are an easy way to accomplish more advanced routing.

When using a regular expression, parameters extracted from the regex will be
passed as an array with the name `_`. This may be inconvenient if your components
are reused. If you specify an array of keys and pass it as the `matchKeys` prop,
matches from the regex will be translated.

For example, in the App above, the path `/friends/39/wall` would pass the props
`{id: '39', pageName: 'wall'}` to the handler, `FriendsPage`.

## Handling "404 Not Found" case

You might want to specify a fallback location which will be activated in case no
other location is matched. For that there's a special `NotFound` location
descriptor:

    var NotFound = Router.NotFound

    var App = React.createClass({

      render: function() {
        return (
          <Locations>
            <Location path="/" handler={MainPage} />
            <Location path="/users/:username" handler={UserPage} />
            <NotFound handler={NotFoundPage} />
          </Locations>
        )
      }
    })

## Navigating between locations

To navigate between different locations React router component provides a `Link`
component. It renders into `<a>` DOM element but handles `"click"` by activating
a different location in the router.

As an example, let's see how `MainPage` component can be implemented with the
usage of the `Link` component to transition to a `UserPage`:

    var Link = require('react-router-component').Link

    var MainPage = React.createClass({

      render: function() {
        return (
          <div>
            Hello, this is main page of the application!
            Proceed to my <Link href="/users/andreypopp">user page</Link>.
          </div>
        )
      }
    })

Alternatively, if you have a reference to a router component instance, you can
call its `.navigate(href)` method to do a transition to a different location.
You can acquire a reference to a router by using React's [Refs][React-Refs]
mechanism.

## Navigation callbacks

Routers also accept callbacks `onBeforeNavigation` and `onNavigation` as
properties which will be called before and after navigation correspondingly:

    <Locations
        onBeforeNavigation={this.showProgressBar}
        onNavigation={this.hideProgressBar}>
      <Location path="/" handler={MainPage} />
      ...
    </Locations>

## Advanced usage

Advanced features include support for [full page server
side rendering][server-side], [multiple routers][multiple] on the same page and
[contextual routers][contextual].

## Recipes

These are the examples of what you can do with React Router component:

  * [Create a custom Link component][rec-custom-link] which would have different appearance if the
    current location matches its href.

  * [A custom Router component][rec-custom-router] which allows to declare
    routes as a prototype attribute (statically) as opposed to have routes
    inferred from its children.

  * [An Animated Router component in ES6][rec-es6-custom-router] an animated router that allows
    the user to set transitions via ReactCSSTransitionGroup. This example also shows use of mixins
    with ES6.

[rec-custom-link]: recipes/custom-link
[rec-custom-router]: recipes/custom-router
[rec-es6-custom-router]: recipes/rec-es6-custom-router

[hash-routing]: hash-routing
[querystring]: querystring
[server-side]: server-side
[multiple]: multiple
[contextual]: contextual
[async]: async
[a-elements]: a-elements
[implementation]: implementation

[React]: http://facebook.github.io/react/
[React-Refs]: http://facebook.github.io/react/docs/more-about-refs.html
[React-Shims]: http://facebook.github.io/react/docs/working-with-the-browser.html#polyfills-needed-to-support-older-browsers
[Saucelabs]: https://saucelabs.com


text: package org.apache.isis.objectstore.jdo.metamodel.facets.object.discriminator;


text:
var GT = GT || {};
var difficulty = 1; // 0 for easy 1 for hard
var esayBuetton;

GT.Menu = function() {};
GT.instructions = function() {};

GT.Menu.prototype = {

    preload: function() {
        background = this.game.add.tileSprite(0,0,800,800, 'BACKGROUND');

    },

    create: function() {
        this.mainMenu();
    },
    mainMenu: function() {
        this.game.add.sprite(0,50, 'title');
        instButton = this.game.add.button(244,250, 'instButton', this.inst);
        easyButton = this.game.add.button(244,400,'easyButton', this.setEasyMode);
        hardButton = this.game.add.button(244,550, 'hardButton', this.setHardMode);

    },
    inst: function() {
        this.game.state.start('instructions');
    },
    setEasyMode: function() {
        difficulty = 0;
        this.game.state.start('Game');
    },
    setHardMode: function() {
        difficulty = 1;
        this.game.state.start('Game');
    },

    start: function() {
        this.game.state.start('Game');
    }
};

GT.instructions.prototype = {
    preload: function() {
        background = this.game.add.tileSprite(0,0,800,800, 'BACKGROUND');
    },
    create: function() {

    this.game.add.text(0,50, 'Welcome to Group Theory! You are presented with a 4 x 3 grid of cards.\nEach card has several properties. A shape, a number of shapes, a color, and a filling.\n', {font:'18px Arial', fill: '#000000', weight: 'bold'});
        this.game.add.text(0,100, 'The object of the game is match 3 cards together in a group.\nA group is 3 cards in which each property is the SAME or DIFFERENT across all three cards.\nTo play, select 3 cards and hit the GROUP! button.\nSee the below for examples.\n', {font:'18px Arial', weight: 'bold', fill: '#000000'});

        var frame1 = this.game.add.sprite(32,194, '1RSC');
        var frame2 = this.game.add.sprite(128,194, '2RSC');
        var frame3 = this.game.add.sprite(224,194, '3RSC');

        var frame4 = this.game.add.sprite(32, 330, '1GShC');
        var frame5 = this.game.add.sprite(128, 330, '2RSC');
        var frame6 = this.game.add.sprite(224, 330, '3BOC');

        var frame7 = this.game.add.sprite(32, 466, '3ROC');
        var frame8 = this.game.add.sprite(128, 466, '3RShC');
        var frame9 = this.game.add.sprite(224, 466, '2BOC');

        frame1.scale.setTo(2,2);
        frame2.scale.setTo(2,2);
        frame3.scale.setTo(2,2);
        frame4.scale.setTo(2,2);
        frame5.scale.setTo(2,2);
        frame6.scale.setTo(2,2);
        frame7.scale.setTo(2,2);
        frame8.scale.setTo(2,2);
        frame9.scale.setTo(2,2);

        this.game.add.text(0,288, 'This is a group. All three numbers are different, all three colors, shapes, and fillings are the same.', {font: '18px Arial', fill:'#000000', weight: 'bold'});
        this.game.add.text(0,424, 'This is a group. All three numbers, colors, and filling are different; all three shapes are the same\n.', {font: '18px Arial', fill:'#000000', weight: 'bold'});
        this.game.add.text(0,560, 'This is not a group. Two of the cards have three red circles, and one has two blue circles.\nTwo cards are open and one is shaded.\n', {font: '18px Arial', fill:'#000000', weight: 'bold'});

        this.game.add.text(0,640, 'If there are no groups, press the DEAL button. This will deal 3 more cards. You can only do this\ntwice before reshuffling the deck.\n', {font: '18px Arial', fill: '#000000', weight: 'bold'});

        this.game.add.text(0,720, 'Click to return to the Main Menu', {font: '18px Arial', fill: '#000000', weight: 'bold'});
    },
    update: function() {
        this.game.input.onTap.addOnce(this.returnToMenu, this);
    },

    returnToMenu: function() {
        this.game.state.start('MainMenu');
    }
}


text:
http http://localhost:8002/push epush_id=xiaomi_c push_method=notification_send title="notification_send中文" description="中文" registration_id="go6VssZlTDDypm+hxYdaxycXtqM7M9NsTPbCjzyIyh0=" -f

#推送单人透传
#http http://localhost:8002/push epush_id=xiaomi_c push_method=pass_through description="中文" registration_id="go6VssZlTDDypm+hxYdaxycXtqM7M9NsTPbCjzyIyh0=" -f


text:
if (document.body.addEventListener) {
  document.body.addEventListener('click',replaceThumbnailWithIframe,false);
}
else {
  document.body.attachEvent('onclick',replaceThumbnailWithIframe);//for IE
}

function replaceThumbnailWithIframe(e){
  e = e || window.event;
  var target = e.target || e.srcElement;
  if (target.className.match(/BetterTube-playBtn/)){
    parent = target.parentNode;
    id = parent.getAttribute('data-youtube-id');
    // w = parent.getAttribute('data-player-width');
    // h = parent.getAttribute('data-player-height');
    style = 'style="frameborder=0;"';
    inner = '<iframe class="youtubePlayer" src="https://www.youtube.com/embed/' + id + '?autoplay=1&autohide=1&border=0&wmode=opaque&enablejsapi=1"' + style + ' />'
    parent.innerHTML = inner;
  }
}


text:
define([
    'jquery',
    'global',
    'underscore',
    'backbone',
    'models/modules/pageTransition'
], function(
    $,
    global,
    _,
    Backbone,
    PageTransitionModel
) {

    "use strict";

    //  The View the Pagination
    return Backbone.View.extend({

        model: new PageTransitionModel(),

        initialize: function(options) {

            //_.bindAll(this);

            this.pages = options.pages;
        },

        render: function(slug) {

            // if already animating or if selected value is false return
            if (this.getter('isAnimating')) {
                return false;
            }

            // begin animation - - - - - - -

            this.setter('isAnimating', true);

            var transitions = this.model.get('transition').get('types'), // array of CSS transitions classnames
                animEndEventName = this.model.get('transition').get('animEndEventName'),
                that = this,
                $currPage = $('.current-page'),
                $nextPage = this.pages[slug].$el.addClass('current-page'),
                target = Math.floor(Math.random() * transitions.length),
                outClass = transitions[target].outClass,
                inClass = transitions[target].inClass;

            $currPage.addClass(outClass).on(animEndEventName, function() {

                $currPage.off(animEndEventName);
                that.model.get('transition').set('endCurrPage', true);

                if (that.model.get('transition').get('endNextPage')) {
                    that.onEndAnimation($currPage, $nextPage);
                }
            });

            $nextPage.addClass(inClass).on(animEndEventName, function() {

                $nextPage.off(animEndEventName);
                that.model.get('transition').set('endNextPage', true);

                if (that.model.get('transition').get('endCurrPage')) {
                    that.onEndAnimation($currPage, $nextPage);
                }
            });

            if (!this.model.get('transition').get('support')) {
                this.onEndAnimation($currPage, $nextPage);
            }
        },

        onEndAnimation: function($outpage, $inpage) {

            this.model.get('transition').set('endCurrPage', false);
            this.model.get('transition').set('endNextPage', false);
            this.resetPage($outpage, $inpage);
            this.setter('isAnimating', false);
        },

        resetPage: function($outpage, $inpage) {

            $outpage.attr('class', 'page');
            $inpage.attr('class', 'page current-page');
        },

        getter: function(value) {
            return this.model.get(value);
        },

        setter: function(target, value) {
            this.model.set(target, value);
        }
    });
});


text:
name: Installation Issue
about: Do you need help to install Kanboard?
title: ''
labels: installation issue
assignees: ''

---

Use the forum instead -> https://kanboard.discourse.group/

https://docs.kanboard.org/en/latest/developer_guide/faq.html#why-did-you-close-my-question-on-the-bug-tracker