text:
/**
 * @docauthor Robert Dougan <rob@sencha.com>
 *
 * Single checkbox field. Can be used as a direct replacement for traditional checkbox fields. Also serves as a
 * parent class for {@link Ext.form.field.Radio radio buttons}.
 *
 * # Labeling
 *
 * In addition to the {@link Ext.form.Labelable standard field labeling options}, checkboxes
 * may be given an optional {@link #boxLabel} which will be displayed immediately after checkbox. Also see
 * {@link Ext.form.CheckboxGroup} for a convenient method of grouping related checkboxes.
 *
 * # Values
 *
 * The main value of a checkbox is a boolean, indicating whether or not the checkbox is checked.
 * The following values will check the checkbox:
 *
 * - `true`
 * - `'true'`
 * - `'1'`
 * - `'on'`
 *
 * Any other value will uncheck the checkbox.
 *
 * In addition to the main boolean value, you may also specify a separate {@link #inputValue}. This will be
 * sent as the parameter value when the form is {@link Ext.form.Basic#submit submitted}. You will want to set
 * this value if you have multiple checkboxes with the same {@link #name}. If not specified, the value `on`
 * will be used.
 *
 * # Example usage
 *
 *     @example
 *     Ext.create('Ext.form.Panel', {
 *         bodyPadding: 10,
 *         width: 300,
 *         title: 'Pizza Order',
 *         items: [
 *             {
 *                 xtype: 'fieldcontainer',
 *                 fieldLabel: 'Toppings',
 *                 defaultType: 'checkboxfield',
 *                 items: [
 *                     {
 *                         boxLabel  : 'Anchovies',
 *                         name      : 'topping',
 *                         inputValue: '1',
 *                         id        : 'checkbox1'
 *                     }, {
 *                         boxLabel  : 'Artichoke Hearts',
 *                         name      : 'topping',
 *                         inputValue: '2',
 *                         checked   : true,
 *                         id        : 'checkbox2'
 *                     }, {
 *                         boxLabel  : 'Bacon',
 *                         name      : 'topping',
 *                         inputValue: '3',
 *                         id        : 'checkbox3'
 *                     }
 *                 ]
 *             }
 *         ],
 *         bbar: [
 *             {
 *                 text: 'Select Bacon',
 *                 handler: function() {
 *                     Ext.getCmp('checkbox3').setValue(true);
 *                 }
 *             },
 *             '-',
 *             {
 *                 text: 'Select All',
 *                 handler: function() {
 *                     Ext.getCmp('checkbox1').setValue(true);
 *                     Ext.getCmp('checkbox2').setValue(true);
 *                     Ext.getCmp('checkbox3').setValue(true);
 *                 }
 *             },
 *             {
 *                 text: 'Deselect All',
 *                 handler: function() {
 *                     Ext.getCmp('checkbox1').setValue(false);
 *                     Ext.getCmp('checkbox2').setValue(false);
 *                     Ext.getCmp('checkbox3').setValue(false);
 *                 }
 *             }
 *         ],
 *         renderTo: Ext.getBody()
 *     });
 */
Ext.define('Ext.form.field.Checkbox', {
    extend: 'Ext.form.field.Base',
    alias: ['widget.checkboxfield', 'widget.checkbox'],
    alternateClassName: 'Ext.form.Checkbox',
    requires: ['Ext.XTemplate', 'Ext.form.CheckboxManager'],

    // note: {id} here is really {inputId}, but {cmpId} is available
    fieldSubTpl: [
        '<tpl if="boxLabel && boxLabelAlign == \'before\'">',
            '{boxLabel}',
        '</tpl>',
        // Creates not an actual checkbox, but a button which is given aria role="checkbox" and
        // styled with a custom checkbox image. This allows greater control and consistency in
        // styling, and using a button allows it to gain focus and handle keyboard nav properly.
        '<input type="button" id="{id}" ',
            '<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>',
            'class="{fieldCls} {typeCls}" autocomplete="off" hidefocus="true" />',
        '<tpl if="boxLabel && boxLabelAlign == \'after\'">',
            '{boxLabel}',
        '</tpl>',
        {
            disableFormats: true,
            compiled: true
        }
    ],

    isCheckbox: true,

    /**
     * @cfg {String} [focusCls='x-form-cb-focus']
     * The CSS class to use when the checkbox receives focus
     */
    focusCls: Ext.baseCSSPrefix + 'form-cb-focus',

    /**
     * @cfg {String} [fieldCls='x-form-field']
     * The default CSS class for the checkbox
     */

    /**
     * @cfg {String} [fieldBodyCls='x-form-cb-wrap']
     * An extra CSS class to be applied to the body content element in addition to {@link #fieldBodyCls}.
     * .
     */
    fieldBodyCls: Ext.baseCSSPrefix + 'form-cb-wrap',

    /**
     * @cfg {Boolean} checked
     * true if the checkbox should render initially checked
     */
    checked: false,

    /**
     * @cfg {String} [checkedCls='x-form-cb-checked']
     * The CSS class added to the component's main element when it is in the checked state.
     */
    checkedCls: Ext.baseCSSPrefix + 'form-cb-checked',

    /**
     * @cfg {String} boxLabel
     * An optional text label that will appear next to the checkbox. Whether it appears before or after the checkbox is
     * determined by the {@link #boxLabelAlign} config.
     */

    /**
     * @cfg {String} [boxLabelCls='x-form-cb-label']
     * The CSS class to be applied to the {@link #boxLabel} element
     */
    boxLabelCls: Ext.baseCSSPrefix + 'form-cb-label',

    /**
     * @cfg {String} boxLabelAlign
     * The position relative to the checkbox where the {@link #boxLabel} should appear. Recognized values are 'before'
     * and 'after'.
     */
    boxLabelAlign: 'after',

    /**
     * @cfg {String} inputValue
     * The value that should go into the generated input element's value attribute and should be used as the parameter
     * value when submitting as part of a form.
     */
    inputValue: 'on',

    /**
     * @cfg {String} uncheckedValue
     * If configured, this will be submitted as the checkbox's value during form submit if the checkbox is unchecked. By
     * default this is undefined, which results in nothing being submitted for the checkbox field when the form is
     * submitted (the default behavior of HTML checkboxes).
     */

    /**
     * @cfg {Function} handler
     * A function called when the {@link #checked} value changes (can be used instead of handling the {@link #change
     * change event}).
     * @cfg {Ext.form.field.Checkbox} handler.checkbox The Checkbox being toggled.
     * @cfg {Boolean} handler.checked The new checked state of the checkbox.
     */

    /**
     * @cfg {Object} scope
     * An object to use as the scope ('this' reference) of the {@link #handler} function (defaults to this Checkbox).
     */

    // private overrides
    checkChangeEvents: [],
    inputType: 'checkbox',
    ariaRole: 'checkbox',

    // private
    onRe: /^on$/i,

    initComponent: function(){
        this.callParent(arguments);
        this.getManager().add(this);
    },

    initValue: function() {
        var me = this,
            checked = !!me.checked;

        /**
         * @property {Object} originalValue
         * The original value of the field as configured in the {@link #checked} configuration, or as loaded by the last
         * form load operation if the form's {@link Ext.form.Basic#trackResetOnLoad trackResetOnLoad} setting is `true`.
         */
        me.originalValue = me.lastValue = checked;

        // Set the initial checked state
        me.setValue(checked);
    },

    // private
    onRender : function(ct, position) {
        var me = this;

        /**
         * @property {Ext.Element} boxLabelEl
         * A reference to the label element created for the {@link #boxLabel}. Only present if the component has been
         * rendered and has a boxLabel configured.
         */
        me.addChildEls('boxLabelEl');

        Ext.applyIf(me.subTplData, {
            boxLabel: me.boxLabel,
            boxLabelCls: me.boxLabelCls,
            boxLabelAlign: me.boxLabelAlign
        });

        me.callParent(arguments);
    },

    initEvents: function() {
        var me = this;
        me.callParent();
        me.mon(me.inputEl, 'click', me.onBoxClick, me);
    },

    /**
     * @private Handle click on the checkbox button
     */
    onBoxClick: function(e) {
        var me = this;
        if (!me.disabled && !me.readOnly) {
            this.setValue(!this.checked);
        }
    },

    /**
     * Returns the checked state of the checkbox.
     * @return {Boolean} True if checked, else false
     */
    getRawValue: function() {
        return this.checked;
    },

    /**
     * Returns the checked state of the checkbox.
     * @return {Boolean} True if checked, else false
     */
    getValue: function() {
        return this.checked;
    },

    /**
     * Returns the submit value for the checkbox which can be used when submitting forms.
     * @return {Boolean/Object} True if checked; otherwise either the {@link #uncheckedValue} or null.
     */
    getSubmitValue: function() {
        var unchecked = this.uncheckedValue,
            uncheckedVal = Ext.isDefined(unchecked) ? unchecked : null;
        return this.checked ? this.inputValue : uncheckedVal;
    },

    /**
     * Sets the checked state of the checkbox.
     *
     * @param {Boolean/String/Number} value The following values will check the checkbox:
     * `true, 'true', '1', 1, or 'on'`, as well as a String that matches the {@link #inputValue}.
     * Any other value will uncheck the checkbox.
     * @return {Boolean} the new checked state of the checkbox
     */
    setRawValue: function(value) {
        var me = this,
            inputEl = me.inputEl,
            inputValue = me.inputValue,
            checked = (value === true || value === 'true' || value === '1' || value === 1 ||
                (((Ext.isString(value) || Ext.isNumber(value)) && inputValue) ? value == inputValue : me.onRe.test(value)));

        if (inputEl) {
            inputEl.dom.setAttribute('aria-checked', checked);
            me[checked ? 'addCls' : 'removeCls'](me.checkedCls);
        }

        me.checked = me.rawValue = checked;
        return checked;
    },

    /**
     * Sets the checked state of the checkbox, and invokes change detection.
     * @param {Boolean/String} checked The following values will check the checkbox: `true, 'true', '1', or 'on'`, as
     * well as a String that matches the {@link #inputValue}. Any other value will uncheck the checkbox.
     * @return {Ext.form.field.Checkbox} this
     */
    setValue: function(checked) {
        var me = this;

        // If an array of strings is passed, find all checkboxes in the group with the same name as this
        // one and check all those whose inputValue is in the array, unchecking all the others. This is to
        // facilitate setting values from Ext.form.Basic#setValues, but is not publicly documented as we
        // don't want users depending on this behavior.
        if (Ext.isArray(checked)) {
            me.getManager().getByName(me.name).each(function(cb) {
                cb.setValue(Ext.Array.contains(checked, cb.inputValue));
            });
        } else {
            me.callParent(arguments);
        }

        return me;
    },

    // private
    valueToRaw: function(value) {
        // No extra conversion for checkboxes
        return value;
    },

    /**
     * @private
     * Called when the checkbox's checked state changes. Invokes the {@link #handler} callback
     * function if specified.
     */
    onChange: function(newVal, oldVal) {
        var me = this,
            handler = me.handler;
        if (handler) {
            handler.call(me.scope || me, me, newVal);
        }
        me.callParent(arguments);
    },

    // inherit docs
    beforeDestroy: function(){
        this.callParent();
        this.getManager().removeAtKey(this.id);
    },

    // inherit docs
    getManager: function() {
        return Ext.form.CheckboxManager;
    },

    onEnable: function() {
        var me = this,
            inputEl = me.inputEl;
        me.callParent();
        if (inputEl) {
            // Can still be disabled if the field is readOnly
            inputEl.dom.disabled = me.readOnly;
        }
    },

    setReadOnly: function(readOnly) {
        var me = this,
            inputEl = me.inputEl;
        if (inputEl) {
            // Set the button to disabled when readonly
            inputEl.dom.disabled = readOnly || me.disabled;
        }
        me.readOnly = readOnly;
    },

    // Calculates and returns the natural width of the bodyEl. It's possible that the initial rendering will
    // cause the boxLabel to wrap and give us a bad width, so we must prevent wrapping while measuring.
    getBodyNaturalWidth: function() {
        var me = this,
            bodyEl = me.bodyEl,
            ws = 'white-space',
            width;
        bodyEl.setStyle(ws, 'nowrap');
        width = bodyEl.getWidth();
        bodyEl.setStyle(ws, '');
        return width;
    }

});


text:
doc-metrix-node
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Provides an API for doc-metrix performance metric documentation.

## Installation

``` bash
$ npm install doc-metrix-node
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).

## Usage

To interface with [doc-metrix](https://github.com/doc-metrix/),

``` javascript
var metrics = require( 'doc-metrix' );
```

The interface has the following methods...

### Metrics

Metric centric methods...

#### metrics.mexists( name )

Checks whether a metric having the provided `name` is included in the documentation.

``` javascript
metrics.mexists( 'cpu.utilization' );
// returns true

metrics.mexists( 'unknown.metric.name' );
// returns false
```

Note: method is __not__ case sensitive.

#### metrics.mlist()

Lists all metrics included in the documentation.

``` javascript
metrics.mlist();
// returns an array of metric names
```

#### metrics.mfilter( regexp )

Lists all metrics satisfying a regular expression filter.

``` javascript
metrics.mfilter( /Utilization/i );
```

Note: filtering for metric names __is__ case sensitive. Ignore case `/i` for case insensitive filtering.

#### metrics.mget( [filter] )

Returns metric documentation. The provided `filter` may be a `string` or a regular expression. If a metric does not have documentation, returns `null`. To return a single metric's documentation,

``` javascript
metrics.mget( 'cpu.utilization' );
// returns {...}

metrics.mget( 'unknown.metric.name' );
// returns null
```

To return metric documentation matching a filter,

``` javascript
metrics.mget( /Utilization/i );
// returns {...}
```

To return all metric documentation,

``` javascript
metrics.mget();
// returns {"metric1":{...},"metric2":{...},...}
```

Note: when the filter is a `string`, the method is __not__ case sensitive.

Note: when the filter is a regular expression, the method __is__ case sensitive. If case does not matter, ignore case `/i`;

### Devices

Device centric methods...

#### metrics.dexists( name )

Checks whether a device having the provided `name` is known to have associated metric documentation.

``` javascript
metrics.dexists( 'ram' );
// returns true

metrics.dexists( 'unknown_device_name' );
// returns false
```

#### metrics.dlist()

Lists all devices known to have associated metric documentation.

``` javascript
metrics.dlist();
// returns an array of device names
```

Note: the returned list __may__ contain regular expressions. Regular expressions are included to account for platform variability.

#### metrics.dget( [name] )

Returns metric documentation associated with devices. If a device does not have associated documentation, returns `null`. To return a single device's metric documentation,

``` javascript
metrics.dget( 'ram' );
// returns {"metric0":{...},"metric1":{...},...}

metrics.dget( 'unknown_device_name' );
// returns null
```

To return all devices and their associated metric documentation,

``` javascript
metrics.dget();
// returns {"device0":{...},"device1":{...},...}
```

## Examples

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```

## Notes

After running the following commands,

``` bash
$ npm install
$ npm update
```

this package, when used as a dependency, will attempt an HTTP request to retrieve the latest documentation from [Github](https://github.com/doc-metrix/INSERT_NAME).

During development, run the following command to retrieve the latest documentation

``` bash
$ npm run docs
```

## Tests

### Unit

Unit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.

### Test Coverage

This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

``` bash
$ make test-cov
```

Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,

``` bash
$ open reports/coverage/lcov-report/index.html
```

## License

[MIT license](http://opensource.org/licenses/MIT).

---
## Copyright

Copyright © 2014. [NodePrime](http://nodeprime.com).

[npm-image]: http://img.shields.io/npm/v/doc-metrix.svg
[npm-url]: https://npmjs.org/package/doc-metrix

[travis-image]: http://img.shields.io/travis/doc-metrix/doc-metrix-node/master.svg
[travis-url]: https://travis-ci.org/doc-metrix/doc-metrix-node

[coveralls-image]: https://img.shields.io/coveralls/doc-metrix/doc-metrix-node/master.svg
[coveralls-url]: https://coveralls.io/r/doc-metrix/doc-metrix-node?branch=master

[dependencies-image]: http://img.shields.io/david/doc-metrix/doc-metrix-node.svg
[dependencies-url]: https://david-dm.org/doc-metrix/doc-metrix-node

[dev-dependencies-image]: http://img.shields.io/david/dev/doc-metrix/doc-metrix-node.svg
[dev-dependencies-url]: https://david-dm.org/dev/doc-metrix/doc-metrix-node

[github-issues-image]: http://img.shields.io/github/issues/doc-metrix/doc-metrix-node.svg
[github-issues-url]: https://github.com/doc-metrix/doc-metrix-node/issues

redpajama_set_name: RedPajamaGithub


text:
var _events = {
    init: function () {

    },
    tick: function () {
        if (roll(_event.main_chance)) {
            var roll_bad_event = roll(_event.bad);
            var roll_good_event = roll(_event.good);
            if (roll_bad_event && roll_good_event) {
                return false;
            } else if (!roll_bad_event && !roll_good_event) {
                return false;
            } else if (!roll_bad_event && roll_good_event) {
                var which = roll_array(_events.good);
                if (which == 'resource') {
                    var arr_result = _events.rolls.resource();
                    _resources.defined[arr_result[0]].amount += parseInt(arr_result[1]);
                    _resource.redraw();
                    _log.report.event('resource', 'good', arr_result[0], parseInt(arr_result[1]));
                }
                if (which == 'chances') {
                    var arr_result = _events.rolls.chance('positive');
                    _resources.defined[arr_result[0]].number = parseFloat(_resources.defined[arr_result[0]].number) + arr_result[1];

                    if (_resources.defined[arr_result[0]].number < 0) {
                        _resources.defined[arr_result[0]].number = 0;
                    }
                    if (_resources.defined[arr_result[0]].number > 1) {
                        _resources.defined[arr_result[0]].number = 1;
                    }
                    _chances.redraw();
                    _log.report.event('chances', 'good', arr_result[0], arr_result[1] * 100);
                }
            } else if (roll_bad_event && !roll_good_event) {
                var which = roll_array(_events.bad);
                if (which == 'resource') {
                    var arr_result = _events.rolls.resource();
                    _resources.defined[arr_result[0]].amount = parseInt(_resources.defined[arr_result[0]].amount) - parseInt(arr_result[1]);

                    if (_resources.defined[arr_result[0]].amount < 0) {
                        _resources.defined[arr_result[0]].amount = 0;
                    }
                    _resource.redraw();
                    _log.report.event('resource', 'bad', arr_result[0], parseInt(arr_result[1]));
                }
                if (which == 'chances') {
                    var arr_result = _events.rolls.chance('negative');
                    console.log(arr_result[1] + ' ' + _resources.defined[arr_result[0]].number + ' ');
                    _resources.defined[arr_result[0]].number = parseFloat(_resources.defined[arr_result[0]].number) + arr_result[1];

                    if (_resources.defined[arr_result[0]].number < 0) {
                        _resources.defined[arr_result[0]].number = 0;
                    }
                    if (_resources.defined[arr_result[0]].number > 1) {
                        _resources.defined[arr_result[0]].number = 1;
                    }
                    _chances.redraw();
                    _log.report.event('chances', 'bad', arr_result[0], arr_result[1] * 100);
                }
            }
        }
        //do event
        //log event info
        //redraw UI
    },
    rolls: {
        resource: function () {
            var roll_diff = Math.random().toFixed(2);
            var which_resource = roll_array(['titan', 'uranium', 'helium', 'power']);
            var multiplier = 0;
            if (roll_diff < 0.3) {
                multiplier = 1.2; //small amount
            }
            if (roll_diff < 0.9 && roll_diff > 0.3) {
                multiplier = 2; //medium amount
            }
            if (roll_diff >= 0.9 && roll_diff <= 0.95) {
                multiplier = 2.5; //big amount
            }
            if (roll_diff >= 0.96) {
                multiplier = 5; //tremendous amount
            }
            var year = parseInt($('[data-number="cur-year"]').text());
            var amount_result = roll_diff * 10 * multiplier * year;
            if (amount_result >= 0 && amount_result <= 1) {
                amount_result = 1;
            }
            return [which_resource, amount_result];
        },
        chance: function (param) {
            var which_chance = roll_array(['born', 'die', 'death', 'apocalypse']);
            var result_amount;
            if (param == 'positive') {
                if (which_chance == 'born') result_amount = Math.abs(parseFloat(roll_specific(0.01, 0.03, 2)));
                if (which_chance == 'die') result_amount = -Math.abs(parseFloat(roll_specific(0.01, 0.03, 2)));
                if (which_chance == 'death') result_amount = -Math.abs(parseFloat(roll_specific(0.01, 0.03, 2)));
                if (which_chance == 'apocalypse') result_amount = -Math.abs(parseFloat(roll_specific(0.0001, 0.00055, 5)));
            }
            if (param == 'negative') {
                if (which_chance == 'born') result_amount = -Math.abs(parseFloat(roll_specific(0.05, 0.20, 2)));
                if (which_chance == 'die') result_amount = Math.abs(parseFloat(roll_specific(0.05, 0.20, 2)));
                if (which_chance == 'death') result_amount = Math.abs(parseFloat(roll_specific(0.05, 0.25, 2)));
                if (which_chance == 'apocalypse') result_amount = Math.abs(parseFloat(roll_specific(0.0005, 0.00125, 5)));
            }
            return [which_chance, result_amount];
        }
    },
    good: ['resource', 'chances'],
    bad: ['resource', 'chances', 'aliens']
};


text:
from __future__ import absolute_import, print_function

import six

import os
import unittest

from cameo import load_model
from cameo.strain_design.deterministic.flux_variability_based import Fseof, FseofResult, DifferentialFVA

from pandas import DataFrame, pandas
from pandas.util.testing import assert_frame_equal

TESTDIR = os.path.dirname(__file__)
ECOLICORE = load_model(os.path.join(TESTDIR, 'data/EcoliCore.xml'))

def assert_dataframes_equal(df, expected):
    try:
        assert_frame_equal(df, expected, check_names=False)
        return True
    except AssertionError:
        return False

class TestFSEOF(unittest.TestCase):
    def setUp(self):
        self.model = ECOLICORE.copy()
        self.model.solver = 'glpk'

    def test_fseof(self):
        objective = self.model.objective
        fseof = Fseof(self.model, enforced_reaction="EX_succ_lp_e_rp_")
        fseof_result = fseof.run()
        self.assertIsInstance(fseof_result, FseofResult)
        self.assertIs(objective, self.model.objective)

    def test_fseof_result(self):
        fseof = Fseof(self.model, self.model.reactions.EX_ac_lp_e_rp_)
        fseof_result = fseof.run()
        self.assertIsInstance(fseof_result.data_frame, DataFrame)
        self.assertIs(fseof_result.enforced_reaction, self.model.reactions.EX_ac_lp_e_rp_)
        self.assertIs(fseof_result.model, self.model)
        self.assertEqual(list(fseof_result), list(fseof_result.reactions))

if six.PY2:  # Make these test cases work with PY3 as well
    class TestDifferentialFVA(unittest.TestCase):
        def setUp(self):
            self.model = ECOLICORE

        def test_minimal_input(self):
            result = DifferentialFVA(self.model, self.model.reactions.EX_succ_lp_e_rp_, points=5).run()
            # result.data_frame.iloc[0].to_pickle(os.path.join(TESTDIR, 'data/REFERENCE_DiffFVA1.pickle'))
            pandas.util.testing.assert_frame_equal(result.data_frame.iloc[0], pandas.read_pickle(os.path.join(TESTDIR, 'data/REFERENCE_DiffFVA1.pickle')))

        def test_with_reference_model(self):
            reference_model = self.model.copy()
            biomass_rxn = reference_model.reactions.Biomass_Ecoli_core_N_lp_w_fsh_GAM_rp__Nmet2
            biomass_rxn.lower_bound = 0.3
            target = reference_model.reactions.EX_succ_lp_e_rp_
            target.lower_bound = 2
            result = DifferentialFVA(self.model, target, reference_model=reference_model, points=5).run()
            # result.data_frame.iloc[0].to_pickle(os.path.join(TESTDIR, 'data/REFERENCE_DiffFVA2.pickle'))
            pandas.util.testing.assert_frame_equal(result.data_frame.iloc[0], pandas.read_pickle(os.path.join(TESTDIR, 'data/REFERENCE_DiffFVA2.pickle')))

if __name__ == "__main__":
    import nose

    nose.runmodule()


text:
package com.almondtools.regexbench.scaling;

import static java.util.Arrays.asList;

import java.util.List;

public class SCMultiFactorBenchmarkTest extends ScalingPatternMatcherBenchmarkTest {

	@Override
	protected ScalingPatternMatcherBenchmark getBenchmark() {
		return new SCMultiFactorBenchmark();
	}

	@Override
	protected List<String> excluded() {
		return asList("kjb:search", "human-protein:search");
	}
}


text:
n/a

## Errata

* The file metadata/go-release-reference.tgz was accidentally included in the release. This file usually only exists to be pushed into Zenodo.


text:
package org.kuali.rice.krad.datadictionary.validation.constraint.resolver;

import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable;
import org.kuali.rice.krad.datadictionary.validation.constraint.Constraint;

import java.util.List;

/**
 * An interface that provides a lookup of constraints for a specific constrainable attribute definition. Implemented by constraint
 * providers as a mechanism to store functional lookups in a map, keyed by constraint type, for example.
 *
 * {@see AttributeDefinitionConstraintProvider} for a number of examples.
 *
 * @author Kuali Rice Team (rice.collab@kuali.org)
 * @param <T>
 * @since 1.1
 */
public interface ConstraintResolver<T extends Constrainable> {

	public <C extends Constraint> List<C> resolve(T definition);

}


text:
<!DOCTYPE html>

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

Hello {name}!


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of INTJ in UD_Komi_Zyrian-IKDP</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Komi_Zyrian-IKDP: POS Tags: INTJ

There are 10 INTJ lemmas (1%), 12 INTJ types (1%) and 17 INTJ tokens (1%).
Out of 16 observed tags, the rank of INTJ is: 12 in number of lemmas, 12 in number of types and 14 in number of tokens.

The 10 most frequent INTJ lemmas: оо, ӧ, а, но, Ооо, м-м, ой, пӧжалуста, хах, этайӧ

The 10 most frequent INTJ types:  ӧ, ӧӧ, Но, А, Ааа, Оо, Ооо, ммм, ой, пӧжалуста

The 10 most frequent ambiguous lemmas: а (<tt>CCONJ</tt> 31, <tt>INTJ</tt> 2), но (<tt>CCONJ</tt> 22, <tt>PART</tt> 3, <tt>INTJ</tt> 2), ой (<tt>INTJ</tt> 1, <tt>NOUN</tt> 1)

The 10 most frequent ambiguous types:  Но (<tt>CCONJ</tt> 10, <tt>INTJ</tt> 2), А (<tt>CCONJ</tt> 21, <tt>INTJ</tt> 1)

Но

<tt>CCONJ</tt> 10: Но вӧӧяссэ миян унаэн видзены .

<tt>INTJ</tt> 2: Но , Ижмаыслэн ю кузяыс сиктъяс дорас , ӧӧ , берегыс изъя .

А

<tt>CCONJ</tt> 21: А ӧні ачум велӧдча .

<tt>INTJ</tt> 1: А , менэ шуэны Терентьев Александр Юрьевич .

Morphology

The form / lemma ratio of INTJ is 1.200000 (the average of all parts of speech is 1.332474).

The 1st highest number of forms (2) was observed with the lemma "а": А, Ааа.

The 2nd highest number of forms (2) was observed with the lemma "оо": Оо, ӧӧ.

The 3rd highest number of forms (1) was observed with the lemma "Ооо": Ооо.

INTJ occurs with 2 features: <tt>Number</tt> (1; 6% instances), <tt>PronType</tt> (1; 6% instances)

INTJ occurs with 2 feature-value pairs: Number=Sing, PronType=Dem

INTJ occurs with 2 feature combinations.
The most frequent feature combination is _ (16 tokens).
Examples: ӧ, ӧӧ, Но, А, Ааа, Оо, Ооо, ммм, ой, пӧжалуста

Relations

INTJ nodes are attached to their parents using 1 different relations: <tt>discourse</tt> (17; 100% instances)

Parents of INTJ nodes belong to 4 different parts of speech: <tt>VERB</tt> (11; 65% instances), <tt>ADJ</tt> (3; 18% instances), <tt>NOUN</tt> (2; 12% instances), <tt>PRON</tt> (1; 6% instances)

1 (6%) INTJ nodes are leaves.

8 (47%) INTJ nodes have one child.

8 (47%) INTJ nodes have two children.

The highest child degree of a INTJ node is 2.

Children of INTJ nodes are attached using 1 different relations: <tt>punct</tt> (24; 100% instances)

Children of INTJ nodes belong to 1 different parts of speech: <tt>PUNCT</tt> (24; 100% instances)

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/**
 * @author
 *   Stephen Samuel
 */
class AvoidSizeEqualsZero
    extends Inspection(
      text = "Avoid Traversable.size == 0",
      defaultLevel = Levels.Warning,
      description = "Checks for use of Traversable.size.",
      explanation =
        "Traversable.size can be slow for some data structures, prefer Traversable.isEmpty, which is O(1)."
    ) {

  def inspector(context: InspectionContext): Inspector =
    new Inspector(context) {
      override def postTyperTraverser: context.Traverser =
        new context.Traverser {

          import context.global._

          private val Size = TermName("size")
          private val Length = TermName("length")

          override def inspect(tree: Tree): Unit = {
            tree match {
              case Apply(Select(Select(q, Size | Length), TermName("$eq$eq")), List(Literal(Constant(0))))
                  if isIterable(q) =>
                context.warn(tree.pos, self, tree.toString.take(100))
              case _ => continue(tree)
            }
          }
        }
    }
}


text:
require 'rubygems'
begin
  gem 'minitest'
rescue Gem::LoadError
  Gem.install('minitest')
  gem 'minitest'
end
require 'minitest'
if (Minitest::VERSION <=> "5.9.0") == 1
  raise ScriptError, "You need to install a modern version of Minitest"
end

module TestUp

  ### Constants ### ------------------------------------------------------------

  # Set to true to expose more debug tools in the UI when developing TestUp.
  DEBUG = false

  # <debug>
  if defined?(SKETCHUP_CONSOLE)
    SKETCHUP_CONSOLE.show
  elsif defined?(LAYOUT_CONSOLE)
    LAYOUT_CONSOLE.show
  end
  # </debug>

  PATH_IMAGES = File.join(PATH, 'images').freeze
  PATH_JS_SCRIPTS = File.join(PATH, 'js').freeze

  ### Accessors ### ------------------------------------------------------------

  class << self
    attr_reader :settings
    attr_accessor :window
  end

  ### Dependencies ### ---------------------------------------------------------

  if defined?(UI::WebDialog)
    if !defined?(TestUp::SKUI)
      skui_path = File.join(PATH, 'third-party', 'SKUI', 'src', 'SKUI')
      require File.join(skui_path, 'embed_skui.rb')
      ::SKUI.embed_in(self)
    end
    require File.join(PATH, 'preferences_window.rb')
    require File.join(PATH, 'test_window.rb')
  end

  require File.join(PATH, 'console.rb')
  require File.join(PATH, 'coverage.rb')
  require File.join(PATH, 'debug.rb')
  require File.join(PATH, 'editor.rb')
  require File.join(PATH, 'p4.rb')
  require File.join(PATH, 'settings.rb')
  require File.join(PATH, 'taskbar_progress.rb')
  require File.join(PATH, 'test_discoverer.rb')
  require File.join(PATH, 'ui.rb')
  if RUBY_PLATFORM =~ /mswin|mingw/
    require File.join(PATH, 'win32.rb')
  end

  ### Configuration ### --------------------------------------------------------

  tests_path = File.join(__dir__, '..', '..', 'tests')
  if defined?(Sketchup)
    defaults = {
        :editor_application => Editor.get_default[0],
        :editor_arguments => Editor.get_default[1],
        :run_in_gui => true,
        :verbose_console_tests => true,
        :paths_to_testsuites => [
            File.expand_path(File.join(tests_path, 'TestUp')),
            File.expand_path(File.join(tests_path, 'SketchUp Ruby API'))
        ]
    }
  elsif defined?(Layout)
    defaults = {
        :editor_application => Editor.get_default[0],
        :editor_arguments => Editor.get_default[1],
        :run_in_gui => false,
        :verbose_console_tests => true,
        :paths_to_testsuites => [
            # ...
        ]
    }
  end
  @settings = Settings.new(PLUGIN_ID, defaults)

  ### UI ### -------------------------------------------------------------------

  self.init_ui

  def self.reload_code_before_tests
    puts "I'm going to call the relaod0"
  end

  def self.reset_settings
    # This will make the default values be used. (At least under Windows.)
    # TODO: Confirm this works under OSX.
    @settings[:debugger_output_enabled] = nil
    @settings[:editor] = nil
    @settings[:editor_application] = nil
    @settings[:editor_arguments] = nil
    @settings[:run_in_gui] = nil
    @settings[:verbose_console_tests] = nil
    @settings[:paths_to_testsuites] = nil
  end

  ### Extension ### ------------------------------------------------------------

  def self.toggle_testup
    @window ||= TestUpWindow.new
    @window.toggle
  end

  def self.toggle_run_in_gui
    @settings[:run_in_gui] = !@settings[:run_in_gui]
  end

  def self.toggle_verbose_console_tests
    @settings[:verbose_console_tests] = !@settings[:verbose_console_tests]
  end

  def self.run_tests_gui
    unless @window && @window.visible?
      warn 'TestUp window not open.'
      UI.beep
      return
    end
    TestUp.reload_code_before_tests
    testsuite = @window.active_testsuite
    tests = @window.selected_tests
    # Number of tests is currently incorrect as the list include stubs from the
    # manifest.
    @num_tests_being_run = tests.size
    if self.run_tests(tests, testsuite)
      #puts Reporter.results.pretty_inspect
      @window.update_results(Reporter.results)
    else
      @window.update_results({})
    end
  end

  def self.update_testing_progress(num_tests_run)
    progress = TaskbarProgress.new
    progress.set_value(num_tests_run, @num_tests_being_run)
    #puts "Test Progres: #{num_tests_run} of #{@num_tests_being_run}"
    nil
  end

  # @example Run a test case:
  #   TestUp.run_tests(["TC_Edge#"])
  #
  # @example Run single test:
  #   TestUp.run_tests(["TC_Edge#start"])
  #
  # @example Run single test:
  #   tests = [
  #     "TC_Face#",
  #     "TC_Edge#start", "TC_Edge#end"
  #   ]
  #   TestUp.run_tests(tests)
  #
  # @param [Array<String>] list of tests or test cases to run.
  def self.run_tests(tests, testsuite = "Untitled")
    TESTUP_CONSOLE.show
    TESTUP_CONSOLE.clear
    if tests.empty?
      puts "No tests selected to run."
      return false
    end
    puts "Discovering tests...\n"
    self.discover_tests
    puts "Running test suite: #{testsuite}"
    # If tests end with a `#` it means the whole test case should be run.
    # Automatically fix the regex.
    tests = tests.map { |pattern|
      if pattern =~ /\#$/
        pattern << ".+"
      end
      pattern
    }
    arguments = []
    arguments << "-n /^(#{tests.join('|')})$/"
    arguments << '--verbose' if @settings[:verbose_console_tests]
    arguments << '--testup' if @settings[:run_in_gui]
    progress = TaskbarProgress.new
    begin
      progress.set_state(TaskbarProgress::NORMAL)
      self.suppress_warning_dialogs {
        Minitest.run(arguments)
      }
    ensure
      progress.set_state(TaskbarProgress::NOPROGRESS)
    end
    true
  end

  def self.discover_tests
    Debugger.time("TestUp.discover_tests") {
      progress = TaskbarProgress.new
      begin
        progress.set_state(TaskbarProgress::INDETERMINATE)
        paths = TestUp.settings[:paths_to_testsuites]
        test_discoverer = TestDiscoverer.new(paths)
        discoveries = test_discoverer.discover
      ensure
        progress.set_state(TaskbarProgress::NOPROGRESS)
      end
      discoveries
    }
  end

  def self.suppress_warning_dialogs(&block)
    if Test.respond_to?(:suppress_warnings=)
      cache = Test.suppress_warnings?
      Test.suppress_warnings = true
    end
    block.call
  ensure
    if Test.respond_to?(:suppress_warnings=)
      Test.suppress_warnings = cache
    end
    nil
  end

  def self.defer(&block)
    done = false
    UI.start_timer(0, false) {
      # Any modal dialog would cause this timer to repeat. We avoid this
      # potential problem by breaking out early if we already have run.
      next if done
      done = true
      block.call
    }
  end

end # module


text:
namespace std {

template<typename T, T... Values>
struct integer_sequence {
    static constexpr size_t size() noexcept {
        return sizeof...(Values);
    }
};

template <size_t... Values>
using index_sequence = integer_sequence<size_t, Values...>;

template <typename, size_t, bool>
struct sequence_concat_impl;

template <typename T, T... I, size_t N>
struct sequence_concat_impl<integer_sequence<T, I...>, N, false> {
    using type = integer_sequence<T, I..., (N + I)...>;
};

template <typename T, T... I, size_t N>
struct sequence_concat_impl<integer_sequence<T, I...>, N, true> {
    using type = integer_sequence<T, I..., (N + I)..., 2 * N>;
};

// The 0 and 1 cannot be deduced directly, must use SFINAE

// Base type for generating a sequence
template <typename T, T N, typename Enable = void>
struct make_integer_sequence_impl;

// The general case construct a list by concatenating
template <typename T, T N, typename Enable>
struct make_integer_sequence_impl {
    using type = typename sequence_concat_impl<typename make_integer_sequence_impl<T, N / 2>::type, N / 2, N % 2 == 1>::type;
};

// Specialization for empty sequence
template <typename T, T N>
struct make_integer_sequence_impl<T, N, std::enable_if_t<(N == 0)>> {
    using type = integer_sequence<T>;
};

// Specialization for sequence of length one
template <typename T, T N>
struct make_integer_sequence_impl<T, N, std::enable_if_t<(N == 1)>> {
    using type = integer_sequence<T, 0>;
};

template <typename T, T N>
using make_integer_sequence = typename make_integer_sequence_impl<T, N>::type;

template <size_t N>
using make_index_sequence = make_integer_sequence<size_t, N>;

} //end of namespace std

#endif


text:
describe TestCreateMenu do

  before do
    @subject = TestCreateMenu.new
  end

  it 'should create a menu via "create"' do
    menu = @subject.some_menu
    menu.should.not == nil
    menu.should.be.kind_of(NSMenu)
    menu.title.should == 'Test Create'
  end

end


text:
    Signature

            <input ref="input" name="data[signature]" type="hidden" class="form-control" lang="en" value="No" id="signature-signature"></input>

            <canvas class="signature-pad-canvas" height="150px" ref="canvas"></canvas>

            Sign above

          <button type="button" class="ui icon button secondary" ref="removeRow">

          </button>

          <button class="ui button primary" ref="addButton"> Add Another</button>


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<title>Resource Timing script initiator types</title>
<link rel="author" title="Google" href="http://www.google.com/" />
<link rel="help" href="http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/>

Description

This test validates that all of the different types of script loads are reported with the correct initiator.


text:
<?php

namespace Opulence\Authentication\Clients\Orm;

use Opulence\Authentication\Clients\IClient;

/**
 * Defines the interface for client repositories to implement
 */
interface IClientRepository
{
    /**
     * Adds a client
     *
     * @param IClient $client The client to add
     */
    public function add(IClient $client);

    /**
     * Deletes a client
     *
     * @param IClient $client The client to delete
     */
    public function delete(IClient $client);

    /**
     * Gets the client with the input Id
     *
     * @param int|string $id The Id to get by
     * @return IClient The client with the input Id
     */
    public function getById($id);
}


text:
#ifndef DUALTREE_RANGE_SEARCH_H
#define DUALTREE_RANGE_SEARCH_H

extern double RANGESEARCH_NO_LIMIT;

#include "kdtree.h"

// note, 'xind' and 'yind' are indices IN THE KDTREE; to get back to
// 'normal' ordering you must use the kdtree permutation vector.
typedef void (*result_callback)(void* extra, int xind, int yind,
								double dist2);

typedef void (*progress_callback)(void* extra, int ydone);

typedef double (*dist2_function)(void* px, void* py, int D);

void dualtree_rangesearch(kdtree_t* xtree, kdtree_t* ytree,
						  double mindist, double maxdist,
						  bool notself,
						  dist2_function distsquared,
						  result_callback callback,
						  void* param,
						  progress_callback progress,
						  void* progress_param);

/*
 void dualtree_rangecount(kdtree_t* x, kdtree_t* y,
 double mindist, double maxdist,
 dist2_function distsquared,
 int* counts);
 */

#endif


text:
title: Visual Effects in Motion Picture and Video Production
modulverantwortlich: Herr Prof. Hans Kornacher
modulniveau:
kuezel: WPF VFX
untertitel:
studiensemester: 4
kategorie:
sprache: Deutsch/Englisch
zuordnung-zum-curriculum: Medieninformatik Bachelor
kreditpunkte: 5
voraussetzungen-nach-pruefungsordnung: Abgeschlossenes Modul AVM
empfohlene-voraussetzungen:
published: true
---

## Lehrform/SWS:

## Arbeitsaufwand:

## Angestrebte Lernergebnisse:

## Inhalt:
In Vortraegen werden die einzelnen Arbeitsschritte einer Visual Effects Produktion vorgestellt, die dann in einem Projekt praktisch umgesetzt wird. Von der Idee ueber das Expose und das Storyboard, der Kalkulation und dem Produktionsplan ueber die eigentliche Produktion mit der DV-Kamera vor Bluescreen bis hin zum finalen Compositing mit AfterEffects oder Shake wird der gesamte Prozess thematisiert.

## Studien-/Prüfungsleistungen:
Projektarbeit und Dokumentation

## Medienformen:

## Literatur:
Fachzeitschrift Digital Production dp


text:
package org.apache.mina.integration.jmx;

import java.net.SocketAddress;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
import javax.management.ObjectName;
import javax.management.modelmbean.ModelMBeanOperationInfo;

import ognl.Ognl;

import org.apache.mina.core.service.IoService;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.integration.ognl.IoSessionFinder;

/**
 * A JMX MBean wrapper for an {@link IoSession}.
 *
 * @author Apache MINA Project
 */
public class IoServiceMBean extends ObjectMBean<IoService> {

    static String getSessionIdAsString(long l) {
        // ID in MINA is a unsigned 32-bit integer.
        String id = Long.toHexString(l).toUpperCase();
        while (id.length() < 8) {
            id = '0' + id; // padding
        }
        id = "0x" + id;
        return id;
    }

    public IoServiceMBean(IoService source) {
        super(source);
    }

    @Override
    protected Object invoke0(String name, Object[] params, String[] signature) throws Exception {
        if (name.equals("findSessions")) {
            IoSessionFinder finder = new IoSessionFinder((String) params[0]);
            return finder.find(getSource().getManagedSessions().values());
        }

        if (name.equals("findAndRegisterSessions")) {
            IoSessionFinder finder = new IoSessionFinder((String) params[0]);
            Set<IoSession> registeredSessions = new LinkedHashSet<IoSession>();
            for (IoSession s : finder.find(getSource().getManagedSessions().values())) {
                try {
                    getServer().registerMBean(
                            new IoSessionMBean(s),
                            new ObjectName(getName().getDomain() + ":type=session,name="
                                    + getSessionIdAsString(s.getId())));
                    registeredSessions.add(s);
                } catch (Exception e) {
                    LOGGER.warn("Failed to register a session as a MBean: " + s, e);
                }
            }

            return registeredSessions;
        }

        if (name.equals("findAndProcessSessions")) {
            IoSessionFinder finder = new IoSessionFinder((String) params[0]);
            String command = (String) params[1];
            Object expr = Ognl.parseExpression(command);
            Set<IoSession> matches = finder.find(getSource().getManagedSessions().values());

            for (IoSession s : matches) {
                try {
                    Ognl.getValue(expr, s);
                } catch (Exception e) {
                    LOGGER.warn("Failed to execute '" + command + "' for: " + s, e);
                }
            }
            return matches;
        }

        return super.invoke0(name, params, signature);
    }

    @Override
    protected void addExtraOperations(List<ModelMBeanOperationInfo> operations) {
        operations.add(new ModelMBeanOperationInfo("findSessions", "findSessions",
                new MBeanParameterInfo[] { new MBeanParameterInfo("ognlQuery", String.class.getName(),
                        "a boolean OGNL expression") }, Set.class.getName(), MBeanOperationInfo.INFO));
        operations.add(new ModelMBeanOperationInfo("findAndRegisterSessions", "findAndRegisterSessions",
                new MBeanParameterInfo[] { new MBeanParameterInfo("ognlQuery", String.class.getName(),
                        "a boolean OGNL expression") }, Set.class.getName(), MBeanOperationInfo.ACTION_INFO));
        operations.add(new ModelMBeanOperationInfo("findAndProcessSessions", "findAndProcessSessions",
                new MBeanParameterInfo[] {
                        new MBeanParameterInfo("ognlQuery", String.class.getName(), "a boolean OGNL expression"),
                        new MBeanParameterInfo("ognlCommand", String.class.getName(),
                                "an OGNL expression that modifies the state of the sessions in the match result") },
                Set.class.getName(), MBeanOperationInfo.ACTION_INFO));
    }

    @Override
    protected boolean isOperation(String methodName, Class<?>[] paramTypes) {
        // Ignore some IoServide methods.
        if (methodName.matches("(newSession|broadcast|(add|remove)Listener)")) {
            return false;
        }

        if ((methodName.equals("bind") || methodName.equals("unbind"))
                && (paramTypes.length > 1 || paramTypes.length == 1
                        && !SocketAddress.class.isAssignableFrom(paramTypes[0]))) {
            return false;
        }

        return super.isOperation(methodName, paramTypes);
    }
}


text:
package com.android.server.pm;

import android.content.pm.PackageParser;

import java.io.File;

/**
 * Settings data for a particular package we know about.
 */
final class PackageSetting extends PackageSettingBase {
    int appId;
    PackageParser.Package pkg;
    SharedUserSetting sharedUser;

    PackageSetting(String name, String realName, File codePath, File resourcePath,
            String nativeLibraryPathString, int pVersionCode, int pkgFlags) {
        super(name, realName, codePath, resourcePath, nativeLibraryPathString, pVersionCode,
                pkgFlags);
    }

    /**
     * New instance of PackageSetting replicating the original settings.
     * Note that it keeps the same PackageParser.Package instance.
     */
    PackageSetting(PackageSetting orig) {
        super(orig);

        appId = orig.appId;
        pkg = orig.pkg;
        sharedUser = orig.sharedUser;
    }

    @Override
    public String toString() {
        return "PackageSetting{"
            + Integer.toHexString(System.identityHashCode(this))
            + " " + name + "/" + appId + "}";
    }
}


text:
*************************
python-cairo-dependencies
*************************

This package contains all of the files required to run the `python-cairo`_ module
compiled for Windows as provided by the GNOME Desktop Project's Windows binary
archive.

How to
======

 1. Install `python-cairo`_ from the binary package provided by the GNOME Project.
 2. Resolve the ``python-cairo`` dependencies by installing `python-cairo-dependencies`_
    (this module)

Binaries
========

This package provides:

 - libcairo-2.dll
 - freetype6.dll
 - libfontconfig-1.dll
 - libpng14-14.dll
 - zlib1.dll

License
=======

 - libfontconfig is licensed under the terms of the `GNU Lesser General Public
   License`_, version 2.
 - Freetype is dual licensed under the terms of the `FreeType license`_ and the
   terms of the `GNU General Public License`_, version 2.
 - cairo, which is dual licensed under the terms of the `GNU Lesser General
   Public License`_, version 2, and the `Mozilla Public License`_.
 - fontconfig, which is licensed under the terms of the `fontconfig license`_.
 - libpng, which is licensed under the terms of the `libpng license`_.
 - zlib, which is licensed under the terms of the `zlib license`_.
 - libexpat, which is licensed under the terms of the `MIT License`_.

This individual package, its documentation, and the code required to build the
package, is licensed under the terms of the MIT License. See `LICENSE.RST`_.

Sources
=======

Binaries
--------

Binary packages were located at the following sources:

 - `GTK+ "development" bundle`_:
     - freetype6
     - libfontconfig-1
     - libpng14-14
     - zlib1
     - libexpat-1
 - `libcairo-2.dll`_
 - `python-cairo-dependencies`_

Individual binaries from the GTK+ bundle can be found on the `GNOME Desktop
Project's Windows binaries page`_.

Sources
-------

Source packages for each of these can be found at the following locations:

 - `cairo`_
 - `freetype6`_
 - `libfontconfig-1`_
 - `libpng14-14`_
 - `zlib1`_
 - `libexpat-1`_
 - `python-cairo`_
 - `python-cairo-dependencies (source)`_ (this project)

.. Links
.. =====
..
.. Licenses
.. --------
..
.. _`FreeType license`: doc/LICENSE-FTL.TXT
.. _`GNU General Public License`: doc/LICENSE-GPL.TXT
.. _`GNU Lesser General Public License`: doc/LICENSE-LGPL.TXT
.. _`Mozilla Public License`: doc/LICENSE-CAIRO.TXT
.. _`fontconfig license`: doc/LICENSE-FONTCONFIG.TXT
.. _`libpng license`: doc/LICENSE-LIBPNG.TXT
.. _`zlib license`: doc/LICENSE-ZLIB.TXT
.. _`MIT License`: doc/LICENSE-LXML2.TXT
.. _`LICENSE.rst`: LICENSE.rst
..
.. Binaries
.. --------
..
.. _`GTK+ "development" bundle`: http://www.gtk.org/download-windows.html
.. _`libcairo-2.dll`: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.10.2-1_win32.zip
.. _`python-cairo`: http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/
.. _`python-cairo-dependencies`: http://www.wxwhatever.com/jmcb/cairo/cairo-dependencies-0.1.win32.exe
.. _`GNOME Desktop Project's Windows binaries page`: http://ftp.gnome.org/pub/GNOME/binaries/win32/
..
.. Sources
.. -------
..
.. _`cairo`: http://cairographics.org/download/
.. _`freetype6`: http://www.freetype.org/download.htm
.. _`libfontconfig-1`: http://www.freedesktop.org/software/fontconfig/release/
.. _`libpng14-14`: http://www.libpng.org/pub/png/libpng.html
.. _`zlib1`: http://zlib.net/
.. _`libexpat-1`: http://sourceforge.net/projects/expat/files/
.. _`python-cairo (source)`: http://ftp.gnome.org/pub/GNOME/sources/gnome-python-desktop/
.. _`python-cairo-dependencies (source)`: http://www.github.com/jmcb/python-cairo-depedencies/


text:
%%  KPNORMDUAL  Computes the dual of the (k,p)-norm of a vector or matrix
%   This function has three required arguments:
%     X: a vector or matrix
%     K: a positive integer
%     P: a real number >= 1, or Inf
%
%   NRM = kpNormDual(X,K,P) is the dual of the (K,P)-norm of the vector or
%   matrix X (see URL for details).
%
%   URL: http://www.qetlab.com/kpNormDual

%   requires: kpNorm.m
%   author: Nathaniel Johnston (nathaniel@njohnston.ca)
%   package: QETLAB
%   last updated: June 24, 2015

function nrm = kpNormDual(X,k,p)

sX = size(X);
nX = min(sX);
xX = max(sX);

% There are some special cases that we can compute slightly faster than
% doing a full SVD, so we consider those cases separately.
if((nX > 1 && k >= nX) && p == 2) % dual of the Frobenius norm is the Frobenius norm
    nrm = norm(X,'fro');
elseif((nX > 1 && k >= nX) && p == 1) % dual of the trace norm is the operator norm, which is computed faster by kpNorm.m, which uses svds in this case
    nrm = kpNorm(X,1,1);
elseif(p == Inf) % this case is needed to avoid errors, not for speed reasons: dual of operator norm is trace norm
    nrm = kpNorm(X,xX,1);
else % in all other cases, it seems like we have to compute all singular values or just brute-force our way with CVX

    % If X is a CVX variable, try to compute the norm in a way that won't
    % piss off MATLAB.
    if(isa(X,'cvx') == 1)
        % Just compute the value via CVX using the definition of what it
        % means to be the dual norm: optimize over the unit ball in the
        % original norm.
        cvx_begin quiet
            cvx_precision best;
            variable Y(sX(2),sX(1)) complex
            maximize real(trace(X'*Y))
            subject to
                kpNorm(Y,k,p) <= 1;
        cvx_end

        nrm = real(cvx_optval);
    else
        if(nX == 1)
            k = min(k,xX);
            s = sort(X,'descend');
        else
            k = min(k,nX);
            s = svd(full(X));
        end

        for r=(k-1):-1:0
            av = sum(s(r+1:end))/(k-r);
            if(r == 0);break;end
            if(s(r) > av);break;end
        end
        if(p == 1)
            nrm = max([s(1),av]);
        else
            nrm = norm([s(1:r).',av*ones(1,k-r)],p/(p-1));
        end
    end
end


text:
package org.opencb.bionetdb.app;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.opencb.bionetdb.core.models.network.Network;
import org.opencb.bionetdb.core.models.network.Node;
import org.opencb.bionetdb.core.models.network.Relation;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;

public class BioNetDBMainTest {

    @Test
    public void createCsvClinicalAnalysis() {
        String caPath = "/home/jtarraga/data150/clinicalAnalysis";
        String cmdLine = "~/appl/bionetdb/build/bin/bionetdb.sh create-csv -i " + caPath + "/input/ -o csv/ --clinical-analysis";
    }

    public void createNetworks() {
        long uid = 0;

        ObjectMapper mapper = new ObjectMapper();
        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        mapper.configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, true);

        Network network;
        Node node1, node2, node3;
        Relation relation1, relation2, relation3;

        network = new Network("net1", "net1", "Network #1");
        network.setNodes(new ArrayList<>());
        network.setRelations(new ArrayList<>());

        node1 = new Node(uid++, "ENSG00000078808", "SDF4", Node.Label.GENE);
        network.getNodes().add(node1);
        node2 = new Node(uid++, null, "COCA", Node.Label.GENE_DRUG_INTERACTION);
        network.getNodes().add(node2);
        relation1 = new Relation(uid++, "rel1", node1.getUid(), Node.Label.GENE, node2.getUid(), Node.Label.GENE_DRUG_INTERACTION,
                Relation.Label.ANNOTATION);
        network.getRelations().add(relation1);

        File file = new File("/tmp/network1.json");
        try {
            network.write(file);
        } catch (FileNotFoundException | JsonProcessingException e) {
            e.printStackTrace();
        }
//        try {
//            mapper.writer().writeValue(, network);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

        network = new Network("net2", "net2", "Network #2");
        network.setNodes(new ArrayList<>());
        network.setRelations(new ArrayList<>());

        node1 = new Node(uid++, "ENSG00000066666", "SDF666", Node.Label.GENE);
        network.getNodes().add(node1);
        node2 = new Node(uid++, null, "COCA", Node.Label.GENE_DRUG_INTERACTION);
        network.getNodes().add(node2);
        node3 = new Node(uid++, "ALCOHOL", "ALCOHOL", Node.Label.GENE_DRUG_INTERACTION);
        network.getNodes().add(node3);
        relation2 = new Relation(uid++, "rel2", node1.getUid(), Node.Label.GENE, node2.getUid(), Node.Label.GENE_DRUG_INTERACTION,
                Relation.Label.ANNOTATION);
        network.getRelations().add(relation2);
        relation3 = new Relation(uid++, "rel3", node1.getUid(), Node.Label.GENE, node3.getUid(), Node.Label.GENE_DRUG_INTERACTION,
                Relation.Label.ANNOTATION);
        network.getRelations().add(relation3);

        file = new File("/tmp/network2.json");
        try {
            network.write(file);
        } catch (FileNotFoundException | JsonProcessingException e) {
            e.printStackTrace();
        }
//        try {
//            mapper.writer().writeValue(new File("/tmp/network2.json"), network);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
         version="3.1">

    <enterprise-beans>

        <session>
            <ejb-name>CommandHandlerRegistry</ejb-name>
            <business-local>org.jeecqrs.commands.registry.AutoDiscoverCommandHandlerRegistry</business-local>
            <ejb-class>org.jeecqrs.commands.registry.AutoDiscoverCommandHandlerRegistry</ejb-class>
            <session-type>Singleton</session-type>
            <init-on-startup>true</init-on-startup>
        </session>

        <message-driven>
            <ejb-name>JMSCommandBusListener</ejb-name>
            <ejb-class>org.jeecqrs.commands.bus.jms.JMSCommandBusListener</ejb-class>
            <messaging-type>javax.jms.MessageListener</messaging-type>
            <message-destination-type>javax.jms.Queue</message-destination-type>
            <!-- mappedName is required for Glassfish and must be the JNDI queue name -->
            <mapped-name>commandQueue</mapped-name>
            <activation-config>
                <!-- destination is the JNDI location of the queue on JBoss,
                     but the physical queue name on Glassfish, which must
                     NOT contain slashes.  Hence we must a global JNDI name w/o slashes. -->
                <activation-config-property>
                    <activation-config-property-name>destination</activation-config-property-name>
                    <activation-config-property-value>commandQueue</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>destinationType</activation-config-property-name>
                    <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>acknowledgeMode</activation-config-property-name>
                    <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
                </activation-config-property>
            </activation-config>
            <ejb-local-ref>
                <ejb-ref-name>commandHandlerRegistry</ejb-ref-name>
                <local>org.jeecqrs.commands.registry.AutoDiscoverCommandHandlerRegistry</local>
                <ejb-link>CommandHandlerRegistry</ejb-link>
            </ejb-local-ref>
        </message-driven>

            <!--resource-ref>
                <res-ref-name>jms/ConnectionFactory</res-ref-name>
                <res-type>javax.jms.QueueConnectionFactory</res-type>
                <mapped-name>jms/ConnectionFactory</mapped-name>
                <lookup-name>java:/jms/ConnectionFactory</lookup-name>
            </resource-ref-->

        <!-- mappedName has higher precedence than lookup-name -->
        <session>
            <ejb-name>CommandBus</ejb-name>
            <business-local>org.jeecqrs.commands.CommandBus</business-local>
            <ejb-class>org.jeecqrs.commands.bus.jms.JMSCommandBus</ejb-class>
            <session-type>Stateless</session-type>
            <resource-ref>
                <res-ref-name>jms/ConnectionFactory</res-ref-name>
                <res-type>javax.jms.QueueConnectionFactory</res-type>
                <mapped-name>jms/ConnectionFactory</mapped-name>
                <lookup-name>java:/jms/ConnectionFactory</lookup-name>
            </resource-ref>
            <resource-env-ref>
                <resource-env-ref-name>jms/commandQueue</resource-env-ref-name>
                <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
                <mapped-name>commandQueue</mapped-name>
                <lookup-name>java:/commandQueue</lookup-name>
            </resource-env-ref>
        </session>

    </enterprise-beans>

</ejb-jar>


text:
<?php

// Run this with:
// php -S localhost:8080 native.php

require '../vendor/autoload.php';

$keyDB = new ArrayObject(array(
    'EscherExample'  => 'TheBeginningOfABeautifulFriendship',
));
$escher = Escher::create('escher_request');

switch($_SERVER["SCRIPT_NAME"]) {
    case "/":
        echo "Escher Example";
        break;
    case "/validate_request":
        try {
            $escher->validateRequest($keyDB);
            echo "OK";
        } catch (EscherException $ex) {
            echo 'ERR: ' . $ex->getMessage();
        }
        break;
}


text:
package com.onboard.frontend.websocket;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

import com.onboard.frontend.service.web.SessionService;

@Configuration
@EnableWebSocket
public class WebsocketConfiguration implements WebSocketConfigurer {

    @Autowired
    SessionService sessionService;

    @Autowired
    WebsocketHandler websocketHandler;

    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(websocketHandler, "/websocket");
    }

}


text:
class RenameSiteAssignment < ActiveRecord::Migration
  def change
    rename_table :site_assignments, :site_contact_assignments
  end
end


text:
var connect = require('connect');
var serveStatic = require('serve-static');
var sanitizeHtml = require('sanitize-html');
var socketIO = require('socket.io');

// set up server and sockets
var app = connect();
var server = app.listen(5000);
var io = socketIO(server);

// static files
app.use(serveStatic(__dirname + '/public'));

// room user lists
var rooms = {};
function updateUserList(room) {
    if (!rooms[room]) return;
    io.to(room).emit('user-list', {
        users: Object.keys(rooms[room])
            .map(function(i) {
                return { userId: i, userName: io.sockets.connected[i].userName };
            })
            .sort(function(a, b) {
                if (a.userName < b.userName) return -1;
                if (a.userName > b.userName) return 1;
                return 0;
            }),
        room: room,
    });
}
function updateRoomList(to) {
    to.emit('room-list', Object.keys(rooms).sort());
}

// socket events
io.on('connection', function(socket) {
    function leave(room) {
        if (!rooms[room] || !rooms[room][socket.id]) return;

        socket.leave(room);
        delete rooms[room][socket.id];

        if (Object.keys(rooms[room]).length === 0) {
            delete rooms[room];
            updateRoomList(io);
        }
        else {
            socket.broadcast.to(room).emit('message', {
                content: 'User ' + socket.userName + ' has left the room.',
                room: room
            });
            updateUserList(room);
        }
    }

    // client disconnect
    socket.on('disconnect', function() {
        for (var r in rooms) {
            if (rooms[r][socket.id]) leave(r);
        }
    });

    socket.on('message', function(data) {
        var newUser = !socket.userName;

        if (typeof data.userName !== 'string' || data.userName.length === 0) {
            // leave room
            if (typeof data.room === 'string') leave(data.room);
            return;
        }

        // user name
        if (socket.userName !== data.userName) {
            var userRooms = socket.rooms.filter(function(r) {
                return rooms[r];
            });
            if (socket.userName !== undefined) {
                userRooms.forEach(function(r) {
                    io.to(r).emit('message', {
                        content: 'User ' + socket.userName + ' changed name to ' + data.userName + '.',
                        room: r
                    });
                });
            }
            socket.userName = data.userName;
            userRooms.forEach(updateUserList);
        }

        // room
        if (typeof data.room !== 'string') return
        if (rooms[data.room] === undefined) {
            rooms[data.room] = {};
            updateRoomList(io);
        }
        if (!rooms[data.room][socket.id]) {
            rooms[data.room][socket.id] = true;
            socket.join(data.room);
            updateUserList(data.room);
            socket.broadcast.to(data.room).emit('message', {
                content: 'User ' + socket.userName + ' has joined the room.',
                room: data.room
            });
        }
        if (newUser) updateRoomList(socket);

        // message
        if (typeof data.content !== 'string') return;
        data.content = sanitizeHtml(data.content, {
            allowedTags: [ 'b', 'i', 'em', 'strong', 'strike',
                'img', 'a', 'br', 'p', 'blockquote', 'code' ],
            allowedAttributes: { 'a': [ 'href' ], img: [ 'src', 'width', 'height' ] }
        });
        if (data.content.trim().length === 0) return;
        data.userId = socket.id;

        // pass message on to all clients
        io.to(data.room).emit('message', data);
    });
});


text:
class Answer < ActiveRecord::Base
	# This is Sinatra! Remember to create a migration!
	belongs_to :question
	belongs_to :user
	has_many :answer_votes
	validates :user_id, :uniqueness => {:scope => :question_id}, presence: true # one user can only answer once for a question
end


text:
package com.creditease.uav.profiling.spi;

public class ProfileConstants {

    public final static String PROELEM_JARS = "jars";
    public final static String PROELEM_COMPONENT = "cpt";
    public final static String PROELEM_LOGS = "logs";
    public final static String PROELEM_IPLINK = "iplnk";
    public static final String PROELEM_CLIENT = "clients";

    /**
     * profile instance id
     */
    public final static String PEI_LIB = "lib";
    public final static String PEI_URLS = "urls";
    public final static String PEI_CLIENTS = "clients";

    /**
     * profile context argument
     */
    public final static String PC_ARG_IPLNK = "pc.iplnk";
    public final static String PC_ARG_CLIENTADDR = "pc.client.addr";
    public final static String PC_ARG_IPLINK_TARGETURL = "pc.iplnk.url";
    public static final String PC_ARG_IPLINK_USRAGENT = "pc.iplnk.useragent";
    public static final String PC_ARG_SVRHOST = "pc.iplnk.svrhost";
    public static final String PC_ARG_APPID = "pc.iplnk.appid";

    public final static String PC_ARG_CLIENT_URL = "pc.client.url";
    public final static String PC_ARG_CLIENT_ACTION = "pc.client.action";
    public static final String PC_ARG_CLIENT_RC = "pc.client.rc";
    public static final String PC_ARG_CLIENT_RS = "pc.client.rs";
    public static final String PC_ARG_CLIENT_TYPE = "pc.client.type";
    public static final String PC_ARG_CLIENT_TARGETSERVER = "pc.client.target.server";

    public static final String PC_ARG_UAVCLIENT_TAG = "pc.uavclient.tag";
    public static final String PC_ARG_PROXYHOST = "pc.proxy.host";

    private ProfileConstants() {

    }
}


text:
using System;
using System.Runtime.InteropServices;
using System.Text;

namespace DanielBogdan.PlainRSS.UI.WinAPI
{
    public class WAWindows
    {
        #region Import WinApi Functions

        [DllImport("user32.dll")]
        public static extern IntPtr GetForegroundWindow();

        [DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool GetWindowRect(IntPtr hWnd, out Rect lpRect);

        [DllImport("user32")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool SetWindowPos(IntPtr hwnd, IntPtr hWndInsertAfter, int x, int y, int cx,
                                               int cy, uint wFlags);

        [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
        public static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);

        [DllImport("user32.dll")]
        public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

        [DllImport("user32.dll", EntryPoint = ("GetSystemMetrics"))]
        public static extern int GetSystemMetrics(int nIndex);

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

        #endregion

        #region Consts and structures

        public const int GwlStyle = -16;

        public const long WsSizebox = 0x00040000L;

        public static readonly IntPtr HwndTop = new IntPtr(0);

        public const uint SwpShowWindow = 0x0040;

        [StructLayout(LayoutKind.Sequential)]
        public struct Rect
        {
            public int Left;
            public int Top;
            public int Right;
            public int Bottom;

            public int Width
            {
                get { return Right - Left; }
            }

            public int Height
            {
                get { return Bottom - Top; }
            }

            public override bool Equals(object obj)
            {
                if (ReferenceEquals(null, obj)) return false;
                if (obj.GetType() != typeof(Rect)) return false;
                return Equals((Rect)obj);
            }

            public bool Equals(Rect other)
            {
                return other.Left == Left && other.Top == Top && other.Right == Right && other.Bottom == Bottom;
            }

            public override int GetHashCode()
            {
                unchecked
                {
                    var result = Left;
                    result = (result * 397) ^ Top;
                    result = (result * 397) ^ Right;
                    result = (result * 397) ^ Bottom;
                    return result;
                }
            }
        }

        public enum WindowShowStyle : uint
        {
            Hide = 0,
            ShowNormal = 1,
            ShowMinimized = 2,
            ShowMaximized = 3,
            ShowNormalNoActivate = 4,
            Show = 5,
            Minimize = 6,
            ShowMinNoActivate = 7,
            ShowNoActivate = 8,
            Restore = 9,
            ShowDefault = 10,
            ForceMinimized = 11
        }

        #endregion
    }
}