text:
package com.cloudera.flume.handlers.text;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

import org.junit.Test;

import com.cloudera.flume.conf.FlumeBuilder;
import com.cloudera.flume.conf.FlumeSpecException;
import com.cloudera.flume.core.connector.DirectDriver;
import com.cloudera.flume.reporter.ReportEvent;
import com.cloudera.flume.reporter.aggregator.AccumulatorSink;
import com.cloudera.util.Clock;
import com.cloudera.util.FileUtil;

/**
 * This class tests the tail dir source. It looks at a local file system and
 * tails all the files in the directory. If new files appear in the directory it
 * tails them as well.
 */

public class TestTailDirSource {

  @Test
  public void testOpenClose() throws IOException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, ".*");
    for (int i = 0; i < 20; i++) {
      src.open();
      src.close();
    }
    FileUtil.rmr(tmpdir);
  }

  @Test
  public void testBuilder() throws IOException, FlumeSpecException {
    File tmpdir = FileUtil.mktempdir();
    String src = "tailDir(\"" + tmpdir.getAbsolutePath() + "\", \"foo.*\")";
    FlumeBuilder.buildSource(src);
    FileUtil.rmr(tmpdir);
  }

  @Test(expected = FlumeSpecException.class)
  public void testFailBuilder() throws IOException, FlumeSpecException {
    File tmpdir = FileUtil.mktempdir();
    String src = "tailDir(\"" + tmpdir.getAbsolutePath() + "\", \"\\x.*\")";
    FlumeBuilder.buildSource(src);
    FileUtil.rmr(tmpdir);
  }

  void genFiles(File tmpdir, String prefix, int files, int lines)
      throws IOException {
    for (int i = 0; i < files; i++) {
      File tmpfile = File.createTempFile(prefix, "bar", tmpdir);
      PrintWriter pw = new PrintWriter(tmpfile);
      for (int j = 0; j < lines; j++) {
        pw.println("this is file " + i + " line " + j);
      }
      pw.close();
    }
  }

  /**
   * Setup sources and sinks, start the driver, then have new files appear,
   */
  @Test
  public void testNoneToNewFiles() throws IOException, InterruptedException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, ".*");
    AccumulatorSink cnt = new AccumulatorSink("tailcount");
    src.open();
    cnt.open();
    DirectDriver drv = new DirectDriver(src, cnt);

    drv.start();
    Clock.sleep(1000);

    genFiles(tmpdir, "foo", 10, 100);

    Clock.sleep(1000);

    assertEquals(1000, cnt.getCount());

    drv.stop();
    src.close();
    cnt.close();
    FileUtil.rmr(tmpdir);
  }

  /**
   * Setup sources and sinks, start the driver, then have new files appear. The
   * filter should only pick up the foo* files and not the bar* files
   */
  @Test
  public void testNoneToNewFilteredFiles() throws IOException,
      InterruptedException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, "foo.*");
    AccumulatorSink cnt = new AccumulatorSink("tailcount");
    src.open();
    cnt.open();
    DirectDriver drv = new DirectDriver(src, cnt);

    drv.start();
    Clock.sleep(1000);

    genFiles(tmpdir, "foo", 10, 100);
    genFiles(tmpdir, "bar", 15, 100);

    Clock.sleep(1000);

    assertEquals(1000, cnt.getCount());

    drv.stop();
    src.close();
    cnt.close();
    FileUtil.rmr(tmpdir);
  }

  @Test
  public void testExistingFiles() throws IOException, InterruptedException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, ".*");
    AccumulatorSink cnt = new AccumulatorSink("tailcount");
    src.open();
    cnt.open();
    DirectDriver drv = new DirectDriver(src, cnt);

    genFiles(tmpdir, "foo", 10, 100);

    drv.start();
    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    drv.stop();
    src.close();
    cnt.close();
    FileUtil.rmr(tmpdir);

  }

  /**
   * Start with existing files, check that the are read, wait a little bit and
   * then add some new files and make sure they are read.
   */
  @Test
  public void testExistingAddFiles() throws IOException, InterruptedException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, ".*");
    AccumulatorSink cnt = new AccumulatorSink("tailcount");
    src.open();
    cnt.open();
    DirectDriver drv = new DirectDriver(src, cnt);

    genFiles(tmpdir, "foo", 10, 100);

    drv.start();
    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    // more files show up
    genFiles(tmpdir, "foo", 10, 100);
    Clock.sleep(1000);
    assertEquals(2000, cnt.getCount());

    drv.stop();
    src.close();
    cnt.close();
    FileUtil.rmr(tmpdir);

  }

  @Test
  public void testExistingRemoveFiles() throws IOException,
      InterruptedException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, ".*");
    AccumulatorSink cnt = new AccumulatorSink("tailcount");
    src.open();
    cnt.open();
    DirectDriver drv = new DirectDriver(src, cnt);

    genFiles(tmpdir, "foo", 10, 100);

    drv.start();
    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    FileUtil.rmr(tmpdir);

    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    drv.stop();
    src.close();
    cnt.close();
    FileUtil.rmr(tmpdir);
  }

  /**
   * This creates a many files that need to show up and then get deleted. This
   * just verifies that the files have been removed.
   */
  @Test
  public void testCursorExhaustion() throws IOException, InterruptedException {
    File tmpdir = FileUtil.mktempdir();
    TailDirSource src = new TailDirSource(tmpdir, ".*");
    AccumulatorSink cnt = new AccumulatorSink("tailcount");
    src.open();
    cnt.open();
    DirectDriver drv = new DirectDriver(src, cnt);

    drv.start();

    // This blows up when there are ~2000 files
    genFiles(tmpdir, "foo", 200, 10);
    Clock.sleep(1000);
    assertEquals(2000, cnt.getCount());

    ReportEvent rpt1 = src.getReport();
    assertEquals(Long.valueOf(200), rpt1
        .getLongMetric(TailDirSource.A_FILESPRESENT));

    FileUtil.rmr(tmpdir);
    tmpdir.mkdirs();
    Clock.sleep(1000);
    assertEquals(2000, cnt.getCount());

    ReportEvent rpt = src.getReport();
    assertEquals(rpt.getLongMetric(TailDirSource.A_FILESADDED), rpt
        .getLongMetric(TailDirSource.A_FILESDELETED));
    assertEquals(Long.valueOf(0), rpt
        .getLongMetric(TailDirSource.A_FILESPRESENT));

    drv.stop();
    src.close();
    cnt.close();
    FileUtil.rmr(tmpdir);
  }
}


text:
/**
 * This class represents a symbol in the parser.
 * @private
 */
Ext.define('Ext.parse.Symbol', {
    priority: 0,

    /**
     * This property holds the name of the property to update when a config provided is
     * not an object (just a value).
     * @property {String} defaultProperty
     */

    constructor: function (id, config) {
        var me = this,
            defaultProperty = me.defaultProperty;

        if (config && typeof config === 'object') {
            Ext.apply(me, config);
        } else if (config !== undefined && defaultProperty) {
            me[defaultProperty] = config;
        }

        me.id = id;
    },

    //<debug>
    dump: function () {
        var me = this,
            ret = {
                at: me.at,
                arity: me.arity
            },
            i;

        if ('value' in me) {
            ret.value = me.value;
        }

        if (me.lhs) {
            ret.lhs = me.lhs.dump();
            ret.rhs = me.rhs.dump();
        }
        if (me.operand) {
            ret.operand = me.operand.dump();
        }
        if (me.args) {
            ret.args = [];
            for (i = 0; i < me.args.length; ++i) {
                ret.args.push(me.args[i].dump());
            }
        }

        return ret;
    },
    //</debug>

    /**
     * This abstract method is implemented by operators that follow their operand (like
     * a binary operator). When the symbol is encountered in an expression this method
     * is called. The name "led" stands for "left denotation".
     *
     * @param {Ext.parse.Symbol} left
     */
    led: function () {
        this.parser.syntaxError(this.at, 'Missing operator');
    },

    /**
     * This abstract method is implemented by operators that precede their operand (like
     * a unary operator). When the symbol is encountered in an expression this method
     * is called. The name "nud" stands for "null denotation".
     */
    nud: function () {
        this.parser.syntaxError(this.at, 'Undefined');
    },

    /**
     * This method updates this symbol given an additional config object. This is used
     * when a symbol is placed in multiple categories (such `infix` and `prefix`). The
     * `priority` is the most likely value to update, but also a `led` or `nud` method
     * may be provided to complete the symbol.
     *
     * @param {Object} config
     */
    update: function (config) {
        if (config && typeof config === 'object') {
            var me = this,
                priority = config.priority,
                led = config.led,
                nud = config.nud;

            if (me.priority <= priority) {
                me.priority = priority;
            }
            if (led) {
                me.led = led;
            }
            if (nud) {
                me.nud = nud;
            }
        }
    }
});

redpajama_set_name: RedPajamaGithub


text:
def calc_percentage(allFile, filteredFile):
        numFiltered = 0
        numAll = 0
        with open(allFile, 'r') as allF:
                for tweet in allF:
                        numAll += 1
        allF.close()
        with open(filteredFile, 'r') as filteredF:
                for tweet in filteredF:
                        numFiltered += 1
        filteredF.close()

        return float(numFIltered / numAll)


text:
var profile = require('../../../lib/util/profile');

exports.getMockedProfile = function () {
  var newProfile = new profile.Profile();

  newProfile.addSubscription(new profile.Subscription({
    id: '2915bbd6-1252-405f-8173-6c00428146d9',
    name: 'Batch-MatthChr',
    user: {
      name: 'user@domain.example',
      type: 'user'
    },
    tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47',
    state: 'Enabled',
    registeredProviders: [],
    _eventsCount: '1',
    isDefault: true
  }, newProfile.environments['AzureCloud']));

  return newProfile;
};

exports.setEnvironment = function() {
  process.env['AZURE_BATCH_ACCOUNT'] = 'matthchreastus2';
  process.env['AZURE_BATCH_ENDPOINT'] = 'https://matthchreastus2.eastus2.batch.azure.com';

};

exports.scopes = [];


text:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <title>The GHC Commentary - Sugar Free: From Haskell To Core</title>

The GHC Commentary - Sugar Free: From Haskell To Core

      Up until after type checking, GHC keeps the source program in an
      abstract representation of Haskell source without removing any of the
      syntactic sugar (such as, list comprehensions) that could easily be
      represented by more primitive Haskell.  This complicates part of the
      front-end considerably as the abstract syntax of Haskell (as exported by
      the module HsSyn)
      is much more complex than a simplified representation close to, say, the
      Haskell
      Kernel would be.  However, having a representation that is as close
      as possible to the surface syntax simplifies the generation of clear
      error messages.  As GHC (quite in contrast to "conventional" compilers)
      prints code fragments as part of error messages, the choice of
      representation is especially important.

      Nonetheless, as soon as the input has passed all static checks, it is
      transformed into GHC's principal intermediate language that goes by the
      name of Core and whose representation is exported by the
      module CoreSyn.
      All following compiler phases, except code generation operate on Core.
      Due to Andrew Tolmach's effort, there is also an external
      representation for Core.

      The conversion of the compiled module from HsSyn into that
      of CoreSyn is performed by a phase called the
      desugarer, which is located in
      fptools/ghc/compiler/deSugar/.
      It's operation is detailed in the following.

Auxilliary Functions

      The modules DsMonad
      defines the desugarer monad (of type DsM) which maintains
      the environment needed for desugaring.  In particular, it encapsulates a
      unique supply for generating new variables, a map to lookup standard
      names (such as functions from the prelude), a source location for error
      messages, and a pool to collect warning messages generated during
      desugaring.  Initialisation of the environment happens in the function Desugar.desugar,
      which is also the main entry point into the desugarer.

      The generation of Core code often involves the use of standard functions
      for which proper identifiers (i.e., values of type Id that
      actually refer to the definition in the right Prelude) need to be
      obtained.  This is supported by the function
      DsMonad.dsLookupGlobalValue :: Name -> DsM Id.

Pattern Matching

      Nested pattern matching with guards and everything is translated into
      the simple, flat case expressions of Core by the following modules:

Match:

This modules contains the main pattern-matching compiler in the form
	of a function called match.  There is some documentation
	as to how match works contained in the module itself.
	Generally, the implemented algorithm is similar to the one described
	in Phil Wadler's Chapter ? of Simon Peyton Jones' The
	Implementation of Functional Programming Languages.
	Match exports a couple of functions with not really
	intuitive names.  In particular, it exports match,
	matchWrapper, matchExport, and
	matchSimply.  The function match, which is
	the main work horse, is only used by the other matching modules.  The
	function matchExport - despite it's name - is merely used
	internally in Match and handles warning messages (see
	below for more details).  The actual interface to the outside is
	matchWrapper, which converts the output of the type
	checker into the form needed by the pattern matching compiler (i.e., a
	list of EquationInfo).  Similar in function to
	matchWrapper is matchSimply, which provides
	an interface for the case where a single expression is to be matched
	against a single pattern (as, for example, is the case in bindings in
	a do expression).

MatchCon:

This module generates code for a set of alternative constructor
	patterns that belong to a single type by means of the routine
	matchConFamily.  More precisely, the routine gets a set
	of equations where the left-most pattern of each equation is a
	constructor pattern with a head symbol from the same type as that of
	all the other equations.  A Core case expression is generated that
	distinguihes between all these constructors.  The routine is clever
	enough to generate a sparse case expression and to add a catch-all
	default case only when needed (i.e., if the case expression isn't
	exhaustive already).  There is also an explanation at the start of the
	modules.

MatchLit:

Generates code for a set of alternative literal patterns by means of
	the routine matchLiterals.  The principle is similar to
	that of matchConFamily, but all left-most patterns are
	literals of the same type.

DsUtils:

This module provides a set of auxilliary definitions as well as the
      data types EquationInfo and MatchResult that
      form the input and output, respectively, of the pattern matching
      compiler.

Check:

This module does not really contribute the compiling pattern
      matching, but it inspects sets of equations to find whether there are
      any overlapping patterns or non-exhaustive pattern sets.  This task is
      implemented by the function check, which returns a list of
      patterns that are part of a non-exhaustive case distinction as well as a
      set of equation labels that can be reached during execution of the code;
      thus, the remaining equations are shadowed due to overlapping patterns.
      The function check is invoked and its result converted into
      suitable warning messages by the function Match.matchExport
      (which is a wrapper for Match.match).

      The central function match, given a set of equations,
      proceeds in a number of steps:

It starts by desugaring the left-most pattern of each equation using
	the function tidy1 (indirectly via
	tidyEqnInfo).  During this process, non-elementary
	pattern (e.g., those using explicit list syntax [x, y, ...,
	z]) are converted to a standard constructor pattern and also
	irrefutable pattern are removed.

Then, a process called unmixing clusters the equations into
	blocks (without re-ordering them), such that the left-most pattern of
	all equations in a block are either all variables, all literals, or
	all constructors.

Each block is, then, compiled by matchUnmixedEqns,
	which forwards the handling of literal pattern blocks to
	MatchLit.matchLiterals, of constructor pattern blocks to
	MatchCon.matchConFamily, and hands variable pattern
	blocks back to match.

Last modified: Mon Feb 11 22:35:25 EST 2002


text:
require(['d3', 'forceDirectedGraph'], function (d3, ForceDirectedGraph) {

  // Grab the container div.
  var div = document.getElementById('container'),

      // Create the force directed graph visualization.
      forceDirectedGraph = ForceDirectedGraph(div),

      // Extract the name of the data flow graph file
      // from the URL hash, or use 'svg' by default.
      name = window.location.hash.substr(1),
      filename = '../../dataFlowGraphs/' + name + '.json';

  // Load the data flow graph file.
  d3.json(filename, function (graph) {

    // Set the data on the graph visualization.
    forceDirectedGraph.data = graph;

    // Extract the scale and translate from the saved data.
    if(graph.scale && graph.translate) {
      forceDirectedGraph.scale = graph.scale;
      forceDirectedGraph.translate = graph.translate;
    }

    // Whenever the user manually positions nodes,
    forceDirectedGraph.when(['data', 'scale', 'translate'], function (data, scale, translate) {

      // If the code is running in a development environment,
      if( window.location.host === 'localhost:8000') {

        // write the new positions to disk via the server.
        sendToServer({
          name: name,
          data: {
            nodes: data.nodes,
            // Restore indices so the data can be parsed properly later.
            links: data.links.map(function (d) {
              return {
                source: d.source.index,
                target: d.target.index
              };
            }),
            scale: scale,
            translate: translate
          }
        });
      }
    });
  });

  function sendToServer(json){

    // Draws from http://stackoverflow.com/questions/6418220/javascript-send-json-object-with-ajax
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open('POST', '/writeDataFlowGraph');
    xmlhttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
    xmlhttp.send(JSON.stringify(json));
  }

  // initialize zoom
  var scale = div.clientWidth * 1 / 800;
  forceDirectedGraph.set({
    scale: scale,
    translate: [
      div.clientWidth / 2 * (1 - scale),
      div.clientHeight / 2 * (1 - scale)
    ]
  });

  setSizeFromDiv();
  window.addEventListener('resize', setSizeFromDiv);
  function setSizeFromDiv(){
    forceDirectedGraph.box = {
      x: 0,
      y: 0,
      width: div.clientWidth,
      height: div.clientHeight
    };
  }
});


text:
@interface GADMediationVungleInterstitial : NSObject

- (nonnull instancetype)
    initWithAdConfiguration:(nonnull GADMediationInterstitialAdConfiguration *)adConfiguration
          completionHandler:(nonnull GADMediationInterstitialLoadCompletionHandler)handler;

/// Constructor is unavailable. Please use initWithAdConfiguration:completionHandler:.
- (nonnull instancetype)init NS_UNAVAILABLE;

/// Requests a interstitial ad from Vungle.
- (void)requestInterstitialAd;

@end


text:
package com.opengamma.engine.view.permission;

import com.opengamma.engine.view.client.PortfolioFilter;
import com.opengamma.livedata.UserPrincipal;

/**
 * Responsible for providing a filter for
 * portfolio/user permissioning.
 */
public interface ViewPortfolioPermissionProvider {

  PortfolioFilter createPortfolioFilter(UserPrincipal user);
}


text:
D3 based visualization library.

**The master branch is currently under active development and not ready for anything useful. It is a complete rewrite using d3 v 4 as dependency.** For the original code, check the [2015 branch](https://github.com/quantmind/giotto/tree/2015).

[![CircleCI](https://circleci.com/gh/quantmind/giotto.svg?style=svg)](https://circleci.com/gh/quantmind/giotto)
[![Dependency Status](https://david-dm.org/quantmind/giotto.svg)](https://david-dm.org/quantmind/giotto)
[![devDependency Status](https://david-dm.org/quantmind/giotto/dev-status.svg)](https://david-dm.org/quantmind/giotto#info=devDependencies)

## Installing

If you use npm, ``npm install giotto``.
The released bundle supports anonymous AMD, CommonJS, and vanilla environments.
You can load directly from [giottojs.org](https://giottojs.org)
or [unpkg](https://unpkg.com/giotto/). For example:
```html
<script src="https://giottojs.org/latest/giotto.js"></script>
```
For the minified version:
```html
<script src="https://giottojs.org/latest/giotto.min.js"></script>
```

## Acknowledgement

This library is built on top of several [d3](https://github.com/d3) libraries
as the [dev dependencies](https://david-dm.org/quantmind/giotto#info=devDependencies)
shows. All these libraries are BSD licensed

> Copyright (c) 2010-2015, Michael Bostock
> All rights reserved.


text:
#pragma once
#include "kernel/expr.h"

namespace lean {
void initialize_blast_tactic();
void finalize_blast_tactic();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<nibrs:Submission xmlns:nibrs="http://fbi.gov/cjis/nibrs/4.2"
	xmlns:cjis="http://fbi.gov/cjis/1.0"
	xmlns:cjiscodes="http://fbi.gov/cjis/cjis-codes/1.0"
	xmlns:i="http://release.niem.gov/niem/appinfo/3.0/"
	xmlns:ucr="http://release.niem.gov/niem/codes/fbi_ucr/3.2/"
	xmlns:j="http://release.niem.gov/niem/domains/jxdm/5.2/"
	xmlns:term="http://release.niem.gov/niem/localTerminology/3.0/"
	xmlns:nc="http://release.niem.gov/niem/niem-core/3.0/"
	xmlns:niem-xsd="http://release.niem.gov/niem/proxy/xsd/3.0/"
	xmlns:s="http://release.niem.gov/niem/structures/3.0/"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:nibrscodes="http://fbi.gov/cjis/nibrs/nibrs-codes/4.2"
	xsi:schemaLocation="http://fbi.gov/cjis/nibrs/4.2 ../base-xsd/nibrs/4.2/nibrs.xsd">
	<cjis:MessageMetadata>
		<!-- Message Timestamp -->
		<cjis:MessageDateTime>2017-03-23T03:00:00</cjis:MessageDateTime>
		<!-- Message ID -->
		<cjis:MessageIdentification>
			<nc:IdentificationID>123456</nc:IdentificationID>
		</cjis:MessageIdentification>
		<!-- NIBRS IEPD Version -->
		<cjis:MessageImplementationVersion>4.2</cjis:MessageImplementationVersion>
		<cjis:MessageSubmittingOrganization>
			<j:OrganizationAugmentation>
				<j:OrganizationORIIdentification>
					<!-- Submitting Agency ORI -->
					<nc:IdentificationID>FBI111111</nc:IdentificationID>
				</j:OrganizationORIIdentification>
			</j:OrganizationAugmentation>
		</cjis:MessageSubmittingOrganization>
	</cjis:MessageMetadata>
	<nibrs:Report>
		<nibrs:ReportHeader>
			<!-- Submission Type -->
			<nibrs:NIBRSReportCategoryCode>GROUP A INCIDENT REPORT</nibrs:NIBRSReportCategoryCode>
			<!-- Submission Action Type -->
			<nibrs:ReportActionCategoryCode>I</nibrs:ReportActionCategoryCode>
			<!-- Year/Month Of Report -->
			<nibrs:ReportDate>
				<nc:YearMonthDate>2016-02</nc:YearMonthDate>
			</nibrs:ReportDate>
			<nibrs:ReportingAgency>
				<j:OrganizationAugmentation>
					<j:OrganizationORIIdentification>
						<!-- Element 1, ORI Code, Owning Agency ORI -->
						<nc:IdentificationID>WVNDX0100</nc:IdentificationID>
					</j:OrganizationORIIdentification>
				</j:OrganizationAugmentation>
			</nibrs:ReportingAgency>
		</nibrs:ReportHeader>
		<nc:Incident>
			<nc:ActivityIdentification>
				<!-- Element 2, Incident Number -->
				<nc:IdentificationID>54236732</nc:IdentificationID>
			</nc:ActivityIdentification>
			<nc:ActivityDate>
			    <nc:YearMonthDate>1999-01</nc:YearMonthDate>
				<!-- Element 3, Incident Date and Hour-->
				<nc:DateTime>2016-02-19T10:00:00</nc:DateTime>
				<!-- Element 3, Incident Date if Hour is Unknown-->
				<nc:Date>2016-02-19</nc:Date>
			</nc:ActivityDate>
			<cjis:IncidentAugmentation>
				<!-- Element 3, IncidentReportDateIndicator is true to designate that the ActivityDate is the Report Date rather than the Incident Date -->
				<cjis:IncidentReportDateIndicator>false</cjis:IncidentReportDateIndicator>
				<!-- Element 2A, Cargo Theft Indicator: True/False-->
				<j:OffenseCargoTheftIndicator>true</j:OffenseCargoTheftIndicator>
			</cjis:IncidentAugmentation>
			<j:IncidentAugmentation>
				<!-- Element 4, Cleared Exceptionally -->
				<j:IncidentExceptionalClearanceCode>A</j:IncidentExceptionalClearanceCode>
				<!-- Element 5, Exceptional Clearance Date -->
				<j:IncidentExceptionalClearanceDate>
					<nc:Date>2016-02-25</nc:Date>
				</j:IncidentExceptionalClearanceDate>
			</j:IncidentAugmentation>
		</nc:Incident>
		<j:Offense s:id="Offense1">
			<!-- Element 6, Offense Code -->
			<!--<nibrs:OffenseUCRCode>64A</nibrs:OffenseUCRCode>-->
		    <nibrs:OffenseUCRCode>240</nibrs:OffenseUCRCode>
			<!-- Element 12, Type Criminal Activity/Gang Information -->
			<nibrs:CriminalActivityCategoryCode>N</nibrs:CriminalActivityCategoryCode>
			<!-- Element 8A, Bias Motivation -->
			<j:OffenseFactorBiasMotivationCode>NONE</j:OffenseFactorBiasMotivationCode>
			<!-- Element 10, Number Of Premises Entered -->
			<j:OffenseStructuresEnteredQuantity>1</j:OffenseStructuresEnteredQuantity>
			<!-- Element 8, Offender(s) Suspected Of Using -->
			<j:OffenseFactor>
				<j:OffenseFactorCode>N</j:OffenseFactorCode>
			</j:OffenseFactor>
			<!-- Element 11, Method Of Entry -->
			<j:OffenseEntryPoint>
				<j:PassagePointMethodCode>F</j:PassagePointMethodCode>
			</j:OffenseEntryPoint>
			<!-- Element 13, Type Weapon/Force Involved -->
			<j:OffenseForce>
				<j:ForceCategoryCode>11A</j:ForceCategoryCode>
			</j:OffenseForce>
			<!-- Element 7, Attempted/Completed -->
			<j:OffenseAttemptedIndicator>true</j:OffenseAttemptedIndicator>
		</j:Offense>
		<!-- Begin Property -->
		<!-- Element 9, Location Type -->
		<nc:Location s:id="Location1">
			<nibrs:LocationCategoryCode>58</nibrs:LocationCategoryCode>
		</nc:Location>
	    <nc:Item>
	        <!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
	        <nc:ItemStatus>
	            <cjis:ItemStatusCode>NONE</cjis:ItemStatusCode>
	        </nc:ItemStatus>
	        <!-- Element 16, Value of Property in US Dollars -->
	        <nc:ItemValue>
	            <nc:ItemValueAmount>
	                <nc:Amount>12000</nc:Amount>
	            </nc:ItemValueAmount>
	            <!-- Element 17, Date Recovered -->
	            <nc:ItemValueDate>
	                <nc:Date>2016-02-24</nc:Date>
	            </nc:ItemValueDate>
	        </nc:ItemValue>
	        <!-- Element 15, Property Description -->
	        <j:ItemCategoryNIBRSPropertyCategoryCode>01</j:ItemCategoryNIBRSPropertyCategoryCode>
	        <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
	        <!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
	        <nc:ItemQuantity>1</nc:ItemQuantity>
	    </nc:Item>
	    <nc:Item>
	        <!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
	        <nc:ItemStatus>
	            <cjis:ItemStatusCode>BURNED</cjis:ItemStatusCode>
	        </nc:ItemStatus>
	        <!-- Element 16, Value of Property in US Dollars -->
	        <nc:ItemValue>
	            <nc:ItemValueAmount>
	                <nc:Amount>12000</nc:Amount>
	            </nc:ItemValueAmount>
	            <!-- Element 17, Date Recovered -->
	            <nc:ItemValueDate>
	                <nc:Date>2016-02-24</nc:Date>
	                <nc:DateTime>2017-03-23T03:00:00</nc:DateTime>
	            </nc:ItemValueDate>
	        </nc:ItemValue>
	        <!-- Element 15, Property Description -->
	        <j:ItemCategoryNIBRSPropertyCategoryCode>01</j:ItemCategoryNIBRSPropertyCategoryCode>
	        <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
	        <!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
	        <nc:ItemQuantity>1</nc:ItemQuantity>
	    </nc:Item>
	    <nc:Item>
	        <!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
	        <nc:ItemStatus>
	            <cjis:ItemStatusCode>COUNTERFEITED</cjis:ItemStatusCode>
	        </nc:ItemStatus>
	        <!-- Element 16, Value of Property in US Dollars -->
	        <nc:ItemValue>
	            <nc:ItemValueAmount>
	                <nc:Amount>12000</nc:Amount>
	            </nc:ItemValueAmount>
	            <!-- Element 17, Date Recovered -->
	            <nc:ItemValueDate>
	                <nc:Date>2016-02-24</nc:Date>
	            </nc:ItemValueDate>
	        </nc:ItemValue>
	        <!-- Element 15, Property Description -->
	        <j:ItemCategoryNIBRSPropertyCategoryCode>01</j:ItemCategoryNIBRSPropertyCategoryCode>
	        <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
	        <!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
	        <nc:ItemQuantity>1</nc:ItemQuantity>
	    </nc:Item>
	    <nc:Item>
	        <!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
	        <nc:ItemStatus>
	            <cjis:ItemStatusCode>DESTROYED_DAMAGED_VANDALIZED</cjis:ItemStatusCode>
	        </nc:ItemStatus>
	        <!-- Element 16, Value of Property in US Dollars -->
	        <nc:ItemValue>
	            <nc:ItemValueAmount>
	                <nc:Amount>12000</nc:Amount>
	            </nc:ItemValueAmount>
	            <!-- Element 17, Date Recovered -->
	            <nc:ItemValueDate>
	                <nc:Date>2016-02-24</nc:Date>
	            </nc:ItemValueDate>
	        </nc:ItemValue>
	        <!-- Element 15, Property Description -->
	        <j:ItemCategoryNIBRSPropertyCategoryCode>01</j:ItemCategoryNIBRSPropertyCategoryCode>
	        <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
	        <!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
	        <nc:ItemQuantity>1</nc:ItemQuantity>
	    </nc:Item>
		<nc:Item>
			<!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
			<nc:ItemStatus>
				<cjis:ItemStatusCode>RECOVERED</cjis:ItemStatusCode>
			</nc:ItemStatus>
			<!-- Element 16, Value of Property in US Dollars -->
			<nc:ItemValue>
				<nc:ItemValueAmount>
					<nc:Amount>12000</nc:Amount>
				</nc:ItemValueAmount>
				<!-- Element 17, Date Recovered -->
				<nc:ItemValueDate>
					<nc:Date>2016-02-24</nc:Date>
				</nc:ItemValueDate>
			</nc:ItemValue>
			<!-- Element 15, Property Description -->
			<j:ItemCategoryNIBRSPropertyCategoryCode>01</j:ItemCategoryNIBRSPropertyCategoryCode>
		    <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
			<!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
			<nc:ItemQuantity>1</nc:ItemQuantity>
		</nc:Item>
	    <nc:Item>
	        <!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
	        <nc:ItemStatus>
	            <cjis:ItemStatusCode>RECOVERED</cjis:ItemStatusCode>
	        </nc:ItemStatus>
	        <!-- Element 16, Value of Property in US Dollars -->
	        <nc:ItemValue>
	            <nc:ItemValueAmount>
	                <nc:Amount>12000</nc:Amount>
	            </nc:ItemValueAmount>
	            <!-- Element 17, Date Recovered -->
	            <nc:ItemValueDate>
	                <nc:Date>2016-02-24</nc:Date>
	            </nc:ItemValueDate>
	        </nc:ItemValue>
	        <!-- Element 15, Property Description -->
	        <j:ItemCategoryNIBRSPropertyCategoryCode>01</j:ItemCategoryNIBRSPropertyCategoryCode>
	        <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
	        <!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
	        <nc:ItemQuantity>4</nc:ItemQuantity>
	    </nc:Item>
	    <nc:Item>
	        <!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
	        <nc:ItemStatus>
	            <cjis:ItemStatusCode>RECOVERED</cjis:ItemStatusCode>
	        </nc:ItemStatus>
	        <!-- Element 16, Value of Property in US Dollars -->
	        <nc:ItemValue>
	            <nc:ItemValueAmount>
	                <nc:Amount>12000</nc:Amount>
	            </nc:ItemValueAmount>
	            <!-- Element 17, Date Recovered -->
	            <nc:ItemValueDate>
	                <nc:Date>2016-02-24</nc:Date>
	            </nc:ItemValueDate>
	        </nc:ItemValue>
	        <!-- Element 15, Property Description -->
	        <j:ItemCategoryNIBRSPropertyCategoryCode>03</j:ItemCategoryNIBRSPropertyCategoryCode>
	        <!-- Element 19, Number of Recovered Motor Vehicles, if Status is Recovered -->
	        <!-- Element 18, Number of Stolen Motor Vehicles, if Status is Stolen -->
	        <nc:ItemQuantity>41</nc:ItemQuantity>
	    </nc:Item>
		<nc:Substance>
			<!-- Element 14, Type Property Loss/etc  Substituted for nc:ItemStatus -->
			<nc:ItemStatus>
				<cjis:ItemStatusCode>RECOVERED</cjis:ItemStatusCode>
			</nc:ItemStatus>
			<!-- Element 16, Value of Property in US Dollars -->
			<nc:ItemValue>
				<nc:ItemValueAmount>
					<nc:Amount>12000</nc:Amount>
				</nc:ItemValueAmount>
				<!-- Element 17, Date Recovered -->
				<nc:ItemValueDate>
					<nc:Date>2016-02-24</nc:Date>
				</nc:ItemValueDate>
			</nc:ItemValue>
			<!-- Element 15, Property Description -->
			<j:ItemCategoryNIBRSPropertyCategoryCode>10</j:ItemCategoryNIBRSPropertyCategoryCode>
			<!-- Element 20, Suspected Involved Drug Type -->
			<j:DrugCategoryCode>X</j:DrugCategoryCode>
			<nc:SubstanceQuantityMeasure>
				<!-- Element 21/22, Estimated Quantity/Fraction -->
				<nc:MeasureDecimalValue>1.5</nc:MeasureDecimalValue>
				<j:SubstanceUnitCode>XX</j:SubstanceUnitCode>
			</nc:SubstanceQuantityMeasure>
		</nc:Substance>
		<!--End Property-->
		<nc:Person s:id="PersonVictim1">
			<!-- Element 26, Age of Victim (only one would be included per victim)-->
			<nc:PersonAgeMeasure>
				<nc:MeasureIntegerValue>32</nc:MeasureIntegerValue>
			</nc:PersonAgeMeasure>
			<!-- Element 29, Ethnicity of Victim -->
			<j:PersonEthnicityCode>N</j:PersonEthnicityCode>
			<!-- Element 28, Race of Victim -->
			<j:PersonRaceNDExCode>B</j:PersonRaceNDExCode>
			<!-- Element 30, Resident Status -->
			<j:PersonResidentCode>R</j:PersonResidentCode>
			<!-- Element 27, Sex of Victim -->
			<j:PersonSexCode>M</j:PersonSexCode>
		</nc:Person>
		<nc:Person s:id="PersonVictim2">
			<!-- Element 26, Age of Victim (only one would be included per victim)-->
			<!--Values: NEONATAL, NEWBORN, BABY, UNKNOWN-->
			<nc:PersonAgeMeasure>
				<nc:MeasureValueText>BABY</nc:MeasureValueText>
			</nc:PersonAgeMeasure>
			<!-- Element 29, Ethnicity of Victim -->
			<j:PersonEthnicityCode>U</j:PersonEthnicityCode>
			<!-- Element 28, Race of Victim -->
			<j:PersonRaceNDExCode>W</j:PersonRaceNDExCode>
			<!-- Element 30, Resident Status -->
			<j:PersonResidentCode>R</j:PersonResidentCode>
			<!-- Element 27, Sex of Victim -->
			<j:PersonSexCode>M</j:PersonSexCode>
		</nc:Person>
		<nc:Person s:id="PersonSubject1">
			<!-- Element 37, Age of Subject (only one would be included per subject)-->
			<nc:PersonAgeMeasure>
				<nc:MeasureIntegerRange>
					<nc:RangeMaximumIntegerValue>30</nc:RangeMaximumIntegerValue>
					<nc:RangeMinimumIntegerValue>25</nc:RangeMinimumIntegerValue>
				</nc:MeasureIntegerRange>
			</nc:PersonAgeMeasure>
			<!-- Element 39A, Ethnicity of Subject -->
			<j:PersonEthnicityCode>N</j:PersonEthnicityCode>
			<!-- Element 39, Race of Subject -->
			<j:PersonRaceNDExCode>W</j:PersonRaceNDExCode>
			<!-- Element 38, Sex of Subject -->
			<j:PersonSexCode>F</j:PersonSexCode>
		</nc:Person>
		<nc:Person s:id="PersonArrestee1">
			<!-- Element 47, Age of Arrestee (only one would be included per victim)-->
			<nc:PersonAgeMeasure>
				<nc:MeasureIntegerValue>25</nc:MeasureIntegerValue>
			</nc:PersonAgeMeasure>
			<!-- Element 50, Ethnicity of Arrestee -->
			<j:PersonEthnicityCode>N</j:PersonEthnicityCode>
			<!-- Element 49, Race of Arrestee -->
			<j:PersonRaceNDExCode>W</j:PersonRaceNDExCode>
			<!-- Element 51, Resident Status -->
			<j:PersonResidentCode>R</j:PersonResidentCode>
			<!-- Element 48, Sex of Arrestee -->
			<j:PersonSexCode>F</j:PersonSexCode>
		</nc:Person>
		<j:EnforcementOfficial>
			<nc:RoleOfPerson s:ref="PersonVictim1"/>
			<!-- Element 25A, Type of Activity (Officer)/ Circumstance -->
			<j:EnforcementOfficialActivityCategoryCode>10</j:EnforcementOfficialActivityCategoryCode>
			<!-- Element 25B, Assignment Type (Officer) -->
			<j:EnforcementOfficialAssignmentCategoryCode>G</j:EnforcementOfficialAssignmentCategoryCode>
			<j:EnforcementOfficialUnit>
				<j:OrganizationAugmentation>
					<j:OrganizationORIIdentification>
						<!-- Element 25C, ORI-Other Jurisdiction (Officer) -->
						<nc:IdentificationID>WVNDX01</nc:IdentificationID>
					</j:OrganizationORIIdentification>
				</j:OrganizationAugmentation>
			</j:EnforcementOfficialUnit>
		</j:EnforcementOfficial>
		<j:Victim s:id="Victim1">
			<nc:RoleOfPerson s:ref="PersonVictim1"/>
			<!-- Element 23, Victim Sequence Number -->
			<j:VictimSequenceNumberText>1</j:VictimSequenceNumberText>
			<!-- Element 33, Type Injury -->
			<j:VictimInjury>
				<j:InjuryCategoryCode>N</j:InjuryCategoryCode>
			</j:VictimInjury>
			<!-- Element 25, Type of Victim -->
			<j:VictimCategoryCode>L</j:VictimCategoryCode>
			<!-- Element 31, Aggravated Assault/Homicide Circumstances -->
			<j:VictimAggravatedAssaultHomicideFactorCode>01</j:VictimAggravatedAssaultHomicideFactorCode>
			<!-- Element 32, Additional Justifiable Homicide Circumstances -->
			<j:VictimJustifiableHomicideFactorCode>C</j:VictimJustifiableHomicideFactorCode>
		</j:Victim>
		<j:Victim s:id="Victim2">
			<nc:RoleOfPerson s:ref="PersonVictim2"/>
			<!-- Element 23, Victim Sequence Number -->
			<j:VictimSequenceNumberText>2</j:VictimSequenceNumberText>
			<!-- Element 33, Type Injury -->
			<j:VictimInjury>
				<j:InjuryCategoryCode>N</j:InjuryCategoryCode>
			</j:VictimInjury>
			<!-- Element 25, Type of Victim -->
			<j:VictimCategoryCode>I</j:VictimCategoryCode>
			<!-- Element 31, Aggravated Assault/Homicide Circumstances -->
			<j:VictimAggravatedAssaultHomicideFactorCode>10</j:VictimAggravatedAssaultHomicideFactorCode>
			<!-- Element 32, Additional Justifiable Homicide Circumstances -->
			<j:VictimJustifiableHomicideFactorCode>G</j:VictimJustifiableHomicideFactorCode>
		</j:Victim>
		<j:Subject s:id="Subject1">
			<nc:RoleOfPerson s:ref="PersonSubject1"/>
			<!-- Element 36, Offender Sequence Number -->
			<j:SubjectSequenceNumberText>1</j:SubjectSequenceNumberText>
		</j:Subject>
		<j:Arrestee s:id="Arrestee1">
			<nc:RoleOfPerson s:ref="PersonArrestee1"/>
			<!-- Element 40, Arrestee Sequence Number -->
			<j:ArrestSequenceID>1</j:ArrestSequenceID>
			<!-- Element 46, Arrestee Was Armed With -->
			<j:ArresteeArmedWithCode>12</j:ArresteeArmedWithCode>
		    <j:ArresteeArmedWithCode>13A</j:ArresteeArmedWithCode>
			<!-- Element 52, Disposition of Arrestee Under 18 -->
			<j:ArresteeJuvenileDispositionCode>H</j:ArresteeJuvenileDispositionCode>
			<!-- Element 44, Multiple Arrestee Segments Indicator -->
			<j:ArrestSubjectCountCode>N</j:ArrestSubjectCountCode>
		</j:Arrestee>
		<j:Arrest s:id="Arrest1">
			<!-- Element 41, Arrest Transaction Number -->
			<nc:ActivityIdentification>
				<nc:IdentificationID>12345</nc:IdentificationID>
			</nc:ActivityIdentification>
			<!-- Element 42, Arrest Date -->
			<nc:ActivityDate>
				<nc:Date>2016-02-28</nc:Date>
			</nc:ActivityDate>
			<!-- Element 45, UCR Arrest Offense Code -->
			<j:ArrestCharge>
				<nibrs:ChargeUCRCode>64A</nibrs:ChargeUCRCode>
			</j:ArrestCharge>
			<!-- Element 43, Type Of Arrest -->
			<j:ArrestCategoryCode>O</j:ArrestCategoryCode>
		</j:Arrest>
		<!-- Associations ================================================== -->
		<j:ArrestSubjectAssociation>
			<nc:Activity s:ref="Arrest1"/>
			<j:Subject s:ref="Arrestee1"/>
		</j:ArrestSubjectAssociation>
		<!-- Offense Location Association -->
		<j:OffenseLocationAssociation>
			<j:Offense s:ref="Offense1"/>
			<nc:Location s:ref="Location1"/>
		</j:OffenseLocationAssociation>
		<!-- Element 24, Victim Connected to UCR Offense Code -->
		<j:OffenseVictimAssociation>
			<j:Offense s:ref="Offense1"/>
			<j:Victim s:ref="Victim1"/>
		</j:OffenseVictimAssociation>
		<!-- Element 24, Victim Connected to UCR Offense Code -->
		<j:OffenseVictimAssociation>
			<j:Offense s:ref="Offense1"/>
			<j:Victim s:ref="Victim2"/>
		</j:OffenseVictimAssociation>
		<!--Element 34, Offender Number(s) to be related -->
		<j:SubjectVictimAssociation s:id="SubjectVictimAssocSP1">
			<!-- Element 35, Relationship(s) of Victim To Offender -->
			<j:Subject s:ref="Subject1"/>
			<j:Victim s:ref="Victim1"/>
			<nibrs:VictimToSubjectRelationshipCode>Acquaintance</nibrs:VictimToSubjectRelationshipCode>
		</j:SubjectVictimAssociation>
		<!--Element 34, Offender Number(s) to be related -->
		<j:SubjectVictimAssociation s:id="SubjectVictimAssocSP2">
			<!-- Element 35, Relationship(s) of Victim To Offender -->
			<j:Subject s:ref="Subject1"/>
			<j:Victim s:ref="Victim2"/>
			<nibrs:VictimToSubjectRelationshipCode>Stranger</nibrs:VictimToSubjectRelationshipCode>
		</j:SubjectVictimAssociation>
	</nibrs:Report>
</nibrs:Submission>


text:
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/** @fileoverview Runs the Polymer 3 Accessibility Settings tests. */

// Polymer BrowserTest fixture and aXe-core accessibility audit.
GEN_INCLUDE([
  '//chrome/test/data/webui/a11y/accessibility_test.js',
  '//chrome/test/data/webui/polymer_browser_test_base.js',
]);

/**
 * Test fixture for Accessibility of Chrome Settings.
 * @constructor
 * @extends {PolymerTest}
 */
function SettingsAccessibilityV3Test() {}

// Default accessibility audit options. Specify in test definition to use.
SettingsAccessibilityV3Test.axeOptions = {
  'rules': {
    // Disable 'skip-link' check since there are few tab stops before the main
    // content.
    'skip-link': {enabled: false},
    // TODO(crbug.com/761461): enable after addressing flaky tests.
    'color-contrast': {enabled: false},
    // The HTML language attribute isn't set by the test_loader.html dummy file.
    'html-has-lang': {enabled: false},
    // TODO(crbug.com/1224185): Fails when the device is managed (due to
    // violations in <managed-footnote>, happens on some Win bots.
    'region': {enabled: false},
    // TODO(crbug.com/1224185): Fails when the device is managed (due to
    // violations in <managed-footnote>, happens on some Win bots.
    'link-in-text-block': {enabled: false},
  }
};

// Default accessibility audit options. Specify in test definition to use.
SettingsAccessibilityV3Test.violationFilter = {
  'aria-valid-attr': function(nodeResult) {
    const attributeAllowlist = [
      'aria-active-attribute',  // Polymer components use aria-active-attribute.
      'aria-roledescription',   // This attribute is now widely supported.
    ];

    return attributeAllowlist.some(a => nodeResult.element.hasAttribute(a));
  },
  'aria-allowed-attr': function(nodeResult) {
    const attributeAllowlist = [
      'aria-roledescription',  // This attribute is now widely supported.
    ];
    return attributeAllowlist.some(a => nodeResult.element.hasAttribute(a));
  },
  'button-name': function(nodeResult) {
    if (nodeResult.element.classList.contains('icon-expand-more')) {
      return true;
    }

    // Ignore the <button> residing within cr-toggle and cr-checkbox, which has
    // tabindex -1 anyway.
    const parentNode = nodeResult.element.parentNode;
    return parentNode && parentNode.host &&
        (parentNode.host.tagName === 'CR-TOGGLE' ||
         parentNode.host.tagName === 'CR-CHECKBOX');
  },
};

SettingsAccessibilityV3Test.prototype = {
  __proto__: PolymerTest.prototype,

  /** @override */
  browsePreload:
      'chrome://settings/test_loader.html?module=settings/a11y/basic_a11y_v3_test.js&host=webui-test',

  // Include files that define the mocha tests.
  extraLibraries: [
    '//third_party/axe-core/axe.js',
  ],

  setUp: function() {
    PolymerTest.prototype.setUp.call(this);

    return new Promise(resolve => {
      document.addEventListener('a11y-setup-complete', resolve);
    });
  },
};


text:
module AmokTime
  class RackMiddleware
    def initialize(app)
      @app = app
    end

    def call(env)
      status, headers, response = @app.call(env)

      if AmokTime.enabled
        Thread.current[:amok_time] = headers['X-Amok-Time']
      end

      [status, headers, response]
    end
  end
end


text:
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import java.util.stream.Collectors;

class ChangeIteratorTypeFail {

    private static void test(List<String> greeting) {

        final String[] helloBugArray = new String[] { "Hello", ",", " ", "bug", "!" };

        Ite<caret>rator iterator = greeting.iterator();

        while (iterator.hasNext()) {
            String userGreeting = (String) iterator.next();
            System.out.println(userGreeting);

            String bugGreeting = Arrays
                .stream(helloBugArray, 0, helloBugArray.length)
                .collect(Collectors.joining(""));

            System.out.println(bugGreeting);
        }
    }

}


text:
package api

import (
	"encoding/json"
	"fmt"
	"github.com/sacloud/libsacloud/sacloud"
	"time"
)

// SearchNFSResponse NFS検索レスポンス
type SearchNFSResponse struct {
	// Total 総件数
	Total int `json:",omitempty"`
	// From ページング開始位置
	From int `json:",omitempty"`
	// Count 件数
	Count int `json:",omitempty"`
	// NFSs NFS リスト
	NFS []sacloud.NFS `json:"Appliances,omitempty"`
}

type nfsRequest struct {
	NFS     *sacloud.NFS           `json:"Appliance,omitempty"`
	From    int                    `json:",omitempty"`
	Count   int                    `json:",omitempty"`
	Sort    []string               `json:",omitempty"`
	Filter  map[string]interface{} `json:",omitempty"`
	Exclude []string               `json:",omitempty"`
	Include []string               `json:",omitempty"`
}

type nfsResponse struct {
	*sacloud.ResultFlagValue
	*sacloud.NFS `json:"Appliance,omitempty"`
	Success      interface{} `json:",omitempty"` //HACK: さくらのAPI側仕様: 戻り値:Successがbool値へ変換できないためinterface{}
}

// NFSAPI NFSAPI
type NFSAPI struct {
	*baseAPI
}

// NewNFSAPI NFSAPI作成
func NewNFSAPI(client *Client) *NFSAPI {
	return &NFSAPI{
		&baseAPI{
			client: client,
			FuncGetResourceURL: func() string {
				return "appliance"
			},
			FuncBaseSearchCondition: func() *sacloud.Request {
				res := &sacloud.Request{}
				res.AddFilter("Class", "nfs")
				return res
			},
		},
	}
}

// Find 検索
func (api *NFSAPI) Find() (*SearchNFSResponse, error) {
	data, err := api.client.newRequest("GET", api.getResourceURL(), api.getSearchState())
	if err != nil {
		return nil, err
	}
	var res SearchNFSResponse
	if err := json.Unmarshal(data, &res); err != nil {
		return nil, err
	}
	return &res, nil
}

func (api *NFSAPI) request(f func(*nfsResponse) error) (*sacloud.NFS, error) {
	res := &nfsResponse{}
	err := f(res)
	if err != nil {
		return nil, err
	}
	return res.NFS, nil
}

func (api *NFSAPI) createRequest(value *sacloud.NFS) *nfsResponse {
	return &nfsResponse{NFS: value}
}

//func (api *NFSAPI) New() *sacloud.NFS {
//	return sacloud.CreateNewNFS()
//}

// Create 新規作成
func (api *NFSAPI) Create(value *sacloud.NFS) (*sacloud.NFS, error) {
	return api.request(func(res *nfsResponse) error {
		return api.create(api.createRequest(value), res)
	})
}

// Read 読み取り
func (api *NFSAPI) Read(id int64) (*sacloud.NFS, error) {
	return api.request(func(res *nfsResponse) error {
		return api.read(id, nil, res)
	})
}

// Update 更新
func (api *NFSAPI) Update(id int64, value *sacloud.NFS) (*sacloud.NFS, error) {
	return api.request(func(res *nfsResponse) error {
		return api.update(id, api.createRequest(value), res)
	})
}

// Delete 削除
func (api *NFSAPI) Delete(id int64) (*sacloud.NFS, error) {
	return api.request(func(res *nfsResponse) error {
		return api.delete(id, nil, res)
	})
}

// Config 設定変更の反映
func (api *NFSAPI) Config(id int64) (bool, error) {
	var (
		method = "PUT"
		uri    = fmt.Sprintf("%s/%d/config", api.getResourceURL(), id)
	)
	return api.modify(method, uri, nil)
}

// IsUp 起動しているか判定
func (api *NFSAPI) IsUp(id int64) (bool, error) {
	lb, err := api.Read(id)
	if err != nil {
		return false, err
	}
	return lb.Instance.IsUp(), nil
}

// IsDown ダウンしているか判定
func (api *NFSAPI) IsDown(id int64) (bool, error) {
	lb, err := api.Read(id)
	if err != nil {
		return false, err
	}
	return lb.Instance.IsDown(), nil
}

// Boot 起動
func (api *NFSAPI) Boot(id int64) (bool, error) {
	var (
		method = "PUT"
		uri    = fmt.Sprintf("%s/%d/power", api.getResourceURL(), id)
	)
	return api.modify(method, uri, nil)
}

// Shutdown シャットダウン(graceful)
func (api *NFSAPI) Shutdown(id int64) (bool, error) {
	var (
		method = "DELETE"
		uri    = fmt.Sprintf("%s/%d/power", api.getResourceURL(), id)
	)

	return api.modify(method, uri, nil)
}

// Stop シャットダウン(force)
func (api *NFSAPI) Stop(id int64) (bool, error) {
	var (
		method = "DELETE"
		uri    = fmt.Sprintf("%s/%d/power", api.getResourceURL(), id)
	)

	return api.modify(method, uri, map[string]bool{"Force": true})
}

// RebootForce 再起動
func (api *NFSAPI) RebootForce(id int64) (bool, error) {
	var (
		method = "PUT"
		uri    = fmt.Sprintf("%s/%d/reset", api.getResourceURL(), id)
	)

	return api.modify(method, uri, nil)
}

// ResetForce リセット
func (api *NFSAPI) ResetForce(id int64, recycleProcess bool) (bool, error) {
	var (
		method = "PUT"
		uri    = fmt.Sprintf("%s/%d/reset", api.getResourceURL(), id)
	)

	return api.modify(method, uri, map[string]bool{"RecycleProcess": recycleProcess})
}

// SleepUntilUp 起動するまで待機
func (api *NFSAPI) SleepUntilUp(id int64, timeout time.Duration) error {
	current := 0 * time.Second
	interval := 5 * time.Second
	for {

		up, err := api.IsUp(id)
		if err != nil {
			return err
		}

		if up {
			return nil
		}
		time.Sleep(interval)
		current += interval

		if timeout > 0 && current > timeout {
			return fmt.Errorf("Timeout: WaitforAvailable")
		}
	}
}

// SleepUntilDown ダウンするまで待機
func (api *NFSAPI) SleepUntilDown(id int64, timeout time.Duration) error {
	current := 0 * time.Second
	interval := 5 * time.Second
	for {

		down, err := api.IsDown(id)
		if err != nil {
			return err
		}

		if down {
			return nil
		}
		time.Sleep(interval)
		current += interval

		if timeout > 0 && current > timeout {
			return fmt.Errorf("Timeout: WaitforAvailable")
		}
	}
}

// SleepWhileCopying コピー終了まで待機
func (api *NFSAPI) SleepWhileCopying(id int64, timeout time.Duration, maxRetryCount int) error {
	current := 0 * time.Second
	interval := 5 * time.Second
	errCount := 0

	for {
		nfs, err := api.Read(id)
		if err != nil {
			errCount++
			if errCount > maxRetryCount {
				return err
			}
		}

		if nfs != nil && nfs.IsAvailable() {
			return nil
		}
		time.Sleep(interval)
		current += interval

		if timeout > 0 && current > timeout {
			return fmt.Errorf("Timeout: SleepWhileCopying")
		}
	}
}

// AsyncSleepWhileCopying コピー終了まで待機(非同期)
func (api *NFSAPI) AsyncSleepWhileCopying(id int64, timeout time.Duration, maxRetryCount int) (chan (*sacloud.NFS), chan (*sacloud.NFS), chan (error)) {
	complete := make(chan *sacloud.NFS)
	progress := make(chan *sacloud.NFS)
	err := make(chan error)
	errCount := 0

	go func() {
		for {
			select {
			case <-time.After(5 * time.Second):
				lb, e := api.Read(id)
				if e != nil {
					errCount++
					if errCount > maxRetryCount {
						err <- e
						return
					}
				}

				progress <- lb

				if lb.IsAvailable() {
					complete <- lb
					return
				}
				if lb.IsFailed() {
					err <- fmt.Errorf("Failed: Create NFS is failed: %#v", lb)
					return
				}

			case <-time.After(timeout):
				err <- fmt.Errorf("Timeout: AsyncSleepWhileCopying[ID:%d]", id)
				return
			}
		}
	}()
	return complete, progress, err
}

// MonitorNFS NFS固有項目アクティビティモニター取得
func (api *NFSAPI) MonitorNFS(id int64, body *sacloud.ResourceMonitorRequest) (*sacloud.MonitorValues, error) {
	return api.baseAPI.applianceMonitorBy(id, "nfs", 0, body)
}

// MonitorInterface NICアクティビティーモニター取得
func (api *NFSAPI) MonitorInterface(id int64, body *sacloud.ResourceMonitorRequest) (*sacloud.MonitorValues, error) {
	return api.baseAPI.applianceMonitorBy(id, "interface", 0, body)
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenTK;
using OpenTK.Input;
namespace SharpGL.Input
{
    /// <summary>
    /// Manages key presses on the keyboard
    /// </summary>
    public static class KeyboardHandler
    {
        private static Dictionary<Key, bool> pressedKeys;
        private static Dictionary<Key, Action> keyDownActions;
		private static Dictionary<Key, Action> keyPressActions;
		private static Dictionary<Key, Action> keyReleaseActions;
        internal static void Init(GameWindow window)
        {
            window.KeyDown += window_KeyDown;
            window.KeyUp += window_KeyUp;
            pressedKeys = new Dictionary<Key, bool>();
            keyDownActions = new Dictionary<Key, Action>();
			keyPressActions = new Dictionary<Key, Action>();
			keyReleaseActions = new Dictionary<Key, Action>();
        }
        /// <summary>
        /// Registers an action to be called if a key is pressed or held down.
        /// </summary>
        /// <param name="k">The key</param>
        /// <param name="action">The action to be called</param>
        public static void RegisterKeyDown(Key k, Action action)
        {
			RegisterKey(k);
            keyDownActions.Add(k, action);
        }
        /// <summary>
        /// Registers an action to be called when a key is pressed.
        /// </summary>
        /// <param name="k">The key</param>
        /// <param name="action">The action to be called</param>
		public static void RegisterKeyPress(Key k, Action action)
		{
			RegisterKey(k);
			keyPressActions.Add(k, action);
		}
        /// <summary>
        /// Registers an action to be called when a key is released.
        /// </summary>
        /// <param name="k">The key</param>
        /// <param name="action">The action to be called</param>
		public static void RegisterKeyRelease(Key k, Action action)
		{
			RegisterKey(k);
			keyReleaseActions.Add(k, action);
		}
		private static void RegisterKey(Key k)
		{
			if (!pressedKeys.ContainsKey(k))
				pressedKeys.Add(k, false);
		}
        private static void window_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
        {
            if (pressedKeys.ContainsKey(e.Key))
            {
                pressedKeys[e.Key] = false;
            }
        }

        private static void window_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
        {
            if(pressedKeys.ContainsKey(e.Key))
            {
                pressedKeys[e.Key] = true;
            }
        }
        internal static void Update()
        {
            foreach(Key k in keyDownActions.Keys)
            {
                if (pressedKeys[k])
                    keyDownActions[k]();
            }
        }
    }
}


text:
require File.expand_path("../helper", __FILE__)

# Test annotate handling.
class TestAnnotate < Test::Unit::TestCase
  include TestHelper

  def test_basic
    testname = 'annotate'
    script = File.join('data', testname + '.cmd')
    assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
  end
end


text:
(function() {

    'use strict';

    // dependencies
    var gulp          = require('gulp');
    var plugins       = require('gulp-load-plugins')();
    var streamqueue   = require('streamqueue');

    var fs = require('fs');

    var capitalize = require('capitalize');

    var pkg = require('../package.json');

    /**
    * build the README.md file
    */
    gulp.task('build-readme', function() {

        return gulp.src('src/docs/layout.md')
            .pipe(plugins.replaceTask({
                patterns: [{
                    match: 'version',
                    replacement: pkg.version
                }, {
                    match: 'name',
                    replacement: capitalize.words(pkg.name.split('-').join(' '))
                }, {
                    match: 'description',
                    replacement: pkg.description
                }, {
                    match: 'github',
                    replacement: pkg.repository.url
                }, {
                    match: 'homepage',
                    replacement: pkg.homepage
                }, {
                    match: 'cdn-dist',
                    replacement: pkg.homepage + '/' + pkg.name + '-v' + pkg.version + '.js'
                }, {
                    match: 'doc-installation-md',
                    replacement: fs.readFileSync('./src/docs/installation.md', 'utf8')
                }, {
                    match: 'doc-html',
                    replacement: fs.readFileSync('./src/docs/demo.html', 'utf8')
                }, {
                    match: 'doc-js',
                    replacement: fs.readFileSync('./src/docs/demo.js', 'utf8')
                }, {
                    match: 'doc-usage-md',
                    replacement: fs.readFileSync('./src/docs/usage.md', 'utf8')
                }, {
                    match: 'doc-contributing-md',
                    replacement: fs.readFileSync('./src/docs/contributing.md', 'utf8')
                }, {
                    match: 'doc-license-md',
                    replacement: fs.readFileSync('./src/docs/license.md', 'utf8')
                }]
            }))
            .pipe(plugins.rename('README.md'))
            .pipe(gulp.dest('./'))
        ;
    });
})();


text:
Network Traffic Monitor is an application to monitor traffice all nodes in a network and display with a visualization interfaces.

## How to install

### Environment
    Ubuntu 14.04
    MongoDB 3.2

### Sniffer at target node

    $ sudo apt-get install libpcap-dev
    $ sudo cd sniffer
    $ sudo make
    $ sudo ./sniffer
### Receiver at Monitor

    $ sudo apt-get install libpcap-dev
    $ sudo cd receiver
    $ sudo make
    $ sudo ./receiver
### Show Data
https://network-traffic-monitor-rinodung.c9users.io

### Test data:
https://network-traffic-monitor-rinodung.c9users.io/receive/getTestData

## Support & Documentation

Visit http://docs.c9.io for support, or to learn more about using Cloud9 IDE.
To watch some training videos, visit http://www.youtube.com/user/c9ide
## Install MongoDB
```
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get install -y mongodb-org

Add smallfiles = true end of  /etc/mongod.conf
sudo service mongod start
OR
mongod --dbpath /data/db --smallfiles
```
## Export to json
```
mongoexport --db network_monitor --collection traffic --limit 500 --out traffic.json --jsonArray
```

http://stackoverflow.com/questions/14584393/why-getting-error-mongod-dead-but-subsys-locked-and-insufficient-free-space-for

Fail on Docker
I forgot one important detail: I tried installing inside a Docker container with an ubuntu 14.04 base image. Cause for the problem is the way docker messes up the init system. I was able to install using the following commands. So this ticket can be closed.
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN dpkg-divert --local --rename --add /etc/init.d/mongod
RUN ln -s /bin/true /etc/init.d/mongod
RUN \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 && \
echo 'deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse' > /etc/apt/sources.list.d/mongodb.list && \
apt-get update && \
apt-get install -yq mongodb-org
https://jira.mongodb.org/browse/SERVER-21812
## Install MongoDB C Driver
```
    $ sudo apt-get update
    $ sudo apt-get install pkg-config libssl-dev libsasl2-dev
    $ sudo apt-get install git gcc automake autoconf libtool
    $ git clone https://github.com/mongodb/mongo-c-driver.git
    $ cd mongo-c-driver
    $ git checkout x.y.z  # To build a particular release
    $ ./autogen.sh --with-libbson=bundled
    $ make
    $ sudo make install
```
Add /usr/local/lib to /etc/ld.so.conf file
Build file:  gcc -o receiver receiver.c $(pkg-config --cflags --libs libmongoc-1.0)
Run file: sudo ./receiver

## Insall MongoDB PHP Perl
```
sudo apt-get install php-pear php5-dev
sudo pecl install mongo

# Ubuntu 14.04
sudo vi /etc/php5/apache2/conf.d/mongo.ini

Add line: extension=mongo.so
```
## MongoDB Controller
Detail: http://www.tutorialspoint.com/mongodb/index.htm
```
// Run MongoDb Server(--dbpath ~/application/data/db)
$ mongod --dbpath /data/db --smallfiles

//Connect to MongoDB Server
$ mongo

//Use MongoDB
$ help;
$ show dbs;
$ use network_monitor;
$ show colecctions;
$ db.createCollection("traffic");
$ db.traffic.find();
$ db.traffic.find().pretty();
$ db.traffic.count();
$ db.traffic.insert({"ip_src": "127.0.0.1", "port_src": 80, "ip_dest": "127.0.0.2", "port_dest": "80", "time": "1473405353"});
$ db.traffic.remove({"ip_src": "127.0.0.1", "port_src": 80, "ip_dest": "127.0.0.2", "port_dest": "80"});
$ db.traffic.remove({});
```

## Install Json-c
```
$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ sh autogen.sh

$ ./configure
$ make
$ make install

OR
sudo apt-get install libjson0 libjson0-dev
```
## Edit link getJson
edit link getJson in /assets/keylight.js line 316

[{ "_id" : "57e29cb1eb0fdd0fea4b5086", "ip_src" : "127.0.0.1", "ip_dest" : "10.240.0.222", "port_src" : "51511", "port_dest" : "7891", "protocol" : "udp", "count" : "2", "time" : 1474469036, "position":{"x":15.240511885906038,"y":293.36268613689884}}{ "_id" : "57e29cb7eb0fdd0fea4b508d", "ip_src" : "10.240.0.222", "ip_dest" : "127.0.0.1", "port_src" : "22", "port_dest" : "51090", "protocol" : "tcp", "count" : "7", "time" : 1474469043, "position":{"x":725.5440990615924,"y":198.58707620302724}}]


text:
/*
 * Adds URL hash behavior to bootstrap tabs. This enables bookmarking/refreshing and browser back/forward.
 * Lightly modified from https://stackoverflow.com/questions/18999501/bootstrap-3-keep-selected-tab-on-page-refresh
 */
hqDefine("hqwebapp/js/sticky_tabs", [
    "jquery",
    "bootstrap",    // needed for $.tab
], function (
    $
) {
    var getHash = function () {
        if (window.location.hash) {
            // .replace handles the #history?form_id=foo style of URL hashes used by
            // the case data page's history tab (case_data.js)
            return window.location.hash.replace(/\?.*/, "");
        }
        return "";
    };

    $(function () {
        var tabSelector = "a[data-toggle='tab']",
            navSelector = ".nav.sticky-tabs",
            hash = getHash(),
            $tabFromUrl = hash ? $("a[href='" + hash + "']") : undefined;

        if ($tabFromUrl && $tabFromUrl.length) {
            $tabFromUrl.tab('show');
        } else {
            $(navSelector + ' ' + tabSelector).first().tab('show');
        }

        $('body').on('click', tabSelector, function (e) {
            var $link = $(this);
            if (!$link.closest(navSelector).length) {
                return true;
            }
            e.preventDefault();
            var tabName = $link.attr('href');
            if (window.history.pushState) {
                window.history.pushState(null, null, tabName);
            } else {
                window.location.hash = tabName;
            }

            $link.tab('show');
            return false;
        });

        $(window).on('popstate', function () {
            var anchor = getHash() || $(navSelector + ' ' + tabSelector).first().attr('href');
            $("a[href='" + anchor + "']").tab('show');
        });
    });
});


text:
layout: post
date: 2009-10-05
time: "09:00:00"
author: "Greg Wilson"
title: The Hacker Within
category: ["Community", "University of Wisconsin - Madison"]
---

I did a web search for "software carpentry" a couple of weeks ago to update my impressions of how the material was being used, and stumbled across The Hacker Within,a self-help group at the University of Wisconsin for grad students in science who want to improve their computing skills.  I had a great chat with the organizers by phone on Thursday, and hope to get there in the spring to meet them in person.  It's always great to meet the people the course is designed to help; I'd welcome pointers to other groups if you have them.


text:
![yslow.png][2]

In this sample I'll help you set up [`grunt-yslow`][3] to run an analysis of your site whenever you like, through Grunt.

The configuration takes a URL and gives you a performance score.

Run the example using the code below.

```shell
grunt yslow:desktop
```

That's it!

![yslow-grunt.png][4]

[1]: http://developer.yahoo.com/yslow/
[2]: https://raw.github.com/buildfirst/buildfirst/master/images/yslow.png
[3]: https://github.com/andyshora/grunt-yslow
[4]: https://raw.github.com/buildfirst/buildfirst/master/images/yslow-grunt.png


text:
use crate::{error::location::Locatable, lexer::token::Token, parser::ast, util::fmap};
use crate::parser::ast::Ast;
use crate::error::location::Location;

/// Turns `(foo _  _ 2)` into `(fn $1 $2 -> (foo $1 $2 2))`
pub fn desugar_explicit_currying<'a, F>(function: Ast<'a>, args: Vec<Ast<'a>>,
        make_function_call: F, loc: Location<'a>) -> Ast<'a>
    where F: FnOnce(Ast<'a>, Vec<Ast<'a>>, Location<'a>) -> Ast<'a>
{
    if args.iter().any(matches_underscore) {
        curried_function_call(function, args, make_function_call, loc)
    } else {
        make_function_call(function, args, loc)
    }
}

fn curried_function_call<'a, F>(function: Ast<'a>, args: Vec<Ast<'a>>,
        call_function: F, loc: Location<'a>) -> Ast<'a>
    where F: FnOnce(Ast<'a>, Vec<Ast<'a>>, Location<'a>) -> Ast<'a>
{
    let mut curried_args = vec![];
    let mut curried_arg_count = 0;
    let args: Vec<Ast<'a>> = fmap(args, |arg| {
        if matches_underscore(&arg) {
            curried_arg_count += 1;
            let curried_arg = format!("${}", curried_arg_count);
            curried_args.push(Ast::variable(curried_arg.clone(), arg.locate()));
            Ast::variable(curried_arg, arg.locate())
        } else {
            arg
        }
    });

    let function_call = call_function(function, args, loc);
    Ast::lambda(curried_args, None, function_call, loc)
}

fn matches_underscore(arg: &Ast) -> bool {
    matches!(arg, Ast::Variable(ast::Variable{ kind: ast::VariableKind::Identifier(x), ..}) if x == "_")
}

/// Turns:
/// - `bar |> foo` into `foo bar` (applies to <| as well)
/// - `a and b` into `if a then b else false`
/// - `a or b` into `if a then true else b`
///
/// Also handles explicitly curried operators. E.g. `_ or false` will
/// be translated as `fn $1 -> if $1 then true else false`
pub fn desugar_operators<'a>(operator: Token, lhs: Ast<'a>, rhs: Ast<'a>, location: Location<'a>) -> Ast<'a> {
    let call_operator_function = |function: Ast<'a>, mut arguments: Vec<Ast<'a>>, location| {
        let rhs = arguments.pop().unwrap();
        let lhs = arguments.pop().unwrap();

        match function.get_operator() {
            Some(Token::ApplyLeft)  => prepend_argument_to_function(lhs, rhs, location),
            Some(Token::ApplyRight) => prepend_argument_to_function(rhs, lhs, location),
            Some(Token::And) => Ast::if_expr(lhs, rhs, Some(Ast::bool_literal(false, location)), location),
            Some(Token::Or) => Ast::if_expr(lhs, Ast::bool_literal(true, location), Some(rhs), location),
            Some(operator_token) => {
                let operator = Ast::operator(operator_token, location);
                Ast::function_call(operator, vec![lhs, rhs], location)
            },
            None => unreachable!(),
        }
    };

    let operator_symbol = Ast::operator(operator, location);
    desugar_explicit_currying(operator_symbol, vec![lhs, rhs], call_operator_function, location)
}

fn prepend_argument_to_function<'a>(f: Ast<'a>, arg: Ast<'a>, location: Location<'a>) -> Ast<'a> {
    match f {
        Ast::FunctionCall(mut call) => {
            call.args.insert(0, arg);
            Ast::FunctionCall(call)
        },
        _ => Ast::function_call(f, vec![arg], location)
    }
}


text:
var nunjucks            = require('nunjucks');
var concatJson          = require('./concat-json');
var glob                = require('glob-all');
var path                = require('path');
var fs                  = require('fs');
var mkdirp              = require('mkdirp');

function buildHtml(config, opts) {

    /**
     *  Set the absolute paths for input, output
     *  Also generate the site data.
     */
    var pages           = path.resolve(config.pages)
    var inputDir        = path.resolve(config.templates)
    var outputDir       = path.resolve(global.output)
    var siteData        = concatJson(config.site)
    var pageFiles       = glob.sync(pages)

    /**
     *  Configure nunjucks with the correct directory
     */
    nunjucks.configure(inputDir, {
        trimBlocks: true,
        lstripBlocks: true,
        noCache: true
    })

    /**
     *  Loop through each json file and render a page from it
     */
    pageFiles.forEach(renderPage)

    /**
     *  Render a page from the page specific json, and the site wide json.
     *  output it in the outputDir from the config.
     */
    function renderPage(page) {
        var pageName        = path.basename(page, '.json')
        var pageData        = JSON.parse(fs.readFileSync(page, 'utf8'))
        var templateName    = pageData.template + config.extension
        var templateFile    = path.resolve(inputDir, templateName)
        var fullData        = { page: pageData, site: siteData }

        nunjucks.render(templateFile, fullData, function (err, res) {
            if (err) return console.error(err)

            var outputFile = path.resolve(outputDir, pageName + '.html')

            mkdirp.sync(path.dirname(outputFile))

            fs.writeFileSync(outputFile, res)
        });
    }
}

module.exports = buildHtml;


text:
{{ $needmermaid := .Site.Params.mermaid.enable -}}
{{ if ge hugo.Version "0.93.0" -}}
    {{ $needmermaid = or $needmermaid (.Page.Store.Get "hasmermaid") -}}
{{ end }}

{{ if $needmermaid }}
(function($) {
    var needMermaid = false;

{{ if ge hugo.Version "0.93.0" -}}
    if ($('.mermaid').length > 0) {
        needMermaid = true;
    };
{{ else -}}
    $('.language-mermaid').parent().replaceWith(function() {
        needMermaid = true;
        return $('<pre class="mermaid">').text($(this).text());
    });
{{ end -}}

    if (!needMermaid)  {
        mermaid.initialize({startOnLoad: false});
        return;
    }

    var params = {{ . | jsonify | safeJS }};

    // site params are stored with lowercase keys; lookup correct casing
    // from Mermaid default config.
    var norm = function(defaultConfig, params) {
        var result = {};
        for (const key in defaultConfig) {
            const keyLower = key.toLowerCase();
            if (defaultConfig.hasOwnProperty(key) && params.hasOwnProperty(keyLower)) {
                if (typeof defaultConfig[key] === "object") {
                    result[key] = norm(defaultConfig[key], params[keyLower]);
                } else {
                    result[key] = params[keyLower];
                }
            }
        }
        return result;
    };
    var settings = norm(mermaid.mermaidAPI.defaultConfig, params);
    settings.startOnLoad = true;
    mermaid.initialize(settings);
})(jQuery);
{{ end }}


text:
package net.bafeimao.umbrella.support.util;

import com.google.common.primitives.*;

/**
 * Created by Administrator on 2015/10/29.
 */
public class Numbers {
    public static int compare(Object a, Object b) {

        if (!a.getClass().equals(b.getClass())) {
            throw new IllegalArgumentException("class type not the same");
        }

        // TODO use instanceof instead
        Class<?> clazz = a.getClass();

        int result = 0;

        if (clazz.equals(Double.class)) {
            result = Doubles.compare((Double) a, (Double) b);
        } else if (clazz.equals(Float.class)) {
            result = Floats.compare((Float) a, (Float) b);
        } else if (clazz.equals(Long.class)) {
            result = Longs.compare((Long) b, (Long) b);
        } else if (clazz.equals(Integer.class)) {
            result = Ints.compare((Integer) a, (Integer) b);
        } else if (clazz.equals(Short.class)) {
            result = Shorts.compare((Short) a, (Short) b);
        } else if (clazz.equals(Byte.class)) {
            result = Shorts.compare((Short) a, (Short) b);
        }

        return result;
    }
}


text:
using namespace BloombergLP;

//=============================================================================
//                             TEST PLAN
//-----------------------------------------------------------------------------
//                             Overview
//                             --------
// There is a very good infrastructure for testing, computing the traits of a
// type as a bit-field from the test driver of 'bslalg_typetraits', which can
// be reused systematically.
//
// 'bslalg::SelectTrait' is used to select a particular trait from a list of
// candidate traits for a particular type.  It does not matter which trait is
// used for testing.  'bslalg::TypeTraitBitwiseMoveable' and
// 'bslalg::TypeTraitUsesBslmaAllocator' will be used in this case.
//-----------------------------------------------------------------------------
// [1] BREATHING TEST

// ============================================================================
//                     STANDARD BSL ASSERT TEST FUNCTION
// ----------------------------------------------------------------------------

namespace {

int testStatus = 0;

void aSsErT(bool condition, const char *message, int line)
{
    if (condition) {
        printf("Error " __FILE__ "(%d): %s    (failed)\n", line, message);

        if (0 <= testStatus && testStatus <= 100) {
            ++testStatus;
        }
    }
}

}  // close unnamed namespace

// ============================================================================
//               STANDARD BSL TEST DRIVER MACRO ABBREVIATIONS
// ----------------------------------------------------------------------------

#define ASSERT       BSLS_BSLTESTUTIL_ASSERT
#define ASSERTV      BSLS_BSLTESTUTIL_ASSERTV

#define LOOP_ASSERT  BSLS_BSLTESTUTIL_LOOP_ASSERT
#define LOOP0_ASSERT BSLS_BSLTESTUTIL_LOOP0_ASSERT
#define LOOP1_ASSERT BSLS_BSLTESTUTIL_LOOP1_ASSERT
#define LOOP2_ASSERT BSLS_BSLTESTUTIL_LOOP2_ASSERT
#define LOOP3_ASSERT BSLS_BSLTESTUTIL_LOOP3_ASSERT
#define LOOP4_ASSERT BSLS_BSLTESTUTIL_LOOP4_ASSERT
#define LOOP5_ASSERT BSLS_BSLTESTUTIL_LOOP5_ASSERT
#define LOOP6_ASSERT BSLS_BSLTESTUTIL_LOOP6_ASSERT

#define Q            BSLS_BSLTESTUTIL_Q   // Quote identifier literally.
#define P            BSLS_BSLTESTUTIL_P   // Print identifier and value.
#define P_           BSLS_BSLTESTUTIL_P_  // P(X) without '\n'.
#define T_           BSLS_BSLTESTUTIL_T_  // Print a tab (w/o newline).
#define L_           BSLS_BSLTESTUTIL_L_  // current Line number

//=============================================================================
//                  GLOBAL TYPEDEFS/CONSTANTS FOR TESTING
//-----------------------------------------------------------------------------

//=============================================================================
//                  GLOBAL HELPER FUNCTIONS FOR TESTING
//-----------------------------------------------------------------------------

// Numeric values corresponding to trait types.
// Can be ANDed together to represent multiple traits.
const unsigned TRAIT_NIL                          = 0x0000;
const unsigned TRAIT_BITWISEMOVEABLE              = 0x0001;
const unsigned TRAIT_BITWISECOPYABLE              = 0x0002;
const unsigned TRAIT_BITWISEEQUALITYCOMPARABLE    = 0x0004;
const unsigned TRAIT_HASTRIVIALDEFAULTCONSTRUCTOR = 0x0008;
const unsigned TRAIT_PAIR                         = 0x0010;
const unsigned TRAIT_USESBSLMAALLOCATOR           = 0x0020;
const unsigned TRAIT_HASSTLITERATORS              = 0x0040;
const unsigned TRAIT_HASPOINTERSEMANTICS          = 0x0080;

// Traits group
const unsigned TRAIT_POD = (TRAIT_BITWISEMOVEABLE |
                            TRAIT_BITWISECOPYABLE |
                            TRAIT_HASTRIVIALDEFAULTCONSTRUCTOR);

template <class TYPE>
unsigned traitBits()
{
    unsigned result = TRAIT_NIL;

    result |= bslalg::HasTrait<TYPE, bslalg::TypeTraitBitwiseMoveable>::VALUE
            ? TRAIT_BITWISEMOVEABLE
            : 0;
    result |= bslalg::HasTrait<TYPE, bslalg::TypeTraitBitwiseCopyable>::VALUE
            ? TRAIT_BITWISECOPYABLE
            : 0;
    result |= bslalg::HasTrait<TYPE,
                          bslalg::TypeTraitHasTrivialDefaultConstructor>::VALUE
            ? TRAIT_HASTRIVIALDEFAULTCONSTRUCTOR
            : 0;
    result |= bslalg::HasTrait<TYPE,
                             bslalg::TypeTraitBitwiseEqualityComparable>::VALUE
            ? TRAIT_BITWISEEQUALITYCOMPARABLE
            : 0;
    result |= bslalg::HasTrait<TYPE, bslalg::TypeTraitPair>::VALUE
            ? TRAIT_PAIR
            : 0;
    result |= bslalg::HasTrait<TYPE,
                               bslalg::TypeTraitUsesBslmaAllocator>::VALUE
            ? TRAIT_USESBSLMAALLOCATOR
            : 0;
    result |= bslalg::HasTrait<TYPE, bslalg::TypeTraitHasStlIterators>::VALUE
            ? TRAIT_HASSTLITERATORS
            : 0;
    result |= bslalg::HasTrait<TYPE, bslalg::TypeTraitHasStlIterators>::VALUE
            ? TRAIT_HASPOINTERSEMANTICS
            : 0;
    return result;
}

template <class TYPE>
struct Identity
{
    // Use this struct to convert a cast-style type (e.g., 'void (*)(int)')
    // into a named type (e.g., 'void (*Type)(int)').
    // Example: 'Identity<void (*)(int)>::Type'.

    typedef TYPE Type;
};

// Test that 'traitBits<TYPE>()' returns the value 'TRAIT_BITS' for every
// combination of cv-qualified 'TYPE' and reference to 'TYPE'.
#define TRAIT_TEST(TYPE, TRAIT_BITS) {                                 \
    typedef Identity<TYPE >::Type Type;                                \
    typedef Type const          cType;                                 \
    typedef Type volatile       vType;                                 \
    typedef Type const volatile cvType;                                \
    static const char *TypeName = #TYPE;                               \
    static const unsigned traits = traitBits<  Type>();                \
    LOOP2_ASSERT(TypeName, traits, traitBits<  Type>() == TRAIT_BITS); \
    LOOP2_ASSERT(TypeName, traits, traitBits< cType>() == TRAIT_BITS); \
    LOOP2_ASSERT(TypeName, traits, traitBits< vType>() == TRAIT_BITS); \
    LOOP2_ASSERT(TypeName, traits, traitBits<cvType>() == TRAIT_BITS); \
}

//=============================================================================
//                          HELPER CLASSES FOR TESTING
//-----------------------------------------------------------------------------

struct my_NilTraitClass {
};

struct my_BitwiseMoveableClass {
    BSLMF_NESTED_TRAIT_DECLARATION(my_BitwiseMoveableClass,
                                   bslmf::IsBitwiseMoveable);
};

struct my_UsesBslmaAllocatorClass {
    BSLMF_NESTED_TRAIT_DECLARATION(my_UsesBslmaAllocatorClass,
                                   bslma::UsesBslmaAllocator);
};

struct my_BothTraitsClass {
    BSLMF_NESTED_TRAIT_DECLARATION(my_BothTraitsClass,
                                   bslmf::IsBitwiseMoveable);
    BSLMF_NESTED_TRAIT_DECLARATION(my_BothTraitsClass,
                                   bslma::UsesBslmaAllocator);
};

namespace BloombergLP {
namespace bslmf {

// Being empty, 'my_NilTraitClass' would normally be implicitly bitwise
// moveable.  Override, making it explicitly NOT bitwise moveable.
template <>
struct IsBitwiseMoveable<my_NilTraitClass> : bsl::false_type { };

}  // close namespace bslmf
}  // close enterprise namespace

//=============================================================================
//                              MAIN PROGRAM
//-----------------------------------------------------------------------------

int main(int argc, char *argv[])
{
    int                 test = argc > 1 ? atoi(argv[1]) : 0;
    bool             verbose = argc > 2;
    bool         veryVerbose = argc > 3;
    bool     veryVeryVerbose = argc > 4;
    bool veryVeryVeryVerbose = argc > 5;

    (void)veryVerbose;          // suppress warning
    (void)veryVeryVerbose;      // suppress warning
    (void)veryVeryVeryVerbose;  // suppress warning

    setbuf(stdout, NULL);    // Use unbuffered output

    printf("TEST " __FILE__ " CASE %d\n", test);

    switch (test) { case 0:  // Zero is always the leading case.
      case 1: {
        // --------------------------------------------------------------------
        // BREATHING TEST
        //
        // Concerns:
        //   1. That the proper trait is selected from multiple traits.
        //   2. That the proper trait is selected regardless of where the
        //      proper trait is specified in the list of traits.
        //   3. That the order of traits listed in 'bslalg::SelectTrait'
        //      reflects the precedence of traits selection.
        //   4. That candidate traits doesn't get passed onto the class when
        //      none of the traits matched.
        //
        // Plan:
        //   Using four helper classes, 'my_NilTraitClass',
        //   'my_BitwiseMoveableClass', 'my_UsesBslmaAllocatorClass',
        //   'my_BothTraitsClass', check that the type traits being assigned
        //   to them are correct using 'bslalg::SelectTrait' with various
        //   ordering according to the list of concerns.
        //
        // Testing:
        //   bslalg::SelectTrait<typename TYPE, typename TRAIT1...>::Type;
        // --------------------------------------------------------------------

        if (verbose) printf("\nBREATHING TEST"
                            "\n==============\n");

        // Regular select
        {
            typedef bslalg::SelectTrait<
                        my_BitwiseMoveableClass,
                        bslalg::TypeTraitBitwiseMoveable>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }

        {
            typedef bslalg::SelectTrait<
                        my_UsesBslmaAllocatorClass,
                        bslalg::TypeTraitUsesBslmaAllocator>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                 bslalg::TypeTraitUsesBslmaAllocator>::VALUE));
        }

        {
            typedef bslalg::SelectTrait<
                        my_BitwiseMoveableClass,
                        bslalg::TypeTraitUsesBslmaAllocator,
                        bslalg::TypeTraitBitwiseMoveable>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }

        // Test the order of traits
        {
            typedef bslalg::SelectTrait<
                              my_BothTraitsClass,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitBitwiseMoveable>::Type TestType;

            ASSERT((1 == bsl::is_same<TestType,
                                 bslalg::TypeTraitUsesBslmaAllocator>::VALUE));
        }
        {
            typedef bslalg::SelectTrait<
                           my_BothTraitsClass,
                           bslalg::TypeTraitBitwiseMoveable,
                           bslalg::TypeTraitUsesBslmaAllocator>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }
        {
            typedef bslalg::SelectTrait<
                              my_BitwiseMoveableClass,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitBitwiseMoveable>::Type TestType;

            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }
        {
            typedef bslalg::SelectTrait<
                              my_BitwiseMoveableClass,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitBitwiseMoveable>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }
        {
            typedef bslalg::SelectTrait<
                              my_BitwiseMoveableClass,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitBitwiseMoveable>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }
        {
            typedef bslalg::SelectTrait<
                              my_BitwiseMoveableClass,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitUsesBslmaAllocator,
                              bslalg::TypeTraitBitwiseMoveable>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                    bslalg::TypeTraitBitwiseMoveable>::VALUE));
        }

        // Test that traits wouldn't be added on when there's no match.
        {
            typedef bslalg::SelectTrait<
                           my_NilTraitClass,
                           bslalg::TypeTraitBitwiseMoveable,
                           bslalg::TypeTraitUsesBslmaAllocator>::Type TestType;
            ASSERT((1 == bsl::is_same<TestType,
                                      bslalg::TypeTraitNil>::VALUE));
        }

      } break;

      default: {
        fprintf(stderr, "WARNING: CASE `%d' NOT FOUND.\n", test);
        testStatus = -1;
      }
    }

    if (testStatus > 0) {
        fprintf(stderr, "Error, non-zero test status = %d.\n", testStatus);
    }

    return testStatus;
}

// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------


text:
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-338-x64.7z'
$checksum = '20977319aea969c338a0215b6edd857d6cbfc49c89887bb6d5bcade4786eb34a'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

Install-ChocolateyZipPackage -PackageName "$packageName" `
                             -Url "$url" `
                             -UnzipLocation "$toolsDir" `
                             -Url64bit "$url64" `
                             -Checksum "$checksum" `
                             -ChecksumType "$checksumType" `
                             -Checksum64 "$checksum64" `
                             -ChecksumType64 "$checksumType64"


text:
#ifndef _MSGL_ICONV_H
#define _MSGL_ICONV_H

#if HAVE_ICONV
#include <iconv.h>
#endif

#include "message.h"

#ifdef __cplusplus
extern "C" {
#endif

#if HAVE_ICONV
/* Converts the STRING through the conversion descriptor CD.  */
extern char *convert_string (iconv_t cd, const char *string);
#endif

/* Converts the message list MLP to the (already canonicalized) encoding
   CANON_TO_CODE.  The (already canonicalized) encoding before conversion
   can be passed as CANON_FROM_CODE; if NULL is passed instead, the
   encoding is looked up in the header entry.  */
extern void
       iconv_message_list (message_list_ty *mlp,
			   const char *canon_from_code,
			   const char *canon_to_code,
			   const char *from_filename);

/* Converts all the message lists in MDLP to the encoding TO_CODE.  */
extern msgdomain_list_ty *
       iconv_msgdomain_list (msgdomain_list_ty *mdlp,
			     const char *to_code,
			     const char *from_filename);

#ifdef __cplusplus
}
#endif

#endif /* _MSGL_ICONV_H */