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

namespace ToDoTool.Models
{
    public class Task
    {
        [Key]
        public int Id { get; set; }

        public string Name { get; set; }

        public string Description { get; set; }

        public DateTime DueDate { get; set; }

        public DateTime NextDate { get; set; }

        public bool Public { get; set; }

        public virtual User Creator { get; set; }

        public virtual Category Category { get; set; }

        public virtual ICollection<UserTaskPermission> UserTaskPermissions { get; set; } = new List<UserTaskPermission>();
    }
}


text:
package org.apache.phoenix.execute;

import java.sql.SQLException;
import java.util.List;

import org.apache.phoenix.compile.ExplainPlan;
import org.apache.phoenix.compile.QueryPlan;
import org.apache.phoenix.compile.RowProjector;
import org.apache.phoenix.expression.Expression;
import org.apache.phoenix.iterate.DelegateResultIterator;
import org.apache.phoenix.iterate.FilterResultIterator;
import org.apache.phoenix.iterate.ResultIterator;
import org.apache.phoenix.schema.tuple.Tuple;

import com.google.common.collect.Lists;

public class TupleProjectionPlan extends DelegateQueryPlan {
    private final TupleProjector tupleProjector;
    private final Expression postFilter;
    private RowProjector rowProjector;

    public TupleProjectionPlan(QueryPlan plan, TupleProjector tupleProjector, Expression postFilter) {
        super(plan);
        if (tupleProjector == null) throw new IllegalArgumentException("tupleProjector is null");
        this.tupleProjector = tupleProjector;
        this.postFilter = postFilter;
    }

    @Override
    public ExplainPlan getExplainPlan() throws SQLException {
        List<String> planSteps = Lists.newArrayList(delegate.getExplainPlan().getPlanSteps());
        if (postFilter != null) {
            planSteps.add("CLIENT FILTER BY " + postFilter.toString());
        }

        return new ExplainPlan(planSteps);
    }

    @Override
    public ResultIterator iterator() throws SQLException {
        ResultIterator iterator = new DelegateResultIterator(delegate.iterator()) {

            @Override
            public Tuple next() throws SQLException {
                Tuple tuple = super.next();
                if (tuple == null)
                    return null;

                return tupleProjector.projectResults(tuple);
            }

            @Override
            public String toString() {
                return "TupleProjectionResultIterator [projector=" + tupleProjector + "]";
            }
        };

        if (postFilter != null) {
            iterator = new FilterResultIterator(iterator, postFilter);
        }

        return iterator;
    }

    public void setRowProjector(RowProjector rowProjector) {
        this.rowProjector = rowProjector;
    }

    public RowProjector getRowProjector() {
        return rowProjector;
    }
}

redpajama_set_name: RedPajamaGithub


text:
import json
import os

from BeautifulSoup import BeautifulSoup

from mobile_codes import MNCOperator

def parse_wikipedia():
    with open('List_of_mobile_country_codes', 'r') as htmlfile:
        soup = BeautifulSoup(htmlfile)
        operators = []

        for table in soup.findAll('table', attrs={'class': 'wikitable'}):
            for row in table.findAll('tr'):
                mcc, mnc, brand, operator = row.findChildren()[:4]
                if mcc.text in ['MCC', '']:
                    continue

                operators.append(
                    MNCOperator(
                        operator=operator.text, brand=brand.text,
                        mcc=mcc.text, mnc=mnc.text))

        return operators

def parse_itu():
    with open(os.path.join('source_data', 'itu.json'), 'rb') as jsonfile:
        return json.loads(jsonfile.read().decode())

def merge_wiki_itu():
    wiki_operators = parse_wikipedia()
    itu_operators = parse_itu()
    merged_operators = {}

    for operator in wiki_operators:
        operator_key = operator.mcc, operator.mnc
        merged_operators[operator_key] = operator

    for operator in itu_operators:
        operator_key = operator.mcc, operator.mnc
        merged_operators[operator_key] = operator

    return merged_operators.values()

def write_operators(operators):
    with open(os.path.join('mobile_codes', 'json', 'operators.json'),
              'wb') as outfile:
        outfile.write(json.dumps(operators))

if __name__ == '__main__':
    write_operators(merge_wiki_itu())


text:
@interface DYMRollingBannerVC : UIPageViewController
/// images for the rolling banner, can be a remote URL or UIImage
@property (nonatomic, copy)     NSArray                 *rollingImages;
/// time interval between the rolling
@property (nonatomic, assign)   NSTimeInterval          rollingInterval;

/// start rolling
-(void)startRolling;

/// stop rolling
-(void)stopRolling;

/// handler for banner tap event
-(void)addBannerTapHandler:(DYMBannderTapHandler)handler;

@end


text:
from __future__ import absolute_import, print_function, division
import sys

import numpy

import convolutional_mlp
import dA
import DBN
import logistic_cg
import logistic_sgd
import mlp
import rbm
import rnnrbm
import SdA
import rnnslu
import lstm

def test_logistic_sgd():
    logistic_sgd.sgd_optimization_mnist(n_epochs=10)

def test_logistic_cg():
    try:
        import scipy
        logistic_cg.cg_optimization_mnist(n_epochs=10)
    except ImportError:
        from nose.plugins.skip import SkipTest
        raise SkipTest(
            'SciPy not available. Needed for the logistic_cg example.')

def test_mlp():
    mlp.test_mlp(n_epochs=1)

def test_convolutional_mlp():
    convolutional_mlp.evaluate_lenet5(n_epochs=1, nkerns=[5, 5])

def test_dA():
    dA.test_dA(training_epochs=1, output_folder='tmp_dA_plots')

def test_SdA():
    SdA.test_SdA(pretraining_epochs=1, training_epochs=1, batch_size=300)

def test_dbn():
    DBN.test_DBN(pretraining_epochs=1, training_epochs=1, batch_size=300)

def test_rbm():
    rbm.test_rbm(training_epochs=1, batch_size=300, n_chains=1, n_samples=1,
                 n_hidden=20, output_folder='tmp_rbm_plots')

def test_rnnrbm():
    rnnrbm.test_rnnrbm(num_epochs=1)

def test_rnnslu():
    s = {'fold': 3,
         # 5 folds 0,1,2,3,4
         'data': 'atis',
         'lr': 0.0970806646812754,
         'verbose': 1,
         'decay': True,
         # decay on the learning rate if improvement stops
         'win': 7,
         # number of words in the context window
         'nhidden': 200,
         # number of hidden units
         'seed': 345,
         'emb_dimension': 50,
         # dimension of word embedding
         'nepochs': 1, # CHANGED
         'savemodel': False}
    rnnslu.main(s)

def test_lstm():
    lstm.train_lstm(max_epochs=1, test_size=1000, saveto='')

def speed():
    """
    This fonction modify the configuration theano and don't restore it!
    """

    algo = ['logistic_sgd', 'logistic_cg', 'mlp', 'convolutional_mlp',
            'dA', 'SdA', 'DBN', 'rbm', 'rnnrbm', 'rnnslu', 'lstm']
    to_exec = [True] * len(algo)
#    to_exec = [False] * len(algo)
#    to_exec[-1] = True
    do_float64 = True
    do_float32 = True
    do_gpu = True

    algo_executed = [s for idx, s in enumerate(algo) if to_exec[idx]]

    def time_test(m, l, idx, f, **kwargs):
        if not to_exec[idx]:
            return
        print(algo[idx])
        ts = m.call_time
        try:
            f(**kwargs)
        except Exception as e:
            print('test', algo[idx], 'FAILED', e, file=sys.stderr)
            l.append(numpy.nan)
            return
        te = m.call_time
        l.append(te - ts)

    def do_tests():
        m = theano.compile.mode.get_default_mode()
        l = []
        time_test(m, l, 0, logistic_sgd.sgd_optimization_mnist, n_epochs=30)
        time_test(m, l, 1, logistic_cg.cg_optimization_mnist, n_epochs=30)
        time_test(m, l, 2, mlp.test_mlp, n_epochs=5)
        time_test(m, l, 3, convolutional_mlp.evaluate_lenet5, n_epochs=5,
                  nkerns=[5, 5])
        time_test(m, l, 4, dA.test_dA, training_epochs=2,
                  output_folder='tmp_dA_plots')
        time_test(m, l, 5, SdA.test_SdA, pretraining_epochs=1,
                  training_epochs=2, batch_size=300)
        time_test(m, l, 6, DBN.test_DBN, pretraining_epochs=1,
                  training_epochs=2, batch_size=300)
        time_test(m, l, 7, rbm.test_rbm, training_epochs=1, batch_size=300,
                  n_chains=1, n_samples=1, output_folder='tmp_rbm_plots')
        time_test(m, l, 8, rnnrbm.test_rnnrbm, num_epochs=1)
        s = {'fold': 3,
             # 5 folds 0,1,2,3,4
             'data': 'atis',
             'lr': 0.0970806646812754,
             'verbose': 1,
             'decay': True,
             # decay on the learning rate if improvement stops
             'win': 7,
             # number of words in the context window
             'nhidden': 200,
             # number of hidden units
             'seed': 345,
             'emb_dimension': 50,
             # dimension of word embedding
             'nepochs': 1,
             # 60 is recommended
             'savemodel': False}
        time_test(m, l, 9, rnnslu.main, param=s)
        time_test(m, l, 10, lstm.train_lstm, max_epochs=1, test_size=1000,
                  saveto='')
        return numpy.asarray(l)

    # Initialize test count and results dictionnary
    test_total = 0
    times_dic = {}

    #test in float64 in FAST_RUN mode on the cpu
    import theano
    if do_float64:
        theano.config.floatX = 'float64'
        theano.config.mode = 'FAST_RUN'
        float64_times = do_tests()
        times_dic['float64'] = float64_times
        test_total += numpy.size(float64_times)
        print(algo_executed, file=sys.stderr)
        print('float64 times', float64_times, file=sys.stderr)

    #test in float32 in FAST_RUN mode on the cpu
    theano.config.floatX = 'float32'
    if do_float32:
        float32_times = do_tests()
        times_dic['float32'] = float32_times
        test_total += numpy.size(float32_times)
        print(algo_executed, file=sys.stderr)
        print('float32 times', float32_times, file=sys.stderr)

        if do_float64:
            print('float64/float32', (
                float64_times / float32_times), file=sys.stderr)
            print(file=sys.stderr)
            print(('Duplicate the timing to have everything '
                                  'in one place'), file=sys.stderr)
            print(algo_executed, file=sys.stderr)
            print('float64 times', float64_times, file=sys.stderr)
            print('float32 times', float32_times, file=sys.stderr)

            print('float64/float32', (
                float64_times / float32_times), file=sys.stderr)

    #test in float32 in FAST_RUN mode on the gpu
    import theano.gpuarray
    if do_gpu:
        theano.gpuarray.use('cuda')
        gpu_times = do_tests()
        times_dic['gpu'] = gpu_times
        test_total += numpy.size(gpu_times)
        print(algo_executed, file=sys.stderr)
        print('gpu times', gpu_times, file=sys.stderr)

        if do_float64:
            print('float64/gpu', float64_times / gpu_times, file=sys.stderr)

        if (do_float64 + do_float32 + do_gpu) > 1:
            print(file=sys.stderr)
            print(('Duplicate the timing to have everything '
                                  'in one place'), file=sys.stderr)
            print(algo_executed, file=sys.stderr)
            if do_float64:
                print('float64 times', float64_times, file=sys.stderr)
            if do_float32:
                print('float32 times', float32_times, file=sys.stderr)
            if do_gpu:
                print('gpu times', gpu_times, file=sys.stderr)

            print()
            if do_float64 and do_float32:
                print('float64/float32', (
                    float64_times / float32_times), file=sys.stderr)
            if do_float64 and do_gpu:
                print('float64/gpu', float64_times / gpu_times, file=sys.stderr)
            if do_float32 and do_gpu:
                print('float32/gpu', float32_times / gpu_times, file=sys.stderr)

    # Generate JUnit performance report
    for label, times in times_dic.items():
        with open('speedtests_{label}.xml'.format(label=label), 'w') as f:
            f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
            f.write('<testsuite name="dlt_speedtests_{label}" tests="{ntests}">\n'
                    .format(label=label, ntests=test_total/len(times_dic)))
            for algo, time in zip(algo_executed, times):
                f.write('   <testcase classname="speed.{label}" name="{algo}" time="{time}">'
                        .format(label=label, algo=algo, time=time))
                f.write('   </testcase>\n')
            f.write('</testsuite>\n')

    if do_gpu:
        assert not numpy.isnan(gpu_times).any()


text:
package in.testpress.testpress.core;

import java.util.List;

import in.testpress.testpress.models.Comment;
import in.testpress.testpress.models.TestpressApiResponse;
import retrofit.RetrofitError;

public class CommentsPager extends ResourcePager<Comment> {

    private TestpressApiResponse<Comment> response;
    private long postId;

    public CommentsPager(TestpressService service, long postId) {
        super(service);
        this.postId = postId;
    }

    @Override
    public ResourcePager<Comment> clear() {
        response = null;
        return super.clear();
    }

    @Override
    protected Object getId(Comment resource) {
        return resource.getId();
    }

    @Override
    public List<Comment> getItems(int page, int size) throws RetrofitError {
        queryParams.put(Constants.Http.PAGE, String.valueOf(page));
        response = service.getComments(postId, queryParams);
        return response.getResults();
    }

    @Override
    public boolean hasNext() {
        return response == null || response.getNext() != null;
    }

    public Integer getCommentsCount() {
        return response != null ? response.getCount() : 0;
    }
}


text:
module AwsCron
  class << self
    attr_writer :configuration
  end

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

  def self.configure
    yield(configuration)
  end

  def self.reset_configuration!
    @configuration = Configuration.new
  end

  class Configuration
    ATTRIBUTES = [:logger, :exception_handler]
    attr_accessor *ATTRIBUTES

    def initialize
      @logger ||= Logger.new(STDOUT)
    end
  end
end


text:
export interface OrganizationBean {
  id: string;
  name: string;
  description: string;
  createdBy: string;
  createdOn: Date;
  modifiedBy: string;
  modifiedOn: Date;
}


text:
import {
  VeuiDefineComponent,
  VeuiDefineInstance,
  RequiredKey,
  SafeOmit,
  Normalized,
  UiMixin,
  ControllableMixin,
  OverlayMixin
} from '../common'
import { Tag } from './option'

export type Item<Position extends boolean = true> = {
  label: string
  value: unknown
  options?: Array<Item> | null
  disabled?: boolean
} & (Position extends true ? { position?: 'inline' | 'popup' } : {})

type Props<T extends Item> = {
  label?: string
  trigger?: 'hover' | 'click'
  options?: Array<T>
  disabled?: boolean
  expanded?: boolean
  // keyField?: string
  position?: 'inline' | 'popup'
  optionTag?: string | ((option: T) => Tag)
}

type Emits = {
  afteropen(): void
}

type Mixins = [
  UiMixin,
  OverlayMixin,
  ControllableMixin<{
    toggle(expanded: boolean): void
  }>
]

export type LooseOptionItem<Position extends boolean = true> = Normalized<
  'options',
  Item<Position>,
  true
>
export type LooseOptionParent<Position extends boolean = true> = RequiredKey<
  Normalized<'options', Item<Position>, true>,
  'options'
>
export type LooseOptionLeaf<Position extends boolean = true> = SafeOmit<
  LooseOptionParent<Position>,
  'options'
>

type Slots = {
  label(slotProps: { label: string }): unknown
  option(slotProps: LooseOptionLeaf<true>): unknown
  'option-label'(slotProps: LooseOptionLeaf<true>): unknown
  'group-label'(slotProps: LooseOptionParent<true>): unknown
  before(): unknown
  after(): unknown
  default(): unknown
}

type OptionGroup = VeuiDefineComponent<{
  new <T extends Item = Item>(...args: any[]): VeuiDefineInstance<
    Props<T>,
    Emits,
    Slots,
    Mixins
  >
}>

export default OptionGroup


text:
> Compile [doTjs](https://github.com/olado/doT) with gulp (gulpjs.com)

## Information

Package	gulp-dotjs-packer

Description
doTjs compiler for Gulp

Gulp Version
3.x

## Usage

```javascript
var gulp = require("gulp");
var dotPacker = require("gulp-dotjs-packer");

gulp.task('dot', function() {
  gulp.src('./lib/*.jst')
	.pipe(dotPacker({
      fileName: "templates.js"
    }))
    .pipe(gulp.dest('./dist/'))
});
```

## Options

- `fileName`

	Name of output file

- `wrap`

    Add a wrapper to be around the output file

    examples:

    [default] - Adds UMD wrapper around the output file
    ```
        dotPacker({
            wrap: true
            ...
        });
    ```

    Disable wrapping
    ```
        dotPacker({
            wrap: false
            ...
        });
    ```

    Custom start and end wrapper
    ```
        dotPacker({
            wrap: {
                start: "(function() {\r\n",
                end: "\r\n}())"
                ...
            }
        });
    ```

- `variable`

	Name of variable to store templates.

- `templateSettings`

	doT.js template settings.

- `processName (pathName, base, cwd)`

	Function that replace template name.

## LICENSE

MIT License

Copyright (c) 2014 Pimenov Sergey pimenov.sergei@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
namespace Leap
{
  using System;

  /**
  * The LeapTransform class represents a transform in three dimensional space.
  *
  * Note that the LeapTransform class replaces the Leap.Matrix class.
  * @since 3.1.2
  */
  public struct LeapTransform
  {
    /**
    * Constructs a new transform from the specified translation and rotation.
    * @param translation the translation vector.
    * @param rotation the rotation quaternion.
    * @since 3.1.2
    */
    public LeapTransform(Vector translation, LeapQuaternion rotation) :
      this(translation, rotation, Vector.Ones)
    {
    }

    /**
    * Constructs a new transform from the specified translation, rotation and scale.
    * @param translation the translation vector.
    * @param rotation the rotation quaternion.
    * @param scale the scale vector.
    * @since 3.1.2
    */
    public LeapTransform(Vector translation, LeapQuaternion rotation, Vector scale) :
      this()
    {
      _scale = scale;
      // these are non-trival setters.
      this.translation = translation;
      this.rotation = rotation; // Calls validateBasis
    }

    /**
    * Transforms the specified position vector, applying translation, rotation and scale.
    * @param point the position vector to transform.
    * @returns the new position vector.
    * @since 3.1.2
    */
    public Vector TransformPoint(Vector point)
    {
      return _xBasisScaled * point.x + _yBasisScaled * point.y + _zBasisScaled * point.z + translation;
    }

    /**
    * Transforms the specified direction vector, applying rotation only.
    * @param direction the direction vector to transform.
    * @returns the new direction vector.
    * @since 3.1.2
    */
    public Vector TransformDirection(Vector direction)
    {
      return _xBasis * direction.x + _yBasis * direction.y + _zBasis * direction.z;
    }

    /**
    * Transforms the specified velocity vector, applying rotation and scale.
    * @param point the velocity vector to transform.
    * @returns the new velocity vector.
    * @since 3.1.2
    */
    public Vector TransformVelocity(Vector velocity)
    {
      return _xBasisScaled * velocity.x + _yBasisScaled * velocity.y + _zBasisScaled * velocity.z;
    }

    /**
    * Transforms the specified quaternion.
    * Multiplies the quaternion representing the rotational part of this transform by the specified
    * quaternion.
    *
    * **Important:** Modifying the basis vectors of this transform directly leaves the underlying quaternion in
    * an indeterminate state. Neither this function nor the LeapTransform.rotation quaternion can be used after
    * the basis vectors are set.
    *
    * @param rhs the quaternion to transform.
    * @returns the new quaternion.
    * @since 3.1.2
    */
    public LeapQuaternion TransformQuaternion(LeapQuaternion rhs)
    {
      if (_quaternionDirty)
        throw new InvalidOperationException("Calling TransformQuaternion after Basis vectors have been modified.");

      if (_flip)
      {
        // Mirror the axis of rotation accross the flip axis.
        rhs.x *= _flipAxes.x;
        rhs.y *= _flipAxes.y;
        rhs.z *= _flipAxes.z;
      }

      LeapQuaternion t = _quaternion.Multiply(rhs);
      return t;
    }

    /**
    * Mirrors this transform's rotation and scale across the x-axis. Translation is not affected.
    * @since 3.1.2
    */
    public void MirrorX()
    {
      _xBasis = -_xBasis;
      _xBasisScaled = -_xBasisScaled;

      _flip = true;
      _flipAxes.y = -_flipAxes.y;
      _flipAxes.z = -_flipAxes.z;
    }

    /**
    * Mirrors this transform's rotation and scale across the z-axis. Translation is not affected.
    * @since 3.1.2
    */
    public void MirrorZ()
    {
      _zBasis = -_zBasis;
      _zBasisScaled = -_zBasisScaled;

      _flip = true;
      _flipAxes.x = -_flipAxes.x;
      _flipAxes.y = -_flipAxes.y;
    }

    /**
    * The x-basis of the transform.
    *
    * **Important:** Modifying the basis vectors of this transform directly leaves the underlying quaternion in
    * an indeterminate state. Neither the TransformQuaternion() function nor the LeapTransform.rotation quaternion
    *  can be used after the basis vectors are set.
    *
    * @since 3.1.2
    */
    public Vector xBasis {
      get { return _xBasis; }
      set {
        _xBasis = value;
        _xBasisScaled = value * scale.x;
        _quaternionDirty = true;
      }
    }

    /**
    * The y-basis of the transform.
    *
    * **Important:** Modifying the basis vectors of this transform directly leaves the underlying quaternion in
    * an indeterminate state. Neither the TransformQuaternion() function nor the LeapTransform.rotation quaternion
    *  can be used after the basis vectors are set.
    *
    * @since 3.1.2
    */
    public Vector yBasis
    {
      get { return _yBasis; }
      set
      {
        _yBasis = value;
        _yBasisScaled = value * scale.y;
        _quaternionDirty = true;
      }
    }

    /**
    * The z-basis of the transform.
    *
    * **Important:** Modifying the basis vectors of this transform directly leaves the underlying quaternion in
    * an indeterminate state. Neither the TransformQuaternion() function nor the LeapTransform.rotation quaternion
    *  can be used after the basis vectors are set.
    *
    * @since 3.1.2
    */
    public Vector zBasis
    {
      get { return _zBasis; }
      set
      {
        _zBasis = value;
        _zBasisScaled = value * scale.z;
        _quaternionDirty = true;
      }
    }

    /**
    * The translation component of the transform.
    * @since 3.1.2
    */
    public Vector translation { get { return _translation; }
      set {
        _translation = value;
      }
    }

    /**
    * The scale factors of the transform.
    * Scale is kept separate from translation.
    * @since 3.1.2
    */
    public Vector scale {
      get { return _scale; }
      set {
        _scale = value;
        _xBasisScaled = _xBasis * scale.x;
        _yBasisScaled = _yBasis * scale.y;
        _zBasisScaled = _zBasis * scale.z;
      }
    }

    /**
    * The rotational component of the transform.
    *
    * **Important:** Modifying the basis vectors of this transform directly leaves the underlying quaternion in
    * an indeterminate state. This rotation quaternion cannot be accessed after
    * the basis vectors are modified directly.
    *
    * @since 3.1.2
    */
    public LeapQuaternion rotation {
      get {
        if (_quaternionDirty)
          throw new InvalidOperationException("Requesting rotation after Basis vectors have been modified.");
        return _quaternion;
      }
      set {
        _quaternion = value;

        float d = value.MagnitudeSquared;
        float s = 2.0f / d;
        float xs = value.x * s,   ys = value.y * s,   zs = value.z * s;
        float wx = value.w * xs,  wy = value.w * ys,  wz = value.w * zs;
        float xx = value.x * xs,  xy = value.x * ys,  xz = value.x * zs;
        float yy = value.y * ys,  yz = value.y * zs,  zz = value.z * zs;

        _xBasis = new Vector(1.0f - (yy + zz), xy + wz, xz - wy);
        _yBasis = new Vector(xy - wz, 1.0f - (xx + zz), yz + wx);
        _zBasis = new Vector(xz + wy, yz - wx, 1.0f - (xx + yy));

        _xBasisScaled = _xBasis * scale.x;
        _yBasisScaled = _yBasis * scale.y;
        _zBasisScaled = _zBasis * scale.z;

        _quaternionDirty = false;
        _flip = false;
        _flipAxes = new Vector(1.0f, 1.0f, 1.0f);
      }
    }

    /**
    * The identity transform.
    * @since 3.1.2
    */
    public static readonly LeapTransform Identity = new LeapTransform(Vector.Zero, LeapQuaternion.Identity, Vector.Ones);

    private Vector _translation;
    private Vector _scale;
    private LeapQuaternion _quaternion;
    private bool _quaternionDirty;
    private bool _flip;
    private Vector _flipAxes;
    private Vector _xBasis;
    private Vector _yBasis;
    private Vector _zBasis;
    private Vector _xBasisScaled;
    private Vector _yBasisScaled;
    private Vector _zBasisScaled;
  }
}


text:
(function(module) {
  var repoView = {};

  // DONE: Private methods declared here live only within the scope of the wrapping IIFE.
  var ui = function() {
    var $about = $('#about'); // Best practice: Cache the DOM query if it's used more than once.

    $about.find('ul').empty();
    $about.show().siblings().hide();
  };

  // DONE: Remember that new Handlebars template? Let's compile it!
  // Save the result in this `render` variable.

  var render = function (repo) {
    var templateGit = Handlebars.compile($('#repo-template').text());
    return templateGit(repo);
  }

  // DONE: If all the data is loaded, we can prep the UI and render the repos.
  repoView.index = function() {
    ui();

    // The jQuery `append` method lets us append an entire array of HTML elements at once,
    // So we can use a little FP to transform our data-set into DOM nodes:
    $('#about ul').append(
      repos.with('name').map(render)
    );
  };

  module.repoView = repoView;
})(window);


text:
package com.app.dextrous.barbara.callback;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.app.dextrous.barbara.activity.UserPreferencesActivity;
import com.app.dextrous.barbara.constant.BarbaraConstants;
import com.app.dextrous.barbara.model.UserPreference;
import com.app.dextrous.barbara.response.GenericBeanResponse;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

import static com.app.dextrous.barbara.constant.BarbaraConstants.MSG_GENERIC_ERROR;

public class UserPreferencesCallback implements Callback<GenericBeanResponse<UserPreference>> {

    private TextView nickNameTextView;
    private TextView securityQuestionTextView;
    private TextView budgetTextView;
    private Button editPreferenceButton;
    private Context context;

    public UserPreferencesCallback(Context context, TextView budgetTextView,
                                   TextView securityQuestionTextView,
                                   TextView nickNameTextView,
                                   Button editPreferenceButton) {
        this.context = context;
        this.nickNameTextView = nickNameTextView;
        this.securityQuestionTextView = securityQuestionTextView;
        this.budgetTextView = budgetTextView;
        this.editPreferenceButton = editPreferenceButton;
    }

    @Override
    public void onResponse(Call<GenericBeanResponse<UserPreference>> call, Response<GenericBeanResponse<UserPreference>> response) {
        GenericBeanResponse<UserPreference> apiResponse = response.body();
        if (apiResponse != null) {
            Log.d("HTTP RESPONSE", apiResponse.toString());
            if (apiResponse.getSuccess() && apiResponse.getItem() != null) {
                final UserPreference item = apiResponse.getItem();
                if(item.getNickName() != null
                        && nickNameTextView!= null) {
                    nickNameTextView.setText(item.getNickName());
                }
                if(item.getBudget() != 0.0
                        && budgetTextView != null) {
                    budgetTextView.setText(String.valueOf(item.getBudget()));
                }
                if(item.getSecurityQuestion() != null
                        && securityQuestionTextView != null) {
                    securityQuestionTextView.setText(item.getSecurityQuestion());
                }
                if (editPreferenceButton != null) {
                    editPreferenceButton.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent intent = new Intent(context, UserPreferencesActivity.class);
                            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            intent.putExtra(BarbaraConstants.INTENT_PARAM_USER_PREFERENCE_ITEM_KEY, item);
                            context.startActivity(intent);
                        }
                    });
                }
            }
        }
    }

    @Override
    public void onFailure(Call<GenericBeanResponse<UserPreference>> call, Throwable t) {
        Log.e("HTTP ERROR", t.getMessage(), t);
        Toast.makeText(context, String.format("%s%s", MSG_GENERIC_ERROR, t.getMessage()), Toast.LENGTH_LONG).show();
    }
}


text:
extern crate time;
extern crate libc;
extern crate getopts;
extern crate collections;

use std::os;
use std::io::util::ChainedReader;
use std::io::BufferedReader;
use getopts::{getopts, optopt, usage, OptGroup};

use stats::LogStats;
use stats::printer::LogStatsPrinter;
use log::nginx::NginxLogParser;
use gzreader::GzipReader;

mod log;
mod stats;
mod gzreader;

static DEFAULT_NUMBER_OF_ITEMS_TO_PRINT: uint = 10u;

fn parse(filenames: &[String], n: uint) {
    let files = filenames.iter().map(|filename| {
        let path = Path::new(filename.clone());
        GzipReader::open(&path).unwrap()
        });
    let file = ChainedReader::new(files);
    let reader = BufferedReader::new(file);
    let mut stats = LogStats::new();
    let mut parser = NginxLogParser::new(reader);
    parser.parse(&mut stats);
    let printer = LogStatsPrinter::new(&stats);
    printer.print(n);
}

fn print_usage(msg: &str, program: &str, opts: &[OptGroup]) {
    println!("{}\n\nSimple HTTP statistics, version 0.0.2\n\n\
              Usage: {} LOGFILE...{}", msg, program, usage("", opts));
    os::set_exit_status(2);
}

fn items_to_print(opt: Option<String>) -> Result<uint, String> {
    match opt {
        Some(str_n) => {
            let n_opt: Option<uint> =  str_n.parse::<uint>();
            match n_opt {
                Some(n) if n > 0 => Ok(n),
                _ => Err(str_n)
            }
        },
        None => Ok(DEFAULT_NUMBER_OF_ITEMS_TO_PRINT)
    }
}

fn main() {
    // TODO: We can use an application object here with smaller methods
    let args = os::args();
    let program = args[0].clone();
    let opts = [
        optopt("n", "", "number of items to print", "NUMBER")
    ];
    let matches = match getopts(args.tail(), &opts) {
        Ok(m) => m,
        Err(err) => {
            print_usage(err.to_string().as_slice(), program.as_slice(), &opts);
            return;
        }
    };
    if !matches.free.is_empty() {
        match items_to_print(matches.opt_str("n")) {
            Ok(n) => parse(matches.free.as_slice(), n),
            Err(_str_n) => {
                print_usage("Invalid number of items provided",
                            program.as_slice(), &opts);
                return;
            }
        }
    } else {
        print_usage("No log files provided", program.as_slice(), &opts);
        return;
    }
}


text:
set -e
CREATE_METASTORE=0

# parse command line options
for ARG in $*
do
  case "$ARG" in
    -create_metastore)
      CREATE_METASTORE=1
      ;;
    -help|*)
      echo "[-create_metastore] : If true, creates a new metastore."
      exit 1
      ;;
  esac
done

# If a specific metastore db is defined, use that. Otherwise create unique metastore
# DB name based on the current directory.
if [ -z "${METASTORE_DB}" ]; then
  METASTORE_DB=`basename ${IMPALA_HOME} | sed -e "s/\\./_/g" | sed -e "s/[.-]/_/g"`
fi

set -u

CLUSTER_DIR=${IMPALA_HOME}/testdata/cluster
${CLUSTER_DIR}/admin create_cluster

# Convert Metastore DB name to be lowercase
export METASTORE_DB=`echo $METASTORE_DB | tr '[A-Z]' '[a-z]'`
export CURRENT_USER=`whoami`

CONFIG_DIR=${IMPALA_HOME}/fe/src/test/resources
echo "Config dir: ${CONFIG_DIR}"
echo "Current user: ${CURRENT_USER}"
echo "Metastore DB: hive_${METASTORE_DB}"

pushd ${CONFIG_DIR}
# Cleanup any existing files
rm -f {core,hdfs,hbase,hive}-site.xml
rm -f authz-provider.ini

# TODO: Throw an error if the template references an undefined environment variable
if [ $CREATE_METASTORE -eq 1 ]; then
  echo "Creating postgresql database for Hive metastore"
  set +o errexit
  dropdb -U hiveuser hive_$METASTORE_DB
  set -e
  createdb -U hiveuser hive_$METASTORE_DB

  psql -U hiveuser -d hive_$METASTORE_DB \
       -f ${HIVE_HOME}/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
fi

set +e
echo "Creating Sentry Policy Server DB"
createdb -U hiveuser sentry_policy
set -e

function generate_config {
  # Search for strings like ${FOO}, if FOO is defined in the environment then replace
  # "${FOO}" with the environment value.
  perl -wpl -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' $1 > $2
}

echo "Linking core-site.xml from local cluster"
CLUSTER_HADOOP_CONF_DIR=$(${CLUSTER_DIR}/admin get_hadoop_client_conf_dir)
ln -s ${CLUSTER_HADOOP_CONF_DIR}/core-site.xml

echo "Linking hdfs-site.xml from local cluster"
ln -s ${CLUSTER_HADOOP_CONF_DIR}/hdfs-site.xml

echo "Generating hive-site.xml using postgresql for metastore"
generate_config postgresql-hive-site.xml.template hive-site.xml

echo "Generating hive-log4j.properties"
generate_config hive-log4j.properties.template hive-log4j.properties

echo "Generating hbase-site.xml"
generate_config hbase-site.xml.template hbase-site.xml

echo "Generating authorization policy file"
generate_config authz-policy.ini.template authz-policy.ini

echo "Generating sentry policy server config file"
generate_config sentry-site.xml.template sentry-site.xml
popd

echo "Completed config generation"

# Creates a symlink in TARGET_DIR to all subdirectories under SOURCE_DIR
function symlink_subdirs {
  SOURCE_DIR=$1
  TARGET_DIR=$2
  if [ -d "${SOURCE_DIR}" ]; then
    find ${SOURCE_DIR}/ -maxdepth 1 -mindepth 1 -type d -exec ln -f -s {} ${TARGET_DIR} \;
  else
    echo "No auxiliary tests found at: ${SOURCE_DIR}"
  fi
}

# The Impala test framework support running additional tests outside of the main repo.
# This is an optional feature that can be enabled by setting the IMPALA_AUX_* environment
# variables to valid locations.
echo "Searching for auxiliary tests, workloads, and datasets (if any exist)."
symlink_subdirs ${IMPALA_AUX_WORKLOAD_DIR} ${IMPALA_WORKLOAD_DIR}
symlink_subdirs ${IMPALA_AUX_DATASET_DIR} ${IMPALA_DATASET_DIR}
symlink_subdirs ${IMPALA_AUX_TEST_HOME}/tests ${IMPALA_HOME}/tests


text:
@echo off
::
:: Configuration variables
::
:: JAVA_HOME
::   Home of Java installation.
::
:: JAVA_OPTIONS
::   Extra options to pass to the JVM
::

:: ----- Verify and Set Required Environment Variables -------------------------

if not "%JAVA_HOME%" == "" goto gotJavaHome
echo You must set JAVA_HOME to point at your Java Development Kit installation
goto end
:gotJavaHome

:: ----- Check System Properties -----------------------------------------------

if not "%JAVA_OPTIONS%" == "" goto gotJavaOptions
set JAVA_OPTIONS=-Xms32M -Xmx512M
:gotJavaOptions

::set JAVA_ARGS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
::set JAVA_ARGS=-Xrunhprof:heap=all,cpu=samples,thread=y,depth=3

:: ----- Set Up The Classpath --------------------------------------------------

set CP=.\tools\loader\classes

"%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% %JAVA_ARGS% -classpath "%CP%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Dloader.jar.repositories=target -Dloader.main.class=edu.mit.simile.rdfizer.marcmods.Main Loader %2 %3 %4 %5 %6 %7 %8 %9
goto end

:: ----- End -------------------------------------------------------------------

set CP=


text:
<?php

namespace Sylius\Bundle\ResourceBundle\Form\EventSubscriber;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;

/**
 * @author Anna Walasek <anna.walasek@lakion.com>
 */
class ResourceTranslationsSubscriber implements EventSubscriberInterface
{
    /**
     * @var array
     */
    private $locales;

    /**
     * @param array $locales
     */
    public function __construct(array $locales)
    {
        $this->locales = $locales;
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents()
    {
        return [
            FormEvents::PRE_SET_DATA => 'preSetData',
            FormEvents::SUBMIT => 'submit',
        ];
    }

    /**
     * @param FormEvent $event
     */
    public function preSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $type = $form->getConfig()->getOption('type');

        foreach ($this->locales as $locale => $isRequired) {
            if (false === $form->has($locale)) {
                $form->add($locale, $type, ['required' => $isRequired]);
            }
        }
    }

    /**
     * @param FormEvent $event
     */
    public function submit(FormEvent $event)
    {
        $data = $event->getData();
        $parent = $event->getForm()->getParent();
        $translatable = $parent->getNormData();

        foreach ($data as $locale => $translation) {
            $translation->setLocale($locale);
            $translation->setTranslatable($translatable);
        }
    }
}


text:
from html.parser import HTMLParser
import re
import urllib.request
import sys

__author__ = 'daill'

class ProtocolParser(HTMLParser):
  def __init__(self):
    super().__init__()

    self.profile_name = ''
    self.tag_stack = list()
    self.active_tag = None
    self.profile_found = False
    self.special_case = False
    self.profile_pattern = re.compile('Request:(.*)Response:(.*)', re.DOTALL)
    self.string_buffer = ''
    self.reset_profile()

  def handle_starttag(self, tag, attrs):
    def attrs_containing(name, value):
      for _name, _value  in attrs:
        if str(_name) == name and str(_value) == value:
          return True
        else:
          return False

    if tag == 'div' and attrs_containing("class", "highlight highlight-xml"):
      self.special_case = True

    self.tag_stack.append(tag)
    self.active_tag = tag

  def handle_endtag(self, tag):
    del self.tag_stack[len(self.tag_stack)-1]
    self.active_tag = self.tag_stack[len(self.tag_stack)-1]

    if self.special_case and tag == 'div':
      self.special_case = False
      self.extract_profiles(self.string_buffer)

  def extract_profiles(self, data):
    m = self.profile_pattern.match(data)
    if m != None:
      # print(self.tag_stack)
      self.profile_request = m.group(1).strip()
      self.profile_response = m.group(2).strip()
      self.print_profile()
      self.reset_profile()
      self.profile_found = False

  def handle_data(self, data):
    # print(str(self.active_tag) + " " + data + " " + str(data.isupper()) + " " + ("" if self.active_tag == None else self.active_tag) + " " + str(self.tag_stack))
    data = data.strip(' \t\n\r')
    if self.profile_found == True:
      if self.active_tag == 'code':
        self.extract_profiles(data)
      elif (self.active_tag == 'pre' or self.active_tag == 'span') and self.special_case:
        self.string_buffer += data
    elif self.active_tag == 'h2' or self.active_tag == 'h3':
      if data.isupper():
        # print(self.active_tag + " " + data)
        self.profile_found = True
        self.profile_name = data
        # print(self.profile_name)

  def reset_profile(self):
    self.profile_name = ''
    self.profile_request = ''
    self.profile_response = ''

  def print_profile(self):
    # print(self.active_tag)
    print("{} = Call(\"{}\", \"{}\")".format(self.profile_name.lower(), self.profile_request if self.profile_request != "empty" else "", self.profile_response if self.profile_response != "empty" else ""))

def parse_html(url):
  try:
    # html = urllib.request.urlopen(url).read().decode('utf-8')
    html = open("/Users/daill/Downloads/binary.html", "r").read()
    parser = ProtocolParser()
    parser.feed(data=html)

  except Exception as err:
    print(sys.last_traceback)

if __name__ == '__main__':
  parse_html("https://github.com/orientechnologies/orientdb/wiki/Network-Binary-Protocol")


text:
package org.kumoricon.site.attendee.reg;

import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.spring.annotation.ViewScope;
import com.vaadin.ui.Button;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;
import org.kumoricon.model.attendee.Attendee;
import org.kumoricon.model.badge.Badge;
import org.kumoricon.service.validate.ValidationException;
import org.kumoricon.site.attendee.AttendeeDetailView;
import org.kumoricon.site.attendee.DetailFormHandler;
import org.kumoricon.site.attendee.window.WarningWindow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.util.UriTemplate;

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

@ViewScope
@SpringView(name = AttendeeRegDetailView.TEMPLATE)
public class AttendeeRegDetailView extends AttendeeDetailView implements View, DetailFormHandler {
    public static final String VIEW_NAME = "order";
    public static final String REQUIRED_RIGHT = "at_con_registration";

    public static final String TEMPLATE = "order/{orderId}/{attendeeId}";
    public static final UriTemplate URI_TEMPLATE = new UriTemplate(TEMPLATE);

    protected Integer attendeeId;
    protected Integer orderId;

    private Button btnDelete;

    private OrderPresenter orderPresenter;

    @Autowired
    public AttendeeRegDetailView(OrderPresenter orderPresenter) {
        this.orderPresenter = orderPresenter;
    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
        super.enter(viewChangeEvent);

        Map<String, String> map = URI_TEMPLATE.match(viewChangeEvent.getViewName());

        try {
            this.orderId = Integer.parseInt((map.get("orderId")));
        } catch (NumberFormatException ex) {
            notifyError("Bad order id: must be an integer");
            navigateTo("/");
        }

        if (map.get("attendeeId") != null && map.get("attendeeId").toLowerCase().equals("new")) {
            orderPresenter.addNewAttendee(this, this.orderId);
        } else {
            try {
                this.attendeeId = Integer.parseInt(map.get("attendeeId"));
            } catch (NumberFormatException ex) {
                notifyError("Bad attendee id: must be an integer");
                close();
            }

            handler.showAttendee(this, attendeeId);
        }
    }

    @Override
    public void showAttendee(Attendee attendee, List<Badge> all) {
        // Make sure this attendee is actually in the the order specified in the URL
        if (!orderId.equals(attendee.getOrder().getId())) {
            notifyError(String.format("Error: Attendee %s is not in order %s", attendee.getId(), orderId));
            close();
        }
        form.setAvailableBadges(all);
        form.show(attendee);
        if (!currentUserHasRight("fan_name_at_con_checkin")) form.hideFanNameField();
        form.setManualPriceEnabled(currentUserHasRight("attendee_override_price"));
        form.focusFirstName();

        if (attendee.getId() == null) { // Attendee hasn't been saved to database yet
            btnAddNote.setVisible(false);
            btnDelete.setVisible(false);
        }
    }

    @Override
    protected VerticalLayout buildSaveCancel() {
        VerticalLayout buttons = new VerticalLayout();
        buttons.setSpacing(true);
        buttons.setWidth("15%");
        buttons.setMargin(new MarginInfo(false, true, false, true));
        btnSave = new Button("Save");
        btnCancel = new Button("Cancel");

        btnAddNote = new Button("Add Note");
        btnAddNote.addClickListener((Button.ClickListener) clickEvent -> showAddNoteWindow());

        if (currentUserHasRight("reprint_badge")) {
            btnSaveAndReprint = new Button("Save and Reprint Badge");
        } else {
            btnSaveAndReprint = new Button("Reprint Badge (Override)");
        }

        btnSave.addClickListener((Button.ClickListener) clickEvent -> {
            try {
                form.commit();
                orderPresenter.saveAttendee(this, form.getAttendee());
                close();
            } catch (Exception e) {
                notifyError(e.getMessage());
            }
        });

        btnDelete = new Button("Delete");
        btnDelete.addStyleName(ValoTheme.BUTTON_DANGER);
        btnDelete.addClickListener((Button.ClickListener) clickEvent -> {
           orderPresenter.removeAttendeeFromOrder(this, form.getAttendee());
           navigateTo(VIEW_NAME + "/" + orderId);
        });

        btnCancel.addClickListener((Button.ClickListener) clickEvent -> close());

        buttons.addComponents(btnSave, btnAddNote, btnDelete, btnCancel);
        return buttons;
    }

    @Override
    protected void reprintClicked() {
        // Not used during at-con registration
    }

    @Override
    protected void setButtonVisibility() {
        btnSave.setVisible(currentUserHasRight("at_con_registration"));
        btnAddNote.setVisible(currentUserHasRight("attendee_add_note"));
    }

    @Override
    protected void showAddNoteWindow() {
        Attendee attendee = form.getAttendee();
        if (handler.attendeeHasChanged(attendee)) {
            try {
                attendee = handler.saveAttendee(this, attendee);
                navigateTo(VIEW_NAME + "/" + attendee.getOrder().getId() + "/" + attendee.getId() + "/note/new");
            } catch (ValidationException ex) {
                notifyError(ex.getMessage());
            }
        } else {
            if (attendee != null && attendee.getOrder() != null) {
                navigateTo(VIEW_NAME + "/" + attendee.getOrder().getId() + "/" + attendee.getId() + "/note/new");
            }
        }
    }

    /**
     * Message shown to users who do not have the right allowing them to check in someone on the blacklist
     */
    public void showBlacklistWarningWindow() {
        WarningWindow window = new WarningWindow("Please send this person to the manager's booth right away");
        showWindow(window);
    }

    /**
     * Message shown to users who have the right allowing them to check in someone on the blacklist
     */
    public void showBlacklistConfirmationWindow() {
        WarningWindow window = new WarningWindow("This person matches a name on the attendee blacklist");
        showWindow(window);
    }

    @Override
    public void close() {
        navigateTo(OrderView.VIEW_NAME + "/" + orderId);
    }

    @Override
    public String getRequiredRight() {
        return REQUIRED_RIGHT;
    }
}


text:
var parser = require('./parser.js');
var Clay = require('pebble-clay');
var messageKeys = require('message_keys');
var clayConfig = require('./config.json');
var clay = new Clay(clayConfig, null, { autoHandleEvents: false });

const WATCARD_URL_BEGIN = 'http://watcard.uwaterloo.ca/oneweb/watgopher661.asp?';
const WATCARD_URL_END = '&FINDATAREP=ON&MESSAGEREP=ON&STATUS=STATUS&watgopher_title=WatCard+Account+Status';
const KEY_ACCOUNT_ID = 'account_id';
const KEY_PIN = 'account_pin';

function sendAppMessage(data) {
  console.log('Sending data: ' + JSON.stringify(data));
  Pebble.sendAppMessage(data, function(e) {
    console.log('Sent data to Pebble');
  }, function(e) {
    console.log('Failed to send data!');
    console.log(JSON.stringify(e));
  });
}

// Send a generic error message back
function sendError() {
  messageDict = {};
  messageDict[messageKeys.Error] = 1;
  sendAppMessage(messageDict);
}

function getWatCardHTML(account_id, pin) {
  var req = new XMLHttpRequest();
  var url = WATCARD_URL_BEGIN + 'acnt_1=' + account_id + '&acnt_2=' + pin + WATCARD_URL_END;
  console.log('url ' + url);
  req.open('POST', url, true);
  req.onload = function(e) {
    if (req.readyState == 4 && req.status == 200) {
      var response = req.responseText;
      parser.parse(response, function onResult(balance){
        messageDict = {};
        messageDict[messageKeys.MealBalance] = Math.floor(balance.meal);
        messageDict[messageKeys.FlexBalance] = Math.floor(balance.flex);
        sendAppMessage(messageDict);
      }, function onError(){
        console.log('Error on parse!');
        sendError();
      });
    } else {
      console.log('Error on fetch. New URL perhaps?');
      sendError();
    }
  }
  req.send(null);
}

function refresh() {
  var account_id = localStorage[KEY_ACCOUNT_ID];
  messageDict = {};
  if (account_id == '1234') {
    messageDict[messageKeys.MealBalance] = 367;
    messageDict[messageKeys.FlexBalance] = 195;
    sendAppMessage(messageDict);
  } else {
    getWatCardHTML(account_id, localStorage[KEY_PIN]);
  }
}

Pebble.addEventListener("ready",
    function ready(e) {
      console.log("JS Ready");
      messageDict = {};
      messageDict[messageKeys.JSReady] = 1;
      sendAppMessage(messageDict);
    }
);

Pebble.addEventListener('appmessage',
  function(e) {
    console.log('Received message: ' + JSON.stringify(e.payload));
    if (e.payload.RequestRefresh) {
      refresh();
    }
  }
);

Pebble.addEventListener('showConfiguration', function(e) {
  Pebble.openURL(clay.generateUrl());
});

Pebble.addEventListener('webviewclosed', function(e) {
  if (e && !e.response) {
    return;
  }

  var dict = clay.getSettings(e.response);
  localStorage[KEY_ACCOUNT_ID] = dict[messageKeys.Dummy_AccountId];
  localStorage[KEY_PIN] = dict[messageKeys.Dummy_AccountPin];

  refresh();
});


text:
<!DOCTYPE html>

foo	bar


text:
<?php

namespace Coupe\Http\Exception;

use Coupe\Exception\Exception;

/**
 * @author Kazuyuki Hayashi <hayashi@valnur.net>
 */
class BadCgiCallException extends Exception
{

}


text:
<Ui xmlns="http://www.blizzard.com/wow/ui/"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
	<Script file="RetsehAnnounce.lua"/>
	<Frame name="RetsehAnnounceFrame">
		<Scripts>
			<OnLoad>
				RetsehAnnounce_OnLoad();
			</OnLoad>
			<OnEvent>
				RetsehAnnounce_OnEvent(event);
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>


text:
class SkCanvas;
class SkPicture;

namespace cc {

class Picture;

class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> {
 public:
  struct CC_EXPORT SolidColorAnalysis {
    SolidColorAnalysis()
        : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {}
    ~SolidColorAnalysis() {}

    bool is_solid_color;
    SkColor solid_color;
  };

  // Raster a subrect of this RasterSource into the given canvas. It is
  // assumed that contents_scale has already been applied to this canvas.
  // Writes the total number of pixels rasterized and the time spent
  // rasterizing to the stats if the respective pointer is not nullptr.
  // It is assumed that the canvas passed here will only be rasterized by
  // this raster source via this call.
  virtual void PlaybackToCanvas(SkCanvas* canvas,
                                const gfx::Rect& canvas_rect,
                                float contents_scale) const = 0;

  // Similar to above, except that the canvas passed here can (or was already)
  // rasterized into by another raster source. That is, it is not safe to clear
  // the canvas or discard its underlying memory.
  virtual void PlaybackToSharedCanvas(SkCanvas* canvas,
                                      const gfx::Rect& canvas_rect,
                                      float contents_scale) const = 0;

  // Analyze to determine if the given rect at given scale is of solid color in
  // this raster source.
  virtual void PerformSolidColorAnalysis(
      const gfx::Rect& content_rect,
      float contents_scale,
      SolidColorAnalysis* analysis) const = 0;

  // Returns true iff the whole raster source is of solid color.
  virtual bool IsSolidColor() const = 0;

  // Returns the color of the raster source if it is solid color. The results
  // are unspecified if IsSolidColor returns false.
  virtual SkColor GetSolidColor() const = 0;

  // Returns the size of this raster source.
  virtual gfx::Size GetSize() const = 0;

  // Populate the given list with all SkPixelRefs that may overlap the given
  // rect at given scale.
  virtual void GatherPixelRefs(const gfx::Rect& content_rect,
                               float contents_scale,
                               std::vector<SkPixelRef*>* pixel_refs) const = 0;

  // Return true iff this raster source can raster the given rect at given
  // scale.
  virtual bool CoversRect(const gfx::Rect& content_rect,
                          float contents_scale) const = 0;

  // Returns true if this raster source has anything to rasterize.
  virtual bool HasRecordings() const = 0;

  // Informs the raster source that it should attempt to use distance field text
  // during rasterization.
  virtual void SetShouldAttemptToUseDistanceFieldText() = 0;

  // Return true iff this raster source would benefit from using distance
  // field text.
  virtual bool ShouldAttemptToUseDistanceFieldText() const = 0;

  // Tracing functionality.
  virtual void DidBeginTracing() = 0;
  virtual void AsValueInto(base::trace_event::TracedValue* array) const = 0;
  virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0;
  virtual size_t GetPictureMemoryUsage() const = 0;

  // Return true if LCD anti-aliasing may be used when rastering text.
  virtual bool CanUseLCDText() const = 0;

  virtual scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const = 0;

 protected:
  friend class base::RefCountedThreadSafe<RasterSource>;

  RasterSource() {}
  virtual ~RasterSource() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(RasterSource);
};

}  // namespace cc

#endif  // CC_RESOURCES_RASTER_SOURCE_H_


text:
/* global describe, it *//* jshint -W030 */

"use strict";

var expect = require('chai').expect;
var welsh = require('../dist');

describe("Welsh Interop", function () {
  it("should work", function (done) {
    new welsh.Deferred(function (resolve, reject) {
      expect(resolve).to.be.a('function');
      expect(reject).to.be.a('function');
      resolve('bill');
    }).then(function (result) {
      expect(result).to.equal('bill');
      return 'hello ' + result;
    }).then(function (result) {
      expect(result).to.equal('hello bill');
      return '"---' + result + '---"';
    }).then(/* fall through */).then(function (result) {
      expect(result).to.equal('"---hello bill---"');
      return new welsh.Promise(function (resolveOuter) {
        setTimeout(function () {
          resolveOuter(new welsh.Deferred(function (resolveInner) {
            setTimeout(function () {
              resolveInner('***' + result + '***');
            }, 100);
          }));
        }, 100);
      });
    }).then(function (result) {
      expect(result).to.equal('***"---hello bill---"***');
      return '///' + result + '\\\\\\';
    }).then(function (result) {
      expect(result).to.equal('///***"---hello bill---"***\\\\\\');
      done();
    });
  });

  it("should handle returned Deferreds that reject", function (done) {
    var reject;
    var p = new welsh.Promise(function (_resolve, _reject) {
      reject = _reject;
    });

    p.catch(function (err) {
      expect(err).to.equal("an error!");
      throw 'totally ' + err;
    }).catch(function (result) {
      expect(result).to.equal('totally an error!');
      return new welsh.Deferred(function (resolve, reject) {
        setTimeout(function () {
          reject('it was ' + result);
        }, 100);
      });
    }).catch(function (err) {
      expect(err).to.equal("it was totally an error!");
      done();
    });

    reject("an error!");
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <billNumber>1612</billNumber>
    <amendments />
    <calendarNumbers />
    <sponsors>
      <item>
        <party>D</party>
        <firstName>CAROLYN</firstName>
        <state>NY</state>
        <fullName>Rep. Maloney, Carolyn B. [D-NY-12]</fullName>
        <identifiers>
          <lisID>729</lisID>
          <bioguideId>M000087</bioguideId>
          <gpoId>8075</gpoId>
        </identifiers>
        <bioguideId>M000087</bioguideId>
        <byRequestType />
        <district>12</district>
        <lastName>MALONEY</lastName>
        <middleName>B.</middleName>
      </item>
    </sponsors>
    <subjects>
      <billSubjects>
        <legislativeSubjects>
          <item>
            <name>Business records</name>
          </item>
          <item>
            <name>Congressional oversight</name>
          </item>
          <item>
            <name>Criminal investigation, prosecution, interrogation</name>
          </item>
          <item>
            <name>Criminal justice information and records</name>
          </item>
          <item>
            <name>Criminal procedure and sentencing</name>
          </item>
          <item>
            <name>Department of Justice</name>
          </item>
          <item>
            <name>Firearms and explosives</name>
          </item>
          <item>
            <name>Licensing and registrations</name>
          </item>
        </legislativeSubjects>
        <policyArea>
          <name>Crime and Law Enforcement</name>
        </policyArea>
      </billSubjects>
    </subjects>
    <notes />
    <summaries>
      <billSummaries />
    </summaries>
    <congress>115</congress>
    <createDate>2017-03-18T04:55:14Z</createDate>
    <committeeReports />
    <recordedVotes />
    <title>Gun Show Loophole Closing Act of 2017</title>
    <introducedDate>2017-03-17</introducedDate>
    <committees>
      <billCommittees>
        <item>
          <systemCode>hsju00</systemCode>
          <name>Judiciary Committee</name>
          <subcommittees>
            <item>
              <systemCode>hsju08</systemCode>
              <name>Crime, Terrorism, Homeland Security, and Investigations Subcommittee</name>
              <activities>
                <item>
                  <date>2017-03-31T19:02:07Z</date>
                  <name>Referred to</name>
                </item>
              </activities>
            </item>
          </subcommittees>
          <type>Standing</type>
          <chamber>House</chamber>
          <activities>
            <item>
              <date>2017-03-17T13:02:00Z</date>
              <name>Referred to</name>
            </item>
          </activities>
        </item>
      </billCommittees>
    </committees>
    <laws />
    <policyArea>
      <name>Crime and Law Enforcement</name>
    </policyArea>
    <relatedBills />
    <originChamber>House</originChamber>
    <billType>HR</billType>
    <actions>
      <actionByCounts>
        <houseOfRepresentatives>4</houseOfRepresentatives>
      </actionByCounts>
      <item>
        <actionDate>2017-03-31</actionDate>
        <committee>
          <systemCode>hsju08</systemCode>
          <name>Crime, Terrorism, Homeland Security, and Investigations Subcommittee</name>
        </committee>
        <links />
        <sourceSystem>
          1
          <name>House committee actions</name>
        </sourceSystem>
        <text>Referred to the Subcommittee on Crime, Terrorism, Homeland Security, and Investigations.</text>
        <type>Committee</type>
      </item>
      <item>
        <committee>
          <systemCode>hsju00</systemCode>
          <name>Judiciary Committee</name>
        </committee>
        <sourceSystem>
          2
          <name>House floor actions</name>
        </sourceSystem>
        <type>IntroReferral</type>
        <actionCode>H11100</actionCode>
        <actionDate>2017-03-17</actionDate>
        <text>Referred to the House Committee on the Judiciary.</text>
        <links />
      </item>
      <item>
        <committee />
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <type>IntroReferral</type>
        <actionCode>Intro-H</actionCode>
        <actionDate>2017-03-17</actionDate>
        <text>Introduced in House</text>
        <links />
      </item>
      <item>
        <committee />
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <type>IntroReferral</type>
        <actionCode>1000</actionCode>
        <actionDate>2017-03-17</actionDate>
        <text>Introduced in House</text>
        <links />
      </item>
      <actionTypeCounts>
        <introducedInTheHouse>1</introducedInTheHouse>
        <placeholderTextForH>1</placeholderTextForH>
        <billReferrals>1</billReferrals>
        <introducedInHouse>1</introducedInHouse>
      </actionTypeCounts>
    </actions>
    <titles>
      <item>
        <parentTitleType />
        <chamberName />
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <title>Gun Show Loophole Closing Act of 2017</title>
        <chamberCode />
      </item>
      <item>
        <parentTitleType />
        <chamberName />
        <titleType>Short Titles as Introduced</titleType>
        <title>Gun Show Loophole Closing Act of 2017</title>
        <chamberCode />
      </item>
      <item>
        <parentTitleType />
        <chamberName />
        <titleType>Official Title as Introduced</titleType>
        <title>To require criminal background checks on all firearms transactions occurring at gun shows.</title>
        <chamberCode />
      </item>
      <item>
        <parentTitleType />
        <chamberName />
        <titleType>Display Title</titleType>
        <title>Gun Show Loophole Closing Act of 2017</title>
        <chamberCode />
      </item>
    </titles>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mrs. CAROLYN B. MALONEY of New York:H.R. 1612.Congress has the power to enact this legislation pursuantto the following:Article I, Section 8, Clause 3, the Commerce Clause[Page H2184]
]]></constitutionalAuthorityStatementText>
    <updateDate>2017-10-13T07:16:20Z</updateDate>
    <cboCostEstimates />
    <cosponsors>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>OR</state>
        <district>3</district>
        <firstName>EARL</firstName>
        <party>D</party>
        <lastName>BLUMENAUER</lastName>
        <middleName />
        <bioguideId>B000574</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>99</lisID>
          <bioguideId>B000574</bioguideId>
          <gpoId>8116</gpoId>
        </identifiers>
        <fullName>Rep. Blumenauer, Earl [D-OR-3]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>PA</state>
        <district>13</district>
        <firstName>Brendan</firstName>
        <party>D</party>
        <lastName>Boyle</lastName>
        <middleName>F.</middleName>
        <bioguideId>B001296</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2267</lisID>
          <bioguideId>B001296</bioguideId>
          <gpoId />
        </identifiers>
        <fullName>Rep. Boyle, Brendan F. [D-PA-13]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>RI</state>
        <district>1</district>
        <firstName>David</firstName>
        <party>D</party>
        <lastName>Cicilline</lastName>
        <middleName>N.</middleName>
        <bioguideId>C001084</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>C001084</bioguideId>
          <lisID>2055</lisID>
          <gpoId>8139</gpoId>
        </identifiers>
        <fullName>Rep. Cicilline, David N. [D-RI-1]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>TN</state>
        <district>9</district>
        <firstName>Steve</firstName>
        <party>D</party>
        <lastName>Cohen</lastName>
        <middleName />
        <bioguideId>C001068</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>C001068</bioguideId>
          <lisID>1878</lisID>
          <gpoId>8156</gpoId>
        </identifiers>
        <fullName>Rep. Cohen, Steve [D-TN-9]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>MI</state>
        <district>13</district>
        <firstName>JOHN</firstName>
        <party>D</party>
        <lastName>CONYERS</lastName>
        <middleName />
        <bioguideId>C000714</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>229</lisID>
          <bioguideId>C000714</bioguideId>
          <gpoId>7999</gpoId>
        </identifiers>
        <fullName>Rep. Conyers, John, Jr. [D-MI-13]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NY</state>
        <district>14</district>
        <firstName>JOSEPH</firstName>
        <party>D</party>
        <lastName>CROWLEY</lastName>
        <middleName />
        <bioguideId>C001038</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1604</lisID>
          <bioguideId>C001038</bioguideId>
          <gpoId>8068</gpoId>
        </identifiers>
        <fullName>Rep. Crowley, Joseph [D-NY-14]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>MD</state>
        <district>7</district>
        <firstName>ELIJAH</firstName>
        <party>D</party>
        <lastName>CUMMINGS</lastName>
        <middleName>E.</middleName>
        <bioguideId>C000984</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>C000984</bioguideId>
          <lisID>256</lisID>
          <gpoId>7982</gpoId>
        </identifiers>
        <fullName>Rep. Cummings, Elijah E. [D-MD-7]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>CT</state>
        <district>3</district>
        <firstName>ROSA</firstName>
        <party>D</party>
        <lastName>DELAURO</lastName>
        <middleName />
        <bioguideId>D000216</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>281</lisID>
          <bioguideId>D000216</bioguideId>
          <gpoId>7868</gpoId>
        </identifiers>
        <fullName>Rep. DeLauro, Rosa L. [D-CT-3]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>PA</state>
        <district>14</district>
        <firstName>MIKE</firstName>
        <party>D</party>
        <lastName>DOYLE</lastName>
        <middleName />
        <bioguideId>D000482</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>316</lisID>
          <bioguideId>D000482</bioguideId>
          <gpoId>8132</gpoId>
        </identifiers>
        <fullName>Rep. Doyle, Michael F. [D-PA-14]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NY</state>
        <district>16</district>
        <firstName>ELIOT</firstName>
        <party>D</party>
        <lastName>ENGEL</lastName>
        <middleName>L.</middleName>
        <bioguideId>E000179</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>E000179</bioguideId>
          <gpoId>8078</gpoId>
          <lisID>344</lisID>
        </identifiers>
        <fullName>Rep. Engel, Eliot L. [D-NY-16]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>AZ</state>
        <district>3</district>
        <firstName>Raul</firstName>
        <party>D</party>
        <lastName>Grijalva</lastName>
        <middleName>M.</middleName>
        <bioguideId>G000551</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>G000551</bioguideId>
          <lisID>1708</lisID>
          <gpoId>7804</gpoId>
        </identifiers>
        <fullName>Rep. Grijalva, Raul M. [D-AZ-3]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>MA</state>
        <district>9</district>
        <firstName>William</firstName>
        <party>D</party>
        <lastName>Keating</lastName>
        <middleName>R.</middleName>
        <bioguideId>K000375</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2025</lisID>
          <bioguideId>K000375</bioguideId>
          <gpoId>7975</gpoId>
        </identifiers>
        <fullName>Rep. Keating, William R. [D-MA-9]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>RI</state>
        <district>2</district>
        <firstName>JAMES</firstName>
        <party>D</party>
        <lastName>LANGEVIN</lastName>
        <middleName>R.</middleName>
        <bioguideId>L000559</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1668</lisID>
          <bioguideId>L000559</bioguideId>
          <gpoId>8140</gpoId>
        </identifiers>
        <fullName>Rep. Langevin, James R. [D-RI-2]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>MA</state>
        <district>8</district>
        <firstName>Stephen</firstName>
        <party>D</party>
        <lastName>Lynch</lastName>
        <middleName>F.</middleName>
        <bioguideId>L000562</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>L000562</bioguideId>
          <gpoId>7974</gpoId>
          <lisID>1686</lisID>
        </identifiers>
        <fullName>Rep. Lynch, Stephen F. [D-MA-8]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>MN</state>
        <district>4</district>
        <firstName>BETTY</firstName>
        <party>D</party>
        <lastName>MCCOLLUM</lastName>
        <middleName />
        <bioguideId>M001143</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>M001143</bioguideId>
          <lisID>1653</lisID>
          <gpoId>8004</gpoId>
        </identifiers>
        <fullName>Rep. McCollum, Betty [D-MN-4]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>MA</state>
        <district>2</district>
        <firstName>JAMES</firstName>
        <party>D</party>
        <lastName>MCGOVERN</lastName>
        <middleName>P.</middleName>
        <bioguideId>M000312</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>M000312</bioguideId>
          <lisID>1504</lisID>
          <gpoId>7968</gpoId>
        </identifiers>
        <fullName>Rep. McGovern, James P. [D-MA-2]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NY</state>
        <district>5</district>
        <firstName>GREGORY</firstName>
        <party>D</party>
        <lastName>MEEKS</lastName>
        <middleName>W.</middleName>
        <bioguideId>M001137</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1506</lisID>
          <bioguideId>M001137</bioguideId>
          <gpoId>8067</gpoId>
        </identifiers>
        <fullName>Rep. Meeks, Gregory W. [D-NY-5]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NY</state>
        <district>10</district>
        <firstName>JERROLD</firstName>
        <party>D</party>
        <lastName>NADLER</lastName>
        <middleName />
        <bioguideId>N000002</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>850</lisID>
          <bioguideId>N000002</bioguideId>
          <gpoId>8069</gpoId>
        </identifiers>
        <fullName>Rep. Nadler, Jerrold [D-NY-10]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>DC</state>
        <district>0</district>
        <firstName>ELEANOR</firstName>
        <party>D</party>
        <lastName>NORTON</lastName>
        <middleName>HOLMES</middleName>
        <bioguideId>N000147</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>868</lisID>
          <bioguideId>N000147</bioguideId>
          <gpoId>7871</gpoId>
        </identifiers>
        <fullName>Rep. Norton, Eleanor Holmes [D-DC-At Large]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>TX</state>
        <district>16</district>
        <firstName>Beto</firstName>
        <party>D</party>
        <lastName>O'Rourke</lastName>
        <middleName />
        <bioguideId>O000170</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2162</lisID>
          <bioguideId>O000170</bioguideId>
          <gpoId />
        </identifiers>
        <fullName>Rep. O'Rourke, Beto [D-TX-16]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>ME</state>
        <district>1</district>
        <firstName>Chellie</firstName>
        <party>D</party>
        <lastName>Pingree</lastName>
        <middleName />
        <bioguideId>P000597</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>P000597</bioguideId>
          <lisID>1927</lisID>
          <gpoId>7984</gpoId>
        </identifiers>
        <fullName>Rep. Pingree, Chellie [D-ME-1]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>WI</state>
        <district>2</district>
        <firstName>Mark</firstName>
        <party>D</party>
        <lastName>Pocan</lastName>
        <middleName />
        <bioguideId>P000607</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2171</lisID>
          <bioguideId>P000607</bioguideId>
          <gpoId />
        </identifiers>
        <fullName>Rep. Pocan, Mark [D-WI-2]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>IL</state>
        <district>5</district>
        <firstName>Mike</firstName>
        <party>D</party>
        <lastName>Quigley</lastName>
        <middleName />
        <bioguideId>Q000023</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1967</lisID>
          <gpoId>7925</gpoId>
          <bioguideId>Q000023</bioguideId>
        </identifiers>
        <fullName>Rep. Quigley, Mike [D-IL-5]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>CA</state>
        <district>51</district>
        <firstName>Juan</firstName>
        <party>D</party>
        <lastName>Vargas</lastName>
        <middleName />
        <bioguideId>V000130</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2112</lisID>
          <bioguideId>V000130</bioguideId>
          <gpoId />
        </identifiers>
        <fullName>Rep. Vargas, Juan [D-CA-51]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>IL</state>
        <district>2</district>
        <firstName>Robin</firstName>
        <party>D</party>
        <lastName>Kelly</lastName>
        <middleName>L.</middleName>
        <bioguideId>K000385</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>K000385</bioguideId>
          <lisID>2190</lisID>
          <gpoId />
        </identifiers>
        <fullName>Rep. Kelly, Robin L. [D-IL-2]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NY</state>
        <district>15</district>
        <firstName>JOSE</firstName>
        <party>D</party>
        <lastName>SERRANO</lastName>
        <middleName>E.</middleName>
        <bioguideId>S000248</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1042</lisID>
          <gpoId>8077</gpoId>
          <bioguideId>S000248</bioguideId>
        </identifiers>
        <fullName>Rep. Serrano, Jose E. [D-NY-15]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NJ</state>
        <district>12</district>
        <firstName>Bonnie</firstName>
        <party>D</party>
        <lastName>Watson Coleman</lastName>
        <middleName />
        <bioguideId>W000822</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2259</lisID>
          <gpoId />
          <bioguideId>W000822</bioguideId>
        </identifiers>
        <fullName>Rep. Watson Coleman, Bonnie [D-NJ-12]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>FL</state>
        <district>23</district>
        <firstName>Debbie</firstName>
        <party>D</party>
        <lastName>Wasserman Schultz</lastName>
        <middleName />
        <bioguideId>W000797</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1777</lisID>
          <bioguideId>W000797</bioguideId>
          <gpoId>7892</gpoId>
        </identifiers>
        <fullName>Rep. Wasserman Schultz, Debbie [D-FL-23]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-17</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <state>NY</state>
        <district>17</district>
        <firstName>NITA</firstName>
        <party>D</party>
        <lastName>LOWEY</lastName>
        <middleName>M.</middleName>
        <bioguideId>L000480</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>L000480</bioguideId>
          <lisID>709</lisID>
          <gpoId>8079</gpoId>
        </identifiers>
        <fullName>Rep. Lowey, Nita M. [D-NY-17]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-23</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>MA</state>
        <district>3</district>
        <firstName>Niki</firstName>
        <party>D</party>
        <lastName>Tsongas</lastName>
        <middleName />
        <bioguideId>T000465</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1884</lisID>
          <bioguideId>T000465</bioguideId>
          <gpoId>7970</gpoId>
        </identifiers>
        <fullName>Rep. Tsongas, Niki [D-MA-3]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-23</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>IL</state>
        <district>1</district>
        <firstName>BOBBY</firstName>
        <party>D</party>
        <lastName>RUSH</lastName>
        <middleName>L.</middleName>
        <bioguideId>R000515</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1003</lisID>
          <bioguideId>R000515</bioguideId>
          <gpoId>7921</gpoId>
        </identifiers>
        <fullName>Rep. Rush, Bobby L. [D-IL-1]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-23</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>CA</state>
        <district>2</district>
        <firstName>Jared</firstName>
        <party>D</party>
        <lastName>Huffman</lastName>
        <middleName />
        <bioguideId>H001068</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2101</lisID>
          <bioguideId>H001068</bioguideId>
          <gpoId />
        </identifiers>
        <fullName>Rep. Huffman, Jared [D-CA-2]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-30</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>FL</state>
        <district>22</district>
        <firstName>Theodore</firstName>
        <party>D</party>
        <lastName>Deutch</lastName>
        <middleName>E.</middleName>
        <bioguideId>D000610</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1976</lisID>
          <bioguideId>D000610</bioguideId>
          <gpoId>7891</gpoId>
        </identifiers>
        <fullName>Rep. Deutch, Theodore E. [D-FL-22]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-30</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>PA</state>
        <district>2</district>
        <firstName>Dwight</firstName>
        <party>D</party>
        <lastName>Evans</lastName>
        <middleName />
        <bioguideId>E000296</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2298</lisID>
          <bioguideId>E000296</bioguideId>
          <gpoId />
        </identifiers>
        <fullName>Rep. Evans, Dwight [D-PA-2]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-03-30</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>CT</state>
        <district>1</district>
        <firstName>JOHN</firstName>
        <party>D</party>
        <lastName>LARSON</lastName>
        <middleName>B.</middleName>
        <bioguideId>L000557</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1583</lisID>
          <bioguideId>L000557</bioguideId>
          <gpoId>7866</gpoId>
        </identifiers>
        <fullName>Rep. Larson, John B. [D-CT-1]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-04-03</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>WA</state>
        <district>7</district>
        <firstName>Pramila</firstName>
        <party>D</party>
        <lastName>Jayapal</lastName>
        <middleName />
        <bioguideId>J000298</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2354</lisID>
          <gpoId />
          <bioguideId>J000298</bioguideId>
        </identifiers>
        <fullName>Rep. Jayapal, Pramila [D-WA-7]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-04-28</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>NH</state>
        <district>1</district>
        <firstName>Carol</firstName>
        <party>D</party>
        <lastName>Shea-Porter</lastName>
        <middleName />
        <bioguideId>S001170</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1861</lisID>
          <gpoId>7528</gpoId>
          <bioguideId>S001170</bioguideId>
        </identifiers>
        <fullName>Rep. Shea-Porter, Carol [D-NH-1]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-04-28</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>CA</state>
        <district>17</district>
        <firstName>Ro</firstName>
        <party>D</party>
        <lastName>Khanna</lastName>
        <middleName />
        <bioguideId>K000389</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>K000389</bioguideId>
          <gpoId />
          <lisID>2308</lisID>
        </identifiers>
        <fullName>Rep. Khanna, Ro [D-CA-17]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-07-19</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>FL</state>
        <district>21</district>
        <firstName>Lois</firstName>
        <party>D</party>
        <lastName>Frankel</lastName>
        <middleName />
        <bioguideId>F000462</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>F000462</bioguideId>
          <lisID>2119</lisID>
          <gpoId />
        </identifiers>
        <fullName>Rep. Frankel, Lois [D-FL-21]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-08-29</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>CT</state>
        <district>4</district>
        <firstName>James</firstName>
        <party>D</party>
        <lastName>Himes</lastName>
        <middleName>A.</middleName>
        <bioguideId>H001047</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>H001047</bioguideId>
          <gpoId>7869</gpoId>
          <lisID>1913</lisID>
        </identifiers>
        <fullName>Rep. Himes, James A. [D-CT-4]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-10-02</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>MD</state>
        <district>3</district>
        <firstName>John</firstName>
        <party>D</party>
        <lastName>Sarbanes</lastName>
        <middleName>P.</middleName>
        <bioguideId>S001168</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>1854</lisID>
          <bioguideId>S001168</bioguideId>
          <gpoId>7978</gpoId>
        </identifiers>
        <fullName>Rep. Sarbanes, John P. [D-MD-3]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-10-12</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>MA</state>
        <district>6</district>
        <firstName>Seth</firstName>
        <party>D</party>
        <lastName>Moulton</lastName>
        <middleName />
        <bioguideId>M001196</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>M001196</bioguideId>
          <lisID>2246</lisID>
          <gpoId />
        </identifiers>
        <fullName>Rep. Moulton, Seth [D-MA-6]</fullName>
      </item>
      <item>
        <sponsorshipDate>2017-10-12</sponsorshipDate>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <state>CA</state>
        <district>6</district>
        <firstName>Doris</firstName>
        <party>D</party>
        <lastName>Matsui</lastName>
        <middleName>O.</middleName>
        <bioguideId>M001163</bioguideId>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>M001163</bioguideId>
          <lisID>1814</lisID>
          <gpoId>7810</gpoId>
        </identifiers>
        <fullName>Rep. Matsui, Doris O. [D-CA-6]</fullName>
      </item>
    </cosponsors>
    <latestAction>
      <text>Referred to the Subcommittee on Crime, Terrorism, Homeland Security, and Investigations.</text>
      <actionDate>2017-03-31</actionDate>
      <links />
    </latestAction>
    <version>1.0.0</version>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
package org.deidentifier.arx.examples;

import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;

import org.deidentifier.arx.ARXAnonymizer;
import org.deidentifier.arx.ARXConfiguration;
import org.deidentifier.arx.ARXResult;
import org.deidentifier.arx.AttributeType;
import org.deidentifier.arx.AttributeType.Hierarchy;
import org.deidentifier.arx.AttributeType.Hierarchy.DefaultHierarchy;
import org.deidentifier.arx.Data;
import org.deidentifier.arx.Data.DefaultData;
import org.deidentifier.arx.criteria.DistinctLDiversity;
import org.deidentifier.arx.criteria.KAnonymity;
import org.deidentifier.arx.metric.Metric;

/**
 * This class implements an example on how to use multiple instances of l-diversity
 * without protecting sensitive associations.
 *
 * @author Fabian Prasser
 * @author Florian Kohlmayer
 */
public class Example23 extends Example {

    /**
     * Entry point.
     *
     * @param args
     *            the arguments
     */
    public static void main(String[] args) throws IOException {

        // Define data
        DefaultData data = Data.create();
        data.add("zipcode", "age", "disease");
        data.add("47677", "22", "gastric ulcer");
        data.add("47602", "23", "gastritis");
        data.add("47678", "24", "stomach cancer");
        data.add("47605", "25", "bronchitis");
        data.add("47607", "26", "pneumonia");
        data.add("47673", "26", "pneumonia");
        data.add("47905", "23", "gastritis");
        data.add("47909", "27", "flu");
        data.add("47906", "25", "bronchitis");

        // Define hierarchies
        DefaultHierarchy age = Hierarchy.create();
        age.add("29", "<=40", "*");
        age.add("22", "<=40", "*");
        age.add("27", "<=40", "*");
        age.add("43", ">40", "*");
        age.add("52", ">40", "*");
        age.add("47", ">40", "*");
        age.add("30", "<=40", "*");
        age.add("36", "<=40", "*");
        age.add("32", "<=40", "*");

        // Only excerpts for readability
        DefaultHierarchy zipcode = Hierarchy.create();
        zipcode.add("47677", "4767*", "476**", "47***", "4****", "*****");
        zipcode.add("47602", "4760*", "476**", "47***", "4****", "*****");
        zipcode.add("47678", "4767*", "476**", "47***", "4****", "*****");
        zipcode.add("47905", "4790*", "479**", "47***", "4****", "*****");
        zipcode.add("47909", "4790*", "479**", "47***", "4****", "*****");
        zipcode.add("47906", "4790*", "479**", "47***", "4****", "*****");
        zipcode.add("47605", "4760*", "476**", "47***", "4****", "*****");
        zipcode.add("47673", "4767*", "476**", "47***", "4****", "*****");
        zipcode.add("47607", "4760*", "476**", "47***", "4****", "*****");

        // Define sensitive value hierarchy
        DefaultHierarchy disease = Hierarchy.create();
        disease.add("flu",
                    "respiratory infection",
                    "vascular lung disease",
                    "respiratory & digestive system disease");
        disease.add("pneumonia",
                    "respiratory infection",
                    "vascular lung disease",
                    "respiratory & digestive system disease");
        disease.add("bronchitis",
                    "respiratory infection",
                    "vascular lung disease",
                    "respiratory & digestive system disease");
        disease.add("pulmonary edema",
                    "vascular lung disease",
                    "vascular lung disease",
                    "respiratory & digestive system disease");
        disease.add("pulmonary embolism",
                    "vascular lung disease",
                    "vascular lung disease",
                    "respiratory & digestive system disease");
        disease.add("gastric ulcer",
                    "stomach disease",
                    "digestive system disease",
                    "respiratory & digestive system disease");
        disease.add("stomach cancer",
                    "stomach disease",
                    "digestive system disease",
                    "respiratory & digestive system disease");
        disease.add("gastritis",
                    "stomach disease",
                    "digestive system disease",
                    "respiratory & digestive system disease");
        disease.add("colitis",
                    "colon disease",
                    "digestive system disease",
                    "respiratory & digestive system disease");
        disease.add("colon cancer",
                    "colon disease",
                    "digestive system disease",
                    "respiratory & digestive system disease");

        data.getDefinition().setAttributeType("zipcode", zipcode);
        data.getDefinition().setAttributeType("disease", AttributeType.SENSITIVE_ATTRIBUTE);
        data.getDefinition().setAttributeType("age", AttributeType.SENSITIVE_ATTRIBUTE);

        // Create an instance of the anonymizer
        ARXAnonymizer anonymizer = new ARXAnonymizer();
        ARXConfiguration config = ARXConfiguration.create();
        config.addPrivacyModel(new KAnonymity(3));
        config.addPrivacyModel(new DistinctLDiversity("disease", 2));
        config.addPrivacyModel(new DistinctLDiversity("age", 2));
        config.setSuppressionLimit(0.1d);
        config.setQualityModel(Metric.createEntropyMetric());

        // Now anonymize
        ARXResult result = anonymizer.anonymize(data, config);

        // Print info
        printResult(result, data);

        // Process results
        if (result.isResultAvailable()) {
            System.out.println(" - Transformed data:");
            Iterator<String[]> transformed = result.getOutput(false).iterator();
            while (transformed.hasNext()) {
                System.out.print("   ");
                System.out.println(Arrays.toString(transformed.next()));
            }
        }
    }
}


text:
That big pink button again:

    <Button size="large" color="deeppink">Click Me</Button>