text:
from amara.test.xslt.xslt_support import _run_html

def test_xslt_order_dependence_dg_20010503():
    _run_html(
        source_xml = """\
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?xml-stylesheet type="text/xml" href="Xml/Xslt/Core/addr_book1.xsl"?>
<ADDRBOOK>
    <ENTRY ID="pa">
        <NAME>Pieter Aaron</NAME>
        <ADDRESS>404 Error Way</ADDRESS>
        <PHONENUM DESC="Work">404-555-1234</PHONENUM>
        <PHONENUM DESC="Fax">404-555-4321</PHONENUM>
        <PHONENUM DESC="Pager">404-555-5555</PHONENUM>
        <EMAIL>pieter.aaron@inter.net</EMAIL>
    </ENTRY>
</ADDRBOOK>
""",
        # This test previously did not work, with the error
        #    XsltError: No stylesheets to process.
        # The problem is the stylesheet is a link in the source XML.
        # I upgraded the tests, but still don't know how to handle this case.
        transform_xml = None,
        expected = """

    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
    <title>Address Book</title>

Tabulate Just Names and Phone Numbers

        Pieter Aaron
        (Work) 404-555-1234
(Fax) 404-555-4321
(Pager) 404-555-5555

""")

if __name__ == '__main__':
    raise SystemExit("Use nosetests")

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Hoplite\TeachersBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Hoplite\TeachersBundle\Entity\Teacher;

class teachers implements FixtureInterface, ContainerAwareInterface
{
  private $container;

  public function setContainer (ContainerInterface $container = null)
  {
    $this->container = $container;
  }

  public function load(ObjectManager $manager)
  {
    $teachers = array (
        array ('first_name' => 'Marta', 'last_name' => 'Benito', 'login' => 'mbenito', 'password' => '1234'),
        array ('first_name' => 'Jesus', 'last_name' => 'García', 'login' => 'jgarcia', 'password' => '1234'),
    );

    foreach ($teachers as $teacher)
    {
      $entity = new Teacher();
      $encoder = $this->container->get('security.encoder_factory')->getEncoder($entity);

      $password = $encoder->encodePassword($teacher['password'], $teacher['password']);

      $entity->setFirstName($teacher['first_name']);
      $entity->setLastName($teacher['last_name']);
      $entity->setLogin($teacher['login']);

      $entity->setPassword($password);
      $entity->setSalt($teacher['password']);

      $manager->persist($entity);

    }

    $now =  new \DateTime('now');
    echo $now->format('Y-m-d h:m:i'). "\n";
    $manager->flush();

    sleep(3);

    $users = $manager->getRepository('TeachersBundle:Teacher')->findAll();
    echo "users = $users ";
    foreach ($users as $user)
    {
      echo "user = " . $user->getId();
      $user->setLastName($user->getLastName() . $user->getLastName());
      $manager->persist($user);
    }
    $manager->flush();

  }

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Melasmia alnea Lév.

### Remarks
null


text:
from __future__ import unicode_literals

import sys

from .base import BaseCommand
from ..utils import uni_print
from ..constants import HTTP_OK_NO_CONTENT

class RbCommand(BaseCommand):

    command = "rb"
    usage = "%(prog)s <bucket> [-c <conf_file> --force]"

    @classmethod
    def add_extra_arguments(cls, parser):
        parser.add_argument("bucket", help="Name of the bucket to be deleted")

        parser.add_argument(
            "--force",
            action="store_true",
            dest="force",
            help="Forcely delete a nonempty bucket"
        )
        return parser

    @classmethod
    def send_request(cls):
        bucket, prefix = cls.validate_qs_path(cls.options.bucket)
        if prefix != "":
            print("Error: Invalid bucket name")
            sys.exit(-1)
        if cls.options.force == True:
            cls.remove_multiple_keys(bucket)
        cls.validate_bucket(bucket)
        current_bucket = cls.client.Bucket(bucket, cls.bucket_map[bucket])
        resp = current_bucket.delete()
        if resp.status_code != HTTP_OK_NO_CONTENT:
            uni_print(resp.content)
        else:
            uni_print("Bucket <%s> deleted" % bucket)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Egghead.io Angular JS tutorial</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
    <link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
    <link rel="stylesheet" href="app.css">
    <link rel="stylesheet" href="bower_components/foundation/css/foundation.css">

            {{$index + 1}}. {{item}} {{ev.pageY}}


text:
import React, { Component } from "react";
import PropTypes from "prop-types";

import { first, last, hexToRGBA } from "../utils";

/*
function d3_scaleExtent(domain) {
	var start = domain[0], stop = domain[domain.length - 1];
	return start < stop ? [start, stop] : [stop, start];
}

function d3_scaleRange(scale) {
	return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
}
*/
class AxisLine extends Component {
	render() {
		const { orient, outerTickSize, fill, stroke, strokeWidth, className, shapeRendering, opacity, range } = this.props;
		const sign = orient === "top" || orient === "left" ? -1 : 1;

		// var range = d3_scaleRange(scale);

		let d;

		if (orient === "bottom" || orient === "top") {
			d = "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize;
		} else {
			d = "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize;
		}

		return (
			<path
				className={className}
				shapeRendering={shapeRendering}
				d={d}
				fill={fill}
				opacity={opacity}
				stroke={stroke}
				strokeWidth={strokeWidth} >
			</path>
		);
	}
}

AxisLine.propTypes = {
	className: PropTypes.string,
	shapeRendering: PropTypes.string,
	orient: PropTypes.string.isRequired,
	scale: PropTypes.func.isRequired,
	outerTickSize: PropTypes.number,
	fill: PropTypes.string,
	stroke: PropTypes.string,
	strokeWidth: PropTypes.number,
	opacity: PropTypes.number,
	range: PropTypes.array,
};

AxisLine.defaultProps = {
	className: "react-stockcharts-axis-line",
	shapeRendering: "crispEdges",
	outerTickSize: 0,
	fill: "none",
	stroke: "#000000",
	strokeWidth: 1,
	opacity: 1,
};

AxisLine.drawOnCanvasStatic = (props, ctx/* , xScale, yScale*/) => {
	props = { ...AxisLine.defaultProps, ...props };

	const { orient, outerTickSize, stroke, strokeWidth, opacity, range } = props;

	const sign = orient === "top" || orient === "left" ? -1 : 1;
	const xAxis = (orient === "bottom" || orient === "top");

	// var range = d3_scaleRange(xAxis ? xScale : yScale);

	ctx.lineWidth = strokeWidth;
	ctx.strokeStyle = hexToRGBA(stroke, opacity);

	ctx.beginPath();

	if (xAxis) {
		ctx.moveTo(first(range), sign * outerTickSize);
		ctx.lineTo(first(range), 0);
		ctx.lineTo(last(range), 0);
		ctx.lineTo(last(range), sign * outerTickSize);
	} else {
		ctx.moveTo(sign * outerTickSize, first(range));
		ctx.lineTo(0, first(range));
		ctx.lineTo(0, last(range));
		ctx.lineTo(sign * outerTickSize, last(range));
	}
	ctx.stroke();

	// ctx.strokeStyle = strokeStyle;
};

export default AxisLine;


text:
<html>
	<head>
		<title>Test barcode generation</title>
		<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
		<script type="text/javascript" src="jquery-code39.js"></script>
	</head>
	<body style="background:#DDDDDD">
		<canvas id="barcodeCanvas" style="margin:100px" width="1054" height="100"></canvas>
		<script>
		$("#barcodeCanvas").code39("577");
		</script>
	</body>
</html>


text:
<ion-modal-view>
    <ion-header-bar>

Signup

    </ion-header-bar>
    <ion-content>
        <form name="signupForm" novalidate ng-submit="signupForm.$valid && signup()">

                    <input type="text" ng-model="signupModel.username" name="username" ng-required="true" placeholder="{{'signup.username'|translate}}" />

                    <input type="password" pattern="\w{8,}" ng-model="signupModel.password" name="password" ng-required="true" placeholder="{{'signup.password'|translate}}" />

                    <input type="password" pattern="\w{8,}"  ng-model="signupModel.passwordRepeat" password-match="signupModel.password" name="passwordRepeat" ng-required="true" placeholder="{{'signup.passwordRepeat'|translate}}" />

                <button class="button button-block button-positive" type="submit" ng-disabled="signupForm.$invalid || signingUp">
                    Signup
                </button>

        </form>
    </ion-content>
</ion-modal-view>


text:
if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
  if (typeof(console) !== 'undefined') { // eslint-disable-line no-console
    console.error('Class ss.i18n not defined');  // eslint-disable-line no-console
  }
} else {
  ss.i18n.addDictionary('en', {
    "Admin.BATCH_ARCHIVE_PROMPT": "You have {num} page(s) selected.\n\nAre you sure you want to archive these pages?\n\nThese pages and all of their children pages will be unpublished and sent to the archive.",
    "Admin.BATCH_DELETELIVE_PROMPT": "You have {num} page(s) selected.\n\nDo you really want to delete these pages from live?",
    "Admin.BATCH_DELETE_PROMPT": "You have {num} page(s) selected.\n\nAre you sure you want to delete these pages?\n\nThese pages and all of their children pages will be deleted and sent to the archive.",
    "Admin.BATCH_PUBLISH_PROMPT": "You have {num} page(s) selected.\n\nDo you really want to publish?",
    "Admin.BATCH_RESTORE_PROMPT": "You have {num} page(s) selected.\n\nDo you really want to restore to stage?\n\nChildren of archived pages will be restored to the root level, unless those pages are also being restored.",
    "Admin.BATCH_UNPUBLISH_PROMPT": "You have {num} page(s) selected.\n\nDo you really want to unpublish",
    "Admin.SELECTONEPAGE": "Please select at least one page",
    "Admin.FormatExample": "Example: {format}",
    "Admin.NO_SIZE": "N/A",
    "Admin.CLOSE": "Close",
    "Admin.CONFIRMUNSAVED": "Are you sure you want to navigate away from this page?\n\nWARNING: Your changes have not been saved.\n\nPress OK to continue, or Cancel to stay on the current page.",
    "Admin.CONFIRMUNSAVEDSHORT": "WARNING: Your changes have not been saved.",
    "Admin.VALIDATIONERROR": "Validation Error",
    "Admin.VALIDATION_ERRORS_IN_TAB": "This tab contains validation errors.",
    "Admin.VALIDATION_ERRORS_ON_PAGE": "There are validation errors on this page, please fix them before saving or publishing.",
    "Admin.VALIDATION_ERRORS_IN_TAB_SCREEN_READER": "(Has validation errors)",
    "Admin.NONE": "None",
    "Admin.EDIT": "Edit",
    "Admin.ANY": "Any",
    "Admin.ERRORINTRANSACTION": "An error occured while fetching data from the server\n Please try again later.",
    "Admin.DELETECONFIRMMESSAGE": "Are you sure you want to delete this record?",
    "Admin.ARCHIVECONFIRMMESSAGE": "Are you sure you want to archive this record?",
    "Admin.EXPANDPANEL": "Expand panel",
    "Admin.COLLAPSEPANEL": "Collapse panel",
    "Admin.VALIDATOR_MESSAGE_REQUIRED": "{name} is required.",
    "Admin.VALIDATOR_MESSAGE_EQUALS": "{name} are not equal.",
    "Admin.VALIDATOR_MESSAGE_NUMERIC": "{name} is not a number.",
    "Admin.VALIDATOR_MESSAGE_DATE": "{name} is not a proper date format.",
    "Admin.VALIDATOR_MESSAGE_ALPHANUMERIC": "{name} is not an alphanumeric value.",
    "Admin.VALIDATOR_MESSAGE_ALPHA": "{name} is not only letters.",
    "Admin.VALIDATOR_MESSAGE_DEFAULT": "{name} is not a valid value."
});
}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.babisoft.ReactNativeLocalization">
</manifest>


text:
//
//  NSData+PGPUtils.m
//  ObjectivePGP
//
//  Created by Marcin Krzyzanowski on 04/05/14.
//  Copyright (c) 2014 Marcin Krzyżanowski. All rights reserved.
//

#import "NSData+PGPUtils.h"
#import "PGPCryptoUtils.h"

#import <CommonCrypto/CommonCrypto.h>

#include <openssl/ripemd.h>
#include <openssl/cast.h>
#include <openssl/idea.h>
#include <openssl/aes.h>
#include <openssl/sha.h>
#include <openssl/des.h>
#include <openssl/camellia.h>
#include <openssl/blowfish.h>

@implementation NSData (PGPUtils)

/**
 *  Calculates a 16bit sum of a string by adding each character * codes modulus 65535
 *
 *  @return checksum
 */
- (UInt16) pgp_Checksum
{
    UInt32 s = 0;
    const UInt8 *bytes = self.bytes;
    for (NSUInteger i = 0; i < self.length; i++) {
        s = (s + (UInt8)bytes[i]);
    }
    s = s % 65536;
    return (UInt16)s;
}

#define CRC24_POLY 0x1864cfbL
#define CRC24_INIT 0xB704CEL

- (UInt32) pgp_CRC24
{
    UInt32 crc = CRC24_INIT;
    NSUInteger len = self.length;
    const UInt8 *octets = self.bytes;
    int i;
    while (len--) {
        crc ^= (*octets++) << 16;
        for (i = 0; i < 8; i++) {
            crc <<= 1;
            if (crc & 0x1000000)
                crc ^= CRC24_POLY;
        }
    }
    return crc & 0xFFFFFFL;
}

- (NSData*) pgp_MD5
{
    if (!self)
        return self;

    CC_MD5_CTX *ctx = calloc(1, sizeof(CC_MD5_CTX));

    CC_MD5_Init(ctx);
    CC_MD5_Update(ctx, self.bytes, (CC_LONG)self.length);
    UInt8 *out = calloc(CC_MD5_DIGEST_LENGTH, sizeof(UInt8));
    if (!out) {
        free(ctx);
        return nil;
    }
    CC_MD5_Final(out, ctx);

    NSData *outData = [NSData dataWithBytes:out length:CC_MD5_DIGEST_LENGTH];

    free(out);
    free(ctx);
    return outData;
}

- (NSData *) pgp_SHA1
{
    if (!self)
        return self;

//    unsigned char digest[CC_SHA1_DIGEST_LENGTH];
//    CC_SHA1(self.bytes, self.length, digest);
//    NSData *outData = [NSData dataWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];

    CC_SHA1_CTX *ctx = calloc(1, sizeof(CC_SHA1_CTX));
    if (!ctx) {
        return nil;
    }

    UInt8 *outBuf = calloc(CC_SHA1_DIGEST_LENGTH, 1);
    if (!outBuf) {
        free(ctx);
        return nil;
    }
    CC_SHA1_Init(ctx);
    CC_SHA1_Update(ctx, self.bytes, (CC_LONG)self.length);
    CC_SHA1_Final(outBuf, ctx);

    NSData *outData = [NSData dataWithBytes:outBuf length:CC_SHA1_DIGEST_LENGTH];

    free(outBuf);
    free(ctx);
    return outData;
}

- (NSData*) pgp_SHA224
{
    if (!self)
        return self;

    CC_SHA256_CTX *ctx = calloc(1, sizeof(CC_SHA256_CTX));
    if (!ctx) {
        return nil;
    }

    CC_SHA224_Init(ctx);
    CC_SHA224_Update(ctx, self.bytes, (CC_LONG)self.length);
    UInt8 *out = calloc(CC_SHA224_DIGEST_LENGTH, sizeof(UInt8));
    if (!out) {
        free(ctx);
        return nil;
    }
    CC_SHA224_Final(out, ctx);

    NSData *outData = [NSData dataWithBytes:out length:CC_SHA224_DIGEST_LENGTH];

    free(out);
    free(ctx);
    return outData;
}

- (NSData*) pgp_SHA256
{
    if (!self)
        return self;

    CC_SHA256_CTX *ctx = calloc(1, sizeof(CC_SHA256_CTX));
    if (!ctx) {
        return nil;
    }

    CC_SHA256_Init(ctx);
    CC_SHA256_Update(ctx, self.bytes, (CC_LONG)self.length);
    UInt8 *out = calloc(CC_SHA256_DIGEST_LENGTH, sizeof(UInt8));
    if (!out) {
        free(ctx);
        return nil;
    }
    CC_SHA256_Final(out, ctx);

    NSData *outData = [NSData dataWithBytes:out length:CC_SHA256_DIGEST_LENGTH];

    free(out);
    free(ctx);
    return outData;
}

- (NSData*) pgp_SHA384
{
    if (!self)
        return self;

    CC_SHA512_CTX *ctx = calloc(1, sizeof(CC_SHA512_CTX));
    if (!ctx) {
        return nil;
    }

    CC_SHA384_Init(ctx);
    CC_SHA384_Update(ctx, self.bytes, (CC_LONG)self.length);
    UInt8 *out = calloc(CC_SHA384_DIGEST_LENGTH, sizeof(UInt8));
    if (!out) {
        free(ctx);
        return nil;
    }
    CC_SHA384_Final(out, ctx);

    NSData *outData = [NSData dataWithBytes:out length:CC_SHA384_DIGEST_LENGTH];

    free(out);
    free(ctx);
    return outData;
}

- (NSData*) pgp_SHA512
{
    if (!self)
        return self;

    CC_SHA512_CTX *ctx = calloc(1, sizeof(CC_SHA512_CTX));
    if (!ctx) {
        return nil;
    }

    CC_SHA512_Init(ctx);
    CC_SHA512_Update(ctx, self.bytes, (CC_LONG)self.length);
    UInt8 *outBuf = calloc(CC_SHA512_DIGEST_LENGTH, sizeof(UInt8));
    if (!outBuf) {
        free(ctx);
        return nil;
    }
    CC_SHA512_Final(outBuf, ctx);

    NSData *outData = [NSData dataWithBytes:outBuf length:CC_SHA512_DIGEST_LENGTH];

    free(outBuf);
    free(ctx);
    return outData;
}

- (NSData*) pgp_RIPEMD160
{
    if (!self)
        return self;

    RIPEMD160_CTX *ctx = calloc(1, sizeof(RIPEMD160_CTX));
    if (!ctx) {
        return nil;
    }

    RIPEMD160_Init(ctx);
    RIPEMD160_Update(ctx, self.bytes, self.length);
    UInt8 *out = calloc(RIPEMD160_DIGEST_LENGTH, sizeof(UInt8));
    if (!out) {
        return nil;
    }
    RIPEMD160_Final(out, ctx);

    NSData *outData = [NSData dataWithBytes:out length:RIPEMD160_DIGEST_LENGTH];

    free(out);
    free(ctx);
    return outData;
}

- (NSData *) pgp_HashedWithAlgorithm:(PGPHashAlgorithm)hashAlgorithm
{
    NSData *hashData = nil;
    switch (hashAlgorithm) {
        case PGPHashMD5:
            hashData = [self pgp_MD5];
            break;
        case PGPHashSHA1:
            hashData = [self pgp_SHA1];
            break;
        case PGPHashSHA224:
            hashData = [self pgp_SHA224];
            break;
        case PGPHashSHA256:
            hashData = [self pgp_SHA256];
            break;
        case PGPHashSHA384:
            hashData = [self pgp_SHA384];
            break;
        case PGPHashSHA512:
            hashData = [self pgp_SHA512];
            break;
        case PGPHashRIPEMD160:
            hashData = [self pgp_RIPEMD160];
            break;

        default:
            NSAssert(false, @"hash algorithm not supported");
            break;
    }
    return hashData;
}

#pragma mark - Encryption

- (NSData *) pgp_encryptBlockWithSymmetricAlgorithm:(PGPSymmetricAlgorithm)symmetricAlgorithm sessionKeyData:(NSData *)sessionKeyData
{
    NSAssert(sessionKeyData,@"Missing key data");

    if (!sessionKeyData) {
        return nil;
    }

    NSUInteger keySize = [PGPCryptoUtils keySizeOfSymmetricAlhorithm:symmetricAlgorithm];

    NSData *ret = nil;

    switch (symmetricAlgorithm) {
        case PGPSymmetricCAST5:
        {
            CAST_KEY *encrypt_key = calloc(1, sizeof(CAST_KEY));
            CAST_set_key(encrypt_key, (unsigned int)keySize, sessionKeyData.bytes);
            UInt8 *outBuf = calloc(self.length, sizeof(UInt8));
            CAST_ecb_encrypt(self.bytes, outBuf, encrypt_key, CAST_ENCRYPT);
            ret = [NSData dataWithBytes:&outBuf length:self.length];

            free(outBuf);
            free(encrypt_key);
        }
            break;
        case PGPSymmetricAES256:
        case PGPSymmetricAES128:
        case PGPSymmetricAES192:
        {
            AES_KEY *encrypt_key = calloc(1, sizeof(AES_KEY));
            AES_set_encrypt_key(sessionKeyData.bytes, (int)(keySize * 8), encrypt_key);

            UInt8 *outBuf = calloc(self.length, sizeof(UInt8));
            AES_encrypt(self.bytes, outBuf, encrypt_key);
            ret = [NSData dataWithBytes:&outBuf length:self.length];

            free(outBuf);
            free(encrypt_key);
        }
            break;
        case PGPSymmetricIDEA:
        {
            IDEA_KEY_SCHEDULE *encrypt_key = calloc(1, sizeof(IDEA_KEY_SCHEDULE));
            idea_set_encrypt_key(sessionKeyData.bytes, encrypt_key);

            UInt8 *outBuf = calloc(self.length, sizeof(UInt8));
            idea_ecb_encrypt(self.bytes, outBuf, encrypt_key);
            ret = [NSData dataWithBytes:&outBuf length:self.length];

            free(outBuf);
            free(encrypt_key);
        }
            break;
        case PGPSymmetricTripleDES:
        {
            // Very unsure if this is working, need some tests later
            const void *key = sessionKeyData.bytes;

            DES_key_schedule *keys3 = calloc(3, sizeof(DES_key_schedule));
            for (int n = 0; n < 3; ++n) {
                DES_set_key((DES_cblock *)(void *)(key + n * 8), &keys3[n]);
            }

            DES_cblock *outBuf = calloc(self.length, sizeof(DES_cblock));
            DES_ecb3_encrypt((void *)(unsigned long)(const void *)(self.bytes), outBuf, &keys3[0], &keys3[1], &keys3[2], DES_ENCRYPT);
            ret = [NSData dataWithBytes:&outBuf length:self.length];

            free(outBuf);
            free(keys3);
        }
            break;
        default:
            [NSException raise:@"PGPNotSupported" format:@"Encryption unsupported, cant encrypt data"];
            break;
    }
    return ret;
}

@end


text:
package cloudformation

// AWSKinesisAnalyticsApplicationReferenceDataSource_RecordFormat AWS CloudFormation Resource (AWS::KinesisAnalytics::ApplicationReferenceDataSource.RecordFormat)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalytics-applicationreferencedatasource-recordformat.html
type AWSKinesisAnalyticsApplicationReferenceDataSource_RecordFormat struct {

	// MappingParameters AWS CloudFormation Property
	// Required: false
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalytics-applicationreferencedatasource-recordformat.html#cfn-kinesisanalytics-applicationreferencedatasource-recordformat-mappingparameters
	MappingParameters *AWSKinesisAnalyticsApplicationReferenceDataSource_MappingParameters `json:"MappingParameters,omitempty"`

	// RecordFormatType AWS CloudFormation Property
	// Required: true
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalytics-applicationreferencedatasource-recordformat.html#cfn-kinesisanalytics-applicationreferencedatasource-recordformat-recordformattype
	RecordFormatType string `json:"RecordFormatType,omitempty"`
}

// AWSCloudFormationType returns the AWS CloudFormation resource type
func (r *AWSKinesisAnalyticsApplicationReferenceDataSource_RecordFormat) AWSCloudFormationType() string {
	return "AWS::KinesisAnalytics::ApplicationReferenceDataSource.RecordFormat"
}


text:
namespace Google.Cloud.GkeMultiCloud.V1.Snippets
{
    // [START gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_async]
    using Google.Cloud.GkeMultiCloud.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedAzureClustersClientSnippets
    {
        /// <summary>Snippet for GetAzureClusterAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetAzureClusterRequestObjectAsync()
        {
            // Create client
            AzureClustersClient azureClustersClient = await AzureClustersClient.CreateAsync();
            // Initialize request argument(s)
            GetAzureClusterRequest request = new GetAzureClusterRequest
            {
                AzureClusterName = AzureClusterName.FromProjectLocationAzureCluster("[PROJECT]", "[LOCATION]", "[AZURE_CLUSTER]"),
            };
            // Make the request
            AzureCluster response = await azureClustersClient.GetAzureClusterAsync(request);
        }
    }
    // [END gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_async]
}


text:
package enumeratum.values

sealed abstract class JsonDrinks(val value: Short, name: String) extends ShortEnumEntry

case object JsonDrinks extends ShortEnum[JsonDrinks] with ShortPlayJsonValueEnum[JsonDrinks] {

  case object OrangeJuice extends JsonDrinks(value = 1, name = "oj")
  case object AppleJuice  extends JsonDrinks(value = 2, name = "aj")
  case object Cola        extends JsonDrinks(value = 3, name = "cola")
  case object Beer        extends JsonDrinks(value = 4, name = "beer")

  val values = findValues

}


text:
categories:
- tumblr
- archive
- link
date: 2009-04-03T02:56:53Z
link: http://wrongtomorrow.com/
title: Wrong Tomorrow - time vs. pundits
url: /2009/04/03/link-wrong-tomorrow---time-vs-pundits/
---


text:
package com.microsoft.azure.management.machinelearningservices.v2019_05_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.machinelearningservices.v2019_05_01.implementation.MachineLearningServicesManager;
import com.microsoft.azure.management.machinelearningservices.v2019_05_01.implementation.OperationInner;

/**
 * Type representing Operation.
 */
public interface Operation extends HasInner<OperationInner>, HasManager<MachineLearningServicesManager> {
    /**
     * @return the display value.
     */
    OperationDisplay display();

    /**
     * @return the name value.
     */
    String name();

}


text:
package org.apache.flink.changelog.fs;

import javax.annotation.concurrent.NotThreadSafe;

import static org.apache.flink.util.Preconditions.checkState;

/** Helper class to throttle upload requests when the in-flight data size limit is exceeded. */
@NotThreadSafe
class UploadThrottle {

    private final long maxBytesInFlight;

    private long inFlightBytesCounter = 0;

    UploadThrottle(long maxBytesInFlight) {
        this.maxBytesInFlight = maxBytesInFlight;
    }

    /**
     * Seize bytes capacity. It is the caller responsibility to ensure at least some capacity
     * {@link #hasCapacity() is available}. After this call, the caller is allowed
     * to actually use the seized capacity. When the capacity is not needed anymore, the caller is
     * required to {@link #releaseCapacity(long) release} it. Called by the Task thread.
     *
     * @throws IllegalStateException if capacity is unavailable.
     */
    public void seizeCapacity(long bytes) throws IllegalStateException {
        checkState(hasCapacity());
        inFlightBytesCounter += bytes;
    }

    /**
     * Release previously {@link #seizeCapacity(long) seized} capacity. Called by {@link
     * BatchingStateChangeUploadScheduler} (IO thread).
     */
    public void releaseCapacity(long bytes) {
        inFlightBytesCounter -= bytes;
    }

    /** Test whether some capacity is available. */
    public boolean hasCapacity() {
        return inFlightBytesCounter < maxBytesInFlight;
    }
}


text:
FROM busybox

# SLEEP is to simulate build time
ARG SLEEP=0
# FAIL=1 will cause the build to fail
ARG FAIL=0
COPY foo /foo

ENV SLEEP_TIMEOUT=${SLEEP}
ENV FAIL=${FAIL}
RUN echo "sleep ${SLEEP_TIMEOUT}"
RUN sleep ${SLEEP_TIMEOUT}
RUN [ "${FAIL}" == "0" ] || false

CMD while true; do cat /foo; sleep 1; done


text:
import os
from itertools import permutations
from job_queue import GridEngineQueue
from utils import (
    make_dir,
    checksum_match,
    skip_msg,
    run_msg,
    end_msg)
from caller import (
    MuTect,
    SomaticSniper,
    Scalpel,
    Strelka,
    VarScan)

class Somatic:
    def __init__(self, args):
        self.sample_file = args.infile
        self.var_type = args.var_type
        self.min_af = args.min_AF
        self.skip_on = args.skip_on
        self.chunk_size = args.chunk_size

        self.q = GridEngineQueue()
        self.hold_jid = {}

        self._regist_caller(args)
        self._prepare_dir()

    @property
    def worker_name(self):
        return type(self).__name__.lower()

    @property
    def sample_name(self):
        clname = os.path.splitext(os.path.basename(self.clone))[0]
        tiname = os.path.splitext(os.path.basename(self.tissue))[0]
        return '{}_-_{}'.format(clname, tiname)

    @property
    def bin_path(self):
        return os.path.dirname(os.path.realpath(__file__))

    @property
    def script_dir(self):
        return '{}/job_scripts/{}'.format(self.bin_path, self.worker_name)

    @property
    def qerr_dir(self):
        return 'q.err/{}.all'.format(self.sample_name)

    @property
    def qout_dir(self):
        return 'q.out/{}.all'.format(self.sample_name)

    @property
    def af_dir(self):
        return self.worker_name + '.AF'

    @property
    def out_dir(self):
        return self.worker_name + '.out'

    @property
    def sample_list(self):
        pairs = set()
        with open(self.sample_file) as f:
            for line in f:
                clone, tissue = line.strip().split('\t')[:2]
                pairs.add((clone, tissue))
        return pairs

    @property
    def concall_file(self):
        return '{}/{}.{}_call_n{}_{}AFcutoff.txt'.format(
            self.out_dir, self.sample_name, self.var_type,
            len(self.caller), str(self.min_af).replace('0.', ''))

    @property
    def concall_file_ok(self):
        return self.skip_on and checksum_match(self.concall_file)

    @property
    def chunk_file(self):
        f=lambda n,i=0:"{:.0f}{}".format(n," kMG"[i])*(n<1e3)or f(n/1e3, i+1)
        return "{}.call/genomic_regions_{}_chunk.txt".format(
            self.worker_name, f(self.chunk_size).strip())

    @property
    def chrom_file(self):
        return "{}.call/genomic_regions_chrom.txt".format(self.worker_name)

    def _regist_caller(self, args):
        if self.var_type == "snv":
            self.caller = [SomaticSniper(args, self.worker_name),
                           Strelka(args, self.worker_name)]
            if args.chunk_on:
                self.caller.extend([
                    MuTect(args, self.worker_name, self.chunk_file),
                    VarScan(args, self.worker_name, self.chunk_file)])
            else:
                self.caller.extend([
                    MuTect(args, self.worker_name),
                    VarScan(args, self.worker_name)])

        elif self.var_type == "indel":
            self.caller = [Strelka(args, self.worker_name)]
            if args.chunk_on:
                self.caller.extend([
                    Scalpel(args, self.worker_name, self.chrom_file),
                    VarScan(args, self.worker_name, self.chunk_file)])
            else:
                self.caller.extend([
                    Scalpel(args, self.worker_name),
                    VarScan(args, self.worker_name)])

    def _prepare_dir(self):
        make_dir(self.out_dir)

    def _qopt(self, jprefix, hold_jid=''):
        qopt = '-N {}.{} -e {} -o {} -v BIN_PATH={}'.format(
            jprefix, self.sample_name, self.qerr_dir, self.qout_dir, self.bin_path)
        if hold_jid == '':
            return qopt
        else:
            return qopt + ' -hold_jid {}'.format(hold_jid)

    def _concall(self, hold_jid):
        qopt = self._qopt('con_call', hold_jid)
        cmd =  '{}/{}_con_call.sh {} {} {}'.format(
            self.script_dir, self.var_type,
            self.min_af, self.af_dir, self.concall_file)
        return self.q.submit(qopt, cmd)

    def _skip_msg(self, jname):
        if self.q.__class__.is_1st_print:
            self.q.__class__.is_1st_print = False
        else:
            print('\x1b[2A', end='\r')
        skip_msg(jname, '{}.all'.format(self.sample_name))

    def _run_msg(self, jname):
        run_msg(jname, '{}.all'.format(self.sample_name))

    def _run(self):
        hold_jid = ''
        if self.concall_file_ok:
            self._skip_msg('calling')
            self._skip_msg('af_calc')
            self._skip_msg('con_call')
        else:
            make_dir(self.qerr_dir)
            make_dir(self.qout_dir)
            jids = (caller.run(self.clone, self.tissue) for caller in self.caller)
            hold_jid = ','.join(jid for jid in jids if jid != '')
            hold_jid = self._concall(hold_jid)
            self._run_msg('con_call')
        return hold_jid

    def run(self):
        for clone, tissue in self.sample_list:
            self.clone = clone
            self.tissue = tissue
            self._run()
        end_msg(self.q.j_total)

class Sensitivity(Somatic):
    def __init__(self, args):
        super().__init__(args)
        self.control_bam = args.control_bam
        self.control_var = args.control_var
        self.g1k_var = args.g1k_var
        self.germ_het_var = args.germ_het_var

        if self.true_file_ok:
            self.true_jid = ''
            self.q.__class__.is_1st_print = False
            skip_msg('truefile', 'For all samples')
        else:
            self.true_jid = self._truefile()
            run_msg('truefile', 'For all samples')

    @property
    def sample_list(self):
        pairs = set()
        with open(self.sample_file) as f:
            for line in f:
                clone = line.strip().split('\t')[0]
                pairs.add((clone, self.control_bam))
        return pairs

    @property
    def concall_file(self):
        return '{}/{}.call_n{{}}.{}_AF.txt'.format(
            self.af_dir, self.sample_name, self.var_type)

    @property
    def concall_file_ok(self):
        return self.skip_on and all(
            [checksum_match(self.concall_file.format(i))
             for i in range(1,len(self.caller)+1)])

    @property
    def true_file(self):
        if self.var_type == "snv":
            var_type = "snp"
        else:
            var_type = self.var_type
        return '{}/germ_het_not_in_NA12878_{}.txt'.format(
            self.out_dir, var_type)

    @property
    def true_file_ok(self):
        return self.skip_on and checksum_match(self.true_file)

    @property
    def sens_file(self):
        return "{}/{}.{}_sensitivity_{}AFcutoff.txt".format(
            self.out_dir, self.sample_name, self.var_type,
            str(self.min_af).replace('0.', ''))

    @property
    def sens_file_ok(self):
        return self.skip_on and checksum_match(self.sens_file)

    def _concall(self, hold_jid):
        qopt = self._qopt('con_call', hold_jid)
        cmd =  '{}/{}_con_call.sh {} {} {}'.format(
            self.script_dir, self.var_type,
            self.min_af, self.af_dir, self.sample_name)
        return self.q.submit(qopt, cmd)

    def _truefile(self):
        qopt = '-N true_file -e q.err -o q.out'
        cmd =  '{}/true_file.sh {} {} {} {}'.format(
            self.script_dir, self.control_var, self.g1k_var,
            self.germ_het_var, self.true_file)
        return self.q.submit(qopt, cmd)

    def _sensitivity(self, hold_jid):
        qopt = self._qopt('sens', hold_jid)
        cmd =  '{}/{}_sensitivity.sh {} {} {} {}'.format(
            self.script_dir, self.var_type,
            self.min_af, self.true_file, self.af_dir, self.sens_file)
        return self.q.submit(qopt, cmd)

    def _run(self):
        if self.sens_file_ok:
            self._skip_msg('calling')
            self._skip_msg('af_calc')
            self._skip_msg('con_call')
            self._skip_msg('sens')
        else:
            make_dir(self.qerr_dir)
            make_dir(self.qout_dir)

            hold_jid = super()._run()
            if hold_jid == '':
                hold_jid = self.true_jid
            elif self.true_jid != '':
                hold_jid += ',' + self.true_jid

            self._sensitivity(hold_jid)
            self._run_msg('sens')

class Pairwise(Somatic):
    def __init__(self, args):
        super().__init__(args)
        self.out_prefix = args.out_prefix
        if self.out_prefix != '':
            self.out_prefix += '-'

    @property
    def sample_list(self):
        clones = set()
        with open(self.sample_file) as f:
            for line in f:
                clones.add(line.strip().split('\t')[0])
        return permutations(clones, 2)

    @property
    def concall_dir(self):
        return '{}/concall'.format(self.out_dir)

    @property
    def concall_file(self):
        return '{}/{}.{}_call_n{}_{}AFcutoff.txt'.format(
            self.concall_dir, self.sample_name, self.var_type,
            len(self.caller), str(self.min_af).replace('0.', ''))

    @property
    def explscore_file(self):
        return '{}/{}pairwise_union.{}_call_n{}_{}AFcutoff.expl_score.txt'.format(
            self.out_dir, self.out_prefix, self.var_type,
            len(self.caller), str(self.min_af).replace('0.',''))
    @property
    def explscore_file_ok(self):
        return self.skip_on and checksum_match(self.explscore_file)

    def _prepare_dir(self):
        make_dir(self.concall_dir)

    def _explscore(self, hold_jid):
        concall_flist = '{}/{}concall_list.{}_call_n{}_{}AFcutoff.txt'.format(
            self.out_dir, self.out_prefix, self.var_type,
            len(self.caller), str(self.min_af).replace('0.',''))
        with open(concall_flist, 'w') as out:
            for clone, tissue in self.sample_list:
                self.clone = clone
                self.tissue = tissue
                out.write(self.concall_file + '\n')
        qopt = '-N expl_score -e q.err -o q.out -v BIN_PATH={}'.format(self.bin_path)
        if hold_jid != '':
            qopt += ' -hold_jid {}'.format(hold_jid)
        cmd =  '{}/expl_score.sh {} {}'.format(
            self.script_dir, concall_flist, self.explscore_file)
        return self.q.submit(qopt, cmd)

    def run(self):
        if self.explscore_file_ok:
            self._skip_msg('calling')
            self._skip_msg('af_calc')
            self._skip_msg('con_call')
            self._skip_msg('expl_score')
        else:
            jids = []
            for clone, tissue in self.sample_list:
                self.clone = clone
                self.tissue = tissue
                jids.append(super()._run())
            hold_jid = ','.join(jid for jid in jids if jid != '')
            self._explscore(hold_jid)
            self._run_msg('expl_score')
            end_msg(self.q.j_total)


text:
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:paddingTop="?android:attr/actionBarSize"
    android:id="@+id/listview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="it.carlom.stickyheader.example.fragment.MainFragment" />


text:
+++
title = "Groups"
developer = "Tlon"
shortcode = "~lander-dister-dozzod-dozzod/landscape"
description = "A suite of applications to communicate on Urbit"
license = "MIT"
website = "https://tlon.io"
bgColor = "#DC5F3F"
+++

Groups is Tlon's flagship app: a community center, workspace, gallery, publisher, and messenger. Designed as a tool for collectives and organizations of various sizes on Urbit, Groups can host a company communication suite, a DAO, a blog, a music syndicate, and just about anything that involves collaboration, publication, or communication.

![Screenshot](https://storage.googleapis.com/media.urbit.org/site/ecosystem/applications/groups.png)

*Messages–send encrypted direct messages to one or many friends:*

Reach out to your friends directly via Messages, a simple chat tool that lets you talk one-on-one or with many.

*Notebooks–write and publish documents or blog posts:*

Write a blog post, create a magazine, draft an announcement or documentation using Notebooks, a short and long form text editor. You can add images, give other ships permission to comment on your posts, and mirror your content on the mainnet with ~tirrel's %studio app.

*Collections–maintain a mood board and gather links:*

Assemble a feed of images, save links for later, make a mood board, or start a forum on Collections, a repository for day-to-day digital trawling.

*Profiles–personalize your Urbit ID:*

Make your Urbit ID yours: set a nickname, write a bio, change your avatar, or choose to stay anonymous. You can also pin featured groups on your profile. Hint: It's a good way to share and discover new groups to join.


text:
<archimate:Folder
    xmlns:archimate="http://www.archimatetool.com/archimate"
    name="Running and testing commands"
    id="32e922b9-9990-4bd0-8653-3acf0b4ca111"
    documentation="Now that you've installed Node.js, we want to do two things—verify that the installation was successful, and familiarize you with the command-line tools.
"/>


text:
using System;
using System.Linq;

namespace Treenumerable
{
    public static partial class TreeWalkerExtensions
    {
        /// <summary>
        /// Gets the root node of a tree given a node in that tree.
        /// </summary>
        /// <typeparam name="T">The type of elements in the tree.</typeparam>
        /// <param name="walker">
        /// The <see cref="ITreeWalker<T>"/> that knows how to find the parent and child nodes.
        /// </param>
        /// <param name="node">
        /// The node from which the search for the root node will begin.
        /// </param>
        /// <returns>
        /// The root node of a tree.
        /// </returns>
        public static T GetRoot<T>(this ITreeWalker<T> walker, T node)
        {
            // Validate parameters.
            if (walker == null)
            {
                throw new ArgumentNullException("walker");
            }

            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            // Get the node's ancestors and return the last one, or the node itself , if the node
            // has no ancestors.
            return
                walker
                .GetAncestorsAndSelf(node)
                .Last();
        }
    }
}


text:
using System;

namespace MongoDB.Bson
{
    /// <summary>
    /// Represents a BSON JavaScript value with a scope.
    /// </summary>
    [Serializable]
    public class BsonJavaScriptWithScope : BsonJavaScript, IComparable<BsonJavaScriptWithScope>, IEquatable<BsonJavaScriptWithScope>
    {
        // private fields
        private BsonDocument _scope;

        // constructors
        /// <summary>
        /// Initializes a new instance of the BsonJavaScriptWithScope class.
        /// </summary>
        /// <param name="code">The JavaScript code.</param>
        /// <param name="scope">A scope (a set of variables with values).</param>
        public BsonJavaScriptWithScope(string code, BsonDocument scope)
            : base(code, BsonType.JavaScriptWithScope)
        {
            if (scope == null)
            {
                throw new ArgumentNullException("scope");
            }
            _scope = scope;
        }

        // public operators
        /// <summary>
        /// Compares two BsonJavaScriptWithScope values.
        /// </summary>
        /// <param name="lhs">The first BsonJavaScriptWithScope.</param>
        /// <param name="rhs">The other BsonJavaScriptWithScope.</param>
        /// <returns>True if the two BsonJavaScriptWithScope values are not equal according to ==.</returns>
        public static bool operator !=(BsonJavaScriptWithScope lhs, BsonJavaScriptWithScope rhs)
        {
            return !(lhs == rhs);
        }

        /// <summary>
        /// Compares two BsonJavaScriptWithScope values.
        /// </summary>
        /// <param name="lhs">The first BsonJavaScriptWithScope.</param>
        /// <param name="rhs">The other BsonJavaScriptWithScope.</param>
        /// <returns>True if the two BsonJavaScriptWithScope values are equal according to ==.</returns>
        public static bool operator ==(BsonJavaScriptWithScope lhs, BsonJavaScriptWithScope rhs)
        {
            if (object.ReferenceEquals(lhs, null)) { return object.ReferenceEquals(rhs, null); }
            return lhs.Equals(rhs);
        }

        // public properties
        /// <summary>
        /// Gets the scope (a set of variables with values).
        /// </summary>
        public BsonDocument Scope
        {
            get { return _scope; }
        }

        // public static methods
        /// <summary>
        /// Creates a new BsonJavaScriptWithScope.
        /// </summary>
        /// <param name="value">An object to be mapped to a BsonJavaScriptWithScope.</param>
        /// <returns>A BsonJavaScriptWithScope or null.</returns>
        public new static BsonJavaScriptWithScope Create(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            return (BsonJavaScriptWithScope)BsonTypeMapper.MapToBsonValue(value, BsonType.JavaScriptWithScope);
        }

        // public methods
        /// <summary>
        /// Creates a shallow clone of the BsonJavaScriptWithScope (see also DeepClone).
        /// </summary>
        /// <returns>A shallow clone of the BsonJavaScriptWithScope.</returns>
        public override BsonValue Clone()
        {
            return new BsonJavaScriptWithScope(Code, (BsonDocument)_scope.Clone());
        }

        /// <summary>
        /// Creates a deep clone of the BsonJavaScriptWithScope (see also Clone).
        /// </summary>
        /// <returns>A deep clone of the BsonJavaScriptWithScope.</returns>
        public override BsonValue DeepClone()
        {
            BsonJavaScriptWithScope clone = new BsonJavaScriptWithScope(Code, new BsonDocument());
            foreach (BsonElement element in _scope)
            {
                clone._scope.Add(element.DeepClone());
            }
            return clone;
        }

        /// <summary>
        /// Compares this BsonJavaScriptWithScope to another BsonJavaScriptWithScope.
        /// </summary>
        /// <param name="other">The other BsonJavaScriptWithScope.</param>
        /// <returns>A 32-bit signed integer that indicates whether this BsonJavaScriptWithScope is less than, equal to, or greather than the other.</returns>
        public int CompareTo(BsonJavaScriptWithScope other)
        {
            if (other == null) { return 1; }
            int r = Code.CompareTo(other.Code);
            if (r != 0) { return r; }
            return _scope.CompareTo(other._scope);
        }

        /// <summary>
        /// Compares the BsonJavaScriptWithScope to another BsonValue.
        /// </summary>
        /// <param name="other">The other BsonValue.</param>
        /// <returns>A 32-bit signed integer that indicates whether this BsonJavaScriptWithScope is less than, equal to, or greather than the other BsonValue.</returns>
        public override int CompareTo(BsonValue other)
        {
            if (other == null) { return 1; }
            var otherJavaScriptWithScope = other as BsonJavaScriptWithScope;
            if (otherJavaScriptWithScope != null)
            {
                return CompareTo(otherJavaScriptWithScope);
            }
            return CompareTypeTo(other);
        }

        /// <summary>
        /// Compares this BsonJavaScriptWithScope to another BsonJavaScriptWithScope.
        /// </summary>
        /// <param name="rhs">The other BsonJavaScriptWithScope.</param>
        /// <returns>True if the two BsonJavaScriptWithScope values are equal.</returns>
        public bool Equals(BsonJavaScriptWithScope rhs)
        {
            if (object.ReferenceEquals(rhs, null) || GetType() != rhs.GetType()) { return false; }
            return Code == rhs.Code && _scope == rhs._scope;
        }

        /// <summary>
        /// Compares this BsonJavaScriptWithScope to another object.
        /// </summary>
        /// <param name="obj">The other object.</param>
        /// <returns>True if the other object is a BsonJavaScriptWithScope and equal to this one.</returns>
        public override bool Equals(object obj)
        {
            return Equals(obj as BsonJavaScriptWithScope); // works even if obj is null or of a different type
        }

        /// <summary>
        /// Gets the hash code.
        /// </summary>
        /// <returns>The hash code.</returns>
        public override int GetHashCode()
        {
            // see Effective Java by Joshua Bloch
            int hash = 17;
            hash = 37 * hash + base.GetHashCode();
            hash = 37 * hash + _scope.GetHashCode();
            return hash;
        }

        /// <summary>
        /// Returns a string representation of the value.
        /// </summary>
        /// <returns>A string representation of the value.</returns>
        public override string ToString()
        {
            return string.Format("new BsonJavaScript(\"{0}\", {1})", Code, _scope.ToJson());
        }
    }
}


text:
using System;
using Telerik.UI.Xaml.Controls.Input;
using Windows.UI.Xaml.Controls;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace SDKExamples.UWP.Rating
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class Selection : ExamplePageBase
    {
        public Selection()
        {
            this.InitializeComponent();

            this.selectionCombo.ItemsSource = Enum.GetValues(typeof(RatingSelectionMode));
            this.selectionCombo.SelectedIndex = 0;
        }

        private void SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.rating.RatingSelectionMode = (RatingSelectionMode)(sender as ComboBox).SelectedItem;
        }
    }
}


text:
class Team < ApplicationRecord
  validates :name, presence: true, uniqueness: true, length: { maximum: 20 }
end


text:
package com.zimbra.cs.index;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

import org.apache.lucene.document.DateTools;
import org.apache.lucene.document.Document;

import com.google.common.base.Objects;
import com.zimbra.common.service.ServiceException;
import com.zimbra.cs.mailbox.Mailbox;
import com.zimbra.cs.mailbox.MailItem;
import com.zimbra.cs.mailbox.MailboxManager;
import com.zimbra.cs.mailbox.Message;
import com.zimbra.cs.mailbox.Tag;
import com.zimbra.cs.mime.ParsedAddress;

import com.zimbra.common.util.Log;
import com.zimbra.common.util.LogFactory;

/**
 * Efficient Read-access to a {@link Message} returned from a query. APIs mirror
 * the APIs on {@link Message}, but are read-only. The real archive.mailbox.Message
 * can be retrieved, but this should only be done if write-access is necessary.
 *
 * @since Oct 15, 2004
 * @author tim
 */
public final class MessageHit extends ZimbraHit {

    private static final Log LOG = LogFactory.getLog(MessageHit.class);

    private Document document = null;
    private Message message = null;
    private List<MessagePartHit> matchedParts = null;
    private int conversationId = 0;
    private int messageId = 0;
    private ConversationHit conversationHit = null;

    MessageHit(ZimbraQueryResultsImpl results, Mailbox mbx, int id, Message msg, Document doc, Object sortValue) {
        super(results, mbx, sortValue);
        messageId = id;
        message = msg;
        document = doc;
    }

    int getFolderId() throws ServiceException {
        return getMessage().getFolderId();
    }

    @Override
    public int getConversationId() throws ServiceException {
        if (conversationId == 0) {
            conversationId = getMessage().getConversationId();
        }
        return conversationId;
    }

    public void addPart(MessagePartHit part) {
        if (matchedParts == null) {
            matchedParts = new ArrayList<MessagePartHit>();
        }
        if (!matchedParts.contains(part)) {
            matchedParts.add(part);
        }
    }

    public List<MessagePartHit> getMatchedMimePartNames() {
        return matchedParts;
    }

    @Override
    public int getItemId() {
        return messageId;
    }

    @Override
    public String toString() {
        try {
            return Objects.toStringHelper(this)
                .add("id", getItemId())
                .add("conv", getConversationId())
                .addValue(super.toString())
                .toString();
        } catch (ServiceException e) {
            return e.toString();
        }
    }

    public boolean isTagged(Tag tag) throws ServiceException {
        return getMessage().isTagged(tag);
    }

    @Override
    void setItem(MailItem item) {
        message = (Message) item;
    }

    @Override
    boolean itemIsLoaded() {
        return message != null;
    }

    @Override
    public MailItem getMailItem() throws ServiceException {
        return getMessage();
    }

    public Message getMessage() throws ServiceException {
        if (message == null) {
            Mailbox mbox = MailboxManager.getInstance().getMailboxById(
                    getMailbox().getId());
            int messageId = getItemId();
            try {
                message = mbox.getMessageById(null, messageId);
            } catch (ServiceException e) {
                LOG.error("Failed to get message mbox=%d,id=%d", mbox.getId(), messageId, e);
                throw e;
            }
        }
        return message;
    }

    @Override
    public String getName() throws ServiceException {
        if (cachedName == null) {
            cachedName = getSender();
        }
        return cachedName;
    }

    public long getDateHeader() throws ServiceException {
        if (message == null && document != null) {
            String dateStr = document.get(LuceneFields.L_SORT_DATE);
            if (dateStr != null) {
                try {
                    return DateTools.stringToTime(dateStr);
                } catch (ParseException e) {
                    return 0;
                }
            } else {
                return 0;
            }
        }
        return getMessage().getDate();
    }

    public String getSender() throws ServiceException {
        return new ParsedAddress(getMessage().getSender()).getSortString();
    }

    /**
     * Returns a {@link ConversationHit} corresponding to this message's conversation.
     */
    public ConversationHit getConversationResult() throws ServiceException {
        if (conversationHit == null) {
            Integer cid = Integer.valueOf(getConversationId());
            conversationHit = getResults().getConversationHit(getMailbox(), cid, sortValue);
            conversationHit.addMessageHit(this);
        }
        return conversationHit;
    }
}


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorPrimaryDark</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.LoginActionBar">
        <item name="windowActionBar">false</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

    <style name="customLayoutStyle">
        <item name="android:background">#f2f2f2</item>
    </style>

    <style name="EditScreenTextInputLayoutStyle" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorControlNormal">@color/white</item>
        <item name="colorControlActivated">@color/white</item>
        <item name="colorControlHighlight">@color/white</item>
        <item name="colorAccent">@color/white</item>
        <item name="android:textColorHint">@color/white</item>
    </style>
    <style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
        <item name="tabIndicatorColor">@color/colorAccent</item>
        <item name="tabIndicatorHeight">3dp</item>
        <item name="tabBackground">@color/colorPrimary</item>
        <item name="tabTextAppearance">@style/MyCustomTabTextAppearance</item>
        <item name="tabSelectedTextColor">@color/colorAccent</item>
    </style>
    <style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab">
        <item name="android:textSize">14sp</item>
        <item name="android:textColor">@color/f5f5f5</item>
        <item name="textAllCaps">true</item>
    </style>
    <style name="WysiwygEditText">
        <item name="android:lineSpacingMultiplier">1.3</item>
        <item name="android:textColor">#000</item>
    </style>

</resources>


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

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

<link rel="shortcut icon" href="http://www.wnet.org/wnet_favicon.ico"  type="image/favicon"/>
<link rel="alternate" type="application/rss+xml" title="WNET RSS Feed" href="http://www.wnet.org/feed/" />
<link rel="alternate" type="application/atom+xml" title="WNET Atom Feed" href="http://www.wnet.org/feed/atom/" />
<link rel="pingback" href="http://www.wnet.org/xmlrpc.php" />

<title>WNET Audit Committee Meetings | WNET</title>
<link rel="canonical" href="http://www.wnet.org/blog/2013/12/16/audit-committee/" />
<meta property='og:locale' content='en_us'/>
<meta property='og:title' content='WNET Audit Committee Meetings | WNET'/>
<meta property='og:url' content='http://www.wnet.org/blog/2013/12/16/audit-committee/'/>
<meta property='og:site_name' content='WNET'/>
<meta property='og:type' content='article'/>

<link rel='stylesheet' id='wnet-convio-subscribe-css'  href='http://www.wnet.org/wp-content/plugins/wnet-convio-subscribe/libs/css/wnet-convio-subscribe.css?ver=1.1' type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css'  href='http://cn1.wnet.org/wp-includes/js/thickbox/thickbox.css?ver=3.4.2' type='text/css' media='all' />
<link rel='stylesheet' id='theme-wnet-1-css'  href='http://cn1.wnet.org/wp-content/themes/wnet/css/site-new.css?ver=1.0' type='text/css' media='all' />
<link rel='stylesheet' id='theme-wnet-2-css'  href='http://cn1.wnet.org/wp-content/themes/wnet/css/print.css?ver=1.0' type='text/css' media='print' />
<link rel='stylesheet' id='popup-css'  href='http://www.wnet.org/wp-content/plugins/pledge-popup/assets/css/popup.css?ver=3.4.2' type='text/css' media='all' />
<link rel='stylesheet' id='colorbox-css'  href='http://www.wnet.org/wp-content/plugins/pledge-popup/assets/css/colorbox.css?ver=3.4.2' type='text/css' media='all' />
<link rel='stylesheet' id='wp-pagenavi-css'  href='http://www.wnet.org/wp-content/plugins/wp-pagenavi/pagenavi-css.css?ver=2.70' type='text/css' media='all' />

<meta name="generator" content="WordPress 3.4.2" />

<form method="get" id="searchform" action="http://www.wnet.org/search-results/">
<input type="text" name="q" class="searchbox"  value="Search WNET" onfocus="if (this.value == 'Search WNET') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search WNET';}"/>
<input type="submit" name="submit" value="search" class="submit" />
</form>

Home

About

Introduction

Our Mission

Leadership

Trustees

Public Meetings

Financials

2013 Annual Review

Production Companies

Interactive

Education

Tisch WNET Studios

Internships

Privacy Policy

Terms of Service

Contact

EEO

CPB Reports

Support

Introduction

Sponsorship

Individual Giving

Bequests and Planned Gifts

Corporate Membership

Membership

Pressroom

THIRTEEN Pressroom

WLIW 21 Pressroom

Channels

THIRTEEN

WLIW21

NJTV

KidsTHIRTEEN

WLIW Create

WLIW World

V-me

Careers

		DONATE

WNET Audit Committee Meetings

AUDIT COMMITTEE (at Skadden, Arps, Slate, Meagher & Flom LLP 4 Times Square, 42nd St. between Bwy and Sixth Ave.)

Tuesday, September 24, 2013 at 2:30 PM **Telephonic

Monday, November 25, 2013 at 3:00 PM

Tuesday, April 22, 2014 at 1:00 PM

** To request the toll-free conference call-in number, please call (212) 560 – 6928

Receive updates by email from WNET

		<form class="form-wnet-convio" data-randid="9094" data-optin="" method="post" name="emailForm" action="http://www.wnet.org/wp-admin/admin-ajax.php">
		<input type="hidden" name="action" id="action" value="convio_email_form">
		<input type="hidden" name="nonce" id="nonce" value="601b996cfa">
		<input type="hidden" name="from" id="from" value="homepage">
		<input type="hidden" name="interestids" id="interestids" value="1606,2541,2461,2561">
		<input type="text" id="email" name="email" class="emailfield" placeholder="Enter email address" />
		<button type="submit" class="emailsubmit" style="background-color: #FDAF17; border-color: #FDAF17;">SUBMIT</button>
		</form>

contact
TV schedule
pbs.org
pressroom
Public Files
privacy policy
terms of service

 ©2015 WNET    825 Eighth Avenue    New York, NY 10019

©2015 WNET    825 Eighth Avenue    New York, NY 10019


text:
package influxdb

import (
	"context"
	"errors"
	"fmt"
	"log"
	"math/rand"
	"net/url"
	"time"

	"github.com/influxdata/telegraf"
	"github.com/influxdata/telegraf/internal"
	"github.com/influxdata/telegraf/internal/tls"
	"github.com/influxdata/telegraf/plugins/outputs"
	"github.com/influxdata/telegraf/plugins/serializers/influx"
)

var (
	defaultURL = "http://localhost:8086"

	ErrMissingURL = errors.New("missing URL")
)

type Client interface {
	Write(context.Context, []telegraf.Metric) error
	CreateDatabase(ctx context.Context) error

	URL() string
	Database() string
}

// InfluxDB struct is the primary data structure for the plugin
type InfluxDB struct {
	URL                  string   // url deprecated in 0.1.9; use urls
	URLs                 []string `toml:"urls"`
	Username             string
	Password             string
	Database             string
	UserAgent            string
	RetentionPolicy      string
	WriteConsistency     string
	Timeout              internal.Duration
	UDPPayload           internal.Size     `toml:"udp_payload"`
	HTTPProxy            string            `toml:"http_proxy"`
	HTTPHeaders          map[string]string `toml:"http_headers"`
	ContentEncoding      string            `toml:"content_encoding"`
	SkipDatabaseCreation bool              `toml:"skip_database_creation"`
	InfluxUintSupport    bool              `toml:"influx_uint_support"`
	tls.ClientConfig

	Precision string // precision deprecated in 1.0; value is ignored

	clients []Client

	CreateHTTPClientF func(config *HTTPConfig) (Client, error)
	CreateUDPClientF  func(config *UDPConfig) (Client, error)

	serializer *influx.Serializer
}

var sampleConfig = `
  ## The full HTTP or UDP URL for your InfluxDB instance.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  # urls = ["unix:///var/run/influxdb.sock"]
  # urls = ["udp://127.0.0.1:8089"]
  # urls = ["http://127.0.0.1:8086"]

  ## The target database for metrics; will be created as needed.
  ## For UDP url endpoint database needs to be configured on server side.
  # database = "telegraf"

  ## If true, no CREATE DATABASE queries will be sent.  Set to true when using
  ## Telegraf with a user without permissions to create databases or when the
  ## database already exists.
  # skip_database_creation = false

  ## Name of existing retention policy to write to.  Empty string writes to
  ## the default retention policy.  Only takes effect when using HTTP.
  # retention_policy = ""

  ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  ## Only takes effect when using HTTP.
  # write_consistency = "any"

  ## Timeout for HTTP messages.
  # timeout = "5s"

  ## HTTP Basic Auth
  # username = "telegraf"
  # password = "metricsmetricsmetricsmetrics"

  ## HTTP User-Agent
  # user_agent = "telegraf"

  ## UDP payload size is the maximum packet size to send.
  # udp_payload = "512B"

  ## Optional TLS Config for use on HTTP connections.
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## HTTP Proxy override, if unset values the standard proxy environment
  ## variables are consulted to determine which proxy, if any, should be used.
  # http_proxy = "http://corporate.proxy:3128"

  ## Additional HTTP headers
  # http_headers = {"X-Special-Header" = "Special-Value"}

  ## HTTP Content-Encoding for write request body, can be set to "gzip" to
  ## compress body or "identity" to apply no encoding.
  # content_encoding = "identity"

  ## When true, Telegraf will output unsigned integers as unsigned values,
  ## i.e.: "42u".  You will need a version of InfluxDB supporting unsigned
  ## integer values.  Enabling this option will result in field type errors if
  ## existing data has been written.
  # influx_uint_support = false
`

func (i *InfluxDB) Connect() error {
	ctx := context.Background()

	urls := make([]string, 0, len(i.URLs))
	urls = append(urls, i.URLs...)
	if i.URL != "" {
		urls = append(urls, i.URL)
	}

	if len(urls) == 0 {
		urls = append(urls, defaultURL)
	}

	i.serializer = influx.NewSerializer()
	if i.InfluxUintSupport {
		i.serializer.SetFieldTypeSupport(influx.UintSupport)
	}

	for _, u := range urls {
		parts, err := url.Parse(u)
		if err != nil {
			return fmt.Errorf("error parsing url [%q]: %v", u, err)
		}

		var proxy *url.URL
		if len(i.HTTPProxy) > 0 {
			proxy, err = url.Parse(i.HTTPProxy)
			if err != nil {
				return fmt.Errorf("error parsing proxy_url [%s]: %v", i.HTTPProxy, err)
			}
		}

		switch parts.Scheme {
		case "udp", "udp4", "udp6":
			c, err := i.udpClient(parts)
			if err != nil {
				return err
			}

			i.clients = append(i.clients, c)
		case "http", "https", "unix":
			c, err := i.httpClient(ctx, parts, proxy)
			if err != nil {
				return err
			}

			i.clients = append(i.clients, c)
		default:
			return fmt.Errorf("unsupported scheme [%q]: %q", u, parts.Scheme)
		}
	}

	return nil
}

func (i *InfluxDB) Close() error {
	return nil
}

func (i *InfluxDB) Description() string {
	return "Configuration for sending metrics to InfluxDB"
}

func (i *InfluxDB) SampleConfig() string {
	return sampleConfig
}

// Write sends metrics to one of the configured servers, logging each
// unsuccessful. If all servers fail, return an error.
func (i *InfluxDB) Write(metrics []telegraf.Metric) error {
	ctx := context.Background()

	var err error
	p := rand.Perm(len(i.clients))
	for _, n := range p {
		client := i.clients[n]
		err = client.Write(ctx, metrics)
		if err == nil {
			return nil
		}

		switch apiError := err.(type) {
		case *APIError:
			if !i.SkipDatabaseCreation {
				if apiError.Type == DatabaseNotFound {
					err := client.CreateDatabase(ctx)
					if err != nil {
						log.Printf("E! [outputs.influxdb] when writing to [%s]: database %q not found and failed to recreate",
							client.URL(), client.Database())
					}
				}
			}
		}

		log.Printf("E! [outputs.influxdb] when writing to [%s]: %v", client.URL(), err)
	}

	return errors.New("could not write any address")
}

func (i *InfluxDB) udpClient(url *url.URL) (Client, error) {
	config := &UDPConfig{
		URL:            url,
		MaxPayloadSize: int(i.UDPPayload.Size),
		Serializer:     i.serializer,
	}

	c, err := i.CreateUDPClientF(config)
	if err != nil {
		return nil, fmt.Errorf("error creating UDP client [%s]: %v", url, err)
	}

	return c, nil
}

func (i *InfluxDB) httpClient(ctx context.Context, url *url.URL, proxy *url.URL) (Client, error) {
	tlsConfig, err := i.ClientConfig.TLSConfig()
	if err != nil {
		return nil, err
	}

	config := &HTTPConfig{
		URL:             url,
		Timeout:         i.Timeout.Duration,
		TLSConfig:       tlsConfig,
		UserAgent:       i.UserAgent,
		Username:        i.Username,
		Password:        i.Password,
		Proxy:           proxy,
		ContentEncoding: i.ContentEncoding,
		Headers:         i.HTTPHeaders,
		Database:        i.Database,
		RetentionPolicy: i.RetentionPolicy,
		Consistency:     i.WriteConsistency,
		Serializer:      i.serializer,
	}

	c, err := i.CreateHTTPClientF(config)
	if err != nil {
		return nil, fmt.Errorf("error creating HTTP client [%s]: %v", url, err)
	}

	if !i.SkipDatabaseCreation {
		err = c.CreateDatabase(ctx)
		if err != nil {
			log.Printf("W! [outputs.influxdb] when writing to [%s]: database %q creation failed: %v",
				c.URL(), c.Database(), err)
		}
	}

	return c, nil
}

func init() {
	outputs.Add("influxdb", func() telegraf.Output {
		return &InfluxDB{
			Timeout: internal.Duration{Duration: time.Second * 5},
			CreateHTTPClientF: func(config *HTTPConfig) (Client, error) {
				return NewHTTPClient(config)
			},
			CreateUDPClientF: func(config *UDPConfig) (Client, error) {
				return NewUDPClient(config)
			},
		}
	})
}


text:
import { isNullOrUndefined } from '../../../util/node-utilities';

export class FieldOption {
  private _value: string;
  private _displayValue: string;

  constructor(value?: string, displayValue?: string) {
    this._value = value;
    this._displayValue = displayValue;
  }

  get value(): string {
    return this._value;
  }

  set value(value: string) {
    this._value = value;
  }

  get displayValue(): string {
    if (isNullOrUndefined(this._displayValue) || '' === this._displayValue) {
      return this.value;
    }
    return this._displayValue;
  }

  set displayValue(value: string) {
    this._displayValue = value;
  }
}


text:
<!doctype html>
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
  <title>app-route</title>

  <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../../web-component-tester/browser.js"></script>
  <script src="../../url/url.js"></script>

  <link rel="import" href="../../polymer/polymer.html">
  <link rel="import" href="./app-example-1.html">
</head>
<body>
  <test-fixture id="ExampleApp">
    <template>
      <app-example-1></app-example-1>
    </template>
  </test-fixture>
<script>
  'use strict';

  function setLocation(url) {
    window.history.pushState({}, '', url);
    Polymer.Base.fire('location-changed', {}, { node: window });
  }

  suite('<test-app-example-1>', function () {
    var originalLocation;
    var exampleApp;

    setup(function() {
      originalLocation = window.location.href;
      exampleApp = fixture('ExampleApp');
    });

    teardown(function() {
      window.history.replaceState({}, '', originalLocation);
    });

    test('runs through basic usage', function() {
      // Navigate to /lol
      setLocation('/lol');

      expect(exampleApp.data).to.be.deep.eq({
        page: 'lol'
      });
      expect(exampleApp.userData).to.be.deep.eq({
      });
      expect(exampleApp.route).to.be.deep.eq({
        prefix: '',
        path: '/lol',
        __queryParams: {}
      });
      expect(exampleApp.userRoute).to.be.deep.eq({
        prefix: null,
        path: null,
        __queryParams: {}
      });
      expect(window.location.pathname).to.be.equal('/lol');

      // Navigate to /user
      setLocation('/user');
      expect(exampleApp.data).to.be.deep.eq({
        page: 'user'
      });

      // We should have redirected to /user/view because of a redirect in
      // the example app code.
      expect(exampleApp.route).to.be.deep.eq({
        prefix: '',
        path: '/user/view',
        __queryParams: {}
      });
      expect(exampleApp.userRoute).to.be.deep.eq({
        prefix: '/user',
        path: '/view',
        __queryParams: {}
      });
      expect(window.location.pathname).to.be.equal('/user/view');

      // Navigate to /user/details
      setLocation('/user/details');
      expect(exampleApp.data).to.be.deep.eq({
        page: 'user'
      });
      expect(exampleApp.userData).to.be.deep.eq({
        page: 'details'
      });
      expect(exampleApp.route).to.be.deep.eq({
        prefix: '',
        path: '/user/details',
        __queryParams: {}
      });
      expect(exampleApp.userRoute).to.be.deep.eq({
        prefix: '/user',
        path: '/details',
        __queryParams: {}
      });
      expect(window.location.pathname).to.be.equal('/user/details');

      exampleApp.set('data.page', 'redirectToUser');
      expect(window.location.pathname).to.be.equal('/user/view');

      // This triggers two redirects in a row!
      setLocation('/redirectToUser');
      expect(window.location.pathname).to.be.equal('/user/view');

      // Data binding changes to a different user subpage.
      exampleApp.set('userData.page', 'profile');
      expect(window.location.pathname).to.be.eq('/user/profile');

      // Data binding changes to the aunt of the current page.
      exampleApp.set('data.page', 'feed');
      expect(window.location.pathname).to.be.eq('/feed');

      setLocation('/user/etc');
      exampleApp.set('userData.page', 'details');
      expect(window.location.pathname).to.be.eq('/user/details')

      expect(window.location.search).to.be.eq('');
      exampleApp.set('userQueryParams.foo', 'bar');
      expect(window.location.search).to.be.eq('?foo=bar');

      exampleApp.userQueryParams = {bar: 'baz'};
      expect(window.location.search).to.be.eq('?bar=baz');
    });
  });
</script>
</body>


text:
{% extends base.html %}
{% block title %}
{% if notebook_name is None %}
  Home
{% else %}
  {{ notebook_name }}
{% end if %}
{% end block %}
{% block body %}

{{ notebook_name }}

  <button class="btn btn-primary visible-xs" onclick="$('.row-offcanvas').toggleClass('active');">< Notes</button>
{% end block %}


text:
package image // import "github.com/docker/docker/api/server/router/image"

import (
	"github.com/docker/docker/api/server/router"
	"github.com/docker/docker/image"
	"github.com/docker/docker/layer"
	"github.com/docker/docker/reference"
)

// imageRouter is a router to talk with the image controller
type imageRouter struct {
	backend          Backend
	referenceBackend reference.Store
	imageStore       image.Store
	layerStore       layer.Store
	routes           []router.Route
}

// NewRouter initializes a new image router
func NewRouter(backend Backend, referenceBackend reference.Store, imageStore image.Store, layerStore layer.Store) router.Router {
	ir := &imageRouter{
		backend:          backend,
		referenceBackend: referenceBackend,
		imageStore:       imageStore,
		layerStore:       layerStore,
	}
	ir.initRoutes()
	return ir
}

// Routes returns the available routes to the image controller
func (ir *imageRouter) Routes() []router.Route {
	return ir.routes
}

// initRoutes initializes the routes in the image router
func (ir *imageRouter) initRoutes() {
	ir.routes = []router.Route{
		// GET
		router.NewGetRoute("/images/json", ir.getImagesJSON),
		router.NewGetRoute("/images/search", ir.getImagesSearch),
		router.NewGetRoute("/images/get", ir.getImagesGet),
		router.NewGetRoute("/images/{name:.*}/get", ir.getImagesGet),
		router.NewGetRoute("/images/{name:.*}/history", ir.getImagesHistory),
		router.NewGetRoute("/images/{name:.*}/json", ir.getImagesByName),
		// POST
		router.NewPostRoute("/images/load", ir.postImagesLoad),
		router.NewPostRoute("/images/create", ir.postImagesCreate),
		router.NewPostRoute("/images/{name:.*}/push", ir.postImagesPush),
		router.NewPostRoute("/images/{name:.*}/tag", ir.postImagesTag),
		router.NewPostRoute("/images/prune", ir.postImagesPrune),
		// DELETE
		router.NewDeleteRoute("/images/{name:.*}", ir.deleteImages),
	}
}


text:
<?php namespace App\Http\Controllers;

use App\Article;
use App\Category;
use Illuminate\Support\Facades\Auth;

class HomeController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| Home Controller
	|--------------------------------------------------------------------------
	|
	| This controller renders your application's "dashboard" for users that
	| are authenticated. Of course, you are free to change or remove the
	| controller as you wish. It is just here to get your app started!
	|
	*/

	/**
	 * Create a new controller instance.
	 *
	 * @return void
	 */
	public function __construct()
	{

	}

	/**
	 * Show the application dashboard to the user.
	 *
	 * @return Response
	 */
	public function index()
	{
		$obj      = new Category();
		$cat      = $obj->getAllCategories();

		$obj2     = new Article();
		$article  = $obj2->getNewArticles();

		return view('index')
			      ->withCat($cat)
			      ->withArt($article);
	}

	public function logout()
	{
		Auth::logout();

		return redirect('/');

	}

}


text:
import React from "react"
import { commitMutation, graphql } from "react-relay"
import styled from "styled-components"

import {
  CollectorIntentUpdateCollectorProfileMutation,
  Intents,
} from "__generated__/CollectorIntentUpdateCollectorProfileMutation.graphql"
import { SystemContextProps, withSystemContext } from "Artsy"
import Colors from "../../../Assets/Colors"
import { MultiButtonState } from "../../Buttons/MultiStateButton"
import { media } from "../../Helpers"
import SelectableToggle from "../SelectableToggle"
import { StepProps } from "../Types"
import { Layout } from "./Layout"

const OptionsContainer = styled.div`
  width: 450px;
  margin: 0 auto 100px;
  &:last-child {
    border-bottom: 1px solid ${Colors.grayRegular};
  }
  ${media.sm`
    width: 100%;
    margin-bottom: 20px;
  `};
`

type Props = StepProps & SystemContextProps

interface State {
  selectedOptions: { [option: string]: boolean }
  error?: string
}

export class CollectorIntentComponent extends React.Component<Props, State> {
  static slug: "interests" = "interests"

  static intentEnum = {
    "buy art & design": "BUY_ART_AND_DESIGN",
    "sell art & design": "SELL_ART_AND_DESIGN",
    "research art prices": "RESEARCH_ART_PRICES",
    "learn about art": "LEARN_ABOUT_ART",
    "find out about new exhibitions": "FIND_ART_EXHIBITS",
    "read art market news": "READ_ART_MARKET_NEWS",
  }

  constructor(props) {
    super(props)

    this.state = {
      selectedOptions: {},
    }
  }

  onOptionSelected = index => {
    const selectedOptions = Object.assign({}, this.state.selectedOptions)
    selectedOptions[index] = !selectedOptions[index]

    this.setState({
      selectedOptions,
    })
  }

  selectedIntents() {
    const intents = Object.values(CollectorIntentComponent.intentEnum).filter(
      (_, index) => this.state.selectedOptions[index]
    ) as Intents[]

    return intents
  }

  submit() {
    commitMutation<CollectorIntentUpdateCollectorProfileMutation>(
      this.props.relayEnvironment,
      {
        mutation: graphql`
          mutation CollectorIntentUpdateCollectorProfileMutation(
            $input: UpdateCollectorProfileInput!
          ) {
            updateCollectorProfile(input: $input) {
              intents
            }
          }
        `,
        variables: {
          input: {
            intents: this.selectedIntents(),
          },
        },
      }
    )

    this.props.onNextButtonPressed()
  }

  render() {
    const options = Object.keys(CollectorIntentComponent.intentEnum).map(
      (text, index) => (
        <SelectableToggle
          key={index}
          text={text}
          onSelect={this.onOptionSelected.bind(this, index)}
          selected={this.state.selectedOptions[index]}
        />
      )
    )

    return (
      <Layout
        title="How would you like to use Artsy?"
        subtitle="Select all that apply"
        onNextButtonPressed={this.submit.bind(this)}
        buttonState={
          this.selectedIntents().length > 0
            ? MultiButtonState.Highlighted
            : MultiButtonState.Default
        }
      >
        <OptionsContainer>{options}</OptionsContainer>
      </Layout>
    )
  }
}

const CollectorIntent = withSystemContext(CollectorIntentComponent)
// tslint:disable:no-string-literal
CollectorIntent["slug"] = CollectorIntentComponent.slug

export default CollectorIntent


text:
class AddSaltToUser < ActiveRecord::Migration
  def change
  	add_column :applications, :recommender, :string
  	add_column :users, :password_hash, :string
  	add_column :users, :password_salt, :string
  end
end


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<APIProxy revision="1" name="test-basepath-extract">
    <ConfigurationVersion majorVersion="4" minorVersion="0"/>
    <CreatedAt>1458322240424</CreatedAt>
    <CreatedBy>dzuluaga@apigee.com</CreatedBy>
    <DisplayName>test-basepath-extract</DisplayName>
    <LastModifiedAt>1458323761104</LastModifiedAt>
    <LastModifiedBy>dzuluaga@apigee.com</LastModifiedBy>
    <Policies>
        <Policy>Extract-Variables-Basepath-Variable</Policy>
        <Policy>JavaScript-Parse-Message-URI</Policy>
    </Policies>
    <ProxyEndpoints>
        <ProxyEndpoint>default</ProxyEndpoint>
    </ProxyEndpoints>
    <Resources>
        <Resource>jsc://JavaScript-1.js</Resource>
    </Resources>
    <TargetServers/>
    <TargetEndpoints/>
    <validate>false</validate>
</APIProxy>


text:
using NUnit.Framework;

using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using HostMe.Sdk.Api;
using HostMe.Sdk.Model;
using HostMe.Sdk.Client;
using System.Reflection;

namespace HostMe.Sdk.Test
{
    /// <summary>
    ///  Class for testing WaiterUpdate
    /// </summary>
    /// <remarks>
    /// This file is automatically generated by Swagger Codegen.
    /// Please update the test case below to test the model.
    /// </remarks>
    [TestFixture]
    public class WaiterUpdateTests
    {
        private WaiterUpdate instance;

        /// <summary>
        /// Setup before each test
        /// </summary>
        [SetUp]
        public void Init()
        {
            instance = new WaiterUpdate();
        }

        /// <summary>
        /// Clean up after each test
        /// </summary>
        [TearDown]
        public void Cleanup()
        {

        }

        /// <summary>
        /// Test an instance of WaiterUpdate
        /// </summary>
        [Test]
        public void WaiterUpdateInstanceTest()
        {
            Assert.IsInstanceOf<WaiterUpdate> (instance, "instance is a WaiterUpdate");
        }

        /// <summary>
        /// Test the property 'Color'
        /// </summary>
        [Test]
        public void ColorTest()
        {
            // TODO: unit test for the property 'Color'
        }
        /// <summary>
        /// Test the property 'FullName'
        /// </summary>
        [Test]
        public void FullNameTest()
        {
            // TODO: unit test for the property 'FullName'
        }
        /// <summary>
        /// Test the property 'Base64DataUrl'
        /// </summary>
        [Test]
        public void Base64DataUrlTest()
        {
            // TODO: unit test for the property 'Base64DataUrl'
        }

    }

}


text:
from math import log
from celeryconfig import config
from redis import StrictRedis
from redis.exceptions import ResponseError
from pprint import pprint

def doc_count(client):
    doc_ids = set()
    key_counts = {}
    for k in client.keys("*"):
        try:
            count = 0
            docs = client.zrevrange(k, 0, -1)
            for d in docs:
                doc_ids.add(d)
                count += 1
            key_counts[k.decode("utf-8")] = count
        except ResponseError:
            pass
    return len(doc_ids), key_counts

def caluclate_idf(doc_count, terms_with_count):
    term_ids = {}
    for k, v in terms_with_count.items():
        term_ids[k] = log(doc_count/v, 2)
    return term_ids

def calculate_tf_ids(client, idfs):
    for k in client.keys("*"):
        try:
            docs = client.zrevrange(k, 0, -1, "WITHSCORES")
            for d in docs:
                tf_idf = log(d[1] + 1) * idfs[k.decode("utf-8")]
                print(client.zadd(k, tf_idf, d[0]))
        except ResponseError:
            pass

if __name__ == "__main__":
    r = StrictRedis(host=config['redis']['host'],
                    port=config['redis']['port'],
                    db=config['redis']['db'])
    total_count, counts = doc_count(r)
    idfs = caluclate_idf(total_count, counts)
    calculate_tf_ids(r, idfs)


text:
#ifndef CORE_ALGORITHMS_FIELDS_TRANSFORMMESH_SCALEFIELDMESHANDDATA_H
#define CORE_ALGORITHMS_FIELDS_TRANSFORMMESH_SCALEFIELDMESHANDDATA_H 1

#include <Core/Algorithms/Base/AlgorithmBase.h>
#include <Core/Algorithms/Legacy/Fields/share.h>

namespace SCIRun {
  namespace Core {
    namespace Algorithms {
      namespace Fields {

        ALGORITHM_PARAMETER_DECL(data_scale);
        ALGORITHM_PARAMETER_DECL(mesh_scale);
        ALGORITHM_PARAMETER_DECL(scale_from_center);

        class SCISHARE ScaleFieldMeshAndDataAlgo : public AlgorithmBase
        {
        public:
          ScaleFieldMeshAndDataAlgo();

          bool runImpl(FieldHandle input, FieldHandle& output) const;

          virtual AlgorithmOutput run(const AlgorithmInput& input) const override;
        };

      }}}}

#endif


text: export { isArrayLike } from 'rxjs/internal-compatibility';


text:
#include "platform/graphics/filters/FESpecularLighting.h"

#include "platform/graphics/filters/LightSource.h"
#include "platform/text/TextStream.h"
#include "wtf/MathExtras.h"
#include <algorithm>

namespace blink {

FESpecularLighting::FESpecularLighting(Filter* filter,
                                       const Color& lightingColor,
                                       float surfaceScale,
                                       float specularConstant,
                                       float specularExponent,
                                       PassRefPtr<LightSource> lightSource)
    : FELighting(filter,
                 SpecularLighting,
                 lightingColor,
                 surfaceScale,
                 0,
                 specularConstant,
                 specularExponent,
                 std::move(lightSource)) {}

FESpecularLighting* FESpecularLighting::create(
    Filter* filter,
    const Color& lightingColor,
    float surfaceScale,
    float specularConstant,
    float specularExponent,
    PassRefPtr<LightSource> lightSource) {
  return new FESpecularLighting(filter, lightingColor, surfaceScale,
                                specularConstant, specularExponent,
                                std::move(lightSource));
}

FESpecularLighting::~FESpecularLighting() {}

Color FESpecularLighting::lightingColor() const {
  return m_lightingColor;
}

bool FESpecularLighting::setLightingColor(const Color& lightingColor) {
  if (m_lightingColor == lightingColor)
    return false;
  m_lightingColor = lightingColor;
  return true;
}

float FESpecularLighting::surfaceScale() const {
  return m_surfaceScale;
}

bool FESpecularLighting::setSurfaceScale(float surfaceScale) {
  if (m_surfaceScale == surfaceScale)
    return false;
  m_surfaceScale = surfaceScale;
  return true;
}

float FESpecularLighting::specularConstant() const {
  return m_specularConstant;
}

bool FESpecularLighting::setSpecularConstant(float specularConstant) {
  specularConstant = std::max(specularConstant, 0.0f);
  if (m_specularConstant == specularConstant)
    return false;
  m_specularConstant = specularConstant;
  return true;
}

float FESpecularLighting::specularExponent() const {
  return m_specularExponent;
}

bool FESpecularLighting::setSpecularExponent(float specularExponent) {
  specularExponent = clampTo(specularExponent, 1.0f, 128.0f);
  if (m_specularExponent == specularExponent)
    return false;
  m_specularExponent = specularExponent;
  return true;
}

const LightSource* FESpecularLighting::lightSource() const {
  return m_lightSource.get();
}

void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource) {
  m_lightSource = lightSource;
}

TextStream& FESpecularLighting::externalRepresentation(TextStream& ts,
                                                       int indent) const {
  writeIndent(ts, indent);
  ts << "[feSpecularLighting";
  FilterEffect::externalRepresentation(ts);
  ts << " surfaceScale=\"" << m_surfaceScale << "\" "
     << "specualConstant=\"" << m_specularConstant << "\" "
     << "specularExponent=\"" << m_specularExponent << "\"]\n";
  inputEffect(0)->externalRepresentation(ts, indent + 1);
  return ts;
}

}  // namespace blink


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

<TITLE>
HasCGLIBMethodProxy (Mockito API)
</TITLE>

<META NAME="date" CONTENT="2009-12-12">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.mockito.internal.invocation.realmethod

Interface HasCGLIBMethodProxy

All Superinterfaces:
java.io.Serializable

All Known Implementing Classes:
CGLIBProxyRealMethod, FilteredCGLIBProxyRealMethod

public interface HasCGLIBMethodProxy
extends java.io.Serializable

Method Summary

 MockitoMethodProxy
getMethodProxy()

Method Detail

getMethodProxy

MockitoMethodProxy getMethodProxy()

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/blue" >

    <ExpandableListView
        android:id="@id/ExpandableListViewCategory"
        style="@style/StyleListViewItem"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:cacheColorHint="#00000000"
        android:fastScrollEnabled="true" />

</LinearLayout>


text:
require 'page-object'

class ArticlePage
  include PageObject

  page_url 'http://localhost:9292/article'

  link(:article_link, text: 'Article')
  h2(:default_msg, text: 'Latest article selection')
  div(:article_div, id: 'three_default_article')

  h3(:article_title, id: 'title')
  div(:article_author_date_div, id: 'author_date')
  link(:read_article_link, class: 'btn btn-success')

  def click_article_tab
    article_link
  end

  def click_read_article_button
    read_article_link
  end
end


text:
require 'easy_zoom_on_rails/version'
require 'easy_zoom_on_rails/engine'
require 'easy_zoom_on_rails/easy_zoom_helper'
require 'easy_zoom_on_rails/railtie'

module EasyZoomOnRails
end