text:
/* DO NOT EDIT */
/* This file was generated by Stone */

package com.dropbox.core.v2.paper;

import com.dropbox.core.DbxApiException;
import com.dropbox.core.DbxException;

/**
 * The request builder returned by {@link DbxUserPaperRequests#docsListBuilder}.
 *
 * <p> Use this class to set optional request parameters and complete the
 * request. </p>
 */
public class DocsListBuilder {
    private final DbxUserPaperRequests _client;
    private final ListPaperDocsArgs.Builder _builder;

    /**
     * Creates a new instance of this builder.
     *
     * @param _client  Dropbox namespace-specific client used to issue paper
     *     requests.
     * @param _builder  Request argument builder.
     *
     * @return instsance of this builder
     */
    DocsListBuilder(DbxUserPaperRequests _client, ListPaperDocsArgs.Builder _builder) {
        if (_client == null) {
            throw new NullPointerException("_client");
        }
        this._client = _client;
        if (_builder == null) {
            throw new NullPointerException("_builder");
        }
        this._builder = _builder;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code
     * ListPaperDocsFilterBy.DOCS_ACCESSED}. </p>
     *
     * @param filterBy  Allows user to specify how the Paper docs should be
     *     filtered. Must not be {@code null}. Defaults to {@code
     *     ListPaperDocsFilterBy.DOCS_ACCESSED} when set to {@code null}.
     *
     * @return this builder
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public DocsListBuilder withFilterBy(ListPaperDocsFilterBy filterBy) {
        this._builder.withFilterBy(filterBy);
        return this;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code
     * ListPaperDocsSortBy.ACCESSED}. </p>
     *
     * @param sortBy  Allows user to specify how the Paper docs should be
     *     sorted. Must not be {@code null}. Defaults to {@code
     *     ListPaperDocsSortBy.ACCESSED} when set to {@code null}.
     *
     * @return this builder
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public DocsListBuilder withSortBy(ListPaperDocsSortBy sortBy) {
        this._builder.withSortBy(sortBy);
        return this;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code
     * ListPaperDocsSortOrder.ASCENDING}. </p>
     *
     * @param sortOrder  Allows user to specify the sort order of the result.
     *     Must not be {@code null}. Defaults to {@code
     *     ListPaperDocsSortOrder.ASCENDING} when set to {@code null}.
     *
     * @return this builder
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public DocsListBuilder withSortOrder(ListPaperDocsSortOrder sortOrder) {
        this._builder.withSortOrder(sortOrder);
        return this;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code 1000}. </p>
     *
     * @param limit  Size limit per batch. The maximum number of docs that can
     *     be retrieved per batch is 1000. Higher value results in invalid
     *     arguments error. Must be greater than or equal to 1 and be less than
     *     or equal to 1000. Defaults to {@code 1000} when set to {@code null}.
     *
     * @return this builder
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public DocsListBuilder withLimit(Integer limit) {
        this._builder.withLimit(limit);
        return this;
    }

    /**
     * Issues the request.
     */
    @SuppressWarnings("deprecation")
    public ListPaperDocsResponse start() throws DbxApiException, DbxException {
        ListPaperDocsArgs arg_ = this._builder.build();
        return _client.docsList(arg_);
    }
}


text:
package com.koch.ambeth.plugin;

import java.io.File;
import java.net.URISyntaxException;
import java.util.List;

import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.koch.ambeth.core.config.CoreConfigurationConstants;
import com.koch.ambeth.core.plugin.PluginClasspathScanner;
import com.koch.ambeth.ioc.IServiceContext;
import com.koch.ambeth.ioc.annotation.Autowired;
import com.koch.ambeth.ioc.annotation.BootstrapModule;
import com.koch.ambeth.ioc.annotation.FrameworkModule;
import com.koch.ambeth.log.config.Properties;
import com.koch.ambeth.testutil.AbstractIocTest;
import com.koch.ambeth.testutil.TestModule;
import com.koch.ambeth.testutil.TestProperties;

@TestModule(PluginModule.class)
@TestProperties(name = CoreConfigurationConstants.PluginPaths,
		value = "${pluginScanResource}/modules.jar;${pluginScanResource}/jars/;${pluginScanResource}/onejarfolder")
public class PluginClasspathScannerTest extends AbstractIocTest {
	@Autowired
	protected PluginClasspathScanner pluginScanner;

	@Autowired
	protected IServiceContext applicationContext;

	protected List<Class<?>> bootstrapModuleClasses;

	protected List<Class<?>> frameworkModuleClasses;

	@BeforeClass
	public static void beforeClass() throws URISyntaxException {
		// get the scan resource absolute root path
		String pluginScanResource =
				new File(PluginClasspathScannerTest.class.getResource("/pluginScanResource").toURI())
						.getAbsolutePath();
		// for build the scan absolute paths
		((Properties) Properties.getSystem()).putString("pluginScanResource", pluginScanResource);
	}

	@Before
	public void before() {
		// scan plugin jar
		bootstrapModuleClasses = pluginScanner.scanClassesAnnotatedWith(BootstrapModule.class);
		frameworkModuleClasses = pluginScanner.scanClassesAnnotatedWith(FrameworkModule.class);
	}

	@Test
	public void pluginScanTest() throws Exception {
		Assert.assertEquals(bootstrapModuleClasses.size(), 1);
		Assert.assertEquals(frameworkModuleClasses.size(), 1);
	}

	@Test
	public void pluginClassRegistTest() throws Exception {
		// inject as module
		applicationContext.createService("application",
				bootstrapModuleClasses.toArray(new Class<?>[bootstrapModuleClasses.size()]));
		applicationContext.createService("framework",
				frameworkModuleClasses.toArray(new Class<?>[frameworkModuleClasses.size()]));
	}

	@Test
	public void pluginRegistModuleTest() throws Exception {
		applicationContext.createService("framework", frameworkModuleClasses.get(0));
		applicationContext.createService("application", bootstrapModuleClasses.get(0));
	}
}

redpajama_set_name: RedPajamaGithub


text:
/*eslint-env node */

// Test support

const Fs = require("fs");

// Heating and cooling rates, in degrees per minute
const RATES = [
    { HW: -0.01, CH: -0.03 }, // OFF = COOL
    { HW: 0.333, CH: 0.1 }   // ON = WARM
];

var TestSupport = {
    // Path for debug pin files
    pin_path: "/tmp/gpio",

    ds18x20: {
        get: function(id, fn) {
            var sensor = TestSupport.thid2Sensor[id];
            fn(null, sensor.temperature);
        },

        isDriverLoaded: function() { return true; }
    },

    adjustSensor: function(sensor) {
        if (typeof TestSupport.name2gpio[sensor.name] !== "undefined") {
            var data = Fs.readFileSync(
                TestSupport.pin_path + TestSupport.name2gpio[sensor.name]);
            var pState = parseInt(data);
            if (isNaN(pState)) {
                console.error("TestSupport: pState from " + TestSupport.pin_path
                              + TestSupport.name2gpio[sensor.name]
                              + " was unparseable; '" + data + "'");
                pState = 0;
            }
            sensor.temperature += RATES[pState][sensor.name] / 120.0;
        }
        setTimeout(function() {
            TestSupport.adjustSensor(sensor);
        }, 500);
    },

    thid2Sensor: {},
    mapThermostat: function(th) {
        var sensor = {
            name: th.name,
            temperature: th.getTargetTemperature()
        };
        TestSupport.thid2Sensor[th.id] = sensor;
        TestSupport.adjustSensor(sensor);
    },

    name2gpio: {},
    mapPin: function(pin) {
        TestSupport.name2gpio[pin.name] = pin.gpio;
    },
};

module.exports = TestSupport;


text:
package com.terradue.dsi.wire;

import static com.google.inject.Scopes.SINGLETON;

import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;

import com.google.inject.AbstractModule;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.config.ClientConfig;

public final class RestClientModule
    extends AbstractModule
{

    @Override
    protected void configure()
    {
        bind( KeyManager[].class ).toProvider( KeyManagerProvider.class ).in( SINGLETON );
        bind( TrustManager[].class ).toProvider( TrustManagersProvider.class ).in( SINGLETON );
        bind( SSLContext.class ).toProvider( SSLContextProvider.class ).in( SINGLETON );
        bind( ClientConfig.class ).toProvider( RestClientConfigProvider.class ).in( SINGLETON );
        bind( Client.class ).toProvider( RestClientProvider.class ).in( SINGLETON );
    }

}


text:
'use strict';

angular.module('users').controller('SocialAccountsController', ['$scope', '$http', 'Authentication',
  function ($scope, $http, Authentication) {

    // Check if there are additional accounts
    $scope.hasConnectedAdditionalSocialAccounts = function (provider) {
      for (var i in $scope.user.additionalProvidersData) {
        return true;
      }

      return false;
    };
    $scope.hasUnConnectedAdditionalSocialAccounts = function (provider) {
      var cnt = 0;
      for (var i in $scope.user.additionalProvidersData) {
        cnt++;
      }
      if (cnt < 4) return true;
      return false;
    };
    // Check if provider is already in use with current user
    $scope.isConnectedSocialAccount = function (provider) {
      return $scope.user.provider === provider || ($scope.user.additionalProvidersData && $scope.user.additionalProvidersData[provider]);
    };

    // Remove a user social account
    $scope.removeUserSocialAccount = function (provider) {
      $scope.success = $scope.error = null;

      $http.delete('/api/users/accounts', {
        params: {
          provider: provider
        }
      }).success(function (response) {
        $scope.success = true;
        $scope.user = Authentication.user = response;
      }).error(function (err) {
        $scope.handleShowMessage(err.message, true);
      });
    };
  }
]);


text:
package workbench.gui.editor.actions;

import workbench.resource.PlatformShortcuts;

/**
 *
 * @author Thomas Kellerer
 */
public class SelectNextWord
	extends NextWord
{
	public SelectNextWord()
	{
		super("TxtEdNxtWordSel", PlatformShortcuts.getDefaultNextWord(true));
		select = true;
	}
}


text:
 A brute force solution that works is better than an elegant solution that
  doesn't work.

  --Steve McConnell
   [
  source]


text:
My iOS apps since 2010
=======================

## Castingworkbook Inc - 2017
[Self-Tape](https://itunes.apple.com/app/apple-store/id911898214?mt=8)
The Ultimate Self-Tape App is a free app powered by Casting Workbook for their members only. It allows you to self-tape professionally, right from your mobile device. Send your self-tape auditions, along with your portfolio, directly to industry professionals all while looping in your agent.

Role: Rebuild the app from scratch using native iOS tools - Xcode and Swift

TECHNOLOGIES & SKILLS: Swift, AWS, Almofire, RESTAPI, Video Recording and Editing, FFMpeg

## Arrowtop - 2016
[Arrowtop](https://itunes.apple.com/ca/app/arrowtop/id969312617?mt=8)

ArrowTop is a social network for creating trends with the world. With ArrowTop, you can create or join in Trends. Post your photos and videos to boost your way to the top.

Role: Added new featuers and bug fixes

TECHNOLOGIES & SKILLS: Swift, Cocoapods, AWS, Almofire, RESTAPI, Social network

## RSA - 2014 - 2016
###[RSA SecurID Authenticate](https://itunes.apple.com/ca/app/rsa-securid-authenticate/id986524970?mt=8)
The RSA SecurID® Authenticate app works with RSA SecurID Access to provide strong authentication and convenient single sign-on to corporate web applications. Use the app to register an iOS device, and then use the registered device to authenticate to applications protected by RSA SecurID Access. The Authenticate app lets you conveniently verify your identity by tapping the device, verifying with Touch ID or Eyeprint ID, or by entering a tokencode generated by the app.

Role: Added new featuers and bug fixes

###Secure Note Storage (the app was released for internal use only)
The system is designed to store secure information on your device and sync it with other devices (Android, Windows, MacOS) via the server. All the data is encrypted end to end.

Role: Build iOS version of the app

TECHNOLOGIES & SKILLS: Swift, Core Data, UIKit, RESTful API, iBeacon, BLE, Git, Agile, JIRA, bsafe, CommonCrypto, encryption, encrypted data transfer

## Burrow - 2015
Finding an apartment or house in Greater Toronto Area is now easier than finding a date on a Friday night! Simply pull out your phone and swipe to find your next home. Innovative and fun location based search. Always know what's avaliable for rent or sale around you. Craigslist, Kijiji and Realtor are tools of the past. BurrowSwipe has more listings than MLS and updated every hour so you'll never miss out on you dream home.

Role: Build the iOS

TECHNOLOGIES & SKILLS: Swift, UIKit, RESTful API

Note: The app and the project was discontinued by the client in 2016

## Five minute journal - 2014

## Rogers 2013-2014
### Sportsnet 2014
### Today's parents 2014
### FXNow 2013
### Breakfast television 2013

## Triggerfox 2013
## IMG Group. Piers 2012
## Zurapps. 2010-2012
### RoadTripper
### MathPad
### KidsTellTime
### Find&Learn
### Find&Read


text:
1. What work did the SIG do this year that should be highlighted?

   - Major improvements in the Job API (see below job-related KEPs).
   - Stability and availability improvements across several controllers (see below KEPs for DaemonSets and StatefulSets).
   - Leadership changes: Maciej joins leadership, Matt and Adnan moving to emeritus.

2. What initiatives are you working on that aren't being tracked in KEPs?

   - Conformance testing promotions.

3. KEP work in 2021 (1.21, 1.22, 1.23):

   - Stable
     - [19 - CronJob to Stable](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/19-Graduate-CronJob-to-Stable/README.md) - 1.21
     - [85 - PodDisruptionBudget to GA](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/85-Graduate-PDB-to-Stable/README.md) - 1.22
     - [592 - TTL After Finished](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/592-ttl-after-finish/README.md) - 1.23
   - Beta
     - [2185 - Random Pod Selection on ReplicaSet Downscale](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2185-random-pod-select-on-replicaset-downscale/README.md) - 1.22
     - [1591 - Allow DaemonSets to surge during update like Deployments](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/1591-daemonset-surge/README.md) - 1.22
     - [2214 - Indexed Job](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2214-indexed-job/README.md) - 1.22
     - [2232 - Suspend Job](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2232-suspend-jobs/README.md) - 1.22
     - [2255 - ReplicaSet Pod Deletion Cost](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2255-pod-cost/README.md) - 1.22
     - [2307 - Job tracking without lingering Pods](https://github.com/kubernetes/enhancements/tree/master/keps/sig-scheduling/2926-job-mutable-scheduling-directives/README.md) - 1.23
     - [2599 - minReadySeconds for StatefulSets](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2599-minreadyseconds-for-statefulsets/README.md) - 1.23
     - [2926 - Mutable Node Scheduling Directives for Jobs](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2599-minreadyseconds-for-statefulsets/README.md) - 1.23
   - Alpha
     - [2185 - Random Pod Selection on ReplicaSet Downscale](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2185-random-pod-select-on-replicaset-downscale/README.md) - 1.21
     - [1591 - Allow DaemonSets to surge during update like Deployments](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/1591-daemonset-surge/README.md) - 1.21
     - [2214 - Indexed Job](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2214-indexed-job/README.md) - 1.21
     - [2232 - Suspend Job](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2232-suspend-jobs/README.md) - 1.21
     - [2255 - ReplicaSet Pod Deletion Cost](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2255-pod-cost/README.md) - 1.21
     - [2307 - Job tracking without lingering Pods](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2307-job-tracking-without-lingering-pods/README.md) - 1.22
     - [2599 - minReadySeconds for StatefulSets](https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2599-minreadyseconds-for-statefulsets/README.md) - 1.22
     - [1847 - Auto delete PVCs created by StatefulSet](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/1847-autoremove-statefulset-pvcs/README.md) - 1.23
     - [2879 - Track ready Pods in Job status](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/2879-ready-pods-job-status/README.md) - 1.23

## Project health

1. What areas and/or subprojects does your group need the most help with?
   Any areas with 2 or fewer OWNERs? (link to more details)

   - Growing additional reviewers and approvers, also see no. 4 below.

2. What metrics/community health stats does your group care about and/or measure?

   - Open untriaged issues and PRs

3. Does your [CONTRIBUTING.md] help **new** contributors engage with your group specifically by pointing
   to activities or programs that provide useful context or allow easy participation?

   - It's up-to-date.

4. If your group has special training, requirements for reviewers/approvers, or processes beyond the general [contributor guide],
   does your [CONTRIBUTING.md] document those to help **existing** contributors grow throughout the [contributor ladder]?

   - We're working with SIG-CLI on starting a monthly review club, details to be announced soon.

5. Does the group have contributors from multiple companies/affiliations?

   - [11 companies](https://k8s.devstats.cncf.io/d/8/company-statistics-by-repository-group?orgId=1&var-period=y&var-metric=contributions&var-repogroup_name=SIG%20Apps&var-repo_name=kubernetes%2Fkubernetes&var-companies=All&from=1609455600000&to=1639350000000) contributed code in 2021.

6. Are there ways end users/companies can contribute that they currently are not?
   If one of those ways is more full time support, what would they work on and why?

   - Increase the test coverage for all controllers.

## Membership

- Primary slack channel member count: 2900
- Primary mailing list member count: 674
- Primary meeting attendee count (estimated, if needed): 10
- Primary meeting participant count (estimated, if needed): 6
- Unique reviewers for SIG-owned packages: 23
- Unique approvers for SIG-owned packages: 31

Include any other ways you measure group membership

## Subprojects

New in 2021:
- None

Retired in 2021:
- None

Continuing:
- [application](https://git.k8s.io/community/sig-apps#application)
- [examples](https://git.k8s.io/community/sig-apps#examples)
- [execution-hook](https://git.k8s.io/community/sig-apps#execution-hook)
- [kompose](https://git.k8s.io/community/sig-apps#kompose)

## Working groups

New in 2021:
- None

Retired in 2021:
- None

Continuing:
- [Data Protection](https://git.k8s.io/community/wg-data-protection/) ([2021 report](https://github.com/kubernetes/community/blob/master/wg-data-protection/annual-report-2021.md))

## Operational

Operational tasks in [sig-governance.md]:

- [x] [README.md] reviewed for accuracy and updated if needed
- [x] [CONTRIBUTING.md] reviewed for accuracy and updated if needed
      (or created if missing and your contributor steps and experience are different or more
      in-depth than the documentation listed in the general [contributor guide] and [devel] folder.)
- [x] Subprojects list and linked OWNERS files in [sigs.yaml] reviewed for accuracy and updated if needed
- [x] SIG leaders (chairs, tech leads, and subproject owners) in [sigs.yaml] are accurate and active, and updated if needed
- [x] Meeting notes and recordings for 2021 are linked from [README.md] and updated/uploaded if needed
- [x] Did you have community-wide updates in 2021 (e.g. community meetings, kubecon, or kubernetes-dev@ emails)? Links to email, slides, or recordings:
      - [KubeCon NA 2021 Sig Apps updates](https://youtu.be/ZvFYvYiMeTs)

[CONTRIBUTING.md]: https://git.k8s.io/community/sig-apps/CONTRIBUTING.md
[contributor ladder]: https://git.k8s.io/community/community-membership.md
[sig-governance.md]: https://git.k8s.io/community/committee-steering/governance/sig-governance.md
[README.md]: https://git.k8s.io/community/sig-apps/README.md
[sigs.yaml]: https://git.k8s.io/community/sigs.yaml
[contributor guide]: https://git.k8s.io/community/contributors/guide/README.md
[devel]: https://git.k8s.io/community/contributors/devel/README.md


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../logi/reset.css" />
	<link rel="stylesheet" type="text/css" href="features.css" />
	<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
	<meta name="description" content="Spice up your java" />
	<title>@Log (and friends)</title>

Project Lombok

@Log (and friends)

Captain's Log, stardate 24435.7: "What was that line again?"

Overview

			NEW in lombok 0.10: You can annotate any class with a log annotation to let lombok generate a logger field.

			The logger is named log and field's type depends on which logger you have selected.

			There are four choices available:

@CommonsLog

Creates private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);

@Log

Creates private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());

@Log4j

Creates private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogExample.class);

@Slf4j

Creates private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);

With Lombok

@HTML_PRE@

Vanilla Java

@HTML_POST@

Small print

				If a field called log already exists, a warning will be emitted and no code will be generated.

				A future feature of lombok's diverse log annotations is to find calls to the logger field and, if the chosen logging framework supports
				it and the log level can be compile-time determined from the log call, guard it with an if statement. This way if
				the log statement ends up being ignored, the potentially expensive calculation of the log string is avoided entirely. This does mean
				that you should NOT put any side-effects in the expression that you log.

			Back to features | Previous feature (@SneakyThrows) | Next feature (val)

			credits | Copyright © 2009-2011 Reinier Zwitserloot, Roel Spilker and Robbert Jan Grootjans, licensed under the MIT license.


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="editize" default="all">

  <!-- Compiler options -->
  <property name="compiler.debug" value="off"/>
  <property name="compiler.generate.no.warnings" value="off"/>
  <property name="compiler.args" value=""/>
  <property name="compiler.max.memory" value="128m"/>
  <patternset id="ignored.files">
    <exclude name="**/CVS/**"/>
    <exclude name="**/SCCS/**"/>
    <exclude name="**/RCS/**"/>
    <exclude name="**/rcs/**"/>
    <exclude name="**/.DS_Store/**"/>
    <exclude name="**/.svn/**"/>
    <exclude name="**/.git/**"/>
    <exclude name="**/vssver.scc/**"/>
    <exclude name="**/vssver2.scc/**"/>
  </patternset>
  <patternset id="compiler.resources">
    <include name="**/?*.properties"/>
    <include name="**/?*.xml"/>
    <include name="**/?*.gif"/>
    <include name="**/?*.jpeg"/>
    <include name="**/?*.jpg"/>
    <include name="**/?*.html"/>
    <include name="**/?*.dtd"/>
    <include name="**/?*.tld"/>
    <include name="**/?*.key"/>
  </patternset>

  <!-- Project Libraries -->
  <path id="library.kunststoff.classpath">
    <pathelement location="${basedir}/lib/kunststoff.jar"/>
  </path>

  <!-- Module Editize -->
  <property name="module.editize.basedir" value="${basedir}"/>

  <property name="compiler.args.editize" value="${compiler.args}"/>
  <property name="editize.output.dir" value="${module.editize.basedir}/classes/production/Editize"/>

  <path id="editize.module.classpath">
    <path refid="library.kunststoff.classpath"/>
  </path>

  <patternset id="excluded.from.module.editize">
    <patternset refid="ignored.files"/>
  </patternset>

  <patternset id="excluded.from.compilation.editize">
    <patternset refid="excluded.from.module.editize"/>
  </patternset>

  <path id="editize.module.sourcepath">
    <dirset dir="${module.editize.basedir}">
      <include name="src"/>
    </dirset>
  </path>

  <target name="compile.module.editize" description="Compile module Editize">
    <mkdir dir="${editize.output.dir}"/>
    <javac destdir="${editize.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" target="1.3" source="1.3">
      <compilerarg line="${compiler.args.editize}"/>
      <classpath refid="editize.module.classpath"/>
      <src refid="editize.module.sourcepath"/>
      <patternset refid="excluded.from.compilation.editize"/>
    </javac>

    <copy todir="${editize.output.dir}">
      <fileset dir="${module.editize.basedir}/src">
        <patternset refid="compiler.resources"/>
        <type type="file"/>
      </fileset>
    </copy>
  </target>

  <target name="jar.module.editize" depends="compile.module.editize" description="Package Editize for distribution">
    <jar jarfile="editize.jar" basedir="${editize.output.dir}" manifest="MANIFEST.MF"/>
    <copy file="lib/kunststoff.jar" todir="${module.editize.basedir}"/>
  </target>

  <target name="jarsign.module.editize" depends="jar.module.editize" description="Sign JAR file for distribution">
    <!-- In order for a Java applet like Editize to access the system clipboard, you must sign the JAR file that contains it with a trusted code signing certificate. You can purchase such a certificate from Thawte and other online retailers. Once you have added your certificate to your Java keystore, uncomment the following tag and fill in its alias and your keystore passphrase. -->
    <!--signjar jar="editize.jar" alias="******" storepass="******"/-->
  </target>

  <target name="clean.module.editize" description="cleanup module">
    <delete dir="${editize.output.dir}"/>
    <delete file="${module.editize.basedir}/editize.jar"/>
    <delete file="${module.editize.basedir}/kunststoff.jar"/>
    <delete file="${module.editize.basedir}/editize_dist.jar"/>
  </target>

  <target name="init" description="Build initialization"/>

  <target name="clean" depends="clean.module.editize" description="cleanup all"/>

  <target name="all" depends="init, clean, jarsign.module.editize" description="build all"/>

  <target name="run" depends="all">
      <java jar="${module.editize.basedir}/editize.jar"></java>
  </target>
</project>


text:
package org.apache.apex.malhar.kafka;

import java.nio.ByteBuffer;
import java.util.Map;

import org.apache.kafka.common.serialization.Deserializer;
import org.apache.kafka.common.serialization.Serializer;

public class KafkaHelper implements Serializer<KafkaOutputOperatorTest.Person>, Deserializer<KafkaOutputOperatorTest.Person>
{
  @Override
  public KafkaOutputOperatorTest.Person deserialize(String s, byte[] bytes)
  {
    ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
    int nameLength = byteBuffer.getInt();
    byte[] name = new byte[nameLength];

    byteBuffer.get(name, 0, nameLength);

    return new KafkaOutputOperatorTest.Person(new String(name), byteBuffer.getInt());
  }

  @Override
  public byte[] serialize(String s, KafkaOutputOperatorTest.Person person)
  {
    byte[] name = person.name.getBytes();

    ByteBuffer byteBuffer = ByteBuffer.allocate(name.length + 4 + 4);

    byteBuffer.putInt(name.length);
    byteBuffer.put(name);
    byteBuffer.putInt(person.age);

    return byteBuffer.array();
  }

  @Override
  public void configure(Map<String, ?> map, boolean b)
  {
  }

  @Override
  public void close()
  {
  }
}


text:
package com.navercorp.pinpoint.common.server.bo.serializer.stat;

import com.navercorp.pinpoint.common.server.bo.serializer.RowKeyEncoder;
import com.navercorp.pinpoint.common.util.BytesUtils;
import com.navercorp.pinpoint.common.util.TimeUtils;
import org.springframework.stereotype.Component;

import static com.navercorp.pinpoint.common.hbase.HBaseTables.AGENT_NAME_MAX_LEN;

/**
 * @author HyunGil Jeong
 */
@Component
public class AgentStatRowKeyEncoder implements RowKeyEncoder<AgentStatRowKeyComponent> {

    @Override
    public byte[] encodeRowKey(AgentStatRowKeyComponent component) {
        if (component == null) {
            throw new NullPointerException("component must not be null");
        }
        byte[] bAgentId = BytesUtils.toBytes(component.getAgentId());
        byte[] bStatType = new byte[]{component.getAgentStatType().getRawTypeCode()};
        byte[] rowKey = new byte[AGENT_NAME_MAX_LEN + bStatType.length + BytesUtils.LONG_BYTE_LENGTH];

        BytesUtils.writeBytes(rowKey, 0, bAgentId);
        BytesUtils.writeBytes(rowKey, AGENT_NAME_MAX_LEN, bStatType);
        BytesUtils.writeLong(TimeUtils.reverseTimeMillis(component.getBaseTimestamp()), rowKey, AGENT_NAME_MAX_LEN + bStatType.length);

        return rowKey;
    }
}


text:
define([
    'yaml!../../resources/data/providers.yaml',
], function (
    providersData
) {
    'use strict';

    class Providers {
        constructor({ runtime }) {
            this.providerWhitelist = runtime.config('services.auth2.providers');
            this.providers = providersData
                .filter((provider) => {
                    if (this.providerWhitelist) {
                        return this.providerWhitelist.includes(provider.id);
                    } else {
                        return true;
                    }
                });
            this.sortByPriority();
        }

        sortByPriority() {
            this.providers.sort(function (a, b) {
                const priorityOrder = a.priority - b.priority;
                if (priorityOrder !== 0) {
                    return priorityOrder;
                }

                const labelOrder = a.label < b.label ? -1 : (a.label > b.label ? 0 : 1);
                return labelOrder;
            });
        }

        get() {
            return this.providers;
        }
    }

    return { Providers };
});


text:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import config from './app.config';
import todos from '../todos';
import angularUiBlock from 'angular-ui-block';

let app = angular.module('app', [uiRouter, todos, angularUiBlock]);

app.config(config);

export default app.name;


text:
[![NPM version](https://badge.fury.io/js/fluxible-addons-react.svg)](http://badge.fury.io/js/fluxible-addons-react)
<!--
[![Build Status](https://img.shields.io/travis/yahoo/fluxible-addons-react.svg)](https://travis-ci.org/yahoo/fluxible-addons-react)
[![Coverage Status](https://img.shields.io/coveralls/yahoo/fluxible-addons-react.svg)](https://coveralls.io/r/yahoo/fluxible-addons-react?branch=master)
[![Dependency Status](https://img.shields.io/david/yahoo/fluxible-addons-react.svg)](https://david-dm.org/yahoo/fluxible-addons-react)
[![devDependency Status](https://img.shields.io/david/dev/yahoo/fluxible-addons-react.svg)](https://david-dm.org/yahoo/fluxible-addons-react#info=devDependencies)
-->

[Fluxible](https://github.com/yahoo/fluxible) addons for use with [React](https://github.com/facebook/react).

```bash
$ npm install --save fluxible-addons-react
```

Join the #fluxible channel of the [Reactiflux](http://reactiflux.com) Discord community.

[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/yahoo/fluxible)

## Docs

 * [connectToStores](https://github.com/yahoo/fluxible-addons-react/blob/master/docs/api/connectToStores.md)
 * [FluxibleComponent](https://github.com/yahoo/fluxible-addons-react/blob/master/docs/api/FluxibleComponent.md)
 * [FluxibleMixin](https://github.com/yahoo/fluxible-addons-react/blob/master/docs/api/FluxibleMixin.md) (legacy)
 * [provideContext](https://github.com/yahoo/fluxible-addons-react/blob/master/docs/api/provideContext.md)
 * [createElementWithContext](https://github.com/yahoo/fluxible-addons-react/blob/master/docs/api/createElementWithContext.md)
 * [batchedUpdatePlugin](https://github.com/yahoo/fluxible-addons-react/blob/master/docs/api/batchedUpdatePlugin.md)

## License

This software is free to use under the Yahoo Inc. BSD license.
See the [LICENSE file][] for license text and copyright information.

[LICENSE file]: https://github.com/yahoo/fluxible/blob/master/LICENSE.md


text:
=================
:mod:`statistics`
=================

.. automodule:: cmepy.statistics
   :members:


text:
// Copyright 2013 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.

package org.chromium.chrome.browser.sync;

import androidx.annotation.IntDef;

import org.chromium.chrome.R;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * This class mirrors the native GoogleServiceAuthError class State enum from:
 * google_apis/gaia/google_service_auth_error.h.
 */
public class GoogleServiceAuthError {
    @IntDef({State.NONE, State.INVALID_GAIA_CREDENTIALS, State.USER_NOT_SIGNED_UP,
            State.CONNECTION_FAILED, State.SERVICE_UNAVAILABLE, State.REQUEST_CANCELED,
            State.UNEXPECTED_SERVICE_RESPONSE, State.SERVICE_ERROR})
    @Retention(RetentionPolicy.SOURCE)
    public @interface State {
        // The user is authenticated.
        int NONE = 0;

        // The credentials supplied to GAIA were either invalid, or the locally
        // cached credentials have expired.
        int INVALID_GAIA_CREDENTIALS = 1;

        // The GAIA user is not authorized to use the service.
        int USER_NOT_SIGNED_UP = 2;

        // Could not connect to server to verify credentials. This could be in
        // response to either failure to connect to GAIA or failure to connect to
        // the service needing GAIA tokens during authentication.
        int CONNECTION_FAILED = 3;

        // DEPRECATED.
        // The user needs to satisfy a CAPTCHA challenge to unlock their account.
        // If no other information is available, this can be resolved by visiting
        // https://www.google.com/accounts/DisplayUnlockCaptcha. Otherwise,
        // captcha() will provide details about the associated challenge.
        // int CAPTCHA_REQUIRED = 4;

        // DEPRECATED.
        // The user account has been deleted.
        // int ACCOUNT_DELETED = 5;

        // DEPRECATED.
        // The user account has been disabled.
        // int ACCOUNT_DISABLED = 6;

        // The service is not available; try again later.
        int SERVICE_UNAVAILABLE = 7;

        // DEPRECATED.
        // The password is valid but we need two factor to get a token.
        // int TWO_FACTOR = 8;

        // The requestor of the authentication step cancelled the request
        // prior to completion.
        int REQUEST_CANCELED = 9;

        // HOSTED accounts are deprecated.
        // int HOSTED_NOT_ALLOWED_DEPRECATED = 10;

        // Indicates the service responded to a request, but we cannot
        // interpret the response.
        int UNEXPECTED_SERVICE_RESPONSE = 11;

        // Indicates the service responded and response carried details of the
        // application error.
        int SERVICE_ERROR = 12;

        // DEPRECATED.
        // The password is valid but web login is required to get a token.
        // int WEB_LOGIN_REQUIRED = 13;

        int NUM_ENTRIES = 14;
    }

    public static int getMessageID(@State int state) {
        switch (state) {
            case State.INVALID_GAIA_CREDENTIALS:
                return R.string.sync_error_ga;
            case State.CONNECTION_FAILED:
                return R.string.sync_error_connection;
            case State.SERVICE_UNAVAILABLE:
                return R.string.sync_error_service_unavailable;
            // case State.NONE:
            // case State.REQUEST_CANCELED:
            // case State.UNEXPECTED_SERVICE_RESPONSE:
            // case State.SERVICE_ERROR:
            default:
                return R.string.sync_error_generic;
        }
    }
}


text:
Optimizer::Optimizer(Methodptr pmethod)
{
   method = pmethod;
}

Optimizer::~Optimizer()
{

}

Methodptr Optimizer::set_method(Methodptr pmethod)
{
    method = pmethod;
}

void Optimizer::set_errorfunction(error_func errfunc)
{
    method->set_errorfunc(errfunc);
}

void Optimizer::set_max_duration(unsigned long long iterations, unsigned long long time)
{
   max_iterations = iterations;
   max_time_ms = time;
}

//One optimization step
unsigned long long Optimizer::iterate(Problem &problem, long double &error)
{
    error = method->optimize(problem);
   // if (problem.minimize)
    return 0;
}

void Optimizer::optimize(Problem &problem)
{
    unsigned long long time = 0;
    long double error = numeric_limits<long double>::max();
    long double best_error = numeric_limits<long double>::max();
    vector<long double> best_params;
    unsigned long long best_index = 0;
    unsigned long long i=0;

    QElapsedTimer timer_measurement;
    timer_measurement.start();
    method->init_params(problem);

    for (i=0;i<max_iterations;++i)
    {
        time = timer_measurement.elapsed();
        iterate(problem, error);

        if(error < best_error)
        {
            best_error = error;
            best_index = i;
            best_params = problem.params;
        }

        if ((time >= max_time_ms) && (0 != max_time_ms))
            break;

        if (error < eps)
            break;

        if ((i >= max_iterations) && (0 != max_iterations))
            break;

        if( 0 == i % REPORTY_CYCLE) //Report status regularly
        {
//            cout << i << " iterations passed" << endl;
//            cout << "Time passed: " << time << "ms" << endl;
//            cout << "Actual error: " << error << endl;
        }
    }
    cout << "Iterations made: " << i << endl;
    cout << "Time needed: " << time << "ms" << endl;
    cout << "Best Params: Index: " << best_index << endl;
    for(unsigned i=0;i<problem.params.size();++i)
        cout << "Param " << i << ": " << best_params[i] << " ";
    cout << endl << "With MSE: " << best_error << endl;
}

void Optimizer::benchmark(Problem &problem)
{
    long double error = 0;
    unsigned long long time = 0;
    time = iterate(problem, error);
    cout << "Time for one iteration: " << time << "ms" << endl;

    cout << "Time for the whole optimization in worst case: " << time*max_iterations << "ms" << endl;

}


text:
package org.datavaultplatform.common.metadata.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.datavaultplatform.common.model.Dataset;
import org.datavaultplatform.common.metadata.Provider;

// This mock metadata provider is for testing purposes only

public class MockProvider implements Provider {

    List<Dataset> datasets = new ArrayList<>();
    Map<String, String> projectIds = new HashMap<>();

    public MockProvider() {
        for (int i = 1; i < 6; i++) {
            Dataset d = new Dataset();
            d.setID("MOCK-DATASET-" + i);
            d.setName("Sample dataset " + i);
            d.setContent("Mock Metadata");
            d.setVisible(true);
            d.setCrisId("CRIS01");
            datasets.add(d);
            projectIds.put(d.getID(), "MOCK-PROJECTID-" + i);
        }
    }

    @Override
    public List<Dataset> getDatasetsForUser(String userID) {
        return datasets;
    }

    @Override
    public Dataset getDataset(String id) {
        for (Dataset d : datasets) {
            if (d.getID().equals(id)) {
                return d;
            }
        }
        return null;
    }

	@Override
	public Map<String, String> getPureProjectIds() {
		return projectIds;
	}

	@Override
	public String getPureProjectId(String datasetId) {
		return projectIds.get(datasetId);
	}
}


text:
package p3;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by tpal on 10/5/16.
 */
public class SubstringTest {
    @Test
    public void fingLongest() throws Exception {
        int longest = (new Substring()).findLongestLength("abcabcbb");
        assertEquals(3, longest);
        longest = (new Substring()).findLongestLength("bbbbbbb");
        assertEquals(1, longest);
        longest = (new Substring()).findLongestLength("pwwkew");
        assertEquals(3, longest);
    }

}


text:
@implementation NSPGattTransaction

- (id)init
{
    self = [super init];
    if (self) {
        self.operationQueue = [[NSMutableArray alloc] init];
        self.timeout = DEFAULT_TIMEOUT;
    }
    return self;
}

- (id)initWithTimeout:(NSInteger)timeout
{
    self = [self init];
    if (self) {
        self.timeout = timeout;
    }
    return self;
}

+ (NSPGattTransaction *)transactionWithOperation:(id<NSPGattOperation>)operation
{
    NSPGattTransaction *transaction = [[NSPGattTransaction alloc] init];
    [transaction addOperation:operation];
    return transaction;
}

- (void)addOperation:(id<NSPGattOperation>)operation
{
    [self.operationQueue addObject:operation];
}

- (id<NSPGattOperation>)nextOperation
{
    if (self.operationQueue.count == 0) {
        return nil;
    }

    id<NSPGattOperation> nextOperation = self.operationQueue[0];
    [self.operationQueue removeObjectAtIndex:0];
    return nextOperation;
}

@end


text:
namespace
{
using namespace ::testing;

using namespace iox::mepoo;

class SharedPointer_Test : public Test
{
  public:
    struct counter_t
    {
        uint64_t ctor{0};
        uint64_t dtor{0};
        uint64_t moveCtor{0};
        uint64_t copyCtor{0};
        uint64_t moveAssignment{0};
        uint64_t copyAssignment{0};
    };

    class TestClass
    {
      public:
        TestClass()
        {
            counter.ctor++;
        }

        TestClass(int a, int b)
            : a{a}
            , b{b}
        {
            counter.ctor++;
        }

        TestClass(const TestClass& v)
        {
            this->a = v.a;
            this->b = v.b;
            counter.copyCtor++;
        }

        TestClass(TestClass&& v)
        {
            this->a = v.a;
            this->b = v.b;
            counter.moveCtor++;
        }

        TestClass& operator=(const TestClass& v)
        {
            this->a = v.a;
            this->b = v.b;
            counter.copyAssignment++;
            return *this;
        }

        TestClass& operator=(TestClass&& v)
        {
            this->a = v.a;
            this->b = v.b;
            counter.moveAssignment++;
            return *this;
        }

        ~TestClass()
        {
            counter.dtor++;
        }

        void Increase()
        {
            a += 12;
            b += 819;
        }

        int a;
        int b;
        static counter_t counter;
    };

    void SetUp() override
    {
        iox::memory::UntypedRelativePointer::registerPtr(memory, 4096);
    }
    void TearDown() override
    {
        iox::memory::UntypedRelativePointer::unregisterAll();
    }

    ChunkManagement* GetChunkManagement(void* memoryChunk)
    {
        ChunkManagement* v = static_cast<ChunkManagement*>(chunkMgmtPool.getChunk());

        auto chunkSettingsResult = ChunkSettings::create(USER_PAYLOAD_SIZE, iox::CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT);
        EXPECT_FALSE(chunkSettingsResult.has_error());
        if (chunkSettingsResult.has_error())
        {
            return nullptr;
        }
        auto& chunkSettings = chunkSettingsResult.value();

        ChunkHeader* chunkHeader = new (memoryChunk) ChunkHeader(mempool.getChunkSize(), chunkSettings);
        new (v) ChunkManagement{chunkHeader, &mempool, &chunkMgmtPool};
        return v;
    }

    int ResetCounter()
    {
        TestClass::counter = counter_t();
        return 0;
    }

    int resetCounter = ResetCounter();

    static constexpr uint32_t USER_PAYLOAD_SIZE{64U};

    char memory[4096U];
    iox::posix::Allocator allocator{memory, 4096U};
    MemPool mempool{sizeof(ChunkHeader) + USER_PAYLOAD_SIZE, 10U, allocator, allocator};
    MemPool chunkMgmtPool{64U, 10U, allocator, allocator};

    void* memoryChunk{mempool.getChunk()};
    ChunkManagement* chunkManagement = GetChunkManagement(memoryChunk);
    SharedChunk chunk{chunkManagement};

    void* memoryChunk2{mempool.getChunk()};
    ChunkManagement* chunkManagement2 = GetChunkManagement(memoryChunk2);
    SharedChunk chunk2{chunkManagement2};

    void* memoryChunk3{mempool.getChunk()};
    ChunkManagement* chunkManagement3 = GetChunkManagement(memoryChunk3);
    SharedChunk chunk3{chunkManagement3};

    void* memoryChunk4{mempool.getChunk()};
    ChunkManagement* chunkManagement4 = GetChunkManagement(memoryChunk4);
    SharedChunk chunk4{chunkManagement4};

    SharedPointer<int> sut = SharedPointer<int>::create(chunk, 42).value();
    SharedPointer<TestClass> sutComplex = SharedPointer<TestClass>::create(chunk2, 1337, 851).value();
};

SharedPointer_Test::counter_t SharedPointer_Test::TestClass::counter;

TEST_F(SharedPointer_Test, DefaultCTor)
{
    ::testing::Test::RecordProperty("TEST_ID", "035f3c9f-4b42-4a67-baae-a4347cd482cc");
    EXPECT_THAT(SharedPointer_Test::TestClass::counter.ctor, Eq(1));
}

TEST_F(SharedPointer_Test, ConstGetMethod)
{
    ::testing::Test::RecordProperty("TEST_ID", "c97a8b0c-bbf0-4ad1-8bb8-4c85c806478a");
    EXPECT_THAT(*const_cast<const SharedPointer<int>&>(sut).get(), Eq(42));
}

TEST_F(SharedPointer_Test, GetMethod)
{
    ::testing::Test::RecordProperty("TEST_ID", "5b3069e1-3ded-46b4-b1cd-bfc44098adcb");
    *sut.get() = 7781;
    EXPECT_THAT(*sut.get(), Eq(7781));
}

TEST_F(SharedPointer_Test, ConstArrowOperator)
{
    ::testing::Test::RecordProperty("TEST_ID", "d44bb68e-d87f-4996-a20f-7ee5602c184a");
    EXPECT_THAT(const_cast<const SharedPointer<TestClass>&>(sutComplex)->a, Eq(1337));
}

TEST_F(SharedPointer_Test, ArrowOperator)
{
    ::testing::Test::RecordProperty("TEST_ID", "17ca6efe-ba9e-4fed-af2d-676939873250");
    sutComplex->Increase();
    EXPECT_THAT(sutComplex->a, Eq(1349));
}

TEST_F(SharedPointer_Test, ConstStarOperator)
{
    ::testing::Test::RecordProperty("TEST_ID", "587cc118-094c-4390-8fce-66ae3a95e93d");
    EXPECT_THAT((*const_cast<const SharedPointer<TestClass>&>(sutComplex)).b, Eq(851));
}

TEST_F(SharedPointer_Test, StarOperator)
{
    ::testing::Test::RecordProperty("TEST_ID", "ec938d1e-dcef-40fb-b1e8-f56e7265c014");
    (*sut)++;
    EXPECT_THAT(*sut, Eq(43));
}

TEST_F(SharedPointer_Test, CopyConstructor)
{
    ::testing::Test::RecordProperty("TEST_ID", "0e2ed79c-d4a5-4702-9aa1-240f205274e6");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 313, 1313).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1
        {
            SharedPointer<TestClass> sut4(sut3);
            EXPECT_THAT(sut4->a, Eq(313));
            EXPECT_THAT(sut4->b, Eq(1313));

            EXPECT_THAT(TestClass::counter.ctor, Eq(2));
            EXPECT_THAT(TestClass::counter.dtor, Eq(0));
            EXPECT_THAT(TestClass::counter.moveCtor, Eq(0));
            EXPECT_THAT(TestClass::counter.copyCtor, Eq(0));
            EXPECT_THAT(TestClass::counter.moveAssignment, Eq(0));
            EXPECT_THAT(TestClass::counter.copyAssignment, Eq(0));
        }
        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(1));
}

TEST_F(SharedPointer_Test, MoveConstructor)
{
    ::testing::Test::RecordProperty("TEST_ID", "183d0ce3-a078-4bab-95f5-87b0da1e9842");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 15, 25).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1
        {
            SharedPointer<TestClass> sut4(std::move(sut3));
            EXPECT_THAT(sut4->a, Eq(15));
            EXPECT_THAT(sut4->b, Eq(25));

            EXPECT_THAT(TestClass::counter.ctor, Eq(2));
            EXPECT_THAT(TestClass::counter.dtor, Eq(0));
            EXPECT_THAT(TestClass::counter.moveCtor, Eq(0));
            EXPECT_THAT(TestClass::counter.copyCtor, Eq(0));
            EXPECT_THAT(TestClass::counter.moveAssignment, Eq(0));
            EXPECT_THAT(TestClass::counter.copyAssignment, Eq(0));
        }
        EXPECT_THAT(TestClass::counter.dtor, Eq(1));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(1));
}

TEST_F(SharedPointer_Test, CopyAssignment)
{
    ::testing::Test::RecordProperty("TEST_ID", "fafcefb2-b599-4862-bf56-6ad6d593d1a5");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1

        auto sut4 = SharedPointer<TestClass>::create(chunk4, 3, 4).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(3));

        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        sut4 = sut3;
        EXPECT_THAT(TestClass::counter.dtor, Eq(1));
        EXPECT_THAT(sut4->a, Eq(1));
        EXPECT_THAT(sut4->b, Eq(2));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(2));
}

TEST_F(SharedPointer_Test, MoveAssignment)
{
    ::testing::Test::RecordProperty("TEST_ID", "3be4dd7a-66cf-458c-9b9c-55459b02e75c");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1

        auto sut4 = SharedPointer<TestClass>::create(chunk4, 3, 4).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(3));

        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        sut4 = std::move(sut3);
        EXPECT_THAT(TestClass::counter.dtor, Eq(1));

        EXPECT_THAT(sut4->a, Eq(1));
        EXPECT_THAT(sut4->b, Eq(2));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(2));
}

TEST_F(SharedPointer_Test, CopyToEmpty)
{
    ::testing::Test::RecordProperty("TEST_ID", "94ab4d3f-1faf-4be8-bd04-b78c7f4850a8");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1

        auto sut4 = SharedPointer<TestClass>();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2));

        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        sut4 = sut3;
        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        EXPECT_THAT(sut4->a, Eq(1));
        EXPECT_THAT(sut4->b, Eq(2));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(1));
}

TEST_F(SharedPointer_Test, CopyFromEmpty)
{
    ::testing::Test::RecordProperty("TEST_ID", "ee9dddea-0c80-44df-9dd0-5c9d4d4116ae");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1

        auto sut4 = SharedPointer<TestClass>();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2));

        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        sut3 = sut4;
        EXPECT_THAT(TestClass::counter.dtor, Eq(1));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(1));
}

TEST_F(SharedPointer_Test, MoveToEmpty)
{
    ::testing::Test::RecordProperty("TEST_ID", "fae2118e-4a8d-4b59-bfcb-6819c5728e0c");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1

        auto sut4 = SharedPointer<TestClass>();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2));

        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        sut4 = std::move(sut3);
        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        EXPECT_THAT(sut4->a, Eq(1));
        EXPECT_THAT(sut4->b, Eq(2));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(1));
}

TEST_F(SharedPointer_Test, MoveFromEmpty)
{
    ::testing::Test::RecordProperty("TEST_ID", "d9b1a79c-a949-4532-a86b-ed49e7b5a0bb");
    {
        auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2)); // sutComplex is 1

        auto sut4 = SharedPointer<TestClass>();
        EXPECT_THAT(TestClass::counter.ctor, Eq(2));

        EXPECT_THAT(TestClass::counter.dtor, Eq(0));
        sut3 = std::move(sut4);
        EXPECT_THAT(TestClass::counter.dtor, Eq(1));
    }
    EXPECT_THAT(TestClass::counter.dtor, Eq(1));
}

TEST_F(SharedPointer_Test, DefaultCTorProvidesInvalidSharedPointer)
{
    ::testing::Test::RecordProperty("TEST_ID", "b1183195-6829-48d9-96fd-caddaa7e9155");
    EXPECT_THAT(static_cast<bool>(SharedPointer<int>()), Eq(false));
}

TEST_F(SharedPointer_Test, SharedPointerWithContentIsValid)
{
    ::testing::Test::RecordProperty("TEST_ID", "df031cdb-2cbe-4ef9-84ae-e177594e1941");
    auto sut3 = SharedPointer<TestClass>::create(chunk3, 1, 2).value();
    EXPECT_THAT(static_cast<bool>(sut3), Eq(true));
}

} // namespace


text:
"""
Classes implementing logic related to the prior distribution
:math:`p_\\theta(\\mathbf{z})` in the VAE framework
"""
__authors__ = "Vincent Dumoulin"
__copyright__ = "Copyright 2014, Universite de Montreal"
__credits__ = ["Vincent Dumoulin"]
__license__ = "3-clause BSD"
__maintainer__ = "Vincent Dumoulin"
__email__ = "pylearn-dev@googlegroups"

import numpy
import theano
import theano.tensor as T
from theano.compat.python2x import OrderedDict
from pylearn2.models import Model
from pylearn2.utils.rng import make_theano_rng
from pylearn2.utils import sharedX, wraps

pi = sharedX(numpy.pi)

class Prior(Model):
    """
    Abstract class implementing methods related to the prior distribution
    :math:`p_\\theta(\\mathbf{z})` for the VAE framework

    Parameters
    ----------
    See `Model`
    """
    def get_vae(self):
        """
        Returns the VAE that this `Prior` instance belongs to, or None
        if it has not been assigned to a VAE yet.
        """
        if hasattr(self, 'vae'):
            return self.vae
        else:
            return None

    def set_vae(self, vae):
        """
        Assigns this `Prior` instance to a VAE.

        Parameters
        ----------
        vae : pylearn2.models.vae.VAE
            VAE to assign to
        """
        if self.get_vae() is not None:
            raise RuntimeError("this `Prior` instance already belongs to "
                               "another VAE")
        self.vae = vae
        self.rng = self.vae.rng
        self.theano_rng = make_theano_rng(int(self.rng.randint(2 ** 30)),
                                          which_method=["normal", "uniform"])
        self.batch_size = vae.batch_size

    def initialize_parameters(self, nhid):
        """
        Initialize model parameters.

        Parameters
        ----------
        nhid : int
            Number of latent units for z
        """
        raise NotImplementedError(str(self.__class__) + " does not implement "
                                  "initialize_parameters")

    def monitoring_channels_from_prior_params(self):
        """
        Get monitoring channels from the parameters of the prior distribution.

        By default, no monitoring channel is computed.
        """
        return OrderedDict()

    def sample_from_p_z(self, num_samples, **kwargs):
        """
        Samples from the prior distribution :math:`p_\\theta(\\mathbf{z})`

        Parameters
        ----------
        num_samples : int
            Number of samples

        Returns
        -------
        z : tensor_like
            Sample from the prior distribution
        """
        raise NotImplementedError(str(self.__class__) + " does not implement "
                                  "sample_from_p_z.")

    def log_p_z(self, z):
        """
        Computes the log-prior probabilities of `z`

        Parameters
        ----------
        z : tensor_like
            Posterior samples

        Returns
        -------
        log_p_z : tensor_like
            Log-prior probabilities
        """
        raise NotImplementedError(str(self.__class__) + " does not implement "
                                  "log_p_z.")

class DiagonalGaussianPrior(Prior):
    """
    Implements a gaussian prior diagonal covariance matrix, i.e.

    .. math::
        p_\\theta(\\mathbf{z})
        = \\prod_i \\exp(-(z_i - \\mu_i)^2 / (2\\sigma_i^2 ) /
                   (\\sqrt{2 \\pi} \\sigma_i)

    Parameters
    ----------
    See `Model`
    """
    @wraps(Prior.initialize_parameters)
    def initialize_parameters(self, nhid):
        self.nhid = nhid
        self.prior_mu = sharedX(numpy.zeros(self.nhid), name="prior_mu")
        self.log_prior_sigma = sharedX(numpy.zeros(self.nhid),
                                       name="prior_log_sigma")
        self._params = [self.prior_mu, self.log_prior_sigma]

    @wraps(Prior.sample_from_p_z)
    def sample_from_p_z(self, num_samples):
        return self.theano_rng.normal(size=(num_samples, self.nhid),
                                      avg=self.prior_mu,
                                      std=T.exp(self.log_prior_sigma),
                                      dtype=theano.config.floatX)

    @wraps(Prior.log_p_z)
    def log_p_z(self, z):
        return -0.5 * (
            T.log(2 * pi * T.exp(2 * self.log_prior_sigma)) +
            ((z - self.prior_mu) / T.exp(self.log_prior_sigma)) ** 2
        ).sum(axis=2)


text:
Montric.LoginRegisterController = Ember.Controller.extend({
    needs: ['user'],

    accountNameValidationError: null,
    firstNameValidationError: null,
    lastNameValidationError: null,
    countryValidationError: null,
    companyValidationError: null,
    usageValidationError: null,

    actions: {
        registerNewAccount: function() {
            var validated = true;
            if (!this.validateFieldContent(this.get('accountName'), 3)) {
                this.set('accountNameValidationError', 'Account Name must contain at least 3 characters!');
                validated = false;
            } else {
                this.set('accountNameValidationError', null);
            }

            if (!this.validateFieldContent(this.get('firstName'), 3)) {
                this.set('firstNameValidationError', 'First Name must contain at least 3 characters!');
                validated = false;
            } else {
                this.set('firstNameValidationError', null);
            }

            if (!this.validateFieldContent(this.get('lastName'), 3)) {
                this.set('lastNameValidationError', 'Last Name must contain at least 3 characters!');
                validated = false;
            } else {
                this.set('lastNameValidationError', null);
            }

            if (!this.validateFieldContent(this.get('country'), 3)) {
                this.set('countryValidationError', 'Country must contain at least 3 characters!');
                validated = false;
            } else {
                this.set('countryValidationError', null);
            }

            if (!this.validateFieldContent(this.get('company'), 2)) {
                this.set('companyValidationError', 'Company must contain at least 2 characters!');
                validated = false;
            } else {
                this.set('companyValidationError', null);
            }

            if (validated) {
                var controller = this;

                $.ajax({
                    type: 'POST',
                    url: '/user/auth/register',
                    data: JSON.stringify({
                        accountName: this.get('accountName'),
                        firstName: this.get('firstName'),
                        lastName: this.get('lastName'),
                        country: this.get('country'),
                        company: this.get('company'),
                        usage: this.get('usage'),
                        authLevel: this.get('authLevel')
                    }),
                    success: function(res, status, xhr) {
                        console.log(res);
                        if (res.uuidToken && res.registered === true) {
                            console.log('user registered: getting user with token: ' + res.uuidToken);
                            controller.set('controllers.user.uuidToken', res.uuidToken);
                        } else {
                            alert('Unable to Register');
                        }

                    },
                    error: function(xhr, status, err) { console.log("error: " + status + " error: " + err); }
                });
            }
        }
    },

    validateFieldContent: function(fieldContent, fieldLength) {
        return (fieldContent != null && fieldContent.length >= fieldLength);
    }

});


text:
namespace base {
class RunLoop;
}

namespace gfx {
class Point;
}

// A collections of functions designed for use with content_browsertests and
// browser_tests.
// TO BE CLEAR: any function here must work against both binaries. If it only
// works with browser_tests, it should be in chrome\test\base\ui_test_utils.h.
// If it only works with content_browsertests, it should be in
// content\test\content_browser_test_utils.h.

namespace content {

class MessageLoopRunner;
class WebContents;

// Simulates clicking at the center of the given tab asynchronously.
void SimulateMouseClick(WebContents* web_contents);

// Simulates asynchronously a mouse enter/move/leave event.
void SimulateMouseEvent(WebContents* web_contents,
                        WebKit::WebInputEvent::Type type,
                        const gfx::Point& point);

// Sends a key press asynchronously.
void SimulateKeyPress(WebContents* web_contents,
                      ui::KeyboardCode key,
                      bool control,
                      bool shift,
                      bool alt,
                      bool command);

// Watches title changes on a tab, blocking until an expected title is set.
class TitleWatcher : public NotificationObserver {
 public:
  // |web_contents| must be non-NULL and needs to stay alive for the
  // entire lifetime of |this|. |expected_title| is the title that |this|
  // will wait for.
  TitleWatcher(WebContents* web_contents,
               const string16& expected_title);
  virtual ~TitleWatcher();

  // Adds another title to watch for.
  void AlsoWaitForTitle(const string16& expected_title);

  // Waits until the title matches either expected_title or one of the titles
  // added with  AlsoWaitForTitle.  Returns the value of the most recently
  // observed matching title.
  const string16& WaitAndGetTitle() WARN_UNUSED_RESULT;

 private:
  // NotificationObserver
  virtual void Observe(int type,
                       const NotificationSource& source,
                       const NotificationDetails& details) OVERRIDE;

  WebContents* web_contents_;
  std::vector<string16> expected_titles_;
  NotificationRegistrar notification_registrar_;
  scoped_refptr<MessageLoopRunner> message_loop_runner_;

  // The most recently observed expected title, if any.
  string16 observed_title_;

  bool expected_title_observed_;
  bool quit_loop_on_observation_;

  DISALLOW_COPY_AND_ASSIGN(TitleWatcher);
};

}  // namespace content

#endif  // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_


text:
class CustomizedDictionary:
    def __init__(self):
        self._pos2words = { 'default': {}, 'custom': {}}

    def add_dictionary(self, words, tag):
        if type(words) == str:
            words = [words]
        wordset = self._pos2words['default'].get(tag, set())

        wordset.update(set(words))
        self._pos2words['default'][tag] = wordset

    def add_custom_dictionary(self, words, tag):
        if type(words) == str:
            words = [words]
        wordset = self._pos2words['custom'].get(tag, set())
        wordset.update(set(words))
        self._pos2words['custom'][tag] = wordset

    def load_dictionary(self, fname_list, tag):
        def load(fname):
            try:
                with open(fname, encoding='utf-8') as f:
                    words = {word.strip() for word in f}
                    return words
            except Exception as e:
                print('load_dictionary error: %s'%e)
                return []

        wordset = self._pos2words["default"].get(tag, set())
        for fname in fname_list:
            wordset.update(load(fname))
        self._pos2words['default'][tag] = wordset

    def get_tags(self, word):
        return {tag for tag, words in self._pos2words['default'].items() if word in words}

    def is_tag(self, word, tag):
        return word in self._pos2words['default'].get(tag, {})

    def is_custom_tag(self, word, tag):
        return word in self._pos2words['custom'].get(tag, {})


text:
/*global CanvasShapes*/

CanvasShapes.SceneInterface = (function () {

    /**
     * A scene interface class.
     *
     * @throws {CanvasShapes.Error} 8008
     */
    var SceneInterface = function () {
        throw new CanvasShapes.Error(8008);
    };

    CanvasShapes.Class.extend(SceneInterface.prototype, {

        _className: 'CanvasShapes.SceneInterface',

        /**
         * Initialises event listeners.
         *
         * @throws {CanvasShapes.Error} 9041
         */
        initialiseListeners: function () {
            throw new CanvasShapes.Error(9041);
        },

        /**
         * Checks whether this scene should be rendered off screen, as global
         * config value (`RENDER_OFF_SCREEN`) can be surpassed by internal scene
         * config value. The method itself only checks
         * `this._shouldRenderOffScreen`, which should be set on initialisation.
         *
         * @throws {CanvasShapes.Error} 9062
         *
         * @return {Boolean}
         */
        shouldRenderOffScreen: function () {
            throw new CanvasShapes.Error(9062);
        },

        /**
         * Renders all the layers, on which there are shapes which requested
         * rendering.
         *
         * If the `shape` is passed it will re-render only the layer associated
         * with this shape. Due to canvas element implementation it's not
         * possible to re-render one shape only. Also it will re-render this
         * `shape` immediately no matter whether it has requested rendering or
         * not. It will also keep it on the list of shapes which requested
         * rendering.
         *
         * [WARNING] Due to performance reasons, this method doesn't perform any
         * type checking when trying to render. It assuems all the passed
         * arguments are of the correct type.
         *
         * @throws {CanvasShapes.Error} 9018
         *
         * @param {CanvasShapes.RenderingInterface} shape
         */
        render: function (shape) {
            throw new CanvasShapes.Error(9018);
        },

        /**
         * Creates new layer on the scene. `width`, `height`, `left` and `top`,
         * parameters will be passed to CanvasShapes.SceneLayer constructor.
         *
         * `shape` parameter if passed, allows you to add shape automatically
         * to the scene with associated newly created layer. You need to be
         * careful though, as the shape can be a child of a group, and adding
         * it as a standalone shape to the scene will cause it to render twice,
         * and in some cases can cause infinite loop which will raise an error.
         *
         * Best practice to obtain a separate layer for a shape being a child of
         * a group, is to call this method without passing a `shape` parameter,
         * which will create a layer and register it on a scene, but shape will
         * not be rendered as a standalone object.
         *
         * @throws {CanvasShapes.Error} 9019
         *
         * @param {CanvasShapes.ShapeInterface} shape [OPTIONAL]
         * @param {integer} width   [OPTIONAL]
         * @param {integer} height  [OPTIONAL]
         * @param {integer} left    [OPTIONAL]
         * @param {integer} top     [OPTIONAL]
         *
         * @return {CanvasShapes.SceneLayerInterface}
         */
        newLayer: function (shape, width, height, left, top) {
            throw new CanvasShapes.Error(9019);
        },

        /**
         * Allows you to retrieve a layer specific for a shape or layer.
         * If `shapeOrLayer` is null it will return default layer for a scene.
         * getLayer called without any arguments should ALWAYS return a
         * layer. By passing a layer you can establish whether the layer is
         * already a part of a scene - it will return `null` if it's not.
         *
         * @throws {CanvasShapes.Error} 9032
         *
         * @param {[
         *     CanvasShapes.ShapeInterface,
         *     CanvasShapes.SceneLayerInterface
         * ]} shapeOrLayer [OPTIONAL]
         * @return {CanvasShapes.SceneLayerInterface}
         */
        getLayer: function (shapeOrLayer) {
            throw new CanvasShapes.Error(9032);
        },

        /**
         * This method should only be used after the shape is already added
         * through CanvasShapes.Renderer instance. Adding shapes only to the
         * scene is not advised because it's not being registered in Renderer
         * and therefore cannot be controlled and rendered from there.
         *
         * Allows you to add a shape with its corresponding layer to the scene.
         * It's very useful when within one scene you want to have a different
         * configuration of layers than in a second scene of the same renderer.
         *
         * You need to be careful, as the shape can be a child of a group, and
         * adding it as a standalone shape to the scene will cause it to render
         * twice, and in some cases can cause infinite loop which will raise an
         * error eventually (after stack exceeds).
         *
         * @throws {CanvasShapes.Error} 9068
         *
         * @param {CanvasShapes.ShapeInterface} shape
         * @param {CanvasShapes.SceneLayerInterface} layer [OPTIONAL]
         *
         * @return {CanvasShapes.SceneLayerInterface}
         */
        addShape: function (shape, layer) {
            throw new CanvasShapes.Error(9068);
        },

        /**
         * Method allowing the shape to request the layer shape is on, to be
         * re-rendered. It will be rendered when the next animation frame is
         * requested. If the same shape is added twice, it will override the
         * previous entry. Instead of `animationFrame` you can simply pass a
         * callback function.
         *
         * `beforeRender` allows you to pass a function which will be executed
         * right before rendering. The function must be self-contained, bound if
         * needed, as no context and no arguments will be applied. Bear in mind
         * that second subsequent calls will override the first beforeRender
         * hook you passed.
         *
         * [WARNING] Due to performance reasons, this method doesn't perform any
         * type checking. It assuems all the passed arguments are of the correct
         * type. It does though check whether shape is associated with a layer.
         *
         * @throws {CanvasShapes.Error} 9048
         *
         * @param {CanvasShapes.Shape}               shape
         * @param {CanvasShapes.AnimationFrame}      animationFrame [OPTIONAL]
         * @param {function}                         beforeRender [OPTIONAL]
         */
        requestRendering: function (shape, animationFrame, beforeRender) {
            throw new CanvasShapes.Error(9048);
        },

        /**
         * Gets handlers which can allow a shape to obtain some functionality
         * from a scene. Current implementation includes following handlers:
         * - newLayer
         * - getLayer
         * - addShape
         * - requestRendering
         * - on
         * - off
         * - dispatch
         *
         * @throws {CanvasShapes.Error} 9034
         *
         * @return {object}
         */
        getSceneInterfaceHandlers: function () {
            throw new CanvasShapes.Error(9034);
        },

        /**
         * Returns width of the scene.
         *
         * @throws {CanvasShapes.Error} 9020
         *
         * @return {integer}
         */
        getWidth: function () {
            throw new CanvasShapes.Error(9020);
        },

        /**
         * Returns height of the scene.
         *
         * @throws {CanvasShapes.Error} 9021
         *
         * @return {integer}
         */
        getHeight: function () {
            throw new CanvasShapes.Error(9021);
        },

        /**
         * Returns HTML container for this scene.
         *
         * @throws {CanvasShapes.Error} 9022
         *
         * @return {object}
         */
        getDom: function () {
            throw new CanvasShapes.Error(9022);
        },

        /**
         * Attaches an event handler to the scene. It prevents you from adding
         * the same handler for the second time.
         *
         * The handler should be ready to accept 1 argument which is
         * `CanvasShapes.EventAbstract` object.
         *
         * Returns boolean with the result of attaching.
         *
         * @throws {CanvasShapes.Error} 9038
         *
         * @param {string}   eventType
         * @param {function} handler
         * @param {object}   context
         *
         * @return {boolean}
         */
        on: function (eventType, handler, context) {
            throw new CanvasShapes.Error(9038);
        },

        /**
         * Allows you to detach the event handler from the scene.
         *
         * When `handlerOrType` is a string it will detach all the handlers,
         * matching passed type.
         *
         * If it's a function, it will detach only the same handler (comparison
         * operator here is `===`). If the second argument is passed, it will
         * remove only the handler of the specified type.
         *
         * It will return number of detached handlers.
         *
         * @throws {CanvasShapes.Error} 9039
         *
         * @param {[string,function]} handlerOrType
         * @param {string}            eventType [OPTIONAL]
         *
         * @return {integer}
         */
        off: function (handlerOrType, eventType) {
            throw new CanvasShapes.Error(9039);
        },

        /**
         * Its job is to trigger all the handlers attached using `on()` method
         * of the passed `type`. `type` attribute must exist within passed
         * `event` argument, or `event` must be a `string` containing a type.
         *
         * It also possible (and very handy for custom events) to pass ready to
         * use CanvasShapes.EventAbstract object. This way any event can be
         * triggered.
         *
         * @throws {CanvasShapes.Error} 9040
         *
         * @param {[Event,object,string,CanvasShapes.EventAbstract]}  event
         */
        dispatch: function (event) {
            throw new CanvasShapes.Error(9040);
        }
    });

    return SceneInterface;
}());


text:
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title><{if $tpl_page_title}><{elseif $MSITE}><{$MSITE.title}><{else}><{$CONFIG.mobile.title}><{/if}></title>
    <link rel="stylesheet" type="text/css" href="%THEME%/weixin/static/style/font-awesome.css" media="all">
	<link rel="stylesheet" type="text/css" href="%THEME%/weixin/static/style/mobile_module.css" media="all">
    <script type="text/javascript" src="%THEME%/weixin/static/script/jq.2.0.3.min.js"></script>
    <script type="text/javascript" src="%THEME%/weixin/static/script/prefixfree.min.js"></script>
    <script type="text/javascript" src="%THEME%/weixin/static/script/m/dialog.js"></script>
    <script type="text/javascript" src="%THEME%/weixin/static/script/m/flipsnap.min.js"></script>
    <script type="text/javascript" src="%THEME%/weixin/static/script/m/wx.js"></script>
    <link rel="shortcut icon" href="/favicon.ico">
</head>


text:
module Rack::App::BundledExtensions
  require "rack/app/bundled_extensions/logger"
  require "rack/app/bundled_extensions/payload"
end


text:
AliFourPion *AddTaskFourPion(
			     Short_t CollisionType=0,
			     Bool_t MCcase=kFALSE,
			     Bool_t TabulatePairs=kFALSE,
			     Int_t CentBinLowLimit=0,
			     Int_t CentBinHighLimit=1,
			     TString StWeightName="alien:///alice/cern.ch/user/d/dgangadh/WeightFile_FourPion.root",
			     TString StMomResName="alien:///alice/cern.ch/user/d/dgangadh/MomResFile_FourPion.root",
			     TString StKName="alien:///alice/cern.ch/user/d/dgangadh/KFile_FourPion.root",
			     TString StMuonName="alien:///alice/cern.ch/user/d/dgangadh/MuonCorrection_FourPion.root",
			     TString StEAName="alien:///alice/cern.ch/user/d/dgangadh/c3EAfile.root"
			     ) {

  //===========================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskFourPion", "No analysis manager to connect to.");
    return NULL;
  }

  cout<<"Start creating the FourPion task"<<endl;
  //____________________________________________//
  // Create task
  AliFourPion *FourPionTask = new AliFourPion("FourPionTask");
  if(!FourPionTask) return NULL;
  FourPionTask->SetLEGOCase(kTRUE);
  FourPionTask->SetMCdecision(MCcase);
  FourPionTask->SetCollisionType(CollisionType);
  FourPionTask->SetGenerateSignal(kFALSE);
  FourPionTask->SetTabulatePairs(TabulatePairs);
  FourPionTask->SetCentBinRange(CentBinLowLimit, CentBinHighLimit);
  FourPionTask->SetRMax(11);
  FourPionTask->SetfcSq(0.7);
  FourPionTask->SetFilterBit(7);
  FourPionTask->SetMaxChi2NDF(10);
  FourPionTask->SetMinTPCncls(0);
  FourPionTask->SetPairSeparationCutEta(0.02);
  FourPionTask->SetPairSeparationCutPhi(0.045);
  FourPionTask->SetNsigmaTPC(2.0);
  FourPionTask->SetNsigmaTOF(2.0);
  //
  FourPionTask->SetMixedChargeCut(kFALSE);
  FourPionTask->SetMinPt(0.16);
  FourPionTask->SetMaxPt(1.0);
  FourPionTask->SetKT3transition(0.3);
  FourPionTask->SetKT4transition(0.3);
  FourPionTask->Setq2Binning(kFALSE);
  FourPionTask->Setq2Index(0);
  FourPionTask->Setq2CutLow(0.55);
  FourPionTask->Setq2CutHigh(1.25);

  mgr->AddTask(FourPionTask);

  cout<<"Finished creating the FourPion task"<<endl;
  // Create ONLY the output containers for the data produced by the task.
  // Get and connect other common input/output containers via the manager as below
  //==============================================================================

  TString outputFileName = AliAnalysisManager::GetCommonFileName();
  outputFileName += ":PWGCF.outputFourPionAnalysis.root";
  AliAnalysisDataContainer *coutFourPion = mgr->CreateContainer("FourPionOutput", TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data());
  mgr->ConnectInput(FourPionTask, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput(FourPionTask, 1, coutFourPion);

  TFile *inputFileWeight = 0;
  TFile *inputFileMomRes = 0;
  TFile *inputFileFSI = 0;
  TFile *inputFileMuon = 0;
  TFile *inputFileEA = 0;

  if(!TabulatePairs){
    cout<<"Start AddTask WeightFile read"<<endl;
    inputFileWeight = TFile::Open(StWeightName,"OLD");
    if (!inputFileWeight){
      cout << "Requested file:" << inputFileWeight << " was not opened. ABORT." << endl;
      return NULL;
    }
    ////////////////////////////////////////////////////
    // C2 Weight File
    const Int_t ktbins_temp = FourPionTask->GetNumKtBins();
    const Int_t cbins_temp = FourPionTask->GetNumCentBins();
    const Int_t ktbins = ktbins_temp;
    const Int_t cbins = cbins_temp;

    TH3F *weightHisto[ktbins][cbins];
    TH3F *weightHisto2[ktbins][cbins];
    TH2F *weightHistoOneD[cbins];
    for(Int_t i=0; i<ktbins; i++){
      for(Int_t j=0; j<cbins; j++){
	for(Int_t q2bin=0; q2bin<2; q2bin++){
	  TString name = "Weight_Kt_";
	  name += i;
	  name += "_Ky_0_M_";
	  name += j;
	  name += "_ED_";
	  name += q2bin;
	  if(q2bin==0) {
	    if(FourPionTask->GetCollisionType()!=0 && j>0) {
	      weightHisto[i][j] = (TH3F*)weightHisto[i][0]->Clone();
	    }else {
	      if(i<ktbins) weightHisto[i][j] = (TH3F*)inputFileWeight->Get(name);
	    }
	  }else{
	    if(i<ktbins) {
	      if(FourPionTask->GetCollisionType()!=0 && j>0) weightHisto2[i][j] = (TH3F*)weightHisto2[i][0]->Clone();
	      else weightHisto2[i][j] = (TH3F*)inputFileWeight->Get(name);
	    }
	  }
	}
      }
    }
    // Qinv weights
    for(Int_t j=0; j<cbins; j++){
      TString name = "Weight_M_";
      name += j;
      name.Append("_1D");
      if(FourPionTask->GetCollisionType()!=0 && j>0) {
	weightHistoOneD[j] = (TH2F*)weightHistoOneD[0]->Clone();
      }else{
	weightHistoOneD[j] = (TH2F*)inputFileWeight->Get(name);
      }
    }
    FourPionTask->SetWeightArrays( kTRUE, weightHisto, weightHisto2, weightHistoOneD );
    cout<<"End AddTask WeightFile read"<<endl;
    //
    //
    cout<<"Start AddTask EA File read"<<endl;
    inputFileEA = TFile::Open(StEAName,"OLD");
    if (!inputFileEA){
      cout << "Requested file:" << inputFileEA << " was not opened. ABORT." << endl;
      return NULL;
    }
    TH3D *PbPbEA[2];
    TH3D *pPbEA[2];
    TH3D *ppEA[2];
    PbPbEA[0] = (TH3D*)inputFileEA->Get("PbPbEA_c3");
    pPbEA[0] = (TH3D*)inputFileEA->Get("pPbEA_c3");
    ppEA[0] = (TH3D*)inputFileEA->Get("ppEA_c3");
    //
    PbPbEA[1] = (TH3D*)inputFileEA->Get("PbPbEA_C3");
    pPbEA[1] = (TH3D*)inputFileEA->Get("pPbEA_C3");
    ppEA[1] = (TH3D*)inputFileEA->Get("ppEA_C3");
    //
    FourPionTask->Setc3FitEAs( kTRUE, PbPbEA, pPbEA, ppEA );
    cout<<"End AddTask WeightFile read"<<endl;
    ////////////////////////////////////////////////////
  }// TabulatePairs check

  if(!MCcase && !TabulatePairs){
    cout<<"Start AddTask MomRes File read"<<endl;
    inputFileMomRes = TFile::Open(StMomResName,"OLD");
    if (!inputFileMomRes){
      cout << "Requested file:" << inputFileMomRes << " was not opened. ABORT." << endl;
      return NULL;
    }
    ////////////////////////////////////////////////////
    // Momentum Resolution File
    TH2D *momResHisto2DSC = 0;
    TH2D *momResHisto2DMC = 0;
    momResHisto2DSC = (TH2D*)inputFileMomRes->Get("MRC_C2_SC");
    momResHisto2DMC = (TH2D*)inputFileMomRes->Get("MRC_C2_MC");
    FourPionTask->SetMomResCorrections( kTRUE, momResHisto2DSC, momResHisto2DMC );
    cout<<"End AddTask WeightFile read"<<endl;
    ////////////////////////////////////////////////////

    // Muon corrections
    cout<<"Start AddTask MuonCorr File read"<<endl;
    inputFileMuon = TFile::Open(StMuonName,"OLD");
    if (!inputFileMuon){
      cout << "Requested file:" << inputFileMuon << " was not opened. ABORT." << endl;
      return NULL;
    }
    TH2D *muonHisto2D = 0;
    muonHisto2D = (TH2D*)inputFileMuon->Get("WeightmuonCorrection");
    FourPionTask->SetMuonCorrections( kTRUE, muonHisto2D);
    cout<<"End AddTask MuonCorr File read"<<endl;
  }// MCcase and TabulatePairs check

  ////////////////////////////////////////////////////
  // FSI File
  cout<<"Start AddTask FSI File read"<<endl;
  inputFileFSI = TFile::Open(StKName,"OLD");
  if (!inputFileFSI){
    cout << "Requested file:" << inputFileFSI << " was not opened. ABORT." << endl;
    return NULL;
  }
  TH1D *FSIss[13];
  TH1D *FSIos[13];
  for(Int_t index=0; index<13; index++) {
    TString *nameSS=new TString("K2ss_");
    *nameSS += index;
    FSIss[index] = (TH1D*)inputFileFSI->Get(nameSS->Data());
    TString *nameOS=new TString("K2os_");
    *nameOS += index;
    FSIos[index] = (TH1D*)inputFileFSI->Get(nameOS->Data());
    //
    FSIss[index]->SetDirectory(0);
    FSIos[index]->SetDirectory(0);
  }
  //
  FourPionTask->SetFSICorrelations( kTRUE, FSIss, FSIos );
  cout<<"End AddTask FSI File read"<<endl;
  ////////////////////////////////////////////////////

  // Return the task pointer
  return FourPionTask;
}