text:
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

package com.twitter.intellij.pants.settings;

import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;

import com.twitter.intellij.pants.model.PantsExecutionOptions;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

public class PantsExecutionSettings extends ExternalSystemExecutionSettings implements PantsExecutionOptions {
  private final String myName;
  private final boolean myLibsWithSourcesAndDocs;
  private final boolean myUseIdeaProjectJdk;
  private final boolean myUseIntellijCompiler;
  private final Optional<Integer> myIncrementalImportDepth;

  private final boolean myImportSourceDepsAsJars;
  private final List<String> myTargetSpecs;

  private static final String DEFAULT_PROJECT_NAME = null;
  private static final List<String> DEFAULT_TARGET_SPECS = Collections.emptyList();
  private static final boolean DEFAULT_WITH_SOURCES_AND_DOCS = true;
  private static final boolean DEFAULT_USE_IDEA_PROJECT_SDK = false;
  private static final Optional<Integer> DEFAULT_INCREMENTAL_IMPORT = Optional.empty();
  private static final boolean DEFAULT_IMPORT_SOURCE_DEPS_AS_JARS = false;
  private static final boolean DEFAULT_USE_INTELLIJ_COMPILER = false;

  public static PantsExecutionSettings createDefault() {
    return new PantsExecutionSettings(
      DEFAULT_PROJECT_NAME,
      DEFAULT_TARGET_SPECS,
      DEFAULT_WITH_SOURCES_AND_DOCS,
      DEFAULT_USE_IDEA_PROJECT_SDK,
      DEFAULT_IMPORT_SOURCE_DEPS_AS_JARS,
      DEFAULT_INCREMENTAL_IMPORT,
      DEFAULT_USE_INTELLIJ_COMPILER
    );
  }

  public PantsExecutionSettings(
    String name,
    List<String> targetSpecs,
    boolean libsWithSourcesAndDocs,
    boolean useIdeaProjectJdk,
    boolean importSourceDepsAsJars,
    Optional<Integer> enableIncrementalImport,
    boolean useIntellijCompiler
  ){
    myName = name;
    myTargetSpecs = targetSpecs;
    myLibsWithSourcesAndDocs = libsWithSourcesAndDocs;
    myUseIdeaProjectJdk = useIdeaProjectJdk;
    myImportSourceDepsAsJars = importSourceDepsAsJars;
    myIncrementalImportDepth = enableIncrementalImport;
    myUseIntellijCompiler = useIntellijCompiler;
  }

  /**
   * @param targetSpecs             targets explicitly listed from `pants idea-plugin` goal.
   * @param libsWithSourcesAndDocs  whether to import sources and docs when resolving for jars.
   * @param useIdeaProjectJdk       whether to explicitly use the JDK selected in project for Pants compile.
   * @param enableIncrementalImport whether to incrementally import the project.
   */
  public PantsExecutionSettings(
    List<String> targetSpecs,
    boolean libsWithSourcesAndDocs,
    boolean useIdeaProjectJdk,
    boolean importSourceDepsAsJars,
    Optional<Integer> enableIncrementalImport,
    boolean useIntellijCompiler
  ) {
    this(DEFAULT_PROJECT_NAME, targetSpecs, libsWithSourcesAndDocs, useIdeaProjectJdk, importSourceDepsAsJars, enableIncrementalImport, useIntellijCompiler);
  }

  public Optional<String> getProjectName(){
    return Optional.ofNullable(myName)
      .filter(name -> !name.isEmpty());
  }

  @NotNull
  public List<String> getSelectedTargetSpecs() {
    return myTargetSpecs;
  }

  public boolean isLibsWithSourcesAndDocs() {
    return myLibsWithSourcesAndDocs;
  }

  public boolean isUseIdeaProjectJdk() {
    return myUseIdeaProjectJdk;
  }

  public Optional<Integer> incrementalImportDepth() {
    return myIncrementalImportDepth;
  }

  @Override
  public boolean isImportSourceDepsAsJars() {
    return myImportSourceDepsAsJars;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;

    PantsExecutionSettings settings = (PantsExecutionSettings) o;
    return Objects.equals(myUseIdeaProjectJdk, settings.myUseIdeaProjectJdk) &&
           Objects.equals(myIncrementalImportDepth, settings.myIncrementalImportDepth) &&
           Objects.equals(myUseIntellijCompiler, settings.myUseIntellijCompiler) &&
           Objects.equals(myLibsWithSourcesAndDocs, settings.myLibsWithSourcesAndDocs) &&
           Objects.equals(myTargetSpecs, settings.myTargetSpecs);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
      myTargetSpecs,
      myLibsWithSourcesAndDocs,
      myUseIdeaProjectJdk,
      myIncrementalImportDepth,
      myUseIntellijCompiler
    );
  }
}


text:
include(FindPackageHandleStandardArgs)

if (CMAKE_SIZEOF_VOID_P EQUAL 4)
    set (DIRECTXSDK_ARCH x86)
else()
    set (DIRECTXSDK_ARCH x64)
endif()

find_path(DIRECTXSDK_H_PATH NAMES d3d10.h PATHS ENV DXSDK_DIR PATH_SUFFIXES Include NO_DEFAULT_PATH)
find_path(DIRECTXSDK_LIB_PATH NAMES d3dx10d.lib PATHS ENV DXSDK_DIR PATH_SUFFIXES "Lib/${DIRECTXSDK_ARCH}")

# now test for the specific d3d lib versions and set MAX_D3D accordingly
if (EXISTS "${DIRECTXSDK_LIB_PATH}/d3d11.lib")
    set (DIRECTXSDK_MAX_D3D 11)
elseif (EXISTS "${DIRECTXSDK_LIB_PATH}/d3d10.lib")
    set (DIRECTXSDK_MAX_D3D 10)
elseif (EXISTS "${DIRECTXSDK_LIB_PATH}/d39.lib")
    set (DIRECTXSDK_MAX_D3D 9)
else()
    set (DIRECTXSDK_MAX_D3D)
endif()

find_package_handle_standard_args(DIRECTXSDK DEFAULT_MSG DIRECTXSDK_LIB_PATH DIRECTXSDK_H_PATH DIRECTXSDK_MAX_D3D)

mark_as_advanced(DIRECTXSDK_H_PATH DIRECTXSDK_LIB_PATH DIRECTXSDK_ARCH)

# set up output vars
if (DIRECTXSDK_FOUND)
    set (DIRECTXSDK_INCLUDE_DIR ${DIRECTXSDK_H_PATH})
    set (DIRECTXSDK_LIBRARY_DIR ${DIRECTXSDK_LIB_PATH})
else()
    set (DIRECTXSDK_INCLUDE_DIR)
    set (DIRECTXSDK_LIBRARY_DIR)
    set (DIRECTXSDK_MAX_D3D)
endif()

redpajama_set_name: RedPajamaGithub


text:
from control import Control
from containers import ScrollContainer
from Tkinter import Listbox as TkListBox, END, BOTH, LEFT, RIGHT, Y

class ListItems(object):
    def __init__(self, control):
        self._list = control

    def __getitem__(self, index):
        return self.get(index)

    def get(self, index):
        return self._list._ctrl.get(index)

    def add(self, item):
        self.append(item)

    def append(self, item):
        self._list._ctrl.insert(END, item)

    def insert(self, index, item):
        self._list._ctrl.insert(index, item)

    def delete(self, index):
        self._list._ctrl.delete(index)

    def remove(self, item):
        index = self.index(item)
        if index >= 0:
            self.delete(index)

    def clear(self):
        self._list._ctrl.delete(0, END)

    def index(self, item):
        for index, tmp in enumerate(self._list._ctrl.get(0, END)):
            if item == tmp:
                return index
        return -1

    @property
    def count(self):
        return self._list._ctrl.size()

    @property
    def selected_count(self):
        return len(self._list._ctrl.curselection())

    @property
    def selected_keys(self):
        return map(int, self._list._ctrl.curselection())

    @selected_keys.setter
    def selected_keys(self, value):
        self._list._ctrl.select_clear(0, END)
        if value is not None:
            for index in value:
                self._list._ctrl.select_set(index)

    @property
    def selected_values(self):
        return map(self.get, self.selected_keys)

    @selected_values.setter
    def selected_values(self, value):
        self.selected_keys = filter(lambda x: x >= 0, map(self.index, value))

    def selected(self, index):
        return self._list._ctrl.selection_includes(index)

    def select(self, index):
        self._list._ctrl.select_set(index)

    def unselect(self, index):
        self._list._ctrl.select_clear(index)

class BaseListBox(Control):
    def __init__(self, parent, **kwargs):
        Control.__init__(self, TkListBox(parent._frame), **kwargs)
        self._items = ListItems(self)

    @property
    def items(self):
        return self._items

    @property
    def multiple(self):
        return self._control_get('selectmode') in ['extended', 'multiple']

    @multiple.setter
    def multiple(self, value):
        self._control_set('selectmode', 'extended' if value else 'browse')

    @property
    def checkboxes(self):
        return self._control_get('selectmode') == 'multiple'

    @checkboxes.setter
    def checkboxes(self, value):
        if self.multiple and not value:
            self._control_set('selectmode', 'extended')
        elif not value:
            self._control_set('selectmode', 'browse')
        else:
            self._control_set('selectmode', 'multiple')

class ListBox(ScrollContainer):
    def __init__(self, parent, **kwargs):
        ScrollContainer.__init__(self, parent, **kwargs)
        self._init_container(BaseListBox(self, **kwargs))

    # NOTE: ListBox by design implements a faceplate for ListBoxContainer properties
    @property
    def items(self):
        return self._container.items

    @property
    def multiple(self):
        return self._container.multiple

    @multiple.setter
    def multiple(self, value):
        self._container.multiple = value

    @property
    def checkboxes(self):
        return self._container.checkboxes

    @checkboxes.setter
    def checkboxes(self, value):
        self._container.checkboxes = value

    @property
    def popup_menu(self):
        return self._container.popup_menu

    @popup_menu.setter
    def popup_menu(self, value):
        self._container.popup_menu = value


text:
[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash)

A drop-in replacement[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer) for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#features).

Lo-Dash's performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.

## Download

 * [Development build](https://raw.github.com/bestiejs/lodash/v0.9.1/lodash.js)
 * [Production build](https://raw.github.com/bestiejs/lodash/v0.9.1/lodash.min.js)
 * [Underscore build](https://raw.github.com/bestiejs/lodash/v0.9.1/lodash.underscore.min.js) tailored for projects already using Underscore
 * CDN copies of ≤ v0.9.1's [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.1/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.1/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.1/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
 * For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need

## Dive in

We've got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).

Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones.

For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).

## Screencasts

For more information check out these screencasts over Lo-Dash:

 * [Introducing Lo-Dash](https://vimeo.com/44154599)
 * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
 * [Lo-Dash's origin and why it's a better utility belt](https://vimeo.com/44154600)
 * [Unit testing in Lo-Dash](https://vimeo.com/45865290)
 * [Lo-Dash's approach to native method use](https://vimeo.com/48576012)

## Features

 * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
 * [_.clone](http://lodash.com/docs#clone) supports *"deep"* cloning
 * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
 * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object's own and inherited properties
 * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object's own properties
 * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
 * [_.lateBind](http://lodash.com/docs#lateBind) for late binding
 * [_.merge](http://lodash.com/docs#merge) for a *"deep"* [_.extend](http://lodash.com/docs#extend)
 * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding
 * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accept `callback` and `thisArg` arguments
 * [_.template](http://lodash.com/docs#template) utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging
 * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
   [and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.pluck, _.reduce, _.reduceRight, _.reject, _.some, _.sortBy, _.where") accept strings

## Support

Lo-Dash has been tested in at least Chrome 5~22, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.

## Custom builds

Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
To top it off, we handle all method dependency and alias mapping for you.

 * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash
lodash backbone
```

 * CSP builds, supporting default Content Security Policy restrictions, may be created using the `csp` modifier argument.
```bash
lodash csp
```

 * Legacy builds, tailored for older browsers without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
```bash
lodash legacy
```

 * Mobile builds, with IE < 9 bug fixes and method compilation removed, may be created using the `mobile` modifier argument.
```bash
lodash mobile
```

 * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
```bash
lodash strict
```

 * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
```bash
lodash underscore
```

Custom builds may be created using the following commands:

 * Use the `category` argument to pass comma separated categories of methods to include in the build.

   Valid categories (case-insensitive) are *"arrays"*, *"chaining"*, *"collections"*, *"functions"*, *"objects"*, and *"utilities"*.
```bash
lodash category=collections,functions
lodash category="collections, functions"
```

 * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.

   Valid exports are *"amd"*, *"commonjs"*, *"global"*, *"node"*, and *"none"*.
```bash
lodash exports=amd,commonjs,node
lodash exports="amd, commonjs, node"
```

 * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
```bash
lodash iife="!function(window,undefined){%output%}(this)"
```

 * Use the `include` argument to pass comma separated method/category names to include in the build.
```bash
lodash include=each,filter,map
lodash include="each, filter, map"
```

 * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
```bash
lodash underscore minus=result,shuffle
lodash underscore minus="result, shuffle"
```

 * Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
```bash
lodash backbone plus=random,template
lodash backbone plus="random, template"
```

 * Use the `template` argument to pass the file path pattern used to match template files to precompile
```bash
lodash template="./*.jst"
```

 * Use the `settings` argument to pass the template settings used when precompiling templates
```bash
lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"
```

All arguments, except `legacy` with `csp` or `mobile`, may be combined.

Unless specified by `-o` or `--output`, all files created are saved to the current working directory.

The following options are also supported:

 * `-c`, `--stdout`     Write output to standard output
 * `-d`, `--debug`       Write only the debug output
 * `-h`, `--help`         Display help information
 * `-m`, `--minify`     Write only the minified output
 * `-o`, `--output`     Write output to a given path/filename
 * `-s`, `--silent`     Skip status updates normally logged to the console
 * `-V`, `--version`   Output current version of Lo-Dash

The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).

## Installation and usage

In browsers:

```html
<script src="lodash.js"></script>
```

Using [npm](http://npmjs.org/):

```bash
npm install lodash

npm install -g lodash
npm link lodash
```

In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):

```js
var _ = require('lodash');
```

**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project's root directory before requiring it.

In [RingoJS v0.7.0-](http://ringojs.org/):

```js
var _ = require('lodash')._;
```

In [Rhino](http://www.mozilla.org/rhino/):

```js
load('lodash.js');
```

In an AMD loader like [RequireJS](http://requirejs.org/):

```js
require({
  'paths': {
    'underscore': 'path/to/lodash'
  }
},
['underscore'], function(_) {
  console.log(_.VERSION);
});
```

## Resolved Underscore.js issues

 * Add AMD loader support [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L116-146)]
 * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L518-524)]
 * Ensure *"Collections"* methods allow string `collection` arguments [[#247](https://github.com/documentcloud/underscore/issues/247), [#276](https://github.com/documentcloud/underscore/issues/276), [#561](https://github.com/documentcloud/underscore/pull/561), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L478-495)]
 * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L531-555)]
 * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L140-146)]
 * `_.clone` should allow `deep` cloning [[#595](https://github.com/documentcloud/underscore/pull/595), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L212-223)]
 * `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L265-274)]
 * `_.extend` should recursively extend objects [[#379](https://github.com/documentcloud/underscore/pull/379), [#718](https://github.com/documentcloud/underscore/issues/718), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L1020-1042)]
 * `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L473-476)]
 * `_.forEach` should allow exiting iteration early [[#211](https://github.com/documentcloud/underscore/issues/211), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L561-579)]
 * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L720-725)]
 * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L801-813)]
 * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L894-896)]
 * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.9.1/test/test.js#L1295-1298)]

## Release Notes

### v0.9.1

 * Ensured `_.every` returns `false` as soon as the `callback` result is falsey
 * Ensured `_.isFinite` returns `false` for non-numeric values
 * Removed `_.forEach` chainability in the `underscore` build
 * Simplified `_.union`

The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).

## BestieJS

Lo-Dash is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.

## Author

* [John-David Dalton](http://allyoucanleet.com/)
  [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")

## Contributors

* [Kit Cambridge](http://kitcambridge.github.com/)
  [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
* [Mathias Bynens](http://mathiasbynens.be/)
  [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")


text:
import Ember from 'ember';

export default Ember.Route.extend({
	model: function(){
		return this.store.find('mail-thread');
	},
	_updateMailReadStatus: function(readStatus) {
		this.currentModel.forEach(function(mailThread){
				mailThread.get('mails').forEach(function(mail){
					mail.set('isMailRead', readStatus);
				});
			});
	},
	actions: {
		markAllRead: function(){
			this._updateMailReadStatus(true);
		},
		markAllUnread: function(){
			this._updateMailReadStatus(false);
		}
	}
});


text:
package org.apache.geode.management.internal.beans.stats;

import java.util.HashMap;
import java.util.Map;

import org.apache.geode.StatisticDescriptor;
import org.apache.geode.Statistics;
import org.apache.geode.annotations.VisibleForTesting;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.internal.statistics.StatisticId;
import org.apache.geode.internal.statistics.StatisticNotFoundException;
import org.apache.geode.internal.statistics.StatisticsNotification;
import org.apache.geode.internal.statistics.ValueMonitor;

/**
 * This class acts as a monitor and listen for GC statistics updates on behalf of MemberMBean.
 *

 * There's only one dedicated thread that wakes up at the
 * {@link ConfigurationProperties#STATISTIC_SAMPLE_RATE} configured, samples all the statistics,
 * writes them to the {@link ConfigurationProperties#STATISTIC_ARCHIVE_FILE} configured (if any) and
 * notifies listeners of changes. The mutable fields are declared as {@code volatile} to make sure
 * readers of the statistics get the latest recorded value.
 *

 * This class is conditionally thread-safe, there can be multiple concurrent readers accessing a
 * instance, but concurrent writers need to be synchronized externally.
 *
 * @see org.apache.geode.internal.statistics.HostStatSampler
 * @see org.apache.geode.distributed.ConfigurationProperties
 * @see org.apache.geode.management.internal.beans.stats.MBeanStatsMonitor
 */
public class GCStatsMonitor extends MBeanStatsMonitor {
  // this class uses these volatile variables to make sure reads are reading the latest values
  // it is not using the parent's siteMap
  // this stores each stat's uniqueId and its collection count
  private final Map<Long, Number> collections;

  // this stors eaech stat's uniqueId and its collectionTime
  private final Map<Long, Number> collectionTime;

  public GCStatsMonitor(String name) {
    this(name, new ValueMonitor());
  }

  @VisibleForTesting
  public GCStatsMonitor(String name, ValueMonitor valueMonitor) {
    super(name, valueMonitor);
    collections = new HashMap<>();
    collectionTime = new HashMap<>();
  }

  long getCollections() {
    return collections.values().stream().mapToLong(Number::longValue).sum();
  }

  long getCollectionTime() {
    return collectionTime.values().stream().mapToLong(Number::longValue).sum();
  }

  @Override
  // this will be called multiple times initially with different collector's stats
  public void addStatisticsToMonitor(Statistics stats) {
    monitor.addListener(this);// if already listener is added this will be a no-op
    monitor.addStatistics(stats);

    StatisticDescriptor[] descriptors = stats.getType().getStatistics();
    for (StatisticDescriptor d : descriptors) {
      String name = d.getName();
      Number value = stats.get(d);
      if (value == null) {
        continue;
      }
      if (name.equals(StatsKey.VM_GC_STATS_COLLECTIONS)) {
        collections.put(stats.getUniqueId(), value);
      } else if (name.equals(StatsKey.VM_GC_STATS_COLLECTION_TIME)) {
        collectionTime.put(stats.getUniqueId(), value);
      }
    }
  }

  @Override
  public Number getStatistic(String statName) {
    if (statName.equals(StatsKey.VM_GC_STATS_COLLECTIONS)) {
      return getCollections();
    }

    if (statName.equals(StatsKey.VM_GC_STATS_COLLECTION_TIME)) {
      return getCollectionTime();
    }

    return 0;
  }

  @Override
  // this will be called each time a collector's stats changed
  public void handleNotification(StatisticsNotification notification) {
    for (StatisticId statId : notification) {
      StatisticDescriptor descriptor = statId.getStatisticDescriptor();
      String name = descriptor.getName();
      Number value;
      try {
        value = notification.getValue(statId);
      } catch (StatisticNotFoundException e) {
        value = 0;
      }
      log(name, value);
      if (name.equals(StatsKey.VM_GC_STATS_COLLECTIONS)) {
        collections.put(statId.getStatistics().getUniqueId(), value);
      }

      else if (name.equals(StatsKey.VM_GC_STATS_COLLECTION_TIME)) {
        collectionTime.put(statId.getStatistics().getUniqueId(), value);
      }
    }
  }
}


text:
/*
Version: @@ver@@ Timestamp: @@timestamp@@
*/
/* line 7, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container {
  position: relative;
  display: inline-block;
  /* inline-block for ie7 */
  zoom: 1;
  *display: inline;
  vertical-align: top;
  /*
    Force border-box so that % widths fit the parent
    container without overlap because of margin/padding.

    More Info : http://www.quirksmode.org/css/box.html
  */
  -webkit-box-sizing: border-box;
  /* webkit */
  -khtml-box-sizing: border-box;
  /* konqueror */
  -moz-box-sizing: border-box;
  /* firefox */
  -ms-box-sizing: border-box;
  /* ie */
  box-sizing: border-box;
  /* css3 */ }

/* line 32, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-drop {
  /*
    Force border-box so that % widths fit the parent
    container without overlap because of margin/padding.

    More Info : http://www.quirksmode.org/css/box.html
  */
  -webkit-box-sizing: border-box;
  /* webkit */
  -khtml-box-sizing: border-box;
  /* konqueror */
  -moz-box-sizing: border-box;
  /* firefox */
  -ms-box-sizing: border-box;
  /* ie */
  box-sizing: border-box;
  /* css3 */ }

/* line 51, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-search {
  /*
    Force border-box so that % widths fit the parent
    container without overlap because of margin/padding.

    More Info : http://www.quirksmode.org/css/box.html
  */
  -webkit-box-sizing: border-box;
  /* webkit */
  -khtml-box-sizing: border-box;
  /* konqueror */
  -moz-box-sizing: border-box;
  /* firefox */
  -ms-box-sizing: border-box;
  /* ie */
  box-sizing: border-box;
  /* css3 */ }
  /* line 68, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-search input {
    /*
      Force border-box so that % widths fit the parent
      container without overlap because of margin/padding.

      More Info : http://www.quirksmode.org/css/box.html
    */
    -webkit-box-sizing: border-box;
    /* webkit */
    -khtml-box-sizing: border-box;
    /* konqueror */
    -moz-box-sizing: border-box;
    /* firefox */
    -ms-box-sizing: border-box;
    /* ie */
    box-sizing: border-box;
    /* css3 */ }

/* line 89, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container .select2-choice {
  display: block;
  height: 26px;
  padding: 0 0 0 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid #aaa;
  white-space: nowrap;
  line-height: 26px;
  color: #444;
  text-decoration: none;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  -webkit-background-clip: padding-box;
  -moz-background-clip: padding;
  background-clip: padding-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: #fff;
  background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
  background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
  background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
  background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 50%);
  background-image: -ms-linear-gradient(top, white 0%, #eeeeee 50%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
  background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%); }
/* line 121, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container.select2-drop-above .select2-choice {
  border-bottom-color: #aaa;
  -webkit-border-radius: 0 0 4px 4px;
  -moz-border-radius: 0 0 4px 4px;
  border-radius: 0 0 4px 4px;
  background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
  background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
  background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
  background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
  background-image: -ms-linear-gradient(top, #eeeeee 0%, white 90%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
  background-image: linear-gradient(top, #eeeeee 0%, #ffffff 90%); }
/* line 135, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container .select2-choice span {
  margin-right: 26px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  -ms-text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
  text-overflow: ellipsis; }
/* line 144, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container .select2-choice abbr {
  display: block;
  width: 12px;
  height: 12px;
  position: absolute;
  right: 26px;
  top: 8px;
  font-size: 1px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  outline: 0; }
  /* line 157, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container .select2-choice abbr:hover {
    background-position: right -11px;
    cursor: pointer; }

/* line 165, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-drop-mask {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9998;
  opacity: 0; }

/* line 173, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-drop {
  width: 100%;
  margin-top: -1px;
  position: absolute;
  z-index: 9999;
  top: 100%;
  background: #fff;
  color: #000;
  border: 1px solid #aaa;
  border-top: 0;
  -webkit-border-radius: 0 0 4px 4px;
  -moz-border-radius: 0 0 4px 4px;
  border-radius: 0 0 4px 4px;
  -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
  -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
  -o-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15); }
  /* line 190, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-drop.select2-drop-above {
    margin-top: 1px;
    border-top: 1px solid #aaa;
    border-bottom: 0;
    -webkit-border-radius: 4px 4px 0 0;
    -moz-border-radius: 4px 4px 0 0;
    border-radius: 4px 4px 0 0;
    -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.15);
    -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.15);
    box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.15); }

/* line 204, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container .select2-choice div {
  display: block;
  width: 18px;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  border-left: 1px solid #aaa;
  -webkit-border-radius: 0 4px 4px 0;
  -moz-border-radius: 0 4px 4px 0;
  border-radius: 0 4px 4px 0;
  -webkit-background-clip: padding-box;
  -moz-background-clip: padding;
  background-clip: padding-box;
  background: #ccc;
  background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(0.6, #eeeeee));
  background-image: -webkit-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);
  background-image: -moz-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);
  background-image: -o-linear-gradient(bottom, #cccccc 0%, #eeeeee 60%);
  background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
  background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%); }
  /* line 226, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container .select2-choice div b {
    display: block;
    width: 100%;
    height: 100%; }

/* line 234, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-search {
  display: inline-block;
  width: 100%;
  min-height: 26px;
  margin: 0;
  padding-left: 4px;
  padding-right: 4px;
  position: relative;
  z-index: 10000;
  white-space: nowrap; }

/* line 246, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-search-hidden {
  display: block;
  position: absolute;
  left: -10000px; }

/* line 252, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-search input {
  width: 100%;
  height: auto !important;
  min-height: 26px;
  padding: 4px 20px 4px 5px;
  margin: 0;
  outline: 0;
  font-family: sans-serif;
  font-size: 1em;
  border: 1px solid #aaa;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  background: white;
  background: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
  background: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
  background: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
  background: -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
  background: -ms-linear-gradient(top, white 85%, #eeeeee 99%);
  background: linear-gradient(top, #ffffff 85%, #eeeeee 99%); }

/* line 277, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-drop.select2-drop-above .select2-search input {
  margin-top: 4px; }

/* line 281, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-search input.select2-active {
  background: white url("/assets/loading.gif") no-repeat 100%;
  background: url("/assets/loading.gif") no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
  background: url("/assets/loading.gif") no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
  background: url("/assets/loading.gif") no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
  background: url("/assets/loading.gif") no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
  background: url("/assets/loading.gif") no-repeat 100%, -ms-linear-gradient(top, white 85%, #eeeeee 99%);
  background: url("/assets/loading.gif") no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%); }

/* line 292, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-active .select2-choice, .select2-container-active .select2-choices {
  border: 1px solid #5897fb;
  outline: none;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  -o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); }

/* line 302, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-dropdown-open .select2-choice {
  border-bottom-color: transparent;
  -webkit-box-shadow: 0 1px 0 #fff inset;
  -moz-box-shadow: 0 1px 0 #fff inset;
  -o-box-shadow: 0 1px 0 #fff inset;
  box-shadow: 0 1px 0 #fff inset;
  -webkit-border-bottom-left-radius: 0;
  -moz-border-radius-bottomleft: 0;
  border-bottom-left-radius: 0;
  -webkit-border-bottom-right-radius: 0;
  -moz-border-radius-bottomright: 0;
  border-bottom-right-radius: 0;
  background-color: #eee;
  background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
  background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
  background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
  background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
  background-image: -ms-linear-gradient(top, white 0%, #eeeeee 50%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
  background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%); }
  /* line 322, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-dropdown-open .select2-choice div {
    background: transparent;
    border-left: none;
    filter: none; }
    /* line 326, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-dropdown-open .select2-choice div b {
      background-position: -18px 1px; }

/* results */
/* line 334, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-results {
  max-height: 200px;
  padding: 0 0 0 4px;
  margin: 4px 4px 4px 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto; }
  /* line 341, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results ul.select2-result-sub {
    margin: 0; }
    /* line 343, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub > li .select2-result-label {
      padding-left: 20px; }
    /* line 347, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
      padding-left: 40px; }
    /* line 351, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
      padding-left: 60px; }
    /* line 355, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
      padding-left: 80px; }
    /* line 359, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
      padding-left: 100px; }
    /* line 363, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
      padding-left: 110px; }
    /* line 366, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
      padding-left: 120px; }
  /* line 375, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results li {
    list-style: none;
    display: list-item;
    background-image: none; }
    /* line 379, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results li.select2-result-with-children > .select2-result-label {
      font-weight: 600; }
  /* line 383, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-result-label {
    padding: 3px 7px 4px;
    margin: 0;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none; }
  /* line 394, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-highlighted {
    background: #3875d7;
    color: #fff; }
  /* line 398, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results li em {
    background: #feffde;
    font-style: normal; }
  /* line 403, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-highlighted em {
    background: transparent; }
  /* line 406, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-highlighted ul {
    background: white;
    color: #000; }
  /* line 411, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-selection-limit {
    background: #f4f4f4;
    display: list-item; }
  /* line 415, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-disabled {
    background: #f4f4f4;
    display: list-item;
    cursor: default; }
    /* line 416, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-results .select2-disabled.select2-highlighted {
      color: #666;
      background: #f4f4f4;
      display: list-item;
      cursor: default; }
  /* line 426, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-results .select2-selected {
    display: none; }

/*
disabled look for disabled choices in the results dropdown
*/
/* line 435, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-more-results {
  background: #f4f4f4;
  display: list-item; }
  /* line 436, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-more-results.select2-active {
    background: #f4f4f4 url("/assets/loading.gif") no-repeat 100%; }

/* disabled styles */
/* line 445, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container.select2-container-disabled .select2-choice {
  background-color: #f4f4f4;
  background-image: none;
  border: 1px solid #ddd;
  cursor: default; }
  /* line 450, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container.select2-container-disabled .select2-choice div {
    background-color: #f4f4f4;
    background-image: none;
    border-left: 0; }
  /* line 455, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container.select2-container-disabled .select2-choice abbr {
    display: none; }

/* multiselect */
/* line 462, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices {
  height: auto !important;
  height: 1%;
  margin: 0;
  padding: 0;
  position: relative;
  border: 1px solid #aaa;
  cursor: text;
  overflow: hidden;
  background-color: #fff;
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, white));
  background-image: -webkit-linear-gradient(top, #eeeeee 1%, white 15%);
  background-image: -moz-linear-gradient(top, #eeeeee 1%, white 15%);
  background-image: -o-linear-gradient(top, #eeeeee 1%, white 15%);
  background-image: -ms-linear-gradient(top, #eeeeee 1%, white 15%);
  background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); }

/* line 480, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-locked {
  padding: 3px 5px 3px 5px !important; }

/* line 485, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices {
  min-height: 26px; }
/* line 488, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi.select2-container-active .select2-choices {
  border: 1px solid #5897fb;
  outline: none;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  -o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); }
/* line 497, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices li {
  float: left;
  list-style: none; }
/* line 501, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices .select2-search-field {
  margin: 0;
  padding: 0;
  white-space: nowrap; }
  /* line 505, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container-multi .select2-choices .select2-search-field input {
    padding: 5px;
    margin: 1px 0;
    font-family: sans-serif;
    font-size: 100%;
    color: #666;
    outline: 0;
    border: 0;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    -o-box-shadow: none;
    box-shadow: none;
    background: transparent !important; }
    /* line 518, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-container-multi .select2-choices .select2-search-field input.select2-active {
      background: white url("/assets/loading.gif") no-repeat 100% !important; }

/* line 526, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-default {
  color: #999 !important; }

/* line 531, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices .select2-search-choice {
  padding: 3px 5px 3px 18px;
  margin: 3px 0 3px 5px;
  position: relative;
  line-height: 13px;
  color: #333;
  cursor: default;
  border: 1px solid #aaaaaa;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  -webkit-box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
  box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
  -webkit-background-clip: padding-box;
  -moz-background-clip: padding;
  background-clip: padding-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: #e4e4e4;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #eaeaea), color-stop(100%, #eeeeee));
  background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #eaeaea 52%, #eeeeee 100%);
  background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #eaeaea 52%, #eeeeee 100%);
  background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #eaeaea 52%, #eeeeee 100%);
  background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #eaeaea 52%, #eeeeee 100%);
  background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #eaeaea 52%, #eeeeee 100%); }
  /* line 562, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container-multi .select2-choices .select2-search-choice span {
    cursor: default; }
/* line 566, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices .select2-search-choice-focus {
  background: #d4d4d4; }

/* line 571, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-search-choice-close {
  display: block;
  width: 12px;
  height: 13px;
  position: absolute;
  right: 3px;
  top: 4px;
  font-size: 1px;
  outline: none; }

/* line 584, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-search-choice-close {
  left: 3px; }
/* line 588, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover, .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
  background-position: right -11px; }
/* line 592, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-container-multi.select2-container-disabled .select2-choices {
  background-color: #f4f4f4;
  background-image: none;
  border: 1px solid #ddd;
  cursor: default; }
  /* line 597, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
  .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
    padding: 3px 5px 3px 5px;
    border: 1px solid #ddd;
    background-image: none;
    background-color: #f4f4f4; }
    /* line 602, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
    .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
      display: none; }

/* line 609, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-result-selectable .select2-match, .select2-result-unselectable .select2-match {
  text-decoration: underline; }

/* line 613, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-offscreen {
  position: absolute;
  left: -10000px; }

/* line 618, /home/andrei/core-admin-release/core-admin/source/stylesheets/select2.scss */
.select2-display-none {
  display: none; }


text:
<?php

namespace Krystal\Tree\AdjacencyList;

use Closure;

interface BreadcrumbBuilderInterface
{
    /**
     * Makes breadcrumbs
     *
     * @param \Closure $visitor
     * @return array
     */
    public function makeAll(Closure $visitor);
}


text:
struct Message
{
	char* buffer;
	int size;
};


text:
/**
 * Configuration constants and defaults.
 */
package com.continuuity.loom.common.conf;


text:
var numStream: Stream<number>;
numStream = Stream.of(1, 2, 3);
numStream = Stream.range(1, 5);
numStream = Stream.rangeClosed(1, 5);
numStream = Stream.from([1, 2, 3]);
Stream.generate(function() {
	return 1;
});
Stream.generate(() => 1);

numStream = Stream.iterate(1, (n) => n * 2);

var comparator = (s1: string, s2: string) => 0;

numStream = numStream.filter(n => n % 2 == 0);
var strStream = numStream
					.dropWhile((n: number) => n % 2 == 0)
					.map(n => "number " + n)
					.dropWhile(/^$/)
					.limit(100)
					.sorted()
					.sort()
					.sort("propName")
					.sorted(comparator)
					.sort(comparator)
					.sorted("propName")
					.shuffle()
					.reverse()
					.distinct()
					.skip(5)
					.peek(s => console.log(s))
					.takeWhile(s => s.length < 5)
					.takeWhile(/^aa.*$/)
					.slice(5, 2)
					;
strStream = Stream.from("foobar");
var strArray = strStream.toArray();
strArray = strStream.toList();
strStream.each(s => console.log(s));
strStream.filter(/^$/);
strStream.forEach(s => console.log(s));
var opt: Stream.Optional<string> = strStream.findFirst();
opt = strStream.findAny();
opt = strStream.max();
opt = strStream.max((s1, s2) => 0);
opt = strStream.min();
opt = strStream.min((s1, s2) => 0);

var sum = numStream.sum();
sum = numStream.sum("foo");
var avg = numStream.average();
avg = numStream.average("foo");
avg = numStream.avg();
avg = numStream.avg("foo");

var count = numStream.count();
count = numStream.size();

var allMatch: boolean = numStream.allMatch(n => true);
allMatch = strStream.allMatch(/^$/);

var anyMatch: boolean = numStream.anyMatch(n => false);
anyMatch = strStream.anyMatch(/^$/);

var noneMatch: boolean = numStream.noneMatch(n => false);
noneMatch = strStream.noneMatch(/^$/);

sum = numStream.reduce(0, (n1, n2) => n1 + n2);
opt = strStream.reduce((s1, s2) => s1 + s2);

class MyList {
	elems: any[];
	name: string
}

var elems: any[];

var myStream: Stream<MyList> = Stream.from([new MyList, new MyList]);
elems = myStream
	.flatMap(list => list.elems)
	.toArray();

myStream = myStream.takeWhile({name: "foo"});
myStream = myStream.dropWhile({name: "foo"});
myStream = myStream.filter({name: "foo"});
var myResult = myStream.min("name");
myResult = myStream.max("name");
var match: boolean = myStream.allMatch({name: "foo"});
match = myStream.anyMatch({name: "foo"});

numStream.collect({
	supplier: () => 0,
	accumulator: (n1, n2) => n1 + n2,
	finisher: n => n
});

var groupingResult = myStream.groupBy(lst => lst.name);
var elems = groupingResult["hello"].elems;
groupingResult = myStream.groupingBy(lst => lst.name);
groupingResult = myStream.groupBy("name");
groupingResult = myStream.groupingBy("name");

var mappingResult = myStream.toMap((lst) => lst.name, (e1: MyList, e2: MyList) => e2);
var aMappingResult: MyList = mappingResult["a"];

mappingResult = myStream.toMap("a");

myStream.toMap(lst => lst.name);

mappingResult = myStream.indexBy(lst => lst.name, (e1, e2) => e2);

var partitionedNums: number[][] = numStream.partitioningBy(n => n % 2 == 0);
partitionedNums = numStream.partitionBy(n => n % 2 == 0);

var partitionedStrings : string[][] = strStream.partitionBy(/^a$/);
partitionedStrings = strStream.partitioningBy(/^a$/);
partitionedStrings = strStream.partitioningBy(5);
partitionedStrings = strStream.partitionBy(5);

var partitionedList: MyList[][] = myStream.partitionBy({name : "foo"});
partitionedList = myStream.partitioningBy({name : "foo"});

var s: string = numStream.joining();
s = numStream.join();
s = numStream.joining(", ");
s = numStream.join(", ");
s = numStream.joining({prefix: "{", delimiter: ", ", suffix: "}"});
s = numStream.join({prefix: "{", delimiter: ", ", suffix: "}"});

var iter = numStream.iterator();
var n: number = iter.next();
var done: boolean = iter.done;

var optNum: Stream.Optional<number> = Stream.Optional.of(2);
optNum = Stream.Optional.ofNullable(null);

var optStr: Stream.Optional<String> = optNum.filter(n => n % 2 == 0)
	.map(n => "number" + n)
	.flatMap(n => Stream.Optional.of(n + 2))
	;

var isPresent: boolean = optNum.isPresent();
var num: number = optNum.get();
optNum.ifPresent(n => console.log(n));
var def: number = optNum.orElse(2);
def = optNum.orElseGet(() => 3);
def = optNum.orElseThrow("something went wrong");


text:
#ifndef _CONTROLLER_BASE_H_
#define _CONTROLLER_BASE_H_

/**
 * Base class for all controllers.  They abstract the controls needed for a
 * GridRunner object - left, right, down and rotation - into an interface.
 * Possible implementations of the interface include a class that watches the
 * physical DS buttons, a class that listens to the wifi interface for a remote
 * networked player, or an AI.
 */
class ControllerBase {
public:
	/**
	 * Constructor.
	 */
	ControllerBase() { };

	/**
	 * Destructor.
	 */
	virtual ~ControllerBase() { };

	/**
	 * Is the left control active?
	 * @return True if the left control is active.
	 */
	virtual bool left() = 0;

	/**
	 * Is the right control active?
	 * @return True if the right control is active.
	 */
	virtual bool right() = 0;

	/**
	 * Is the down control active?
	 * @return True if the down control is active.
	 */
	virtual bool down() = 0;

	/**
	 * Is the clockwise rotation control active?
	 * @return True if the clockwise rotation control is active.
	 */
	virtual bool rotateClockwise() = 0;

	/**
	 * Is the anticlockwise rotation control active?
	 * @return True if the anticlockwise rotation control is active.
	 */
	virtual bool rotateAntiClockwise() = 0;
};

#endif


text:
package com.luboganev.handdrawn.data;

public class SensorDataPoint {
    private long timestamp;
    private float[] values;
    private int accuracy;

    public SensorDataPoint(long timestamp, int accuracy, float[] values) {
        this.timestamp = timestamp;
        this.accuracy = accuracy;
        this.values = values;
    }

    public float[] getValues() {
        return values;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public int getAccuracy() {
        return accuracy;
    }
}


text:
package org.apache.isis.applib.services.bookmarkui;

import org.apache.isis.applib.annotation.Programmatic;

public interface BookmarkUiService {

    @Programmatic
    void clear();

}


text:
<?php

namespace Buzz\Test\Listener;

use Buzz\Listener\HistoryListener;
use Buzz\Message;

class HistoryListenerTest extends \PHPUnit_Framework_TestCase
{
    private $journal;
    private $listener;

    protected function setUp()
    {
        $this->journal = $this->getMockBuilder('Buzz\Listener\History\Journal')
            ->disableOriginalConstructor()
            ->getMock();

        $this->listener = new HistoryListener($this->journal);
    }

    public function testHistory()
    {
        $request = new Message\Request();
        $response = new Message\Response();

        $this->journal->expects($this->once())
            ->method('record')
            ->with($request, $response, $this->isType('float'));

        $this->listener->preSend($request);
        $this->listener->postSend($request, $response);
    }

    public function testGetter()
    {
        $this->assertSame($this->journal, $this->listener->getJournal());
    }
}


text:
require.ensure([], function(require) {
require("./36.async.js");
require("./73.async.js");
require("./146.async.js");
require("./291.async.js");
});
module.exports = 292;


text:
        This metric reports the number of source lines of product code in
        each package.
        Comments and whitespace are not counted for purposes of this metric.

Abbreviation: SLOCp

Powered by
        MetricsReloaded


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

namespace VC
{
    public static class Defines
    {
        public static string[] EmailsDefault = new string[] { "eebyrne@gmail.com" };

        public static readonly string RootDirectory = @"C:\Network\";
        public static readonly string RootLocalDirectory = @"C:\Temp\";

        public static readonly string LogsRootDirectory = RootDirectory + @"Logs\";
        public static readonly string LogsRootLocalDirectory = RootLocalDirectory + @"Logs\";
    }
}


text:
import functools as ft
from typing import Optional, Tuple, Type

import equinox as eqx
import equinox.internal as eqxi
import jax
import jax.lax as lax
import jax.numpy as jnp
import jax.tree_util as jtu
from equinox.internal import ω

from .custom_types import Array, DenseInfos, Int, PyTree, Scalar
from .local_interpolation import AbstractLocalInterpolation
from .misc import fill_forward, left_broadcast_to
from .path import AbstractPath

class AbstractGlobalInterpolation(AbstractPath):
    ts: Array["times"]  # noqa: F821

    def __post_init__(self):
        if self.ts.ndim != 1:
            raise ValueError("`ts` must be one dimensional.")

    def _ts_size(self):
        return self.ts.shape[0]

    def _interpret_t(self, t: Scalar, left: bool) -> Tuple[Scalar, Scalar]:
        maxlen = self._ts_size() - 2
        index = jnp.searchsorted(self.ts, t, side="left" if left else "right")
        index = jnp.clip(index - 1, a_min=0, a_max=maxlen)
        # Will never access the final element of `ts`; this is correct behaviour.
        fractional_part = t - self.ts[index]
        return index, fractional_part

    @property
    def t0(self):
        """The start of the interval over which the interpolation is defined."""
        return self.ts[0]

    @property
    def t1(self):
        """The end of the interval over which the interpolation is defined."""
        return self.ts[-1]

class LinearInterpolation(AbstractGlobalInterpolation):
    """Linearly interpolates some data `ys` over the interval $[t_0, t_1]$ with knots
    at `ts`.

    !!! warning

        If using `LinearInterpolation` as part of a [`diffrax.ControlTerm`][], then the
        vector field will make a jump every time one of the knots `ts` is passed. If
        using an adaptive step size controller such as [`diffrax.PIDController`][],
        then this means the controller should be informed about the jumps, so that it
        can handle them appropriately:

        ```python
        ts = ...
        interp = LinearInterpolation(ts=ts, ...)
        term = ControlTerm(..., control=interp)
        stepsize_controller = PIDController(..., jump_ts=ts)
        ```
    """

    ys: PyTree[Array["times", ...]]  # noqa: F821

    def __post_init__(self):
        def _check(_ys):
            if _ys.shape[0] != self.ts.shape[0]:
                raise ValueError(
                    "Must have ts.shape[0] == ys.shape[0], that is to say the same "
                    "number of entries along the timelike dimension."
                )

        jtu.tree_map(_check, self.ys)

    @eqx.filter_jit
    def evaluate(
        self, t0: Scalar, t1: Optional[Scalar] = None, left: bool = True
    ) -> PyTree:
        r"""Evaluate the linear interpolation.

        **Arguments:**

        - `t0`: Any point in $[t_0, t_1]$ to evaluate the interpolation at.
        - `t1`: If passed, then the increment from `t1` to `t0` is evaluated instead.
        - `left`: Across jump points: whether to treat the path as left-continuous
            or right-continuous. [In practice linear interpolation is always continuous
            except around `NaN`s.]

        !!! faq "FAQ"

            Note that we use $t_0$ and $t_1$ to refer to the overall interval, as
            obtained via `instance.t0` and `instance.t1`. We use `t0` and `t1` to refer
            to some subinterval of $[t_0, t_1]$. This is an API that is used for
            consistency with the rest of the package, and just happens to be a little
            confusing here.

        **Returns:**

        If `t1` is not passed:

        The interpolation of the data. Suppose $t_j < t < t_{j+1}$, where $t$ is `t0`
        and $t_j$ and $t_{j+1}$ are some element of `ts` as passed in `__init__`.
        Then the value returned is
        $y_j + (y_{j+1} - y_j)\frac{t - t_j}{t_{j+1} - t_j}$.

        If `t1` is passed:

        As above, with $t$ taken to be both `t0` and `t1`, and the increment between
        them returned.
        """

        if t1 is not None:
            return self.evaluate(t1, left=left) - self.evaluate(t0, left=left)
        index, fractional_part = self._interpret_t(t0, left)

        def _index(_ys):
            return _ys[index]

        prev_ys = jtu.tree_map(_index, self.ys)
        next_ys = (self.ys**ω)[index + 1].ω
        prev_t = self.ts[index]
        next_t = self.ts[index + 1]
        diff_t = next_t - prev_t

        return (
            prev_ys**ω + (next_ys**ω - prev_ys**ω) * (fractional_part / diff_t)
        ).ω

    @eqx.filter_jit
    def derivative(self, t: Scalar, left: bool = True) -> PyTree:
        r"""Evaluate the derivative of the linear interpolation. Essentially equivalent
        to `jax.jvp(self.evaluate, (t,), (jnp.ones_like(t),))`.

        **Arguments:**

        - `t`: Any point in $[t_0, t_1]$ to evaluate the derivative at.
        - `left`: Whether to obtain the left-derivative or right-derivative at that
            point.

        **Returns:**

        The derivative of the interpolation of the data. Suppose $t_j < t < t_{j+1}$,
        where $t_j$ and $t_{j+1}$ are some elements of `ts` passed in `__init__`. Then
        the value returned is $\frac{y_{j+1} - y_j}{t_{j+1} - t_j}$.
        """

        index, _ = self._interpret_t(t, left)

        return (
            (ω(self.ys)[index + 1] - ω(self.ys)[index])
            / (self.ts[index + 1] - self.ts[index])
        ).ω

LinearInterpolation.__init__.__doc__ = """**Arguments:**

- `ts`: Some increasing collection of times.
- `ys`: The value of the data at those times.

Note that if `ys` has any missing data then you may wish to use
[`diffrax.linear_interpolation`][] or [`diffrax.rectilinear_interpolation`][] first to
interpolate over these.
"""

class CubicInterpolation(AbstractGlobalInterpolation):
    """Piecewise cubic spline interpolation over the interval $[t_0, t_1]$."""

    # d, c, b, a
    coeffs: Tuple[
        PyTree["times - 1", ...],  # noqa: F821
        PyTree["times - 1", ...],  # noqa: F821
        PyTree["times - 1", ...],  # noqa: F821
        PyTree["times - 1", ...],  # noqa: F821
    ]

    def __post_init__(self):
        def _check(d, c, b, a):
            error_msg = (
                "Each cubic coefficient must have `times - 1` entries, where "
                "`times = self.ts.shape[0]`."
            )
            if d.shape[0] + 1 != self.ts.shape[0]:
                raise ValueError(error_msg)
            if c.shape[0] + 1 != self.ts.shape[0]:
                raise ValueError(error_msg)
            if b.shape[0] + 1 != self.ts.shape[0]:
                raise ValueError(error_msg)
            if a.shape[0] + 1 != self.ts.shape[0]:
                raise ValueError(error_msg)

        jtu.tree_map(_check, *self.coeffs)

    @eqx.filter_jit
    def evaluate(
        self, t0: Scalar, t1: Optional[Scalar] = None, left: bool = True
    ) -> PyTree:
        r"""Evaluate the cubic interpolation.

        **Arguments:**

        - `t0`: Any point in $[t_0, t_1]$ to evaluate the interpolation at.
        - `t1`: If passed, then the increment from `t1` to `t0` is evaluated instead.
        - `left`: Across jump points: whether to treat the path as left-continuous
            or right-continuous. [In practice cubic interpolation is always continuous
            except around `NaN`s.]

        !!! faq "FAQ"

            Note that we use $t_0$ and $t_1$ to refer to the overall interval, as
            obtained via `instance.t0` and `instance.t1`. We use `t0` and `t1` to refer
            to some subinterval of $[t_0, t_1]$. This is an API that is used for
            consistency with the rest of the package, and just happens to be a little
            confusing here.

        **Returns:**

        If `t1` is not passed:

        The interpolation of the data at `t0`.

        If `t1` is passed:

        The increment between `t0` and `t1`.
        """

        if t1 is not None:
            return self.evaluate(t1, left=left) - self.evaluate(t0, left=left)
        index, frac = self._interpret_t(t0, left)

        d, c, b, a = self.coeffs

        return (
            ω(a)[index]
            + frac * (ω(b)[index] + frac * (ω(c)[index] + frac * ω(d)[index]))
        ).ω

    @eqx.filter_jit
    def derivative(self, t: Scalar, left: bool = True) -> PyTree:
        r"""Evaluate the derivative of the cubic interpolation. Essentially equivalent
        to `jax.jvp(self.evaluate, (t,), (jnp.ones_like(t),))`.

        **Arguments:**

        - `t`: Any point in $[t_0, t_1]$ to evaluate the derivative at.
        - `left`: Whether to obtain the left-derivative or right-derivative at that
            point. [In practice cubic interpolation is always continuously
            differentiable except around `NaN`s.]

        **Returns:**

        The derivative of the interpolation of the data.
        """

        index, frac = self._interpret_t(t, left)

        d, c, b, _ = self.coeffs

        return (ω(b)[index] + frac * (2 * ω(c)[index] + frac * 3 * ω(d)[index])).ω

CubicInterpolation.__init__.__doc__ = """**Arguments:**

- `ts`: Some increasing collection of times.
- `coeffs`: The coefficients at all but the last time.

Any kind of spline (natural, ...) may be used; simply pass the appropriate
coefficients.

In practice a good choice is typically "cubic Hermite splines with backward
differences", introduced in [this paper](https://arxiv.org/abs/2106.11028). Such
coefficients can be obtained using [`diffrax.backward_hermite_coefficients`][].

Letting `d, c, b, a = coeffs`, then for all `t` in the interval from `ts[i]` to
`ts[i + 1]` the interpolation is defined as
```python
d[i] * (t - ts[i]) ** 3 + c[i] * (t - ts[i]) ** 2 + b[i] * (t - ts[i]) + a[i]
```
"""

class DenseInterpolation(AbstractGlobalInterpolation):
    ts_size: Int
    infos: DenseInfos
    direction: Scalar
    interpolation_cls: Type[AbstractLocalInterpolation] = eqx.static_field()

    def __post_init__(self):
        def _check(_infos):
            assert _infos.shape[0] + 1 == self.ts.shape[0]

        jtu.tree_map(_check, self.infos)

    # DenseInterpolations typically get `ts` and `infos` that are way longer than they
    # need to be, and padded with `nan`s. This means the normal way of measuring how
    # many entries we have - ts.shape[0] - won't be correct.
    def _ts_size(self):
        return self.ts_size

    def _get_local_interpolation(self, t: Scalar, left: bool):
        index, _ = self._interpret_t(t, left)
        prev_t = self.ts[index]
        next_t = self.ts[index + 1]
        infos = ω(self.infos)[index].ω
        return self.interpolation_cls(t0=prev_t, t1=next_t, **infos)

    @eqx.filter_jit
    def evaluate(
        self, t0: Scalar, t1: Optional[Scalar] = None, left: bool = True
    ) -> PyTree:
        if t1 is not None:
            return self.evaluate(t1, left=left) - self.evaluate(t0, left=left)
        t0 = t0 * self.direction
        # Passing `left` doesn't matter on a local interpolation, which is globally
        # continuous.
        return self._get_local_interpolation(t0, left).evaluate(t0)

    @eqx.filter_jit
    def derivative(self, t: Scalar, left: bool = True) -> PyTree:
        # Passing `left` doesn't matter on a local interpolation, which is globally
        # continuous.
        t = t * self.direction
        out = self._get_local_interpolation(t, left).derivative(t)
        return (self.direction * out**ω).ω

    @property
    def t0(self):
        return self.ts[0] * self.direction

    @property
    def t1(self):
        return self.ts[-1] * self.direction

#
# The following interpolation routines are quite involved, as they are designed to
# handle NaNs (representing missing data), by interpolating over them.
#

def _check_ts(ts: Array["times"]) -> None:  # noqa: F821
    if ts.ndim != 1:
        raise ValueError(f"`ts` must be 1-dimensional; got {ts.ndim}.")
    if ts.shape[0] < 2:
        raise ValueError(f"`ts` must be of length at least 2; got {ts.shape[0]}")
    # Also catches any NaN times.
    ts = eqxi.error_if(
        ts, ts[:-1] >= ts[1:], "`ts` must be monotonically strictly increasing."
    )
    return ts

def _interpolation_reverse(
    carry: Tuple[Array["channels":...], Array["channels":...]],  # noqa: F821
    value: Tuple[Array["channels":...], Array["channels":...]],  # noqa: F821
) -> Tuple[
    Tuple[Array["channels":...], Array["channels":...]],  # noqa: F821
    Tuple[Array["channels":...], Array["channels":...]],  # noqa: F821
]:
    next_ti, next_yi = carry
    ti, yi = value
    cond = jnp.isnan(yi)
    ti = jnp.where(cond, next_ti, ti)
    yi = jnp.where(cond, next_yi, yi)
    return (ti, yi), (ti, yi)

def _linear_interpolation_forward(
    carry: Tuple[Array["channels":...], Array["channels":...]],  # noqa: F821
    value: Tuple[
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
    ],
) -> Tuple[
    Tuple[Array["channels":...], Array["channels":...]],  # noqa: F821
    Array["channels":...],  # noqa: F821
]:

    prev_ti, prev_yi = carry
    ti, yi, next_ti, next_yi = value
    cond = jnp.isnan(yi)
    carry_ti = jnp.where(cond, prev_ti, ti)
    carry_yi = jnp.where(cond, prev_yi, yi)

    _div = jnp.where(cond, next_ti - carry_ti, 1)
    y = carry_yi + (next_yi - carry_yi) * (ti - carry_ti) / _div

    return (carry_ti, carry_yi), y

def _linear_interpolation(
    fill_forward_nans_at_end: bool,
    ts: Array["times"],  # noqa: F821
    ys: Array["times", "channels":...],  # noqa: F821
    replace_nans_at_start: Optional[Array["channels":...]] = None,  # noqa: F821
) -> Array["times", "channels":...]:  # noqa: F821

    ts = left_broadcast_to(ts, ys.shape)

    if replace_nans_at_start is None:
        y0 = ys[0]
    else:
        y0 = jnp.broadcast_to(replace_nans_at_start, ys[0].shape)

    _, (next_ts, next_ys) = lax.scan(
        _interpolation_reverse, (ts[-1], ys[-1]), (ts, ys), reverse=True
    )
    if fill_forward_nans_at_end:
        next_ys = fill_forward(next_ys)
    _, ys = lax.scan(
        _linear_interpolation_forward, (ts[0], y0), (ts, ys, next_ts, next_ys)
    )
    return ys

@eqx.filter_jit
def linear_interpolation(
    ts: Array["times"],  # noqa: F821
    ys: PyTree["times", ...],  # noqa: F821
    *,
    fill_forward_nans_at_end: bool = False,
    replace_nans_at_start: Optional[PyTree[...]] = None,
) -> PyTree["times", ...]:  # noqa: F821
    """Fill in any missing values via linear interpolation.

    Any missing values in `ys` (represented as `NaN`) are filled in by looking at the
    nearest non-`NaN` values either side, and linearly interpolating.

    This is often useful prior to using [`diffrax.LinearInterpolation`][] to create a
    continuous path from discrete observations.

    **Arguments:**

    - `ts`: The time of each observation.
    - `ys`: The observations themselves. Should use `NaN` to indicate those missing
        observations to interpolate over.
    - `fill_forward_nans_at_end`: By default `NaN` values at the end (with no non-`NaN`
        value after them) are left as `NaN`s. If this is set then they will instead
        be filled in using the last non-`NaN` value.
    - `replace_nans_at_start`: By default `NaN` values at the start (with no non-`NaN`
        value before them) are left as `NaN`s. If this is passed then it will be used
        to fill in such `NaN` values.

    **Returns:**

    As `ys`, but with `NaN` values filled in.
    """

    ts = _check_ts(ts)
    fn = ft.partial(_linear_interpolation, fill_forward_nans_at_end, ts)
    if replace_nans_at_start is None:
        return jtu.tree_map(fn, ys)
    else:
        return jtu.tree_map(fn, ys, replace_nans_at_start)

def _rectilinear_interpolation(
    ts: Array["times"],  # noqa: F821
    replace_nans_at_start: Optional[Array["channels":...]],  # noqa: F821
    ys: Array["times", "channels":...],  # noqa: F821
) -> Tuple[
    Array["2 * times - 1"], Array["2 * times - 1", "channels":...]  # noqa: F821
]:
    ts = jnp.repeat(ts, 2, axis=0)[1:]
    ys = fill_forward(ys, replace_nans_at_start)
    ys = jnp.repeat(ys, 2, axis=0)[:-1]
    return ts, ys

@eqx.filter_jit
def rectilinear_interpolation(
    ts: Array["times"],  # noqa: F821
    ys: PyTree["times", ...],  # noqa: F821
    replace_nans_at_start: Optional[PyTree[...]] = None,
) -> Tuple[Array["2 * times - 1"], PyTree["2 * times - 1", ...]]:  # noqa: F821
    """Rectilinearly interpolates the input. This is a variant of linear interpolation
    that is particularly useful when using neural CDEs in a real-time scenario.

    This is often useful prior to using [`diffrax.LinearInterpolation`][] to create a
    continuous path from discrete observations, in real-time scenarios.

    It is strongly recommended to have a read of the reference below if you are
    unfamiliar.

    ??? cite "Reference"

        ```bibtex
        @article{morrill2021cdeonline,
                title={{N}eural {C}ontrolled {D}ifferential {E}quations for {O}nline
                       {P}rediction {T}asks},
                author={Morrill, James and Kidger, Patrick and Yang, Lingyi and
                        Lyons, Terry},
                journal={arXiv:2106.11028},
                year={2021}
        }
        ```

    !!! example

        Suppose `ts = [t0, t1, t2, t3]` and `ys = [y0, y1, y2, y3]`. Then rectilinearly
        interpolating these produces `new_ts = [t0, t1, t1, t2, t2, t3, t3]` and
        `new_ys = [y0, y0, y1, y1, y2, y2, y3]`.

        This can be thought of as advancing time whilst keeping the data fixed, then
        keeping the data fixed whilst advancing time.

    **Arguments:**

    - `ts`: The time of each observation.
    - `ys`: The observations themselves. Should use `NaN` to indicate those missing
        observations to interpolate over.
    - `replace_nans_at_start`: By default `NaN` values at the start (with no non-`NaN`
        value before them) are left as `NaN`s. If this is passed then it will be used
        to fill in such `NaN` values.

    **Returns:**

    A new version of both `ts` and `ys`, subject to rectilinear interpolation.

    !!! example

        Suppose we wish to use a rectilinearly interpolated control to drive a neural
        CDE. Then this should be done something like the following:

        ```python
        ts = jnp.array([0., 1., 1.5, 2.])
        ys = jnp.array([5., 6., 5., 6.])
        ts, ys = rectilinear_interpolation(ts, ys)
        data = jnp.stack([ts, ys], axis=-1)
        interp_ts = jnp.arange(7)
        interp = LinearInterpolation(interp_ts, data)
        ```

        Note how time and observations are stacked together as the data of the
        interpolation (as usual for a neural CDE), and how the interpolation times
        are something we are free to pick.
    """

    ts = _check_ts(ts)
    if replace_nans_at_start is None:
        fn = ft.partial(_rectilinear_interpolation, ts, None)
        out = jtu.tree_map(fn, ys)
    else:
        fn = ft.partial(_rectilinear_interpolation, ts)
        out = jtu.tree_map(fn, replace_nans_at_start, ys)
    ys_treedef = jtu.tree_structure(ys)
    interp_treedef = jtu.tree_structure((0, 0))
    return jtu.tree_transpose(ys_treedef, interp_treedef, out)

def _hermite_forward(
    carry: Tuple[
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
    ],
    value: Tuple[Scalar, Array["channels":...]],  # noqa: F821
) -> Tuple[
    Tuple[
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
    ],
    Tuple[
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
        Array["channels":...],  # noqa: F821
    ],
]:

    prev_ti, prev_yi, prev_deriv_i = carry
    ti, yi, next_ti, next_yi = value
    first_deriv_i = (next_yi - yi) / (next_ti - ti)
    later_deriv_i = (yi - prev_yi) / (ti - prev_ti)
    deriv_i = jnp.where(jnp.isnan(prev_yi), first_deriv_i, later_deriv_i)
    cond = jnp.isnan(yi)
    carry_ti = jnp.where(cond, prev_ti, ti)
    carry_yi = jnp.where(cond, prev_yi, yi)
    carry_deriv_i = jnp.where(cond, prev_deriv_i, deriv_i)

    return (carry_ti, carry_yi, carry_deriv_i), (carry_ti, carry_yi, carry_deriv_i)

def _hermite_coeffs(t0, y0, deriv0, t1, y1):
    t_diff = t1 - t0
    deriv1 = (y1 - y0) / t_diff
    d_deriv = deriv1 - deriv0

    a = y0
    b = deriv0
    c = 2 * d_deriv / t_diff
    d = -d_deriv / t_diff**2

    return d, c, b, a

def _hermite_impl(prev_ti, prev_yi, prev_deriv_i, ti, next_ti, next_yi):
    d, c, b, a = _hermite_coeffs(prev_ti, prev_yi, prev_deriv_i, next_ti, next_yi)
    ts = jnp.stack([prev_ti, next_ti])
    interpolation = CubicInterpolation(
        ts=ts, coeffs=(d[None], c[None], b[None], a[None])
    )
    interp_yi = interpolation.evaluate(ti)
    interp_deriv_i = interpolation.derivative(ti)
    return _hermite_coeffs(ti, interp_yi, interp_deriv_i, next_ti, next_yi)

def _backward_hermite_coefficients(
    fill_forward_nans_at_end: bool,
    ts: Array["times"],  # noqa: F821
    ys: Array["times", "channels":...],  # noqa: F821
    deriv0: Optional[Array["channels":...]] = None,  # noqa: F821
    replace_nans_at_start: Optional[Array["channels":...]] = None,  # noqa: F821
) -> Tuple[
    Array["channels":...],  # noqa: F821
    Array["channels":...],  # noqa: F821
    Array["channels":...],  # noqa: F821
    Array["channels":...],  # noqa: F821
]:
    ts = left_broadcast_to(ts, ys.shape)

    _, (next_ts, next_ys) = lax.scan(
        _interpolation_reverse, (ts[-1], ys[-1]), (ts[1:], ys[1:]), reverse=True
    )

    if fill_forward_nans_at_end:
        next_ys = fill_forward(next_ys)

    t0 = ts[0]
    if replace_nans_at_start is None:
        y0 = ys[0]
    else:
        y0 = jnp.broadcast_to(replace_nans_at_start, ys[0].shape)
    if deriv0 is None:
        deriv0 = (next_ys[0] - y0) / (next_ts[0] - t0)
    else:
        deriv0 = jnp.broadcast_to(deriv0, ys[0].shape)
    ts = ts[:-1]
    ys = ys[:-1]
    _, (prev_ts, prev_ys, prev_derivs) = lax.scan(
        _hermite_forward, (t0, y0, deriv0), (ts[1:], ys[1:], next_ts[1:], next_ys[1:])
    )
    prev_ts = jnp.concatenate([t0[None], prev_ts])
    prev_ys = jnp.concatenate([y0[None], prev_ys])
    prev_derivs = jnp.concatenate([deriv0[None], prev_derivs])

    hermite_impl = _hermite_impl
    for _ in range(len(ys.shape)):
        hermite_impl = jax.vmap(hermite_impl)
    ds, cs, bs, as_ = hermite_impl(prev_ts, prev_ys, prev_derivs, ts, next_ts, next_ys)

    return ds, cs, bs, as_

@eqx.filter_jit
def backward_hermite_coefficients(
    ts: Array["times"],  # noqa: F821
    ys: PyTree["times", ...],  # noqa: F821
    *,
    deriv0: Optional[PyTree[...]] = None,
    fill_forward_nans_at_end: bool = False,
    replace_nans_at_start: Optional[PyTree[...]] = None,
) -> Tuple[
    PyTree["times - 1", ...],  # noqa: F821
    PyTree["times - 1", ...],  # noqa: F821
    PyTree["times - 1", ...],  # noqa: F821
    PyTree["times - 1", ...],  # noqa: F821
]:
    """Interpolates the data with a cubic spline. Specifically, this calculates the
    coefficients for Hermite cubic splines with backward differences.

    This is most useful prior to using [`diffrax.CubicInterpolation`][] to create a
    smooth path from discrete observations.

    ??? cite "Reference"

        Hermite cubic splines with backward differences were introduced in this paper:

        ```bibtex
        @article{morrill2021cdeonline,
                title={{N}eural {C}ontrolled {D}ifferential {E}quations for {O}nline
                       {P}rediction {T}asks},
                author={Morrill, James and Kidger, Patrick and Yang, Lingyi and
                        Lyons, Terry},
                journal={arXiv:2106.11028},
                year={2021}
        }
        ```

    **Arguments:**

    - `ts`: The time of each observation.
    - `ys`: The observations themselves. Should use `NaN` to indicate missing data.
    - `deriv0`: The derivative at `ts[0]`. If not passed then a forward difference of
        `(ys[i] - ys[0]) / (ts[i] - ts[0])` is used, where `i` is the index of the
        first non-`NaN` element of `ys`.
    - `fill_forward_nans_at_end`: By default `NaN` values at the end (with no non-`NaN`
        value after them) are left as `NaN`s. If this is set then they will instead
        be filled in using the last non-`NaN` value prior to fitting the cubic spline.
    - `replace_nans_at_start`: By default `NaN` values at the start (with no non-`NaN`
        value before them) are left as `NaN`s. If this is passed then it will be used
        to fill in such `NaN` values.

    **Returns:**

    The coefficients of the Hermite cubic spline. If `ts` has length $T$ then the
    coefficients will be of length $T - 1$, covering each of the intervals from `ts[0]`
    to `ts[1]`, and `ts[1]` to `ts[2]` etc.
    """

    ts = _check_ts(ts)
    fn = ft.partial(_backward_hermite_coefficients, fill_forward_nans_at_end, ts)
    if deriv0 is None:
        if replace_nans_at_start is None:
            coeffs = jtu.tree_map(fn, ys)
        else:
            _fn = lambda ys, replace_nans_at_start: fn(ys, None, replace_nans_at_start)
            coeffs = jtu.tree_map(_fn, ys, replace_nans_at_start)
    else:
        if replace_nans_at_start is None:
            coeffs = jtu.tree_map(fn, ys, deriv0)
        else:
            coeffs = jtu.tree_map(fn, ys, deriv0, replace_nans_at_start)
    ys_treedef = jtu.tree_structure(ys)
    coeffs_treedef = jtu.tree_structure((0, 0, 0, 0))
    return jtu.tree_transpose(ys_treedef, coeffs_treedef, coeffs)


text:
require 'cloudflare'
class Rainforest::Cloudflare
  include Fourchette::Logger

  def initialize(apps = [])
    @apps = apps
    @client = CloudFlare::connection(ENV['FOURCHETTE_CLOUDFLARE_API_KEY'], ENV['FOURCHETTE_CLOUDFLARE_EMAIL'])
    @zones = Rainforest::ZONES
  end

  def create_subdomains(pull_request_id, heroku_app_url)
    @apps.each do |app|
      record_name = "#{app}-#{pull_request_id}"
      begin
        @zones.each do |zone|
          logger.info "Creating CNAME #{record_name} (#{zone}) to point to #{heroku_app_url}"
          @client.rec_new(zone, 'CNAME', record_name, heroku_app_url, 1)
        end
      rescue CloudFlare::RequestError => ex
        logger.error ex
        logger.error ex.message
      end
    end
  end

  def delete_subdomains(pull_request_id)
    raise 'invalid pull_request_id' unless pull_request_id.to_i > 0
    @apps.each do |app|
      @zones.each do |zone|
        record_name = "#{app}-#{pull_request_id}"
        record_id = dns_record_id(record_name, zone)
        logger.info "Deleting CNAME #{record_name} of #{zone}"
        begin
          @client.rec_delete(zone, record_id)
        rescue CloudFlare::RequestError => ex
          logger.error ex
          logger.error ex.message
        end
      end
    end
  end

  def all_dns_records(zone)
    @client.rec_load_all(zone)['response']['recs']['objs']
  end

  def dns_record_id(record_name, zone)
    domain_to_match = "#{record_name}.#{zone}"
    all_dns_records(zone).each do |rec|
      if rec['type'] == 'CNAME' && rec['name'] == domain_to_match
        return rec['rec_id']
      end
    end
  end
end


text:
package com.artemis.utils;

/**
 * A non-modifiable intbag.
 */
public interface ImmutableIntBag<E> {

    /**
     * Returns the element at the specified position in Bag.
     *
     * @param index index of the element to return
     * @return the element at the specified position in bag
     */
    int get(int index);

    /**
     * Returns the number of elements in this bag.
     *
     * @return the number of elements in this bag
     */
    int size();

    /**
     * Returns true if this bag contains no elements.
     *
     * @return true if this bag contains no elements
     */
    boolean isEmpty();

    /**
     * Check if bag contains this element.
     *
     * @param id
     * @return true if the bag contains this element
     */
    boolean contains(int id);

}


text:
/**
 * Module dependencies.
 */
var util = require('util')
  , OAuth2Strategy = require('passport-oauth').OAuth2Strategy
  , InternalOAuthError = require('passport-oauth').InternalOAuthError;

/**
 * `Strategy` constructor.
 *
 * The TripCase authentication strategy authenticates requests by delegating to
 * TripCase using the OAuth 2.0 protocol.
 *
 * Applications must supply a `verify` callback which accepts an `accessToken`,
 * `refreshToken` and service-specific `profile`, and then calls the `done`
 * callback supplying a `user`, which should be set to `false` if the
 * credentials are not valid.  If an exception occured, `err` should be set.
 *
 * Options:
 *   - `clientID`      your TripCase application's Client ID
 *   - `clientSecret`  your TripCase application's Client Secret
 *   - `callbackURL`   URL to which TripCase will redirect the user after granting authorization
 *   - `scope`         array of permission scopes to request.  valid scopes include:
 *                     'user', 'public_repo', 'repo', 'gist', or none.
 *                     (see http://developer.tripcase.com/v3/oauth/#scopes for more info)
 *   — `userAgent`     All API requests MUST include a valid User Agent string.
 *                     e.g: domain name of your application.
 *
 * Examples:
 *
 *     passport.use(new TripCaseStrategy({
 *         clientID: '123-456-789',
 *         clientSecret: 'shhh-its-a-secret'
 *         callbackURL: 'https://www.example.com/auth/tripcase/callback',
 *         userAgent: 'myapp.com'
 *       },
 *       function(accessToken, refreshToken, profile, done) {
 *         User.findOrCreate(..., function (err, user) {
 *           done(err, user);
 *         });
 *       }
 *     ));
 *
 * @param {Object} options
 * @param {Function} verify
 * @api public
 */
function Strategy(options, verify) {
  options = options || {};
  options.authorizationURL = options.authorizationURL || 'https://www.tripcase.com/client_api_permissions';
  options.tokenURL = options.tokenURL || 'https://www.tripcase.com/developer_api/tokens';
  options.scopeSeparator = options.scopeSeparator || ',';
  options.customHeaders = options.customHeaders || {};

  if (!options.customHeaders['User-Agent']) {
    options.customHeaders['User-Agent'] = options.userAgent || 'passport-tripcase';
  }

  OAuth2Strategy.call(this, options, verify);
  this.name = 'tripcase';
  this._userProfileURL = options.userProfileURL || 'https://www.tripcase.com/developer_api/users/me.json';
}

/**
 * Inherit from `OAuth2Strategy`.
 */
util.inherits(Strategy, OAuth2Strategy);

/**
 * Retrieve user profile from TripCase.
 *
 * This function constructs a normalized profile, with the following properties:
 *
 *   - `provider`         always set to `tripcase`
 *   - `username`         the user's tripcase username
 *   - `displayName`      the user's full name
 *   - `emails`           the user's email addresses
 *
 * @param {String} accessToken
 * @param {Function} done
 * @api protected
 */
Strategy.prototype.userProfile = function(accessToken, done) {
  this._oauth2.get(this._userProfileURL, accessToken, function (err, body, res) {
    if (err) { return done(new InternalOAuthError('failed to fetch user profile', err)); }

    try {
      var json = JSON.parse(body);

      var profile = { provider: 'tripcase' };
      profile.displayName = json.user_settings.first_name + ' ' + json.user_settings.last_name;
      profile.username = json.user_settings.primary_email;
      profile.emails = [{ value: json.user_settings.email }];

      profile._raw = body;
      profile._json = json;

      done(null, profile);
    } catch(e) {
      done(e);
    }
  });
}

/**
 * Expose `Strategy`.
 */
module.exports = Strategy;


text:
<?php declare(strict_types=1);

namespace Kuria\Dom;

class XmlFragment extends XmlDocument
{
    function loadEmpty(?array $properties = null): void
    {
        $this->loadString('', null, $properties);
    }

    protected function populate(\DOMDocument $document, string $content, ?string $encoding = null): void
    {
        if (!$encoding) {
            $encoding = static::INTERNAL_ENCODING;
        }

        parent::populate(
            $document,
            <<<XML
<?xml version="1.0" encoding="{$this->escape($encoding)}"?>
<root>{$content}</root>
XML
            ,
            $encoding
        );
    }

    function save(?\DOMNode $contextNode = null, bool $childrenOnly = false): string
    {
        if ($contextNode === null) {
            $contextNode = $this->getRoot();
            $childrenOnly = true;
        }

        return parent::save($contextNode, $childrenOnly);
    }

    function query(string $expression, ?\DOMNode $contextNode = null, bool $registerNodeNs = true): \DOMNodeList
    {
        // if no context node has been given, assume <root>
        if ($contextNode === null) {
            $contextNode = $this->getRoot();

            // make sure the query is relative to the context node
            if ($expression !== '' && $expression[0] !== '.') {
                $expression = '.' . $expression;
            }
        }

        return parent::query($expression, $contextNode, $registerNodeNs);
    }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>IRemoteClient</title>
<meta name="date" content="2015-02-13">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

gameshop.advance.interfaces.remote.sales

Interface IRemoteClient

All Superinterfaces:

java.rmi.Remote

All Known Subinterfaces:

IRemoteBookClient

All Known Implementing Classes:

ReservationControllerSingleton

public interface IRemoteClient
extends java.rmi.Remote

Interfaccia remota per l'esportazione delle classi che la implementano tramite
 Java RMI.I RemoteClient si occuperanno di aggiornare e far visualizzare le
 informazioni di una vendita.

Method Summary

Methods

Modifier and Type
Method and Description

void
aggiornaResto(Money m)

void
aggiornaTotale(Money m)

Method Detail

aggiornaTotale

void aggiornaTotale(Money m)
                    throws java.rmi.RemoteException

Parameters:

m -

Throws:

java.rmi.RemoteException

aggiornaResto

void aggiornaResto(Money m)
                   throws java.rmi.RemoteException

Parameters:

m -

Throws:

java.rmi.RemoteException

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
//

import sun.misc.*;

public class ExitOnThrow {

    private static volatile boolean ran = false;

    public static void main(String[] args) throws Exception {
        Cleaner.create(new Object(),
                       new Runnable() {
                               public void run() {
                                   ran = true;
                                   throw new RuntimeException("Foo!");
                               }
                           });
        while (!ran) {
            System.gc();
            Thread.sleep(100);
        }
        System.exit(0);
    }

}


text:
/*******************************************************************************
 * © Indra Sistemas, S.A.
 * 2013 - 2014  SPAIN
 *
 * All rights reserved
 ******************************************************************************/
package com.indra.sofia2.kpmodelo.worker.Sensor;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.indra.sofia2.kpmodelo.events.SensorEvents;
import com.indra.sofia2.kpmodelo.infraestructure.loader.KPWorkerCfg;
import com.indra.sofia2.kpmodelo.message.SensorMessage;
import com.indra.sofia2.ssap.ssap.SSAPMessage;
import com.mycila.event.Event;

public abstract class NewDataReceivedWorkerImpl implements NewDataReceivedWorker {
	static Logger log = Logger.getLogger( NewDataReceivedWorkerImpl.class.getName() );
	@Autowired
	protected KPWorkerCfg kPWorkerCfg;

	public void onEvent(Event<SensorMessage> event) throws Exception{
//		log.debug( "3 NewDataReceivedWorkerImpl:onEvent " );
		SSAPMessage ssapMessage = generateSSAPMessage(event.getSource());
		if (ssapMessage!=null){
//			log.debug( "4 NewDataReceivedWorkerImpl:onEvent:publish_to_DATA_TO_SEND" );
			kPWorkerCfg.publish(SensorEvents.DATA_TO_SEND.name(), ssapMessage);
		}
	}

	public abstract SSAPMessage generateSSAPMessage(SensorMessage sensorData);
}