text:
package edu.colorado.hopper.client.bounds

import com.ibm.wala.ipa.callgraph.CGNode
import com.ibm.wala.ssa.{ISSABasicBlock, SSACFG, SSAInstruction, SSAInvokeInstruction, SSAPhiInstruction}
import edu.colorado.hopper.executor.TransferFunctions
import edu.colorado.hopper.state.Qry
import edu.colorado.walautil.{Util, WalaAnalysisResults}

import scala.collection.JavaConversions._

class ArrayBoundsTransferFunctions(walaRes : WalaAnalysisResults)
  extends TransferFunctions(walaRes.cg, walaRes.hg, walaRes.hm, walaRes.cha) {

  override def dropConstraintsFromInstructions(i : Iterable[SSAInstruction], n : CGNode, qry : Qry,
                                               callee : Option[CGNode] = None, loopDrop : Boolean = false) : Unit = {
    require(Util.implies(callee.isDefined, i.forall(i => i.isInstanceOf[SSAInvokeInstruction])))
    // important to do this first; otherwise we may unsoundly assume a local binding holds when it can in fact be reassigned in a loop
    // qry.node check is because we only need to drop local constraints for the current node (not for callees,
    // because we won't have any)
    if (qry.node == n) {
      val dropInstrs = if (loopDrop) {
        val changingDefs = getChangingDefs(i)
        i.filter(i => changingDefs.contains(i.getDef()))
      } else i
      // purposely turn off problem-causing loopDrop
      dropInstrs.foreach(i => dropLocalConstraintsFromInstruction(i, qry, loopDrop = false))
    }
    // purposely turn off problem-causing loopDrop
    i.foreach(i => dropHeapConstraintsFromInstruction(i, n, qry, modRef, loopDrop = false, callee))
  }

  override def dropLoopWriteableConstraints(qry : Qry, loopHead : ISSABasicBlock, n : CGNode) : Unit = {
    val loopInstrs = edu.colorado.thresher.core.WALACFGUtil.getInstructionsInLoop(loopHead.asInstanceOf[SSACFG#BasicBlock], n.getIR()).toSet
    dropConstraintsFromInstructions(loopInstrs, n, qry, callee = None, loopDrop = true)
  }

  // get the value numbers of all def's that may assign to a value that changes in the loop
  def getChangingDefs(instrs : Iterable[SSAInstruction]) : Set[Int] = {
    val (defs, phiUses) = instrs.foldLeft (Set.empty[Int], Map.empty[Int,Seq[Int]]) ((pair, i) => {
      val (defs, phiUses) = pair
      i match {
        case i : SSAPhiInstruction =>
          (defs, phiUses + (i.getDef() -> (0 to i.getNumberOfUses() - 1).map(j => i.getUse(j))))
        case i if i.hasDef() => (defs + i.getDef(), phiUses)
        case _ => pair
      }
    })

    // we only want to count a phi use as a def if it can assign to something that's changing in the loop
    // thus, only count a phi def as a def if it assigns to another *non-phi* def
    @annotation.tailrec
    def addPhiUsesRec(defs : Set[Int], phiUses : Map[Int,Seq[Int]], misses : Int = 0) : Set[Int] = phiUses match {
      case phiUses if !phiUses.isEmpty =>
        val (key, valu) = phiUses.head
        if (valu.exists(use => defs.contains(use))) {
          addPhiUsesRec(defs + key, phiUses - key, 0)
        } else {
          val newMisses = misses + 1
          if (newMisses == phiUses.size) defs // we've looked at everything and found no phi uses that are also defs
          else addPhiUsesRec(defs, phiUses, newMisses)
        }
      case _ => defs
    }
    // get the list of defs that may change in a loop
    addPhiUsesRec(defs, phiUses)
  }
}


text:
@interface FileSystem : NSObject

@property (strong, nonatomic) NSString *host;
@property (strong, nonatomic) NSString *db;

@property (strong, nonatomic) Util *QUtil;

- (id)Conn: (NSString *)db;

- (BOOL)AppCreate:(NSString *)name;
- (void)AppDelete:(NSString *)name;

- (NSString *)ParticleRead:(NSString *)name;
- (void)ParticleWrite:(NSString *)name text:(NSString *)text;
- (void)ParticleDelete:(NSString *)name;

- (NSString *)ParticleCacheRead:(NSString *)name;
- (void)ParticleCacheWrite:(NSString *)name text:(NSString *)text;
- (void)ParticleCacheDelete:(NSString *)name;

@end

redpajama_set_name: RedPajamaGithub


text:
import React from 'react';
import ReactDOM from 'react-dom';
import Router from 'cerebral-module-router';
import Controller from 'cerebral';
import Model from 'cerebral-model-baobab';
import {Container} from 'cerebral-view-react';
import Devtools from 'cerebral-module-devtools';
import Example from './modules/Example';
import ColorChanger from './components/ColorChanger';

const controller = Controller(Model({}));

controller.addModules({
  example: Example(),

  devtools: Devtools(),
  router: Router(
    {
    '/': 'example.redirectRoot',
    '/:color': 'example.colorChanged'
    }
    // Uncomment next 3 lines for hash-based routing for older browsers
    // ,{
    // onlyHash: true
    // }
  )
});

ReactDOM.render(<Container controller={controller}><ColorChanger /></Container>, document.getElementById('root'));


text:
import * as path from 'path';

import got from 'got';
import cheerio from 'cheerio';
import Promise from 'bluebird';

import log from '../../lib/log';

export default function (taskConfig, eTagMap) {
	eTagMap.data = [];

	return Promise.resolve(got('https://developers.google.com/speed/libraries/devguide')).then((response) => {
		log.info(`Fetched google data`);

		let $ = cheerio.load(response.body, { normalizeWhitespace: true });
		let $libs = $('div[itemprop="articleBody"]').children();
		let libs = [];

		$libs.each((index, element) => {
			let $element = $(element);

			if (element.name === 'h3') {
				try {
					let $libElements = $element.next().find('dd');
					let $versionElements = $element.next().find('dd.versions');
					let homepage = $($libElements[1]).find('a').attr('href');
					let mainfile = $libElements.find('code').text().split('"').slice(-2, -1)[0].split('/').slice(-1)[0];
					let name = $libElements.find('code').text().split('"').slice(-2, -1)[0].split('/')[5];
					let hasMin = ~$libElements.find('code').text().indexOf('.min.js');
					let versions = [];

					$versionElements.each((i, e) => {
						versions.push(...$(e).text().split(',').filter(v => v).map(v => v.trim()));
					});

					libs.push({
						name,
						mainfile,
						homepage,
						versions,
						assets: getAssets(mainfile, versions, hasMin),
					});
				} catch (error) {
					log.err(`Error parsing google data`);
					throw error;
				}
			}
		});

		return libs;
	}).catch((error) => {
		log.err(`Could not get https://developers.google.com/speed/libraries/devguide`);
		throw error;
	}).each((library) => {
		eTagMap.data.push({
			path: library.name,
			etag: Date.now(),
		});
	});
}

function getAssets (mainfile, versions, hasMin) {
	var name = path.basename(path.basename(mainfile, path.extname(mainfile)), '.min');
	var extensions = [ 'js' ];

	if (hasMin) {
		extensions.push('min.js');
	}

	return versions.reverse().map((version) => {
		return {
			version,
			mainfile,
			files: extensions.map(extension => `${name}.${extension}`),
		};
	});
}


text:
package org.hisp.dhis.analytics;

import java.util.ArrayList;
import java.util.List;

import org.hisp.dhis.common.ListMap;

/**
 * Immutable class representing a group of data query parameters. Should be
 * instantiated using the Builder class. Example usage:
 *

 *

 * {@code
 * DataQueryGroups groups = DataQueryGroups.newBuilder()
 *     .withQueries( queries )
 *     .build();
 * }
 *

 *
 * @author Lars Helge Overland
 */
public class DataQueryGroups
{
    private List<DataQueryParams> queries = new ArrayList<>();

    private List<List<DataQueryParams>> sequentialQueries = new ArrayList<>();

    // -------------------------------------------------------------------------
    // Constructor
    // -------------------------------------------------------------------------

    private DataQueryGroups()
    {
    }

    public static Builder newBuilder()
    {
        return new Builder();
    }

    // -------------------------------------------------------------------------
    // Public methods
    // -------------------------------------------------------------------------

    /**
     * Gets all queries.
     *
     * @return all queries.
     */
    public List<DataQueryParams> getAllQueries()
    {
        return queries;
    }

    /**
     * Gets groups of queries which should be run in sequence for optimal
     * performance. Currently queries with different aggregation type are run
     * in sequence due to the typical indicator query, where few data elements
     * have the average aggregation operator and many have the sum. Performance
     * will increase if optimal number of queries can be run in parallel for the
     * queries which take most time, which in this case are the ones with sum
     * aggregation type.
     *
     * @return groups of queries which should be run in sequence
     */
    public List<List<DataQueryParams>> getSequentialQueries()
    {
        return sequentialQueries;
    }

    /**
     * Indicates whether the current number of queries in this group is optimal.
     * Uses the given optimal query number compared to the size of the largest
     * query group to determine the outcome.
     *
     * @return true if the current number of queries in this group is optimal.
     */
    public boolean isOptimal( int optimalQueries )
    {
        return getLargestGroupSize() >= optimalQueries;
    }

    /**
     * Gets the size of the largest query group of the sequential queries.
     *
     * @return the size of the largest query group of the sequential queries.
     */
    public int getLargestGroupSize()
    {
        int max = 0;

        for ( List<DataQueryParams> list : sequentialQueries )
        {
            max = list.size() > max ? list.size() : max;
        }

        return max;
    }

    @Override
    public String toString()
    {
        return "[Seq queries: " + sequentialQueries.size() + ", all queries: " + queries.size() + ", queries: " + queries + "]";
    }

    // -------------------------------------------------------------------------
    // Supportive methods
    // -------------------------------------------------------------------------

    private static ListMap<String, DataQueryParams> getListMap( List<DataQueryParams> queries )
    {
        ListMap<String, DataQueryParams> map = new ListMap<>();

        for ( DataQueryParams query : queries )
        {
            map.putValue( query.getSequentialQueryGroupKey(), query );
        }

        return map;
    }

    // -------------------------------------------------------------------------
    // Builder
    // -------------------------------------------------------------------------

    public static class Builder
    {
        private DataQueryGroups groups;

        private Builder()
        {
            groups = new DataQueryGroups();
        }

        public Builder withQueries( List<DataQueryParams> queries )
        {
            this.groups.queries = queries;
            this.groups.sequentialQueries.addAll( getListMap( queries ).values() );
            return this;
        }

        public DataQueryGroups build()
        {
            return groups;
        }
    }
}


text:
package org.gradle.language.twirl;

import org.gradle.api.Incubating;

/**
 * Represents the available sets of default imports that can be used when compiling Twirl templates.
 */
@Incubating
public enum TwirlImports {
    SCALA, JAVA
}


text:
// Copyright 2015-2022, University of Colorado Boulder

/**
 * UI parts for update-related dialogs
 */

import merge from '../../phet-core/js/merge.js';
import StringUtils from '../../phetcommon/js/util/StringUtils.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import SpinningIndicatorNode from '../../scenery-phet/js/SpinningIndicatorNode.js';
import { allowLinksProperty, HBox, Node, openPopup, Path, Rectangle, RichText, RichTextLinks, VBox, VoicingText, VStrut } from '../../scenery/js/imports.js';
import checkSolidShape from '../../sherpa/js/fontawesome-5/checkSolidShape.js';
import exclamationTriangleSolidShape from '../../sherpa/js/fontawesome-5/exclamationTriangleSolidShape.js';
import TextPushButton from '../../sun/js/buttons/TextPushButton.js';
import joist from './joist.js';
import JoistStrings from './JoistStrings.js';
import updateCheck from './updateCheck.js';
import UpdateState from './UpdateState.js';
import UpdateDialog from './UpdateDialog.js';
import DerivedProperty from '../../axon/js/DerivedProperty.js';

// constants
const UPDATE_TEXT_FONT = new PhetFont( 14 );
const MAX_WIDTH = 550; // Maximum width of the resulting update items

type Options = {
  big?: boolean;
  centerX?: number;
  centerY?: number;
  left?: number;
  top?: number;
};

type TStep = {
  step: ( dt: number ) => void;
  stepListener: ( dt: number ) => void;
};

type TStepHBox = TStep & HBox;

const UpdateNodes = {

  /**
   * "Checking" state node. With two size options (if options.big == true, it will be bigger)
   *
   * [options] - passed to the Node
   * returns step( dt ) and stepListener (bound to the node itself)
   * (joist-internal)
   */
  createCheckingNode: function( options: Options ): Node & TStep {
    const spinningIndicatorNode = new SpinningIndicatorNode( { diameter: options.big ? 24 : 18 } );
    const checkingNode = new HBox( merge( {
      spacing: options.big ? 10 : 8,
      maxWidth: MAX_WIDTH,
      children: [
        spinningIndicatorNode,
        new VoicingText( JoistStrings.updates.checkingStringProperty, {
          font: new PhetFont( options.big ? 16 : 14 ),
          fontWeight: options.big ? 'bold' : 'normal'
        } )
      ]
    }, options ) ) as TStepHBox;
    checkingNode.step = function( dt ) {
      if ( updateCheck.stateProperty.value === UpdateState.CHECKING ) {
        spinningIndicatorNode.step( dt );
      }
    };
    checkingNode.stepListener = checkingNode.step.bind( checkingNode );
    return checkingNode;
  },

  /**
   * "Up-to-date" state node
   * [options] - passed to the Node
   * (joist-internal)
   */
  createUpToDateNode: function( options: Options ): Node {
    return new HBox( merge( {
      spacing: 8,
      maxWidth: MAX_WIDTH,
      children: [
        new Rectangle( 0, 0, 20, 20, 5, 5, {
          fill: '#5c3',
          scale: options.big ? 1.2 : 1,
          children: [
            new Path( checkSolidShape, {
              fill: '#fff',
              scale: 0.029,
              centerX: 10,
              centerY: 10
            } )
          ]
        } ),
        new VoicingText( JoistStrings.updates.upToDateStringProperty, {
          font: new PhetFont( options.big ? 16 : 14 ),
          fontWeight: options.big ? 'bold' : 'normal'
        } )
      ]
    }, options ) );
  },

  /**
   * "Out-of-date" state node for the "About" dialog.
   * [options] - passed to the Node
   * (joist-internal)
   */
  createOutOfDateAboutNode: function( options: Options ): Node {
    const stringProperty = new DerivedProperty( [ JoistStrings.updates.outOfDateStringProperty, allowLinksProperty ], ( outOfDateString, allowLinks ) => {
      return allowLinks ? `<a href="{{url}}">${outOfDateString}</a>` : outOfDateString;
    } );

    const links: RichTextLinks = { url: updateCheck.updateURL };

    const linkNode = new RichText( stringProperty, {
      links: links,
      font: UPDATE_TEXT_FONT
    } );
    return new HBox( merge( {
      spacing: 8,
      maxWidth: MAX_WIDTH,
      children: [
        new Path( exclamationTriangleSolidShape, {
          fill: '#E87600', // "safety orange", according to Wikipedia
          scale: 0.03
        } ),
        linkNode
      ],

      // pdom
      tagName: 'div'
    }, options ) );
  },

  /**
   * "Out-of-date" state node for the "Check for update" dialog.
   * dialog - the dialog, so that it can be closed with the "No thanks..." button
   * [options] - passed to the Node
   * (joist-internal)
   */
  createOutOfDateDialogNode: function( dialog: UpdateDialog, ourVersionString: string, latestVersionString: string, options: Options ): Node {

    const latestVersionStringProperty = new DerivedProperty( [ JoistStrings.updates.newVersionAvailableStringProperty ], string => {
      return StringUtils.format( string, latestVersionString );
    } );
    const ourVersionStringProperty = new DerivedProperty( [ JoistStrings.updates.yourCurrentVersionStringProperty ], string => {
      return StringUtils.format( string, ourVersionString );
    } );

    return new VBox( merge( {
      spacing: 15,
      maxWidth: MAX_WIDTH,
      children: [
        new VBox( {
          spacing: 5, align: 'left', children: [
            new VoicingText( latestVersionStringProperty, {
              font: new PhetFont( 16 ), fontWeight: 'bold'
            } ),
            new VoicingText( ourVersionStringProperty, {
              font: UPDATE_TEXT_FONT
            } )
          ]
        } ),
        new HBox( {
          spacing: 25, children: [
            new TextPushButton( JoistStrings.updates.getUpdateStringProperty, {
              visibleProperty: allowLinksProperty,
              baseColor: '#6f6', font: UPDATE_TEXT_FONT, listener: function() {
                openPopup( updateCheck.updateURL ); // open in a new window/tab
              }
            } ),
            new TextPushButton( JoistStrings.updates.noThanksStringProperty, {
              baseColor: '#ddd', font: UPDATE_TEXT_FONT, listener: function() {
                dialog.hide();

                // Closing the dialog is handled by the Dialog listener itself, no need to add code to close it here.
              }
            } )
          ]
        } )
      ]
    }, options ) );
  },

  /**
   * "Offline" state node
   * [options] - passed to the Node
   * (joist-internal)
   */
  createOfflineNode: function( options: Options ): Node {
    return new HBox( merge( {
      spacing: 0,
      maxWidth: MAX_WIDTH,
      children: [
        new VStrut( 20 ), // spacer to match layout of other nodes
        new VoicingText( JoistStrings.updates.offlineStringProperty, {
          font: new PhetFont( options.big ? 16 : 14 ),
          fontWeight: options.big ? 'bold' : 'normal'
        } )
      ]
    }, options ) );
  }
};

joist.register( 'UpdateNodes', UpdateNodes );

export default UpdateNodes;


text:
using System;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Documents;

namespace Cauldron.XAML.Extended
{
    /// <summary>
    /// Provides Attached Properties to <see cref="Hyperlink"/> that has the <see cref="LauncherOptions.TreatAsUntrusted"/> property set to false
    /// </summary>
    internal static class HyperlinkProperties
    {
        #region Dependency Attached Property NavigateUri

        /// <summary>
        /// Identifies the NavigateUri dependency property
        /// </summary>
        public static readonly DependencyProperty NavigateUriProperty = DependencyProperty.RegisterAttached("NavigateUri", typeof(Uri), typeof(HyperlinkProperties), new PropertyMetadata(null, OnNavigateUriChanged));

        /// <summary>
        /// Gets the value of NavigateUri
        /// </summary>
        /// <param name="obj"><see cref="DependencyObject" /> with the attached property</param>
        /// <returns>The value of the attached property</returns>
        public static Uri GetNavigateUri(DependencyObject obj)
        {
            return (Uri)obj.GetValue(NavigateUriProperty);
        }

        /// <summary>
        /// Sets the value of the NavigateUri attached property
        /// </summary>
        /// <param name="obj"><see cref="DependencyObject" /> with the attached property</param>
        /// <param name="value">The new value to set</param>
        public static void SetNavigateUri(DependencyObject obj, Uri value)
        {
            obj.SetValue(NavigateUriProperty, value);
        }

        private static void OnNavigateUriChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
        {
            var obj = dependencyObject as Hyperlink;

            if (obj == null)
                throw new NotSupportedException("This attached property can only be attached to a Windows.UI.Xaml.Documents.Hyperlink");

            obj.Click += async (s, e) =>
            {
                var uri = args.NewValue as Uri;

                if (uri == null)
                    return;

                await Launcher.LaunchUriAsync(uri, new LauncherOptions { TreatAsUntrusted = false });
            };
        }

        #endregion Dependency Attached Property NavigateUri
    }
}


text:
<?php
require 'vendor/autoload.php';

stream_set_blocking(STDIN, 0);
$payload = json_decode(file_get_contents("php://stdin"), true);
if (isset($payload['name'])) {
    echo "Hello ", $payload['name'],"!\n\n";
} else {
    echo "Hello World!\n\n";
}


text:
<?php

/**
 * TSessionPageStatePersister class
 *
 * TSessionPageStatePersister implements a page state persistent method based on
 * sessions. Page state are stored in user sessions and therefore, this persister
 * requires session to be started and available.
 *
 * TSessionPageStatePersister keeps limited number of history states in session,
 * mainly to preserve the precious server storage. The number is specified
 * by {@link setHistorySize HistorySize}, which defaults to 10.
 *
 * There are a couple of ways to use TSessionPageStatePersister.
 * One can override the page's {@link TPage::getStatePersister()} method and
 * create a TSessionPageStatePersister instance there.
 * Or one can configure the pages to use TSessionPageStatePersister in page configurations
 * as follows,
 *
 *   <pages StatePersisterClass="System.Web.UI.TSessionPageStatePersister" />
 *
 * The above configuration will affect the pages under the directory containing
 * this configuration and all its subdirectories.
 * To configure individual pages to use TSessionPageStatePersister, use
 *
 *   <pages>
 *     <page id="PageID" StatePersisterClass="System.Web.UI.TSessionPageStatePersister" />
 *   </pages>
 *
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @version $Id: TSessionPageStatePersister.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
 * @package System.Web.UI
 * @since 3.1
 */
class TSessionPageStatePersister extends TComponent implements IPageStatePersister
{
	const STATE_SESSION_KEY='PRADO_SESSION_PAGESTATE';
	const QUEUE_SESSION_KEY='PRADO_SESSION_STATEQUEUE';

	private $_page;
	private $_historySize=10;

	/**
	 * @param TPage the page that this persister works for
	 */
	public function getPage()
	{
		return $this->_page;
	}

	/**
	 * @param TPage the page that this persister works for.
	 */
	public function setPage(TPage $page)
	{
		$this->_page=$page;
	}

	/**
	 * @return integer maximum number of page states that should be kept in session. Defaults to 10.
	 */
	public function getHistorySize()
	{
		return $this->_historySize;
	}

	/**
	 * @param integer maximum number of page states that should be kept in session
	 * @throws TInvalidDataValueException if the number is smaller than 1.
	 */
	public function setHistorySize($value)
	{
		if(($value=TPropertyValue::ensureInteger($value))>0)
			$this->_historySize=$value;
		else
			throw new TInvalidDataValueException('sessionpagestatepersister_historysize_invalid');
	}
	/**
	 * Saves state in session.
	 * @param mixed state to be stored
	 */
	public function save($state)
	{
		$session=$this->_page->getSession();
		$session->open();
		$data=serialize($state);
		$timestamp=(string)microtime(true);
		$key=self::STATE_SESSION_KEY.$timestamp;
		$session->add($key,$data);
		if(($queue=$session->itemAt(self::QUEUE_SESSION_KEY))===null)
			$queue=array();
		$queue[]=$key;
		if(count($queue)>$this->getHistorySize())
		{
			$expiredKey=array_shift($queue);
			$session->remove($expiredKey);
		}
		$session->add(self::QUEUE_SESSION_KEY,$queue);
		$this->_page->setClientState(TPageStateFormatter::serialize($this->_page,$timestamp));
	}

	/**
	 * Loads page state from session.
	 * @return mixed the restored state
	 * @throws THttpException if page state is corrupted
	 */
	public function load()
	{
		if(($timestamp=TPageStateFormatter::unserialize($this->_page,$this->_page->getRequestClientState()))!==null)
		{
			$session=$this->_page->getSession();
			$session->open();
			$key=self::STATE_SESSION_KEY.$timestamp;
			if(($data=$session->itemAt($key))!==null)
				return unserialize($data);
		}
		throw new THttpException(400,'sessionpagestatepersister_pagestate_corrupted');
	}
}


text:
A service which enables functions and services to be executed remotely via a response web client.
Exposes various common tasks when interacting with windows, such as Volume mixer, Process manager and more...

Features:
* Execution of functions
* Service host
* Response web client
* Extendable with plugin support (functions & services)

Future features:
* See and able to change the active window
* Able to simulate keyboard and mouse input
* Change display resolution
* Able to Start/Stop Windows Services

Contribution
Feel free to send pull requests


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace Judge_Jeopardy
{
    public static class Enums
    {
        public static Dictionary<int, string> ToDictionary(Type type)
        {
            return Enum.GetValues(type).Cast<object>().ToDictionary(e => (int) e, e => e.ToString().Replace("_", " "));
        }
    }
}


text:
A library intended to simplify creating
other libraries that draw onto a canvas.

## Installation

`npm install canvas-everywhere`

If running on node, also install `canvas`:

`npm install canvas`

## Overview

Canvas everywhere is a simple wrapper around canvas that allows
libraries that rely on canvas to be written in a platform agnostic
manner. When running on node, the `canvas` library will be used. When
running in the browser, `document.createElement('canvas')` will be used.

Canvas everywhere relies on having `canvas` installed when using with
node. `Canvas` is is marked as a peer dependency, but note that it is
only required for node - when used in a browser context, a canvas dom
element will be created instead.

## Usage

```js

// commonjs
const { createCanvas, loadImage } = requrie('canvas-everywhere');

// es module
import { createCanvas, loadImage } from 'canvas-everywhere';

// initial width and height must be given, but they can be changed
// later by setting the width and height properties of the canvas.
const canvas = createCanvas(400, 600);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#baddad';
ctx.fillRect(0, 0, canvas.width, canvas.height);

loadImage('path/to/image.png').then((img) => {
  ctx.drawImage(img, 0, 0);
});

```

## Testing

`npm run test`

This runs the test suite using jest. `canvas` must be installed in order
for the tests to pass.


text:
from django.contrib.gis.db import models
from lingcod.intersection import models as int_models
from lingcod.data_distributor.models import functions_in_module
from lingcod.unit_converter.models import length_in_display_units, area_in_display_units
from django.contrib.gis.geos import fromstr

def use_sort_as_key(results):
    """
    we want the results sorted by the sort value, not by the habitat name.
    """
    sort_results = {}
    for hab,sub_dict in results.iteritems():
        sub_dict.update( {'name':hab} )
        sort_results.update( {results[hab]['sort']:sub_dict} )

    return sort_results

class ReplicationSetup(models.Model):
    org_scheme = models.ForeignKey(int_models.OrganizationScheme)

    def __unicode__(self):
        return self.org_scheme.name

    def save(self, *args, **kwargs):
        super(ReplicationSetup,self).save(*args, **kwargs)
        for fm in self.org_scheme.featuremapping_set.all():
            # calling fm.units on the next line triggers a featuremapping validation method
            ht, created = HabitatThreshold.objects.get_or_create(replication_setup=self,habitat=fm,units=fm.units)
            ht.save()

    def analyze(self, in_dict):
        """
        in_dict should be like: { id: hab_result_dict, id2: hab_result_dict2, etc. }.  this method will return the same
        format with replication info added to the cd
        """
        results = {}
        for k,geom in in_dict.iteritems():
            if geom.__class__.__name__<>'GeometryCollection': # This will allow us to include other info in the dict
                results[k] = geom # pass whatever this is on to the results
            else:
                results[k] = self.analyze_single_item(geom)
        return results

    def analyze_single_item(self,geom):
        """
        Get the habitat representation results for the geom (this could be for a cluster (geom collection) or for
        an individual MPA (polygon)) and add replication results to it.
        """
        results = self.org_scheme.transformed_results(geom)
        for ht in self.habitatthreshold_set.all():
            sub_dict = {}
            if results[ht.habitat.name]['feature_map_id'] != ht.habitat.pk:
                raise Exception('Replication setup is out of sync with Organization Scheme feature map.')
            sub_dict = ht.analyze(value=results[ht.habitat.name]['result'],geom=geom)
            results[ht.habitat.name].update(sub_dict)
        return results

class HabitatThreshold(models.Model):
    replication_setup = models.ForeignKey(ReplicationSetup)
    habitat = models.ForeignKey(int_models.FeatureMapping)
    minimum_quantity = models.FloatField(null=True, blank=True)
    rule = models.ForeignKey('ThresholdRule', null=True, blank=True)
    units = models.CharField(blank=True, max_length=255)
    date_modified = models.DateTimeField(null=True, auto_now=True, verbose_name="Date Modified")

    def __unicode__(self):
        return self.habitat.name

    def save(self, *args, **kwargs):
        if self.minimum_quantity!=None and self.rule!=None:
            raise Exception, "You can specify minimum quantity or a rule.  You may not specify both."
        else:
            super(HabitatThreshold, self).save(*args, **kwargs)

    def analyze(self, value=0.0, geom=fromstr('POLYGON EMPTY')):
        results = {}
        if self.minimum_quantity:
            if value >= self.minimum_quantity:
                results['replicate'] = True
                results['additional_required'] = 0.0
            else:
                results['replicate'] = False
                results['additional_required'] = self.minimum_quantity - value
        elif self.rule:
            rule = self.rule.name
            r_func = rule_functions()[rule]
            results['replicate'], results['reason'] = r_func(geom)
            results['additional_required'] = -1
        else:
            results['replicate'] = None
            results['additional_required'] = None
        return results

### Rule Functions ###
# These rules are actually specific to a particular organization scheme which is, in turn, specific to a particular project (nc_mlpa in this case).
# That kind of sucks and perhaps I should really move this into the report app somehow, but I'm just going this way for now.

def rule_for_soft_30_100m(geom):
    """
    IF area 30-100m soft bottom >= 7 sq mi
    OR total area soft bottom >= 7 sq mi AND area 30-100m soft bottom >= 5 sq mi AND [length 0-30m soft proxy >= 1.1 mi OR area >100m soft bottom >= 1 sq mi]
    """
    from lingcod.intersection.models import OrganizationScheme, FeatureMapping
    replicate = False
    # The following are lamely dependent on data loaded into the intersection app
    soft_0_30_proxy = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='0 - 30').filter(name__icontains='proxy')[0].transformed_results(geom).values()[0]['result']
    soft_30_100 = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='30 - 100')[0].transformed_results(geom).values()[0]['result']
    soft_100_3000 = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='100 - 3000')[0].transformed_results(geom).values()[0]['result']
    total_soft = OrganizationScheme.objects.get(name='satopencoast').featuremapping_set.filter(name__icontains='soft all depths')[0].transformed_results(geom).values()[0]['result']
    if soft_30_100 >= 7:
        replicate = True
        reason = '7 or more square miles of Soft 30-100m (%f square miles).' % soft_30_100
    elif total_soft >= 7 and soft_30_100 >= 5 and (soft_0_30_proxy >= 1.1 or soft_100_3000 >= 1):
        replicate = True
        reason = 'total_soft >= 7 sq mi and soft_30_100 >= 5 sq mi and (soft_0_30_proxy >= 1.1 mi or soft_100_3000 >= 1 sq mi). total_soft: %f sq mi, soft_30_100: %f sq mi, soft_0_30_proxy: %f mi, soft_100_3000: %f sq mi' % (total_soft, soft_30_100, soft_0_30_proxy, soft_100_3000)
    # elif total_soft >= 10 and soft_100_3000 >= 1 and soft_30_100 >= 5 and soft_0_30_proxy >= 1.1:
    #     replicate = True
    #     reason = 'total_soft >= 10 and soft_100_3000 >= 1 and soft_30_100 >= 5 and soft_0_30_proxy >= 1.1  (total_soft: %f sq mi, soft_30_100: %f sq mi, soft_0_30_proxy: %f mi, soft_100_3000: %f sq mi)' % (total_soft, soft_30_100, soft_0_30_proxy, soft_100_3000)
    else:
        reason = 'None of the replication requirements were met: IF area 30-100m soft bottom >= 7 sq mi OR total area soft bottom >= 7 sq mi AND area 30-100m soft bottom >= 5 sq mi AND [length 0-30m soft proxy >= 1.1 mi OR area >100m soft bottom >= 1 sq mi]'
    return replicate, reason

def rule_for_soft_100_3000m(geom):
    """
    IF area 100-3000m soft bottom >= 17 sq mi
    OR total area soft bottom >= 7 sq mi AND area 100-3000m >= 1 sq mi AND area 30-100m soft bottom >= 5 sq mi
    """
    from lingcod.intersection.models import OrganizationScheme, FeatureMapping
    replicate = False
    # The following are lamely dependent on data loaded into the intersection app
    soft_0_30_proxy = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='0 - 30').filter(name__icontains='proxy')[0].transformed_results(geom).values()[0]['result']
    soft_30_100 = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='30 - 100')[0].transformed_results(geom).values()[0]['result']
    soft_100_3000 = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='100 - 3000')[0].transformed_results(geom).values()[0]['result']
    total_soft = OrganizationScheme.objects.get(name='satopencoast').featuremapping_set.filter(name__icontains='soft all depths')[0].transformed_results(geom).values()[0]['result']
    if soft_100_3000 >= 17:
        replicate = True
        reason = '17 or more square miles of Soft 100-3000m (%f square miles).' % soft_100_3000
    elif total_soft >= 7 and soft_100_3000 >= 1 and soft_30_100 >= 5:
        replicate = True
        reason = 'total area soft bottom >= 7 sq mi AND area 100-3000m >= 1 sq mi AND area 30-100m soft bottom >= 5 sq mi. total_soft: %f sq mi, soft_30_100: %f sq mi, soft_100_3000: %f sq mi' % (total_soft, soft_30_100, soft_100_3000)
    # elif total_soft >= 10 and soft_100_3000 >= 1 and soft_30_100 >= 5 and soft_0_30_proxy >= 1.1:
    #     replicate = True
    #     reason = 'total area soft bottom >= 10 sq mi AND area 100-3000m soft bottom >= 1 sq mi AND area 30-100m soft bottom >=5 sq mi AND length 0-30m soft proxy >= 1.1 mi. (total_soft: %f sq mi, soft_30_100: %f sq mi, soft_0_30_proxy: %f mi, soft_100_3000: %f sq mi)' % (total_soft, soft_30_100, soft_0_30_proxy, soft_100_3000)
    else:
        reason = 'None of the replication requirements for this habitat were met: IF area 100-3000m soft bottom >= 17 sq mi OR total area soft bottom >= 7 sq mi AND area 100-3000m >= 1 sq mi AND area 30-100m soft bottom >= 5 sq mi'
    return replicate, reason

AREA_PROPORTION_THRESHOLD = 0.85
INSHORE_AREA_PROPORTION_THRESHOLD = 0.93
ANGLE_THRESHOLD = 2.0

def sub_rule_for_0_30_area(geom):
    from lingcod.intersection.models import OrganizationScheme, FeatureMapping
    from report.models import construct_0_30_poly
    replicate = False
    all_0_30 = OrganizationScheme.objects.get(name='shallow030').featuremapping_set.filter(name='shallow030')[0].transformed_results(geom).values()[0]['result']
    theoretical_0_30 = area_in_display_units( construct_0_30_poly(geom) )
    if all_0_30 < theoretical_0_30 * AREA_PROPORTION_THRESHOLD:
        reason = 'Area problems. In addition to containing the 0-30m proxy line, the shape must contain a corresponding amount of 0-30m depth zone area.'
        return replicate, reason
    else:
        reason = 'Sufficient 0-30m proxy and sufficient 0-30m depth range area.'
        replicate = True
        return replicate, reason

def sub_rule_for_shoreline_length(geom):
    from report.models import ShoreLine
    sl = ShoreLine.objects.all()[0]
    sl_segment = sl.segment_proxy_parallel(geom)
    # I don't really think this method will work either.  I think I'm just giving up on this whole idea.

def sub_rule_for_inshore_area(geom):
    from report.models import construct_inshore_poly
    replicate = False
    inshore = construct_inshore_poly(geom)
    inshore_intersection = inshore.intersection(geom)
    if inshore_intersection.area == 0.0:
        reason = 'Insufficient area captured between proxy line and shore.'
        return replicate, reason
    else:
        proportion_captured = inshore_intersection.area / inshore.area
    if proportion_captured > INSHORE_AREA_PROPORTION_THRESHOLD:
        reason = 'Sufficient 0-30m proxy and sufficient inshore area.'
        replicate = True
        return replicate, reason
    else:
        reason = 'Insufficient area captured between proxy line and shore.'
        return replicate, reason

def sub_rule_for_boundary_angle(geom):
    from lingcod.intersection.models import OrganizationScheme, FeatureMapping
    from report.models import angle_test
    replicate = False
    angle_results = angle_test(geom,degrees_of_slop=ANGLE_THRESHOLD)
    if False not in angle_results:
        reason = 'Sufficient 0-30m proxy and sufficient 0-30m boundaries.'
        replicate = True
        return replicate, reason
    else:
        reason = 'Boundary problems. In addition to containing the 0-30m proxy line, the shape must contain a corresponding amount of 0-30m depth zone area.'
        return replicate, reason

def sub_rule_for_0_30m_proxies(geom):
    from report.models import touches_30m_contour_test
    area_result, reason = sub_rule_for_0_30_area(geom)
    replicate = False
    if area_result:
        if touches_30m_contour_test(geom):
            replicate = True
            return replicate, reason
        else:
            reason = 'The shape must extend to the 30m depth contour or offshore edge of the study region boundary in order to count as a replicated of 0-30m habitat.'
            return replicate, reason
    else:
        # second chance
        replicate, second_reason = sub_rule_for_boundary_angle(geom)
        if replicate:
            return replicate, second_reason
        else:
            return replicate, reason

def rule_for_soft_0_30m(geom):
    THRESHOLD = 1.1
    from lingcod.intersection.models import OrganizationScheme, FeatureMapping
    replicate = False
    soft_0_30_proxy = OrganizationScheme.objects.get(name='satopencoast_replication').featuremapping_set.filter(name__icontains='soft').filter(name__icontains='0 - 30').filter(name__icontains='proxy')[0].transformed_results(geom).values()[0]['result']
    if soft_0_30_proxy < THRESHOLD:
        reason = 'Not enough soft substrate.  Needed %f, had %f' % (THRESHOLD,soft_0_30_proxy)
        return replicate, reason
    else:
        return sub_rule_for_0_30m_proxies(geom)

### End Rule Functions ###

def rule_functions(module=__name__):
    all_funcs = functions_in_module(module)
    for key in all_funcs.keys():
        if not key.startswith('rule_for_'):
            all_funcs.pop(key)
    return all_funcs

class ThresholdRule(models.Model):
    name_choices = zip(rule_functions().keys(),rule_functions().keys())
    name = models.CharField(max_length=180, choices=name_choices)
    description = models.TextField(blank=True,null=True)

    def __unicode__(self):
        return self.name

    def save(self, *args, **kwargs):
        self.description = rule_functions()[self.name].__doc__
        super(ThresholdRule,self).save(*args, **kwargs)


text:
//
//  SharedObject.h
//  RelaxMuzikWord
//
//  Created by popeveryday on 6/25/13.
//  Copyright (c) 2013 Lapsky. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol ObserverObjectDelegate <NSObject>
-(void) observerObjectDidCallWithKey:(NSInteger)key value:(id)value;

@optional
-(void) observerObjectDidCallWithKey:(NSInteger)key value:(id)value notificationKey:(NSString*)notificationKey;
@end

@interface ObserverObject : NSObject
@property (nonatomic) NSMutableDictionary* targetObjects;

+(ObserverObject*)instance;

+(void)registerForNotificationKey:(NSString*)notificationKey;

+(void)addObserverToTarget:(id<ObserverObjectDelegate>)target;

+(void)addObserverToTarget:(id<ObserverObjectDelegate>)target notificationKey:(NSString*)notificationKey;

+(void)removeObserverWithTarget:(id<ObserverObjectDelegate>)target;

+(void)removeObserverWithTarget:(id<ObserverObjectDelegate>)target notificationKey:(NSString*)notificationKey;

+(void)sendObserver:(NSInteger)key object:(id)object notificationKey:(NSString*)notificationKey;

+(void)sendObserver:(NSInteger)key object:(id)object;

+(void)sendObserver:(NSInteger)key notificationKey:(NSString*)notificationKey;

+(void)sendObserver:(NSInteger)key;

@end

/*

 //implement delegate
 <ObserverObjectDelegate>

 //viewDidLoad
 [ObserverObject addObserverToTarget:self];

 -(void)observerObjectDidCallWithKey:(NSInteger)key value:(id)value
 {
 switch (key)
 {
 case OBS_FinishRoundDialog_NextRound:
 NSLog(@"next");
 break;
 case OBS_FinishRoundDialog_ReplayRound:
 NSLog(@"replay");
 break;
 case OBS_FinishRoundDialog_ReturnPackage:
 NSLog(@"return");
 break;
 }
 }

 -(void) dealloc{
 [ObserverObject removeObserverToTarget:self];
 }
 */

/*
 FOR MANUAL OBSERVER =====================

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionObserver:) name:@"ANY_NAME_HERE" object:nil];

 [[NSNotificationCenter defaultCenter] postNotificationName:OBS_KEY object: @{ @"key":@(key), @"value": object } ];

 -(void) actionObserver:(NSNotification*)sender
 {
 NSDictionary* data = sender.object;
 }
 */


text:
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Subscription } from "rxjs";
import {MessageService} from "../../message/message.service";
import {WorldService} from "../world.service";
import {World} from "../World";

@Component({
  selector: 'bsp-world-detail',
  templateUrl: './world-detail.component.html',
  styleUrls: ['./world-detail.component.css']
})
export class WorldDetailComponent implements OnInit {
  index: number;
  item: World;
  subscription: Subscription;

  constructor(private db: WorldService, private router: Router, private ms: MessageService, private route: ActivatedRoute) { }

  ngOnInit() {
    this.subscription = this.route.params.subscribe(
      (params: any) => {
        if(params.hasOwnProperty('id')) {
          this.index = +params['id'];
          while(!this.db.done) {}
          this.item = this.db.getItemByIndex(this.index);
          console.log(this.item);
        } else {
          this.ms.error('The selected World was not found');
          this.navigateBack();
        }
      }
    );
  }

  edit() {
    this.router.navigate(['/world/' + this.index + '/edit']);
  }

  navigateBack() {
    this.router.navigate(['../']);
  }
}


text:
var Promise = require('bluebird');
var fs = Promise.promisifyAll(require('fs'));

module.exports = {
    load: function() {
        var path = __dirname + '/resources/nace.json';
        return fs.readFileAsync(path).then(JSON.parse);
    }
};


text:
<Type Name="AVCompositionTrackSegment" FullName="MonoMac.AVFoundation.AVCompositionTrackSegment">
  <TypeSignature Language="C#" Value="public class AVCompositionTrackSegment : MonoMac.AVFoundation.AVAssetTrackSegment" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AVCompositionTrackSegment extends MonoMac.AVFoundation.AVAssetTrackSegment" />
  <AssemblyInfo>
    <AssemblyName>MonoMac</AssemblyName>
    <AssemblyVersion>0.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>MonoMac.AVFoundation.AVAssetTrackSegment</BaseTypeName>
  </Base>
  <Interfaces />
  <Attributes>
    <Attribute>
      <AttributeName>MonoMac.Foundation.Register("AVCompositionTrackSegment", true)</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AVCompositionTrackSegment ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>MonoMac.Foundation.Export("init")</AttributeName>
        </Attribute>
        <Attribute>
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters />
      <Docs>
        Default constructor that initializes a new instance of this class with no parameters.
        <remarks>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AVCompositionTrackSegment (MonoMac.CoreMedia.CMTimeRange timeRange);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype MonoMac.CoreMedia.CMTimeRange timeRange) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>MonoMac.Foundation.Export("initWithTimeRange:")</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="timeRange" Type="MonoMac.CoreMedia.CMTimeRange" />
      </Parameters>
      <Docs>
        <param name="timeRange">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AVCompositionTrackSegment (MonoMac.Foundation.NSCoder coder);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class MonoMac.Foundation.NSCoder coder) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>MonoMac.Foundation.Export("initWithCoder:")</AttributeName>
        </Attribute>
        <Attribute>
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="coder" Type="MonoMac.Foundation.NSCoder" />
      </Parameters>
      <Docs>
        <param name="coder">The unarchiver object.</param>
        A constructor that initializes the object from the data stored in the unarchiver object.
        <remarks>This constructor is provided to allow the class to be initialized from an unarchiver (for example, during NIB deserialization).</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AVCompositionTrackSegment (MonoMac.Foundation.NSObjectFlag t);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class MonoMac.Foundation.NSObjectFlag t) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="t" Type="MonoMac.Foundation.NSObjectFlag" />
      </Parameters>
      <Docs>
        <param name="t">Unused sentinel value, pass NSObjectFlag.Empty.</param>
        Constructor to call on derived classes when the derived class has an [Export] constructor.
        <remarks>
          <para>This constructor should be called by derived classes when they are initialized using an [Export] attribute. The argument value is ignore, typically the chaining would look like this:</para>
          <example>

public class MyClass : BaseClass {
    [Export ("initWithFoo:")]
    public MyClass (string foo) : base (NSObjectFlag.Empty)
    {
        ...
    }

          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AVCompositionTrackSegment (IntPtr handle);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="handle" Type="System.IntPtr" />
      </Parameters>
      <Docs>
        <param name="handle">Pointer (handle) to the unmanaged object.</param>
        A constructor used when creating managed representations of unmanaged objects;  Called by the runtime.
        <remarks>
          <para>This constructor is invoked by the runtime infrastructure (<see cref="M:MonoMac.ObjCRuntime.GetNSObject (System.IntPtr)" />) to create a new managed representation for a pointer to an unmanaged Objective-C object.    You should not invoke this method directly, instead you should call the GetNSObject method as it will prevent two instances of a managed object to point to the same native object.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public AVCompositionTrackSegment (MonoMac.Foundation.NSUrl URL, int trackID, MonoMac.CoreMedia.CMTimeRange sourceTimeRange, MonoMac.CoreMedia.CMTimeRange targetTimeRange);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class MonoMac.Foundation.NSUrl URL, int32 trackID, valuetype MonoMac.CoreMedia.CMTimeRange sourceTimeRange, valuetype MonoMac.CoreMedia.CMTimeRange targetTimeRange) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>MonoMac.Foundation.Export("initWithURL:trackID:sourceTimeRange:targetTimeRange:")</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="URL" Type="MonoMac.Foundation.NSUrl" />
        <Parameter Name="trackID" Type="System.Int32" />
        <Parameter Name="sourceTimeRange" Type="MonoMac.CoreMedia.CMTimeRange" />
        <Parameter Name="targetTimeRange" Type="MonoMac.CoreMedia.CMTimeRange" />
      </Parameters>
      <Docs>
        <param name="URL">To be added.</param>
        <param name="trackID">To be added.</param>
        <param name="sourceTimeRange">To be added.</param>
        <param name="targetTimeRange">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="ClassHandle">
      <MemberSignature Language="C#" Value="public override IntPtr ClassHandle { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance native int ClassHandle" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.IntPtr</ReturnType>
      </ReturnValue>
      <Docs>
        The handle for this class.
        <value>The pointer to the Objective-C class.</value>
        <remarks>Each MonoMac class mirrors an unmanaged Objective-C class.   This value contains the pointer to the Objective-C class, it is similar to calling objc_getClass with the object name.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Dispose">
      <MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="disposing" Type="System.Boolean" />
      </Parameters>
      <Docs>
        <param name="disposing">
          <para>If set to <see langword="true" />, the method is invoked directly and will dispose manage and unmanaged resources;   If set to <see langword="false" /> the method is being called by the garbage collector finalizer and should only release unmanaged resources.</para>
        </param>
        Releases the resources used by the AVCompositionTrackSegment object.
        <remarks>
          <para>This Dispose method releases the resources used by the AVCompositionTrackSegment class.</para>
          <para>This method is called by both the Dispose() method and the object finalizer (Finalize).    When invoked by the Dispose method, the parameter disposting <paramref name="disposing" /> is set to <see langword="true" /> and any managed object references that this object holds are also disposed or released;  when invoked by the object finalizer, on the finalizer thread the value is set to <see langword="false" />. </para>
          <para>Calling the Dispose method when you are finished using the AVCompositionTrackSegment ensures that all external resources used by this managed object are released as soon as possible.  Once you have invoked the Dispose method, the object is no longer useful and you should no longer make any calls to it.</para>
          <para>  For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="FromTimeRange">
      <MemberSignature Language="C#" Value="public static IntPtr FromTimeRange (MonoMac.CoreMedia.CMTimeRange timeRange);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig native int FromTimeRange(valuetype MonoMac.CoreMedia.CMTimeRange timeRange) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>MonoMac.Foundation.Export("compositionTrackSegmentWithTimeRange:")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.IntPtr</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="timeRange" Type="MonoMac.CoreMedia.CMTimeRange" />
      </Parameters>
      <Docs>
        <param name="timeRange">To be added.</param>
        To be added.
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="FromUrl">
      <MemberSignature Language="C#" Value="public static IntPtr FromUrl (MonoMac.Foundation.NSUrl url, int trackID, MonoMac.CoreMedia.CMTimeRange sourceTimeRange, MonoMac.CoreMedia.CMTimeRange targetTimeRange);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig native int FromUrl(class MonoMac.Foundation.NSUrl url, int32 trackID, valuetype MonoMac.CoreMedia.CMTimeRange sourceTimeRange, valuetype MonoMac.CoreMedia.CMTimeRange targetTimeRange) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>MonoMac.Foundation.Export("compositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange:")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.IntPtr</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="url" Type="MonoMac.Foundation.NSUrl" />
        <Parameter Name="trackID" Type="System.Int32" />
        <Parameter Name="sourceTimeRange" Type="MonoMac.CoreMedia.CMTimeRange" />
        <Parameter Name="targetTimeRange" Type="MonoMac.CoreMedia.CMTimeRange" />
      </Parameters>
      <Docs>
        <param name="url">To be added.</param>
        <param name="trackID">To be added.</param>
        <param name="sourceTimeRange">To be added.</param>
        <param name="targetTimeRange">To be added.</param>
        To be added.
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="SourceTrackID">
      <MemberSignature Language="C#" Value="public virtual int SourceTrackID { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance int32 SourceTrackID" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>get: MonoMac.Foundation.Export("sourceTrackID")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="SourceUrl">
      <MemberSignature Language="C#" Value="public virtual MonoMac.Foundation.NSUrl SourceUrl { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class MonoMac.Foundation.NSUrl SourceUrl" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>get: MonoMac.Foundation.Export("sourceURL")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>MonoMac.Foundation.NSUrl</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
using System;
using System.Xml.Serialization;

namespace Mamesaver.Models
{
    [Serializable, XmlRoot("SelectableGame")]
    public class SelectableGame : Game
    {
        [XmlAttribute("selected")]
        public bool Selected { get; set; }
    }
}


text:
mkdir ..\Build
cd ..\Build
cmake .. -G"Visual Studio 9 2008" -DASMJIT_BUILD_LIBRARY=1 -DASMJIT_BUILD_TEST=1
cd ..\Scripts
pause


text:
var concat = function () {
  var x = arguments.length <= 0 ? undefined : arguments[0];
  var y = arguments.length <= 1 ? undefined : arguments[1];
};
var somefun = function () {
  var get2ndArg = function (a, b) {
    var _b = arguments.length <= 2 ? undefined : arguments[2];
    var somef = function (x, y, z) {
      var _a = arguments.length <= 3 ? undefined : arguments[3];
    };
    var somefg = function (c, d, e, f) {
      var _a = arguments.length <= 4 ? undefined : arguments[4];
    };
    var _d = arguments.length <= 3 ? undefined : arguments[3];
  };
  var get3rdArg = function () {
    return arguments.length <= 2 ? undefined : arguments[2];
  };
};
function demo1() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return function (i) {
    return args[i + 0];
  };
}
var x = function () {
  if (noNeedToWork) return 0;
  for (var _len2 = arguments.length, rest = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    rest[_key2] = arguments[_key2];
  }
  return rest;
};
var innerclassproperties = function () {
  var _class;
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
    args[_key3] = arguments[_key3];
  }
  return _class = /*#__PURE__*/babelHelpers.createClass(function _class() {
    "use strict";

    babelHelpers.classCallCheck(this, _class);
    this.args = args;
  }), _class.args = args, _class;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/tutorial_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical">

    <org.buildmlearn.toolkit.views.TextViewPlus
        android:id="@+id/tutorial_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:padding="16dp"
        android:text="@string/screen_1_title"
        android:textSize="@dimen/headline" />

    <ImageView
        android:id="@+id/device_image"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:adjustViewBounds="true"
        android:contentDescription="@string/tutorial_image"
        android:scaleType="centerInside" />

    <Button
        android:text="Skip Tutorial"
        style="?android:attr/borderlessButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:textAllCaps="false"
        android:id="@+id/skip_button" />

    <org.buildmlearn.toolkit.views.TextViewPlus
        android:id="@+id/tutorial_desc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:gravity="center"
        android:padding="16dp"
        android:text="@string/screen_1_desc"
        android:textSize="@dimen/body" />
</LinearLayout>


text:
package org.apache.hadoop.hive.common.metrics.common;

/**
 * This class defines some metrics generated by Hive processes.
 */
public class MetricsConstant {

  public static final String JVM_PAUSE_INFO = "jvm.pause.info-threshold";
  public static final String JVM_PAUSE_WARN = "jvm.pause.warn-threshold";
  public static final String JVM_EXTRA_SLEEP = "jvm.pause.extraSleepTime";

  public static final String OPEN_CONNECTIONS = "open_connections";
  public static final String OPEN_OPERATIONS = "open_operations";
  public static final String CUMULATIVE_CONNECTION_COUNT = "cumulative_connection_count";

  public static final String METASTORE_HIVE_LOCKS = "metastore_hive_locks";
  public static final String ZOOKEEPER_HIVE_SHAREDLOCKS = "zookeeper_hive_sharedlocks";
  public static final String ZOOKEEPER_HIVE_EXCLUSIVELOCKS = "zookeeper_hive_exclusivelocks";
  public static final String ZOOKEEPER_HIVE_SEMISHAREDLOCKS = "zookeeper_hive_semisharedlocks";

  public static final String EXEC_ASYNC_QUEUE_SIZE = "exec_async_queue_size";
  public static final String EXEC_ASYNC_POOL_SIZE = "exec_async_pool_size";

  public static final String OPERATION_PREFIX = "hs2_operation_";
  public static final String COMPLETED_OPERATION_PREFIX = "hs2_completed_operation_";

  public static final String SQL_OPERATION_PREFIX = "hs2_sql_operation_";
  public static final String COMPLETED_SQL_OPERATION_PREFIX = "hs2_completed_sql_operation_";

  public static final String INIT_TOTAL_DATABASES = "init_total_count_dbs";
  public static final String INIT_TOTAL_TABLES = "init_total_count_tables";
  public static final String INIT_TOTAL_PARTITIONS = "init_total_count_partitions";

  public static final String CREATE_TOTAL_DATABASES = "create_total_count_dbs";
  public static final String CREATE_TOTAL_TABLES = "create_total_count_tables";
  public static final String CREATE_TOTAL_PARTITIONS = "create_total_count_partitions";

  public static final String DELETE_TOTAL_DATABASES = "delete_total_count_dbs";
  public static final String DELETE_TOTAL_TABLES = "delete_total_count_tables";
  public static final String DELETE_TOTAL_PARTITIONS = "delete_total_count_partitions";

  public static final String DIRECTSQL_ERRORS = "directsql_errors";
}


text:
/**
 * Created by lhy95 on 2017/2/26.
 */
import Vue from 'vue'
import store from 'src/store'
import Index from 'src/components/index/Index'

describe('Index.vue', () => {
  it('should render correct contents', () => {
    const Constructor = Vue.extend({Index, store})
    const vm = new Constructor().$mount()
    // expect(vm.$el.querySelector('.footer-container p').textContent)
    //   .to.equal('Copyright © 2016 - 2017 山东创新石油技术有限公司 All rights reserved.')
  })
})


text:
package org.antlr.v4.test.runtime.java;

import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CharStreams;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

import java.io.File;
import java.io.InputStream;
import java.io.Reader;
import java.nio.channels.SeekableByteChannel;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CodingErrorAction;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class TestCharStreams {
	@Test
	public void fromBMPStringHasExpectedSize() {
		CharStream s = CharStreams.fromString("hello");
		assertEquals(5, s.size());
		assertEquals(0, s.index());
		assertEquals("hello", s.toString());
	}

	@Test
	public void fromSMPStringHasExpectedSize() {
		CharStream s = CharStreams.fromString(
				"hello \uD83C\uDF0E");
		assertEquals(7, s.size());
		assertEquals(0, s.index());
		assertEquals("hello \uD83C\uDF0E", s.toString());
	}

	@Test
	public void fromBMPUTF8PathHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path test = new File(tempDir.toString(), "test").toPath();
		Files.write(test, "hello".getBytes(StandardCharsets.UTF_8));
		CharStream s = CharStreams.fromPath(test);
		assertEquals(5, s.size());
		assertEquals(0, s.index());
		assertEquals("hello", s.toString());
		assertEquals(test.toString(), s.getSourceName());
	}

	@Test
	public void fromSMPUTF8PathHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_8));
		CharStream s = CharStreams.fromPath(p);
		assertEquals(7, s.size());
		assertEquals(0, s.index());
		assertEquals("hello \uD83C\uDF0E", s.toString());
		assertEquals(p.toString(), s.getSourceName());
	}

	@Test
	public void fromBMPUTF8InputStreamHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello".getBytes(StandardCharsets.UTF_8));
		try (InputStream is = Files.newInputStream(p)) {
			CharStream s = CharStreams.fromStream(is);
			assertEquals(5, s.size());
			assertEquals(0, s.index());
			assertEquals("hello", s.toString());
		}
	}

	@Test
	public void fromSMPUTF8InputStreamHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_8));
		try (InputStream is = Files.newInputStream(p)) {
			CharStream s = CharStreams.fromStream(is);
			assertEquals(7, s.size());
			assertEquals(0, s.index());
			assertEquals("hello \uD83C\uDF0E", s.toString());
		}
	}

	@Test
	public void fromBMPUTF8ChannelHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello".getBytes(StandardCharsets.UTF_8));
		try (SeekableByteChannel c = Files.newByteChannel(p)) {
			CharStream s = CharStreams.fromChannel(
					c, 4096, CodingErrorAction.REPLACE, "foo");
			assertEquals(5, s.size());
			assertEquals(0, s.index());
			assertEquals("hello", s.toString());
			assertEquals("foo", s.getSourceName());
		}
	}

	@Test
	public void fromSMPUTF8ChannelHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_8));
		try (SeekableByteChannel c = Files.newByteChannel(p)) {
			CharStream s = CharStreams.fromChannel(
					c, 4096, CodingErrorAction.REPLACE, "foo");
			assertEquals(7, s.size());
			assertEquals(0, s.index());
			assertEquals("hello \uD83C\uDF0E", s.toString());
			assertEquals("foo", s.getSourceName());
		}
	}

	@Test
	public void fromInvalidUTF8BytesChannelReplacesWithSubstCharInReplaceMode(@TempDir Path tempDir)
		throws Exception {
		Path p = getTestFile(tempDir);
		byte[] toWrite = new byte[] { (byte)0xCA, (byte)0xFE, (byte)0xFE, (byte)0xED };
		Files.write(p, toWrite);
		try (SeekableByteChannel c = Files.newByteChannel(p)) {
			CharStream s = CharStreams.fromChannel(
					c, 4096, CodingErrorAction.REPLACE, "foo");
			assertEquals(4, s.size());
			assertEquals(0, s.index());
			assertEquals("\uFFFD\uFFFD\uFFFD\uFFFD", s.toString());
		}
	}

	@Test
	public void fromInvalidUTF8BytesThrowsInReportMode(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		byte[] toWrite = new byte[] { (byte)0xCA, (byte)0xFE };
		Files.write(p, toWrite);
		try (SeekableByteChannel c = Files.newByteChannel(p)) {
			assertThrows(
					CharacterCodingException.class,
					() -> CharStreams.fromChannel(c, 4096, CodingErrorAction.REPORT, "foo")
			);
		}
	}

	@Test
	public void fromSMPUTF8SequenceStraddlingBufferBoundary(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_8));
		try (SeekableByteChannel c = Files.newByteChannel(p)) {
			CharStream s = CharStreams.fromChannel(
					c,
					// Note this buffer size ensures the SMP code point
					// straddles the boundary of two buffers
					8,
					CodingErrorAction.REPLACE,
					"foo");
			assertEquals(7, s.size());
			assertEquals(0, s.index());
			assertEquals("hello \uD83C\uDF0E", s.toString());
		}
	}

	@Test
	public void fromFileName(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_8));
		CharStream s = CharStreams.fromFileName(p.toString());
		assertEquals(7, s.size());
		assertEquals(0, s.index());
		assertEquals("hello \uD83C\uDF0E", s.toString());
		assertEquals(p.toString(), s.getSourceName());

	}

	@Test
	public void fromFileNameWithLatin1(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \u00CA\u00FE".getBytes(StandardCharsets.ISO_8859_1));
		CharStream s = CharStreams.fromFileName(p.toString(), StandardCharsets.ISO_8859_1);
		assertEquals(8, s.size());
		assertEquals(0, s.index());
		assertEquals("hello \u00CA\u00FE", s.toString());
		assertEquals(p.toString(), s.getSourceName());
	}

	@Test
	public void fromReader(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_8));
		try (Reader r = Files.newBufferedReader(p, StandardCharsets.UTF_8)) {
			CharStream s = CharStreams.fromReader(r);
			assertEquals(7, s.size());
			assertEquals(0, s.index());
			assertEquals("hello \uD83C\uDF0E", s.toString());
		}
	}

	@Test
	public void fromSMPUTF16LEPathSMPHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		Files.write(p, "hello \uD83C\uDF0E".getBytes(StandardCharsets.UTF_16LE));
		CharStream s = CharStreams.fromPath(p, StandardCharsets.UTF_16LE);
		assertEquals(7, s.size());
		assertEquals(0, s.index());
		assertEquals("hello \uD83C\uDF0E", s.toString());
		assertEquals(p.toString(), s.getSourceName());
	}

	@Test
	public void fromSMPUTF32LEPathSMPHasExpectedSize(@TempDir Path tempDir) throws Exception {
		Path p = getTestFile(tempDir);
		// UTF-32 isn't popular enough to have an entry in StandardCharsets.
		Charset c = Charset.forName("UTF-32LE");
		Files.write(p, "hello \uD83C\uDF0E".getBytes(c));
		CharStream s = CharStreams.fromPath(p, c);
		assertEquals(7, s.size());
		assertEquals(0, s.index());
		assertEquals("hello \uD83C\uDF0E", s.toString());
		assertEquals(p.toString(), s.getSourceName());
	}

	private Path getTestFile(Path dir) {
		return new File(dir.toString(), "test").toPath();
	}
}


text:
package io.vamp.pulse.notification

import io.vamp.common.notification.{ DefaultPackageMessageResolverProvider, LoggingNotificationProvider }

trait PulseNotificationProvider extends LoggingNotificationProvider with DefaultPackageMessageResolverProvider


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">ContextAwareFramework</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>

</resources>


text:
c3dl.EffectTemplate=function()
{this.vertexShaders=[];this.fragmentShaders=[];this.isInitialized=false;this.params=[];this.renderingCB=null;this.programObjects=[];this.init=function()
{var rc=false;if(this.isInitialized==false)
{if(this.renderingCB&&this.vertexShaders.length>0&&this.fragmentShaders.length>0)
{this.isInitialized=true;rc=true;}}
return rc;}
this.addFragmentShader=function(fragmentShader)
{if(this.isInitialized==false)
{if(fragmentShader&&typeof(fragmentShader)=="string")
{this.fragmentShaders.push(fragmentShader);}
else
{c3dl.debug.logWarning("Invalid argument passed to Effect's addFragmentShader().");}}}
this.addParameter=function(paramName,paramType,paramDefaultValue)
{if(this.isInitialized==false)
{if(paramName&&typeof(paramName)=="string")
{var val;if(paramType==Array)
{val=c3dl.copyObj(paramDefaultValue);}
else
{val=paramDefaultValue;}
this.params.push({name:paramName,type:paramType,value:val});}
else
{c3dl.debug.logWarning("Invalid argument(s) passed to Effect's addParameter().");}}
else
{c3dl.debug.logWarning("Effect addParameter(): cannot be called once an effect has been initialized.");}}
this.addVertexShader=function(vertexShader)
{if(this.isInitialized==false)
{if(vertexShader&&typeof(vertexShader)=="string")
{this.vertexShaders.push(vertexShader);}
else
{c3dl.debug.logWarning("Invalid argument passed to Effect's addVertexShader().");}}}
this.getVertexShaders=function()
{return this.vertexShaders;}
this.getParameters=function()
{var ret=[];for(var i=0,len=this.params.length;i<len;i++)
{var val;if(typeof this.params[i].value=="Array")
{val=c3dl.copyObj(this.params[i].value);}
else
{val=this.params[i].value;}
ret.push({name:this.params[i].name,type:this.params[i].type,value:val});}
return ret;}
this.getFragmentShaders=function()
{return this.fragmentShaders;}
this.getRenderingCallback=function()
{return this.renderingCB;}
this.setRenderingCallback=function(func)
{if(this.isInitialized==false)
{if(func instanceof Function)
{this.renderingCB=func;}
else
{c3dl.debug.logWarning("Invalid argument passed to Effect's setRenderingCB().");}}}
this.getProgramID=function(rendererID)
{var programID=-1;var found=false;for(var i=0,len=this.programObjects.length;found==false&&i<len;i++)
{if(found===false)
{if(rendererID==this.programObjects[i].getRendererID())
{found=true;programID=this.programObjects[i].getProgramID();}}}
return programID;}
this.addProgramObject=function(programObject)
{this.programObjects.push(programObject);}
this.toString=function(delimiter)
{if(!delimiter&&typeof(delimiter)!="string")
{delimiter=",";}
return"Initialized = "+this.isInitialized+delimiter+"Vertex Shaders = "+
this.vertexShaders+delimiter+"Fragment Shaders = "+this.fragmentShaders+
delimiter+"Rendering Callback = "+this.renderingCB+delimiter+"Parameters = "+
this.parameters;}}


text:
package template

import (
	"errors"
	"io"
	"reflect"
)

type teLoopBlock struct {
	template *Template
	v        placeholders
	els      *Template
}

// *s must begin with loop directive
func parseTELoop(s *string, funcs map[string]interface{}) (b teLoopBlock, err error) {
	directive, _ := extractDirective(s)
	directive = directive[len(loopBlockPrefix):] // Only placeholder definitions

	// Loop block
	var placeholders placeholders
	placeholders, err = parsePlaceholders(directive, funcs)
	if err != nil {
		return
	}
	b.v = placeholders

	var subT *Template
	subT, err = parse(s, funcs)
	if err != nil {
		return
	}
	b.template = subT

	// prepare for else/end block
	directive, err = extractDirective(s)
	if err != nil {
		return
	}

	// Else block
	if directive == optionalElseBlockPrefix {
		var subT *Template
		subT, err = parse(s, funcs)
		if err != nil {
			return
		}

		b.els = subT

		// prepare for end block
		directive, err = extractDirective(s)
		if err != nil {
			return
		}
	}

	// End directive
	if directive != endOfBlock {
		err = errors.New("expect end of loop block, but got '" + directive + "'")
	}
	return
}

func (te teLoopBlock) Execute(wr io.Writer, data []interface{}) error {
	do, err := te.v[0].CompileInterface( data)
	if err != nil {
		return err
	}

	var doEls bool
	switch value := reflect.ValueOf(do); value.Kind() {
	case reflect.Int:
		doEls = value.Int() == 0
		if !doEls {
			args,err:=te.v[1:].CompileInterfaces(data)
			if err!=nil{
				return err
			}
			args=append([]interface{}{nil},args...)	// Add space for 'i'
			for i := 0; i < int(value.Int()); i++ {
				args[0]=i
				err = te.template.execute(wr, args)
				if err != nil {
					return err
				}
			}
		}
	case reflect.Slice:
		doEls = value.Len() == 0
		if !doEls {
			args,err:=te.v[1:].CompileInterfaces(data)
			if err!=nil{
				return err
			}
			args=append([]interface{}{nil,nil},args...)	// Add space for 'i' & do[i]
			for i := 0; i < value.Len(); i++ {
				args[0]=value.Index(i).Interface()
				args[1]=i
				err = te.template.execute(wr, args)
				if err != nil {
					return err
				}
			}
		}
	default:
		return errors.New("in loop block directive alowed only int and slice types, but got " + value.Kind().String())
	}

	if doEls && te.els != nil {
		return te.els.execute(wr, data)
	}

	return nil
}


text:
<?php

namespace Magento\Setup\Model\Installer;

/**
 * Installation progress model
 */
class Progress
{
    /**
     * Total number of steps
     *
     * @var int
     */
    private $total;

    /**
     * Current step
     *
     * @var int
     */
    private $current;

    /**
     * Constructor
     *
     * @param int $total
     * @param int $current
     */
    public function __construct($total, $current = 0)
    {
        $this->validate($total, $current);
        $this->total = $total;
        $this->current = $current;
    }

    /**
     * Increments current counter
     *
     * @return void
     */
    public function setNext()
    {
        $this->validate($this->total, $this->current + 1);
        $this->current++;
    }

    /**
     * Sets current counter to the end
     *
     * @return void
     */
    public function finish()
    {
        $this->current = $this->total;
    }

    /**
     * Gets the current counter
     *
     * @return int
     */
    public function getCurrent()
    {
        return $this->current;
    }

    /**
     * Gets the total number
     *
     * @return int
     */
    public function getTotal()
    {
        return $this->total;
    }

    /**
     * Gets ratio of current to total
     *
     * @return float
     */
    public function getRatio()
    {
        return $this->current / $this->total;
    }

    /**
     * Asserts invariants
     *
     * @param int $total
     * @param int $current
     * @return void
     * @throws \LogicException
     */
    private function validate($total, $current)
    {
        if (empty($total) || 0 >= $total) {
            throw new \LogicException('Total number must be more than zero.');
        }
        if ($current > $total) {
            throw new \LogicException('Current cannot exceed total number.');
        }
    }
}


text:
package org.spongepowered.common.mixin.api.mcp.entity.passive;

import net.minecraft.entity.passive.EntityPig;
import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.data.manipulator.DataManipulator;
import org.spongepowered.api.data.manipulator.mutable.entity.PigSaddleData;
import org.spongepowered.api.data.value.mutable.Value;
import org.spongepowered.api.entity.living.animal.Pig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.data.manipulator.mutable.entity.SpongePigSaddleData;
import org.spongepowered.common.data.value.mutable.SpongeValue;

import java.util.Collection;

@Mixin(EntityPig.class)
public abstract class EntityPigMixin_API extends EntityAnimalMixin_API implements Pig {

    @Shadow public abstract boolean getSaddled();

    @Override
    public PigSaddleData getPigSaddleData() {
        return new SpongePigSaddleData(this.getSaddled());
    }

    @Override
    public Value<Boolean> saddled() {
        return new SpongeValue<>(Keys.PIG_SADDLE, false, this.getSaddled());
    }

    @Override
    protected void spongeApi$supplyVanillaManipulators(final Collection<? super DataManipulator<?, ?>> manipulators) {
        super.spongeApi$supplyVanillaManipulators(manipulators);
        manipulators.add(this.getPigSaddleData());
    }
}


text:
@implementation NSObject(StoreSupport)

- (BOOL)store_isValid
{
	return YES;
}

- (BOOL)store_hasChildren
{
	return YES;
}

@end

#pragma mark -

@implementation SamuraiRenderStoreScope

@def_prop_strong( SamuraiRenderStoreNode *,	storeTree );
@def_prop_strong( NSString *,				storePath );

BASE_CLASS( SamuraiRenderStoreScope )

+ (SamuraiRenderStoreScope *)storeScope
{
	return [[self alloc] init];
}

+ (SamuraiRenderStoreScope *)storeScope:(id)sourceOrTarget
{
	SamuraiRenderStoreScope * scope = [[self alloc] init];
	[scope attach:sourceOrTarget];
	return scope;
}

#pragma mark -

- (id)init
{
	self = [super init];
	if ( self )
	{
	}
	return self;
}

- (void)dealloc
{
	self.storeTree = nil;
	self.storePath = nil;
}

#pragma mark -

- (void)attach:(id)sourceOrTarget
{
	[self attach:sourceOrTarget path:nil];
}

- (void)attach:(id)sourceOrTarget path:(NSString *)path
{
	SamuraiRenderObject * renderer = nil;

	if ( [sourceOrTarget isKindOfClass:[UIViewController class]] )
	{
		renderer = [[sourceOrTarget view] renderer];
	}
	else if ( [sourceOrTarget isKindOfClass:[UIView class]] )
	{
		renderer = [sourceOrTarget renderer];
	}
	else if ( [sourceOrTarget isKindOfClass:[SamuraiRenderObject class]] )
	{
		renderer = sourceOrTarget;
	}

	self.storeTree = [self buildStoreTree:renderer];
	self.storePath = path;

	[self didAttached];
}

- (void)detach
{
	self.storeTree = nil;
	self.storePath = nil;

	[self didDetached];
}

- (void)didAttached
{

}

- (void)didDetached
{

}

#pragma mark -

- (SamuraiRenderStoreNode *)buildStoreTree:(SamuraiRenderObject *)renderer
{
	SamuraiRenderStoreNode * storeNode = [SamuraiRenderStoreNode storeNode];
	[self parseRenderer:renderer forContainer:storeNode];
	return storeNode;
}

- (void)parseRenderer:(SamuraiRenderObject *)renderer forContainer:(SamuraiRenderStoreNode *)parentStore
{
	if ( NO == [renderer store_isValid] )
		return;

	SamuraiRenderStoreNode * thisStore = nil;

	if ( renderer.dom.domName && renderer.dom.domName.length )
	{
		thisStore = [SamuraiRenderStoreNode storeNode:renderer];

		[parentStore appendNode:thisStore];
	}

	if ( nil == thisStore )
	{
		thisStore = parentStore;
	}

	if ( [renderer store_hasChildren] )
	{
		for ( SamuraiRenderObject * childRenderer in renderer.childs )
		{
			[self parseRenderer:childRenderer forContainer:thisStore];
		}
	}
}

#pragma mark -

- (id)getData
{
	if ( nil == self.storeTree )
		return nil;

	return [self getDataWithPath:nil];
}

- (id)getDataWithPath:(NSString *)path
{
	if ( nil == self.storeTree )
		return nil;

	if ( self.storePath )
	{
		if ( nil == path )
		{
			path = self.storePath;
		}
		else
		{
			path = [NSString stringWithFormat:@"%@.%@", self.storePath, path];
		}
	}

	if ( nil == path )
	{
		return [self getDataFromStore:self.storeTree];
	}
	else
	{
		NSArray * storeNodes = [self.storeTree find:path];

		if ( nil == storeNodes || 0 == storeNodes.count )
		{
			return nil;
		}

		if ( 1 == storeNodes.count )
		{
			return [self getDataFromStore:[storeNodes firstObject]];
		}
		else
		{
			NSMutableArray * array = [NSMutableArray array];

			for ( SamuraiRenderStoreNode * childStore in storeNodes)
			{
				NSObject * childData = [self getDataFromStore:childStore];

				if ( childData )
				{
					[array addObject:childData];
				}
			}

			return array;
		}
	}
}

- (id)getDataFromStore:(SamuraiRenderStoreNode *)store
{
	if ( nil == store )
		return nil;

	if ( store.childs.count )
	{
		NSMutableDictionary * dict = [NSMutableDictionary dictionary];

		for ( SamuraiRenderStoreNode * childStore in store.childs )
		{
			if ( [childStore.target.dom.domName hasSuffix:@"[]"] )
			{
				NSString * childPath = nil;

				childPath = childStore.target.dom.domName;
				childPath = [childPath substringToIndex:childPath.length - 2];

				NSMutableArray * array = [dict objectForKey:childPath];

				if ( nil == array )
				{
					array = [[NSMutableArray alloc] init];

					[dict setObject:array forKey:childPath];
				}

				NSObject * value = [self getDataFromStore:childStore];
				if ( value )
				{
					[array addObject:value];
				}
			}
			else
			{
				NSObject * value = [self getDataFromStore:childStore];
				if ( value )
				{
					[dict setObject:value forKey:childStore.target.dom.domName];
				}
			}
		}

		return dict;
	}
	else
	{
		return [store.target serialize];
	}
}

- (void)setData:(NSObject *)data
{
	if ( nil == self.storeTree )
		return;

	[self setData:data withPath:nil];
}

- (void)setData:(NSObject *)data withPath:(NSString *)path
{
	if ( nil == self.storeTree )
		return;

	if ( self.storePath )
	{
		if ( nil == path )
		{
			path = self.storePath;
		}
		else
		{
			path = [NSString stringWithFormat:@"%@.%@", self.storePath, path];
		}
	}

	if ( nil == path )
	{
		[self setData:data forStore:self.storeTree];
	}
	else
	{
		NSArray * storeNodes = [self.storeTree find:path];

		if ( nil == storeNodes || 0 == storeNodes.count )
		{
			return;
		}

		if ( 1 == storeNodes.count )
		{
			if ( data )
			{
				[self setData:data forStore:[storeNodes firstObject]];
			}
			else
			{
				[self setData:nil forStore:[storeNodes firstObject]];
			}
		}
		else
		{
			if ( [data isKindOfClass:[NSArray class]] || [data conformsToProtocol:@protocol(NSArrayProtocol)] )
			{
				for ( SamuraiRenderStoreNode * childStore in storeNodes)
				{
					NSObject * childData = [(NSArray *)data safeObjectAtIndex:[storeNodes indexOfObject:childStore]];

					if ( childData )
					{
						[self setData:childData forStore:childStore];
					}
					else
					{
						[self clearDataForStore:childStore];
					}
				}
			}
			else
			{
				for ( SamuraiRenderStoreNode * childStore in storeNodes)
				{
					if ( 0 == [storeNodes indexOfObject:childStore] )
					{
						[self setData:data forStore:childStore];
					}
					else
					{
						[self clearDataForStore:childStore];
					}
				}
			}
		}
	}
}

- (void)setData:(NSObject *)data forStore:(SamuraiRenderStoreNode *)store
{
	if ( nil == store )
		return;

	if ( store.target && store.target.dom.domName )
	{
		INFO( @"Set data for '%@'", store.target.dom.domName );

		if ( data )
		{
			[store.target unserialize:data];
		}
//		else
//		{
//			[store.target zerolize];
//		}
	}

	NSMutableDictionary * arrayIndexes = nil;

	for ( SamuraiRenderStoreNode * childStore in store.childs )
	{
		if ( childStore.target )
		{
			NSObject * value = nil;

			if ( [childStore.target.dom.domName hasSuffix:@"[]"] )
			{
				NSString * childPath = nil;

				childPath = childStore.target.dom.domName;
				childPath = [childPath substringToIndex:childPath.length - 2];

				if ( [data isKindOfClass:[NSDictionary class]] || [data conformsToProtocol:@protocol(NSDictionaryProtocol)] )
				{
					value = [(NSDictionary *)data objectForKey:childStore.target.dom.domName];

					if ( nil == value )
					{
						value = [(NSDictionary *)data objectForKey:childPath];
					}
				}
				else
				{
					value = [(NSObject *)data valueForKey:childStore.target.dom.domName];

					if ( nil == value )
					{
						value = [(NSObject *)data valueForKey:childPath];
					}
				}

				if ( [value isKindOfClass:[NSArray class]] || [value conformsToProtocol:@protocol(NSArrayProtocol)] )
				{
					if ( nil == arrayIndexes )
					{
						arrayIndexes = [NSMutableDictionary dictionary];
					}

					NSNumber * childIndex = [arrayIndexes objectForKey:childPath];

					if ( nil == childIndex )
					{
						value = [(NSArray *)value safeObjectAtIndex:0];

						[arrayIndexes setObject:@(1) forKey:childPath];
					}
					else
					{
						value = [(NSArray *)value safeObjectAtIndex:childIndex.integerValue];

						[arrayIndexes setObject:@(childIndex.integerValue + 1) forKey:childPath];
					}
				}
			}
			else
			{
				if ( [data isKindOfClass:[NSDictionary class]] || [data conformsToProtocol:@protocol(NSDictionaryProtocol)] )
				{
					value = [(NSDictionary *)data objectForKey:childStore.target.dom.domName];
				}
				else
				{
					value = [(NSObject *)data valueForKey:childStore.target.dom.domName];
				}
			}

			[self setData:value forStore:childStore];
		}
		else
		{
			[self setData:data forStore:childStore];
		}
	}
}

- (void)clearData
{
	if ( nil == self.storeTree )
		return;

	[self clearDataWithPath:nil];
}

- (void)clearDataWithPath:(NSString *)path
{
	if ( nil == self.storeTree )
		return;

	if ( self.storePath )
	{
		if ( nil == path )
		{
			path = self.storePath;
		}
		else
		{
			path = [NSString stringWithFormat:@"%@.%@", self.storePath, path];
		}
	}

	if ( nil == path )
	{
		[self clearDataForStore:self.storeTree];
	}
	else
	{
		NSArray * storeNodes = [self.storeTree find:path];

		for ( SamuraiRenderStoreNode * childStore in storeNodes )
		{
			[self clearDataForStore:childStore];
		}
	}
}

- (void)clearDataForStore:(SamuraiRenderStoreNode *)store
{
	if ( nil == store )
	{
		return;
	}

	if ( store.target && store.target.dom.domName )
	{
		[store.target zerolize];
	}

	for ( SamuraiRenderStoreNode * childStore in store.childs )
	{
		[self clearDataForStore:childStore];
	}
}

#pragma mark -

- (void)dump
{
#if __SAMURAI_DEBUG__

	[self.storeTree dump];

#endif	// #if __SAMURAI_DEBUG__
}

@end

// ----------------------------------
// Unit test
// ----------------------------------

#pragma mark -

#if __SAMURAI_TESTING__

TEST_CASE( UI, RenderStoreScope )

DESCRIBE( before )
{
}

DESCRIBE( after )
{
}

TEST_CASE_END

#endif	// #if __SAMURAI_TESTING__

#endif	// #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)

#import "_pragma_pop.h"


text:
{-# LANGUAGE TupleSections #-}

module Data.Graphics.BoundingBox where

import Control.Arrow
import Control.Monad
import Data.Foldable

import Control.Logic.Frege ((<<-), adjoin)          -- http://lpaste.net/111101

-- a solution to the problem posted by http://lpaste.net/4021501857770766336

type Index = Int

{--
The thing is, we don't wish to keep recomputing the calculations. When a
bounding box is constructed, we wish to retain the artifacts of construction.
So how I approach this is to make the bounding box a wider type than just its
bounds and hide the internals in the type (newtype?) (yup)
--}

newtype BoundingBox = Bounder BBI
   deriving Show

type Point2D = (Float, Float)

data BB = BB (Index, Index) Point2D Point2D
   deriving (Eq, Ord, Show)

data BBI = BBinternal BB Int (Float, Float)
   deriving (Eq, Ord, Show)

-- the internal representation is the same as the BoundingBox but the meaning is
-- very different BBI side (lenx/cell, heighty/cell)

makeBoundingBox :: (Index, Index) -> Point2D -> Point2D -> BoundingBox
makeBoundingBox (idxa, idxz) orgs ends =
   -- okay, first, BB is obvs:
   let bb = BB (idxa, idxz) orgs ends
   -- next obvs: the sqrt of indices:
       sz = ceiling $ sqrt $ fromIntegral $ idxz - idxa
   -- now, BBI, not so obvs ... wait: yes it is:
       divr = aside sz
   in Bounder . BBinternal bb sz
              . adjoin divr $ firstsAndSeconds ends orgs

-- ... isn't the last tuple an arrow? or a bifunctor?

makeBBfrom :: Foldable t => t a -> Point2D -> BoundingBox
makeBBfrom = flip makeBoundingBox (0,0) . (0,) . length
    -- #1Liner solution by Gautier DI FOLCO @gautier_difolco

firstsAndSeconds :: (a,b) -> (c,d) -> ((a,c), (b,d))
firstsAndSeconds =
   curry ((fst . fst &&& fst . snd) &&& (snd . fst &&& snd . snd))

-- *Main> makeBoundingBox (1, 100) (0,0) (1000,750) ~>
-- Bounder (BBinternal (BB (1,100) (0.0,0.0) (1000.0,750.0)) 10 (100.0,75.0))

center :: BoundingBox -> Point2D
center (Bounder (BBinternal (BB _ (orgx, orgy) (endx, endy)) _ _)) =
   ((orgx + endx) / 2, (orgy + endy) / 2)

minCellSz :: BoundingBox -> Float
minCellSz (Bounder (BBinternal _ _ (a,b))) = min a b

aside :: Int -> (Float, Float) -> Float
aside count (end, start) = (end - start) / fromIntegral count

-- given that I'm index so-and-so (13, say), what row/column do I fall under?

rowcol :: Enum a => BoundingBox -> a -> (Int, Int)
rowcol (Bounder (BBinternal (BB (start,_) _ _) sq _)) =
   adjoin succ . flip divMod sq . flip (-) start . fromEnum

-- n.b. row, col is one-based
-- *Main> rowcol bb 13 ~> (2,3)   *Main> rowcol bb 5 ~> (1,5)
-- so there

cell :: Enum a => BoundingBox -> a -> Point2D
cell bb@(Bounder (BBinternal _ _ celsz)) =
   fourStars celsz . adjoin fromIntegral . rowcol bb

fourStars :: Point2D -> Point2D -> Point2D
fourStars = adjoin (uncurry (*)) <<- firstsAndSeconds

{--
cells :: [Index]
cells = [46,19,2,52,21,9,77,7,49,42]

*Main> map (flip cell (makeBoundingBox (1,100) (0,0) (1000, 750))) cells ~>
[(500.0,450.0),(200.0,675.0),(100.0,150.0),(600.0,150.0),(300.0,75.0),
 (100.0,675.0),(800.0,525.0),(100.0,525.0),(500.0,675.0),(500.0,150.0)]
--}


text:
<bill session="115" type="h" number="2946" updated="2017-09-15T07:16:55Z">
  <state datetime="2017-06-20">REFERRED</state>
  <status>
    <introduced datetime="2017-06-20"/>
  </status>
  <introduced datetime="2017-06-20"/>
  <titles>
    <title type="short" as="introduced">Heavy Truck, Tractor, and Trailer Retail Federal Excise Tax Repeal Act of 2017</title>
    <title type="short" as="introduced">Heavy Truck, Tractor, and Trailer Retail Federal Excise Tax Repeal Act of 2017</title>
    <title type="official" as="introduced">To amend the Internal Revenue Code of 1986 to repeal the excise tax on heavy trucks and trailers, and for other purposes.</title>
    <title type="display">Heavy Truck, Tractor, and Trailer Retail Federal Excise Tax Repeal Act of 2017</title>
  </titles>
  <sponsor bioguide_id="L000578"/>
  <cosponsors>
    <cosponsor bioguide_id="A000374" joined="2017-06-26"/>
    <cosponsor bioguide_id="B001260" joined="2017-06-27"/>
    <cosponsor bioguide_id="B001305" joined="2017-07-24"/>
    <cosponsor bioguide_id="G000578" joined="2017-06-26"/>
    <cosponsor bioguide_id="G000579" joined="2017-07-14"/>
    <cosponsor bioguide_id="H001045" joined="2017-07-14"/>
    <cosponsor bioguide_id="H001077" joined="2017-06-26"/>
    <cosponsor bioguide_id="R000607" joined="2017-06-20"/>
    <cosponsor bioguide_id="R000609" joined="2017-09-14"/>
    <cosponsor bioguide_id="S001199" joined="2017-07-24"/>
    <cosponsor bioguide_id="W000799" joined="2017-07-25"/>
    <cosponsor bioguide_id="W000816" joined="2017-06-26"/>
  </cosponsors>
  <actions>
    <action datetime="2017-06-20">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-06-20" state="REFERRED">
      <text>Referred to the House Committee on Ways and Means.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSWM" name="House Ways and Means" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Taxation"/>
  </subjects>
  <amendments/>
  <committee-reports/>
</bill>