text:
import threading
import socket
import struct
import bitstring as bs
import pydes
import pydh

class Server(threading.Thread):
   def __init__(self, port, lock):
      super(Server, self).__init__()
      self.port = port
      self.lock = lock
      self.box = None

   def run(self):
      self.startup()
      buff = ''
      while True:
         cipher = self.client.recv(8)
         b = bs.BitArray(bytes = cipher)
         m = self.box.decrypt(b)
         mstr = m.hex.decode('hex')
         for c in mstr:
            if c == '\f':
               self.tprint(buff)
               buff = ''
               break
            else:
               buff += c

   def startup(self):
      self.tprint("Starting up...")
      self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
      self.sock.bind(('0.0.0.0', self.port))
      self.sock.listen(0)
      self.tprint("Listening for connections on port " + str(self.port))

      (clientSocket, address) = self.sock.accept()
      self.client = clientSocket
      self.tprint("Made connection with client at " + str(address))
      self.tprint("Waiting for Diffie-Helman initation...")
      buff = self.client.recv(8)
      gen, group = struct.unpack('!II', buff)

      self.tprint("Diffie-Helman initiated!")
      DH = pydh.DiffieHellman(generator=gen, group=group)

      self.client.send(bytes(DH.publicKey))
      otherKey = int(self.client.recv(4096))
      DH.genKey(otherKey)

      self.box = pydes.DES(DH.getKey()[:16])
      self.box.genSubKeys()
      self.tprint("DES Key=" + str(DH.getKey()[:16]))
      self.tprint('DES key calculated, beginning DES communication now!')

   def tprint(self, str):
      self.lock.acquire()
      print '\033[92m[Server]\033[0m', str
      self.lock.release()

if __name__=='__main__':
   print 'Do not run this module as main.'
else:
   pass

redpajama_set_name: RedPajamaGithub


text:
package edu.cmu.dynet

import org.scalatest._
import Matchers._

case class RegressionLine(slope: Float, intercept: Float) {}

/* An end-to-end example for sanity check purposes. */
class LinearRegressionSpec extends FlatSpec with Matchers {

  import Utilities._

  Initialize.initialize()

  def regress(xs: Seq[Float], ys: Seq[Float], numIterations: Int = 20): RegressionLine = {
    assert(xs.size > 0)
    assert(xs.size == ys.size)

    val model = new ParameterCollection
    val trainer = new SimpleSGDTrainer(model, 0.01f)

    val p_W = model.addParameters(Dim(1))
    val p_b = model.addParameters(Dim(1))

    val examples = xs.zip(ys)

    for (iter <- 1 to numIterations) {
      for ((x, y) <- examples) {
        ComputationGraph.renew()
        val W = Expression.parameter(p_W)
        val b = Expression.parameter(p_b)

        val prediction = W * x + b
        val loss = Expression.square(prediction - y)
        ComputationGraph.forward(loss)
        ComputationGraph.backward(loss)
        trainer.update()
      }
    }

    RegressionLine(p_W.values.toFloat, p_b.values.toFloat)
  }

  "regression" should "learn the correct model" in {
    // x from 0.0 to 10.0
    val xs = (0 until 100).map(_.toFloat / 10)

    // y_i = 2 * x_i
    val ys = for {
      x <- xs
    } yield (-5.0 + 2.0 * x).toFloat

    val result = regress(xs, ys, 20)

    // These are very weak bounds, 20 iterations should always get this close.
    result.slope shouldBe 2f +- 1f
    result.intercept shouldBe -5f +- 1f
  }
}


text:
DEVICE_SERVER_IP=$1
LWM2M_SERVER_IP=$2
CONTENT_TYPE=$3
OUTPUT_FILENAME=$4

ORGANISATION_0_KEY=$5
ORGANISATION_0_SECRET=$6

ORGANISATION_1_KEY=$7
ORGANISATION_1_SECRET=$8

# Run tests and save results. NB: `dotnet test -xml results.xml` does not yet work on linux.

COMMAND="env DeviceServerTests:RestAPI:URI=http://$DEVICE_SERVER_IP:8080 \
             DeviceServerTests:RestAPI:ContentType=$CONTENT_TYPE \
             DeviceServerTests:RestAPI:Authentication:MasterKey=$ORGANISATION_0_KEY \
             DeviceServerTests:RestAPI:Authentication:MasterSecret=$ORGANISATION_0_SECRET \
             DeviceServerTests:RestAPI:Authentication:Key=$ORGANISATION_1_KEY \
             DeviceServerTests:RestAPI:Authentication:Secret=$ORGANISATION_1_SECRET \
             DeviceServerTests:LWM2MClient:URI=coaps://$LWM2M_SERVER_IP:5684 \
         mono bin/Debug/net451/debian.8-x64/dotnet-test-xunit.exe \
              bin/Debug/net451/debian.8-x64/DeviceServerTests.dll \
              -xml $OUTPUT_FILENAME \
              -parallel none"

#create a temporary container to run the tests within
docker create -it \
	   --workdir /app/test/DeviceServerTests/ \
	   --name deviceserver-test-container \
       --net imaginationdeviceserver_DeviceServerNet \
	   deviceserver-test \
	   $COMMAND

docker start -a deviceserver-test-container || true

# copy test results out of container
docker cp deviceserver-test-container:/app/test/DeviceServerTests/$OUTPUT_FILENAME $OUTPUT_FILENAME || true

docker rm -f deviceserver-test-container


text:
import React, { Component } from 'react';
import './RoomInfo.css';
import Users from './Users';
import Scoreboard from './Scoreboard';

class RoomInfo extends Component {
    constructor(props) {
        super(props);
        this.state = {
            players: this.props.players
        }
    }

    render(){
        return(
            <div className="Room-info">
                <Users users={this.state.players}/>
                <Scoreboard players={this.state.players}/>
            </div>
        );
    }
}

export default RoomInfo;


text:
package cn.hashdata.bireme.pipeline;

import java.util.Arrays;
import java.util.HashMap;

import org.apache.commons.codec.binary.Base64;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.logging.log4j.LogManager;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import cn.hashdata.bireme.BiremeException;
import cn.hashdata.bireme.BiremeUtility;
import cn.hashdata.bireme.Context;
import cn.hashdata.bireme.Record;
import cn.hashdata.bireme.Row;
import cn.hashdata.bireme.Table;
import cn.hashdata.bireme.Row.RowType;

/**
 * {@code MaxwellPipeLine} is a kind of {@code KafkaPipeLine} whose change data coming from Maxwell.
 *
 * @author yuze
 *
 */
public class MaxwellPipeLine extends KafkaPipeLine {
  public MaxwellPipeLine(Context cxt, SourceConfig conf, int id) {
    super(cxt, conf, "Maxwell-" + conf.name + "-" + conf.topic + "-" + id);
    consumer.subscribe(Arrays.asList(conf.topic));
    logger = LogManager.getLogger("Bireme." + myName);
    logger.info("Create new Maxwell Pipeline. Name: {}", myName);
  }

  @Override
  public Transformer createTransformer() {
    return new MaxwellTransformer();
  }

  /**
   * {@code MaxwellChangeTransformer} is a type of {@code Transformer}. It is used to transform data
   * to {@code Row} from <B>Maxwell</B> data source.
   *
   * @author yuze
   *
   */
  class MaxwellTransformer extends KafkaTransformer {
    HashMap<String, String> tableMap;

    public MaxwellTransformer() {
      super();
      tableMap = conf.tableMap;
    }

    private String getMappedTableName(MaxwellRecord record) {
      return cxt.tableMap.get(record.dataSource + "." + record.database + "." + record.table);
    }

    private String getOriginTableName(MaxwellRecord record) {
      return record.dataSource + "." + record.database + "." + record.table;
    }

    private boolean filter(MaxwellRecord record) {
      String fullTableName = record.dataSource + "." + record.database + "." + record.table;

      if (!tableMap.containsKey(fullTableName)) {
        return true;
      }

      return false;
    }

    @Override
    protected byte[] decodeToBinary(String data) {
      byte[] decoded = null;
      decoded = Base64.decodeBase64(data);
      return decoded;
    }

    @Override
    protected String decodeToBit(String data, int precision) {
      String binaryStr = Integer.toBinaryString(Integer.valueOf(data));
      return String.format("%" + precision + "s", binaryStr).replace(' ', '0');
    }

    @Override
    public boolean transform(ConsumerRecord<String, String> change, Row row)
        throws BiremeException {
      MaxwellRecord record = new MaxwellRecord(change.value());

      if (filter(record)) {
        return false;
      }

      Table table = cxt.tablesInfo.get(getMappedTableName(record));

      row.type = record.type;
      row.produceTime = record.produceTime;
      row.originTable = getOriginTableName(record);
      row.mappedTable = getMappedTableName(record);
      row.keys = formatColumns(record, table, table.keyNames, false);

      if (row.type == RowType.INSERT || row.type == RowType.UPDATE) {
        row.tuple = formatColumns(record, table, table.columnName, false);
      }

      if (row.type == RowType.UPDATE) {
        row.oldKeys = formatColumns(record, table, table.keyNames, true);

        if (row.keys.equals(row.oldKeys)) {
          row.oldKeys = null;
        }
      }

      return true;
    }

    class MaxwellRecord implements Record {
      public String dataSource;
      public String database;
      public String table;
      public Long produceTime;
      public RowType type;
      public JsonObject data;
      public JsonObject old;

      public MaxwellRecord(String changeValue) {
        JsonParser jsonParser = new JsonParser();
        JsonObject value = (JsonObject) jsonParser.parse(changeValue);

        this.dataSource = getPipeLineName();
        this.database = value.get("database").getAsString();
        this.table = value.get("table").getAsString();
        this.produceTime = value.get("ts").getAsLong() * 1000;
        this.data = value.get("data").getAsJsonObject();

        if (value.has("old") && !value.get("old").isJsonNull()) {
          this.old = value.get("old").getAsJsonObject();
        }

        switch (value.get("type").getAsString()) {
          case "insert":
            type = RowType.INSERT;
            break;

          case "update":
            type = RowType.UPDATE;
            break;

          case "delete":
            type = RowType.DELETE;
            break;
        }
      }

      @Override
      public String getField(String fieldName, boolean oldValue) throws BiremeException {
        String field = null;

        if (oldValue) {
          try {
            field = BiremeUtility.jsonGetIgnoreCase(old, fieldName);
            return field;
          } catch (BiremeException ignore) {
          }
        }

        return BiremeUtility.jsonGetIgnoreCase(data, fieldName);
      }
    }
  }
}


text:
class AddCurrencyToAccount < ActiveRecord::Migration[5.0]
  def change
    add_reference :accounts, :currency, index: true, foreign_key: true, null: true
  end
end


text:
;(function ( $, window, document, undefined )
{
    var pluginName = 'previewmodal',
        pluginElement = null,
        defaults =
        {
            targetVars:
            {
                nodeId : null,
                contentObjectId: null,
                nodeUrl: null,
                versionNumber: null,
            },
        };

    function getScrollBarWidth()
    {
        // Create the measurement node
        var scrollDiv = document.createElement("div");
        scrollDiv.className = "scrollbar-measure";
        document.body.appendChild(scrollDiv);

        // Get the scrollbar width
        var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
        console.warn(scrollbarWidth); // Mac:  15

        // Delete the DIV
        document.body.removeChild(scrollDiv);
    }

    function Plugin( element, options )
    {
        pluginElement = element;
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;

        this.init();
    }

    Plugin.prototype =
    {
        init : function()
        {
            var self = this;

            $( self.element ).modal(
            {
                backdrop: true,
                show: false,
            });

            self.initTriggers();
        },

        initTriggers : function()
        {
            var self = this;
            var iframe = $(self.element).find( 'iframe' );

            iframe.load( function()
            {
                $(this).show();
            });

            $( '#preview-selector' ).change( function()
            {

                iframe
                    .hide()
                    .attr( 'src', self.parseUrl( $(this).find( 'option:selected' ).attr( 'data-iframe-target' ) ) );

                var defaultSize = $(this).find( 'option:selected' ).attr( 'data-default-size' );
                if( defaultSize )
                {
                    $( self.element ).find( '#preview-size' )
                        .val( defaultSize )
                        .change();
                }
            });

            $( self.element ).find( '#preview-size' ).change( function()
            {
                $( self.element ).find( '#iframe-wrapper' )
                    .removeClass( 'extra-small-width small-width medium-width large-width' )
                    .addClass( $(this).val() );
            });

            $( self.element ).find( '#open-in-new-window' ).click( function()
            {
                window.open( $(self.element).find( 'iframe').attr( 'src' ) );
            });

            // TODO: not sure if that's the right place for it
            $( '#view-button *[data-layout]' ).click( function()
            {
                self.show( $(this).attr( 'data-layout' ) );
                return false;
            });
        },

        show : function( layout )
        {
            var self = this;

            $( '#preview-selector' )
                .val( layout )
                .change();

            $(self.element).modal( 'show' );
        },

        parseUrl : function( url )
        {
            var self = this;

            Mustache.parse( url, [ '[[', ']]' ] );

            return Mustache.render( url, self.options.targetVars );
        },
    };

    $.fn[pluginName] = function ( options ) {
        var args = arguments;

        if (options === undefined || typeof options === 'object') {
            return this.each(function ()
            {
                if (!$.data(this, 'plugin_' + pluginName)) {

                    $.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
                }
            });

        } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {

            var returns;

            this.each(function () {
                var instance = $.data(this, 'plugin_' + pluginName);

                if (instance instanceof Plugin && typeof instance[options] === 'function') {

                    returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
                }

                // Allow instances to be destroyed via the 'destroy' method
                if (options === 'destroy') {
                    $.data(this, 'plugin_' + pluginName, null);
                }
            });

            return returns !== undefined ? returns : this;
        }
    };

}(jQuery, window, document));


text:
#include <nitroshare/category.h>
#include <nitroshare/setting.h>
#include <nitroshare/settingsregistry.h>

#include "settingsregistry_p.h"

SettingsRegistryPrivate::SettingsRegistryPrivate(QObject *parent, QSettings *settings)
    : QObject(parent),
      settings(settings),
      isInGroup(false)
{
}

SettingsRegistry::SettingsRegistry(QSettings *settings, QObject *parent)
    : QObject(parent),
      d(new SettingsRegistryPrivate(this, settings))
{
}

QList<Category*> SettingsRegistry::categories() const
{
    return d->categoryList;
}

QList<Setting*> SettingsRegistry::settings() const
{
    return d->settingsList;
}

Category *SettingsRegistry::findCategory(const QString &name) const
{
    foreach (Category *category, d->categoryList) {
        if (category->name() == name) {
            return category;
        }
    }
    return nullptr;
}

void SettingsRegistry::addCategory(Category *category)
{
    d->categoryList.append(category);
    emit categoryAdded(category);
}

void SettingsRegistry::removeCategory(Category *category)
{
    d->categoryList.removeOne(category);
    emit categoryRemoved(category);
}

Setting *SettingsRegistry::findSetting(const QString &name) const
{
    foreach (Setting *setting, d->settingsList) {
        if (setting->name() == name) {
            return setting;
        }
    }
    return nullptr;
}

void SettingsRegistry::addSetting(Setting *setting)
{
    d->settingsList.append(setting);
    emit settingAdded(setting);
}

void SettingsRegistry::removeSetting(Setting *setting)
{
    d->settingsList.removeOne(setting);
    emit settingRemoved(setting);
}

QVariant SettingsRegistry::value(const QString &name) const
{
    Setting *setting = findSetting(name);
    if (setting) {
        if (d->settings->contains(name)) {
            return d->settings->value(name);
        } else {
            d->settings->setValue(name, setting->defaultValue());
            return setting->defaultValue();
        }
    } else {
        return QVariant();
    }
}

void SettingsRegistry::setValue(const QString &name, const QVariant &value)
{
    if (d->settings->contains(name) && d->settings->value(name) == value) {
        return;
    }
    d->settings->setValue(name, value);
    if (d->isInGroup) {
        d->groupNames.insert(name);
    } else {
        emit settingsChanged({ name });
    }
}

void SettingsRegistry::begin()
{
    d->isInGroup = true;
}

void SettingsRegistry::end()
{
    emit settingsChanged(d->groupNames.toList());
    d->isInGroup = false;
    d->groupNames.clear();
}


text:
+++
date = "2015-12-14"
draft = false
title = "Survey 1"

+++

Let's start with an artistic style. Which one's your favorite?
https://benjaminma.typeform.com/to/MgyCHi


text:
layout: post
date: 2017-06-06
title: "Jorge Manuel THE SEJIMA Sleeveless Court Train Mermaid/Trumpet"
category: Jorge Manuel
tags: [Jorge Manuel ,Jorge Manuel,Mermaid/Trumpet,Sweetheart,Court Train,Sleeveless]
---
### Jorge Manuel THE SEJIMA
Just **$449.99**
###   Sleeveless Court Train Mermaid/Trumpet

BRANDS	Jorge Manuel

Silhouette	Mermaid/Trumpet

Neckline	Sweetheart

Hemline/Train	Court Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/jorge-manuel-/35790-jorge-manuel-the-sejima.html](https://www.readybrides.com/en/jorge-manuel-/35790-jorge-manuel-the-sejima.html)


text:
typedef NS_ENUM(NSInteger, ILJourneyType) {
    ILJourneyTypeCreate,
    ILJourneyTypeJoin,
    ILJourneyTypeDailyCheck,
    ILJourneyTypeDone,
    ILJourneyTypeQuit,
    ILJourneyTypeCustomer
};

typedef NS_ENUM(NSInteger, ILTipoffsType) {
    ILTipoffsType0,
    ILTipoffsType1,
    ILTipoffsType2,
    ILTipoffsType3
};

@interface ILDreamDBManager : NSObject

+ (void)createDream:(ILDreamModel *)dreamModel;
+ (void)joinDream:(AVObject*)dreamObject;
+ (void)removeDream:(AVObject*)dreamObject;
+ (void)updateFollowers:(AVObject *)dreamObject;
+ (void)updateJourneys:(AVObject *)dreamObject;
+ (void)updateDreamCount:(AVUser *)userObject;

+ (void)addStandardJourney:(ILJourneyType)journeyType toDream:(AVObject*)dreamObject;
+ (void)addCustomJourney:(ILJourneyModel *)journeyModel toDream:(AVObject*)dreamObject;

+ (void)updateLikeNumber:(AVObject *)journeyObject;
+ (void)updateCommentNumber:(AVObject *)journeyObject;
+ (void)addLike:(AVObject *)journeyObject;
+ (void)removeLike:(AVObject *)journeyObject;
+ (void)addComment:(NSString *)commentString toUser:(AVUser *)toUser onJourney:(AVObject *)journeyObject;

+ (void)addTipoffs:(ILTipoffsType)type toObject:(AVObject *)object;

+ (void)AddMessageListFrom:(AVUser *)fromUser to:(AVUser *)toUser message:(NSString *)messageString;
+ (void)pushMessage:(NSString *)message toUser:(AVUser *)toUser;
+ (void)updateBadge:(NSInteger)type forUser:(AVUser *)userObject;
+ (void)resetBadge:(NSInteger)type;
+ (void)fetchBadge;

@end


text:
        A

          <input ref="input" name="data[a]" type="text" class="form-control" lang="en" disabled="disabled" spellcheck="true" value="" id="a-a"></input>

        B

          <input ref="input" name="data[b]" type="text" class="form-control" lang="en" disabled="disabled" spellcheck="true" value="" id="b-b"></input>

        Sum

          <input ref="input" name="data[number]" type="text" class="form-control" lang="en" disabled="disabled" spellcheck="true" value="" id="number-number"></input>

      <button ref="button" class="ui button primary " name="data[submit]" type="submit" class="btn btn-primary btn-md" lang="en" disabled="disabled">
        Submit
      </button>


text: an example of classes in processing


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

<title>game.control</title>
<meta name="date" content="2015-10-14">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

game.control

Classes

GameClient

GameServer

PlayerMP


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//-----------------------------------------------------------------------------
var BUGNUMBER = 465424;
var summary = 'TM: issue with post-decrement operator';
var actual = '';
var expect = '';

//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------

function test()
{
  enterFunc ('test');
  printBugNumber(BUGNUMBER);
  printStatus (summary);

  expect = '0,1,2,3,4,';

  jit(true);
  for (let j=0;j<5;++j) { jj=j; print(actual += '' + (jj--) + ',') }
  jit(false);

  reportCompare(expect, actual, summary);

  exitFunc ('test');
}


text:
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
    {
        "file": "plugins/cordova-plugin-battery-status/www/battery.js",
        "id": "cordova-plugin-battery-status.battery",
        "pluginId": "cordova-plugin-battery-status",
        "clobbers": [
            "navigator.battery"
        ]
    },
    {
        "file": "plugins/cordova-plugin-battery-status/src/browser/BatteryProxy.js",
        "id": "cordova-plugin-battery-status.Battery",
        "pluginId": "cordova-plugin-battery-status",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
        "id": "cordova-plugin-camera.Camera",
        "pluginId": "cordova-plugin-camera",
        "clobbers": [
            "Camera"
        ]
    },
    {
        "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
        "id": "cordova-plugin-camera.CameraPopoverOptions",
        "pluginId": "cordova-plugin-camera",
        "clobbers": [
            "CameraPopoverOptions"
        ]
    },
    {
        "file": "plugins/cordova-plugin-camera/www/Camera.js",
        "id": "cordova-plugin-camera.camera",
        "pluginId": "cordova-plugin-camera",
        "clobbers": [
            "navigator.camera"
        ]
    },
    {
        "file": "plugins/cordova-plugin-camera/src/browser/CameraProxy.js",
        "id": "cordova-plugin-camera.CameraProxy",
        "pluginId": "cordova-plugin-camera",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/contacts.js",
        "id": "cordova-plugin-contacts.contacts",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "navigator.contacts"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/Contact.js",
        "id": "cordova-plugin-contacts.Contact",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "Contact"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactAddress.js",
        "id": "cordova-plugin-contacts.ContactAddress",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "ContactAddress"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactError.js",
        "id": "cordova-plugin-contacts.ContactError",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "ContactError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactField.js",
        "id": "cordova-plugin-contacts.ContactField",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "ContactField"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactFindOptions.js",
        "id": "cordova-plugin-contacts.ContactFindOptions",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "ContactFindOptions"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactName.js",
        "id": "cordova-plugin-contacts.ContactName",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "ContactName"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactOrganization.js",
        "id": "cordova-plugin-contacts.ContactOrganization",
        "pluginId": "cordova-plugin-contacts",
        "clobbers": [
            "ContactOrganization"
        ]
    },
    {
        "file": "plugins/cordova-plugin-contacts/www/ContactFieldType.js",
        "id": "cordova-plugin-contacts.ContactFieldType",
        "pluginId": "cordova-plugin-contacts",
        "merges": [
            ""
        ]
    },
    {
        "file": "plugins/cordova-plugin-device/www/device.js",
        "id": "cordova-plugin-device.device",
        "pluginId": "cordova-plugin-device",
        "clobbers": [
            "device"
        ]
    },
    {
        "file": "plugins/cordova-plugin-device/src/browser/DeviceProxy.js",
        "id": "cordova-plugin-device.DeviceProxy",
        "pluginId": "cordova-plugin-device",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-device-motion/www/Acceleration.js",
        "id": "cordova-plugin-device-motion.Acceleration",
        "pluginId": "cordova-plugin-device-motion",
        "clobbers": [
            "Acceleration"
        ]
    },
    {
        "file": "plugins/cordova-plugin-device-motion/www/accelerometer.js",
        "id": "cordova-plugin-device-motion.accelerometer",
        "pluginId": "cordova-plugin-device-motion",
        "clobbers": [
            "navigator.accelerometer"
        ]
    },
    {
        "file": "plugins/cordova-plugin-device-motion/src/browser/AccelerometerProxy.js",
        "id": "cordova-plugin-device-motion.AccelerometerProxy",
        "pluginId": "cordova-plugin-device-motion",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-device-orientation/www/CompassError.js",
        "id": "cordova-plugin-device-orientation.CompassError",
        "pluginId": "cordova-plugin-device-orientation",
        "clobbers": [
            "CompassError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-device-orientation/www/CompassHeading.js",
        "id": "cordova-plugin-device-orientation.CompassHeading",
        "pluginId": "cordova-plugin-device-orientation",
        "clobbers": [
            "CompassHeading"
        ]
    },
    {
        "file": "plugins/cordova-plugin-device-orientation/www/compass.js",
        "id": "cordova-plugin-device-orientation.compass",
        "pluginId": "cordova-plugin-device-orientation",
        "clobbers": [
            "navigator.compass"
        ]
    },
    {
        "file": "plugins/cordova-plugin-device-orientation/src/browser/CompassProxy.js",
        "id": "cordova-plugin-device-orientation.CompassProxy",
        "pluginId": "cordova-plugin-device-orientation",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-dialogs/www/notification.js",
        "id": "cordova-plugin-dialogs.notification",
        "pluginId": "cordova-plugin-dialogs",
        "merges": [
            "navigator.notification"
        ]
    },
    {
        "file": "plugins/cordova-plugin-dialogs/www/browser/notification.js",
        "id": "cordova-plugin-dialogs.notification_browser",
        "pluginId": "cordova-plugin-dialogs",
        "merges": [
            "navigator.notification"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
        "id": "cordova-plugin-file.DirectoryEntry",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.DirectoryEntry"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
        "id": "cordova-plugin-file.DirectoryReader",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.DirectoryReader"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/Entry.js",
        "id": "cordova-plugin-file.Entry",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.Entry"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/File.js",
        "id": "cordova-plugin-file.File",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.File"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileEntry.js",
        "id": "cordova-plugin-file.FileEntry",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileEntry"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileError.js",
        "id": "cordova-plugin-file.FileError",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileReader.js",
        "id": "cordova-plugin-file.FileReader",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileReader"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileSystem.js",
        "id": "cordova-plugin-file.FileSystem",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileSystem"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
        "id": "cordova-plugin-file.FileUploadOptions",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileUploadOptions"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
        "id": "cordova-plugin-file.FileUploadResult",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileUploadResult"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/FileWriter.js",
        "id": "cordova-plugin-file.FileWriter",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.FileWriter"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/Flags.js",
        "id": "cordova-plugin-file.Flags",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.Flags"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
        "id": "cordova-plugin-file.LocalFileSystem",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.LocalFileSystem"
        ],
        "merges": [
            "window"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/Metadata.js",
        "id": "cordova-plugin-file.Metadata",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.Metadata"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
        "id": "cordova-plugin-file.ProgressEvent",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.ProgressEvent"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/fileSystems.js",
        "id": "cordova-plugin-file.fileSystems",
        "pluginId": "cordova-plugin-file"
    },
    {
        "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
        "id": "cordova-plugin-file.requestFileSystem",
        "pluginId": "cordova-plugin-file",
        "clobbers": [
            "window.requestFileSystem"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
        "id": "cordova-plugin-file.resolveLocalFileSystemURI",
        "pluginId": "cordova-plugin-file",
        "merges": [
            "window"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
        "id": "cordova-plugin-file.isChrome",
        "pluginId": "cordova-plugin-file",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-file/www/browser/Preparing.js",
        "id": "cordova-plugin-file.Preparing",
        "pluginId": "cordova-plugin-file",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-file/src/browser/FileProxy.js",
        "id": "cordova-plugin-file.browserFileProxy",
        "pluginId": "cordova-plugin-file",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
        "id": "cordova-plugin-file.fileSystemPaths",
        "pluginId": "cordova-plugin-file",
        "merges": [
            "cordova"
        ],
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-file/www/browser/FileSystem.js",
        "id": "cordova-plugin-file.firefoxFileSystem",
        "pluginId": "cordova-plugin-file",
        "merges": [
            "window.FileSystem"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file-transfer/www/FileTransferError.js",
        "id": "cordova-plugin-file-transfer.FileTransferError",
        "pluginId": "cordova-plugin-file-transfer",
        "clobbers": [
            "window.FileTransferError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file-transfer/www/FileTransfer.js",
        "id": "cordova-plugin-file-transfer.FileTransfer",
        "pluginId": "cordova-plugin-file-transfer",
        "clobbers": [
            "window.FileTransfer"
        ]
    },
    {
        "file": "plugins/cordova-plugin-file-transfer/www/browser/FileTransfer.js",
        "id": "cordova-plugin-file-transfer.BrowserFileTransfer",
        "pluginId": "cordova-plugin-file-transfer",
        "clobbers": [
            "window.FileTransfer"
        ]
    },
    {
        "file": "plugins/cordova-plugin-globalization/www/GlobalizationError.js",
        "id": "cordova-plugin-globalization.GlobalizationError",
        "pluginId": "cordova-plugin-globalization",
        "clobbers": [
            "window.GlobalizationError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-globalization/www/globalization.js",
        "id": "cordova-plugin-globalization.globalization",
        "pluginId": "cordova-plugin-globalization",
        "clobbers": [
            "navigator.globalization"
        ]
    },
    {
        "file": "plugins/cordova-plugin-globalization/www/browser/moment.js",
        "id": "cordova-plugin-globalization.moment",
        "pluginId": "cordova-plugin-globalization",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-globalization/src/browser/GlobalizationProxy.js",
        "id": "cordova-plugin-globalization.GlobalizationProxy",
        "pluginId": "cordova-plugin-globalization",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
        "id": "cordova-plugin-inappbrowser.inappbrowser",
        "pluginId": "cordova-plugin-inappbrowser",
        "clobbers": [
            "cordova.InAppBrowser.open",
            "window.open"
        ]
    },
    {
        "file": "plugins/cordova-plugin-inappbrowser/src/browser/InAppBrowserProxy.js",
        "id": "cordova-plugin-inappbrowser.InAppBrowserProxy",
        "pluginId": "cordova-plugin-inappbrowser",
        "merges": [
            ""
        ]
    },
    {
        "file": "plugins/cordova-plugin-media/www/MediaError.js",
        "id": "cordova-plugin-media.MediaError",
        "pluginId": "cordova-plugin-media",
        "clobbers": [
            "window.MediaError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media/www/Media.js",
        "id": "cordova-plugin-media.Media",
        "pluginId": "cordova-plugin-media",
        "clobbers": [
            "window.Media"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media/www/browser/Media.js",
        "id": "cordova-plugin-media.BrowserMedia",
        "pluginId": "cordova-plugin-media",
        "clobbers": [
            "window.Media"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/CaptureAudioOptions.js",
        "id": "cordova-plugin-media-capture.CaptureAudioOptions",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "CaptureAudioOptions"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/CaptureImageOptions.js",
        "id": "cordova-plugin-media-capture.CaptureImageOptions",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "CaptureImageOptions"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/CaptureVideoOptions.js",
        "id": "cordova-plugin-media-capture.CaptureVideoOptions",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "CaptureVideoOptions"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/CaptureError.js",
        "id": "cordova-plugin-media-capture.CaptureError",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "CaptureError"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/MediaFileData.js",
        "id": "cordova-plugin-media-capture.MediaFileData",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "MediaFileData"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/MediaFile.js",
        "id": "cordova-plugin-media-capture.MediaFile",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "MediaFile"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/www/capture.js",
        "id": "cordova-plugin-media-capture.capture",
        "pluginId": "cordova-plugin-media-capture",
        "clobbers": [
            "navigator.device.capture"
        ]
    },
    {
        "file": "plugins/cordova-plugin-media-capture/src/browser/CaptureProxy.js",
        "id": "cordova-plugin-media-capture.CaptureProxy",
        "pluginId": "cordova-plugin-media-capture",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-network-information/www/network.js",
        "id": "cordova-plugin-network-information.network",
        "pluginId": "cordova-plugin-network-information",
        "clobbers": [
            "navigator.connection",
            "navigator.network.connection"
        ]
    },
    {
        "file": "plugins/cordova-plugin-network-information/www/Connection.js",
        "id": "cordova-plugin-network-information.Connection",
        "pluginId": "cordova-plugin-network-information",
        "clobbers": [
            "Connection"
        ]
    },
    {
        "file": "plugins/cordova-plugin-network-information/src/browser/network.js",
        "id": "cordova-plugin-network-information.NetworkInfoProxy",
        "pluginId": "cordova-plugin-network-information",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-splashscreen/www/splashscreen.js",
        "id": "cordova-plugin-splashscreen.SplashScreen",
        "pluginId": "cordova-plugin-splashscreen",
        "clobbers": [
            "navigator.splashscreen"
        ]
    },
    {
        "file": "plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js",
        "id": "cordova-plugin-splashscreen.SplashScreenProxy",
        "pluginId": "cordova-plugin-splashscreen",
        "runs": true
    },
    {
        "file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
        "id": "cordova-plugin-statusbar.statusbar",
        "pluginId": "cordova-plugin-statusbar",
        "clobbers": [
            "window.StatusBar"
        ]
    },
    {
        "file": "plugins/cordova-plugin-statusbar/src/browser/statusbar.js",
        "id": "cordova-plugin-statusbar.statusbar.Browser",
        "pluginId": "cordova-plugin-statusbar",
        "merges": [
            "window.StatusBar"
        ]
    },
    {
        "file": "plugins/cordova-plugin-vibration/www/vibration.js",
        "id": "cordova-plugin-vibration.notification",
        "pluginId": "cordova-plugin-vibration",
        "merges": [
            "navigator.notification",
            "navigator"
        ]
    },
    {
        "file": "plugins/cordova-plugin-vibration/src/browser/Vibration.js",
        "id": "cordova-plugin-vibration.Vibration",
        "pluginId": "cordova-plugin-vibration",
        "merges": [
            "navigator.notification",
            "navigator"
        ]
    },
    {
        "file": "plugins/phonegap-plugin-push/www/push.js",
        "id": "phonegap-plugin-push.PushNotification",
        "pluginId": "phonegap-plugin-push",
        "clobbers": [
            "PushNotification"
        ]
    },
    {
        "file": "plugins/phonegap-plugin-push/www/browser/push.js",
        "id": "phonegap-plugin-push.BrowserPush",
        "pluginId": "phonegap-plugin-push",
        "clobbers": [
            "PushNotification"
        ]
    },
    {
        "file": "plugins/pushbots-cordova-plugin/www/pushbots.js",
        "id": "pushbots-cordova-plugin.PushbotsPlugin",
        "pluginId": "pushbots-cordova-plugin",
        "clobbers": [
            "PushbotsPlugin"
        ]
    }
];
module.exports.metadata =
// TOP OF METADATA
{
    "cordova-plugin-battery-status": "1.1.2",
    "cordova-plugin-camera": "2.1.1",
    "cordova-plugin-compat": "1.0.0",
    "cordova-plugin-console": "1.0.4",
    "cordova-plugin-contacts": "2.0.1",
    "cordova-plugin-device": "1.1.3",
    "cordova-plugin-device-motion": "1.2.2",
    "cordova-plugin-device-orientation": "1.0.4",
    "cordova-plugin-dialogs": "1.2.1",
    "cordova-plugin-file": "4.3.0",
    "cordova-plugin-file-transfer": "1.5.1",
    "cordova-plugin-geolocation": "2.1.0",
    "cordova-plugin-globalization": "1.0.4",
    "cordova-plugin-inappbrowser": "1.3.0",
    "cordova-plugin-media": "2.2.0",
    "cordova-plugin-media-capture": "1.2.0",
    "cordova-plugin-network-information": "1.2.1",
    "cordova-plugin-splashscreen": "3.2.2",
    "cordova-plugin-statusbar": "2.1.3",
    "cordova-plugin-vibration": "2.1.2",
    "cordova-plugin-whitelist": "1.2.2",
    "phonegap-plugin-push": "1.8.3",
    "pushbots-cordova-plugin": "1.3.9"
}
// BOTTOM OF METADATA
});


text:
typedef NS_ENUM(NSInteger, CLOperationState) {
    CLOperationStateNotStarted, // All operations start off not started
    CLOperationStateExecuting,
    CLOperationStateFinished // Finish does not imply success, check isSuccess flag
};

extern NSString * const CLOperationWillExpireNotification;

@class RACSignal;
@interface CLOperation : NSOperation

@property (weak, readonly) NSOperationQueue *operationQueue;

@property (nonatomic, assign) BOOL backgroundTask; // Default = NO

@property (assign, readonly) CLOperationState operationState;
@property (assign, readonly) BOOL isPaused;

@property (assign, readonly) CGFloat progress;
@property (assign, readonly) BOOL isSuccess;
@property (strong, readonly) NSError *error;

// Progress signal is very versatile
// Sends @0 right before operationDidStart
// Sends @1 followed by complete when operation succeeds
// Sends error when operation fails
@property (readonly) RACSignal *progressSignal;

// Cancel, pause and resume are optioncally supported by subclasses

// To handle cancel, either check the isCancelled flag at a regular interval
// or override operationDidCancel method. Must call finishWithSuccess:error: to
// mark cancellation is complete and thus remove operation from queue

// To handle pause, either override operationDidPause or check isPaused flag
// Called by user of operation

- (void)start;
- (void)cancel;
- (void)pause;
- (void)resume;

// Called by sublcass / implementors of operation only

- (void)updateProgress:(CGFloat)progress;
- (void)finishWithSuccess;
- (void)finishWithError:(NSError *)error;
- (void)finishWithSuccess:(BOOL)success error:(NSError *)error;

// No-op implementations that should be overriden by subclasses

- (void)operationDidStart;
- (void)operationDidPause;
- (void)operationDidResume;
- (void)operationDidCancel;
- (void)operationDidFail;
- (void)operationDidSucceed;
- (void)operationDidFinish; // Finish = sum of fail + succeed

// Background Task & App Life Cycle
// Life cycle notifications will only be sent if backgroundTask = YES

- (void)backgroundTaskWillExpire;
- (void)applicationDidEnterBackground:(NSNotification *)note;
- (void)applicationWillEnterForeground:(NSNotification *)note;

- (NSString *)name;
- (instancetype)setName:(NSString *)name;

@end


text:
'use strict';

module.exports = function(Review) {

  Review.beforeRemote('create', function(context, user, next) {
    context.args.data.date = Date.now();
    context.args.data.publisherId = context.req.accessToken.userId;
    console.log('before creat Review')
    next();
  });

};


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Schlechtendalia 4: 6 (2000)

#### Original name
Microsphaera lonicerae var. flexuosa U. Braun

### Remarks
null


text:
INACTIVITY_MINS=30

xautolock -time "$INACTIVITY_MINS" -locker xsecurelock -nowlocker xsecurelock -detectsleep


text:
<!-- File generated from "src/FixedDataTableColumn.react.js" -->
`Column` (component)
====================

Component that defines the attributes of table column.

Props
-----

### `align`

The horizontal alignment of the table cell content.

type: `enum('left'|'center'|'right')`

### `headerClassName`

className for this column's header cell.

type: `string`

### `footerClassName`

className for this column's footer cell.

type: `string`

### `cellClassName`

className for each of this column's data cells.

type: `string`

### `cellRenderer`

The cell renderer that returns React-renderable content for table cell.
```
function(
  cellData: any,
  cellDataKey: string,
  rowData: object,
  rowIndex: number,
  columnData: any,
  width: number
): ?$jsx
```

type: `func`

### `cellDataGetter`

The getter `function(string_cellDataKey, object_rowData)` that returns
the cell data for the `cellRenderer`.
If not provided, the cell data will be collected from
`rowData[cellDataKey]` instead. The value that `cellDataGetter` returns
will be used to determine whether the cell should re-render.

type: `func`

### `dataKey` (required)

The key to retrieve the cell data from the data row. Provided key type
must be either `string` or `number`. Since we use this
for keys, it must be specified for each column.

type: `union(string|number)`

### `fixed`

Controls if the column is fixed when scrolling in the X axis.

type: `bool`
defaultValue: `false`

### `headerRenderer`

The cell renderer that returns React-renderable content for table column
header.
```
function(
  label: ?string,
  cellDataKey: string,
  columnData: any,
  rowData: array<?object>,
  width: number
): ?$jsx
```

type: `func`

### `footerRenderer`

The cell renderer that returns React-renderable content for table column
footer.
```
function(
  label: ?string,
  cellDataKey: string,
  columnData: any,
  rowData: array<?object>,
  width: number
): ?$jsx
```

type: `func`

### `columnData`

Bucket for any data to be passed into column renderer functions.

type: `object`

### `label`

The column's header label.

type: `string`

### `width` (required)

The pixel width of the column.

type: `number`

### `minWidth`

If this is a resizable column this is its minimum pixel width.

type: `number`

### `maxWidth`

If this is a resizable column this is its maximum pixel width.

type: `number`

### `flexGrow`

The grow factor relative to other columns. Same as the flex-grow API
from http://www.w3.org/TR/css3-flexbox/. Basically, take any available
extra width and distribute it proportionally according to all columns'
flexGrow values. Defaults to zero (no-flexing).

type: `number`

### `isResizable`

Whether the column can be resized with the
FixedDataTableColumnResizeHandle. Please note that if a column
has a flex grow, once you resize the column this will be set to 0.

This property only provides the UI for the column resizing. If this
is set to true, you will need ot se the onColumnResizeEndCallback table
property and render your columns appropriately.

type: `bool`

### `allowCellsRecycling`

Experimental feature
Whether cells in this column can be removed from document when outside
of viewport as a result of horizontal scrolling.
Setting this property to true allows the table to not render cells in
particular column that are outside of viewport for visible rows. This
allows to create table with many columns and not have vertical scrolling
performance drop.
Setting the property to false will keep previous behaviour and keep
cell rendered if the row it belongs to is visible.

type: `bool`
defaultValue: `false`


text:
package kivik

import (
	"context"
	"net/http"
	"sync"
	"time"

	"github.com/go-kivik/kivik/v3/driver"
)

// ReplicationState represents a replication's state
type ReplicationState string

// The possible values for the _replication_state field in _replicator documents
// plus a blank value for unstarted replications.
const (
	ReplicationNotStarted ReplicationState = ""
	ReplicationStarted    ReplicationState = "triggered"
	ReplicationError      ReplicationState = "error"
	ReplicationComplete   ReplicationState = "completed"
)

// The additional possible values for the state field in the _scheduler docs.
const (
	ReplicationInitializing ReplicationState = "initializing"
	ReplicationRunning      ReplicationState = "running"
	ReplicationPending      ReplicationState = "pending"
	ReplicationCrashing     ReplicationState = "crashing"
	ReplicationFailed       ReplicationState = "failed"
)

// Replication represents a CouchDB replication process.
type Replication struct {
	Source string
	Target string

	infoMU    sync.RWMutex
	info      *driver.ReplicationInfo
	statusErr error
	irep      driver.Replication
}

// DocsWritten returns the number of documents written, if known.
func (r *Replication) DocsWritten() int64 {
	if r != nil && r.info != nil {
		r.infoMU.RLock()
		defer r.infoMU.RUnlock()
		return r.info.DocsWritten
	}
	return 0
}

// DocsRead returns the number of documents read, if known.
func (r *Replication) DocsRead() int64 {
	if r != nil && r.info != nil {
		r.infoMU.RLock()
		defer r.infoMU.RUnlock()
		return r.info.DocsRead
	}
	return 0
}

// DocWriteFailures returns the number of doc write failures, if known.
func (r *Replication) DocWriteFailures() int64 {
	if r != nil && r.info != nil {
		r.infoMU.RLock()
		defer r.infoMU.RUnlock()
		return r.info.DocWriteFailures
	}
	return 0
}

// Progress returns the current replication progress, if known.
func (r *Replication) Progress() float64 {
	if r != nil && r.info != nil {
		r.infoMU.RLock()
		defer r.infoMU.RUnlock()
		return r.info.Progress
	}
	return 0
}

func newReplication(rep driver.Replication) *Replication {
	return &Replication{
		Source: rep.Source(),
		Target: rep.Target(),
		irep:   rep,
	}
}

// ReplicationID returns the _replication_id field of the replicator document.
func (r *Replication) ReplicationID() string {
	return r.irep.ReplicationID()
}

// StartTime returns the replication start time, once the replication has been
// triggered.
func (r *Replication) StartTime() time.Time {
	return r.irep.StartTime()
}

// EndTime returns the replication end time, once the replication has terminated.
func (r *Replication) EndTime() time.Time {
	return r.irep.EndTime()
}

// State returns the current replication state
func (r *Replication) State() ReplicationState {
	return ReplicationState(r.irep.State())
}

// Err returns the error, if any, that caused the replication to abort.
func (r *Replication) Err() error {
	if r == nil {
		return nil
	}
	return r.irep.Err()
}

// IsActive returns true if the replication has not yet completed or
// errored.
func (r *Replication) IsActive() bool {
	if r == nil {
		return false
	}
	switch r.State() {
	case ReplicationError, ReplicationComplete, ReplicationCrashing, ReplicationFailed:
		return false
	default:
		return true
	}
}

// Delete deletes a replication. If it is currently running, it will be
// cancelled.
func (r *Replication) Delete(ctx context.Context) error {
	return r.irep.Delete(ctx)
}

// Update requests a replication state update from the server. If there is an
// error retrieving the update, it is returned and the replication state is
// unaltered.
func (r *Replication) Update(ctx context.Context) error {
	var info driver.ReplicationInfo
	r.statusErr = r.irep.Update(ctx, &info)
	if r.statusErr != nil {
		return r.statusErr
	}
	r.infoMU.Lock()
	r.info = &info
	r.infoMU.Unlock()
	return nil
}

var replicationNotImplemented = &Error{HTTPStatus: http.StatusNotImplemented, Message: "kivik: driver does not support replication"}

// GetReplications returns a list of defined replications in the _replicator
// database. Options are in the same format as to AllDocs(), except that
// "conflicts" and "update_seq" are ignored.
func (c *Client) GetReplications(ctx context.Context, options ...Options) ([]*Replication, error) {
	replicator, ok := c.driverClient.(driver.ClientReplicator)
	if !ok {
		return nil, replicationNotImplemented
	}
	reps, err := replicator.GetReplications(ctx, mergeOptions(options...))
	if err != nil {
		return nil, err
	}
	replications := make([]*Replication, len(reps))
	for i, rep := range reps {
		replications[i] = newReplication(rep)
	}
	return replications, nil
}

// Replicate initiates a replication from source to target.
func (c *Client) Replicate(ctx context.Context, targetDSN, sourceDSN string, options ...Options) (*Replication, error) {
	replicator, ok := c.driverClient.(driver.ClientReplicator)
	if !ok {
		return nil, replicationNotImplemented
	}
	rep, err := replicator.Replicate(ctx, targetDSN, sourceDSN, mergeOptions(options...))
	if err != nil {
		return nil, err
	}
	return newReplication(rep), nil
}

// ReplicationInfo represents a snapshot of the status of a replication.
type ReplicationInfo struct {
	DocWriteFailures int64
	DocsRead         int64
	DocsWritten      int64
	Progress         float64
}


text:
namespace ork {
///////////////////////////////////////////////////////////////////////////////

Future::Future()
{
    mState = 0;
}

void Future::Clear()
{
    mResult.Set<bool>(false);
    mState=0;
}

void Future::WaitForSignal() const
{
    while(false==IsSignaled()){}
      usleep(1000);
}
const Future::var_t& Future::GetResult() const
{
    WaitForSignal();
    return mResult;
}//

///////////////////////////////////////////////////////////////////////////////
} // namespace ork


text:
from __future__ import unicode_literals
from ..diffusion import DWIJointRicianLMMSEFilter

def test_DWIJointRicianLMMSEFilter_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    compressOutput=dict(argstr='--compressOutput ',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    inputVolume=dict(argstr='%s',
    position=-2,
    ),
    ng=dict(argstr='--ng %d',
    ),
    outputVolume=dict(argstr='%s',
    hash_files=False,
    position=-1,
    ),
    re=dict(argstr='--re %s',
    sep=',',
    ),
    rf=dict(argstr='--rf %s',
    sep=',',
    ),
    terminal_output=dict(deprecated='1.0.0',
    nohash=True,
    ),
    )
    inputs = DWIJointRicianLMMSEFilter.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(inputs.traits()[key], metakey) == value

def test_DWIJointRicianLMMSEFilter_outputs():
    output_map = dict(outputVolume=dict(position=-1,
    ),
    )
    outputs = DWIJointRicianLMMSEFilter.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(outputs.traits()[key], metakey) == value


text:
<?xml version='1.0' encoding='utf-8'?>
<!--
  ~ Copyright 2001-2012 Remi Vankeisbelck
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
        <property name="connection.url">jdbc:hsqldb:mem:wokodb;sql.syntax_mys=true</property>
        <property name="connection.username">sa</property>
        <property name="connection.password"></property>
        <property name="connection.pool_size">10</property>
        <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
        <property name="current_session_context_class">thread</property>
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
        <property name="show_sql">false</property>
        <property name="hbm2ddl.auto">update</property>
        <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
        <property name="hibernate.current_session_context_class">thread</property>
        <!-- other configuration -->
        <event type="pre-update">
          <listener class="org.hibernate.cfg.beanvalidation.BeanValidationEventListener"/>
        </event>
        <event type="pre-insert">
          <listener class="org.hibernate.cfg.beanvalidation.BeanValidationEventListener"/>
        </event>
    </session-factory>
</hibernate-configuration>


text:
<!DOCTYPE html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GoodwillDallas.org</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,IE=11">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="generator" content="Hugo 0.23" />

<meta name="description" content="Dallas, TX; Graphic designer & aspiring front-end webdev.">
<meta name="keywords" content="william pansky, web development, graphic design, dallas">
<meta name="url" content="http://williampansky.com">
<meta name="subject" content="Me, myself, and I.">
<meta name="copyright" content="© 2017 William Pansky.">

<meta name="designer" content="William Pansky, http://williampansky.com">
<link rel="author" href="humans.txt" type="text/plain">

<meta name="robots" content="all,follow">
<meta name="googlebot" content="index,follow,snippet,archive">

<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#303030">
<meta name="theme-color" content="#f76708">

<meta property="og:description" content="Dallas, TX; Graphic designer & aspiring front-end webdev.">

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.22/css/uikit.min.css" />

<link href="//fonts.googleapis.com/css?family=Droid+Serif:400,700|Source+Sans+Pro:400,400i,700,700i" rel="stylesheet">

<link rel="stylesheet" href="/css/atom-one-dark.css">

<link rel="stylesheet" href="/css/pants.min.css">

          William Pansky

Projects

Resume

Contact


text:
module Dspace
	class CommunityPresenter
		attr_accessor :id

		def initialize(id = nil)
			self.id = id
		end

		def root_communities
			@root_communities ||= Dspace::Community.where('community_id NOT IN (select child_comm_id from community2community)').order(:name)
		end

		def items
		  @items ||= Dspace::CommunitiesToItem.where(community_id: self.id)
		end

		def metadata_fields
			@metadata_fields ||= Dspace::MetadataFieldRegistry.where(metadata_field_id: Dspace::MetadataValue.where(item_id: items.pluck("item_id")).distinct.pluck("metadata_field_id")).order(:element, :qualifier)
		end
	end
end

##################################################################################################
# -- VARIOUS QUEIRES --
# Notes: This is for development and hand run to test. To be REMOVED
# @item_id_array = Dspace::CommunitiesToItem.where(community_id: 134).pluck('item_id') // Get item_id by community
# Dspace::MetadataValue.where(item_id: @item_id_array).uniq.pluck("metadata_field_id") // Get unique metadata field ids by item_id array
#
##################################################################################################


text:
require.def("store/static/composants/carouselhorizontal",
	[
		"antie/widgets/horizontalcarousel",
	],
	function(Carousel){
		return Carousel.extend({
			init: function(id, formatter, datasource, animation, modeWrap){
				var self = this;
				this._super(id, formatter, datasource);
				this._modeWrap = modeWrap;
				self._setConfig();
			},

			_onBeforeShow: function(){

			},

			_onBeforeRender: function(){

			},

			_setConfig: function(){
				this._setNavigation();
				//this.setRenderMode(2); //element UL

			},

			_setNavigation: function(modeWrap){
				this._modeWrap = modeWrap;

				switch(modeWrap){
					case "infinie":
						this.setWrapMode(Carousel.WRAP_MODE_VISUAL);
						break;
					case "finie":
						this.setWrapMode(Carousel.WRAP_MODE_NAVIGATION_ONLY);
						break;
					default:
						this.setWrapMode(Carousel.WRAP_MODE_NAVIGATION_ONLY);
						break;
				}
			}

		})
	}
);


text:
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Image_Graph - PEAR PHP OO Graph Rendering Utility.
 *
 * PHP versions 4 and 5
 *
 * LICENSE: This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version. This library is distributed in the hope that it
 * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details. You should have received a copy of
 * the GNU Lesser General Public License along with this library; if not, write
 * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307 USA
 *
 * @category   Images
 * @package    Image_Graph
 * @subpackage Plot
 * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
 * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
 * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
 * @version    CVS: $Id: Line.php,v 1.14 2006/03/02 12:37:37 nosey Exp $
 * @link       http://pear.php.net/package/Image_Graph
 */

/**
 * Include file Image/Graph/Plot/Smoothed/Bezier.php
 */
require_once 'Image/Graph/Plot/Smoothed/Bezier.php';

/**
 * Bezier smoothed line chart.
 *
 * Similar to a {@link Image_Graph_Plot_Line}, but the interconnecting lines
 * between two datapoints are smoothed using a Bezier curve, which enables the
 * chart to appear as a nice curved plot instead of the sharp edges of a
 * conventional {@link Image_Graph_Plot_Line}. Smoothed charts are only supported
 * with non-stacked types
 *
 * @category   Images
 * @package    Image_Graph
 * @subpackage Plot
 * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
 * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
 * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
 * @version    Release: @package_version@
 * @link       http://pear.php.net/package/Image_Graph
 */
class Image_Graph_Plot_Smoothed_Line extends Image_Graph_Plot_Smoothed_Bezier
{

    /**
     * Gets the fill style of the element
     *
     * @return int A GD filestyle representing the fill style
     * @see Image_Graph_Fill
     * @access private
     */
    function _getFillStyle($ID = false)
    {
        return IMG_COLOR_TRANSPARENT;
    }

    /**
     * Perform the actual drawing on the legend.
     *
     * @param int $x0 The top-left x-coordinate
     * @param int $y0 The top-left y-coordinate
     * @param int $x1 The bottom-right x-coordinate
     * @param int $y1 The bottom-right y-coordinate
     * @access private
     */
    function _drawLegendSample($x0, $y0, $x1, $y1)
    {
        $this->_addSamplePoints($x0, $y0, $x1, $y1);
        $this->_canvas->polygon(array('connect' => false));
    }

    /**
     * Output the Bezier smoothed plot as an Line Chart
     *
     * @return bool Was the output 'good' (true) or 'bad' (false).
     * @access private
     */
    function _done()
    {
        if (parent::_done() === false) {
            return false;
        }

        $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
        $this->_clip(true);
        $keys = array_keys($this->_dataset);
        foreach ($keys as $key) {
            $dataset =& $this->_dataset[$key];
            $dataset->_reset();
            $numPoints = 0;
            while ($p1 = $dataset->_next()) {
                if ($p1['Y'] === null) {
                    if ($numPoints > 1) {
                        $this->_getLineStyle($key);
                        $this->_canvas->polygon(array('connect' => false, 'map_vertices' => true));
                    }
                    else {
                        $this->_canvas->reset();
                    }
                    $numPoints = 0;
                } else {
                    $p0 = $dataset->_nearby(-2);
                    $p2 = $dataset->_nearby(0);
                    $p3 = $dataset->_nearby(1);

                    if (($p0) && ($p0['Y'] === null)) {
                        $p0 = false;
                    }
                    if (($p2) && ($p2['Y'] === null)) {
                        $p2 = false;
                    }
                    if (($p3) && ($p3['Y'] === null)) {
                        $p3 = false;
                    }

                    if ($p2) {
                        $cp = $this->_getControlPoints($p1, $p0, $p2, $p3);
                        $this->_canvas->addSpline(
                            $this->_mergeData(
                                $p1,
	                    	  array(
    	                        	'x' => $cp['X'],
	                               	'y' => $cp['Y'],
	                            	'p1x' => $cp['P1X'],
	                            	'p1y' => $cp['P1Y'],
	                            	'p2x' => $cp['P2X'],
	                            	'p2y' => $cp['P2Y']
                                )
	                        )
	                    );
					} else {
                        $x = $this->_pointX($p1);
                        $y = $this->_pointY($p1);
                        $this->_canvas->addVertex(
                            $this->_mergeData(
                                $p1,
                                array('x' => $x, 'y' => $y)
                            )
                        );
                    }
                    $numPoints++;
                }
            }
            if ($numPoints > 1) {
                $this->_getLineStyle();
                $this->_canvas->polygon(array('connect' => false, 'map_vertices' => true));
            }
            else {
                $this->_canvas->reset();
            }
        }
        unset($keys);
        $this->_drawMarker();
        $this->_clip(false);
        $this->_canvas->endGroup();
        return true;
    }

}
?>


text:
AcknowledgementPayloads.cpp
===========================

.. literalinclude:: ../../../../examples_linux/acknowledgementPayloads.cpp
    :lines: 7-
    :linenos:
    :lineno-match:


text:
import os

# Keep a global dictionary of library target params for lookups in
# ExtendComponent().
_all_lib_targets = {}

def _GenericLibrary(env, static, **kwargs):
  """Extends ComponentLibrary to support multiplatform builds
     of dynamic or static libraries.

  Args:
    env: The environment object.
    kwargs: The keyword arguments.

  Returns:
    See swtoolkit ComponentLibrary
  """
  params = CombineDicts(kwargs, {'COMPONENT_STATIC': static})
  return ExtendComponent(env, 'ComponentLibrary', **params)

def Library(env, **kwargs):
  """Extends ComponentLibrary to support multiplatform builds of static
     libraries.

  Args:
    env: The current environment.
    kwargs: The keyword arguments.

  Returns:
    See swtoolkit ComponentLibrary
  """
  return _GenericLibrary(env, True, **kwargs)

def DynamicLibrary(env, **kwargs):
  """Extends ComponentLibrary to support multiplatform builds
     of dynmic libraries.

  Args:
    env: The environment object.
    kwargs: The keyword arguments.

  Returns:
    See swtoolkit ComponentLibrary
  """
  return _GenericLibrary(env, False, **kwargs)

def Object(env, **kwargs):
  return ExtendComponent(env, 'ComponentObject', **kwargs)

def Unittest(env, **kwargs):
  """Extends ComponentTestProgram to support unittest built
     for multiple platforms.

  Args:
    env: The current environment.
    kwargs: The keyword arguments.

  Returns:
    See swtoolkit ComponentProgram.
  """
  kwargs['name'] = kwargs['name'] + '_unittest'

  common_test_params = {
    'posix_cppdefines': ['GUNIT_NO_GOOGLE3', 'GTEST_HAS_RTTI=0'],
    'libs': ['unittest_main', 'gunit']
  }
  if not kwargs.has_key('explicit_libs'):
    common_test_params['win_libs'] = [
      'advapi32',
      'crypt32',
      'iphlpapi',
      'secur32',
      'shell32',
      'shlwapi',
      'user32',
      'wininet',
      'ws2_32'
    ]
    common_test_params['lin_libs'] = [
      'crypto',
      'pthread',
      'ssl',
    ]

  params = CombineDicts(kwargs, common_test_params)
  return ExtendComponent(env, 'ComponentTestProgram', **params)

def App(env, **kwargs):
  """Extends ComponentProgram to support executables with platform specific
     options.

  Args:
    env: The current environment.
    kwargs: The keyword arguments.

  Returns:
    See swtoolkit ComponentProgram.
  """
  if not kwargs.has_key('explicit_libs'):
    common_app_params = {
      'win_libs': [
        'advapi32',
        'crypt32',
        'iphlpapi',
        'secur32',
        'shell32',
        'shlwapi',
        'user32',
        'wininet',
        'ws2_32'
      ]}
    params = CombineDicts(kwargs, common_app_params)
  else:
    params = kwargs
  return ExtendComponent(env, 'ComponentProgram', **params)

def WiX(env, **kwargs):
  """ Extends the WiX builder
  Args:
    env: The current environment.
    kwargs: The keyword arguments.

  Returns:
    The node produced by the environment's wix builder
  """
  return ExtendComponent(env, 'WiX', **kwargs)

def Repository(env, at, path):
  """Maps a directory external to $MAIN_DIR to the given path so that sources
     compiled from it end up in the correct place under $OBJ_DIR.  NOT required
     when only referring to header files.

  Args:
    env: The current environment object.
    at: The 'mount point' within the current directory.
    path: Path to the actual directory.
  """
  env.Dir(at).addRepository(env.Dir(path))

def Components(*paths):
  """Completes the directory paths with the correct file
     names such that the directory/directory.scons name
     convention can be used.

  Args:
    paths: The paths to complete. If it refers to an existing
           file then it is ignored.

  Returns:
    The completed lif scons files that are needed to build talk.
  """
  files = []
  for path in paths:
    if os.path.isfile(path):
      files.append(path)
    else:
      files.append(ExpandSconsPath(path))
  return files

def ExpandSconsPath(path):
  """Expands a directory path into the path to the
     scons file that our build uses.
     Ex: magiflute/plugin/common => magicflute/plugin/common/common.scons

  Args:
    path: The directory path to expand.

  Returns:
    The expanded path.
  """
  return '%s/%s.scons' % (path, os.path.basename(path))

def AddMediaLibs(env, **kwargs):
  lmi_libdir = '$GOOGLE3/../googleclient/third_party/lmi/files/lib/'
  if env.Bit('windows'):
    if env.get('COVERAGE_ENABLED'):
      lmi_libdir += 'win32/c_only'
    else:
      lmi_libdir += 'win32/Release'
  elif env.Bit('mac'):
    lmi_libdir += 'macos'
  elif env.Bit('linux'):
      lmi_libdir += 'linux/x86'

  AddToDict(kwargs, 'libdirs', [
    '$MAIN_DIR/third_party/gips/Libraries/',
    lmi_libdir,
  ])

  gips_lib = ''
  if env.Bit('windows'):
    if env.Bit('debug'):
      gips_lib = 'gipsvoiceenginelib_mtd'
    else:
      gips_lib = 'gipsvoiceenginelib_mt'
  elif env.Bit('mac'):
    gips_lib = 'VoiceEngine_mac_universal_gcc'
  elif env.Bit('linux'):
      gips_lib = 'VoiceEngine_Linux_gcc'

  AddToDict(kwargs, 'libs', [
    gips_lib,
    'LmiAudioCommon',
    'LmiClient',
    'LmiCmcp',
    'LmiDeviceManager',
    'LmiH263ClientPlugIn',
    'LmiH263CodecCommon',
    'LmiH263Decoder',
    'LmiH263Encoder',
    'LmiH264ClientPlugIn',
    'LmiH264CodecCommon',
    'LmiH264Common',
    'LmiH264Decoder',
    'LmiH264Encoder',
    'LmiIce',
    'LmiMediaPayload',
    'LmiOs',
    'LmiPacketCache',
    'LmiProtocolStack',
    'LmiRateShaper',
    'LmiRtp',
    'LmiSecurity',
    'LmiSignaling',
    'LmiStun',
    'LmiTransport',
    'LmiUi',
    'LmiUtils',
    'LmiVideoCommon',
    'LmiXml',
  ])

  if env.Bit('windows'):
    AddToDict(kwargs, 'libs', [
      'dsound',
      'd3d9',
      'gdi32',
      'strmiids',
    ])

  if env.Bit('mac'):
    AddToDict(kwargs, 'FRAMEWORKS', [
      'AudioToolbox',
      'AudioUnit',
      'Cocoa',
      'CoreAudio',
      'CoreFoundation',
      'IOKit',
      'QTKit',
      'QuickTime',
      'QuartzCore',
    ])
  return kwargs

def ReadVersion(filename):
  """Executes the supplied file and pulls out a version definition from it. """
  defs = {}
  execfile(str(filename), defs)
  if not defs.has_key('version'):
    return '0.0.0.0'
  version = defs['version']
  parts = version.split(',')
  build = os.environ.get('GOOGLE_VERSION_BUILDNUMBER')
  if build:
    parts[-1] = str(build)
  return '.'.join(parts)

#-------------------------------------------------------------------------------
# Helper methods for translating talk.Foo() declarations in to manipulations of
# environmuent construction variables, including parameter parsing and merging,
#
def GetEntry(dict, key):
  """Get the value from a dictionary by key. If the key
     isn't in the dictionary then None is returned. If it is in
     the dictionaruy the value is fetched and then is it removed
     from the dictionary.

  Args:
    key: The key to get the value for.
    kwargs: The keyword argument dictionary.
  Returns:
    The value or None if the key is missing.
  """
  value = None
  if dict.has_key(key):
    value = dict[key]
    dict.pop(key)

  return value

def MergeAndFilterByPlatform(env, params):
  """Take a dictionary of arguments to lists of values, and, depending on
     which platform we are targetting, merge the lists of associated keys.
     Merge by combining value lists like so:
       {win_foo = [a,b], lin_foo = [c,d], foo = [e], mac_bar = [f], bar = [g] }
       becomes {foo = [a,b,e], bar = [g]} on windows, and
       {foo = [e], bar = [f,g]} on mac

  Args:
    env: The hammer environment which knows which platforms are active
    params: The keyword argument dictionary.
  Returns:
    A new dictionary with the filtered and combined entries of params
  """
  platforms = {
    'linux': 'lin_',
    'mac': 'mac_',
    'posix': 'posix_',
    'windows': 'win_',
  }
  active_prefixes = [
    platforms[x] for x in iter(platforms) if env.Bit(x)
  ]
  inactive_prefixes = [
    platforms[x] for x in iter(platforms) if not env.Bit(x)
  ]

  merged = {}
  for arg, values in params.iteritems():
    inactive_platform = False

    key = arg

    for prefix in active_prefixes:
      if arg.startswith(prefix):
        key = arg[len(prefix):]

    for prefix in inactive_prefixes:
      if arg.startswith(prefix):
        inactive_platform = True

    if inactive_platform:
      continue

    AddToDict(merged, key, values)

  return merged

# Linux can build both 32 and 64 bit on 64 bit host, but 32 bit host can
# only build 32 bit.  For 32 bit debian installer a 32 bit host is required.
# ChromeOS (linux) ebuild don't support 64 bit and requires 32 bit build only
# for now.
def Allow64BitCompile(env):
  return (env.Bit('linux') and env.Bit('platform_arch_64bit')
          )

def MergeSettingsFromLibraryDependencies(env, params):
  if params.has_key('libs'):
    for lib in params['libs']:
      if (_all_lib_targets.has_key(lib) and
          _all_lib_targets[lib].has_key('dependent_target_settings')):
        params = CombineDicts(
            params,
            MergeAndFilterByPlatform(
                env,
                _all_lib_targets[lib]['dependent_target_settings']))
  return params

def ExtendComponent(env, component, **kwargs):
  """A wrapper around a scons builder function that preprocesses and post-
     processes its inputs and outputs.  For example, it merges and filters
     certain keyword arguments before appending them to the environments
     construction variables.  It can build signed targets and 64bit copies
     of targets as well.

  Args:
    env: The hammer environment with which to build the target
    component: The environment's builder function, e.g. ComponentProgram
    kwargs: keyword arguments that are either merged, translated, and passed on
            to the call to component, or which control execution.
            TODO(): Document the fields, such as cppdefines->CPPDEFINES,
            prepend_includedirs, include_talk_media_libs, etc.
  Returns:
    The output node returned by the call to component, or a subsequent signed
    dependant node.
  """
  env = env.Clone()

  # prune parameters intended for other platforms, then merge
  params = MergeAndFilterByPlatform(env, kwargs)

  # get the 'target' field
  name = GetEntry(params, 'name')

  # save pristine params of lib targets for future reference
  if 'ComponentLibrary' == component:
    _all_lib_targets[name] = dict(params)

  # add any dependent target settings from library dependencies
  params = MergeSettingsFromLibraryDependencies(env, params)

  # if this is a signed binary we need to make an unsigned version first
  signed = env.Bit('windows') and GetEntry(params, 'signed')
  if signed:
    name = 'unsigned_' + name

  # add default values
  if GetEntry(params, 'include_talk_media_libs'):
    params = AddMediaLibs(env, **params)

  # potentially exit now
  srcs = GetEntry(params, 'srcs')
  if not srcs or not hasattr(env, component):
    return None

  # apply any explicit dependencies
  dependencies = GetEntry(params, 'depends')
  if dependencies is not None:
    env.Depends(name, dependencies)

  # put the contents of params into the environment
  # some entries are renamed then appended, others renamed then prepended
  appends = {
    'cppdefines' : 'CPPDEFINES',
    'libdirs' : 'LIBPATH',
    'link_flags' : 'LINKFLAGS',
    'libs' : 'LIBS',
    'FRAMEWORKS' : 'FRAMEWORKS',
  }
  prepends = {}
  if env.Bit('windows'):
    # MSVC compile flags have precedence at the beginning ...
    prepends['ccflags'] = 'CCFLAGS'
  else:
    # ... while GCC compile flags have precedence at the end
    appends['ccflags'] = 'CCFLAGS'
  if GetEntry(params, 'prepend_includedirs'):
    prepends['includedirs'] = 'CPPPATH'
  else:
    appends['includedirs'] = 'CPPPATH'

  for field, var in appends.items():
    values = GetEntry(params, field)
    if values is not None:
      env.Append(**{var : values})
  for field, var in prepends.items():
    values = GetEntry(params, field)
    if values is not None:
      env.Prepend(**{var : values})

  # workaround for pulse stripping link flag for unknown reason
  if Allow64BitCompile(env):
    env['SHLINKCOM'] = ('$SHLINK -o $TARGET -m32 $SHLINKFLAGS $SOURCES '
                        '$_LIBDIRFLAGS $_LIBFLAGS')
    env['LINKCOM'] = ('$LINK -o $TARGET -m32 $LINKFLAGS $SOURCES '
                      '$_LIBDIRFLAGS $_LIBFLAGS')

  # any other parameters are replaced without renaming
  for field, value in params.items():
    env.Replace(**{field : value})

  # invoke the builder function
  builder = getattr(env, component)

  node = builder(name, srcs)

  # make a parallel 64bit version if requested
  if Allow64BitCompile(env) and GetEntry(params, 'also64bit'):
    env_64bit = env.Clone()
    env_64bit.FilterOut(CCFLAGS = ['-m32'], LINKFLAGS = ['-m32'])
    env_64bit.Prepend(CCFLAGS = ['-m64', '-fPIC'], LINKFLAGS = ['-m64'])
    name_64bit = name + '64'
    env_64bit.Replace(OBJSUFFIX = '64' + env_64bit['OBJSUFFIX'])
    env_64bit.Replace(SHOBJSUFFIX = '64' + env_64bit['SHOBJSUFFIX'])
    if ('ComponentProgram' == component or
        ('ComponentLibrary' == component and
         env_64bit['COMPONENT_STATIC'] == False)):
      # link 64 bit versions of libraries
      libs = []
      for lib in env_64bit['LIBS']:
        if (_all_lib_targets.has_key(lib) and
            _all_lib_targets[lib].has_key('also64bit')):
          libs.append(lib + '64')
        else:
          libs.append(lib)
      env_64bit.Replace(LIBS = libs)

    env_64bit['SHLINKCOM'] = ('$SHLINK -o $TARGET -m64 $SHLINKFLAGS $SOURCES '
                              '$_LIBDIRFLAGS $_LIBFLAGS')
    env_64bit['LINKCOM'] = ('$LINK -o $TARGET -m64 $LINKFLAGS $SOURCES '
                            '$_LIBDIRFLAGS $_LIBFLAGS')
    builder = getattr(env_64bit, component)
    nodes = [node, builder(name_64bit, srcs)]
    return nodes

  if signed:  # Note currently incompatible with 64Bit flag
    # Get the name of the built binary, then get the name of the final signed
    # version from it.  We need the output path since we don't know the file
    # extension beforehand.
    target = node[0].path.split('_', 1)[1]
    signed_node = env.SignedBinary(
      source = node,
      target = '$STAGING_DIR/' + target,
    )
    env.Alias('signed_binaries', signed_node)
    return signed_node

  return node

def AddToDict(dictionary, key, values, append=True):
  """Merge the given key value(s) pair into a dictionary.  If it contains an
     entry with that key already, then combine by appending or prepending the
     values as directed.  Otherwise, assign a new keyvalue pair.
  """
  if values is None:
    return

  if not dictionary.has_key(key):
    dictionary[key] = values
    return

  cur = dictionary[key]
  # TODO: Make sure that there are no duplicates
  # in the list. I can't use python set for this since
  # the nodes that are returned by the SCONS builders
  # are not hashable.
  # dictionary[key] = list(set(cur).union(set(values)))
  if append:
    dictionary[key] = cur + values
  else:
    dictionary[key] = values + cur

def CombineDicts(a, b):
  """Unions two dictionaries by combining values of keys shared between them.
  """
  c = {}
  for key in a:
    if b.has_key(key):
      c[key] = a[key] + b.pop(key)
    else:
      c[key] = a[key]

  for key in b:
    c[key] = b[key]

  return c

def RenameKey(d, old, new, append=True):
  AddToDict(d, new, GetEntry(d, old), append)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NFO_Helper.TMDb
{
    class ImageConfiguration
    {
        public string base_url { get; set; }
        public string secure_base_url { get; set; }
        public IList<string> backdrop_sizes { get; set; }
        public IList<string> logo_sizes { get; set; }
        public IList<string> poster_sizes { get; set; }
        public IList<string> profile_sizes { get; set; }
        public IList<string> still_sizes { get; set; }
    }
    class Configuration
    {
        public ImageConfiguration images { get; set; }
        public IList<string> change_keys { get; set; }
    }
}


text:
require 'money_calculator'

RSpec.describe Money do
  context "On conversion rates input" do
    it 'stores first input of rates' do
      Money.conversion_rates('EUR', {'USD' => 1.11})
      expect(Money.rates).to include('USD' => 1.11)
    end
    it 'updates rates to add more rates with the same main currency' do
      Money.conversion_rates('EUR', {'Bitcoin' => 0.0047})
      expect(Money.rates).to include('Bitcoin' => 0.0047)
    end
    it 'updates rates to add more rates with another main currency but among stored dependent currencies' do
      Money.conversion_rates('USD', {'HUF' => 295})
      expect(Money.rates['HUF'].round(2)).to equal(327.45)
    end
    it 'updates rates to add more rates with one of dependent currencies which is the stored main currency' do
      Money.conversion_rates('RUB', {'EUR' => 0.014})
      expect(Money.rates['RUB'].round(2)).to equal(71.43)
    end
    it 'raises an ArgumentError on attempt of updating rates that does not contain any of stored currencies' do
      expect {
        Money.conversion_rates('CNY', {'JPY' => 19.19})
      }.to raise_error(ArgumentError, 'Rates in argument must refer to a currency already contained')
    end
  end
  context "On creating object and conversion" do
    it 'creates Object \'Money\' that has relevant output on inspect' do
      five_euros = Money.new 5, 'EUR'
      expect(five_euros.class.name).to eq 'Money'
      expect(five_euros.inspect).to eq "5 'EUR'"
    end
    context "On creating object with currency not included in rates" do
      it 'raises an ArgumentError' do
        expect {
          five_rubles = Money.new 5, 'CNY'
        }.to raise_error(ArgumentError, "Conversion rate is not defined for 'CNY'")
      end
      it 'returns \'nil\'' do
        begin
          five_rubles = Money.new 5, 'CNY'
        rescue ArgumentError
        end
        expect(five_rubles).to be_nil
      end
    end
    it 'converts the object from the main to dependent currency in stored rates' do
      five_euros = Money.new 5, 'EUR'
      expect(five_euros.convert_to('USD').inspect).to eq "5.55 'USD'"
    end
    it 'converts the object from dependent currency in stored rates to the main currency' do
      five_dollars = Money.new 5, 'USD'
      expect(five_dollars.convert_to('EUR').inspect).to eq "4.5 'EUR'"
    end
    it 'converts the object from existing currency to another existing currency' do
      fifty_dollars = Money.new 50, 'USD'
      expect(fifty_dollars.convert_to('Bitcoin').inspect).to eq "0.21 'Bitcoin'"
    end
    it 'raises an ArgumentError on attempt to convert an object to non-existing currency in rates' do
      five_euros = Money.new 5, 'EUR'
      expect {
        five_euros.convert_to('CNY')
      }.to raise_error(ArgumentError, "Conversion rate is not defined for 'CNY'")
    end
  end
  context "On operations with object - maths/logic" do
    it 'checks for equality of two objects with the same currency' do
      five_euros = Money.new(5, 'EUR')
      another_five_euros = Money.new(5, 'EUR')
      six_euros = Money.new(6, 'EUR')
      expect(five_euros == another_five_euros ).to be_truthy
      expect(five_euros == six_euros ).to be_falsey
    end
    it 'checks for equality of two objects with different currencies' do
      five_euros = Money.new(5, 'EUR')
      five_dollars = Money.new(5, 'USD')
      five_dollars_fiftyfive_cents = Money.new(5.55, 'USD')
      expect(five_euros == five_dollars_fiftyfive_cents ).to be_truthy
      expect(five_euros == five_dollars ).to be_falsey
    end
    it 'checks for equality rounding up to cents' do
      five_euros = Money.new(5, 'EUR')
      five_euros_half_cent = Money.new(5.004, 'EUR')
      expect(five_euros == five_euros_half_cent ).to be_truthy
    end
    it 'checks inequality of objects' do
      five_euros = Money.new(5, 'EUR')
      five_euros_half_cent = Money.new(5.004, 'EUR')
      five_dollars = Money.new(5, 'USD')
      expect(five_euros >= five_euros_half_cent ).to be_truthy
      expect(five_euros <= five_euros_half_cent ).to be_truthy
      expect(five_euros <= five_dollars ).to be_falsey
      expect(five_euros >= five_dollars ).to be_truthy
      expect(five_euros < five_dollars ).to be_falsey
      expect(five_euros > five_dollars ).to be_truthy
      expect(five_dollars <= five_euros ).to be_truthy
      expect(five_dollars >= five_euros ).to be_falsey
      expect(five_dollars < five_euros ).to be_truthy
      expect(five_dollars > five_euros ).to be_falsey
    end
    it 'does operations of addition and subtraction with objects' do
      five_euros = Money.new(5, 'EUR')
      six_dollars_sixtysix_cents = Money.new(6.66, 'USD')
      eleven_euros = five_euros + six_dollars_sixtysix_cents
      minus_one_euro = five_euros - six_dollars_sixtysix_cents
      one_dollar_eleven_cents = six_dollars_sixtysix_cents - five_euros
      expect(eleven_euros.inspect).to eq "11.0 'EUR'"
      expect(minus_one_euro.inspect).to eq "-1.0 'EUR'"
      expect(one_dollar_eleven_cents.inspect).to eq "1.11 'USD'"

    end
    it 'does operations of multiplication and division' do
      five_euros = Money.new(5, 'EUR')
      ten_euros = five_euros * 2
      two_euros = ten_euros / 5
      expect(ten_euros.inspect).to eq "10 'EUR'"
      expect(two_euros.inspect).to eq "2 'EUR'"
    end
  end
end


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// Test class that verifies the integration with APM (Task => APM) section 2.5.11 in the TPL spec
// "Asynchronous Programming Model", or the "Begin/End" pattern
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

using Xunit;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Diagnostics;

namespace System.Threading.Tasks.Tests
{
    /// <summary>
    /// A class that implements the APM pattern to ensure that TPL can support APM patttern
    /// </summary>
    public sealed class TaskAPMTests : IDisposable
    {
        /// <summary>
        /// Used to indicate whether to test TPL's Task or Future functionality for the APM pattern
        /// </summary>
        private bool _hasReturnType;

        /// <summary>
        /// Used to synchornize between Main thread and async thread, by blocking the main thread until
        /// the thread that invokes the TaskCompleted method via AsyncCallback finishes
        /// </summary>
        private ManualResetEvent _mre = new ManualResetEvent(false);

        /// <summary>
        /// The input value to LongTask<int>.DoTask/BeginDoTask
        /// </summary>
        private const int IntInput = 1000;

        /// <summary>
        /// The constant that defines the number of milliseconds to spinwait (to simulate work) in the LongTask class
        /// </summary>
        private const int LongTaskMilliseconds = 100;

        [Theory]
        [OuterLoop]
        [InlineData(true)]
        [InlineData(false)]
        public void WaitUntilCompleteTechnique(bool hasReturnType)
        {
            _hasReturnType = hasReturnType;

            LongTask longTask;
            if (_hasReturnType)
                longTask = new LongTask<int>(LongTaskMilliseconds);
            else
                longTask = new LongTask(LongTaskMilliseconds);

            // Prove that the Wait-until-done technique works
            IAsyncResult asyncResult = longTask.BeginDoTask(null, null);
            longTask.EndDoTask(asyncResult);

            AssertTaskCompleted(asyncResult);
            Assert.False(asyncResult.CompletedSynchronously, "Should not have completed synchronously.");
        }

        [Theory]
        [OuterLoop]
        [InlineData(true)]
        [InlineData(false)]
        public void PollUntilCompleteTechnique(bool hasReturnType)
        {
            _hasReturnType = hasReturnType;

            LongTask longTask;
            if (_hasReturnType)
                longTask = new LongTask<int>(LongTaskMilliseconds);
            else
                longTask = new LongTask(LongTaskMilliseconds);

            IAsyncResult asyncResult = longTask.BeginDoTask(null, null);
            while (!asyncResult.IsCompleted)
            {
                Task.Delay(300).Wait();
            }

            AssertTaskCompleted(asyncResult);
            Assert.False(asyncResult.CompletedSynchronously, "Should not have completed synchronously.");
        }

        [Theory]
        [OuterLoop]
        [InlineData(true)]
        [InlineData(false)]
        public void WaitOnAsyncWaitHandleTechnique(bool hasReturnType)
        {
            _hasReturnType = hasReturnType;

            LongTask longTask;
            if (_hasReturnType)
                longTask = new LongTask<int>(LongTaskMilliseconds);
            else
                longTask = new LongTask(LongTaskMilliseconds);

            IAsyncResult asyncResult = longTask.BeginDoTask(null, null);
            asyncResult.AsyncWaitHandle.WaitOne();

            AssertTaskCompleted(asyncResult);
            Assert.False(asyncResult.CompletedSynchronously, "Should not have completed synchronously.");
        }

        [Theory]
        [OuterLoop]
        [InlineData(true)]
        [InlineData(false)]
        public void CallbackTechnique(bool hasReturnType)
        {
            _hasReturnType = hasReturnType;

            LongTask longTask;
            if (_hasReturnType)
                longTask = new LongTask<int>(LongTaskMilliseconds);
            else
                longTask = new LongTask(LongTaskMilliseconds);

            IAsyncResult asyncResult;
            if (_hasReturnType)
                asyncResult = ((LongTask<int>)longTask).BeginDoTask(IntInput, TaskCompleted, longTask);
            else
                asyncResult = longTask.BeginDoTask(TaskCompleted, longTask);

            _mre.WaitOne(); //Block the main thread until async thread finishes executing the call back

            AssertTaskCompleted(asyncResult);
            Assert.False(asyncResult.CompletedSynchronously, "Should not have completed synchronously.");
        }

        /// <summary>
        /// Method used by the callback implementation by the APM
        /// </summary>
        /// <param name="ar"></param>
        private void TaskCompleted(IAsyncResult ar)
        {
            if (_hasReturnType)
            {
                LongTask<int> lt = (LongTask<int>)ar.AsyncState;
                int retValue = lt.EndDoTask(ar);
                if (retValue != IntInput)
                    Assert.True(false, string.Format("Mismatch: Return = {0} vs Expect = {1}", retValue, IntInput));
            }
            else
            {
                LongTask lt = (LongTask)ar.AsyncState;
                lt.EndDoTask(ar);
            }

            _mre.Set();
        }

        /// <summary>
        /// Assert that the IAsyncResult represent a completed Task
        /// </summary>
        private void AssertTaskCompleted(IAsyncResult ar)
        {
            Assert.True(ar.IsCompleted);
            Assert.Equal(TaskStatus.RanToCompletion, ((Task)ar).Status);
        }

        public void Dispose()
        {
            _mre.Dispose();
        }
    }

    /// <summary>
    /// A dummy class that simulates a long running task that implements IAsyncResult methods
    /// </summary>
    public class LongTask
    {
        // Amount of time to SpinWait, in milliseconds.
        protected readonly Int32 _msWaitDuration;

        public LongTask(Int32 milliseconds)
        {
            _msWaitDuration = milliseconds;
        }

        // Synchronous version of time-consuming method
        public void DoTask()
        {
            // Simulate time-consuming task
            SpinWait.SpinUntil(() => false, _msWaitDuration);
        }

        // Asynchronous version of time-consuming method (Begin part)
        public IAsyncResult BeginDoTask(AsyncCallback callback, Object state)
        {
            // Create IAsyncResult object identifying the asynchronous operation
            Task task = Task.Factory.StartNew(
                delegate
                {
                    DoTask(); //simulates workload
                },
                state);

            if (callback != null)
            {
                task.ContinueWith(delegate
                {
                    callback(task);
                });
            }

            return task; // Return the IAsyncResult to the caller
        }

        // Asynchronous version of time-consuming method (End part)
        public void EndDoTask(IAsyncResult asyncResult)
        {
            // We know that the IAsyncResult is really a Task object
            Task task = (Task)asyncResult;
            // Wait for operation to complete
            task.Wait();
        }
    }

    /// <summary>
    /// A dummy class that simulates a long running Future that implements IAsyncResult methods
    /// </summary>
    public sealed class LongTask<T> : LongTask
    {
        public LongTask(Int32 milliseconds)
            : base(milliseconds)
        {
        }

        // Synchronous version of time-consuming method
        public T DoTask(T input)
        {
            SpinWait.SpinUntil(() => false, _msWaitDuration); // Simulate time-consuming task
            return input; // Return some result, for now, just return the input
        }

        public IAsyncResult BeginDoTask(T input, AsyncCallback callback, Object state)
        {
            // Create IAsyncResult object identifying the asynchronous operation
            Task<T> task = Task<T>.Factory.StartNew(
                delegate
                {
                    return DoTask(input);
                },
                state);

            task.ContinueWith(delegate
            {
                callback(task);
            });

            return task; // Return the IAsyncResult to the caller
        }

        // Asynchronous version of time-consuming method (End part)
        new public T EndDoTask(IAsyncResult asyncResult)
        {
            // We know that the IAsyncResult is really a Task object
            Task<T> task = (Task<T>)asyncResult;

            // Return the result
            return task.Result;
        }
    }
}