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
Javascript
Javascript
remove unused var
4b254a07df8069e36803a8001234539c604916c2
<ide><path>src/js/component.js <ide> vjs.Component = vjs.CoreObject.extend({ <ide> touchmove = true; <ide> })); <ide> this.on('touchend', vjs.bind(this, function(event) { <del> if (!touchmove && !didSomething) { <add> if (!touchmove) { <ide> this.player_.reportUserActivity(); <ide> } <ide> }));
1
Ruby
Ruby
add more examples to #titleize
ea16e0f716d150af98dbd612a8c730dad5bb2924
<ide><path>activesupport/lib/active_support/inflector/methods.rb <ide> def humanize(lower_case_and_underscored_word) <ide> # +titleize+ is also aliased as as +titlecase+. <ide> # <ide> # Examples: <del> # "man from the boondocks".titleize # => "Man From The Boondocks" <del> # "x-men: the last stand".titleize # => "X Men: The Last Stand" <add> # "man from the boondocks".titleize # => "Man From The Boondocks" <add> # "x-men: the last stand".titleize # => "X Men: The Last Stand" <add> # "TheManWithoutAPast".titleize # => "The Man Without A Past" <add> # "raiders_of_the_lost_ark".titleize # => "Raiders Of The Lost Ark" <ide> def titleize(word) <ide> humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize } <ide> end
1
PHP
PHP
add docblock for runtimeexception
adec8f3b55a7d03305fb8a36b6865206f9a81a8b
<ide><path>src/Illuminate/Foundation/Console/ViewClearCommand.php <ide> public function __construct(Filesystem $files) <ide> * Execute the console command. <ide> * <ide> * @return void <add> * <add> * @throws \RuntimeException <ide> */ <ide> public function handle() <ide> {
1
PHP
PHP
stringify column name in data array
cddaaa45c838d6c4173ecbac3e2a51d50296fb78
<ide><path>tests/TestCase/Database/QueryTest.php <ide> public function testInsertQuoteColumns() <ide> $query->insert([123]) <ide> ->into('articles') <ide> ->values([ <del> 123 => 'mark', <add> '123' => 'mark', <ide> ]); <ide> $result = $query->sql(); <ide> $this->assertQuotedQuery(
1
Text
Text
replace 303 status code with see_other
c487372c4b1c37dc7a796d8a00ed214dc63b4282
<ide><path>guides/source/getting_started.md <ide> class CommentsController < ApplicationController <ide> @article = Article.find(params[:article_id]) <ide> @comment = @article.comments.find(params[:id]) <ide> @comment.destroy <del> redirect_to article_path(@article), status: 303 <add> redirect_to article_path(@article), status: :see_other <ide> end <ide> <ide> private
1
Ruby
Ruby
add a blockuntrustedips middleware
9a9caf646d020e33ccdeac0f9b114acec019b599
<ide><path>actionpack/lib/action_dispatch.rb <ide> module ActionDispatch <ide> end <ide> <ide> autoload_under 'middleware' do <add> autoload :BlockUntrustedIps <ide> autoload :Callbacks <ide> autoload :Cascade <ide> autoload :Cookies <ide><path>actionpack/lib/action_dispatch/middleware/block_untrusted_ips.rb <add>module ActionDispatch <add> class BlockUntrustedIps <add> class SpoofAttackError < StandardError ; end <add> <add> def initialize(app) <add> @app = app <add> end <add> <add> def call(env) <add> if @env['HTTP_X_FORWARDED_FOR'] && @env['HTTP_CLIENT_IP'] <add> remote_ips = @env['HTTP_X_FORWARDED_FOR'].split(',') <add> <add> unless remote_ips.include?(@env['HTTP_CLIENT_IP']) <add> http_client_ip = @env['HTTP_CLIENT_IP'].inspect <add> http_forwarded_for = @env['HTTP_X_FORWARDED_FOR'].inspect <add> <add> raise SpoofAttackError, "IP spoofing attack?!\n " \ <add> "HTTP_CLIENT_IP=#{http_client_ip}\n HTTP_X_FORWARDED_FOR=http_forwarded_for" <add> end <add> end <add> <add> @app.call(env) <add> end <add> end <add>end <ide>\ No newline at end of file
2
Javascript
Javascript
move ember.inspect to ember-metal
2632209ad66c52adbc0f85f6b189382ee53ca83c
<ide><path>packages/ember-metal/lib/utils.js <ide> Ember.typeOf = function(item) { <ide> <ide> return ret; <ide> }; <add> <add>/** <add> Convenience method to inspect an object. This method will attempt to <add> convert the object into a useful string description. <add> <add> It is a pretty simple implementation. If you want something more robust, <add> use something like JSDump: https://github.com/NV/jsDump <add> <add> @method inspect <add> @for Ember <add> @param {Object} obj The object you want to inspect. <add> @return {String} A description of the object <add>*/ <add>Ember.inspect = function(obj) { <add> var type = Ember.typeOf(obj); <add> if (type === 'array') { <add> return '[' + obj + ']'; <add> } <add> if (type !== 'object') { <add> return obj + ''; <add> } <add> <add> var v, ret = []; <add> for(var key in obj) { <add> if (obj.hasOwnProperty(key)) { <add> v = obj[key]; <add> if (v === 'toString') { continue; } // ignore useless items <add> if (Ember.typeOf(v) === 'function') { v = "function() { ... }"; } <add> ret.push(key + ": " + v); <add> } <add> } <add> return "{" + ret.join(", ") + "}"; <add>}; <add> <add> <ide><path>packages/ember-runtime/lib/core.js <ide> Ember.copy = function(obj, deep) { <ide> return _copy(obj, deep, deep ? [] : null, deep ? [] : null); <ide> }; <ide> <del>/** <del> Convenience method to inspect an object. This method will attempt to <del> convert the object into a useful string description. <del> <del> It is a pretty simple implementation. If you want something more robust, <del> use something like JSDump: https://github.com/NV/jsDump <del> <del> @method inspect <del> @for Ember <del> @param {Object} obj The object you want to inspect. <del> @return {String} A description of the object <del>*/ <del>Ember.inspect = function(obj) { <del> var type = Ember.typeOf(obj); <del> if (type === 'array') { <del> return '[' + obj + ']'; <del> } <del> if (type !== 'object') { <del> return obj + ''; <del> } <del> <del> var v, ret = []; <del> for(var key in obj) { <del> if (obj.hasOwnProperty(key)) { <del> v = obj[key]; <del> if (v === 'toString') { continue; } // ignore useless items <del> if (Ember.typeOf(v) === 'function') { v = "function() { ... }"; } <del> ret.push(key + ": " + v); <del> } <del> } <del> return "{" + ret.join(", ") + "}"; <del>}; <del> <ide> /** <ide> Compares two objects, returning true if they are logically equal. This is <ide> a deeper comparison than a simple triple equal. For sets it will compare the <ide><path>packages/ember-runtime/tests/core/inspect_test.js <del>module("Ember.inspect"); <del> <del>var inspect = Ember.inspect; <del> <del>test("strings", function() { <del> equal(inspect("foo"), "foo"); <del>}); <del> <del>test("numbers", function() { <del> equal(inspect(2.6), "2.6"); <del>}); <del> <del>test("null", function() { <del> equal(inspect(null), "null"); <del>}); <del> <del>test("undefined", function() { <del> equal(inspect(undefined), "undefined"); <del>}); <del> <del>test("true", function() { <del> equal(inspect(true), "true"); <del>}); <del> <del>test("false", function() { <del> equal(inspect(false), "false"); <del>}); <del> <del>test("object", function() { <del> equal(inspect({}), "{}"); <del> equal(inspect({ foo: 'bar' }), "{foo: bar}"); <del> equal(inspect({ foo: Ember.K }), "{foo: function() { ... }}"); <del>}); <del> <del>test("array", function() { <del> equal(inspect([1,2,3]), "[1,2,3]"); <del>}); <del> <del>test("regexp", function() { <del> equal(inspect(/regexp/), "/regexp/"); <del>}); <del> <del>test("date", function() { <del> var inspected = inspect(new Date("Sat Apr 30 2011 13:24:11")); <del> ok(inspected.match(/Sat Apr 30/), "The inspected date has its date"); <del> ok(inspected.match(/2011/), "The inspected date has its year"); <del> ok(inspected.match(/13:24:11/), "The inspected date has its time"); <del>});
3
Text
Text
update the contributing.md
2bb6b13685af42655479e6fa71cbb729bbf5faf4
<ide><path>CONTRIBUTING.md <ide> and will thank you for it! <ide> Check that [our issue database](https://github.com/docker/docker/issues) <ide> doesn't already include that problem or suggestion before submitting an issue. <ide> If you find a match, add a quick "+1" or "I have this problem too." Doing this <del>helps prioritize the most common problems and requests. <add>helps prioritize the most common problems and requests. **DO NOT DO THAT** to <add>subscribe to the issue unless you have something meaningful to add to the <add>conversation. The best way to subscribe the issue is by clicking Subscribe <add>button in top right of the page. <ide> <ide> When reporting issues, please include your host OS (Ubuntu 12.04, Fedora 19, <ide> etc). Please include: <ide> <ide> * The output of `uname -a`. <ide> * The output of `docker version`. <del>* The output of `docker -D info`. <add>* The output of `docker info`. <ide> <ide> Please also include the steps required to reproduce the problem if possible and <ide> applicable. This information will help us review and fix your issue faster.
1
Javascript
Javascript
add a collada exporter link to the docs
7c0f31b6bce1b5a4e951bd5a0b7d46d0650c7bac
<ide><path>docs/list.js <ide> var list = { <ide> <ide> "Exporters": { <ide> "GLTFExporter": "examples/exporters/GLTFExporter", <del> "PLYExporter": "examples/exporters/PLYExporter" <add> "PLYExporter": "examples/exporters/PLYExporter", <add> "ColladaExporter": "examples/exporters/ColladaExporter" <ide> }, <ide> <ide> "Plugins": {
1
Java
Java
fix observable javadoc
54c281a3d106da4f3bcf2f59271b1c9034683a60
<ide><path>src/main/java/io/reactivex/Observable.java <ide> public static <T> Observable<T> fromCallable(Callable<? extends T> supplier) { <ide> * <p> <ide> * <em>Important note:</em> This ObservableSource is blocking; you cannot dispose it. <ide> * <p> <del> * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the <del> * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. <add> * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the <add> * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. <ide> * <dl> <ide> * <dt><b>Scheduler:</b></dt> <ide> * <dd>{@code fromFuture} does not operate by default on a particular {@link Scheduler}.</dd> <ide> public static <T> Observable<T> fromFuture(Future<? extends T> future) { <ide> * return value of the {@link Future#get} method of that object, by passing the object into the {@code from} <ide> * method. <ide> * <p> <del> * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the <del> * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. <add> * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the <add> * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. <ide> * <p> <ide> * <em>Important note:</em> This ObservableSource is blocking; you cannot dispose it. <ide> * <dl> <ide> public static <T> Observable<T> fromFuture(Future<? extends T> future, long time <ide> * return value of the {@link Future#get} method of that object, by passing the object into the {@code from} <ide> * method. <ide> * <p> <del> * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the <del> * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. <add> * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the <add> * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. <ide> * <p> <ide> * <em>Important note:</em> This ObservableSource is blocking; you cannot dispose it. <ide> * <dl> <ide> public static <T> Observable<T> fromFuture(Future<? extends T> future, long time <ide> * return value of the {@link Future#get} method of that object, by passing the object into the {@code from} <ide> * method. <ide> * <p> <del> * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the <del> * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. <add> * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the <add> * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. <ide> * <dl> <ide> * <dt><b>Scheduler:</b></dt> <ide> * <dd>You specify which {@link Scheduler} this operator will use.</dd> <ide> public final Observable<T> delaySubscription(long delay, TimeUnit unit, Schedule <ide> * returned Observable cancels the flow and terminates with that type of terminal event: <ide> * <pre><code> <ide> * Observable.just(createOnNext(1), createOnComplete(), createOnNext(2)) <del> * .doOnCancel(() -&gt; System.out.println("Cancelled!")); <add> * .doOnDispose(() -&gt; System.out.println("Cancelled!")); <ide> * .test() <ide> * .assertResult(1); <ide> * </code></pre>
1
Ruby
Ruby
add a class for splitting up rake commands
7f698da8878b141c5324b2419d73570f507ef08f
<ide><path>railties/lib/rails/test_unit/sub_test_task.rb <ide> <ide> module Rails <ide> class TestTask < Rake::TestTask # :nodoc: all <add> class TestInfo <add> def initialize(tasks) <add> @tasks = tasks <add> end <add> <add> def files <add> @tasks.find_all { |t| File.file?(t) && !File.directory?(t) } <add> end <add> <add> def tasks <add> @tasks - files - opt_names <add> end <add> <add> def opts <add> opts = opt_names <add> if opts.any? <add> "-n #{opts.join ' '}" <add> end <add> end <add> <add> private <add> <add> def opt_names <add> (@tasks - files).reject { |t| task_defined? t } <add> end <add> <add> def task_defined?(task) <add> Rake::Task.task_defined? task <add> end <add> end <add> <add> def self.test_info(tasks) <add> TestInfo.new tasks <add> end <add> <ide> def initialize(name = :test) <ide> super <ide> @libs << "test" # lib *and* test seem like a better default <ide><path>railties/test/test_info_test.rb <add>require 'abstract_unit' <add>require 'rails/test_unit/sub_test_task' <add> <add>module Rails <add> class TestInfoTest < ActiveSupport::TestCase <add> def test_test_files <add> info = new_test_info ['test'] <add> assert_predicate info.files, :empty? <add> assert_nil info.opts <add> assert_equal ['test'], info.tasks <add> end <add> <add> def test_with_file <add> info = new_test_info ['test', __FILE__] <add> assert_equal [__FILE__], info.files <add> assert_nil info.opts <add> assert_equal ['test'], info.tasks <add> end <add> <add> def test_with_opts <add> info = new_test_info ['test', __FILE__, '/foo/'] <add> assert_equal [__FILE__], info.files <add> assert_equal '-n /foo/', info.opts <add> assert_equal ['test'], info.tasks <add> end <add> <add> def new_test_info(tasks) <add> Class.new(TestTask::TestInfo) { <add> def task_defined?(task) <add> task == "test" <add> end <add> }.new tasks <add> end <add> end <add>end
2
Python
Python
add urlretrieve docstring
68bde67d0a73825f9de15bb2a1eef01aaf405fa0
<ide><path>keras/utils/data_utils.py <ide> from ..utils.generic_utils import Progbar <ide> <ide> <del># Under Python 2, 'urlretrieve' relies on FancyURLopener from legacy <del># urllib module, known to have issues with proxy management <ide> if sys.version_info[0] == 2: <ide> def urlretrieve(url, filename, reporthook=None, data=None): <add> """Replacement for `urlretrive` for Python 2. <add> <add> Under Python 2, `urlretrieve` relies on `FancyURLopener` from legacy <add> `urllib` module, known to have issues with proxy management. <add> <add> # Arguments <add> url: url to retrieve. <add> filename: where to store the retrieved data locally. <add> reporthook: a hook function that will be called once <add> on establishment of the network connection and once <add> after each block read thereafter. <add> The hook will be passed three arguments; <add> a count of blocks transferred so far, <add> a block size in bytes, and the total size of the file. <add> data: `data` argument passed to `urlopen`. <add> """ <ide> def chunk_read(response, chunk_size=8192, reporthook=None): <ide> total_size = response.info().get('Content-Length').strip() <ide> total_size = int(total_size)
1
PHP
PHP
fix duplicate items in habtm associations
2097d5a968e57ea72bbe1710b667e20130374402
<ide><path>lib/Cake/Model/Datasource/DboSource.php <ide> protected function _mergeAssociation(&$data, &$merge, $association, $type, $self <ide> } <ide> } else { <ide> foreach ($merge as $i => $row) { <add> $insert = array(); <ide> if (count($row) === 1) { <del> if (empty($data[$association]) || (isset($data[$association]) && !in_array($row[$association], $data[$association]))) { <del> $data[$association][] = $row[$association]; <del> } <del> } elseif (!empty($row)) { <del> $tmp = array_merge($row[$association], $row); <del> unset($tmp[$association]); <del> $data[$association][] = $tmp; <add> $insert = $row[$association]; <add> } elseif (isset($row[$association])) { <add> $insert = array_merge($row[$association], $row); <add> unset($insert[$association]); <add> } <add> <add> if (empty($data[$association]) || (isset($data[$association]) && !in_array($insert, $data[$association], true))) { <add> $data[$association][] = $insert; <ide> } <ide> } <ide> }
1
Ruby
Ruby
remove unnecessary flatten! method call
586c346059f263aa72242a61f863396c56181c8f
<ide><path>actionpack/lib/action_dispatch/journey/router.rb <ide> def find_routes req <ide> <ide> def get_routes_as_head(routes) <ide> precedence = (routes.map(&:precedence).max || 0) + 1 <del> routes = routes.select { |r| <add> routes.select { |r| <ide> r.verb === "GET" && !(r.verb === "HEAD") <ide> }.map! { |r| <ide> Route.new(r.name, <ide> def get_routes_as_head(routes) <ide> route.precedence = r.precedence + precedence <ide> end <ide> } <del> routes.flatten! <del> routes <ide> end <ide> end <ide> end
1
Mixed
Java
add ability to disable scroll on android viewpager
5a93877673105ca13c9e587796432881e26a0de7
<ide><path>Libraries/Components/ViewPager/ViewPagerAndroid.android.js <ide> var ViewPagerAndroid = React.createClass({ <ide> 'none', // default <ide> 'on-drag', <ide> ]), <add> <add> /** <add> * When false, the content does not scroll. <add> * The default value is true. <add> */ <add> scrollEnabled: React.PropTypes.bool, <ide> }, <ide> <ide> componentDidMount: function() { <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPager.java <ide> public void onPageScrollStateChanged(int state) { <ide> <ide> private final EventDispatcher mEventDispatcher; <ide> private boolean mIsCurrentItemFromJs; <add> private boolean mScrollEnabled = true; <ide> <ide> public ReactViewPager(ReactContext reactContext) { <ide> super(reactContext); <ide> public Adapter getAdapter() { <ide> <ide> @Override <ide> public boolean onInterceptTouchEvent(MotionEvent ev) { <del> if (super.onInterceptTouchEvent(ev)) { <add> if (mScrollEnabled && super.onInterceptTouchEvent(ev)) { <ide> NativeGestureUtil.notifyNativeGestureStarted(this, ev); <ide> return true; <ide> } <ide> return false; <ide> } <ide> <add> @Override <add> public boolean onTouchEvent(MotionEvent ev) { <add> if (!mScrollEnabled) { <add> return false; <add> } <add> return super.onTouchEvent(ev); <add> } <add> <ide> public void setCurrentItemFromJs(int item, boolean animated) { <ide> mIsCurrentItemFromJs = true; <ide> setCurrentItem(item, animated); <ide> mIsCurrentItemFromJs = false; <ide> } <ide> <add> public void setScrollEnabled(boolean scrollEnabled) { <add> mScrollEnabled = scrollEnabled; <add> } <add> <ide> /*package*/ void addViewToAdapter(View child, int index) { <ide> getAdapter().addView(child, index); <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPagerManager.java <ide> protected ReactViewPager createViewInstance(ThemedReactContext reactContext) { <ide> return new ReactViewPager(reactContext); <ide> } <ide> <add> <add> @ReactProp(name = "scrollEnabled", defaultBoolean = true) <add> public void setScrollEnabled(ReactViewPager viewPager, boolean value) { <add> viewPager.setScrollEnabled(value); <add> } <add> <ide> @Override <ide> public boolean needsCustomLayoutForChildren() { <ide> return true;
3
Javascript
Javascript
fix dom fixture for 16.0.0
4a26b90cfa4a4f2b70dfa704b9706bb1c5fa26b4
<ide><path>fixtures/dom/src/react-loader.js <ide> export default function loadReact() { <ide> let version = query.version || 'local'; <ide> <ide> if (version !== 'local') { <del> REACT_PATH = 'https://unpkg.com/react@' + version + '/dist/react.js'; <del> DOM_PATH = 'https://unpkg.com/react-dom@' + version + '/dist/react-dom.js'; <add> if (parseInt(version, 10) >= 16) { <add> REACT_PATH = <add> 'https://unpkg.com/react@' + version + '/umd/react.development.js'; <add> DOM_PATH = <add> 'https://unpkg.com/react-dom@' + <add> version + <add> '/umd/react-dom.development.js'; <add> } else { <add> REACT_PATH = 'https://unpkg.com/react@' + version + '/dist/react.js'; <add> DOM_PATH = <add> 'https://unpkg.com/react-dom@' + version + '/dist/react-dom.js'; <add> } <ide> } <ide> <ide> const needsReactDOM = version === 'local' || parseFloat(version, 10) > 0.13;
1
Javascript
Javascript
fix display of checkpoints
9a18344dad0d210b17c8a746e44c2fb0149784b8
<ide><path>server/boot/user.js <ide> module.exports = function(app) { <ide> }); <ide> <ide> const waypoints = profileUser.completedChallenges.filter(function(obj) { <del> return (obj.name || '').match(/^Waypoint/i); <add> return (obj.name || '').match(/^Waypoint|^Checkpoint/i); <ide> }); <ide> <ide> res.render('account/show', {
1
Javascript
Javascript
replace deprecated method
8876514cdba5961094c6bfcf25829253a9b9f831
<ide><path>lib/Compilation.js <ide> const ChunkTemplate = require("./ChunkTemplate"); <ide> const HotUpdateChunkTemplate = require("./HotUpdateChunkTemplate"); <ide> const ModuleTemplate = require("./ModuleTemplate"); <ide> const RuntimeTemplate = require("./RuntimeTemplate"); <del>const Dependency = require("./Dependency"); <ide> const ChunkRenderError = require("./ChunkRenderError"); <ide> const AsyncDependencyToInitialChunkError = require("./AsyncDependencyToInitialChunkError"); <ide> const Stats = require("./Stats"); <ide> const Queue = require("./util/Queue"); <ide> const SortableSet = require("./util/SortableSet"); <ide> const GraphHelpers = require("./GraphHelpers"); <ide> const ModuleDependency = require("./dependencies/ModuleDependency"); <add>const compareLocations = require("./compareLocations"); <ide> <ide> /** @typedef {import("./Module")} Module */ <ide> /** @typedef {import("./Compiler")} Compiler */ <ide> class Compilation extends Tapable { <ide> war.dependencies = dependencies; <ide> this.warnings.push(war); <ide> } <del> module.dependencies.sort(Dependency.compare); <add> module.dependencies.sort((a, b) => compareLocations(a.loc, b.loc)); <ide> if (error) { <ide> this.hooks.failedModule.call(module, error); <ide> return callback(error);
1
Go
Go
update the help with push/pull
e4f9a0dca0a3eb9fd762ef502d40a089ed16acd4
<ide><path>commands.go <ide> func (srv *Server) Help() string { <ide> {"logs", "Fetch the logs of a container"}, <ide> {"port", "Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"}, <ide> {"ps", "List containers"}, <add> {"pull", "Pull an image or a repository to the docker registry server"}, <add> {"push", "Push an image or a repository to the docker registry server"}, <ide> {"restart", "Restart a running container"}, <ide> {"rm", "Remove a container"}, <ide> {"rmi", "Remove an image"},
1
PHP
PHP
apply fixes from styleci
030e9a886bfea56f90dc911471f55b5b4c36e3ce
<ide><path>tests/Cache/CacheRepositoryTest.php <ide> public function testRememberMethodCallsPutAndReturnsDefault() <ide> return 'qux'; <ide> }); <ide> $this->assertSame('qux', $result); <del> <add> <ide> /* <ide> * Use a callable... <ide> */
1
Text
Text
reflect changes introduced in d2ffcd9 in docs
0099b5e68cc76080f01e9150d3a3b86e0cb2b741
<ide><path>docs/sources/userguide/dockerlinks.md <ide> earlier. The `--link` flag takes the form: <ide> Where `name` is the name of the container we're linking to and `alias` is an <ide> alias for the link name. You'll see how that alias gets used shortly. <ide> <del>Next, look at your linked containers using `docker ps`. <add>Next, look at the names of your linked containers by filtering the full output of <add>`docker ps` to the last column (NAMES) using `docker ps --no-trunc | awk '{print $NF}'`. <ide> <del> $ sudo docker ps <del> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES <del> 349169744e49 training/postgres:latest su postgres -c '/usr About a minute ago Up About a minute 5432/tcp db, web/db <del> aed84ee21bde training/webapp:latest python app.py 16 hours ago Up 2 minutes 0.0.0.0:49154->5000/tcp web <add> $ sudo docker ps --no-trunc | awk '{print $NF}' <add> NAMES <add> db, web/db <add> web <ide> <ide> You can see your named containers, `db` and `web`, and you can see that the `db` <ide> container also shows `web/db` in the `NAMES` column. This tells you that the
1
Javascript
Javascript
remove module.exports from client bundles
d6c7050816ca364aa42cf82a4b583c2fa7086f9a
<ide><path>build/webpack.js <ide> export default async function getBaseWebpackConfig (dir: string, {dev = false, i <ide> } <ide> return '[name]' <ide> }, <del> libraryTarget: 'commonjs2', <add> libraryTarget: isServer ? 'commonjs2' : 'jsonp', <ide> hotUpdateChunkFilename: 'static/webpack/[id].[hash].hot-update.js', <ide> hotUpdateMainFilename: 'static/webpack/[hash].hot-update.json', <ide> // This saves chunks with the name given via `import()` <ide><path>server/document.js <ide> export class NextScript extends Component { <ide> <ide> return ` <ide> __NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)} <del> module={} <ide> __NEXT_LOADED_PAGES__ = [] <ide> <ide> __NEXT_REGISTER_PAGE = function (route, fn) {
2
Go
Go
fix panic in parsing /etc/os-release
7b102dc11486539bc661a4d858e2de3ce3f46493
<ide><path>pkg/parsers/operatingsystem/operatingsystem_linux.go <ide> package operatingsystem <ide> <ide> import ( <add> "bufio" <ide> "bytes" <del> "errors" <add> "fmt" <ide> "io/ioutil" <add> "os" <add> "strings" <add> <add> "github.com/mattn/go-shellwords" <ide> ) <ide> <ide> var ( <ide> var ( <ide> <ide> // GetOperatingSystem gets the name of the current operating system. <ide> func GetOperatingSystem() (string, error) { <del> b, err := ioutil.ReadFile(etcOsRelease) <add> osReleaseFile, err := os.Open(etcOsRelease) <ide> if err != nil { <ide> return "", err <ide> } <del> if i := bytes.Index(b, []byte("PRETTY_NAME")); i >= 0 { <del> b = b[i+13:] <del> return string(b[:bytes.IndexByte(b, '"')]), nil <add> defer osReleaseFile.Close() <add> <add> var prettyName string <add> scanner := bufio.NewScanner(osReleaseFile) <add> for scanner.Scan() { <add> line := scanner.Text() <add> if strings.HasPrefix(line, "PRETTY_NAME=") { <add> data := strings.SplitN(line, "=", 2) <add> prettyNames, err := shellwords.Parse(data[1]) <add> if err != nil { <add> return "", fmt.Errorf("PRETTY_NAME is invalid: %s", err.Error()) <add> } <add> if len(prettyNames) != 1 { <add> return "", fmt.Errorf("PRETTY_NAME needs to be enclosed by quotes if they have spaces: %s", data[1]) <add> } <add> prettyName = prettyNames[0] <add> } <add> } <add> if prettyName != "" { <add> return prettyName, nil <ide> } <del> return "", errors.New("PRETTY_NAME not found") <add> // If not set, defaults to PRETTY_NAME="Linux" <add> // c.f. http://www.freedesktop.org/software/systemd/man/os-release.html <add> return "Linux", nil <ide> } <ide> <ide> // IsContainerized returns true if we are running inside a container. <ide><path>pkg/parsers/operatingsystem/operatingsystem_unix_test.go <ide> import ( <ide> ) <ide> <ide> func TestGetOperatingSystem(t *testing.T) { <del> var ( <del> backup = etcOsRelease <del> ubuntuTrusty = []byte(`NAME="Ubuntu" <add> var backup = etcOsRelease <add> <add> invalids := []struct { <add> content string <add> errorExpected string <add> }{ <add> { <add> `PRETTY_NAME=Source Mage GNU/Linux <add>PRETTY_NAME=Ubuntu 14.04.LTS`, <add> "PRETTY_NAME needs to be enclosed by quotes if they have spaces: Source Mage GNU/Linux", <add> }, <add> { <add> `PRETTY_NAME="Ubuntu Linux <add>PRETTY_NAME=Ubuntu 14.04.LTS`, <add> "PRETTY_NAME is invalid: invalid command line string", <add> }, <add> { <add> `PRETTY_NAME=Ubuntu' <add>PRETTY_NAME=Ubuntu 14.04.LTS`, <add> "PRETTY_NAME is invalid: invalid command line string", <add> }, <add> { <add> `PRETTY_NAME' <add>PRETTY_NAME=Ubuntu 14.04.LTS`, <add> "PRETTY_NAME needs to be enclosed by quotes if they have spaces: Ubuntu 14.04.LTS", <add> }, <add> } <add> <add> valids := []struct { <add> content string <add> expected string <add> }{ <add> { <add> `NAME="Ubuntu" <add>PRETTY_NAME_AGAIN="Ubuntu 14.04.LTS" <add>VERSION="14.04, Trusty Tahr" <add>ID=ubuntu <add>ID_LIKE=debian <add>VERSION_ID="14.04" <add>HOME_URL="http://www.ubuntu.com/" <add>SUPPORT_URL="http://help.ubuntu.com/" <add>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`, <add> "Linux", <add> }, <add> { <add> `NAME="Ubuntu" <ide> VERSION="14.04, Trusty Tahr" <ide> ID=ubuntu <ide> ID_LIKE=debian <del>PRETTY_NAME="Ubuntu 14.04 LTS" <ide> VERSION_ID="14.04" <ide> HOME_URL="http://www.ubuntu.com/" <ide> SUPPORT_URL="http://help.ubuntu.com/" <del>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`) <del> gentoo = []byte(`NAME=Gentoo <add>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`, <add> "Linux", <add> }, <add> { <add> `NAME=Gentoo <ide> ID=gentoo <ide> PRETTY_NAME="Gentoo/Linux" <ide> ANSI_COLOR="1;32" <ide> HOME_URL="http://www.gentoo.org/" <ide> SUPPORT_URL="http://www.gentoo.org/main/en/support.xml" <ide> BUG_REPORT_URL="https://bugs.gentoo.org/" <del>`) <del> noPrettyName = []byte(`NAME="Ubuntu" <add>`, <add> "Gentoo/Linux", <add> }, <add> { <add> `NAME="Ubuntu" <ide> VERSION="14.04, Trusty Tahr" <ide> ID=ubuntu <ide> ID_LIKE=debian <add>PRETTY_NAME="Ubuntu 14.04 LTS" <ide> VERSION_ID="14.04" <ide> HOME_URL="http://www.ubuntu.com/" <ide> SUPPORT_URL="http://help.ubuntu.com/" <del>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`) <del> ) <add>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`, <add> "Ubuntu 14.04 LTS", <add> }, <add> { <add> `NAME="Ubuntu" <add>VERSION="14.04, Trusty Tahr" <add>ID=ubuntu <add>ID_LIKE=debian <add>PRETTY_NAME='Ubuntu 14.04 LTS'`, <add> "Ubuntu 14.04 LTS", <add> }, <add> { <add> `PRETTY_NAME=Source <add>NAME="Source Mage"`, <add> "Source", <add> }, <add> { <add> `PRETTY_NAME=Source <add>PRETTY_NAME="Source Mage"`, <add> "Source Mage", <add> }, <add> } <ide> <ide> dir := os.TempDir() <ide> etcOsRelease = filepath.Join(dir, "etcOsRelease") <ide> BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`) <ide> etcOsRelease = backup <ide> }() <ide> <del> for expect, osRelease := range map[string][]byte{ <del> "Ubuntu 14.04 LTS": ubuntuTrusty, <del> "Gentoo/Linux": gentoo, <del> "": noPrettyName, <del> } { <del> if err := ioutil.WriteFile(etcOsRelease, osRelease, 0600); err != nil { <add> for _, elt := range invalids { <add> if err := ioutil.WriteFile(etcOsRelease, []byte(elt.content), 0600); err != nil { <add> t.Fatalf("failed to write to %s: %v", etcOsRelease, err) <add> } <add> s, err := GetOperatingSystem() <add> if err == nil || err.Error() != elt.errorExpected { <add> t.Fatalf("Expected an error %q, got %q (err: %v)", elt.errorExpected, s, err) <add> } <add> } <add> <add> for _, elt := range valids { <add> if err := ioutil.WriteFile(etcOsRelease, []byte(elt.content), 0600); err != nil { <ide> t.Fatalf("failed to write to %s: %v", etcOsRelease, err) <ide> } <ide> s, err := GetOperatingSystem() <del> if s != expect { <del> if expect == "" { <del> t.Fatalf("Expected error 'PRETTY_NAME not found', but got %v", err) <del> } else { <del> t.Fatalf("Expected '%s', but got '%s'. Err=%v", expect, s, err) <del> } <add> if err != nil || s != elt.expected { <add> t.Fatalf("Expected %q, got %q (err: %v)", elt.expected, s, err) <ide> } <ide> } <ide> }
2
Ruby
Ruby
modify assert_template to use instrumentation
947f86c699b33bd44703b3554db58e4cfca37c86
<ide><path>actionpack/lib/action_controller/test_case.rb <ide> require 'action_view/test_case' <ide> <ide> module ActionController <add> module TemplateAssertions <add> extend ActiveSupport::Concern <add> <add> included do <add> setup :setup_subscriptions <add> teardown :teardown_subscriptions <add> end <add> <add> def setup_subscriptions <add> @partials = Hash.new(0) <add> @templates = Hash.new(0) <add> ActiveSupport::Notifications.subscribe("action_view.slow_render_template") do |name, start, finish, id, payload| <add> path = payload[:virtual_path] <add> next unless path <add> partial = path =~ /^.*\/_[^\/]*$/ <add> if partial <add> @partials[path] += 1 <add> @partials[path.split("/").last] += 1 <add> @templates[path] += 1 <add> else <add> @templates[path] += 1 <add> end <add> end <add> end <add> <add> def teardown_subscriptions <add> ActiveSupport::Notifications.unsubscribe("action_view.slow_render_template") <add> end <add> <add> # Asserts that the request was rendered with the appropriate template file or partials <add> # <add> # ==== Examples <add> # <add> # # assert that the "new" view template was rendered <add> # assert_template "new" <add> # <add> # # assert that the "_customer" partial was rendered twice <add> # assert_template :partial => '_customer', :count => 2 <add> # <add> # # assert that no partials were rendered <add> # assert_template :partial => false <add> # <add> def assert_template(options = {}, message = nil) <add> validate_request! <add> <add> case options <add> when NilClass, String <add> rendered = @templates <add> msg = build_message(message, <add> "expecting <?> but rendering with <?>", <add> options, rendered.keys.join(', ')) <add> assert_block(msg) do <add> if options.nil? <add> @templates.blank? <add> else <add> rendered.any? { |t,num| t.match(options) } <add> end <add> end <add> when Hash <add> if expected_partial = options[:partial] <add> if expected_count = options[:count] <add> actual_count = @partials[expected_partial] <add> # actual_count = found.nil? ? 0 : found[1] <add> msg = build_message(message, <add> "expecting ? to be rendered ? time(s) but rendered ? time(s)", <add> expected_partial, expected_count, actual_count) <add> assert(actual_count == expected_count.to_i, msg) <add> else <add> msg = build_message(message, <add> "expecting partial <?> but action rendered <?>", <add> options[:partial], @partials.keys) <add> assert(@partials.include?(expected_partial), msg) <add> end <add> else <add> assert @partials.empty?, <add> "Expected no partials to be rendered" <add> end <add> end <add> end <add> end <add> <ide> class TestRequest < ActionDispatch::TestRequest #:nodoc: <ide> def initialize(env = {}) <ide> super <ide> def initialize(session = {}) <ide> # assert_redirected_to page_url(:title => 'foo') <ide> class TestCase < ActiveSupport::TestCase <ide> include ActionDispatch::TestProcess <add> include ActionController::TemplateAssertions <ide> <ide> # Executes a request simulating GET HTTP method and set/volley the response <ide> def get(action, parameters = nil, session = nil, flash = nil) <ide><path>actionpack/lib/action_dispatch/testing/assertions/response.rb <ide> def assert_redirected_to(options = {}, message=nil) <ide> end <ide> end <ide> <del> # Asserts that the request was rendered with the appropriate template file or partials <del> # <del> # ==== Examples <del> # <del> # # assert that the "new" view template was rendered <del> # assert_template "new" <del> # <del> # # assert that the "_customer" partial was rendered twice <del> # assert_template :partial => '_customer', :count => 2 <del> # <del> # # assert that no partials were rendered <del> # assert_template :partial => false <del> # <del> def assert_template(options = {}, message = nil) <del> validate_request! <del> <del> case options <del> when NilClass, String <del> rendered = (@controller.template.rendered[:template] || []).map { |t| t.identifier } <del> msg = build_message(message, <del> "expecting <?> but rendering with <?>", <del> options, rendered.join(', ')) <del> assert_block(msg) do <del> if options.nil? <del> @controller.template.rendered[:template].blank? <del> else <del> rendered.any? { |t| t.match(options) } <del> end <del> end <del> when Hash <del> if expected_partial = options[:partial] <del> partials = @controller.template.rendered[:partials] <del> if expected_count = options[:count] <del> found = partials.detect { |p, _| p.identifier.match(expected_partial) } <del> actual_count = found.nil? ? 0 : found.second <del> msg = build_message(message, <del> "expecting ? to be rendered ? time(s) but rendered ? time(s)", <del> expected_partial, expected_count, actual_count) <del> assert(actual_count == expected_count.to_i, msg) <del> else <del> msg = build_message(message, <del> "expecting partial <?> but action rendered <?>", <del> options[:partial], partials.keys) <del> assert(partials.keys.any? { |p| p.identifier.match(expected_partial) }, msg) <del> end <del> else <del> assert @controller.template.rendered[:partials].empty?, <del> "Expected no partials to be rendered" <del> end <del> end <del> end <del> <ide> private <ide> # Proxy to to_param if the object will respond to it. <ide> def parameterize(value) <ide><path>actionpack/lib/action_view/template.rb <ide> def initialize(source, identifier, handler, details) <ide> end <ide> <ide> def render(view, locals, &block) <del> method_name = compile(locals, view) <del> view.send(method_name, locals, &block) <add> # TODO: Revisit this name <add> # This is only slow if it's being listened to. Do not instrument this in production. <add> ActiveSupport::Notifications.instrument("action_view.slow_render_template", :virtual_path => @virtual_path) do <add> method_name = compile(locals, view) <add> view.send(method_name, locals, &block) <add> end <ide> rescue Exception => e <ide> if e.is_a?(Template::Error) <ide> e.sub_template_of(self) <ide><path>actionpack/lib/action_view/test_case.rb <ide> def initialize <ide> end <ide> <ide> include ActionDispatch::Assertions, ActionDispatch::TestProcess <add> include ActionController::TemplateAssertions <ide> include ActionView::Context <ide> <ide> include ActionController::PolymorphicRoutes <ide><path>actionpack/test/abstract_unit.rb <ide> class TestCase <ide> setup do <ide> @router = SharedTestRoutes <ide> end <del> <del> def assert_template(options = {}, message = nil) <del> validate_request! <del> <del> hax = @controller.view_context.instance_variable_get(:@_rendered) <del> <del> case options <del> when NilClass, String <del> rendered = (hax[:template] || []).map { |t| t.identifier } <del> msg = build_message(message, <del> "expecting <?> but rendering with <?>", <del> options, rendered.join(', ')) <del> assert_block(msg) do <del> if options.nil? <del> hax[:template].blank? <del> else <del> rendered.any? { |t| t.match(options) } <del> end <del> end <del> when Hash <del> if expected_partial = options[:partial] <del> partials = hax[:partials] <del> if expected_count = options[:count] <del> found = partials.detect { |p, _| p.identifier.match(expected_partial) } <del> actual_count = found.nil? ? 0 : found[1] <del> msg = build_message(message, <del> "expecting ? to be rendered ? time(s) but rendered ? time(s)", <del> expected_partial, expected_count, actual_count) <del> assert(actual_count == expected_count.to_i, msg) <del> else <del> msg = build_message(message, <del> "expecting partial <?> but action rendered <?>", <del> options[:partial], partials.keys) <del> assert(partials.keys.any? { |p| p.identifier.match(expected_partial) }, msg) <del> end <del> else <del> assert hax[:partials].empty?, <del> "Expected no partials to be rendered" <del> end <del> end <del> end <ide> end <ide> end <ide>
5
Ruby
Ruby
allow wildcard entries for launchctl
33d3a5d7284c30f326d0f9006415d2a47ff6acf9
<ide><path>Library/Homebrew/cask/artifact/abstract_uninstall.rb <ide> def uninstall_early_script(directives, **options) <ide> # :launchctl must come before :quit/:signal for cases where app would instantly re-launch <ide> def uninstall_launchctl(*services, command: nil, **_) <ide> booleans = [false, true] <add> <add> all_services = [] <add> <add> # if launchctl item contains a wildcard, find matching process(es) <ide> services.each do |service| <add> all_services.push(service) <add> next unless /\*/.match?(service) <add> <add> find_launchctl_with_wildcard(service) <add> .map { |_, _, id| id } <add> .each do |match| <add> all_services.push(match) <add> end <add> end <add> <add> all_services.each do |service| <ide> ohai "Removing launchctl service #{service}" <ide> booleans.each do |with_sudo| <ide> plist_status = command.run( <ide> def uninstall_login_item(*login_items, command: nil, upgrade: false, **_) <ide> end <ide> end <ide> <add> def find_launchctl_with_wildcard(search) <add> system_command!("/bin/launchctl", args: ["list"]) <add> .stdout.lines.drop(1) <add> .map { |line| line.chomp.split("\t") } <add> .map { |pid, state, id| [pid.to_i, state.to_i, id] } <add> .select do |(pid, _, id)| <add> pid.nonzero? && /\A#{Regexp.escape(search).gsub("\\*", ".*")}\Z/.match?(id) <add> end <add> end <add> <ide> # :kext should be unloaded before attempting to delete the relevant file <ide> def uninstall_kext(*kexts, command: nil, **_) <ide> kexts.each do |kext|
1
Javascript
Javascript
fix a bug when setting extent
f176785b83d90df27580cb425e91e4bc686a1867
<ide><path>d3.js <ide> d3.svg.brush = function() { <ide> .attr("width", 6) <ide> .attr("height", 6) <ide> .style("visibility", "hidden") <del> .style("pointer-events", brush.empty() ? "none" : "all") <ide> .style("cursor", function(d) { return d3_svg_brushCursor[d]; }); <ide> <add> // Update the resizers. <add> tz.style("pointer-events", brush.empty() ? "none" : "all"); <add> <ide> // Remove any superfluous resizers. <ide> tz.exit().remove(); <ide> <ide><path>d3.min.js <ide> (function(){function e(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function f(a){return Array.prototype.slice.call(a)}function i(){return this}function j(a,b,c){return function(){var d=c.apply(b,arguments);return arguments.length?a:d}}function k(a){return a!=null&&!isNaN(a)}function l(a){return a.length}function m(a){return a==null}function n(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function q(){}function r(){function c(){var b=a,c=-1,d=b.length,e;while(++c<d)(e=b[c].on)&&e.apply(this,arguments)}var a=[],b={};return c.on=function(d,e){var f,g;if(arguments.length<2)return(f=b[d])&&f.on;if(f=b[d])f.on=null,a=a.slice(0,g=a.indexOf(f)).concat(a.slice(g+1)),delete b[d];return e&&a.push(b[d]={on:e}),c},c}function u(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function v(a){return a+""}function w(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 y(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function D(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function E(a){return function(b){return 1-a(1-b)}}function F(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function G(a){return a}function H(a){return function(b){return Math.pow(b,a)}}function I(a){return 1-Math.cos(a*Math.PI/2)}function J(a){return Math.pow(2,10*(a-1))}function K(a){return 1-Math.sqrt(1-a*a)}function L(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function M(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function N(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 O(){d3.event.stopPropagation(),d3.event.preventDefault()}function Q(a){return a=="transform"?d3.interpolateTransform:d3.interpolate}function R(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function S(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function T(a,b,c){return new U(a,b,c)}function U(a,b,c){this.r=a,this.g=b,this.b=c}function V(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function W(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(Y(h[0]),Y(h[1]),Y(h[2]))}}return(i=Z[a])?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)),b(d,e,f))}function X(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;return 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,_(g,h,i)}function Y(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function _(a,b,c){return new ba(a,b,c)}function ba(a,b,c){this.h=a,this.s=b,this.l=c}function bb(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return 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,T(g(a+120),g(a),g(a-120))}function bc(a){return h(a,bi),a}function bj(a){return function(){return bd(a,this)}}function bk(a){return function(){return be(a,this)}}function bm(a,b){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=n(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=n(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}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;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bn(a){return{__data__:a}}function bo(a){return function(){return bh(this,a)}}function bp(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function br(a){return h(a,bs),a}function bt(a,b,c){h(a,bx);var d={},e=d3.dispatch("start","end"),f=bA;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d[b]:(c==null?delete d[b]:d[b]=c,a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bB.call(a,b):(e.on(b,c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){if(o.active>b)return r();o.active=b;for(var f in d)(f=d[f].call(l,h,i))&&k.push(f);return e.start.call(l,h,i),q(a)||d3.timer(q,0,c),1}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bz=b,e.end.call(l,h,i),bz=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bv(a,b,c){return c!=""&&bu}function bw(a,b){function d(a,d,e){var f=b.call(this,a,d);return f==null?e!=""&&bu:e!=f&&c(e,f)}function e(a,d,e){return e!=b&&c(e,b)}var c=Q(a);return typeof b=="function"?d:b==null?bv:(b+="",e)}function bB(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 bF(){var a,b=Date.now(),c=bC;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bG()-b;d>24?(isFinite(d)&&(clearTimeout(bE),bE=setTimeout(bF,d)),bD=0):(bD=1,bH(bF))}function bG(){var a=null,b=bC,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bC=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bI(a){var b=[a.a,a.b],c=[a.c,a.d],d=bK(b),e=bJ(b,c),f=bK(bL(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*bM,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*bM:0}function bJ(a,b){return a[0]*b[0]+a[1]*b[1]}function bK(a){var b=Math.sqrt(bJ(a,a));return b&&(a[0]/=b,a[1]/=b),b}function bL(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function bN(){}function bO(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bP(a){return a.rangeExtent?a.rangeExtent():bO(a.range())}function bQ(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bR(){return Math}function bS(a,b,c,d){function g(){var g=a.length==2?bY:bZ,i=d?S:R;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return bW(a,b)},h.tickFormat=function(b){return bX(a,b)},h.nice=function(){return bQ(a,bU),g()},h.copy=function(){return bS(a,b,c,d)},g()}function bT(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clamp")}function bU(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bV(a,b){var c=bO(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return 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,c}function bW(a,b){return d3.range.apply(d3,bV(a,b))}function bX(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bV(a,b)[2])/Math.LN10+.01))+"f")}function bY(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bZ(a,b,c,d){var e=[],f=[],g=0,h=a.length-1;a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());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,h)-1;return f[c](e[c](b))}}function b$(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=function(e){return arguments.length?(b=e[0]<0?cb:ca,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(bQ(a.domain(),bR)),d},d.ticks=function(){var d=bO(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===cb){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(a,e){arguments.length<2&&(e=b_);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===cb?(h=-1e-12,Math.floor):(h=1e-12,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return b$(a.copy(),b)},bT(d,a)}function ca(a){return Math.log(a<0?0:a)/Math.LN10}function cb(a){return-Math.log(a>0?0:-a)/Math.LN10}function cc(a,b){function e(b){return a(c(b))}var c=cd(b),d=cd(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return bW(e.domain(),a)},e.tickFormat=function(a){return bX(e.domain(),a)},e.nice=function(){return e.domain(bQ(e.domain(),bU))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=cd(b=a),d=cd(1/b),e.domain(f)},e.copy=function(){return cc(a.copy(),b)},bT(e,a)}function cd(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function ce(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}function g(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length-1+h);return d=g(a.length<2?(i+j)/2:i+k*h/2,k),e=0,b={t:"rangePoints",x:c,p:h},f},f.rangeBands=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length+h);return d=g(i+k*h,k),e=k*(1-h),b={t:"rangeBands",x:c,p:h},f},f.rangeRoundBands=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=Math.floor((j-i)/(a.length+h));return d=g(i+Math.round((j-i-(a.length-h)*k)/2),k),e=Math.round(k*(1-h)),b={t:"rangeRoundBands",x:c,p:h},f},f.rangeBand=function(){return e},f.rangeExtent=function(){return b.t==="range"?bO(b.x):b.x},f.copy=function(){return ce(a,b)},f.domain(a)}function cj(a,b){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}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return cj(a,b)},d()}function ck(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return ck(a,b,c)},g()}function cn(a){return a.innerRadius}function co(a){return a.outerRadius}function cp(a){return a.startAngle}function cq(a){return a.endAngle}function cr(a){function g(d){return d.length<1?null:"M"+e(a(cs(this,d,b,c)),f)}var b=ct,c=cu,d="linear",e=cv[d],f=.7;return g.x=function(a){return arguments.length?(b=a,g):b},g.y=function(a){return arguments.length?(c=a,g):c},g.interpolate=function(a){return arguments.length?(e=cv[d=a],g):d},g.tension=function(a){return arguments.length?(f=a,g):f},g}function cs(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 ct(a){return a[0]}function cu(a){return a[1]}function cw(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function cx(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cy(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function cz(a,b){return a.length<4?cw(a):a[1]+cC(a.slice(1,a.length-1),cD(a,b))}function cA(a,b){return a.length<3?cw(a):a[0]+cC((a.push(a[0]),a),cD([a[a.length-2]].concat(a,[a[1]]),b))}function cB(a,b,c){return a.length<3?cw(a):a[0]+cC(a,cD(a,b))}function cC(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cw(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 cD(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cE(a){if(a.length<3)return cw(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];cM(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cM(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cM(i,g,h);return i.join("")}function cF(a){if(a.length<4)return cw(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cI(cL,f)+","+cI(cL,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cM(b,f,g);return b.join("")}function cG(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[cI(cL,g),",",cI(cL,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cM(b,g,h);return b.join("")}function cH(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cE(a)}function cI(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cM(a,b,c){a.push("C",cI(cJ,b),",",cI(cJ,c),",",cI(cK,b),",",cI(cK,c),",",cI(cL,b),",",cI(cL,c))}function cN(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cO(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cN(e,f);while(++b<c)d[b]=g+(g=cN(e=f,f=a[b+1]));return d[b]=g,d}function cP(a){var b=[],c,d,e,f,g=cO(a),h=-1,i=a.length-1;while(++h<i)c=cN(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cQ(a){return a.length<3?cw(a):a[0]+cC(a,cP(a))}function cR(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cl,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cS(a){function j(f){if(f.length<1)return null;var j=cs(this,f,b,d),k=cs(this,f,b===c?cT(j):c,d===e?cU(j):e);return"M"+g(a(k),i)+"L"+h(a(j.reverse()),i)+"Z"}var b=ct,c=ct,d=0,e=cu,f,g,h,i=.7;return j.x=function(a){return arguments.length?(b=c=a,j):c},j.x0=function(a){return arguments.length?(b=a,j):b},j.x1=function(a){return arguments.length?(c=a,j):c},j.y=function(a){return arguments.length?(d=e=a,j):e},j.y0=function(a){return arguments.length?(d=a,j):d},j.y1=function(a){return arguments.length?(e=a,j):e},j.interpolate=function(a){return arguments.length?(g=cv[f=a],h=g.reverse||g,j):f},j.tension=function(a){return arguments.length?(i=a,j):i},j.interpolate("linear")}function cT(a){return function(b,c){return a[c][0]}}function cU(a){return function(b,c){return a[c][1]}}function cV(a){return a.source}function cW(a){return a.target}function cX(a){return a.radius}function cY(a){return a.startAngle}function cZ(a){return a.endAngle}function c$(a){return[a.x,a.y]}function c_(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cl;return[c*Math.cos(d),c*Math.sin(d)]}}function db(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(da<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();da=!e.f&&!e.e,d.remove()}return da?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse()),[c.x,c.y]}function dc(){return 64}function dd(){return"circle"}function dh(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function di(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function dj(a,b,c){e=[];if(c&&b.length>1){var d=bO(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function dv(a,b){a.select(".extent").attr("x",b[0][0]),a.selectAll(".n,.s,.w,.nw,.sw").attr("x",b[0][0]-2),a.selectAll(".e,.ne,.se").attr("x",b[1][0]-3),a.selectAll(".extent,.n,.s").attr("width",b[1][0]-b[0][0])}function dw(a,b){a.select(".extent").attr("y",b[0][1]),a.selectAll(".n,.e,.w,.nw,.ne").attr("y",b[0][1]-3),a.selectAll(".s,.se,.sw").attr("y",b[1][1]-4),a.selectAll(".extent,.e,.w").attr("height",b[1][1]-b[0][1])}function dx(){d3.event.keyCode==32&&dm&&!dr&&(dt=null,du[0]-=dq[1][0],du[1]-=dq[1][1],dr=2,O())}function dy(){d3.event.keyCode==32&&dr==2&&(du[0]+=dq[1][0],du[1]+=dq[1][1],dr=0,O())}function dz(){if(du){var a=d3.svg.mouse(dm),b=d3.select(dm);dr||(d3.event.altKey?(dt||(dt=[(dq[0][0]+dq[1][0])/2,(dq[0][1]+dq[1][1])/2]),du[0]=dq[+(a[0]<dt[0])][0],du[1]=dq[+(a[1]<dt[1])][1]):dt=null),dn&&(dA(a,dn,0),dv(b,dq)),dp&&(dA(a,dp,1),dw(b,dq)),dl("brush")}}function dA(a,b,c){var d=bP(b),e=d[0],f=d[1],g=du[c],h=dq[1][c]-dq[0][c],i,j;dr&&(e-=g,f-=h+g),i=Math.max(e,Math.min(f,a[c])),dr?j=(i+=g)+h:(dt&&(g=Math.max(e,Math.min(f,2*dt[c]-i))),g<i?(j=i,i=g):j=g),dq[0][c]=i,dq[1][c]=j}function dB(){du&&(dz(),d3.select(dm).selectAll(".resize").style("pointer-events",dk.empty()?"none":"all"),dl("brushend"),dk=dl=dm=dn=dp=dq=dr=ds=dt=du=null,O())}function dK(a){var b=dL(),c=d3.event,d=d3.event={type:a};b&&(d.x=b[0]+dH[0],d.y=b[1]+dH[1],d.dx=b[0]-dI[0],d.dy=b[1]-dI[1],dJ|=d.dx|d.dy,dI=b);try{dD[a].apply(dF,dG)}finally{d3.event=c}c.stopPropagation(),c.preventDefault()}function dL(){var a=dF.parentNode,b=d3.event.changedTouches;return a&&(b?d3.svg.touches(a,b)[0]:d3.svg.mouse(a))}function dM(){if(!dF)return;var a=dF.parentNode;if(!a)return dN();dK("drag"),O()}function dN(){if(!dF)return;dK("dragend"),dJ&&(O(),dJ=d3.event.target===dE),dD=dE=dF=dG=dH=dI=null}function dO(){dJ&&(O(),dJ=0)}function d_(a){return[a[0]-dU[0],a[1]-dU[1],dU[2]]}function ea(){dP||(dP=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dP.scrollTop=1e3,dP.dispatchEvent(a),b=1e3-dP.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function eb(){var a=d3.svg.touches(dY),b=-1,c=a.length,d;while(++b<c)dS[(d=a[b]).identifier]=d_(d);return a}function ec(){var a=d3.svg.touches(dY);switch(a.length){case 1:var b=a[0];eg(dU[2],b,dS[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=dS[c.identifier],g=dS[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];eg(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function ed(){dR=null,dQ&&(d$=1,eg(dU[2],d3.svg.mouse(dY),dQ))}function ee(){dQ&&(d$&&(O(),d$=dX===d3.event.target),dU=dV=dW=dX=dY=dZ=dQ=null)}function ef(){d$&&(O(),d$=0)}function eg(a,b,c){function l(a,b,c){a.domain(a.range().map(function(f){return a.invert((f-c)*d/e+b)}))}a=ei(a,2);var d=Math.pow(2,dU[2]),e=Math.pow(2,a),f=Math.pow(2,(dU[2]=a)-c[2]),g=dU[0],h=dU[1],i=dU[0]=ei(b[0]-c[0]*f,0,e),j=dU[1]=ei(b[1]-c[1]*f,1,e),k=d3.event;d3.event={scale:e,translate:[i,j],transform:function(a,b){a&&l(a,g,i),b&&l(b,h,j)}};try{dW.apply(dY,dZ)}finally{d3.event=k}k.preventDefault()}function ei(a,b,c){var d=dV[b],e=d[0],f=d[1];return arguments.length===3?Math.max(f*(f===Infinity?-Infinity:1/c-1),Math.min(e===-Infinity?Infinity:e,a/c))*c:Math.max(e,Math.min(f,a))}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.7.2"};var d=f;try{d(document.documentElement.childNodes)[0].nodeType}catch(g){d=e}var h=[].__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){var c=1,d=arguments.length,e;while(++c<d)a[e=arguments[c]]=j(a,b,b[e]);return a},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.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)k(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)k(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(k),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},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.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++c<d&&((e=g=a[c])==null||e!=e))e=g=undefined;while(++c<d)(f=a[c])!=null&&(e>f&&(e=f),g<f&&(g=f))}else{while(++c<d&&((e=g=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),g<f&&(g=f))}return[e,g]},d3.random={normal:function(a,b){return arguments.length<2&&(b=1),arguments.length<1&&(a=0),function(){var c,d,e;do c=Math.random()*2-1,d=Math.random()*2-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/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.transpose=function(a){return d3.zip.apply(d3,a)},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,l),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[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 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}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)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},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,g=a.length;arguments.length<2&&(b=m);while(++f<g)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(o,"\\$&")};var o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/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=null):b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),b&&d.setRequestHeader("Accept",b),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)};var p={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/"};d3.ns={prefix:p,qualify:function(a){var b=a.indexOf(":");return b<0?a in p?{space:p[a],local:a}:a:{space:p[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(){var a=new q,b=-1,c=arguments.length;while(++b<c)a[arguments[b]]=r();return a},q.prototype.on=function(a,b){var c=a.indexOf("."),d="";return c>0&&(d=a.substring(c+1),a=a.substring(0,c)),arguments.length<2?this[a].on(d):(this[a].on(d,b),this)},d3.format=function(a){var b=s.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,k="",l=!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=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=t[i]||v,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=w(a)),a=b+a}else{g&&(a=w(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var s=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,t={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){return d3.round(a,b=u(a,b)).toFixed(Math.max(0,Math.min(20,b)))}},x=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(y);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,u(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),x[8+c/3]};var z=H(2),A=H(3),B={linear:function(){return G},poly:H,quad:function(){return z},cubic:function(){return A},sin:function(){return I},exp:function(){return J},circle:function(){return K},elastic:L,back:M,bounce:function(){return N}},C={"in":function(a){return a},out:E,"in-out":F,"out-in":function(a){return F(E(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 D(C[d](B[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){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,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;P.lastIndex=0;for(d=0;c=P.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=P.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=P.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.interpolateTransform=function(a,b){return d3.interpolateString(d3.transform(a)+"",d3.transform(b)+"")},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"#"+V(Math.round(c+f*a))+V(Math.round(d+g*a))+V(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 bb(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]=Q(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 P=/[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return(typeof a=="string"||typeof b=="string")&&d3.interpolateString(a+"",b+"")},function(a,b){return(typeof b=="string"?b in Z||/^(#|rgb\(|hsl\()/.test(b):b instanceof U||b instanceof ba)&&d3.interpolateRgb(a,b)},function(a,b){return!isNaN(a=+a)&&!isNaN(b=+b)&&d3.interpolateNumber(a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof U?T(a.r,a.g,a.b):W(""+a,T,bb):T(~~a,~~b,~~c)},U.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?T(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),T(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},U.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),T(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},U.prototype.hsl=function(){return X(this.r,this.g,this.b)},U.prototype.toString=function(){return"#"+V(this.r)+V(this.g)+V(this.b)};var Z={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" <del>,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 $ in Z)Z[$]=W(Z[$],T,bb);d3.hsl=function(a,b,c){return arguments.length===1?a instanceof ba?_(a.h,a.s,a.l):W(""+a,X,_):_(+a,+b,+c)},ba.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),_(this.h,this.s,this.l/a)},ba.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),_(this.h,this.s,a*this.l)},ba.prototype.rgb=function(){return bb(this.h,this.s,this.l)},ba.prototype.toString=function(){return this.rgb().toString()};var bd=function(a,b){return b.querySelector(a)},be=function(a,b){return b.querySelectorAll(a)},bf=document.documentElement,bg=bf.matchesSelector||bf.webkitMatchesSelector||bf.mozMatchesSelector||bf.msMatchesSelector||bf.oMatchesSelector,bh=function(a,b){return bg.call(a,b)};typeof Sizzle=="function"&&(bd=function(a,b){return Sizzle(a,b)[0]},be=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},bh=Sizzle.matchesSelector);var bi=[];d3.selection=function(){return bq},d3.selection.prototype=bi,bi.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bj(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return bc(b)},bi.selectAll=function(a){var b=[],c,e;typeof a!="function"&&(a=bk(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i])b.push(c=d(a.call(e,e.__data__,i))),c.parentNode=e;return bc(b)},bi.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}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)},bi.classed=function(a,b){var c=a.split(bl),d=c.length,e=-1;if(arguments.length>1){while(++e<d)bm.call(this,c[e],b);return this}while(++e<d)if(!bm.call(this,c[e]))return!1;return!0};var bl=/\s+/g;bi.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bi.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bi.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.textContent=b==null?"":b}:a==null?function(){this.textContent=""}:function(){this.textContent=a})},bi.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.innerHTML=b==null?"":b}:a==null?function(){this.innerHTML=""}:function(){this.innerHTML=a})},bi.append=function(a){function b(){return this.appendChild(document.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bi.insert=function(a,b){function c(){return this.insertBefore(document.createElementNS(this.namespaceURI,a),bd(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),bd(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bi.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bi.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bn(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]=bn(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bn(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=bc(d);return j.enter=function(){return br(c)},j.exit=function(){return bc(e)},j},bi.filter=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bo(a));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 bc(b)},bi.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},bi.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c=this[a],d=c.length-1,e=c[d],f;--d>=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},bi.sort=function(a){a=bp.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},bi.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bi.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bi.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bi.empty=function(){return!this.node()},bi.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bi.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bt(a,bz||++by,Date.now())};var bq=bc([[document]]);bq[0].parentNode=bf,d3.select=function(a){return typeof a=="string"?bq.select(a):bc([[a]])},d3.selectAll=function(a){return typeof a=="string"?bq.selectAll(a):bc([d(a)])};var bs=[];bs.append=bi.append,bs.insert=bi.insert,bs.empty=bi.empty,bs.node=bi.node,bs.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return bc(b)};var bu={},bx=[],by=0,bz=0,bA=d3.ease("cubic-in-out");bx.call=bi.call,d3.transition=function(){return bq.transition()},d3.transition.prototype=bx,bx.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bj(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bt(b,this.id,this.time).ease(this.ease())},bx.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bk(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return bt(b,this.id,this.time).ease(this.ease())},bx.attr=function(a,b){return this.attrTween(a,bw(a,b))},bx.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bu?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bu?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bx.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bw(a,b),c)},bx.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bu?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bx.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bx.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bx.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},bx.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},bx.transition=function(){return this.select(i)};var bC=null,bD,bE;d3.timer=function(a,b,c){var d=!1,e,f=bC;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bC={callback:a,then:c,delay:b,next:bC}),bD||(bE=clearTimeout(bE),bD=1,bH(bF))},d3.timer.flush=function(){var a,b=Date.now(),c=bC;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bG()};var bH=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.transform=function(a){var b=document.createElementNS(d3.ns.prefix.svg,"g"),c={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(a){b.setAttribute("transform",a);var d=b.transform.baseVal.consolidate();return new bI(d?d.matrix:c)})(a)},bI.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bM=180/Math.PI;d3.scale={},d3.scale.linear=function(){return bS([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return b$(d3.scale.linear(),ca)};var b_=d3.format(".0e");ca.pow=function(a){return Math.pow(10,a)},cb.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return cc(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ce([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cf)},d3.scale.category20=function(){return d3.scale.ordinal().range(cg)},d3.scale.category20b=function(){return d3.scale.ordinal().range(ch)},d3.scale.category20c=function(){return d3.scale.ordinal().range(ci)};var cf=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cg=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],ch=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],ci=["#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 cj([],[])},d3.scale.quantize=function(){return ck(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)+cl,h=d.apply(this,arguments)+cl,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>=cm?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,0 0,"+ -e+"A"+e+","+e+" 0 1,0 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=cn,b=co,c=cp,d=cq;return e.innerRadius=function(b){return arguments.length?(a=d3.functor(b),e):a},e.outerRadius=function(a){return arguments.length?(b=d3.functor(a),e):b},e.startAngle=function(a){return arguments.length?(c=d3.functor(a),e):c},e.endAngle=function(a){return arguments.length?(d=d3.functor(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cl;return[Math.cos(f)*e,Math.sin(f)*e]},e};var cl=-Math.PI/2,cm=2*Math.PI-1e-6;d3.svg.line=function(){return cr(Object)};var cv={linear:cw,"step-before":cx,"step-after":cy,basis:cE,"basis-open":cF,"basis-closed":cG,bundle:cH,cardinal:cB,"cardinal-open":cz,"cardinal-closed":cA,monotone:cQ},cJ=[0,2/3,1/3,0],cK=[0,1/3,2/3,0],cL=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cr(cR);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},cx.reverse=cy,cy.reverse=cx,d3.svg.area=function(){return cS(Object)},d3.svg.area.radial=function(){var a=cS(cR);return 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,a},d3.svg.chord=function(){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,e.a1-e.a0)+(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,f.a1-f.a0)+j(f.r,f.p1,e.r,e.p0))+"Z"}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)+cl,k=e.call(a,h,g)+cl;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 h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Math.PI)+",1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=cV,b=cW,c=cX,d=cp,e=cq;return f.radius=function(a){return arguments.length?(c=d3.functor(a),f):c},f.source=function(b){return arguments.length?(a=d3.functor(b),f):a},f.target=function(a){return arguments.length?(b=d3.functor(a),f):b},f.startAngle=function(a){return arguments.length?(d=d3.functor(a),f):d},f.endAngle=function(a){return arguments.length?(e=d3.functor(a),f):e},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];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cV,b=cW,c=c$;return d.source=function(b){return arguments.length?(a=d3.functor(b),d):a},d.target=function(a){return arguments.length?(b=d3.functor(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=c$,c=a.projection;return a.projection=function(a){return arguments.length?c(c_(b=a)):b},a},d3.svg.mouse=function(a){return db(a,d3.event)};var da=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a,b){return arguments.length<2&&(b=d3.event.touches),b?d(b).map(function(b){var c=db(a,b);return c.identifier=b.identifier,c}):[]},d3.svg.symbol=function(){function c(c,d){return(de[a.call(this,c,d)]||de.circle)(b.call(this,c,d))}var a=dd,b=dc;return c.type=function(b){return arguments.length?(a=d3.functor(b),c):a},c.size=function(a){return arguments.length?(b=d3.functor(a),c):b},c};var de={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*dg)),c=b*dg;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/df),c=b*df/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/df),c=b*df/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(de);var df=Math.sqrt(3),dg=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bz;try{return bz=j.id,a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bz=b}}:Object,p=a.ticks?a.ticks.apply(a,g):a.domain(),q=h==null?a.tickFormat?a.tickFormat.apply(a,g):String:h,r=dj(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bP(a),C=n.selectAll(".domain").data([0]),D=C.enter().append("path").attr("class","domain"),E=o(C),F=a.copy(),G=this.__chart__||F;this.__chart__=F,x.append("line").attr("class","tick"),x.append("text"),z.select("text").text(q);switch(b){case"bottom":A=dh,t.attr("y2",d),v.attr("x2",0).attr("y2",d),x.select("line").attr("y2",c),x.select("text").attr("y",Math.max(c,0)+f),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=dh,t.attr("y2",-d),v.attr("x2",0).attr("y2",-d),x.select("line").attr("y2",-c),x.select("text").attr("y",-(Math.max(c,0)+f)),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=di,t.attr("x2",-d),v.attr("x2",-d).attr("y2",0),x.select("line").attr("x2",-c),x.select("text").attr("x",-(Math.max(c,0)+f)),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=di,t.attr("x2",d),v.attr("x2",d).attr("y2",0),x.select("line").attr("x2",c),x.select("text").attr("x",Math.max(c,0)+f),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}if(a.ticks)x.call(A,G),z.call(A,F),y.call(A,F),t.call(A,G),v.call(A,F),u.call(A,F);else{var H=F.rangeBand()/2,I=function(a){return F(a)+H};x.call(A,I),z.call(A,I)}})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;return j.scale=function(b){return arguments.length?(a=b,j):a},j.orient=function(a){return arguments.length?(b=a,j):b},j.ticks=function(){return arguments.length?(g=arguments,j):g},j.tickFormat=function(a){return arguments.length?(h=a,j):h},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,j},j.tickPadding=function(a){return arguments.length?(f=+a,j):f},j.tickSubdivide=function(a){return arguments.length?(i=+a,j):i},j},d3.svg.brush=function(){function e(a){var g=b&&c?["n","e","s","w","nw","ne","se","sw"]:b?["e","w"]:c?["n","s"]:[];a.each(function(){var a=d3.select(this).on("mousedown.brush",f),h=a.selectAll(".background").data([,]),i=a.selectAll(".extent").data([,]),j=a.selectAll(".resize").data(g,String),k;h.enter().append("rect").attr("class","background").style("visibility","hidden").style("pointer-events","all").style("cursor","crosshair"),i.enter().append("rect").attr("class","extent").style("cursor","move"),j.enter().append("rect").attr("class",function(a){return"resize "+a}).attr("width",6).attr("height",6).style("visibility","hidden").style("pointer-events",e.empty()?"none":"all").style("cursor",function(a){return dC[a]}),j.exit().remove(),b&&(k=bP(b),h.attr("x",k[0]).attr("width",k[1]-k[0]),dv(a,d)),c&&(k=bP(c),h.attr("y",k[0]).attr("height",k[1]-k[0]),dw(a,d))})}function f(){var a=d3.select(d3.event.target);dk=e,dm=this,dq=d,du=d3.svg.mouse(dm),(dr=a.classed("extent"))?(du[0]=d[0][0]-du[0],du[1]=d[0][1]-du[1]):a.classed("resize")?(ds=d3.event.target.__data__,du[0]=d[+/w$/.test(ds)][0],du[1]=d[+/^n/.test(ds)][1]):d3.event.altKey&&(dt=du.slice()),dn=!/^(n|s)$/.test(ds)&&b,dp=!/^(e|w)$/.test(ds)&&c,dl=g(this,arguments),dl("brushstart"),dz(),O()}function g(b,c){return function(d){var f=d3.event;try{d3.event={type:d,target:e},a[d].apply(b,c)}finally{d3.event=f}}}var a=d3.dispatch("brushstart","brush","brushend"),b,c,d=[[0,0],[0,0]];return e.x=function(a){return arguments.length?(b=a,e):b},e.y=function(a){return arguments.length?(c=a,e):c},e.extent=function(a){var f,g,h,i,j;return arguments.length?(b&&(f=a[0],g=a[1],c&&(f=f[0],g=g[0]),b.invert&&(f=b(f),g=b(g)),g<f&&(j=f,f=g,g=j),d[0][0]=f,d[1][0]=g),c&&(h=a[0],i=a[1],b&&(h=h[1],i=i[1]),c.invert&&(h=c(h),i=c(i)),i<h&&(j=h,h=i,i=j),d[0][1]=h,d[1][1]=i),e):(b&&(f=d[0][0],g=d[1][0],b.invert&&(f=b.invert(f),g=b.invert(g)),g<f&&(j=f,f=g,g=j)),c&&(h=d[0][1],i=d[1][1],c.invert&&(h=c.invert(h),i=c.invert(i)),i<h&&(j=h,h=i,i=j)),b&&c?[[f,h],[g,i]]:b?[f,g]:c&&[h,i])},e.clear=function(){return d[0][0]=d[0][1]=d[1][0]=d[1][1]=0,e},e.empty=function(){return b&&d[0][0]===d[1][0]||c&&d[0][1]===d[1][1]},d3.select(window).on("mousemove.brush",dz).on("mouseup.brush",dB).on("keydown.brush",dx).on("keyup.brush",dy),d3.rebind(e,a,"on")};var dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dC={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};d3.behavior={},d3.behavior.drag=function(){function c(){this.on("mousedown.drag",e).on("touchstart.drag",e),d3.select(window).on("mousemove.drag",dM).on("touchmove.drag",dM).on("mouseup.drag",dN,!0).on("touchend.drag",dN,!0).on("click.drag",dO,!0)}function d(){dD=a,dE=d3.event.target,dF=this,dG=arguments,dI=dL(),b?(dH=b.apply(dF,dG),dH=[dH.x-dI[0],dH.y-dI[1]]):dH=[0,0],dJ=0}function e(){d.apply(this,arguments),dK("dragstart")}var a=d3.dispatch("drag","dragstart","dragend"),b=null;return c.origin=function(a){return arguments.length?(b=a,c):b},d3.rebind(c,a,"on")};var dD,dE,dF,dG,dH,dI,dJ;d3.behavior.zoom=function(){function d(){this.on("mousedown.zoom",f).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g).on("dblclick.zoom",h).on("touchstart.zoom",i),d3.select(window).on("mousemove.zoom",ed).on("mouseup.zoom",ee).on("touchmove.zoom",ec).on("touchend.zoom",eb).on("click.zoom",ef,!0)}function e(){dU=a,dV=c,dW=b.zoom,dX=d3.event.target,dY=this,dZ=arguments}function f(){e.apply(this,arguments),dQ=d_(d3.svg.mouse(dY)),d$=0,d3.event.preventDefault(),window.focus()}function g(){e.apply(this,arguments),dR||(dR=d_(d3.svg.mouse(dY))),eg(ea()+a[2],d3.svg.mouse(dY),dR)}function h(){e.apply(this,arguments);var b=d3.svg.mouse(dY);eg(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,d_(b))}function i(){e.apply(this,arguments);var b=eb(),c,d=Date.now();b.length===1&&d-dT<300&&eg(1+Math.floor(a[2]),c=b[0],dS[c.identifier]),dT=d}var a=[0,0,0],b=d3.dispatch("zoom"),c=eh;return d.extent=function(a){return arguments.length?(c=a==null?eh:a,d):c},d3.rebind(d,b,"on")};var dP,dQ,dR,dS={},dT=0,dU,dV,dW,dX,dY,dZ,d$,eh=[[-Infinity,Infinity],[-Infinity,Infinity],[-Infinity,Infinity]]})(); <ide>\ No newline at end of file <add>,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 $ in Z)Z[$]=W(Z[$],T,bb);d3.hsl=function(a,b,c){return arguments.length===1?a instanceof ba?_(a.h,a.s,a.l):W(""+a,X,_):_(+a,+b,+c)},ba.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),_(this.h,this.s,this.l/a)},ba.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),_(this.h,this.s,a*this.l)},ba.prototype.rgb=function(){return bb(this.h,this.s,this.l)},ba.prototype.toString=function(){return this.rgb().toString()};var bd=function(a,b){return b.querySelector(a)},be=function(a,b){return b.querySelectorAll(a)},bf=document.documentElement,bg=bf.matchesSelector||bf.webkitMatchesSelector||bf.mozMatchesSelector||bf.msMatchesSelector||bf.oMatchesSelector,bh=function(a,b){return bg.call(a,b)};typeof Sizzle=="function"&&(bd=function(a,b){return Sizzle(a,b)[0]},be=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},bh=Sizzle.matchesSelector);var bi=[];d3.selection=function(){return bq},d3.selection.prototype=bi,bi.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bj(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return bc(b)},bi.selectAll=function(a){var b=[],c,e;typeof a!="function"&&(a=bk(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i])b.push(c=d(a.call(e,e.__data__,i))),c.parentNode=e;return bc(b)},bi.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}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)},bi.classed=function(a,b){var c=a.split(bl),d=c.length,e=-1;if(arguments.length>1){while(++e<d)bm.call(this,c[e],b);return this}while(++e<d)if(!bm.call(this,c[e]))return!1;return!0};var bl=/\s+/g;bi.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bi.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bi.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.textContent=b==null?"":b}:a==null?function(){this.textContent=""}:function(){this.textContent=a})},bi.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.innerHTML=b==null?"":b}:a==null?function(){this.innerHTML=""}:function(){this.innerHTML=a})},bi.append=function(a){function b(){return this.appendChild(document.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bi.insert=function(a,b){function c(){return this.insertBefore(document.createElementNS(this.namespaceURI,a),bd(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),bd(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bi.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bi.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bn(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]=bn(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bn(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=bc(d);return j.enter=function(){return br(c)},j.exit=function(){return bc(e)},j},bi.filter=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bo(a));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 bc(b)},bi.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},bi.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c=this[a],d=c.length-1,e=c[d],f;--d>=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},bi.sort=function(a){a=bp.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},bi.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bi.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bi.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bi.empty=function(){return!this.node()},bi.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bi.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bt(a,bz||++by,Date.now())};var bq=bc([[document]]);bq[0].parentNode=bf,d3.select=function(a){return typeof a=="string"?bq.select(a):bc([[a]])},d3.selectAll=function(a){return typeof a=="string"?bq.selectAll(a):bc([d(a)])};var bs=[];bs.append=bi.append,bs.insert=bi.insert,bs.empty=bi.empty,bs.node=bi.node,bs.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return bc(b)};var bu={},bx=[],by=0,bz=0,bA=d3.ease("cubic-in-out");bx.call=bi.call,d3.transition=function(){return bq.transition()},d3.transition.prototype=bx,bx.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bj(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bt(b,this.id,this.time).ease(this.ease())},bx.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bk(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return bt(b,this.id,this.time).ease(this.ease())},bx.attr=function(a,b){return this.attrTween(a,bw(a,b))},bx.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bu?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bu?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bx.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bw(a,b),c)},bx.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bu?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bx.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bx.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bx.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},bx.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},bx.transition=function(){return this.select(i)};var bC=null,bD,bE;d3.timer=function(a,b,c){var d=!1,e,f=bC;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bC={callback:a,then:c,delay:b,next:bC}),bD||(bE=clearTimeout(bE),bD=1,bH(bF))},d3.timer.flush=function(){var a,b=Date.now(),c=bC;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bG()};var bH=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.transform=function(a){var b=document.createElementNS(d3.ns.prefix.svg,"g"),c={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(a){b.setAttribute("transform",a);var d=b.transform.baseVal.consolidate();return new bI(d?d.matrix:c)})(a)},bI.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bM=180/Math.PI;d3.scale={},d3.scale.linear=function(){return bS([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return b$(d3.scale.linear(),ca)};var b_=d3.format(".0e");ca.pow=function(a){return Math.pow(10,a)},cb.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return cc(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return ce([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cf)},d3.scale.category20=function(){return d3.scale.ordinal().range(cg)},d3.scale.category20b=function(){return d3.scale.ordinal().range(ch)},d3.scale.category20c=function(){return d3.scale.ordinal().range(ci)};var cf=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cg=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],ch=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],ci=["#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 cj([],[])},d3.scale.quantize=function(){return ck(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)+cl,h=d.apply(this,arguments)+cl,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>=cm?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,0 0,"+ -e+"A"+e+","+e+" 0 1,0 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=cn,b=co,c=cp,d=cq;return e.innerRadius=function(b){return arguments.length?(a=d3.functor(b),e):a},e.outerRadius=function(a){return arguments.length?(b=d3.functor(a),e):b},e.startAngle=function(a){return arguments.length?(c=d3.functor(a),e):c},e.endAngle=function(a){return arguments.length?(d=d3.functor(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cl;return[Math.cos(f)*e,Math.sin(f)*e]},e};var cl=-Math.PI/2,cm=2*Math.PI-1e-6;d3.svg.line=function(){return cr(Object)};var cv={linear:cw,"step-before":cx,"step-after":cy,basis:cE,"basis-open":cF,"basis-closed":cG,bundle:cH,cardinal:cB,"cardinal-open":cz,"cardinal-closed":cA,monotone:cQ},cJ=[0,2/3,1/3,0],cK=[0,1/3,2/3,0],cL=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cr(cR);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},cx.reverse=cy,cy.reverse=cx,d3.svg.area=function(){return cS(Object)},d3.svg.area.radial=function(){var a=cS(cR);return 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,a},d3.svg.chord=function(){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,e.a1-e.a0)+(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,f.a1-f.a0)+j(f.r,f.p1,e.r,e.p0))+"Z"}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)+cl,k=e.call(a,h,g)+cl;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 h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Math.PI)+",1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=cV,b=cW,c=cX,d=cp,e=cq;return f.radius=function(a){return arguments.length?(c=d3.functor(a),f):c},f.source=function(b){return arguments.length?(a=d3.functor(b),f):a},f.target=function(a){return arguments.length?(b=d3.functor(a),f):b},f.startAngle=function(a){return arguments.length?(d=d3.functor(a),f):d},f.endAngle=function(a){return arguments.length?(e=d3.functor(a),f):e},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];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cV,b=cW,c=c$;return d.source=function(b){return arguments.length?(a=d3.functor(b),d):a},d.target=function(a){return arguments.length?(b=d3.functor(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=c$,c=a.projection;return a.projection=function(a){return arguments.length?c(c_(b=a)):b},a},d3.svg.mouse=function(a){return db(a,d3.event)};var da=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a,b){return arguments.length<2&&(b=d3.event.touches),b?d(b).map(function(b){var c=db(a,b);return c.identifier=b.identifier,c}):[]},d3.svg.symbol=function(){function c(c,d){return(de[a.call(this,c,d)]||de.circle)(b.call(this,c,d))}var a=dd,b=dc;return c.type=function(b){return arguments.length?(a=d3.functor(b),c):a},c.size=function(a){return arguments.length?(b=d3.functor(a),c):b},c};var de={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*dg)),c=b*dg;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/df),c=b*df/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/df),c=b*df/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(de);var df=Math.sqrt(3),dg=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bz;try{return bz=j.id,a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bz=b}}:Object,p=a.ticks?a.ticks.apply(a,g):a.domain(),q=h==null?a.tickFormat?a.tickFormat.apply(a,g):String:h,r=dj(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bP(a),C=n.selectAll(".domain").data([0]),D=C.enter().append("path").attr("class","domain"),E=o(C),F=a.copy(),G=this.__chart__||F;this.__chart__=F,x.append("line").attr("class","tick"),x.append("text"),z.select("text").text(q);switch(b){case"bottom":A=dh,t.attr("y2",d),v.attr("x2",0).attr("y2",d),x.select("line").attr("y2",c),x.select("text").attr("y",Math.max(c,0)+f),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=dh,t.attr("y2",-d),v.attr("x2",0).attr("y2",-d),x.select("line").attr("y2",-c),x.select("text").attr("y",-(Math.max(c,0)+f)),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=di,t.attr("x2",-d),v.attr("x2",-d).attr("y2",0),x.select("line").attr("x2",-c),x.select("text").attr("x",-(Math.max(c,0)+f)),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=di,t.attr("x2",d),v.attr("x2",d).attr("y2",0),x.select("line").attr("x2",c),x.select("text").attr("x",Math.max(c,0)+f),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}if(a.ticks)x.call(A,G),z.call(A,F),y.call(A,F),t.call(A,G),v.call(A,F),u.call(A,F);else{var H=F.rangeBand()/2,I=function(a){return F(a)+H};x.call(A,I),z.call(A,I)}})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;return j.scale=function(b){return arguments.length?(a=b,j):a},j.orient=function(a){return arguments.length?(b=a,j):b},j.ticks=function(){return arguments.length?(g=arguments,j):g},j.tickFormat=function(a){return arguments.length?(h=a,j):h},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,j},j.tickPadding=function(a){return arguments.length?(f=+a,j):f},j.tickSubdivide=function(a){return arguments.length?(i=+a,j):i},j},d3.svg.brush=function(){function e(a){var g=b&&c?["n","e","s","w","nw","ne","se","sw"]:b?["e","w"]:c?["n","s"]:[];a.each(function(){var a=d3.select(this).on("mousedown.brush",f),h=a.selectAll(".background").data([,]),i=a.selectAll(".extent").data([,]),j=a.selectAll(".resize").data(g,String),k;h.enter().append("rect").attr("class","background").style("visibility","hidden").style("pointer-events","all").style("cursor","crosshair"),i.enter().append("rect").attr("class","extent").style("cursor","move"),j.enter().append("rect").attr("class",function(a){return"resize "+a}).attr("width",6).attr("height",6).style("visibility","hidden").style("cursor",function(a){return dC[a]}),j.style("pointer-events",e.empty()?"none":"all"),j.exit().remove(),b&&(k=bP(b),h.attr("x",k[0]).attr("width",k[1]-k[0]),dv(a,d)),c&&(k=bP(c),h.attr("y",k[0]).attr("height",k[1]-k[0]),dw(a,d))})}function f(){var a=d3.select(d3.event.target);dk=e,dm=this,dq=d,du=d3.svg.mouse(dm),(dr=a.classed("extent"))?(du[0]=d[0][0]-du[0],du[1]=d[0][1]-du[1]):a.classed("resize")?(ds=d3.event.target.__data__,du[0]=d[+/w$/.test(ds)][0],du[1]=d[+/^n/.test(ds)][1]):d3.event.altKey&&(dt=du.slice()),dn=!/^(n|s)$/.test(ds)&&b,dp=!/^(e|w)$/.test(ds)&&c,dl=g(this,arguments),dl("brushstart"),dz(),O()}function g(b,c){return function(d){var f=d3.event;try{d3.event={type:d,target:e},a[d].apply(b,c)}finally{d3.event=f}}}var a=d3.dispatch("brushstart","brush","brushend"),b,c,d=[[0,0],[0,0]];return e.x=function(a){return arguments.length?(b=a,e):b},e.y=function(a){return arguments.length?(c=a,e):c},e.extent=function(a){var f,g,h,i,j;return arguments.length?(b&&(f=a[0],g=a[1],c&&(f=f[0],g=g[0]),b.invert&&(f=b(f),g=b(g)),g<f&&(j=f,f=g,g=j),d[0][0]=f,d[1][0]=g),c&&(h=a[0],i=a[1],b&&(h=h[1],i=i[1]),c.invert&&(h=c(h),i=c(i)),i<h&&(j=h,h=i,i=j),d[0][1]=h,d[1][1]=i),e):(b&&(f=d[0][0],g=d[1][0],b.invert&&(f=b.invert(f),g=b.invert(g)),g<f&&(j=f,f=g,g=j)),c&&(h=d[0][1],i=d[1][1],c.invert&&(h=c.invert(h),i=c.invert(i)),i<h&&(j=h,h=i,i=j)),b&&c?[[f,h],[g,i]]:b?[f,g]:c&&[h,i])},e.clear=function(){return d[0][0]=d[0][1]=d[1][0]=d[1][1]=0,e},e.empty=function(){return b&&d[0][0]===d[1][0]||c&&d[0][1]===d[1][1]},d3.select(window).on("mousemove.brush",dz).on("mouseup.brush",dB).on("keydown.brush",dx).on("keyup.brush",dy),d3.rebind(e,a,"on")};var dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dC={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};d3.behavior={},d3.behavior.drag=function(){function c(){this.on("mousedown.drag",e).on("touchstart.drag",e),d3.select(window).on("mousemove.drag",dM).on("touchmove.drag",dM).on("mouseup.drag",dN,!0).on("touchend.drag",dN,!0).on("click.drag",dO,!0)}function d(){dD=a,dE=d3.event.target,dF=this,dG=arguments,dI=dL(),b?(dH=b.apply(dF,dG),dH=[dH.x-dI[0],dH.y-dI[1]]):dH=[0,0],dJ=0}function e(){d.apply(this,arguments),dK("dragstart")}var a=d3.dispatch("drag","dragstart","dragend"),b=null;return c.origin=function(a){return arguments.length?(b=a,c):b},d3.rebind(c,a,"on")};var dD,dE,dF,dG,dH,dI,dJ;d3.behavior.zoom=function(){function d(){this.on("mousedown.zoom",f).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g).on("dblclick.zoom",h).on("touchstart.zoom",i),d3.select(window).on("mousemove.zoom",ed).on("mouseup.zoom",ee).on("touchmove.zoom",ec).on("touchend.zoom",eb).on("click.zoom",ef,!0)}function e(){dU=a,dV=c,dW=b.zoom,dX=d3.event.target,dY=this,dZ=arguments}function f(){e.apply(this,arguments),dQ=d_(d3.svg.mouse(dY)),d$=0,d3.event.preventDefault(),window.focus()}function g(){e.apply(this,arguments),dR||(dR=d_(d3.svg.mouse(dY))),eg(ea()+a[2],d3.svg.mouse(dY),dR)}function h(){e.apply(this,arguments);var b=d3.svg.mouse(dY);eg(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,d_(b))}function i(){e.apply(this,arguments);var b=eb(),c,d=Date.now();b.length===1&&d-dT<300&&eg(1+Math.floor(a[2]),c=b[0],dS[c.identifier]),dT=d}var a=[0,0,0],b=d3.dispatch("zoom"),c=eh;return d.extent=function(a){return arguments.length?(c=a==null?eh:a,d):c},d3.rebind(d,b,"on")};var dP,dQ,dR,dS={},dT=0,dU,dV,dW,dX,dY,dZ,d$,eh=[[-Infinity,Infinity],[-Infinity,Infinity],[-Infinity,Infinity]]})(); <ide>\ No newline at end of file <ide><path>src/svg/brush.js <ide> d3.svg.brush = function() { <ide> .attr("width", 6) <ide> .attr("height", 6) <ide> .style("visibility", "hidden") <del> .style("pointer-events", brush.empty() ? "none" : "all") <ide> .style("cursor", function(d) { return d3_svg_brushCursor[d]; }); <ide> <add> // Update the resizers. <add> tz.style("pointer-events", brush.empty() ? "none" : "all"); <add> <ide> // Remove any superfluous resizers. <ide> tz.exit().remove(); <ide>
3
Javascript
Javascript
replace indexof, assert.equal, add mustcall()
8cd2306cc3e3ea379c569ecb90f0af2afa6345e3
<ide><path>test/parallel/test-fs-symlink.js <ide> if (common.isWindows) { <ide> // On Windows, creating symlinks requires admin privileges. <ide> // We'll only try to run symlink test if we have enough privileges. <ide> exec('whoami /priv', function(err, o) { <del> if (err || o.indexOf('SeCreateSymbolicLinkPrivilege') == -1) { <add> if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) { <ide> common.skip('insufficient privileges'); <ide> return; <ide> } <ide> common.refreshTmpDir(); <ide> const linkData = path.join(common.fixturesDir, '/cycles/root.js'); <ide> const linkPath = path.join(common.tmpDir, 'symlink1.js'); <ide> <del>fs.symlink(linkData, linkPath, function(err) { <del> if (err) throw err; <add>fs.symlink(linkData, linkPath, common.mustCall(function(err) { <add> assert.ifError(err); <ide> <ide> fs.lstat(linkPath, common.mustCall(function(err, stats) { <del> if (err) throw err; <add> assert.ifError(err); <ide> linkTime = stats.mtime.getTime(); <ide> })); <ide> <ide> fs.stat(linkPath, common.mustCall(function(err, stats) { <del> if (err) throw err; <add> assert.ifError(err); <ide> fileTime = stats.mtime.getTime(); <ide> })); <ide> <ide> fs.readlink(linkPath, common.mustCall(function(err, destination) { <del> if (err) throw err; <del> assert.equal(destination, linkData); <add> assert.ifError(err); <add> assert.strictEqual(destination, linkData); <ide> })); <del>}); <add>})); <ide> <ide> <ide> process.on('exit', function() {
1
Text
Text
fix broken url in docs
8851481e5b6ae47b266c863292b064cfa3b71a80
<ide><path>docs/recipes/MigratingToRedux.md <ide> We don't want to lock you in! <ide> <ide> Your process will look like this: <ide> <del>- Create a function called `createFluxStore(reducer)` that creates a Flux store compatible with your existing app from a reducer function. Internally it might look similar to [`createStore`](../api/createStore.md) ([source](https://github.com/reduxjs/redux/blob/master/src/createStore.js)) implementation from Redux. Its dispatch handler should just call the `reducer` for any action, store the next state, and emit change. <add>- Create a function called `createFluxStore(reducer)` that creates a Flux store compatible with your existing app from a reducer function. Internally it might look similar to [`createStore`](../api/createStore.md) ([source](https://github.com/reduxjs/redux/blob/v4.0.5/src/createStore.js)) implementation from Redux. Its dispatch handler should just call the `reducer` for any action, store the next state, and emit change. <ide> <ide> - This allows you to gradually rewrite every Flux Store in your app as a reducer, but still export `createFluxStore(reducer)` so the rest of your app is not aware that this is happening and sees the Flux stores. <ide> <ide><path>docs/recipes/Troubleshooting.md <ide> It's possible you're correctly dispatching an action and applying your reducer b <ide> ## Something else doesn't work <ide> <ide> Ask around on the **#redux** [Reactiflux](http://reactiflux.com/) Discord channel, or [create an issue](https://github.com/reduxjs/redux/issues). <del>If you figure it out, [edit this document](https://github.com/reduxjs/redux/edit/master/docs/Troubleshooting.md) as a courtesy to the next person having the same problem. <add>If you figure it out, [edit this document](https://github.com/reduxjs/redux/edit/master/docs/recipes/Troubleshooting.md) as a courtesy to the next person having the same problem.
2
Python
Python
remove unused argument
c4857bc7dbb150b28163cad6418cf0f52d6d19e7
<ide><path>spacy/util.py <ide> def get_lang_class(name): <ide> return LANGUAGES[lang] <ide> <ide> <del>def load_lang_class(lang, depth='.'): <add>def load_lang_class(lang): <ide> module = importlib.import_module('.lang.%s' % lang, 'spacy') <ide> return getattr(module, module.__all__[0]) <ide>
1
Ruby
Ruby
remove redundant begin block
464d625324accb8486aefa0b4a4b46477462dd08
<ide><path>railties/test/generators/app_generator_test.rb <ide> def test_inclusion_of_listen_related_configuration_by_default <ide> def test_inclusion_of_listen_related_configuration_on_other_rubies <ide> ruby_engine = Object.send(:remove_const, :RUBY_ENGINE) <ide> Object.const_set(:RUBY_ENGINE, "MyRuby") <del> begin <del> run_generator <del> if RbConfig::CONFIG["host_os"] =~ /darwin|linux/ <del> assert_listen_related_configuration <del> else <del> assert_no_listen_related_configuration <del> end <del> ensure <del> Object.send(:remove_const, :RUBY_ENGINE) <del> Object.const_set(:RUBY_ENGINE, ruby_engine) <add> <add> run_generator <add> if RbConfig::CONFIG["host_os"] =~ /darwin|linux/ <add> assert_listen_related_configuration <add> else <add> assert_no_listen_related_configuration <ide> end <add> ensure <add> Object.send(:remove_const, :RUBY_ENGINE) <add> Object.const_set(:RUBY_ENGINE, ruby_engine) <ide> end <ide> <ide> def test_non_inclusion_of_listen_related_configuration_if_skip_listen
1
Text
Text
add dlrm entry
7b6c1bcb3b043b8cd03714e1e8c818ed15087d51
<ide><path>community/README.md <ide> This repository provides a curated list of the GitHub repositories with machine <ide> |-------|-------|----------|------------| <ide> | [Wide & Deep](https://github.com/IntelAI/models/tree/master/benchmarks/recommendation/tensorflow/wide_deep_large_ds) | [Wide & Deep Learning for Recommender Systems](https://arxiv.org/pdf/1606.07792) | • Int8 Inference<br/>• FP32 Inference<br/>• FP32 Training | [Intel](https://github.com/IntelAI) | <ide> | [Wide & Deep](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow2/Recommendation/WideAndDeep) | [Wide & Deep Learning for Recommender Systems](https://arxiv.org/pdf/1606.07792) | • Automatic mixed precision<br/>• Multi-GPU training support with Horovod<br/>• XLA | [NVIDIA](https://github.com/NVIDIA) | <add>| [DLRM](https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow2/Recommendation/DLRM) | [Deep Learning Recommendation Model for Personalization and Recommendation Systems](https://arxiv.org/pdf/1906.00091.pdf) | • Automatic Mixed Precision<br/>• Hybrid-parallel multiGPU training using Horovod all2all<br/>• Multinode training for Pyxis/Enroot Slurm clusters<br/>• XLA<br/>• Criteo dataset preprocessing with Spark on GPU | [NVIDIA](https://github.com/NVIDIA) | <ide> <ide> ## Contributions <ide>
1
Ruby
Ruby
remove unused block arguments
dbfab58457c4a2c958718b8f67491965d879c69a
<ide><path>actionpack/lib/action_controller/metal/etag_with_template_digest.rb <ide> module EtagWithTemplateDigest <ide> class_attribute :etag_with_template_digest <ide> self.etag_with_template_digest = true <ide> <del> ActiveSupport.on_load :action_view, yield: true do |action_view_base| <add> ActiveSupport.on_load :action_view, yield: true do <ide> etag do |options| <ide> determine_template_etag(options) if etag_with_template_digest <ide> end <ide><path>actionpack/lib/action_dispatch/routing/route_set.rb <ide> def call(t, args, inner_options) <ide> private <ide> <ide> def optimized_helper(args) <del> params = parameterize_args(args) { |k| <add> params = parameterize_args(args) do <ide> raise_generation_error(args) <del> } <add> end <ide> <ide> @route.format params <ide> end
2
Javascript
Javascript
add test for nested avoided boundaries
8af90c8972ab4cfc5fdbca8c576c202ce9cadab8
<ide><path>packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js <ide> describe('ReactSuspenseWithNoopRenderer', () => { <ide> ); <ide> }); <ide> <del> it('shows the parent boundary if the inner boundary should be avoided', async () => { <add> it('shows the parent fallback if the inner fallback should be avoided', async () => { <ide> function Foo({showC}) { <ide> Scheduler.yieldValue('Foo'); <ide> return ( <ide> describe('ReactSuspenseWithNoopRenderer', () => { <ide> expect(ReactNoop.getChildren()).toEqual([span('A'), span('C'), span('B')]); <ide> }); <ide> <add> it('favors showing the inner fallback for nested top level avoided fallback', async () => { <add> function Foo({showB}) { <add> Scheduler.yieldValue('Foo'); <add> return ( <add> <Suspense <add> unstable_avoidThisFallback={true} <add> fallback={<Text text="Loading A..." />}> <add> <Text text="A" /> <add> <Suspense <add> unstable_avoidThisFallback={true} <add> fallback={<Text text="Loading B..." />}> <add> <AsyncText text="B" ms={5000} /> <add> </Suspense> <add> </Suspense> <add> ); <add> } <add> <add> ReactNoop.render(<Foo />); <add> expect(Scheduler).toFlushAndYield([ <add> 'Foo', <add> 'A', <add> 'Suspend! [B]', <add> 'Loading B...', <add> ]); <add> // Flush to skip suspended time. <add> Scheduler.advanceTime(600); <add> await advanceTimers(600); <add> <add> expect(ReactNoop.getChildren()).toEqual([span('A'), span('Loading B...')]); <add> }); <add> <add> it('keeps showing an avoided parent fallback if it is already showing', async () => { <add> function Foo({showB}) { <add> Scheduler.yieldValue('Foo'); <add> return ( <add> <Suspense fallback={<Text text="Initial load..." />}> <add> <Suspense <add> unstable_avoidThisFallback={true} <add> fallback={<Text text="Loading A..." />}> <add> <Text text="A" /> <add> {showB ? ( <add> <Suspense <add> unstable_avoidThisFallback={true} <add> fallback={<Text text="Loading B..." />}> <add> <AsyncText text="B" ms={5000} /> <add> </Suspense> <add> ) : null} <add> </Suspense> <add> </Suspense> <add> ); <add> } <add> <add> ReactNoop.render(<Foo />); <add> expect(Scheduler).toFlushAndYield(['Foo', 'A']); <add> expect(ReactNoop.getChildren()).toEqual([span('A')]); <add> <add> ReactNoop.render(<Foo showB={true} />); <add> <add> expect(Scheduler).toFlushAndYield([ <add> 'Foo', <add> 'A', <add> 'Suspend! [B]', <add> 'Loading B...', <add> ]); <add> // Still suspended. <add> expect(ReactNoop.getChildren()).toEqual([span('A')]); <add> <add> // Flush to skip suspended time. <add> Scheduler.advanceTime(600); <add> await advanceTimers(600); <add> <add> expect(ReactNoop.getChildren()).toEqual([span('A'), span('Loading B...')]); <add> }); <add> <ide> it('commits a suspended idle pri render within a reasonable time', async () => { <ide> function Foo({something}) { <ide> return (
1
Javascript
Javascript
use common.port in simple/test-regress-gh-1697
05b3f88064a3dc85f892d0ff07dbca4f90437809
<ide><path>test/simple/test-regress-GH-1697.js <ide> if (process.argv[2] === 'server') { <ide> }); <ide> }); <ide> <del> server.listen(1234, '127.0.0.1', function() { <add> server.listen(common.PORT, '127.0.0.1', function() { <ide> console.log('Server running.'); <ide> }); <ide> <ide> if (process.argv[2] === 'server') { <ide> serverProcess.stderr.pipe(process.stdout); <ide> <ide> serverProcess.stdout.once('data', function() { <del> var client = net.createConnection(1234, '127.0.0.1'); <add> var client = net.createConnection(common.PORT, '127.0.0.1'); <ide> client.on('connect', function() { <ide> var alot = new Buffer(1024), <ide> alittle = new Buffer(1);
1
Python
Python
adjust loss difference
ea46e3fa9c0fce752bdf6e73c9e0f10a8d04ae37
<ide><path>tests/test_modeling_tf_mt5.py <ide> def test_small_integration_test(self): <ide> mtf_score = -tf.math.reduce_sum(loss).numpy() <ide> <ide> EXPECTED_SCORE = -84.9127 <del> self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 1e-4) <add> self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 2e-4)
1
Javascript
Javascript
replace tt tag with code tag
69f4d0ff70530e2ad7fb93fe11d66ed96c5ac97b
<ide><path>src/ng/directive/ngSwitch.js <ide> * <ide> * @scope <ide> * @priority 1200 <del> * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>. <add> * @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>. <ide> * On child elements add: <ide> * <ide> * * `ngSwitchWhen`: the case statement to match against. If match then this <ide> <div ng-controller="ExampleController"> <ide> <select ng-model="selection" ng-options="item for item in items"> <ide> </select> <del> <tt>selection={{selection}}</tt> <add> <code>selection={{selection}}</code> <ide> <hr/> <ide> <div class="animate-switch-container" <ide> ng-switch on="selection">
1
PHP
PHP
add emulation for public properties
bd4665720e464949ef2d48e7975e55827a37987d
<ide><path>src/Network/Request.php <ide> use Cake\Core\Configure; <ide> use Cake\Network\Exception\MethodNotAllowedException; <ide> use Cake\Utility\Hash; <add>use InvalidArgumentException; <ide> <ide> /** <ide> * A class that helps wrap Request information and particulars about a single request. <ide> public function withParam($name, $value) <ide> public function withAttribute($name, $value) <ide> { <ide> $new = clone $this; <del> $new->attributes[$name] = $value; <add> $emulated = ['webroot', 'base', 'params']; <add> if (in_array($name, $emulated, true)) { <add> $new->{$name} = $value; <add> } else { <add> $new->attributes[$name] = $value; <add> } <ide> return $new; <ide> } <ide> <ide> public function withAttribute($name, $value) <ide> * @param string $name The attribute name. <ide> * @param mixed $value The value of the attribute. <ide> * @return static <add> * @throws InvalidArgumentException <ide> */ <ide> public function withoutAttribute($name) <ide> { <ide> $new = clone $this; <add> $emulated = ['webroot', 'base', 'params']; <add> if (in_array($name, $emulated, true)) { <add> throw new InvalidArgumentException( <add> "You cannot unset '$name'. It is a required CakePHP attribute." <add> ); <add> } <ide> unset($new->attributes[$name]); <ide> return $new; <ide> } <ide> public function withoutAttribute($name) <ide> */ <ide> public function getAttribute($name, $default = null) <ide> { <add> $emulated = ['webroot', 'base', 'params']; <add> if (in_array($name, $emulated, true)) { <add> return $this->{$name}; <add> } <ide> if (array_key_exists($name, $this->attributes)) { <ide> return $this->attributes[$name]; <ide> } <ide> public function getAttribute($name, $default = null) <ide> /** <ide> * Get all the attributes in the request. <ide> * <add> * This will include the params, webroot, and base attributes that CakePHP <add> * provides. <add> * <ide> * @return array <ide> */ <ide> public function getAttributes() <ide> { <del> return $this->attributes; <add> $emulated = [ <add> 'params' => $this->params, <add> 'webroot' => $this->webroot, <add> 'base' => $this->base <add> ]; <add> return $this->attributes + $emulated; <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Network/RequestTest.php <ide> public function testWithAttribute() <ide> $this->assertSame(['complex'], $update->getAttribute('key')); <ide> } <ide> <add> /** <add> * Test that withAttribute() can modify the deprecated public properties. <add> * <add> * @return void <add> */ <add> public function testWithAttributesCompatibility() <add> { <add> $request = new Request([ <add> 'params' => [ <add> 'controller' => 'Articles', <add> 'action' => 'index' <add> ], <add> 'base' => '/cakeapp', <add> 'webroot' => '/cakeapp/' <add> ]); <add> <add> $new = $request->withAttribute('base', '/replace') <add> ->withAttribute('webroot', '/replace/') <add> ->withAttribute('params', ['controller' => 'Tags']); <add> <add> // Original request should not change. <add> $this->assertSame('/cakeapp', $request->getAttribute('base')); <add> $this->assertSame('/cakeapp/', $request->getAttribute('webroot')); <add> $this->assertSame( <add> ['controller' => 'Articles', 'action' => 'index'], <add> $request->getAttribute('params') <add> ); <add> <add> $this->assertSame('/replace', $new->getAttribute('base')); <add> $this->assertSame('/replace', $new->base); <add> $this->assertSame('/replace/', $new->getAttribute('webroot')); <add> $this->assertSame('/replace/', $new->webroot); <add> <add> $this->assertSame(['controller' => 'Tags'], $new->getAttribute('params')); <add> $this->assertSame(['controller' => 'Tags'], $new->params); <add> } <add> <add> /** <add> * Test that getAttribute() can read deprecated public properties. <add> * <add> * @dataProvider emulatedPropertyProvider <add> * @return void <add> */ <add> public function testGetAttributesCompatibility($prop) <add> { <add> $request = new Request([ <add> 'params' => [ <add> 'controller' => 'Articles', <add> 'action' => 'index' <add> ], <add> 'base' => '/cakeapp', <add> 'webroot' => '/cakeapp/' <add> ]); <add> <add> $this->assertSame($request->{$prop}, $request->getAttribute($prop)); <add> } <add> <ide> /** <ide> * Test getting all attributes. <ide> * <ide> public function testGetAttributes() <ide> $expected = [ <ide> 'key' => 'value', <ide> 'nully' => null, <del> 'falsey' => false <add> 'falsey' => false, <add> 'params' => [ <add> 'plugin' => null, <add> 'controller' => null, <add> 'action' => null, <add> '_ext' => null, <add> 'pass' => [], <add> ], <add> 'webroot' => '', <add> 'base' => '' <ide> ]; <ide> $this->assertEquals($expected, $new->getAttributes()); <ide> } <ide> public function testWithoutAttribute() <ide> $this->assertNull($update->getAttribute('key')); <ide> } <ide> <add> /** <add> * Test that withoutAttribute() cannot remove deprecated public properties. <add> * <add> * @dataProvider emulatedPropertyProvider <add> * @expectedException InvalidArgumentException <add> * @return void <add> */ <add> public function testWithoutAttributesDenyEmulatedProperties($prop) <add> { <add> $request = new Request([]); <add> $request->withoutAttribute($prop); <add> } <add> <add> /** <add> * Data provider for emulated property tests. <add> * <add> * @return array <add> */ <add> public function emulatedPropertyProvider() <add> { <add> return [ <add> ['params'], <add> ['base'], <add> ['webroot'] <add> ]; <add> } <add> <ide> /** <ide> * loadEnvironment method <ide> *
2
Javascript
Javascript
fix alertios docs
404f7d9dbfbf6e1552f4502b35d067a4c54ecd15
<ide><path>Libraries/Utilities/AlertIOS.js <ide> var DEFAULT_BUTTON = { <ide> * {text: 'Foo', onPress: () => console.log('Foo Pressed!')}, <ide> * {text: 'Bar', onPress: () => console.log('Bar Pressed!')}, <ide> * ] <del> * )} <add> * ) <ide> * ``` <ide> */ <ide>
1
Go
Go
fix tmp cleanup in tests
4180579313e84ea7e3d85214521a815e95459a90
<ide><path>daemon/graphdriver/aufs/aufs_test.go <ide> import ( <ide> "crypto/sha256" <ide> "encoding/hex" <ide> "fmt" <del> "github.com/docker/docker/daemon/graphdriver" <del> "github.com/docker/docker/pkg/archive" <ide> "io/ioutil" <ide> "os" <ide> "path" <ide> "testing" <add> <add> "github.com/docker/docker/daemon/graphdriver" <add> "github.com/docker/docker/pkg/archive" <ide> ) <ide> <ide> var ( <del> tmp = path.Join(os.TempDir(), "aufs-tests", "aufs") <add> tmpOuter = path.Join(os.TempDir(), "aufs-tests") <add> tmp = path.Join(tmpOuter, "aufs") <ide> ) <ide> <ide> func testInit(dir string, t *testing.T) graphdriver.Driver { <ide> func testMountMoreThan42Layers(t *testing.T, mountPath string) { <ide> t.Fatal(err) <ide> } <ide> <del> d := testInit(mountPath, t).(*Driver) <ide> defer os.RemoveAll(mountPath) <add> d := testInit(mountPath, t).(*Driver) <ide> defer d.Cleanup() <ide> var last string <ide> var expected int <ide> func testMountMoreThan42Layers(t *testing.T, mountPath string) { <ide> <ide> if err := d.Create(current, parent); err != nil { <ide> t.Logf("Current layer %d", i) <del> t.Fatal(err) <add> t.Error(err) <ide> } <ide> point, err := d.Get(current, "") <ide> if err != nil { <ide> t.Logf("Current layer %d", i) <del> t.Fatal(err) <add> t.Error(err) <ide> } <ide> f, err := os.Create(path.Join(point, current)) <ide> if err != nil { <ide> t.Logf("Current layer %d", i) <del> t.Fatal(err) <add> t.Error(err) <ide> } <ide> f.Close() <ide> <ide> if i%10 == 0 { <ide> if err := os.Remove(path.Join(point, parent)); err != nil { <ide> t.Logf("Current layer %d", i) <del> t.Fatal(err) <add> t.Error(err) <ide> } <ide> expected-- <ide> } <ide> func testMountMoreThan42Layers(t *testing.T, mountPath string) { <ide> // Perform the actual mount for the top most image <ide> point, err := d.Get(last, "") <ide> if err != nil { <del> t.Fatal(err) <add> t.Error(err) <ide> } <ide> files, err := ioutil.ReadDir(point) <ide> if err != nil { <del> t.Fatal(err) <add> t.Error(err) <ide> } <ide> if len(files) != expected { <del> t.Fatalf("Expected %d got %d", expected, len(files)) <add> t.Errorf("Expected %d got %d", expected, len(files)) <ide> } <ide> } <ide> <ide> func TestMountMoreThan42Layers(t *testing.T) { <add> os.RemoveAll(tmpOuter) <ide> testMountMoreThan42Layers(t, tmp) <ide> } <ide> <ide> func TestMountMoreThan42LayersMatchingPathLength(t *testing.T) { <del> tmp := "aufs-tests" <add> defer os.RemoveAll(tmpOuter) <add> zeroes := "0" <ide> for { <ide> // This finds a mount path so that when combined into aufs mount options <ide> // 4096 byte boundary would be in between the paths or in permission <del> // section. For '/tmp' it will use '/tmp/aufs-tests00000000/aufs' <del> mountPath := path.Join(os.TempDir(), tmp, "aufs") <add> // section. For '/tmp' it will use '/tmp/aufs-tests/00000000/aufs' <add> mountPath := path.Join(tmpOuter, zeroes, "aufs") <ide> pathLength := 77 + len(mountPath) <ide> <ide> if mod := 4095 % pathLength; mod == 0 || mod > pathLength-2 { <ide> t.Logf("Using path: %s", mountPath) <ide> testMountMoreThan42Layers(t, mountPath) <ide> return <ide> } <del> tmp += "0" <add> zeroes += "0" <ide> } <ide> }
1
Python
Python
improve train cli sentrec scoring
d2f3a44b42bfff9773fdf3abaccdcc0e78d295f7
<ide><path>spacy/cli/train.py <ide> def _score_for_model(meta): <ide> mean_acc.append((acc["ents_p"] + acc["ents_r"] + acc["ents_f"]) / 3) <ide> if "textcat" in pipes: <ide> mean_acc.append(acc["textcat_score"]) <add> if "sentrec" in pipes: <add> mean_acc.append((acc["sent_p"] + acc["sent_r"] + acc["sent_f"]) / 3) <ide> return sum(mean_acc) / len(mean_acc) <ide> <ide> <ide> def _get_metrics(component): <ide> elif component == "ner": <ide> return ("ents_f", "ents_p", "ents_r") <ide> elif component == "sentrec": <del> return ("sent_p", "sent_r", "sent_f",) <add> return ("sent_f", "sent_p", "sent_r") <ide> return ("token_acc",) <ide> <ide>
1
Java
Java
use consistent block style
866e9d702e1db09a61fd814ae5cbb5c9b593723f
<ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java <ide> public String toString() { <ide> */ <ide> public static MethodInvocation currentInvocation() throws IllegalStateException { <ide> MethodInvocation mi = invocation.get(); <del> if (mi == null) <add> if (mi == null) { <ide> throw new IllegalStateException( <ide> "No MethodInvocation found: Check that an AOP invocation is in progress, and that the " + <ide> "ExposeInvocationInterceptor is upfront in the interceptor chain. Specifically, note that " + <ide> "advices with order HIGHEST_PRECEDENCE will execute before ExposeInvocationInterceptor!"); <add> } <ide> return mi; <ide> } <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java <ide> public Object invokeMethod(String name, Object arg) { <ide> } <ide> else if ("ref".equals(name)) { <ide> String refName; <del> if (args[0] == null) <add> if (args[0] == null) { <ide> throw new IllegalArgumentException("Argument to ref() is not a valid bean or was not found"); <add> } <ide> <ide> if (args[0] instanceof RuntimeBeanReference) { <ide> refName = ((RuntimeBeanReference) args[0]).getBeanName(); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionWrapper.java <ide> else if (FACTORY_BEAN.equals(property)) { <ide> } <ide> // factoryMethod <ide> else if (FACTORY_METHOD.equals(property)) { <del> if (newValue != null) <add> if (newValue != null) { <ide> bd.setFactoryMethodName(newValue.toString()); <add> } <ide> } <ide> // initMethod <ide> else if (INIT_METHOD.equals(property)) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public boolean equals(Object other) { <ide> <ide> AbstractBeanDefinition that = (AbstractBeanDefinition) other; <ide> <del> if (!ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName())) return false; <del> if (!ObjectUtils.nullSafeEquals(this.scope, that.scope)) return false; <del> if (this.abstractFlag != that.abstractFlag) return false; <del> if (this.lazyInit != that.lazyInit) return false; <del> <del> if (this.autowireMode != that.autowireMode) return false; <del> if (this.dependencyCheck != that.dependencyCheck) return false; <del> if (!Arrays.equals(this.dependsOn, that.dependsOn)) return false; <del> if (this.autowireCandidate != that.autowireCandidate) return false; <del> if (!ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers)) return false; <del> if (this.primary != that.primary) return false; <del> <del> if (this.nonPublicAccessAllowed != that.nonPublicAccessAllowed) return false; <del> if (this.lenientConstructorResolution != that.lenientConstructorResolution) return false; <del> if (!ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues)) return false; <del> if (!ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues)) return false; <del> if (!ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides)) return false; <del> <del> if (!ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName)) return false; <del> if (!ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName)) return false; <del> if (!ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName)) return false; <del> if (this.enforceInitMethod != that.enforceInitMethod) return false; <del> if (!ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName)) return false; <del> if (this.enforceDestroyMethod != that.enforceDestroyMethod) return false; <del> <del> if (this.synthetic != that.synthetic) return false; <del> if (this.role != that.role) return false; <add> if (!ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName())) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.scope, that.scope)) { <add> return false; <add> } <add> if (this.abstractFlag != that.abstractFlag) { <add> return false; <add> } <add> if (this.lazyInit != that.lazyInit) { <add> return false; <add> } <add> <add> if (this.autowireMode != that.autowireMode) { <add> return false; <add> } <add> if (this.dependencyCheck != that.dependencyCheck) { <add> return false; <add> } <add> if (!Arrays.equals(this.dependsOn, that.dependsOn)) { <add> return false; <add> } <add> if (this.autowireCandidate != that.autowireCandidate) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers)) { <add> return false; <add> } <add> if (this.primary != that.primary) { <add> return false; <add> } <add> <add> if (this.nonPublicAccessAllowed != that.nonPublicAccessAllowed) { <add> return false; <add> } <add> if (this.lenientConstructorResolution != that.lenientConstructorResolution) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues)) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues)) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides)) { <add> return false; <add> } <add> <add> if (!ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName)) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName)) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName)) { <add> return false; <add> } <add> if (this.enforceInitMethod != that.enforceInitMethod) { <add> return false; <add> } <add> if (!ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName)) { <add> return false; <add> } <add> if (this.enforceDestroyMethod != that.enforceDestroyMethod) { <add> return false; <add> } <add> <add> if (this.synthetic != that.synthetic) { <add> return false; <add> } <add> if (this.role != that.role) { <add> return false; <add> } <ide> <ide> return super.equals(other); <ide> } <ide><path>spring-context-indexer/src/main/java/org/springframework/context/index/CandidateComponentsIndexer.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private static List<TypeElement> staticTypesIn(Iterable<? extends Element> eleme <ide> List<TypeElement> list = new ArrayList<>(); <ide> for (Element e : elements) { <ide> if (TYPE_KINDS.contains(e.getKind()) <del> && e.getModifiers().contains(Modifier.STATIC)) <add> && e.getModifiers().contains(Modifier.STATIC)) { <ide> list.add(TypeElement.class.cast(e)); <add> } <ide> } <ide> return list; <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java <ide> protected final void refreshBeanFactory() throws BeansException { <ide> @Override <ide> protected void cancelRefresh(BeansException ex) { <ide> synchronized (this.beanFactoryMonitor) { <del> if (this.beanFactory != null) <add> if (this.beanFactory != null) { <ide> this.beanFactory.setSerializationId(null); <add> } <ide> } <ide> super.cancelRefresh(ex); <ide> } <ide><path>spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java <ide> public static boolean isReferenceTypeArray(String arraytype) { <ide> int length = arraytype.length(); <ide> for (int i = 0; i < length; i++) { <ide> char ch = arraytype.charAt(i); <del> if (ch == '[') continue; <add> if (ch == '[') { <add> continue; <add> } <ide> return ch=='L'; <ide> } <ide> return false; <ide><path>spring-jdbc/src/main/java/org/springframework/jdbc/support/GeneratedKeyHolder.java <ide> public Map<String, Object> getKeys() throws InvalidDataAccessApiUsageException { <ide> if (this.keyList.isEmpty()) { <ide> return null; <ide> } <del> if (this.keyList.size() > 1) <add> if (this.keyList.size() > 1) { <ide> throw new InvalidDataAccessApiUsageException( <ide> "The getKeys method should only be used when keys for a single row are returned. " + <ide> "The current key list contains keys for multiple rows: " + this.keyList); <add> } <ide> return this.keyList.get(0); <ide> } <ide> <ide><path>spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceUnitReader.java <ide> protected void parseManagedClasses(Element persistenceUnit, SpringPersistenceUni <ide> List<Element> classes = DomUtils.getChildElementsByTagName(persistenceUnit, MANAGED_CLASS_NAME); <ide> for (Element element : classes) { <ide> String value = DomUtils.getTextValue(element).trim(); <del> if (StringUtils.hasText(value)) <add> if (StringUtils.hasText(value)) { <ide> unitInfo.addManagedClassName(value); <add> } <ide> } <ide> } <ide> <ide><path>spring-tx/src/main/java/org/springframework/transaction/annotation/Isolation.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public enum Isolation { <ide> private final int value; <ide> <ide> <del> Isolation(int value) { this.value = value; } <add> Isolation(int value) { <add> this.value = value; <add> } <ide> <del> public int value() { return this.value; } <add> public int value() { <add> return this.value; <add> } <ide> <ide> } <ide><path>spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public enum Propagation { <ide> private final int value; <ide> <ide> <del> Propagation(int value) { this.value = value; } <add> Propagation(int value) { <add> this.value = value; <add> } <ide> <del> public int value() { return this.value; } <add> public int value() { <add> return this.value; <add> } <ide> <ide> } <ide><path>spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java <ide> protected TransactionInfo prepareTransactionInfo(@Nullable PlatformTransactionMa <ide> else { <ide> // The TransactionInfo.hasTransaction() method will return false. We created it only <ide> // to preserve the integrity of the ThreadLocal stack maintained in this class. <del> if (logger.isTraceEnabled()) <add> if (logger.isTraceEnabled()) { <ide> logger.trace("Don't need to create transaction for [" + joinpointIdentification + <ide> "]: This method isn't transactional."); <add> } <ide> } <ide> <ide> // We always bind the TransactionInfo to the thread, even if we didn't create <ide><path>spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpRequest.java <ide> else if (read == -1) { <ide> onAllDataRead(); <ide> } <ide> return null; <del> } finally { <add> } <add> finally { <ide> if (release && pooledByteBuffer.isOpen()) { <ide> pooledByteBuffer.close(); <ide> } <ide><path>spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityDecoder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private void findNextPotentialReference(int startPosition) { <ide> this.originalMessage.indexOf('&', this.nextPotentialReferencePosition); <ide> <ide> if (this.nextSemicolonPosition != -1 && <del> this.nextSemicolonPosition < this.nextPotentialReferencePosition) <add> this.nextSemicolonPosition < this.nextPotentialReferencePosition) { <ide> this.nextSemicolonPosition = this.originalMessage.indexOf(';', this.nextPotentialReferencePosition + 1); <add> } <ide> <ide> boolean isPotentialReference = (this.nextPotentialReferencePosition != -1 && <ide> this.nextSemicolonPosition != -1 && <ide> private void copyCharactersTillPotentialReference() { <ide> this.currentPosition = skipUntilIndex; <ide> } <ide> else { <del> while (this.currentPosition < skipUntilIndex) <add> while (this.currentPosition < skipUntilIndex) { <ide> this.decodedMessage.append(this.originalMessage.charAt(this.currentPosition++)); <add> } <ide> } <ide> } <ide> }
14
Ruby
Ruby
convert stringinreplaceextension test to spec
1ff6846218367fc73736039d668b319acebd8cae
<ide><path>Library/Homebrew/test/inreplace_spec.rb <add>require "extend/string" <add>require "tempfile" <add>require "utils/inreplace" <add> <add>describe StringInreplaceExtension do <add> subject { string.extend(described_class) } <add> <add> describe "#change_make_var!" do <add> context "flag" do <add> context "with spaces" do <add> let(:string) do <add> <<-EOS.undent <add> OTHER=def <add> FLAG = abc <add> FLAG2=abc <add> EOS <add> end <add> <add> it "is successfully replaced" do <add> subject.change_make_var! "FLAG", "def" <add> expect(subject).to eq <<-EOS.undent <add> OTHER=def <add> FLAG=def <add> FLAG2=abc <add> EOS <add> end <add> <add> it "is successfully appended" do <add> subject.change_make_var! "FLAG", "\\1 def" <add> expect(subject).to eq <<-EOS.undent <add> OTHER=def <add> FLAG=abc def <add> FLAG2=abc <add> EOS <add> end <add> end <add> <add> context "with tabs" do <add> let(:string) do <add> <<-EOS.undent <add> CFLAGS\t=\t-Wall -O2 <add> LDFLAGS\t=\t-lcrypto -lssl <add> EOS <add> end <add> <add> it "is successfully replaced" do <add> subject.change_make_var! "CFLAGS", "-O3" <add> expect(subject).to eq <<-EOS.undent <add> CFLAGS=-O3 <add> LDFLAGS\t=\t-lcrypto -lssl <add> EOS <add> end <add> end <add> end <add> <add> context "empty flag between other flags" do <add> let(:string) do <add> <<-EOS.undent <add> OTHER=def <add> FLAG = <add> FLAG2=abc <add> EOS <add> end <add> <add> it "is successfully replaced" do <add> subject.change_make_var! "FLAG", "def" <add> expect(subject).to eq <<-EOS.undent <add> OTHER=def <add> FLAG=def <add> FLAG2=abc <add> EOS <add> end <add> end <add> <add> context "empty flag" do <add> let(:string) do <add> <<-EOS.undent <add> FLAG = <add> mv file_a file_b <add> EOS <add> end <add> <add> it "is successfully replaced" do <add> subject.change_make_var! "FLAG", "def" <add> expect(subject).to eq <<-EOS.undent <add> FLAG=def <add> mv file_a file_b <add> EOS <add> end <add> end <add> <add> context "shell-style variable" do <add> let(:string) do <add> <<-EOS.undent <add> OTHER=def <add> FLAG=abc <add> FLAG2=abc <add> EOS <add> end <add> <add> it "is successfully replaced" do <add> subject.change_make_var! "FLAG", "def" <add> expect(subject).to eq <<-EOS.undent <add> OTHER=def <add> FLAG=def <add> FLAG2=abc <add> EOS <add> end <add> end <add> end <add> <add> describe "#remove_make_var!" do <add> context "flag" do <add> context "with spaces" do <add> let(:string) do <add> <<-EOS.undent <add> OTHER=def <add> FLAG = abc <add> FLAG2 = def <add> EOS <add> end <add> <add> it "is successfully removed" do <add> subject.remove_make_var! "FLAG" <add> expect(subject).to eq <<-EOS.undent <add> OTHER=def <add> FLAG2 = def <add> EOS <add> end <add> end <add> <add> context "with tabs" do <add> let(:string) do <add> <<-EOS.undent <add> CFLAGS\t=\t-Wall -O2 <add> LDFLAGS\t=\t-lcrypto -lssl <add> EOS <add> end <add> <add> it "is successfully removed" do <add> subject.remove_make_var! "LDFLAGS" <add> expect(subject).to eq <<-EOS.undent <add> CFLAGS\t=\t-Wall -O2 <add> EOS <add> end <add> end <add> end <add> <add> context "multiple flags" do <add> let(:string) do <add> <<-EOS.undent <add> OTHER=def <add> FLAG = abc <add> FLAG2 = def <add> OTHER2=def <add> EOS <add> end <add> <add> specify "are be successfully removed" do <add> subject.remove_make_var! ["FLAG", "FLAG2"] <add> expect(subject).to eq <<-EOS.undent <add> OTHER=def <add> OTHER2=def <add> EOS <add> end <add> end <add> end <add> <add> describe "#get_make_var" do <add> context "with spaces" do <add> let(:string) do <add> <<-EOS.undent <add> CFLAGS = -Wall -O2 <add> LDFLAGS = -lcrypto -lssl <add> EOS <add> end <add> <add> it "extracts the value for a given variable" do <add> expect(subject.get_make_var("CFLAGS")).to eq("-Wall -O2") <add> end <add> end <add> <add> context "with tabs" do <add> let(:string) do <add> <<-EOS.undent <add> CFLAGS\t=\t-Wall -O2 <add> LDFLAGS\t=\t-lcrypto -lssl <add> EOS <add> end <add> <add> it "extracts the value for a given variable" do <add> expect(subject.get_make_var("CFLAGS")).to eq("-Wall -O2") <add> end <add> end <add> end <add> <add> describe "#sub!" do <add> let(:string) { "foo" } <add> <add> it "replaces the first occurence" do <add> subject.sub!("o", "e") <add> expect(subject).to eq("feo") <add> end <add> end <add> <add> describe "#gsub!" do <add> let(:string) { "foo" } <add> <add> it "replaces the all occurences" do <add> subject.gsub!("o", "e") # rubocop:disable Performance/StringReplacement <add> expect(subject).to eq("fee") <add> end <add> end <add>end <add> <add>describe Utils::Inreplace do <add> let(:file) { Tempfile.new("test") } <add> <add> before(:each) do <add> file.write <<-EOS.undent <add> a <add> b <add> c <add> EOS <add> end <add> <add> after(:each) { file.unlink } <add> <add> it "raises error if there is nothing to replace" do <add> expect { <add> described_class.inreplace file.path, "d", "f" <add> }.to raise_error(Utils::InreplaceError) <add> end <add> <add> it "raises error if there is nothing to replace" do <add> expect { <add> described_class.inreplace(file.path) do |s| <add> s.gsub!("d", "f") # rubocop:disable Performance/StringReplacement <add> end <add> }.to raise_error(Utils::InreplaceError) <add> end <add> <add> it "raises error if there is nothing to replace" do <add> expect { <add> described_class.inreplace(file.path) do |s| <add> s.change_make_var! "VAR", "value" <add> s.remove_make_var! "VAR2" <add> end <add> }.to raise_error(Utils::InreplaceError) <add> end <add>end <ide><path>Library/Homebrew/test/inreplace_test.rb <del>require "testing_env" <del>require "extend/string" <del>require "utils/inreplace" <del> <del>class InreplaceTest < Homebrew::TestCase <del> def test_change_make_var <del> # Replace flag <del> s1 = "OTHER=def\nFLAG = abc\nFLAG2=abc" <del> s1.extend(StringInreplaceExtension) <del> s1.change_make_var! "FLAG", "def" <del> assert_equal "OTHER=def\nFLAG=def\nFLAG2=abc", s1 <del> end <del> <del> def test_change_make_var_empty <del> # Replace empty flag <del> s1 = "OTHER=def\nFLAG = \nFLAG2=abc" <del> s1.extend(StringInreplaceExtension) <del> s1.change_make_var! "FLAG", "def" <del> assert_equal "OTHER=def\nFLAG=def\nFLAG2=abc", s1 <del> end <del> <del> def test_change_make_var_empty_2 <del> # Replace empty flag <del> s1 = "FLAG = \nmv file_a file_b" <del> s1.extend(StringInreplaceExtension) <del> s1.change_make_var! "FLAG", "def" <del> assert_equal "FLAG=def\nmv file_a file_b", s1 <del> end <del> <del> def test_change_make_var_append <del> # Append to flag <del> s1 = "OTHER=def\nFLAG = abc\nFLAG2=abc" <del> s1.extend(StringInreplaceExtension) <del> s1.change_make_var! "FLAG", "\\1 def" <del> assert_equal "OTHER=def\nFLAG=abc def\nFLAG2=abc", s1 <del> end <del> <del> def test_change_make_var_shell_style <del> # Shell variables have no spaces around = <del> s1 = "OTHER=def\nFLAG=abc\nFLAG2=abc" <del> s1.extend(StringInreplaceExtension) <del> s1.change_make_var! "FLAG", "def" <del> assert_equal "OTHER=def\nFLAG=def\nFLAG2=abc", s1 <del> end <del> <del> def test_remove_make_var <del> # Replace flag <del> s1 = "OTHER=def\nFLAG = abc\nFLAG2 = def" <del> s1.extend(StringInreplaceExtension) <del> s1.remove_make_var! "FLAG" <del> assert_equal "OTHER=def\nFLAG2 = def", s1 <del> end <del> <del> def test_remove_make_vars <del> # Replace flag <del> s1 = "OTHER=def\nFLAG = abc\nFLAG2 = def\nOTHER2=def" <del> s1.extend(StringInreplaceExtension) <del> s1.remove_make_var! ["FLAG", "FLAG2"] <del> assert_equal "OTHER=def\nOTHER2=def", s1 <del> end <del> <del> def test_get_make_var <del> s = "CFLAGS = -Wall -O2\nLDFLAGS = -lcrypto -lssl" <del> s.extend(StringInreplaceExtension) <del> assert_equal "-Wall -O2", s.get_make_var("CFLAGS") <del> end <del> <del> def test_change_make_var_with_tabs <del> s = "CFLAGS\t=\t-Wall -O2\nLDFLAGS\t=\t-lcrypto -lssl" <del> s.extend(StringInreplaceExtension) <del> <del> assert_equal "-Wall -O2", s.get_make_var("CFLAGS") <del> <del> s.change_make_var! "CFLAGS", "-O3" <del> assert_equal "CFLAGS=-O3\nLDFLAGS\t=\t-lcrypto -lssl", s <del> <del> s.remove_make_var! "LDFLAGS" <del> assert_equal "CFLAGS=-O3\n", s <del> end <del> <del> def test_sub_gsub <del> s = "foo" <del> s.extend(StringInreplaceExtension) <del> <del> s.sub!("f", "b") <del> assert_equal "boo", s <del> <del> # Under current context, we are testing `String#gsub!`, so let's disable rubocop temporarily. <del> s.gsub!("o", "e") # rubocop:disable Performance/StringReplacement <del> assert_equal "bee", s <del> end <del> <del> def test_inreplace_errors <del> require "tempfile" <del> extend(Utils::Inreplace) <del> <del> file = Tempfile.new("test") <del> <del> file.write "a\nb\nc\n" <del> <del> assert_raises(Utils::InreplaceError) do <del> inreplace file.path, "d", "f" <del> end <del> <del> assert_raises(Utils::InreplaceError) do <del> # Under current context, we are testing `String#gsub!`, so let's disable rubocop temporarily. <del> inreplace(file.path) { |s| s.gsub!("d", "f") } # rubocop:disable Performance/StringReplacement <del> end <del> <del> assert_raises(Utils::InreplaceError) do <del> inreplace(file.path) do |s| <del> s.change_make_var! "VAR", "value" <del> s.remove_make_var! "VAR2" <del> end <del> end <del> ensure <del> file.unlink <del> end <del>end
2
Text
Text
fix typos in shadows article
d69010e1b87a1ec24b50aec3a1ae2b5fac8c0567
<ide><path>threejs/lessons/threejs-shadows.md <ide> Description: Shadows in Three.js <ide> This article is part of a series of articles about three.js. The <ide> first article is [three.js fundamentals](threejs-fundamentals.html). If <ide> you haven't read that yet and you're new to three.js you might want to <del>consider starting there. The <add>consider starting there. The <ide> [previous article was about cameras](threejs-cameras.html) which is <ide> important to have read before you read this article as well as <ide> the [article before that one about lights](threejs-lights.html). <ide> <ide> Shadows on computers can be a complicated topic. There are various <ide> solutions and all of them have tradeoffs including the solutions <del>available in three.js <add>available in three.js. <ide> <ide> Three.js by default uses *shadow maps*. The way a shadow map works <ide> is, *for every light that casts shadows all objects marked to cast <ide> shadows are rendered from the point of view of the light*. **READ THAT <del>AGAIN!** and let it sink in. <add>AGAIN!** and let it sink in. <ide> <ide> In other words, if you have 20 objects, and 5 lights, and <ide> all 20 objects are casting shadows and all 5 lights are casting <ide> shadows then your entire scene will be drawn 6 times. All 20 objects <del>will be drawn for light #1, then all 20 objects will be drawn for <add>will be drawn for light #1, then all 20 objects will be drawn for <ide> light #2, then #3, etc and finally the actual scene will be drawn <ide> using data from the first 5 renders. <ide> <ide> lighting or static lighting hints but at least it's fast. We'll <ide> cover both of those in another article. <ide> <ide> Another solution is to use fake shadows. Make a plane, put a grayscale <del>texture in the plane that approximates a shadow, <add>texture in the plane that approximates a shadow, <ide> draw it above the ground below your object. <ide> <ide> For example let's use this texture as a fake shadow <ide> a `MeshBasicMaterial` as we don't need lighting for the ground. <ide> <ide> Note we're setting the color to `1.5, 1.5, 1.5`. This will multiply the checkerboard <ide> texture's colors by 1.5, 1.5, 1.5. Since the texture's colors are 0x808080 and 0xC0C0C0 <del>which is medium gray and light gray, multiplying them by 1.5 will give is a white and <add>which is medium gray and light gray, multiplying them by 1.5 will give us a white and <ide> light grey checkerboard. <ide> <ide> Let's load the shadow texture <ide> const shadowGeo = new THREE.PlaneBufferGeometry(planeSize, planeSize); <ide> Now we'll make a bunch of spheres. For each sphere we'll create a `base` <ide> `THREE.Object3D` and we'll make both the shadow plane mesh and the sphere mesh <ide> children of the base. That way if we move the base both the sphere and the shadow <del>will move. We need to put the shadow slightly above the ground to prevent z-fighting. <add>will move. We need to put the shadow slightly above the ground to prevent z-fighting. <ide> We also set `depthWrite` to false so that the shadows don't mess each other up. <ide> We'll go over both of these issues in [another article](threejs-transparency.html). <ide> The shadow is a `MeshBasicMaterial` because it doesn't need lighting. <ide> the shadow mesh and the initial y position of each sphere. <ide> ```js <ide> const numSpheres = 15; <ide> for (let i = 0; i < numSpheres; ++i) { <del> // make a base for the shadow and the sphere. <add> // make a base for the shadow and the sphere <ide> // so they move together. <ide> const base = new THREE.Object3D(); <ide> scene.add(base); <ide> The other is a `DirectionalLight` so the spheres get some defintion <ide> It would render as is but let's animate there spheres. <ide> For each sphere, shadow, base set we move the base in the xz plane, we <ide> move the sphere up and down using `Math.abs(Math.sin(time))` <del>which gives us a bouncy animation. And, we also set the shadow material's <add>which gives us a bouncy animation. And, we also set the shadow material's <ide> opacity so that as each sphere goes higher its shadow fades out. <ide> <ide> ```js <ide> function render(time) { <ide> // u is a value that goes from 0 to 1 as we iterate the spheres <ide> const u = ndx / sphereShadowBases.length; <ide> <del> // compute a position for there base. This will move <add> // compute a position for the base. This will move <ide> // both the sphere and its shadow <ide> const speed = time * .2; <ide> const angle = speed + u * Math.PI * 2 * (ndx % 1 ? 1 : -1); <ide> And here's 15 kind of bouncing balls. <ide> In some apps it's common to use a round or oval shadow for everything but <ide> of course you could also use different shaped shadow textures. You might also <ide> give the shadow a harder edge. A good example of using this type <del>of shadow is [Animal Crossing Pocket Camp](https://www.google.com/search?tbm=isch&q=animal+crossing+pocket+camp+screenshots) <add>of shadow is [Animal Crossing Pocket Camp](https://www.google.com/search?tbm=isch&q=animal+crossing+pocket+camp+screenshots) <ide> where you can see each character has a simple round shadow. It's effective and cheap. <del>[Monument Valley](https://www.google.com/search?q=monument+valley+screenshots&tbm=isch) <add>[Monument Valley](https://www.google.com/search?q=monument+valley+screenshots&tbm=isch) <ide> appears to also use this kind of shadow for the main character. <ide> <del>So, moving on to shadow maps, there are 3 lights with can cast shadows. The `DirectionalLight`, <add>So, moving on to shadow maps, there are 3 lights which can cast shadows. The `DirectionalLight`, <ide> the `PointLight`, and the `SpotLight`. <ide> <del>Let's start with the `DirectionaLight` with helper example from [the lights article](threejs-lights.html). <add>Let's start with the `DirectionaLight` with the helper example from [the lights article](threejs-lights.html). <ide> <ide> The first thing we need to do is turn on shadows in the renderer. <ide> <ide> what's inside the light's shadow camera box is where shadows are drawn. <ide> <ide> We can adjust the size of that box by adjusting the light's shadow camera. <ide> <del>Let's add some GUI setting to adjust the light's shadow camera box. Since a <del>`DirectionalLight` represents light all going in a parallel direction the <add>Let's add some GUI setting to adjust the light's shadow camera box. Since a <add>`DirectionalLight` represents light all going in a parallel direction, the <ide> `DirectionalLight` uses an `OrthographicCamera` for its shadow camera. <del>We went over how an `OrthographicCamera` works in [the previous article about cameras.](threejs-cameras.html). <add>We went over how an `OrthographicCamera` works in [the previous article about cameras](threejs-cameras.html). <ide> <ide> Recall an `OrthographicCamera` defines <ide> its box or *view frustum* by its `left`, `right`, `top`, `bottom`, `near`, `far`, <ide> and you might see something like this <ide> <ide> <div class="threejs_center"><img src="resources/images/low-res-shadow-map.png" style="width: 369px"></div> <ide> <del>What's going on with these low-res shadows! <add>What's going on with these low-res shadows?! <ide> <del>This issue is yet another shadow related setting to be aware of. <del>Shadow maps are textures the shadows get drawn into. <add>This issue is yet another shadow related setting to be aware of. <add>Shadow maps are textures the shadows get drawn into. <ide> Those textures have a size. The shadow camera's area we set above is stretched <del>across that size. That means the larger area you set the more blocky your shadows will <add>across that size. That means the larger area you set, the more blocky your shadows will <ide> be. <ide> <ide> You can set the resolution of the shadow map's texture by setting `light.shadow.mapSize.width` <ide> and `light.shadow.mapSize.height`. They default to 512x512. <ide> The larger you make them the more memory they take and the slower they are to compute so you want <ide> to set them as small as you can and still make your scene work. The same is true with the <del>light's shadow camera area. Smaller means better looking shadows so make the area as small as you <add>light's shadow camera area. Smaller means better looking shadows so make the area as small as you <ide> can and still cover your scene. Be aware that each user's machine has a maximum texture size <ide> allowed which is available on the renderer as [`renderer.capabilities.maxTextureSize`](WebGLRenderer.capabilities). <ide> <ide> each one pointing to the face of a cube around the light. This means <ide> `PointLight` shadows are much slower since the entire scene must be <ide> drawn 6 times, one for each direction. <ide> <del>Let's put a box around our scene so we can see shadows on the walls <del>and ceiling. We'll set the material's `side` property to `THREE.BackSide` <add>Let's put a box around our scene so we can see shadows on the walls <add>and ceiling. We'll set the material's `side` property to `THREE.BackSide` <ide> so we render the inside of the box instead of the outside. Like the floor <ide> we'll set it only to receive shadows. Also we'll set the position of the <ide> box so its bottom is slightly below the floor so the floor and the bottom
1
PHP
PHP
add docs to translation marshalling tests
c8bf49a21e078e6ef4fed318e371f8202ac7a674
<ide><path>tests/TestCase/ORM/MarshallerTest.php <ide> public function testAssociationNoChanges() <ide> $this->assertTrue($entity->user->isNew()); <ide> } <ide> <add> /** <add> * Test that primary key meta data is being read from the table <add> * and not the schema reflection when handling belongsToMany associations. <add> * <add> * @return void <add> */ <ide> public function testEnsurePrimaryKeyBeingReadFromTableForHandlingEmptyStringPrimaryKey() <ide> { <ide> $data = [ <ide> public function testEnsurePrimaryKeyBeingReadFromTableForHandlingEmptyStringPrim <ide> $this->assertNull($result->id); <ide> } <ide> <add> /** <add> * Test that primary key meta data is being read from the table <add> * and not the schema reflection when handling belongsToMany associations. <add> * <add> * @return void <add> */ <ide> public function testEnsurePrimaryKeyBeingReadFromTableWhenLoadingBelongsToManyRecordsByPrimaryKey() <ide> { <ide> $data = [ <ide> public function testEnsurePrimaryKeyBeingReadFromTableWhenLoadingBelongsToManyRe <ide> $this->assertEquals($expected, $result->toArray()); <ide> } <ide> <add> <add> /** <add> * Test one() propagates validation errors up. <add> * <add> * @return void <add> * @todo Move to TranslateBehavior test. <add> */ <ide> public function testMergeTranslationsWithOneMethod() <ide> { <ide> $this->articles->behaviors()->load('Translate', [ <ide> public function testMergeTranslationsWithOneMethod() <ide> $this->assertEquals($data['_translations']['en'], $translations['en']->toArray()); <ide> } <ide> <add> /** <add> * Test one() propagates validation errors up. <add> * <add> * @return void <add> * @todo Move to TranslateBehavior test. <add> */ <ide> public function testMergeTranslationsWithOneMethodAndReturnErrors() <ide> { <ide> $this->articles->behaviors()->load('Translate', [ <ide> public function testMergeTranslationsWithOneMethodAndReturnErrors() <ide> $this->assertEquals($expected, $errors['_translations']); <ide> } <ide> <del> public function testMergeTransaltionsWithMergeMethod() <add> /** <add> * Test merge() creates new translations. <add> * <add> * @return void <add> * @todo Move to TranslateBehavior test. <add> */ <add> public function testMergeTranslationsWithMergeMethodNewTranslations() <ide> { <ide> $this->articles->behaviors()->load('Translate', [ <ide> 'fields' => ['title', 'body'] <ide> public function testMergeTransaltionsWithMergeMethod() <ide> $this->assertEquals($data['_translations']['en'], $translations['en']->toArray()); <ide> } <ide> <add> /** <add> * Test that adding _translations to fieldList allows <add> * all translated entities in. <add> * <add> * @return void <add> * @todo Move to TranslateBehavior test. <add> */ <ide> public function testMergeTranslationsWithOneMethodWithFieldList() <ide> { <ide> $this->articles->behaviors()->load('Translate', [ <ide> 'fields' => ['title', 'body'], <del> 'validator' => 'custom' <ide> ]); <ide> <del> $validator = (new Validator)->add('title', 'notBlank', ['rule' => 'notBlank']); <del> $this->articles->validator('custom', $validator); <del> <ide> $data = [ <ide> 'author_id' => 1, <ide> '_translations' => [ <ide> public function testMergeTranslationsWithOneMethodWithFieldList() <ide> $marshall = new Marshaller($this->articles); <ide> $result = $marshall->one($data, ['fieldList' => ['author_id', 'title', '_translations']]); <ide> <del> $expected = [ <del> 'en' => [ <del> 'title' => 'English Title' <del> ], <del> 'es' => [ <del> 'title' => 'Titulo Español' <del> ] <del> ]; <del> $translations = $result->get('_translations'); <del> <ide> $this->assertTrue($result->has('author_id')); <ide> $this->assertEmpty($result->errors()); <del> $this->assertEquals($expected['en'], $translations['en']->toArray()); <del> $this->assertEquals($expected['es'], $translations['es']->toArray()); <add> <add> $translations = $result->get('_translations'); <add> $this->assertEquals(['title' => 'English Title'], $translations['en']->toArray()); <add> $this->assertEquals(['title' => 'Titulo Español'], $translations['es']->toArray()); <ide> } <ide> <add> /** <add> * Test merge() with translations and failing validation rules. <add> * <add> * @return void <add> * @todo Move to TranslateBehavior test. <add> */ <ide> public function testMergeTranslationsWithMergeMethodAndReturnErrors() <ide> { <ide> $this->articles->behaviors()->load('Translate', [ <ide> public function testMergeTranslationsWithMergeMethodAndReturnErrors() <ide> ] <ide> ]; <ide> $errors = $result->errors(); <del> $this->assertArrayHasKey('_translations', $errors); <del> $this->assertEquals($expected, $errors['_translations']); <add> $this->assertArrayHasKey('_translations', $errors, 'Validation errors should propagate up'); <add> $this->assertEquals($expected, $errors['_translations'], 'Translation validation errors should match'); <ide> } <ide> <add> /** <add> * test merge with translations and passing validation rules applied <add> * <add> * @return void <add> * @todo Move to TranslateBehavior test. <add> */ <ide> public function testMergeTranslationsWithMergeMethodUpdateFields() <ide> { <ide> $this->articles->behaviors()->load('Translate', [
1
Text
Text
fix find and replace typo in dockerimages
a4b2de674c7030e70f671d5d6dcedb0c7ca5b0cd
<ide><path>docs/userguide/dockerimages.md <ide> If you don't specify a variant, for example you just use `ubuntu`, then Docker <ide> will default to using the `ubuntu:latest` image. <ide> <ide> > **Tip:** <del>> You recommend you always use a specific tagged image, for example <del>> `ubuntu:12.04`. That way you always know exactly what variant of an image is <del>> being used. <add>> You should always specify an image tag, for example `ubuntu:14.04`. <add>> That way, you always know exactly what variant of an image you are using. <add>> This is useful for troubleshooting and debugging. <ide> <ide> ## Getting a new image <ide>
1
Ruby
Ruby
remove "circular require considered harmful" error
b79e4223f7b9ddcda1d64ceb8807f91de16e100f
<ide><path>railties/lib/rails/generators.rb <ide> activesupport_path = File.expand_path('../../../../activesupport/lib', __FILE__) <ide> $:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path) <ide> <add>require 'thor/group' <add> <ide> require 'active_support' <ide> require 'active_support/core_ext/object/blank' <ide> require 'active_support/core_ext/kernel/singleton_class' <ide> require 'active_support/core_ext/module/attribute_accessors' <ide> require 'active_support/core_ext/string/inflections' <ide> <del>require 'rails/generators/base' <del> <ide> module Rails <ide> module Generators <ide> autoload :Actions, 'rails/generators/actions' <ide><path>railties/lib/rails/generators/base.rb <ide> end <ide> <ide> require 'rails/generators' <del>require 'rails/generators/actions' <ide> <ide> module Rails <ide> module Generators
2
PHP
PHP
add absolute parameter to signed routes
a0b4d25c1b795cd81cacda1a1407ecc191151c4c
<ide><path>src/Illuminate/Routing/UrlGenerator.php <ide> public function formatScheme($secure = null) <ide> * @param string $name <ide> * @param array $parameters <ide> * @param \DateTimeInterface|int $expiration <add> * @param bool $absolute <ide> * @return string <ide> */ <del> public function signedRoute($name, $parameters = [], $expiration = null) <add> public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true) <ide> { <ide> $parameters = $this->formatParameters($parameters); <ide> <ide> public function signedRoute($name, $parameters = [], $expiration = null) <ide> <ide> return $this->route($name, $parameters + [ <ide> 'signature' => hash_hmac('sha256', $this->route($name, $parameters), $key), <del> ]); <add> ], $absolute); <ide> } <ide> <ide> /** <ide> public function signedRoute($name, $parameters = [], $expiration = null) <ide> * @param string $name <ide> * @param \DateTimeInterface|int $expiration <ide> * @param array $parameters <add> * @param bool $absolute <ide> * @return string <ide> */ <del> public function temporarySignedRoute($name, $expiration, $parameters = []) <add> public function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true) <ide> { <del> return $this->signedRoute($name, $parameters, $expiration); <add> return $this->signedRoute($name, $parameters, $expiration, $absolute); <ide> } <ide> <ide> /**
1
Javascript
Javascript
move error checking and display
5c97a30a6e4101d7ee19d128a05b7d35ede2f3be
<ide><path>src/renderers/webgl/WebGLProgram.js <ide> import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, Equirecta <ide> <ide> var programIdCount = 0; <ide> <add>function addLineNumbers( string ) { <add> <add> var lines = string.split( '\n' ); <add> <add> for ( var i = 0; i < lines.length; i ++ ) { <add> <add> lines[ i ] = ( i + 1 ) + ': ' + lines[ i ]; <add> <add> } <add> <add> return lines.join( '\n' ); <add> <add>} <add> <ide> function getEncodingComponents( encoding ) { <ide> <ide> switch ( encoding ) { <ide> function getEncodingComponents( encoding ) { <ide> <ide> } <ide> <add>function getShaderErrors( gl, shader ) { <add> <add> var status = gl.getShaderParameter( shader, gl.COMPILE_STATUS ); <add> var source = gl.getShaderSource( shader ); <add> var log = gl.getShaderInfoLog( shader ).trim(); <add> var type = gl.getShaderParameter( shader, gl.SHADER_TYPE ) === gl.VERTEX_SHADER ? 'vertex' : 'fragment'; <add> <add> if ( status && log === '' ) return ''; <add> <add> // --enable-privileged-webgl-extension <add> // console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); <add> <add> return 'THREE.WebGLShader: gl.getShaderInfoLog() ' + type + ' ' + log + addLineNumbers( source ); <add> <add>} <add> <ide> function getTexelDecodingFunction( functionName, encoding ) { <ide> <ide> var components = getEncodingComponents( encoding ); <ide> function WebGLProgram( renderer, extensions, code, material, shader, parameters, <ide> var programLog = gl.getProgramInfoLog( program ).trim(); <ide> var vertexLog = gl.getShaderInfoLog( glVertexShader ).trim(); <ide> var fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim(); <add> var vertexErrors = getShaderErrors( gl, glVertexShader ); <add> var fragmentErrors = getShaderErrors( gl, glFragmentShader ); <ide> <ide> var runnable = true; <ide> var haveDiagnostics = true; <ide> <del> // console.log( '**VERTEX**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) ); <del> // console.log( '**FRAGMENT**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) ); <del> <ide> if ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) { <ide> <ide> runnable = false; <ide> <del> console.error( 'THREE.WebGLProgram: shader error: ', gl.getError(), 'gl.VALIDATE_STATUS', gl.getProgramParameter( program, gl.VALIDATE_STATUS ), 'gl.getProgramInfoLog', programLog, vertexLog, fragmentLog ); <add> console.error( 'THREE.WebGLProgram: shader error: ', gl.getError(), 'gl.VALIDATE_STATUS', gl.getProgramParameter( program, gl.VALIDATE_STATUS ), 'gl.getProgramInfoLog', programLog, vertexErrors, fragmentErrors ); <ide> <ide> } else if ( programLog !== '' ) { <ide> <ide><path>src/renderers/webgl/WebGLShader.js <ide> * @author mrdoob / http://mrdoob.com/ <ide> */ <ide> <del>function addLineNumbers( string ) { <del> <del> var lines = string.split( '\n' ); <del> <del> for ( var i = 0; i < lines.length; i ++ ) { <del> <del> lines[ i ] = ( i + 1 ) + ': ' + lines[ i ]; <del> <del> } <del> <del> return lines.join( '\n' ); <del> <del>} <del> <del>function WebGLShader( gl, type, string, debug ) { <add>function WebGLShader( gl, type, string ) { <ide> <ide> var shader = gl.createShader( type ); <ide> <ide> gl.shaderSource( shader, string ); <ide> gl.compileShader( shader ); <ide> <del> if ( debug === true ) { <del> <del> if ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === false ) { <del> <del> console.error( 'THREE.WebGLShader: Shader couldn\'t compile.' ); <del> <del> } <del> <del> if ( gl.getShaderInfoLog( shader ) !== '' ) { <del> <del> console.warn( 'THREE.WebGLShader: gl.getShaderInfoLog()', type === gl.VERTEX_SHADER ? 'vertex' : 'fragment', gl.getShaderInfoLog( shader ), addLineNumbers( string ) ); <del> <del> } <del> <del> } <del> <del> // --enable-privileged-webgl-extension <del> // console.log( type, gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); <del> <ide> return shader; <ide> <ide> } <ide> <del> <ide> export { WebGLShader };
2
Ruby
Ruby
remove unneeded scripts prior to installation
c062429dddebf52f1cf218b190d00a3a34d2f7d1
<ide><path>Library/Homebrew/language/node.rb <ide> def self.pack_for_installation <ide> # fed to `npm install` only symlinks are created linking back to that <ide> # directory, consequently breaking that assumption. We require a tarball <ide> # because npm install creates a "real" installation when fed a tarball. <add> if (package = Pathname("package.json")) && package.exist? <add> begin <add> pkg_json = JSON.parse(package.read) <add> rescue JSON::ParserError <add> $stderr.puts "Could not parse package.json" <add> raise <add> end <add> prepare_removed = pkg_json["scripts"]&.delete("prepare") <add> prepack_removed = pkg_json["scripts"]&.delete("prepack") <add> package.atomic_write(JSON.pretty_generate(pkg_json)) if prepare_removed || prepack_removed <add> end <ide> output = Utils.popen_read("npm pack --ignore-scripts") <ide> raise "npm failed to pack #{Dir.pwd}" if !$CHILD_STATUS.exitstatus.zero? || output.lines.empty? <ide>
1
Go
Go
remove integration/utils setraw funcs
63331abbcadee3528f3e03f96cff1ca6a506cc9e
<ide><path>daemon/container.go <ide> import ( <ide> "syscall" <ide> "time" <ide> <del> "github.com/docker/libcontainer" <ide> "github.com/docker/libcontainer/configs" <ide> "github.com/docker/libcontainer/devices" <ide> "github.com/docker/libcontainer/label" <ide> func (container *Container) Exposes(p nat.Port) bool { <ide> return exists <ide> } <ide> <del>func (container *Container) GetPtyMaster() (libcontainer.Console, error) { <del> ttyConsole, ok := container.command.ProcessConfig.Terminal.(execdriver.TtyTerminal) <del> if !ok { <del> return nil, ErrNoTTY <del> } <del> return ttyConsole.Master(), nil <del>} <del> <ide> func (container *Container) HostConfig() *runconfig.HostConfig { <ide> container.Lock() <ide> res := container.hostConfig <ide><path>integration/utils.go <ide> import ( <ide> "time" <ide> <ide> "github.com/docker/docker/daemon" <del> "github.com/docker/docker/pkg/term" <ide> ) <ide> <ide> func closeWrap(args ...io.Closer) error { <ide> func closeWrap(args ...io.Closer) error { <ide> return nil <ide> } <ide> <del>func setRaw(t *testing.T, c *daemon.Container) *term.State { <del> pty, err := c.GetPtyMaster() <del> if err != nil { <del> t.Fatal(err) <del> } <del> state, err := term.MakeRaw(pty.Fd()) <del> if err != nil { <del> t.Fatal(err) <del> } <del> return state <del>} <del> <del>func unsetRaw(t *testing.T, c *daemon.Container, state *term.State) { <del> pty, err := c.GetPtyMaster() <del> if err != nil { <del> t.Fatal(err) <del> } <del> term.RestoreTerminal(pty.Fd(), state) <del>} <del> <ide> func waitContainerStart(t *testing.T, timeout time.Duration) *daemon.Container { <ide> var container *daemon.Container <ide>
2
Python
Python
move selfattentionmask to keras_nlp
28f70bc455ad61f333814883b2f34d7cf0e066c2
<ide><path>official/nlp/keras_nlp/layers/__init__.py <ide> # ============================================================================== <ide> """Keras-NLP layers package definition.""" <ide> from official.nlp.keras_nlp.layers.position_embedding import PositionEmbedding <add>from official.nlp.keras_nlp.layers.self_attention_mask import SelfAttentionMask <ide> from official.nlp.keras_nlp.layers.transformer_encoder_block import TransformerEncoderBlock <ide><path>official/nlp/keras_nlp/layers/self_attention_mask.py <add># Copyright 2020 The TensorFlow Authors. All Rights Reserved. <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>"""Keras layer that creates a self-attention mask.""" <add> <add>import tensorflow as tf <add> <add> <add>@tf.keras.utils.register_keras_serializable(package='keras_nlp') <add>class SelfAttentionMask(tf.keras.layers.Layer): <add> """Create 3D attention mask from a 2D tensor mask. <add> <add> inputs[0]: from_tensor: 2D or 3D Tensor of shape <add> [batch_size, from_seq_length, ...]. <add> inputs[1]: to_mask: int32 Tensor of shape [batch_size, to_seq_length]. <add> <add> Returns: <add> float Tensor of shape [batch_size, from_seq_length, to_seq_length]. <add> """ <add> <add> def call(self, inputs, to_mask): <add> from_shape = tf.shape(inputs) <add> batch_size = from_shape[0] <add> from_seq_length = from_shape[1] <add> <add> to_shape = tf.shape(to_mask) <add> to_seq_length = to_shape[1] <add> <add> to_mask = tf.cast( <add> tf.reshape(to_mask, [batch_size, 1, to_seq_length]), <add> dtype=inputs.dtype) <add> <add> # We don't assume that `from_tensor` is a mask (although it could be). We <add> # don't actually care if we attend *from* padding tokens (only *to* padding) <add> # tokens so we create a tensor of all ones. <add> # <add> # `broadcast_ones` = [batch_size, from_seq_length, 1] <add> broadcast_ones = tf.ones( <add> shape=[batch_size, from_seq_length, 1], dtype=inputs.dtype) <add> <add> # Here we broadcast along two dimensions to create the mask. <add> mask = broadcast_ones * to_mask <add> <add> return mask
2
Text
Text
update directory path and update bashrc file
652cf785dffb8b7a8cbee6f8ccf48f782a19ac7c
<ide><path>research/object_detection/g3doc/installation.md <ide> cp -r pycocotools <path_to_tensorflow>/models/research/ <ide> The Tensorflow Object Detection API uses Protobufs to configure model and <ide> training parameters. Before the framework can be used, the Protobuf libraries <ide> must be compiled. This should be done by running the following command from <del>the tensorflow/models/research/ directory: <add>the [tensorflow/models/research/](https://github.com/tensorflow/models/tree/master/research/) directory: <ide> <ide> <ide> ``` bash <ide> export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim <ide> Note: This command needs to run from every new terminal you start. If you wish <ide> to avoid running this manually, you can add it as a new line to the end of your <ide> ~/.bashrc file, replacing \`pwd\` with the absolute path of <del>tensorflow/models/research on your system. <add>tensorflow/models/research on your system. After updating ~/.bashrc file you can run the following command: <add> <add>``` bash <add>source ~/.bashrc <add>``` <ide> <ide> # Testing the Installation <ide>
1
Python
Python
add an explanation about padding in conv1d
78be823518e3b1aedc0e07949b4cb97a593fa3d3
<ide><path>keras/layers/convolutional.py <ide> class Conv1D(_Conv): <ide> Specifying any stride value != 1 is incompatible with specifying <ide> any `dilation_rate` value != 1. <ide> padding: One of `"valid"`, `"causal"` or `"same"` (case-insensitive). <add> `"valid"` means "no padding". <add> `"same"` results in padding the input such that <add> the output has the same length as the original input. <ide> `"causal"` results in causal (dilated) convolutions, e.g. output[t] <ide> does not depend on input[t+1:]. Useful when modeling temporal data <ide> where the model should not violate the temporal order.
1
Go
Go
fix deadlock on cancelling healthcheck
89b123473774248fc3a0356dd3ce5b116cc69b29
<ide><path>container/health.go <ide> func (s *Health) OpenMonitorChannel() chan struct{} { <ide> func (s *Health) CloseMonitorChannel() { <ide> if s.stop != nil { <ide> logrus.Debug("CloseMonitorChannel: waiting for probe to stop") <del> // This channel does not buffer. Once the write succeeds, the monitor <del> // has read the stop request and will not make any further updates <del> // to c.State.Health. <del> s.stop <- struct{}{} <add> close(s.stop) <ide> s.stop = nil <ide> logrus.Debug("CloseMonitorChannel done") <ide> } <ide><path>daemon/health.go <ide> func (p *cmdProbe) run(ctx context.Context, d *Daemon, container *container.Cont <ide> } <ide> <ide> // Update the container's Status.Health struct based on the latest probe's result. <del>func handleProbeResult(d *Daemon, c *container.Container, result *types.HealthcheckResult) { <add>func handleProbeResult(d *Daemon, c *container.Container, result *types.HealthcheckResult, done chan struct{}) { <ide> c.Lock() <ide> defer c.Unlock() <ide> <add> // probe may have been cancelled while waiting on lock. Ignore result then <add> select { <add> case <-done: <add> return <add> default: <add> } <add> <ide> retries := c.Config.Healthcheck.Retries <ide> if retries <= 0 { <ide> retries = defaultProbeRetries <ide> func monitor(d *Daemon, c *container.Container, stop chan struct{}, probe probe) <ide> cancelProbe() <ide> return <ide> case result := <-results: <del> handleProbeResult(d, c, result) <add> handleProbeResult(d, c, result, stop) <ide> // Stop timeout <ide> cancelProbe() <ide> case <-ctx.Done(): <ide> func monitor(d *Daemon, c *container.Container, stop chan struct{}, probe probe) <ide> Output: fmt.Sprintf("Health check exceeded timeout (%v)", probeTimeout), <ide> Start: startTime, <ide> End: time.Now(), <del> }) <add> }, stop) <ide> cancelProbe() <ide> // Wait for probe to exit (it might take a while to respond to the TERM <ide> // signal and we don't want dying probes to pile up). <ide><path>daemon/health_test.go <ide> func TestHealthStates(t *testing.T) { <ide> Start: startTime, <ide> End: startTime, <ide> ExitCode: exitCode, <del> }) <add> }, nil) <ide> } <ide> <ide> // starting -> failed -> success -> failed
3
Javascript
Javascript
replace symbol.iterator by symboliterator
c101251a95cc82142bee4637f8db6cc360a06d82
<ide><path>lib/internal/streams/buffer_list.js <ide> 'use strict'; <ide> <ide> const { <del> Symbol, <add> SymbolIterator, <ide> } = primordials; <ide> <ide> const { Buffer } = require('buffer'); <ide> module.exports = class BufferList { <ide> return this.head.data; <ide> } <ide> <del> *[Symbol.iterator]() { <add> *[SymbolIterator]() { <ide> for (let p = this.head; p; p = p.next) { <ide> yield p.data; <ide> } <ide><path>lib/internal/streams/from.js <ide> <ide> const { <ide> Symbol, <add> SymbolIterator <ide> } = primordials; <ide> <ide> const { <ide> function from(Readable, iterable, opts) { <ide> let iterator; <ide> if (iterable && iterable[Symbol.asyncIterator]) <ide> iterator = iterable[Symbol.asyncIterator](); <del> else if (iterable && iterable[Symbol.iterator]) <del> iterator = iterable[Symbol.iterator](); <add> else if (iterable && iterable[SymbolIterator]) <add> iterator = iterable[SymbolIterator](); <ide> else <ide> throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); <ide> <ide><path>lib/internal/url.js <ide> const { <ide> ReflectGetOwnPropertyDescriptor, <ide> ReflectOwnKeys, <ide> Symbol, <add> SymbolIterator, <ide> } = primordials; <ide> <ide> const { inspect } = require('internal/util/inspect'); <ide> const kFormat = Symbol('format'); <ide> <ide> // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object <ide> const IteratorPrototype = ObjectGetPrototypeOf( <del> ObjectGetPrototypeOf([][Symbol.iterator]()) <add> ObjectGetPrototypeOf([][SymbolIterator]()) <ide> ); <ide> <ide> const unpairedSurrogateRe = <ide> class URLSearchParams { <ide> if (init === null || init === undefined) { <ide> this[searchParams] = []; <ide> } else if (typeof init === 'object' || typeof init === 'function') { <del> const method = init[Symbol.iterator]; <del> if (method === this[Symbol.iterator]) { <add> const method = init[SymbolIterator]; <add> if (method === this[SymbolIterator]) { <ide> // While the spec does not have this branch, we can use it as a <ide> // shortcut to avoid having to go through the costly generic iterator. <ide> const childParams = init[searchParams]; <ide> class URLSearchParams { <ide> for (const pair of init) { <ide> if ((typeof pair !== 'object' && typeof pair !== 'function') || <ide> pair === null || <del> typeof pair[Symbol.iterator] !== 'function') { <add> typeof pair[SymbolIterator] !== 'function') { <ide> throw new ERR_INVALID_TUPLE('Each query pair', '[name, value]'); <ide> } <ide> const convertedPair = []; <ide> defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { <ide> }); <ide> <ide> // https://heycam.github.io/webidl/#es-iterable-entries <del>ObjectDefineProperty(URLSearchParams.prototype, Symbol.iterator, { <add>ObjectDefineProperty(URLSearchParams.prototype, SymbolIterator, { <ide> writable: true, <ide> configurable: true, <ide> value: URLSearchParams.prototype.entries
3
Ruby
Ruby
remove duplicate method definition
159a1210444e30f165bd546506f5d3fabc5c779f
<ide><path>railties/lib/rails/generators.rb <ide> def api_only! <ide> end <ide> end <ide> <del> # Remove the color from output. <del> def no_color! <del> Thor::Base.shell = Thor::Shell::Basic <del> end <del> <ide> # Returns an array of generator namespaces that are hidden. <ide> # Generator namespaces may be hidden for a variety of reasons. <ide> # Some are aliased such as "rails:migration" and can be
1
Text
Text
remove note about resize
33021ba2b05bf27a569016914ec0095758ec2a4c
<ide><path>doc/api/tty.md <ide> process.stdout.on('resize', () => { <ide> }); <ide> ``` <ide> <del>*Note*: On Windows resize events will be emitted only if stdin is unpaused <del>(by a call to `resume()` or by adding a data listener) and in raw mode. It can <del>also be triggered if a terminal control sequence that moves the cursor is <del>written to the screen. Also, the resize event will only be signaled if the <del>console screen buffer height was also changed. For example shrinking the <del>console window height will not cause the resize event to be emitted. Increasing <del>the console window height will only be registered when the new console window <del>height is greater than the current console buffer size. <del> <ide> ### writeStream.columns <ide> <!-- YAML <ide> added: v0.7.7
1
Go
Go
reset identitymapping if empty
0bdcc60c4c8f0587af610c1cbf08e7fa6dac750e
<ide><path>builder/builder-next/builder.go <ide> type Builder struct { <ide> func New(opt Opt) (*Builder, error) { <ide> reqHandler := newReqBodyHandler(tracing.DefaultTransport) <ide> <add> if opt.IdentityMapping != nil && opt.IdentityMapping.Empty() { <add> opt.IdentityMapping = nil <add> } <add> <ide> c, err := newController(reqHandler, opt) <ide> if err != nil { <ide> return nil, err
1
Text
Text
add v3.13.0-beta.4 to changelog
92dcebf8ccea4f2ff53d4138b5a8b3c935e9b503
<ide><path>CHANGELOG.md <ide> # Ember Changelog <ide> <add>### v3.13.0-beta.4 (August 26, 2019) <add> <add>- [#18278](https://github.com/emberjs/ember.js/pull/18278) [BUGFIX] Bump ember-router-generator from v1.2.3 to v2.0.0 to support parsing `app/router.js` with native class. <add>- [#18291](https://github.com/emberjs/ember.js/pull/18291) [BUGFIX] Adds the babel-helpers injection plugin back and include `ember-template-compiler` in the vendor folder for Ember. <add>- [#18296](https://github.com/emberjs/ember.js/pull/18296) [BUGFIX] Ensure {{each-in}} can iterate over keys with periods <add>- [#18304](https://github.com/emberjs/ember.js/pull/18304) [BUGFIX] Check the EMBER_ENV environment variable after it is set <add> <ide> ### v3.13.0-beta.3 (August 19, 2019) <ide> <ide> - [#18223](https://github.com/emberjs/ember.js/pull/18223) [FEATURE] Tracked Props Performance Tuning
1
Javascript
Javascript
update jasmine 2 pr with changes from master
5c509b150d8c793558ef043e887eb1f163261025
<ide><path>src/addons/transitions/__tests__/ReactTransitionGroup-test.js <ide> describe('ReactTransitionGroup', function() { <ide> <ide> ReactDOM.render(<Component />, container); <ide> <del> expect(console.error.argsForCall.length).toBe(2); <del> expect(console.error.argsForCall[0][0]).toBe( <add> expect(console.error.calls.count()).toBe(2); <add> expect(console.error.calls.argsFor(0)[0]).toBe( <ide> 'Warning: flattenChildren(...): ' + <ide> 'Encountered two children with the same key, `1`. ' + <ide> 'Child keys must be unique; when two children share a key, ' + <ide> 'only the first child will be used.' <ide> ); <del> expect(normalizeCodeLocInfo(console.error.argsForCall[1][0])).toBe( <add> expect(normalizeCodeLocInfo(console.error.calls.argsFor(1)[0])).toBe( <ide> 'Warning: flattenChildren(...): ' + <ide> 'Encountered two children with the same key, `1`. ' + <ide> 'Child keys must be unique; when two children share a key, ' + <ide><path>src/renderers/shared/stack/reconciler/__tests__/ReactChildReconciler-test.js <ide> describe('ReactChildReconciler', function() { <ide> <ide> ReactTestUtils.renderIntoDocument(<Component />); <ide> <del> expect(console.error.argsForCall.length).toBe(1); <del> expect(console.error.argsForCall[0][0]).toContain( <add> expect(console.error.calls.count()).toBe(1); <add> expect(console.error.calls.argsFor(0)[0]).toContain( <ide> 'Child keys must be unique; when two children share a key, only the first child will be used.' <ide> ); <ide> }); <ide> describe('ReactChildReconciler', function() { <ide> <ide> ReactTestUtils.renderIntoDocument(<GrandParent />); <ide> <del> expect(console.error.argsForCall.length).toBe(1); <del> expect(normalizeCodeLocInfo(console.error.argsForCall[0][0])).toBe( <add> expect(console.error.calls.count()).toBe(1); <add> expect(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( <ide> 'Warning: flattenChildren(...): ' + <ide> 'Encountered two children with the same key, `1`. ' + <ide> 'Child keys must be unique; when two children share a key, ' + <ide><path>src/renderers/shared/stack/reconciler/__tests__/ReactMultiChild-test.js <ide> describe('ReactMultiChild', function() { <ide> container <ide> ); <ide> <del> expect(console.error.argsForCall.length).toBe(1); <del> expect(normalizeCodeLocInfo(console.error.argsForCall[0][0])).toBe( <add> expect(console.error.calls.count()).toBe(1); <add> expect(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( <ide> 'Warning: flattenChildren(...): ' + <ide> 'Encountered two children with the same key, `1`. ' + <ide> 'Child keys must be unique; when two children share a key, ' + <ide><path>src/test/__tests__/ReactTestUtils-test.js <ide> describe('ReactTestUtils', function() { <ide> <ide> var shallowRenderer = ReactTestUtils.createRenderer(); <ide> shallowRenderer.render(<SimpleComponent />); <del> expect(console.error.argsForCall.length).toBe(1); <add> expect(console.error.calls.count()).toBe(1); <ide> expect( <del> console.error.argsForCall[0][0].replace(/\(at .+?:\d+\)/g, '(at **)') <add> console.error.calls.argsFor(0)[0].replace(/\(at .+?:\d+\)/g, '(at **)') <ide> ).toBe( <ide> 'Warning: Failed context type: Required context `name` was not ' + <ide> 'specified in `SimpleComponent`.\n' +
4
Javascript
Javascript
exclude _app.js since it’s not a normal page
0f2c8f5eb1af62963a057b4c53aac52f5096dc16
<ide><path>server/export.js <ide> export default async function (dir, options, configuration) { <ide> const defaultPathMap = {} <ide> <ide> for (const page of pages) { <del> if (page === '/_document') { <add> // _document and _app are not real pages. <add> if (page === '/_document' || page === '/_app') { <ide> continue <ide> } <ide> defaultPathMap[page] = { page }
1
Javascript
Javascript
add test for placeholder text positioning
b35708b8cf9878ecda29051ff7bbefd91b5a64f1
<ide><path>spec/text-editor-component-spec.js <ide> describe('TextEditorComponent', () => { <ide> verifyCursorPosition(component, element.querySelector('.cursor'), 0, 4) <ide> }) <ide> <del> it('positions cursors correctly when the lines container has a margin and/or is padded', async () => { <del> const {component, element, editor} = buildComponent() <add> it('positions cursors and placeholder text correctly when the lines container has a margin and/or is padded', async () => { <add> const {component, element, editor} = buildComponent({placeholderText: 'testing'}) <ide> <ide> component.refs.lineTiles.style.marginLeft = '10px' <ide> TextEditor.didUpdateStyles() <ide> describe('TextEditorComponent', () => { <ide> TextEditor.didUpdateStyles() <ide> await component.getNextUpdatePromise() <ide> verifyCursorPosition(component, element.querySelector('.cursor'), 2, 2) <add> <add> editor.setText('') <add> await component.getNextUpdatePromise() <add> <add> const placeholderTextLeft = element.querySelector('.placeholder-text').getBoundingClientRect().left <add> const linesLeft = component.refs.lineTiles.getBoundingClientRect().left <add> expect(placeholderTextLeft).toBe(linesLeft) <ide> }) <ide> <ide> it('places the hidden input element at the location of the last cursor if it is visible', async () => {
1
Python
Python
pass params to encode
b1dbdf22ef3b4f1246402a9188d6b4117a5babdc
<ide><path>src/transformers/generation_flax_utils.py <ide> def _run_loop_in_debug(cond_fn, body_fn, init_state): <ide> state = body_fn(state) <ide> return state <ide> <del> def _prepare_encoder_decoder_kwargs_for_generation(self, input_ids, model_kwargs): <add> def _prepare_encoder_decoder_kwargs_for_generation(self, input_ids, params, model_kwargs): <ide> encoder_kwargs = { <ide> argument: value <ide> for argument, value in model_kwargs.items() <ide> if not (argument.startswith("decoder_") or argument.startswith("cross_attn")) <ide> } <del> model_kwargs["encoder_outputs"] = self.encode(input_ids, return_dict=True, **encoder_kwargs) <add> model_kwargs["encoder_outputs"] = self.encode(input_ids, params=params, return_dict=True, **encoder_kwargs) <ide> return model_kwargs <ide> <ide> @staticmethod <ide> def generate( <ide> <ide> if self.config.is_encoder_decoder: <ide> # add encoder_outputs to model_kwargs <del> model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(input_ids, model_kwargs) <add> model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(input_ids, params, model_kwargs) <ide> # prepare decoder_input_ids for generation <ide> input_ids = jnp.ones((input_ids.shape[0], 1), dtype="i4") * decoder_start_token_id <ide>
1
Javascript
Javascript
fix failing router tests using old api
ddb09515a0abf34d35c432b4a178d708ca5f470a
<ide><path>packages/ember/tests/routing/basic_test.js <ide> test("The Homepage with explicit template name in renderTemplate", function() { <ide> <ide> test('render does not replace templateName if user provided', function() { <ide> Router.map(function(match) { <del> match("/").to("home"); <add> this.route("home", { path: "/" }); <ide> }); <ide> <ide> Ember.TEMPLATES.the_real_home_template = Ember.Handlebars.compile( <ide> test('navigating away triggers a url property change', function() { <ide> var urlPropertyChangeCount = 0; <ide> <ide> Router.map(function(match) { <del> match("/").to("root"); <del> match("/foo").to("foo"); <del> match("/bar").to("bar"); <add> this.route('root', { path: '/' }); <add> this.route('foo', { path: '/foo' }); <add> this.route('bar', { path: '/bar' }); <ide> }); <ide> <ide> bootApplication();
1
Javascript
Javascript
fix separate objects
f26d0adfc6c433f28525edacd958597a1e49184b
<ide><path>examples/js/loaders/LDrawLoader.js <ide> THREE.LDrawLoader = ( function () { <ide> <ide> var parentParseScope = scope.getParentParseScope(); <ide> <add> // Set current matrix <add> if ( subobject ) { <add> <add> parseScope.currentMatrix.multiplyMatrices( parentParseScope.currentMatrix, subobject.matrix ); <add> parseScope.matrix = subobject.matrix.clone(); <add> <add> } <add> <ide> // Add to cache <ide> var currentFileName = parentParseScope.currentFileName; <ide> if ( currentFileName !== null ) { <ide> THREE.LDrawLoader = ( function () { <ide> <ide> } else { <ide> <add> if ( scope.separateObjects ) { <add> <add> parseScope.lineSegments.forEach( ls => { <add> <add> ls.v0.applyMatrix4( parseScope.matrix ); <add> ls.v1.applyMatrix4( parseScope.matrix ); <add> <add> } ); <add> <add> parseScope.optionalSegments.forEach( ls => { <add> <add> ls.v0.applyMatrix4( parseScope.matrix ); <add> ls.v1.applyMatrix4( parseScope.matrix ); <add> <add> } ); <add> <add> parseScope.triangles.forEach( ls => { <add> <add> ls.v0 = ls.v0.clone().applyMatrix4( parseScope.matrix ); <add> ls.v1 = ls.v1.clone().applyMatrix4( parseScope.matrix ); <add> ls.v2 = ls.v2.clone().applyMatrix4( parseScope.matrix ); <add> <add> } ); <add> <add> } <add> <add> <ide> // TODO: we need to multiple matrices here <ide> // TODO: First, instead of tracking matrices anywhere else we <ide> // should just multiple everything here. <ide> THREE.LDrawLoader = ( function () { <ide> parseScope.mainEdgeColourCode = subobject.material.userData.edgeMaterial.userData.code; <ide> parseScope.currentFileName = subobject.originalFileName; <ide> <del> if ( ! scope.separateObjects ) { <del> <del> // Set current matrix <del> parseScope.currentMatrix.multiplyMatrices( parentParseScope.currentMatrix, subobject.matrix ); <del> <del> } <ide> <ide> // If subobject was cached previously, use the cached one <ide> var cached = scope.subobjectCache[ subobject.originalFileName.toLowerCase() ]; <ide> THREE.LDrawLoader = ( function () { <ide> mainColourCode: topParseScope ? topParseScope.mainColourCode : '16', <ide> mainEdgeColourCode: topParseScope ? topParseScope.mainEdgeColourCode : '24', <ide> currentMatrix: new THREE.Matrix4(), <add> matrix: new THREE.Matrix4(), <ide> <ide> // If false, it is a root material scope previous to parse <ide> isFromParse: true, <ide> THREE.LDrawLoader = ( function () { <ide> <ide> if ( ! scope.separateObjects ) { <ide> <del> v.applyMatrix4( parentParseScope.currentMatrix ); <add> v.applyMatrix4( currentParseScope.currentMatrix ); <ide> <ide> } <ide>
1
PHP
PHP
add stub helper
0a324ec9ded25947ca5022dccc6be670b8a758b6
<ide><path>tests/TestCase/View/HelperRegistryTest.php <ide> namespace Cake\Test\TestCase\View; <ide> <ide> use Cake\Core\App; <add>use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\View\Helper; <ide> public function testLoadPluginHelper() { <ide> * @return void <ide> */ <ide> public function testReset() { <del> $this->skipIf(true, 'Currently no helper with any event'); <add> Configure::write('App.namespace', 'TestApp'); <ide> <del> $instance = $this->Helpers->load('Paginator'); <add> $instance = $this->Helpers->load('EventListenerTest'); <ide> $this->assertSame( <ide> $instance, <del> $this->Helpers->Paginator, <add> $this->Helpers->EventListenerTest, <ide> 'Instance in registry should be the same as previously loaded' <ide> ); <ide> $this->assertCount(1, $this->Events->listeners('View.beforeRender')); <ide> <ide> $this->assertNull($this->Helpers->reset(), 'No return expected'); <ide> $this->assertCount(0, $this->Events->listeners('View.beforeRender')); <ide> <del> $this->assertNotSame($instance, $this->Helpers->load('Paginator')); <add> $this->assertNotSame($instance, $this->Helpers->load('EventListenerTest')); <ide> } <ide> <ide> /** <ide> public function testReset() { <ide> * @return void <ide> */ <ide> public function testUnload() { <del> $this->skipIf(true, 'Currently no helper with any event'); <add> Configure::write('App.namespace', 'TestApp'); <ide> <del> $instance = $this->Helpers->load('Paginator'); <add> $instance = $this->Helpers->load('EventListenerTest'); <ide> $this->assertSame( <ide> $instance, <del> $this->Helpers->Paginator, <add> $this->Helpers->EventListenerTest, <ide> 'Instance in registry should be the same as previously loaded' <ide> ); <ide> $this->assertCount(1, $this->Events->listeners('View.beforeRender')); <ide> <del> $this->assertNull($this->Helpers->unload('Paginator'), 'No return expected'); <add> $this->assertNull($this->Helpers->unload('EventListenerTest'), 'No return expected'); <ide> $this->assertCount(0, $this->Events->listeners('View.beforeRender')); <ide> } <add> <ide> } <ide><path>tests/test_app/TestApp/View/Helper/EventListenerTestHelper.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @since 3.0.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace TestApp\View\Helper; <add> <add>use Cake\Event\Event; <add>use Cake\View\Helper; <add> <add>class EventListenerTestHelper extends Helper { <add> <add>/** <add> * Before render callback. Stub. <add> * <add> * @param \Cake\Event\Event $event The event instance. <add> * @param string $viewFile The view file being rendered. <add> * @return void <add> */ <add> public function beforeRender(Event $event, $viewFile) { <add> $this->config('options.foo', 'bar'); <add> } <add> <add>/** <add> * Event listeners. <add> * <add> * @return array <add> */ <add> public function implementedEvents() { <add> return ['View.beforeRender' => 'beforeRender']; <add> } <add> <add>}
2
Python
Python
remove a confusing docstring line
d4286f864af9b53337186a71b2fca14e75e79b74
<ide><path>numpy/core/numeric.py <ide> def zeros_like(a, dtype=None, order='K', subok=True): <ide> """ <ide> Return an array of zeros with the same shape and type as a given array. <ide> <del> With default parameters, is equivalent to ``a.copy().fill(0)``. <del> <ide> Parameters <ide> ---------- <ide> a : array_like <ide> def ones_like(a, dtype=None, order='K', subok=True): <ide> """ <ide> Return an array of ones with the same shape and type as a given array. <ide> <del> With default parameters, is equivalent to ``a.copy().fill(1)``. <del> <ide> Parameters <ide> ---------- <ide> a : array_like
1
Go
Go
remove commoncontainer - just container
55f8828eec1ff6c70628a0b6f22bea175ce36159
<ide><path>container/container.go <ide> var ( <ide> errInvalidNetwork = fmt.Errorf("invalid network settings while building port map info") <ide> ) <ide> <del>// CommonContainer holds the fields for a container which are <del>// applicable across all platforms supported by the daemon. <del>type CommonContainer struct { <add>// Container holds the structure defining a container object. <add>type Container struct { <ide> StreamConfig *stream.Config <ide> // embed for Container to support states directly. <ide> *State `json:"State"` // Needed for Engine API version <= 1.11 <ide> type CommonContainer struct { <ide> LogCopier *logger.Copier `json:"-"` <ide> restartManager restartmanager.RestartManager <ide> attachContext *attachContext <add> <add> // Fields here are specific to Unix platforms <add> AppArmorProfile string <add> HostnamePath string <add> HostsPath string <add> ShmPath string <add> ResolvConfPath string <add> SeccompProfile string <add> NoNewPrivileges bool <add> <add> // Fields here are specific to Windows <add> NetworkSharedContainerID string <ide> } <ide> <ide> // NewBaseContainer creates a new container with its <ide> // basic configuration. <ide> func NewBaseContainer(id, root string) *Container { <ide> return &Container{ <del> CommonContainer: CommonContainer{ <del> ID: id, <del> State: NewState(), <del> ExecCommands: exec.NewStore(), <del> Root: root, <del> MountPoints: make(map[string]*volume.MountPoint), <del> StreamConfig: stream.NewConfig(), <del> attachContext: &attachContext{}, <del> }, <add> ID: id, <add> State: NewState(), <add> ExecCommands: exec.NewStore(), <add> Root: root, <add> MountPoints: make(map[string]*volume.MountPoint), <add> StreamConfig: stream.NewConfig(), <add> attachContext: &attachContext{}, <ide> } <ide> } <ide> <ide><path>container/container_unit_test.go <ide> import ( <ide> <ide> func TestContainerStopSignal(t *testing.T) { <ide> c := &Container{ <del> CommonContainer: CommonContainer{ <del> Config: &container.Config{}, <del> }, <add> Config: &container.Config{}, <ide> } <ide> <ide> def, err := signal.ParseSignal(signal.DefaultStopSignal) <ide> func TestContainerStopSignal(t *testing.T) { <ide> } <ide> <ide> c = &Container{ <del> CommonContainer: CommonContainer{ <del> Config: &container.Config{StopSignal: "SIGKILL"}, <del> }, <add> Config: &container.Config{StopSignal: "SIGKILL"}, <ide> } <ide> s = c.StopSignal() <ide> if s != 9 { <ide> func TestContainerStopSignal(t *testing.T) { <ide> <ide> func TestContainerStopTimeout(t *testing.T) { <ide> c := &Container{ <del> CommonContainer: CommonContainer{ <del> Config: &container.Config{}, <del> }, <add> Config: &container.Config{}, <ide> } <ide> <ide> s := c.StopTimeout() <ide> func TestContainerStopTimeout(t *testing.T) { <ide> <ide> stopTimeout := 15 <ide> c = &Container{ <del> CommonContainer: CommonContainer{ <del> Config: &container.Config{StopTimeout: &stopTimeout}, <del> }, <add> Config: &container.Config{StopTimeout: &stopTimeout}, <ide> } <ide> s = c.StopSignal() <ide> if s != 15 { <ide><path>container/container_unix.go <ide> const ( <ide> containerSecretMountPath = "/run/secrets" <ide> ) <ide> <del>// Container holds the fields specific to unixen implementations. <del>// See CommonContainer for standard fields common to all containers. <del>type Container struct { <del> CommonContainer <del> <del> // Fields below here are platform specific. <del> AppArmorProfile string <del> HostnamePath string <del> HostsPath string <del> ShmPath string <del> ResolvConfPath string <del> SeccompProfile string <del> NoNewPrivileges bool <del>} <del> <ide> // ExitStatus provides exit reasons for a container. <ide> type ExitStatus struct { <ide> // The exit code with which the container exited. <ide><path>container/container_windows.go <ide> const ( <ide> containerInternalConfigsDirPath = `C:\ProgramData\Docker\internal\configs` <ide> ) <ide> <del>// Container holds fields specific to the Windows implementation. See <del>// CommonContainer for standard fields common to all containers. <del>type Container struct { <del> CommonContainer <del> <del> // Fields below here are platform specific. <del> NetworkSharedContainerID string <del>} <del> <ide> // ExitStatus provides exit reasons for a container. <ide> type ExitStatus struct { <ide> // The exit code with which the container exited. <ide><path>daemon/cluster/executor/container/health_test.go <ide> func TestHealthStates(t *testing.T) { <ide> } <ide> <ide> c := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "id", <del> Name: "name", <del> Config: &containertypes.Config{ <del> Image: "image_name", <del> Labels: map[string]string{ <del> "com.docker.swarm.task.id": "id", <del> }, <add> ID: "id", <add> Name: "name", <add> Config: &containertypes.Config{ <add> Image: "image_name", <add> Labels: map[string]string{ <add> "com.docker.swarm.task.id": "id", <ide> }, <ide> }, <ide> } <ide><path>daemon/daemon_test.go <ide> import ( <ide> <ide> func TestGetContainer(t *testing.T) { <ide> c1 := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "5a4ff6a163ad4533d22d69a2b8960bf7fafdcba06e72d2febdba229008b0bf57", <del> Name: "tender_bardeen", <del> }, <add> ID: "5a4ff6a163ad4533d22d69a2b8960bf7fafdcba06e72d2febdba229008b0bf57", <add> Name: "tender_bardeen", <ide> } <ide> <ide> c2 := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "3cdbd1aa394fd68559fd1441d6eff2ab7c1e6363582c82febfaa8045df3bd8de", <del> Name: "drunk_hawking", <del> }, <add> ID: "3cdbd1aa394fd68559fd1441d6eff2ab7c1e6363582c82febfaa8045df3bd8de", <add> Name: "drunk_hawking", <ide> } <ide> <ide> c3 := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "3cdbd1aa394fd68559fd1441d6eff2abfafdcba06e72d2febdba229008b0bf57", <del> Name: "3cdbd1aa", <del> }, <add> ID: "3cdbd1aa394fd68559fd1441d6eff2abfafdcba06e72d2febdba229008b0bf57", <add> Name: "3cdbd1aa", <ide> } <ide> <ide> c4 := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "75fb0b800922abdbef2d27e60abcdfaf7fb0698b2a96d22d3354da361a6ff4a5", <del> Name: "5a4ff6a163ad4533d22d69a2b8960bf7fafdcba06e72d2febdba229008b0bf57", <del> }, <add> ID: "75fb0b800922abdbef2d27e60abcdfaf7fb0698b2a96d22d3354da361a6ff4a5", <add> Name: "5a4ff6a163ad4533d22d69a2b8960bf7fafdcba06e72d2febdba229008b0bf57", <ide> } <ide> <ide> c5 := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "d22d69a2b8960bf7fafdcba06e72d2febdba960bf7fafdcba06e72d2f9008b060b", <del> Name: "d22d69a2b896", <del> }, <add> ID: "d22d69a2b8960bf7fafdcba06e72d2febdba960bf7fafdcba06e72d2f9008b060b", <add> Name: "d22d69a2b896", <ide> } <ide> <ide> store := container.NewMemoryStore() <ide> func TestContainerInitDNS(t *testing.T) { <ide> "UpdateDns":false,"Volumes":{},"VolumesRW":{},"AppliedVolumesFrom":null}` <ide> <ide> // Container struct only used to retrieve path to config file <del> container := &container.Container{CommonContainer: container.CommonContainer{Root: containerPath}} <add> container := &container.Container{Root: containerPath} <ide> configPath, err := container.ConfigPath() <ide> if err != nil { <ide> t.Fatal(err) <ide><path>daemon/delete_test.go <ide> func newDaemonWithTmpRoot(t *testing.T) (*Daemon, func()) { <ide> <ide> func newContainerWithState(state *container.State) *container.Container { <ide> return &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "test", <del> State: state, <del> Config: &containertypes.Config{}, <del> }, <add> ID: "test", <add> State: state, <add> Config: &containertypes.Config{}, <ide> } <ide> <ide> } <ide><path>daemon/events_test.go <ide> func TestLogContainerEventCopyLabels(t *testing.T) { <ide> defer e.Evict(l) <ide> <ide> container := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "container_id", <del> Name: "container_name", <del> Config: &containertypes.Config{ <del> Image: "image_name", <del> Labels: map[string]string{ <del> "node": "1", <del> "os": "alpine", <del> }, <add> ID: "container_id", <add> Name: "container_name", <add> Config: &containertypes.Config{ <add> Image: "image_name", <add> Labels: map[string]string{ <add> "node": "1", <add> "os": "alpine", <ide> }, <ide> }, <ide> } <ide> func TestLogContainerEventWithAttributes(t *testing.T) { <ide> defer e.Evict(l) <ide> <ide> container := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "container_id", <del> Name: "container_name", <del> Config: &containertypes.Config{ <del> Labels: map[string]string{ <del> "node": "1", <del> "os": "alpine", <del> }, <add> ID: "container_id", <add> Name: "container_name", <add> Config: &containertypes.Config{ <add> Labels: map[string]string{ <add> "node": "1", <add> "os": "alpine", <ide> }, <ide> }, <ide> } <ide><path>daemon/health_test.go <ide> func reset(c *container.Container) { <ide> <ide> func TestNoneHealthcheck(t *testing.T) { <ide> c := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "container_id", <del> Name: "container_name", <del> Config: &containertypes.Config{ <del> Image: "image_name", <del> Healthcheck: &containertypes.HealthConfig{ <del> Test: []string{"NONE"}, <del> }, <add> ID: "container_id", <add> Name: "container_name", <add> Config: &containertypes.Config{ <add> Image: "image_name", <add> Healthcheck: &containertypes.HealthConfig{ <add> Test: []string{"NONE"}, <ide> }, <del> State: &container.State{}, <ide> }, <add> State: &container.State{}, <ide> } <ide> daemon := &Daemon{} <ide> <ide> func TestHealthStates(t *testing.T) { <ide> } <ide> <ide> c := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> ID: "container_id", <del> Name: "container_name", <del> Config: &containertypes.Config{ <del> Image: "image_name", <del> }, <add> ID: "container_id", <add> Name: "container_name", <add> Config: &containertypes.Config{ <add> Image: "image_name", <ide> }, <ide> } <ide> daemon := &Daemon{ <ide><path>daemon/volumes_unix_test.go <ide> func TestBackportMountSpec(t *testing.T) { <ide> d := Daemon{containers: container.NewMemoryStore()} <ide> <ide> c := &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> State: &container.State{}, <del> MountPoints: map[string]*volume.MountPoint{ <del> "/apple": {Destination: "/apple", Source: "/var/lib/docker/volumes/12345678", Name: "12345678", RW: true, CopyData: true}, // anonymous volume <del> "/banana": {Destination: "/banana", Source: "/var/lib/docker/volumes/data", Name: "data", RW: true, CopyData: true}, // named volume <del> "/cherry": {Destination: "/cherry", Source: "/var/lib/docker/volumes/data", Name: "data", CopyData: true}, // RO named volume <del> "/dates": {Destination: "/dates", Source: "/var/lib/docker/volumes/data", Name: "data"}, // named volume nocopy <del> "/elderberry": {Destination: "/elderberry", Source: "/var/lib/docker/volumes/data", Name: "data"}, // masks anon vol <del> "/fig": {Destination: "/fig", Source: "/data", RW: true}, // RW bind <del> "/guava": {Destination: "/guava", Source: "/data", RW: false, Propagation: "shared"}, // RO bind + propagation <del> "/kumquat": {Destination: "/kumquat", Name: "data", RW: false, CopyData: true}, // volumes-from <add> State: &container.State{}, <add> MountPoints: map[string]*volume.MountPoint{ <add> "/apple": {Destination: "/apple", Source: "/var/lib/docker/volumes/12345678", Name: "12345678", RW: true, CopyData: true}, // anonymous volume <add> "/banana": {Destination: "/banana", Source: "/var/lib/docker/volumes/data", Name: "data", RW: true, CopyData: true}, // named volume <add> "/cherry": {Destination: "/cherry", Source: "/var/lib/docker/volumes/data", Name: "data", CopyData: true}, // RO named volume <add> "/dates": {Destination: "/dates", Source: "/var/lib/docker/volumes/data", Name: "data"}, // named volume nocopy <add> "/elderberry": {Destination: "/elderberry", Source: "/var/lib/docker/volumes/data", Name: "data"}, // masks anon vol <add> "/fig": {Destination: "/fig", Source: "/data", RW: true}, // RW bind <add> "/guava": {Destination: "/guava", Source: "/data", RW: false, Propagation: "shared"}, // RO bind + propagation <add> "/kumquat": {Destination: "/kumquat", Name: "data", RW: false, CopyData: true}, // volumes-from <ide> <del> // partially configured mountpoint due to #32613 <del> // specifically, `mp.Spec.Source` is not set <del> "/honeydew": { <del> Type: mounttypes.TypeVolume, <del> Destination: "/honeydew", <del> Name: "data", <del> Source: "/var/lib/docker/volumes/data", <del> Spec: mounttypes.Mount{Type: mounttypes.TypeVolume, Target: "/honeydew", VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, <del> }, <add> // partially configured mountpoint due to #32613 <add> // specifically, `mp.Spec.Source` is not set <add> "/honeydew": { <add> Type: mounttypes.TypeVolume, <add> Destination: "/honeydew", <add> Name: "data", <add> Source: "/var/lib/docker/volumes/data", <add> Spec: mounttypes.Mount{Type: mounttypes.TypeVolume, Target: "/honeydew", VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, <add> }, <ide> <del> // from hostconfig.Mounts <del> "/jambolan": { <del> Type: mounttypes.TypeVolume, <del> Destination: "/jambolan", <del> Source: "/var/lib/docker/volumes/data", <del> RW: true, <del> Name: "data", <del> Spec: mounttypes.Mount{Type: mounttypes.TypeVolume, Target: "/jambolan", Source: "data"}, <del> }, <add> // from hostconfig.Mounts <add> "/jambolan": { <add> Type: mounttypes.TypeVolume, <add> Destination: "/jambolan", <add> Source: "/var/lib/docker/volumes/data", <add> RW: true, <add> Name: "data", <add> Spec: mounttypes.Mount{Type: mounttypes.TypeVolume, Target: "/jambolan", Source: "data"}, <ide> }, <del> HostConfig: &containertypes.HostConfig{ <del> Binds: []string{ <del> "data:/banana", <del> "data:/cherry:ro", <del> "data:/dates:ro,nocopy", <del> "data:/elderberry:ro,nocopy", <del> "/data:/fig", <del> "/data:/guava:ro,shared", <del> "data:/honeydew:nocopy", <del> }, <del> VolumesFrom: []string{"1:ro"}, <del> Mounts: []mounttypes.Mount{ <del> {Type: mounttypes.TypeVolume, Target: "/jambolan"}, <del> }, <add> }, <add> HostConfig: &containertypes.HostConfig{ <add> Binds: []string{ <add> "data:/banana", <add> "data:/cherry:ro", <add> "data:/dates:ro,nocopy", <add> "data:/elderberry:ro,nocopy", <add> "/data:/fig", <add> "/data:/guava:ro,shared", <add> "data:/honeydew:nocopy", <add> }, <add> VolumesFrom: []string{"1:ro"}, <add> Mounts: []mounttypes.Mount{ <add> {Type: mounttypes.TypeVolume, Target: "/jambolan"}, <ide> }, <del> Config: &containertypes.Config{Volumes: map[string]struct{}{ <del> "/apple": {}, <del> "/elderberry": {}, <del> }}, <del> }} <add> }, <add> Config: &containertypes.Config{Volumes: map[string]struct{}{ <add> "/apple": {}, <add> "/elderberry": {}, <add> }}, <add> } <ide> <ide> d.containers.Add("1", &container.Container{ <del> CommonContainer: container.CommonContainer{ <del> State: &container.State{}, <del> ID: "1", <del> MountPoints: map[string]*volume.MountPoint{ <del> "/kumquat": {Destination: "/kumquat", Name: "data", RW: false, CopyData: true}, <del> }, <del> HostConfig: &containertypes.HostConfig{ <del> Binds: []string{ <del> "data:/kumquat:ro", <del> }, <add> State: &container.State{}, <add> ID: "1", <add> MountPoints: map[string]*volume.MountPoint{ <add> "/kumquat": {Destination: "/kumquat", Name: "data", RW: false, CopyData: true}, <add> }, <add> HostConfig: &containertypes.HostConfig{ <add> Binds: []string{ <add> "data:/kumquat:ro", <ide> }, <ide> }, <ide> })
10
Ruby
Ruby
make check for stray developer dir more specific
3473bbc010e9b169181dc180406c97cb2176ecb8
<ide><path>Library/Homebrew/cmd/doctor.rb <ide> def check_for_latest_xcode <ide> end <ide> <ide> def check_for_stray_developer_directory <del> if MacOS::Xcode.version >= "4.3" and File.exist? "/Developer/Library" <add> # if the uninstaller script isn't there, it's a good guess neither are <add> # any troublesome leftover Xcode files <add> if MacOS::Xcode.version >= "4.3" and File.exist? "/Developer/Library/uninstall-developer-folder" <ide> return <<-EOS.undent <ide> You have leftover files from an older version of Xcode. <ide> You should delete them using:
1
Ruby
Ruby
add xcode 7.0.1
be8d348a6d98425ed8b3feecec7ce58ce95e948c
<ide><path>Library/Homebrew/os/mac.rb <ide> def preferred_arch <ide> "6.3.1" => { :clang => "6.1", :clang_build => 602 }, <ide> "6.3.2" => { :clang => "6.1", :clang_build => 602 }, <ide> "6.4" => { :clang => "6.1", :clang_build => 602 }, <del> "7.0" => { :clang => "7.0", :clang_build => 700 } <add> "7.0" => { :clang => "7.0", :clang_build => 700 }, <add> "7.0.1" => { :clang => "7.0", :clang_build => 700 }, <ide> } <ide> <ide> def compilers_standard?
1
Python
Python
remove unused imports and unreachable code
d785aa39f99720950cd7f9acfe1133494cb5ff58
<ide><path>numpy/compat/py3k.py <ide> import os <ide> from pathlib import Path <ide> import io <del> <del>import abc <del>from abc import ABC as abc_ABC <del> <ide> try: <ide> import pickle5 as pickle <ide> except ImportError: <ide><path>numpy/core/multiarray.py <ide> """ <ide> <ide> import functools <del>import warnings <del> <ide> from . import overrides <ide> from . import _multiarray_umath <ide> from ._multiarray_umath import * # noqa: F403 <ide><path>numpy/lib/format.py <ide> def _read_array_header(fp, version): <ide> if EXPECTED_KEYS != d.keys(): <ide> keys = sorted(d.keys()) <ide> msg = "Header does not contain the correct keys: {!r}" <del> raise ValueError(msg.format(d.keys())) <add> raise ValueError(msg.format(keys)) <ide> <ide> # Sanity-check the values. <ide> if (not isinstance(d['shape'], tuple) or <ide><path>numpy/lib/index_tricks.py <ide> def __getitem__(self, key): <ide> length = int(step) <ide> if step != 1: <ide> step = (key.stop-start)/float(step-1) <del> stop = key.stop + step <ide> return _nx.arange(0, length, 1, float)*step + start <ide> else: <ide> return _nx.arange(start, stop, step) <ide><path>numpy/ma/extras.py <ide> def _median(a, axis=None, out=None, overwrite_input=False): <ide> return np.ma.mean(asorted[indexer], axis=axis, out=out) <ide> <ide> if asorted.ndim == 1: <del> counts = count(asorted) <ide> idx, odd = divmod(count(asorted), 2) <ide> mid = asorted[idx + odd - 1:idx + 1] <ide> if np.issubdtype(asorted.dtype, np.inexact) and asorted.size > 0: <ide><path>numpy/ma/mrecords.py <ide> def __new__(cls, shape, dtype=None, buf=None, offset=0, strides=None, <ide> msg = "Mask and data not compatible: data size is %i, " + \ <ide> "mask size is %i." <ide> raise MAError(msg % (nd, nm)) <del> copy = True <ide> if not keep_mask: <ide> self.__setmask__(mask) <ide> self._sharedmask = True <ide><path>numpy/typing/_array_like.py <ide> <ide> import sys <ide> from typing import Any, Sequence, TYPE_CHECKING, Union, TypeVar, Generic <del> <ide> from numpy import ( <ide> ndarray, <ide> dtype, <ide> str_, <ide> bytes_, <ide> ) <del> <ide> from . import _HAS_TYPING_EXTENSIONS <del>from ._dtype_like import DTypeLike <ide> <ide> if sys.version_info >= (3, 8): <ide> from typing import Protocol
7
Ruby
Ruby
add require to failing multi_db test
723ccf8fec776bee226f9befb9d0a0c191999fdf
<ide><path>railties/test/application/rake/multi_dbs_test.rb <ide> def generate_models_for_animals <ide> end <ide> <ide> test "db:schema:load:name sets the connection back to its original state" do <add> require "#{app_path}/config/environment" <ide> Dir.chdir(app_path) do <ide> dummy_task = <<~RUBY <ide> task foo: :environment do
1
PHP
PHP
support responsable objects
c0c89fd73cebf9ed56e6c5e69ad35106df03d9db
<ide><path>src/Illuminate/Contracts/Support/Responsable.php <add><?php <add> <add>namespace Illuminate\Contracts\Support; <add> <add>interface Responsable <add>{ <add> /** <add> * Create an HTTP response that represents the object. <add> * <add> * @return \Illuminate\Http\Response <add> */ <add> public function toResponse(); <add>} <ide><path>src/Illuminate/Routing/Pipeline.php <ide> protected function carry() <ide> */ <ide> protected function handleException($passable, Exception $e) <ide> { <del> if (! $this->container->bound(ExceptionHandler::class) || ! $passable instanceof Request) { <add> if (! $this->container->bound(ExceptionHandler::class) || <add> ! $passable instanceof Request) { <ide> throw $e; <ide> } <ide> <ide><path>src/Illuminate/Routing/Router.php <ide> use Illuminate\Contracts\Support\Jsonable; <ide> use Illuminate\Contracts\Events\Dispatcher; <ide> use Illuminate\Contracts\Support\Arrayable; <add>use Illuminate\Contracts\Support\Responsable; <ide> use Illuminate\Contracts\Routing\BindingRegistrar; <ide> use Psr\Http\Message\ResponseInterface as PsrResponseInterface; <ide> use Illuminate\Contracts\Routing\Registrar as RegistrarContract; <ide> public static function prepareResponse($request, $response) <ide> { <ide> if ($response instanceof PsrResponseInterface) { <ide> $response = (new HttpFoundationFactory)->createResponse($response); <add> } elseif ($response instanceof Responsable) { <add> $response = $response->toResponse(); <ide> } elseif (! $response instanceof SymfonyResponse && <ide> ($response instanceof Arrayable || <ide> $response instanceof Jsonable || <ide><path>tests/Integration/Routing/ResponsableTest.php <add><?php <add> <add>use Orchestra\Testbench\TestCase; <add>use Illuminate\Support\Facades\Route; <add>use Illuminate\Contracts\Support\Responsable; <add> <add>/** <add> * @group integration <add> */ <add>class ResponsableTest extends TestCase <add>{ <add> public function test_responsable_objects_are_rendered() <add> { <add> Route::get('/responsable', function () { <add> return new TestResponsableResponse; <add> }); <add> <add> $response = $this->get('/responsable'); <add> <add> $this->assertEquals(201, $response->status()); <add> $this->assertEquals('Taylor', $response->headers->get('X-Test-Header')); <add> $this->assertEquals('hello world', $response->getContent()); <add> } <add>} <add> <add> <add>class TestResponsableResponse implements Responsable <add>{ <add> public function toResponse() <add> { <add> return response('hello world', 201, ['X-Test-Header' => 'Taylor']); <add> } <add>}
4
Python
Python
remove useless logging line
5efe6f34fd4a00f388d2979a708c90884f2e09ac
<ide><path>airflow/models/dagrun.py <ide> def _filter_tis_and_exclude_removed(dag: "DAG", tis: List[TI]) -> Iterable[TI]: <ide> try: <ide> ti.task = dag.get_task(ti.task_id) <ide> except TaskNotFound: <del> self.log.error("Failed to get task for ti %s. Marking it as removed.", ti) <del> ti.state = State.REMOVED <del> session.flush() <add> if ti.state != State.REMOVED: <add> self.log.error("Failed to get task for ti %s. Marking it as removed.", ti) <add> ti.state = State.REMOVED <add> session.flush() <ide> else: <ide> yield ti <ide>
1
PHP
PHP
fix failing test
cbdf6b80eb14901bcd156ba946663a29834e8dee
<ide><path>tests/TestCase/Cache/Engine/MemcachedEngineTest.php <ide> public function testParseServerStringUnix() <ide> { <ide> $Memcached = new TestMemcachedEngine(); <ide> $result = $Memcached->parseServerString('unix:///path/to/memcachedd.sock'); <del> $this->assertEquals(['unix:///path/to/memcachedd.sock', 0], $result); <add> $this->assertEquals(['/path/to/memcachedd.sock', 0], $result); <ide> } <ide> <ide> /**
1
Ruby
Ruby
clarify partial filename constraints. closes
cf965cda5c755b51292e7c959def80ea54ea41f8
<ide><path>actionpack/lib/action_controller/base.rb <ide> def session_enabled? <ide> # # each win partial. <ide> # render :partial => "win", :collection => @wins, :spacer_template => "win_divider" <ide> # <add> # Note that the partial filename must also be a valid Ruby variable name, <add> # so e.g. 2005 and register-user are invalid. <add> # <ide> # _Deprecation_ _notice_: This used to have the signatures <ide> # <tt>render_partial(partial_path = default_template_name, object = nil, local_assigns = {})</tt> and <ide> # <tt>render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = {})</tt>.
1
Ruby
Ruby
convert dependencies to formulas for name matching
73ff7395839dee412f70c010f739210a8fd2a63a
<ide><path>Library/Homebrew/cmd/uses.rb <ide> def uses <ide> uses = formulae.select do |f| <ide> used_formulae.all? do |ff| <ide> if recursive <del> f.recursive_dependencies.any? { |dep| dep.name == ff.name } || <add> f.recursive_dependencies.any? { |dep| dep.to_formula.name == ff.name } || <ide> f.recursive_requirements.any? { |req| req.name == ff.name } <ide> else <del> f.deps.any? { |dep| dep.name == ff.name } || <add> f.deps.any? { |dep| dep.to_formula.name == ff.name } || <ide> f.requirements.any? { |req| req.name == ff.name } <ide> end <ide> end
1
PHP
PHP
fix csrf validation failure
522ed2f1fb49b00001c1ef8815a6feda790d61dd
<ide><path>src/Controller/Component/CsrfComponent.php <ide> protected function _validateToken(Request $request) <ide> $post = $request->data($this->_config['field']); <ide> $header = $request->header('X-CSRF-Token'); <ide> <add> if (empty($cookie)) { <add> throw new ForbiddenException(__d('cake', 'Invalid CSRF token.')); <add> } <add> <ide> if ($post !== $cookie && $header !== $cookie) { <ide> throw new ForbiddenException(__d('cake', 'Invalid CSRF token.')); <ide> } <ide><path>tests/TestCase/Controller/Component/CsrfComponentTest.php <ide> public function testValidTokenRequestData($method) <ide> * @dataProvider httpMethodProvider <ide> * @expectedException \Cake\Network\Exception\ForbiddenException <ide> * @return void <del> * @triggers Controller.startup $controller <ide> */ <ide> public function testInvalidTokenRequestData($method) <ide> { <ide> public function testInvalidTokenRequestData($method) <ide> $this->component->startup($event); <ide> } <ide> <add> /** <add> * Test that missing post field fails <add> * <add> * @expectedException \Cake\Network\Exception\ForbiddenException <add> * @return void <add> */ <add> public function testInvalidTokenRequestDataMissing() <add> { <add> $_SERVER['REQUEST_METHOD'] = 'POST'; <add> <add> $controller = $this->getMock('Cake\Controller\Controller', ['redirect']); <add> $controller->request = new Request([ <add> 'post' => [], <add> 'cookies' => ['csrfToken' => 'testing123'] <add> ]); <add> $controller->response = new Response(); <add> <add> $event = new Event('Controller.startup', $controller); <add> $this->component->startup($event); <add> } <add> <add> /** <add> * Test that missing header and cookie fails <add> * <add> * @dataProvider httpMethodProvider <add> * @expectedException \Cake\Network\Exception\ForbiddenException <add> * @return void <add> */ <add> public function testInvalidTokenMissingCookie($method) <add> { <add> $_SERVER['REQUEST_METHOD'] = $method; <add> <add> $controller = $this->getMock('Cake\Controller\Controller', ['redirect']); <add> $controller->request = new Request([ <add> 'post' => ['_csrfToken' => 'could-be-valid'], <add> 'cookies' => [] <add> ]); <add> $controller->response = new Response(); <add> <add> $event = new Event('Controller.startup', $controller); <add> $this->component->startup($event); <add> } <add> <ide> /** <ide> * Test that CSRF checks are not applied to request action requests. <ide> *
2
PHP
PHP
delete a space between ! and empty
05bcc4fe58ff96aaa5175ebc5338844488fdc740
<ide><path>lib/Cake/Network/Email/SmtpTransport.php <ide> protected function _sendData() { <ide> $lines = $this->_cakeEmail->message(); <ide> $messages = array(); <ide> foreach ($lines as $line) { <del> if ((! empty($line)) && ($line[0] === '.')) { <add> if ((!empty($line)) && ($line[0] === '.')) { <ide> $messages[] = '.' . $line; <ide> } else { <ide> $messages[] = $line;
1
Python
Python
update exception handling
3863b49ec5e1b11f364be01192940544431dd4d8
<ide><path>libcloud/common/base.py <ide> # See the License for the specific language governing permissions and <ide> # limitations under the License. <ide> <add>import sys <ide> import ssl <ide> import time <ide> <ide> def request(self, <ide> else: <ide> self.connection.request(method=method, url=url, body=data, <ide> headers=headers) <del> #except ssl.SSLError, e: <ide> except ssl.SSLError: <del> raise ssl.SSLError() <del> #raise ssl.SSLError(str(e)) <add> e = sys.exc_info()[1] <add> raise ssl.SSLError(str(e)) <ide> <ide> if raw: <ide> response = self.rawResponseCls(connection=self) <ide><path>libcloud/compute/base.py <ide> Provides base classes for working with drivers <ide> """ <ide> <add>import sys <ide> import time <ide> import hashlib <ide> import os <ide> def deploy_node(self, **kwargs): <ide> ssh_client=ssh_client, <ide> max_tries=3) <ide> except Exception: <del> #except Exception, e: <del> #raise DeploymentError(node, e) <del> raise DeploymentError(node, None) <add> e = sys.exc_info()[1] <add> raise DeploymentError(node, e) <ide> return node <ide> <ide> def _wait_until_running(self, node, wait_period=3, timeout=600):
2
Javascript
Javascript
apply safeareaview in header
4f0b9e25545006fa22e745fdc8d0e6761b0e6d4e
<ide><path>Libraries/YellowBox/UI/YellowBoxInspectorHeader.js <ide> <ide> const Platform = require('Platform'); <ide> const React = require('React'); <add>const SafeAreaView = require('SafeAreaView'); <ide> const StyleSheet = require('StyleSheet'); <ide> const Text = require('Text'); <ide> const UTFSequence = require('UTFSequence'); <ide> const YellowBoxInspectorHeader = (props: Props): React.Node => { <ide> : `Occurrence ${props.selectedIndex + 1} of ${props.warnings.length}`; <ide> <ide> return ( <del> <View style={styles.header}> <del> <YellowBoxInspectorHeaderButton <del> disabled={props.warnings[prevIndex] == null} <del> label={UTFSequence.TRIANGLE_LEFT} <del> onPress={() => props.onSelectIndex(prevIndex)} <del> /> <del> <View style={styles.headerTitle}> <del> <Text style={styles.headerTitleText}>{titleText}</Text> <add> <SafeAreaView style={styles.root}> <add> <View style={styles.header}> <add> <YellowBoxInspectorHeaderButton <add> disabled={props.warnings[prevIndex] == null} <add> label={UTFSequence.TRIANGLE_LEFT} <add> onPress={() => props.onSelectIndex(prevIndex)} <add> /> <add> <View style={styles.headerTitle}> <add> <Text style={styles.headerTitleText}>{titleText}</Text> <add> </View> <add> <YellowBoxInspectorHeaderButton <add> disabled={props.warnings[nextIndex] == null} <add> label={UTFSequence.TRIANGLE_RIGHT} <add> onPress={() => props.onSelectIndex(nextIndex)} <add> /> <ide> </View> <del> <YellowBoxInspectorHeaderButton <del> disabled={props.warnings[nextIndex] == null} <del> label={UTFSequence.TRIANGLE_RIGHT} <del> onPress={() => props.onSelectIndex(nextIndex)} <del> /> <del> </View> <add> </SafeAreaView> <ide> ); <ide> }; <ide> <ide> const YellowBoxInspectorHeaderButton = ( <ide> |}>, <ide> ): React.Node => ( <ide> <YellowBoxPressable <add> backgroundColor={{ <add> default: 'transparent', <add> pressed: YellowBoxStyle.getHighlightColor(1), <add> }} <ide> onPress={props.disabled ? null : props.onPress} <ide> style={styles.headerButton}> <ide> {props.disabled ? null : ( <ide> const YellowBoxInspectorHeaderButton = ( <ide> ); <ide> <ide> const styles = StyleSheet.create({ <add> root: { <add> backgroundColor: YellowBoxStyle.getBackgroundColor(0.95), <add> }, <ide> header: { <ide> flexDirection: 'row', <ide> height: Platform.select({ <ide> const styles = StyleSheet.create({ <ide> }, <ide> headerTitle: { <ide> alignItems: 'center', <del> backgroundColor: YellowBoxStyle.getBackgroundColor(0.95), <ide> flex: 1, <ide> justifyContent: 'center', <ide> },
1
Javascript
Javascript
fix lint on travis
892f0a59fe63c46cb3d998ac7165296a864f65d8
<ide><path>Gruntfile.js <ide> module.exports = function(grunt) { <ide> cmd: 'node_modules/.bin/eslint', <ide> args: ['src'] <ide> }, function(err, result, code) { <add> if (code === 0) { <add> grunt.log.ok('Lint passed (but may contain warnings)'); <add> } else { <add> grunt.log.error('Lint failed'); <add> } <ide> if (result.stdout.length) { <del> grunt.warn(result.stdout); <add> grunt.log.writeln(result.stdout); <ide> } <ide> <ide> done(code === 0);
1
Ruby
Ruby
add missing test for response destructuring
cbd10e27d1fa6e07d39dbb6fb42ce3420c5959db
<ide><path>actionpack/test/dispatch/response_test.rb <ide> def test_response_body_encoding <ide> assert_not @response.respond_to?(:method_missing) <ide> assert @response.respond_to?(:method_missing, true) <ide> end <add> <add> test "can be destructured into status, headers and an enumerable body" do <add> response = ActionDispatch::Response.new(404, { 'Content-Type' => 'text/plain' }, ['Not Found']) <add> status, headers, body = response <add> <add> assert_equal 404, status <add> assert_equal({ 'Content-Type' => 'text/plain' }, headers) <add> assert_equal ['Not Found'], body.each.to_a <add> end <ide> end <ide> <ide> class ResponseIntegrationTest < ActionDispatch::IntegrationTest
1
Javascript
Javascript
fix an mtk device bug
c21d2e9839697c2ec532256d58acc9ddd5d8745b
<ide><path>src/renderers/webgl/WebGLUniforms.js <ide> function WebGLUniforms( gl, program, renderer ) { <ide> <ide> var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS ); <ide> <del> for ( var i = 0; i !== n; ++ i ) { <add> for ( var i = 0; i < n; ++ i ) { <ide> <ide> var info = gl.getActiveUniform( program, i ), <ide> path = info.name,
1
PHP
PHP
add missing pkpass mimetype
2f02d0c755fd35130924d2f2d460c4f63095e194
<ide><path>lib/Cake/Network/CakeResponse.php <ide> class CakeResponse { <ide> 'vcf' => 'text/x-vcard', <ide> 'vtt' => 'text/vtt', <ide> 'mkv' => 'video/x-matroska', <add> 'pkpass' => 'application/vnd.apple.pkpass' <ide> ); <ide> <ide> /**
1
PHP
PHP
add allowdynamicproperties attribute to command
47bce90a3066d694c93994b200e38951384d2119
<ide><path>src/Command/Command.php <ide> * Includes traits that integrate logging <ide> * and ORM models to console commands. <ide> */ <add>#[\AllowDynamicProperties] <ide> class Command extends BaseCommand <ide> { <ide> use LocatorAwareTrait;
1
Python
Python
implement toggle of process list display
ad5bfecbf92d63982df9d8e6d5a32bf90abec599
<ide><path>glances/glances.py <ide> def __catchKey(self): <ide> elif self.pressedkey == ord('n') and network_tag: <ide> # 'n' > Show/hide network stats <ide> self.network_tag = not self.network_tag <add> elif self.pressedkey == ord('z'): <add> # 'z' > Show/Hide process list <add> self.process_tag = not self.process_tag <ide> elif self.pressedkey == ord('p'): <ide> # 'p' > Sort processes by name <ide> self.setProcessSortedBy('name')
1
Text
Text
add input and output for code examples
1d0c7f3f8be8b6e4ca08b51ff7241240dee169b8
<ide><path>client/src/pages/guide/english/python/python-f-strings/index.md <ide> The use of f-string allows the programmer to dynamically insert a variable into <ide> <ide> To perform these dynamic behaviours within an f-string we wrap them inside curly brackets within the string, and prepend a lower case f to the beginning of the string (before the opening quote. <ide> <del>### Examples <del>1. Dynamically inserting a variable into a string at runtime: <del> ```python <del> name = 'Jon Snow' <del> greeting = f'Hello! {name}' <del> print(greeting) <del> ``` <del> <del>2. Evaluate an expression in a string: <del> ```python <del> val1 = 2 <del> val2 = 3 <del> expr = f'The sum of {val1} + {val2} is {val1 + val2}' <del> print(expr) <del> ``` <del>3. Calling a function and inserting output within a string: <del> ```python <del> def sum(*args): <del> result = 0 <del> for arg in args: <del> result += arg <del> return result <del> <del> func = f'The sum of 3 + 5 is {sum(3, 5)}' <del> print(func) <del> ``` <del> 4. Joining the contents of a collection within a string: <del> <del> ```python <del> fruits = ['Apple', 'Banana', 'Pear'] <del> <del> list_str = f'List of fruits: {", ".join(fruits)}' <del> print(list_str) <del> ``` <add>## Examples <add>### Dynamically inserting a variable into a string at runtime: <add> <add>#### Input <add> <add>```python <add>name = 'Jon Snow' <add>greeting = f'Hello! {name}' <add>print(greeting) <add>``` <add> <add>#### Output <add> <add>``` <add>Hello! Jon Snow <add>``` <add> <add>### Evaluate an expression in a string: <add> <add>#### Input <add> <add>```python <add>val1 = 2 <add>val2 = 3 <add>expr = f'The sum of {val1} + {val2} is {val1 + val2}' <add>print(expr) <add>``` <add> <add>#### Output <add>``` <add>The sum of 2 + 3 is 5 <add>``` <add> <add>### Calling a function and inserting output within a string: <add> <add>#### Input <add>```python <add>def sum(*args): <add> result = 0 <add> for arg in args: <add> result += arg <add> return result <add> <add>func = f'The sum of 3 + 5 is {sum(3, 5)}' <add>print(func) <add>``` <add> <add>#### Output <add>``` <add>The sum of 3 + 5 is 8 <add>``` <add>### Joining the contents of a collection within a string: <add> <add>#### Input <add> <add>```python <add>fruits = ['Apple', 'Banana', 'Pear'] <add> <add>list_str = f'List of fruits: {", ".join(fruits)}' <add>print(list_str) <add>``` <add> <add>#### Output <add>``` <add>List of fruits: Apple, Banana, Pear <add>``` <add> <ide> ### Sources <ide> https://www.python.org/dev/peps/pep-0498/
1
Text
Text
fix links in 2.4 release
5490fc2700e4ca459583a3a00f253c1d85a7a189
<ide><path>docs/topics/2.4-announcement.md <ide> The next planned release will be 3.0, featuring an improved and simplified seria <ide> Once again, many thanks to all the generous [backers and sponsors][kickstarter-sponsors] who've helped make this possible! <ide> <ide> [lts-releases]: https://docs.djangoproject.com/en/dev/internals/release-process/#long-term-support-lts-releases <del>[2-4-release-notes]: ./topics/release-notes/#240 <add>[2-4-release-notes]: release-notes#240 <ide> [view-name-and-description-settings]: ../api-guide/settings/#view-names-and-descriptions <ide> [client-ip-identification]: ../api-guide/throttling/#how-clients-are-identified <del>[2-3-announcement]: ./topics/2.3-announcement <add>[2-3-announcement]: 2.3-announcement <ide> [github-labels]: https://github.com/tomchristie/django-rest-framework/issues <ide> [github-milestones]: https://github.com/tomchristie/django-rest-framework/milestones <del>[kickstarter-sponsors]: ./topics/kickstarter-announcement/#sponsors <add>[kickstarter-sponsors]: kickstarter-announcement#sponsors
1
Text
Text
fix missing closing brace and bracket for promise
2287d73b4fb23cbde6d2f55b9d64921c0962794e
<ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/complete-a-promise-with-resolve-and-reject.english.md <ide> const myPromise = new Promise((resolve, reject) => { <ide> } else { <ide> reject("Promise was rejected"); <ide> } <add>}); <ide> ``` <ide> <ide> The example above uses strings for the argument of these functions, but it can really be anything. Often, it might be an object, that you would use data from, to put on your website or elsewhere.
1
Ruby
Ruby
update the postgresql adapter documentation
0b6af35ef0647cf346bc7e274fc49da64f790ab0
<ide><path>activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb <ide> def self.extract_value_from_default(default) <ide> # <encoding></tt> call on the connection. <ide> # * <tt>:min_messages</tt> - An optional client min messages that is used in a <ide> # <tt>SET client_min_messages TO <min_messages></tt> call on the connection. <del> # * <tt>:allow_concurrency</tt> - If true, use async query methods so Ruby threads don't deadlock; <del> # otherwise, use blocking query methods. <ide> class PostgreSQLAdapter < AbstractAdapter <ide> class TableDefinition < ActiveRecord::ConnectionAdapters::TableDefinition <ide> def xml(*args)
1
Ruby
Ruby
allow debugging patching failures
d2d7516cc04ec31f105eda64f87b79db316bcb2f
<ide><path>Library/Homebrew/debrew.rb <ide> def install <ide> Debrew.debrew { super } <ide> end <ide> <add> def patch <add> Debrew.debrew { super } <add> end <add> <ide> def test <ide> Debrew.debrew { super } <ide> end <ide><path>Library/Homebrew/patch.rb <ide> def apply <ide> resource.unpack do <ide> # Assumption: the only file in the staging directory is the patch <ide> patchfile = Pathname.pwd.children.first <del> safe_system "/usr/bin/patch", "-g", "0", "-f", "-d", dir, "-#{strip}", "-i", patchfile <add> dir.cd { safe_system "/usr/bin/patch", "-g", "0", "-f", "-#{strip}", "-i", patchfile } <ide> end <ide> end <ide>
2
Ruby
Ruby
use exact format for last_revision_*
461bb20b7cd72ec8fc23b9b6b6d75ef6cb534624
<ide><path>Library/Homebrew/utils/git.rb <ide> def last_revision_commit_of_file(repo, file, before_commit: nil) <ide> <ide> out, = Open3.capture3( <ide> HOMEBREW_SHIMS_PATH/"scm/git", "-C", repo, <del> "log", "--oneline", "--max-count=1", *args, "--", file <add> "log", "--format=%h", "--abbrev=7", "--max-count=1", <add> *args, "--", file <ide> ) <del> out.split(" ").first <add> out.chomp <ide> end <ide> <ide> def last_revision_of_file(repo, file, before_commit: nil)
1
Javascript
Javascript
move top_before_blur to bubble phase
3c1a7ac87c5b4903aa0de02d11bd9ec2590ad598
<ide><path>packages/react-dom/src/client/ReactDOMHostConfig.js <ide> export function insertInContainerBefore( <ide> } <ide> } <ide> <del>function createEvent(type: TopLevelType): Event { <add>function createEvent(type: TopLevelType, bubbles: boolean): Event { <ide> const event = document.createEvent('Event'); <del> event.initEvent(((type: any): string), false, false); <add> event.initEvent(((type: any): string), bubbles, false); <ide> return event; <ide> } <ide> <ide> function dispatchBeforeDetachedBlur(target: HTMLElement): void { <ide> if (enableDeprecatedFlareAPI || enableCreateEventHandleAPI) { <del> const event = createEvent(TOP_BEFORE_BLUR); <add> const event = createEvent(TOP_BEFORE_BLUR, true); <ide> // Dispatch "beforeblur" directly on the target, <ide> // so it gets picked up by the event system and <ide> // can propagate through the React internal tree. <ide> function dispatchBeforeDetachedBlur(target: HTMLElement): void { <ide> <ide> function dispatchAfterDetachedBlur(target: HTMLElement): void { <ide> if (enableDeprecatedFlareAPI || enableCreateEventHandleAPI) { <del> const event = createEvent(TOP_AFTER_BLUR); <add> const event = createEvent(TOP_AFTER_BLUR, false); <ide> // So we know what was detached, make the relatedTarget the <ide> // detached target on the "afterblur" event. <ide> (event: any).relatedTarget = target; <ide><path>packages/react-dom/src/events/DOMModernPluginEventSystem.js <ide> import { <ide> TOP_PLAYING, <ide> TOP_CLICK, <ide> TOP_SELECTION_CHANGE, <del> TOP_BEFORE_BLUR, <ide> TOP_AFTER_BLUR, <ide> getRawEventName, <ide> } from './DOMTopLevelEventTypes'; <ide> export const capturePhaseEvents: Set<DOMTopLevelEventType> = new Set([ <ide> ]); <ide> <ide> if (enableCreateEventHandleAPI) { <del> capturePhaseEvents.add(TOP_BEFORE_BLUR); <ide> capturePhaseEvents.add(TOP_AFTER_BLUR); <ide> } <ide>
2
Text
Text
add links for repl.replserver
363570c07d8453c4e66e8cac326ecd1cc8d9fb51
<ide><path>doc/api/repl.md <ide> const repl = require('repl'); <ide> <ide> ## Design and Features <ide> <del>The `repl` module exports the `repl.REPLServer` class. While running, instances <del>of `repl.REPLServer` will accept individual lines of user input, evaluate those <del>according to a user-defined evaluation function, then output the result. Input <del>and output may be from `stdin` and `stdout`, respectively, or may be connected <del>to any Node.js [stream][]. <add>The `repl` module exports the [`repl.REPLServer`][] class. While running, <add>instances of [`repl.REPLServer`][] will accept individual lines of user input, <add>evaluate those according to a user-defined evaluation function, then output the <add>result. Input and output may be from `stdin` and `stdout`, respectively, or may <add>be connected to any Node.js [stream][]. <ide> <del>Instances of `repl.REPLServer` support automatic completion of inputs, <add>Instances of [`repl.REPLServer`][] support automatic completion of inputs, <ide> simplistic Emacs-style line editing, multi-line inputs, ANSI-styled output, <ide> saving and restoring current REPL session state, error recovery, and <ide> customizable evaluation functions. <ide> The following key combinations in the REPL have these special effects: <ide> <ide> ### Default Evaluation <ide> <del>By default, all instances of `repl.REPLServer` use an evaluation function that <del>evaluates JavaScript expressions and provides access to Node.js' built-in <add>By default, all instances of [`repl.REPLServer`][] use an evaluation function <add>that evaluates JavaScript expressions and provides access to Node.js' built-in <ide> modules. This default behavior can be overridden by passing in an alternative <del>evaluation function when the `repl.REPLServer` instance is created. <add>evaluation function when the [`repl.REPLServer`][] instance is created. <ide> <ide> #### JavaScript Expressions <ide> <ide> undefined <ide> <ide> ### Custom Evaluation Functions <ide> <del>When a new `repl.REPLServer` is created, a custom evaluation function may be <add>When a new [`repl.REPLServer`][] is created, a custom evaluation function may be <ide> provided. This can be used, for instance, to implement fully customized REPL <ide> applications. <ide> <ide> function isRecoverableError(error) { <ide> <ide> ### Customizing REPL Output <ide> <del>By default, `repl.REPLServer` instances format output using the <add>By default, [`repl.REPLServer`][] instances format output using the <ide> [`util.inspect()`][] method before writing the output to the provided `Writable` <ide> stream (`process.stdout` by default). The `useColors` boolean option can be <ide> specified at construction to instruct the default writer to use ANSI style <ide> codes to colorize the output from the `util.inspect()` method. <ide> <del>It is possible to fully customize the output of a `repl.REPLServer` instance <add>It is possible to fully customize the output of a [`repl.REPLServer`][] instance <ide> by passing a new function in using the `writer` option on construction. The <ide> following example, for instance, simply converts any input text to upper case: <ide> <ide> changes: <ide> `SIGINT` is received, i.e. `Ctrl+C` is pressed. This cannot be used together <ide> with a custom `eval` function. **Default:** `false`. <ide> <del>The `repl.start()` method creates and starts a `repl.REPLServer` instance. <add>The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance. <ide> <ide> If `options` is a string, then it specifies the input prompt: <ide> <ide> For an example of running a REPL instance over [curl(1)][], see: <ide> [`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn <ide> [`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function <ide> [`readline.Interface`]: readline.html#readline_class_interface <add>[`repl.ReplServer`]: #repl_class_replserver <ide> [`util.inspect()`]: util.html#util_util_inspect_object_options <ide> [curl(1)]: https://curl.haxx.se/docs/manpage.html <ide> [stream]: stream.html
1
Text
Text
add strict versioning to adnode
6f65591ec9cfca64c242cba12aaf149afb305b47
<ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/authentication-strategies.md <ide> dashedName: authentication-strategies <ide> <ide> A strategy is a way of authenticating a user. You can use a strategy for allowing users to authenticate based on locally saved information (if you have them register first) or from a variety of providers such as Google or GitHub. For this project, we will set up a local strategy. To see a list of the hundreds of strategies, visit Passport's site [here](http://passportjs.org/). <ide> <del>Add `passport-local` as a dependency and add it to your server as follows: `const LocalStrategy = require('passport-local');` <add>Add `passport-local@~1.0.0` as a dependency and add it to your server as follows: `const LocalStrategy = require('passport-local');` <ide> <ide> Now you will have to tell passport to **use** an instantiated LocalStrategy object with a few settings defined. Make sure this (as well as everything from this point on) is encapsulated in the database connection since it relies on it! <ide> <ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/authentication-with-socket.io.md <ide> dashedName: authentication-with-socket-io <ide> <ide> Currently, you cannot determine who is connected to your web socket. While `req.user` contains the user object, that's only when your user interacts with the web server, and with web sockets you have no `req` (request) and therefore no user data. One way to solve the problem of knowing who is connected to your web socket is by parsing and decoding the cookie that contains the passport session then deserializing it to obtain the user object. Luckily, there is a package on NPM just for this that turns a once complex task into something simple! <ide> <del>Add `passport.socketio`, `connect-mongo@~3.2.0`, and `cookie-parser` as dependencies and require them as `passportSocketIo`, `MongoStore`, and `cookieParser` respectively. Also, we need to initialize a new memory store, from `express-session` which we previously required. It should look like this: <add>Add `passport.socketio@~3.7.0`, `connect-mongo@~3.2.0`, and `cookie-parser@~1.4.5` as dependencies and require them as `passportSocketIo`, `MongoStore`, and `cookieParser` respectively. Also, we need to initialize a new memory store, from `express-session` which we previously required. It should look like this: <ide> <ide> ```js <ide> const MongoStore = require('connect-mongo')(session); <ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/hashing-your-passwords.md <ide> dashedName: hashing-your-passwords <ide> <ide> Going back to the information security section, you may remember that storing plaintext passwords is *never* okay. Now it is time to implement BCrypt to solve this issue. <ide> <del>Add BCrypt as a dependency, and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account, and when you check to see that a password is correct on login. <add>Add `bcrypt@~5.0.0` as a dependency, and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account, and when you check to see that a password is correct on login. <ide> <ide> Currently on our registration route, you insert a user's password into the database like so: `password: req.body.password`. An easy way to implement saving a hash instead is to add the following before your database logic `const hash = bcrypt.hashSync(req.body.password, 12);`, and replacing the `req.body.password` in the database saving with just `password: hash`. <ide> <ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication-ii.md <ide> dashedName: implementation-of-social-authentication-ii <ide> <ide> # --description-- <ide> <del>The last part of setting up your GitHub authentication is to create the strategy itself. For this, you will need to add the dependency of 'passport-github' to your project and require it in your `auth.js` as `GithubStrategy` like this: `const GitHubStrategy = require('passport-github').Strategy;`. Do not forget to require and configure `dotenv` to use your environment variables. <add>The last part of setting up your GitHub authentication is to create the strategy itself. For this, you will need to add the dependency of `passport-github@~1.1.0` to your project and require it in your `auth.js` as `GithubStrategy` like this: `const GitHubStrategy = require('passport-github').Strategy;`. Do not forget to require and configure `dotenv` to use your environment variables. <ide> <ide> To set up the GitHub strategy, you have to tell Passport to use an instantiated `GitHubStrategy`, which accepts 2 arguments: an object (containing `clientID`, `clientSecret`, and `callbackURL`) and a function to be called when a user is successfully authenticated, which will determine if the user is new and what fields to save initially in the user's database object. This is common across many strategies, but some may require more information as outlined in that specific strategy's GitHub README. For example, Google requires a *scope* as well which determines what kind of information your request is asking to be returned and asks the user to approve such access. The current strategy we are implementing has its usage outlined [here](https://github.com/jaredhanson/passport-github/), but we're going through it all right here on freeCodeCamp! <ide> <ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md <ide> Serialization and deserialization are important concepts in regards to authentic <ide> <ide> To set this up properly, we need to have a serialize function and a deserialize function. In Passport, we create these with `passport.serializeUser( OURFUNCTION )` and `passport.deserializeUser( OURFUNCTION )` <ide> <del>The `serializeUser` is called with 2 arguments, the full user object and a callback used by passport. A unique key to identify that user should be returned in the callback, the easiest one to use being the user's `_id` in the object. It should be unique as it generated by MongoDB. Similarly, `deserializeUser` is called with that key and a callback function for passport as well, but, this time, we have to take that key and return the full user object to the callback. To make a query search for a Mongo `_id`, you will have to create `const ObjectID = require('mongodb').ObjectID;`, and then to use it you call `new ObjectID(THE_ID)`. Be sure to add MongoDB as a dependency. You can see this in the examples below: <add>The `serializeUser` is called with 2 arguments, the full user object and a callback used by passport. A unique key to identify that user should be returned in the callback, the easiest one to use being the user's `_id` in the object. It should be unique as it generated by MongoDB. Similarly, `deserializeUser` is called with that key and a callback function for passport as well, but, this time, we have to take that key and return the full user object to the callback. To make a query search for a Mongo `_id`, you will have to create `const ObjectID = require('mongodb').ObjectID;`, and then to use it you call `new ObjectID(THE_ID)`. Be sure to add `mongodb@~3.6.0` as a dependency. You can see this in the examples below: <ide> <ide> ```js <ide> passport.serializeUser((user, done) => { <ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/set-up-passport.md <ide> dashedName: set-up-passport <ide> <ide> It's time to set up *Passport* so we can finally start allowing a user to register or login to an account! In addition to Passport, we will use Express-session to handle sessions. Using this middleware saves the session id as a cookie in the client and allows us to access the session data using that id on the server. This way we keep personal account information out of the cookie used by the client to verify to our server they are authenticated and just keep the *key* to access the data stored on the server. <ide> <del>To set up Passport for use in your project, you will need to add it as a dependency first in your package.json. `"passport": "^0.3.2"` <add>To set up Passport for use in your project, you will need to add it as a dependency first in your package.json. `passport@~0.4.1` <ide> <del>In addition, add Express-session as a dependency now as well. Express-session has a ton of advanced features you can use but for now we're just going to use the basics! `"express-session": "^1.15.0"` <add>In addition, add Express-session as a dependency now as well. Express-session has a ton of advanced features you can use but for now we're just going to use the basics! `express-session@~1.17.1` <ide> <ide> You will need to set up the session settings now and initialize Passport. Be sure to first create the variables 'session' and 'passport' to require 'express-session' and 'passport' respectively. <ide> <ide><path>curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/set-up-the-environment.md <ide> dashedName: set-up-the-environment <ide> <ide> The following challenges will make use of the `chat.pug` file. So, in your `routes.js` file, add a GET route pointing to `/chat` which makes use of `ensureAuthenticated`, and renders `chat.pug`, with `{ user: req.user }` passed as an argument to the response. Now, alter your existing `/auth/github/callback` route to set the `req.session.user_id = req.user.id`, and redirect to `/chat`. <ide> <del>Add `http` and `socket.io` as a dependency and require/instantiate them in your server defined as follows: <add>Add `socket.io@~2.3.0` as a dependency and require/instantiate it in your server defined as follows, with `http` (comes built-in with Nodejs): <ide> <ide> ```javascript <ide> const http = require('http').createServer(app);
7
Javascript
Javascript
use dynamic port in test-cluster-bind-twice
30a045858a8de9c41c19a73da186727780c2df18
<ide><path>test/parallel/test-cluster-bind-twice.js <ide> if (!id) { <ide> <ide> <ide> a.on('message', common.mustCall((m) => { <del> if (typeof m === 'object') return; <del> assert.strictEqual(m, 'READY'); <del> b.send('START'); <add> assert.strictEqual(m.msg, 'READY'); <add> b.send({msg: 'START', port: m.port}); <ide> })); <ide> <ide> b.on('message', common.mustCall((m) => { <ide> if (!id) { <ide> } else if (id === 'one') { <ide> if (cluster.isMaster) return startWorker(); <ide> <del> http.createServer(common.mustNotCall()) <del> .listen(common.PORT, common.mustCall(() => { <del> process.send('READY'); <del> })); <add> const server = http.createServer(common.mustNotCall()); <add> server.listen(0, common.mustCall(() => { <add> process.send({msg: 'READY', port: server.address().port}); <add> })); <ide> <ide> process.on('message', common.mustCall((m) => { <ide> if (m === 'QUIT') process.exit(); <ide> if (!id) { <ide> const server = http.createServer(common.mustNotCall()); <ide> process.on('message', common.mustCall((m) => { <ide> if (m === 'QUIT') process.exit(); <del> assert.strictEqual(m, 'START'); <del> server.listen(common.PORT, common.mustNotCall()); <add> assert.strictEqual(m.msg, 'START'); <add> server.listen(m.port, common.mustNotCall()); <ide> server.on('error', common.mustCall((e) => { <ide> assert.strictEqual(e.code, 'EADDRINUSE'); <ide> process.send(e.code);
1
Python
Python
add exception details to response
5d3e7b737c834595735cbeb81077739dd950f396
<ide><path>flask/wrappers.py <ide> def on_json_loading_failed(self, e): <ide> <ide> .. versionadded:: 0.8 <ide> """ <del> raise BadRequest() <add> raise BadRequest(e) <ide> <ide> def _load_form_data(self): <ide> RequestBase._load_form_data(self)
1
Ruby
Ruby
keep subprocess code inside begin block
913c12fd43909469829023d6d7d3de92e9503406
<ide><path>Library/Homebrew/utils/fork.rb <ide> def self.safe_fork(&block) <ide> read, write = IO.pipe <ide> <ide> pid = fork do <del> ENV["HOMEBREW_ERROR_PIPE"] = server.path <del> <ide> begin <add> ENV["HOMEBREW_ERROR_PIPE"] = server.path <ide> server.close <ide> read.close <ide> write.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
1
Text
Text
fix typos in responsive design article
4b441cc01d7ca92d99a304ce4a30470ec6048e51
<ide><path>threejs/lessons/threejs-responsive.md <ide> to the page displaying well on different sized displays from <ide> desktops to tablets to phones. <ide> <ide> For three.js there are even more situations to consider. For <del>example a 3D editor with controls on the left, right, top, or <add>example, a 3D editor with controls on the left, right, top, or <ide> bottom is something we might want to handle. A live diagram <ide> in the middle of a document is another example. <ide> <del>The last sample we had used a plain canvas with no css and <add>The last sample we had used a plain canvas with no CSS and <ide> no size <ide> <ide> ```html <ide> <canvas id="c"></canvas> <ide> ``` <ide> <del>That canvas defaults to 300x150 css pixels in size. <add>That canvas defaults to 300x150 CSS pixels in size. <ide> <ide> In the web platform the recommended way to set the size <ide> of something is to use CSS. <ide> html, body { <ide> </style> <ide> ``` <ide> <del>In HTML the body has a margin of 5px pixels by default so setting the <add>In HTML the body has a margin of 5 pixels by default so setting the <ide> margin to 0 removes the margin. Setting the html and body height to 100% <ide> makes them fill the window. Otherwise they are only as large <ide> as the content that fills them. <ide> Canvas elements have 2 sizes. One size is the size the canvas is displayed <ide> on the page. That's what we set with CSS. The other size is the <ide> number of pixels in the canvas itself. This is no different than an image. <ide> For example we might have a 128x64 pixel image and using <del>css we might display as 400x200 pixels. <add>CSS we might display as 400x200 pixels. <ide> <ide> ```html <ide> <img src="some128x64image.jpg" style="width:400px; height:200px"> <ide> changed. <ide> ## Handling HD-DPI displays <ide> <ide> HD-DPI stands for high-density dot per inch displays. <del>That's most Mac's now a days and many windows machines <add>That's most Macs nowadays and many Windows machines <ide> as well as pretty much all smartphones. <ide> <ide> The way this works in the browser is they use <del>CSS pixels to set the sizes which are suppose to be the same <add>CSS pixels to set the sizes which are supposed to be the same <ide> regardless of how high res the display is. The browser <del>will the just render text with more detail but the <add>will just render text with more detail but the <ide> same physical size. <ide> <ide> There are various ways to handle HD-DPI with three.js. <ide> is arguably the most common. Rendering 3D graphics <ide> takes a lot of GPU processing power. Mobile GPUs have <ide> less power than desktops, at least as of 2018, and yet <ide> mobile phones often have very high resolution displays. <del>The current top of the line phones have a HD-DPI ratio <add>The current top of the line phones have an HD-DPI ratio <ide> of 3x meaning for every one pixel from a non-HD-DPI display <ide> those phones have 9 pixels. That means they have to do 9x <ide> the rendering. <ide> a screenshot, or reading pixels for GPU picking, for drawing into a 2D canvas, <ide> etc... There many many cases where if we use `setPixelRatio` then our actual size will be different <ide> than the size we requested and we'll have to guess when to use the size <ide> we asked for and when to use the size three.js is actually using. <del>By doing it oursevles we always know the size being used is the size we requested. <add>By doing it ourselves we always know the size being used is the size we requested. <ide> There is no special case where magic is happening behind the scenes. <ide> <ide> Here's an example using the code above.
1