content_type stringclasses 8 values | main_lang stringclasses 7 values | message stringlengths 1 50 | sha stringlengths 40 40 | patch stringlengths 52 962k | file_count int64 1 300 |
|---|---|---|---|---|---|
Ruby | Ruby | move header allocation to a helper method | c6cfcc6124fdef4df3a406f389ba32be486cd437 | <ide><path>actionpack/test/dispatch/header_test.rb
<ide> require "abstract_unit"
<ide>
<ide> class HeaderTest < ActiveSupport::TestCase
<add> def make_headers(hash)
<add> ActionDispatch::Http::Headers.new hash
<add> end
<add>
<ide> setup do
<del> @headers = ActionDispatch::Http::Headers.new(
<add> @headers = make_headers(
<ide> "CONTENT_TYPE" => "text/plain",
<ide> "HTTP_REFERER" => "/some/page"
<ide> )
<ide> end
<ide>
<ide> test "#new does not normalize the data" do
<del> headers = ActionDispatch::Http::Headers.new(
<add> headers = make_headers(
<ide> "Content-Type" => "application/json",
<ide> "HTTP_REFERER" => "/some/page",
<ide> "Host" => "http://test.com")
<ide> class HeaderTest < ActiveSupport::TestCase
<ide> end
<ide>
<ide> test "env variables with . are not modified" do
<del> headers = ActionDispatch::Http::Headers.new
<add> headers = make_headers({})
<ide> headers.merge! "rack.input" => "",
<ide> "rack.request.cookie_hash" => "",
<ide> "action_dispatch.logger" => ""
<ide> class HeaderTest < ActiveSupport::TestCase
<ide> end
<ide>
<ide> test "symbols are treated as strings" do
<del> headers = ActionDispatch::Http::Headers.new
<add> headers = make_headers({})
<ide> headers.merge!(:SERVER_NAME => "example.com",
<ide> "HTTP_REFERER" => "/",
<ide> :Host => "test.com")
<ide> class HeaderTest < ActiveSupport::TestCase
<ide>
<ide> test "headers directly modifies the passed environment" do
<ide> env = {"HTTP_REFERER" => "/"}
<del> headers = ActionDispatch::Http::Headers.new(env)
<add> headers = make_headers(env)
<ide> headers['Referer'] = "http://example.com/"
<ide> headers.merge! "CONTENT_TYPE" => "text/plain"
<ide> assert_equal({"HTTP_REFERER"=>"http://example.com/", | 1 |
Java | Java | fix javadoc typo | dba1ef0b264c0251078f0558d09fff261c18d348 | <ide><path>spring-context/src/main/java/org/springframework/validation/Errors.java
<ide> void rejectValue(@Nullable String field, String errorCode,
<ide> /**
<ide> * Add all errors from the given {@code Errors} instance to this
<ide> * {@code Errors} instance.
<del> * <p>This is a onvenience method to avoid repeated {@code reject(..)}
<add> * <p>This is a convenience method to avoid repeated {@code reject(..)}
<ide> * calls for merging an {@code Errors} instance into another
<ide> * {@code Errors} instance.
<ide> * <p>Note that the passed-in {@code Errors} instance is supposed | 1 |
Text | Text | improve table accessibility | b123e0806f267d4517d54876e2066726f73586d8 | <ide><path>doc/api/n-api.md
<ide> from version 3 with some additions. This means that it is not necessary
<ide> to recompile for new versions of Node.js which are
<ide> listed as supporting a later version.
<ide>
<del>| | 1 | 2 | 3 | 4 | 5 | 6 |
<del>|-------|----------|----------|----------|----------|-----------|-----------|
<del>| v6.x | | | v6.14.2* | | | |
<del>| v8.x | v8.6.0** | v8.10.0* | v8.11.2 | v8.16.0 | | |
<del>| v9.x | v9.0.0* | v9.3.0* | v9.11.0* | | | |
<del>| v10.x | v10.0.0 | v10.0.0 | v10.0.0 | v10.16.0 | v10.17.0 | v10.20.0 |
<del>| v11.x | v11.0.0 | v11.0.0 | v11.0.0 | v11.8.0 | | |
<del>| v12.x | v12.0.0 | v12.0.0 | v12.0.0 | v12.0.0 | v12.11.0 | v12.17.0 |
<del>| v13.x | v13.0.0 | v13.0.0 | v13.0.0 | v13.0.0 | v13.0.0 | |
<del>| v14.x | v14.0.0 | v14.0.0 | v14.0.0 | v14.0.0 | v14.0.0 | v14.0.0 |
<add><!-- For accessibility purposes, this table needs row headers. That means we
<add> can't do it in markdown. Hence, the raw HTML. -->
<add>
<add><table>
<add> <tr>
<add> <td></td>
<add> <th scope="col">1</th>
<add> <th scope="col">2</th>
<add> <th scope="col">3</th>
<add> <th scope="col">4</th>
<add> <th scope="col">5</th>
<add> <th scope="col">6</th>
<add> </tr>
<add> <tr>
<add> <th scope="row">v6.x</th>
<add> <td></td>
<add> <td></td>
<add> <td>v6.14.2*</td>
<add> <td></td>
<add> <td></td>
<add> <td></td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v8.x</th>
<add> <td>v8.6.0**</td>
<add> <td>v8.10.0*</td>
<add> <td>v8.11.2</td>
<add> <td>v8.16.0</td>
<add> <td></td>
<add> <td></td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v9.x</th>
<add> <td>v9.0.0*</td>
<add> <td>v9.3.0*</td>
<add> <td>v9.11.0*</td>
<add> <td></td>
<add> <td></td>
<add> <td></td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v10.x</th>
<add> <td>v10.0.0</td>
<add> <td>v10.0.0</td>
<add> <td>v10.0.0</td>
<add> <td>v10.16.0</td>
<add> <td>v10.17.0</td>
<add> <td>v10.20.0</td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v11.x</th>
<add> <td>v11.0.0</td>
<add> <td>v11.0.0</td>
<add> <td>v11.0.0</td>
<add> <td>v11.8.0</td>
<add> <td></td>
<add> <td></td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v12.x</th>
<add> <td>v12.0.0</td>
<add> <td>v12.0.0</td>
<add> <td>v12.0.0</td>
<add> <td>v12.0.0</td>
<add> <td>v12.11.0</td>
<add> <td>v12.17.0</td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v13.x</th>
<add> <td>v13.0.0</td>
<add> <td>v13.0.0</td>
<add> <td>v13.0.0</td>
<add> <td>v13.0.0</td>
<add> <td>v13.0.0</td>
<add> <td></td>
<add> </tr>
<add> <tr>
<add> <th scope="row">v14.x</th>
<add> <td>v14.0.0</td>
<add> <td>v14.0.0</td>
<add> <td>v14.0.0</td>
<add> <td>v14.0.0</td>
<add> <td>v14.0.0</td>
<add> <td>v14.0.0</td>
<add> </tr>
<add></table>
<ide>
<ide> \* N-API was experimental.
<ide> | 1 |
Python | Python | fill auth_user_info in v3 connection | ce49cc61bbefe08146618aaafe40d269034aad46 | <ide><path>libcloud/common/openstack_identity.py
<ide> def authenticate(self, force=False):
<ide> self.auth_token_expires = parse_date(expires)
<ide> # Note: catalog is not returned for unscoped tokens
<ide> self.urls = body['token'].get('catalog', None)
<del> self.auth_user_info = None
<add> self.auth_user_info = body['token'].get('user', None)
<ide> self.auth_user_roles = roles
<ide> except KeyError as e:
<ide> raise MalformedResponseError('Auth JSON response is \ | 1 |
Ruby | Ruby | fix warning message | 741e68766368b4ad18120a81b2180743790b529e | <ide><path>Library/Homebrew/cask/test/cask/accessibility_test.rb
<ide> @installer.stubs(bundle_identifier: "com.example.BasicCask")
<ide>
<ide> capture_io { @installer.disable_accessibility_access }[1]
<del> .must_match("Warning: Accessibility access was enabled for with-accessibility-access, but it is not safe to disable")
<add> .must_match("Warning: Accessibility access cannot be disabled automatically on this version of macOS.")
<ide> end
<ide> it "warns about disabling accessibility access on new macOS releases" do
<ide> MacOS.stubs(version: MacOS::Version.new("10.12")) | 1 |
Text | Text | improve changelog entry [ci skip] | 17c1143af91fac5d1b6465ed5ad26315b1a2ec27 | <ide><path>activerecord/CHANGELOG.md
<ide>
<ide> *Ben Tucker*
<ide>
<del>* Fixed a bug in ActiveRecord#sanitize_sql_hash_for_conditions in which
<del> `self.class` is an argument to PredicateBuilder#build_from_hash
<del> causing PredicateBuilder to call non-existant method
<del> Class#reflect_on_association.
<add>* Fixed a bug in `ActiveRecord#sanitize_sql_hash_for_conditions` in which
<add> `self.class` is an argument to `PredicateBuilder#build_from_hash`
<add> causing `PredicateBuilder` to call non-existant method
<add> `Class#reflect_on_association`.
<ide>
<ide> *Zach Ohlgren*
<ide> | 1 |
Text | Text | use code markup/markdown in headers | f64842adebe5cc89039488d2e54a6dfc89cd56d3 | <ide><path>CPP_STYLE_GUIDE.md
<ide> codebase not related to stylistic issues.
<ide> * [Align function arguments vertically](#align-function-arguments-vertically)
<ide> * [Initialization lists](#initialization-lists)
<ide> * [CamelCase for methods, functions, and classes](#camelcase-for-methods-functions-and-classes)
<del> * [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters)
<del> * [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields)
<del> * [snake\_case for C-like structs](#snake_case-for-c-like-structs)
<add> * [`snake_case` for local variables and parameters](#snake_case-for-local-variables-and-parameters)
<add> * [`snake_case_` for private class fields](#snake_case_-for-private-class-fields)
<add> * [`snake_case` for C-like structs](#snake_case-for-c-like-structs)
<ide> * [Space after `template`](#space-after-template)
<ide> * [Memory Management](#memory-management)
<ide> * [Memory allocation](#memory-allocation)
<ide> class FooBar {
<ide> };
<ide> ```
<ide>
<del>### snake\_case for local variables and parameters
<add>### `snake_case` for local variables and parameters
<ide>
<ide> ```c++
<ide> int FunctionThatDoesSomething(const char* important_string) {
<ide> const char* pointer_into_string = important_string;
<ide> }
<ide> ```
<ide>
<del>### snake\_case\_ for private class fields
<add>### `snake_case_` for private class fields
<ide>
<ide> ```c++
<ide> class Foo {
<ide> class Foo {
<ide> };
<ide> ```
<ide>
<del>### snake\_case for C-like structs
<del>For plain C-like structs snake_case can be used.
<add>### `snake_case` for C-like structs
<add>
<add>For `plain C-like structs snake_case can be used.
<ide>
<ide> ```c++
<ide> struct foo_bar {
<ide><path>benchmark/README.md
<ide> The common.js module is used by benchmarks for consistency across repeated
<ide> tasks. It has a number of helpful functions and properties to help with
<ide> writing benchmarks.
<ide>
<del>### createBenchmark(fn, configs\[, options\])
<add>### `createBenchmark(fn, configs[, options])`
<ide>
<ide> See [the guide on writing benchmarks](writing-and-running-benchmarks.md#basics-of-a-benchmark).
<ide>
<del>### default\_http\_benchmarker
<add>### `default_http_benchmarker`
<ide>
<ide> The default benchmarker used to run HTTP benchmarks.
<ide> See [the guide on writing HTTP benchmarks](writing-and-running-benchmarks.md#creating-an-http-benchmark).
<ide>
<del>### PORT
<add>### `PORT`
<ide>
<ide> The default port used to run HTTP benchmarks.
<ide> See [the guide on writing HTTP benchmarks](writing-and-running-benchmarks.md#creating-an-http-benchmark).
<ide>
<del>### sendResult(data)
<add>### `sendResult(data)`
<ide>
<ide> Used in special benchmarks that can't use `createBenchmark` and the object
<ide> it returns to accomplish what they need. This function reports timing
<ide><path>doc/api/fs.md
<ide> changes:
<ide>
<ide> The `Promise` is resolved with the [`fs.Stats`][] object for the given `path`.
<ide>
<del>### `fsPromises.symlink(target, path\[, type\])`
<add>### `fsPromises.symlink(target, path[, type])`
<ide> <!-- YAML
<ide> added: v10.0.0
<ide> -->
<ide><path>doc/api/http2.md
<ide> const server = http2.createServer((req, res) => {
<ide> });
<ide> ```
<ide>
<del>#### `response.setTimeout(msecs\[, callback\])`
<add>#### `response.setTimeout(msecs[, callback])`
<ide> <!-- YAML
<ide> added: v8.4.0
<ide> -->
<ide><path>test/common/README.md
<ide> This directory contains modules used to test the Node.js implementation.
<ide>
<ide> The `benchmark` module is used by tests to run benchmarks.
<ide>
<del>### runBenchmark(name, args, env)
<add>### `runBenchmark(name, args, env)`
<ide>
<ide> * `name` [<string>][] Name of benchmark suite to be run.
<ide> * `args` [<Array>][] Array of environment variable key/value pairs (ex:
<ide> The `benchmark` module is used by tests to run benchmarks.
<ide> The `common` module is used by tests for consistency across repeated
<ide> tasks.
<ide>
<del>### allowGlobals(...whitelist)
<add>### `allowGlobals(...whitelist)`
<add>
<ide> * `whitelist` [<Array>][] Array of Globals
<ide> * return [<Array>][]
<ide>
<ide> Takes `whitelist` and concats that with predefined `knownGlobals`.
<ide>
<del>### canCreateSymLink()
<add>### `canCreateSymLink()`
<add>
<ide> * return [<boolean>][]
<ide>
<ide> Checks whether the current running process can create symlinks. On Windows, this
<ide> symlinks
<ide> ([SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)).
<ide> On non-Windows platforms, this always returns `true`.
<ide>
<del>### createZeroFilledFile(filename)
<add>### `createZeroFilledFile(filename)`
<ide>
<ide> Creates a 10 MB file of all null characters.
<ide>
<del>### disableCrashOnUnhandledRejection()
<add>### `disableCrashOnUnhandledRejection()`
<ide>
<ide> Removes the `process.on('unhandledRejection')` handler that crashes the process
<ide> after a tick. The handler is useful for tests that use Promises and need to make
<ide> sure no unexpected rejections occur, because currently they result in silent
<ide> failures. However, it is useful in some rare cases to disable it, for example if
<ide> the `unhandledRejection` hook is directly used by the test.
<ide>
<del>### enoughTestMem
<add>### `enoughTestMem`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates if there is more than 1gb of total memory.
<ide>
<del>### expectsError(validator\[, exact\])
<add>### `expectsError(validator[, exact])`
<add>
<ide> * `validator` [<Object>][] | [<RegExp>][] | [<Function>][] |
<ide> [<Error>][] The validator behaves identical to
<ide> `assert.throws(fn, validator)`.
<ide> validated using `assert.throws(() => { throw error; }, validator)`. If the
<ide> returned function has not been called exactly `exact` number of times when the
<ide> test is complete, then the test will fail.
<ide>
<del>### expectWarning(name\[, expected\[, code\]\])
<add>### `expectWarning(name[, expected[, code]])`
<add>
<ide> * `name` [<string>][] | [<Object>][]
<ide> * `expected` [<string>][] | [<Array>][] | [<Object>][]
<ide> * `code` [<string>][]
<ide> expectWarning({
<ide> });
<ide> ```
<ide>
<del>### getArrayBufferViews(buf)
<add>### `getArrayBufferViews(buf)`
<add>
<ide> * `buf` [<Buffer>][]
<ide> * return [<ArrayBufferView>][]\[\]
<ide>
<ide> Returns an instance of all possible `ArrayBufferView`s of the provided Buffer.
<ide>
<del>### getBufferSources(buf)
<add>### `getBufferSources(buf)`
<add>
<ide> * `buf` [<Buffer>][]
<ide> * return [<BufferSource>][]\[\]
<ide>
<ide> Returns an instance of all possible `BufferSource`s of the provided Buffer,
<ide> consisting of all `ArrayBufferView` and an `ArrayBuffer`.
<ide>
<del>### getCallSite(func)
<add>### `getCallSite(func)`
<add>
<ide> * `func` [<Function>][]
<ide> * return [<string>][]
<ide>
<ide> Returns the file name and line number for the provided Function.
<ide>
<del>### getTTYfd()
<add>### `getTTYfd()`
<ide>
<ide> Attempts to get a valid TTY file descriptor. Returns `-1` if it fails.
<ide>
<ide> The TTY file descriptor is assumed to be capable of being writable.
<ide>
<del>### hasCrypto
<add>### `hasCrypto`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates whether OpenSSL is available.
<ide>
<del>### hasFipsCrypto
<add>### `hasFipsCrypto`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates that Node.js has been linked with a FIPS compatible OpenSSL library,
<ide> To only detect if the OpenSSL library is FIPS compatible, regardless if it has
<ide> been enabled or not, then `process.config.variables.openssl_is_fips` can be
<ide> used to determine that situation.
<ide>
<del>### hasIntl
<add>### `hasIntl`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates if [internationalization][] is supported.
<ide>
<del>### hasIPv6
<add>### `hasIPv6`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates whether `IPv6` is supported on this platform.
<ide>
<del>### hasMultiLocalhost
<add>### `hasMultiLocalhost`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates if there are multiple localhosts available.
<ide>
<del>### inFreeBSDJail
<add>### `inFreeBSDJail`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Checks whether free BSD Jail is true or false.
<ide>
<del>### isAIX
<add>### `isAIX`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for Advanced Interactive eXecutive (AIX).
<ide>
<del>### isAlive(pid)
<add>### `isAlive(pid)`
<add>
<ide> * `pid` [<number>][]
<ide> * return [<boolean>][]
<ide>
<ide> Attempts to 'kill' `pid`
<ide>
<del>### isFreeBSD
<add>### `isFreeBSD`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for Free BSD.
<ide>
<del>### isIBMi
<add>### `isIBMi`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for IBMi.
<ide>
<del>### isLinux
<add>### `isLinux`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for Linux.
<ide>
<del>### isLinuxPPCBE
<add>### `isLinuxPPCBE`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for Linux on PowerPC.
<ide>
<del>### isOSX
<add>### `isOSX`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for macOS.
<ide>
<del>### isSunOS
<add>### `isSunOS`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for SunOS.
<ide>
<del>### isWindows
<add>### `isWindows`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Platform check for Windows.
<ide>
<del>### localhostIPv4
<add>### `localhostIPv4`
<add>
<ide> * [<string>][]
<ide>
<ide> IP of `localhost`.
<ide>
<del>### localIPv6Hosts
<add>### `localIPv6Hosts`
<add>
<ide> * [<Array>][]
<ide>
<ide> Array of IPV6 representations for `localhost`.
<ide>
<del>### mustCall(\[fn\]\[, exact\])
<add>### `mustCall([fn][, exact])`
<add>
<ide> * `fn` [<Function>][] default = () => {}
<ide> * `exact` [<number>][] default = 1
<ide> * return [<Function>][]
<ide> fail.
<ide>
<ide> If `fn` is not provided, an empty function will be used.
<ide>
<del>### mustCallAtLeast(\[fn\]\[, minimum\])
<add>### `mustCallAtLeast([fn][, minimum])`
<add>
<ide> * `fn` [<Function>][] default = () => {}
<ide> * `minimum` [<number>][] default = 1
<ide> * return [<Function>][]
<ide> fail.
<ide>
<ide> If `fn` is not provided, an empty function will be used.
<ide>
<del>### mustNotCall(\[msg\])
<add>### `mustNotCall([msg])`
<add>
<ide> * `msg` [<string>][] default = 'function should not have been called'
<ide> * return [<Function>][]
<ide>
<ide> Returns a function that triggers an `AssertionError` if it is invoked. `msg` is
<ide> used as the error message for the `AssertionError`.
<ide>
<del>### nodeProcessAborted(exitCode, signal)
<add>### `nodeProcessAborted(exitCode, signal)`
<add>
<ide> * `exitCode` [<number>][]
<ide> * `signal` [<string>][]
<ide> * return [<boolean>][]
<ide> Returns `true` if the exit code `exitCode` and/or signal name `signal` represent
<ide> the exit code and/or signal name of a node process that aborted, `false`
<ide> otherwise.
<ide>
<del>### opensslCli
<add>### `opensslCli`
<add>
<ide> * [<boolean>][]
<ide>
<ide> Indicates whether 'opensslCli' is supported.
<ide>
<del>### platformTimeout(ms)
<add>### `platformTimeout(ms)`
<add>
<ide> * `ms` [<number>][] | [<bigint>][]
<ide> * return [<number>][] | [<bigint>][]
<ide>
<ide> Returns a timeout value based on detected conditions. For example, a debug build
<ide> may need extra time so the returned value will be larger than on a release
<ide> build.
<ide>
<del>### PIPE
<add>### `PIPE`
<add>
<ide> * [<string>][]
<ide>
<ide> Path to the test socket.
<ide>
<del>### PORT
<add>### `PORT`
<add>
<ide> * [<number>][]
<ide>
<ide> A port number for tests to use if one is needed.
<ide>
<del>### printSkipMessage(msg)
<add>### `printSkipMessage(msg)`
<add>
<ide> * `msg` [<string>][]
<ide>
<ide> Logs '1..0 # Skipped: ' + `msg`
<ide>
<del>### pwdCommand
<add>### `pwdCommand`
<add>
<ide> * [<array>][] First two argument for the `spawn`/`exec` functions.
<ide>
<ide> Platform normalized `pwd` command options. Usage example:
<ide> const { spawn } = require('child_process');
<ide> spawn(...common.pwdCommand, { stdio: ['pipe'] });
<ide> ```
<ide>
<del>### rootDir
<add>### `rootDir`
<add>
<ide> * [<string>][]
<ide>
<ide> Path to the 'root' directory. either `/` or `c:\\` (windows)
<ide>
<del>### runWithInvalidFD(func)
<add>### `runWithInvalidFD(func)`
<add>
<ide> * `func` [<Function>][]
<ide>
<ide> Runs `func` with an invalid file descriptor that is an unsigned integer and
<ide> can be used to trigger `EBADF` as the first argument. If no such file
<ide> descriptor could be generated, a skip message will be printed and the `func`
<ide> will not be run.
<ide>
<del>### skip(msg)
<add>### `skip(msg)`
<add>
<ide> * `msg` [<string>][]
<ide>
<ide> Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`.
<ide>
<del>### skipIfEslintMissing()
<add>### `skipIfEslintMissing()`
<ide>
<ide> Skip the rest of the tests in the current file when `ESLint` is not available
<ide> at `tools/node_modules/eslint`
<ide>
<del>### skipIfInspectorDisabled()
<add>### `skipIfInspectorDisabled()`
<ide>
<ide> Skip the rest of the tests in the current file when the Inspector
<ide> was disabled at compile time.
<ide>
<del>### skipIf32Bits()
<add>### `skipIf32Bits()`
<ide>
<ide> Skip the rest of the tests in the current file when the Node.js executable
<ide> was compiled with a pointer size smaller than 64 bits.
<ide>
<del>### skipIfWorker()
<add>### `skipIfWorker()`
<ide>
<ide> Skip the rest of the tests in the current file when not running on a main
<ide> thread.
<ide> countdown.dec();
<ide> countdown.dec();
<ide> ```
<ide>
<del>### new Countdown(limit, callback)
<add>### `new Countdown(limit, callback)`
<ide>
<ide> * `limit` {number}
<ide> * `callback` {function}
<ide>
<ide> Creates a new `Countdown` instance.
<ide>
<del>### Countdown.prototype.dec()
<add>### `Countdown.prototype.dec()`
<ide>
<ide> Decrements the `Countdown` counter.
<ide>
<del>### Countdown.prototype.remaining
<add>### `Countdown.prototype.remaining`
<ide>
<ide> Specifies the remaining number of times `Countdown.prototype.dec()` must be
<ide> called before the callback is invoked.
<ide> called before the callback is invoked.
<ide>
<ide> The `cpu-prof` module provides utilities related to CPU profiling tests.
<ide>
<del>### env
<add>### `env`
<ide>
<ide> * Default: { ...process.env, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' }
<ide>
<ide> Environment variables used in profiled processes.
<ide>
<del>### getCpuProfiles(dir)
<add>### `getCpuProfiles(dir)`
<ide>
<ide> * `dir` {string} The directory containing the CPU profile files.
<ide> * return [<string>][]
<ide>
<ide> Returns an array of all `.cpuprofile` files found in `dir`.
<ide>
<del>### getFrames(file, suffix)
<add>### `getFrames(file, suffix)`
<ide>
<ide> * `file` {string} Path to a `.cpuprofile` file.
<ide> * `suffix` {string} Suffix of the URL of call frames to retrieve.
<ide> Returns an array of all `.cpuprofile` files found in `dir`.
<ide> Returns an object containing an array of the relevant call frames and an array
<ide> of all the profile nodes.
<ide>
<del>### kCpuProfInterval
<add>### `kCpuProfInterval`
<ide>
<ide> Sampling interval in microseconds.
<ide>
<del>### verifyFrames(output, file, suffix)
<add>### `verifyFrames(output, file, suffix)`
<ide>
<ide> * `output` {string}
<ide> * `file` {string}
<ide> Sampling interval in microseconds.
<ide> Throws an `AssertionError` if there are no call frames with the expected
<ide> `suffix` in the profiling data contained in `file`.
<ide>
<del>## DNS Module
<add>## `DNS` Module
<ide>
<ide> The `DNS` module provides utilities related to the `dns` built-in module.
<ide>
<del>### errorLookupMock(code, syscall)
<add>### `errorLookupMock(code, syscall)`
<ide>
<ide> * `code` [<string>][] Defaults to `dns.mockedErrorCode`.
<ide> * `syscall` [<string>][] Defaults to `dns.mockedSysCall`.
<ide> A mock for the `lookup` option of `net.connect()` that would result in an error
<ide> with the `code` and the `syscall` specified. Returns a function that has the
<ide> same signature as `dns.lookup()`.
<ide>
<del>### mockedErrorCode
<add>### `mockedErrorCode`
<ide>
<ide> The default `code` of errors generated by `errorLookupMock`.
<ide>
<del>### mockedSysCall
<add>### `mockedSysCall`
<ide>
<ide> The default `syscall` of errors generated by `errorLookupMock`.
<ide>
<del>### readDomainFromPacket(buffer, offset)
<add>### `readDomainFromPacket(buffer, offset)`
<ide>
<ide> * `buffer` [<Buffer>][]
<ide> * `offset` [<number>][]
<ide> The default `syscall` of errors generated by `errorLookupMock`.
<ide> Reads the domain string from a packet and returns an object containing the
<ide> number of bytes read and the domain.
<ide>
<del>### parseDNSPacket(buffer)
<add>### `parseDNSPacket(buffer)`
<ide>
<ide> * `buffer` [<Buffer>][]
<ide> * return [<Object>][]
<ide>
<ide> Parses a DNS packet. Returns an object with the values of the various flags of
<ide> the packet depending on the type of packet.
<ide>
<del>### writeIPv6(ip)
<add>### `writeIPv6(ip)`
<ide>
<ide> * `ip` [<string>][]
<ide> * return [<Buffer>][]
<ide>
<ide> Reads an IPv6 String and returns a Buffer containing the parts.
<ide>
<del>### writeDomainName(domain)
<add>### `writeDomainName(domain)`
<ide>
<ide> * `domain` [<string>][]
<ide> * return [<Buffer>][]
<ide>
<ide> Reads a Domain String and returns a Buffer containing the domain.
<ide>
<del>### writeDNSPacket(parsed)
<add>### `writeDNSPacket(parsed)`
<ide>
<ide> * `parsed` [<Object>][]
<ide> * return [<Buffer>][]
<ide> There is no difference between client or server side beyond their names.
<ide> The behavior of the Node.js test suite can be altered using the following
<ide> environment variables.
<ide>
<del>### NODE_COMMON_PORT
<add>### `NODE_COMMON_PORT`
<ide>
<ide> If set, `NODE_COMMON_PORT`'s value overrides the `common.PORT` default value of
<ide> 12346.
<ide>
<del>### NODE_SKIP_FLAG_CHECK
<add>### `NODE_SKIP_FLAG_CHECK`
<ide>
<ide> If set, command line arguments passed to individual tests are not validated.
<ide>
<del>### NODE_TEST_KNOWN_GLOBALS
<add>### `NODE_TEST_KNOWN_GLOBALS`
<ide>
<ide> A comma-separated list of variables names that are appended to the global
<ide> variable whitelist. Alternatively, if `NODE_TEST_KNOWN_GLOBALS` is set to `'0'`,
<ide> global leak detection is disabled.
<ide> The `common/fixtures` module provides convenience methods for working with
<ide> files in the `test/fixtures` directory.
<ide>
<del>### fixtures.fixturesDir
<add>### `fixtures.fixturesDir`
<ide>
<ide> * [<string>][]
<ide>
<ide> The absolute path to the `test/fixtures/` directory.
<ide>
<del>### fixtures.path(...args)
<add>### `fixtures.path(...args)`
<ide>
<ide> * `...args` [<string>][]
<ide>
<ide> Returns the result of `path.join(fixtures.fixturesDir, ...args)`.
<ide>
<del>### fixtures.readSync(args\[, enc\])
<add>### `fixtures.readSync(args[, enc])`
<ide>
<ide> * `args` [<string>][] | [<Array>][]
<ide>
<ide> Returns the result of
<ide> `fs.readFileSync(path.join(fixtures.fixturesDir, ...args), 'enc')`.
<ide>
<del>### fixtures.readKey(arg\[, enc\])
<add>### `fixtures.readKey(arg[, enc])`
<ide>
<ide> * `arg` [<string>][]
<ide>
<ide> Returns the result of
<ide> This provides utilities for checking the validity of heap dumps.
<ide> This requires the usage of `--expose-internals`.
<ide>
<del>### heap.recordState()
<add>### `heap.recordState()`
<ide>
<ide> Create a heap dump and an embedder graph copy for inspection.
<ide> The returned object has a `validateSnapshotNodes` function similar to the
<ide> one listed below. (`heap.validateSnapshotNodes(...)` is a shortcut for
<ide> `heap.recordState().validateSnapshotNodes(...)`.)
<ide>
<del>### heap.validateSnapshotNodes(name, expected, options)
<add>### `heap.validateSnapshotNodes(name, expected, options)`
<ide>
<ide> * `name` [<string>][] Look for this string as the name of heap dump nodes.
<ide> * `expected` [<Array>][] A list of objects, possibly with an `children`
<ide> hijackStdout((data) => {
<ide> console.log('this is sent to the hijacked listener');
<ide> ```
<ide>
<del>### hijackStderr(listener)
<add>### `hijackStderr(listener)`
<add>
<ide> * `listener` [<Function>][]: a listener with a single parameter
<ide> called `data`.
<ide>
<ide> called, `listener` will also be called and the `data` of `write` function will
<ide> be passed to `listener`. What's more, `process.stderr.writeTimes` is a count of
<ide> the number of calls.
<ide>
<del>### hijackStdout(listener)
<add>### `hijackStdout(listener)`
<add>
<ide> * `listener` [<Function>][]: a listener with a single parameter
<ide> called `data`.
<ide>
<ide> const frame = new http2.SettingsFrame(ack);
<ide> socket.write(frame.data);
<ide> ```
<ide>
<del>### http2.kFakeRequestHeaders
<add>### `http2.kFakeRequestHeaders`
<ide>
<ide> Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2
<ide> request headers to be used as the payload of a `http2.HeadersFrame`.
<ide> const frame = new http2.HeadersFrame(1, http2.kFakeRequestHeaders, 0, true);
<ide> socket.write(frame.data);
<ide> ```
<ide>
<del>### http2.kFakeResponseHeaders
<add>### `http2.kFakeResponseHeaders`
<ide>
<ide> Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2
<ide> response headers to be used as the payload a `http2.HeadersFrame`.
<ide> const frame = new http2.HeadersFrame(1, http2.kFakeResponseHeaders, 0, true);
<ide> socket.write(frame.data);
<ide> ```
<ide>
<del>### http2.kClientMagic
<add>### `http2.kClientMagic`
<ide>
<ide> Set to a `Buffer` containing the preamble bytes an HTTP/2 client must send
<ide> upon initial establishment of a connection.
<ide> socket.write(http2.kClientMagic);
<ide> The `common/internet` module provides utilities for working with
<ide> internet-related tests.
<ide>
<del>### internet.addresses
<add>### `internet.addresses`
<ide>
<ide> * [<Object>][]
<ide> * `INET_HOST` [<string>][] A generic host that has registered common
<ide> const onGC = require('../common/ongc');
<ide> onGC({}, { ongc() { console.log('collected'); } });
<ide> ```
<ide>
<del>### onGC(target, listener)
<add>### `onGC(target, listener)`
<add>
<ide> * `target` [<Object>][]
<ide> * `listener` [<Object>][]
<ide> * `ongc` [<Function>][]
<ide> should not be in scope when `listener.ongc()` is created.
<ide> The `report` module provides helper functions for testing diagnostic reporting
<ide> functionality.
<ide>
<del>### findReports(pid, dir)
<add>### `findReports(pid, dir)`
<ide>
<ide> * `pid` [<number>][] Process ID to retrieve diagnostic report files for.
<ide> * `dir` [<string>][] Directory to search for diagnostic report files.
<ide> functionality.
<ide> Returns an array of diagnotic report file names found in `dir`. The files should
<ide> have been generated by a process whose PID matches `pid`.
<ide>
<del>### validate(filepath)
<add>### `validate(filepath)`
<ide>
<ide> * `filepath` [<string>][] Diagnostic report filepath to validate.
<ide>
<ide> Validates the schema of a diagnostic report file whose path is specified in
<ide> `filepath`. If the report fails validation, an exception is thrown.
<ide>
<del>### validateContent(report)
<add>### `validateContent(report)`
<ide>
<ide> * `report` [<Object>][] | [<string>][] JSON contents of a diagnostic
<ide> report file, the parsed Object thereof, or the result of
<ide> Validates the schema of a diagnostic report whose content is specified in
<ide> The `tick` module provides a helper function that can be used to call a callback
<ide> after a given number of event loop "ticks".
<ide>
<del>### tick(x, cb)
<add>### `tick(x, cb)`
<ide>
<ide> * `x` [<number>][] Number of event loop "ticks".
<ide> * `cb` [<Function>][] A callback function.
<ide> after a given number of event loop "ticks".
<ide>
<ide> The `tmpdir` module supports the use of a temporary directory for testing.
<ide>
<del>### path
<add>### `path`
<add>
<ide> * [<string>][]
<ide>
<ide> The realpath of the testing temporary directory.
<ide>
<del>### refresh()
<add>### `refresh()`
<ide>
<ide> Deletes and recreates the testing temporary directory.
<ide>
<ide> parent.
<ide>
<ide> ## WPT Module
<ide>
<del>### harness
<add>### `harness`
<ide>
<ide> A legacy port of [Web Platform Tests][] harness.
<ide> | 5 |
PHP | PHP | apply fixes from styleci | 5dfafef41f9b2ebbdbf3f24b64f783ee49fb266d | <ide><path>tests/Database/DatabaseQueryBuilderTest.php
<ide> public function testMySqlWrappingJsonWithBooleanAndIntegerThatLooksLikeOne()
<ide>
<ide> public function testJsonPathEscaping()
<ide> {
<del> $expectedWithJsonEscaped = <<<SQL
<add> $expectedWithJsonEscaped = <<<'SQL'
<ide> select json_unquote(json_extract(`json`, '$."''))#"'))
<ide> SQL;
<ide> | 1 |
PHP | PHP | remove extraneous word | de1ff69da097f8c37e41b32fbb494f8a40aacebc | <ide><path>src/Illuminate/Foundation/Console/ListenerMakeCommand.php
<ide> protected function getDefaultNamespace($rootNamespace)
<ide> protected function getOptions()
<ide> {
<ide> return [
<del> ['event', null, InputOption::VALUE_REQUIRED, 'The event class the being listened for.'],
<add> ['event', null, InputOption::VALUE_REQUIRED, 'The event class being listened for.'],
<ide>
<ide> ['queued', null, InputOption::VALUE_NONE, 'Indicates the event listener should be queued.'],
<ide> ]; | 1 |
Javascript | Javascript | add property types in json documentation | ab45390e01c01a713ac1fe68c87ac25dd3d4ec5d | <ide><path>tools/doc/json.js
<ide> function processList(section) {
<ide> // copy the data up to the section.
<ide> var value = values[0] || {};
<ide> delete value.name;
<del> section.typeof = value.type;
<add> section.typeof = value.type || section.typeof;
<ide> delete value.type;
<ide> Object.keys(value).forEach(function(k) {
<ide> section[k] = value[k]; | 1 |
Mixed | Ruby | add deprecations for a smooth transition after | a8f773b05734b9a798ae9755d280ef95004ec711 | <ide><path>activesupport/CHANGELOG.md
<add>* `ActiveSupport::Cache::Store#namespaced_key`,
<add> `ActiveSupport::Cache::MemCachedStore#escape_key`, and
<add> `ActiveSupport::Cache::FileStore#key_file_path`
<add> are deprecated and replaced with `normalize_key` that now calls `super`.
<add>
<add> `ActiveSupport::Cache::LocaleCache#set_cache_value` is deprecated and replaced with `write_cache_value`.
<add>
<add> *Michael Grosser*
<add>
<ide> * Implements an evented file system monitor to asynchronously detect changes
<ide> in the application source code, routes, locales, etc.
<ide>
<ide><path>activesupport/lib/active_support/cache.rb
<ide> require 'active_support/core_ext/numeric/time'
<ide> require 'active_support/core_ext/object/to_param'
<ide> require 'active_support/core_ext/string/inflections'
<add>require 'active_support/core_ext/string/strip'
<ide>
<ide> module ActiveSupport
<ide> # See ActiveSupport::Cache::Store for documentation.
<ide> def normalize_key(key, options)
<ide> key = "#{prefix}:#{key}" if prefix
<ide> key
<ide> end
<del> alias namespaced_key normalize_key
<add>
<add> def namespaced_key(*args)
<add> ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
<add> `namespaced_key` is deprecated and will be removed from Rails 5.1.
<add> Please use `normalize_key` which will return a fully resolved key.
<add> MESSAGE
<add> normalize_key(*args)
<add> end
<ide>
<ide> def instrument(operation, key, options = nil)
<ide> log { "Cache #{operation}: #{normalize_key(key, options)}#{options.blank? ? "" : " (#{options.inspect})"}" }
<ide><path>activesupport/lib/active_support/cache/file_store.rb
<ide> def normalize_key(key, options)
<ide> File.join(cache_path, DIR_FORMATTER % dir_1, DIR_FORMATTER % dir_2, *fname_paths)
<ide> end
<ide>
<add> def key_file_path(key)
<add> ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
<add> `key_file_path` is deprecated and will be removed from Rails 5.1.
<add> Please use `normalize_key` which will return a fully resolved key or nothing.
<add> MESSAGE
<add> key
<add> end
<add>
<ide> # Translate a file path into a key.
<ide> def file_path_key(path)
<ide> fname = path[cache_path.to_s.size..-1].split(File::SEPARATOR, 4).last
<ide><path>activesupport/lib/active_support/cache/mem_cache_store.rb
<ide> def normalize_key(key, options)
<ide> key
<ide> end
<ide>
<add> def escape_key(key)
<add> ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
<add> `escape_key` is deprecated and will be removed from Rails 5.1.
<add> Please use `normalize_key` which will return a fully resolved key or nothing.
<add> MESSAGE
<add> key
<add> end
<add>
<ide> def deserialize_entry(raw_value)
<ide> if raw_value
<ide> entry = Marshal.load(raw_value) rescue raw_value
<ide><path>activesupport/lib/active_support/cache/strategy/local_cache.rb
<ide> def cleanup(options = nil) # :nodoc:
<ide> def increment(name, amount = 1, options = nil) # :nodoc:
<ide> return super unless local_cache
<ide> value = bypass_local_cache{super}
<del> set_cache_value(name, value, options)
<add> write_cache_value(name, value, options)
<ide> value
<ide> end
<ide>
<ide> def decrement(name, amount = 1, options = nil) # :nodoc:
<ide> return super unless local_cache
<ide> value = bypass_local_cache{super}
<del> set_cache_value(name, value, options)
<add> write_cache_value(name, value, options)
<ide> value
<ide> end
<ide>
<ide> def delete_entry(key, options) # :nodoc:
<ide> super
<ide> end
<ide>
<del> def set_cache_value(name, value, options) # :nodoc:
<add> def set_cache_value(value, name, amount, options) # :nodoc:
<add> ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
<add> `set_cache_value` is deprecated and will be removed from Rails 5.1.
<add> Please use `write_cache_value`
<add> MESSAGE
<add> write_cache_value name, value, options
<add> end
<add>
<add> def write_cache_value(name, value, options) # :nodoc:
<ide> name = normalize_key(name, options)
<ide> cache = local_cache
<ide> cache.mute do
<ide><path>activesupport/test/caching_test.rb
<ide> def test_cache_miss_instrumentation
<ide> ensure
<ide> ActiveSupport::Notifications.unsubscribe "cache_read.active_support"
<ide> end
<add>
<add> def test_can_call_deprecated_namesaced_key
<add> assert_deprecated "`namespaced_key` is deprecated" do
<add> @cache.send(:namespaced_key, 111, {})
<add> end
<add> end
<ide> end
<ide>
<ide> # https://rails.lighthouseapp.com/projects/8994/tickets/6225-memcachestore-cant-deal-with-umlauts-and-special-characters
<ide> def test_middleware
<ide> app = @cache.middleware.new(app)
<ide> app.call({})
<ide> end
<add>
<add> def test_can_call_deprecated_set_cache_value
<add> @cache.with_local_cache do
<add> assert_deprecated "`set_cache_value` is deprecated" do
<add> @cache.send(:set_cache_value, 1, 'foo', :ignored, {})
<add> end
<add> assert_equal 1, @cache.read('foo')
<add> end
<add> end
<ide> end
<ide>
<ide> module AutoloadingCacheBehavior
<ide> def test_write_with_unless_exist
<ide> @cache.write(1, nil)
<ide> assert_equal false, @cache.write(1, "aaaaaaaaaa", unless_exist: true)
<ide> end
<add>
<add> def test_can_call_deprecated_key_file_path
<add> assert_deprecated "`key_file_path` is deprecated" do
<add> assert_equal 111, @cache.send(:key_file_path, 111)
<add> end
<add> end
<ide> end
<ide>
<ide> class MemoryStoreTest < ActiveSupport::TestCase
<ide> def test_read_should_return_a_different_object_id_each_time_it_is_called
<ide> value << 'bingo'
<ide> assert_not_equal value, @cache.read('foo')
<ide> end
<add>
<add> def test_can_call_deprecated_escape_key
<add> assert_deprecated "`escape_key` is deprecated" do
<add> assert_equal 111, @cache.send(:escape_key, 111)
<add> end
<add> end
<ide> end
<ide>
<ide> class NullStoreTest < ActiveSupport::TestCase | 6 |
Text | Text | update index.md description | f04d98dcbb62ff38b74a8c324d5f04c7c76aa58c | <ide><path>guide/english/computer-science/index.md
<ide> title: Computer Science
<ide> ---
<ide> # Computer Science
<ide>
<del>Computer Science is the study of computers and the concepts that make computers possible.
<add>Computer Science is the study of computers and the concepts that make computers possible. It is a scientific approach to computation and its applications. This includes the study of the structure, expression, and algorithms that underlie the manipulation of data.
<ide>
<ide> Much of computer science was pioneered in the latter half of the 20th century.
<ide> | 1 |
Python | Python | clarify the after_request argument | dfae2679a6be1d3e61eaa9f83e85e0daf655187c | <ide><path>flask/app.py
<ide> def before_first_request(self, f):
<ide>
<ide> @setupmethod
<ide> def after_request(self, f):
<del> """Register a function to be run after each request. Your function
<del> must take one parameter, a :attr:`response_class` object and return
<del> a new response object or the same (see :meth:`process_response`).
<add> """Register a function to be run after each request.
<add>
<add> Your function must take one parameter, an instance of
<add> :attr:`response_class` and return a new response object or the
<add> same (see :meth:`process_response`).
<ide>
<ide> As of Flask 0.7 this function might not be executed at the end of the
<ide> request in case an unhandled exception occurred. | 1 |
Javascript | Javascript | remove process.mixin dependency from all tests | 5861db8a69695e4f1a8c82ad2de55e4b07ab981a | <ide><path>test/common.js
<ide> var path = require("path");
<ide>
<add>exports = module.exports = global;
<add>
<ide> exports.testDir = path.dirname(__filename);
<ide> exports.fixturesDir = path.join(exports.testDir, "fixtures");
<ide> exports.libDir = path.join(exports.testDir, "../lib");
<ide> exports.PORT = 12346;
<ide>
<ide> require.paths.unshift(exports.libDir);
<ide>
<del>var assert = require('assert');
<ide> var sys = require("sys");
<del>
<del>process.mixin(exports, sys);
<del>exports.assert = require('assert');
<ide>\ No newline at end of file
<add>for (var i in sys) exports[i] = sys[i];
<add>exports.assert = require('assert');
<ide><path>test/disabled/test-cat.js
<del>process.mixin(require("../common.js"));
<add>require("../common.js");
<ide> http = require("/http.js");
<ide>
<ide> puts("hello world");
<ide><path>test/disabled/test-dns.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var dns = require("dns"),
<ide> sys = require("sys");
<ide><path>test/disabled/test-eio-race3.js
<ide> /* XXX Can this test be modified to not call the now-removed wait()? */
<ide>
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide>
<ide> puts('first stat ...');
<ide><path>test/disabled/test-fs-sendfile.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> tcp = require("tcp");
<ide> sys = require("sys");
<ide><path>test/disabled/test-http-stress.js
<del>process.mixin(require('../common.js'));
<add>require("../common");
<ide>
<ide> var request_count = 1000;
<ide> var response_body = '{"ok": true}';
<ide><path>test/fixtures/echo.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> process.stdio.open();
<ide>
<ide> print("hello world\r\n");
<ide><path>test/fixtures/print-chars.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var n = parseInt(process.argv[2]);
<ide>
<ide><path>test/pummel/test-http-client-reconnect-bug.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var tcp = require("tcp"),
<ide> sys = require("sys"),
<ide><path>test/pummel/test-keep-alive.js
<ide> // This test requires the program "ab"
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> http = require("http");
<ide> sys = require("sys");
<ide>
<ide><path>test/pummel/test-multipart.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var http = require("http"),
<ide> multipart = require("multipart"),
<ide><path>test/pummel/test-process-spawn-loop.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var N = 40;
<ide> var finished = false;
<ide><path>test/pummel/test-tcp-many-clients.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> // settings
<ide> var bytes = 1024*40;
<ide><path>test/pummel/test-tcp-pause.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> N = 200;
<ide>
<ide><path>test/pummel/test-tcp-pingpong-delay.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide>
<ide>
<ide><path>test/pummel/test-tcp-pingpong.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide>
<ide> var tests_run = 0;
<ide><path>test/pummel/test-tcp-throttle.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> N = 60*1024; // 30kb
<ide>
<ide><path>test/pummel/test-tcp-timeout.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> exchanges = 0;
<ide> starttime = null;
<ide><path>test/pummel/test-tcp-tls.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> fs=require("fs");
<ide>
<ide><path>test/pummel/test-timers.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var WINDOW = 200; // why is does this need to be so big?
<ide>
<ide><path>test/pummel/test-watch-file.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var fs = require("fs");
<ide> var path = require("path");
<ide><path>test/simple/test-assert.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var a = require('assert');
<ide>
<ide><path>test/simple/test-byte-length.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> assert.equal(14, process._byteLength("Il était tué"));
<ide> assert.equal(14, process._byteLength("Il était tué", "utf8"));
<ide><path>test/simple/test-chdir.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> assert.equal(true, process.cwd() !== __dirname);
<ide>
<ide><path>test/simple/test-child-process-env.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> child = process.createChildProcess('/usr/bin/env', [], {'HELLO' : 'WORLD'});
<ide> response = "";
<ide>
<ide><path>test/simple/test-delayed-require.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> setTimeout(function () {
<ide> a = require("../fixtures/a");
<ide><path>test/simple/test-eio-race.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var count = 100;
<ide> var fs = require('fs');
<ide><path>test/simple/test-eio-race2.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var testTxt = path.join(fixturesDir, "x.txt");
<ide> var fs = require('fs');
<ide><path>test/simple/test-eio-race4.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var fs = require('fs');
<ide> var N = 100;
<ide> var j = 0;
<ide><path>test/simple/test-event-emitter-add-listeners.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var events = require('events');
<ide>
<ide> var e = new events.EventEmitter();
<ide><path>test/simple/test-event-emitter-modify-in-emit.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var events = require('events');
<ide>
<ide> var callbacks_called = [ ];
<ide><path>test/simple/test-exception-handler.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var MESSAGE = 'catch me if you can';
<ide> var caughtException = false;
<ide><path>test/simple/test-exec.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> success_count = 0;
<ide> error_count = 0;
<ide><path>test/simple/test-file-read-noexist.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide> var got_error = false;
<ide><path>test/simple/test-file-read-stream.js
<del>process.mixin(require('../common'));
<add>require('../common');
<ide>
<ide> var
<ide> path = require('path'),
<ide><path>test/simple/test-file-write-stream.js
<del>process.mixin(require('../common'));
<add>require('../common');
<ide>
<ide> var
<ide> path = require('path'),
<ide><path>test/simple/test-fs-chmod.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide> var got_error = false;
<ide><path>test/simple/test-fs-realpath.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var fs = require('fs');
<ide> var path = require('path');
<ide> var async_completed = 0, async_expected = 0, unlink = [];
<ide><path>test/simple/test-fs-stat.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var fs = require('fs');
<ide> var got_error = false;
<ide> var success_count = 0;
<ide><path>test/simple/test-fs-symlink.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide> var completed = 0;
<ide><path>test/simple/test-fs-write.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide> var fn = path.join(fixturesDir, "write.txt");
<ide><path>test/simple/test-http-1.0.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> http = require("http");
<ide>
<ide><path>test/simple/test-http-cat.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> http = require("http");
<ide>
<ide> var body = "exports.A = function() { return 'A';}";
<ide><path>test/simple/test-http-chunked.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var http = require("http");
<ide>
<ide> var UTF8_STRING = "Il était tué";
<ide><path>test/simple/test-http-client-race.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> http = require("http");
<ide> url = require("url");
<ide>
<ide><path>test/simple/test-http-client-upload.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> http = require("http");
<ide>
<ide> var sent_body = "";
<ide><path>test/simple/test-http-eof-on-connect.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> http = require("http");
<ide>
<ide><path>test/simple/test-http-malformed-request.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> http = require("http");
<ide> url = require("url");
<ide><path>test/simple/test-http-proxy.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> http = require("http");
<ide> url = require("url");
<ide>
<ide><path>test/simple/test-http-server.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> http = require("http");
<ide> url = require("url");
<ide><path>test/simple/test-http-tls.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var http = require("http");
<ide> var url = require("url");
<ide> var fs = require('fs');
<ide><path>test/simple/test-http-wget.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> http = require("http");
<ide>
<ide><path>test/simple/test-http.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> http = require("http");
<ide> url = require("url");
<ide>
<ide><path>test/simple/test-idle-watcher.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var complete = false;
<ide> var idle = new process.IdleWatcher();
<ide><path>test/simple/test-ini.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require("fs");
<ide> parse = require("ini").parse;
<ide><path>test/simple/test-memory-usage.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var r = process.memoryUsage();
<ide> puts(inspect(r));
<ide><path>test/simple/test-mkdir-rmdir.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide>
<ide><path>test/simple/test-module-loading.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide>
<ide> debug("load test-module-loading.js");
<ide><path>test/simple/test-next-tick.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var complete = 0;
<ide>
<ide><path>test/simple/test-path.js
<ide> var path = require("path");
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var f = __filename;
<ide>
<ide><path>test/simple/test-process-buffering.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var pwd_called = false;
<ide>
<ide><path>test/simple/test-process-kill.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var exit_status = -1;
<ide>
<ide><path>test/simple/test-process-mixin.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var target = function() {};
<ide> process.mixin(target, {
<ide> process.mixin(true, target, {
<ide> });
<ide>
<ide> assert.notStrictEqual(['bar'], target.foo);
<del>assert.deepEqual(['bar'], target.foo);
<ide>\ No newline at end of file
<add>assert.deepEqual(['bar'], target.foo);
<ide><path>test/simple/test-process-simple.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var cat = process.createChildProcess("cat");
<ide>
<ide><path>test/simple/test-querystring.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> // test using assert
<ide>
<ide><path>test/simple/test-readdir.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide>
<ide><path>test/simple/test-remote-module-loading.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var http = require('http');
<ide> var sys = require('sys');
<ide><path>test/simple/test-signal-handler.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> puts("process.pid: " + process.pid);
<ide>
<ide><path>test/simple/test-stdio.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide>
<ide> var sub = path.join(fixturesDir, 'echo.js');
<ide><path>test/simple/test-stdout-flush.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> var path = require('path');
<ide>
<ide> var sub = path.join(fixturesDir, 'print-chars.js');
<ide><path>test/simple/test-sync-fileread.js
<del>process.mixin(require('../common'));
<add>require('../common');
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide>
<ide><path>test/simple/test-sys.js
<del>process.mixin(require("../common"));
<del>process.mixin(require("sys"));
<add>require("../common");
<ide>
<ide> assert.equal("0", inspect(0));
<ide> assert.equal("1", inspect(1));
<ide><path>test/simple/test-tcp-binary.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide>
<ide> binaryString = "";
<ide><path>test/simple/test-tcp-reconnect.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide> tcp = require("tcp");
<ide> var N = 50;
<ide>
<ide><path>test/simple/test-umask.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var mask = 0664;
<ide> var old = process.umask(mask);
<ide><path>test/simple/test-url.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> var url = require("url"),
<ide> sys = require("sys");
<ide><path>test/simple/test-utf8-scripts.js
<del>process.mixin(require("../common"));
<add>require("../common");
<ide>
<ide> // üäö
<ide> | 77 |
Go | Go | correct the spelling error of driver | 054e479bfae694194d40b4b68c63e5819a436b29 | <ide><path>daemon/daemon.go
<ide> func (daemon *Daemon) restore() error {
<ide> // if the container has restart policy, do not
<ide> // prepare the mountpoints since it has been done on restarting.
<ide> // This is to speed up the daemon start when a restart container
<del> // has a volume and the volume dirver is not available.
<add> // has a volume and the volume driver is not available.
<ide> if _, ok := restartContainers[c]; ok {
<ide> continue
<ide> } else if _, ok := removeContainers[c.ID]; ok { | 1 |
Text | Text | fix typo for `decipher.final` | ca9784e358cb92bf3e7a1061ab68ee57a23a9fbf | <ide><path>doc/api/crypto.md
<ide> added: v0.1.94
<ide> -->
<ide>
<ide> Returns any remaining deciphered contents. If `output_encoding`
<del>parameter is one of `'latin1'`, `'base64'` or `'hex'`, a string is returned.
<add>parameter is one of `'latin1'`, `'ascii'` or `'utf8'`, a string is returned.
<ide> If an `output_encoding` is not provided, a [`Buffer`][] is returned.
<ide>
<ide> Once the `decipher.final()` method has been called, the `Decipher` object can | 1 |
Ruby | Ruby | remove dead code | d2a44869f0b49f210c42bfe12787fa215a6c150e | <ide><path>Library/Homebrew/cmd/test-bot.rb
<ide> def resolve_test_tap
<ide> end
<ide> end
<ide>
<del> if git_url = ENV["UPSTREAM_GIT_URL"] || ENV["GIT_URL"]
<del> # Also can get tap from Jenkins GIT_URL.
<del> url_path = git_url.sub(%r{^https?://github\.com/}, "").chomp("/")
<del> begin
<del> tap = Tap.fetch(tap)
<del> return tap unless tap.core_formula_repository?
<del> rescue
<del> end
<del> end
<del>
<ide> # return nil means we are testing core repo.
<ide> end
<ide> | 1 |
Go | Go | fix netns test cleanup | 73baee2dcf546b2561bdd9a500b0af08cb62b1be | <ide><path>internal/test/daemon/daemon_unix.go
<ide> func cleanupNetworkNamespace(t testingT, execRoot string) {
<ide> // new exec root.
<ide> netnsPath := filepath.Join(execRoot, "netns")
<ide> filepath.Walk(netnsPath, func(path string, info os.FileInfo, err error) error {
<del> if err := unix.Unmount(path, unix.MNT_FORCE); err != nil {
<add> if err := unix.Unmount(path, unix.MNT_DETACH); err != nil && err != unix.EINVAL && err != unix.ENOENT {
<ide> t.Logf("unmount of %s failed: %v", path, err)
<ide> }
<ide> os.Remove(path) | 1 |
Javascript | Javascript | update gulpfile.js to use in strict mode | 14399ffe372ebabcb66bab20827b45594e7fc204 | <ide><path>gulpfile.js
<ide> var yargs = require('yargs');
<ide> var path = require('path');
<ide> var fs = require('fs');
<ide> var htmllint = require('gulp-htmllint');
<del>var package = require('./package.json');
<add>var pkg = require('./package.json');
<ide>
<ide> var argv = yargs
<ide> .option('force-output', {default: false})
<ide> gulp.task('default', ['build', 'watch']);
<ide> */
<ide> function bowerTask() {
<ide> var json = JSON.stringify({
<del> name: package.name,
<del> description: package.description,
<del> homepage: package.homepage,
<del> license: package.license,
<del> version: package.version,
<add> name: pkg.name,
<add> description: pkg.description,
<add> homepage: pkg.homepage,
<add> license: pkg.license,
<add> version: pkg.version,
<ide> main: outDir + "Chart.js",
<ide> ignore: [
<ide> '.github',
<ide> function buildTask() {
<ide> .on('error', errorHandler)
<ide> .pipe(source('Chart.bundle.js'))
<ide> .pipe(insert.prepend(header))
<del> .pipe(streamify(replace('{{ version }}', package.version)))
<add> .pipe(streamify(replace('{{ version }}', pkg.version)))
<ide> .pipe(gulp.dest(outDir))
<ide> .pipe(streamify(uglify()))
<ide> .pipe(insert.prepend(header))
<del> .pipe(streamify(replace('{{ version }}', package.version)))
<add> .pipe(streamify(replace('{{ version }}', pkg.version)))
<ide> .pipe(streamify(concat('Chart.bundle.min.js')))
<ide> .pipe(gulp.dest(outDir));
<ide>
<ide> function buildTask() {
<ide> .on('error', errorHandler)
<ide> .pipe(source('Chart.js'))
<ide> .pipe(insert.prepend(header))
<del> .pipe(streamify(replace('{{ version }}', package.version)))
<add> .pipe(streamify(replace('{{ version }}', pkg.version)))
<ide> .pipe(gulp.dest(outDir))
<ide> .pipe(streamify(uglify()))
<ide> .pipe(insert.prepend(header))
<del> .pipe(streamify(replace('{{ version }}', package.version)))
<add> .pipe(streamify(replace('{{ version }}', pkg.version)))
<ide> .pipe(streamify(concat('Chart.min.js')))
<ide> .pipe(gulp.dest(outDir));
<ide> | 1 |
Text | Text | add more verbosity to index.md for groovy | 62ba46f9ce9ea4acd9a2f1abdc3cacbb7aa7a376 | <ide><path>guide/english/groovy/index.md
<ide> title: Groovy
<ide> ---
<ide> ## Groovy
<del>Apache Groovy or Groovy is a powerful and dynamic language with static compilation and typing capabilities for the Java platform and was designed to increase productivity with its concise and familiar syntax. It integrates with any Java program with ease.
<add>
<add>Appache groovy, or just plain groovy is JVM language, that builds on standard java with many modern and flexible features that developers outside of java have become accustomed too.
<add>
<add>Since groovy can accept most java files. So, its perfect for anyone with a java foundation. In learning groovy, a developer can start out writing java and build on groovy concepts and idioms, and add them to their programs, or even refactor as the develop their groovy chopss.
<add>
<add>Some of those features are dynamic typing, operator overloading, and native support for lists, maps, regualr expressions. Plus, features like automatic null pointer checking, and the safe navigator operator ?. Groovy can even be executed as an uncompiled script.
<add>
<add>
<add>Popular usages of groovy are:
<add>- [gradle](https://gradle.org/)
<add>- [grails](https://grails.org/)
<add>- [jenkins pipeline configuration](https://jenkins.io/doc/pipeline/steps/workflow-cps/)
<ide>
<ide> ### Hello World
<ide> Try the traditional "Hello World" example below: | 1 |
PHP | PHP | remove unnecessary use on verification controller | 2c5633d334f26efbf9da3083677169b08d23ee36 | <ide><path>app/Http/Controllers/Auth/VerificationController.php
<ide>
<ide> namespace App\Http\Controllers\Auth;
<ide>
<del>use Illuminate\Http\Request;
<ide> use Illuminate\Routing\Controller;
<ide> use Illuminate\Foundation\Auth\VerifiesEmails;
<ide> | 1 |
Python | Python | use inline if | d920683237bd2eb17d110a80fc09708a67340f01 | <ide><path>rest_framework/decorators.py
<ide> def api_view(http_method_names=None):
<ide> Decorator that converts a function-based view into an APIView subclass.
<ide> Takes a list of allowed methods for the view as an argument.
<ide> """
<del> if http_method_names is None:
<del> http_method_names = ['GET']
<add> http_method_names = ['GET'] if http_method_names is None else http_method_names
<ide>
<ide> def decorator(func):
<ide>
<ide> def detail_route(methods=None, **kwargs):
<ide> """
<ide> Used to mark a method on a ViewSet that should be routed for detail requests.
<ide> """
<del> if methods is None:
<del> methods = ['get']
<add> methods = ['get'] if methods is None else methods
<add>
<ide> def decorator(func):
<ide> func.bind_to_methods = methods
<ide> func.detail = True
<ide> def list_route(methods=None, **kwargs):
<ide> """
<ide> Used to mark a method on a ViewSet that should be routed for list requests.
<ide> """
<del> if methods is None:
<del> methods = ['get']
<add> methods = ['get'] if methods is None else methods
<add>
<ide> def decorator(func):
<ide> func.bind_to_methods = methods
<ide> func.detail = False | 1 |
PHP | PHP | replace deprecated table helper | b55b0e6ab5d7c9a3c9c369705838e022c1b39874 | <ide><path>src/Illuminate/Console/Command.php
<ide> <?php namespace Illuminate\Console;
<ide>
<add>use Symfony\Component\Helper\Table;
<ide> use Symfony\Component\Console\Input\ArrayInput;
<ide> use Symfony\Component\Console\Output\NullOutput;
<ide> use Symfony\Component\Console\Question\Question;
<ide> public function choice($question, array $choices, $default = null, $attempts = n
<ide> return $helper->ask($this->input, $this->output, $question);
<ide> }
<ide>
<del> /**
<del> * Format input to textual table
<del> *
<del> * @param array $headers
<del> * @param array $rows
<del> * @return void
<del> */
<del> public function table(array $headers, array $rows)
<add> /**
<add> * Format input to textual table
<add> *
<add> * @param array $headers
<add> * @param array $rows
<add> * @param string $style
<add> * @return void
<add> */
<add> public function table(array $headers, array $rows, $style = 'default')
<ide> {
<del> $table = $this->getHelperSet()->get('table');
<add> $table = new Table($this->output);
<ide> $table->setHeaders($headers);
<ide> $table->setRows($rows);
<del> $table->render($this->output);
<add> $table->setStyle($style);
<add> $table->render();
<ide> }
<ide>
<ide> /** | 1 |
PHP | PHP | add getters and setters to eloquentuserprovider | ef359c9845e1850af7d3b58779c8b84ba4d3dff9 | <ide><path>src/Illuminate/Auth/EloquentUserProvider.php
<ide> public function createModel()
<ide>
<ide> return new $class;
<ide> }
<add>
<add> /**
<add> * Gets the hasher implementation.
<add> *
<add> * @return \Illuminate\Contracts\Hashing\Hasher
<add> */
<add> public function getHasher()
<add> {
<add> return $this->hasher;
<add> }
<add>
<add> /**
<add> * Sets the hasher implementation.
<add> *
<add> * @param \Illuminate\Contracts\Hashing\Hasher $hasher
<add> * @return $this
<add> */
<add> public function setHasher(HasherContract $hasher)
<add> {
<add> $this->hasher = $hasher;
<add>
<add> return $this;
<add> }
<add>
<add> /**
<add> * Gets the name of the Eloquent user model.
<add> *
<add> * @return string
<add> */
<add> public function getModel()
<add> {
<add> return $this->model;
<add> }
<add>
<add> /**
<add> * Sets the name of the Eloquent user model.
<add> *
<add> * @param string $model
<add> * @return $this
<add> */
<add> public function setModel($model)
<add> {
<add> $this->model = $model;
<add>
<add> return $this;
<add> }
<ide> } | 1 |
Go | Go | add support for named pipe protocol | 0906195fbbd6f379c163b80f23e4c5a60bcfc5f0 | <ide><path>api/client/cli.go
<ide> func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (host string,
<ide> return "", errors.New("Please specify only one -H")
<ide> }
<ide>
<del> defaultHost := opts.DefaultTCPHost
<del> if tlsOptions != nil {
<del> defaultHost = opts.DefaultTLSHost
<del> }
<del>
<del> host, err = opts.ParseHost(defaultHost, host)
<add> host, err = opts.ParseHost(tlsOptions != nil, host)
<ide> return
<ide> }
<ide>
<ide><path>api/server/server_windows.go
<ide> package server
<ide>
<ide> import (
<ide> "errors"
<add> "fmt"
<add> "github.com/Microsoft/go-winio"
<ide> "net"
<ide> "net/http"
<add> "strings"
<ide> )
<ide>
<ide> // NewServer sets up the required Server and does protocol specific checking.
<ide> func (s *Server) newServer(proto, addr string) ([]*HTTPServer, error) {
<ide> }
<ide> ls = append(ls, l)
<ide>
<add> case "npipe":
<add> // allow Administrators and SYSTEM, plus whatever additional users or groups were specified
<add> sddl := "D:P(A;;GA;;;BA)(A;;GA;;;SY)"
<add> if s.cfg.SocketGroup != "" {
<add> for _, g := range strings.Split(s.cfg.SocketGroup, ",") {
<add> sid, err := winio.LookupSidByName(g)
<add> if err != nil {
<add> return nil, err
<add> }
<add> sddl += fmt.Sprintf("(A;;GRGW;;;%s)", sid)
<add> }
<add> }
<add> l, err := winio.ListenPipe(addr, sddl)
<add> if err != nil {
<add> return nil, err
<add> }
<add> ls = append(ls, l)
<add>
<ide> default:
<del> return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
<add> return nil, errors.New("Invalid protocol format. Windows only supports tcp and npipe.")
<ide> }
<ide>
<ide> var res []*HTTPServer
<ide><path>daemon/config.go
<ide> type CommonConfig struct {
<ide> Pidfile string `json:"pidfile,omitempty"`
<ide> RawLogs bool `json:"raw-logs,omitempty"`
<ide> Root string `json:"graph,omitempty"`
<add> SocketGroup string `json:"group,omitempty"`
<ide> TrustKeyPath string `json:"-"`
<ide>
<ide> // ClusterStore is the storage backend used for the cluster information. It is used by both
<ide><path>daemon/config_unix.go
<ide> type Config struct {
<ide> EnableCors bool `json:"api-enable-cors,omitempty"`
<ide> EnableSelinuxSupport bool `json:"selinux-enabled,omitempty"`
<ide> RemappedRoot string `json:"userns-remap,omitempty"`
<del> SocketGroup string `json:"group,omitempty"`
<ide> CgroupParent string `json:"cgroup-parent,omitempty"`
<ide> Ulimits map[string]*units.Ulimit `json:"default-ulimits,omitempty"`
<ide> }
<ide><path>daemon/config_windows.go
<ide> func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) strin
<ide>
<ide> // Then platform-specific install flags.
<ide> cmd.StringVar(&config.bridgeConfig.VirtualSwitchName, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
<add> cmd.StringVar(&config.SocketGroup, []string{"G", "-group"}, "", usageFn("Users or groups that can access the named pipe"))
<ide> }
<ide><path>docker/daemon.go
<ide> func (cli *DaemonCli) CmdDaemon(args ...string) error {
<ide> serverConfig := &apiserver.Config{
<ide> AuthorizationPluginNames: cli.Config.AuthorizationPlugins,
<ide> Logging: true,
<add> SocketGroup: cli.Config.SocketGroup,
<ide> Version: dockerversion.Version,
<ide> }
<ide> serverConfig = setPlatformServerConfig(serverConfig, cli.Config)
<ide>
<del> defaultHost := opts.DefaultHost
<ide> if cli.Config.TLS {
<ide> tlsOptions := tlsconfig.Options{
<ide> CAFile: cli.Config.CommonTLSOptions.CAFile,
<ide> func (cli *DaemonCli) CmdDaemon(args ...string) error {
<ide> logrus.Fatal(err)
<ide> }
<ide> serverConfig.TLSConfig = tlsConfig
<del> defaultHost = opts.DefaultTLSHost
<ide> }
<ide>
<ide> if len(cli.Config.Hosts) == 0 {
<ide> cli.Config.Hosts = make([]string, 1)
<ide> }
<ide> for i := 0; i < len(cli.Config.Hosts); i++ {
<ide> var err error
<del> if cli.Config.Hosts[i], err = opts.ParseHost(defaultHost, cli.Config.Hosts[i]); err != nil {
<add> if cli.Config.Hosts[i], err = opts.ParseHost(cli.Config.TLS, cli.Config.Hosts[i]); err != nil {
<ide> logrus.Fatalf("error parsing -H %s : %v", cli.Config.Hosts[i], err)
<ide> }
<ide>
<ide><path>docker/daemon_unix.go
<ide> import (
<ide> const defaultDaemonConfigFile = "/etc/docker/daemon.json"
<ide>
<ide> func setPlatformServerConfig(serverConfig *apiserver.Config, daemonCfg *daemon.Config) *apiserver.Config {
<del> serverConfig.SocketGroup = daemonCfg.SocketGroup
<ide> serverConfig.EnableCors = daemonCfg.EnableCors
<ide> serverConfig.CorsHeaders = daemonCfg.CorsHeaders
<ide>
<ide><path>opts/hosts.go
<ide> import (
<ide> "fmt"
<ide> "net"
<ide> "net/url"
<del> "runtime"
<ide> "strconv"
<ide> "strings"
<ide> )
<ide>
<ide> var (
<ide> // DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. docker daemon -H tcp://
<del> // TODO Windows. DefaultHTTPPort is only used on Windows if a -H parameter
<del> // is not supplied. A better longer term solution would be to use a named
<del> // pipe as the default on the Windows daemon.
<ide> // These are the IANA registered port numbers for use with Docker
<ide> // see http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker
<ide> DefaultHTTPPort = 2375 // Default HTTP Port
<ide> var (
<ide> DefaultTCPHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultHTTPPort)
<ide> // DefaultTLSHost constant defines the default host string used by docker for TLS sockets
<ide> DefaultTLSHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultTLSHTTPPort)
<add> // DefaultNamedPipe defines the default named pipe used by docker on Windows
<add> DefaultNamedPipe = `//./pipe/docker_engine`
<ide> )
<ide>
<ide> // ValidateHost validates that the specified string is a valid host and returns it.
<ide> func ValidateHost(val string) (string, error) {
<del> _, err := parseDockerDaemonHost(DefaultTCPHost, DefaultTLSHost, DefaultUnixSocket, "", val)
<del> if err != nil {
<del> return val, err
<add> host := strings.TrimSpace(val)
<add> // The empty string means default and is not handled by parseDockerDaemonHost
<add> if host != "" {
<add> _, err := parseDockerDaemonHost(host)
<add> if err != nil {
<add> return val, err
<add> }
<ide> }
<ide> // Note: unlike most flag validators, we don't return the mutated value here
<ide> // we need to know what the user entered later (using ParseHost) to adjust for tls
<ide> return val, nil
<ide> }
<ide>
<ide> // ParseHost and set defaults for a Daemon host string
<del>func ParseHost(defaultHost, val string) (string, error) {
<del> host, err := parseDockerDaemonHost(DefaultTCPHost, DefaultTLSHost, DefaultUnixSocket, defaultHost, val)
<del> if err != nil {
<del> return val, err
<add>func ParseHost(defaultToTLS bool, val string) (string, error) {
<add> host := strings.TrimSpace(val)
<add> if host == "" {
<add> if defaultToTLS {
<add> host = DefaultTLSHost
<add> } else {
<add> host = DefaultHost
<add> }
<add> } else {
<add> var err error
<add> host, err = parseDockerDaemonHost(host)
<add> if err != nil {
<add> return val, err
<add> }
<ide> }
<ide> return host, nil
<ide> }
<ide>
<ide> // parseDockerDaemonHost parses the specified address and returns an address that will be used as the host.
<del>// Depending of the address specified, will use the defaultTCPAddr or defaultUnixAddr
<del>// defaultUnixAddr must be a absolute file path (no `unix://` prefix)
<del>// defaultTCPAddr must be the full `tcp://host:port` form
<del>func parseDockerDaemonHost(defaultTCPAddr, defaultTLSHost, defaultUnixAddr, defaultAddr, addr string) (string, error) {
<del> addr = strings.TrimSpace(addr)
<del> if addr == "" {
<del> if defaultAddr == defaultTLSHost {
<del> return defaultTLSHost, nil
<del> }
<del> if runtime.GOOS != "windows" {
<del> return fmt.Sprintf("unix://%s", defaultUnixAddr), nil
<del> }
<del> return defaultTCPAddr, nil
<del> }
<add>// Depending of the address specified, this may return one of the global Default* strings defined in hosts.go.
<add>func parseDockerDaemonHost(addr string) (string, error) {
<ide> addrParts := strings.Split(addr, "://")
<del> if len(addrParts) == 1 {
<add> if len(addrParts) == 1 && addrParts[0] != "" {
<ide> addrParts = []string{"tcp", addrParts[0]}
<ide> }
<ide>
<ide> switch addrParts[0] {
<ide> case "tcp":
<del> return parseTCPAddr(addrParts[1], defaultTCPAddr)
<add> return parseTCPAddr(addrParts[1], DefaultTCPHost)
<ide> case "unix":
<del> return parseUnixAddr(addrParts[1], defaultUnixAddr)
<add> return parseSimpleProtoAddr("unix", addrParts[1], DefaultUnixSocket)
<add> case "npipe":
<add> return parseSimpleProtoAddr("npipe", addrParts[1], DefaultNamedPipe)
<ide> case "fd":
<ide> return addr, nil
<ide> default:
<ide> return "", fmt.Errorf("Invalid bind address format: %s", addr)
<ide> }
<ide> }
<ide>
<del>// parseUnixAddr parses and validates that the specified address is a valid UNIX
<del>// socket address. It returns a formatted UNIX socket address, either using the
<del>// address parsed from addr, or the contents of defaultAddr if addr is a blank
<del>// string.
<del>func parseUnixAddr(addr string, defaultAddr string) (string, error) {
<del> addr = strings.TrimPrefix(addr, "unix://")
<add>// parseSimpleProtoAddr parses and validates that the specified address is a valid
<add>// socket address for simple protocols like unix and npipe. It returns a formatted
<add>// socket address, either using the address parsed from addr, or the contents of
<add>// defaultAddr if addr is a blank string.
<add>func parseSimpleProtoAddr(proto, addr, defaultAddr string) (string, error) {
<add> addr = strings.TrimPrefix(addr, proto+"://")
<ide> if strings.Contains(addr, "://") {
<del> return "", fmt.Errorf("Invalid proto, expected unix: %s", addr)
<add> return "", fmt.Errorf("Invalid proto, expected %s: %s", proto, addr)
<ide> }
<ide> if addr == "" {
<ide> addr = defaultAddr
<ide> }
<del> return fmt.Sprintf("unix://%s", addr), nil
<add> return fmt.Sprintf("%s://%s", proto, addr), nil
<ide> }
<ide>
<ide> // parseTCPAddr parses and validates that the specified address is a valid TCP
<ide><path>opts/hosts_test.go
<ide> package opts
<ide>
<ide> import (
<del> "runtime"
<add> "fmt"
<ide> "testing"
<ide> )
<ide>
<ide> func TestParseHost(t *testing.T) {
<ide> "tcp://invalid": "Invalid bind address format: invalid",
<ide> "tcp://invalid:port": "Invalid bind address format: invalid:port",
<ide> }
<del> const defaultHTTPHost = "tcp://127.0.0.1:2375"
<del> var defaultHOST = "unix:///var/run/docker.sock"
<del>
<del> if runtime.GOOS == "windows" {
<del> defaultHOST = defaultHTTPHost
<del> }
<ide> valid := map[string]string{
<del> "": defaultHOST,
<add> "": DefaultHost,
<add> " ": DefaultHost,
<add> " ": DefaultHost,
<ide> "fd://": "fd://",
<ide> "fd://something": "fd://something",
<del> "tcp://host:": "tcp://host:2375",
<del> "tcp://": "tcp://localhost:2375",
<del> "tcp://:2375": "tcp://localhost:2375", // default ip address
<del> "tcp://:2376": "tcp://localhost:2376", // default ip address
<add> "tcp://host:": fmt.Sprintf("tcp://host:%d", DefaultHTTPPort),
<add> "tcp://": DefaultTCPHost,
<add> "tcp://:2375": fmt.Sprintf("tcp://%s:2375", DefaultHTTPHost),
<add> "tcp://:2376": fmt.Sprintf("tcp://%s:2376", DefaultHTTPHost),
<ide> "tcp://0.0.0.0:8080": "tcp://0.0.0.0:8080",
<ide> "tcp://192.168.0.0:12000": "tcp://192.168.0.0:12000",
<ide> "tcp://192.168:8080": "tcp://192.168:8080",
<ide> "tcp://0.0.0.0:1234567890": "tcp://0.0.0.0:1234567890", // yeah it's valid :P
<add> " tcp://:7777/path ": fmt.Sprintf("tcp://%s:7777/path", DefaultHTTPHost),
<ide> "tcp://docker.com:2375": "tcp://docker.com:2375",
<del> "unix://": "unix:///var/run/docker.sock", // default unix:// value
<add> "unix://": "unix://" + DefaultUnixSocket,
<ide> "unix://path/to/socket": "unix://path/to/socket",
<add> "npipe://": "npipe://" + DefaultNamedPipe,
<add> "npipe:////./pipe/foo": "npipe:////./pipe/foo",
<ide> }
<ide>
<ide> for value, errorMessage := range invalid {
<del> if _, err := ParseHost(defaultHTTPHost, value); err == nil || err.Error() != errorMessage {
<del> t.Fatalf("Expected an error for %v with [%v], got [%v]", value, errorMessage, err)
<add> if _, err := ParseHost(false, value); err == nil || err.Error() != errorMessage {
<add> t.Errorf("Expected an error for %v with [%v], got [%v]", value, errorMessage, err)
<ide> }
<ide> }
<ide> for value, expected := range valid {
<del> if actual, err := ParseHost(defaultHTTPHost, value); err != nil || actual != expected {
<del> t.Fatalf("Expected for %v [%v], got [%v, %v]", value, expected, actual, err)
<add> if actual, err := ParseHost(false, value); err != nil || actual != expected {
<add> t.Errorf("Expected for %v [%v], got [%v, %v]", value, expected, actual, err)
<ide> }
<ide> }
<ide> }
<ide>
<ide> func TestParseDockerDaemonHost(t *testing.T) {
<del> var (
<del> defaultHTTPHost = "tcp://localhost:2375"
<del> defaultHTTPSHost = "tcp://localhost:2376"
<del> defaultUnix = "/var/run/docker.sock"
<del> defaultHOST = "unix:///var/run/docker.sock"
<del> )
<del> if runtime.GOOS == "windows" {
<del> defaultHOST = defaultHTTPHost
<del> }
<ide> invalids := map[string]string{
<ide> "0.0.0.0": "Invalid bind address format: 0.0.0.0",
<ide> "tcp:a.b.c.d": "Invalid bind address format: tcp:a.b.c.d",
<ide> "tcp:a.b.c.d/path": "Invalid bind address format: tcp:a.b.c.d/path",
<ide> "udp://127.0.0.1": "Invalid bind address format: udp://127.0.0.1",
<ide> "udp://127.0.0.1:2375": "Invalid bind address format: udp://127.0.0.1:2375",
<ide> "tcp://unix:///run/docker.sock": "Invalid bind address format: unix",
<del> "tcp": "Invalid bind address format: tcp",
<del> "unix": "Invalid bind address format: unix",
<del> "fd": "Invalid bind address format: fd",
<add> " tcp://:7777/path ": "Invalid bind address format: tcp://:7777/path ",
<add> "tcp": "Invalid bind address format: tcp",
<add> "unix": "Invalid bind address format: unix",
<add> "fd": "Invalid bind address format: fd",
<add> "": "Invalid bind address format: ",
<ide> }
<ide> valids := map[string]string{
<ide> "0.0.0.1:": "tcp://0.0.0.1:2375",
<ide> func TestParseDockerDaemonHost(t *testing.T) {
<ide> "[::1]:5555/path": "tcp://[::1]:5555/path",
<ide> "[0:0:0:0:0:0:0:1]:": "tcp://[0:0:0:0:0:0:0:1]:2375",
<ide> "[0:0:0:0:0:0:0:1]:5555/path": "tcp://[0:0:0:0:0:0:0:1]:5555/path",
<del> ":6666": "tcp://localhost:6666",
<del> ":6666/path": "tcp://localhost:6666/path",
<del> "": defaultHOST,
<del> " ": defaultHOST,
<del> " ": defaultHOST,
<del> "tcp://": defaultHTTPHost,
<del> "tcp://:7777": "tcp://localhost:7777",
<del> "tcp://:7777/path": "tcp://localhost:7777/path",
<del> " tcp://:7777/path ": "tcp://localhost:7777/path",
<add> ":6666": fmt.Sprintf("tcp://%s:6666", DefaultHTTPHost),
<add> ":6666/path": fmt.Sprintf("tcp://%s:6666/path", DefaultHTTPHost),
<add> "tcp://": DefaultTCPHost,
<add> "tcp://:7777": fmt.Sprintf("tcp://%s:7777", DefaultHTTPHost),
<add> "tcp://:7777/path": fmt.Sprintf("tcp://%s:7777/path", DefaultHTTPHost),
<ide> "unix:///run/docker.sock": "unix:///run/docker.sock",
<del> "unix://": "unix:///var/run/docker.sock",
<add> "unix://": "unix://" + DefaultUnixSocket,
<ide> "fd://": "fd://",
<ide> "fd://something": "fd://something",
<ide> "localhost:": "tcp://localhost:2375",
<ide> "localhost:5555": "tcp://localhost:5555",
<ide> "localhost:5555/path": "tcp://localhost:5555/path",
<ide> }
<ide> for invalidAddr, expectedError := range invalids {
<del> if addr, err := parseDockerDaemonHost(defaultHTTPHost, defaultHTTPSHost, defaultUnix, "", invalidAddr); err == nil || err.Error() != expectedError {
<add> if addr, err := parseDockerDaemonHost(invalidAddr); err == nil || err.Error() != expectedError {
<ide> t.Errorf("tcp %v address expected error %v return, got %s and addr %v", invalidAddr, expectedError, err, addr)
<ide> }
<ide> }
<ide> for validAddr, expectedAddr := range valids {
<del> if addr, err := parseDockerDaemonHost(defaultHTTPHost, defaultHTTPSHost, defaultUnix, "", validAddr); err != nil || addr != expectedAddr {
<add> if addr, err := parseDockerDaemonHost(validAddr); err != nil || addr != expectedAddr {
<ide> t.Errorf("%v -> expected %v, got (%v) addr (%v)", validAddr, expectedAddr, err, addr)
<ide> }
<ide> }
<ide> func TestParseTCP(t *testing.T) {
<ide> }
<ide>
<ide> func TestParseInvalidUnixAddrInvalid(t *testing.T) {
<del> if _, err := parseUnixAddr("tcp://127.0.0.1", "unix:///var/run/docker.sock"); err == nil || err.Error() != "Invalid proto, expected unix: tcp://127.0.0.1" {
<add> if _, err := parseSimpleProtoAddr("unix", "tcp://127.0.0.1", "unix:///var/run/docker.sock"); err == nil || err.Error() != "Invalid proto, expected unix: tcp://127.0.0.1" {
<ide> t.Fatalf("Expected an error, got %v", err)
<ide> }
<del> if _, err := parseUnixAddr("unix://tcp://127.0.0.1", "/var/run/docker.sock"); err == nil || err.Error() != "Invalid proto, expected unix: tcp://127.0.0.1" {
<add> if _, err := parseSimpleProtoAddr("unix", "unix://tcp://127.0.0.1", "/var/run/docker.sock"); err == nil || err.Error() != "Invalid proto, expected unix: tcp://127.0.0.1" {
<ide> t.Fatalf("Expected an error, got %v", err)
<ide> }
<del> if v, err := parseUnixAddr("", "/var/run/docker.sock"); err != nil || v != "unix:///var/run/docker.sock" {
<add> if v, err := parseSimpleProtoAddr("unix", "", "/var/run/docker.sock"); err != nil || v != "unix:///var/run/docker.sock" {
<ide> t.Fatalf("Expected an %v, got %v", v, "unix:///var/run/docker.sock")
<ide> }
<ide> } | 9 |
Text | Text | add test for event.preventdefault | f4b0b0b1b57e21d57147a198b6fdb3d74695270a | <ide><path>curriculum/challenges/english/03-front-end-libraries/react/create-a-controlled-form.md
<ide> The `MyForm` component is set up with an empty `form` with a submit handler. The
<ide>
<ide> We've added a button which submits the form. You can see it has the `type` set to `submit` indicating it is the button controlling the form. Add the `input` element in the `form` and set its `value` and `onChange()` attributes like the last challenge. You should then complete the `handleSubmit` method so that it sets the component state property `submit` to the current input value in the local `state`.
<ide>
<del>**Note:** You also must call `event.preventDefault()` in the submit handler, to prevent the default form submit behavior which will refresh the web page.
<add>**Note:** You also must call `event.preventDefault()` in the submit handler, to prevent the default form submit behavior which will refresh the web page. For camper convenience, the default behavior has been disabled here to prevent refreshes from resetting challenge code.
<ide>
<ide> Finally, create an `h1` tag after the `form` which renders the `submit` value from the component's `state`. You can then type in the form and click the button (or press enter), and you should see your input rendered to the page.
<ide>
<ide> Submitting the form should run `handleSubmit` which should set the `submit` prop
<ide> })();
<ide> ```
<ide>
<add>`handleSubmit` should call `event.preventDefault`
<add>
<add>```js
<add>const handleSubmit = MyForm.prototype.handleSubmit.toString();
<add>const allMatches = handleSubmit.match(/\bevent\.preventDefault\(\s*?\)/g) ?? [];
<add>const blockCommented = handleSubmit.match(
<add> /\/\*.*?\bevent\.preventDefault\(\s*?\).*?\*\//gs
<add>);
<add>const lineCommented = handleSubmit.match(
<add> /\/\/.*?\bevent\.preventDefault\(\s*?\)/g
<add>);
<add>const commentedMatches = [...(blockCommented ?? []), ...(lineCommented ?? [])];
<add>
<add>assert(
<add> // At least one event.preventDefault() call exists and is not commented out
<add> allMatches.length > commentedMatches.length
<add>);
<add>```
<add>
<ide> The `h1` header should render the value of the `submit` field from the component's state.
<ide>
<ide> ```js
<ide> class MyForm extends React.Component {
<ide> }
<ide> handleSubmit(event) {
<ide> // Change code below this line
<del>
<add>
<ide> // Change code above this line
<ide> }
<ide> render() { | 1 |
Mixed | Javascript | fix some time rounding problems | c3f765857edf974f1136e2162e00d931bc2400bc | <ide><path>docs/01-Scales.md
<ide> The time scale extends the core scale class with the following tick template:
<ide> parser: false,
<ide> // string - By default, unit will automatically be detected. Override with 'week', 'month', 'year', etc. (see supported time measurements)
<ide> unit: false,
<add>
<add> // Number - The number of steps of the above unit between ticks
<add> unitStepSize: 1
<add>
<ide> // string - By default, no rounding is applied. To round, set to a supported time unit eg. 'week', 'month', 'year', etc.
<ide> round: false,
<add>
<ide> // Moment js for each of the units. Replaces `displayFormat`
<ide> // To override, use a pattern string from http://momentjs.com/docs/#/displaying/format/
<ide> displayFormats: {
<ide><path>src/core/core.scale.js
<ide> module.exports = function(Chart) {
<ide> skipRatio = 1 + Math.floor((((longestRotatedLabel / 2) + this.options.ticks.autoSkipPadding) * this.ticks.length) / (this.width - (this.paddingLeft + this.paddingRight)));
<ide> }
<ide>
<del> if (!useAutoskipper) {
<del> skipRatio = false;
<del> }
<del>
<ide> // if they defined a max number of ticks,
<ide> // increase skipRatio until that number is met
<ide> if (maxTicks && this.ticks.length > maxTicks) {
<ide> module.exports = function(Chart) {
<ide> }
<ide> }
<ide>
<add> if (!useAutoskipper) {
<add> skipRatio = false;
<add> }
<add>
<ide> helpers.each(this.ticks, function(label, index) {
<ide> // Blank ticks
<ide> var isLastTick = this.ticks.length === index + 1;
<ide><path>src/scales/scale.time.js
<ide> module.exports = function(Chart) {
<ide>
<ide> this.ticks = [];
<ide> this.unitScale = 1; // How much we scale the unit by, ie 2 means 2x unit per step
<add> this.scaleSizeInUnits = 0; // How large the scale is in the base unit (seconds, minutes, etc)
<ide>
<ide> // Set unit override if applicable
<ide> if (this.options.time.unit) {
<ide> this.tickUnit = this.options.time.unit || 'day';
<ide> this.displayFormat = this.options.time.displayFormats[this.tickUnit];
<del> this.tickRange = Math.ceil(this.lastTick.diff(this.firstTick, this.tickUnit, true));
<add> this.scaleSizeInUnits = this.lastTick.diff(this.firstTick, this.tickUnit, true);
<add> this.unitScale = helpers.getValueOrDefault(this.options.time.unitStepSize, 1);
<ide> } else {
<ide> // Determine the smallest needed unit of the time
<ide> var tickFontSize = helpers.getValueOrDefault(this.options.ticks.fontSize, Chart.defaults.global.defaultFontSize);
<ide> var innerWidth = this.isHorizontal() ? this.width - (this.paddingLeft + this.paddingRight) : this.height - (this.paddingTop + this.paddingBottom);
<del> var labelCapacity = innerWidth / (tickFontSize + 10);
<del> var buffer = this.options.time.round ? 0 : 1;
<add>
<add> // Crude approximation of what the label length might be
<add> var tempFirstLabel = this.tickFormatFunction(this.firstTick, 0, []);
<add> var tickLabelWidth = tempFirstLabel.length * tickFontSize;
<add> var cosRotation = Math.cos(helpers.toRadians(this.options.ticks.maxRotation));
<add> var sinRotation = Math.sin(helpers.toRadians(this.options.ticks.maxRotation));
<add> tickLabelWidth = (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);
<add> var labelCapacity = innerWidth / (tickLabelWidth + 10);
<ide>
<ide> // Start as small as possible
<ide> this.tickUnit = 'millisecond';
<del> this.tickRange = Math.ceil(this.lastTick.diff(this.firstTick, this.tickUnit, true) + buffer);
<add> this.scaleSizeInUnits = this.lastTick.diff(this.firstTick, this.tickUnit, true);
<ide> this.displayFormat = this.options.time.displayFormats[this.tickUnit];
<ide>
<ide> var unitDefinitionIndex = 0;
<ide> module.exports = function(Chart) {
<ide> // Can we scale this unit. If `false` we can scale infinitely
<ide> this.unitScale = 1;
<ide>
<del> if (helpers.isArray(unitDefinition.steps) && Math.ceil(this.tickRange / labelCapacity) < helpers.max(unitDefinition.steps)) {
<add> if (helpers.isArray(unitDefinition.steps) && Math.ceil(this.scaleSizeInUnits / labelCapacity) < helpers.max(unitDefinition.steps)) {
<ide> // Use one of the prefedined steps
<ide> for (var idx = 0; idx < unitDefinition.steps.length; ++idx) {
<del> if (unitDefinition.steps[idx] > Math.ceil(this.tickRange / labelCapacity)) {
<del> this.unitScale = unitDefinition.steps[idx];
<add> if (unitDefinition.steps[idx] > Math.ceil(this.scaleSizeInUnits / labelCapacity)) {
<add> this.unitScale = helpers.getValueOrDefault(this.options.time.unitStepSize, unitDefinition.steps[idx]);
<ide> break;
<ide> }
<ide> }
<ide>
<ide> break;
<del> } else if ((unitDefinition.maxStep === false) || (Math.ceil(this.tickRange / labelCapacity) < unitDefinition.maxStep)) {
<add> } else if ((unitDefinition.maxStep === false) || (Math.ceil(this.scaleSizeInUnits / labelCapacity) < unitDefinition.maxStep)) {
<ide> // We have a max step. Scale this unit
<del> this.unitScale = Math.ceil(this.tickRange / labelCapacity);
<add> this.unitScale = helpers.getValueOrDefault(this.options.time.unitStepSize, Math.ceil(this.scaleSizeInUnits / labelCapacity));
<ide> break;
<ide> } else {
<ide> // Move to the next unit up
<ide> ++unitDefinitionIndex;
<ide> unitDefinition = time.units[unitDefinitionIndex];
<ide>
<ide> this.tickUnit = unitDefinition.name;
<del> this.tickRange = Math.ceil(this.lastTick.diff(this.firstTick, this.tickUnit) + buffer);
<add> this.scaleSizeInUnits = this.lastTick.diff(this.firstTick, this.tickUnit, true);
<ide> this.displayFormat = this.options.time.displayFormats[unitDefinition.name];
<ide> }
<ide> }
<ide> module.exports = function(Chart) {
<ide> this.ticks.push(this.firstTick.clone());
<ide>
<ide> // For every unit in between the first and last moment, create a moment and add it to the ticks tick
<del> for (var i = 1; i < this.tickRange; ++i) {
<add> for (var i = 1; i < this.scaleSizeInUnits; ++i) {
<ide> var newTick = roundedStart.clone().add(i, this.tickUnit);
<ide>
<ide> // Are we greater than the max time
<ide> module.exports = function(Chart) {
<ide> }
<ide>
<ide> // Always show the right tick
<del> if (this.options.time.max) {
<del> this.ticks.push(this.lastTick.clone());
<del> } else if (this.ticks[this.ticks.length - 1].diff(this.lastTick, this.tickUnit, true) !== 0) {
<del> this.tickRange = Math.ceil(this.tickRange / this.unitScale) * this.unitScale;
<del> this.ticks.push(this.firstTick.clone().add(this.tickRange, this.tickUnit));
<del> this.lastTick = this.ticks[this.ticks.length - 1].clone();
<add> if (this.ticks[this.ticks.length - 1].diff(this.lastTick, this.tickUnit) !== 0 || this.scaleSizeInUnits === 0) {
<add> // this is a weird case. If the <max> option is the same as the end option, we can't just diff the times because the tick was created from the roundedStart
<add> // but the last tick was not rounded.
<add> if (this.options.time.max) {
<add> this.ticks.push(this.lastTick.clone());
<add> this.scaleSizeInUnits = this.lastTick.diff(this.ticks[0], this.tickUnit, true);
<add> } else {
<add> this.scaleSizeInUnits = Math.ceil(this.scaleSizeInUnits / this.unitScale) * this.unitScale;
<add> this.ticks.push(this.firstTick.clone().add(this.scaleSizeInUnits, this.tickUnit));
<add> this.lastTick = this.ticks[this.ticks.length - 1].clone();
<add> }
<ide> }
<ide> },
<ide> // Get tooltip label
<ide> module.exports = function(Chart) {
<ide>
<ide> return label;
<ide> },
<del> convertTicksToLabels: function() {
<del> this.ticks = this.ticks.map(function(tick, index, ticks) {
<del> var formattedTick = tick.format(this.displayFormat);
<add> // Function to format an individual tick mark
<add> tickFormatFunction: function tickFormatFunction(tick, index, ticks) {
<add> var formattedTick = tick.format(this.displayFormat);
<ide>
<del> if (this.options.ticks.userCallback) {
<del> return this.options.ticks.userCallback(formattedTick, index, ticks);
<del> } else {
<del> return formattedTick;
<del> }
<del> }, this);
<add> if (this.options.ticks.userCallback) {
<add> return this.options.ticks.userCallback(formattedTick, index, ticks);
<add> } else {
<add> return formattedTick;
<add> }
<add> },
<add> convertTicksToLabels: function() {
<add> this.ticks = this.ticks.map(this.tickFormatFunction, this);
<ide> },
<ide> getPixelForValue: function(value, index, datasetIndex, includeOffset) {
<ide> var labelMoment = this.getLabelMoment(datasetIndex, index);
<ide>
<ide> if (labelMoment) {
<ide> var offset = labelMoment.diff(this.firstTick, this.tickUnit, true);
<ide>
<del> var decimal = offset / this.tickRange;
<add> var decimal = offset / this.scaleSizeInUnits;
<ide>
<ide> if (this.isHorizontal()) {
<ide> var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
<ide><path>test/scale.time.tests.js
<ide> describe('Time scale tests', function() {
<ide> scale.update(400, 50);
<ide>
<ide> // Counts down because the lines are drawn top to bottom
<del> expect(scale.ticks).toEqual(['Nov 20, 1981', 'Nov 20, 1981']);
<add> expect(scale.ticks).toEqual(['Nov 19, 1981', 'Nov 19, 1981']);
<ide> });
<ide>
<ide> it('should build ticks using the config unit', function() { | 4 |
Python | Python | fix minor typo in comment | 1c2212501798ad5c011dfef0503a6f206600cf0e | <ide><path>numpy/core/einsumfunc.py
<ide> def einsum_path(*operands, optimize='greedy', einsum_call=False):
<ide>
<ide>
<ide> def _einsum_dispatcher(*operands, out=None, optimize=None, **kwargs):
<del> # Arguably we dispatch on more arguments that we really should; see note in
<add> # Arguably we dispatch on more arguments than we really should; see note in
<ide> # _einsum_path_dispatcher for why.
<ide> yield from operands
<ide> yield out | 1 |
Text | Text | add aqrln to collaborators | 6581c3578701f92714a51c1d4432c93e67b17f21 | <ide><path>README.md
<ide> more information about the governance of the Node.js project, see
<ide> **Andras** <andras@kinvey.com>
<ide> * [AndreasMadsen](https://github.com/AndreasMadsen) -
<ide> **Andreas Madsen** <amwebdk@gmail.com> (he/him)
<add>* [aqrln](https://github.com/aqrln) -
<add>**Alexey Orlenko** <eaglexrlnk@gmail.com>
<ide> * [bengl](https://github.com/bengl) -
<ide> **Bryan English** <bryan@bryanenglish.com> (he/him)
<ide> * [benjamingr](https://github.com/benjamingr) - | 1 |
PHP | PHP | add note about expire time | 3bab2d4487be7cf0d2fa46187aec0f444a661eb1 | <ide><path>app/views/emails/auth/reminder.blade.php
<ide> <h2>Password Reset</h2>
<ide>
<ide> <div>
<del> To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
<add> To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.<br/>
<add> This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes.
<ide> </div>
<ide> </body>
<ide> </html> | 1 |
Ruby | Ruby | prefer https/s over ftp where known available | 331fdba29d9364ba20e99e1fa8db074ac482ca9c | <ide><path>Library/Homebrew/cmd/audit.rb
<ide> def audit_urls
<ide> end
<ide> end
<ide>
<add> # Prefer HTTP/S when possible over FTP protocol due to possible firewalls.
<add> urls.each do |p|
<add> case p
<add> when %r{^ftp://ftp\.mirrorservice\.org}
<add> problem "Please use https:// for #{p}"
<add> when %r{^ftp://ftp\.cpan\.org/pub/CPAN(.*)}i
<add> problem "#{p} should be `http://search.cpan.org/CPAN#{$1}`"
<add> end
<add> end
<add>
<ide> # Check SourceForge urls
<ide> urls.each do |p|
<ide> # Skip if the URL looks like a SVN repo | 1 |
PHP | PHP | add seneca quote to inspire command | 6b1075e479eacda7d131ccb0da525be2dfe33eb3 | <ide><path>src/Illuminate/Foundation/Inspiring.php
<ide> public static function quote()
<ide> 'Well begun is half done. - Aristotle',
<ide> 'He who is contented is rich. - Laozi',
<ide> 'Very little is needed to make a happy life. - Marcus Antoninus',
<add> 'It is quality rather than quantity that matters. - Lucius Annaeus Seneca',
<ide>
<ide> ])->random();
<ide> } | 1 |
Go | Go | increase timeout for swarm requests | 85b1fdf15ce2ad1b373748554d3aa218e2eb5a5f | <ide><path>daemon/cluster/cluster.go
<ide> import (
<ide> const swarmDirName = "swarm"
<ide> const controlSocket = "control.sock"
<ide> const swarmConnectTimeout = 20 * time.Second
<add>const swarmRequestTimeout = 20 * time.Second
<ide> const stateFile = "docker-state.json"
<ide> const defaultAddr = "0.0.0.0:2377"
<ide>
<ide> func (c *Cluster) clearState() error {
<ide> return nil
<ide> }
<ide>
<del>func (c *Cluster) getRequestContext() context.Context { // TODO: not needed when requests don't block on qourum lost
<del> ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
<del> return ctx
<add>func (c *Cluster) getRequestContext() (context.Context, func()) { // TODO: not needed when requests don't block on qourum lost
<add> return context.WithTimeout(context.Background(), swarmRequestTimeout)
<ide> }
<ide>
<ide> // Inspect retrieves the configuration properties of a managed swarm cluster.
<ide> func (c *Cluster) Inspect() (types.Swarm, error) {
<ide> return types.Swarm{}, c.errNoManager()
<ide> }
<ide>
<del> swarm, err := getSwarm(c.getRequestContext(), c.client)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> swarm, err := getSwarm(ctx, c.client)
<ide> if err != nil {
<ide> return types.Swarm{}, err
<ide> }
<ide> func (c *Cluster) Update(version uint64, spec types.Spec) error {
<ide> return c.errNoManager()
<ide> }
<ide>
<del> swarm, err := getSwarm(c.getRequestContext(), c.client)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> swarm, err := getSwarm(ctx, c.client)
<ide> if err != nil {
<ide> return err
<ide> }
<ide> func (c *Cluster) Update(version uint64, spec types.Spec) error {
<ide> }
<ide>
<ide> _, err = c.client.UpdateCluster(
<del> c.getRequestContext(),
<add> ctx,
<ide> &swarmapi.UpdateClusterRequest{
<ide> ClusterID: swarm.ID,
<ide> Spec: &swarmSpec,
<ide> func (c *Cluster) Info() types.Info {
<ide> if c.err != nil {
<ide> info.Error = c.err.Error()
<ide> }
<add>
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<ide> if c.isActiveManager() {
<ide> info.ControlAvailable = true
<del> if r, err := c.client.ListNodes(c.getRequestContext(), &swarmapi.ListNodesRequest{}); err == nil {
<add> if r, err := c.client.ListNodes(ctx, &swarmapi.ListNodesRequest{}); err == nil {
<ide> info.Nodes = len(r.Nodes)
<ide> for _, n := range r.Nodes {
<ide> if n.ManagerStatus != nil {
<ide> func (c *Cluster) Info() types.Info {
<ide> }
<ide> }
<ide>
<del> if swarm, err := getSwarm(c.getRequestContext(), c.client); err == nil && swarm != nil {
<add> if swarm, err := getSwarm(ctx, c.client); err == nil && swarm != nil {
<ide> info.CACertHash = swarm.RootCA.CACertHash
<ide> }
<ide> }
<ide> func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Serv
<ide> if err != nil {
<ide> return nil, err
<ide> }
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<ide> r, err := c.client.ListServices(
<del> c.getRequestContext(),
<add> ctx,
<ide> &swarmapi.ListServicesRequest{Filters: filters})
<ide> if err != nil {
<ide> return nil, err
<ide> func (c *Cluster) CreateService(s types.ServiceSpec, encodedAuth string) (string
<ide> return "", c.errNoManager()
<ide> }
<ide>
<del> ctx := c.getRequestContext()
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<ide>
<ide> err := populateNetworkID(ctx, c.client, &s)
<ide> if err != nil {
<ide> func (c *Cluster) GetService(input string) (types.Service, error) {
<ide> return types.Service{}, c.errNoManager()
<ide> }
<ide>
<del> service, err := getService(c.getRequestContext(), c.client, input)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> service, err := getService(ctx, c.client, input)
<ide> if err != nil {
<ide> return types.Service{}, err
<ide> }
<ide> func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.Ser
<ide> return c.errNoManager()
<ide> }
<ide>
<del> ctx := c.getRequestContext()
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<ide>
<ide> err := populateNetworkID(ctx, c.client, &spec)
<ide> if err != nil {
<ide> func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.Ser
<ide> } else {
<ide> // this is needed because if the encodedAuth isn't being updated then we
<ide> // shouldn't lose it, and continue to use the one that was already present
<del> currentService, err := getService(c.getRequestContext(), c.client, serviceID)
<add> currentService, err := getService(ctx, c.client, serviceID)
<ide> if err != nil {
<ide> return err
<ide> }
<ide> func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.Ser
<ide> }
<ide>
<ide> _, err = c.client.UpdateService(
<del> c.getRequestContext(),
<add> ctx,
<ide> &swarmapi.UpdateServiceRequest{
<ide> ServiceID: serviceID,
<ide> Spec: &serviceSpec,
<ide> func (c *Cluster) RemoveService(input string) error {
<ide> return c.errNoManager()
<ide> }
<ide>
<del> service, err := getService(c.getRequestContext(), c.client, input)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> service, err := getService(ctx, c.client, input)
<ide> if err != nil {
<ide> return err
<ide> }
<ide>
<del> if _, err := c.client.RemoveService(c.getRequestContext(), &swarmapi.RemoveServiceRequest{ServiceID: service.ID}); err != nil {
<add> if _, err := c.client.RemoveService(ctx, &swarmapi.RemoveServiceRequest{ServiceID: service.ID}); err != nil {
<ide> return err
<ide> }
<ide> return nil
<ide> func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, erro
<ide> if err != nil {
<ide> return nil, err
<ide> }
<add>
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<ide> r, err := c.client.ListNodes(
<del> c.getRequestContext(),
<add> ctx,
<ide> &swarmapi.ListNodesRequest{Filters: filters})
<ide> if err != nil {
<ide> return nil, err
<ide> func (c *Cluster) GetNode(input string) (types.Node, error) {
<ide> return types.Node{}, c.errNoManager()
<ide> }
<ide>
<del> node, err := getNode(c.getRequestContext(), c.client, input)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> node, err := getNode(ctx, c.client, input)
<ide> if err != nil {
<ide> return types.Node{}, err
<ide> }
<ide> func (c *Cluster) UpdateNode(nodeID string, version uint64, spec types.NodeSpec)
<ide> return err
<ide> }
<ide>
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<ide> _, err = c.client.UpdateNode(
<del> c.getRequestContext(),
<add> ctx,
<ide> &swarmapi.UpdateNodeRequest{
<ide> NodeID: nodeID,
<ide> Spec: &nodeSpec,
<ide> func (c *Cluster) RemoveNode(input string) error {
<ide> return c.errNoManager()
<ide> }
<ide>
<del> ctx := c.getRequestContext()
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<ide>
<ide> node, err := getNode(ctx, c.client, input)
<ide> if err != nil {
<ide> func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, erro
<ide> if err != nil {
<ide> return nil, err
<ide> }
<add>
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<ide> r, err := c.client.ListTasks(
<del> c.getRequestContext(),
<add> ctx,
<ide> &swarmapi.ListTasksRequest{Filters: filters})
<ide> if err != nil {
<ide> return nil, err
<ide> func (c *Cluster) GetTask(input string) (types.Task, error) {
<ide> return types.Task{}, c.errNoManager()
<ide> }
<ide>
<del> task, err := getTask(c.getRequestContext(), c.client, input)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> task, err := getTask(ctx, c.client, input)
<ide> if err != nil {
<ide> return types.Task{}, err
<ide> }
<ide> func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error) {
<ide> return apitypes.NetworkResource{}, c.errNoManager()
<ide> }
<ide>
<del> network, err := getNetwork(c.getRequestContext(), c.client, input)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> network, err := getNetwork(ctx, c.client, input)
<ide> if err != nil {
<ide> return apitypes.NetworkResource{}, err
<ide> }
<ide> func (c *Cluster) GetNetworks() ([]apitypes.NetworkResource, error) {
<ide> return nil, c.errNoManager()
<ide> }
<ide>
<del> r, err := c.client.ListNetworks(c.getRequestContext(), &swarmapi.ListNetworksRequest{})
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> r, err := c.client.ListNetworks(ctx, &swarmapi.ListNetworksRequest{})
<ide> if err != nil {
<ide> return nil, err
<ide> }
<ide> func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
<ide> return "", errors.NewRequestForbiddenError(err)
<ide> }
<ide>
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<ide> networkSpec := convert.BasicNetworkCreateToGRPC(s)
<del> r, err := c.client.CreateNetwork(c.getRequestContext(), &swarmapi.CreateNetworkRequest{Spec: &networkSpec})
<add> r, err := c.client.CreateNetwork(ctx, &swarmapi.CreateNetworkRequest{Spec: &networkSpec})
<ide> if err != nil {
<ide> return "", err
<ide> }
<ide> func (c *Cluster) RemoveNetwork(input string) error {
<ide> return c.errNoManager()
<ide> }
<ide>
<del> network, err := getNetwork(c.getRequestContext(), c.client, input)
<add> ctx, cancel := c.getRequestContext()
<add> defer cancel()
<add>
<add> network, err := getNetwork(ctx, c.client, input)
<ide> if err != nil {
<ide> return err
<ide> }
<ide>
<del> if _, err := c.client.RemoveNetwork(c.getRequestContext(), &swarmapi.RemoveNetworkRequest{NetworkID: network.ID}); err != nil {
<add> if _, err := c.client.RemoveNetwork(ctx, &swarmapi.RemoveNetworkRequest{NetworkID: network.ID}); err != nil {
<ide> return err
<ide> }
<ide> return nil
<ide> func (c *Cluster) Cleanup() {
<ide> }
<ide>
<ide> func (c *Cluster) managerStats() (current bool, reachable int, unreachable int, err error) {
<del> ctx, _ := context.WithTimeout(context.Background(), 3*time.Second)
<add> ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
<add> defer cancel()
<ide> nodes, err := c.client.ListNodes(ctx, &swarmapi.ListNodesRequest{})
<ide> if err != nil {
<ide> return false, 0, 0, err | 1 |
Java | Java | correct outdated error message | 51fb49be344524abd4a92098a8a62c83d62ecb9a | <ide><path>spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/MessagingRSocket.java
<ide> private Flux<Payload> handleAndReply(Payload firstPayload, FrameType frameType,
<ide> }
<ide> })
<ide> .thenMany(Flux.defer(() -> responseRef.get() != null ?
<del> responseRef.get() :
<del> Mono.error(new IllegalStateException("Something went wrong: reply Mono not set"))));
<add> responseRef.get() : Mono.error(new IllegalStateException("Expected response"))));
<ide> }
<ide>
<ide> private DataBuffer retainDataAndReleasePayload(Payload payload) { | 1 |
Text | Text | add informations about queries in graphql | 04790915a85e9f5e253fb357d350a2a7e72890f2 | <ide><path>guide/english/graphql/index.md
<ide> npm install graphql --save
<ide> ```
<ide>
<ide> ## Queries
<del><!-- This section is a stub. Consider contributing by forking this repository and submitting a Pull Request with your changes! -->
<add>
<add>A query is the shape of the request that get back the exact data you asked for, not the whole object like in REST approach. You can write your query like that:-
<add>
<add>```
<add>{
<add> hero {
<add> name
<add> }
<add>}
<add>```
<add>
<add>and then the output is like that:-
<add>
<add>```
<add>{
<add> "data": {
<add> "hero": {
<add> "name": "R2-D2"
<add> }
<add> }
<add>}
<add>```
<add>
<add>note that the returned data has a special structure which starts with "data" and it has the same structure as the request.
<ide>
<ide> ## Mutations
<ide> <!-- This section is a stub. Consider contributing by forking this repository and submitting a Pull Request with your changes! --> | 1 |
Java | Java | add jmh benchmark for stringdecoder | cfc3522641e000946876ecca61d2d3ffe88d7c62 | <ide><path>spring-core/src/jmh/java/org/springframework/core/codec/StringDecoderBenchmark.java
<add>/*
<add> * Copyright 2002-2020 the original author or authors.
<add> *
<add> * Licensed under the Apache License, Version 2.0 (the "License");
<add> * you may not use this file except in compliance with the License.
<add> * You may obtain a copy of the License at
<add> *
<add> * https://www.apache.org/licenses/LICENSE-2.0
<add> *
<add> * Unless required by applicable law or agreed to in writing, software
<add> * distributed under the License is distributed on an "AS IS" BASIS,
<add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<add> * See the License for the specific language governing permissions and
<add> * limitations under the License.
<add> */
<add>package org.springframework.core.codec;
<add>
<add>import java.nio.charset.Charset;
<add>import java.nio.charset.StandardCharsets;
<add>import java.util.Collections;
<add>import java.util.List;
<add>
<add>import org.openjdk.jmh.annotations.Benchmark;
<add>import org.openjdk.jmh.annotations.BenchmarkMode;
<add>import org.openjdk.jmh.annotations.Level;
<add>import org.openjdk.jmh.annotations.Mode;
<add>import org.openjdk.jmh.annotations.Scope;
<add>import org.openjdk.jmh.annotations.Setup;
<add>import org.openjdk.jmh.annotations.State;
<add>import org.openjdk.jmh.infra.Blackhole;
<add>import reactor.core.publisher.Flux;
<add>
<add>import org.springframework.core.ResolvableType;
<add>import org.springframework.core.io.buffer.DataBuffer;
<add>import org.springframework.core.io.buffer.DataBufferFactory;
<add>import org.springframework.core.io.buffer.DataBufferUtils;
<add>import org.springframework.core.io.buffer.DefaultDataBufferFactory;
<add>import org.springframework.util.MimeType;
<add>
<add>/**
<add> * Benchmarks for {@link DataBufferUtils}.
<add> *
<add> * @author Rossen Stoyanchev
<add> */
<add>@BenchmarkMode(Mode.Throughput)
<add>public class StringDecoderBenchmark {
<add>
<add> private static final ResolvableType ELEMENT_TYPE = ResolvableType.forClass(String.class);
<add>
<add> @Benchmark
<add> public void parseLines(DecodeState state, Blackhole blackhole) {
<add> Flux<DataBuffer> input = Flux.fromIterable(state.chunks);
<add> MimeType mimeType = state.mimeType;
<add> List<String> lines = state.decoder.decode(input, ELEMENT_TYPE, mimeType, Collections.emptyMap())
<add> .collectList()
<add> .block();
<add>
<add> blackhole.consume(lines);
<add> }
<add>
<add> @State(Scope.Benchmark)
<add> @SuppressWarnings({"NotNullFieldNotInitialized", "ConstantConditions"})
<add> public static class DecodeState {
<add>
<add> private static final Charset CHARSET = StandardCharsets.UTF_8;
<add>
<add> byte[][] delimiterBytes;
<add>
<add> List<DataBuffer> chunks;
<add>
<add> StringDecoder decoder = StringDecoder.textPlainOnly();
<add>
<add> MimeType mimeType = new MimeType("text", "plain", CHARSET);
<add>
<add> @Setup(Level.Trial)
<add> public void setup() {
<add> this.delimiterBytes = new byte[][] {"\r\n".getBytes(CHARSET), "\n".getBytes(CHARSET)};
<add>
<add> String eventTemplate = "id:$1\n" +
<add> "event:some-event\n" +
<add> ":some-comment-$1-aa\n" +
<add> ":some-comment-$1-bb\n" +
<add> "data:abcdefg-$1-hijklmnop-$1-qrstuvw-$1-xyz-$1\n\n";
<add>
<add> int totalSize = 10 * 1024;
<add> int chunkSize = 2000;
<add>
<add> int eventLength = String.format(eventTemplate, String.format("%05d", 1)).length();
<add> int eventCount = totalSize / eventLength;
<add> DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
<add>
<add> this.chunks = Flux.range(1, eventCount)
<add> .map(index -> String.format(eventTemplate, String.format("%05d", index)))
<add> .buffer(chunkSize > eventLength ? chunkSize / eventLength : 1)
<add> .map(strings -> String.join("", strings))
<add> .map(chunk -> {
<add> byte[] bytes = chunk.getBytes(CHARSET);
<add> DataBuffer buffer = bufferFactory.allocateBuffer(bytes.length);
<add> buffer.write(bytes);
<add> return buffer;
<add> })
<add> .collectList()
<add> .block();
<add> }
<add> }
<add>
<add>} | 1 |
PHP | PHP | update migrator.php | 2d6d02abc87edfc73a4b5154337c86c5933c5c8e | <ide><path>src/Illuminate/Database/Migrations/Migrator.php
<ide> protected function rollbackMigrations(array $migrations, $paths, array $options)
<ide>
<ide> $this->fireMigrationEvent(new MigrationsStarted('down'));
<ide>
<del> $this->write(Info::class, 'Rollbacking migrations.');
<add> $this->write(Info::class, 'Rolling back migrations.');
<ide>
<ide> // Next we will run through all of the migrations and call the "down" method
<ide> // which will reverse each migration in order. This getLast method on the
<ide><path>tests/Integration/Migration/MigratorTest.php
<ide> public function testRollback()
<ide> $this->subject->getRepository()->log('2015_10_04_000000_modify_people_table', 1);
<ide> $this->subject->getRepository()->log('2016_10_04_000000_modify_people_table', 1);
<ide>
<del> $this->expectInfo('Rollbacking migrations.');
<add> $this->expectInfo('Rolling back migrations.');
<ide>
<ide> $this->expectTask('2016_10_04_000000_modify_people_table', 'DONE');
<ide> $this->expectTask('2015_10_04_000000_modify_people_table', 'DONE'); | 2 |
Python | Python | fix bug in _sorted_checkpoints | 048dd6cf10937cb188d0116b25d7a3005b6686fe | <ide><path>src/transformers/trainer.py
<ide> def _sorted_checkpoints(self, checkpoint_prefix=PREFIX_CHECKPOINT_DIR, use_mtime
<ide> # Make sure we don't delete the best model.
<ide> if self.state.best_model_checkpoint is not None:
<ide> best_model_index = checkpoints_sorted.index(self.state.best_model_checkpoint)
<del> checkpoints_sorted[best_model_index], checkpoints_sorted[best_model_index][-1] = (
<add> checkpoints_sorted[best_model_index], checkpoints_sorted[-1] = (
<ide> checkpoints_sorted[-1],
<ide> checkpoints_sorted[best_model_index],
<ide> ) | 1 |
Javascript | Javascript | add a threshold of 30s for the liveui to show | 47349c8e2909b477bf9117315d52a2ceee694edb | <ide><path>src/js/live-tracker.js
<ide> import document from 'global/document';
<ide> import * as browser from './utils/browser.js';
<ide> import * as Fn from './utils/fn.js';
<ide>
<add>const defaults = {
<add> // Number of seconds of live window (seekableEnd - seekableStart) that
<add> // a video needs to have before the liveui will be shown.
<add> trackingThreshold: 30
<add>};
<add>
<ide> /* track when we are at the live edge, and other helpers for live playback */
<ide> class LiveTracker extends Component {
<ide>
<ide> constructor(player, options) {
<ide> // LiveTracker does not need an element
<del> const options_ = mergeOptions({createEl: false}, options);
<add> const options_ = mergeOptions(defaults, options, {createEl: false});
<ide>
<ide> super(player, options_);
<ide>
<ide> class LiveTracker extends Component {
<ide> * and start/stop tracking accordingly.
<ide> */
<ide> handleDurationchange() {
<del> if (this.player_.duration() === Infinity) {
<add> if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
<add> if (this.player_.options_.liveui) {
<add> this.player_.addClass('vjs-liveui');
<add> }
<ide> this.startTracking();
<ide> } else {
<add> this.player_.removeClass('vjs-liveui');
<ide> this.stopTracking();
<ide> }
<ide> }
<ide><path>src/js/player.js
<ide> class Player extends Component {
<ide>
<ide> if (seconds === Infinity) {
<ide> this.addClass('vjs-live');
<del> if (this.options_.liveui && this.player_.liveTracker) {
<del> this.addClass('vjs-liveui');
<del> }
<ide> } else {
<ide> this.removeClass('vjs-live');
<del> this.removeClass('vjs-liveui');
<ide> }
<ide> if (!isNaN(seconds)) {
<ide> // Do not fire durationchange unless the duration value is known.
<ide><path>test/unit/live-tracker.test.js
<ide> import {createTimeRanges} from '../../src/js/utils/time-ranges.js';
<ide> import sinon from 'sinon';
<ide>
<ide> QUnit.module('LiveTracker', () => {
<add> QUnit.module('options', {
<add> beforeEach() {
<add> this.clock = sinon.useFakeTimers();
<add> },
<add> afterEach() {
<add> this.player.dispose();
<add> this.clock.restore();
<add> }
<add> });
<add>
<add> QUnit.test('liveui true, trackingThreshold is met', function(assert) {
<add> this.player = TestHelpers.makePlayer({liveui: true});
<add> this.player.seekable = () => createTimeRanges(0, 30);
<add>
<add> this.player.duration(Infinity);
<add>
<add> assert.ok(this.player.hasClass('vjs-liveui'), 'has vjs-liveui');
<add> assert.ok(this.player.liveTracker.isTracking(), 'is tracking');
<add> });
<add>
<add> QUnit.test('liveui true, trackingThreshold is not met', function(assert) {
<add> this.player = TestHelpers.makePlayer({liveui: true, liveTracker: {trackingThreshold: 31}});
<add> this.player.seekable = () => createTimeRanges(0, 30);
<add>
<add> this.player.duration(Infinity);
<add>
<add> assert.notOk(this.player.hasClass('vjs-liveui'), 'does not have vjs-iveui');
<add> assert.notOk(this.player.liveTracker.isTracking(), 'is not tracking');
<add> });
<add>
<add> QUnit.test('liveui false, trackingThreshold is met', function(assert) {
<add> this.player = TestHelpers.makePlayer({liveui: false});
<add> this.player.seekable = () => createTimeRanges(0, 30);
<add>
<add> this.player.duration(Infinity);
<add>
<add> assert.notOk(this.player.hasClass('vjs-liveui'), 'does not have vjs-liveui');
<add> assert.ok(this.player.liveTracker.isTracking(), 'is tracking');
<add> });
<add>
<add> QUnit.test('liveui false, trackingThreshold is not met', function(assert) {
<add> this.player = TestHelpers.makePlayer({liveui: false, liveTracker: {trackingThreshold: 31}});
<add> this.player.seekable = () => createTimeRanges(0, 30);
<add>
<add> this.player.duration(Infinity);
<add>
<add> assert.notOk(this.player.hasClass('vjs-liveui'), 'does not have vjs-liveui');
<add> assert.notOk(this.player.liveTracker.isTracking(), 'is not tracking');
<add> });
<ide>
<ide> QUnit.module('start/stop', {
<ide> beforeEach() {
<ide> this.clock = sinon.useFakeTimers();
<ide>
<ide> this.player = TestHelpers.makePlayer({liveui: true});
<add> this.player.seekable = () => createTimeRanges(0, 30);
<ide>
<ide> this.liveTracker = this.player.liveTracker;
<ide> },
<ide> QUnit.module('LiveTracker', () => {
<ide> this.player = TestHelpers.makePlayer();
<ide>
<ide> this.liveTracker = this.player.liveTracker;
<add> this.player.seekable = () => createTimeRanges(0, 30);
<ide> this.player.duration(Infinity);
<ide>
<ide> this.liveEdgeChanges = 0;
<ide> QUnit.module('LiveTracker', () => {
<ide> });
<ide>
<ide> QUnit.test('pastSeekEnd should update when seekable changes', function(assert) {
<del> assert.strictEqual(this.liveTracker.liveCurrentTime(), 0.03, 'liveCurrentTime is now 0.03');
<del> this.clock.tick(2000);
<add> assert.strictEqual(this.liveTracker.liveCurrentTime(), 30.03, 'liveCurrentTime is now 30');
<add> this.clock.tick(2010);
<ide>
<ide> assert.ok(this.liveTracker.pastSeekEnd() > 2, 'pastSeekEnd should be over 2s');
<ide>
<del> this.player.seekable = () => createTimeRanges(0, 2);
<add> this.player.seekable = () => createTimeRanges(30, 61);
<ide>
<ide> this.clock.tick(30);
<ide> assert.strictEqual(this.liveTracker.pastSeekEnd(), 0.03, 'pastSeekEnd start at 0.03 again');
<del> assert.strictEqual(this.liveTracker.liveCurrentTime(), 2.03, 'liveCurrentTime is now 2.03');
<del> assert.equal(this.seekableEndChanges, 1, 'should be one seek end change');
<add> assert.strictEqual(this.liveTracker.liveCurrentTime(), 61.03, 'liveCurrentTime is now 2.03');
<ide> });
<ide>
<ide> QUnit.test('seeks to live edge on seekableendchange', function(assert) {
<ide><path>test/unit/seek-to-live.test.js
<ide> import TestHelpers from './test-helpers.js';
<ide> import sinon from 'sinon';
<ide> import computedStyle from '../../src/js/utils/computed-style.js';
<add>import { createTimeRange } from '../../src/js/utils/time-ranges.js';
<ide>
<ide> QUnit.module('SeekToLive', () => {
<ide> QUnit.module('live with liveui', {
<ide> QUnit.module('SeekToLive', () => {
<ide>
<ide> this.player = TestHelpers.makePlayer({liveui: true});
<ide> this.seekToLive = this.player.controlBar.seekToLive;
<add> this.player.seekable = () => createTimeRange(0, 45);
<ide>
<ide> this.getComputedDisplay = () => {
<ide> return computedStyle(this.seekToLive.el(), 'display');
<ide> QUnit.module('SeekToLive', () => {
<ide>
<ide> this.player = TestHelpers.makePlayer();
<ide> this.seekToLive = this.player.controlBar.seekToLive;
<add> this.player.seekable = () => createTimeRange(0, 45);
<ide>
<ide> this.getComputedDisplay = () => {
<ide> return computedStyle(this.seekToLive.el(), 'display');
<ide> QUnit.module('SeekToLive', () => {
<ide> QUnit.test('switch to live', function(assert) {
<ide> assert.equal(this.getComputedDisplay(), 'none', 'is hidden');
<ide>
<add> this.player.seekable = () => createTimeRange(0, 45);
<ide> this.player.duration(Infinity);
<ide> this.player.trigger('durationchange');
<ide> | 4 |
Javascript | Javascript | fix orberby documentation error | 4c762bfe5c6421560af9d4388ddc6506421b9c45 | <ide><path>src/apis.js
<ide> var angularArray = {
<ide> * {@link angular.Array} for more info.
<ide> *
<ide> * @param {Array} array The array to sort.
<del> * @param {function(*, *)|string|Array.<(function(*, *)|string)>} expression A predicate to be
<add> * @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
<ide> * used by the comparator to determine the order of elements.
<ide> *
<ide> * Can be one of:
<ide> *
<del> * - `function`: JavaScript's Array#sort comparator function
<add> * - `function`: getter function. The result of this function will be sorted using the
<add> * `<`, `=`, `>` operator
<ide> * - `string`: angular expression which evaluates to an object to order by, such as 'name' to
<ide> * sort by a property called 'name'. Optionally prefixed with `+` or `-` to control ascending
<ide> * or descending sort order (e.g. +name or -name). | 1 |
PHP | PHP | fix typehint in docblock | ea8e6d0fa69eec9f3ab275db607121b53aa92436 | <ide><path>src/Database/Schema/TableSchemaAwareInterface.php
<ide> public function getTableSchema();
<ide> /**
<ide> * Get and set the schema for this fixture.
<ide> *
<del> * @param \Cake\Database\Schema\TableSchemaInterface$schema $schema The table to set.
<add> * @param \Cake\Database\Schema\TableSchemaInterface&\Cake\Database\Schema\SqlGeneratorInterface $schema The table to set.
<ide> * @return $this
<ide> */
<ide> public function setTableSchema($schema); | 1 |
Javascript | Javascript | use wheeldelta instead of delta | 77c685a1b7d285cc58e5fc4a59c7e190109becd9 | <ide><path>src/text-editor-component.js
<ide> class TextEditorComponent {
<ide> didMouseWheel (event) {
<ide> const scrollSensitivity = this.props.model.getScrollSensitivity() / 100
<ide>
<del> let {deltaX, deltaY} = event
<add> let {wheelDeltaX, wheelDeltaY} = event
<ide>
<del> if (Math.abs(deltaX) > Math.abs(deltaY)) {
<del> deltaX = (Math.sign(deltaX) === 1)
<del> ? Math.max(1, deltaX * scrollSensitivity)
<del> : Math.min(-1, deltaX * scrollSensitivity)
<del> deltaY = 0
<add> if (Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)) {
<add> wheelDeltaX = (Math.sign(wheelDeltaX) === 1)
<add> ? Math.max(1, wheelDeltaX * scrollSensitivity)
<add> : Math.min(-1, wheelDeltaX * scrollSensitivity)
<add> wheelDeltaY = 0
<ide> } else {
<del> deltaX = 0
<del> deltaY = (Math.sign(deltaY) === 1)
<del> ? Math.max(1, deltaY * scrollSensitivity)
<del> : Math.min(-1, deltaY * scrollSensitivity)
<add> wheelDeltaX = 0
<add> wheelDeltaY = (Math.sign(wheelDeltaY) === 1)
<add> ? Math.max(1, wheelDeltaY * scrollSensitivity)
<add> : Math.min(-1, wheelDeltaY * scrollSensitivity)
<ide> }
<ide>
<ide> if (this.getPlatform() !== 'darwin' && event.shiftKey) {
<del> let temp = deltaX
<del> deltaX = deltaY
<del> deltaY = temp
<add> let temp = wheelDeltaX
<add> wheelDeltaX = wheelDeltaY
<add> wheelDeltaY = temp
<ide> }
<ide>
<del> const scrollLeftChanged = deltaX !== 0 && this.setScrollLeft(this.getScrollLeft() + deltaX)
<del> const scrollTopChanged = deltaY !== 0 && this.setScrollTop(this.getScrollTop() + deltaY)
<add> const scrollLeftChanged = wheelDeltaX !== 0 && this.setScrollLeft(this.getScrollLeft() - wheelDeltaX)
<add> const scrollTopChanged = wheelDeltaY !== 0 && this.setScrollTop(this.getScrollTop() - wheelDeltaY)
<ide>
<ide> if (scrollLeftChanged || scrollTopChanged) this.updateSync()
<ide> } | 1 |
Text | Text | improve explanation of prefers-reduced-motion | cd9a7334a089f5d356a07d74e3c341d06942d775 | <ide><path>curriculum/challenges/english/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6148e41c728f65138addf9cc.md
<ide> dashedName: step-66
<ide>
<ide> # --description--
<ide>
<del>Setting the `scroll-behavior` to `smooth` is preferred by most users. However, some users find this to be too slow, and prefer to have the scrolling happen instantaneously.
<add>Certain types of motion-based animations can cause discomfort for some users. In particular, people with <dfn>vestibular</dfn> disorders have sensitivity to certain motion triggers.
<ide>
<del>There exists a media rule to set CSS based on the user's browser settings. This media rule is called `prefers-reduced-motion`, and expects one of the following values:
<add>The `@media` at-rule has a media feature called `prefers-reduced-motion` to set CSS based on the user's preferences. It can take one of the following values:
<ide>
<del>- `reduce`
<del>- `no-preference`
<add>- `reduce`
<add>- `no-preference`
<ide>
<del>Wrap the appropriate rule within a `prefers-reduced-motion` media rule such that a `scroll-behavior` of `smooth` is only set if the user's browser setting is `no-preference`.
<add>```CSS
<add>@media (feature: value) {
<add> selector {
<add> styles
<add> }
<add>}
<add>```
<add>
<add>---
<add>
<add>Wrap the style rule that sets `scroll-behavior: smooth` within an `@media` at-rule with the media feature `prefers-reduced-motion` having `no-preference` set as the value.
<ide>
<ide> # --hints--
<ide> | 1 |
Javascript | Javascript | remove redundant existence checks | 7b9c1a19535eb334c9caf39bf6a946987c9582fe | <ide><path>packages/ember-runtime/lib/compare.js
<ide> export default function compare(v, w) {
<ide> let type1 = typeOf(v);
<ide> let type2 = typeOf(w);
<ide>
<del> if (Comparable) {
<del> if (type1 === 'instance' && Comparable.detect(v) && v.constructor.compare) {
<del> return v.constructor.compare(v, w);
<del> }
<add> if (type1 === 'instance' && Comparable.detect(v) && v.constructor.compare) {
<add> return v.constructor.compare(v, w);
<add> }
<ide>
<del> if (type2 === 'instance' && Comparable.detect(w) && w.constructor.compare) {
<del> return w.constructor.compare(w, v) * -1;
<del> }
<add> if (type2 === 'instance' && Comparable.detect(w) && w.constructor.compare) {
<add> return w.constructor.compare(w, v) * -1;
<ide> }
<ide>
<ide> let res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]);
<ide> export default function compare(v, w) {
<ide> return spaceship(vLen, wLen);
<ide> }
<ide> case 'instance':
<del> if (Comparable && Comparable.detect(v)) {
<add> if (Comparable.detect(v)) {
<ide> return v.compare(v, w);
<ide> }
<ide> return 0; | 1 |
PHP | PHP | define initial array value | 3c8d033c03b7e0d1af4d83da718ac7e269010e43 | <ide><path>src/ORM/EntityValidator.php
<ide> protected function _buildPropertyMap($include) {
<ide> return [];
<ide> }
<ide>
<add> $map = [];
<ide> foreach ($include['associated'] as $key => $options) {
<ide> if (is_int($key) && is_scalar($options)) {
<ide> $key = $options;
<ide> protected function _buildPropertyMap($include) {
<ide> ];
<ide> }
<ide> }
<del>
<ide> return $map;
<ide> }
<ide> | 1 |
Javascript | Javascript | remove duplicate flow type for touchableprops | fb5276c1897982f0be96f2e7074d839ae8fffdc8 | <ide><path>Libraries/Components/ScrollView/ScrollView.js
<ide> export type ScrollResponderType = {
<ide> ...typeof ScrollResponder.Mixin,
<ide> };
<ide>
<del>type TouchableProps = $ReadOnly<{|
<del> onTouchStart?: (event: PressEvent) => void,
<del> onTouchMove?: (event: PressEvent) => void,
<del> onTouchEnd?: (event: PressEvent) => void,
<del> onTouchCancel?: (event: PressEvent) => void,
<del> onTouchEndCapture?: (event: PressEvent) => void,
<del>|}>;
<del>
<ide> type IOSProps = $ReadOnly<{|
<ide> /**
<ide> * Controls whether iOS should automatically adjust the content inset
<ide> type StickyHeaderComponentType = React.ComponentType<ScrollViewStickyHeaderProps
<ide>
<ide> export type Props = $ReadOnly<{|
<ide> ...ViewProps,
<del> ...TouchableProps,
<ide> ...IOSProps,
<ide> ...AndroidProps,
<ide> ...VRProps, | 1 |
Text | Text | add command before bash output | c8f50ef02bcf5dc8b9d42e174581cae27a160821 | <ide><path>guides/source/active_record_validations_callbacks.md
<ide> end
<ide> We can see how it works by looking at some `rails console` output:
<ide>
<ide> ```ruby
<add>$ rails console
<ide> >> p = Person.new(:name => "John Doe")
<ide> => #<Person id: nil, name: "John Doe", created_at: nil, updated_at: nil>
<ide> >> p.new_record?
<ide> We can see how it works by looking at some `rails console` output:
<ide> => false
<ide> ```
<ide>
<add>TIP: All lines starting with a dollar sign `$` are intended to be run on the command line.
<add>
<ide> Creating and saving a new record will send an SQL `INSERT` operation to the database. Updating an existing record will send an SQL `UPDATE` operation instead. Validations are typically run before these commands are sent to the database. If any validations fail, the object will be marked as invalid and Active Record will not perform the `INSERT` or `UPDATE` operation. This helps to avoid storing an invalid object in the database. You can choose to have specific validations run when an object is created, saved, or updated.
<ide>
<ide> CAUTION: There are many ways to change the state of an object in the database. Some methods will trigger validations, but some will not. This means that it's possible to save an object in the database in an invalid state if you aren't careful. | 1 |
PHP | PHP | add test for | dd7fc712149c5dc9020322060ec378319d9d3467 | <ide><path>tests/TestCase/Error/DebuggerTest.php
<ide> use Cake\Error\Renderer\HtmlErrorRenderer;
<ide> use Cake\Form\Form;
<ide> use Cake\Log\Log;
<add>use Cake\ORM\Table;
<ide> use Cake\TestSuite\TestCase;
<ide> use InvalidArgumentException;
<ide> use MyClass;
<ide> public function testExportVarInvalidDebugInfo(): void
<ide> $this->assertTextEquals($expected, $result);
<ide> }
<ide>
<add> /**
<add> * Test exportVar with a mock
<add> */
<add> public function testExportVarMockObject(): void
<add> {
<add> $result = Debugger::exportVar($this->getMockBuilder(Table::class)->getMock());
<add> $expected = '(unable to export object: foreach() argument must be of type array|object, null given)';
<add> $this->assertTextEquals($expected, $result);
<add> }
<add>
<ide> /**
<ide> * Text exportVarAsNodes()
<ide> */ | 1 |
PHP | PHP | apply fixes from styleci | eee8c84f5d8be26d7acef2292a97ff391e2de320 | <ide><path>tests/Integration/Notifications/SendingMailNotificationsTest.php
<ide> use Orchestra\Testbench\TestCase;
<ide> use Illuminate\Contracts\Mail\Mailer;
<ide> use Illuminate\Support\Facades\Schema;
<del>use Illuminate\Database\Eloquent\Model;
<ide> use Illuminate\Contracts\Mail\Mailable;
<add>use Illuminate\Database\Eloquent\Model;
<ide> use Illuminate\Notifications\Notifiable;
<ide> use Illuminate\Notifications\Notification;
<ide> use Illuminate\Notifications\Channels\MailChannel; | 1 |
Javascript | Javascript | add known issue about end-symbol in expression | c95a3d8088de29a54c96f161704a387a12a2cfb2 | <ide><path>src/ng/interpolate.js
<ide> function $InterpolateProvider() {
<ide> * </file>
<ide> * </example>
<ide> *
<add> * @knownIssue
<add> * It is currently not possible for an interpolated expression to contain the interpolation end
<add> * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e.
<add> * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string.
<add> *
<ide> * @param {string} text The text with markup to interpolate.
<ide> * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have
<ide> * embedded expression in order to return an interpolation function. Strings with no | 1 |
Ruby | Ruby | compare actual version for casks | 94a33b1d2ed98335e7e8ff4182f1c5f1b0821e6e | <ide><path>Library/Homebrew/livecheck/livecheck.rb
<ide> def run_checks(
<ide> Version.new(formula_or_cask.version)
<ide> end
<ide>
<add> current_str = current.to_s
<add> current = actual_version(formula_or_cask, current)
<add>
<ide> latest = if formula&.head_only?
<ide> formula.head.downloader.fetch_last_commit
<ide> else
<ide> def run_checks(
<ide> latest = Version.new(m[1])
<ide> end
<ide>
<add> latest_str = latest.to_s
<add> latest = actual_version(formula_or_cask, latest)
<add>
<ide> is_outdated = if formula&.head_only?
<ide> # A HEAD-only formula is considered outdated if the latest upstream
<ide> # commit hash is different than the installed version's commit hash
<ide> def run_checks(
<ide> info[:formula] = name if formula
<ide> info[:cask] = name if cask
<ide> info[:version] = {
<del> current: current.to_s,
<del> latest: latest.to_s,
<add> current: current_str,
<add> latest: latest_str,
<ide> outdated: is_outdated,
<ide> newer_than_upstream: is_newer_than_upstream,
<ide> }
<ide> def formula_or_cask_name(formula_or_cask, full_name: false)
<ide> formula_name(formula_or_cask, full_name: full_name)
<ide> when Cask::Cask
<ide> cask_name(formula_or_cask, full_name: full_name)
<add> else
<add> T.absurd(formula_or_cask)
<ide> end
<ide> end
<ide>
<ide> def checkable_urls(formula_or_cask)
<ide> urls << formula_or_cask.appcast.to_s if formula_or_cask.appcast
<ide> urls << formula_or_cask.url.to_s if formula_or_cask.url
<ide> urls << formula_or_cask.homepage if formula_or_cask.homepage
<add> else
<add> T.absurd(formula_or_cask)
<ide> end
<ide>
<ide> urls.compact
<ide> def latest_version(formula_or_cask, json: false, full_name: false, verbose: fals
<ide> next if match_version_map.blank?
<ide>
<ide> version_info = {
<del> latest: Version.new(match_version_map.values.max),
<add> latest: Version.new(match_version_map.values.max_by { |v| actual_version(formula_or_cask, v) }),
<ide> }
<ide>
<ide> if json && verbose
<ide> def latest_version(formula_or_cask, json: false, full_name: false, verbose: fals
<ide>
<ide> nil
<ide> end
<add>
<add> sig { params(formula_or_cask: T.any(Formula, Cask::Cask), version: Version).returns(Version) }
<add> def actual_version(formula_or_cask, version)
<add> case formula_or_cask
<add> when Formula
<add> version
<add> when Cask::Cask
<add> Version.new(Cask::DSL::Version.new(version.to_s).before_comma)
<add> else
<add> T.absurd(formula_or_cask)
<add> end
<add> end
<ide> end
<ide> end | 1 |
Java | Java | fix broken javadoc links | a8feb792da01128223c44c4b945c4d94f0eec241 | <ide><path>spring-messaging/src/main/java/org/springframework/messaging/converter/ProtobufJsonFormatMessageConverter.java
<ide> /*
<del> * Copyright 2002-2019 the original author or authors.
<add> * Copyright 2002-2020 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> * See the License for the specific language governing permissions and
<ide> * limitations under the License.
<ide> */
<add>
<ide> package org.springframework.messaging.converter;
<ide>
<ide> import com.google.protobuf.ExtensionRegistry;
<ide> public class ProtobufJsonFormatMessageConverter extends ProtobufMessageConverter {
<ide>
<ide> /**
<del> * Constructor with default instances of {@link JsonFormat.Parser},
<del> * {@link JsonFormat.Printer}, and {@link ExtensionRegistry}.
<add> * Constructor with default instances of {@link com.google.protobuf.util.JsonFormat.Parser
<add> * JsonFormat.Parser}, {@link com.google.protobuf.util.JsonFormat.Printer
<add> * JsonFormat.Printer}, and {@link ExtensionRegistry}.
<ide> */
<ide> public ProtobufJsonFormatMessageConverter(@Nullable ExtensionRegistry extensionRegistry) {
<ide> this(null, null);
<ide> }
<ide>
<ide> /**
<del> * Constructor with given instances of {@link JsonFormat.Parser},
<del> * {@link JsonFormat.Printer}, and a default instance of {@link ExtensionRegistry}.
<add> * Constructor with given instances of {@link com.google.protobuf.util.JsonFormat.Parser
<add> * JsonFormat.Parser}, {@link com.google.protobuf.util.JsonFormat.Printer
<add> * JsonFormat.Printer}, and a default instance of {@link ExtensionRegistry}.
<ide> */
<ide> public ProtobufJsonFormatMessageConverter(
<ide> @Nullable JsonFormat.Parser parser, @Nullable JsonFormat.Printer printer) {
<ide> public ProtobufJsonFormatMessageConverter(
<ide> }
<ide>
<ide> /**
<del> * Constructor with given instances of {@link JsonFormat.Parser},
<del> * {@link JsonFormat.Printer}, and {@link ExtensionRegistry}.
<add> * Constructor with given instances of {@link com.google.protobuf.util.JsonFormat.Parser
<add> * JsonFormat.Parser}, {@link com.google.protobuf.util.JsonFormat.Printer
<add> * JsonFormat.Printer}, and {@link ExtensionRegistry}.
<ide> */
<ide> public ProtobufJsonFormatMessageConverter(@Nullable JsonFormat.Parser parser,
<ide> @Nullable JsonFormat.Printer printer, @Nullable ExtensionRegistry extensionRegistry) {
<ide><path>spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java
<ide> /*
<del> * Copyright 2002-2019 the original author or authors.
<add> * Copyright 2002-2020 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
<ide>
<ide> /**
<ide> * Set the body to the given {@code Object} value. This method invokes the
<del> * {@link WebClient.RequestBodySpec#bodyValue(Object) bodyValue} method
<del> * on the underlying {@code WebClient}.
<add> * {@link org.springframework.web.reactive.function.client.WebClient.RequestBodySpec#bodyValue(Object)
<add> * bodyValue} method on the underlying {@code WebClient}.
<ide> * @param body the value to write to the request body
<ide> * @return spec for further declaration of the request
<ide> * @since 5.2
<ide> <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
<ide>
<ide> /**
<ide> * Set the body from the given producer. This method invokes the
<del> * {@link WebClient.RequestBodySpec#body(Object, Class)} method on the
<del> * underlying {@code WebClient}.
<add> * {@link org.springframework.web.reactive.function.client.WebClient.RequestBodySpec#body(Object, Class)
<add> * body(Object, Class)} method on the underlying {@code WebClient}.
<ide> * @param producer the producer to write to the request. This must be a
<ide> * {@link Publisher} or another producer adaptable to a
<ide> * {@code Publisher} via {@link ReactiveAdapterRegistry}
<ide> <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
<ide>
<ide> /**
<ide> * Set the body from the given producer. This method invokes the
<del> * {@link WebClient.RequestBodySpec#body(Object, ParameterizedTypeReference)}
<del> * method on the underlying {@code WebClient}.
<add> * {@link org.springframework.web.reactive.function.client.WebClient.RequestBodySpec#body(Object, ParameterizedTypeReference)
<add> * body(Object, ParameterizedTypeReference)} method on the underlying {@code WebClient}.
<ide> * @param producer the producer to write to the request. This must be a
<ide> * {@link Publisher} or another producer adaptable to a
<ide> * {@code Publisher} via {@link ReactiveAdapterRegistry}
<ide> <T, S extends Publisher<T>> RequestHeadersSpec<?> body(
<ide> /**
<ide> * Set the body of the request to the given {@code BodyInserter}.
<ide> * This method invokes the
<del> * {@link WebClient.RequestBodySpec#body(BodyInserter)} method on the
<del> * underlying {@code WebClient}.
<add> * {@link org.springframework.web.reactive.function.client.WebClient.RequestBodySpec#body(BodyInserter)
<add> * body(BodyInserter)} method on the underlying {@code WebClient}.
<ide> * @param inserter the body inserter to use
<ide> * @return spec for further declaration of the request
<ide> * @see org.springframework.web.reactive.function.BodyInserters
<ide><path>spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufJsonFormatHttpMessageConverter.java
<ide> /*
<del> * Copyright 2002-2019 the original author or authors.
<add> * Copyright 2002-2020 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> * @since 5.0
<ide> * @see JsonFormat#parser()
<ide> * @see JsonFormat#printer()
<del> * @see #ProtobufJsonFormatHttpMessageConverter(JsonFormat.Parser, JsonFormat.Printer)
<add> * @see #ProtobufJsonFormatHttpMessageConverter(com.google.protobuf.util.JsonFormat.Parser, com.google.protobuf.util.JsonFormat.Printer)
<ide> */
<ide> public class ProtobufJsonFormatHttpMessageConverter extends ProtobufHttpMessageConverter {
<ide>
<ide> /**
<del> * Constructor with default instances of {@link JsonFormat.Parser},
<del> * {@link JsonFormat.Printer}, and {@link ExtensionRegistry}.
<add> * Constructor with default instances of
<add> * {@link com.google.protobuf.util.JsonFormat.Parser JsonFormat.Parser},
<add> * {@link com.google.protobuf.util.JsonFormat.Printer JsonFormat.Printer},
<add> * and {@link ExtensionRegistry}.
<ide> */
<ide> public ProtobufJsonFormatHttpMessageConverter() {
<del> this(null, null, (ExtensionRegistry)null);
<add> this(null, null);
<ide> }
<ide>
<ide> /**
<del> * Constructor with given instances of {@link JsonFormat.Parser},
<del> * {@link JsonFormat.Printer}, and a default instance of {@link ExtensionRegistry}.
<add> * Constructor with given instances of
<add> * {@link com.google.protobuf.util.JsonFormat.Parser JsonFormat.Parser},
<add> * {@link com.google.protobuf.util.JsonFormat.Printer JsonFormat.Printer},
<add> * and a default instance of {@link ExtensionRegistry}.
<ide> */
<ide> public ProtobufJsonFormatHttpMessageConverter(
<ide> @Nullable JsonFormat.Parser parser, @Nullable JsonFormat.Printer printer) {
<ide>
<del> this(parser, printer, (ExtensionRegistry)null);
<add> this(parser, printer, (ExtensionRegistry) null);
<ide> }
<ide>
<ide> /**
<del> * Constructor with given instances of {@link JsonFormat.Parser},
<del> * {@link JsonFormat.Printer}, and {@link ExtensionRegistry}.
<add> * Constructor with given instances of
<add> * {@link com.google.protobuf.util.JsonFormat.Parser JsonFormat.Parser},
<add> * {@link com.google.protobuf.util.JsonFormat.Printer JsonFormat.Printer},
<add> * and {@link ExtensionRegistry}.
<ide> */
<ide> public ProtobufJsonFormatHttpMessageConverter(@Nullable JsonFormat.Parser parser,
<ide> @Nullable JsonFormat.Printer printer, @Nullable ExtensionRegistry extensionRegistry) {
<ide> public ProtobufJsonFormatHttpMessageConverter(@Nullable JsonFormat.Parser parser
<ide> * @param printer the JSON printer configuration
<ide> * @param registryInitializer an initializer for message extensions
<ide> * @deprecated as of 5.1, in favor of
<del> * {@link #ProtobufJsonFormatHttpMessageConverter(JsonFormat.Parser, JsonFormat.Printer, ExtensionRegistry)}
<add> * {@link #ProtobufJsonFormatHttpMessageConverter(com.google.protobuf.util.JsonFormat.Parser, com.google.protobuf.util.JsonFormat.Printer, ExtensionRegistry)}
<ide> */
<ide> @Deprecated
<ide> public ProtobufJsonFormatHttpMessageConverter(@Nullable JsonFormat.Parser parser, | 3 |
Ruby | Ruby | teach activejob to set configs on itself | b4fffc3c68d7be96acd0fc2ccc40023a31a2ad6e | <ide><path>activejob/lib/active_job.rb
<ide> module ActiveJob
<ide> # :singleton-method:
<ide> # If false, Rails will preserve the legacy serialization of BigDecimal job arguments as Strings.
<ide> # If true, Rails will use the new BigDecimalSerializer to (de)serialize BigDecimal losslessly.
<del> # This behavior will be removed in Rails 7.2.
<add> # Legacy serialization will be removed in Rails 7.2, along with this config.
<ide> singleton_class.attr_accessor :use_big_decimal_serializer
<ide> self.use_big_decimal_serializer = false
<ide> end
<ide><path>activejob/lib/active_job/railtie.rb
<ide> class Railtie < Rails::Railtie # :nodoc:
<ide> options = app.config.active_job
<ide> options.queue_adapter ||= :async
<ide>
<add> config.after_initialize do
<add> options.each do |k, v|
<add> k = "#{k}="
<add> if ActiveJob.respond_to?(k)
<add> ActiveJob.send(k, v)
<add> end
<add> end
<add> end
<add>
<ide> ActiveSupport.on_load(:active_job) do
<ide> # Configs used in other initializers
<ide> options = options.except(
<ide> :log_query_tags_around_perform,
<ide> :custom_serializers
<ide> )
<ide>
<del> options.each do |k, v|
<add> options.each do |k, v|
<ide> k = "#{k}="
<del> send(k, v) if respond_to? k
<add> if ActiveJob.respond_to?(k)
<add> ActiveJob.send(k, v)
<add> elsif respond_to? k
<add> send(k, v)
<add> end
<ide> end
<ide> end
<ide>
<ide><path>railties/lib/rails/application/configuration.rb
<ide> def initialize(*)
<ide> # {configuration guide}[https://guides.rubyonrails.org/configuring.html#versioned-default-values]
<ide> # for the default values associated with a particular version.
<ide> def load_defaults(target_version)
<add> # To introduce a change in behavior, follow these steps:
<add> # 1. Add an accessor on the target object (e.g. the ActiveJob class for global Active Job config).
<add> # 2. Set a default value there preserving existing behavior for existing applications.
<add> # 3. Implement the behavior change based on the config value.
<add> # 4. In the section below corresponding to the next release of Rails, set the new value.
<add> # 5. Add a commented out section in the `new_framework_defaults` template, setting the new value.
<add> # 6. Update the guide in `configuration.md`.
<add>
<add> # To remove configurable deprecated behavior, follow these steps:
<add> # 1. Update or remove the entry in the guides.
<add> # 2. Remove the references below.
<add> # 3. Remove the legacy code paths and config check.
<add> # 4. Remove the config accessor.
<add>
<ide> case target_version.to_s
<ide> when "5.0"
<ide> if respond_to?(:action_controller)
<ide> def load_defaults(target_version)
<ide> end
<ide>
<ide> if respond_to?(:active_job)
<del> active_job.use_big_decimal_serializer = false
<add> active_job.use_big_decimal_serializer = true
<ide> end
<ide>
<ide> if respond_to?(:active_support)
<ide><path>railties/test/application/configuration_test.rb
<ide> class ::DummySerializer < ActiveJob::Serializers::ObjectSerializer; end
<ide> assert_includes ActiveJob::Serializers.serializers, DummySerializer
<ide> end
<ide>
<add> test "use_big_decimal_serializer is enabled in new apps" do
<add> app "development"
<add>
<add> # When loaded, ActiveJob::Base triggers the :active_job load hooks, which is where config is attached.
<add> # Referencing the constant auto-loads it.
<add> ActiveJob::Base
<add>
<add> assert ActiveJob.use_big_decimal_serializer, "use_big_decimal_serializer should be enabled in new apps"
<add> end
<add>
<add> test "use_big_decimal_serializer is disabled if using defaults prior to 7.1" do
<add> remove_from_config '.*config\.load_defaults.*\n'
<add> add_to_config 'config.load_defaults "7.0"'
<add> app "development"
<add>
<add> # When loaded, ActiveJob::Base triggers the :active_job load hooks, which is where config is attached.
<add> # Referencing the constant auto-loads it.
<add> ActiveJob::Base
<add>
<add> assert_not ActiveJob.use_big_decimal_serializer, "use_big_decimal_serializer should be disabled in defaults prior to 7.1"
<add> end
<add>
<add> test "use_big_decimal_serializer can be enabled in config" do
<add> remove_from_config '.*config\.load_defaults.*\n'
<add> add_to_config 'config.load_defaults "7.0"'
<add> app_file "config/initializers/new_framework_defaults_7_1.rb", <<-RUBY
<add> Rails.application.config.active_job.use_big_decimal_serializer = true
<add> RUBY
<add> app "development"
<add>
<add> # When loaded, ActiveJob::Base triggers the :active_job load hooks, which is where config is attached.
<add> # Referencing the constant auto-loads it.
<add> ActiveJob::Base
<add>
<add> assert ActiveJob.use_big_decimal_serializer, "use_big_decimal_serializer should be enabled if set in config"
<add> end
<add>
<ide> test "active record job queue is set" do
<ide> app "development"
<ide> | 4 |
PHP | PHP | fix indention for blade component inline | 49f542bbc10afa02fc947eb99d96b916776bb522 | <ide><path>src/Illuminate/Foundation/Console/ComponentMakeCommand.php
<ide> protected function buildClass($name)
<ide> if ($this->option('inline')) {
<ide> return str_replace(
<ide> 'DummyView',
<del> "<<<'blade'\n<div>\n ".Inspiring::quote()."\n</div>\nblade",
<add> "<<<'blade'\n <div>\n ".Inspiring::quote()."\n </div>\n blade",
<ide> parent::buildClass($name)
<ide> );
<ide> } | 1 |
Javascript | Javascript | use sha1 instead of murmurhash | cc2ec6ff0739a6f2a59b6eb62288790136b6983d | <ide><path>packager/src/lib/TransformCache.js
<ide>
<ide> 'use strict';
<ide>
<add>const crypto = require('crypto');
<ide> const debugRead = require('debug')('RNP:TransformCache:Read');
<ide> const fs = require('fs');
<del>/**
<del> * We get the package "for free" with "write-file-atomic". MurmurHash3 is a
<del> * faster hash, but non-cryptographic and insecure, that seems reasonnable for
<del> * this particular use case.
<del> */
<del>const imurmurhash = require('imurmurhash');
<ide> const mkdirp = require('mkdirp');
<ide> const path = require('path');
<ide> const rimraf = require('rimraf');
<ide> const terminal = require('../lib/terminal');
<del>const toFixedHex = require('./toFixedHex');
<ide> const writeFileAtomicSync = require('write-file-atomic').sync;
<ide>
<ide> const CACHE_NAME = 'react-native-packager-cache';
<ide> const getCacheDirPath = (function() {
<ide> if (dirPath == null) {
<ide> dirPath = path.join(
<ide> require('os').tmpdir(),
<del> CACHE_NAME + '-' + imurmurhash(__dirname).result().toString(16),
<add> CACHE_NAME + '-' + crypto.createHash('sha1')
<add> .update(__dirname).digest('base64'),
<ide> );
<del>
<ide> require('debug')('RNP:TransformCache:Dir')(
<ide> `transform cache directory: ${dirPath}`
<ide> );
<ide> function hashSourceCode(props: {
<ide> transformOptions: TransformOptions,
<ide> transformOptionsKey: string,
<ide> }): string {
<del> return imurmurhash(props.getTransformCacheKey(
<del> props.sourceCode,
<del> props.filePath,
<del> props.transformOptions,
<del> )).hash(props.sourceCode).result();
<add> return crypto.createHash('sha1')
<add> .update(props.getTransformCacheKey(
<add> props.sourceCode,
<add> props.filePath,
<add> props.transformOptions,
<add> ))
<add> .update(props.sourceCode)
<add> .digest('hex');
<ide> }
<ide>
<ide> /**
<ide> function getCacheFilePaths(props: {
<ide> filePath: string,
<ide> transformOptionsKey: string,
<ide> }): CacheFilePaths {
<del> const hasher = imurmurhash()
<del> .hash(props.filePath)
<del> .hash(props.transformOptionsKey);
<del> const hash = toFixedHex(8, hasher.result());
<add> const hasher = crypto.createHash('sha1')
<add> .update(props.filePath)
<add> .update(props.transformOptionsKey);
<add> const hash = hasher.digest('hex');
<ide> const prefix = hash.substr(0, 2);
<ide> const fileName = `${hash.substr(2)}${path.basename(props.filePath)}`;
<ide> const base = path.join(getCacheDirPath(), prefix, fileName);
<ide> function writeSync(props: {
<ide> unlinkIfExistsSync(cacheFilePath.metadata);
<ide> writeFileAtomicSync(cacheFilePath.transformedCode, result.code);
<ide> writeFileAtomicSync(cacheFilePath.metadata, JSON.stringify([
<del> imurmurhash(result.code).result(),
<add> crypto.createHash('sha1').update(result.code).digest('hex'),
<ide> hashSourceCode(props),
<ide> result.dependencies,
<ide> result.dependencyOffsets,
<ide> const GARBAGE_COLLECTOR = new (class GarbageCollector {
<ide> function readMetadataFileSync(
<ide> metadataFilePath: string,
<ide> ): ?{
<del> cachedResultHash: number,
<del> cachedSourceHash: number,
<add> cachedResultHash: string,
<add> cachedSourceHash: string,
<ide> dependencies: Array<string>,
<ide> dependencyOffsets: Array<number>,
<ide> sourceMap: ?SourceMap,
<ide> function readMetadataFileSync(
<ide> sourceMap,
<ide> ] = metadata;
<ide> if (
<del> typeof cachedResultHash !== 'number' ||
<del> typeof cachedSourceHash !== 'number' ||
<add> typeof cachedResultHash !== 'string' ||
<add> typeof cachedSourceHash !== 'string' ||
<ide> !(
<ide> Array.isArray(dependencies) &&
<ide> dependencies.every(dep => typeof dep === 'string')
<ide> function readSync(props: ReadTransformProps): ?CachedResult {
<ide> return null;
<ide> }
<ide> transformedCode = fs.readFileSync(cacheFilePaths.transformedCode, 'utf8');
<del> if (metadata.cachedResultHash !== imurmurhash(transformedCode).result()) {
<add> const codeHash = crypto.createHash('sha1').update(transformedCode).digest('hex');
<add> if (metadata.cachedResultHash !== codeHash) {
<ide> return null;
<ide> }
<ide> } catch (error) {
<ide><path>packager/src/lib/__tests__/TransformCache-test.js
<ide> jest
<ide> .dontMock('imurmurhash')
<ide> .dontMock('json-stable-stringify')
<ide> .dontMock('../TransformCache')
<del> .dontMock('../toFixedHex')
<ide> .dontMock('left-pad')
<ide> .dontMock('lodash/throttle')
<ide> .dontMock('crypto');
<ide><path>packager/src/lib/toFixedHex.js
<del>/**
<del> * Copyright (c) 2016-present, Facebook, Inc.
<del> * All rights reserved.
<del> *
<del> * This source code is licensed under the BSD-style license found in the
<del> * LICENSE file in the root directory of this source tree. An additional grant
<del> * of patent rights can be found in the PATENTS file in the same directory.
<del> *
<del> * @flow
<del> */
<del>
<del>'use strict';
<del>
<del>const leftPad = require('left-pad');
<del>
<del>function toFixedHex(length: number, number: number): string {
<del> return leftPad(number.toString(16), length, '0');
<del>}
<del>
<del>module.exports = toFixedHex; | 3 |
Javascript | Javascript | clamp easing functions to [0,1] | e7ac548105765301eee615859d5c415bc11a6f30 | <ide><path>d3.js
<ide> d3.ease = function(name) {
<ide> var i = name.indexOf("-"),
<ide> t = i >= 0 ? name.substring(0, i) : name,
<ide> m = i >= 0 ? name.substring(i + 1) : "in";
<del> return d3_ease_mode[m](d3_ease[t].apply(null, Array.prototype.slice.call(arguments, 1)));
<add> return d3_ease_clamp(d3_ease_mode[m](d3_ease[t].apply(null, Array.prototype.slice.call(arguments, 1))));
<ide> };
<ide>
<add>function d3_ease_clamp(f) {
<add> return function(t) {
<add> return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
<add> };
<add>}
<add>
<ide> function d3_ease_reverse(f) {
<ide> return function(t) {
<ide> return 1 - f(1 - t);
<ide> function d3_transition(groups, id) {
<ide> function tick(elapsed) {
<ide> if (lock.active !== id) return stop();
<ide>
<del> var t = Math.min(1, (elapsed - delay) / duration),
<add> var t = (elapsed - delay) / duration,
<ide> e = ease(t),
<ide> n = tweened.length;
<ide>
<ide> while (n > 0) {
<ide> tweened[--n].call(node, e);
<ide> }
<ide>
<del> if (t === 1) {
<add> if (t >= 1) {
<ide> stop();
<ide> d3_transitionInheritId = id;
<ide> event.end.dispatch.call(node, d, i);
<ide><path>d3.min.js
<del>(function(){function dp(a,b,c){function i(a,b){var c=a.__domain||(a.__domain=a.domain()),d=a.range().map(function(a){return(a-b)/h});a.domain(c).domain(d.map(a.invert))}var d=Math.pow(2,(db[2]=a)-c[2]),e=db[0]=b[0]-d*c[0],f=db[1]=b[1]-d*c[1],g=d3.event,h=Math.pow(2,a);d3.event={scale:h,translate:[e,f],transform:function(a,b){a&&i(a,e),b&&i(b,f)}};try{dc.apply(dd,de)}finally{d3.event=g}g.preventDefault()}function dn(){dg&&(d3.event.stopPropagation(),d3.event.preventDefault(),dg=!1)}function dm(){cZ&&(df&&(dg=!0),dl(),cZ=null)}function dl(){c$=null,cZ&&(df=!0,dp(db[2],d3.svg.mouse(dd),cZ))}function dk(){var a=d3.svg.touches(dd);switch(a.length){case 1:var b=a[0];dp(db[2],b,c_[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=c_[c.identifier],g=c_[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];dp(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function dj(){var a=d3.svg.touches(dd),b=-1,c=a.length,d;while(++b<c)c_[(d=a[b]).identifier]=dh(d);return a}function di(){cY||(cY=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{cY.scrollTop=1e3,cY.dispatchEvent(a),b=1e3-cY.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function dh(a){return[a[0]-db[0],a[1]-db[1],db[2]]}function cX(){d3.event.stopPropagation(),d3.event.preventDefault()}function cW(){cR&&(cX(),cR=!1)}function cV(){!cN||(cS("dragend"),cN=null,cQ&&(cR=!0,cX()))}function cU(){if(!!cN){var a=cN.parentNode;if(!a)return cV();cS("drag"),cX()}}function cT(a){return d3.event.touches?d3.svg.touches(a)[0]:d3.svg.mouse(a)}function cS(a){var b=d3.event,c=cN.parentNode,d=0,e=0;c&&(c=cT(c),d=c[0]-cP[0],e=c[1]-cP[1],cP=c,cQ|=d|e);try{d3.event={dx:d,dy:e},cM[a].dispatch.apply(cN,cO)}finally{d3.event=b}b.preventDefault()}function cL(a,b,c){e=[];if(c&&b.length>1){var d=bp(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function cK(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function cJ(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function cF(){return"circle"}function cE(){return 64}function cD(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(cC<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();cC=!e.f&&!e.e,d.remove()}cC?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function cB(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+bN;return[c*Math.cos(d),c*Math.sin(d)]}}function cA(a){return[a.x,a.y]}function cz(a){return a.endAngle}function cy(a){return a.startAngle}function cx(a){return a.radius}function cw(a){return a.target}function cv(a){return a.source}function cu(a){return function(b,c){return a[c][1]}}function ct(a){return function(b,c){return a[c][0]}}function cs(a){function i(f){if(f.length<1)return null;var i=bU(this,f,b,d),j=bU(this,f,b===c?ct(i):c,d===e?cu(i):e);return"M"+g(a(j),h)+"L"+g(a(i.reverse()),h)+"Z"}var b=bV,c=bV,d=0,e=bW,f="linear",g=bX[f],h=.7;i.x=function(a){if(!arguments.length)return c;b=c=a;return i},i.x0=function(a){if(!arguments.length)return b;b=a;return i},i.x1=function(a){if(!arguments.length)return c;c=a;return i},i.y=function(a){if(!arguments.length)return e;d=e=a;return i},i.y0=function(a){if(!arguments.length)return d;d=a;return i},i.y1=function(a){if(!arguments.length)return e;e=a;return i},i.interpolate=function(a){if(!arguments.length)return f;g=bX[f=a];return i},i.tension=function(a){if(!arguments.length)return h;h=a;return i};return i}function cr(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+bN,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cq(a){return a.length<3?bY(a):a[0]+cc(a,cp(a))}function cp(a){var b=[],c,d,e,f,g=co(a),h=-1,i=a.length-1;while(++h<i)c=cn(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function co(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cn(e,f);while(++b<c)d[b]=g+(g=cn(e=f,f=a[b+1]));d[b]=g;return d}function cn(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cm(a,b,c){a.push("C",ci(cj,b),",",ci(cj,c),",",ci(ck,b),",",ci(ck,c),",",ci(cl,b),",",ci(cl,c))}function ci(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function ch(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return ce(a)}function cg(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[ci(cl,g),",",ci(cl,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cm(b,g,h);return b.join("")}function cf(a){if(a.length<4)return bY(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(ci(cl,f)+","+ci(cl,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cm(b,f,g);return b.join("")}function ce(a){if(a.length<3)return bY(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),cm(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cm(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cm(b,h,i);return b.join("")}function cd(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cc(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bY(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cb(a,b,c){return a.length<3?bY(a):a[0]+cc(a,cd(a,b))}function ca(a,b){return a.length<3?bY(a):a[0]+cc((a.push(a[0]),a),cd([a[a.length-2]].concat(a,[a[1]]),b))}function b_(a,b){return a.length<4?bY(a):a[1]+cc(a.slice(1,a.length-1),cd(a,b))}function b$(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bZ(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bY(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bW(a){return a[1]}function bV(a){return a[0]}function bU(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bT(a){function g(d){return d.length<1?null:"M"+e(a(bU(this,d,b,c)),f)}var b=bV,c=bW,d="linear",e=bX[d],f=.7;g.x=function(a){if(!arguments.length)return b;b=a;return g},g.y=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bX[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g}function bS(a){return a.endAngle}function bR(a){return a.startAngle}function bQ(a){return a.outerRadius}function bP(a){return a.innerRadius}function bM(a,b,c){function g(){d=c.length/(b-a),e=c.length-1;return f}function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}var d,e;f.domain=function(c){if(!arguments.length)return[a,b];a=+c[0],b=+c[c.length-1];return g()},f.range=function(a){if(!arguments.length)return c;c=a;return g()},f.copy=function(){return bM(a,b,c)};return g()}function bL(a,b){function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}var c;e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending);return d()},e.range=function(a){if(!arguments.length)return b;b=a;return d()},e.quantiles=function(){return c},e.copy=function(){return bL(a,b)};return d()}function bG(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}var c,d,e;f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){if(!arguments.length)return d;d=a,e=0,b={t:"range",x:a};return f},f.rangePoints=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length-1+g);d=a.length<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,b={t:"rangePoints",x:c,p:g};return f},f.rangeBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length+g);d=d3.range(h+j*g,i,j),e=j*(1-g),b={t:"rangeBands",x:c,p:g};return f},f.rangeRoundBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=Math.floor((i-h)/(a.length+g)),k=i-h-(a.length-g)*j;d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),b={t:"rangeRoundBands",x:c,p:g};return f},f.rangeBand=function(){return e},f.copy=function(){return bG(a,b)};return f.domain(a)}function bF(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function bE(a,b){function e(b){return a(c(b))}var c=bF(b),d=bF(1/b);e.invert=function(b){return d(a.invert(b))},e.domain=function(b){if(!arguments.length)return a.domain().map(d);a.domain(b.map(c));return e},e.ticks=function(a){return bw(e.domain(),a)},e.tickFormat=function(a){return bx(e.domain(),a)},e.nice=function(){return e.domain(bq(e.domain(),bu))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();c=bF(b=a),d=bF(1/b);return e.domain(f)},e.copy=function(){return bE(a.copy(),b)};return bt(e,a)}function bD(a){return a.toPrecision(1)}function bC(a){return-Math.log(-a)/Math.LN10}function bB(a){return Math.log(a)/Math.LN10}function bA(a,b){function d(c){return a(b(c))}var c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=e[0]<0?bC:bB,c=b.pow,a.domain(e.map(b));return d},d.nice=function(){a.domain(bq(a.domain(),br));return d},d.ticks=function(){var d=bp(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bC){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return bD},d.copy=function(){return bA(a.copy(),b)};return bt(d,a)}function bz(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function by(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bx(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bv(a,b)[2])/Math.LN10+.01))+"f")}function bw(a,b){return d3.range.apply(d3,bv(a,b))}function bv(a,b){var c=bp(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e;return c}function bu(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bt(a,b){a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp);return a}function bs(a,b,c,d){function h(a){return e(a)}function g(){var g=a.length==2?by:bz,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(b){return bw(a,b)},h.tickFormat=function(b){return bx(a,b)},h.nice=function(){bq(a,bu);return g()},h.copy=function(){return bs(a,b,c,d)};return g()}function br(){return Math}function bq(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bp(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bo(){}function bm(){var a=null,b=bi,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bi=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bl(){var a,b=Date.now(),c=bi;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bm()-b;d>24?(isFinite(d)&&(clearTimeout(bk),bk=setTimeout(bl,d)),bj=0):(bj=1,bn(bl))}function bh(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function bc(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function bb(a,b){d(a,bd);var c={},e=d3.dispatch("start","end"),f=bg,g=Date.now();a.id=b,a.tween=function(b,d){if(arguments.length<2)return c[b];d==null?delete c[b]:c[b]=d;return a},a.ease=function(b){if(!arguments.length)return f;f=typeof b=="function"?b:d3.ease.apply(d3,arguments);return a},a.each=function(b,c){if(arguments.length<2)return bh.call(a,b);e[b].add(c);return a},d3.timer(function(d){a.each(function(h,i,j){function r(){--o.count||delete l.__transition__;return 1}function q(a){if(o.active!==b)return r();var c=Math.min(1,(a-m)/n),d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c===1){r(),bf=b,e.end.dispatch.call(l,h,i),bf=0;return 1}}function p(a){if(o.active>b)return r();o.active=b;for(var d in c)(d=c[d].call(l,h,i))&&k.push(d);e.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,g);return 1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=d?p(d):d3.timer(p,m,g)});return 1},0,g);return a}function _(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function Z(a){d(a,$);return a}function Y(a){return{__data__:a}}function X(a){return function(){return U(a,this)}}function W(a){return function(){return T(a,this)}}function S(a){d(a,V);return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);return a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=b-(a=+a)?1/(b-a):0;return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=b-(a=+a)?1/(b-a):0;return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return Math.pow(2,10*(a-1))}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function g(a){return a==null}function f(a){return a.length}function e(){return this}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.1.1"};var d=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,f),c=Array(b);++a<b;)for(var d=-1,e,g=c[a]=Array(e);++d<e;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,h=a.length;arguments.length<2&&(b=g);while(++f<h)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,Math.min(20,b-c)))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in N||/^(#|rgb\(|hsl\()/.test(b):b instanceof I||b instanceof Q)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"};var T=function(a,b){return b.querySelector(a)},U=function(a,b){return b.querySelectorAll(a)};typeof Sizzle=="function"&&(T=function(a,b){return Sizzle(a,b)[0]},U=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var V=[];d3.selection=function(){return ba},d3.selection.prototype=V,V.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=W(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return S(b)},V.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=X(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h])b.push(c=a.call(d,d.__data__,h)),c.parentNode=d;return S(b)},V.attr=function(a,b){function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function g(){this.setAttributeNS(a.space,a.local,b)}function f(){this.setAttribute(a,b)}function e(){this.removeAttributeNS(a.space,a.local)}function d(){this.removeAttribute(a)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},V.classed=function(a,b){function i(){(b.apply(this,arguments)?f:g).call(this)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=h(e.replace(c," ")),d?b.baseVal=e:this.className=e}function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=h(e+" "+a),d?b.baseVal=e:this.className=e)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;c.lastIndex=0;return c.test(
<del>e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?i:b?f:g)},V.style=function(a,b,c){function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}function e(){this.style.setProperty(a,b,c)}function d(){this.style.removeProperty(a)}arguments.length<3&&(c="");return arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},V.property=function(a,b){function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}function d(){this[a]=b}function c(){delete this[a]}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},V.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})},V.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})},V.append=function(a){function c(){return this.appendChild(document.createElementNS(a.space,a.local))}function b(){return this.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return this.select(a.local?c:b)},V.insert=function(a,b){function d(){return this.insertBefore(document.createElementNS(a.space,a.local),T(b,this))}function c(){return this.insertBefore(document.createElement(a),T(b,this))}a=d3.ns.qualify(a);return this.select(a.local?d:c)},V.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},V.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=Y(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=S(d);j.enter=function(){return Z(c)},j.exit=function(){return S(e)};return j};var $=[];$.append=V.append,$.insert=V.insert,$.empty=V.empty,$.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return S(b)},V.filter=function(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return S(b)},V.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},V.sort=function(a){a=_.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this},V.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");e>0&&(a=a.substring(0,e));return arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},V.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},V.call=function(a){a.apply(this,(arguments[0]=this,arguments));return this},V.empty=function(){return!this.node()},V.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},V.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bb(a,bf||++be)};var ba=S([[document]]);ba[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?ba.select(a):S([[a]])},d3.selectAll=function(a){return typeof a=="string"?ba.selectAll(a):S([a])};var bd=[],be=0,bf=0,bg=d3.ease("cubic-in-out");bd.call=V.call,d3.transition=function(){return ba.transition()},d3.transition.prototype=bd,bd.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=W(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bb(b,this.id).ease(this.ease())},bd.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=X(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h]){b.push(c=a.call(d.node,d.node.__data__,h));for(var j=-1,k=c.length;++j<k;)c[j]={node:c[j],delay:d.delay,duration:d.duration}}return bb(b,this.id).ease(this.ease())},bd.attr=function(a,b){return this.attrTween(a,bc(b))},bd.attrTween=function(a,b){function d(c,d){var e=b.call(this,c,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function c(c,d){var e=b.call(this,c,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}a=d3.ns.qualify(a);return this.tween("attr."+a,a.local?d:c)},bd.style=function(a,b,c){arguments.length<3&&(c="");return this.styleTween(a,bc(b),c)},bd.styleTween=function(a,b,c){arguments.length<3&&(c="");return this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}})},bd.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bd.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bd.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},bd.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},bd.transition=function(){return this.select(e)};var bi=null,bj,bk;d3.timer=function(a,b,c){var d=!1,e,f=bi;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bi={callback:a,then:c,delay:b,next:bi}),bj||(bk=clearTimeout(bk),bj=1,bn(bl))},d3.timer.flush=function(){var a,b=Date.now(),c=bi;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bm()};var bn=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bs([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return bA(d3.scale.linear(),bB)},bB.pow=function(a){return Math.pow(10,a)},bC.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return bE(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return bG([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(bH)},d3.scale.category20=function(){return d3.scale.ordinal().range(bI)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bJ)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bK)};var bH=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bI=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bJ=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bK=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return bL([],[])},d3.scale.quantize=function(){return bM(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bN,h=d.apply(this,arguments)+bN,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bO?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bP,b=bQ,c=bR,d=bS;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bN;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bN=-Math.PI/2,bO=2*Math.PI-1e-6;d3.svg.line=function(){return bT(Object)};var bX={linear:bY,"step-before":bZ,"step-after":b$,basis:ce,"basis-open":cf,"basis-closed":cg,bundle:ch,cardinal:cb,"cardinal-open":b_,"cardinal-closed":ca,monotone:cq},cj=[0,2/3,1/3,0],ck=[0,1/3,2/3,0],cl=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=bT(cr);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return cs(Object)},d3.svg.area.radial=function(){var a=cs(cr);a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1;return a},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bN,k=e.call(a,h,g)+bN;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=cv,b=cw,c=cx,d=bR,e=bS;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cv,b=cw,c=cA;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cA,c=a.projection;a.projection=function(a){return arguments.length?c(cB(b=a)):b};return a},d3.svg.mouse=function(a){return cD(a,d3.event)};var cC=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.touches;return b?Array.prototype.map.call(b,function(b){var c=cD(a,b);c.identifier=b.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(cG[a.call(this,c,d)]||cG.circle)(b.call(this,c,d))}var a=cF,b=cE;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var cG={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cI)),c=b*cI;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cH),c=b*cH/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cH),c=b*cH/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cG);var cH=Math.sqrt(3),cI=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){function F(a){return j.delay?a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease()):a}var n=d3.select(this),o=a.ticks.apply(a,g),p=h==null?a.tickFormat.apply(a,g):h,q=cL(a,o,i),r=n.selectAll(".minor").data(q,String),s=r.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),t=F(r.exit()).style("opacity",1e-6).remove(),u=F(r).style("opacity",1),v=n.selectAll("g").data(o,String),w=v.enter().insert("svg:g","path").style("opacity",1e-6),x=F(v.exit()).style("opacity",1e-6).remove(),y=F(v).style("opacity",1),z,A=bp(a.range()),B=n.selectAll(".domain").data([]),C=B.enter().append("svg:path").attr("class","domain"),D=F(B),E=this.__chart__||a;this.__chart__=a.copy(),w.append("svg:line").attr("class","tick"),w.append("svg:text"),y.select("text").text(p);switch(b){case"bottom":z=cJ,u.attr("y2",d),w.select("text").attr("dy",".71em").attr("text-anchor","middle"),y.select("line").attr("y2",c),y.select("text").attr("y",Math.max(c,0)+f),D.attr("d","M"+A[0]+","+e+"V0H"+A[1]+"V"+e);break;case"top":z=cJ,u.attr("y2",-d),w.select("text").attr("text-anchor","middle"),y.select("line").attr("y2",-c),y.select("text").attr("y",-(Math.max(c,0)+f)),D.attr("d","M"+A[0]+","+ -e+"V0H"+A[1]+"V"+ -e);break;case"left":z=cK,u.attr("x2",-d),w.select("text").attr("dy",".32em").attr("text-anchor","end"),y.select("line").attr("x2",-c),y.select("text").attr("x",-(Math.max(c,0)+f)),D.attr("d","M"+ -e+","+A[0]+"H0V"+A[1]+"H"+ -e);break;case"right":z=cK,u.attr("x2",d),w.select("text").attr("dy",".32em"),y.select("line").attr("x2",c),y.select("text").attr("x",Math.max(c,0)+f),D.attr("d","M"+e+","+A[0]+"H0V"+A[1]+"H"+e)}w.call(z,E),y.call(z,a),x.call(z,a),s.call(z,E),u.call(z,a),t.call(z,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;j.scale=function(b){if(!arguments.length)return a;a=b;return j},j.orient=function(a){if(!arguments.length)return b;b=a;return j},j.ticks=function(){if(!arguments.length)return g;g=arguments;return j},j.tickFormat=function(a){if(!arguments.length)return h;h=a;return j},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c;return j},j.tickPadding=function(a){if(!arguments.length)return f;f=+a;return j},j.tickSubdivide=function(a){if(!arguments.length)return i;i=+a;return j};return j},d3.behavior={},d3.behavior.drag=function(){function d(){c.apply(this,arguments),cS("dragstart")}function c(){cM=a,cP=cT((cN=this).parentNode),cQ=0,cO=arguments}function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",cU).on("touchmove.drag",cU).on("mouseup.drag",cV,!0).on("touchend.drag",cV,!0).on("click.drag",cW,!0)}var a=d3.dispatch("drag","dragstart","dragend");b.on=function(c,d){a[c].add(d);return b};return b};var cM,cN,cO,cP,cQ,cR;d3.behavior.zoom=function(){function h(){d.apply(this,arguments);var b=dj(),c,e=Date.now();b.length===1&&e-da<300&&dp(1+Math.floor(a[2]),c=b[0],c_[c.identifier]),da=e}function g(){d.apply(this,arguments);var b=d3.svg.mouse(dd);dp(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dh(b))}function f(){d.apply(this,arguments),c$||(c$=dh(d3.svg.mouse(dd))),dp(di()+a[2],d3.svg.mouse(dd),c$)}function e(){d.apply(this,arguments),cZ=dh(d3.svg.mouse(dd)),df=!1,d3.event.preventDefault(),window.focus()}function d(){db=a,dc=b.zoom.dispatch,dd=this,de=arguments}function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dl).on("mouseup.zoom",dm).on("touchmove.zoom",dk).on("touchend.zoom",dj).on("click.zoom",dn,!0)}var a=[0,0,0],b=d3.dispatch("zoom");c.on=function(a,d){b[a].add(d);return c};return c};var cY,cZ,c$,c_={},da=0,db,dc,dd,de,df,dg})()
<ide>\ No newline at end of file
<add>(function(){function dq(a,b,c){function i(a,b){var c=a.__domain||(a.__domain=a.domain()),d=a.range().map(function(a){return(a-b)/h});a.domain(c).domain(d.map(a.invert))}var d=Math.pow(2,(dc[2]=a)-c[2]),e=dc[0]=b[0]-d*c[0],f=dc[1]=b[1]-d*c[1],g=d3.event,h=Math.pow(2,a);d3.event={scale:h,translate:[e,f],transform:function(a,b){a&&i(a,e),b&&i(b,f)}};try{dd.apply(de,df)}finally{d3.event=g}g.preventDefault()}function dp(){dh&&(d3.event.stopPropagation(),d3.event.preventDefault(),dh=!1)}function dn(){c$&&(dg&&(dh=!0),dm(),c$=null)}function dm(){c_=null,c$&&(dg=!0,dq(dc[2],d3.svg.mouse(de),c$))}function dl(){var a=d3.svg.touches(de);switch(a.length){case 1:var b=a[0];dq(dc[2],b,da[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=da[c.identifier],g=da[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];dq(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function dk(){var a=d3.svg.touches(de),b=-1,c=a.length,d;while(++b<c)da[(d=a[b]).identifier]=di(d);return a}function dj(){cZ||(cZ=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{cZ.scrollTop=1e3,cZ.dispatchEvent(a),b=1e3-cZ.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function di(a){return[a[0]-dc[0],a[1]-dc[1],dc[2]]}function cY(){d3.event.stopPropagation(),d3.event.preventDefault()}function cX(){cS&&(cY(),cS=!1)}function cW(){!cO||(cT("dragend"),cO=null,cR&&(cS=!0,cY()))}function cV(){if(!!cO){var a=cO.parentNode;if(!a)return cW();cT("drag"),cY()}}function cU(a){return d3.event.touches?d3.svg.touches(a)[0]:d3.svg.mouse(a)}function cT(a){var b=d3.event,c=cO.parentNode,d=0,e=0;c&&(c=cU(c),d=c[0]-cQ[0],e=c[1]-cQ[1],cQ=c,cR|=d|e);try{d3.event={dx:d,dy:e},cN[a].dispatch.apply(cO,cP)}finally{d3.event=b}b.preventDefault()}function cM(a,b,c){e=[];if(c&&b.length>1){var d=bq(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function cL(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function cK(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function cG(){return"circle"}function cF(){return 64}function cE(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(cD<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();cD=!e.f&&!e.e,d.remove()}cD?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function cC(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+bO;return[c*Math.cos(d),c*Math.sin(d)]}}function cB(a){return[a.x,a.y]}function cA(a){return a.endAngle}function cz(a){return a.startAngle}function cy(a){return a.radius}function cx(a){return a.target}function cw(a){return a.source}function cv(a){return function(b,c){return a[c][1]}}function cu(a){return function(b,c){return a[c][0]}}function ct(a){function i(f){if(f.length<1)return null;var i=bV(this,f,b,d),j=bV(this,f,b===c?cu(i):c,d===e?cv(i):e);return"M"+g(a(j),h)+"L"+g(a(i.reverse()),h)+"Z"}var b=bW,c=bW,d=0,e=bX,f="linear",g=bY[f],h=.7;i.x=function(a){if(!arguments.length)return c;b=c=a;return i},i.x0=function(a){if(!arguments.length)return b;b=a;return i},i.x1=function(a){if(!arguments.length)return c;c=a;return i},i.y=function(a){if(!arguments.length)return e;d=e=a;return i},i.y0=function(a){if(!arguments.length)return d;d=a;return i},i.y1=function(a){if(!arguments.length)return e;e=a;return i},i.interpolate=function(a){if(!arguments.length)return f;g=bY[f=a];return i},i.tension=function(a){if(!arguments.length)return h;h=a;return i};return i}function cs(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+bO,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cr(a){return a.length<3?bZ(a):a[0]+cd(a,cq(a))}function cq(a){var b=[],c,d,e,f,g=cp(a),h=-1,i=a.length-1;while(++h<i)c=co(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cp(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=co(e,f);while(++b<c)d[b]=g+(g=co(e=f,f=a[b+1]));d[b]=g;return d}function co(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cn(a,b,c){a.push("C",cj(ck,b),",",cj(ck,c),",",cj(cl,b),",",cj(cl,c),",",cj(cm,b),",",cj(cm,c))}function cj(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function ci(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cf(a)}function ch(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[cj(cm,g),",",cj(cm,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cn(b,g,h);return b.join("")}function cg(a){if(a.length<4)return bZ(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cj(cm,f)+","+cj(cm,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cn(b,f,g);return b.join("")}function cf(a){if(a.length<3)return bZ(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),cn(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cn(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cn(b,h,i);return b.join("")}function ce(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cd(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bZ(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cc(a,b,c){return a.length<3?bZ(a):a[0]+cd(a,ce(a,b))}function cb(a,b){return a.length<3?bZ(a):a[0]+cd((a.push(a[0]),a),ce([a[a.length-2]].concat(a,[a[1]]),b))}function ca(a,b){return a.length<4?bZ(a):a[1]+cd(a.slice(1,a.length-1),ce(a,b))}function b_(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function b$(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bZ(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bX(a){return a[1]}function bW(a){return a[0]}function bV(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bU(a){function g(d){return d.length<1?null:"M"+e(a(bV(this,d,b,c)),f)}var b=bW,c=bX,d="linear",e=bY[d],f=.7;g.x=function(a){if(!arguments.length)return b;b=a;return g},g.y=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bY[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g}function bT(a){return a.endAngle}function bS(a){return a.startAngle}function bR(a){return a.outerRadius}function bQ(a){return a.innerRadius}function bN(a,b,c){function g(){d=c.length/(b-a),e=c.length-1;return f}function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}var d,e;f.domain=function(c){if(!arguments.length)return[a,b];a=+c[0],b=+c[c.length-1];return g()},f.range=function(a){if(!arguments.length)return c;c=a;return g()},f.copy=function(){return bN(a,b,c)};return g()}function bM(a,b){function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}var c;e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending);return d()},e.range=function(a){if(!arguments.length)return b;b=a;return d()},e.quantiles=function(){return c},e.copy=function(){return bM(a,b)};return d()}function bH(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}var c,d,e;f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){if(!arguments.length)return d;d=a,e=0,b={t:"range",x:a};return f},f.rangePoints=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length-1+g);d=a.length<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,b={t:"rangePoints",x:c,p:g};return f},f.rangeBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length+g);d=d3.range(h+j*g,i,j),e=j*(1-g),b={t:"rangeBands",x:c,p:g};return f},f.rangeRoundBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=Math.floor((i-h)/(a.length+g)),k=i-h-(a.length-g)*j;d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),b={t:"rangeRoundBands",x:c,p:g};return f},f.rangeBand=function(){return e},f.copy=function(){return bH(a,b)};return f.domain(a)}function bG(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function bF(a,b){function e(b){return a(c(b))}var c=bG(b),d=bG(1/b);e.invert=function(b){return d(a.invert(b))},e.domain=function(b){if(!arguments.length)return a.domain().map(d);a.domain(b.map(c));return e},e.ticks=function(a){return bx(e.domain(),a)},e.tickFormat=function(a){return by(e.domain(),a)},e.nice=function(){return e.domain(br(e.domain(),bv))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();c=bG(b=a),d=bG(1/b);return e.domain(f)},e.copy=function(){return bF(a.copy(),b)};return bu(e,a)}function bE(a){return a.toPrecision(1)}function bD(a){return-Math.log(-a)/Math.LN10}function bC(a){return Math.log(a)/Math.LN10}function bB(a,b){function d(c){return a(b(c))}var c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=e[0]<0?bD:bC,c=b.pow,a.domain(e.map(b));return d},d.nice=function(){a.domain(br(a.domain(),bs));return d},d.ticks=function(){var d=bq(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bD){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return bE},d.copy=function(){return bB(a.copy(),b)};return bu(d,a)}function bA(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bz(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function by(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bw(a,b)[2])/Math.LN10+.01))+"f")}function bx(a,b){return d3.range.apply(d3,bw(a,b))}function bw(a,b){var c=bq(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e;return c}function bv(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bu(a,b){a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp);return a}function bt(a,b,c,d){function h(a){return e(a)}function g(){var g=a.length==2?bz:bA,i=d?H:G;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(b){return bx(a,b)},h.tickFormat=function(b){return by(a,b)},h.nice=function(){br(a,bv);return g()},h.copy=function(){return bt(a,b,c,d)};return g()}function bs(){return Math}function br(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bq(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bp(){}function bn(){var a=null,b=bj,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bj=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bm(){var a,b=Date.now(),c=bj;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bn()-b;d>24?(isFinite(d)&&(clearTimeout(bl),bl=setTimeout(bm,d)),bk=0):(bk=1,bo(bm))}function bi(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function bd(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function bc(a,b){d(a,be);var c={},e=d3.dispatch("start","end"),f=bh,g=Date.now();a.id=b,a.tween=function(b,d){if(arguments.length<2)return c[b];d==null?delete c[b]:c[b]=d;return a},a.ease=function(b){if(!arguments.length)return f;f=typeof b=="function"?b:d3.ease.apply(d3,arguments);return a},a.each=function(b,c){if(arguments.length<2)return bi.call(a,b);e[b].add(c);return a},d3.timer(function(d){a.each(function(h,i,j){function r(){--o.count||delete l.__transition__;return 1}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1){r(),bg=b,e.end.dispatch.call(l,h,i),bg=0;return 1}}function p(a){if(o.active>b)return r();o.active=b;for(var d in c)(d=c[d].call(l,h,i))&&k.push(d);e.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,g);return 1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=d?p(d):d3.timer(p,m,g)});return 1},0,g);return a}function ba(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function $(a){d(a,_);return a}function Z(a){return{__data__:a}}function Y(a){return function(){return V(a,this)}}function X(a){return function(){return U(a,this)}}function T(a){d(a,W);return a}function S(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);return a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return I(g(a+120),g(a),g(a-120))}function R(a,b,c){this.h=a,this.s=b,this.l=c}function Q(a,b,c){return new R(a,b,c)}function N(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function M(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return Q(g,h,i)}function L(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(N(h[0]),N(h[1]),N(h[2]))}}if(i=O[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function K(a){return a<16?"0"+a.toString(16):a.toString(16)}function J(a,b,c){this.r=a,this.g=b,this.b=c}function I(a,b,c){return new J(a,b,c)}function H(a,b){b=b-(a=+a)?1/(b-a):0;return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function G(a,b){b=b-(a=+a)?1/(b-a):0;return function(c){return(c-a)*b}}function F(a){return a in E||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function C(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function B(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function A(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function z(a){return 1-Math.sqrt(1-a*a)}function y(a){return Math.pow(2,10*(a-1))}function x(a){return 1-Math.cos(a*Math.PI/2)}function w(a){return function(b){return Math.pow(b,a)}}function v(a){return a}function u(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function t(a){return function(b){return 1-a(1-b)}}function s(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function g(a){return a==null}function f(a){return a.length}function e(){return this}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.1.1"};var d=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,f),c=Array(b);++a<b;)for(var d=-1,e,g=c[a]=Array(e);++d<e;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,h=a.length;arguments.length<2&&(b=g);while(++f<h)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,Math.min(20,b-c)))}},o=w(2),p=w(3),q={linear:function(){return v},poly:w,quad:function(){return o},cubic:function(){return p},sin:function(){return x},exp:function(){return y},circle:function(){return z},elastic:A,back:B,bounce:function(){return C}},r={"in":function(a){return a},out:t,"in-out":u,"out-in":function(a){return u(t(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return s(r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;D.lastIndex=0;for(d=0;c=D.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=D.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=D.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return S(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=F(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var D=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,E={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in O||/^(#|rgb\(|hsl\()/.test(b):b instanceof J||b instanceof R)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?L(""+a,I,S):I(~~a,~~b,~~c)},J.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return I(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return I(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},J.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return I(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},J.prototype.hsl=function(){return M(this.r,this.g,this.b)},J.prototype.toString=function(){return"#"+K(this.r)+K(this.g)+K(this.b)};var O={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var P in O)O[P]=L(O[P],I,S);d3.hsl=function(a,b,c){return arguments.length===1?L(""+a,M,Q):Q(+a,+b,+c)},R.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return Q(this.h,this.s,this.l/a)},R.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return Q(this.h,this.s,a*this.l)},R.prototype.rgb=function(){return S(this.h,this.s,this.l)},R.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"};var U=function(a,b){return b.querySelector(a)},V=function(a,b){return b.querySelectorAll(a)};typeof Sizzle=="function"&&(U=function(a,b){return Sizzle(a,b)[0]},V=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var W=[];d3.selection=function(){return bb},d3.selection.prototype=W,W.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=X(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return T(b)},W.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=Y(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h])b.push(c=a.call(d,d.__data__,h)),c.parentNode=d;return T(b)},W.attr=function(a,b){function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function g(){this.setAttributeNS(a.space,a.local,b)}function f(){this.setAttribute(a,b)}function e(){this.removeAttributeNS(a.space,a.local)}function d(){this.removeAttribute(a)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},W.classed=function(a,b){function i(){(b.apply(this,arguments)?f:g).call(this)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=h(e.replace(c," ")),d?b.baseVal=e:this.className=e}function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=h(e+" "+a),d?b.baseVal=e:this.className=e)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains
<add>(a);var e=d.className;c.lastIndex=0;return c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?i:b?f:g)},W.style=function(a,b,c){function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}function e(){this.style.setProperty(a,b,c)}function d(){this.style.removeProperty(a)}arguments.length<3&&(c="");return arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},W.property=function(a,b){function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}function d(){this[a]=b}function c(){delete this[a]}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},W.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})},W.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})},W.append=function(a){function c(){return this.appendChild(document.createElementNS(a.space,a.local))}function b(){return this.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return this.select(a.local?c:b)},W.insert=function(a,b){function d(){return this.insertBefore(document.createElementNS(a.space,a.local),U(b,this))}function c(){return this.insertBefore(document.createElement(a),U(b,this))}a=d3.ns.qualify(a);return this.select(a.local?d:c)},W.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},W.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Z(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Z(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=Z(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=T(d);j.enter=function(){return $(c)},j.exit=function(){return T(e)};return j};var _=[];_.append=W.append,_.insert=W.insert,_.empty=W.empty,_.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return T(b)},W.filter=function(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return T(b)},W.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},W.sort=function(a){a=ba.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this},W.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");e>0&&(a=a.substring(0,e));return arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},W.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},W.call=function(a){a.apply(this,(arguments[0]=this,arguments));return this},W.empty=function(){return!this.node()},W.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},W.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bc(a,bg||++bf)};var bb=T([[document]]);bb[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?bb.select(a):T([[a]])},d3.selectAll=function(a){return typeof a=="string"?bb.selectAll(a):T([a])};var be=[],bf=0,bg=0,bh=d3.ease("cubic-in-out");be.call=W.call,d3.transition=function(){return bb.transition()},d3.transition.prototype=be,be.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=X(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bc(b,this.id).ease(this.ease())},be.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=Y(a));for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)if(d=g[h]){b.push(c=a.call(d.node,d.node.__data__,h));for(var j=-1,k=c.length;++j<k;)c[j]={node:c[j],delay:d.delay,duration:d.duration}}return bc(b,this.id).ease(this.ease())},be.attr=function(a,b){return this.attrTween(a,bd(b))},be.attrTween=function(a,b){function d(c,d){var e=b.call(this,c,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function c(c,d){var e=b.call(this,c,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}a=d3.ns.qualify(a);return this.tween("attr."+a,a.local?d:c)},be.style=function(a,b,c){arguments.length<3&&(c="");return this.styleTween(a,bd(b),c)},be.styleTween=function(a,b,c){arguments.length<3&&(c="");return this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}})},be.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},be.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},be.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},be.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},be.transition=function(){return this.select(e)};var bj=null,bk,bl;d3.timer=function(a,b,c){var d=!1,e,f=bj;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bj={callback:a,then:c,delay:b,next:bj}),bk||(bl=clearTimeout(bl),bk=1,bo(bm))},d3.timer.flush=function(){var a,b=Date.now(),c=bj;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bn()};var bo=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bt([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return bB(d3.scale.linear(),bC)},bC.pow=function(a){return Math.pow(10,a)},bD.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return bF(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return bH([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(bI)},d3.scale.category20=function(){return d3.scale.ordinal().range(bJ)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bK)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bL)};var bI=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bJ=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bK=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bL=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return bM([],[])},d3.scale.quantize=function(){return bN(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bO,h=d.apply(this,arguments)+bO,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bP?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bQ,b=bR,c=bS,d=bT;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bO;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bO=-Math.PI/2,bP=2*Math.PI-1e-6;d3.svg.line=function(){return bU(Object)};var bY={linear:bZ,"step-before":b$,"step-after":b_,basis:cf,"basis-open":cg,"basis-closed":ch,bundle:ci,cardinal:cc,"cardinal-open":ca,"cardinal-closed":cb,monotone:cr},ck=[0,2/3,1/3,0],cl=[0,1/3,2/3,0],cm=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=bU(cs);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return ct(Object)},d3.svg.area.radial=function(){var a=ct(cs);a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1;return a},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bO,k=e.call(a,h,g)+bO;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=cw,b=cx,c=cy,d=bS,e=bT;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cw,b=cx,c=cB;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cB,c=a.projection;a.projection=function(a){return arguments.length?c(cC(b=a)):b};return a},d3.svg.mouse=function(a){return cE(a,d3.event)};var cD=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.touches;return b?Array.prototype.map.call(b,function(b){var c=cE(a,b);c.identifier=b.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(cH[a.call(this,c,d)]||cH.circle)(b.call(this,c,d))}var a=cG,b=cF;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var cH={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cJ)),c=b*cJ;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cI),c=b*cI/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cI),c=b*cI/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cH);var cI=Math.sqrt(3),cJ=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){function F(a){return j.delay?a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease()):a}var n=d3.select(this),o=a.ticks.apply(a,g),p=h==null?a.tickFormat.apply(a,g):h,q=cM(a,o,i),r=n.selectAll(".minor").data(q,String),s=r.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),t=F(r.exit()).style("opacity",1e-6).remove(),u=F(r).style("opacity",1),v=n.selectAll("g").data(o,String),w=v.enter().insert("svg:g","path").style("opacity",1e-6),x=F(v.exit()).style("opacity",1e-6).remove(),y=F(v).style("opacity",1),z,A=bq(a.range()),B=n.selectAll(".domain").data([]),C=B.enter().append("svg:path").attr("class","domain"),D=F(B),E=this.__chart__||a;this.__chart__=a.copy(),w.append("svg:line").attr("class","tick"),w.append("svg:text"),y.select("text").text(p);switch(b){case"bottom":z=cK,u.attr("y2",d),w.select("text").attr("dy",".71em").attr("text-anchor","middle"),y.select("line").attr("y2",c),y.select("text").attr("y",Math.max(c,0)+f),D.attr("d","M"+A[0]+","+e+"V0H"+A[1]+"V"+e);break;case"top":z=cK,u.attr("y2",-d),w.select("text").attr("text-anchor","middle"),y.select("line").attr("y2",-c),y.select("text").attr("y",-(Math.max(c,0)+f)),D.attr("d","M"+A[0]+","+ -e+"V0H"+A[1]+"V"+ -e);break;case"left":z=cL,u.attr("x2",-d),w.select("text").attr("dy",".32em").attr("text-anchor","end"),y.select("line").attr("x2",-c),y.select("text").attr("x",-(Math.max(c,0)+f)),D.attr("d","M"+ -e+","+A[0]+"H0V"+A[1]+"H"+ -e);break;case"right":z=cL,u.attr("x2",d),w.select("text").attr("dy",".32em"),y.select("line").attr("x2",c),y.select("text").attr("x",Math.max(c,0)+f),D.attr("d","M"+e+","+A[0]+"H0V"+A[1]+"H"+e)}w.call(z,E),y.call(z,a),x.call(z,a),s.call(z,E),u.call(z,a),t.call(z,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;j.scale=function(b){if(!arguments.length)return a;a=b;return j},j.orient=function(a){if(!arguments.length)return b;b=a;return j},j.ticks=function(){if(!arguments.length)return g;g=arguments;return j},j.tickFormat=function(a){if(!arguments.length)return h;h=a;return j},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c;return j},j.tickPadding=function(a){if(!arguments.length)return f;f=+a;return j},j.tickSubdivide=function(a){if(!arguments.length)return i;i=+a;return j};return j},d3.behavior={},d3.behavior.drag=function(){function d(){c.apply(this,arguments),cT("dragstart")}function c(){cN=a,cQ=cU((cO=this).parentNode),cR=0,cP=arguments}function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",cV).on("touchmove.drag",cV).on("mouseup.drag",cW,!0).on("touchend.drag",cW,!0).on("click.drag",cX,!0)}var a=d3.dispatch("drag","dragstart","dragend");b.on=function(c,d){a[c].add(d);return b};return b};var cN,cO,cP,cQ,cR,cS;d3.behavior.zoom=function(){function h(){d.apply(this,arguments);var b=dk(),c,e=Date.now();b.length===1&&e-db<300&&dq(1+Math.floor(a[2]),c=b[0],da[c.identifier]),db=e}function g(){d.apply(this,arguments);var b=d3.svg.mouse(de);dq(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,di(b))}function f(){d.apply(this,arguments),c_||(c_=di(d3.svg.mouse(de))),dq(dj()+a[2],d3.svg.mouse(de),c_)}function e(){d.apply(this,arguments),c$=di(d3.svg.mouse(de)),dg=!1,d3.event.preventDefault(),window.focus()}function d(){dc=a,dd=b.zoom.dispatch,de=this,df=arguments}function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dm).on("mouseup.zoom",dn).on("touchmove.zoom",dl).on("touchend.zoom",dk).on("click.zoom",dp,!0)}var a=[0,0,0],b=d3.dispatch("zoom");c.on=function(a,d){b[a].add(d);return c};return c};var cZ,c$,c_,da={},db=0,dc,dd,de,df,dg,dh})()
<ide>\ No newline at end of file
<ide><path>src/core/ease.js
<ide> d3.ease = function(name) {
<ide> var i = name.indexOf("-"),
<ide> t = i >= 0 ? name.substring(0, i) : name,
<ide> m = i >= 0 ? name.substring(i + 1) : "in";
<del> return d3_ease_mode[m](d3_ease[t].apply(null, Array.prototype.slice.call(arguments, 1)));
<add> return d3_ease_clamp(d3_ease_mode[m](d3_ease[t].apply(null, Array.prototype.slice.call(arguments, 1))));
<ide> };
<ide>
<add>function d3_ease_clamp(f) {
<add> return function(t) {
<add> return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
<add> };
<add>}
<add>
<ide> function d3_ease_reverse(f) {
<ide> return function(t) {
<ide> return 1 - f(1 - t);
<ide><path>src/core/transition.js
<ide> function d3_transition(groups, id) {
<ide> function tick(elapsed) {
<ide> if (lock.active !== id) return stop();
<ide>
<del> var t = Math.min(1, (elapsed - delay) / duration),
<add> var t = (elapsed - delay) / duration,
<ide> e = ease(t),
<ide> n = tweened.length;
<ide>
<ide> while (n > 0) {
<ide> tweened[--n].call(node, e);
<ide> }
<ide>
<del> if (t === 1) {
<add> if (t >= 1) {
<ide> stop();
<ide> d3_transitionInheritId = id;
<ide> event.end.dispatch.call(node, d, i);
<ide><path>test/core/ease-test.js
<ide> suite.addBatch({
<ide> var e = ease("bounce");
<ide> assert.inDelta(e(.5), 0.765625, 1e-6);
<ide> },
<del> "all easing functions return approximately 0 for t = 0": function(ease) {
<del> assert.inDelta(ease("linear")(0), 0, 1e-9);
<del> assert.inDelta(ease("poly", 2)(0), 0, 1e-9);
<del> assert.inDelta(ease("quad")(0), 0, 1e-9);
<del> assert.inDelta(ease("cubic")(0), 0, 1e-9);
<del> assert.inDelta(ease("sin")(0), 0, 1e-9);
<del> assert.inDelta(ease("exp")(0), 0, 1e-3); // XXX
<del> assert.inDelta(ease("circle")(0), 0, 1e-9);
<del> assert.inDelta(ease("elastic")(0), 0, 1e-9);
<del> assert.inDelta(ease("back")(0), 0, 1e-9);
<del> assert.inDelta(ease("bounce")(0), 0, 1e-9);
<del> },
<del> "all easing functions return approximately 1 for t = 1": function(ease) {
<del> assert.inDelta(ease("linear")(1), 1, 1e-9);
<del> assert.inDelta(ease("poly", 2)(1), 1, 1e-9);
<del> assert.inDelta(ease("quad")(1), 1, 1e-9);
<del> assert.inDelta(ease("cubic")(1), 1, 1e-9);
<del> assert.inDelta(ease("sin")(1), 1, 1e-9);
<del> assert.inDelta(ease("exp")(1), 1, 1e-9);
<del> assert.inDelta(ease("circle")(1), 1, 1e-9);
<del> assert.inDelta(ease("elastic")(1), 1, 1e-3); // XXX
<del> assert.inDelta(ease("back")(1), 1, 1e-9);
<del> assert.inDelta(ease("bounce")(1), 1, 1e-9);
<add> "all easing functions return exactly 0 for t = 0": function(ease) {
<add> assert.equal(ease("linear")(0), 0);
<add> assert.equal(ease("poly", 2)(0), 0);
<add> assert.equal(ease("quad")(0), 0);
<add> assert.equal(ease("cubic")(0), 0);
<add> assert.equal(ease("sin")(0), 0);
<add> assert.equal(ease("exp")(0), 0);
<add> assert.equal(ease("circle")(0), 0);
<add> assert.equal(ease("elastic")(0), 0);
<add> assert.equal(ease("back")(0), 0);
<add> assert.equal(ease("bounce")(0), 0);
<add> },
<add> "all easing functions return exactly 1 for t = 1": function(ease) {
<add> assert.equal(ease("linear")(1), 1);
<add> assert.equal(ease("poly", 2)(1), 1);
<add> assert.equal(ease("quad")(1), 1);
<add> assert.equal(ease("cubic")(1), 1);
<add> assert.equal(ease("sin")(1), 1);
<add> assert.equal(ease("exp")(1), 1);
<add> assert.equal(ease("circle")(1), 1);
<add> assert.equal(ease("elastic")(1), 1);
<add> assert.equal(ease("back")(1), 1);
<add> assert.equal(ease("bounce")(1), 1);
<ide> },
<ide> "the -in suffix returns the identity": function(ease) {
<del> assert.equal(ease("linear-in"), ease("linear"));
<del> assert.equal(ease("quad-in"), ease("quad"));
<add> assert.inDelta(ease("linear-in")(.25), ease("linear")(.25), 1e-6);
<add> assert.inDelta(ease("quad-in")(.75), ease("quad")(.75), 1e-6);
<ide> },
<ide> "the -out suffix returns the reverse": function(ease) {
<ide> assert.inDelta(ease("sin-out")(.25), 1 - ease("sin-in")(.75), 1e-6);
<ide> suite.addBatch({
<ide> assert.inDelta(ease("bounce-out-in")(.25), .5 * ease("bounce-out")(.5), 1e-6);
<ide> assert.inDelta(ease("elastic-out-in")(.25), .5 * ease("elastic-out")(.5), 1e-6);
<ide> },
<del> "does not clamp input time": function(ease) {
<add> "clamps input time": function(ease) {
<ide> var e = ease("linear");
<del> assert.inDelta(e(-1), -1, 1e-6);
<del> assert.inDelta(e(2), 2, 1e-6);
<add> assert.inDelta(e(-1), 0, 1e-6);
<add> assert.inDelta(e(2), 1, 1e-6);
<ide> },
<ide> "poly": {
<ide> "supports an optional polynomial": function(ease) { | 5 |
Go | Go | add options to route map | dd53c457d75a49e6e140c6d71642b237f3ee9056 | <ide><path>api.go
<ide> func postBuild(srv *Server, version float64, w http.ResponseWriter, r *http.Requ
<ide> return nil
<ide> }
<ide>
<add>func optionsHandler(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
<add> w.WriteHeader(http.StatusOK)
<add> return nil
<add>}
<ide> func writeCorsHeaders(w http.ResponseWriter, r *http.Request) {
<ide> w.Header().Add("Access-Control-Allow-Origin", "*")
<ide> w.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept")
<ide> func createRouter(srv *Server, logging bool) (*mux.Router, error) {
<ide> "/containers/{name:.*}": deleteContainers,
<ide> "/images/{name:.*}": deleteImages,
<ide> },
<add> "OPTIONS": {
<add> "": optionsHandler,
<add> },
<ide> }
<ide>
<ide> for method, routes := range m {
<ide> func createRouter(srv *Server, logging bool) (*mux.Router, error) {
<ide> httpError(w, err)
<ide> }
<ide> }
<del> r.Path("/v{version:[0-9.]+}" + localRoute).Methods(localMethod).HandlerFunc(f)
<del> r.Path(localRoute).Methods(localMethod).HandlerFunc(f)
<add>
<add> if localRoute == "" {
<add> r.Methods(localMethod).HandlerFunc(f)
<add> } else {
<add> r.Path("/v{version:[0-9.]+}" + localRoute).Methods(localMethod).HandlerFunc(f)
<add> r.Path(localRoute).Methods(localMethod).HandlerFunc(f)
<add> }
<ide> }
<ide> }
<del> r.Methods("OPTIONS").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
<del> if srv.enableCors {
<del> writeCorsHeaders(w, r)
<del> }
<del> w.WriteHeader(http.StatusOK)
<del> })
<ide> return r, nil
<ide> }
<ide> | 1 |
Go | Go | log active configuration when reloading | 8378dcf46d017c70df97d6f851e0196b113b422e | <ide><path>daemon/config/config.go
<ide> type CommonConfig struct {
<ide> sync.Mutex
<ide> // FIXME(vdemeester) This part is not that clear and is mainly dependent on cli flags
<ide> // It should probably be handled outside this package.
<del> ValuesSet map[string]interface{}
<add> ValuesSet map[string]interface{} `json:"-"`
<ide>
<ide> Experimental bool `json:"experimental"` // Experimental indicates whether experimental features should be exposed or not
<ide>
<ide><path>daemon/reload.go
<ide> func (daemon *Daemon) Reload(conf *config.Config) (err error) {
<ide> attributes := map[string]string{}
<ide>
<ide> defer func() {
<add> jsonString, _ := json.Marshal(daemon.configStore)
<add>
<ide> // we're unlocking here, because
<ide> // LogDaemonEventWithAttributes() -> SystemInfo() -> GetAllRuntimes()
<ide> // holds that lock too.
<ide> daemon.configStore.Unlock()
<ide> if err == nil {
<add> logrus.Infof("Reloaded configuration: %s", jsonString)
<ide> daemon.LogDaemonEventWithAttributes("reload", attributes)
<ide> }
<ide> }() | 2 |
Ruby | Ruby | skip some flaky tests for now | 50c964df2ebda125366a94f0e8701eaeb0d98fa7 | <ide><path>Library/Homebrew/test/test_uninstall.rb
<ide> def handle_unsatisfied_dependents
<ide> end
<ide>
<ide> def test_check_for_testball_f2s_when_developer
<add> skip "Flaky test"
<ide> assert_match "Warning", handle_unsatisfied_dependents
<ide> refute_predicate Homebrew, :failed?
<ide> end
<ide>
<ide> def test_check_for_dependents_when_not_developer
<add> skip "Flaky test"
<ide> run_as_not_developer do
<ide> assert_match "Error", handle_unsatisfied_dependents
<ide> assert_predicate Homebrew, :failed? | 1 |
Text | Text | add documentation for common.mustnotcall() | 163c0780ead0e245d8ff2e68955b7e7a906399cd | <ide><path>test/common/README.md
<ide> fail.
<ide>
<ide> If `fn` is not provided, `common.noop` will be used.
<ide>
<add>### mustNotCall([msg])
<add>* `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) default = 'function should not have been called'
<add>* return [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
<add>
<add>Returns a function that triggers an `AssertionError` if it is invoked. `msg` is used as the error message for the `AssertionError`.
<add>
<ide> ### nodeProcessAborted(exitCode, signal)
<ide> * `exitCode` [<Number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)
<ide> * `signal` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | 1 |
Python | Python | add mean bias deviation in scoring functions | 80bdfbb9f9f828f39633e6f59deb7559340b4700 | <ide><path>machine_learning/scoring_functions.py
<del>import numpy
<add>import numpy as np
<ide>
<ide> """ Here I implemented the scoring functions.
<ide> MAE, MSE, RMSE, RMSLE are included.
<ide> def rmse(predict, actual):
<ide> actual = np.array(actual)
<ide>
<ide> difference = predict - actual
<del> square_diff = np.square(dfference)
<add> square_diff = np.square(difference)
<ide> mean_square_diff = square_diff.mean()
<ide> score = np.sqrt(mean_square_diff)
<ide> return score
<ide> def rmsle(predict, actual):
<ide> score = np.sqrt(mean_square_diff)
<ide>
<ide> return score
<add>
<add>#Mean Bias Deviation
<add>def mbd(predict, actual):
<add> predict = np.array(predict)
<add> actual = np.array(actual)
<add>
<add> difference = predict - actual
<add> numerator = np.sum(difference) / len(predict)
<add> denumerator = np.sum(actual) / len(predict)
<add> print str(numerator)
<add> print str(denumerator)
<add>
<add> score = float(numerator) / denumerator * 100
<add>
<add> return score
<ide>\ No newline at end of file | 1 |
Text | Text | fix version in spanruler docs | 763dcbf885d026be1412ea6b2219ceaad6125377 | <ide><path>website/docs/api/spanruler.md
<ide> title: SpanRuler
<ide> tag: class
<ide> source: spacy/pipeline/span_ruler.py
<del>new: 3.3
<add>new: 3.3.1
<ide> teaser: 'Pipeline component for rule-based span and named entity recognition'
<ide> api_string_name: span_ruler
<ide> api_trainable: false
<ide><path>website/docs/usage/rule-based-matching.md
<ide> with nlp.select_pipes(enable="tagger"):
<ide> ruler.add_patterns(patterns)
<ide> ```
<ide>
<del>## Rule-based span matching {#spanruler new="3.3"}
<add>## Rule-based span matching {#spanruler new="3.3.1"}
<ide>
<ide> The [`SpanRuler`](/api/spanruler) is a generalized version of the entity ruler
<ide> that lets you add spans to `doc.spans` or `doc.ents` based on pattern | 2 |
Java | Java | testsubscriber javadoc improvements | acb1259c35377058220c7a664011a8d4c30cd510 | <ide><path>src/main/java/rx/observers/TestSubscriber.java
<ide> public void onCompleted() {
<ide> }
<ide>
<ide> /**
<del> * Get the {@link Notification}s representing each time this {@link Subscriber} was notified of sequence
<add> * Returns the {@link Notification}s representing each time this {@link Subscriber} was notified of sequence
<ide> * completion via {@link #onCompleted}, as a {@link List}.
<ide> *
<ide> * @return a list of Notifications representing calls to this Subscriber's {@link #onCompleted} method
<ide> public void onError(Throwable e) {
<ide> }
<ide>
<ide> /**
<del> * Get the {@link Throwable}s this {@link Subscriber} was notified of via {@link #onError} as a
<add> * Returns the {@link Throwable}s this {@link Subscriber} was notified of via {@link #onError} as a
<ide> * {@link List}.
<ide> *
<ide> * @return a list of the Throwables that were passed to this Subscriber's {@link #onError} method
<ide> public void onNext(T t) {
<ide> }
<ide>
<ide> /**
<del> * Allow calling the protected {@link #request(long)} from unit tests.
<add> * Allows calling the protected {@link #request(long)} from unit tests.
<ide> *
<ide> * @param n the maximum number of items you want the Observable to emit to the Subscriber at this time, or
<ide> * {@code Long.MAX_VALUE} if you want the Observable to emit items at its own pace
<ide> public void requestMore(long n) {
<ide> }
<ide>
<ide> /**
<del> * Get the sequence of items observed by this {@link Subscriber}, as an ordered {@link List}.
<add> * Returns the sequence of items observed by this {@link Subscriber}, as an ordered {@link List}.
<ide> *
<ide> * @return a list of items observed by this Subscriber, in the order in which they were observed
<ide> */
<ide> public List<T> getOnNextEvents() {
<ide> }
<ide>
<ide> /**
<del> * Assert that a particular sequence of items was received by this {@link Subscriber} in order.
<add> * Asserts that a particular sequence of items was received by this {@link Subscriber} in order.
<ide> *
<ide> * @param items
<ide> * the sequence of items expected to have been observed
<ide> public void assertReceivedOnNext(List<T> items) {
<ide> }
<ide>
<ide> /**
<del> * Assert that a single terminal event occurred, either {@link #onCompleted} or {@link #onError}.
<add> * Asserts that a single terminal event occurred, either {@link #onCompleted} or {@link #onError}.
<ide> *
<ide> * @throws AssertionError
<ide> * if not exactly one terminal event notification was received
<ide> public void assertTerminalEvent() {
<ide> }
<ide>
<ide> /**
<del> * Assert that this {@code Subscriber} is unsubscribed.
<add> * Asserts that this {@code Subscriber} is unsubscribed.
<ide> *
<ide> * @throws AssertionError
<ide> * if this {@code Subscriber} is not unsubscribed
<ide> public void assertUnsubscribed() {
<ide> }
<ide>
<ide> /**
<del> * Assert that this {@code Subscriber} has received no {@code onError} notifications.
<add> * Asserts that this {@code Subscriber} has received no {@code onError} notifications.
<ide> *
<ide> * @throws AssertionError
<ide> * if this {@code Subscriber} has received one or more {@code onError} notifications
<ide> public Thread getLastSeenThread() {
<ide> }
<ide>
<ide> /**
<del> * Assert if there is exactly a single completion event.
<add> * Asserts that there is exactly one completion event.
<ide> *
<ide> * @throws AssertionError if there were zero, or more than one, onCompleted events
<ide> * @since (if this graduates from "Experimental" replace this parenthetical with the release number)
<ide> public void assertCompleted() {
<ide> }
<ide>
<ide> /**
<del> * Assert if there is no completion event.
<add> * Asserts that there is no completion event.
<ide> *
<ide> * @throws AssertionError if there were one or more than one onCompleted events
<ide> * @since (if this graduates from "Experimental" replace this parenthetical with the release number)
<ide> public void assertNotCompleted() {
<ide> }
<ide>
<ide> /**
<del> * Assert if there is exactly one error event which is a subclass of the given class.
<add> * Asserts that there is exactly one error event which is a subclass of the given class.
<ide> *
<ide> * @param clazz the class to check the error against.
<ide> * @throws AssertionError if there were zero, or more than one, onError events, or if the single onError
<ide> public void assertError(Class<? extends Throwable> clazz) {
<ide> }
<ide>
<ide> /**
<del> * Assert there is a single onError event with the exact exception.
<add> * Asserts that there is a single onError event with the exact exception.
<ide> *
<ide> * @param throwable the throwable to check
<ide> * @throws AssertionError if there were zero, or more than one, onError events, or if the single onError
<ide> public void assertError(Throwable throwable) {
<ide> }
<ide>
<ide> /**
<del> * Assert for no onError and onCompleted events.
<add> * Asserts that there are no onError and onCompleted events.
<ide> *
<ide> * @throws AssertionError if there was either an onError or onCompleted event
<ide> * @since (if this graduates from "Experimental" replace this parenthetical with the release number)
<ide> public void assertNoTerminalEvent() {
<ide> }
<ide>
<ide> /**
<del> * Assert if there are no onNext events received.
<add> * Asserts that there are no onNext events received.
<ide> *
<ide> * @throws AssertionError if there were any onNext events
<ide> * @since (if this graduates from "Experimental" replace this parenthetical with the release number)
<ide> public void assertNoValues() {
<ide> }
<ide>
<ide> /**
<del> * Assert if the given number of onNext events are received.
<add> * Asserts that the given number of onNext events are received.
<ide> *
<ide> * @param count the expected number of onNext events
<ide> * @throws AssertionError if there were more or fewer onNext events than specified by {@code count}
<ide> public void assertValueCount(int count) {
<ide> }
<ide>
<ide> /**
<del> * Assert if the received onNext events, in order, are the specified items.
<add> * Asserts that the received onNext events, in order, are the specified items.
<ide> *
<ide> * @param values the items to check
<ide> * @throws AssertionError if the items emitted do not exactly match those specified by {@code values}
<ide> public void assertValues(T... values) {
<ide> }
<ide>
<ide> /**
<del> * Assert if there is only a single received onNext event and that it marks the emission of a specific item.
<add> * Asserts that there is only a single received onNext event and that it marks the emission of a specific item.
<ide> *
<ide> * @param value the item to check
<ide> * @throws AssertionError if the Observable does not emit only the single item specified by {@code value} | 1 |
Ruby | Ruby | handle referenced cask in livecheck | 77273fe2b3b56ab84dce4d03b47b1129c949e19e | <ide><path>Library/Homebrew/cask/audit.rb
<ide> def check_download
<ide> def check_livecheck_version
<ide> return unless appcast?
<ide>
<add> referenced_cask, = Homebrew::Livecheck.resolve_livecheck_reference(cask)
<add>
<add> # Respect skip conditions for a referenced cask
<add> if referenced_cask
<add> skip_info = Homebrew::Livecheck::SkipConditions.referenced_skip_information(
<add> referenced_cask,
<add> Homebrew::Livecheck.cask_name(cask),
<add> )
<add> end
<add>
<ide> # Respect cask skip conditions (e.g. discontinued, latest, unversioned)
<del> skip_info = Homebrew::Livecheck::SkipConditions.skip_information(cask)
<add> skip_info ||= Homebrew::Livecheck::SkipConditions.skip_information(cask)
<ide> return :skip if skip_info.present?
<ide>
<del> latest_version = Homebrew::Livecheck.latest_version(cask)&.fetch(:latest)
<add> latest_version = Homebrew::Livecheck.latest_version(
<add> cask,
<add> referenced_formula_or_cask: referenced_cask,
<add> )&.fetch(:latest)
<ide> if cask.version.to_s == latest_version.to_s
<ide> if cask.appcast
<ide> add_error "Version '#{latest_version}' was automatically detected by livecheck; " \
<ide><path>Library/Homebrew/test/cask/audit_spec.rb
<ide> def tmp_cask(name, text)
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<add> context "when the Cask has a livecheck block referencing a Cask using skip" do
<add> let(:cask_token) { "livecheck/livecheck-skip-reference" }
<add>
<add> it { is_expected.not_to fail_with(message) }
<add> end
<add>
<ide> context "when the Cask is discontinued" do
<ide> let(:cask_token) { "livecheck/discontinued" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<add> context "when the Cask has a livecheck block referencing a discontinued Cask" do
<add> let(:cask_token) { "livecheck/discontinued-reference" }
<add>
<add> it { is_expected.not_to fail_with(message) }
<add> end
<add>
<ide> context "when version is :latest" do
<ide> let(:cask_token) { "livecheck/version-latest" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<ide>
<add> context "when the Cask has a livecheck block referencing a Cask where version is :latest" do
<add> let(:cask_token) { "livecheck/version-latest-reference" }
<add>
<add> it { is_expected.not_to fail_with(message) }
<add> end
<add>
<ide> context "when url is unversioned" do
<ide> let(:cask_token) { "livecheck/url-unversioned" }
<ide>
<ide> it { is_expected.not_to fail_with(message) }
<ide> end
<add>
<add> context "when the Cask has a livecheck block referencing a Cask with an unversioned url" do
<add> let(:cask_token) { "livecheck/url-unversioned-reference" }
<add>
<add> it { is_expected.not_to fail_with(message) }
<add> end
<ide> end
<ide>
<ide> describe "when the Cask stanza requires uninstall" do
<ide><path>Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/discontinued-reference.rb
<add>cask "discontinued-reference" do
<add> version "1.2.3"
<add> sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
<add>
<add> # This cask is used in --online tests, so we use fake URLs to avoid impacting
<add> # real servers. The URL paths are specific enough that they'll be
<add> # understandable if they appear in local server logs.
<add> url "http://localhost/homebrew/test/cask/audit/livecheck/discontinued-#{version}.dmg"
<add> name "Discontinued Reference"
<add> desc "Cask for testing a livecheck reference to a discontinued cask"
<add> homepage "http://localhost/homebrew/test/cask/audit/livecheck/discontinued"
<add>
<add> livecheck do
<add> cask "livecheck/discontinued"
<add> end
<add>
<add> app "TestCask.app"
<add>end
<ide><path>Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-skip-reference.rb
<add>cask "livecheck-skip-reference" do
<add> version "1.2.3"
<add> sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
<add>
<add> # This cask is used in --online tests, so we use fake URLs to avoid impacting
<add> # real servers. The URL paths are specific enough that they'll be
<add> # understandable if they appear in local server logs.
<add> url "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip-#{version}.dmg"
<add> name "Skip Reference"
<add> desc "Cask for testing a livecheck reference to a cask with a #skip livecheck block"
<add> homepage "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip"
<add>
<add> livecheck do
<add> cask "livecheck/livecheck-skip"
<add> end
<add>
<add> app "TestCask.app"
<add>end
<ide><path>Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/url-unversioned-reference.rb
<add>cask "url-unversioned-reference" do
<add> version "1.2.3"
<add> sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
<add>
<add> # This cask is used in --online tests, so we use fake URLs to avoid impacting
<add> # real servers. The URL paths are specific enough that they'll be
<add> # understandable if they appear in local server logs.
<add> url "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned.dmg"
<add> name "Unversioned URL Reference"
<add> desc "Cask for testing a livecheck reference to a cask with an unversioned URL"
<add> homepage "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned"
<add>
<add> livecheck do
<add> cask "livecheck/url-unversioned"
<add> end
<add>
<add> app "TestCask.app"
<add>end
<ide><path>Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/version-latest-reference.rb
<add>cask "version-latest-reference" do
<add> version :latest
<add> sha256 :no_check
<add>
<add> # This cask is used in --online tests, so we use fake URLs to avoid impacting
<add> # real servers. The URL paths are specific enough that they'll be
<add> # understandable if they appear in local server logs.
<add> url "http://localhost/homebrew/test/cask/audit/livecheck/version-latest.dmg"
<add> name "Version Latest Reference"
<add> desc "Cask for testing a livecheck reference to a cask where version is :latest"
<add> homepage "http://localhost/homebrew/test/cask/audit/livecheck/version-latest"
<add>
<add> livecheck do
<add> cask "livecheck/version-latest"
<add> end
<add>
<add> app "TestCask.app"
<add>end | 6 |
Ruby | Ruby | fix autoload tests | 1bf522084c5289b05904beeebbe9f00c6c8d534d | <ide><path>activesupport/test/autoload_test.rb
<ide> module Autoload
<ide> end
<ide> end
<ide>
<add> def setup
<add> @some_class_path = File.expand_path("test/fixtures/autoload/some_class.rb")
<add> @another_class_path = File.expand_path("test/fixtures/autoload/another_class.rb")
<add> end
<add>
<ide> test "the autoload module works like normal autoload" do
<ide> module ::Fixtures::Autoload
<ide> autoload :SomeClass, "fixtures/autoload/some_class"
<ide> module ::Fixtures::Autoload
<ide>
<ide> test "when specifying an :eager constant it still works like normal autoload by default" do
<ide> module ::Fixtures::Autoload
<del> autoload :SomeClass, "fixtures/autoload/some_class"
<add> eager_autoload do
<add> autoload :SomeClass, "fixtures/autoload/some_class"
<add> end
<ide> end
<ide>
<del> assert !$LOADED_FEATURES.include?("fixtures/autoload/some_class.rb")
<add> assert !$LOADED_FEATURES.include?(@some_class_path)
<ide> assert_nothing_raised { ::Fixtures::Autoload::SomeClass }
<ide> end
<ide>
<ide> module ::Fixtures::Autoload
<ide> autoload :SomeClass
<ide> end
<ide>
<del> assert !$LOADED_FEATURES.include?("fixtures/autoload/some_class.rb")
<add> assert !$LOADED_FEATURES.include?(@some_class_path)
<ide> assert_nothing_raised { ::Fixtures::Autoload::SomeClass }
<ide> end
<ide>
<ide> test "the location of :eager autoloaded constants defaults to :name.underscore" do
<ide> module ::Fixtures::Autoload
<del> autoload :SomeClass
<add> eager_autoload do
<add> autoload :SomeClass
<add> end
<ide> end
<ide>
<add> assert !$LOADED_FEATURES.include?(@some_class_path)
<ide> ::Fixtures::Autoload.eager_load!
<add> assert $LOADED_FEATURES.include?(@some_class_path)
<ide> assert_nothing_raised { ::Fixtures::Autoload::SomeClass }
<ide> end
<ide>
<ide> module ::Fixtures
<ide> end
<ide> end
<ide>
<del> assert !$LOADED_FEATURES.include?("fixtures/autoload/another_class.rb")
<add> assert !$LOADED_FEATURES.include?(@another_class_path)
<ide> assert_nothing_raised { ::Fixtures::AnotherClass }
<ide> end
<ide>
<ide> module ::Fixtures
<ide> end
<ide> end
<ide>
<del> assert !$LOADED_FEATURES.include?("fixtures/autoload/another_class.rb")
<add> assert !$LOADED_FEATURES.include?(@another_class_path)
<ide> assert_nothing_raised { ::Fixtures::AnotherClass }
<ide> end
<ide> end
<ide>\ No newline at end of file | 1 |
Javascript | Javascript | update other remote test urls as well | 83a97f5c21a3c8c063e05f0df40efe13069c82f2 | <ide><path>test/unit/ajax.js
<ide> test("jQuery.ajax() - JSONP, Remote", function() {
<ide> test("jQuery.ajax() - script, Remote", function() {
<ide> expect(2);
<ide>
<del> var base = window.location.href.replace(/\?.*$/, "");
<add> var base = window.location.href.replace(/[^\/]*$/, "");
<ide>
<ide> stop();
<ide>
<ide> test("jQuery.ajax() - script, Remote", function() {
<ide> test("jQuery.ajax() - script, Remote with POST", function() {
<ide> expect(3);
<ide>
<del> var base = window.location.href.replace(/\?.*$/, "");
<add> var base = window.location.href.replace(/[^\/]*$/, "");
<ide>
<ide> stop();
<ide>
<ide> test("jQuery.ajax() - script, Remote with POST", function() {
<ide> test("jQuery.ajax() - script, Remote with scheme-less URL", function() {
<ide> expect(2);
<ide>
<del> var base = window.location.href.replace(/\?.*$/, "");
<add> var base = window.location.href.replace(/[^\/]*$/, "");
<ide> base = base.replace(/^.*?\/\//, "//");
<ide>
<ide> stop();
<ide> test("jQuery.getJSON - Using Native JSON", function() {
<ide> test("jQuery.getJSON(String, Function) - JSON object with absolute url to local content", function() {
<ide> expect(2);
<ide>
<del> var base = window.location.href.replace(/\?.*$/, "");
<add> var base = window.location.href.replace(/[^\/]*$/, "");
<ide>
<ide> stop();
<ide> jQuery.getJSON(url(base + "data/json.php"), function(json) { | 1 |
Python | Python | move string cleanup under a setting flag | 8fec7268eb7cbd8e3c0374fee7dc2101336ce5cb | <ide><path>spacy/language.py
<ide> def pipe(self, texts, as_tuples=False, n_threads=2, batch_size=1000,
<ide> # in the string store.
<ide> recent_refs = weakref.WeakSet()
<ide> old_refs = weakref.WeakSet()
<del> # If there is anything that we have inside — after iterations we should
<del> # carefully get it back.
<del> original_strings_data = list(self.vocab.strings)
<add> # Keep track of the original string data, so that if we flush old strings,
<add> # we can recover the original ones. However, we only want to do this if we're
<add> # really adding strings, to save up-front costs.
<add> original_strings_data = None
<ide> nr_seen = 0
<ide> for doc in docs:
<ide> yield doc
<del> recent_refs.add(doc)
<del> if nr_seen < 10000:
<del> old_refs.add(doc)
<del> nr_seen += 1
<del> elif len(old_refs) == 0:
<del> old_refs, recent_refs = recent_refs, old_refs
<del> keys, strings = self.vocab.strings._cleanup_stale_strings(original_strings_data)
<del> self.vocab._reset_cache(keys, strings)
<del> self.tokenizer._reset_cache(keys)
<del> nr_seen = 0
<add> if cleanup:
<add> recent_refs.add(doc)
<add> if nr_seen < 10000:
<add> old_refs.add(doc)
<add> nr_seen += 1
<add> elif len(old_refs) == 0:
<add> old_refs, recent_refs = recent_refs, old_refs
<add> if original_strings_data is None:
<add> original_strings_data = list(self.vocab.strings)
<add> else:
<add> keys, strings = self.vocab.strings._cleanup_stale_strings(original_strings_data)
<add> self.vocab._reset_cache(keys, strings)
<add> self.tokenizer._reset_cache(keys)
<add> nr_seen = 0
<ide>
<ide> def to_disk(self, path, disable=tuple()):
<ide> """Save the current state to a directory. If a model is loaded, this | 1 |
PHP | PHP | add other test | 2f5a4ccf7834c82c465767fc6fcbf8e7b8278b61 | <ide><path>tests/Database/DatabaseEloquentBuilderTest.php
<ide> public function testHasWithContraintsAndHavingInSubquery()
<ide> $this->assertEquals(['baz', 'qux', 'quuux'], $builder->getBindings());
<ide> }
<ide>
<add> public function testHasWithContraintsAndJoinAndHavingInSubquery()
<add> {
<add> $model = new EloquentBuilderTestModelParentStub;
<add> $builder = $model->where('bar', 'baz');
<add> $builder->whereHas('foo', function ($q) {
<add> $q->join('quuuux', function ($j) {
<add> $j->on('quuuuux', '=', 'quuuuuux', 'and', true);
<add> });
<add> $q->having('bam', '>', 'qux');
<add> })->where('quux', 'quuux');
<add>
<add> $this->assertEquals('select * from "eloquent_builder_test_model_parent_stubs" where "bar" = ? and (select count(*) from "eloquent_builder_test_model_close_related_stubs" inner join "quuuux" on "quuuuux" = ? where "eloquent_builder_test_model_parent_stubs"."foo_id" = "eloquent_builder_test_model_close_related_stubs"."id" having "bam" > ?) >= 1 and "quux" = ?', $builder->toSql());
<add> $this->assertEquals(['baz', 'quuuuuux', 'qux', 'quuux'], $builder->getBindings());
<add> }
<add>
<ide> public function testHasNestedWithConstraints()
<ide> {
<ide> $model = new EloquentBuilderTestModelParentStub; | 1 |
Javascript | Javascript | add primordials to arguments comment | e1b90be3b7c687fcf263db72862b6a199d239f89 | <ide><path>lib/internal/bootstrap/node.js
<ide>
<ide> // This file is compiled as if it's wrapped in a function with arguments
<ide> // passed by node::RunBootstrapping()
<del>/* global process, require, internalBinding */
<add>/* global process, require, internalBinding, primordials */
<ide>
<ide> setupPrepareStackTrace();
<ide> | 1 |
Ruby | Ruby | remove lonely number sign | 93bcb0c268c6df0cd6e14a7c880897ef7fa42df1 | <ide><path>railties/test/generators/namespaced_generators_test.rb
<ide> def test_routes_should_not_be_namespaced
<ide> run_generator
<ide> assert_file "config/routes.rb", /get "account\/foo"/, /get "account\/bar"/
<ide> end
<del>#
<add>
<ide> def test_invokes_default_template_engine_even_with_no_action
<ide> run_generator ["account"]
<ide> assert_file "app/views/test_app/account" | 1 |
PHP | PHP | fix lint error on testemail in emailtest.php | 14fb128d17fd9086ff3724b7f9cbab66690512de | <ide><path>tests/TestCase/Mailer/EmailTest.php
<ide> public function getContentTransferEncoding()
<ide> {
<ide> return $this->_getContentTransferEncoding();
<ide> }
<del>
<ide> }
<ide>
<ide> /** | 1 |
PHP | PHP | return $this instead of void | a446bf91df53aa62abf4174c7f19317354cdc58f | <ide><path>src/ORM/Locator/TableLocator.php
<ide> public function __construct(?array $locations = null)
<ide> * Set if fallback class should be used.
<ide> *
<ide> * @param bool $enable Flag to enable or disable fallback
<del> * @return void
<add> * @return $this
<ide> */
<del> public function useFallbackClass(bool $enable): void
<add> public function useFallbackClass(bool $enable)
<ide> {
<ide> $this->useFallbackClass = $enable;
<add>
<add> return $this;
<ide> }
<ide>
<ide> /**
<ide><path>tests/TestCase/ORM/Association/BelongsToManyTest.php
<ide> public function testFallbackClassForJunction()
<ide> 'sourceTable' => $this->article,
<ide> 'targetTable' => $this->tag,
<ide> ]);
<del> $tableLocator = new TableLocator();
<del> $tableLocator->useFallbackClass(false);
<del> $assoc->setTableLocator($tableLocator);
<add> $assoc->setTableLocator((new TableLocator())->useFallbackClass(false));
<ide> $junction = $assoc->junction();
<ide> $this->assertInstanceOf(Table::class, $junction);
<ide> } | 2 |
Python | Python | allow more recursion depth for scalar tests | a100272b6f8cbfad2b18dfd638a0fb2bf51563d6 | <ide><path>numpy/core/tests/test_scalarmath.py
<ide> def recursionlimit(n):
<ide> @settings(verbosity=Verbosity.verbose)
<ide> def test_operator_object_left(o, op, type_):
<ide> try:
<del> with recursionlimit(100):
<add> with recursionlimit(200):
<ide> op(o, type_(1))
<ide> except TypeError:
<ide> pass
<ide> def test_operator_object_left(o, op, type_):
<ide> sampled_from(types))
<ide> def test_operator_object_right(o, op, type_):
<ide> try:
<del> with recursionlimit(100):
<add> with recursionlimit(200):
<ide> op(type_(1), o)
<ide> except TypeError:
<ide> pass | 1 |
PHP | PHP | fix weird wording | 3f223fba974bf56551d576618109ec50429fe0b2 | <ide><path>src/Illuminate/Database/Console/Migrations/StatusCommand.php
<ide> class StatusCommand extends BaseCommand {
<ide> *
<ide> * @var string
<ide> */
<del> protected $description = 'Show a list of migrations up/down';
<add> protected $description = 'Show the status of each migration';
<ide>
<ide> /**
<ide> * The migrator instance. | 1 |
PHP | PHP | allow cell name containing "cell" | 0bcd72c3b73e719fd2d1f904273dc015968a9417 | <ide><path>src/View/Cell.php
<ide> public function render($template = null)
<ide> $render = function () use ($template) {
<ide> $className = explode('\\', get_class($this));
<ide> $className = array_pop($className);
<del> $name = substr($className, 0, strpos($className, 'Cell'));
<add> $name = substr($className, 0, strrpos($className, 'Cell'));
<ide> $this->View->subDir = 'Cell' . DS . $name;
<ide>
<ide> try { | 1 |
Go | Go | remove pre-defined networks from package init | 22801e071f071e82b663347107b70ed9a68b37ae | <ide><path>libnetwork/drivers/bridge/bridge_test.go
<ide> import (
<ide> "github.com/docker/libnetwork/types"
<ide> )
<ide>
<add>func init() {
<add> ipamutils.InitNetworks()
<add>}
<add>
<ide> func getIPv4Data(t *testing.T) []driverapi.IPAMData {
<ide> ipd := driverapi.IPAMData{AddressSpace: "full"}
<ide> nw, _, err := ipamutils.ElectInterfaceAddresses("")
<ide><path>libnetwork/ipam/allocator_test.go
<ide> func randomLocalStore() (datastore.DataStore, error) {
<ide> }
<ide>
<ide> func getAllocator() (*Allocator, error) {
<add> ipamutils.InitNetworks()
<ide> ds, err := randomLocalStore()
<ide> if err != nil {
<ide> return nil, err
<ide><path>libnetwork/ipams/builtin/builtin_unix.go
<ide> import (
<ide> "github.com/docker/libnetwork/datastore"
<ide> "github.com/docker/libnetwork/ipam"
<ide> "github.com/docker/libnetwork/ipamapi"
<add> "github.com/docker/libnetwork/ipamutils"
<ide> )
<ide>
<ide> // Init registers the built-in ipam service with libnetwork
<ide> func Init(ic ipamapi.Callback, l, g interface{}) error {
<ide> return fmt.Errorf("incorrect global datastore passed to built-in ipam init")
<ide> }
<ide> }
<add>
<add> ipamutils.InitNetworks()
<add>
<ide> a, err := ipam.NewAllocator(localDs, globalDs)
<ide> if err != nil {
<ide> return err
<ide><path>libnetwork/ipamutils/utils.go
<ide> // Package ipamutils provides utililty functions for ipam management
<ide> package ipamutils
<ide>
<del>import "net"
<add>import (
<add> "net"
<add> "sync"
<add>)
<ide>
<ide> var (
<ide> // PredefinedBroadNetworks contains a list of 31 IPv4 private networks with host size 16 and 12
<ide> var (
<ide> // PredefinedGranularNetworks contains a list of 64K IPv4 private networks with host size 8
<ide> // (10.x.x.x/24) which do not overlap with the networks in `PredefinedBroadNetworks`
<ide> PredefinedGranularNetworks []*net.IPNet
<add>
<add> initNetworksOnce sync.Once
<ide> )
<ide>
<del>func init() {
<del> PredefinedBroadNetworks = initBroadPredefinedNetworks()
<del> PredefinedGranularNetworks = initGranularPredefinedNetworks()
<add>// InitNetworks initializes the pre-defined networks used by the built-in IP allocator
<add>func InitNetworks() {
<add> initNetworksOnce.Do(func() {
<add> PredefinedBroadNetworks = initBroadPredefinedNetworks()
<add> PredefinedGranularNetworks = initGranularPredefinedNetworks()
<add> })
<ide> }
<ide>
<ide> func initBroadPredefinedNetworks() []*net.IPNet {
<ide><path>libnetwork/ipamutils/utils_linux.go
<ide> func ElectInterfaceAddresses(name string) (*net.IPNet, []*net.IPNet, error) {
<ide> err error
<ide> )
<ide>
<add> InitNetworks()
<add>
<ide> defer osl.InitOSContext()()
<ide>
<ide> link, _ := netlink.LinkByName(name)
<ide><path>libnetwork/ipamutils/utils_test.go
<ide> import (
<ide> "github.com/vishvananda/netlink"
<ide> )
<ide>
<add>func init() {
<add> InitNetworks()
<add>}
<add>
<ide> func TestGranularPredefined(t *testing.T) {
<ide> for _, nw := range PredefinedGranularNetworks {
<ide> if ones, bits := nw.Mask.Size(); bits != 32 || ones != 24 { | 6 |
Python | Python | remove surviving, unused, list comprehension | fe3412fde8990ff08405f3324d309e521aff1d7d | <ide><path>numpy/polynomial/_polybase.py
<ide> def _repr_latex_(self):
<ide> )
<ide> needs_parens = True
<ide>
<del> # filter out uninteresting coefficients
<del> filtered_coeffs = [
<del> (i, c)
<del> for i, c in enumerate(self.coef)
<del> # if not (c == 0) # handle NaN
<del> ]
<del>
<ide> mute = r"\color{{LightGray}}{{{}}}".format
<ide>
<ide> parts = [] | 1 |
Javascript | Javascript | simplify spawn argument parsing | 4f9cd2770a5f04b4e83157c71a3a9f1bf5b42d84 | <ide><path>lib/child_process.js
<ide> function normalizeSpawnArguments(file, args, options) {
<ide> }
<ide>
<ide> // Validate windowsVerbatimArguments, if present.
<del> if (options.windowsVerbatimArguments != null &&
<del> typeof options.windowsVerbatimArguments !== 'boolean') {
<add> let { windowsVerbatimArguments } = options;
<add> if (windowsVerbatimArguments != null &&
<add> typeof windowsVerbatimArguments !== 'boolean') {
<ide> throw new ERR_INVALID_ARG_TYPE('options.windowsVerbatimArguments',
<ide> 'boolean',
<del> options.windowsVerbatimArguments);
<add> windowsVerbatimArguments);
<ide> }
<ide>
<del> // Make a shallow copy so we don't clobber the user's options object.
<del> options = { ...options };
<del>
<ide> if (options.shell) {
<ide> const command = [file].concat(args).join(' ');
<ide> // Set the shell, switches, and commands.
<ide> function normalizeSpawnArguments(file, args, options) {
<ide> // '/d /s /c' is used only for cmd.exe.
<ide> if (/^(?:.*\\)?cmd(?:\.exe)?$/i.test(file)) {
<ide> args = ['/d', '/s', '/c', `"${command}"`];
<del> options.windowsVerbatimArguments = true;
<add> windowsVerbatimArguments = true;
<ide> } else {
<ide> args = ['-c', command];
<ide> }
<ide> function normalizeSpawnArguments(file, args, options) {
<ide> }
<ide>
<ide> return {
<del> file: file,
<del> args: args,
<del> options: options,
<del> envPairs: envPairs
<add> // Make a shallow copy so we don't clobber the user's options object.
<add> ...options,
<add> args,
<add> detached: !!options.detached,
<add> envPairs,
<add> file,
<add> windowsHide: !!options.windowsHide,
<add> windowsVerbatimArguments: !!windowsVerbatimArguments
<ide> };
<ide> }
<ide>
<ide>
<ide> var spawn = exports.spawn = function spawn(file, args, options) {
<del> const opts = normalizeSpawnArguments(file, args, options);
<ide> const child = new ChildProcess();
<ide>
<del> options = opts.options;
<del> debug('spawn', opts.args, options);
<del>
<del> child.spawn({
<del> file: opts.file,
<del> args: opts.args,
<del> cwd: options.cwd,
<del> windowsHide: !!options.windowsHide,
<del> windowsVerbatimArguments: !!options.windowsVerbatimArguments,
<del> detached: !!options.detached,
<del> envPairs: opts.envPairs,
<del> stdio: options.stdio,
<del> uid: options.uid,
<del> gid: options.gid
<del> });
<add> options = normalizeSpawnArguments(file, args, options);
<add> debug('spawn', options);
<add> child.spawn(options);
<ide>
<ide> return child;
<ide> };
<ide>
<ide> function spawnSync(file, args, options) {
<del> const opts = normalizeSpawnArguments(file, args, options);
<del>
<del> const defaults = {
<add> options = {
<ide> maxBuffer: MAX_BUFFER,
<del> ...opts.options
<add> ...normalizeSpawnArguments(file, args, options)
<ide> };
<del> options = opts.options = defaults;
<ide>
<del> debug('spawnSync', opts.args, options);
<add> debug('spawnSync', options);
<ide>
<ide> // Validate the timeout, if present.
<ide> validateTimeout(options.timeout);
<ide>
<ide> // Validate maxBuffer, if present.
<ide> validateMaxBuffer(options.maxBuffer);
<ide>
<del> options.file = opts.file;
<del> options.args = opts.args;
<del> options.envPairs = opts.envPairs;
<del>
<ide> // Validate and translate the kill signal, if present.
<ide> options.killSignal = sanitizeKillSignal(options.killSignal);
<ide>
<ide> function spawnSync(file, args, options) {
<ide> }
<ide> }
<ide>
<del> return child_process.spawnSync(opts);
<add> return child_process.spawnSync(options);
<ide> }
<ide> exports.spawnSync = spawnSync;
<ide>
<ide> function checkExecSyncError(ret, args, cmd) {
<ide>
<ide>
<ide> function execFileSync(command, args, options) {
<del> const opts = normalizeSpawnArguments(command, args, options);
<del> const inheritStderr = !opts.options.stdio;
<add> options = normalizeSpawnArguments(command, args, options);
<ide>
<del> const ret = spawnSync(opts.file, opts.args.slice(1), opts.options);
<add> const inheritStderr = !options.stdio;
<add> const ret = spawnSync(options.file, options.args.slice(1), options);
<ide>
<ide> if (inheritStderr && ret.stderr)
<ide> process.stderr.write(ret.stderr);
<ide>
<del> const err = checkExecSyncError(ret, opts.args, undefined);
<add> const err = checkExecSyncError(ret, options.args, undefined);
<ide>
<ide> if (err)
<ide> throw err;
<ide><path>lib/internal/child_process.js
<ide> function maybeClose(subprocess) {
<ide> }
<ide> }
<ide>
<del>function spawnSync(opts) {
<del> const options = opts.options;
<add>function spawnSync(options) {
<ide> const result = spawn_sync.spawn(options);
<ide>
<ide> if (result.output && options.encoding && options.encoding !== 'buffer') {
<ide> function spawnSync(opts) {
<ide> result.stderr = result.output && result.output[2];
<ide>
<ide> if (result.error) {
<del> result.error = errnoException(result.error, 'spawnSync ' + opts.file);
<del> result.error.path = opts.file;
<del> result.error.spawnargs = opts.args.slice(1);
<add> result.error = errnoException(result.error, 'spawnSync ' + options.file);
<add> result.error.path = options.file;
<add> result.error.spawnargs = options.args.slice(1);
<ide> }
<ide>
<ide> return result;
<ide><path>test/parallel/test-child-process-spawnsync-kill-signal.js
<ide> if (process.argv[2] === 'child') {
<ide> // Verify that the default kill signal is SIGTERM.
<ide> {
<ide> const child = spawn(undefined, (opts) => {
<del> assert.strictEqual(opts.options.killSignal, undefined);
<add> assert.strictEqual(opts.killSignal, undefined);
<ide> });
<ide>
<ide> assert.strictEqual(child.signal, 'SIGTERM');
<ide> if (process.argv[2] === 'child') {
<ide> // Verify that a string signal name is handled properly.
<ide> {
<ide> const child = spawn('SIGKILL', (opts) => {
<del> assert.strictEqual(opts.options.killSignal, SIGKILL);
<add> assert.strictEqual(opts.killSignal, SIGKILL);
<ide> });
<ide>
<ide> assert.strictEqual(child.signal, 'SIGKILL');
<ide> if (process.argv[2] === 'child') {
<ide> assert.strictEqual(typeof SIGKILL, 'number');
<ide>
<ide> const child = spawn(SIGKILL, (opts) => {
<del> assert.strictEqual(opts.options.killSignal, SIGKILL);
<add> assert.strictEqual(opts.killSignal, SIGKILL);
<ide> });
<ide>
<ide> assert.strictEqual(child.signal, 'SIGKILL');
<ide><path>test/parallel/test-child-process-spawnsync-shell.js
<ide> assert.strictEqual(env.stdout.toString().trim(), 'buzz');
<ide> assert.strictEqual(opts.file, shellOutput);
<ide> assert.deepStrictEqual(opts.args,
<ide> [shellOutput, ...shellFlags, outputCmd]);
<del> assert.strictEqual(opts.options.shell, shell);
<del> assert.strictEqual(opts.options.file, opts.file);
<del> assert.deepStrictEqual(opts.options.args, opts.args);
<del> assert.strictEqual(opts.options.windowsHide, undefined);
<del> assert.strictEqual(opts.options.windowsVerbatimArguments,
<del> windowsVerbatim);
<add> assert.strictEqual(opts.shell, shell);
<add> assert.strictEqual(opts.file, opts.file);
<add> assert.deepStrictEqual(opts.args, opts.args);
<add> assert.strictEqual(opts.windowsHide, false);
<add> assert.strictEqual(opts.windowsVerbatimArguments,
<add> !!windowsVerbatim);
<ide> });
<ide> cp.spawnSync(cmd, { shell });
<ide> internalCp.spawnSync = oldSpawnSync;
<ide><path>test/parallel/test-child-process-windows-hide.js
<ide> internalCp.ChildProcess.prototype.spawn = common.mustCall(function(options) {
<ide> }, 2);
<ide>
<ide> internalCp.spawnSync = common.mustCall(function(options) {
<del> assert.strictEqual(options.options.windowsHide, true);
<add> assert.strictEqual(options.windowsHide, true);
<ide> return originalSpawnSync.apply(this, arguments);
<ide> });
<ide> | 5 |
Ruby | Ruby | add stub for configuring your package manager | e13d232150921cdf0ec3d713caefa628d235152e | <ide><path>railties/lib/rails/generators/rails/app/app_generator.rb
<del>require 'digest/md5'
<add>require 'digest/md5'
<ide> require 'active_support/secure_random'
<ide> require 'rails/version' unless defined?(Rails::VERSION)
<ide>
<ide> def create_config_files
<ide> end
<ide> end
<ide>
<add> def create_boot_file
<add> copy_file "config/boot.rb"
<add> end
<add>
<ide> def create_activerecord_files
<ide> return if options[:skip_activerecord]
<ide> template "config/databases/#{options[:database]}.yml", "config/database.yml"
<ide><path>railties/lib/rails/generators/rails/app/templates/config/application.rb
<del>begin
<del> # Use Bundler
<del> require File.expand_path("../../vendor/gems/environment", __FILE__)
<del>rescue LoadError
<del> # Use Rubygems
<del> require 'rubygems'
<del>end
<del>
<del>require 'rails'
<add>require File.expand_path(File.join(File.dirname(__FILE__), 'boot'))
<ide>
<ide> Rails::Initializer.run do |config|
<ide> # Settings in config/environments/* take precedence over those specified here.
<ide> # g.template_engine :erb
<ide> # g.test_framework :test_unit, :fixture => true
<ide> # end
<del>end
<ide>\ No newline at end of file
<add>end
<ide><path>railties/lib/rails/generators/rails/app/templates/config/boot.rb
<add># Package management
<add># Choose one
<add>
<add># Use Bundler (preferred)
<add>environment = File.expand_path('../../vendor/gems/environment', __FILE__)
<add>require environment if File.exist?(environment)
<add>
<add># Use 2.x style vendor/rails directory
<add>vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
<add>Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } if File.exist?(vendor_rails)
<add>
<add># Load Rails from traditional RubyGems
<add>require 'rubygems'
<add>
<add>require 'rails'
<ide><path>railties/lib/rails/generators/rails/app/templates/config/environment.rb
<del># Be sure to restart your server when you modify this file
<del>
<del># Specifies gem version of Rails to use when vendor/rails is not present
<del><%= '# ' if options[:freeze] %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>' unless defined? RAILS_GEM_VERSION
<del>
<ide> # Load the rails application
<ide> require File.expand_path(File.join(File.dirname(__FILE__), 'application'))
<add>
<ide> # Initialize the rails application
<ide> Rails.initialize! | 4 |
Go | Go | add logdrivers to executor from swarmkit | 8a50315f3ce89b24e3556dba288b2ce7b4daf026 | <ide><path>daemon/cluster/executor/container/container.go
<ide> func getMountMask(m *api.Mount) string {
<ide> }
<ide>
<ide> func (c *containerConfig) hostConfig() *enginecontainer.HostConfig {
<del> return &enginecontainer.HostConfig{
<add> hc := &enginecontainer.HostConfig{
<ide> Resources: c.resources(),
<ide> Binds: c.binds(),
<ide> Tmpfs: c.tmpfs(),
<ide> }
<add>
<add> if c.task.LogDriver != nil {
<add> hc.LogConfig = enginecontainer.LogConfig{
<add> Type: c.task.LogDriver.Name,
<add> Config: c.task.LogDriver.Options,
<add> }
<add> }
<add>
<add> return hc
<ide> }
<ide>
<ide> // This handles the case of volumes that are defined inside a service Mount | 1 |
PHP | PHP | fix unused imports | 9835a8b9c4478313914f70e5aafebb4bbda5b3e1 | <ide><path>src/Controller/ErrorController.php
<ide> namespace Cake\Controller;
<ide>
<ide> use Cake\Event\EventInterface;
<del>use Cake\Http\Response;
<ide>
<ide> /**
<ide> * Error Handling Controller
<ide><path>tests/test_app/TestApp/Controller/Admin/ErrorController.php
<ide>
<ide> use Cake\Controller\Controller;
<ide> use Cake\Event\EventInterface;
<del>use Cake\Http\Response;
<ide>
<ide> /**
<ide> * Error Handling Controller
<ide><path>tests/test_app/TestApp/Controller/PostsController.php
<ide>
<ide> use Cake\Event\EventInterface;
<ide> use Cake\Http\Cookie\Cookie;
<del>use Cake\Http\Response;
<ide>
<ide> /**
<ide> * PostsController class | 3 |
Go | Go | remove engine usage for events | c9eb37f9752d72d9a4280d703368e5e73adfffa1 | <ide><path>api/server/server.go
<ide> package server
<ide> import (
<ide> "bufio"
<ide> "bytes"
<add> "time"
<ide>
<ide> "encoding/base64"
<ide> "encoding/json"
<ide> import (
<ide> "github.com/docker/docker/daemon"
<ide> "github.com/docker/docker/daemon/networkdriver/bridge"
<ide> "github.com/docker/docker/engine"
<add> "github.com/docker/docker/pkg/jsonmessage"
<ide> "github.com/docker/docker/pkg/parsers"
<add> "github.com/docker/docker/pkg/parsers/filters"
<ide> "github.com/docker/docker/pkg/stdcopy"
<ide> "github.com/docker/docker/pkg/streamformatter"
<ide> "github.com/docker/docker/pkg/version"
<ide> func getEvents(eng *engine.Engine, version version.Version, w http.ResponseWrite
<ide> if err := parseForm(r); err != nil {
<ide> return err
<ide> }
<add> var since int64 = -1
<add> if r.Form.Get("since") != "" {
<add> s, err := strconv.ParseInt(r.Form.Get("since"), 10, 64)
<add> if err != nil {
<add> return err
<add> }
<add> since = s
<add> }
<ide>
<del> var job = eng.Job("events")
<del> streamJSON(job, w, true)
<del> job.Setenv("since", r.Form.Get("since"))
<del> job.Setenv("until", r.Form.Get("until"))
<del> job.Setenv("filters", r.Form.Get("filters"))
<del> return job.Run()
<add> var until int64 = -1
<add> if r.Form.Get("until") != "" {
<add> u, err := strconv.ParseInt(r.Form.Get("until"), 10, 64)
<add> if err != nil {
<add> return err
<add> }
<add> until = u
<add> }
<add> timer := time.NewTimer(0)
<add> timer.Stop()
<add> if until > 0 {
<add> dur := time.Unix(until, 0).Sub(time.Now())
<add> timer = time.NewTimer(dur)
<add> }
<add>
<add> ef, err := filters.FromParam(r.Form.Get("filters"))
<add> if err != nil {
<add> return err
<add> }
<add>
<add> isFiltered := func(field string, filter []string) bool {
<add> if len(filter) == 0 {
<add> return false
<add> }
<add> for _, v := range filter {
<add> if v == field {
<add> return false
<add> }
<add> if strings.Contains(field, ":") {
<add> image := strings.Split(field, ":")
<add> if image[0] == v {
<add> return false
<add> }
<add> }
<add> }
<add> return true
<add> }
<add>
<add> d := getDaemon(eng)
<add> es := d.EventsService
<add> w.Header().Set("Content-Type", "application/json")
<add> enc := json.NewEncoder(utils.NewWriteFlusher(w))
<add>
<add> getContainerId := func(cn string) string {
<add> c, err := d.Get(cn)
<add> if err != nil {
<add> return ""
<add> }
<add> return c.ID
<add> }
<add>
<add> sendEvent := func(ev *jsonmessage.JSONMessage) error {
<add> //incoming container filter can be name,id or partial id, convert and replace as a full container id
<add> for i, cn := range ef["container"] {
<add> ef["container"][i] = getContainerId(cn)
<add> }
<add>
<add> if isFiltered(ev.Status, ef["event"]) || isFiltered(ev.From, ef["image"]) ||
<add> isFiltered(ev.ID, ef["container"]) {
<add> return nil
<add> }
<add>
<add> return enc.Encode(ev)
<add> }
<add>
<add> current, l := es.Subscribe()
<add> defer es.Evict(l)
<add> for _, ev := range current {
<add> if ev.Time < since {
<add> continue
<add> }
<add> if err := sendEvent(ev); err != nil {
<add> return err
<add> }
<add> }
<add> for {
<add> select {
<add> case ev := <-l:
<add> jev, ok := ev.(*jsonmessage.JSONMessage)
<add> if !ok {
<add> continue
<add> }
<add> if err := sendEvent(jev); err != nil {
<add> return err
<add> }
<add> case <-timer.C:
<add> return nil
<add> }
<add> }
<ide> }
<ide>
<ide> func getImagesHistory(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
<ide><path>api/server/server_unit_test.go
<ide> func TestGetContainersByName(t *testing.T) {
<ide> }
<ide> }
<ide>
<del>func TestGetEvents(t *testing.T) {
<del> eng := engine.New()
<del> var called bool
<del> eng.Register("events", func(job *engine.Job) error {
<del> called = true
<del> since := job.Getenv("since")
<del> if since != "1" {
<del> t.Fatalf("'since' should be 1, found %#v instead", since)
<del> }
<del> until := job.Getenv("until")
<del> if until != "0" {
<del> t.Fatalf("'until' should be 0, found %#v instead", until)
<del> }
<del> v := &engine.Env{}
<del> v.Set("since", since)
<del> v.Set("until", until)
<del> if _, err := v.WriteTo(job.Stdout); err != nil {
<del> return err
<del> }
<del> return nil
<del> })
<del> r := serveRequest("GET", "/events?since=1&until=0", nil, eng, t)
<del> if !called {
<del> t.Fatal("handler was not called")
<del> }
<del> assertContentType(r, "application/json", t)
<del> var stdoutJSON struct {
<del> Since int
<del> Until int
<del> }
<del> if err := json.Unmarshal(r.Body.Bytes(), &stdoutJSON); err != nil {
<del> t.Fatal(err)
<del> }
<del> if stdoutJSON.Since != 1 {
<del> t.Errorf("since != 1: %#v", stdoutJSON.Since)
<del> }
<del> if stdoutJSON.Until != 0 {
<del> t.Errorf("until != 0: %#v", stdoutJSON.Until)
<del> }
<del>}
<del>
<ide> func TestLogs(t *testing.T) {
<ide> eng := engine.New()
<ide> var inspect bool
<ide><path>builtins/builtins.go
<ide> import (
<ide> "github.com/docker/docker/autogen/dockerversion"
<ide> "github.com/docker/docker/daemon/networkdriver/bridge"
<ide> "github.com/docker/docker/engine"
<del> "github.com/docker/docker/events"
<ide> "github.com/docker/docker/pkg/parsers/kernel"
<ide> )
<ide>
<ide> func Register(eng *engine.Engine) error {
<ide> if err := remote(eng); err != nil {
<ide> return err
<ide> }
<del> if err := events.New().Install(eng); err != nil {
<del> return err
<del> }
<ide> if err := eng.Register("version", dockerVersion); err != nil {
<ide> return err
<ide> }
<ide><path>daemon/container.go
<ide> func (container *Container) WriteHostConfig() error {
<ide>
<ide> func (container *Container) LogEvent(action string) {
<ide> d := container.daemon
<del> if err := d.eng.Job("log", action, container.ID, d.Repositories().ImageName(container.ImageID)).Run(); err != nil {
<del> logrus.Errorf("Error logging event %s for %s: %s", action, container.ID, err)
<del> }
<add> d.EventsService.Log(
<add> action,
<add> container.ID,
<add> d.Repositories().ImageName(container.ImageID),
<add> )
<ide> }
<ide>
<ide> func (container *Container) getResourcePath(path string) (string, error) {
<ide><path>daemon/daemon.go
<ide> import (
<ide> "github.com/Sirupsen/logrus"
<ide> "github.com/docker/docker/api"
<ide> "github.com/docker/docker/autogen/dockerversion"
<add> "github.com/docker/docker/daemon/events"
<ide> "github.com/docker/docker/daemon/execdriver"
<ide> "github.com/docker/docker/daemon/execdriver/execdrivers"
<ide> "github.com/docker/docker/daemon/execdriver/lxc"
<ide> type Daemon struct {
<ide> statsCollector *statsCollector
<ide> defaultLogConfig runconfig.LogConfig
<ide> RegistryService *registry.Service
<add> EventsService *events.Events
<ide> }
<ide>
<ide> // Install installs daemon capabilities to eng.
<ide> func NewDaemonFromDirectory(config *Config, eng *engine.Engine, registryService
<ide> return nil, err
<ide> }
<ide>
<add> eventsService := events.New()
<ide> logrus.Debug("Creating repository list")
<del> repositories, err := graph.NewTagStore(path.Join(config.Root, "repositories-"+driver.String()), g, trustKey, registryService)
<add> repositories, err := graph.NewTagStore(path.Join(config.Root, "repositories-"+driver.String()), g, trustKey, registryService, eventsService)
<ide> if err != nil {
<ide> return nil, fmt.Errorf("Couldn't create Tag store: %s", err)
<ide> }
<ide> func NewDaemonFromDirectory(config *Config, eng *engine.Engine, registryService
<ide> statsCollector: newStatsCollector(1 * time.Second),
<ide> defaultLogConfig: config.LogConfig,
<ide> RegistryService: registryService,
<add> EventsService: eventsService,
<ide> }
<ide>
<ide> eng.OnShutdown(func() {
<ide><path>daemon/image_delete.go
<ide> func (daemon *Daemon) DeleteImage(eng *engine.Engine, name string, list *[]types
<ide> *list = append(*list, types.ImageDelete{
<ide> Untagged: utils.ImageReference(repoName, tag),
<ide> })
<del> eng.Job("log", "untag", img.ID, "").Run()
<add> daemon.EventsService.Log("untag", img.ID, "")
<ide> }
<ide> }
<ide> tags = daemon.Repositories().ByID()[img.ID]
<ide> func (daemon *Daemon) DeleteImage(eng *engine.Engine, name string, list *[]types
<ide> *list = append(*list, types.ImageDelete{
<ide> Deleted: img.ID,
<ide> })
<add> daemon.EventsService.Log("delete", img.ID, "")
<ide> eng.Job("log", "delete", img.ID, "").Run()
<ide> if img.Parent != "" && !noprune {
<ide> err := daemon.DeleteImage(eng, img.Parent, list, false, force, noprune)
<ide><path>daemon/info.go
<ide> func (daemon *Daemon) CmdInfo(job *engine.Job) error {
<ide> initPath = daemon.SystemInitPath()
<ide> }
<ide>
<del> cjob := job.Eng.Job("subscribers_count")
<del> env, _ := cjob.Stdout.AddEnv()
<del> if err := cjob.Run(); err != nil {
<del> return err
<del> }
<ide> v := &engine.Env{}
<ide> v.SetJson("ID", daemon.ID)
<ide> v.SetInt("Containers", len(daemon.List()))
<ide> func (daemon *Daemon) CmdInfo(job *engine.Job) error {
<ide> v.Set("SystemTime", time.Now().Format(time.RFC3339Nano))
<ide> v.Set("ExecutionDriver", daemon.ExecutionDriver().Name())
<ide> v.Set("LoggingDriver", daemon.defaultLogConfig.Type)
<del> v.SetInt("NEventsListener", env.GetInt("count"))
<add> v.SetInt("NEventsListener", daemon.EventsService.SubscribersCount())
<ide> v.Set("KernelVersion", kernelVersion)
<ide> v.Set("OperatingSystem", operatingSystem)
<ide> v.Set("IndexServerAddress", registry.IndexServerAddress())
<ide><path>graph/import.go
<ide> import (
<ide> "net/http"
<ide> "net/url"
<ide>
<del> "github.com/Sirupsen/logrus"
<ide> "github.com/docker/docker/engine"
<ide> "github.com/docker/docker/pkg/archive"
<ide> "github.com/docker/docker/pkg/progressreader"
<ide> func (s *TagStore) CmdImport(job *engine.Job) error {
<ide> if tag != "" {
<ide> logID = utils.ImageReference(logID, tag)
<ide> }
<del> if err = job.Eng.Job("log", "import", logID, "").Run(); err != nil {
<del> logrus.Errorf("Error logging event 'import' for %s: %s", logID, err)
<del> }
<add>
<add> s.eventsService.Log("import", logID, "")
<ide> return nil
<ide> }
<ide><path>graph/pull.go
<ide> func (s *TagStore) CmdPull(job *engine.Job) error {
<ide>
<ide> logrus.Debugf("pulling v2 repository with local name %q", repoInfo.LocalName)
<ide> if err := s.pullV2Repository(job.Eng, r, job.Stdout, repoInfo, tag, sf, job.GetenvBool("parallel")); err == nil {
<del> if err = job.Eng.Job("log", "pull", logName, "").Run(); err != nil {
<del> logrus.Errorf("Error logging event 'pull' for %s: %s", logName, err)
<del> }
<add> s.eventsService.Log("pull", logName, "")
<ide> return nil
<ide> } else if err != registry.ErrDoesNotExist && err != ErrV2RegistryUnavailable {
<ide> logrus.Errorf("Error from V2 registry: %s", err)
<ide> func (s *TagStore) CmdPull(job *engine.Job) error {
<ide> return err
<ide> }
<ide>
<del> if err = job.Eng.Job("log", "pull", logName, "").Run(); err != nil {
<del> logrus.Errorf("Error logging event 'pull' for %s: %s", logName, err)
<del> }
<add> s.eventsService.Log("pull", logName, "")
<ide>
<ide> return nil
<ide> }
<ide><path>graph/tags.go
<ide> import (
<ide> "strings"
<ide> "sync"
<ide>
<add> "github.com/docker/docker/daemon/events"
<ide> "github.com/docker/docker/image"
<ide> "github.com/docker/docker/pkg/parsers"
<ide> "github.com/docker/docker/pkg/stringid"
<ide> type TagStore struct {
<ide> pullingPool map[string]chan struct{}
<ide> pushingPool map[string]chan struct{}
<ide> registryService *registry.Service
<add> eventsService *events.Events
<ide> }
<ide>
<ide> type Repository map[string]string
<ide> func (r Repository) Contains(u Repository) bool {
<ide> return true
<ide> }
<ide>
<del>func NewTagStore(path string, graph *Graph, key libtrust.PrivateKey, registryService *registry.Service) (*TagStore, error) {
<add>func NewTagStore(path string, graph *Graph, key libtrust.PrivateKey, registryService *registry.Service, eventsService *events.Events) (*TagStore, error) {
<ide> abspath, err := filepath.Abs(path)
<ide> if err != nil {
<ide> return nil, err
<ide> func NewTagStore(path string, graph *Graph, key libtrust.PrivateKey, registrySer
<ide> pullingPool: make(map[string]chan struct{}),
<ide> pushingPool: make(map[string]chan struct{}),
<ide> registryService: registryService,
<add> eventsService: eventsService,
<ide> }
<ide> // Load the json file if it exists, otherwise create it.
<ide> if err := store.reload(); os.IsNotExist(err) {
<ide><path>graph/tags_unit_test.go
<ide> import (
<ide> "path"
<ide> "testing"
<ide>
<add> "github.com/docker/docker/daemon/events"
<ide> "github.com/docker/docker/daemon/graphdriver"
<ide> _ "github.com/docker/docker/daemon/graphdriver/vfs" // import the vfs driver so it is used in the tests
<ide> "github.com/docker/docker/image"
<ide> func mkTestTagStore(root string, t *testing.T) *TagStore {
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> }
<del> store, err := NewTagStore(path.Join(root, "tags"), graph, nil, nil)
<add> store, err := NewTagStore(path.Join(root, "tags"), graph, nil, nil, events.New())
<ide> if err != nil {
<ide> t.Fatal(err)
<ide> } | 11 |
Java | Java | update javadoc for lazyinittargetsourcecreator | e8335c94d5e7ab57b2b43dd6b809c81c1e997fbd | <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/LazyInitTargetSourceCreator.java
<ide> /*
<del> * Copyright 2002-2014 the original author or authors.
<add> * Copyright 2002-2020 the original author or authors.
<ide> *
<ide> * Licensed under the Apache License, Version 2.0 (the "License");
<ide> * you may not use this file except in compliance with the License.
<ide> import org.springframework.lang.Nullable;
<ide>
<ide> /**
<del> * TargetSourceCreator that enforces a LazyInitTargetSource for each bean
<del> * that is defined as "lazy-init". This will lead to a proxy created for
<del> * each of those beans, allowing to fetch a reference to such a bean
<del> * without actually initializing the target bean instance.
<add> * {@code TargetSourceCreator} that enforces a {@link LazyInitTargetSource} for
<add> * each bean that is defined as "lazy-init". This will lead to a proxy created for
<add> * each of those beans, allowing to fetch a reference to such a bean without
<add> * actually initializing the target bean instance.
<ide> *
<del> * <p>To be registered as custom TargetSourceCreator for an auto-proxy creator,
<del> * in combination with custom interceptors for specific beans or for the
<del> * creation of lazy-init proxies only. For example, as autodetected
<add> * <p>To be registered as custom {@code TargetSourceCreator} for an auto-proxy
<add> * creator, in combination with custom interceptors for specific beans or for the
<add> * creation of lazy-init proxies only. For example, as an autodetected
<ide> * infrastructure bean in an XML application context definition:
<ide> *
<ide> * <pre class="code">
<ide> * <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<add> * <property name="beanNames" value="*" /> <!-- apply to all beans -->
<ide> * <property name="customTargetSourceCreators">
<ide> * <list>
<del> * <bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator"/>
<add> * <bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator" />
<ide> * </list>
<ide> * </property>
<ide> * </bean>
<ide> *
<ide> * <bean id="myLazyInitBean" class="mypackage.MyBeanClass" lazy-init="true">
<del> * ...
<add> * <!-- ... -->
<ide> * </bean></pre>
<ide> *
<ide> * @author Juergen Hoeller
<add> * @author Sam Brannen
<ide> * @since 1.2
<ide> * @see org.springframework.beans.factory.config.BeanDefinition#isLazyInit
<ide> * @see org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#setCustomTargetSourceCreators | 1 |
Python | Python | fix prediction on run-squad.py example | aa90e0c36adc0034ece203c857d0d993c82ae65a | <ide><path>examples/run_squad.py
<ide> def main():
<ide> parser.add_argument("--num_train_epochs", default=3.0, type=float,
<ide> help="Total number of training epochs to perform.")
<ide> parser.add_argument("--warmup_proportion", default=0.1, type=float,
<del> help="Proportion of training to perform linear learning rate warmup for. E.g., 0.1 = 10%% "
<add> help="Proportion of training to perform linear learning rate warmup for. E.g., 0.1 = 10% "
<ide> "of training.")
<ide> parser.add_argument("--n_best_size", default=20, type=int,
<ide> help="The total number of n-best predictions to generate in the nbest_predictions.json "
<ide> def main():
<ide> if args.do_train:
<ide> torch.save(model_to_save.state_dict(), output_model_file)
<ide>
<del> # Load a trained model that you have fine-tuned
<del> model_state_dict = torch.load(output_model_file)
<del> model = BertForQuestionAnswering.from_pretrained(args.bert_model, state_dict=model_state_dict)
<add> # Load a trained model that you have fine-tuned
<add> model_state_dict = torch.load(output_model_file)
<add> model = BertForQuestionAnswering.from_pretrained(args.bert_model, state_dict=model_state_dict)
<add> else:
<add> model = BertForQuestionAnswering.from_pretrained(args.bert_model)
<add>
<ide> model.to(device)
<ide>
<ide> if args.do_predict and (args.local_rank == -1 or torch.distributed.get_rank() == 0): | 1 |
PHP | PHP | remove unused reflectionmethod in scanners | 6892e6bf4620e3bda723869602f0e5b7bc4873e6 | <ide><path>src/Illuminate/Events/Annotations/Scanner.php
<ide>
<ide> use SplFileInfo;
<ide> use ReflectionClass;
<del>use ReflectionMethod;
<ide> use Symfony\Component\Finder\Finder;
<ide> use Doctrine\Common\Annotations\AnnotationRegistry;
<ide> use Doctrine\Common\Annotations\SimpleAnnotationReader;
<ide><path>src/Illuminate/Routing/Annotations/Scanner.php
<ide>
<ide> use SplFileInfo;
<ide> use ReflectionClass;
<del>use ReflectionMethod;
<ide> use Symfony\Component\Finder\Finder;
<ide> use Doctrine\Common\Annotations\AnnotationRegistry;
<ide> use Doctrine\Common\Annotations\SimpleAnnotationReader; | 2 |
PHP | PHP | fix doc block | 7931724ee9518b82ffd2f7476a4b2af335ae32cc | <ide><path>src/Illuminate/Foundation/AliasLoader.php
<ide> class AliasLoader {
<ide> protected static $instance;
<ide>
<ide> /**
<del> * Singleton shouln't allow instantiation
<add> * Create a new AliasLoader instance.
<add> *
<add> * @param array $aliases
<ide> */
<ide> private function __construct($aliases)
<ide> { | 1 |
Text | Text | update the link | ee292e0365a9621b8d4bb9252a1078fabf4dfd49 | <ide><path>research/object_detection/g3doc/running_on_mobile_tensorflowlite.md
<ide> are named 'TFLite_Detection_PostProcess', 'TFLite_Detection_PostProcess:1',
<ide> 'TFLite_Detection_PostProcess:2', and 'TFLite_Detection_PostProcess:3' and
<ide> represent four arrays: detection_boxes, detection_classes, detection_scores, and
<ide> num_detections. The documentation for other flags used in this command is
<del>[here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/convert/cmdline_reference.md).
<add>[here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/convert/cmdline.md).
<ide> If things ran successfully, you should now see a third file in the /tmp/tflite
<ide> directory called detect.tflite. This file contains the graph and all model
<ide> parameters and can be run via the TensorFlow Lite interpreter on the Android | 1 |
Ruby | Ruby | remove unused `row` class in `selectmanager` | 386e2c7357d8e15ab52f63c7d79101458561fbb1 | <ide><path>activerecord/lib/arel/select_manager.rb
<ide> def source
<ide> @ctx.source
<ide> end
<ide>
<del> class Row < Struct.new(:data) # :nodoc:
<del> def id
<del> data["id"]
<del> end
<del>
<del> def method_missing(name, *args)
<del> name = name.to_s
<del> return data[name] if data.key?(name)
<del> super
<del> end
<del> end
<del>
<ide> private
<ide> def collapse(exprs)
<ide> exprs = exprs.compact | 1 |
Javascript | Javascript | add abort functionality in fetch stream | 949c3e9417ded8588df2d99024c8697987b6265e | <ide><path>src/display/fetch_stream.js
<ide> import {
<ide> validateRangeRequestCapabilities, validateResponseStatus
<ide> } from './network_utils';
<ide>
<del>function createFetchOptions(headers, withCredentials) {
<add>function createFetchOptions(headers, withCredentials, abortController) {
<ide> return {
<ide> method: 'GET',
<ide> headers,
<add> signal: abortController && abortController.signal,
<ide> mode: 'cors',
<ide> credentials: withCredentials ? 'include' : 'same-origin',
<ide> redirect: 'follow',
<ide> class PDFFetchStreamReader {
<ide> this._disableRange = true;
<ide> }
<ide>
<add> if (typeof AbortController !== 'undefined') {
<add> this._abortController = new AbortController();
<add> }
<ide> this._isStreamingSupported = !source.disableStream;
<ide> this._isRangeSupported = !source.disableRange;
<ide>
<ide> class PDFFetchStreamReader {
<ide> }
<ide>
<ide> let url = source.url;
<del> fetch(url, createFetchOptions(this._headers, this._withCredentials)).
<del> then((response) => {
<add> fetch(url, createFetchOptions(this._headers, this._withCredentials,
<add> this._abortController)).then((response) => {
<ide> if (!validateResponseStatus(response.status)) {
<ide> throw createResponseStatusError(response.status, url);
<ide> }
<ide> class PDFFetchStreamReader {
<ide> if (this._reader) {
<ide> this._reader.cancel(reason);
<ide> }
<add> if (this._abortController) {
<add> this._abortController.abort();
<add> }
<ide> }
<ide> }
<ide>
<ide> class PDFFetchStreamRangeReader {
<ide> this._readCapability = createPromiseCapability();
<ide> this._isStreamingSupported = !source.disableStream;
<ide>
<add> if (typeof AbortController !== 'undefined') {
<add> this._abortController = new AbortController();
<add> }
<add>
<ide> this._headers = new Headers();
<ide> for (let property in this._stream.httpHeaders) {
<ide> let value = this._stream.httpHeaders[property];
<ide> class PDFFetchStreamRangeReader {
<ide> let rangeStr = begin + '-' + (end - 1);
<ide> this._headers.append('Range', 'bytes=' + rangeStr);
<ide> let url = source.url;
<del> fetch(url, createFetchOptions(this._headers, this._withCredentials)).
<del> then((response) => {
<add> fetch(url, createFetchOptions(this._headers, this._withCredentials,
<add> this._abortController)).then((response) => {
<ide> if (!validateResponseStatus(response.status)) {
<ide> throw createResponseStatusError(response.status, url);
<ide> }
<ide> class PDFFetchStreamRangeReader {
<ide> if (this._reader) {
<ide> this._reader.cancel(reason);
<ide> }
<add> if (this._abortController) {
<add> this._abortController.abort();
<add> }
<ide> }
<ide> }
<ide> | 1 |
Java | Java | remove trailing whitespace from source code | 61824b1aded8f975f3e02e0b1a7ace63a993a6fb | <ide><path>spring-context/src/test/java/org/springframework/context/expression/FactoryBeanAccessTests.java
<ide> public void factoryBeanAccess() { // SPR9511
<ide> } catch (BeanIsNotAFactoryException binafe) {
<ide> // success
<ide> }
<del>
<add>
<ide> // No such bean
<ide> try {
<ide> expr = new SpelExpressionParser().parseRaw("@truck");
<ide><path>spring-context/src/test/java/org/springframework/context/expression/MapAccessorTests.java
<ide> public class MapAccessorTests {
<ide> @Test
<ide> public void mapAccessorCompilable() {
<ide> Map<String, Object> testMap = getSimpleTestMap();
<del> StandardEvaluationContext sec = new StandardEvaluationContext();
<add> StandardEvaluationContext sec = new StandardEvaluationContext();
<ide> sec.addPropertyAccessor(new MapAccessor());
<ide> SpelExpressionParser sep = new SpelExpressionParser();
<del>
<add>
<ide> // basic
<ide> Expression ex = sep.parseExpression("foo");
<ide> assertEquals("bar",ex.getValue(sec,testMap));
<del> assertTrue(SpelCompiler.compile(ex));
<add> assertTrue(SpelCompiler.compile(ex));
<ide> assertEquals("bar",ex.getValue(sec,testMap));
<ide>
<ide> // compound expression
<ide> ex = sep.parseExpression("foo.toUpperCase()");
<ide> assertEquals("BAR",ex.getValue(sec,testMap));
<del> assertTrue(SpelCompiler.compile(ex));
<add> assertTrue(SpelCompiler.compile(ex));
<ide> assertEquals("BAR",ex.getValue(sec,testMap));
<del>
<add>
<ide> // nested map
<ide> Map<String,Map<String,Object>> nestedMap = getNestedTestMap();
<ide> ex = sep.parseExpression("aaa.foo.toUpperCase()");
<ide> assertEquals("BAR",ex.getValue(sec,nestedMap));
<del> assertTrue(SpelCompiler.compile(ex));
<add> assertTrue(SpelCompiler.compile(ex));
<ide> assertEquals("BAR",ex.getValue(sec,nestedMap));
<del>
<add>
<ide> // avoiding inserting checkcast because first part of expression returns a Map
<ide> ex = sep.parseExpression("getMap().foo");
<ide> MapGetter mapGetter = new MapGetter();
<ide> assertEquals("bar",ex.getValue(sec,mapGetter));
<del> assertTrue(SpelCompiler.compile(ex));
<add> assertTrue(SpelCompiler.compile(ex));
<ide> assertEquals("bar",ex.getValue(sec,mapGetter));
<ide> }
<del>
<add>
<ide> public static class MapGetter {
<ide> Map<String,Object> map = new HashMap<String,Object>();
<ide>
<ide> public MapGetter() {
<ide> map.put("foo", "bar");
<ide> }
<del>
<add>
<ide> @SuppressWarnings("rawtypes")
<ide> public Map getMap() {
<ide> return map;
<ide> }
<ide> }
<del>
<add>
<ide> public Map<String,Object> getSimpleTestMap() {
<ide> Map<String,Object> map = new HashMap<String,Object>();
<ide> map.put("foo","bar");
<ide><path>spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationCoverageTests.java
<ide> public void constructorReference_SPR13781() {
<ide> assertEquals("java.lang.String",expression.getValue());
<ide> assertCanCompile(expression);
<ide> assertEquals("java.lang.String",expression.getValue());
<del>
<add>
<ide> // These tests below verify that the chain of static accesses (either method/property or field)
<ide> // leave the right thing on top of the stack for processing by any outer consuming code.
<ide> // Here the consuming code is the String.valueOf() function. If the wrong thing were on
<del> // the stack (for example if the compiled code for static methods wasn't popping the
<add> // the stack (for example if the compiled code for static methods wasn't popping the
<ide> // previous thing off the stack) the valueOf() would operate on the wrong value.
<ide>
<ide> String shclass = StaticsHelper.class.getName();
<ide> public void constructorReference_SPR13781() {
<ide> assertEquals("fb",expression.getValue(StaticsHelper.sh));
<ide> assertCanCompile(expression);
<ide> assertEquals("fb",expression.getValue(StaticsHelper.sh));
<del>
<add>
<ide> expression = parser.parseExpression("T(String).valueOf(propertya.propertyb)");
<ide> assertEquals("pb",expression.getValue(StaticsHelper.sh));
<ide> assertCanCompile(expression);
<ide> public void constructorReference_SPR13781() {
<ide> assertEquals("mb",expression.getValue(StaticsHelper.sh));
<ide> assertCanCompile(expression);
<ide> assertEquals("mb",expression.getValue(StaticsHelper.sh));
<del>
<del> }
<ide>
<add> }
<add>
<ide> @Test
<ide> public void constructorReference_SPR12326() {
<ide> String type = this.getClass().getName();
<ide> public static StaticsHelper methoda() {
<ide> public static String methodb() {
<ide> return "mb";
<ide> }
<del>
<add>
<ide> public static StaticsHelper getPropertya() {
<ide> return sh;
<ide> }
<ide>
<ide> public static String getPropertyb() {
<ide> return "pb";
<ide> }
<del>
<add>
<ide>
<ide> public static StaticsHelper fielda = sh;
<ide> public static String fieldb = "fb";
<del>
<add>
<ide> public String toString() {
<ide> return "sh";
<ide> }
<ide><path>spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java
<ide> public void SPR13055() throws Exception {
<ide> res = parser.parseExpression("#root.![values()]").getValue(context, List.class);
<ide> assertEquals("[[test12, test11], [test22, test21]]", res.toString());
<ide> }
<del>
<add>
<ide> @Test
<ide> public void AccessingFactoryBean_spr9511() {
<ide> StandardEvaluationContext context = new StandardEvaluationContext();
<ide> public void AccessingFactoryBean_spr9511() {
<ide> assertEquals("custard", expr.getValue(context));
<ide> expr = new SpelExpressionParser().parseRaw("&foo");
<ide> assertEquals("foo factory",expr.getValue(context));
<del>
<add>
<ide> try {
<ide> expr = new SpelExpressionParser().parseRaw("&@foo");
<ide> fail("Illegal syntax, error expected");
<ide> } catch (SpelParseException spe) {
<ide> assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode());
<ide> assertEquals(0,spe.getPosition());
<ide> }
<del>
<add>
<ide> try {
<ide> expr = new SpelExpressionParser().parseRaw("@&foo");
<ide> fail("Illegal syntax, error expected");
<ide> } catch (SpelParseException spe) {
<ide> assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode());
<ide> assertEquals(0,spe.getPosition());
<del> }
<add> }
<ide> }
<ide>
<ide> @Test
<ide><path>spring-web/src/test/java/org/springframework/http/client/OkHttpAsyncClientHttpRequestFactoryTests.java
<ide> * @author Luciano Leggieri
<ide> */
<ide> public class OkHttpAsyncClientHttpRequestFactoryTests extends AbstractAsyncHttpRequestFactoryTestCase {
<del>
<add>
<ide> @Override
<ide> protected AsyncClientHttpRequestFactory createRequestFactory() {
<ide> return new OkHttpClientHttpRequestFactory();
<ide><path>spring-web/src/test/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequestTests.java
<ide> public void onCompletionHandler() throws Exception {
<ide> }
<ide>
<ide> // SPR-13292
<del>
<add>
<ide> @Test
<ide> public void onCompletionHandlerAfterOnErrorEvent() throws Exception {
<ide> Runnable handler = mock(Runnable.class); | 6 |
Python | Python | fix dummy objects for quantization | 1a92bc578866bc0eee1104d253dbad98b89ecc3b | <ide><path>src/transformers/utils/dummy_flax_objects.py
<ide> class FlaxBertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["flax"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["flax"])
<add>
<add> def __call__(self, *args, **kwargs):
<add> requires_backends(self, ["flax"])
<add>
<ide>
<ide> class FlaxBertForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide><path>src/transformers/utils/dummy_pt_objects.py
<ide> class TextDatasetForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["torch"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["torch"])
<add>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["torch"])
<add>
<ide>
<ide> class BeamScorer:
<ide> def __init__(self, *args, **kwargs):
<ide> class BertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["torch"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["torch"])
<add>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["torch"])
<add>
<ide>
<ide> class BertForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide> class FNetForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["torch"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["torch"])
<add>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["torch"])
<add>
<ide>
<ide> class FNetForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide> class MegatronBertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["torch"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["torch"])
<add>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["torch"])
<add>
<ide>
<ide> class MegatronBertForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide> class MobileBertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["torch"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["torch"])
<add>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["torch"])
<add>
<ide>
<ide> class MobileBertForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide><path>src/transformers/utils/dummy_pytorch_quantization_and_torch_objects.py
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertForMultipleChoice:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["pytorch_quantization", "torch"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["pytorch_quantization", "torch"])
<add>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertForQuestionAnswering:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertForSequenceClassification:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertForTokenClassification:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertLayer:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertModel:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> class QDQBertPreTrainedModel:
<ide> def __init__(self, *args, **kwargs):
<ide> def __init__(self, *args, **kwargs):
<ide> def from_pretrained(cls, *args, **kwargs):
<ide> requires_backends(cls, ["pytorch_quantization", "torch"])
<ide>
<add> def forward(self, *args, **kwargs):
<add> requires_backends(self, ["pytorch_quantization", "torch"])
<add>
<ide>
<ide> def load_tf_weights_in_qdqbert(*args, **kwargs):
<ide> requires_backends(load_tf_weights_in_qdqbert, ["pytorch_quantization", "torch"])
<ide><path>src/transformers/utils/dummy_tf_objects.py
<ide> class TFBertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["tf"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["tf"])
<add>
<add> def call(self, *args, **kwargs):
<add> requires_backends(self, ["tf"])
<add>
<ide>
<ide> class TFBertForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide> class TFMobileBertForNextSentencePrediction:
<ide> def __init__(self, *args, **kwargs):
<ide> requires_backends(self, ["tf"])
<ide>
<add> @classmethod
<add> def from_pretrained(cls, *args, **kwargs):
<add> requires_backends(cls, ["tf"])
<add>
<add> def call(self, *args, **kwargs):
<add> requires_backends(self, ["tf"])
<add>
<ide>
<ide> class TFMobileBertForPreTraining:
<ide> def __init__(self, *args, **kwargs):
<ide><path>utils/check_dummies.py
<ide> PATH_TO_TRANSFORMERS = "src/transformers"
<ide>
<ide> # Matches is_xxx_available()
<del>_re_backend = re.compile(r"is\_([a-z]*)_available()")
<add>_re_backend = re.compile(r"is\_([a-z_]*)_available()")
<ide> # Matches from xxx import bla
<ide> _re_single_line_import = re.compile(r"\s+from\s+\S*\s+import\s+([^\(\s].*)\n")
<ide> _re_test_backend = re.compile(r"^\s+if\s+is\_[a-z]*\_available\(\)")
<ide> def create_dummy_object(name, backend_name):
<ide> "ForConditionalGeneration",
<ide> "ForMaskedLM",
<ide> "ForMultipleChoice",
<add> "ForNextSentencePrediction",
<ide> "ForObjectDetection",
<ide> "ForQuestionAnswering",
<ide> "ForSegmentation", | 5 |
PHP | PHP | simplify lazy collection | 68359835771a43ee2432735b0d25de8d8c41b02c | <ide><path>src/Illuminate/Support/LazyCollection.php
<ide> public function mode($key = null)
<ide> */
<ide> public function collapse()
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original) {
<del> foreach ($original as $values) {
<add> return new static(function () {
<add> foreach ($this as $values) {
<ide> if (is_array($values) || $values instanceof Enumerable) {
<ide> foreach ($values as $value) {
<ide> yield $value;
<ide> public function filter(callable $callback = null)
<ide> };
<ide> }
<ide>
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $callback) {
<del> foreach ($original as $key => $value) {
<add> return new static(function () use ($callback) {
<add> foreach ($this as $key => $value) {
<ide> if ($callback($value, $key)) {
<ide> yield $key => $value;
<ide> }
<ide> public function first(callable $callback = null, $default = null)
<ide> */
<ide> public function flatten($depth = INF)
<ide> {
<del> $original = clone $this;
<del>
<del> $instance = new static(function () use ($original, $depth) {
<del> foreach ($original as $item) {
<add> $instance = new static(function () use ($depth) {
<add> foreach ($this as $item) {
<ide> if (! is_array($item) && ! $item instanceof Enumerable) {
<ide> yield $item;
<ide> } elseif ($depth === 1) {
<ide> public function flatten($depth = INF)
<ide> */
<ide> public function flip()
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original) {
<del> foreach ($original as $key => $value) {
<add> return new static(function () {
<add> foreach ($this as $key => $value) {
<ide> yield $value => $key;
<ide> }
<ide> });
<ide> public function groupBy($groupBy, $preserveKeys = false)
<ide> */
<ide> public function keyBy($keyBy)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $keyBy) {
<add> return new static(function () use ($keyBy) {
<ide> $keyBy = $this->valueRetriever($keyBy);
<ide>
<del> foreach ($original as $key => $item) {
<add> foreach ($this as $key => $item) {
<ide> $resolvedKey = $keyBy($item, $key);
<ide>
<ide> if (is_object($resolvedKey)) {
<ide> public function join($glue, $finalGlue = '')
<ide> */
<ide> public function keys()
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original) {
<del> foreach ($original as $key => $value) {
<add> return new static(function () {
<add> foreach ($this as $key => $value) {
<ide> yield $key;
<ide> }
<ide> });
<ide> public function last(callable $callback = null, $default = null)
<ide> */
<ide> public function pluck($value, $key = null)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $value, $key) {
<add> return new static(function () use ($value, $key) {
<ide> [$value, $key] = $this->explodePluckParameters($value, $key);
<ide>
<del> foreach ($original as $item) {
<add> foreach ($this as $item) {
<ide> $itemValue = data_get($item, $value);
<ide>
<ide> if (is_null($key)) {
<ide> public function pluck($value, $key = null)
<ide> */
<ide> public function map(callable $callback)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $callback) {
<del> foreach ($original as $key => $value) {
<add> return new static(function () use ($callback) {
<add> foreach ($this as $key => $value) {
<ide> yield $key => $callback($value, $key);
<ide> }
<ide> });
<ide> public function mapToDictionary(callable $callback)
<ide> */
<ide> public function mapWithKeys(callable $callback)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $callback) {
<del> foreach ($original as $key => $value) {
<add> return new static(function () use ($callback) {
<add> foreach ($this as $key => $value) {
<ide> yield from $callback($value, $key);
<ide> }
<ide> });
<ide> public function mergeRecursive($items)
<ide> */
<ide> public function combine($values)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $values) {
<add> return new static(function () use ($values) {
<ide> $values = $this->makeIterator($values);
<ide>
<ide> $errorMessage = 'Both parameters should have an equal number of elements';
<ide>
<del> foreach ($original as $key) {
<add> foreach ($this as $key) {
<ide> if (! $values->valid()) {
<ide> trigger_error($errorMessage, E_USER_WARNING);
<ide>
<ide> public function union($items)
<ide> */
<ide> public function nth($step, $offset = 0)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $step, $offset) {
<add> return new static(function () use ($step, $offset) {
<ide> $position = 0;
<ide>
<del> foreach ($original as $item) {
<add> foreach ($this as $item) {
<ide> if ($position % $step === $offset) {
<ide> yield $item;
<ide> }
<ide> public function only($keys)
<ide> $keys = is_array($keys) ? $keys : func_get_args();
<ide> }
<ide>
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $keys) {
<add> return new static(function () use ($keys) {
<ide> if (is_null($keys)) {
<del> yield from $original;
<add> yield from $this;
<ide> } else {
<ide> $keys = array_flip($keys);
<ide>
<del> foreach ($original as $key => $value) {
<add> foreach ($this as $key => $value) {
<ide> if (array_key_exists($key, $keys)) {
<ide> yield $key => $value;
<ide>
<ide> public function only($keys)
<ide> */
<ide> public function concat($source)
<ide> {
<del> $original = clone $this;
<del>
<del> return (new static(function () use ($original, $source) {
<del> yield from $original;
<add> return (new static(function () use ($source) {
<add> yield from $this;
<ide> yield from $source;
<ide> }))->values();
<ide> }
<ide> public function reduce(callable $callback, $initial = null)
<ide> */
<ide> public function replace($items)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $items) {
<add> return new static(function () use ($items) {
<ide> $items = $this->getArrayableItems($items);
<ide>
<del> foreach ($original as $key => $value) {
<add> foreach ($this as $key => $value) {
<ide> if (array_key_exists($key, $items)) {
<ide> yield $key => $items[$key];
<ide>
<ide> public function shuffle($seed = null)
<ide> */
<ide> public function skip($count)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $count) {
<del> $iterator = $original->getIterator();
<add> return new static(function () use ($count) {
<add> $iterator = $this->getIterator();
<ide>
<ide> while ($iterator->valid() && $count--) {
<ide> $iterator->next();
<ide> public function chunk($size)
<ide> return static::empty();
<ide> }
<ide>
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $size) {
<del> $iterator = $original->getIterator();
<add> return new static(function () use ($size) {
<add> $iterator = $this->getIterator();
<ide>
<ide> while ($iterator->valid()) {
<ide> $chunk = [];
<ide> public function take($limit)
<ide> return $this->passthru('take', func_get_args());
<ide> }
<ide>
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $limit) {
<del> $iterator = $original->getIterator();
<add> return new static(function () use ($limit) {
<add> $iterator = $this->getIterator();
<ide>
<ide> while ($limit--) {
<ide> if (! $iterator->valid()) {
<ide> public function take($limit)
<ide> */
<ide> public function tapEach(callable $callback)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $callback) {
<del> foreach ($original as $key => $value) {
<add> return new static(function () use ($callback) {
<add> foreach ($this as $key => $value) {
<ide> $callback($value, $key);
<ide>
<ide> yield $key => $value;
<ide> public function tapEach(callable $callback)
<ide> */
<ide> public function values()
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original) {
<del> foreach ($original as $item) {
<add> return new static(function () {
<add> foreach ($this as $item) {
<ide> yield $item;
<ide> }
<ide> });
<ide> public function zip($items)
<ide> {
<ide> $iterables = func_get_args();
<ide>
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $iterables) {
<add> return new static(function () use ($iterables) {
<ide> $iterators = Collection::make($iterables)->map(function ($iterable) {
<ide> return $this->makeIterator($iterable);
<del> })->prepend($original->getIterator());
<add> })->prepend($this->getIterator());
<ide>
<ide> while ($iterators->contains->valid()) {
<ide> yield new static($iterators->map->current());
<ide> public function pad($size, $value)
<ide> return $this->passthru('pad', func_get_args());
<ide> }
<ide>
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $size, $value) {
<add> return new static(function () use ($size, $value) {
<ide> $yielded = 0;
<ide>
<del> foreach ($original as $index => $item) {
<add> foreach ($this as $index => $item) {
<ide> yield $index => $item;
<ide>
<ide> $yielded++;
<ide> protected function explodePluckParameters($value, $key)
<ide> */
<ide> protected function passthru($method, array $params)
<ide> {
<del> $original = clone $this;
<del>
<del> return new static(function () use ($original, $method, $params) {
<del> yield from $original->collect()->$method(...$params);
<add> return new static(function () use ($method, $params) {
<add> yield from $this->collect()->$method(...$params);
<ide> });
<ide> }
<del>
<del> /**
<del> * Finish cloning the collection instance.
<del> *
<del> * @return void
<del> */
<del> public function __clone()
<del> {
<del> if (! is_array($this->source)) {
<del> $this->source = clone $this->source;
<del> }
<del> }
<ide> } | 1 |
Text | Text | release notes for 3.1.2 | 5c8df2c56b35ecb3f3320bab2c017eafa5f28d96 | <ide><path>docs/topics/release-notes.md
<ide> You can determine your currently installed version using `pip freeze`:
<ide>
<ide> ## 3.1.x series
<ide>
<add>### 3.1.2
<add>
<add>**Date**: [13rd May 2015][3.1.2-milestone].
<add>
<add>* DateField to_representation can handle str and empty values. ([#2656](gh2656), [#2687](gh2687), [#2869](gh2869))
<add>* Use default reason phrases from HTTP standard. ([#2764](gh2764), [#2763](gh2763))
<add>* Raise error when ModelSerializer used with abstract model. ([#2757](gh2757), [#2630](gh2630))
<add>* Handle reversal of non-API view_name in HyperLinkedRelatedField ([#2724](gh2724), [#2711](gh2711))
<add>* Dont require pk strictly for related fields. ([#2745](gh2745), [#2754](gh2754))
<add>* Metadata detects null boolean field type. ([#2762](gh2762))
<add>* Proper handling of depth in nested serializers. ([#2798](gh2798))
<add>* Display viewset without paginator. ([#2807](gh2807))
<add>* Don't check for deprecated '.model' attribute in permissions ([#2818](gh2818))
<add>* Restrict integer field to integers and strings. ([#2835](gh2835), [#2836](gh2836))
<add>* Improve IntegerField to use compiled decimal regex. ([#2853](gh2853))
<add>* Prevent empty `queryset`s to raise AssertionError. ([#2862](gh2862))
<add>* DjangoModelPermissions rely on get_queryset. ([#2863](gh2863))
<add>* Check AcceptHeaderVersioning with content negotiation in place. ([#2868](gh2868))
<add>
<add>
<ide> ### 3.1.1
<ide>
<ide> **Date**: [23rd March 2015][3.1.1-milestone].
<ide> For older release notes, [please see the version 2.x documentation][old-release-
<ide> [3.0.5-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.5+Release%22
<ide> [3.1.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.0+Release%22
<ide> [3.1.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.1+Release%22
<add>[3.1.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.2+Release%22
<ide>
<ide> <!-- 3.0.1 -->
<ide> [gh2013]: https://github.com/tomchristie/django-rest-framework/issues/2013
<ide> For older release notes, [please see the version 2.x documentation][old-release-
<ide> [gh2631]: https://github.com/tomchristie/django-rest-framework/issues/2631
<ide> [gh2741]: https://github.com/tomchristie/django-rest-framework/issues/2641
<ide> [gh2743]: https://github.com/tomchristie/django-rest-framework/issues/2643
<add><!-- 3.1.2 -->
<add>[gh2656]: https://github.com/tomchristie/django-rest-framework/issues/2656
<add>[gh2687]: https://github.com/tomchristie/django-rest-framework/issues/2687
<add>[gh2869]: https://github.com/tomchristie/django-rest-framework/issues/2869
<add>[gh2764]: https://github.com/tomchristie/django-rest-framework/issues/2764
<add>[gh2763]: https://github.com/tomchristie/django-rest-framework/issues/2763
<add>[gh2757]: https://github.com/tomchristie/django-rest-framework/issues/2757
<add>[gh2630]: https://github.com/tomchristie/django-rest-framework/issues/2630
<add>[gh2724]: https://github.com/tomchristie/django-rest-framework/issues/2724
<add>[gh2711]: https://github.com/tomchristie/django-rest-framework/issues/2711
<add>[gh2745]: https://github.com/tomchristie/django-rest-framework/issues/2745
<add>[gh2754]: https://github.com/tomchristie/django-rest-framework/issues/2754
<add>[gh2762]: https://github.com/tomchristie/django-rest-framework/issues/2762
<add>[gh2798]: https://github.com/tomchristie/django-rest-framework/issues/2798
<add>[gh2807]: https://github.com/tomchristie/django-rest-framework/issues/2807
<add>[gh2818]: https://github.com/tomchristie/django-rest-framework/issues/2818
<add>[gh2835]: https://github.com/tomchristie/django-rest-framework/issues/2835
<add>[gh2836]: https://github.com/tomchristie/django-rest-framework/issues/2836
<add>[gh2853]: https://github.com/tomchristie/django-rest-framework/issues/2853
<add>[gh2862]: https://github.com/tomchristie/django-rest-framework/issues/2862
<add>[gh2863]: https://github.com/tomchristie/django-rest-framework/issues/2863
<add>[gh2868]: https://github.com/tomchristie/django-rest-framework/issues/2868 | 1 |
Go | Go | remove endpoint list | 410a8612f481e67265ce0edaf78ed1d96f6dffcf | <ide><path>daemon/oci_windows.go
<ide> func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e
<ide> s.Root.Path = c.BaseFS
<ide> s.Root.Readonly = c.HostConfig.ReadonlyRootfs
<ide>
<del> // In s.Windows.Networking
<del> // Connect all the libnetwork allocated networks to the container
<del> var epList []string
<del> if c.NetworkSettings != nil {
<del> for n := range c.NetworkSettings.Networks {
<del> sn, err := daemon.FindNetwork(n)
<del> if err != nil {
<del> continue
<del> }
<del>
<del> ep, err := c.GetEndpointInNetwork(sn)
<del> if err != nil {
<del> continue
<del> }
<del>
<del> data, err := ep.DriverInfo()
<del> if err != nil {
<del> continue
<del> }
<del> if data["hnsid"] != nil {
<del> epList = append(epList, data["hnsid"].(string))
<del> }
<del> }
<del> }
<del> s.Windows.Networking = &windowsoci.WindowsNetworking{
<del> EndpointList: epList,
<del> }
<del>
<ide> // In s.Windows.Resources
<ide> // @darrenstahlmsft implement these resources
<ide> cpuShares := uint64(c.HostConfig.CPUShares)
<ide><path>daemon/start_windows.go
<ide> func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Contain
<ide> layerOpts.LayerPaths = append([]string{layerPath}, layerOpts.LayerPaths...)
<ide> }
<ide>
<add> // Get endpoints for the libnetwork allocated networks to the container
<add> var epList []string
<add> if container.NetworkSettings != nil {
<add> for n := range container.NetworkSettings.Networks {
<add> sn, err := daemon.FindNetwork(n)
<add> if err != nil {
<add> continue
<add> }
<add>
<add> ep, err := container.GetEndpointInNetwork(sn)
<add> if err != nil {
<add> continue
<add> }
<add>
<add> data, err := ep.DriverInfo()
<add> if err != nil {
<add> continue
<add> }
<add> if data["hnsid"] != nil {
<add> epList = append(epList, data["hnsid"].(string))
<add> }
<add> }
<add> }
<add>
<ide> // Now build the full set of options
<ide> createOptions = append(createOptions, &libcontainerd.FlushOption{IgnoreFlushesDuringBoot: !container.HasBeenStartedBefore})
<ide> createOptions = append(createOptions, hvOpts)
<ide> createOptions = append(createOptions, layerOpts)
<add> if epList != nil {
<add> createOptions = append(createOptions, &libcontainerd.NetworkEndpointsOption{Endpoints: epList})
<add> }
<ide>
<ide> return &createOptions, nil
<ide> }
<ide><path>libcontainerd/client_windows.go
<ide> func (clnt *client) Create(containerID string, checkpoint string, checkpointDir
<ide> HvPartition: false,
<ide> }
<ide>
<del> if spec.Windows.Networking != nil {
<del> configuration.EndpointList = spec.Windows.Networking.EndpointList
<del> }
<del>
<ide> if spec.Windows.Resources != nil {
<ide> if spec.Windows.Resources.CPU != nil {
<ide> if spec.Windows.Resources.CPU.Shares != nil {
<ide> func (clnt *client) Create(containerID string, checkpoint string, checkpointDir
<ide> }
<ide> if l, ok := option.(*LayerOption); ok {
<ide> layerOpt = l
<add> }
<add> if n, ok := option.(*NetworkEndpointsOption); ok {
<add> configuration.EndpointList = n.Endpoints
<ide> continue
<ide> }
<ide> }
<ide><path>libcontainerd/types_windows.go
<ide> type Stats hcsshim.Statistics
<ide> // Resources defines updatable container resource values.
<ide> type Resources struct{}
<ide>
<del>// ServicingOption is an empty CreateOption with a no-op application that signifies
<add>// ServicingOption is a CreateOption with a no-op application that signifies
<ide> // the container needs to be used for a Windows servicing operation.
<ide> type ServicingOption struct {
<ide> IsServicing bool
<ide> }
<ide>
<del>// FlushOption is an empty CreateOption that signifies if the container should be
<add>// FlushOption is a CreateOption that signifies if the container should be
<ide> // started with flushes ignored until boot has completed. This is an optimisation
<ide> // for first boot of a container.
<ide> type FlushOption struct {
<ide> type LayerOption struct {
<ide> LayerPaths []string
<ide> }
<ide>
<add>// NetworkEndpointsOption is a CreateOption that provides the runtime list
<add>// of network endpoints to which a container should be attached during its creation.
<add>type NetworkEndpointsOption struct {
<add> Endpoints []string
<add>}
<add>
<ide> // Checkpoint holds the details of a checkpoint (not supported in windows)
<ide> type Checkpoint struct {
<ide> Name string
<ide><path>libcontainerd/utils_windows.go
<ide> func (h *HyperVIsolationOption) Apply(interface{}) error {
<ide> func (h *LayerOption) Apply(interface{}) error {
<ide> return nil
<ide> }
<add>
<add>// Apply for the network endpoints option is a no-op.
<add>func (s *NetworkEndpointsOption) Apply(interface{}) error {
<add> return nil
<add>}
<ide><path>libcontainerd/windowsoci/oci_windows.go
<ide> type Spec struct {
<ide> type Windows struct {
<ide> // Resources contains information for handling resource constraints for the container
<ide> Resources *WindowsResources `json:"resources,omitempty"`
<del> // Networking contains the platform specific network settings for the container.
<del> Networking *WindowsNetworking `json:"networking,omitempty"`
<ide> }
<ide>
<ide> // Process contains information to start a specific application inside the container.
<ide> type Mount struct {
<ide> Options []string `json:"options,omitempty"`
<ide> }
<ide>
<del>// WindowsNetworking contains the platform specific network settings for the container
<del>type WindowsNetworking struct {
<del> // List of endpoints to be attached to the container
<del> EndpointList []string `json:"endpoints,omitempty"`
<del>}
<del>
<ide> // WindowsStorage contains storage resource management settings
<ide> type WindowsStorage struct {
<ide> // Specifies maximum Iops for the system drive | 6 |
Ruby | Ruby | use an if statement instead of a case statement | 2c3ba1fb40609918db0264ccace00b3a058a3588 | <ide><path>actionpack/lib/action_dispatch/http/url.rb
<ide> def port
<ide> # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080'
<ide> # req.standard_port # => 80
<ide> def standard_port
<del> case protocol
<del> when "https://" then 443
<del> else 80
<add> if "https://" == protocol
<add> 443
<add> else
<add> 80
<ide> end
<ide> end
<ide> | 1 |
Ruby | Ruby | add parentheses to if statement | 322d5c67ec636dd44ce17f835dd6ec5cd36a9625 | <ide><path>Library/Homebrew/cask/cask.rb
<ide> def outdated_versions(greedy: false, greedy_latest: false, greedy_auto_updates:
<ide> # special case: tap version is not available
<ide> return [] if version.nil?
<ide>
<del> if greedy || greedy_latest && greedy_auto_updates || greedy_auto_updates && auto_updates
<add> if greedy || (greedy_latest && greedy_auto_updates) || (greedy_auto_updates && auto_updates)
<ide> return versions if version.latest?
<ide> elsif greedy_latest && version.latest?
<ide> return versions | 1 |
Javascript | Javascript | fix the clerical error | f1b13681b425bd3384c856a23be060c8b4b5b071 | <ide><path>website/src/react-native/index.js
<ide> var GeoInfo = React.createClass({
<ide> - (void)processString:(NSString *)input callback:(RCTResponseSenderBlock)callback
<ide> {
<ide> RCT_EXPORT(); // available as NativeModules.MyCustomModule.processString
<del> callback(@[[input stringByReplacingOccurrencesOfString:@"Goodbye" withString:@"Hello"];]]);
<add> callback(@[[input stringByReplacingOccurrencesOfString:@"Goodbye" withString:@"Hello"]]);
<ide> }
<ide> @end`}
<ide> </Prism> | 1 |
PHP | PHP | apply fixes from styleci | e656932002588bcaaa94476f1ed1850747eb4708 | <ide><path>app/Http/Controllers/Auth/RegisterController.php
<ide>
<ide> namespace App\Http\Controllers\Auth;
<ide>
<del>use App\User;
<ide> use App\Http\Controllers\Controller;
<add>use App\User;
<add>use Illuminate\Foundation\Auth\RegistersUsers;
<ide> use Illuminate\Support\Facades\Hash;
<ide> use Illuminate\Support\Facades\Validator;
<del>use Illuminate\Foundation\Auth\RegistersUsers;
<ide>
<ide> class RegisterController extends Controller
<ide> {
<ide><path>app/Http/Controllers/Controller.php
<ide>
<ide> namespace App\Http\Controllers;
<ide>
<add>use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
<ide> use Illuminate\Foundation\Bus\DispatchesJobs;
<del>use Illuminate\Routing\Controller as BaseController;
<ide> use Illuminate\Foundation\Validation\ValidatesRequests;
<del>use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
<add>use Illuminate\Routing\Controller as BaseController;
<ide>
<ide> class Controller extends BaseController
<ide> {
<ide><path>app/Http/Middleware/TrustProxies.php
<ide>
<ide> namespace App\Http\Middleware;
<ide>
<del>use Illuminate\Http\Request;
<ide> use Fideloper\Proxy\TrustProxies as Middleware;
<add>use Illuminate\Http\Request;
<ide>
<ide> class TrustProxies extends Middleware
<ide> {
<ide><path>app/Providers/AuthServiceProvider.php
<ide>
<ide> namespace App\Providers;
<ide>
<del>use Illuminate\Support\Facades\Gate;
<ide> use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
<add>use Illuminate\Support\Facades\Gate;
<ide>
<ide> class AuthServiceProvider extends ServiceProvider
<ide> {
<ide><path>app/Providers/BroadcastServiceProvider.php
<ide>
<ide> namespace App\Providers;
<ide>
<del>use Illuminate\Support\ServiceProvider;
<ide> use Illuminate\Support\Facades\Broadcast;
<add>use Illuminate\Support\ServiceProvider;
<ide>
<ide> class BroadcastServiceProvider extends ServiceProvider
<ide> {
<ide><path>app/Providers/EventServiceProvider.php
<ide>
<ide> namespace App\Providers;
<ide>
<del>use Illuminate\Support\Facades\Event;
<ide> use Illuminate\Auth\Events\Registered;
<ide> use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
<ide> use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
<add>use Illuminate\Support\Facades\Event;
<ide>
<ide> class EventServiceProvider extends ServiceProvider
<ide> {
<ide><path>app/Providers/RouteServiceProvider.php
<ide>
<ide> namespace App\Providers;
<ide>
<del>use Illuminate\Support\Facades\Route;
<ide> use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
<add>use Illuminate\Support\Facades\Route;
<ide>
<ide> class RouteServiceProvider extends ServiceProvider
<ide> {
<ide><path>app/User.php
<ide>
<ide> namespace App;
<ide>
<del>use Illuminate\Notifications\Notifiable;
<ide> use Illuminate\Contracts\Auth\MustVerifyEmail;
<ide> use Illuminate\Foundation\Auth\User as Authenticatable;
<add>use Illuminate\Notifications\Notifiable;
<ide>
<ide> class User extends Authenticatable
<ide> {
<ide><path>database/factories/UserFactory.php
<ide>
<ide> /** @var \Illuminate\Database\Eloquent\Factory $factory */
<ide> use App\User;
<del>use Illuminate\Support\Str;
<ide> use Faker\Generator as Faker;
<add>use Illuminate\Support\Str;
<ide>
<ide> /*
<ide> |--------------------------------------------------------------------------
<ide><path>database/migrations/2014_10_12_000000_create_users_table.php
<ide> <?php
<ide>
<del>use Illuminate\Support\Facades\Schema;
<del>use Illuminate\Database\Schema\Blueprint;
<ide> use Illuminate\Database\Migrations\Migration;
<add>use Illuminate\Database\Schema\Blueprint;
<add>use Illuminate\Support\Facades\Schema;
<ide>
<ide> class CreateUsersTable extends Migration
<ide> {
<ide><path>database/migrations/2014_10_12_100000_create_password_resets_table.php
<ide> <?php
<ide>
<del>use Illuminate\Support\Facades\Schema;
<del>use Illuminate\Database\Schema\Blueprint;
<ide> use Illuminate\Database\Migrations\Migration;
<add>use Illuminate\Database\Schema\Blueprint;
<add>use Illuminate\Support\Facades\Schema;
<ide>
<ide> class CreatePasswordResetsTable extends Migration
<ide> {
<ide><path>database/migrations/2019_08_19_000000_create_failed_jobs_table.php
<ide> <?php
<ide>
<del>use Illuminate\Support\Facades\Schema;
<del>use Illuminate\Database\Schema\Blueprint;
<ide> use Illuminate\Database\Migrations\Migration;
<add>use Illuminate\Database\Schema\Blueprint;
<add>use Illuminate\Support\Facades\Schema;
<ide>
<ide> class CreateFailedJobsTable extends Migration
<ide> {
<ide><path>tests/Bootstrap.php
<ide>
<ide> namespace Tests;
<ide>
<add>use Illuminate\Contracts\Console\Kernel;
<ide> use PHPUnit\Runner\AfterLastTestHook;
<ide> use PHPUnit\Runner\BeforeFirstTestHook;
<del>use Illuminate\Contracts\Console\Kernel;
<ide>
<ide> class Bootstrap implements BeforeFirstTestHook, AfterLastTestHook
<ide> {
<ide><path>tests/Feature/ExampleTest.php
<ide>
<ide> namespace Tests\Feature;
<ide>
<del>use Tests\TestCase;
<ide> use Illuminate\Foundation\Testing\RefreshDatabase;
<add>use Tests\TestCase;
<ide>
<ide> class ExampleTest extends TestCase
<ide> {
<ide><path>tests/Unit/ExampleTest.php
<ide>
<ide> namespace Tests\Unit;
<ide>
<del>use Tests\TestCase;
<ide> use Illuminate\Foundation\Testing\RefreshDatabase;
<add>use Tests\TestCase;
<ide>
<ide> class ExampleTest extends TestCase
<ide> { | 15 |
Java | Java | remove unused imports | 5356fe475567bfbf1e6d37fa3cb4316b7075669c | <ide><path>src/test/java/io/reactivex/processors/UnicastProcessorTest.java
<ide>
<ide> package io.reactivex.processors;
<ide>
<del>import org.junit.Test;
<ide> import static org.junit.Assert.assertEquals;
<ide>
<ide> import java.util.concurrent.atomic.AtomicBoolean;
<ide>
<add>import org.junit.Test;
<add>
<add>import io.reactivex.Observable;
<add>import io.reactivex.disposables.Disposable;
<ide> import io.reactivex.internal.fuseable.QueueSubscription;
<ide> import io.reactivex.subscribers.*;
<del>import io.reactivex.observers.*;
<del>import io.reactivex.*;
<del>import io.reactivex.disposables.*;
<ide>
<ide> public class UnicastProcessorTest {
<ide>
<ide><path>src/test/java/io/reactivex/subjects/UnicastSubjectTest.java
<ide>
<ide> package io.reactivex.subjects;
<ide>
<del>import io.reactivex.Observable;
<del>import io.reactivex.disposables.Disposable;
<del>import java.util.concurrent.atomic.AtomicBoolean;
<ide> import static org.junit.Assert.assertEquals;
<add>
<add>import java.util.concurrent.atomic.AtomicBoolean;
<add>
<ide> import org.junit.Test;
<ide>
<add>import io.reactivex.Observable;
<add>import io.reactivex.disposables.Disposable;
<ide> import io.reactivex.internal.fuseable.QueueDisposable;
<ide> import io.reactivex.observers.*;
<del>import io.reactivex.*;
<ide>
<ide> public class UnicastSubjectTest {
<ide> | 2 |
PHP | PHP | change language files | ef958716c37fcdf0ea80bb89ba0c93394ae0b157 | <ide><path>resources/lang/en/auth.php
<add><?php
<add>
<add>return [
<add>
<add> /*
<add> |--------------------------------------------------------------------------
<add> | Authentication Language Lines
<add> |--------------------------------------------------------------------------
<add> |
<add> | The following language lines are used during authentication for various
<add> | messages that we need to display to the user. You are free to modify
<add> | these language lines according to your application's requirements.
<add> |
<add> */
<add>
<add> 'failed' => 'These credentials do not match our records.',
<add> 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
<add>
<add>];
<ide><path>resources/lang/en/passwords.php
<ide> 'password' => 'Passwords must be at least six characters and match the confirmation.',
<ide> 'reset' => 'Your password has been reset!',
<ide> 'sent' => 'We have e-mailed your password reset link!',
<del> 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
<ide> 'token' => 'This password reset token is invalid.',
<ide> 'user' => "We can't find a user with that e-mail address.",
<ide> | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.