text:
# by Timothy Downs, inputbox written for my map editor

# This program needs a little cleaning up
# It ignores the shift key
# And, for reasons of my own, this program converts "-" to "_"

# A program to get user input, allowing backspace etc
# shown in a box in the middle of the screen
# Called by:
# import inputbox
# answer = inputbox.ask(screen, "Your name")
#
# Only near the center of the screen is blitted to
import pygame
import bf98

def get_key():
    while True:
        event = pygame.event.poll()
        if event.type == pygame.KEYDOWN:
            return event.key
        else:
            pass

def display_box(screen, message):
    """Print a message in a box in the middle of the screen"""
    fontobject = pygame.font.Font("../font/Inconsolata.otf", 14)
    bf98.blit_statics()
    bf98.initiate_new_run()
    pygame.draw.rect(screen, (0, 0, 0),
                    ((screen.get_width() / 2) - 150,
                     (screen.get_height() / 2) - 10,
                     250, 20), 0)
    pygame.draw.rect(screen, (255, 255, 255),
                    ((screen.get_width() / 2) - 152,
                     (screen.get_height() / 2) - 12,
                     254, 24), 1)

    if len(message) != 0:
        screen.blit(fontobject.render(message, 1, (230, 200, 70)),
                    ((screen.get_width() / 2) - 150,
                     (screen.get_height() / 2) - 10))
    pygame.display.flip()

def ask(screen, question):
    """ask(screen, question) -> answer"""
    pygame.font.init()
    current_string = []
    display_box(screen, question + ": " + "".join(current_string))
    while True:
        inkey = get_key()
        if inkey == pygame.K_BACKSPACE:
            current_string = current_string[0:-1]
        elif inkey == pygame.K_RETURN:
            break
        elif inkey == pygame.K_ESCAPE:
            break
        elif inkey <= 127:
            current_string.append(chr(inkey))
        display_box(screen, question + ": " + "".join(current_string))
    return "".join(current_string)


text:
'use strict';

const { expect } = require('chai');
const spec = require('../util.js').setup();

describe('lesshint', function () {
    describe('#urlFormat()', function () {
        it('should have the proper node types', function () {
            const source = '.foo { background-image: url(img/image.jpg); }';

            return spec.parse(source, function (ast) {
                expect(spec.linter.nodeTypes).to.include(ast.root.first.first.type);
            });
        });

        it('should allow relative URLs when "style" is "relative"', function () {
            const source = '.foo { background-image: url(img/image.jpg); }';
            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should allow multiple relative URLs when "style" is "relative"', function () {
            const source = '.foo { background-image: url(img/image.jpg), url(img/foo.jpg); }';
            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should not allow absolute URLs when "style" is "relative"', function () {
            const source = '.foo { background-image: url(http://example.com/img/image.jpg); }';
            const expected = [{
                column: 30,
                line: 1,
                message: 'URL "http://example.com/img/image.jpg" should be relative.'
            }];

            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.deep.equal(expected);
            });
        });

        it('should not allow multiple absolute URLs when "style" is "relative"', function () {
            const source = '.foo { background-image: url(http://example.com/img/image.jpg), url(http://example.com/img/foo.jpg); }';
            const expected = [
                {
                    column: 30,
                    line: 1,
                    message: 'URL "http://example.com/img/image.jpg" should be relative.'
                },
                {
                    column: 69,
                    line: 1,
                    message: 'URL "http://example.com/img/foo.jpg" should be relative.'
                }
            ];

            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.deep.equal(expected);
            });
        });

        it('should allow absolute URLs when "style" is "absolute"', function () {
            const source = '.foo { background-image: url(http://example.com/img/image.jpg); }';
            const options = {
                style: 'absolute'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should not allow relative URLs when "style" is "absolute"', function () {
            const source = '.foo { background-image: url(img/image.jpg); }';
            const expected = [{
                column: 30,
                line: 1,
                message: 'URL "img/image.jpg" should be absolute.'
            }];

            const options = {
                style: 'absolute'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.deep.equal(expected);
            });
        });

        it('should treat absolute URLs without a protocol as such when "style" is "relative"', function () {
            const source = '.foo { background-image: url(//example.com/img/image.jpg); }';
            const expected = [{
                column: 30,
                line: 1,
                message: 'URL "//example.com/img/image.jpg" should be relative.'
            }];

            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.deep.equal(expected);
            });
        });

        it('should treat absolute URLs without a protocol as such when "style" is "absolute"', function () {
            const source = '.foo { background-image: url(//example.com/img/image.jpg); }';
            const options = {
                style: 'absolute'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should handle relative URLs with single quotes', function () {
            const source = ".foo { background-image: url('img/image.jpg'); }";
            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should handle relative URLs with double quotes', function () {
            const source = '.foo { background-image: url("img/image.jpg"); }';
            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should handle absolute URLs with single quotes', function () {
            const source = ".foo { background-image: url('http://example.com/img/image.jpg'); }";
            const options = {
                style: 'absolute'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should handle absolute URLs with double quotes', function () {
            const source = '.foo { background-image: url("http://example.com/img/image.jpg"); }';
            const options = {
                style: 'absolute'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should handle quoted relative URLs surrounded by spaces (#22)', function () {
            const source = ".foo { background-image: url( 'img/image.jpg' ); }";
            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should handle unquoted URLs surrounded by spaces (#22)', function () {
            const source = '.foo { background-image: url( img/image.jpg ); }';
            const options = {
                style: 'relative'
            };

            return spec.parse(source, function (ast) {
                const result = spec.linter.lint(options, ast.root.first.first);

                expect(result).to.be.undefined;
            });
        });

        it('should throw on invalid "style" value', function () {
            const source = '.foo { background-image: url(img/image.jpg); }';
            const options = {
                style: 'invalid'
            };

            return spec.parse(source, function (ast) {
                const lint = spec.linter.lint.bind(null, options, ast.root.first.first);

                expect(lint).to.throw(Error);
            });
        });
    });
});

redpajama_set_name: RedPajamaGithub


text:
<template>

                <lightning-button-icon
                    class="slds-modal__close"
                    title={customLabels.closeButtonLabel}
                    icon-name="utility:close"
                    icon-class="slds-button_icon-inverse"
                    onclick={handleCancel}
                    onkeydown={handleClosedButtonTrapFocus}
                    data-id="closeButton">
                </lightning-button-icon>

                    {header}

            <lightning-record-edit-form record-id={recordId} object-api-name="npe03__Recurring_Donation__c"
                onsubmit={handleSubmit} onerror={handleSaveError} onsuccess={handleSuccess} data-id="outerRecordEditForm">

                    <template if:true={isLoading}>

                                <lightning-spinner alternative-text={customLabels.spinnerAltText} data-text={loadingText}
                                    class="loading-spinner">
                                </lightning-spinner>
                                <c-util-stencil row-count="20" column-count="2"></c-util-stencil>

                    </template>

                        <template if:true={error.detail}>
                            <c-util-page-level-message title={error.header}
                                variant="error"
                                icon-name="utility:error" icon-size="x-small" icon-variant="inverse" data-id="error"
                                data-qa-locator="error">

                                    <lightning-formatted-text value={error.detail}></lightning-formatted-text>

                            </c-util-page-level-message>
                        </template>

                                {customLabels.donorSectionHeader}

                                <c-rd2-entry-form-donor-section
                                        record-id={recordId}
                                        parent-id={parentId}
                                        parent-s-object-type={rdSettings.parentSObjectType}
                                        data-id="donorComponent"
                                        onerrorevent={handleChildComponentError}
                                        oncontactchange={handleContactChange}
                                        onaccountchange={handleAccountChange}
                                        ondonortypechange={handleDonorTypeChange}
                                        if:true={isSettingReady}
                                >
                                </c-rd2-entry-form-donor-section>

                        <template if:true={isEdit}>

                                    {customLabels.statusSectionHeader}

                                    <lightning-layout horizontal-align="spread" multiple-rows="true">
                                        <lightning-layout-item padding="horizontal-small" size="6" if:true={fields.status}>
                                            <lightning-input-field
                                                    data-id="status"
                                                    field-name={fields.status.apiName}
                                                    required>
                                            </lightning-input-field>
                                        </lightning-layout-item>

                                        <lightning-layout-item padding="horizontal-small" size="6"
                                            if:true={fields.statusReason}>
                                            <lightning-input-field field-name={fields.statusReason.apiName}>
                                            </lightning-input-field>
                                        </lightning-layout-item>
                                    </lightning-layout>

                        </template>

                                {customLabels.scheduleSectionHeader}

                                <lightning-layout horizontal-align="spread" multiple-rows="true">
                                    <lightning-layout-item padding="horizontal-small" size="6" small-device-size="6"
                                        if:true={fields.amount}>
                                        <lightning-input-field
                                                field-name={fields.amount.apiName}
                                                data-id="amountField"
                                                required
                                        >
                                        </lightning-input-field>
                                    </lightning-layout-item>

                                    <template if:true={isMultiCurrencyEnabled}>
                                        <lightning-layout-item padding="horizontal-small" size="6" small-device-size="6"
                                            if:true={fields.amount}>

                                                {fields.currency.label}
                                                <lightning-input-field id="currencyField" data-id="currencyField"
                                                    field-name={fields.currency.apiName} variant="label-hidden"
                                                    required onchange={handleCurrencyChange}>
                                                </lightning-input-field>

                                        </lightning-layout-item>
                                    </template>

                                </lightning-layout>

                                <c-rd2-entry-form-schedule-section
                                        record-id={recordId}
                                        data-id="scheduleComponent"
                                        onerrorevent={handleChildComponentError}
                                        ontypechange={handleRecurringTypeChange}
                                        onperiodchange={handleRecurringPeriodChange}
                                        onperiodtypechange={handleRecurringPeriodTypeChange}
                                        if:true={isSettingReady}>
                                </c-rd2-entry-form-schedule-section>

                                <lightning-layout horizontal-align="spread" multiple-rows="true">
                                    <lightning-layout-item padding="horizontal-small" size="12" small-device-size="6"
                                        if:true={fields.paymentMethod}>
                                        <lightning-input-field field-name={fields.paymentMethod.apiName}
                                            onchange={handlePaymentChange}
                                            data-id="paymentMethod">
                                        </lightning-input-field>
                                    </lightning-layout-item>

                                    <lightning-layout-item size="12" class="slds-p-bottom_small"
                                        if:true={isElevateWidgetEnabled}>
                                        <c-rd2-elevate-credit-card-form data-id='elevateWidget'
                                            data-qa-locator='widget Elevate'
                                            is-edit-mode={isCommitmentEdit}
                                            rd2-record-id={recordId}
                                            card-exp-date={cardExpDate}
                                            card-last-four-label={cardLastFourLabel}
                                            ach-last-four-label={achLastFourLabel}
                                            card-last-four={cardLastFour}
                                            ach-last-four={achLastFour}
                                            next-donation-date={nextDonationDate}
                                            payer-organization-name={organizationAccountName}
                                            payer-first-name={contactFirstName}
                                            payer-last-name={contactLastName}
                                            ach-account-type={accountHolderType}
                                            existing-payment-method={existingPaymentMethod}
                                            payment-method={paymentMethod}>
                                        </c-rd2-elevate-credit-card-form>
                                    </lightning-layout-item>
                                </lightning-layout>

                                {customLabels.otherSectionHeader}

                                <lightning-layout horizontal-align="spread" multiple-rows="true">
                                    <template if:false={isAutoNamingEnabled}>
                                        <lightning-layout-item padding="horizontal-small" size="12" if:true={fields.name}>
                                            <lightning-input-field class="name-field-class" field-name={fields.name.apiName}
                                                required>
                                            </lightning-input-field>
                                        </lightning-layout-item>
                                    </template>

                                    <lightning-layout-item padding="horizontal-small" size="12" if:true={fields.campaign}>
                                        <lightning-input-field field-name={fields.campaign.apiName}>
                                        </lightning-input-field>
                                    </lightning-layout-item>
                                </lightning-layout>

                            <template if:true={hasCustomFields}>

                                        {customLabels.customFieldsSectionHeader}

                                        <c-rd2-entry-form-custom-fields-section record-id={recordId} fields={customFields}
                                            data-id="customFieldsComponent"></c-rd2-entry-form-custom-fields-section>

                            </template>

                        <lightning-button label={customLabels.cancelButtonLabel} title={customLabels.cancelButtonLabel}
                            variant="neutral" class="slds-m-right_small" onclick={handleCancel} disabled={isLoading}>
                        </lightning-button>
                        <lightning-button label={customLabels.saveButtonLabel} title={customLabels.saveButtonLabel}
                            variant="brand" onclick={handleSubmit} onkeydown={handleSaveButtonTrapFocus} data-id="submitButton" disabled={isSaveButtonDisabled}>
                        </lightning-button>

            </lightning-record-edit-form>

</template>


text:
var assert = require('chai').assert;
var sinon = require('sinon');
var carty = typeof window !== 'undefined' ? window.carty : require('../lib/carty');

describe("carty().update()", function() {
    var cart;

    beforeEach(function() {
        cart = carty({
            storage: {
                load: function() { return [{id: 'Item'}]; },
                put: function (item, items) { },
                remove: function (item, items) { },
                clear: function () {}
            }
        });
    });

    it("updates an item", function(done) {
        cart
            .update({id: 'Item', price: 10})
            .ready(function(cart) {
                assert.deepEqual(cart.get({id: 'Item'}).price, 10);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("updates an item as string", function(done) {
        cart
            .update('Item')
            .ready(function(cart) {
                assert.isTrue(cart.has({id: 'Item'}));
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("updates an item as item()", function(done) {
        cart
            .update(cart.item({id: 'Item', price: 10}))
            .ready(function(cart) {
                assert.deepEqual(cart.get({id: 'Item'}).price, 10);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("does nothing if item does not exist", function(done) {
        carty()
            .update({id: 'Item2'})
            .ready(function(cart) {
                assert.isFalse(cart.has({id: 'Item'}));
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("sets quantity for existing item", function(done) {
        cart
            .update({id: 'Item', quantity: 2})
            .ready(function(cart) {
                assert.strictEqual(cart.get('Item').quantity, 2);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("sets quantity for mixed item type", function(done) {
        cart
            .update({id: 'Item', quantity: 2})
            .ready(function(cart) {
                assert.strictEqual(cart.get('Item').quantity, 2);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("updates item attributes", function(done) {
        cart
            .update({id: 'Item', price: 5, foo: 'bar', bar: 'baz'})
            .ready(function(cart) {
                assert.strictEqual(cart.get('Item').price, 5);
                assert.strictEqual(cart.get('Item').foo, 'bar');
                assert.strictEqual(cart.get('Item').bar, 'baz');
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("updates custom item attributes", function(done) {
        cart
            .update({id: 'Item', custom: 'foo'})
            .update({id: 'Item', custom: 'bar'})
            .ready(function(cart) {
                assert.strictEqual(cart.get('Item').custom, 'bar');
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("removes existing item if quantity lower 0", function(done) {
        cart
            .ready(function(cart) {
                assert.strictEqual(cart.size(), 1);
            })
            .update({id: 'Item', quantity: 0})
            .ready(function(cart) {
                assert.strictEqual(cart.size(), 0);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("emits update event", function(done) {
        var spy = sinon.spy();

        cart.on('update', spy);

        cart
            .update('Item')
            .ready(function() {
                assert.isTrue(spy.called);
                assert.strictEqual(spy.args[0][0], 'Item');
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("aborts if update event listener returns false", function(done) {
        cart.on('update', function() {
            return false;
        });

        cart
            .update({id: 'Item', quantity: 2})
            .ready(function(cart) {
                assert.strictEqual(cart.get('Item').quantity, 1);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("emits updated event", function(done) {
        var spy = sinon.spy();

        cart.on('updated', spy);

        cart
            .update('Item')
            .ready(function() {
                assert.isTrue(spy.called);
                assert.deepEqual(spy.args[0][0], {
                    id: 'Item',
                    label: "Item",
                    price: 0,
                    quantity: 1,
                    variant: {}
                });
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("emits updatefailed event", function(done) {
        cart = carty({
            storage: {
                load: function() { return [{id: 'Item'}]; },
                put: function() { return Promise.reject('error'); }
            }
        });

        var spy = sinon.spy();

        cart.on('updatefailed', spy);

        cart
            .update('Item')
            .error(function() {
                assert.strictEqual(spy.args[0][0], 'error');
                assert.deepEqual(spy.args[0][1], {
                    id: 'Item',
                    label: "Item",
                    price: 0,
                    quantity: 1,
                    variant: {}
                });
            })
            .ready(function() {
                assert.isTrue(spy.called);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("emits change event", function(done) {
        var spy = sinon.spy();

        cart.on('change', spy);

        cart
            .update('Item')
            .ready(function() {
                assert.isTrue(spy.called);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("emits changed event", function(done) {
        var spy = sinon.spy();

        cart.on('changed', spy);

        cart
            .update('Item')
            .ready(function() {
                assert.isTrue(spy.called);
            })
            .ready(function() {
                done();
            })
        ;
    });

    it("emits changefailed event", function(done) {
        cart = carty({
            storage: {
                load: function() { return [{id: 'Item'}]; },
                put: function() { return Promise.reject('error'); }
            }
        });

        var spy = sinon.spy();

        cart.on('changefailed', spy);

        cart
            .update('Item')
            .error(function() {}) // Catch the rejection from storage.put()
            .ready(function() {
                assert.isTrue(spy.called);
            })
            .ready(function() {
                done();
            })
        ;
    });
});


text:
// Author: Prasanna V. Loganathar
// Created: 9:26 AM 20-01-2015
// Project: RedScooby
// License: http://www.apache.org/licenses/LICENSE-2.0

using System;
using Windows.UI.Xaml.Data;

namespace RedScooby.Converters
{
    public class NegationConverter : IValueConverter
    {
        public NegationConverter() { }

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var type = value.GetType();
            if (type == typeof (int))
            {
                var res = (int) value;
                return -res;
            }
            else if (type == typeof (double))
            {
                var res = (double) value;
                return -res;
            }
            else if (type == typeof (long))
            {
                var res = (long) value;
                return -res;
            }
            else
            {
                throw new InvalidOperationException("Unsupported type");
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            return Convert(value, targetType, parameter, language);
        }
    }
}


text:
Returns whether the current stream supports writing.

```csharp
public override bool CanWrite { get; }
```

## Property Value

True if the stream supports writing; otherwise, false.

## See Also

* class [ZeroStream](../ZeroStream.md)
* namespace [Faithlife.Utility](../../Faithlife.Utility.md)

<!-- DO NOT EDIT: generated by xmldocmd for Faithlife.Utility.dll -->


text:
<?php

namespace ActivismeBe\Console\Utils;

use Dotenv\Dotenv;
use Github\Client;
use Symfony\Component\Config\Definition\Exception\Exception;

trait Github
{
    /**
     * Authencate the used on github for a request.
     *
     * @return mixed
     */
    public function user()
    {
        $env = new Dotenv(__DIR__ .'/../../');
        $env->load();

        $github = new Client();
        $github->authenticate(getenv('GITHUB_USER'), getenv('GITHUB_PASS'), Client::AUTH_HTTP_PASSWORD);

        return $github;
    }

    /**
     * Push a new file towards GitHub
     *
     * @param  string  $author
     * @param  string  $repo
     * @param  string  $path
     * @param  string  $content
     * @param  string  $commitMessage
     * @param  string  $branch
     * @param  array   $commiter
     * @return bool
     */
    public function createFileGit($author, $repo, $path, $content, $commitMessage, $branch, $commiter)
    {
        $gitFile  = $this->user()->api('repo')->contents();

        if ($gitFile->create($author, $repo, $path, $content, $commitMessage, $branch, $commiter)) {
            return true;
        } else {
            return false;
        }
    }
}


text:
define(["jquery"], function($) {
	"use strict";
	return {
		getData: function() {
			return $.get("https://api.github.com/users/dribba/repos");
		}
	};
});


text:
"""Create / interact with Google Cloud Translate connections."""

from google.cloud import _http

class Connection(_http.JSONConnection):
    """A connection to Google Cloud Translate via the JSON REST API."""

    API_BASE_URL = 'https://translation.googleapis.com'
    """The base of the API call URL."""

    API_VERSION = 'v2'
    """The version of the API, used in building the API call's URL."""

    API_URL_TEMPLATE = '{api_base_url}/language/translate/{api_version}{path}'
    """A template for the URL of a particular API call."""

    SCOPE = ('https://www.googleapis.com/auth/cloud-platform',)
    """The scopes required for authenticating."""


text:
package sum

import "github.com/catorpilor/leetcode/utils"

func pathSum(root *utils.TreeNode) int {
	return useBackTracking(root)
}

// useBackTracking time compelxity O(N), space complexity O(log(N))
func useBackTracking(root *utils.TreeNode) int {
	var ans int
	helper(root, &ans, []int{})
	return ans
}

func helper(root *utils.TreeNode, ans *int, path []int) {
	if root == nil {
		return
	}
	np := len(path)
	path = append(path, root.Val)
	if root.Left == nil && root.Right == nil {
		// it's a leaf node
		*ans += genNum(path)
		path = path[:np]
		return
	}
	helper(root.Left, ans, path)
	helper(root.Right, ans, path)
}

func genNum(nums []int) int {
	var ans int
	n := len(nums)
	for i := 0; i < n; i++ {
		ans += nums[i] * (1 << (n - 1 - i))
	}
	return ans
}

// useDfs time complexity O(N) space complexity O(log(N))
func useDfs(root *utils.TreeNode) int {
	return dfs(root, 0)
}

func dfs(root *utils.TreeNode, val int) int {
	if root == nil {
		return 0
	}
	val = val*2 + root.Val
	if root.Left == nil && root.Right == nil {
		return val
	}
	return dfs(root.Left, val) + dfs(root.Right, val)
}


text:
require_relative 'marketcloud/address'
require_relative 'marketcloud/application'
require_relative 'marketcloud/authentication'
require_relative 'marketcloud/braintree'
require_relative 'marketcloud/brand'
require_relative 'marketcloud/cart'
require_relative 'marketcloud/category'
require_relative 'marketcloud/collection'
require_relative 'marketcloud/configuration'
require_relative 'marketcloud/coupon'
require_relative 'marketcloud/file'
require_relative 'marketcloud/handle_errors'
require_relative 'marketcloud/order'
require_relative 'marketcloud/payment'
require_relative 'marketcloud/payment_method'
require_relative 'marketcloud/product'
require_relative 'marketcloud/promotion'
require_relative 'marketcloud/request'
require_relative 'marketcloud/shipping'
require_relative 'marketcloud/user'
require_relative 'marketcloud/variant'
require 'logger'

API_URL = "http://api.marketcloud.it/v0"

module Marketcloud
  class NotFound < StandardError; end
  class BadRequest < StandardError; end
  class Anauthorized < StandardError; end
  class InternalServerError < StandardError; end
  class ExistingUserError < StandardError; end
  class BraintreeProcessorDeclinedError < StandardError; end
  class AddressNotFound < StandardError; end

  class << self
    attr_accessor :configuration
    attr_writer :logger

    def logger
      @logger ||= Logger.new($stdout).tap do |log|
        log.progname = self.name
      end
    end
  end

  def self.configuration
    @configuration ||= Marketcloud::Configuration.new
  end

  def self.configure
    yield(configuration)
  end
end


text:
package org.apache.flink.streaming.runtime.io;

import org.apache.flink.annotation.Internal;
import org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent;

import java.io.IOException;
import java.util.Optional;

/**
 * The {@link BufferStorage} takes the buffers and events from a data stream and adds them in a sequence.
 * After a number of elements have been added, the {@link BufferStorage} can {@link #rollOver() "roll over"}.
 * After rolling over, previously stored buffers are available for reading via {@link #pollNext()}.
 */
@Internal
public interface BufferStorage extends AutoCloseable {

	/**
	 * Adds a buffer or event to the {@link BufferStorage}.
	 *
	 * @param boe The buffer or event to be added into the blocker.
	 */
	void add(BufferOrEvent boe) throws IOException;

	/**
	 * @return true if size limit was exceeded.
	 */
	boolean isFull();

	/**
	 * Start returning next sequence of stored {@link BufferOrEvent}s.
	 */
	void rollOver() throws IOException;

	/**
	 * @return the number of pending bytes blocked in the current sequence - bytes that are have not
	 * been yet rolled, but are already blocked.
	 */
	long getPendingBytes();

	/**
	 * @return the number of already rolled bytes in in blocked sequences.
	 */
	long getRolledBytes();

	/**
	 * @return true if this {@link BufferStorage} doesn't store and data.
	 */
	boolean isEmpty();

	Optional<BufferOrEvent> pollNext() throws IOException;

	long getMaxBufferedBytes();

	/**
	 * Cleans up all the resources in the current sequence.
	 */
	@Override
	void close() throws IOException;
}


text:
using System;
using System.Net;
using System.Threading.Tasks;
using System.Net.Http;
using Microsoft.Azure.WebJobs.Host;
using System.Linq;

namespace PreCompiledFunctionSample
{
    public class FunctionTrigger
    {
        public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
        {
            log.Info($"PreCompiledFunctionSample. C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");

            // parse query parameter
            var name = req.GetQueryNameValuePairs()
                .FirstOrDefault(q => string.Compare(q.Key, "name", StringComparison.OrdinalIgnoreCase) == 0)
                .Value;

            // Get request body
            dynamic data = await req.Content.ReadAsAsync<object>();

            // Set name to query string or body data
            name = name ?? data?.name;

            log.Info("Hello world");
            return name == null
                ? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body")
                : req.CreateResponse(HttpStatusCode.OK, "good day!! " + name);
        }
    }
}


text:
package org.codenergic.eventbus;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import io.vertx.core.eventbus.DeliveryOptions;

import static org.assertj.core.api.Assertions.assertThat;

public class SendMessageTest {
	private static EventBus eventBus;

	@AfterClass
	public static void after() {
		eventBus.close();
		TestHelper.stopServer();
	}

	@BeforeClass
	public static void beforeClass() throws Exception {
		eventBus = EventBus.newInstance(TestHelper.startServer()).openSync();
		io.vertx.core.eventbus.EventBus eb = TestHelper.vertx.eventBus();
		eb.consumer("test-address", event -> {
			event.reply(event.address() + "-" + event.body(), new DeliveryOptions().setHeaders(event.headers()));
			eb.send("test-address-reply", event.address() + "-" + event.body(), new DeliveryOptions().setHeaders(event.headers()));
			eb.publish("test-address-publish-reply", event.address() + "-" + event.body(), new DeliveryOptions().setHeaders(event.headers()));
		});
	}

	@Test
	public void testPublishAndSubscribe() throws InterruptedException {
		CountDownLatch latch = new CountDownLatch(2);
		List<Message> messages = new ArrayList<>();

		String body = UUID.randomUUID().toString();
		Map<String, Object> headers = Collections.singletonMap("token", "123");

		Consumer<Message> messageHandler = message -> {
			messages.add(message);
			latch.countDown();
		};

		eventBus.registerHandler("test-address-publish-reply", messageHandler);
		eventBus.registerHandler("test-address-publish-reply", messageHandler);

		eventBus.publish("test-address", body, headers);

		boolean completed = latch.await(5, TimeUnit.SECONDS);
		assertThat(completed).isTrue();

		assertThat(messages).hasSize(2);
		messages.forEach(message -> {
			assertThat(message).isNotNull();
			assertThat(message.getBody()).isEqualTo("test-address-" + body);
			assertThat(message.getHeaders()).isEqualTo(headers);
		});
	}

	@Test
	public void testSendAndSubscribe() throws InterruptedException {
		CountDownLatch latch = new CountDownLatch(2);
		List<Message> messages = new ArrayList<>();

		String body = UUID.randomUUID().toString();
		Map<String, Object> headers = Collections.singletonMap("token", "123");

		eventBus.registerHandler("test-address-reply", message -> {
			messages.add(message);
			latch.countDown();
		});

		eventBus.send("test-address", body, headers);
		eventBus.send("test-address", body);

		boolean completed = latch.await(5, TimeUnit.SECONDS);
		assertThat(completed).isTrue();

		assertThat(messages).hasSize(2);
		assertThat(messages.get(0).getHeaders()).isEqualTo(headers);
		assertThat(messages.get(1).getHeaders()).isNull();
		messages.forEach(message -> {
			assertThat(message).isNotNull();
			assertThat(message.getBody()).isEqualTo("test-address-" + body);
		});
	}

	@Test
	public void testSendMessageWithReply() throws InterruptedException {
		List<String> messageBodies = IntStream.rangeClosed(0, 20)
				.mapToObj(i -> UUID.randomUUID().toString())
				.collect(Collectors.toList());

		CountDownLatch latch = new CountDownLatch(messageBodies.size());
		List<String> messages = new ArrayList<>();

		messageBodies.forEach(body -> {
			eventBus.send("test-address", body, null, message -> {
				messages.add(message.getBody());
				latch.countDown();
			});
		});

		boolean sent = latch.await(5, TimeUnit.SECONDS);
		assertThat(sent).isTrue();
		assertThat(messages.size()).isEqualTo(messageBodies.size());

		messageBodies.forEach(message -> {
			String expectedBody = "test-address-" + message;
			assertThat(messages).contains(expectedBody);
			messages.remove(expectedBody);
		});

		assertThat(messages).isEmpty();
	}

	@Test
	public void testSubscribeAndThrowError() throws InterruptedException {
		CountDownLatch latch = new CountDownLatch(4);
		List<Message> messages = new ArrayList<>();
		List<Throwable> throwables = new ArrayList<>();

		String body = UUID.randomUUID().toString();
		eventBus.send("test-address", body, null, message -> {
			messages.add(message);
			latch.countDown();
			throw new IllegalStateException();
		}, (message, throwable) -> {
			latch.countDown();
			throwables.add(throwable);
		});

		eventBus.registerHandler("test-address-reply", message -> {
			messages.add(message);
			latch.countDown();
			throw new IllegalStateException();
		}, ((message, throwable) -> {
			latch.countDown();
			throwables.add(throwable);
		}));
		eventBus.send("test-address", body);

		assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue();

		assertThat(messages).hasSize(2);
		messages.forEach(message -> assertThat(message.getBody()).isEqualTo("test-address-" + body));

		assertThat(throwables).hasSize(2);
		throwables.forEach(throwable -> assertThat(throwable).isInstanceOf(IllegalStateException.class));
	}

	@Test
	public void testSubscribeAndUnsubscribe() throws InterruptedException {
		final CountDownLatch latch = new CountDownLatch(2);
		List<String> messages = new ArrayList<>();

		Consumer<Message> messageHandler = message -> {
			messages.add(message.getBody());
			latch.countDown();
		};
		eventBus.registerHandler("test-address-publish-reply", messageHandler);
		eventBus.publish("test-address", "testing");

		boolean sent = latch.await(2, TimeUnit.SECONDS);
		assertThat(sent).isFalse();

		eventBus.unregisterHandler("test-address-publish-reply", messageHandler);
		eventBus.publish("test-address", "testing");

		sent = latch.await(2, TimeUnit.SECONDS);
		assertThat(sent).isFalse();

		assertThat(messages).hasSize(1);
		assertThat(messages.iterator().next()).isEqualTo("test-address-testing");
	}
}


text:
FactoryGirl.define do
  factory :device_user do
    name 'Test User 1'
    username 'testuser1'
    password 'Password1'
    password_confirmation 'Password1'
    active true
  end
end


text:
namespace XCommand
{
    /// <summary>
    /// Enum defining the mode the user command manager can be.
    /// </summary>
    public enum UserCommandManagerMode
    {
        /// <summary>
        /// Mode configuring the service to be used with the classic undo/redo mode.
        /// Default mode.
        /// </summary>
        User,

        /// <summary>
        /// Mode configuring the service to be used in an auto test context.
        /// All the commands are regsitered in order to be replayed in an auto test session.
        /// </summary>
        AutoTest
    }
}


text:
const GITHUB_BASE_URL = 'https://api.github.com';
const GITHUB_TOKEN_KEY = 'github_token';

//models

class GitHubRepo {
  constructor(gitHubAPI, data){
    this._api = gitHubAPI;
    Object.assign(this, data);
  }

  loadRecentCommits(){
    return this._api.get(`${GITHUB_BASE_URL}/repos/${this.owner.login}/${this.name}/commits`)
      .then(commits => this.commits = commits);
  }

}

class GitHubOrg {
  constructor(gitHubAPI, data){
    this._api = gitHubAPI;
    Object.assign(this,data);
  }

  loadRepos(){
    if(!this._loadRepos){
      this._loadRepos = this._api.getAll(this.repos_url)
        .then(repos => repos.map(repo => new GitHubRepo(this._api, repo)))
        .then(repos => this.addRepos(repos));
    }
    return this._loadRepos;
  }

  getRepo(repoName){
    return this.loadRepos()
      .then((repos) => repos.filter((repo) => repo.name === repoName).pop())
  }

  addRepos(repos){
    this.repos = repos;
    return repos;
  }

}

//api consumer singleton, wrap's angular's $http for the github API
export class GitHubAPI {

  constructor($http,$q){
    this._http = $http;
    this._q = $q;
    this._authToken = undefined;
  }

  setAuthToken(token){
    this._access_token = token;
    return token;
  }

  get(url, params = {}){
    params.access_token = this._access_token;
    return this._http.get(url,{params})
      .then((res) => this._parseResponse(res));
  }

  getAll(url, params = {}, all = []){
    params.access_token = this._access_token;
    params.page = params.page || 1;
    return this.get(url,params).then(results => {
      if(!results.length){
        return all;
      }
      params.page++;
      return this.getAll(url, params, all.concat(results));
    });
  }

  _parseResponse(res){
    return res.data;
  }
}

GitHubAPI.$inject = ['$http','$q'];

//singleton user service representing the logged in user
export class GitHubUser {

  constructor(gitHubAPI, tokenStore, $location){
    this._api = gitHubAPI;
    this._tokenStore = tokenStore;
    this._$location = $location;
    this._userData = undefined;
    this._userOrgs = undefined;
  }

  authenticate(){
    return this._getToken()
      .then(() => this.getUser());
  }

  getUser(){
    if(!this._loadUserData){
      this._loadUserData = this._api.get(`${GITHUB_BASE_URL}/user`)
        .then((user) => this._userData = user);
    }
    return this._loadUserData;
  }

  getOrgs(){
    if(!this._loadUserOrgs){
      this._loadUserOrgs = this._api.get(`${GITHUB_BASE_URL}/user/orgs`)
        .then((userOrgs) => this._userOrgs = userOrgs);
    }
    return this._loadUserOrgs;
  }

  parseURLToken(){
    return this._$location.search()[GITHUB_TOKEN_KEY];
  }

  _getToken(){
      //check if we have one in the URL from the server
      let urlToken = this.parseURLToken()
      if(urlToken){
        //clear url
        this._$location.search({})
        return this._tokenStore.setToken(urlToken)
          .then((token) => this._api.setAuthToken(token));
      }
      //otherwise check storage (and reject if not found)
      return this._tokenStore.getToken()
        .then((token) => this._api.setAuthToken(token));
  }
}

GitHubUser.$inject = ['GitHubAPI','TokenStore','$location']

//singleton GitHub core services
export class GitHub {
  constructor(gitHubAPI,gitHubUser,$q){
    this._api = gitHubAPI;
    this._user = gitHubUser;
    this._orgs = [];
    this._q = $q;
  }

  get orgs(){
    return this._orgs;
  }

  checkAuthenticated(){
    return this._user.authenticate();
  }

  getUserOrgs(params){
    return this._user.getOrgs()
      .then(orgs => orgs.map((org) => new GitHubOrg(this._api, org)))
      .then((orgs) => this._orgs = orgs);
  }

  getOrg(orgLogin){
    let org = this._orgs.filter((org) => org.login === orgLogin).pop();
    if(org){
      return this._q.when(org);
    }
    return this._api.get(`${GITHUB_BASE_URL}/orgs/${orgLogin}`)
      .then((org) => new GitHubOrg(this._api, org))
      .then((org) => {
        this._orgs.push(org);
        return org;
      });
  }

  addOrg(org){
    return this.getOrg(org.login)
  }

}

GitHub.$inject = ['GitHubAPI','GitHubUser','$q'];


text:
var exec = require('cordova/exec');
var platformId = require('cordova/platform').id;

module.exports = {

    /**
     * Call the native dialer
     *
     * @param {String, Function}      The phone number to call, The callback error function
     */
    dial: function(phnum, error) {
        if (phnum == null)
            error("empty");
        if (platformId == 'ios') {
            exec(null, function(err) {
                error(err);
            }, "PhoneDialer", "dial", [phnum]);
        } else {
            document.location.href = "tel:" + phnum
        }
    },
};


text:
 <input type="text"  size="30" bind="filterInput" />

'


text:
require_relative "fixtures"

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.include Fixtures

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'
end

require_relative "../lib/extra_doilies"


text:
import { push } from 'react-router-redux';
import { setRoomName } from 'containers/App/actions';

export default dispatch => ({
  goToHome: () => dispatch(push('/')),
  onSubmit: name => dispatch(setRoomName(name)),
});


text:
(function() {
	"use strict";
	var Composer = this.Composer;
	var global = this;

	/**
	 * Collections hold lists of models and contain various helper functions for
	 * finding and selecting subsets of model data. They are basically a wrapper
	 * around an array, thats function is dealing with large amounts of model data.
	 *
	 * Collections can also sync with the server like models. They tie into model
	 * events in such a way that if a model's data changes, the collection will be
	 * notified, and anybody listinging to the collection (ie, a controller) can
	 * react to that event (re-display the view, for instance).
	 */
	var Collection = Composer.Base.extend({
		/**
		 * Track this object's type. Useful for debugging, mainly
		 */
		__composer_type: 'collection',

		// the TYPE of model in this collection
		model: Composer.Model,

		// "private" array holding all the models in this collection
		_models: [],

		// model.id/cid -> model hashes for fast id lookups
		_id_idx: {},
		_cid_idx: {},

		// function used for sorting. override to sort on a criteria besides order of
		// addition to collection
		sortfn: null,

		// the base url for this collection. if you update a model, the default url
		// sent to the sync function would be PUT /[collection url]/[model id].
		url: '/mycollection',

		// when a model belongs to many collections, it will generate its url from the
		// collection having the highest priority. if all have the same priority, then
		// the first collection from the list will have its url used for the model's
		// sync operation.
		priority: 1,

		/**
		 * allow the passing in of an array of data to instantiate a collection with a
		 * pre-set number of models. models will be created via this.model.
		 */
		initialize: function(models, params, options) {
			params || (params = {});
			for(var x in params) {
				this[x] = params[x];
			}

			// call Base.initialize
			this.parent();

			// allow Collection.model to be a string so load-order dependencies can be
			// kept to a minimum. here, we convert the string to an object on collection
			// instantiation and store it back into Collection.model.
			//
			// NOTE: this happens before the initial reset =]
			this.model = typeof(this.model) == 'string' ? global[this.model] : this.model;

			if(models) {
				this.reset(models, options);
			}

			this.init();
		},

		/**
		 * override me
		 */
		init: function() {},

		/**
		 * for each model in this collection, get its raw data, then return all of the
		 * raw data in an array
		 */
		toJSON: function() {
			return this.models().map( function(model) { return model.toJSON(); } );
		},

		/**
		 * wrapper to get the models under this collection for direct selection (often
		 * via MooTools' array helper/selection functions)
		 */
		models: function() {
			return this._models;
		},

		/**
		 * get the number of models in the collection
		 */
		size: function() {
			return this.models().length;
		},

		/**
		 * add a model to this collection, and hook up the correct wire in doing so
		 * (events and setting the model's collection).
		 */
		add: function(data, options) {
			if(Composer.array.is(data)) {
				return data.forEach(function(model) { this.add(model, options); }.bind(this));
			}

			options || (options = {});

			// if we are passing raw data, create a new model from data
			var model = data instanceof Composer.Model ? data : new this.model(data, options);

			// reference this collection to the model
			if(model.collections.indexOf(this) == -1) {
				model.collections.push(this);
				options.is_new = true;
			}

			if(this.sortfn) {
				// if we have a sorting function, get the index the model should exist at
				// and add it to that position
				var index = options.at ? parseInt(options.at) : this.sort_index(model, options);
				this._models.splice(index, 0, model);
			} else {
				if (typeof(options.at) == 'number') {
					this._models.splice(options.at, 0, model);
				} else {
					this._models.push(model);
				}
			}

			// listen to the model's events so we can propogate them
			model.bind('all', this._model_event.bind(this, model), 'collection:'+this.cid()+':listen:model:all');

			// index the model (if we have a real id)
			this._index_model(model);

			this.fire_event('add', options, model, this, options);

			return model;
		},

		/**
		 * remove a model(s) from the collection, unhooking all necessary wires (events, etc)
		 */
		remove: function(model, options) {
			if(Composer.array.is(model)) {
				return model.slice(0).forEach(function(m) { this.remove(m, options); }.bind(this));
			}
			if(!model) return;

			options || (options = {});

			// remove this collection's reference(s) from the model
			Composer.array.erase(model.collections, this);

			// save to trigger change event if needed
			var num_rec = this._models.length;

			// remove the model
			Composer.array.erase(this._models, model);

			// remove the model from the collection
			this._remove_reference(model);

			// if the number actually change, trigger our change event
			if(this._models.length != num_rec) {
				this.fire_event('remove', options, model);
			}
		},

		/**
		 * given a model, check if its ID is already in this collection. if so,
		 * replace is with the given model, otherwise add the model to the collection.
		 */
		upsert: function(data, options) {
			if(Composer.array.is(data)) {
				return data.forEach(function(model) { this.upsert(model, options); }.bind(this));
			}

			options || (options = {});

			// if we are passing raw data, create a new model from data
			var model = data instanceof Composer.Model ? data : new this.model(data, options);

			var existing = this.get(model.id(), options);
			if(existing) {
				// reposition the model if necessary
				var existing_idx = this.index_of(existing);
				if(typeof(options.at) == 'number' && existing_idx != options.at) {
					this._models.splice(existing_idx, 1);
					this._models.splice(options.at, 0, existing);
					this.fire_event('sort', options);
				}

				// replace the data in the existing model with the new model's
				existing.set(model.toJSON(), Composer.object.merge({}, {silent: true, upsert: true}, options));
				this.fire_event('upsert', options, existing, options);

				return existing;
			}

			// model is not in this collection, add it
			this.add(model, options);
			return model;
		},

		/**
		 * remove all the models from the collection
		 */
		clear: function(options) {
			options || (options = {});

			// save to trigger change event if needed
			var num_rec = this._models.length;

			if(num_rec == 0) return;

			this.remove(this._models, options);
			this._models = [];

			// if the number actually change, trigger our change event
			if(this._models.length != num_rec) {
				this.fire_event('clear', options, options);
			}
		},

		/**
		 * reset the collection with all new data. it can also be appended to the
		 * current set of models if specified in the options (via "append").
		 */
		reset: function(data, options) {
			options || (options = {});

			if(!options.append && !options.upsert) this.clear(options);
			if(options.upsert) {
				if(!options.append) {
					// before we upsert, figure out which items are in the
					// collection that are missing from the reset data. this allows
					// us to remove those items (basically a patch: remove the
					// missing, add the new, and update the existing)
					var data_id_map = {}
					var id_key = (new this.model()).id_key;
					data.forEach(function(item) {
						if(item instanceof Composer.Model) {
							var id = item.id();
						} else {
							var id = item[id_key];
						}
						data_id_map[id] = true;
					});
					var missing = [];
					this.each(function(m) {
						var mid = m.id();
						if(!data_id_map[mid]) missing.push(mid);
					});
					var remove_list = missing.map(function(mid) { return this.get(mid); }.bind(this));
					this.remove(remove_list);
				}
				this.upsert(data, options);
			} else {
				this.add(data, options);
			}

			this.fire_event('reset', options, options);
		},

		/**
		 * reset the collection with all new data. it does this asynchronously
		 * for each item in the data array passed. this is good for setting
		 * large amounts of data into a collection whose models may do heavy
		 * processing. this way, the browser is able to process other events (ie
		 * not freeze) while adding the models to the collection.
		 *
		 * data can be appended by setting the {append: true} flag in the
		 * options.
		 *
		 * when ALL models have been added, this function calls the
		 * options.complete callback.
		 */
		reset_async: function(data, options) {
			options || (options = {});

			if(data == undefined) return options.complete && options.complete();
			if(!Composer.array.is(data)) data = [data];

			data = data.slice(0);

			if(!options.append && !options.upsert) this.clear();
			if(data.length > 0) {
				var batch = options.batch || 1;
				var slice = data.splice(0, batch);
				if(options.upsert) {
					this.upsert(slice, options);
				} else {
					this.add(slice, options);
				}
			}
			if(data.length == 0) {
				this.fire_event('reset', options, options);
				if(options.complete) options.complete()
				return;
			}
			setTimeout(function() {
				this.reset_async(data, Composer.object.merge({append: true}, options));
			}.bind(this), 0);
		},

		/**
		 * not normally necessary to call this, unless collection.sortfn changes after
		 * instantiation of the data. sort order is normall maintained upon adding of
		 * data viw Collection.add().
		 *
		 * However, since the sorting criteria for the models can be modified manually
		 * and it's not always desired to sort automatically, you can call this method
		 * to re-sort the data in the collection via the bubble-up eventing:
		 *
		 * mycollection.bind('change:sort_order', mycollection.sort.bind(mycollection))
		 */
		sort: function(options) {
			if(!this.sortfn) return false;

			this._models.sort(this.sortfn);
			this.fire_event('reset', options, options);
		},

		/**
		 * given the current sort function and a model passecd in, determine the
		 * index the model should exist at in the collection's model list.
		 */
		sort_index: function(model, options) {
			options || (options = {});
			if(this._models.length == 0) return 0;

			if(!this.sortfn) {
				var idx = this.index_of(model);
				if(idx === false || idx < 0) return this.size();
				return idx;
			}

			var sorted = this._models;
			if(options.accurate_sort) sorted = sorted.slice(0).sort(this.sortfn);

			for(var i = 0; i < sorted.length; i++) {
				if(model == sorted[i]) return i;
				if(this.sortfn(sorted[i], model) > 0) return i;
			}
			var index = sorted.indexOf(model);
			if(index == sorted.length - 1) return index;
			return sorted.length;
		},

		/**
		 * overridable function called when the collection is synced with the server
		 */
		parse: function(data) {
			return data;
		},

		/**
		 * convenience function to loop over collection's models
		 */
		each: function(cb, bind) {
			bind || (bind = this);
			this.models().forEach(cb.bind(bind));
		},

		/**
		 * convenience function to execute a function on a collection's models
		 */
		map: function(cb, bind) {
			bind || (bind = this);
			return this.models().map(cb.bind(bind));
		},

		/**
		 * Find the first model that satisfies the callback. An optional sort function
		 * can be passed in to order the results of the find, which uses the usual
		 * fn(a,b){return (-1|0|1);} syntax.
		 */
		find: function(callback, sortfn) {
			var models = this.models();
			if(sortfn) models = models.slice(0).sort(sortfn);

			for(var i = 0; i < models.length; i++) {
				var rec = models[i];
				if(callback(rec)) {
					return rec;
				}
			}
			return false;
		},

		/**
		 * given a callback, returns whether or not at least one of the models
		 * satisfies that callback.
		 */
		exists: function(callback) {
			for(var i = 0; i < this.size(); i++) {
				if(callback(this.models()[i])) return true;
			}
			return false;
		},

		/**
		 * convenience function to find a model by id
		 */
		get: function(id, options) {
			options || (options = {});
			var model = this._id_idx[id];
			if(options.fast) return model || false;
			return model || this.find(function(model) {
				if(model.id(options.strict) == id) {
					return true;
				}
				if(options.allow_cid && model.cid() == id) {
					return true;
				}
			});
		},

		/**
		 * convenience function to find a model by cid
		 */
		find_by_cid: function(cid, options) {
			options || (options = {});
			var model = this._cid_idx[cid];
			if(options.fast) return model || false;
			return model || this.find(function(model) {
				if(model.cid() == cid) {
					return true;
				}
			});
		},

		/**
		 * DEPRECATED. use get()
		 */
		find_by_id: function(_) { return this.get.apply(this, arguments); },

		/**
		 * get the index of an item in the list of models. useful for sorting items.
		 */
		index_of: function(model_or_id) {
			var id = model_or_id.__composer_type == 'model' ? model_or_id.id() : model_or_id;
			for(var i = 0; i < this._models.length; i++) {
				if(this._models[i].id() == id) {
					return i;
				}
			}
			return false;
		},

		/**
		 * Filter this collection's models by the given callback. Works just
		 * like Array.filter in JS.
		 */
		filter: function(callback, bind) {
			bind || (bind = this);
			return this._models.filter(callback.bind(bind));
		},

		/**
		 * query the models in the collection with a callback and return ALL that
		 * match. takes either a function OR a key-value object for matching:
		 *
		 * mycol.select(function(data) {
		 *		if(data.get('name') == 'andrew' && data.get('age') == 24) {
		 *			return true
		 *		}
		 * });
		 *
		 * is the same as:
		 *
		 * mycol.select({
		 *		name: andrew,
		 *		age: 24
		 * });
		 *
		 * in other words, it's a very simple version of MongoDB's selection syntax,
		 * but with a lot less functionality. the only selection is direct value
		 * matching. still nice, though.
		 */
		select: function(selector) {
			if(typeof(selector) == 'object') {
				var params = selector;
				var keys = Object.keys(params);
				selector = function(model) {
					for(var i = 0; i < keys.length; i++) {
						var key = keys[i];
						var compare = params[key];
						if(model.get(key) !== compare) return false;
					}
					return true;
				};
			}
			return this._models.filter(selector);
		},

		/**
		 *	Convenience functon to just select one model from a collection
		 */
		select_one: function(selector) {
			var result = this.select(selector);

			if(result.length) return result[0];

			return null;
		},

		/**
		 * return the first model in the collection. if n is specified, return the
		 * first n models.
		 */
		first: function(n) {
			var models = this.models();
			return (typeof(n) != 'undefined' && parseInt(n) != 0) ? models.slice(0, n) : models[0];
		},

		/**
		 * returns the last model in the collection. if n is specified, returns the
		 * last n models.
		 */
		last: function(n) {
			var models = this.models();
			return (typeof(n) != 'undefined' && parseInt(n) != 0) ? models.slice(models.length - n) : models[models.length - 1];
		},

		/**
		 * returns the model at the specified index. if there is no model there,
		 * return false
		 */
		at: function(n) {
			var model = this._models[n];
			return (model || false);
		},

		/**
		 * given the current sort function, find the model at the given position
		 */
		sort_at: function(n, options) {
			options || (options = {});
			if(!this.sortfn) return false;

			var sorted = this._models;
			if(options.accurate_sort) sorted = sorted.slice(0).sort(this.sortfn);
			return sorted[n];
		},

		/**
		 * sync the collection with the server.
		 */
		fetch: function(options) {
			options || (options = {});

			var success = options.success;
			options.success = function(res) {
				this.reset(this.parse(res), options);
				if(success) success(this, res);
			}.bind(this);
			options.error = Composer.wrap_error(options.error ? options.error.bind(this) : null, this, options).bind(this);
			return (this.sync || Composer.sync).call(this, 'read', this, options);
		},

		/**
		 * simple wrapper to get the collection's url
		 */
		get_url: function() {
			return this.url;
		},

		/**
		 * Index a model by its id/cid
		 */
		_index_model: function(model) {
			var id = model.id(true);
			if(id) {
				this._unindex_model(model);
				// index the new, and track the ids
				this._id_idx[id] = model;
				model._tracked_ids.push(id);
			}
			this._cid_idx[model.cid()] = model;
		},

		_unindex_model: function(model) {
			// unindex old ids
			if(!model._tracked_ids) model._tracked_ids = [];
			model._tracked_ids.forEach(function(id) {
				delete this._id_idx[id];
			}.bind(this));
			delete this._cid_idx[model.cid()];
		},

		/**
		 * remove all ties between this colleciton and a model
		 */
		_remove_reference: function(model) {
			// unindex the model
			this._unindex_model(model);

			// defref this collection from the model
			Composer.array.erase(model.collections, this);

			// don't listen to this model anymore
			model.unbind('all', 'collection:'+this.cid()+':listen:model:all');
		},

		/**
		 * bound to every model's "all" event, propagates or reacts to certain events.
		 */
		_model_event: function(model, ev, _) {
			// reindex the model if its id changed
			if(ev == 'change:'+ model.id_key) this._index_model(model);
			if(ev == 'destroy') this.remove(model, arguments[4]);

			// forward the event
			var args = Array.prototype.slice.call(arguments, 1);
			this.trigger.apply(this, args);
		}
	});
	Composer.exp0rt({ Collection: Collection });
}).apply((typeof exports != 'undefined') ? exports : this);


text:
using System.Collections.Generic;
using Free.FileFormats.VRML.Fields;
using Free.FileFormats.VRML.Interfaces;

namespace Free.FileFormats.VRML.Nodes
{
	/// <summary>
	/// The Polyline2D node specifies a set of vertices in the local 2D
	/// coordinate system at each of which is displayed a point.
	/// </summary>
	public class x3dPolypoint2D : X3DNode, X3DGeometryNode
	{
		public List<SFVec2f> Point { get; set; }

		public x3dPolypoint2D()
		{
			Point=new List<SFVec2f>();
		}

		internal override X3DPrototypeInstance GetProto() { return new x3dPolypoint2DPROTO(); }

		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="point") Point.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
			else return false;
			return true;
		}
	}
}


text:
package org.kuali.mobility.events.util;

import java.util.Comparator;

import org.kuali.mobility.events.entity.Event;

public class EventComparator implements Comparator<Event> {
	public int compare(final Event a, final Event b) {
		int flip;
		if (a.getStartDate() == null) {
			flip = 5;
		} else if (b.getStartDate() == null) {
			flip = 8;
		} else if ((a.getStartDate()).before(b.getStartDate())) {
			flip = -3;
		} else {
			flip = 2;
		}
		return flip;
	}
}


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

<title>Monitor (MDW 6 API JavaDocs)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

com.centurylink.mdw.annotations

Annotation Type Monitor

@Documented
 @Target(value=TYPE)
 @Retention(value=RUNTIME)
public @interface Monitor

Use monitor annotations to expose your activity, process, adapter, service or task monitors
 on the Configurator Monitoring tab in MDW Studio.  Enabled monitors will be notified at specified
 lifecycle stages.

Required Element Summary

Required Elements

Modifier and Type
Required Element and Description

java.lang.Class<? extends Monitor>
category

This represents the type of monitor to register.

java.lang.String
value

Value is the monitor label.

Optional Element Summary

Optional Elements

Modifier and Type
Optional Element and Description

boolean
defaultEnabled

Recommended practice is to leave this set to false, and then enable
 per activity in MDW Studio or MDWHub.

java.lang.String
defaultOptions

Default value for user-entered options for this monitor.

Element Detail

value

public abstract java.lang.String value

Value is the monitor label.

category

public abstract java.lang.Class<? extends Monitor> category

This represents the type of monitor to register.

defaultEnabled

public abstract boolean defaultEnabled

Recommended practice is to leave this set to false, and then enable
 per activity in MDW Studio or MDWHub.  This way only designated activities
 will trigger this monitor.  If defaultEnabled is set to true, this monitor
 is enabled unless explicitly deselected in MDW Studio/Hub.

Default:

false

defaultOptions

public abstract java.lang.String defaultOptions

Default value for user-entered options for this monitor.
 The value entered in MDW Studio/Hub is available as the forth column in the
 JSONArray value from attribute "monitors" in the runtimeContext.

Default:

""

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

Copyright © 2019 CenturyLink, Inc.


text:
<!DOCTYPE html>

        <title>SimpleWebRTC Demo</title>

Start a room

        <button id="screenShareButton"></button>

        <form id="createRoom">
            <input id="sessionInput"/>
            <button type="submit">Create it!</button>
        </form>
        <video id="localVideo" style="height: 150px;"></video>


text:
'use strict';

angular.module('jvAngularGame.version.version-directive', [])

.directive('appVersion', ['version', function(version) {
  return function(scope, elm, attrs) {
    elm.text(version);
  };
}]);


text:
@interface ManifestBrowserViewController () <NSBrowserDelegate>
@property (strong) IBOutlet NSButton *okButton;
@property (strong) IBOutlet NSBrowser *manifestsBrowser;
@property ManifestPreviewViewController *previewViewController;
@end

@implementation ManifestBrowserViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [[PFMManifestProvider sharedInstance] reloadManifests];
}

#pragma mark - Actions

- (IBAction)acceptCurrentSelection:(id)sender {
    id selectedItem = [self.manifestsBrowser itemAtIndexPath:self.manifestsBrowser.selectionIndexPath];

    if ([selectedItem isKindOfClass:[PFMPreferenceManifest class]]) {
        [self dismissController:self];
        self.originalOutlineViewController.preferenceManifest = selectedItem;
        [self.originalOutlineViewController manifestSelectionIsDone];
    }
}

- (IBAction)cancelSelection:(id)sender {
    [self dismissController:self];
    [self.originalOutlineViewController manifestSelectionCancelled];
}

#pragma mark - Toolbox

- (NSArray*)sortedArray:(NSArray*)arrayToSort {
    return [arrayToSort sortedArrayUsingSelector:@selector(compare:)];
}

- (NSDictionary*)manifestSource {
    if (self.useGlobalySharedManifests) {
        return [PFMManifestProvider sharedInstance].globalManifestsPerSourceAndName;
    } else {
        return [PFMManifestProvider sharedInstance].manifestsPerSourceAndDomain;
    }
}

- (NSString*)displayLabelForPreferenceManifest:(PFMPreferenceManifest*)preferenceManifest {
    if (self.useGlobalySharedManifests) {
        return preferenceManifest.pfm_title;
    } else {
        return preferenceManifest.pfm_title;
    }
}

#pragma mark - NSBrowserDelegate

-(id)rootItemForBrowser:(NSBrowser *)browser {
    return [self manifestSource];
}

- (NSInteger)browser:(NSBrowser *)browser numberOfChildrenOfItem:(NSDictionary*)item {
    return [[item allKeys] count];
}

- (id)browser:(NSBrowser *)browser child:(NSInteger)index ofItem:(NSDictionary*)item {
    return [item objectForKey:[[self sortedArray:[item allKeys]] objectAtIndex:index]];
}

- (BOOL)browser:(NSBrowser *)browser isLeafItem:(id)item {
    return [item isKindOfClass:[PFMPreferenceManifest class]];
}

- (id)browser:(NSBrowser *)browser objectValueForItem:(id)item {
    if ([item isKindOfClass:[PFMPreferenceManifest class]]) {
        return [self displayLabelForPreferenceManifest:(PFMPreferenceManifest*)item];
    } else {
        return [[[self manifestSource] allKeysForObject:item] lastObject];
    }
}

-(NSViewController *)browser:(NSBrowser *)browser previewViewControllerForLeafItem:(PFMPreferenceManifest*)item {
    if (!self.previewViewController) {
        self.previewViewController = [[ManifestPreviewViewController alloc] initWithNibName:@"ManifestPreviewViewController" bundle:[NSBundle bundleForClass:[self class]]];
    }
    self.previewViewController.manifest = item;
    return self.previewViewController;
}

- (CGFloat)browser:(NSBrowser *)browser shouldSizeColumn:(NSInteger)columnIndex forUserResize:(BOOL)forUserResize toWidth:(CGFloat)suggestedWidth  {
    if (!forUserResize) {
        id item = [browser parentForItemsInColumn:columnIndex];
        if ([self browser:browser isLeafItem:item]) {
            suggestedWidth = 250;
        }
    }
    return suggestedWidth;
}

- (NSIndexSet *)browser:(NSBrowser *)browser selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes inColumn:(NSInteger)column {
    NSIndexPath *indexPath = [browser indexPathForColumn:column];

    if ([proposedSelectionIndexes count] > 0) {
        indexPath = [indexPath indexPathByAddingIndex:[proposedSelectionIndexes lastIndex]];
    }

    id selectedItem = [browser itemAtIndexPath:indexPath];

    self.okButton.enabled = [selectedItem isKindOfClass:[PFMPreferenceManifest class]];
    return proposedSelectionIndexes;
}

@end


text:
/*global require, exports */

////////////////////////////////////////////////////////////////////////////////
/// @brief Foxx Sessions
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2013 triagens GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Jan Steemann, Lucas Dohmen
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////

var Foxx = require('org/arangodb/foxx'),
  crypto = require('org/arangodb/crypto');

// -----------------------------------------------------------------------------
// --SECTION--                                                  helper functions
// -----------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////////////
/// @brief decorates the controller with session logic
////////////////////////////////////////////////////////////////////////////////

function decorateController(auth, controller) {
  'use strict';
  var cfg = auth.configuration;

  controller.before('/*', function (req) {
    var sessions = auth.getSessionStorage();
    var sid;
    if (cfg.type === 'cookie') {
      sid = req.cookie(cfg.cookie.name, cfg.cookie.secret ? {
        signed: {
          secret: cfg.cookie.secret,
          algorithm: cfg.cookie.algorithm
        }
      } : undefined);
    } else if (cfg.type === 'header') {
      sid = req.headers[cfg.header.toLowerCase()];
    }
    if (sid) {
      if (cfg.jwt) {
        sid = crypto.jwtDecode(cfg.jwt.secret, sid, !cfg.jwt.verify);
      }
      try {
        req.session = sessions.get(sid);
      } catch (e) {
        if (!(e instanceof sessions.errors.SessionNotFound)) {
          throw e;
        }
      }
    }
    if (!req.session && cfg.autoCreateSession) {
      req.session = sessions.create();
    }
  });

  controller.after('/*', function (req, res) {
    if (req.session) {
      var sid = req.session.get('_key');
      if (cfg.jwt) {
        sid = crypto.jwtEncode(cfg.jwt.secret, sid, cfg.jwt.algorithm);
      }
      if (cfg.type === 'cookie') {
        res.cookie(cfg.cookie.name, sid, {
          ttl: req.session.getTTL() / 1000,
          signed: cfg.cookie.secret ? {
            secret: cfg.cookie.secret,
            algorithm: cfg.cookie.algorithm
          } : undefined
        });
      } else if (cfg.type === 'header') {
        res.set(cfg.header, sid);
      }
    }
  });
}

////////////////////////////////////////////////////////////////////////////////
/// @brief convenience wrapper for session destruction logic
////////////////////////////////////////////////////////////////////////////////

function createDestroySessionHandler(auth, opts) {
  'use strict';
  if (!opts) {
    opts = {};
  }
  if (typeof opts === 'function') {
    opts = {after: opts};
  }
  if (!opts.after) {
    opts.after = function (req, res) {
      res.json({message: 'logged out'});
    };
  }
  var cfg = auth.configuration;
  return function (req, res, injected) {
    if (typeof opts.before === 'function') {
      opts.before(req, res, injected);
    }
    if (req.session) {
      req.session.delete();
    }
    if (cfg.autoCreateSession) {
      req.session = auth.getSessionStorage().create();
    } else {
      if (cfg.type === 'cookie') {
        res.cookie(cfg.cookie.name, '', {
          ttl: -(7 * 24 * 60 * 60),
          sign: cfg.cookie.secret ? {
            secret: cfg.cookie.secret,
            algorithm: cfg.cookie.algorithm
          } : undefined
        });
      }
      delete req.session;
    }
    if (typeof opts.after === 'function') {
      opts.after(req, res, injected);
    }
  };
}

// -----------------------------------------------------------------------------
// --SECTION--                                                     FOXX SESSIONS
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// --SECTION--                                      constructors and destructors
// -----------------------------------------------------------------------------

var sessionTypes = ['cookie', 'header'];

////////////////////////////////////////////////////////////////////////////////
/// @brief constructor
////////////////////////////////////////////////////////////////////////////////

function Sessions(opts) {
  'use strict';
  if (!opts) {
    opts = {};
  }
  if (!opts.type) {
    opts.type = 'cookie';
  }

  if (opts.type === 'cookie') {
    if (opts.cookie === true) {
      opts.cookie = {};
    } else if (typeof opts.cookie === 'string') {
      opts.cookie = {name: opts.cookie};
    } else if (typeof opts.cookie !== 'object') {
      throw new Error('Expected cookie settings to be an object, boolean or string.');
    }
    if (!opts.cookie.name) {
      opts.cookie.name = 'sid';
    } else if (typeof opts.cookie.name !== 'string') {
      throw new Error('Cookie name must be a string or empty.');
    }
    if (opts.cookie.secret && typeof opts.cookie.secret !== 'string') {
      throw new Error('Cookie secret must be a string or empty.');
    }
    if (!opts.cookie.name) {
      opts.cookie.name = 'sid';
    }
  } else if (opts.type === 'header') {
    if (opts.header && typeof opts.header !== 'string') {
      throw new Error('Header name must be a string or empty.');
    }
    if (!opts.header) {
      opts.header = 'X-Session-Id';
    }
  } else {
    throw new Error('Only the following session types are supported at this time: ' + sessionTypes.join(', '));
  }
  if (opts.jwt) {
    if (opts.jwt === true) {
      opts.jwt = {};
    } else if (typeof opts.jwt === 'string') {
      opts.jwt = {secret: opts.jwt};
    } else if (typeof opts.jwt !== 'object') {
      throw new Error('Expected JWT settings to be an object, boolean or string.');
    }
    if (opts.jwt.verify !== false) {
      opts.jwt.verify = true;
    }
    if (!opts.jwt.secret) {
      opts.jwt.secret = '';
      if (!opts.jwt.algorithm) {
        opts.jwt.algorithm = 'none';
      } else if (opts.jwt.algorithm !== 'none') {
        throw new Error('Must provide a JWT secret to use any algorithm other than "none".');
      }
    } else {
      if (typeof opts.jwt.secret !== 'string') {
        throw new Error('Header JWT secret must be a string or empty.');
      }
      if (!opts.jwt.algorithm) {
        opts.jwt.algorithm = 'HS256';
      } else {
        opts.jwt.algorithm = crypto.jwtCanonicalAlgorithmName(opts.jwt.algorithm);
      }
    }
  }
  if (opts.autoCreateSession !== false) {
    opts.autoCreateSession = true;
  }
  if (!opts.sessionStorageApp) {
    opts.sessionStorageApp = '/_system/sessions';
  }
  this.configuration = opts;
}

// -----------------------------------------------------------------------------
// --SECTION--                                                  public functions
// -----------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////////////
/// @brief fetches the session storage
////////////////////////////////////////////////////////////////////////////////

Sessions.prototype.getSessionStorage = function () {
  'use strict';
  return Foxx.requireApp(this.configuration.sessionStorageApp).sessionStorage;
};

// -----------------------------------------------------------------------------
// --SECTION--                                                     custom errors
// -----------------------------------------------------------------------------

// http://stackoverflow.com/questions/783818/how-do-i-create-a-custom-error-in-javascript

////////////////////////////////////////////////////////////////////////////////
/// @brief constructor
////////////////////////////////////////////////////////////////////////////////

function UnauthorizedError(message) {
  'use strict';
  this.message = message;
  this.statusCode = 401;
}

UnauthorizedError.prototype = new Error();

// -----------------------------------------------------------------------------
// --SECTION--                                                    module exports
// -----------------------------------------------------------------------------

exports.UnauthorizedError = UnauthorizedError;
exports.sessionTypes = sessionTypes;
exports.Sessions = Sessions;
exports.decorateController = decorateController;
exports.createDestroySessionHandler = createDestroySessionHandler;

// -----------------------------------------------------------------------------
// --SECTION--                                                       END-OF-FILE
// -----------------------------------------------------------------------------

/// Local Variables:
/// mode: outline-minor
/// outline-regexp: "/// @brief\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}\\|/\\*jslint"
/// End:


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1815cbe92">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Northern District of Ohio</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2012-01-03</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2007-01-24</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_06-cr-00569</identifier>
<identifier type="local">P0b002ee1815cbe92</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2012-01-03</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2012-01-03</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ohnd-1_06-cr-00569</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ohnd-1_06-cr-00569</accessId>
 <courtType>District</courtType>
 <courtCode>ohnd</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Ohio</courtState>
 <courtSortOrder>2392</courtSortOrder>
 <caseNumber>1:06-cr-00569</caseNumber>
 <caseOffice>Cleveland</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="James" fullName="James Oppermann" lastName="Oppermann" role="Defendant"></party>
 <party fullName="United States of America" lastName="United States of America" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>United States of America v. Oppermann</title>
 <partNumber>1:06-cr-00569</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_06-cr-00569/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">1:06-cr-00569;06-569</identifier>
<name type="corporate">
 <namePart>United States District Court Northern District of Ohio</namePart>
 <namePart>6th Circuit</namePart>
 <namePart>Cleveland</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>James Oppermann</displayForm>
 <namePart type="family">Oppermann</namePart>
 <namePart type="given">James</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>United States of America</displayForm>
 <namePart type="family">United States of America</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ohnd-1_06-cr-00569</accessId>
 <courtType>District</courtType>
 <courtCode>ohnd</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Ohio</courtState>
 <courtSortOrder>2392</courtSortOrder>
 <caseNumber>1:06-cr-00569</caseNumber>
 <caseOffice>Cleveland</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="James" fullName="James Oppermann" lastName="Oppermann" role="Defendant"></party>
 <party fullName="United States of America" lastName="United States of America" role="Plaintiff"></party>
 <state>Ohio</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ohnd-1_06-cr-00569-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_06-cr-00569/USCOURTS-ohnd-1_06-cr-00569-0/mods.xml">
 <titleInfo>
  <title>United States of America v. Oppermann</title>
  <subTitle>Report and Recommendation on Plea of Guilty as to James Oppermann . Signed by Magistrate Judge James S. Gallas on 1/5/2007 (Transcript will be filed for viewing by court staff only). (P, J)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2007-01-05</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ohnd-1_06-cr-00569-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1816ab6c0</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_06-cr-00569/USCOURTS-ohnd-1_06-cr-00569-0</identifier>
 <identifier type="former granule identifier">ohnd-1_06-cr-00569_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_06-cr-00569/USCOURTS-ohnd-1_06-cr-00569-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_06-cr-00569/pdf/USCOURTS-ohnd-1_06-cr-00569-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 1:06-cr-00569; United States of America v. Oppermann; </searchTitle>
  <courtName>United States District Court Northern District of Ohio</courtName>
  <state>Ohio</state>
  <accessId>USCOURTS-ohnd-1_06-cr-00569-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2007-01-05</dateIssued>
  <docketText>Report and Recommendation on Plea of Guilty as to James Oppermann . Signed by Magistrate Judge James S. Gallas on 1/5/2007 (Transcript will be filed for viewing by court staff only). (P, J)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ohnd-1_06-cr-00569-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_06-cr-00569/USCOURTS-ohnd-1_06-cr-00569-1/mods.xml">
 <titleInfo>
  <title>United States of America v. Oppermann</title>
  <subTitle>Order Adopting Magistrate Judge James Gallas' Report and Recommendation accepting the guilty plea of Defendant, James Oppermann on Count 1 of the Information. (Related Document 11). Signed by Judge Peter C. Economus on 1/23/07. (BR,S)</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2007-01-24</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ohnd-1_06-cr-00569-1.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1816ab6c1</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_06-cr-00569/USCOURTS-ohnd-1_06-cr-00569-1</identifier>
 <identifier type="former granule identifier">ohnd-1_06-cr-00569_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ohnd-1_06-cr-00569/USCOURTS-ohnd-1_06-cr-00569-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ohnd-1_06-cr-00569/pdf/USCOURTS-ohnd-1_06-cr-00569-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 1:06-cr-00569; United States of America v. Oppermann; </searchTitle>
  <courtName>United States District Court Northern District of Ohio</courtName>
  <state>Ohio</state>
  <accessId>USCOURTS-ohnd-1_06-cr-00569-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2007-01-24</dateIssued>
  <docketText>Order Adopting Magistrate Judge James Gallas' Report and Recommendation accepting the guilty plea of Defendant, James Oppermann on Count 1 of the Information. (Related Document 11). Signed by Judge Peter C. Economus on 1/23/07. (BR,S)</docketText>
</extension>
</relatedItem>
</mods>