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
Go
Go
enable cross-platforms login to registry
960710bd810e70b7c06b77b956c7bf8cdfeb15f8
<ide><path>api/client/login.go <ide> import ( <ide> // <ide> // Usage: docker login SERVER <ide> func (cli *DockerCli) CmdLogin(args ...string) error { <del> cmd := Cli.Subcmd("login", []string{"[SERVER]"}, Cli.DockerCommands["login"].Description+".\nIf no server is specified \""+registry.IndexServer+"\" is the default.", true) <add> cmd := Cli.Subcmd("login", []string{"[SERVER]"}, Cli.DockerCommands["login"].Description+".\nIf no server is specified, the default is defined by the daemon.", true) <ide> cmd.Require(flag.Max, 1) <ide> <ide> flUser := cmd.String([]string{"u", "-username"}, "", "Username") <ide> func (cli *DockerCli) CmdLogin(args ...string) error { <ide> cli.in = os.Stdin <ide> } <ide> <add> // The daemon `/info` endpoint informs us of the default registry being <add> // used. This is essential in cross-platforms environment, where for <add> // example a Linux client might be interacting with a Windows daemon, hence <add> // the default registry URL might be Windows specific. <ide> serverAddress := registry.IndexServer <add> if info, err := cli.client.Info(); err != nil { <add> fmt.Fprintf(cli.out, "Warning: failed to get default registry endpoint from daemon (%v). Using system default: %s\n", err, serverAddress) <add> } else { <add> serverAddress = info.IndexServerAddress <add> } <ide> if len(cmd.Args()) > 0 { <ide> serverAddress = cmd.Arg(0) <ide> }
1
Python
Python
add pathlib in cli tests
1b5f21e015e2c4f36fcdb34a09ce93787d59e181
<ide><path>tests/test_cli.py <ide> import sys <ide> import types <ide> from functools import partial <add>from pathlib import Path <ide> from unittest.mock import patch <ide> <ide> import click <ide> from flask.cli import ScriptInfo <ide> from flask.cli import with_appcontext <ide> <del>cwd = os.getcwd() <del>test_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "test_apps")) <add>cwd = Path.cwd() <add>test_path = (Path(__file__) / ".." / "test_apps").resolve() <ide> <ide> <ide> @pytest.fixture <ide> def create_app(): <ide> ( <ide> ("test", cwd, "test"), <ide> ("test.py", cwd, "test"), <del> ("a/test", os.path.join(cwd, "a"), "test"), <add> ("a/test", cwd / "a", "test"), <ide> ("test/__init__.py", cwd, "test"), <ide> ("test/__init__", cwd, "test"), <ide> # nested package <ide> ( <del> os.path.join(test_path, "cliapp", "inner1", "__init__"), <add> test_path / "cliapp" / "inner1" / "__init__", <ide> test_path, <ide> "cliapp.inner1", <ide> ), <ide> ( <del> os.path.join(test_path, "cliapp", "inner1", "inner2"), <add> test_path / "cliapp" / "inner1" / "inner2", <ide> test_path, <ide> "cliapp.inner1.inner2", <ide> ), <ide> # dotted name <ide> ("test.a.b", cwd, "test.a.b"), <del> (os.path.join(test_path, "cliapp.app"), test_path, "cliapp.app"), <add> (test_path / "cliapp.app", test_path, "cliapp.app"), <ide> # not a Python file, will be caught during import <del> ( <del> os.path.join(test_path, "cliapp", "message.txt"), <del> test_path, <del> "cliapp.message.txt", <del> ), <add> (test_path / "cliapp" / "message.txt", test_path, "cliapp.message.txt"), <ide> ), <ide> ) <ide> def test_prepare_import(request, value, path, result): <ide> def reset_path(): <ide> request.addfinalizer(reset_path) <ide> <ide> assert prepare_import(value) == result <del> assert sys.path[0] == path <add> assert sys.path[0] == str(path) <ide> <ide> <ide> @pytest.mark.parametrize( <ide> def test_scriptinfo(test_apps, monkeypatch): <ide> assert obj.load_app() is app <ide> <ide> # import app with module's absolute path <del> cli_app_path = os.path.abspath( <del> os.path.join(os.path.dirname(__file__), "test_apps", "cliapp", "app.py") <del> ) <add> cli_app_path = str(test_path / "cliapp" / "app.py") <add> <ide> obj = ScriptInfo(app_import_path=cli_app_path) <ide> app = obj.load_app() <ide> assert app.name == "testapp" <ide> def create_app(): <ide> pytest.raises(NoAppException, obj.load_app) <ide> <ide> # import app from wsgi.py in current directory <del> monkeypatch.chdir( <del> os.path.abspath( <del> os.path.join(os.path.dirname(__file__), "test_apps", "helloworld") <del> ) <del> ) <add> monkeypatch.chdir(test_path / "helloworld") <ide> obj = ScriptInfo() <ide> app = obj.load_app() <ide> assert app.name == "hello" <ide> <ide> # import app from app.py in current directory <del> monkeypatch.chdir( <del> os.path.abspath(os.path.join(os.path.dirname(__file__), "test_apps", "cliapp")) <del> ) <add> monkeypatch.chdir(test_path / "cliapp") <ide> obj = ScriptInfo() <ide> app = obj.load_app() <ide> assert app.name == "testapp" <ide> def test_load_dotenv(monkeypatch): <ide> monkeypatch.setenv("EGGS", "3") <ide> monkeypatch.chdir(test_path) <ide> assert load_dotenv() <del> assert os.getcwd() == test_path <add> assert Path.cwd() == test_path <ide> # .flaskenv doesn't overwrite .env <ide> assert os.environ["FOO"] == "env" <ide> # set only in .flaskenv <ide> def test_dotenv_path(monkeypatch): <ide> for item in ("FOO", "BAR", "EGGS"): <ide> monkeypatch._setitem.append((os.environ, item, notset)) <ide> <del> cwd = os.getcwd() <del> load_dotenv(os.path.join(test_path, ".flaskenv")) <del> assert os.getcwd() == cwd <add> load_dotenv(test_path / ".flaskenv") <add> assert Path.cwd() == cwd <ide> assert "FOO" in os.environ <ide> <ide>
1
PHP
PHP
get argument order
73d8e2f2fab62207c9264f2f3d09cb6bcbfc88f0
<ide><path>system/arr.php <ide> class Arr { <ide> /** <ide> * Get an item from an array. <ide> * <del> * @param string $key <del> * @param string $default <ide> * @param array $array <add> * @param string $key <add> * @param array $default <ide> * @return mixed <ide> */ <del> public static function get($key, $default = null, $array = array()) <add> public static function get($array, $key, $default = null) <ide> { <ide> if (is_null($key)) <ide> { <ide><path>system/input.php <ide> public static function get($key = null, $default = null) <ide> static::hydrate(); <ide> } <ide> <del> return Arr::get($key, $default, static::$input); <add> return Arr::get(static::$input, $key, $default); <ide> } <ide> <ide> /** <ide> public static function old($key = null, $default = null) <ide> throw new \Exception("Sessions must be enabled to retrieve old input data."); <ide> } <ide> <del> return Arr::get($key, $default, Session::get('laravel_old_input', array())); <add> return Arr::get(Session::get('laravel_old_input', array()), $key, $default); <ide> } <ide> <ide> /**
2
Text
Text
remove note related to format.js [ci skip]
8019ad72ea5c5bb4fd5c0e2c56c050858d7bc2c1
<ide><path>guides/source/working_with_javascript_in_rails.md <ide> $(document).ready -> <ide> Obviously, you'll want to be a bit more sophisticated than that, but it's a <ide> start. You can see more about the events [in the jquery-ujs wiki](https://github.com/rails/jquery-ujs/wiki/ajax). <ide> <del> <del>NOTE: If javascript is disabled in the user browser, `format.html { ... }` <del>block should be executed as fallback. <del> <ide> ### form_tag <ide> <ide> [`form_tag`](http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-form_tag)
1
Javascript
Javascript
remove pdfworker from cache after detsroy
9b1b160d4f6f293488bed497678836908525f1a3
<ide><path>src/display/api.js <ide> var PDFWorker = (function PDFWorkerClosure() { <ide> this._webWorker.terminate(); <ide> this._webWorker = null; <ide> } <add> pdfWorkerPorts.delete(this._port); <ide> this._port = null; <ide> if (this._messageHandler) { <ide> this._messageHandler.destroy();
1
Java
Java
handle webview provider missing exception
3f3394a5668d515e3476933aec67f07794c6e765
<ide><path>ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java <ide> protected void doInBackgroundGuarded(Void... params) { <ide> // https://bugs.chromium.org/p/chromium/issues/detail?id=559720 <ide> return null; <ide> } catch (Exception exception) { <del> String message = exception.getMessage(); <del> // We cannot catch MissingWebViewPackageException as it is in a private / system API <del> // class. This validates the exception's message to ensure we are only handling this <del> // specific exception. <del> // The exception class doesn't always contain the correct name as it depends on the OEM <del> // and OS version. It is better to check the message for clues regarding the exception <del> // as that is somewhat consistent across OEMs. <del> // For instance, the Exception thrown on OxygenOS 11 is a RuntimeException but the message <del> // contains the required strings. <del> // https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java#348 <del> if (exception.getClass().getCanonicalName().contains("MissingWebViewPackageException") <del> || (message != null <del> && (message.contains("WebView provider") <del> || message.contains("No WebView installed") <del> || message.contains("Cannot load WebView") <del> || message.contains("disableWebView") <del> || message.contains("WebView is disabled")))) { <del> return null; <del> } else { <del> throw exception; <del> } <add> // Ideally we would like to catch a `MissingWebViewPackageException` here. <add> // That API is private so we can't access it. <add> // Historically we used string matching on the error message to understand <add> // if the exception was a Missing Webview One. <add> // OEMs have been customizing that message making really hard to catch it. <add> // Therefore we result to returning null as a default instead of rethrowing <add> // the exception as it will result in a app crash at runtime. <add> // a) We will return null for all the other unhandled conditions when a webview provider is <add> // not found. <add> // b) We already have null checks in place for `getCookieManager()` calls. <add> // c) We have annotated the method as @Nullable to notify future devs about our return type. <add> return null; <ide> } <ide> } <ide>
1
Javascript
Javascript
add default material
654e95dc47d1a143efdf074d9a6736ef0531f901
<ide><path>examples/js/loaders/GLTFLoader.js <ide> THREE.GLTFLoader = ( function () { <ide> <ide> } <ide> <add> function createDefaultMaterial() { <add> <add> return new THREE.MeshPhongMaterial( { <add> color: 0x00000, <add> emissive: 0x888888, <add> specular: 0x000000, <add> shininess: 0, <add> transparent: false, <add> depthTest: true, <add> side: THREE.FrontSide <add> } ); <add> <add> }; <add> <ide> // Deferred constructor for RawShaderMaterial types <ide> function DeferredShaderMaterial( params ) { <ide>
1
Javascript
Javascript
make polyfills and globals lazy
9a3a082225277ff65857ac046fa09edb51702367
<ide><path>Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js <ide> <ide> const BatchedBridge = require('BatchedBridge'); <ide> const RemoteModules = BatchedBridge.RemoteModules; <add>const Platform = require('Platform'); <ide> <ide> function normalizePrefix(moduleName: string): string { <ide> return moduleName.replace(/^(RCT|RK)/, ''); <ide> Object.keys(RemoteModules).forEach((moduleName) => { <ide> * the call sites accessing NativeModules.UIManager directly have <ide> * been removed #9344445 <ide> */ <del>const UIManager = NativeModules.UIManager; <del>UIManager && Object.keys(UIManager).forEach(viewName => { <del> const viewConfig = UIManager[viewName]; <del> if (viewConfig.Manager) { <del> let constants; <del> /* $FlowFixMe - nice try. Flow doesn't like getters */ <del> Object.defineProperty(viewConfig, 'Constants', { <del> configurable: true, <del> enumerable: true, <del> get: () => { <del> if (constants) { <add>if (Platform.OS === 'ios') { <add> const UIManager = NativeModules.UIManager; <add> UIManager && Object.keys(UIManager).forEach(viewName => { <add> const viewConfig = UIManager[viewName]; <add> if (viewConfig.Manager) { <add> let constants; <add> /* $FlowFixMe - nice try. Flow doesn't like getters */ <add> Object.defineProperty(viewConfig, 'Constants', { <add> configurable: true, <add> enumerable: true, <add> get: () => { <add> if (constants) { <add> return constants; <add> } <add> constants = {}; <add> const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)]; <add> viewManager && Object.keys(viewManager).forEach(key => { <add> const value = viewManager[key]; <add> if (typeof value !== 'function') { <add> constants[key] = value; <add> } <add> }); <ide> return constants; <del> } <del> constants = {}; <del> const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)]; <del> viewManager && Object.keys(viewManager).forEach(key => { <del> const value = viewManager[key]; <del> if (typeof value !== 'function') { <del> constants[key] = value; <add> }, <add> }); <add> let commands; <add> /* $FlowFixMe - nice try. Flow doesn't like getters */ <add> Object.defineProperty(viewConfig, 'Commands', { <add> configurable: true, <add> enumerable: true, <add> get: () => { <add> if (commands) { <add> return commands; <ide> } <del> }); <del> return constants; <del> }, <del> }); <del> let commands; <del> /* $FlowFixMe - nice try. Flow doesn't like getters */ <del> Object.defineProperty(viewConfig, 'Commands', { <del> configurable: true, <del> enumerable: true, <del> get: () => { <del> if (commands) { <add> commands = {}; <add> const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)]; <add> viewManager && Object.keys(viewManager).forEach((key, index) => { <add> const value = viewManager[key]; <add> if (typeof value === 'function') { <add> commands[key] = index; <add> } <add> }); <ide> return commands; <del> } <del> commands = {}; <del> const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)]; <del> viewManager && Object.keys(viewManager).forEach((key, index) => { <del> const value = viewManager[key]; <del> if (typeof value === 'function') { <del> commands[key] = index; <del> } <del> }); <del> return commands; <del> }, <del> }); <del> } <del>}); <add> }, <add> }); <add> } <add> }); <add>} <ide> <ide> module.exports = NativeModules; <ide><path>Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js <ide> function polyfillGlobal(name, newValue, scope = GLOBAL) { <ide> Object.defineProperty(scope, name, {...descriptor, value: newValue}); <ide> } <ide> <add>function polyfillLazyGlobal(name, valueFn, scope = GLOBAL) { <add> if (scope[name] !== undefined) { <add> const descriptor = Object.getOwnPropertyDescriptor(scope, name); <add> const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`; <add> Object.defineProperty(scope, backupName, {...descriptor, value: scope[name]}); <add> } <add> <add> Object.defineProperty(scope, name, { <add> configurable: true, <add> enumerable: true, <add> get() { <add> return this[name] = valueFn(); <add> }, <add> set(value) { <add> Object.defineProperty(this, name, { <add> configurable: true, <add> enumerable: true, <add> value <add> }); <add> } <add> }); <add>} <add> <ide> /** <ide> * Polyfill a module if it is not already defined in `scope`. <ide> */ <ide> function setUpErrorHandler() { <ide> * unexplainably dropped timing signals. <ide> */ <ide> function setUpTimers() { <del> var JSTimers = require('JSTimers'); <del> GLOBAL.setTimeout = JSTimers.setTimeout; <del> GLOBAL.setInterval = JSTimers.setInterval; <del> GLOBAL.setImmediate = JSTimers.setImmediate; <del> GLOBAL.clearTimeout = JSTimers.clearTimeout; <del> GLOBAL.clearInterval = JSTimers.clearInterval; <del> GLOBAL.clearImmediate = JSTimers.clearImmediate; <del> GLOBAL.cancelAnimationFrame = JSTimers.clearInterval; <del> GLOBAL.requestAnimationFrame = function(cb) { <del> /*requestAnimationFrame() { [native code] };*/ // Trick scroller library <del> return JSTimers.requestAnimationFrame(cb); // into thinking it's native <add> const defineLazyTimer = (name) => { <add> polyfillLazyGlobal(name, () => require('JSTimers')[name]); <ide> }; <add> defineLazyTimer('setTimeout'); <add> defineLazyTimer('setInterval'); <add> defineLazyTimer('setImmediate'); <add> defineLazyTimer('clearTimeout'); <add> defineLazyTimer('clearInterval'); <add> defineLazyTimer('clearImmediate'); <add> defineLazyTimer('requestAnimationFrame'); <add> defineLazyTimer('cancelAnimationFrame'); <ide> } <ide> <ide> function setUpAlert() { <ide> function setUpAlert() { <ide> function setUpPromise() { <ide> // The native Promise implementation throws the following error: <ide> // ERROR: Event loop not supported. <del> GLOBAL.Promise = require('Promise'); <add> polyfillLazyGlobal('Promise', () => require('Promise')); <ide> } <ide> <ide> function setUpXHR() { <ide> // The native XMLHttpRequest in Chrome dev tools is CORS aware and won't <ide> // let you fetch anything from the internet <del> polyfillGlobal('XMLHttpRequest', require('XMLHttpRequest')); <del> polyfillGlobal('FormData', require('FormData')); <add> polyfillLazyGlobal('XMLHttpRequest', () => require('XMLHttpRequest')); <add> polyfillLazyGlobal('FormData', () => require('FormData')); <ide> <del> var fetchPolyfill = require('fetch'); <del> polyfillGlobal('fetch', fetchPolyfill.fetch); <del> polyfillGlobal('Headers', fetchPolyfill.Headers); <del> polyfillGlobal('Request', fetchPolyfill.Request); <del> polyfillGlobal('Response', fetchPolyfill.Response); <add> polyfillLazyGlobal('fetch', () => require('fetch').fetch); <add> polyfillLazyGlobal('Headers', () => require('fetch').Headers); <add> polyfillLazyGlobal('Request', () => require('fetch').Request); <add> polyfillLazyGlobal('Response', () => require('fetch').Response); <ide> } <ide> <ide> function setUpGeolocation() { <ide> function setUpGeolocation() { <ide> enumerable: true, <ide> configurable: true, <ide> }); <del> polyfillGlobal('geolocation', require('Geolocation'), GLOBAL.navigator); <add> polyfillLazyGlobal('geolocation', () => require('Geolocation'), GLOBAL.navigator); <ide> } <ide> <ide> function setUpMapAndSet() { <add> // We can't make these lazy as Map checks the global.Map to see if it's <add> // available but in our case it'll be a lazy getter. <ide> polyfillGlobal('Map', require('Map')); <ide> polyfillGlobal('Set', require('Set')); <ide> } <ide> function setUpProduct() { <ide> } <ide> <ide> function setUpWebSockets() { <del> polyfillGlobal('WebSocket', require('WebSocket')); <add> polyfillLazyGlobal('WebSocket', () => require('WebSocket')); <ide> } <ide> <ide> function setUpProfile() {
2
Python
Python
set segmentation loss weight to 0.5
2e9081986f2f9261c8f78e7dae71f336f1647dc5
<ide><path>official/vision/beta/projects/panoptic_maskrcnn/configs/panoptic_maskrcnn.py <ide> class Losses(maskrcnn.Losses): <ide> semantic_segmentation_use_groundtruth_dimension: bool = True <ide> semantic_segmentation_top_k_percent_pixels: float = 1.0 <ide> instance_segmentation_weight: float = 1.0 <del> semantic_segmentation_weight: float = 1.0 <add> semantic_segmentation_weight: float = 0.5 <ide> <ide> <ide> @dataclasses.dataclass <ide> def panoptic_fpn_coco() -> cfg.ExperimentConfig: <ide> is_thing.append(True if idx <= num_thing_categories else False) <ide> <ide> config = cfg.ExperimentConfig( <del> runtime=cfg.RuntimeConfig(mixed_precision_dtype='bfloat16'), <add> runtime=cfg.RuntimeConfig( <add> mixed_precision_dtype='bfloat16', enable_xla=True), <ide> task=PanopticMaskRCNNTask( <ide> init_checkpoint='gs://cloud-tpu-checkpoints/vision-2.0/resnet50_imagenet/ckpt-28080', # pylint: disable=line-too-long <ide> init_checkpoint_modules=['backbone'],
1
Javascript
Javascript
add path of project to the doc gen config
9ca685bfbdbb63794c8e203936cdd383ff8745a5
<ide><path>docs/docs.config.js <ide> module.exports = function(config) { <ide> <ide> config = basePackage(config); <ide> <add> config.set('source.projectPath', path.resolve(basePath, '..')); <add> <ide> config.set('source.files', [ <ide> { pattern: 'src/**/*.js', basePath: path.resolve(basePath,'..') }, <ide> { pattern: '**/*.ngdoc', basePath: path.resolve(basePath, 'content') }
1
Javascript
Javascript
replace assert.throws w/ common.expectserror
0005846f033ae9866a6bc5dbbe7f73c6aeb67185
<ide><path>test/parallel/test-buffer-alloc.js <ide> new Buffer('', 'latin1'); <ide> new Buffer('', 'binary'); <ide> Buffer(0); <ide> <add>const outOfBoundsError = { <add> code: 'ERR_BUFFER_OUT_OF_BOUNDS', <add> type: RangeError <add>}; <add> <ide> // try to write a 0-length string beyond the end of b <del>common.expectsError( <del> () => b.write('', 2048), <del> { <del> code: 'ERR_BUFFER_OUT_OF_BOUNDS', <del> type: RangeError <del> } <del>); <add>common.expectsError(() => b.write('', 2048), outOfBoundsError); <ide> <ide> // throw when writing to negative offset <del>common.expectsError( <del> () => b.write('a', -1), <del> { <del> code: 'ERR_BUFFER_OUT_OF_BOUNDS', <del> type: RangeError <del> } <del>); <add>common.expectsError(() => b.write('a', -1), outOfBoundsError); <ide> <ide> // throw when writing past bounds from the pool <del>common.expectsError( <del> () => b.write('a', 2048), <del> { <del> code: 'ERR_BUFFER_OUT_OF_BOUNDS', <del> type: RangeError <del> } <del>); <add>common.expectsError(() => b.write('a', 2048), outOfBoundsError); <ide> <ide> // throw when writing to negative offset <del>common.expectsError( <del> () => b.write('a', -1), <del> { <del> code: 'ERR_BUFFER_OUT_OF_BOUNDS', <del> type: RangeError <del> } <del>); <add>common.expectsError(() => b.write('a', -1), outOfBoundsError); <ide> <ide> // try to copy 0 bytes worth of data into an empty buffer <ide> b.copy(Buffer.alloc(0), 0, 0, 0); <ide> assert.strictEqual(Buffer.from('13.37').length, 5); <ide> Buffer.from(Buffer.allocUnsafe(0), 0, 0); <ide> <ide> // issue GH-5587 <del>assert.throws(() => Buffer.alloc(8).writeFloatLE(0, 5), RangeError); <del>assert.throws(() => Buffer.alloc(16).writeDoubleLE(0, 9), RangeError); <add>common.expectsError( <add> () => Buffer.alloc(8).writeFloatLE(0, 5), <add> outOfBoundsError <add>); <add>common.expectsError( <add> () => Buffer.alloc(16).writeDoubleLE(0, 9), <add> outOfBoundsError <add>); <ide> <ide> // attempt to overflow buffers, similar to previous bug in array buffers <del>assert.throws(() => Buffer.allocUnsafe(8).writeFloatLE(0.0, 0xffffffff), <del> RangeError); <del>assert.throws(() => Buffer.allocUnsafe(8).writeFloatLE(0.0, 0xffffffff), <del> RangeError); <del> <add>common.expectsError( <add> () => Buffer.allocUnsafe(8).writeFloatLE(0.0, 0xffffffff), <add> outOfBoundsError <add>); <add>common.expectsError( <add> () => Buffer.allocUnsafe(8).writeFloatLE(0.0, 0xffffffff), <add> outOfBoundsError <add>); <ide> <ide> // ensure negative values can't get past offset <del>assert.throws(() => Buffer.allocUnsafe(8).writeFloatLE(0.0, -1), RangeError); <del>assert.throws(() => Buffer.allocUnsafe(8).writeFloatLE(0.0, -1), RangeError); <del> <add>common.expectsError( <add> () => Buffer.allocUnsafe(8).writeFloatLE(0.0, -1), <add> outOfBoundsError <add>); <add>common.expectsError( <add> () => Buffer.allocUnsafe(8).writeFloatLE(0.0, -1), <add> outOfBoundsError <add>); <ide> <ide> // test for common write(U)IntLE/BE <ide> { <ide> common.expectsError(() => { <ide> const a = Buffer.alloc(1); <ide> const b = Buffer.alloc(1); <ide> a.copy(b, 0, 0x100000000, 0x100000001); <del>}, { <del> code: 'ERR_OUT_OF_RANGE', <del> type: RangeError <del>}); <add>}, outOfBoundsError); <ide> <ide> // Unpooled buffer (replaces SlowBuffer) <ide> {
1
Text
Text
graduate capturerejections to supported
9a85efaa7f5f22c6905bf47d672dd73738787437
<ide><path>doc/api/events.md <ide> myEmitter.emit('error', new Error('whoops!')); <ide> <ide> ## Capture rejections of promises <ide> <del>> Stability: 1 - captureRejections is experimental. <del> <ide> Using `async` functions with event handlers is problematic, because it <ide> can lead to an unhandled rejection in case of a thrown exception: <ide> <ide> emitter.emit('log'); <ide> added: <ide> - v13.4.0 <ide> - v12.16.0 <add>changes: <add> - version: REPLACEME <add> pr-url: https://github.com/nodejs/node/pull/41267 <add> description: No longer experimental. <ide> --> <ide> <del>> Stability: 1 - captureRejections is experimental. <del> <ide> * `err` Error <ide> * `eventName` {string|symbol} <ide> * `...args` {any} <ide> foo().then(() => console.log('done')); <ide> added: <ide> - v13.4.0 <ide> - v12.16.0 <add>changes: <add> - version: REPLACEME <add> pr-url: https://github.com/nodejs/node/pull/41267 <add> description: No longer experimental. <ide> --> <ide> <del>> Stability: 1 - captureRejections is experimental. <del> <ide> Value: {boolean} <ide> <ide> Change the default `captureRejections` option on all new `EventEmitter` objects. <ide> Change the default `captureRejections` option on all new `EventEmitter` objects. <ide> <ide> <!-- YAML <ide> added: <del> - v13.4.0 <del> - v12.16.0 <add> - v13.4.0 <add> - v12.16.0 <add>changes: <add> - version: REPLACEME <add> pr-url: https://github.com/nodejs/node/pull/41267 <add> description: No longer experimental. <ide> --> <ide> <del>> Stability: 1 - captureRejections is experimental. <del> <ide> Value: `Symbol.for('nodejs.rejection')` <ide> <ide> See how to write a custom [rejection handler][rejection].
1
Javascript
Javascript
add more options to map-bench
a6e69f8c08958a0909a60b53d048b21d181e90e5
<ide><path>benchmark/es/map-bench.js <ide> const common = require('../common.js'); <ide> const assert = require('assert'); <ide> <ide> const bench = common.createBenchmark(main, { <del> method: ['object', 'nullProtoObject', 'fakeMap', 'map'], <add> method: [ <add> 'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject', <add> 'fakeMap', 'map' <add> ], <ide> millions: [1] <ide> }); <ide> <ide> function runNullProtoObject(n) { <ide> bench.end(n / 1e6); <ide> } <ide> <add>function runNullProtoLiteralObject(n) { <add> const m = { __proto__: null }; <add> var i = 0; <add> bench.start(); <add> for (; i < n; i++) { <add> m['i' + i] = i; <add> m['s' + i] = String(i); <add> assert.strictEqual(String(m['i' + i]), m['s' + i]); <add> m['i' + i] = undefined; <add> m['s' + i] = undefined; <add> } <add> bench.end(n / 1e6); <add>} <add> <add>function StorageObject() {} <add>StorageObject.prototype = Object.create(null); <add> <add>function runStorageObject(n) { <add> const m = new StorageObject(); <add> var i = 0; <add> bench.start(); <add> for (; i < n; i++) { <add> m['i' + i] = i; <add> m['s' + i] = String(i); <add> assert.strictEqual(String(m['i' + i]), m['s' + i]); <add> m['i' + i] = undefined; <add> m['s' + i] = undefined; <add> } <add> bench.end(n / 1e6); <add>} <add> <ide> function fakeMap() { <ide> const m = {}; <ide> return { <ide> function main(conf) { <ide> case 'nullProtoObject': <ide> runNullProtoObject(n); <ide> break; <add> case 'nullProtoLiteralObject': <add> runNullProtoLiteralObject(n); <add> break; <add> case 'storageObject': <add> runStorageObject(n); <add> break; <ide> case 'fakeMap': <ide> runFakeMap(n); <ide> break;
1
Javascript
Javascript
catch getrouteentry errors
b095432e6d9750f65bab0a57a1f34019e352fd7c
<ide><path>Libraries/Core/ExceptionsManager.js <ide> function reportException( <ide> message = <ide> e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`; <ide> <del> const isHandledByLogBox = e.forceRedbox !== true && !global.RN$Bridgeless; <add> const isHandledByLogBox = <add> e.forceRedbox !== true && !global.RN$Bridgeless && !global.RN$Express; <ide> <ide> const data = preprocessException({ <ide> message, <ide> function reportException( <ide> <ide> NativeExceptionsManager.reportException(data); <ide> <del> if (__DEV__) { <add> if (__DEV__ && !global.RN$Express) { <ide> if (e.preventSymbolication === true) { <ide> return; <ide> }
1
PHP
PHP
fix failing tests on windows
e9dd234ef72644f972751608d8d13f5b2fceb7de
<ide><path>tests/TestCase/Console/Command/Task/PluginTaskTest.php <ide> public function testExecuteUpdateComposer() { <ide> <ide> $this->Task->expects($this->at(3)) <ide> ->method('callProcess') <del> ->with("cd '$path'; php 'composer.phar' dump-autoload"); <add> ->with('cd ' . escapeshellarg($path) . '; php ' . escapeshellarg('composer.phar') . ' dump-autoload'); <ide> <ide> $this->Task->main('BakeTestPlugin'); <ide>
1
Text
Text
add trpc to examples
65ea43f6d5bf6b1245835de02ad9974efa040a07
<ide><path>examples/with-trpc/README.md <add># Next.js + tRPC <add> <add>## Next.js + tRPC + Prisma starter <add> <add>- https://github.com/trpc/examples-next-prisma-starter <add> <add>## Next.js + tRPC + Prisma starter with websockets <add> <add>- https://github.com/trpc/examples-next-prisma-starter-websockets <add> <add>## Next.js + tRPC minimal implementation <add> <add>- https://github.com/trpc/examples-next-minimal-starter
1
Python
Python
remove performance claim
0ca5969ae7dcd1770f117d8c8782b7c4ec4e5ca4
<ide><path>numpy/core/fromnumeric.py <ide> def searchsorted(a, v, side='left', sorter=None): <ide> As of NumPy 1.4.0 `searchsorted` works with real/complex arrays containing <ide> `nan` values. The enhanced sort order is documented in `sort`. <ide> <del> This function is a faster version of the builtin python `bisect.bisect_left` <add> This function is a version of the builtin python `bisect.bisect_left` <ide> (``side='left'``) and `bisect.bisect_right` (``side='right'``) functions, <ide> which is also vectorized in the `v` argument. <ide>
1
Text
Text
add permissions doc
bf5482216bc80cee609590c518ea9415358c931f
<ide><path>share/doc/homebrew/El_Capitan_and_Homebrew.md <add># El Capitan & Homebrew <add> <add>Part of the OS X 10.11/El Capitan changes is something called [System Integrity Protection](https://en.wikipedia.org/wiki/System_Integrity_Protection) or "SIP". <add> <add>SIP prevents you from writing to many system directories such as `/usr`, `/System` & `/bin`, regardless of whether or not you are root. The Apple keynote is [here](https://developer.apple.com/videos/wwdc/2015/?id=706) if you'd like to learn more. <add> <add>One of the implications of SIP is that you cannot simply create `/usr/local` if it is removed or doesn't exist for another reason. However, as noted in the keynote, Apple is leaving `/usr/local` open for developers to use, so Homebrew can still be used as expected. <add> <add>Apple documentation hints that `/usr/local` will be returned to `root:wheel restricted` permissions on [every OS X update](https://developer.apple.com/library/prerelease/mac/releasenotes/General/rn-osx-10.11/); Homebrew will be adding a `brew doctor` check to warn you when this happens in the near future. <add> <add>If you haven't installed Homebrew in `/usr/local` or another system-protected directory, none of these concerns apply to you. <add> <add>This is how to fix Homebrew on El Capitan if you see permission issues: <add> <add>## If `/usr/local` exists already: <add> <add>```bash <add>sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local <add>``` <add> <add>## If `/usr/local` does not exist: <add> <add>* Reboot into Recovery mode (Hold Cmd+R on boot) & access the Terminal. <add>* In that terminal run: <add> `csrutil disable` <add>* Reboot back into OS X <add>* Open your Terminal application and execute: <add> <add>```bash <add> sudo mkdir /usr/local && sudo chflags norestricted /usr/local && sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local <add>``` <add> <add>* Reboot back into Recovery Mode & access the Terminal again. <add>* In that terminal execute: <add> `csrutil enable` <add>* Reboot back into OS X & you'll be able to write to `/usr/local` & install Homebrew.
1
Ruby
Ruby
use separate collection for requirement deps
0b9c29a66743cf2b0fd2128ba83b2bc8e7ad9e4c
<ide><path>Library/Homebrew/formula_installer.rb <ide> class FormulaInstaller <ide> attr_accessor :tab, :options, :ignore_deps <ide> attr_accessor :show_summary_heading, :show_header <ide> attr_reader :unsatisfied_deps <add> attr_reader :requirement_deps <ide> <ide> def initialize ff <ide> @f = ff <ide> def initialize ff <ide> @options = Options.new <ide> @tab = Tab.dummy_tab(ff) <ide> @unsatisfied_deps = [] <add> @requirement_deps = [] <ide> <ide> @@attempted ||= Set.new <ide> <ide> def check_requirements <ide> elsif req.satisfied? <ide> Requirement.prune <ide> elsif req.default_formula? <del> unsatisfied_deps << req.to_dependency <add> requirement_deps << req.to_dependency <ide> Requirement.prune <ide> else <ide> puts "#{dependent}: #{req.message}" <ide> def filter_deps <ide> end <ide> <ide> def install_dependencies <add> unsatisfied_deps.concat(requirement_deps) <ide> unsatisfied_deps.concat(filter_deps) <ide> <ide> if unsatisfied_deps.length > 1 <ide> def install_dependencies <ide> end <ide> @show_header = true unless unsatisfied_deps.empty? <ide> ensure <add> requirement_deps.clear <ide> unsatisfied_deps.clear <ide> end <ide>
1
Text
Text
add link to api documentation
30433253eda59656b1060d6ccc5e1b8e5913c331
<ide><path>guides/source/action_controller_overview.md <ide> end <ide> <ide> The [Layouts & Rendering Guide](layouts_and_rendering.html) explains this in more detail. <ide> <del>`ApplicationController` inherits from `ActionController::Base`, which defines a number of helpful methods. This guide will cover some of these, but if you're curious to see what's in there, you can see all of them in the API documentation or in the source itself. <add>`ApplicationController` inherits from `ActionController::Base`, which defines a number of helpful methods. This guide will cover some of these, but if you're curious to see what's in there, you can see all of them in the [API documentation](http://api.rubyonrails.org/classes/ActionController.html) or in the source itself. <ide> <ide> Only public methods are callable as actions. It is a best practice to lower the visibility of methods (with `private` or `protected`) which are not intended to be actions, like auxiliary methods or filters. <ide>
1
Javascript
Javascript
fix old comments
f4f2699bf732033747eeaa16f39ec85d619b32fe
<ide><path>packages/ember-routing-handlebars/tests/helpers/action_test.js <del>import Ember from 'ember-metal/core'; // A, FEATURES, assert, TESTING_DEPRECATION <add>import Ember from 'ember-metal/core'; // A, FEATURES, assert <ide> import { set } from "ember-metal/property_set"; <ide> import run from "ember-metal/run_loop"; <ide> import EventDispatcher from "ember-views/system/event_dispatcher"; <ide><path>packages/ember-views/tests/system/event_dispatcher_test.js <del>import Ember from 'ember-metal/core'; // A, FEATURES, assert, TESTING_DEPRECATION <add>import Ember from 'ember-metal/core'; // A, FEATURES, assert <ide> import { get } from "ember-metal/property_get"; <ide> import run from "ember-metal/run_loop"; <ide>
2
Text
Text
fix spelling error
439f2662b4f32c0a520c1c778ec6f5bd731f313d
<ide><path>guide/english/php/PHP Syantax and Comments/index.md <ide> --- <del>title: PHP Syantax and Comments <add>title: PHP Syntax and Comments <ide> --- <ide> <del>### PHP Syantx <add>### PHP Syntax <ide> <del>The structure of a PHP syantax somewhat looks like: <add>The structure of a PHP syntax somewhat looks like: <ide> <ide> ```shell <ide> <?php <ide> The structure of a PHP syantax somewhat looks like: <ide> <ide> ?> <ide> ``` <add> <ide> This PHP script can be placed anywhere in the document. <del>A PHP file generally have HTML tags, and some scripting code . <add>A PHP file generally has HTML tags, and some scripting code. <ide> The default file extension for PHP files is `.php`. <ide> <ide> ### How to make comments in PHP? <ide> <ide> A comment in PHP code is a line that is not read/executed as part of the program. Its only purpose is to be read by someone who is looking at the code. <ide> <del>In PHP, comments can be make by two ways either single lined or multi-lined. <del>The code snippet given below explains it: <add>In PHP, comments can be made by two ways either single-lined or multi-lined. <add> <add>The code snippet given below explains multiple ways of commenting: <ide> <ide> ```shell <ide> <? <ide> The code snippet given below explains it: <ide> # This is also a single-line comment <ide> <ide> /* <del> This is a multiple-lines comment block <add> This is a multiple-line comment block <ide> that spans over multiple <ide> lines <ide> */
1
Javascript
Javascript
update semver regex to support uppercase branches
93080b5879d02412b737eacaaf25e0f0d8e7db9e
<ide><path>packages/ember-metal/tests/main_test.js <ide> import Ember from '..'; // testing reexports <ide> <del>// From sindresourhus/semver-regex https://github.com/sindresorhus/semver-regex/blob/795b05628d96597ebcbe6d31ef4a432858365582/index.js#L3 <del>const SEMVER_REGEX = /^\bv?(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?\b$/; <add>// From https://github.com/semver/semver.org/issues/59 & https://regex101.com/r/vW1jA8/6 <add>const SEMVER_REGEX = /^((?:0|(?:[1-9]\d*)))\.((?:0|(?:[1-9]\d*)))\.((?:0|(?:[1-9]\d*)))(?:-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$/; <ide> <ide> QUnit.module('ember-metal/core/main'); <ide> <ide> QUnit.test('SEMVER_REGEX properly validates and invalidates version numbers', fu <ide> validateVersionString('1.0.0-beta.16.1', true); <ide> validateVersionString('1.12.1+canary.aba1412', true); <ide> validateVersionString('2.0.0-beta.1+canary.bb344775', true); <add> validateVersionString('3.1.0-foobarBaz+30d70bd3', true); <ide> <ide> // Negative test cases <ide> validateVersionString('1.11.3.aba18a', false);
1
PHP
PHP
apply styleci fixes
4087ab34e16eb4ba35512b9d2d68ad184b2a0fc5
<ide><path>src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php <ide> protected function getArguments() <ide> { <ide> return [ <ide> parent::getArguments()[0], <del> ['model', InputArgument::OPTIONAL, 'The name of the model to create'] <add> ['model', InputArgument::OPTIONAL, 'The name of the model to create'], <ide> ]; <ide> } <del> <del> <ide> } <ide><path>src/Illuminate/Foundation/Console/ModelMakeCommand.php <ide> protected function createFactory() <ide> { <ide> $this->call('make:factory', [ <ide> 'name' => $this->argument('name').'Factory', <del> 'model' => $this->argument('name') <add> 'model' => $this->argument('name'), <ide> ]); <ide> } <ide>
2
Go
Go
fix vet warning
213eab995a3e6dcdb69b587301cc5008911e3dfe
<ide><path>pkg/archive/archive_test.go <ide> func TestTarWithBlockCharFifo(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> if len(changes) > 0 { <del> t.Fatalf("Tar with special device (block, char, fifo) should keep them (recreate them when untar) : %s", changes) <add> t.Fatalf("Tar with special device (block, char, fifo) should keep them (recreate them when untar) : %v", changes) <ide> } <ide> } <ide>
1
Go
Go
simplify dir removal in overlay driver
6ed11b53743668dba3bcf6ecef4e57a399d95569
<ide><path>daemon/graphdriver/overlay/overlay.go <ide> func (d *Driver) dir(id string) string { <ide> <ide> // Remove cleans the directories that are created for this id. <ide> func (d *Driver) Remove(id string) error { <del> dir := d.dir(id) <del> if _, err := os.Stat(dir); err != nil { <del> return err <del> } <del> return os.RemoveAll(dir) <add> return os.RemoveAll(d.dir(id)) <ide> } <ide> <ide> // Get creates and mounts the required file system for the given id and returns the mount path.
1
Python
Python
update alias for field_mask in google memmcache
a3f5c93806258b5ad396a638ba0169eca7f9d065
<ide><path>airflow/providers/google/cloud/hooks/cloud_memorystore.py <ide> def update_instance( <ide> - ``redisConfig`` <ide> <ide> If a dict is provided, it must be of the same form as the protobuf message <del> :class:`~google.cloud.redis_v1.types.FieldMask` <del> :type update_mask: Union[Dict, google.cloud.redis_v1.types.FieldMask] <add> :class:`~google.protobuf.field_mask_pb2.FieldMask` <add> :type update_mask: Union[Dict, google.protobuf.field_mask_pb2.FieldMask] <ide> :param instance: Required. Update description. Only fields specified in ``update_mask`` are updated. <ide> <ide> If a dict is provided, it must be of the same form as the protobuf message <ide> def list_instances( <ide> @GoogleBaseHook.fallback_to_default_project_id <ide> def update_instance( <ide> self, <del> update_mask: Union[Dict, cloud_memcache.field_mask.FieldMask], <add> update_mask: Union[Dict, FieldMask], <ide> instance: Union[Dict, cloud_memcache.Instance], <ide> project_id: str, <ide> location: Optional[str] = None, <ide> def update_instance( <ide> - ``displayName`` <ide> <ide> If a dict is provided, it must be of the same form as the protobuf message <del> :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask` <add> :class:`~google.protobuf.field_mask_pb2.FieldMask`) <ide> :type update_mask: <del> Union[Dict, google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask] <add> Union[Dict, google.protobuf.field_mask_pb2.FieldMask] <ide> :param instance: Required. Update description. Only fields specified in ``update_mask`` are updated. <ide> <ide> If a dict is provided, it must be of the same form as the protobuf message <ide> def update_instance( <ide> @GoogleBaseHook.fallback_to_default_project_id <ide> def update_parameters( <ide> self, <del> update_mask: Union[Dict, cloud_memcache.field_mask.FieldMask], <add> update_mask: Union[Dict, FieldMask], <ide> parameters: Union[Dict, cloud_memcache.MemcacheParameters], <ide> project_id: str, <ide> location: str, <ide> def update_parameters( <ide> <ide> :param update_mask: Required. Mask of fields to update. <ide> If a dict is provided, it must be of the same form as the protobuf message <del> :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask` <add> :class:`~google.protobuf.field_mask_pb2.FieldMask` <ide> :type update_mask: <del> Union[Dict, google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask] <add> Union[Dict, google.protobuf.field_mask_pb2.FieldMask] <ide> :param parameters: The parameters to apply to the instance. <ide> If a dict is provided, it must be of the same form as the protobuf message <ide> :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.MemcacheParameters` <ide><path>setup.py <ide> def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version <ide> 'google-cloud-kms>=2.0.0,<3.0.0', <ide> 'google-cloud-language>=1.1.1,<2.0.0', <ide> 'google-cloud-logging>=2.1.1,<3.0.0', <del> 'google-cloud-memcache>=0.2.0', <add> # 1.1.0 removed field_mask and broke import for released providers <add> # We can remove the <1.1.0 limitation after we release new Google Provider <add> 'google-cloud-memcache>=0.2.0,<1.1.0', <ide> 'google-cloud-monitoring>=2.0.0,<3.0.0', <ide> 'google-cloud-os-login>=2.0.0,<3.0.0', <ide> 'google-cloud-pubsub>=2.0.0,<3.0.0',
2
Javascript
Javascript
match any dates (linkedin button)
2b60d14b5cc2360363bf0588e1c292686a14e8bd
<ide><path>cypress/integration/ShowCertification.js <ide> describe('A certification,', function() { <ide> }); <ide> <ide> it('should render a LinkedIn button', function() { <del> cy.contains('Add this certification to my LinkedIn profile').should( <del> 'have.attr', <del> 'href', <del> 'https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=Legacy Front End&organizationId=4831032&issueYear=2020&issueMonth=8&certUrl=https://freecodecamp.org/certification/developmentuser/legacy-front-end' <del> ); <add> cy.contains('Add this certification to my LinkedIn profile') <add> .should('have.attr', 'href') <add> .and( <add> 'match', <add> // eslint-disable-next-line max-len <add> /https:\/\/www\.linkedin\.com\/profile\/add\?startTask=CERTIFICATION_NAME&name=Legacy Front End&organizationId=4831032&issueYear=\d\d\d\d&issueMonth=\d\d?&certUrl=https:\/\/freecodecamp\.org\/certification\/developmentuser\/legacy-front-end/ <add> ); <ide> }); <ide> <ide> it('should render a Twitter button', function() {
1
Javascript
Javascript
attempt #6 to fix format
f87d5ef77f6954c59954342a1e9232e4764cfbdc
<ide><path>test/lang/ms-my.js <ide> exports["lang:ms-my"] = { <ide> ['L', '14/02/2010'], <ide> ['LL', '14 Februari 2010'], <ide> ['LLL', '14 Februari 2010 pukul 15.25'], <del> ['LLLL', 'Ahad, Februari 14 2010 15.25'], <add> ['LLLL', 'Ahad, 14 Februari 2010 15.25'], <ide> ['l', '14/2/2010'], <ide> ['ll', '14 Feb 2010'], <ide> ['lll', '14 Feb 2010 pukul 15.25'],
1
Go
Go
fix bugs when pruning buildkit cache with filters
48620057beb843ee1fb4e69ae0ed1e8eac9f307a
<ide><path>builder/builder-next/builder.go <ide> func toBuildkitPruneInfo(opts types.BuildCachePruneOptions) (client.PruneInfo, e <ide> <ide> bkFilter := make([]string, 0, opts.Filters.Len()) <ide> for cacheField := range cacheFields { <del> values := opts.Filters.Get(cacheField) <del> switch len(values) { <del> case 0: <del> bkFilter = append(bkFilter, cacheField) <del> case 1: <del> bkFilter = append(bkFilter, cacheField+"=="+values[0]) <del> default: <del> return client.PruneInfo{}, errMultipleFilterValues <add> if opts.Filters.Include(cacheField) { <add> values := opts.Filters.Get(cacheField) <add> switch len(values) { <add> case 0: <add> bkFilter = append(bkFilter, cacheField) <add> case 1: <add> if cacheField == "id" { <add> bkFilter = append(bkFilter, cacheField+"~="+values[0]) <add> } else { <add> bkFilter = append(bkFilter, cacheField+"=="+values[0]) <add> } <add> default: <add> return client.PruneInfo{}, errMultipleFilterValues <add> } <ide> } <ide> } <ide> return client.PruneInfo{ <ide> All: opts.All, <ide> KeepDuration: unusedFor, <ide> KeepBytes: opts.KeepStorage, <del> Filter: bkFilter, <add> Filter: []string{strings.Join(bkFilter, ",")}, <ide> }, nil <ide> }
1
PHP
PHP
move json method to input class
208eb8a380766b9f9cf5a4ecfa953fd0c8d629d9
<ide><path>laravel/input.php <ide> <ide> class Input { <ide> <add> /** <add> * The JSON payload for applications using Backbone.js or similar. <add> * <add> * @var object <add> */ <add> public static $json; <add> <ide> /** <ide> * The key used to store old input in the session. <ide> * <ide> public static function query($key = null, $default = null) <ide> return array_get(Request::foundation()->query->all(), $key, $default); <ide> } <ide> <add> /** <add> * Get the JSON payload for the request. <add> * <add> * @return object <add> */ <add> public static function json() <add> { <add> if ( ! is_null(static::$json)) return static::$json; <add> <add> return static::$json = json_decode(Request::foundation()->getContent()); <add> } <add> <ide> /** <ide> * Get a subset of the items from the input data. <ide> * <ide><path>laravel/request.php <ide> class Request { <ide> */ <ide> public static $route; <ide> <del> /** <del> * The JSON payload for applications using Backbone.js or similar. <del> * <del> * @var object <del> */ <del> public static $json; <del> <ide> /** <ide> * The Symfony HttpFoundation Request instance. <ide> * <ide> public static function headers() <ide> return static::foundation()->headers->all(); <ide> } <ide> <del> /** <del> * Get the JSON payload for the request. <del> * <del> * @return object <del> */ <del> public static function json() <del> { <del> if ( ! is_null(static::$json)) return static::$json; <del> <del> return static::$json = json_decode(static::foundation()->getContent()); <del> } <del> <ide> /** <ide> * Get an item from the $_SERVER array. <ide> *
2
Python
Python
remove unnecessary prints
2831597c9432cafc9d77e9f7401cc55d3d25ff97
<ide><path>celery/worker/__init__.py <ide> def on_start(self): <ide> pass <ide> <ide> def on_consumer_ready(self, consumer): <del> print 'In consumer_ready' <del> print self.on_consumer_ready_callbacks <ide> [callback(consumer) for callback in self.on_consumer_ready_callbacks] <ide> <ide> def setup_instance(self, queues=None, ready_callback=None,
1
Javascript
Javascript
add mjs extension to lint-js
641eac9b0d762bcbd7d7301d477187ab99baf384
<ide><path>tools/lint-js.js <ide> 'use strict'; <ide> <ide> const rulesDirs = ['tools/eslint-rules']; <del>const extensions = ['.js', '.md']; <add>const extensions = ['.js', '.mjs', '.md']; <ide> // This is the maximum number of files to be linted per worker at any given time <ide> const maxWorkload = 60; <ide>
1
Java
Java
replace bindtohttphandler with bindtowebhandler
4d4c3d5c0b74d55c4dd6a0927e813f54724cdb5f
<ide><path>spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultMockServerSpec.java <add>/* <add> * Copyright 2002-2017 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> * http://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.test.web.reactive.server; <add> <add>import org.springframework.util.Assert; <add>import org.springframework.web.server.WebHandler; <add>import org.springframework.web.server.adapter.WebHttpHandlerBuilder; <add> <add>/** <add> * <add> * @author Rossen Stoyanchev <add> * @since 5.0 <add> */ <add>class DefaultMockServerSpec extends AbstractMockServerSpec<DefaultMockServerSpec> { <add> <add> private final WebHandler webHandler; <add> <add> <add> DefaultMockServerSpec(WebHandler webHandler) { <add> Assert.notNull(webHandler, "'WebHandler' is required"); <add> this.webHandler = webHandler; <add> } <add> <add> <add> @Override <add> protected WebHttpHandlerBuilder initHttpHandlerBuilder() { <add> return WebHttpHandlerBuilder.webHandler(this.webHandler); <add> } <add> <add>} <ide><path>spring-test/src/main/java/org/springframework/test/web/reactive/server/MockServerExchangeMutator.java <ide> * transformations during requests from the {@code WebTestClient} to a mock <ide> * server -- i.e. when one of the following is in use: <ide> * <ul> <del> * <li>{@link WebTestClient#bindToController}, <add> * <li>{@link WebTestClient#bindToController} <ide> * <li>{@link WebTestClient#bindToRouterFunction} <del> * <li>{@link WebTestClient#bindToApplicationContext}. <add> * <li>{@link WebTestClient#bindToApplicationContext} <add> * <li>{@link WebTestClient#bindToWebHandler} <ide> * </ul> <ide> * <ide> * <p>Example of registering a "global" transformation: <ide><path>spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java <ide> import org.springframework.http.MediaType; <ide> import org.springframework.http.client.reactive.ClientHttpRequest; <ide> import org.springframework.http.codec.ServerCodecConfigurer; <del>import org.springframework.http.server.reactive.HttpHandler; <ide> import org.springframework.util.MultiValueMap; <ide> import org.springframework.validation.Validator; <ide> import org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder; <ide> import org.springframework.web.reactive.function.server.RouterFunction; <ide> import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer; <ide> import org.springframework.web.server.WebFilter; <add>import org.springframework.web.server.WebHandler; <ide> import org.springframework.web.util.UriBuilder; <ide> import org.springframework.web.util.UriBuilderFactory; <ide> <ide> public interface WebTestClient { <ide> // Static, factory methods <ide> <ide> /** <del> * Integration testing without a server targeting specific annotated, <add> * Integration testing with a "mock" server targeting specific annotated, <ide> * WebFlux controllers. The default configuration is the same as for <ide> * {@link org.springframework.web.reactive.config.EnableWebFlux @EnableWebFlux} <ide> * but can also be further customized through the returned spec. <ide> static ControllerSpec bindToController(Object... controllers) { <ide> } <ide> <ide> /** <del> * Integration testing without a server with WebFlux infrastructure detected <del> * from an {@link ApplicationContext} such as {@code @EnableWebFlux} <del> * Java config and annotated controller Spring beans. <add> * Integration testing with a "mock" server with WebFlux infrastructure <add> * detected from an {@link ApplicationContext} such as <add> * {@code @EnableWebFlux} Java config and annotated controller Spring beans. <ide> * @param applicationContext the context <ide> * @return the {@link WebTestClient} builder <ide> * @see org.springframework.web.reactive.config.EnableWebFlux <ide> static RouterFunctionSpec bindToRouterFunction(RouterFunction<?> routerFunction) <ide> } <ide> <ide> /** <del> * Integration testing without a server targeting the given HttpHandler. <del> * @param httpHandler the handler to test <add> * Integration testing with a "mock" server targeting the given WebHandler. <add> * @param webHandler the handler to test <ide> * @return the {@link WebTestClient} builder <ide> */ <del> static Builder bindToHttpHandler(HttpHandler httpHandler) { <del> return new DefaultWebTestClientBuilder(httpHandler); <add> static MockServerSpec<?> bindToWebHandler(WebHandler webHandler) { <add> return new DefaultMockServerSpec(webHandler); <ide> } <ide> <ide> /** <add><path>spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/WebFilterTests.java <del><path>spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpHandlerTests.java <ide> package org.springframework.test.web.reactive.server.samples.bind; <ide> <ide> import java.nio.charset.StandardCharsets; <del>import java.util.Collections; <ide> <ide> import org.junit.Test; <ide> import reactor.core.publisher.Mono; <ide> <ide> import org.springframework.core.io.buffer.DataBuffer; <ide> import org.springframework.core.io.buffer.DefaultDataBufferFactory; <del>import org.springframework.http.server.reactive.HttpHandler; <ide> import org.springframework.test.web.reactive.server.WebTestClient; <ide> import org.springframework.web.server.WebFilter; <del>import org.springframework.web.server.adapter.WebHttpHandlerBuilder; <ide> <ide> /** <del> * Bind to an {@link HttpHandler}. <add> * Tests for a {@link WebFilter}. <ide> * @author Rossen Stoyanchev <ide> */ <del>public class HttpHandlerTests { <del> <add>public class WebFilterTests { <ide> <ide> @Test <ide> public void testWebFilter() throws Exception { <ide> <del> WebFilter myFilter = (exchange, chain) -> { <add> WebFilter filter = (exchange, chain) -> { <ide> DataBuffer buffer = new DefaultDataBufferFactory().allocateBuffer(); <ide> buffer.write("It works!".getBytes(StandardCharsets.UTF_8)); <ide> return exchange.getResponse().writeWith(Mono.just(buffer)); <ide> }; <ide> <del> HttpHandler httpHandler = WebHttpHandlerBuilder.webHandler(exchange -> Mono.empty()) <del> .filters(Collections.singletonList(myFilter)).build(); <add> WebTestClient client = WebTestClient.bindToWebHandler(exchange -> Mono.empty()) <add> .webFilter(filter) <add> .build(); <ide> <del> WebTestClient.bindToHttpHandler(httpHandler).build() <del> .get().uri("/") <add> client.get().uri("/") <ide> .exchange() <ide> .expectStatus().isOk() <ide> .expectBody(String.class).isEqualTo("It works!");
4
Ruby
Ruby
inline cipher constant
d22f8796919b2e8eeadce1d74ad4cf33f695e57e
<ide><path>railties/lib/rails/secrets.rb <ide> def initialize <ide> end <ide> end <ide> <del> CIPHER = "aes-128-gcm" <del> <add> @cipher = "aes-128-gcm" <ide> @read_encrypted_secrets = false <ide> @root = File # Wonky, but ensures `join` uses the current directory. <ide> <ide> def parse(paths, env:) <ide> end <ide> <ide> def generate_key <del> SecureRandom.hex( <del> OpenSSL::Cipher.new(CIPHER).key_len <del> ) <add> SecureRandom.hex(OpenSSL::Cipher.new(@cipher).key_len) <ide> end <ide> <ide> def key <ide> def preprocess(path) <ide> end <ide> <ide> def encryptor <del> @encryptor ||= ActiveSupport::MessageEncryptor.new([ key ].pack("H*"), cipher: CIPHER) <add> @encryptor ||= ActiveSupport::MessageEncryptor.new([ key ].pack("H*"), cipher: @cipher) <ide> end <ide> end <ide> end
1
Python
Python
fix action logging
252c6436b3197f97f0ed27f533389f88d9e425ed
<ide><path>airflow/www/utils.py <ide> def wrapper(*args, **kwargs): <ide> <ide> session.add( <ide> models.Log( <del> event=f.func_name, <add> event=f.__name__, <ide> task_instance=None, <ide> owner=user, <del> extra=request.get_json())) <add> extra=str(request.args.items()))) <ide> session.commit() <ide> return f(*args, **kwargs) <ide> return wrapper
1
Python
Python
add intra/inter op support for dcgan model
ebc97a77da336dbaa92f3a8b88413b910c85295f
<ide><path>research/gan/cifar/eval.py <ide> <ide> flags.DEFINE_boolean('write_to_disk', True, 'If `True`, run images to disk.') <ide> <add>flags.DEFINE_integer( <add> 'inter_op_parallelism_threads', 0, <add> 'Number of threads to use for inter-op parallelism. If left as default value of 0, the system will pick an appropriate number.') <add> <add>flags.DEFINE_integer( <add> 'intra_op_parallelism_threads', 0, <add> 'Number of threads to use for intra-op parallelism. If left as default value of 0, the system will pick an appropriate number.') <ide> <ide> def main(_, run_eval_loop=True): <ide> # Fetch and generate images to run through Inception. <ide> def main(_, run_eval_loop=True): <ide> <ide> # For unit testing, use `run_eval_loop=False`. <ide> if not run_eval_loop: return <add> sess_config = tf.ConfigProto( <add> inter_op_parallelism_threads=FLAGS.inter_op_parallelism_threads, <add> intra_op_parallelism_threads=FLAGS.intra_op_parallelism_threads) <ide> tf.contrib.training.evaluate_repeatedly( <ide> FLAGS.checkpoint_dir, <ide> master=FLAGS.master, <ide> hooks=[tf.contrib.training.SummaryAtEndHook(FLAGS.eval_dir), <ide> tf.contrib.training.StopAfterNEvalsHook(1)], <ide> eval_ops=image_write_ops, <add> config=sess_config, <ide> max_number_of_evaluations=FLAGS.max_number_of_evaluations) <ide> <ide> <ide><path>research/gan/cifar/train.py <ide> 'backup_workers', 1, <ide> 'Number of workers to be kept as backup in the sync replicas case.') <ide> <add>flags.DEFINE_integer( <add> 'inter_op_parallelism_threads', 0, <add> 'Number of threads to use for inter-op parallelism. If left as default value of 0, the system will pick an appropriate number.') <add> <add>flags.DEFINE_integer( <add> 'intra_op_parallelism_threads', 0, <add> 'Number of threads to use for intra-op parallelism. If left as default value of 0, the system will pick an appropriate number.') <ide> <ide> FLAGS = flags.FLAGS <ide> <ide> def main(_): <ide> tf.as_string(tf.train.get_or_create_global_step())], <ide> name='status_message') <ide> if FLAGS.max_number_of_steps == 0: return <add> sess_config = tf.ConfigProto( <add> inter_op_parallelism_threads=FLAGS.inter_op_parallelism_threads, <add> intra_op_parallelism_threads=FLAGS.intra_op_parallelism_threads) <ide> tfgan.gan_train( <ide> train_ops, <ide> hooks=( <ide> def main(_): <ide> sync_hooks), <ide> logdir=FLAGS.train_log_dir, <ide> master=FLAGS.master, <del> is_chief=FLAGS.task == 0) <add> is_chief=FLAGS.task == 0, <add> config=sess_config) <ide> <ide> <ide> def _learning_rate():
2
Go
Go
fix readall to run on windows
691555fc8b070a40d3e35922fda681394bdfa173
<ide><path>builder/dockerignore/dockerignore.go <ide> func ReadAll(reader io.ReadCloser) ([]string, error) { <ide> continue <ide> } <ide> pattern = filepath.Clean(pattern) <add> pattern = filepath.ToSlash(pattern) <ide> excludes = append(excludes, pattern) <ide> } <ide> if err := scanner.Err(); err != nil {
1
Javascript
Javascript
halve the size of the pageview cache
f852cefdd8efc83ae6cd6010c97aec516bd408c9
<ide><path>web/viewer.js <ide> var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf'; <ide> var DEFAULT_SCALE = 'auto'; <ide> var DEFAULT_SCALE_DELTA = 1.1; <ide> var UNKNOWN_SCALE = 0; <del>var CACHE_SIZE = 20; <add>var CACHE_SIZE = 10; <ide> var CSS_UNITS = 96.0 / 72.0; <ide> var SCROLLBAR_PADDING = 40; <ide> var VERTICAL_PADDING = 5;
1
Python
Python
use correct fixtures in url tokenizer
42cd598f572dbf9194aeaf9641e349d5629b31e0
<ide><path>spacy/tests/tokenizer/test_urls.py <ide> '"', ":", ">"] <ide> <ide> @pytest.mark.parametrize("text", URLS) <del>def test_simple_url(en_tokenizer, text): <del> tokens = en_tokenizer(text) <add>def test_simple_url(tokenizer, text): <add> tokens = tokenizer(text) <ide> assert tokens[0].orth_ == text <ide> assert len(tokens) == 1 <ide> <ide> <ide> @pytest.mark.parametrize("prefix", PREFIXES) <ide> @pytest.mark.parametrize("url", URLS) <del>def test_prefixed_url(en_tokenizer, prefix, url): <del> tokens = en_tokenizer(prefix + url) <add>def test_prefixed_url(tokenizer, prefix, url): <add> tokens = tokenizer(prefix + url) <ide> assert tokens[0].text == prefix <ide> assert tokens[1].text == url <ide> assert len(tokens) == 2 <ide> <ide> @pytest.mark.parametrize("suffix", SUFFIXES) <ide> @pytest.mark.parametrize("url", URLS) <del>def test_suffixed_url(en_tokenizer, url, suffix): <del> tokens = en_tokenizer(url + suffix) <add>def test_suffixed_url(tokenizer, url, suffix): <add> tokens = tokenizer(url + suffix) <ide> assert tokens[0].text == url <ide> assert tokens[1].text == suffix <ide> assert len(tokens) == 2 <ide> <ide> @pytest.mark.parametrize("prefix", PREFIXES) <ide> @pytest.mark.parametrize("suffix", SUFFIXES) <ide> @pytest.mark.parametrize("url", URLS) <del>def test_surround_url(en_tokenizer, prefix, suffix, url): <del> tokens = en_tokenizer(prefix + url + suffix) <add>def test_surround_url(tokenizer, prefix, suffix, url): <add> tokens = tokenizer(prefix + url + suffix) <ide> assert tokens[0].text == prefix <ide> assert tokens[1].text == url <ide> assert tokens[2].text == suffix <ide> def test_surround_url(en_tokenizer, prefix, suffix, url): <ide> @pytest.mark.parametrize("prefix1", PREFIXES) <ide> @pytest.mark.parametrize("prefix2", PREFIXES) <ide> @pytest.mark.parametrize("url", URLS) <del>def test_two_prefix_url(en_tokenizer, prefix1, prefix2, url): <del> tokens = en_tokenizer(prefix1 + prefix2 + url) <add>def test_two_prefix_url(tokenizer, prefix1, prefix2, url): <add> tokens = tokenizer(prefix1 + prefix2 + url) <ide> assert tokens[0].text == prefix1 <ide> assert tokens[1].text == prefix2 <ide> assert tokens[2].text == url <ide> def test_two_prefix_url(en_tokenizer, prefix1, prefix2, url): <ide> @pytest.mark.parametrize("suffix1", SUFFIXES) <ide> @pytest.mark.parametrize("suffix2", SUFFIXES) <ide> @pytest.mark.parametrize("url", URLS) <del>def test_two_prefix_url(en_tokenizer, suffix1, suffix2, url): <del> tokens = en_tokenizer(url + suffix1 + suffix2) <add>def test_two_prefix_url(tokenizer, suffix1, suffix2, url): <add> tokens = tokenizer(url + suffix1 + suffix2) <ide> assert tokens[0].text == url <ide> assert tokens[1].text == suffix1 <ide> assert tokens[2].text == suffix2
1
Python
Python
fix mypy errors for arithmetic analysis algorithms
ad5108d6a49155bc0a5aca498426265004b0265f
<ide><path>arithmetic_analysis/in_static_equilibrium.py <ide> """ <ide> Checks if a system of forces is in static equilibrium. <del> <del>python/black : true <del>flake8 : passed <del>mypy : passed <ide> """ <add>from typing import List <ide> <del>from __future__ import annotations <del> <del>from numpy import array, cos, cross, radians, sin # type: ignore <add>from numpy import array, cos, cross, radians, sin <ide> <ide> <ide> def polar_force( <ide> magnitude: float, angle: float, radian_mode: bool = False <del>) -> list[float]: <add>) -> List[float]: <ide> """ <ide> Resolves force along rectangular components. <ide> (force, angle) => (force_x, force_y) <ide><path>arithmetic_analysis/lu_decomposition.py <del>"""Lower-Upper (LU) Decomposition.""" <add>"""Lower-Upper (LU) Decomposition. <ide> <del># lower–upper (LU) decomposition - https://en.wikipedia.org/wiki/LU_decomposition <del>import numpy <add>Reference: <add>- https://en.wikipedia.org/wiki/LU_decomposition <add>""" <add>from typing import Tuple <ide> <add>import numpy as np <add>from numpy import ndarray <ide> <del>def LUDecompose(table): <add> <add>def lower_upper_decomposition(table: ndarray) -> Tuple[ndarray, ndarray]: <add> """Lower-Upper (LU) Decomposition <add> <add> Example: <add> <add> >>> matrix = np.array([[2, -2, 1], [0, 1, 2], [5, 3, 1]]) <add> >>> outcome = lower_upper_decomposition(matrix) <add> >>> outcome[0] <add> array([[1. , 0. , 0. ], <add> [0. , 1. , 0. ], <add> [2.5, 8. , 1. ]]) <add> >>> outcome[1] <add> array([[ 2. , -2. , 1. ], <add> [ 0. , 1. , 2. ], <add> [ 0. , 0. , -17.5]]) <add> <add> >>> matrix = np.array([[2, -2, 1], [0, 1, 2]]) <add> >>> lower_upper_decomposition(matrix) <add> Traceback (most recent call last): <add> ... <add> ValueError: 'table' has to be of square shaped array but got a 2x3 array: <add> [[ 2 -2 1] <add> [ 0 1 2]] <add> """ <ide> # Table that contains our data <ide> # Table has to be a square array so we need to check first <del> rows, columns = numpy.shape(table) <del> L = numpy.zeros((rows, columns)) <del> U = numpy.zeros((rows, columns)) <add> rows, columns = np.shape(table) <ide> if rows != columns: <del> return [] <add> raise ValueError( <add> f"'table' has to be of square shaped array but got a {rows}x{columns} " <add> + f"array:\n{table}" <add> ) <add> lower = np.zeros((rows, columns)) <add> upper = np.zeros((rows, columns)) <ide> for i in range(columns): <ide> for j in range(i): <del> sum = 0 <add> total = 0 <ide> for k in range(j): <del> sum += L[i][k] * U[k][j] <del> L[i][j] = (table[i][j] - sum) / U[j][j] <del> L[i][i] = 1 <add> total += lower[i][k] * upper[k][j] <add> lower[i][j] = (table[i][j] - total) / upper[j][j] <add> lower[i][i] = 1 <ide> for j in range(i, columns): <del> sum1 = 0 <add> total = 0 <ide> for k in range(i): <del> sum1 += L[i][k] * U[k][j] <del> U[i][j] = table[i][j] - sum1 <del> return L, U <add> total += lower[i][k] * upper[k][j] <add> upper[i][j] = table[i][j] - total <add> return lower, upper <ide> <ide> <ide> if __name__ == "__main__": <del> matrix = numpy.array([[2, -2, 1], [0, 1, 2], [5, 3, 1]]) <del> L, U = LUDecompose(matrix) <del> print(L) <del> print(U) <add> import doctest <add> <add> doctest.testmod() <ide><path>arithmetic_analysis/newton_forward_interpolation.py <ide> # https://www.geeksforgeeks.org/newton-forward-backward-interpolation/ <ide> <ide> import math <add>from typing import List <ide> <ide> <ide> # for calculating u value <del>def ucal(u, p): <add>def ucal(u: float, p: int) -> float: <ide> """ <ide> >>> ucal(1, 2) <ide> 0 <ide> def ucal(u, p): <ide> return temp <ide> <ide> <del>def main(): <add>def main() -> None: <ide> n = int(input("enter the numbers of values: ")) <del> y = [] <add> y: List[List[float]] = [] <ide> for i in range(n): <ide> y.append([]) <ide> for i in range(n): <ide><path>arithmetic_analysis/newton_raphson.py <ide> # quickly find a good approximation for the root of a real-valued function <ide> from decimal import Decimal <ide> from math import * # noqa: F401, F403 <add>from typing import Union <ide> <ide> from sympy import diff <ide> <ide> <del>def newton_raphson(func: str, a: int, precision: int = 10 ** -10) -> float: <add>def newton_raphson( <add> func: str, a: Union[float, Decimal], precision: float = 10 ** -10 <add>) -> float: <ide> """Finds root from the point 'a' onwards by Newton-Raphson method <ide> >>> newton_raphson("sin(x)", 2) <ide> 3.1415926536808043 <ide><path>arithmetic_analysis/secant_method.py <del># Implementing Secant method in Python <del># Author: dimgrichr <del> <del> <del>from math import exp <del> <del> <del>def f(x): <del> """ <del> >>> f(5) <del> 39.98652410600183 <del> """ <del> return 8 * x - 2 * exp(-x) <del> <del> <del>def SecantMethod(lower_bound, upper_bound, repeats): <del> """ <del> >>> SecantMethod(1, 3, 2) <del> 0.2139409276214589 <del> """ <del> x0 = lower_bound <del> x1 = upper_bound <del> for i in range(0, repeats): <del> x0, x1 = x1, x1 - (f(x1) * (x1 - x0)) / (f(x1) - f(x0)) <del> return x1 <del> <del> <del>print(f"The solution is: {SecantMethod(1, 3, 2)}") <add>""" <add>Implementing Secant method in Python <add>Author: dimgrichr <add>""" <add>from math import exp <add> <add> <add>def f(x: float) -> float: <add> """ <add> >>> f(5) <add> 39.98652410600183 <add> """ <add> return 8 * x - 2 * exp(-x) <add> <add> <add>def secant_method(lower_bound: float, upper_bound: float, repeats: int) -> float: <add> """ <add> >>> secant_method(1, 3, 2) <add> 0.2139409276214589 <add> """ <add> x0 = lower_bound <add> x1 = upper_bound <add> for i in range(0, repeats): <add> x0, x1 = x1, x1 - (f(x1) * (x1 - x0)) / (f(x1) - f(x0)) <add> return x1 <add> <add> <add>if __name__ == "__main__": <add> print(f"Example: {secant_method(1, 3, 2) = }")
5
PHP
PHP
apply fixes from styleci
d435f584348f754ffe1a680e98fd30e6d1e17d61
<ide><path>src/Illuminate/Database/Eloquent/Model.php <ide> public function fill(array $attributes) <ide> $this->setAttribute($key, $value); <ide> } elseif ($totallyGuarded) { <ide> throw new MassAssignmentException(sprintf( <del> "Add [%s] to fillable property to allow mass assignment on [%s].", <add> 'Add [%s] to fillable property to allow mass assignment on [%s].', <ide> $key, get_class($this) <ide> )); <ide> } <ide><path>tests/Support/SupportCollectionTest.php <ide> public function testDiffUsingWithCollection() <ide> { <ide> $c = new Collection(['en_GB', 'fr', 'HR']); <ide> // demonstrate that diffKeys wont support case insensitivity <del> $this->assertEquals(['en_GB', 'fr', 'HR'], $c->diff(new Collection(['en_gb' , 'hr']))->values()->toArray()); <add> $this->assertEquals(['en_GB', 'fr', 'HR'], $c->diff(new Collection(['en_gb', 'hr']))->values()->toArray()); <ide> // allow for case insensitive difference <del> $this->assertEquals(['fr'], $c->diffUsing(new Collection(['en_gb' , 'hr']), 'strcasecmp')->values()->toArray()); <add> $this->assertEquals(['fr'], $c->diffUsing(new Collection(['en_gb', 'hr']), 'strcasecmp')->values()->toArray()); <ide> } <add> <ide> public function testDiffUsingWithNull() <ide> { <ide> $c = new Collection(['en_GB', 'fr', 'HR']);
2
Ruby
Ruby
redirect deprecation tests
315873041155510fc629e78e4f1567e913935340
<ide><path>actionpack/test/controller/redirect_test.rb <ide> def setup <ide> <ide> def test_simple_redirect <ide> get :simple_redirect <del> assert_redirect_url "http://test.host/redirect/hello_world" <add> assert_response :redirect <add> assert_equal "http://test.host/redirect/hello_world", redirect_to_url <ide> end <ide> <ide> def test_redirect_with_method_reference_and_parameters <del> get :method_redirect <del> assert_redirect_url "http://test.host/redirect/dashboard/1?message=hello" <add> assert_deprecated(/redirect_to/) { get :method_redirect } <add> assert_response :redirect <add> assert_equal "http://test.host/redirect/dashboard/1?message=hello", redirect_to_url <ide> end <ide> <ide> def test_simple_redirect_using_options <ide> get :host_redirect <add> assert_response :redirect <ide> assert_redirected_to :action => "other_host", :only_path => false, :host => 'other.test.host' <ide> end <ide> <ide> def test_redirect_error_with_pretty_diff <ide> get :host_redirect <add> assert_response :redirect <ide> begin <ide> assert_redirected_to :action => "other_host", :only_path => true <ide> rescue Test::Unit::AssertionFailedError => err <ide> def test_redirect_error_with_pretty_diff <ide> <ide> def test_module_redirect <ide> get :module_redirect <del> assert_redirect_url "http://test.host/module_test/module_redirect/hello_world" <add> assert_response :redirect <add> assert_redirected_to "http://test.host/module_test/module_redirect/hello_world" <ide> end <ide> <ide> def test_module_redirect_using_options <ide> get :module_redirect <add> assert_response :redirect <ide> assert_redirected_to :controller => 'module_test/module_redirect', :action => 'hello_world' <ide> end <ide> <ide> def test_redirect_with_assigns <ide> get :redirect_with_assigns <add> assert_response :redirect <ide> assert_equal "world", assigns["hello"] <ide> end <ide> <ide> def test_redirect_to_back <ide> @request.env["HTTP_REFERER"] = "http://www.example.com/coming/from" <ide> get :redirect_to_back <del> assert_redirect_url "http://www.example.com/coming/from" <add> assert_response :redirect <add> assert_equal "http://www.example.com/coming/from", redirect_to_url <ide> end <ide> <ide> def test_redirect_to_back_with_no_referer <ide> def setup <ide> <ide> def test_simple_redirect <ide> get :simple_redirect <del> assert_redirect_url "http://test.host/module_test/module_redirect/hello_world" <add> assert_response :redirect <add> assert_equal "http://test.host/module_test/module_redirect/hello_world", redirect_to_url <ide> end <ide> <ide> def test_redirect_with_method_reference_and_parameters <del> get :method_redirect <del> assert_redirect_url "http://test.host/module_test/module_redirect/dashboard/1?message=hello" <add> assert_deprecated(/redirect_to/) { get :method_redirect } <add> assert_response :redirect <add> assert_equal "http://test.host/module_test/module_redirect/dashboard/1?message=hello", redirect_to_url <ide> end <ide> <ide> def test_simple_redirect_using_options <ide> get :host_redirect <add> assert_response :redirect <ide> assert_redirected_to :action => "other_host", :only_path => false, :host => 'other.test.host' <ide> end <ide> <ide> def test_module_redirect <ide> get :module_redirect <del> assert_redirect_url "http://test.host/redirect/hello_world" <add> assert_response :redirect <add> assert_equal "http://test.host/redirect/hello_world", redirect_to_url <ide> end <ide> <ide> def test_module_redirect_using_options <ide> get :module_redirect <add> assert_response :redirect <ide> assert_redirected_to :controller => 'redirect', :action => "hello_world" <ide> end <ide> end
1
Go
Go
fix a minor typo in daemon/exec.go
5b794c413a147dbc06f76caa6f2c32d1f4b1f2ce
<ide><path>daemon/exec.go <ide> func (execConfig *execConfig) Resize(h, w int) error { <ide> } <ide> <ide> func (d *Daemon) registerExecCommand(execConfig *execConfig) { <del> // Storing execs in container inorder to kill them gracefully whenever the container is stopped or removed. <add> // Storing execs in container in order to kill them gracefully whenever the container is stopped or removed. <ide> execConfig.Container.execCommands.Add(execConfig.ID, execConfig) <ide> // Storing execs in daemon for easy access via remote API. <ide> d.execCommands.Add(execConfig.ID, execConfig)
1
PHP
PHP
add the route name to the check subcommand
569dfd2df091c96115b0dd79514e87611117ba91
<ide><path>src/Shell/RoutesShell.php <ide> public function check($url) <ide> { <ide> try { <ide> $route = Router::parse($url); <add> foreach (Router::routes() as $r) { <add> if ($r->match($route)) { <add> $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName(); <add> break; <add> } <add> } <ide> $output = [ <ide> ['Route name', 'URI template', 'Defaults'], <del> ['', $url, json_encode($route)] <add> [$name, $url, json_encode($route)] <ide> ]; <ide> $this->helper('table')->output($output); <ide> } catch (MissingRouteException $e) { <ide><path>tests/TestCase/Shell/RoutesShellTest.php <ide> public function testCheck() <ide> $this->logicalAnd( <ide> $this->contains(['Route name', 'URI template', 'Defaults']), <ide> $this->contains([ <del> '', <add> 'articles:_action', <ide> '/articles/index', <ide> '{"action":"index","pass":[],"controller":"Articles","plugin":null}' <ide> ]) <ide> public function testCheck() <ide> $this->shell->check('/articles/index'); <ide> } <ide> <add> /** <add> * Test checking an existing route with named route. <add> * <add> * @return void <add> */ <add> public function testCheckWithNamedRoute() <add> { <add> $this->table->expects($this->once()) <add> ->method('output') <add> ->with( <add> $this->logicalAnd( <add> $this->contains(['Route name', 'URI template', 'Defaults']), <add> $this->contains([ <add> 'testName', <add> '/tests/index', <add> '{"action":"index","pass":[],"controller":"Tests","plugin":null}' <add> ]) <add> ) <add> ); <add> $this->shell->check('/tests/index'); <add> } <add> <ide> /** <ide> * Test checking an non-existing route. <ide> *
2
Python
Python
scheduler tweaks, logging improvement
f46f3e1a208f6f347faa9ad4d66c3e96c0e6e360
<ide><path>airflow/jobs.py <ide> def process_dag(self, dag, executor): <ide> <ide> descartes = [obj for obj in product(dag.tasks, active_runs)] <ide> logging.info( <del> 'Scheduling {} tasks instances, ' <add> 'Checking dependencies on {} tasks instances, ' <ide> 'minus {} skippable ones'.format(len(descartes), len(skip_tis))) <ide> for task, dttm in descartes: <ide> if task.adhoc or (task.task_id, dttm) in skip_tis: <ide> def prioritize_queued(self, session, executor, dagbag): <ide> open_slots = 32 <ide> else: <ide> open_slots = pools[pool].open_slots(session=session) <add> <add> queue_size = len(tis) <ide> logging.info( <del> "Pool {pool} has {open_slots} slots".format(**locals())) <add> "Pool {pool} has {open_slots} slots, " <add> "{queue_size} task instances in queue".format(**locals())) <ide> if not open_slots: <ide> return <ide> tis = sorted( <ide> def prioritize_queued(self, session, executor, dagbag): <ide> except: <ide> logging.error("Queued task {} seems gone".format(ti)) <ide> session.delete(ti) <del> if task: <del> ti.task = task <del> <del> # picklin' <del> dag = dagbag.dags[ti.dag_id] <del> pickle_id = None <del> if self.do_pickle and self.executor.__class__ not in ( <del> executors.LocalExecutor, <del> executors.SequentialExecutor): <del> pickle_id = dag.pickle(session).id <del> <del> if ( <del> ti.are_dependencies_met() and <del> not task.dag.concurrency_reached): <del> executor.queue_task_instance( <del> ti, force=True, pickle_id=pickle_id) <del> open_slots -= 1 <del> else: <del> session.delete(ti) <del> continue <del> ti.task = task <del> <del> # picklin' <del> dag = dagbag.dags[ti.dag_id] <del> pickle_id = None <del> if self.do_pickle and self.executor.__class__ not in ( <del> executors.LocalExecutor, executors.SequentialExecutor): <del> pickle_id = dag.pickle(session).id <del> <del> if ti.are_dependencies_met(): <del> executor.queue_task_instance( <del> ti, force=True, pickle_id=pickle_id) <del> else: <del> session.delete(ti) <ide> session.commit() <add> continue <add> <add> if not task: <add> continue <add> <add> ti.task = task <add> <add> # picklin' <add> dag = dagbag.dags[ti.dag_id] <add> pickle_id = None <add> if self.do_pickle and self.executor.__class__ not in ( <add> executors.LocalExecutor, <add> executors.SequentialExecutor): <add> pickle_id = dag.pickle(session).id <add> <add> if ( <add> not task.dag.concurrency_reached and <add> ti.are_dependencies_met()): <add> executor.queue_task_instance( <add> ti, force=True, pickle_id=pickle_id) <add> open_slots -= 1 <add> else: <add> session.delete(ti) <add> continue <add> ti.task = task <add> <add> session.commit() <ide> <ide> def _execute(self): <ide> dag_id = self.dag_id <ide><path>airflow/models.py <ide> def kill_zombies(self, session): <ide> """ <ide> from airflow.jobs import LocalTaskJob as LJ <ide> logging.info("Finding 'running' jobs without a recent heartbeat") <del> secs = (configuration.getint('scheduler', 'job_heartbeat_sec') * 3) + 120 <add> secs = ( <add> configuration.getint('scheduler', 'job_heartbeat_sec') * 3) + 120 <ide> limit_dttm = datetime.now() - timedelta(seconds=secs) <del> print("Failing jobs without heartbeat after {}".format(limit_dttm)) <add> logging.info( <add> "Failing jobs without heartbeat after {}".format(limit_dttm)) <ide> jobs = ( <ide> session <ide> .query(LJ)
2
Text
Text
add missing --add-runtime
585332dfe0b4b38f428deb680086b6d69275100d
<ide><path>docs/reference/commandline/dockerd.md <ide> weight = -1 <ide> A self-sufficient runtime for linux containers. <ide> <ide> Options: <add> --add-runtime=[] Register an additional OCI compatible runtime <ide> --api-cors-header="" Set CORS headers in the remote API <ide> --authorization-plugin=[] Set authorization plugins to load <ide> -b, --bridge="" Attach containers to a network bridge <ide> weight = -1 <ide> -p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file <ide> --raw-logs Full timestamps without ANSI coloring <ide> --registry-mirror=[] Preferred Docker registry mirror <del> --add-runtime=[] Register an additional OCI compatible runtime <ide> -s, --storage-driver="" Storage driver to use <ide> --selinux-enabled Enable selinux support <ide> --storage-opt=[] Set storage driver options <ide><path>man/dockerd.8.md <ide> dockerd - Enable daemon mode <ide> <ide> # SYNOPSIS <ide> **dockerd** <add>[**--add-runtime**[=*[]*]] <ide> [**--api-cors-header**=[=*API-CORS-HEADER*]] <ide> [**--authorization-plugin**[=*[]*]] <ide> [**-b**|**--bridge**[=*BRIDGE*]] <ide> format. <ide> <ide> # OPTIONS <ide> <add>**--add-runtime**=[] <add> Set additional OCI compatible runtime. <add> <ide> **--api-cors-header**="" <ide> Set CORS headers in the remote API. Default is cors disabled. Give urls like "http://foo, http://bar, ...". Give "*" to allow all. <ide>
2
Text
Text
fix unnecessary translation of strong tag
372cba1c4cd6ae63fc17d385d1d6ffff1556ddbb
<ide><path>curriculum/challenges/spanish/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.spanish.md <ide> id: 587d781a367417b2b2512ab7 <ide> title: Use the strong Tag to Make Text Bold <ide> challengeType: 0 <ide> videoUrl: '' <del>localeTitle: Utilice la etiqueta fuerte para hacer el texto en negrita <add>localeTitle: Utilice la etiqueta strong para hacer el texto en negrita <ide> --- <ide> <ide> ## Description
1
Ruby
Ruby
remove deprecated block usage in composed_of
fdb7f84eb10c5e59490764a1a259aa00a1fcfe5f
<ide><path>activerecord/lib/active_record/aggregations.rb <ide> module ClassMethods <ide> # :constructor => Proc.new { |ip| IPAddr.new(ip, Socket::AF_INET) }, <ide> # :converter => Proc.new { |ip| ip.is_a?(Integer) ? IPAddr.new(ip, Socket::AF_INET) : IPAddr.new(ip.to_s) } <ide> # <del> def composed_of(part_id, options = {}, &block) <add> def composed_of(part_id, options = {}) <ide> options.assert_valid_keys(:class_name, :mapping, :allow_nil, :constructor, :converter) <ide> <ide> name = part_id.id2name <ide> def composed_of(part_id, options = {}, &block) <ide> mapping = [ mapping ] unless mapping.first.is_a?(Array) <ide> allow_nil = options[:allow_nil] || false <ide> constructor = options[:constructor] || :new <del> converter = options[:converter] || block <del> <del> ActiveSupport::Deprecation.warn('The conversion block has been deprecated, use the :converter option instead.', caller) if block_given? <add> converter = options[:converter] <ide> <ide> reader_method(name, class_name, mapping, allow_nil, constructor) <ide> writer_method(name, class_name, mapping, allow_nil, converter) <ide><path>activerecord/test/cases/aggregations_test.rb <ide> def test_custom_converter <ide> end <ide> end <ide> <del>class DeprecatedAggregationsTest < ActiveRecord::TestCase <del> class Person < ActiveRecord::Base; end <del> <del> def test_conversion_block_is_deprecated <del> assert_deprecated 'conversion block has been deprecated' do <del> Person.composed_of(:balance, :class_name => "Money", :mapping => %w(balance amount)) { |balance| balance.to_money } <del> end <del> end <del> <del> def test_conversion_block_used_when_converter_option_is_nil <del> assert_deprecated 'conversion block has been deprecated' do <del> Person.composed_of(:balance, :class_name => "Money", :mapping => %w(balance amount)) { |balance| balance.to_money } <del> end <del> assert_raise(NoMethodError) { Person.new.balance = 5 } <del> end <del> <del> def test_converter_option_overrides_conversion_block <del> assert_deprecated 'conversion block has been deprecated' do <del> Person.composed_of(:balance, :class_name => "Money", :mapping => %w(balance amount), :converter => Proc.new { |balance| Money.new(balance) }) { |balance| balance.to_money } <del> end <del> <del> person = Person.new <del> assert_nothing_raised { person.balance = 5 } <del> assert_equal 5, person.balance.amount <del> assert_kind_of Money, person.balance <del> end <del>end <del> <ide> class OverridingAggregationsTest < ActiveRecord::TestCase <ide> class Name; end <ide> class DifferentName; end
2
PHP
PHP
add functions for encrypt / decrypt
ea9432aa1036c45b9af78af7ab111d2da4ca32b5
<ide><path>src/Illuminate/Foundation/helpers.php <ide> function database_path($path = '') <ide> } <ide> } <ide> <add>if (! function_exists('decrypt')) { <add> /** <add> * Decrypt the given value. <add> * <add> * @param string $value <add> * @return string <add> */ <add> function decrypt($value) <add> { <add> return app('encrypter')->decrypt($value); <add> } <add>} <add> <ide> if (! function_exists('delete')) { <ide> /** <ide> * Register a new DELETE route with the router. <ide> function elixir($file) <ide> } <ide> } <ide> <add>if (! function_exists('encrypt')) { <add> /** <add> * Encrypt the given value. <add> * <add> * @param string $value <add> * @return string <add> */ <add> function encrypt($value) <add> { <add> return app('encrypter')->encrypt($value); <add> } <add>} <add> <ide> if (! function_exists('env')) { <ide> /** <ide> * Gets the value of an environment variable. Supports boolean, empty and null.
1
Javascript
Javascript
simplify map implementation
4b25f0a62b8028690a9b28f99ab9a2b32bb8bce6
<ide><path>d3.js <ide> function d3_selection_filter(filter) { <ide> return d3_selection(subgroups); <ide> } <ide> function d3_selection_map(map) { <del> for (var j = 0, m = this.length; j < m; j++) { <del> for (var group = this[j], i = 0, n = group.length, node; i < n; i++) { <del> if (node = group[i]) node.__data__ = map.call(node, node.__data__, i); <del> } <del> } <del> return this; <add> return this.each(function() { <add> this.__data__ = map.apply(this, arguments); <add> }); <ide> } <ide> function d3_selection_sort(comparator) { <ide> comparator = d3_selection_sortComparator.apply(this, arguments); <ide><path>d3.min.js <del>(function(){function dj(){return"circle"}function di(){return 64}function dh(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(dg<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();dg=!e.f&&!e.e,d.remove()}dg?(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 df(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cr;return[c*Math.cos(d),c*Math.sin(d)]}}function de(a){return[a.x,a.y]}function dd(a){return a.endAngle}function dc(a){return a.startAngle}function db(a){return a.radius}function da(a){return a.target}function c_(a){return a.source}function c$(a){return function(b,c){return a[c][1]}}function cZ(a){return function(b,c){return a[c][0]}}function cY(a){function i(f){if(f.length<1)return null;var i=cy(this,f,b,d),j=cy(this,f,b===c?cZ(i):c,d===e?c$(i):e);return"M"+g(a(j),h)+"L"+g(a(i.reverse()),h)+"Z"}var b=cz,c=cz,d=0,e=cA,f="linear",g=cB[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=cB[f=a];return i},i.tension=function(a){if(!arguments.length)return h;h=a;return i};return i}function cX(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cr,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cW(a){return a.length<3?cC(a):a[0]+cI(a,cV(a))}function cV(a){var b=[],c,d,e,f,g=cU(a),h=-1,i=a.length-1;while(++h<i)c=cT(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 cU(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cT(e,f);while(++b<c)d[b]=g+(g=cT(e=f,f=a[b+1]));d[b]=g;return d}function cT(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cS(a,b,c){a.push("C",cO(cP,b),",",cO(cP,c),",",cO(cQ,b),",",cO(cQ,c),",",cO(cR,b),",",cO(cR,c))}function cO(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cN(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 cK(a)}function cM(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=[cO(cR,g),",",cO(cR,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cS(b,g,h);return b.join("")}function cL(a){if(a.length<4)return cC(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(cO(cR,f)+","+cO(cR,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cS(b,f,g);return b.join("")}function cK(a){if(a.length<3)return cC(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),cS(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);return b.join("")}function cJ(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 cI(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cC(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 cH(a,b,c){return a.length<3?cC(a):a[0]+cI(a,cJ(a,b))}function cG(a,b){return a.length<3?cC(a):a[0]+cI((a.push(a[0]),a),cJ([a[a.length-2]].concat(a,[a[1]]),b))}function cF(a,b){return a.length<4?cC(a):a[1]+cI(a.slice(1,a.length-1),cJ(a,b))}function cE(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 cD(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 cC(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 cA(a){return a[1]}function cz(a){return a[0]}function cy(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 cx(a){function g(d){return d.length<1?null:"M"+e(a(cy(this,d,b,c)),f)}var b=cz,c=cA,d="linear",e=cB[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=cB[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g}function cw(a){return a.endAngle}function cv(a){return a.startAngle}function cu(a){return a.outerRadius}function ct(a){return a.innerRadius}function cq(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 cq(a,b,c)};return g()}function cp(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 cp(a,b)};return d()}function ck(a,b,c){function f(c){return d[((a[c]||(a[c]=++b))-1)%d.length]}var d,e;f.domain=function(d){if(!arguments.length)return d3.keys(a);a={},b=0;var e=-1,g=d.length,h;while(++e<g)a[h=d[e]]||(a[h]=++b);return f[c.t](c.x,c.p)},f.range=function(a){if(!arguments.length)return d;d=a,e=0,c={t:"range",x:a};return f},f.rangePoints=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b-1+g);d=b<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,c={t:"rangePoints",x:a,p:g};return f},f.rangeBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b+g);d=d3.range(h+j*g,i,j),e=j*(1-g),c={t:"rangeBands",x:a,p:g};return f},f.rangeRoundBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=Math.floor((i-h)/(b+g)),k=i-h-(b-g)*j;d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),c={t:"rangeRoundBands",x:a,p:g};return f},f.rangeBand=function(){return e},f.copy=function(){var d={},e;for(e in a)d[e]=a[e];return ck(d,b,c)};return f[c.t](c.x,c.p)}function cj(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function ci(a,b){function e(b){return a(c(b))}var c=cj(b),d=cj(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 ca(e.domain(),a)},e.tickFormat=function(a){return cb(e.domain(),a)},e.nice=function(){return e.domain(bW(e.domain(),b$))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();c=cj(b=a),d=cj(1/b);return e.domain(f)},e.copy=function(){return ci(a.copy(),b)};return bZ(e,a)}function ch(a){return a.toPrecision(1)}function cg(a){return-Math.log(-a)/Math.LN10}function cf(a){return Math.log(a)/Math.LN10}function ce(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?cg:cf,c=b.pow,a.domain(e.map(b));return d},d.nice=function(){a.domain(bW(a.domain(),bX));return d},d.ticks=function(){var d=bV(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===cg){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 ch},d.copy=function(){return ce(a.copy(),b)};return bZ(d,a)}function cd(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 cc(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 cb(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(b_(a,b)[2])/Math.LN10+.01))+"f")}function ca(a,b){return d3.range.apply(d3,b_(a,b))}function b_(a,b){var c=bV(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 b$(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 bZ(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 bY(a,b,c,d){function h(a){return e(a)}function g(){var g=a.length==2?cc:cd,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 ca(a,b)},h.tickFormat=function(b){return cb(a,b)},h.nice=function(){bW(a,b$);return g()},h.copy=function(){return bY(a,b,c,d)};return g()}function bX(){return Math}function bW(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 bV(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bU(){}function bS(){var a=null,b=bO,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bO=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bR(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bS()-b;d>24?(isFinite(d)&&(clearTimeout(bQ),bQ=setTimeout(bR,d)),bP=0):(bP=1,bT(bR))}function bN(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 bM(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}))}function bL(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}))}function bK(){return this.each("end",function(){var a=this.__transition__,b;a.owner===a.active&&(b=this.parentNode)&&b.removeChild(this)})}function bJ(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})}function bI(a,b,c){arguments.length<3&&(c=null);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)}})}function bH(a,b,c){arguments.length<3&&(c=null);return this.styleTween(a,by(b),c)}function bG(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)}function bF(a,b){return this.attrTween(a,by(b))}function bE(a){var b=[],c,d;typeof a!="function"&&(a=$(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(d.node));for(var j=-1,k=c.length;++j<k;)c[j]={node:c[j],delay:d.delay,duration:d.duration}}return bx(b).ease(this.ease())}function bD(a){var b=[],c,d,e;typeof a!="function"&&(a=Y(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(e.node))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bx(b).ease(this.ease())}function by(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 bx(a){e(a,bz);var b=bB||++bA,c={},d=d3.dispatch("start","end"),f=bC;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 bN.call(a,b);d[b].add(c);return a},d3.timer(function(e){a.each(function(g,h,i){function p(a){if(n.active!==b)return!0;var c=Math.min(1,(a-l)/m),e=f(c),h=-1,i=j.length;while(++h<i)j[h].call(k,e);if(c===1){bB=b,d.end.dispatch.call(k,g,h),bB=0,n.owner===b&&delete k.__transition__;return!0}}function o(a){if(n.active<=b){n.active=b,d.start.dispatch.call(k,g,h);for(var e in c)(e=c[e].call(k,g,h))&&j.push(e);l-=a,d3.timer(p)}return!0}var j=[],k=this,l=a[i][h].delay-e,m=a[i][h].duration,n=k.__transition__||(k.__transition__={active:0});n.owner=b,l<=0?o(0):d3.timer(o,l)});return!0});return a}function bw(){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 bx(a)}function bv(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}function bu(){return!this.node()}function bt(a){a.apply(this,(arguments[0]=this,arguments));return this}function bs(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}function br(a,b,c){arguments.length<3&&(c=!1);var d=a.indexOf("."),e=d===-1?a:a.substring(0,d),f="__on"+a;return this.each(function(a,d){function h(a){var c=d3.event;d3.event=a;try{b.call(this,g.__data__,d)}finally{d3.event=c}}this[f]&&this.removeEventListener(e,this[f],c),b&&this.addEventListener(e,this[f]=h,c);var g=this})}function bq(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bp(a){a=bq.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}function bo(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length,g;e<f;e++)if(g=d[e])g.__data__=a.call(g,g.__data__,e);return this}function bn(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)}function bm(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(f.parentNode)),d.__data__=g.__data__):c.push(null)}return S(b)}function bk(a){e(a,bl);return a}function bj(a){return{__data__:a}}function bi(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]=bj(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]=bj(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bj(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 bk(c)},j.exit=function(){return S(e)};return j}function bh(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})}function bg(a,b){function d(c){return c.insertBefore(document.createElementNS(a.space,a.local),U(b,c))}function c(c){return c.insertBefore(document.createElement(a),U(b,c))}a=d3.ns.qualify(a);return this.select(a.local?d:c)}function bf(a){function c(b){return b.appendChild(document.createElementNS(a.space,a.local))}function b(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return this.select(a.local?c:b)}function be(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})}function bd(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})}function bc(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)}function bb(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)}function ba(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(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?i:b?f:g)}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)}function $(a){return function(b){return V(a,b)}}function Z(a){var b=[],c,d;typeof a!="function"&&(a=$(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(d)),c.parentNode=d;return S(b)}function Y(a){return function(b){return U(a,b)}}function X(a){var b=[],c,d,e,f;typeof a!="function"&&(a=Y(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(f)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return S(b)}function S(a){e(a,T);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=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));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 c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.29.6"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}var e=[].__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= <del>{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+"%)"},d3.select=function(a){return typeof a=="string"?W.select(a):S([[a]])},d3.selectAll=function(b){return typeof b=="string"?W.selectAll(b):S([a(b)])};var T=[];T.select=X,T.selectAll=Z,T.attr=_,T.classed=ba,T.style=bb,T.property=bc,T.text=bd,T.html=be,T.append=bf,T.insert=bg,T.remove=bh,T.data=bi,T.filter=bn,T.map=bo,T.sort=bp,T.on=br,T.transition=bw,T.each=bs,T.call=bt,T.empty=bu,T.node=bv;var U=function(a,b){return b.querySelector(a)},V=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(U=function(a,b){return Sizzle(a,b)[0]},V=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var W=S([[document]]);W[0].parentNode=document.documentElement;var bl=[];bl.select=bm,bl.append=bf,bl.insert=bg,bl.empty=bu;var bz=[],bA=0,bB=0,bC=d3.ease("cubic-in-out");bz.select=bD,bz.selectAll=bE,bz.attr=bF,bz.attrTween=bG,bz.style=bH,bz.styleTween=bI,bz.text=bJ,bz.remove=bK,bz.delay=bL,bz.duration=bM,bz.call=bt,d3.transition=function(){return W.transition()};var bO=null,bP,bQ;d3.timer=function(a,b){var c=Date.now(),d=!1,e,f=bO;if(arguments.length<2)b=0;else if(!isFinite(b))return;while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bO={callback:a,then:c,delay:b,next:bO}),bP||(bQ=clearTimeout(bQ),bP=1,bT(bR))},d3.timer.flush=function(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bS()};var bT=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bY([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return ce(d3.scale.linear(),cf)},cf.pow=function(a){return Math.pow(10,a)},cg.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return ci(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ck({},0,{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cl)},d3.scale.category20=function(){return d3.scale.ordinal().range(cm)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cn)},d3.scale.category20c=function(){return d3.scale.ordinal().range(co)};var cl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cm=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],co=["#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 cp([],[])},d3.scale.quantize=function(){return cq(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)+cr,h=d.apply(this,arguments)+cr,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>=cs?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=ct,b=cu,c=cv,d=cw;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+cr;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var cr=-Math.PI/2,cs=2*Math.PI-1e-6;d3.svg.line=function(){return cx(Object)};var cB={linear:cC,"step-before":cD,"step-after":cE,basis:cK,"basis-open":cL,"basis-closed":cM,bundle:cN,cardinal:cH,"cardinal-open":cF,"cardinal-closed":cG,monotone:cW},cP=[0,2/3,1/3,0],cQ=[0,1/3,2/3,0],cR=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cx(cX);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return cY(Object)},d3.svg.area.radial=function(){var a=cY(cX);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)+cr,k=e.call(a,h,g)+cr;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=c_,b=da,c=db,d=cv,e=cw;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=c_,b=da,c=de;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=de,c=a.projection;a.projection=function(a){return arguments.length?c(df(b=a)):b};return a},d3.svg.mouse=function(a){return dh(a,d3.event)};var dg=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=dh(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(dk[a.call(this,c,d)]||dk.circle)(b.call(this,c,d))}var a=dj,b=di;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 dk={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*dm)),c=b*dm;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/dl),c=b*dl/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dl),c=b*dl/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(dk);var dl=Math.sqrt(3),dm=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <add>(function(){function dj(){return"circle"}function di(){return 64}function dh(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(dg<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();dg=!e.f&&!e.e,d.remove()}dg?(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 df(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cr;return[c*Math.cos(d),c*Math.sin(d)]}}function de(a){return[a.x,a.y]}function dd(a){return a.endAngle}function dc(a){return a.startAngle}function db(a){return a.radius}function da(a){return a.target}function c_(a){return a.source}function c$(a){return function(b,c){return a[c][1]}}function cZ(a){return function(b,c){return a[c][0]}}function cY(a){function i(f){if(f.length<1)return null;var i=cy(this,f,b,d),j=cy(this,f,b===c?cZ(i):c,d===e?c$(i):e);return"M"+g(a(j),h)+"L"+g(a(i.reverse()),h)+"Z"}var b=cz,c=cz,d=0,e=cA,f="linear",g=cB[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=cB[f=a];return i},i.tension=function(a){if(!arguments.length)return h;h=a;return i};return i}function cX(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cr,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cW(a){return a.length<3?cC(a):a[0]+cI(a,cV(a))}function cV(a){var b=[],c,d,e,f,g=cU(a),h=-1,i=a.length-1;while(++h<i)c=cT(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 cU(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cT(e,f);while(++b<c)d[b]=g+(g=cT(e=f,f=a[b+1]));d[b]=g;return d}function cT(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cS(a,b,c){a.push("C",cO(cP,b),",",cO(cP,c),",",cO(cQ,b),",",cO(cQ,c),",",cO(cR,b),",",cO(cR,c))}function cO(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cN(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 cK(a)}function cM(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=[cO(cR,g),",",cO(cR,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cS(b,g,h);return b.join("")}function cL(a){if(a.length<4)return cC(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(cO(cR,f)+","+cO(cR,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cS(b,f,g);return b.join("")}function cK(a){if(a.length<3)return cC(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),cS(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),cS(b,h,i);return b.join("")}function cJ(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 cI(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cC(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 cH(a,b,c){return a.length<3?cC(a):a[0]+cI(a,cJ(a,b))}function cG(a,b){return a.length<3?cC(a):a[0]+cI((a.push(a[0]),a),cJ([a[a.length-2]].concat(a,[a[1]]),b))}function cF(a,b){return a.length<4?cC(a):a[1]+cI(a.slice(1,a.length-1),cJ(a,b))}function cE(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 cD(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 cC(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 cA(a){return a[1]}function cz(a){return a[0]}function cy(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 cx(a){function g(d){return d.length<1?null:"M"+e(a(cy(this,d,b,c)),f)}var b=cz,c=cA,d="linear",e=cB[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=cB[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g}function cw(a){return a.endAngle}function cv(a){return a.startAngle}function cu(a){return a.outerRadius}function ct(a){return a.innerRadius}function cq(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 cq(a,b,c)};return g()}function cp(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 cp(a,b)};return d()}function ck(a,b,c){function f(c){return d[((a[c]||(a[c]=++b))-1)%d.length]}var d,e;f.domain=function(d){if(!arguments.length)return d3.keys(a);a={},b=0;var e=-1,g=d.length,h;while(++e<g)a[h=d[e]]||(a[h]=++b);return f[c.t](c.x,c.p)},f.range=function(a){if(!arguments.length)return d;d=a,e=0,c={t:"range",x:a};return f},f.rangePoints=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b-1+g);d=b<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,c={t:"rangePoints",x:a,p:g};return f},f.rangeBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=(i-h)/(b+g);d=d3.range(h+j*g,i,j),e=j*(1-g),c={t:"rangeBands",x:a,p:g};return f},f.rangeRoundBands=function(a,g){arguments.length<2&&(g=0);var h=a[0],i=a[1],j=Math.floor((i-h)/(b+g)),k=i-h-(b-g)*j;d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),c={t:"rangeRoundBands",x:a,p:g};return f},f.rangeBand=function(){return e},f.copy=function(){var d={},e;for(e in a)d[e]=a[e];return ck(d,b,c)};return f[c.t](c.x,c.p)}function cj(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function ci(a,b){function e(b){return a(c(b))}var c=cj(b),d=cj(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 ca(e.domain(),a)},e.tickFormat=function(a){return cb(e.domain(),a)},e.nice=function(){return e.domain(bW(e.domain(),b$))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();c=cj(b=a),d=cj(1/b);return e.domain(f)},e.copy=function(){return ci(a.copy(),b)};return bZ(e,a)}function ch(a){return a.toPrecision(1)}function cg(a){return-Math.log(-a)/Math.LN10}function cf(a){return Math.log(a)/Math.LN10}function ce(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?cg:cf,c=b.pow,a.domain(e.map(b));return d},d.nice=function(){a.domain(bW(a.domain(),bX));return d},d.ticks=function(){var d=bV(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===cg){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 ch},d.copy=function(){return ce(a.copy(),b)};return bZ(d,a)}function cd(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 cc(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 cb(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(b_(a,b)[2])/Math.LN10+.01))+"f")}function ca(a,b){return d3.range.apply(d3,b_(a,b))}function b_(a,b){var c=bV(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 b$(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 bZ(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 bY(a,b,c,d){function h(a){return e(a)}function g(){var g=a.length==2?cc:cd,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 ca(a,b)},h.tickFormat=function(b){return cb(a,b)},h.nice=function(){bW(a,b$);return g()},h.copy=function(){return bY(a,b,c,d)};return g()}function bX(){return Math}function bW(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 bV(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bU(){}function bS(){var a=null,b=bO,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bO=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bR(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bS()-b;d>24?(isFinite(d)&&(clearTimeout(bQ),bQ=setTimeout(bR,d)),bP=0):(bP=1,bT(bR))}function bN(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 bM(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}))}function bL(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}))}function bK(){return this.each("end",function(){var a=this.__transition__,b;a.owner===a.active&&(b=this.parentNode)&&b.removeChild(this)})}function bJ(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})}function bI(a,b,c){arguments.length<3&&(c=null);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)}})}function bH(a,b,c){arguments.length<3&&(c=null);return this.styleTween(a,by(b),c)}function bG(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)}function bF(a,b){return this.attrTween(a,by(b))}function bE(a){var b=[],c,d;typeof a!="function"&&(a=$(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(d.node));for(var j=-1,k=c.length;++j<k;)c[j]={node:c[j],delay:d.delay,duration:d.duration}}return bx(b).ease(this.ease())}function bD(a){var b=[],c,d,e;typeof a!="function"&&(a=Y(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(e.node))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bx(b).ease(this.ease())}function by(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 bx(a){e(a,bz);var b=bB||++bA,c={},d=d3.dispatch("start","end"),f=bC;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 bN.call(a,b);d[b].add(c);return a},d3.timer(function(e){a.each(function(g,h,i){function p(a){if(n.active!==b)return!0;var c=Math.min(1,(a-l)/m),e=f(c),h=-1,i=j.length;while(++h<i)j[h].call(k,e);if(c===1){bB=b,d.end.dispatch.call(k,g,h),bB=0,n.owner===b&&delete k.__transition__;return!0}}function o(a){if(n.active<=b){n.active=b,d.start.dispatch.call(k,g,h);for(var e in c)(e=c[e].call(k,g,h))&&j.push(e);l-=a,d3.timer(p)}return!0}var j=[],k=this,l=a[i][h].delay-e,m=a[i][h].duration,n=k.__transition__||(k.__transition__={active:0});n.owner=b,l<=0?o(0):d3.timer(o,l)});return!0});return a}function bw(){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 bx(a)}function bv(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}function bu(){return!this.node()}function bt(a){a.apply(this,(arguments[0]=this,arguments));return this}function bs(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}function br(a,b,c){arguments.length<3&&(c=!1);var d=a.indexOf("."),e=d===-1?a:a.substring(0,d),f="__on"+a;return this.each(function(a,d){function h(a){var c=d3.event;d3.event=a;try{b.call(this,g.__data__,d)}finally{d3.event=c}}this[f]&&this.removeEventListener(e,this[f],c),b&&this.addEventListener(e,this[f]=h,c);var g=this})}function bq(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bp(a){a=bq.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}function bo(a){return this.each(function(){this.__data__=a.apply(this,arguments)})}function bn(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)}function bm(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(f.parentNode)),d.__data__=g.__data__):c.push(null)}return S(b)}function bk(a){e(a,bl);return a}function bj(a){return{__data__:a}}function bi(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]=bj(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]=bj(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bj(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 bk(c)},j.exit=function(){return S(e)};return j}function bh(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})}function bg(a,b){function d(c){return c.insertBefore(document.createElementNS(a.space,a.local),U(b,c))}function c(c){return c.insertBefore(document.createElement(a),U(b,c))}a=d3.ns.qualify(a);return this.select(a.local?d:c)}function bf(a){function c(b){return b.appendChild(document.createElementNS(a.space,a.local))}function b(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return this.select(a.local?c:b)}function be(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})}function bd(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})}function bc(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)}function bb(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)}function ba(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(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?i:b?f:g)}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)}function $(a){return function(b){return V(a,b)}}function Z(a){var b=[],c,d;typeof a!="function"&&(a=$(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(d)),c.parentNode=d;return S(b)}function Y(a){return function(b){return U(a,b)}}function X(a){var b=[],c,d,e,f;typeof a!="function"&&(a=Y(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(f)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return S(b)}function S(a){e(a,T);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=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));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 c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.29.6"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}var e=[].__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 <add>:"#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+"%)"},d3.select=function(a){return typeof a=="string"?W.select(a):S([[a]])},d3.selectAll=function(b){return typeof b=="string"?W.selectAll(b):S([a(b)])};var T=[];T.select=X,T.selectAll=Z,T.attr=_,T.classed=ba,T.style=bb,T.property=bc,T.text=bd,T.html=be,T.append=bf,T.insert=bg,T.remove=bh,T.data=bi,T.filter=bn,T.map=bo,T.sort=bp,T.on=br,T.transition=bw,T.each=bs,T.call=bt,T.empty=bu,T.node=bv;var U=function(a,b){return b.querySelector(a)},V=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(U=function(a,b){return Sizzle(a,b)[0]},V=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var W=S([[document]]);W[0].parentNode=document.documentElement;var bl=[];bl.select=bm,bl.append=bf,bl.insert=bg,bl.empty=bu;var bz=[],bA=0,bB=0,bC=d3.ease("cubic-in-out");bz.select=bD,bz.selectAll=bE,bz.attr=bF,bz.attrTween=bG,bz.style=bH,bz.styleTween=bI,bz.text=bJ,bz.remove=bK,bz.delay=bL,bz.duration=bM,bz.call=bt,d3.transition=function(){return W.transition()};var bO=null,bP,bQ;d3.timer=function(a,b){var c=Date.now(),d=!1,e,f=bO;if(arguments.length<2)b=0;else if(!isFinite(b))return;while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bO={callback:a,then:c,delay:b,next:bO}),bP||(bQ=clearTimeout(bQ),bP=1,bT(bR))},d3.timer.flush=function(){var a,b=Date.now(),c=bO;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bS()};var bT=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bY([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return ce(d3.scale.linear(),cf)},cf.pow=function(a){return Math.pow(10,a)},cg.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return ci(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ck({},0,{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cl)},d3.scale.category20=function(){return d3.scale.ordinal().range(cm)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cn)},d3.scale.category20c=function(){return d3.scale.ordinal().range(co)};var cl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cm=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],co=["#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 cp([],[])},d3.scale.quantize=function(){return cq(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)+cr,h=d.apply(this,arguments)+cr,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>=cs?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=ct,b=cu,c=cv,d=cw;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+cr;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var cr=-Math.PI/2,cs=2*Math.PI-1e-6;d3.svg.line=function(){return cx(Object)};var cB={linear:cC,"step-before":cD,"step-after":cE,basis:cK,"basis-open":cL,"basis-closed":cM,bundle:cN,cardinal:cH,"cardinal-open":cF,"cardinal-closed":cG,monotone:cW},cP=[0,2/3,1/3,0],cQ=[0,1/3,2/3,0],cR=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cx(cX);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return cY(Object)},d3.svg.area.radial=function(){var a=cY(cX);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)+cr,k=e.call(a,h,g)+cr;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=c_,b=da,c=db,d=cv,e=cw;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=c_,b=da,c=de;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=de,c=a.projection;a.projection=function(a){return arguments.length?c(df(b=a)):b};return a},d3.svg.mouse=function(a){return dh(a,d3.event)};var dg=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=dh(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(dk[a.call(this,c,d)]||dk.circle)(b.call(this,c,d))}var a=dj,b=di;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 dk={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*dm)),c=b*dm;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/dl),c=b*dl/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dl),c=b*dl/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(dk);var dl=Math.sqrt(3),dm=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <ide><path>src/core/selection-map.js <ide> function d3_selection_map(map) { <del> for (var j = 0, m = this.length; j < m; j++) { <del> for (var group = this[j], i = 0, n = group.length, node; i < n; i++) { <del> if (node = group[i]) node.__data__ = map.call(node, node.__data__, i); <del> } <del> } <del> return this; <add> return this.each(function() { <add> this.__data__ = map.apply(this, arguments); <add> }); <ide> }
3
Ruby
Ruby
remove deprecated constants autoload
b990921f05b641c0d6f1b98c2c2ac19b9cdf9906
<ide><path>actionpack/lib/action_controller.rb <ide> module ActionController <ide> autoload :UrlFor <ide> end <ide> <del> autoload :Integration, 'action_controller/deprecated/integration_test' <del> autoload :IntegrationTest, 'action_controller/deprecated/integration_test' <del> autoload :Routing, 'action_controller/deprecated' <ide> autoload :TestCase, 'action_controller/test_case' <ide> autoload :TemplateAssertions, 'action_controller/test_case' <ide>
1
PHP
PHP
add deprecation warnings to event/filesystem
dce82efd44279378df075b37a16dea42d343f435
<ide><path>src/Event/Event.php <ide> public function __construct($name, $subject = null, $data = null) <ide> */ <ide> public function __get($attribute) <ide> { <add> $method = 'get' . ucfirst($attribute); <add> deprecationWarning( <add> "Event::${$attribute} is deprecated. " . <add> "Use Event::{$method}() instead." <add> ); <ide> if ($attribute === 'name' || $attribute === 'subject') { <ide> return $this->{$attribute}(); <ide> } <ide> public function __get($attribute) <ide> */ <ide> public function __set($attribute, $value) <ide> { <add> $method = 'set' . ucfirst($attribute); <add> deprecationWarning( <add> "Event::${$attribute} is deprecated. " . <add> "Use Event::{$method}() instead." <add> ); <ide> if ($attribute === 'data') { <ide> $this->_data = (array)$value; <ide> } <ide> public function __set($attribute, $value) <ide> */ <ide> public function name() <ide> { <add> deprecationWarning('Event::name() is deprecated. Use Event::getName() instead.'); <add> <ide> return $this->_name; <ide> } <ide> <ide> public function getName() <ide> */ <ide> public function subject() <ide> { <add> deprecationWarning('Event::subject() is deprecated. Use Event::getSubject() instead.'); <add> <ide> return $this->_subject; <ide> } <ide> <ide> public function isStopped() <ide> */ <ide> public function result() <ide> { <add> deprecationWarning('Event::result() is deprecated. Use Event::getResult() instead.'); <add> <ide> return $this->result; <ide> } <ide> <ide><path>src/Event/EventDispatcherTrait.php <ide> trait EventDispatcherTrait <ide> */ <ide> public function eventManager(EventManager $eventManager = null) <ide> { <add> deprecationWarning( <add> 'EventDispatcherTrait::eventManager() is deprecated. ' . <add> 'Use EventDispatcherTrait::setEventManager()/getEventManager() instead.' <add> ); <ide> if ($eventManager !== null) { <ide> $this->setEventManager($eventManager); <ide> } <ide><path>src/Event/EventManager.php <ide> public static function instance($manager = null) <ide> */ <ide> public function attach($callable, $eventKey = null, array $options = []) <ide> { <add> deprecationWarning('EventManager::attach() is deprecated. Use EventManager::on() instead.'); <ide> if ($eventKey === null) { <ide> $this->on($callable); <ide> <ide> protected function _extractCallable($function, $object) <ide> */ <ide> public function detach($callable, $eventKey = null) <ide> { <add> deprecationWarning('EventManager::detach() is deprecated. Use EventManager::off() instead.'); <ide> if ($eventKey === null) { <ide> $this->off($callable); <ide> <ide><path>src/Filesystem/Folder.php <ide> public static function addPathElement($path, $element) <ide> */ <ide> public function inCakePath($path = '') <ide> { <add> deprecationWarning('Folder::inCakePath() is deprecated. Use Folder::inPath() instead.'); <ide> $dir = substr(Folder::slashTerm(ROOT), 0, -1); <ide> $newdir = $dir . $path; <ide> <ide><path>tests/TestCase/Event/EventDispatcherTraitTest.php <ide> public function testIsInitiallyEmpty() <ide> /** <ide> * testEventManager <ide> * <add> * @group deprecated <ide> * @return void <ide> */ <ide> public function testEventManager() <ide> { <del> $eventManager = new EventManager(); <del> <del> $this->subject->eventManager($eventManager); <add> $this->deprecated(function () { <add> $eventManager = new EventManager(); <add> $this->subject->eventManager($eventManager); <ide> <del> $this->assertSame($eventManager, $this->subject->eventManager()); <add> $this->assertSame($eventManager, $this->subject->eventManager()); <add> }); <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Event/EventManagerTest.php <ide> class EventManagerTest extends TestCase <ide> /** <ide> * Tests the attach() method for a single event key in multiple queues <ide> * <add> * @group deprecated <ide> * @return void <ide> */ <ide> public function testAttachListeners() <ide> { <del> $manager = new EventManager(); <del> $manager->attach('fakeFunction', 'fake.event'); <del> $expected = [ <del> ['callable' => 'fakeFunction'] <del> ]; <del> $this->assertEquals($expected, $manager->listeners('fake.event')); <del> <del> $manager->attach('fakeFunction2', 'fake.event'); <del> $expected[] = ['callable' => 'fakeFunction2']; <del> $this->assertEquals($expected, $manager->listeners('fake.event')); <del> <del> $manager->attach('inQ5', 'fake.event', ['priority' => 5]); <del> $manager->attach('inQ1', 'fake.event', ['priority' => 1]); <del> $manager->attach('otherInQ5', 'fake.event', ['priority' => 5]); <del> <del> $expected = array_merge( <del> [ <del> ['callable' => 'inQ1'], <del> ['callable' => 'inQ5'], <del> ['callable' => 'otherInQ5'] <del> ], <del> $expected <del> ); <del> $this->assertEquals($expected, $manager->listeners('fake.event')); <add> $this->deprecated(function () { <add> $manager = new EventManager(); <add> $manager->attach('fakeFunction', 'fake.event'); <add> $expected = [ <add> ['callable' => 'fakeFunction'] <add> ]; <add> $this->assertEquals($expected, $manager->listeners('fake.event')); <add> <add> $manager->attach('fakeFunction2', 'fake.event'); <add> $expected[] = ['callable' => 'fakeFunction2']; <add> $this->assertEquals($expected, $manager->listeners('fake.event')); <add> <add> $manager->attach('inQ5', 'fake.event', ['priority' => 5]); <add> $manager->attach('inQ1', 'fake.event', ['priority' => 1]); <add> $manager->attach('otherInQ5', 'fake.event', ['priority' => 5]); <add> <add> $expected = array_merge( <add> [ <add> ['callable' => 'inQ1'], <add> ['callable' => 'inQ5'], <add> ['callable' => 'otherInQ5'] <add> ], <add> $expected <add> ); <add> $this->assertEquals($expected, $manager->listeners('fake.event')); <add> }); <ide> } <ide> <ide> /** <ide> * Tests the attach() method for multiple event key in multiple queues <ide> * <add> * @group deprecated <ide> * @return void <ide> */ <ide> public function testAttachMultipleEventKeys() <ide> { <del> $manager = new EventManager(); <del> $manager->attach('fakeFunction', 'fake.event'); <del> $manager->attach('fakeFunction2', 'another.event'); <del> $manager->attach('fakeFunction3', 'another.event', ['priority' => 1]); <del> $expected = [ <del> ['callable' => 'fakeFunction'] <del> ]; <del> $this->assertEquals($expected, $manager->listeners('fake.event')); <del> <del> $expected = [ <del> ['callable' => 'fakeFunction3'], <del> ['callable' => 'fakeFunction2'] <del> ]; <del> $this->assertEquals($expected, $manager->listeners('another.event')); <add> $this->deprecated(function () { <add> $manager = new EventManager(); <add> $manager->attach('fakeFunction', 'fake.event'); <add> $manager->attach('fakeFunction2', 'another.event'); <add> $manager->attach('fakeFunction3', 'another.event', ['priority' => 1]); <add> $expected = [ <add> ['callable' => 'fakeFunction'] <add> ]; <add> $this->assertEquals($expected, $manager->listeners('fake.event')); <add> <add> $expected = [ <add> ['callable' => 'fakeFunction3'], <add> ['callable' => 'fakeFunction2'] <add> ]; <add> $this->assertEquals($expected, $manager->listeners('another.event')); <add> }); <ide> } <ide> <ide> /** <ide> public function testAttachMultipleEventKeys() <ide> public function testMatchingListeners() <ide> { <ide> $manager = new EventManager(); <del> $manager->attach('fakeFunction1', 'fake.event'); <del> $manager->attach('fakeFunction2', 'real.event'); <del> $manager->attach('fakeFunction3', 'test.event'); <del> $manager->attach('fakeFunction4', 'event.test'); <add> $manager->on('fake.event', 'fakeFunction1'); <add> $manager->on('real.event', 'fakeFunction2'); <add> $manager->on('test.event', 'fakeFunction3'); <add> $manager->on('event.test', 'fakeFunction4'); <ide> <ide> $this->assertArrayHasKey('fake.event', $manager->matchingListeners('fake.event')); <ide> $this->assertArrayHasKey('real.event', $manager->matchingListeners('real.event')); <ide> public function testRemoveAllListeners() <ide> /** <ide> * Tests detaching an event from a event key queue <ide> * <add> * @group deprecated <ide> * @return void <ide> */ <ide> public function testDetach() <ide> { <del> $manager = new EventManager(); <del> $manager->attach(['AClass', 'aMethod'], 'fake.event'); <del> $manager->attach(['AClass', 'anotherMethod'], 'another.event'); <del> $manager->attach('fakeFunction', 'another.event', ['priority' => 1]); <add> $this->deprecated(function () { <add> $manager = new EventManager(); <add> $manager->attach(['AClass', 'aMethod'], 'fake.event'); <add> $manager->attach(['AClass', 'anotherMethod'], 'another.event'); <add> $manager->attach('fakeFunction', 'another.event', ['priority' => 1]); <ide> <del> $manager->detach(['AClass', 'aMethod'], 'fake.event'); <del> $this->assertEquals([], $manager->listeners('fake.event')); <add> $manager->detach(['AClass', 'aMethod'], 'fake.event'); <add> $this->assertEquals([], $manager->listeners('fake.event')); <ide> <del> $manager->detach(['AClass', 'anotherMethod'], 'another.event'); <del> $expected = [ <del> ['callable' => 'fakeFunction'] <del> ]; <del> $this->assertEquals($expected, $manager->listeners('another.event')); <add> $manager->detach(['AClass', 'anotherMethod'], 'another.event'); <add> $expected = [ <add> ['callable' => 'fakeFunction'] <add> ]; <add> $this->assertEquals($expected, $manager->listeners('another.event')); <ide> <del> $manager->detach('fakeFunction', 'another.event'); <del> $this->assertEquals([], $manager->listeners('another.event')); <add> $manager->detach('fakeFunction', 'another.event'); <add> $this->assertEquals([], $manager->listeners('another.event')); <add> }); <ide> } <ide> <ide> /** <ide> * Tests detaching an event from all event queues <ide> * <add> * @group deprecated <ide> * @return void <ide> */ <ide> public function testDetachFromAll() <ide> { <del> $manager = new EventManager(); <del> $manager->attach(['AClass', 'aMethod'], 'fake.event'); <del> $manager->attach(['AClass', 'aMethod'], 'another.event'); <del> $manager->attach('fakeFunction', 'another.event', ['priority' => 1]); <del> <del> $manager->detach(['AClass', 'aMethod']); <del> $expected = [ <del> ['callable' => 'fakeFunction'] <del> ]; <del> $this->assertEquals($expected, $manager->listeners('another.event')); <del> $this->assertEquals([], $manager->listeners('fake.event')); <add> $this->deprecated(function () { <add> $manager = new EventManager(); <add> $manager->attach(['AClass', 'aMethod'], 'fake.event'); <add> $manager->attach(['AClass', 'aMethod'], 'another.event'); <add> $manager->attach('fakeFunction', 'another.event', ['priority' => 1]); <add> <add> $manager->detach(['AClass', 'aMethod']); <add> $expected = [ <add> ['callable' => 'fakeFunction'] <add> ]; <add> $this->assertEquals($expected, $manager->listeners('another.event')); <add> $this->assertEquals([], $manager->listeners('fake.event')); <add> }); <ide> } <ide> <ide> /** <ide> public function testDispatch() <ide> ->getMock(); <ide> $anotherListener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener') <ide> ->getMock(); <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <del> $manager->attach([$anotherListener, 'listenerFunction'], 'fake.event'); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <add> $manager->on('fake.event', [$anotherListener, 'listenerFunction']); <ide> $event = new Event('fake.event'); <ide> <ide> $listener->expects($this->once())->method('listenerFunction')->with($event); <ide> public function testDispatchWithKeyName() <ide> { <ide> $manager = new EventManager(); <ide> $listener = new EventTestListener; <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <ide> $event = 'fake.event'; <ide> $manager->dispatch($event); <ide> <ide> public function testDispatchReturnValue() <ide> ->getMock(); <ide> $anotherListener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener') <ide> ->getMock(); <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <del> $manager->attach([$anotherListener, 'listenerFunction'], 'fake.event'); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <add> $manager->on('fake.event', [$anotherListener, 'listenerFunction']); <ide> $event = new Event('fake.event'); <ide> <ide> $listener->expects($this->at(0))->method('listenerFunction') <ide> public function testDispatchFalseStopsEvent() <ide> ->getMock(); <ide> $anotherListener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener') <ide> ->getMock(); <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <del> $manager->attach([$anotherListener, 'listenerFunction'], 'fake.event'); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <add> $manager->on('fake.event', [$anotherListener, 'listenerFunction']); <ide> $event = new Event('fake.event'); <ide> <ide> $listener->expects($this->at(0))->method('listenerFunction') <ide> public function testDispatchPrioritized() <ide> { <ide> $manager = new EventManager(); <ide> $listener = new EventTestListener; <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <del> $manager->attach([$listener, 'secondListenerFunction'], 'fake.event', ['priority' => 5]); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <add> $manager->on('fake.event', ['priority' => 5], [$listener, 'secondListenerFunction']); <ide> $event = new Event('fake.event'); <ide> $manager->dispatch($event); <ide> <ide> public function testDispatchPrioritized() <ide> * @triggers fake.event <ide> * @triggers another.event $this, array(some => data) <ide> */ <del> public function testAttachSubscriber() <add> public function testOnSubscriber() <ide> { <ide> $manager = new EventManager(); <ide> $listener = $this->getMockBuilder(__NAMESPACE__ . '\CustomTestEventListenerInterface') <ide> ->setMethods(['secondListenerFunction']) <ide> ->getMock(); <del> $manager->attach($listener); <add> $manager->on($listener); <ide> <ide> $event = new Event('fake.event'); <ide> $manager->dispatch($event); <ide> public function testAttachSubscriber() <ide> * @return void <ide> * @triggers multiple.handlers <ide> */ <del> public function testAttachSubscriberMultiple() <add> public function testOnSubscriberMultiple() <ide> { <ide> $manager = new EventManager(); <ide> $listener = $this->getMockBuilder(__NAMESPACE__ . '\CustomTestEventListenerInterface') <ide> ->setMethods(['listenerFunction', 'thirdListenerFunction']) <ide> ->getMock(); <del> $manager->attach($listener); <add> $manager->on($listener); <ide> $event = new Event('multiple.handlers'); <ide> $listener->expects($this->once()) <ide> ->method('listenerFunction') <ide> public function testDetachSubscriber() <ide> $listener = $this->getMockBuilder(__NAMESPACE__ . '\CustomTestEventListenerInterface') <ide> ->setMethods(['secondListenerFunction']) <ide> ->getMock(); <del> $manager->attach($listener); <add> $manager->on($listener); <ide> $expected = [ <ide> ['callable' => [$listener, 'secondListenerFunction']] <ide> ]; <ide> public function testDetachSubscriber() <ide> ['callable' => [$listener, 'listenerFunction']] <ide> ]; <ide> $this->assertEquals($expected, $manager->listeners('fake.event')); <del> $manager->detach($listener); <add> $manager->off($listener); <ide> $this->assertEquals([], $manager->listeners('fake.event')); <ide> $this->assertEquals([], $manager->listeners('another.event')); <ide> } <ide> public function testStopPropagation() <ide> ->with('fake.event') <ide> ->will($this->returnValue([])); <ide> <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <del> $manager->attach([$listener, 'stopListener'], 'fake.event', ['priority' => 8]); <del> $manager->attach([$listener, 'secondListenerFunction'], 'fake.event', ['priority' => 5]); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <add> $manager->on('fake.event', ['priority' => 8], [$listener, 'stopListener']); <add> $manager->on('fake.event', ['priority' => 5], [$listener, 'secondListenerFunction']); <ide> $event = new Event('fake.event'); <ide> $manager->dispatch($event); <ide> <ide> public function testDispatchPrioritizedWithGlobal() <ide> ]] <ide> )); <ide> <del> $manager->attach([$listener, 'listenerFunction'], 'fake.event'); <del> $manager->attach([$listener, 'thirdListenerFunction'], 'fake.event', ['priority' => 15]); <add> $manager->on('fake.event', [$listener, 'listenerFunction']); <add> $manager->on('fake.event', ['priority' => 15], [$listener, 'thirdListenerFunction']); <ide> <ide> $manager->dispatch($event); <ide> <ide> public function testDispatchGlobalBeforeLocal() <ide> ]] <ide> )); <ide> <del> $manager->attach([$listener, 'secondListenerFunction'], 'fake.event'); <add> $manager->on('fake.event', [$listener, 'secondListenerFunction']); <ide> <ide> $manager->dispatch($event); <ide> <ide><path>tests/TestCase/Event/EventTest.php <ide> public function testName() <ide> { <ide> $event = new Event('fake.event'); <ide> $this->assertEquals('fake.event', $event->getName()); <del> $this->assertEquals('fake.event', $event->getName()); <ide> } <ide> <ide> /** <ide> public function testSubject() <ide> { <ide> $event = new Event('fake.event', $this); <ide> $this->assertSame($this, $event->getSubject()); <del> $this->assertSame($this, $event->getSubject()); <ide> <ide> $event = new Event('fake.event'); <ide> $this->assertNull($event->getSubject()); <ide> public function testEventData() <ide> { <ide> $event = new Event('fake.event', $this, ['some' => 'data']); <ide> $this->assertEquals(['some' => 'data'], $event->getData()); <del> $this->assertEquals(['some' => 'data'], $event->getData()); <ide> <ide> $this->assertEquals('data', $event->getData('some')); <ide> $this->assertNull($event->getData('undef')); <ide> public function testEventDataObject() <ide> $data = new ArrayObject(['some' => 'data']); <ide> $event = new Event('fake.event', $this, $data); <ide> $this->assertEquals(['some' => 'data'], $event->getData()); <del> $this->assertEquals(['some' => 'data'], $event->getData()); <ide> <ide> $this->assertEquals('data', $event->getData('some')); <ide> $this->assertNull($event->getData('undef')); <ide><path>tests/TestCase/Filesystem/FolderTest.php <ide> public function testCorrectSlashFor() <ide> /** <ide> * testInCakePath method <ide> * <add> * @group deprecated <ide> * @return void <ide> */ <ide> public function testInCakePath() <ide> { <del> $Folder = new Folder(); <del> $Folder->cd(ROOT); <del> $path = 'C:\\path\\to\\file'; <del> $result = $Folder->inCakePath($path); <del> $this->assertFalse($result); <add> $this->deprecated(function () { <add> $Folder = new Folder(); <add> $Folder->cd(ROOT); <add> $path = 'C:\\path\\to\\file'; <add> $result = $Folder->inCakePath($path); <add> $this->assertFalse($result); <ide> <del> $path = ROOT; <del> $Folder->cd(ROOT); <del> $result = $Folder->inCakePath($path); <del> $this->assertFalse($result); <add> $path = ROOT; <add> $Folder->cd(ROOT); <add> $result = $Folder->inCakePath($path); <add> $this->assertFalse($result); <ide> <del> $path = DS . 'config'; <del> $Folder->cd(ROOT . DS . 'config'); <del> $result = $Folder->inCakePath($path); <del> $this->assertTrue($result); <add> $path = DS . 'config'; <add> $Folder->cd(ROOT . DS . 'config'); <add> $result = $Folder->inCakePath($path); <add> $this->assertTrue($result); <add> }); <ide> } <ide> <ide> /**
8
Javascript
Javascript
add documentation to textinput's flow types
d00f0882fbdd532f8698d2569bd771ca5843d0f5
<ide><path>Libraries/Components/TextInput/TextInput.js <ide> export type TextContentType = <ide> type PasswordRules = string; <ide> <ide> type IOSProps = $ReadOnly<{| <add> /** <add> * If `false`, disables spell-check style (i.e. red underlines). <add> * The default value is inherited from `autoCorrect`. <add> * @platform ios <add> */ <ide> spellCheck?: ?boolean, <add> <add> /** <add> * Determines the color of the keyboard. <add> * @platform ios <add> */ <ide> keyboardAppearance?: ?('default' | 'light' | 'dark'), <add> <add> /** <add> * If `true`, the keyboard disables the return key when there is no text and <add> * automatically enables it when there is text. The default value is `false`. <add> * @platform ios <add> */ <ide> enablesReturnKeyAutomatically?: ?boolean, <add> <add> /** <add> * An instance of `DocumentSelectionState`, this is some state that is responsible for <add> * maintaining selection information for a document. <add> * <add> * Some functionality that can be performed with this instance is: <add> * <add> * - `blur()` <add> * - `focus()` <add> * - `update()` <add> * <add> * > You can reference `DocumentSelectionState` in <add> * > [`vendor/document/selection/DocumentSelectionState.js`](https://github.com/facebook/react-native/blob/master/Libraries/vendor/document/selection/DocumentSelectionState.js) <add> * <add> * @platform ios <add> */ <ide> selectionState?: ?DocumentSelectionState, <add> <add> /** <add> * When the clear button should appear on the right side of the text view. <add> * This property is supported only for single-line TextInput component. <add> * @platform ios <add> */ <ide> clearButtonMode?: ?('never' | 'while-editing' | 'unless-editing' | 'always'), <add> <add> /** <add> * If `true`, clears the text field automatically when editing begins. <add> * @platform ios <add> */ <ide> clearTextOnFocus?: ?boolean, <add> <add> /** <add> * Determines the types of data converted to clickable URLs in the text input. <add> * Only valid if `multiline={true}` and `editable={false}`. <add> * By default no data types are detected. <add> * <add> * You can provide one type or an array of many types. <add> * <add> * Possible values for `dataDetectorTypes` are: <add> * <add> * - `'phoneNumber'` <add> * - `'link'` <add> * - `'address'` <add> * - `'calendarEvent'` <add> * - `'none'` <add> * - `'all'` <add> * <add> * @platform ios <add> */ <ide> dataDetectorTypes?: <ide> | ?DataDetectorTypesType <ide> | $ReadOnlyArray<DataDetectorTypesType>, <add> <add> /** <add> * An optional identifier which links a custom InputAccessoryView to <add> * this text input. The InputAccessoryView is rendered above the <add> * keyboard when this text input is focused. <add> * @platform ios <add> */ <ide> inputAccessoryViewID?: ?string, <add> <add> /** <add> * Give the keyboard and the system information about the <add> * expected semantic meaning for the content that users enter. <add> * @platform ios <add> */ <ide> textContentType?: ?TextContentType, <add> <ide> PasswordRules?: ?PasswordRules, <add> <add> /** <add> * If `false`, scrolling of the text view will be disabled. <add> * The default value is `true`. Does only work with 'multiline={true}'. <add> * @platform ios <add> */ <ide> scrollEnabled?: ?boolean, <ide> |}>; <ide> <ide> type AndroidProps = $ReadOnly<{| <add> /** <add> * Determines which content to suggest on auto complete, e.g.`username`. <add> * To disable auto complete, use `off`. <add> * <add> * *Android Only* <add> * <add> * The following values work on Android only: <add> * <add> * - `username` <add> * - `password` <add> * - `email` <add> * - `name` <add> * - `tel` <add> * - `street-address` <add> * - `postal-code` <add> * - `cc-number` <add> * - `cc-csc` <add> * - `cc-exp` <add> * - `cc-exp-month` <add> * - `cc-exp-year` <add> * - `off` <add> * <add> * @platform android <add> */ <ide> autoCompleteType?: ?( <ide> | 'cc-csc' <ide> | 'cc-exp' <ide> type AndroidProps = $ReadOnly<{| <ide> | 'username' <ide> | 'off' <ide> ), <add> <add> /** <add> * Sets the return key to the label. Use it instead of `returnKeyType`. <add> * @platform android <add> */ <ide> returnKeyLabel?: ?string, <add> <add> /** <add> * Sets the number of lines for a `TextInput`. Use it with multiline set to <add> * `true` to be able to fill the lines. <add> * @platform android <add> */ <ide> numberOfLines?: ?number, <add> <add> /** <add> * When `false`, if there is a small amount of space available around a text input <add> * (e.g. landscape orientation on a phone), the OS may choose to have the user edit <add> * the text inside of a full screen text input mode. When `true`, this feature is <add> * disabled and users will always edit the text directly inside of the text input. <add> * Defaults to `false`. <add> * @platform android <add> */ <ide> disableFullscreenUI?: ?boolean, <add> <add> /** <add> * Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced` <add> * The default value is `simple`. <add> * @platform android <add> */ <ide> textBreakStrategy?: ?('simple' | 'highQuality' | 'balanced'), <add> <add> /** <add> * The color of the `TextInput` underline. <add> * @platform android <add> */ <ide> underlineColorAndroid?: ?ColorValue, <add> <add> /** <add> * If defined, the provided image resource will be rendered on the left. <add> * The image resource must be inside `/android/app/src/main/res/drawable` and referenced <add> * like <add> * ``` <add> * <TextInput <add> * inlineImageLeft='search_icon' <add> * /> <add> * ``` <add> * @platform android <add> */ <ide> inlineImageLeft?: ?string, <add> <add> /** <add> * Padding between the inline image, if any, and the text input itself. <add> * @platform android <add> */ <ide> inlineImagePadding?: ?number, <add> <ide> importantForAutofill?: ?( <ide> | 'auto' <ide> | 'no' <ide> | 'noExcludeDescendants' <ide> | 'yes' <ide> | 'yesExcludeDescendants' <ide> ), <add> <add> /** <add> * When `false`, it will prevent the soft keyboard from showing when the field is focused. <add> * Defaults to `true`. <add> * @platform android <add> */ <ide> showSoftInputOnFocus?: ?boolean, <ide> |}>; <ide> <ide> type Props = $ReadOnly<{| <ide> ...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>, <ide> ...IOSProps, <ide> ...AndroidProps, <add> <add> /** <add> * Can tell `TextInput` to automatically capitalize certain characters. <add> * <add> * - `characters`: all characters. <add> * - `words`: first letter of each word. <add> * - `sentences`: first letter of each sentence (*default*). <add> * - `none`: don't auto capitalize anything. <add> */ <ide> autoCapitalize?: ?AutoCapitalize, <add> <add> /** <add> * If `false`, disables auto-correct. The default value is `true`. <add> */ <ide> autoCorrect?: ?boolean, <add> <add> /** <add> * If `true`, focuses the input on `componentDidMount`. <add> * The default value is `false`. <add> */ <ide> autoFocus?: ?boolean, <add> <add> /** <add> * Specifies whether fonts should scale to respect Text Size accessibility settings. The <add> * default is `true`. <add> */ <ide> allowFontScaling?: ?boolean, <add> <add> /** <add> * Specifies largest possible scale a font can reach when `allowFontScaling` is enabled. <add> * Possible values: <add> * `null/undefined` (default): inherit from the parent node or the global default (0) <add> * `0`: no max, ignore parent/global default <add> * `>= 1`: sets the maxFontSizeMultiplier of this node to this value <add> */ <ide> maxFontSizeMultiplier?: ?number, <add> <add> /** <add> * If `false`, text is not editable. The default value is `true`. <add> */ <ide> editable?: ?boolean, <add> <add> /** <add> * Determines which keyboard to open, e.g.`numeric`. <add> * <add> * The following values work across platforms: <add> * <add> * - `default` <add> * - `numeric` <add> * - `number-pad` <add> * - `decimal-pad` <add> * - `email-address` <add> * - `phone-pad` <add> * <add> * *iOS Only* <add> * <add> * The following values work on iOS only: <add> * <add> * - `ascii-capable` <add> * - `numbers-and-punctuation` <add> * - `url` <add> * - `name-phone-pad` <add> * - `twitter` <add> * - `web-search` <add> * <add> * *Android Only* <add> * <add> * The following values work on Android only: <add> * <add> * - `visible-password` <add> */ <ide> keyboardType?: ?KeyboardType, <add> <add> /** <add> * Determines how the return key should look. On Android you can also use <add> * `returnKeyLabel`. <add> * <add> * *Cross platform* <add> * <add> * The following values work across platforms: <add> * <add> * - `done` <add> * - `go` <add> * - `next` <add> * - `search` <add> * - `send` <add> * <add> * *Android Only* <add> * <add> * The following values work on Android only: <add> * <add> * - `none` <add> * - `previous` <add> * <add> * *iOS Only* <add> * <add> * The following values work on iOS only: <add> * <add> * - `default` <add> * - `emergency-call` <add> * - `google` <add> * - `join` <add> * - `route` <add> * - `yahoo` <add> */ <ide> returnKeyType?: ?ReturnKeyType, <add> <add> /** <add> * Limits the maximum number of characters that can be entered. Use this <add> * instead of implementing the logic in JS to avoid flicker. <add> */ <ide> maxLength?: ?number, <add> <add> /** <add> * If `true`, the text input can be multiple lines. <add> * The default value is `false`. <add> */ <ide> multiline?: ?boolean, <add> <add> /** <add> * Callback that is called when the text input is blurred. <add> */ <ide> onBlur?: ?(e: BlurEvent) => mixed, <add> <add> /** <add> * Callback that is called when the text input is focused. <add> */ <ide> onFocus?: ?(e: FocusEvent) => mixed, <add> <add> /** <add> * Callback that is called when the text input's text changes. <add> */ <ide> onChange?: ?(e: ChangeEvent) => mixed, <add> <add> /** <add> * Callback that is called when the text input's text changes. <add> * Changed text is passed as an argument to the callback handler. <add> */ <ide> onChangeText?: ?(text: string) => mixed, <add> <add> /** <add> * Callback that is called when the text input's content size changes. <add> * This will be called with <add> * `{ nativeEvent: { contentSize: { width, height } } }`. <add> * <add> * Only called for multiline text inputs. <add> */ <ide> onContentSizeChange?: ?(e: ContentSizeChangeEvent) => mixed, <add> <ide> onTextInput?: ?(e: TextInputEvent) => mixed, <add> <add> /** <add> * Callback that is called when text input ends. <add> */ <ide> onEndEditing?: ?(e: EditingEvent) => mixed, <add> <add> /** <add> * Callback that is called when the text input selection is changed. <add> * This will be called with <add> * `{ nativeEvent: { selection: { start, end } } }`. <add> */ <ide> onSelectionChange?: ?(e: SelectionChangeEvent) => mixed, <add> <add> /** <add> * Callback that is called when the text input's submit button is pressed. <add> * Invalid if `multiline={true}` is specified. <add> */ <ide> onSubmitEditing?: ?(e: EditingEvent) => mixed, <add> <add> /** <add> * Callback that is called when a key is pressed. <add> * This will be called with `{ nativeEvent: { key: keyValue } }` <add> * where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and <add> * the typed-in character otherwise including `' '` for space. <add> * Fires before `onChange` callbacks. <add> */ <ide> onKeyPress?: ?(e: KeyPressEvent) => mixed, <add> <add> /** <add> * Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`. <add> * May also contain other properties from ScrollEvent but on Android contentSize <add> * is not provided for performance reasons. <add> */ <ide> onScroll?: ?(e: ScrollEvent) => mixed, <add> <add> /** <add> * The string that will be rendered before text input has been entered. <add> */ <ide> placeholder?: ?Stringish, <add> <add> /** <add> * The text color of the placeholder string. <add> */ <ide> placeholderTextColor?: ?ColorValue, <add> <add> /** <add> * If `true`, the text input obscures the text entered so that sensitive text <add> * like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'. <add> */ <ide> secureTextEntry?: ?boolean, <add> <add> /** <add> * The highlight and cursor color of the text input. <add> */ <ide> selectionColor?: ?ColorValue, <add> <add> /** <add> * The start and end of the text input's selection. Set start and end to <add> * the same value to position the cursor. <add> */ <ide> selection?: ?$ReadOnly<{| <ide> start: number, <ide> end?: ?number, <ide> |}>, <add> <add> /** <add> * The value to show for the text input. `TextInput` is a controlled <add> * component, which means the native value will be forced to match this <add> * value prop if provided. For most uses, this works great, but in some <add> * cases this may cause flickering - one common cause is preventing edits <add> * by keeping value the same. In addition to simply setting the same value, <add> * either set `editable={false}`, or set/update `maxLength` to prevent <add> * unwanted edits without flicker. <add> */ <ide> value?: ?Stringish, <add> <add> /** <add> * Provides an initial value that will change when the user starts typing. <add> * Useful for simple use-cases where you do not want to deal with listening <add> * to events and updating the value prop to keep the controlled state in sync. <add> */ <ide> defaultValue?: ?Stringish, <add> <add> /** <add> * If `true`, all text will automatically be selected on focus. <add> */ <ide> selectTextOnFocus?: ?boolean, <add> <add> /** <add> * If `true`, the text field will blur when submitted. <add> * The default value is true for single-line fields and false for <add> * multiline fields. Note that for multiline fields, setting `blurOnSubmit` <add> * to `true` means that pressing return will blur the field and trigger the <add> * `onSubmitEditing` event instead of inserting a newline into the field. <add> */ <ide> blurOnSubmit?: ?boolean, <add> <add> /** <add> * Note that not all Text styles are supported, an incomplete list of what is not supported includes: <add> * <add> * - `borderLeftWidth` <add> * - `borderTopWidth` <add> * - `borderRightWidth` <add> * - `borderBottomWidth` <add> * - `borderTopLeftRadius` <add> * - `borderTopRightRadius` <add> * - `borderBottomRightRadius` <add> * - `borderBottomLeftRadius` <add> * <add> * see [Issue#7070](https://github.com/facebook/react-native/issues/7070) <add> * for more detail. <add> * <add> * [Styles](docs/style.html) <add> */ <ide> style?: ?TextStyleProp, <add> <add> /** <add> * If `true`, caret is hidden. The default value is `false`. <add> * This property is supported only for single-line TextInput component on iOS. <add> */ <ide> caretHidden?: ?boolean, <add> <add> /* <add> * If `true`, contextMenuHidden is hidden. The default value is `false`. <add> */ <ide> contextMenuHidden?: ?boolean, <ide> |}>; <ide>
1
Javascript
Javascript
remove redefinition of fog chunk
15ee4cf3b3cb6c8bbec642c22b3645e98f1511c8
<ide><path>examples/js/effects/OutlineEffect.js <ide> THREE.OutlineEffect = function ( renderer, parameters ) { <ide> <ide> var vertexShaderChunk = [ <ide> <del> "#include <fog_pars_vertex>", <del> <ide> "uniform float outlineThickness;", <ide> <ide> "vec4 calculateOutline( vec4 pos, vec3 objectNormal, vec4 skinned ) {",
1
Ruby
Ruby
fix typo in method description in responder class
56d386254123df3083437ecd619b4a7242cf0788
<ide><path>actionpack/lib/action_controller/metal/responder.rb <ide> def initialize(controller, resources, options={}) <ide> undef_method(:to_json) if method_defined?(:to_json) <ide> undef_method(:to_yaml) if method_defined?(:to_yaml) <ide> <del> # Initializes a new responder an invoke the proper format. If the format is <add> # Initializes a new responder and invokes the proper format. If the format is <ide> # not defined, call to_format. <ide> # <ide> def self.call(*args)
1
PHP
PHP
add a passwordreset event.
d36101c68f43e22fbe69e61eb2d9b68d9d698d15
<ide><path>src/Illuminate/Auth/Events/PasswordReset.php <add><?php <add> <add>namespace Illuminate\Auth\Events; <add> <add>use Illuminate\Queue\SerializesModels; <add> <add>class PasswordReset <add>{ <add> use SerializesModels; <add> <add> /** <add> * The user. <add> * <add> * @var \Illuminate\Contracts\Auth\Authenticatable <add> */ <add> public $user; <add> <add> /** <add> * Create a new event instance. <add> * <add> * @param \Illuminate\Contracts\Auth\Authenticatable $user <add> * @return void <add> */ <add> public function __construct($user) <add> { <add> $this->user = $user; <add> } <add>} <ide><path>src/Illuminate/Foundation/Auth/ResetsPasswords.php <ide> use Illuminate\Http\Request; <ide> use Illuminate\Support\Facades\Auth; <ide> use Illuminate\Support\Facades\Password; <add>use Illuminate\Auth\Events\PasswordReset; <ide> <ide> trait ResetsPasswords <ide> { <ide> protected function resetPassword($user, $password) <ide> <ide> $user->save(); <ide> <add> event(new PasswordReset($user)); <add> <ide> $this->guard()->login($user); <ide> } <ide>
2
PHP
PHP
add test for callback condition and fix docs
f2aa2726bafb580db836a083fb0df558768d2a8e
<ide><path>src/Validation/Validator.php <ide> public function allowEmptyString($field, $when = true, $message = null) <ide> * Opposite to allowEmptyString() <ide> * <ide> * @param string $field The name of the field. <del> * @param string|null $message The message to show if the field is not <add> * @param string|null $message The message to show if the field is empty. <ide> * @param bool|string|callable $when Indicates when the field is not allowed <del> * to be empty. Valid values are false (always), 'create', 'update'. If a <del> * callable is passed then the field will allowed to be empty only when <del> * the callback returns false. <add> * to be empty. Valid values are false (never), 'create', 'update'. If a <add> * callable is passed then the field will be required to be not empty when <add> * the callback returns true. <ide> * @return $this <ide> * @see \Cake\Validation\Validator::allowEmptyString() <ide> * @since 3.8.0 <ide> public function allowEmptyArray($field, $when = true, $message = null) <ide> * Opposite to allowEmptyArray() <ide> * <ide> * @param string $field The name of the field. <del> * @param bool|string|callable $when Indicates when the field is allowed to be empty <del> * @param string|null $message The message to show if the field is not <del> * Valid values are false (always), 'create', 'update'. If a callable is passed then <del> * the field will allowed to be empty only when the callback returns false. <add> * @param string|null $message The message to show if the field is empty. <add> * @param bool|string|callable $when Indicates when the field is not allowed <add> * to be empty. Valid values are false (never), 'create', 'update'. If a <add> * callable is passed then the field will be required to be not empty when <add> * the callback returns true. <ide> * @return $this <ide> * @see \Cake\Validation\Validator::allowEmptyArray() <ide> * @since 3.8.0 <ide> public function allowEmptyFile($field, $when = true, $message = null) <ide> * Opposite to allowEmptyFile() <ide> * <ide> * @param string $field The name of the field. <del> * @param string|null $message The message to show if the field is not <del> * @param bool|string|callable $when Indicates when the field is allowed to be empty <del> * Valid values are false (always), 'create', 'update'. If a callable is passed then <del> * the field will required to be not empty when the callback returns false. <add> * @param string|null $message The message to show if the field is empty. <add> * @param bool|string|callable $when Indicates when the field is not allowed <add> * to be empty. Valid values are false (never), 'create', 'update'. If a <add> * callable is passed then the field will be required to be not empty when <add> * the callback returns true. <ide> * @return $this <del> * @since 3.7.0 <add> * @since 3.8.0 <ide> * @see \Cake\Validation\Validator::allowEmptyFile() <ide> */ <ide> public function notEmptyFile($field, $message = null, $when = false) <ide> public function allowEmptyDate($field, $when = true, $message = null) <ide> * Require a non-empty date value <ide> * <ide> * @param string $field The name of the field. <del> * @param string|null $message The message to show if the field is not <del> * @param bool|string|callable $when Indicates when the field is allowed to be empty <del> * Valid values are false, 'create', 'update'. If a callable is passed then <del> * the field will allowed to be empty only when the callback returns false. <add> * @param string|null $message The message to show if the field is empty. <add> * @param bool|string|callable $when Indicates when the field is not allowed <add> * to be empty. Valid values are false (never), 'create', 'update'. If a <add> * callable is passed then the field will be required to be not empty when <add> * the callback returns true. <ide> * @return $this <del> * @since 3.7.0 <add> * @since 3.8.0 <ide> * @see \Cake\Validation\Validator::allowEmptyDate() For detail usage <ide> */ <ide> public function notEmptyDate($field, $message = null, $when = false) <ide> public function allowEmptyTime($field, $when = true, $message = null) <ide> * Opposite to allowEmptyTime() <ide> * <ide> * @param string $field The name of the field. <del> * @param string|null $message The message to show if the field is not <del> * @param bool|string|callable $when Indicates when the field is allowed to be empty <del> * Valid values are false, 'create', 'update'. If a callable is passed then <del> * the field will allowed to be empty only when the callback returns true. <add> * @param string|null $message The message to show if the field is empty. <add> * @param bool|string|callable $when Indicates when the field is not allowed <add> * to be empty. Valid values are false (never), 'create', 'update'. If a <add> * callable is passed then the field will be required to be not empty when <add> * the callback returns true. <ide> * @return $this <ide> * @since 3.8.0 <ide> * @see \Cake\Validation\Validator::allowEmptyTime() <ide> public function allowEmptyDateTime($field, $when = true, $message = null) <ide> * Opposite to allowEmptyDateTime <ide> * <ide> * @param string $field The name of the field. <del> * @param string|null $message The message to show if the field is not <del> * @param bool|string|callable $when Indicates when the field is allowed to be empty <del> * Valid values are false, 'create', 'update'. If a callable is passed then <del> * the field will allowed to be empty only when the callback returns false. <add> * @param string|null $message The message to show if the field is empty. <add> * @param bool|string|callable $when Indicates when the field is not allowed <add> * to be empty. Valid values are false (never), 'create', 'update'. If a <add> * callable is passed then the field will be required to be not empty when <add> * the callback returns true. <ide> * @return $this <ide> * @since 3.8.0 <ide> * @see \Cake\Validation\Validator::allowEmptyDateTime() <ide><path>tests/TestCase/Validation/ValidatorTest.php <ide> public function testNotEmptyStringCreate() <ide> $this->assertEmpty($validator->errors($data, false), 'empty allowed on update'); <ide> } <ide> <add> /** <add> * Test notEmptyString with callback <add> * <add> * @return void <add> */ <add> public function testNotEmptyStringCallbackWhen() <add> { <add> $validator = new Validator(); <add> $validator->notEmptyString('title', 'message', function ($context) { <add> if (!isset($context['data']['emptyOk'])) { <add> return true; <add> } <add> return $context['data']['emptyOk']; <add> }); <add> <add> $error = [ <add> 'title' => ['_empty' => 'message'], <add> ]; <add> $data = ['title' => '']; <add> $this->assertSame($error, $validator->errors($data)); <add> <add> $data = ['title' => '', 'emptyOk' => false]; <add> $this->assertEmpty($validator->errors($data)); <add> <add> $data = ['title' => '', 'emptyOk' => true]; <add> $this->assertSame($error, $validator->errors($data)); <add> } <add> <ide> /** <ide> * Tests the allowEmptyArray method <ide> *
2
Javascript
Javascript
update a typo in module.js' comments
520cf1d6de3373a0949203aac7539cbc96761814
<ide><path>lib/module.js <ide> function toRealPath(requestPath) { <ide> }); <ide> } <ide> <del>// given a path check a the file exists with any of the set extensions <add>// given a path, check if the file exists with any of the set extensions <ide> function tryExtensions(p, exts, isMain) { <ide> for (var i = 0; i < exts.length; i++) { <ide> const filename = tryFile(p + exts[i], isMain);
1
Go
Go
add error when running overlay over btrfs
32f1025b22d16872ead5ec2e3650bf76622fae99
<ide><path>daemon/graphdriver/overlay/overlay.go <ide> func Init(home string, options []string) (graphdriver.Driver, error) { <ide> return nil, graphdriver.ErrNotSupported <ide> } <ide> <add> // check if they are running over btrfs <add> var buf syscall.Statfs_t <add> if err := syscall.Statfs(path.Dir(home), &buf); err != nil { <add> return nil, err <add> } <add> <add> switch graphdriver.FsMagic(buf.Type) { <add> case graphdriver.FsMagicBtrfs: <add> log.Error("'overlay' is not supported over btrfs.") <add> return nil, graphdriver.ErrIncompatibleFS <add> case graphdriver.FsMagicAufs: <add> log.Error("'overlay' is not supported over aufs.") <add> return nil, graphdriver.ErrIncompatibleFS <add> } <add> <ide> // Create the driver home dir <ide> if err := os.MkdirAll(home, 0755); err != nil && !os.IsExist(err) { <ide> return nil, err
1
Ruby
Ruby
register spec subclasses for people who spec
1c09c29a0958eac86fffede00f30a1bee36d09a9
<ide><path>actionpack/lib/action_controller/test_case.rb <ide> def exists? <ide> # <ide> # assert_redirected_to page_url(:title => 'foo') <ide> class TestCase < ActiveSupport::TestCase <add> <add> # Use AS::TestCase for the base class when describing a model <add> register_spec_type(self) do |desc| <add> desc < ActionController::Base <add> end <add> <ide> module Behavior <ide> extend ActiveSupport::Concern <ide> include ActionDispatch::TestProcess <ide><path>activesupport/lib/active_support/test_case.rb <ide> require 'active_support/core_ext/kernel/reporting' <ide> <ide> module ActiveSupport <del> class TestCase < ::MiniTest::Unit::TestCase <add> class TestCase < ::MiniTest::Spec <add> <add> # Use AS::TestCase for the base class when describing a model <add> register_spec_type(self) do |desc| <add> desc < ActiveRecord::Model <add> end <add> <ide> Assertion = MiniTest::Assertion <ide> alias_method :method_name, :name if method_defined? :name <ide> alias_method :method_name, :__name__ if method_defined? :__name__
2
Javascript
Javascript
update open source env
3ff39870ce776c653823e1733363be0401896294
<ide><path>jestSupport/env.js <ide> <ide> require('../packager/react-packager/src/Resolver/polyfills/babelHelpers.js'); <ide> global.__DEV__ = true; <add>global.__fbBatchedBridgeConfig = { <add> remoteModuleConfig: [], <add> localModulesConfig: [], <add>}; <add> <add>global.Promise = require('promise');
1
Text
Text
clarify the meaning of legacy status
625c1e841adee3e687225597e60c70df6510a696
<ide><path>doc/api/documentation.md <ide> The stability indices are as follows: <ide> <ide> <!-- separator --> <ide> <del>> Stability: 3 - Legacy. The feature is no longer recommended for use. While it <del>> likely will not be removed, and is still covered by semantic-versioning <del>> guarantees, use of the feature should be avoided. <add>> Stability 3 - Legacy. Although this feature is unlikely to be removed and is <add>> still covered by semantic-versioning guarantees, it is no longer actively <add>> maintained, and other alternatives are available. <add> <add>Features are marked as legacy rather than being deprecated if their use does no <add>harm, and they are widely relied upon within the npm ecosystem. Bugs found in <add>legacy features are unlikely to be fixed. <ide> <ide> Use caution when making use of Experimental features, particularly within <ide> modules. Users may not be aware that experimental features are being used. <ide><path>doc/api/url.md <ide> A `TypeError` is thrown if `urlString` is not a string. <ide> <ide> A `URIError` is thrown if the `auth` property is present but cannot be decoded. <ide> <del>Use of the legacy `url.parse()` method is discouraged. Users should <del>use the WHATWG `URL` API. Because the `url.parse()` method uses a <del>lenient, non-standard algorithm for parsing URL strings, security <del>issues can be introduced. Specifically, issues with [host name spoofing][] and <del>incorrect handling of usernames and passwords have been identified. <add>`url.parse()` uses a lenient, non-standard algorithm for parsing URL <add>strings. It is prone to security issues such as [host name spoofing][] <add>and incorrect handling of usernames and passwords. <add> <add>`url.parse()` is an exception to most of the legacy APIs. Despite its security <add>concerns, it is legacy and not deprecated because it is: <add> <add>* Faster than the alternative WHATWG `URL` parser. <add>* Easier to use with regards to relative URLs than the alternative WHATWG `URL` API. <add>* Widely relied upon within the npm ecosystem. <add> <add>Use with caution. <ide> <ide> ### `url.resolve(from, to)` <ide>
2
Javascript
Javascript
remove legacy addon `viewname` support
a85d6a19fc82ea86f137483a773aa0f1a0e15366
<ide><path>packages/ember-htmlbars/lib/node-managers/component-node-manager.js <ide> function configureCreateOptions(attrs, createOptions) { <ide> // they are still streams. <ide> if (attrs.id) { createOptions.elementId = getValue(attrs.id); } <ide> if (attrs._defaultTagName) { createOptions._defaultTagName = getValue(attrs._defaultTagName); } <del> if (attrs.viewName) { createOptions.viewName = getValue(attrs.viewName); } <ide> } <ide> <ide> ComponentNodeManager.prototype.render = function ComponentNodeManager_render(_env, visitor) { <ide><path>packages/ember-htmlbars/lib/node-managers/view-node-manager.js <ide> ViewNodeManager.create = function ViewNodeManager_create(renderNode, env, attrs, <ide> if (attrs && attrs.id) { options.elementId = getValue(attrs.id); } <ide> if (attrs && attrs.tagName) { options.tagName = getValue(attrs.tagName); } <ide> if (attrs && attrs._defaultTagName) { options._defaultTagName = getValue(attrs._defaultTagName); } <del> if (attrs && attrs.viewName) { options.viewName = getValue(attrs.viewName); } <ide> <ide> if (found.component.create && contentScope) { <ide> let _self = contentScope.getSelf(); <ide> export function createOrUpdateComponent(component, options, createOptions, rende <ide> <ide> if (options.parentView) { <ide> options.parentView.appendChild(component); <del> <del> if (options.viewName) { <del> set(options.parentView, options.viewName, component); <del> } <ide> } <ide> <ide> component._renderNode = renderNode; <ide><path>packages/ember-views/lib/mixins/view_support.js <ide> export default Mixin.create({ <ide> @private <ide> */ <ide> destroy() { <del> // get parentView before calling super because it'll be destroyed <del> let parentView = this.parentView; <del> let viewName = this.viewName; <del> <ide> if (!this._super(...arguments)) { return; } <ide> <del> // remove from non-virtual parent view if viewName was specified <del> if (viewName && parentView) { <del> parentView.set(viewName, null); <del> } <del> <ide> // Destroy HTMLbars template <ide> if (this.lastResult) { <ide> this.lastResult.destroy();
3
Javascript
Javascript
use loaderoptionsplugin to set updateindex
ccf9da2171a4a35f85998f15df8f7f84e183a64a
<ide><path>test/HotTestCases.test.js <ide> describe("HotTestCases", function() { <ide> var recordsPath = path.join(outputDirectory, "records.json"); <ide> if(fs.existsSync(recordsPath)) <ide> fs.unlinkSync(recordsPath); <add> var fakeUpdateLoaderOptions = { <add> options: { <add> updateIndex: 0 <add> } <add> }; <ide> var options = { <ide> context: testDirectory, <ide> entry: "./index.js", <ide> describe("HotTestCases", function() { <ide> target: "async-node", <ide> plugins: [ <ide> new webpack.HotModuleReplacementPlugin(), <del> new webpack.NamedModulesPlugin() <add> new webpack.NamedModulesPlugin(), <add> new webpack.LoaderOptionsPlugin(fakeUpdateLoaderOptions) <ide> ], <del> recordsPath: recordsPath, <del> updateIndex: 0 <add> recordsPath: recordsPath <ide> } <ide> var compiler = webpack(options); <ide> compiler.run(function(err, stats) { <ide> describe("HotTestCases", function() { <ide> } <ide> <ide> function _next(callback) { <del> options.updateIndex++; <add> fakeUpdateLoaderOptions.options.updateIndex++; <ide> compiler.run(function(err, stats) { <ide> if(err) return done(err); <ide> var jsonStats = stats.toJson({ <ide> errorDetails: true <ide> }); <del> if(checkArrayExpectation(testDirectory, jsonStats, "error", "errors" + options.updateIndex, "Error", done)) return; <del> if(checkArrayExpectation(testDirectory, jsonStats, "warning", "warnings" + options.updateIndex, "Warning", done)) return; <add> if(checkArrayExpectation(testDirectory, jsonStats, "error", "errors" + fakeUpdateLoaderOptions.options.updateIndex, "Error", done)) return; <add> if(checkArrayExpectation(testDirectory, jsonStats, "warning", "warnings" + fakeUpdateLoaderOptions.options.updateIndex, "Warning", done)) return; <ide> if(callback) callback(); <ide> }) <ide> }
1
Javascript
Javascript
replace language select
1e60623c8bb372b8a9f192c5619a15f4748f4e0a
<ide><path>client/src/components/Header/Header.test.js <ide> const hasRadioNavItem = component => { <ide> }; <ide> <ide> const hasSignOutNavItem = component => { <del> const { children } = navigationLinks(component, 10); <add> const { children } = navigationLinks(component, 12); <ide> const signOutProps = children[1].props; <ide> <ide> return ( <ide><path>client/src/components/Header/components/NavLinks.js <ide> import PropTypes from 'prop-types'; <ide> import { withTranslation } from 'react-i18next'; <ide> import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; <ide> import { <del> // faCheck, <add> faCheck, <ide> faCheckSquare, <ide> faHeart, <ide> faSquare, <ide> import { <ide> radioLocation, <ide> apiLocation <ide> } from '../../../../../config/env.json'; <del>// import createLanguageRedirect from '../../createLanguageRedirect'; <add>import createLanguageRedirect from '../../createLanguageRedirect'; <ide> import createExternalRedirect from '../../createExternalRedirects'; <ide> <del>/* const { <add>const { <ide> availableLangs, <ide> i18nextCodes, <ide> langDisplayNames <del>} = require('../../../../i18n/allLangs'); */ <add>} = require('../../../../i18n/allLangs'); <ide> <del>// const locales = availableLangs.client; <del> <del>// The linter was complaining about inline comments. Add the code below above <del>// the sign out button when the language menu is ready to be added <del>/* <del> <div className='nav-link nav-link-header' key='lang-header'> <del> {t('footer.language')} <del> </div> <del> {locales.map(lang => <del> // current lang is a button that closes the menu <del> i18n.language === i18nextCodes[lang] ? ( <del> <button <del> className='nav-link nav-link-lang nav-link-flex' <del> onClick={() => toggleDisplayMenu()} <del> > <del> <span>{langDisplayNames[lang]}</span> <del> <FontAwesomeIcon icon={faCheck} /> <del> </button> <del> ) : ( <del> <Link <del> className='nav-link nav-link-lang nav-link-flex' <del> external={true} <del> // Todo: should treat other lang client application links as external?? <del> key={'lang-' + lang} <del> to={createLanguageRedirect({ <del> clientLocale, <del> lang <del> })} <del> > <del> {langDisplayNames[lang]} <del> </Link> <del> ) <del> ) <del>*/ <add>const locales = availableLangs.client; <ide> <ide> const propTypes = { <ide> displayMenu: PropTypes.bool, <ide> export class NavLinks extends Component { <ide> render() { <ide> const { <ide> displayMenu, <del> // i18n, <add> i18n, <ide> fetchState, <ide> t, <del> // toggleDisplayMenu, <add> toggleDisplayMenu, <ide> toggleNightMode, <ide> user: { isDonating = false, username, theme } <ide> } = this.props; <ide> export class NavLinks extends Component { <ide> <span className='nav-link-dull'>{t('misc.change-theme')}</span> <ide> )} <ide> </button> <add> <div className='nav-link nav-link-header' key='lang-header'> <add> {t('footer.language')} <add> </div> <add> {locales.map(lang => <add> // current lang is a button that closes the menu <add> i18n.language === i18nextCodes[lang] ? ( <add> <button <add> className='nav-link nav-link-lang nav-link-flex' <add> key={'lang-' + lang} <add> onClick={() => toggleDisplayMenu()} <add> > <add> <span>{langDisplayNames[lang]}</span> <add> <FontAwesomeIcon icon={faCheck} /> <add> </button> <add> ) : ( <add> <Link <add> className='nav-link nav-link-lang nav-link-flex' <add> external={true} <add> // Todo: should treat other lang client application links as external?? <add> key={'lang-' + lang} <add> to={createLanguageRedirect({ <add> clientLocale, <add> lang <add> })} <add> > <add> {langDisplayNames[lang]} <add> </Link> <add> ) <add> )} <ide> {username && ( <ide> <> <ide> <hr className='nav-line-2' />
2
Ruby
Ruby
use faster form of running callbacks
a87b62729715fb286ea613e6e3ec59135a82529d
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb <ide> def checkout <ide> # calling +checkout+ on this pool. <ide> def checkin(conn) <ide> @connection_mutex.synchronize do <del> conn.run_callbacks :checkin do <add> conn._run_checkin_callbacks do <ide> @checked_out.delete conn <ide> @queue.signal <ide> end
1
PHP
PHP
use putenv to define defaults
7005190c1669e2760f0f47574996287c596d894e
<ide><path>tests/init.php <ide> ] <ide> ]); <ide> <add>// Ensure default test connection is defined <add>if (!getenv('db_class')) { <add> putenv('db_class=Cake\Database\Driver\Sqlite'); <add> putenv('db_dsn=sqlite::memory:'); <add>} <add> <ide> ConnectionManager::config('test', [ <ide> 'className' => 'Cake\Database\Connection', <ide> 'driver' => getenv('db_class'),
1
Ruby
Ruby
fix multiple hash preloads. fixes
b713e207d470fe01ce8ea945163c6c2540292301
<ide><path>activerecord/lib/active_record/associations/preloader.rb <ide> def preloaders_on(association, records, scope) <ide> end <ide> <ide> def preloaders_for_hash(association, records, scope) <del> parent, child = association.to_a.first # hash should only be of length 1 <add> association.flat_map { |parent, child| <add> loaders = preloaders_for_one parent, records, scope <ide> <del> loaders = preloaders_for_one parent, records, scope <del> <del> recs = loaders.flat_map(&:preloaded_records).uniq <del> loaders.concat Array.wrap(child).flat_map { |assoc| <del> preloaders_on assoc, recs, scope <add> recs = loaders.flat_map(&:preloaded_records).uniq <add> loaders.concat Array.wrap(child).flat_map { |assoc| <add> preloaders_on assoc, recs, scope <add> } <add> loaders <ide> } <ide> end <ide> <ide><path>activerecord/test/cases/relations_test.rb <ide> def test_find_with_preloaded_associations <ide> end <ide> end <ide> <add> def test_deep_preload <add> post = Post.preload(author: :posts, comments: :post).first <add> <add> assert_predicate post.author.association(:posts), :loaded? <add> assert_predicate post.comments.first.association(:post), :loaded? <add> end <add> <ide> def test_preload_applies_to_all_chained_preloaded_scopes <ide> assert_queries(3) do <ide> post = Post.with_comments.with_tags.first
2
Text
Text
add contributors snapshot
c069932f5da84f99cac527f7b222101359e99943
<ide><path>README.md <ide> <ide> 🤗 Transformers (formerly known as `pytorch-transformers` and `pytorch-pretrained-bert`) provides state-of-the-art general-purpose architectures (BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet, CTRL...) for Natural Language Understanding (NLU) and Natural Language Generation (NLG) with over 32+ pretrained models in 100+ languages and deep interoperability between TensorFlow 2.0 and PyTorch. <ide> <add>[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/0)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/0)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/1)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/1)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/2)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/2)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/3)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/3)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/4)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/4)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/5)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/5)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/6)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/6)[![](https://sourcerer.io/fame/clmnt/huggingface/transformers/images/7)](https://sourcerer.io/fame/clmnt/huggingface/transformers/links/7) <add> <ide> ### Features <ide> <ide> - As easy to use as pytorch-transformers
1
Text
Text
specify correct version in the changelog [ci skip]
b74c3565cb08d6b011915c7c04c2f01fa1b78bf0
<ide><path>activerecord/CHANGELOG.md <ide> * `time` columns can now affected by `time_zone_aware_attributes`. If you have <ide> set `config.time_zone` to a value other than `'UTC'`, they will be treated <del> as in that time zone by default in Rails 5.0. If this is not the desired <add> as in that time zone by default in Rails 5.1. If this is not the desired <ide> behavior, you can set <ide> <ide> ActiveRecord::Base.time_zone_aware_types = [:datetime]
1
Javascript
Javascript
increase ram requirement for intensive tests
135a863f80791f7ecf7e05e5719018bb86f35cd9
<ide><path>test/common.js <ide> exports.isLinuxPPCBE = (process.platform === 'linux') && <ide> exports.isSunOS = process.platform === 'sunos'; <ide> exports.isFreeBSD = process.platform === 'freebsd'; <ide> <del>exports.enoughTestMem = os.totalmem() > 0x20000000; /* 512MB */ <add>exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ <ide> exports.rootDir = exports.isWindows ? 'c:\\' : '/'; <ide> <ide> function rimrafSync(p) { <ide><path>test/parallel/test-fs-readfile-tostring-fail.js <ide> 'use strict'; <ide> <ide> const common = require('../common'); <add> <add>if (!common.enoughTestMem) { <add> const skipMessage = 'intensive toString tests due to memory confinements'; <add> common.skip(skipMessage); <add> return; <add>} <add> <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide> const path = require('path');
2
PHP
PHP
clear the resolved request facade on dispatch
fcad1d7b24af9878cfa3cf80e10adf0925a77ce4
<ide><path>src/Illuminate/Foundation/Application.php <ide> use Illuminate\Routing\Router; <ide> use Illuminate\Container\Container; <ide> use Illuminate\Filesystem\Filesystem; <add>use Illuminate\Support\Facades\Facade; <ide> use Illuminate\Support\ServiceProvider; <ide> use Illuminate\Events\EventServiceProvider; <ide> use Illuminate\Routing\RoutingServiceProvider; <ide> public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MAS <ide> { <ide> $this['request'] = $request; <ide> <add> Facade::clearResolvedInstance('request'); <add> <ide> return $this->dispatch($request); <ide> } <ide> <ide><path>src/Illuminate/Support/Facades/Facade.php <ide> protected static function resolveFacadeInstance($name) <ide> return static::$resolvedInstance[$name] = static::$app[$name]; <ide> } <ide> <add> /** <add> * Clear a resolved facade instance. <add> * <add> * @param string $name <add> * @return void <add> */ <add> public static function clearResolvedInstance($name) <add> { <add> unset(static::$resolvedInstance[$name]); <add> } <add> <ide> /** <ide> * Clear all of the resolved instances. <ide> *
2
Ruby
Ruby
fix bad docs from f373f296 [ci skip]
a29554461e43f8c1b428422f49103aa80275bf46
<ide><path>actionpack/lib/action_view/lookup_context.rb <ide> def initialize(view_paths, details = {}, prefixes = []) <ide> initialize_details(details) <ide> end <ide> <del> # Freeze the current formats in the lookup context. By freezing them, you <del> # that next template lookups are not going to modify the formats. The con <del> # use this, to ensure that formats won't be further modified (as it does <add> # Freeze the current formats in the lookup context. By freezing them, you are guaranteeing <add> # that next template lookups are not going to modify the formats. The controller can also <add> # use this, to ensure that formats won't be further modified (as it does in respond_to blocks). <ide> def freeze_formats(formats, unless_frozen=false) #:nodoc: <ide> return if unless_frozen && @frozen_formats <ide> self.formats = formats
1
Ruby
Ruby
improve assert_response helper
bc3b0e729282b6474f217806c14f293584dd8c97
<ide><path>actionpack/lib/action_dispatch/testing/assertions/response.rb <ide> def normalize_argument_to_redirection(fragment) <ide> def generate_response_message(expected, actual = @response.response_code) <ide> "Expected response to be a <#{code_with_name(expected)}>,"\ <ide> " but was a <#{code_with_name(actual)}>" <del> .concat location_if_redirected <add> .concat(location_if_redirected).concat(response_body_if_short) <add> end <add> <add> def response_body_if_short <add> return "" if @response.body.size > 500 <add> "\nResponse body: #{@response.body}" <ide> end <ide> <ide> def location_if_redirected <ide><path>actionpack/test/assertions/response_assertions_test.rb <ide> module Assertions <ide> class ResponseAssertionsTest < ActiveSupport::TestCase <ide> include ResponseAssertions <ide> <del> FakeResponse = Struct.new(:response_code, :location) do <add> FakeResponse = Struct.new(:response_code, :location, :body) do <ide> def initialize(*) <ide> super <ide> self.location ||= "http://test.example.com/posts" <add> self.body ||= "" <ide> end <ide> <ide> [:successful, :not_found, :redirection, :server_error].each do |sym| <ide> def test_error_message_shows_302_redirect_when_302_asserted_for_301 <ide> " redirect to <http://test.host/posts/redirect/2>" <ide> assert_match expected, error.message <ide> end <add> <add> def test_error_message_shows_short_response_body <add> @response = ActionDispatch::Response.new <add> @response.status = 400 <add> @response.body = "not too long" <add> error = assert_raises(Minitest::Assertion) { assert_response 200 } <add> expected = "Expected response to be a <200: OK>,"\ <add> " but was a <400: Bad Request>" \ <add> "\nResponse body: not too long" <add> assert_match expected, error.message <add> end <add> <add> def test_error_message_does_not_show_long_response_body <add> @response = ActionDispatch::Response.new <add> @response.status = 400 <add> @response.body = "not too long" * 50 <add> error = assert_raises(Minitest::Assertion) { assert_response 200 } <add> expected = "Expected response to be a <200: OK>,"\ <add> " but was a <400: Bad Request>" <add> assert_match expected, error.message <add> end <ide> end <ide> end <ide> end
2
Javascript
Javascript
add link to `module.config()` docs
e3814b12662dac500f96f4ce1bb5f35c24195497
<ide><path>src/loader.js <ide> function setupModuleLoader(window) { <ide> * configuration. <ide> * @description <ide> * Use this method to register work which needs to be performed on module loading. <add> * For more about how to configure services, see <add> * {@link providers#providers_provider-recipe Provider Recipe}. <ide> */ <ide> config: config, <ide>
1
Ruby
Ruby
fix dependents with unavailable formulae
3a27d8121970dab95f2d28db81189ddf9619c0f5
<ide><path>Library/Homebrew/keg.rb <ide> def to_formula <ide> end <ide> <ide> def installed_dependents <del> my_tab = Tab.for_keg(self) <add> tap = Tab.for_keg(self).source["tap"] <ide> Keg.all.select do |keg| <ide> tab = Tab.for_keg(keg) <ide> next if tab.runtime_dependencies.nil? # no dependency information saved. <ide> def installed_dependents <ide> dep_formula = Formulary.factory(dep["full_name"]) <ide> next false unless dep_formula == to_formula <ide> rescue FormulaUnavailableError <del> next false unless my_tab["full_name"] = dep["full_name"] <add> next false unless "#{tap}/#{name}" == dep["full_name"] <ide> end <ide> <ide> dep["version"] == version.to_s <ide><path>Library/Homebrew/test/keg_test.rb <ide> def dependencies(deps) <ide> # from a file path or URL. <ide> def test_unknown_formula <ide> Formulary.unstub(:loader_for) <del> alter_tab { |t| t.source["tap"] = "some/tap" } <del> dependencies [{ "full_name" => "some/tap/bar", "version" => "1.0" }] <del> alter_tab { |t| t.source["path"] = nil } <add> alter_tab(@keg) do |t| <add> t.source["tap"] = "some/tap" <add> t.source["path"] = nil <add> end <add> dependencies [{ "full_name" => "some/tap/foo", "version" => "1.0" }] <ide> assert_equal [@dependent], @keg.installed_dependents <ide> assert_equal [[@keg], ["bar 1.0"]], Keg.find_some_installed_dependents([@keg]) <ide> end
2
Ruby
Ruby
make boost-jam a build-time dependency
62cfa490828bc65cc13666c686b4eb209633af3a
<ide><path>Library/Homebrew/cmd/audit.rb <ide> def audit_formula_text name, text <ide> end <ide> <ide> # cmake, pkg-config, and scons are build-time deps <del> if text =~ /depends_on ['"](cmake|pkg-config|scons|smake)['"]$/ <add> if text =~ /depends_on ['"](boost-jam|cmake|pkg-config|scons|smake)['"]$/ <ide> problems << " * #{$1} dependency should be \"depends_on '#{$1}' => :build\"" <ide> end <ide>
1
Ruby
Ruby
allow describe queries on read-only connections
9b1a92b33d0fa6dd917836cc5e86e426fcd03d45
<ide><path>activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb <ide> def query(sql, name = nil) # :nodoc: <ide> execute(sql, name).to_a <ide> end <ide> <del> READ_QUERY = ActiveRecord::ConnectionAdapters::AbstractAdapter.build_read_query_regexp(:begin, :commit, :explain, :select, :set, :show, :release, :savepoint, :rollback) # :nodoc: <add> READ_QUERY = ActiveRecord::ConnectionAdapters::AbstractAdapter.build_read_query_regexp( <add> :begin, :commit, :explain, :select, :set, :show, :release, :savepoint, :rollback, :describe, :desc <add> ) # :nodoc: <ide> private_constant :READ_QUERY <ide> <ide> def write_query?(sql) # :nodoc: <ide><path>activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb <ide> def test_doesnt_error_when_a_set_query_is_called_while_preventing_writes <ide> end <ide> end <ide> <add> def test_doesnt_error_when_a_describe_query_is_called_while_preventing_writes <add> @connection_handler.while_preventing_writes do <add> @conn.execute("DESCRIBE engines") <add> @conn.execute("DESC engines") # DESC is an alias for DESCRIBE <add> end <add> end <add> <ide> def test_doesnt_error_when_a_read_query_with_leading_chars_is_called_while_preventing_writes <ide> @conn.execute("INSERT INTO `engines` (`car_id`) VALUES ('138853948594')") <ide>
2
Text
Text
update napi_make_callback documentation
03c4ee91d003da2a6ff4c19b91c7c7dafa705a55
<ide><path>doc/api/n-api.md <ide> NAPI_EXTERN napi_status napi_make_callback(napi_env env, <ide> * `[in] env`: The environment that the API is invoked under. <ide> * `[in] async_context`: Context for the async operation that is <ide> invoking the callback. This should normally be a value previously <del> obtained from [`napi_async_init`][]. However `NULL` is also allowed, <del> which indicates the current async context (if any) is to be used <del> for the callback. <add> obtained from [`napi_async_init`][]. <add> In order to retain ABI compatibility with previous versions, passing `NULL` <add> for `async_context` will not result in an error. However, this will result <add> in incorrect operation of async hooks. Potential issues include loss of <add> async context when using the `AsyncLocalStorage` API. <ide> * `[in] recv`: The `this` object passed to the called function. <ide> * `[in] func`: `napi_value` representing the JavaScript function to be invoked. <ide> * `[in] argc`: The count of elements in the `argv` array.
1
Python
Python
add a note / warning
9b84bd0316b6b7846de8ff2c480700af0e122cf0
<ide><path>libcloud/compute/ssh.py <ide> def run(self, cmd): <ide> stdin.close() <ide> <ide> # Receive all the output <del> # Note: This is used instead of chan.makefile approach to prevent <add> # Note #1: This is used instead of chan.makefile approach to prevent <ide> # buffering issues and hanging if the executed command produces a lot <ide> # of output. <add> # <add> # Note #2: If you are going to remove "ready" checks inside the loop <add> # you are going to have a bad time. Trying to consume from a channel <add> # which is not ready will block for indefinitely. <ide> exit_status_ready = chan.exit_status_ready() <ide> <ide> while not exit_status_ready:
1
Javascript
Javascript
fix tojson casting of invalid moment
a289cf13aa567d06ed1d0a767cb0144588afd7b9
<ide><path>src/lib/moment/to-type.js <ide> export function toObject () { <ide> } <ide> <ide> export function toJSON () { <del> // JSON.stringify(new Date(NaN)) === 'null' <del> return this.isValid() ? this.toISOString() : 'null'; <add> // JSON.stringify(new Date(NaN)) === null <add> return this.isValid() ? this.toISOString() : null; <ide> } <ide><path>src/test/moment/invalid.js <ide> test('invalid operations', function (assert) { <ide> }); <ide> assert.ok(moment.isDate(invalid.toDate())); <ide> assert.ok(isNaN(invalid.toDate().valueOf())); <del> assert.equal(invalid.toJSON(), 'null'); <add> assert.equal(invalid.toJSON(), null); <ide> assert.equal(invalid.toString(), 'Invalid date'); <ide> assert.ok(isNaN(invalid.unix())); <ide> assert.ok(isNaN(invalid.valueOf()));
2
Mixed
Javascript
reset webpack file for none preset
f987a6db9bd7905e87eb399fc9b408818b153439
<ide><path>src/Illuminate/Foundation/Console/Presets/None.php <ide> public static function install() <ide> { <ide> static::updatePackages(); <ide> static::updateBootstrapping(); <add> static::updateWebpackConfiguration(); <ide> <ide> tap(new Filesystem, function ($filesystem) { <ide> $filesystem->deleteDirectory(resource_path('js/components')); <ide> protected static function updateBootstrapping() <ide> copy(__DIR__.'/none-stubs/app.js', resource_path('js/app.js')); <ide> copy(__DIR__.'/none-stubs/bootstrap.js', resource_path('js/bootstrap.js')); <ide> } <add> <add> /** <add> * Update the Webpack configuration. <add> * <add> * @return void <add> */ <add> protected static function updateWebpackConfiguration() <add> { <add> copy(__DIR__.'/none-stubs/webpack.mix.js', base_path('webpack.mix.js')); <add> } <ide> } <ide><path>src/Illuminate/Foundation/Console/Presets/none-stubs/webpack.mix.js <add>const mix = require('laravel-mix'); <add> <add>/* <add> |-------------------------------------------------------------------------- <add> | Mix Asset Management <add> |-------------------------------------------------------------------------- <add> | <add> | Mix provides a clean, fluent API for defining some Webpack build steps <add> | for your Laravel application. By default, we are compiling the Sass <add> | file for the application as well as bundling up all the JS files. <add> | <add> */ <add> <add>mix.js('resources/js/app.js', 'public/js') <add> .sass('resources/sass/app.scss', 'public/css');
2
Ruby
Ruby
apply suggestions from code review
2188b268de15935b848a6a5ac8ee4efa1cea4d60
<ide><path>Library/Homebrew/cmd/commands.rb <ide> def commands <ide> <ide> prepend_separator = false <ide> <del> { "Built-in commands" => Commands.internal_commands, <add> { <add> "Built-in commands" => Commands.internal_commands, <ide> "Built-in developer commands" => Commands.internal_developer_commands, <ide> "External commands" => Commands.external_commands, <ide> "Cask commands" => Commands.cask_internal_commands, <del> "External cask commands" => Commands.cask_external_commands } <del> .each do |title, commands| <del> next if commands.blank? <add> "External cask commands" => Commands.cask_external_commands, <add> }.each do |title, commands| <add> next if commands.blank? <ide> <ide> puts if prepend_separator <ide> ohai title, Formatter.columns(commands) <ide> <del> prepend_separator = true <add> prepend_separator ||= true <ide> end <ide> end <ide> end
1
PHP
PHP
remove deprecated code from auth namespace
c4fc7bd632d178303c3ca872a6ce1118c3eca58a
<ide><path>src/Auth/BaseAuthenticate.php <ide> abstract class BaseAuthenticate implements EventListenerInterface <ide> * - `passwordHasher` Password hasher class. Can be a string specifying class name <ide> * or an array containing `className` key, any other keys will be passed as <ide> * config to the class. Defaults to 'Default'. <del> * - Options `scope` and `contain` have been deprecated since 3.1. Use custom <del> * finder instead to modify the query to fetch user record. <ide> * <ide> * @var array <ide> */ <ide> abstract class BaseAuthenticate implements EventListenerInterface <ide> 'password' => 'password' <ide> ], <ide> 'userModel' => 'Users', <del> 'scope' => [], <ide> 'finder' => 'all', <del> 'contain' => null, <ide> 'passwordHasher' => 'Default' <ide> ]; <ide> <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> { <ide> $this->_registry = $registry; <ide> $this->setConfig($config); <del> <del> if ($this->getConfig('scope') || $this->getConfig('contain')) { <del> deprecationWarning( <del> 'The `scope` and `contain` options for Authentication are deprecated. ' . <del> 'Use the `finder` option instead to define additional conditions.' <del> ); <del> } <ide> } <ide> <ide> /** <ide> protected function _query($username) <ide> 'conditions' => [$table->aliasField($config['fields']['username']) => $username] <ide> ]; <ide> <del> if (!empty($config['scope'])) { <del> $options['conditions'] = array_merge($options['conditions'], $config['scope']); <del> } <del> if (!empty($config['contain'])) { <del> $options['contain'] = $config['contain']; <del> } <del> <ide> $finder = $config['finder']; <ide> if (is_array($finder)) { <ide> $options += current($finder);
1
Python
Python
remove double licenses
027813d334645d6076a72b41b7b87ec30334cbb1
<ide><path>official/modeling/multitask/base_model.py <ide> # See the License for the specific language governing permissions and <ide> # limitations under the License. <ide> <del># Lint as: python3 <del># Copyright 2020 The TensorFlow Authors. All Rights Reserved. <del># <del># Licensed under the Apache License, Version 2.0 (the "License"); <del># you may not use this file except in compliance with the License. <del># You may obtain a copy of the License at <del># <del># http://www.apache.org/licenses/LICENSE-2.0 <del># <del># Unless required by applicable law or agreed to in writing, software <del># distributed under the License is distributed on an "AS IS" BASIS, <del># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <del># See the License for the specific language governing permissions and <del># limitations under the License. <del># ============================================================================== <ide> """Abstraction of multi-task model.""" <ide> from typing import Text, Dict <ide> <ide><path>official/modeling/multitask/base_trainer.py <ide> # See the License for the specific language governing permissions and <ide> # limitations under the License. <ide> <del># Lint as: python3 <del># Copyright 2020 The TensorFlow Authors. All Rights Reserved. <del># <del># Licensed under the Apache License, Version 2.0 (the "License"); <del># you may not use this file except in compliance with the License. <del># You may obtain a copy of the License at <del># <del># http://www.apache.org/licenses/LICENSE-2.0 <del># <del># Unless required by applicable law or agreed to in writing, software <del># distributed under the License is distributed on an "AS IS" BASIS, <del># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <del># See the License for the specific language governing permissions and <del># limitations under the License. <del># ============================================================================== <ide> """Multitask base trainer implementation. <ide> <ide> The trainer derives from the Orbit `StandardTrainer` class.
2
Python
Python
put a note in the error traceback code
18ff39368281ffd64e5869722c30c5e54596d94b
<ide><path>keras/utils/traceback_utils.py <ide> def error_handler(*args, **kwargs): <ide> return fn(*args, **kwargs) <ide> except Exception as e: # pylint: disable=broad-except <ide> filtered_tb = _process_traceback_frames(e.__traceback__) <add> # To get the full stack trace, call: <add> # `tf.debugging.disable_traceback_filtering()` <ide> raise e.with_traceback(filtered_tb) from None <ide> finally: <ide> del filtered_tb
1
Text
Text
use code markup/markdown in headers
2d6949d8c00dd1b2bea009ad0132709c3215f70f
<ide><path>doc/api/http2.md <ide> req.on('end', () => { <ide> req.end(); <ide> ``` <ide> <del>### Class: Http2Session <add>### Class: `Http2Session` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> User code will not create `Http2Session` instances directly. Server-side <ide> new HTTP/2 connection is received. Client-side `Http2Session` instances are <ide> created using the `http2.connect()` method. <ide> <del>#### Http2Session and Sockets <add>#### `Http2Session` and Sockets <ide> <ide> Every `Http2Session` instance is associated with exactly one [`net.Socket`][] or <ide> [`tls.TLSSocket`][] when it is created. When either the `Socket` or the <ide> the socket to become unusable. <ide> Once a `Socket` has been bound to an `Http2Session`, user code should rely <ide> solely on the API of the `Http2Session`. <ide> <del>#### Event: 'close' <add>#### Event: `'close'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> The `'close'` event is emitted once the `Http2Session` has been destroyed. Its <ide> listener does not expect any arguments. <ide> <del>#### Event: 'connect' <add>#### Event: `'connect'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> connected to the remote peer and communication may begin. <ide> <ide> User code will typically not listen for this event directly. <ide> <del>#### Event: 'error' <add>#### Event: `'error'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> The `'error'` event is emitted when an error occurs during the processing of <ide> an `Http2Session`. <ide> <del>#### Event: 'frameError' <add>#### Event: `'frameError'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> closed and destroyed immediately following the `'frameError'` event. If the <ide> event is not associated with a stream, the `Http2Session` will be shut down <ide> immediately following the `'frameError'` event. <ide> <del>#### Event: 'goaway' <add>#### Event: `'goaway'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The `'goaway'` event is emitted when a `GOAWAY` frame is received. <ide> The `Http2Session` instance will be shut down automatically when the `'goaway'` <ide> event is emitted. <ide> <del>#### Event: 'localSettings' <add>#### Event: `'localSettings'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> session.on('localSettings', (settings) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'ping' <add>#### Event: `'ping'` <ide> <!-- YAML <ide> added: v10.12.0 <ide> --> <ide> added: v10.12.0 <ide> The `'ping'` event is emitted whenever a `PING` frame is received from the <ide> connected peer. <ide> <del>#### Event: 'remoteSettings' <add>#### Event: `'remoteSettings'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> session.on('remoteSettings', (settings) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'stream' <add>#### Event: `'stream'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Even though HTTP/2 streams and network sockets are not in a 1:1 correspondence, <ide> a network error will destroy each individual stream and must be handled on the <ide> stream level, as shown above. <ide> <del>#### Event: 'timeout' <add>#### Event: `'timeout'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> session.setTimeout(2000); <ide> session.on('timeout', () => { /* .. */ }); <ide> ``` <ide> <del>#### http2session.alpnProtocol <add>#### `http2session.alpnProtocol` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or <ide> will return the value of the connected `TLSSocket`'s own `alpnProtocol` <ide> property. <ide> <del>#### http2session.close(\[callback\]) <add>#### `http2session.close([callback])` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> are no open `Http2Stream` instances. <ide> If specified, the `callback` function is registered as a handler for the <ide> `'close'` event. <ide> <del>#### http2session.closed <add>#### `http2session.closed` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> added: v9.4.0 <ide> Will be `true` if this `Http2Session` instance has been closed, otherwise <ide> `false`. <ide> <del>#### http2session.connecting <add>#### `http2session.connecting` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> Will be `true` if this `Http2Session` instance is still connecting, will be set <ide> to `false` before emitting `connect` event and/or calling the `http2.connect` <ide> callback. <ide> <del>#### http2session.destroy(\[error\]\[, code\]) <add>#### `http2session.destroy([error][, code])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> is not undefined, an `'error'` event will be emitted immediately before the <ide> If there are any remaining open `Http2Streams` associated with the <ide> `Http2Session`, those will also be destroyed. <ide> <del>#### http2session.destroyed <add>#### `http2session.destroyed` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Will be `true` if this `Http2Session` instance has been destroyed and must no <ide> longer be used, otherwise `false`. <ide> <del>#### http2session.encrypted <add>#### `http2session.encrypted` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> connected, `true` if the `Http2Session` is connected with a `TLSSocket`, <ide> and `false` if the `Http2Session` is connected to any other kind of socket <ide> or stream. <ide> <del>#### http2session.goaway(\[code\[, lastStreamID\[, opaqueData\]\]\]) <add>#### `http2session.goaway([code[, lastStreamID[, opaqueData]]])` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> added: v9.4.0 <ide> Transmits a `GOAWAY` frame to the connected peer *without* shutting down the <ide> `Http2Session`. <ide> <del>#### http2session.localSettings <add>#### `http2session.localSettings` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> A prototype-less object describing the current local settings of this <ide> `Http2Session`. The local settings are local to *this* `Http2Session` instance. <ide> <del>#### http2session.originSet <add>#### `http2session.originSet` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> considered authoritative. <ide> <ide> The `originSet` property is only available when using a secure TLS connection. <ide> <del>#### http2session.pendingSettingsAck <add>#### `http2session.pendingSettingsAck` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> a sent `SETTINGS` frame. Will be `true` after calling the <ide> `http2session.settings()` method. Will be `false` once all sent `SETTINGS` <ide> frames have been acknowledged. <ide> <del>#### http2session.ping(\[payload, \]callback) <add>#### `http2session.ping([payload, ]callback)` <ide> <!-- YAML <ide> added: v8.9.3 <ide> --> <ide> session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { <ide> If the `payload` argument is not specified, the default payload will be the <ide> 64-bit timestamp (little endian) marking the start of the `PING` duration. <ide> <del>#### http2session.ref() <add>#### `http2session.ref()` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> <ide> Calls [`ref()`][`net.Socket.prototype.ref()`] on this `Http2Session` <ide> instance's underlying [`net.Socket`][]. <ide> <del>#### http2session.remoteSettings <add>#### `http2session.remoteSettings` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> A prototype-less object describing the current remote settings of this <ide> `Http2Session`. The remote settings are set by the *connected* HTTP/2 peer. <ide> <del>#### http2session.setTimeout(msecs, callback) <add>#### `http2session.setTimeout(msecs, callback)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Used to set a callback function that is called when there is no activity on <ide> the `Http2Session` after `msecs` milliseconds. The given `callback` is <ide> registered as a listener on the `'timeout'` event. <ide> <del>#### http2session.socket <add>#### `http2session.socket` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See <ide> <ide> All other interactions will be routed directly to the socket. <ide> <del>#### http2session.state <add>#### `http2session.state` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Provides miscellaneous information about the current state of the <ide> <ide> An object describing the current status of this `Http2Session`. <ide> <del>#### http2session.settings(\[settings\]\[, callback\]) <add>#### `http2session.settings([settings][, callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The new settings will not become effective until the `SETTINGS` acknowledgment <ide> is received and the `'localSettings'` event is emitted. It is possible to send <ide> multiple `SETTINGS` frames while acknowledgment is still pending. <ide> <del>#### http2session.type <add>#### `http2session.type` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The `http2session.type` will be equal to <ide> server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a <ide> client. <ide> <del>#### http2session.unref() <add>#### `http2session.unref()` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> <ide> Calls [`unref()`][`net.Socket.prototype.unref()`] on this `Http2Session` <ide> instance's underlying [`net.Socket`][]. <ide> <del>### Class: ServerHttp2Session <add>### Class: `ServerHttp2Session` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> * Extends: {Http2Session} <ide> <del>#### serverhttp2session.altsvc(alt, originOrStream) <add>#### `serverhttp2session.altsvc(alt, originOrStream)` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> The protocol identifier (`'h2'` in the examples) may be any valid <ide> The syntax of these values is not validated by the Node.js implementation and <ide> are passed through as provided by the user or received from the peer. <ide> <del>#### serverhttp2session.origin(...origins) <add>#### `serverhttp2session.origin(...origins)` <ide> <!-- YAML <ide> added: v10.12.0 <ide> --> <ide> server.on('stream', (stream) => { <ide> }); <ide> ``` <ide> <del>### Class: ClientHttp2Session <add>### Class: `ClientHttp2Session` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> * Extends: {Http2Session} <ide> <del>#### Event: 'altsvc' <add>#### Event: `'altsvc'` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> client.on('altsvc', (alt, origin, streamId) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'origin' <add>#### Event: `'origin'` <ide> <!-- YAML <ide> added: v10.12.0 <ide> --> <ide> client.on('origin', (origins) => { <ide> <ide> The `'origin'` event is only emitted when using a secure TLS connection. <ide> <del>#### clienthttp2session.request(headers\[, options\]) <add>#### `clienthttp2session.request(headers[, options])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> they respectively default to: <ide> * `:method` = `'GET'` <ide> * `:path` = `/` <ide> <del>### Class: Http2Stream <add>### Class: `Http2Stream` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> All `Http2Stream` instances are [`Duplex`][] streams. The `Writable` side of the <ide> `Duplex` is used to send data to the connected peer, while the `Readable` side <ide> is used to receive data sent by the connected peer. <ide> <del>#### Http2Stream Lifecycle <add>#### `Http2Stream` Lifecycle <ide> <ide> ##### Creation <ide> <ide> property will be `true` and the `http2stream.rstCode` property will specify the <ide> `RST_STREAM` error code. The `Http2Stream` instance is no longer usable once <ide> destroyed. <ide> <del>#### Event: 'aborted' <add>#### Event: `'aborted'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Its listener does not expect any arguments. <ide> The `'aborted'` event will only be emitted if the `Http2Stream` writable side <ide> has not been ended. <ide> <del>#### Event: 'close' <add>#### Event: `'close'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The HTTP/2 error code used when closing the stream can be retrieved using <ide> the `http2stream.rstCode` property. If the code is any value other than <ide> `NGHTTP2_NO_ERROR` (`0`), an `'error'` event will have also been emitted. <ide> <del>#### Event: 'error' <add>#### Event: `'error'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> The `'error'` event is emitted when an error occurs during the processing of <ide> an `Http2Stream`. <ide> <del>#### Event: 'frameError' <add>#### Event: `'frameError'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> argument identifying the frame type, and an integer argument identifying the <ide> error code. The `Http2Stream` instance will be destroyed immediately after the <ide> `'frameError'` event is emitted. <ide> <del>#### Event: 'timeout' <add>#### Event: `'timeout'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The `'timeout'` event is emitted after no activity is received for this <ide> `http2stream.setTimeout()`. <ide> Its listener does not expect any arguments. <ide> <del>#### Event: 'trailers' <add>#### Event: `'trailers'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> stream.on('trailers', (headers, flags) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'wantTrailers' <add>#### Event: `'wantTrailers'` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> final `DATA` frame to be sent on a frame and the `Http2Stream` is ready to send <ide> trailing headers. When initiating a request or response, the `waitForTrailers` <ide> option must be set for this event to be emitted. <ide> <del>#### http2stream.aborted <add>#### `http2stream.aborted` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, <ide> the `'aborted'` event will have been emitted. <ide> <del>#### http2stream.bufferSize <add>#### `http2stream.bufferSize` <ide> <!-- YAML <ide> added: v11.2.0 <ide> --> <ide> added: v11.2.0 <ide> This property shows the number of characters currently buffered to be written. <ide> See [`net.Socket.bufferSize`][] for details. <ide> <del>#### http2stream.close(code\[, callback\]) <add>#### `http2stream.close(code[, callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the <ide> connected HTTP/2 peer. <ide> <del>#### http2stream.closed <add>#### `http2stream.closed` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> added: v9.4.0 <ide> <ide> Set to `true` if the `Http2Stream` instance has been closed. <ide> <del>#### http2stream.destroyed <add>#### `http2stream.destroyed` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Set to `true` if the `Http2Stream` instance has been destroyed and is no longer <ide> usable. <ide> <del>#### http2stream.endAfterHeaders <add>#### `http2stream.endAfterHeaders` <ide> <!-- YAML <ide> added: v10.11.0 <ide> --> <ide> Set the `true` if the `END_STREAM` flag was set in the request or response <ide> HEADERS frame received, indicating that no additional data should be received <ide> and the readable side of the `Http2Stream` will be closed. <ide> <del>#### http2stream.id <add>#### `http2stream.id` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` <ide> if the stream identifier has not yet been assigned. <ide> <del>#### http2stream.pending <add>#### `http2stream.pending` <ide> <!-- YAML <ide> added: v9.4.0 <ide> --> <ide> added: v9.4.0 <ide> Set to `true` if the `Http2Stream` instance has not yet been assigned a <ide> numeric stream identifier. <ide> <del>#### http2stream.priority(options) <add>#### `http2stream.priority(options)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> Updates the priority for this `Http2Stream` instance. <ide> <del>#### http2stream.rstCode <add>#### `http2stream.rstCode` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> destroyed after either receiving an `RST_STREAM` frame from the connected peer, <ide> calling `http2stream.close()`, or `http2stream.destroy()`. Will be <ide> `undefined` if the `Http2Stream` has not been closed. <ide> <del>#### http2stream.sentHeaders <add>#### `http2stream.sentHeaders` <ide> <!-- YAML <ide> added: v9.5.0 <ide> --> <ide> added: v9.5.0 <ide> <ide> An object containing the outbound headers sent for this `Http2Stream`. <ide> <del>#### http2stream.sentInfoHeaders <add>#### `http2stream.sentInfoHeaders` <ide> <!-- YAML <ide> added: v9.5.0 <ide> --> <ide> added: v9.5.0 <ide> An array of objects containing the outbound informational (additional) headers <ide> sent for this `Http2Stream`. <ide> <del>#### http2stream.sentTrailers <add>#### `http2stream.sentTrailers` <ide> <!-- YAML <ide> added: v9.5.0 <ide> --> <ide> added: v9.5.0 <ide> <ide> An object containing the outbound trailers sent for this `HttpStream`. <ide> <del>#### http2stream.session <add>#### `http2stream.session` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> A reference to the `Http2Session` instance that owns this `Http2Stream`. The <ide> value will be `undefined` after the `Http2Stream` instance is destroyed. <ide> <del>#### http2stream.setTimeout(msecs, callback) <add>#### `http2stream.setTimeout(msecs, callback)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> const req = client.request({ ':path': '/' }); <ide> req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); <ide> ``` <ide> <del>#### http2stream.state <add>#### `http2stream.state` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Provides miscellaneous information about the current state of the <ide> <ide> A current state of this `Http2Stream`. <ide> <del>#### http2stream.sendTrailers(headers) <add>#### `http2stream.sendTrailers(headers)` <ide> <!-- YAML <ide> added: v10.0.0 <ide> --> <ide> server.on('stream', (stream) => { <ide> The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header <ide> fields (e.g. `':method'`, `':path'`, etc). <ide> <del>### Class: ClientHttp2Stream <add>### Class: `ClientHttp2Stream` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> used exclusively on HTTP/2 Clients. `Http2Stream` instances on the client <ide> provide events such as `'response'` and `'push'` that are only relevant on <ide> the client. <ide> <del>#### Event: 'continue' <add>#### Event: `'continue'` <ide> <!-- YAML <ide> added: v8.5.0 <ide> --> <ide> Emitted when the server sends a `100 Continue` status, usually because <ide> the request contained `Expect: 100-continue`. This is an instruction that <ide> the client should send the request body. <ide> <del>#### Event: 'headers' <add>#### Event: `'headers'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> stream.on('headers', (headers, flags) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'push' <add>#### Event: `'push'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> stream.on('push', (headers, flags) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'response' <add>#### Event: `'response'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> req.on('response', (headers, flags) => { <ide> }); <ide> ``` <ide> <del>### Class: ServerHttp2Stream <add>### Class: `ServerHttp2Stream` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> used exclusively on HTTP/2 Servers. `Http2Stream` instances on the server <ide> provide additional methods such as `http2stream.pushStream()` and <ide> `http2stream.respond()` that are only relevant on the server. <ide> <del>#### http2stream.additionalHeaders(headers) <add>#### `http2stream.additionalHeaders(headers)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. <ide> <del>#### http2stream.headersSent <add>#### `http2stream.headersSent` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> True if headers were sent, false otherwise (read-only). <ide> <del>#### http2stream.pushAllowed <add>#### `http2stream.pushAllowed` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> client's most recent `SETTINGS` frame. Will be `true` if the remote peer <ide> accepts push streams, `false` otherwise. Settings are the same for every <ide> `Http2Stream` in the same `Http2Session`. <ide> <del>#### http2stream.pushStream(headers\[, options\], callback) <add>#### `http2stream.pushStream(headers[, options], callback)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> a `weight` value to `http2stream.priority` with the `silent` option set to <ide> Calling `http2stream.pushStream()` from within a pushed stream is not permitted <ide> and will throw an error. <ide> <del>#### http2stream.respond(\[headers\[, options\]\]) <add>#### `http2stream.respond([headers[, options]])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> server.on('stream', (stream) => { <ide> }); <ide> ``` <ide> <del>#### http2stream.respondWithFD(fd\[, headers\[, options\]\]) <add>#### `http2stream.respondWithFD(fd[, headers[, options]])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> server.on('stream', (stream) => { <ide> }); <ide> ``` <ide> <del>#### http2stream.respondWithFile(path\[, headers\[, options\]\]) <add>#### `http2stream.respondWithFile(path[, headers[, options]])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> server.on('stream', (stream) => { <ide> }); <ide> ``` <ide> <del>### Class: Http2Server <add>### Class: `Http2Server` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Instances of `Http2Server` are created using the `http2.createServer()` <ide> function. The `Http2Server` class is not exported directly by the `http2` <ide> module. <ide> <del>#### Event: 'checkContinue' <add>#### Event: `'checkContinue'` <ide> <!-- YAML <ide> added: v8.5.0 <ide> --> <ide> the request body. <ide> When this event is emitted and handled, the [`'request'`][] event will <ide> not be emitted. <ide> <del>#### Event: 'request' <add>#### Event: `'request'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Emitted each time there is a request. There may be multiple requests <ide> per session. See the [Compatibility API][]. <ide> <del>#### Event: 'session' <add>#### Event: `'session'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> The `'session'` event is emitted when a new `Http2Session` is created by the <ide> `Http2Server`. <ide> <del>#### Event: 'sessionError' <add>#### Event: `'sessionError'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> The `'sessionError'` event is emitted when an `'error'` event is emitted by <ide> an `Http2Session` object associated with the `Http2Server`. <ide> <del>#### Event: 'stream' <add>#### Event: `'stream'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> server.on('stream', (stream, headers, flags) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'timeout' <add>#### Event: `'timeout'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> The `'timeout'` event is emitted when there is no activity on the Server for <ide> a given number of milliseconds set using `http2server.setTimeout()`. <ide> **Default:** 0 (no timeout) <ide> <del>#### server.close(\[callback\]) <add>#### `server.close([callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> If `callback` is provided, it is not invoked until all active sessions have been <ide> closed, although the server has already stopped allowing new sessions. See <ide> [`net.Server.close()`][] for more details. <ide> <del>#### server.setTimeout(\[msecs\]\[, callback\]) <add>#### `server.setTimeout([msecs][, callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> The given callback is registered as a listener on the `'timeout'` event. <ide> In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK` <ide> error will be thrown. <ide> <del>### Class: Http2SecureServer <add>### Class: `Http2SecureServer` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Instances of `Http2SecureServer` are created using the <ide> `http2.createSecureServer()` function. The `Http2SecureServer` class is not <ide> exported directly by the `http2` module. <ide> <del>#### Event: 'checkContinue' <add>#### Event: `'checkContinue'` <ide> <!-- YAML <ide> added: v8.5.0 <ide> --> <ide> the request body. <ide> When this event is emitted and handled, the [`'request'`][] event will <ide> not be emitted. <ide> <del>#### Event: 'request' <add>#### Event: `'request'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Emitted each time there is a request. There may be multiple requests <ide> per session. See the [Compatibility API][]. <ide> <del>#### Event: 'session' <add>#### Event: `'session'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> The `'session'` event is emitted when a new `Http2Session` is created by the <ide> `Http2SecureServer`. <ide> <del>#### Event: 'sessionError' <add>#### Event: `'sessionError'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> The `'sessionError'` event is emitted when an `'error'` event is emitted by <ide> an `Http2Session` object associated with the `Http2SecureServer`. <ide> <del>#### Event: 'stream' <add>#### Event: `'stream'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> server.on('stream', (stream, headers, flags) => { <ide> }); <ide> ``` <ide> <del>#### Event: 'timeout' <add>#### Event: `'timeout'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The `'timeout'` event is emitted when there is no activity on the Server for <ide> a given number of milliseconds set using `http2secureServer.setTimeout()`. <ide> **Default:** 2 minutes. <ide> <del>#### Event: 'unknownProtocol' <add>#### Event: `'unknownProtocol'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler <ide> receives the socket for handling. If no listener is registered for this event, <ide> the connection is terminated. See the [Compatibility API][]. <ide> <del>#### server.close(\[callback\]) <add>#### `server.close([callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> If `callback` is provided, it is not invoked until all active sessions have been <ide> closed, although the server has already stopped allowing new sessions. See <ide> [`tls.Server.close()`][] for more details. <ide> <del>#### server.setTimeout(\[msecs\]\[, callback\]) <add>#### `server.setTimeout([msecs][, callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The given callback is registered as a listener on the `'timeout'` event. <ide> In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK` <ide> error will be thrown. <ide> <del>### http2.createServer(options\[, onRequestHandler\]) <add>### `http2.createServer(options[, onRequestHandler])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> server.on('stream', (stream, headers) => { <ide> server.listen(80); <ide> ``` <ide> <del>### http2.createSecureServer(options\[, onRequestHandler\]) <add>### `http2.createSecureServer(options[, onRequestHandler])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> server.on('stream', (stream, headers) => { <ide> server.listen(80); <ide> ``` <ide> <del>### http2.connect(authority\[, options\]\[, listener\]) <add>### `http2.connect(authority[, options][, listener])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> const client = http2.connect('https://localhost:1234'); <ide> client.close(); <ide> ``` <ide> <del>### http2.constants <add>### `http2.constants` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <del>#### Error Codes for RST_STREAM and GOAWAY <add>#### Error Codes for `RST_STREAM` and `GOAWAY` <ide> <a id="error_codes"></a> <ide> <ide> | Value | Name | Constant | <ide> added: v8.4.0 <ide> The `'timeout'` event is emitted when there is no activity on the Server for <ide> a given number of milliseconds set using `http2server.setTimeout()`. <ide> <del>### http2.getDefaultSettings() <add>### `http2.getDefaultSettings()` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Returns an object containing the default settings for an `Http2Session` <ide> instance. This method returns a new object instance every time it is called <ide> so instances returned may be safely modified for use. <ide> <del>### http2.getPackedSettings(\[settings\]) <add>### `http2.getPackedSettings([settings])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> console.log(packed.toString('base64')); <ide> // Prints: AAIAAAAA <ide> ``` <ide> <del>### http2.getUnpackedSettings(buf) <add>### `http2.getUnpackedSettings(buf)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> client.on('stream', (pushedStream, requestHeaders) => { <ide> const req = client.request({ ':path': '/' }); <ide> ``` <ide> <del>### Supporting the CONNECT method <add>### Supporting the `CONNECT` method <ide> <ide> The `CONNECT` method is used to allow an HTTP/2 server to be used as a proxy <ide> for TCP/IP connections. <ide> req.on('end', () => { <ide> req.end('Jane'); <ide> ``` <ide> <del>### The Extended CONNECT Protocol <add>### The Extended `CONNECT` Protocol <ide> <ide> [RFC 8441][] defines an "Extended CONNECT Protocol" extension to HTTP/2 that <ide> may be used to bootstrap the use of an `Http2Stream` using the `CONNECT` <ide> function onRequest(req, res) { <ide> The `'request'` event works identically on both [HTTPS][] and <ide> HTTP/2. <ide> <del>### Class: http2.Http2ServerRequest <add>### Class: `http2.Http2ServerRequest` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> A `Http2ServerRequest` object is created by [`http2.Server`][] or <ide> [`'request'`][] event. It may be used to access a request status, headers, and <ide> data. <ide> <del>#### Event: 'aborted' <add>#### Event: `'aborted'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> abnormally aborted in mid-communication. <ide> The `'aborted'` event will only be emitted if the `Http2ServerRequest` writable <ide> side has not been ended. <ide> <del>#### Event: 'close' <add>#### Event: `'close'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> Indicates that the underlying [`Http2Stream`][] was closed. <ide> Just like `'end'`, this event occurs only once per response. <ide> <del>#### request.aborted <add>#### `request.aborted` <ide> <!-- YAML <ide> added: v10.1.0 <ide> --> <ide> added: v10.1.0 <ide> The `request.aborted` property will be `true` if the request has <ide> been aborted. <ide> <del>#### request.authority <add>#### `request.authority` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> The request authority pseudo header field. It can also be accessed via <ide> `req.headers[':authority']`. <ide> <del>#### request.complete <add>#### `request.complete` <ide> <!-- YAML <ide> added: v12.10.0 <ide> --> <ide> added: v12.10.0 <ide> The `request.complete` property will be `true` if the request has <ide> been completed, aborted, or destroyed. <ide> <del>#### request.connection <add>#### `request.connection` <ide> <!-- YAML <ide> added: v8.4.0 <ide> deprecated: v13.0.0 <ide> deprecated: v13.0.0 <ide> <ide> See [`request.socket`][]. <ide> <del>#### request.destroy(\[error\]) <add>#### `request.destroy([error])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> is emitted and `error` is passed as an argument to any listeners on the event. <ide> <ide> It does nothing if the stream was already destroyed. <ide> <del>#### request.headers <add>#### `request.headers` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> removeAllHeaders(request.headers); <ide> assert(request.url); // Fails because the :path header has been removed <ide> ``` <ide> <del>#### request.httpVersion <add>#### `request.httpVersion` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> client response, the HTTP version of the connected-to server. Returns <ide> Also `message.httpVersionMajor` is the first integer and <ide> `message.httpVersionMinor` is the second. <ide> <del>#### request.method <add>#### `request.method` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. <ide> <del>#### request.rawHeaders <add>#### `request.rawHeaders` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Header names are not lowercased, and duplicates are not merged. <ide> console.log(request.rawHeaders); <ide> ``` <ide> <del>#### request.rawTrailers <add>#### `request.rawTrailers` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> The raw request/response trailer keys and values exactly as they were <ide> received. Only populated at the `'end'` event. <ide> <del>#### request.scheme <add>#### `request.scheme` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> The request scheme pseudo header field indicating the scheme <ide> portion of the target URL. <ide> <del>#### request.setTimeout(msecs, callback) <add>#### `request.setTimeout(msecs, callback)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> the server, then [`Http2Stream`][]s are destroyed when they time out. If a <ide> handler is assigned to the request, the response, or the server's `'timeout'` <ide> events, timed out sockets must be handled explicitly. <ide> <del>#### request.socket <add>#### `request.socket` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> All other interactions will be routed directly to the socket. With TLS support, <ide> use [`request.socket.getPeerCertificate()`][] to obtain the client's <ide> authentication details. <ide> <del>#### request.stream <add>#### `request.stream` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> The [`Http2Stream`][] object backing the request. <ide> <del>#### request.trailers <add>#### `request.trailers` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> The request/response trailers object. Only populated at the `'end'` event. <ide> <del>#### request.url <add>#### `request.url` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Url { <ide> href: '/status?name=ryan' } <ide> ``` <ide> <del>### Class: http2.Http2ServerResponse <add>### Class: `http2.Http2ServerResponse` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> This object is created internally by an HTTP server — not by the user. It is <ide> passed as the second parameter to the [`'request'`][] event. <ide> <del>#### Event: 'close' <add>#### Event: `'close'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> <ide> Indicates that the underlying [`Http2Stream`][] was terminated before <ide> [`response.end()`][] was called or able to flush. <ide> <del>#### Event: 'finish' <add>#### Event: `'finish'` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> does not imply that the client has received anything yet. <ide> <ide> After this event, no more events will be emitted on the response object. <ide> <del>#### response.addTrailers(headers) <add>#### `response.addTrailers(headers)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> message) to the response. <ide> Attempting to set a header field name or value that contains invalid characters <ide> will result in a [`TypeError`][] being thrown. <ide> <del>#### response.connection <add>#### `response.connection` <ide> <!-- YAML <ide> added: v8.4.0 <ide> deprecated: v13.0.0 <ide> deprecated: v13.0.0 <ide> <ide> See [`response.socket`][]. <ide> <del>#### response.end(\[data\[, encoding\]\]\[, callback\]) <add>#### `response.end([data[, encoding]][, callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> If `data` is specified, it is equivalent to calling <ide> If `callback` is specified, it will be called when the response stream <ide> is finished. <ide> <del>#### response.finished <add>#### `response.finished` <ide> <!-- YAML <ide> added: v8.4.0 <ide> deprecated: v13.4.0 <ide> deprecated: v13.4.0 <ide> Boolean value that indicates whether the response has completed. Starts <ide> as `false`. After [`response.end()`][] executes, the value will be `true`. <ide> <del>#### response.getHeader(name) <add>#### `response.getHeader(name)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> The name is case-insensitive. <ide> const contentType = response.getHeader('content-type'); <ide> ``` <ide> <del>#### response.getHeaderNames() <add>#### `response.getHeaderNames()` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> const headerNames = response.getHeaderNames(); <ide> // headerNames === ['foo', 'set-cookie'] <ide> ``` <ide> <del>#### response.getHeaders() <add>#### `response.getHeaders()` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> const headers = response.getHeaders(); <ide> // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } <ide> ``` <ide> <del>#### response.hasHeader(name) <add>#### `response.hasHeader(name)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> outgoing headers. The header name matching is case-insensitive. <ide> const hasContentType = response.hasHeader('content-type'); <ide> ``` <ide> <del>#### response.headersSent <add>#### `response.headersSent` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> True if headers were sent, false otherwise (read-only). <ide> <del>#### response.removeHeader(name) <add>#### `response.removeHeader(name)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Removes a header that has been queued for implicit sending. <ide> response.removeHeader('Content-Encoding'); <ide> ``` <ide> <del>#### response.sendDate <add>#### `response.sendDate` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> the response if it is not already present in the headers. Defaults to true. <ide> This should only be disabled for testing; HTTP requires the Date header <ide> in responses. <ide> <del>#### response.setHeader(name, value) <add>#### `response.setHeader(name, value)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <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> the server, then [`Http2Stream`][]s are destroyed when they time out. If a <ide> handler is assigned to the request, the response, or the server's `'timeout'` <ide> events, timed out sockets must be handled explicitly. <ide> <del>#### response.socket <add>#### `response.socket` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> const server = http2.createServer((req, res) => { <ide> }).listen(3000); <ide> ``` <ide> <del>#### response.statusCode <add>#### `response.statusCode` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> response.statusCode = 404; <ide> After response header was sent to the client, this property indicates the <ide> status code which was sent out. <ide> <del>#### response.statusMessage <add>#### `response.statusMessage` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns <ide> an empty string. <ide> <del>#### response.stream <add>#### `response.stream` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> added: v8.4.0 <ide> <ide> The [`Http2Stream`][] object backing the response. <ide> <del>#### response.writableEnded <add>#### `response.writableEnded` <ide> <!-- YAML <ide> added: v12.9.0 <ide> --> <ide> Is `true` after [`response.end()`][] has been called. This property <ide> does not indicate whether the data has been flushed, for this use <ide> [`writable.writableFinished`][] instead. <ide> <del>#### response.write(chunk\[, encoding\]\[, callback\]) <add>#### `response.write(chunk[, encoding][, callback])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Returns `true` if the entire data was flushed successfully to the kernel <ide> buffer. Returns `false` if all or part of the data was queued in user memory. <ide> `'drain'` will be emitted when the buffer is free again. <ide> <del>#### response.writeContinue() <add>#### `response.writeContinue()` <ide> <!-- YAML <ide> added: v8.4.0 <ide> --> <ide> Sends a status `100 Continue` to the client, indicating that the request body <ide> should be sent. See the [`'checkContinue'`][] event on `Http2Server` and <ide> `Http2SecureServer`. <ide> <del>#### response.writeHead(statusCode\[, statusMessage\]\[, headers\]) <add>#### `response.writeHead(statusCode[, statusMessage][, headers])` <ide> <!-- YAML <ide> added: v8.4.0 <ide> changes: <ide> const server = http2.createServer((req, res) => { <ide> Attempting to set a header field name or value that contains invalid characters <ide> will result in a [`TypeError`][] being thrown. <ide> <del>#### response.createPushResponse(headers, callback) <add>#### `response.createPushResponse(headers, callback)` <ide> <!-- YAML <ide> added: v8.4.0 <ide> -->
1
Java
Java
use the c.f.react.bridge.reactmarker
e70d1dba58bdb92eb5a025c6348303e9c650148c
<ide><path>ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java <ide> public class ReactMarkerConstants { <ide> public static final String CREATE_CATALYST_INSTANCE_END = "CREATE_CATALYST_INSTANCE_END"; <ide> public static final String RUN_JS_BUNDLE_START = "RUN_JS_BUNDLE_START"; <ide> public static final String RUN_JS_BUNDLE_END = "RUN_JS_BUNDLE_END"; <add> public static final String NATIVE_MODULE_INITIALIZE_START = "NativeModule_start"; <add> public static final String NATIVE_MODULE_INITIALIZE_END = "NativeModule_end"; <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/cxxbridge/NativeModuleRegistry.java <ide> <ide> package com.facebook.react.cxxbridge; <ide> <del>import java.io.IOException; <del>import java.io.StringWriter; <ide> import java.util.ArrayList; <ide> import java.util.Collection; <ide> import java.util.HashMap; <del>import java.util.HashSet; <ide> import java.util.Map; <del>import java.util.Set; <del> <del>import javax.annotation.Nullable; <ide> <add>import com.facebook.infer.annotation.Assertions; <ide> import com.facebook.react.bridge.BaseJavaModule; <del>import com.facebook.react.bridge.CatalystInstance; <ide> import com.facebook.react.bridge.NativeModule; <ide> import com.facebook.react.bridge.OnBatchCompleteListener; <del>import com.facebook.react.bridge.ReadableNativeArray; <add>import com.facebook.react.bridge.ReactMarker; <add>import com.facebook.react.bridge.ReactMarkerConstants; <ide> import com.facebook.react.common.MapBuilder; <del>import com.facebook.react.common.SetBuilder; <del>import com.facebook.infer.annotation.Assertions; <ide> import com.facebook.systrace.Systrace; <ide> <ide> /** <ide> private NativeModuleRegistry(Map<Class<NativeModule>, NativeModule> moduleInstan <ide> /* package */ void notifyCatalystInstanceInitialized() { <ide> UiThreadUtil.assertOnUiThread(); <ide> <del> ReactMarker.logMarker("NativeModule_start"); <add> ReactMarker.logMarker(ReactMarkerConstants.NATIVE_MODULE_INITIALIZE_START); <ide> Systrace.beginSection( <ide> Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, <ide> "NativeModuleRegistry_notifyCatalystInstanceInitialized"); <ide> private NativeModuleRegistry(Map<Class<NativeModule>, NativeModule> moduleInstan <ide> } <ide> } finally { <ide> Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); <del> ReactMarker.logMarker("NativeModule_end"); <add> ReactMarker.logMarker(ReactMarkerConstants.NATIVE_MODULE_INITIALIZE_END); <ide> } <ide> } <ide> <ide> public Builder add(NativeModule module) { <ide> public NativeModuleRegistry build() { <ide> Map<Class<NativeModule>, NativeModule> moduleInstances = new HashMap<>(); <ide> for (NativeModule module : mModules.values()) { <del> moduleInstances.put((Class<NativeModule>)module.getClass(), module); <add> moduleInstances.put((Class<NativeModule>) module.getClass(), module); <ide> } <ide> return new NativeModuleRegistry(moduleInstances); <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/cxxbridge/ReactMarker.java <del>// Copyright 2004-present Facebook. All Rights Reserved. <del> <del>package com.facebook.react.cxxbridge; <del> <del>import javax.annotation.Nullable; <del>import com.facebook.proguard.annotations.DoNotStrip; <del>/** <del> * Static class that allows markers to be placed in React code and responded to in a <del> * configurable way <del> */ <del>@DoNotStrip <del>public class ReactMarker { <del> <del> public interface MarkerListener { <del> void logMarker(String name); <del> }; <del> <del> @Nullable static private MarkerListener sMarkerListener = null; <del> <del> static public void setMarkerListener(MarkerListener listener) { <del> sMarkerListener = listener; <del> } <del> <del> @DoNotStrip <del> static public void logMarker(String name) { <del> if (sMarkerListener != null) { <del> sMarkerListener.logMarker(name); <del> } <del> } <del> <del>}
3
PHP
PHP
remove unintentional whitespace from docblocks
9a4c071fb2a50b364b3cc0128364bc35bc84d9d7
<ide><path>src/Illuminate/Session/Store.php <ide> public function ageFlashData() <ide> <ide> /** <ide> * Remove data that was flashed on last request <del> * <add> * <ide> * @return void <ide> */ <ide> public function removeFlashNowData() <ide> public function flash($key, $value) <ide> /** <ide> * Flash a key / value pair to the session <ide> * for immediate use <del> * <add> * <ide> * @param string $key <ide> * @param mixed $value <ide> * @return void
1
Ruby
Ruby
add test for `uninstall` before removing artifacts
ecb17f4f1d265e1625828565ecbbdac6d5f989c6
<ide><path>Library/Homebrew/cask/spec/cask/cli/uninstall_spec.rb <ide> expect(Hbc.appdir.join("Caffeine.app")).not_to exist <ide> end <ide> <add> it "calls `uninstall` before removing artifacts" do <add> cask = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-uninstall-script-app.rb") <add> <add> shutup do <add> Hbc::Installer.new(cask).install <add> end <add> <add> expect(cask).to be_installed <add> <add> expect { <add> shutup do <add> Hbc::CLI::Uninstall.run("with-uninstall-script-app") <add> end <add> }.not_to raise_error <add> <add> expect(cask).not_to be_installed <add> expect(Hbc.appdir.join("MyFancyApp.app")).not_to exist <add> end <add> <ide> describe "when multiple versions of a cask are installed" do <ide> let(:token) { "versioned-cask" } <ide> let(:first_installed_version) { "1.2.3" } <ide><path>Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-app.rb <add>cask 'with-uninstall-script-app' do <add> version '1.2.3' <add> sha256 '5633c3a0f2e572cbf021507dec78c50998b398c343232bdfc7e26221d0a5db4d' <add> <add> url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip" <add> homepage 'http://example.com/MyFancyApp' <add> <add> app 'MyFancyApp/MyFancyApp.app' <add> <add> postflight do <add> IO.write "#{appdir}/MyFancyApp.app/uninstall.sh", <<-EOS.undent <add> #!/bin/sh <add> /bin/rm -r "#{appdir}/MyFancyApp.app" <add> EOS <add> end <add> <add> uninstall script: { <add> executable: "#{appdir}/MyFancyApp.app/uninstall.sh", <add> sudo: false <add> } <add>end
2
Javascript
Javascript
add @description section
76cb53f8376a210b13c47dba88f99bbf9170233e
<ide><path>src/ngSanitize/sanitize.js <ide> * @ngdoc overview <ide> * @name ngSanitize <ide> * @description <add> * <add> * The `ngSanitize` module provides functionality to sanitize HTML. <add> * <add> * # Installation <add> * As a separate module, it must be loaded after Angular core is loaded; otherwise, an 'Uncaught Error: <add> * No module: ngSanitize' runtime error will occur. <add> * <add> * <pre> <add> * <script src="angular.js"></script> <add> * <script src="angular-sanitize.js"></script> <add> * </pre> <add> * <add> * # Usage <add> * To make sure the module is available to your application, declare it as a dependency of you application <add> * module. <add> * <add> * <pre> <add> * angular.module('app', ['ngSanitize']); <add> * </pre> <ide> */ <ide> <ide> /*
1
PHP
PHP
remove duplicate 'just'
4ef35884eceb4ff17c7eaf7f6f9ba6fa551e32cf
<ide><path>src/Illuminate/Database/Query/Grammars/Grammar.php <ide> protected function compileJoins(Builder $query, $joins) <ide> <ide> $type = $join->type; <ide> <del> // Cross joins generate a cartesian product between the first table and the joined <del> // table. Since they don't expect any "on" clauses to perform the join, we just <del> // just append the SQL statement and jump to the next iteration of this loop. <add> // Cross joins generate a cartesian product between the first table and the <add> // joined table. Since they don't expect any "on" clauses to perform the <add> // join, we append the SQL and jump to the next iteration of the loop. <ide> if ($type === 'cross') { <ide> $sql[] = "cross join $table"; <ide>
1
Javascript
Javascript
simplify implementation of planehelper
96bc672f4b17482b3a8e20680aaf723def1933b1
<ide><path>src/helpers/PlaneHelper.js <ide> import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; <ide> import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; <ide> import { Float32BufferAttribute } from '../core/BufferAttribute.js'; <ide> import { BufferGeometry } from '../core/BufferGeometry.js'; <del>import { FrontSide, BackSide } from '../constants.js'; <ide> <ide> class PlaneHelper extends Line { <ide> <ide> constructor( plane, size = 1, hex = 0xffff00 ) { <ide> <ide> const color = hex; <ide> <del> const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; <add> const positions = [ 1, - 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, - 1, 0, 1, 1, 0 ]; <ide> <ide> const geometry = new BufferGeometry(); <ide> geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); <ide> class PlaneHelper extends Line { <ide> <ide> this.size = size; <ide> <del> const positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; <add> const positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ]; <ide> <ide> const geometry2 = new BufferGeometry(); <ide> geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); <ide> class PlaneHelper extends Line { <ide> <ide> updateMatrixWorld( force ) { <ide> <del> let scale = - this.plane.constant; <add> this.position.set( 0, 0, 0 ); <ide> <del> if ( Math.abs( scale ) < 1e-8 ) scale = 1e-8; // sign does not matter <del> <del> this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); <del> <del> this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here <add> this.scale.set( 0.5 * this.size, 0.5 * this.size, 1 ); <ide> <ide> this.lookAt( this.plane.normal ); <ide> <add> this.translateZ( - this.plane.constant ); <add> <ide> super.updateMatrixWorld( force ); <ide> <ide> }
1
Javascript
Javascript
exit the process on module load error. (temporary)
0407145c11ae3bf28ce3d43a087df3bdfadc3f7f
<ide><path>src/node.js <ide> node.Module.prototype.loadObject = function (callback) { <ide> } else { <ide> node.stdio.writeError("Error reading " + self.filename + "\n"); <ide> loadPromise.emitError(); <add> node.exit(1); <ide> } <ide> }); <ide> return loadPromise; <ide> node.Module.prototype.loadScript = function (callback) { <ide> cat_promise.addErrback(function () { <ide> node.stdio.writeError("Error reading " + self.filename + "\n"); <ide> loadPromise.emitError(); <add> node.exit(1); <ide> }); <ide> <ide> cat_promise.addCallback(function (content) {
1
Java
Java
update copyright date
12a78d1af2fffa83ceffaa314aa5a20d6096e0e7
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.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.
1
Python
Python
remove v8_typed_array_max_size_in_heap option
b42dcb0eeb2d2c302b0ecabbc1092605a54213d6
<ide><path>configure.py <ide> def configure_v8(o): <ide> o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) <ide> o['variables']['force_dynamic_crt'] = 1 if options.shared else 0 <ide> o['variables']['node_enable_d8'] = b(options.enable_d8) <del> # Unconditionally force typed arrays to allocate outside the v8 heap. This <del> # is to prevent memory pointers from being moved around that are returned by <del> # Buffer::Data(). <del> o['variables']['v8_typed_array_max_size_in_heap'] = 0 <ide> if options.enable_d8: <ide> o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp. <ide> if options.without_bundled_v8 and options.enable_d8:
1
Ruby
Ruby
remove insignificant classes from docs
32b27f997b68a998991ed62c4cadc5bdc114d34d
<ide><path>actionpack/lib/action_controller/vendor/html-scanner/html/node.rb <ide> def ==(node) <ide> <ide> # A CDATA node is simply a text node with a specialized way of displaying <ide> # itself. <del> class CDATA < Text <add> class CDATA < Text #:nodoc: <ide> def to_s <ide> "<![CDATA[#{super}]>" <ide> end <ide><path>activerecord/lib/active_record/connection_adapters/oci_adapter.rb <ide> def define_a_column(i) <ide> <ide> # The OCIConnectionFactory factors out the code necessary to connect and <ide> # configure an OCI connection. <del> class OCIConnectionFactory <add> class OCIConnectionFactory #:nodoc: <ide> def new_connection(username, password, host) <ide> conn = OCI8.new username, password, host <ide> conn.exec %q{alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'} <ide> def new_connection(username, password, host) <ide> # this would be dangerous (as the earlier part of the implied transaction <ide> # may have failed silently if the connection died) -- so instead the <ide> # connection is marked as dead, to be reconnected on it's next use. <del> class OCI8AutoRecover < DelegateClass(OCI8) <add> class OCI8AutoRecover < DelegateClass(OCI8) #:nodoc: <ide> attr_accessor :active <ide> alias :active? :active <ide>
2
Ruby
Ruby
add versioned_formulae to to_hash
11c7b08a345142775be8b9f647618920f7cb03ca
<ide><path>Library/Homebrew/formula.rb <ide> def to_hash <ide> "full_name" => full_name, <ide> "oldname" => oldname, <ide> "aliases" => aliases.sort, <add> "versioned_formulae" => versioned_formulae.map(&:name), <ide> "desc" => desc, <ide> "homepage" => homepage, <ide> "versions" => {
1
Go
Go
remove iscpcannotcopyreadonly utility
e31e9180cda6fe21cc2f23baf41a1cb7287e5e8e
<ide><path>integration-cli/docker_cli_cp_to_container_test.go <ide> func (s *DockerCLICpSuite) TestCpToErrReadOnlyRootfs(c *testing.T) { <ide> dstPath := containerCpPath(containerID, "/root/shouldNotExist") <ide> <ide> err := runDockerCp(c, srcPath, dstPath) <del> assert.ErrorContains(c, err, "") <del> <del> assert.Assert(c, isCpCannotCopyReadOnly(err), "expected ErrContainerRootfsReadonly error, but got %T: %s", err, err) <add> assert.ErrorContains(c, err, "marked read-only") <ide> assert.NilError(c, containerStartOutputEquals(c, containerID, ""), "dstPath should not have existed") <ide> } <ide> <ide> func (s *DockerCLICpSuite) TestCpToErrReadOnlyVolume(c *testing.T) { <ide> dstPath := containerCpPath(containerID, "/vol_ro/shouldNotExist") <ide> <ide> err := runDockerCp(c, srcPath, dstPath) <del> assert.ErrorContains(c, err, "") <add> assert.ErrorContains(c, err, "marked read-only") <ide> <del> assert.Assert(c, isCpCannotCopyReadOnly(err), "expected ErrVolumeReadonly error, but got %T: %s", err, err) <ide> assert.NilError(c, containerStartOutputEquals(c, containerID, ""), "dstPath should not have existed") <ide> } <ide><path>integration-cli/docker_cli_cp_utils_test.go <ide> func isCpCannotCopyDir(err error) bool { <ide> return strings.Contains(err.Error(), archive.ErrCannotCopyDir.Error()) <ide> } <ide> <del>func isCpCannotCopyReadOnly(err error) bool { <del> return strings.Contains(err.Error(), "marked read-only") <del>} <del> <ide> func fileContentEquals(c *testing.T, filename, contents string) error { <ide> c.Helper() <ide>
2