content_type
stringclasses 8
values | main_lang
stringclasses 7
values | message
stringlengths 1
50
| sha
stringlengths 40
40
| patch
stringlengths 52
962k
| file_count
int64 1
300
|
---|---|---|---|---|---|
Ruby | Ruby | pillow lives in homebrew/science | 18c7254ecddc67851e9aa087eabd203b336d62e8 | <ide><path>Library/Homebrew/missing_formula.rb
<ide> def blacklisted_reason(name)
<ide> #{Formatter.url("https://pip.readthedocs.io/en/stable/installing/")}
<ide> EOS
<ide> when "pil" then <<-EOS.undent
<del> Instead of PIL, consider `pip install pillow` or `brew install Homebrew/python/pillow`.
<add> Instead of PIL, consider `pip install pillow` or `brew install Homebrew/science/pillow`.
<ide> EOS
<ide> when "macruby" then <<-EOS.undent
<ide> MacRuby is not packaged and is on an indefinite development hiatus. | 1 |
Javascript | Javascript | allow the factory to cache controllers | 23054b4e69f65a324fa5efc2ddf9e28733bf3e02 | <ide><path>examples/jsm/webxr/XRControllerModelFactory.js
<ide> import {
<ide> SphereGeometry,
<ide> } from "../../../build/three.module.js";
<ide>
<del>import { GLTFLoader } from '../loaders/GLTFLoader.js'
<add>import { GLTFLoader } from '../loaders/GLTFLoader.js';
<ide>
<ide> import {
<ide> Constants as MotionControllerConstants,
<ide> fetchProfile,
<ide> MotionController
<del>} from '../libs/motion-controllers.module.js'
<add>} from '../libs/motion-controllers.module.js';
<ide>
<del>const DEFAULT_PROFILES_PATH = 'https://cdn.jsdelivr.net/npm/@webxr-input-profiles/[email protected]/dist/profiles'
<add>const DEFAULT_PROFILES_PATH = 'https://cdn.jsdelivr.net/npm/@webxr-input-profiles/[email protected]/dist/profiles';
<ide>
<ide> function XRControllerModel( ) {
<ide>
<ide> function findNodes( motionController, scene ) {
<ide> });
<ide> }
<ide>
<add>function addAssetSceneToControllerModel( controllerModel, scene ) {
<add> // Find the nodes needed for animation and cache them on the motionController.
<add> findNodes( controllerModel.motionController, scene );
<add>
<add> // Apply any environment map that the mesh already has set.
<add> if ( controllerModel.envMap ) {
<add>
<add> scene.traverse(( child ) => {
<add>
<add> if ( child.isMesh ) {
<add>
<add> child.material.envMap = controllerModel.envMap;
<add> child.material.needsUpdate = true;
<add>
<add> }
<add>
<add> });
<add>
<add> }
<add>
<add> // Add the glTF scene to the controllerModel.
<add> controllerModel.add( scene );
<add>}
<add>
<ide> var XRControllerModelFactory = ( function () {
<ide>
<ide> function XRControllerModelFactory( gltfLoader = null ) {
<ide>
<ide> this.gltfLoader = gltfLoader;
<ide> this.path = DEFAULT_PROFILES_PATH;
<add> this._assetCache = {};
<ide>
<ide> // If a GLTFLoader wasn't supplied to the constructor create a new one.
<ide> if ( !this.gltfLoader ) {
<ide> var XRControllerModelFactory = ( function () {
<ide>
<ide> createControllerModel: function ( controller ) {
<ide>
<del> if ( !this.gltfLoader ) {
<del>
<del> throw new Error(`GLTFLoader not set.`);
<del>
<del> }
<del>
<ide> const controllerModel = new XRControllerModel();
<ide> let scene = null;
<ide>
<ide> controller.addEventListener( 'connected', ( event ) => {
<ide>
<ide> const xrInputSource = event.data;
<ide>
<add> if (xrInputSource.targetRayMode !== 'tracked-pointer' ) return;
<add>
<ide> fetchProfile(xrInputSource, this.path).then(({ profile, assetPath }) => {
<ide>
<ide> controllerModel.motionController = new MotionController(
<ide> var XRControllerModelFactory = ( function () {
<ide> assetPath
<ide> );
<ide>
<del> this.gltfLoader.setPath('');
<del> this.gltfLoader.load( controllerModel.motionController.assetUrl, ( asset ) => {
<add> let cachedAsset = this._assetCache[controllerModel.motionController.assetUrl];
<add> if (cachedAsset) {
<ide>
<del> scene = asset.scene;
<add> scene = cachedAsset.scene.clone();
<ide>
<del> // Find the nodes needed for animation and cache them on the motionController.
<del> findNodes( controllerModel.motionController, scene );
<add> addAssetSceneToControllerModel(controllerModel, scene);
<ide>
<del> // Apply any environment map that the mesh already has set.
<del> if ( controllerModel.envMap ) {
<add> } else {
<ide>
<del> scene.traverse(( child ) => {
<add> if ( !this.gltfLoader ) {
<ide>
<del> if ( child.isMesh ) {
<add> throw new Error(`GLTFLoader not set.`);
<ide>
<del> child.material.envMap = controllerModel.envMap;
<del> child.material.needsUpdate = true;
<add> }
<ide>
<del> }
<add> this.gltfLoader.setPath('');
<add> this.gltfLoader.load( controllerModel.motionController.assetUrl, ( asset ) => {
<ide>
<del> });
<add> this._assetCache[controllerModel.motionController.assetUrl] = asset;
<ide>
<del> }
<add> scene = asset.scene.clone();
<add>
<add> addAssetSceneToControllerModel(controllerModel, scene);
<ide>
<del> // Add the glTF scene to the controllerModel.
<del> controllerModel.add( scene );
<add> },
<add> null,
<add> () => {
<ide>
<del> },
<del> null,
<del> () => {
<add> throw new Error(`Asset ${motionController.assetUrl} missing or malformed.`);
<ide>
<del> throw new Error(`Asset ${motionController.assetUrl} missing or malformed.`);
<add> });
<ide>
<del> });
<add> }
<ide>
<ide> }).catch((err) => {
<ide> | 1 |
Javascript | Javascript | update @next version | 77938881f42ac466c573fa24ecc9eff84ff7aca4 | <ide><path>ReactVersions.js
<ide> //
<ide> // 0.0.0-experimental-241c4467e-20200129
<ide>
<del>const ReactVersion = '18.0.0';
<add>const ReactVersion = '18.1.0';
<ide>
<ide> // The label used by the @next channel. Represents the upcoming release's
<ide> // stability. Could be "alpha", "beta", "rc", etc.
<ide> const nextChannelLabel = 'next';
<ide>
<ide> const stablePackages = {
<ide> 'create-subscription': ReactVersion,
<del> 'eslint-plugin-react-hooks': '4.4.0',
<del> 'jest-react': '0.12.1',
<add> 'eslint-plugin-react-hooks': '4.5.0',
<add> 'jest-react': '0.13.1',
<ide> react: ReactVersion,
<ide> 'react-art': ReactVersion,
<ide> 'react-dom': ReactVersion,
<ide> 'react-is': ReactVersion,
<del> 'react-reconciler': '0.27.0',
<del> 'react-refresh': '0.12.0',
<add> 'react-reconciler': '0.28.0',
<add> 'react-refresh': '0.13.0',
<ide> 'react-test-renderer': ReactVersion,
<del> 'use-subscription': '1.6.0',
<del> 'use-sync-external-store': '1.0.0',
<del> scheduler: '0.21.0',
<add> 'use-subscription': '1.7.0',
<add> 'use-sync-external-store': '1.1.0',
<add> scheduler: '0.22.0',
<ide> };
<ide>
<ide> // These packages do not exist in the @next or @latest channel, only | 1 |
Go | Go | put message back as soon as possible | 98810847c4589792f888079e318afbd56e357c91 | <ide><path>daemon/logger/jsonfilelog/jsonfilelog.go
<ide> func New(info logger.Info) (logger.Logger, error) {
<ide>
<ide> // Log converts logger.Message to jsonlog.JSONLog and serializes it to file.
<ide> func (l *JSONFileLogger) Log(msg *logger.Message) error {
<del> defer logger.PutMessage(msg)
<ide> buf := buffersPool.Get().(*bytes.Buffer)
<ide> buf.Reset()
<ide> defer buffersPool.Put(buf)
<ide>
<del> if err := marshalMessage(msg, l.extra, buf); err != nil {
<add> timestamp := msg.Timestamp
<add> err := marshalMessage(msg, l.extra, buf)
<add> logger.PutMessage(msg)
<add>
<add> if err != nil {
<ide> return err
<ide> }
<ide>
<del> return l.writer.WriteLogEntry(msg.Timestamp, buf.Bytes())
<add> return l.writer.WriteLogEntry(timestamp, buf.Bytes())
<ide> }
<ide>
<ide> func marshalMessage(msg *logger.Message, extra json.RawMessage, buf *bytes.Buffer) error {
<ide><path>daemon/logger/local/local.go
<ide> func (d *driver) Name() string {
<ide> }
<ide>
<ide> func (d *driver) Log(msg *logger.Message) error {
<del> defer logger.PutMessage(msg)
<ide> buf := buffersPool.Get().(*[]byte)
<ide> defer buffersPool.Put(buf)
<ide>
<add> timestamp := msg.Timestamp
<ide> err := marshal(msg, buf)
<add> logger.PutMessage(msg)
<add>
<ide> if err != nil {
<ide> return errors.Wrap(err, "error marshalling logger.Message")
<ide> }
<del> return d.logfile.WriteLogEntry(msg.Timestamp, *buf)
<add> return d.logfile.WriteLogEntry(timestamp, *buf)
<ide> }
<ide>
<ide> func (d *driver) Close() error { | 2 |
Javascript | Javascript | avoid assertions for symbol when not present | 77b4bc6c14f603de7d2ff1a8b2d8d5f901a8edd4 | <ide><path>packages/@ember/-internals/glimmer/tests/integration/components/component-template-test.js
<ide> import {
<ide> EMBER_GLIMMER_SET_COMPONENT_TEMPLATE,
<ide> EMBER_MODULE_UNIFICATION,
<ide> } from '@ember/canary-features';
<add>import { HAS_NATIVE_SYMBOL } from '@ember/-internals/utils';
<ide>
<ide> import { Component, compile } from '../../utils/helpers';
<ide> import { setComponentTemplate, getComponentTemplate } from '../../..';
<ide> if (EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) {
<ide> setComponentTemplate(compile('foo'), 'foo');
<ide> }, /Cannot call `setComponentTemplate` on `foo`/);
<ide>
<del> expectAssertion(() => {
<del> setComponentTemplate(compile('foo'), Symbol('foo'));
<del> }, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
<add> if (HAS_NATIVE_SYMBOL) {
<add> expectAssertion(() => {
<add> setComponentTemplate(compile('foo'), Symbol('foo'));
<add> }, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
<add> }
<ide> }
<ide>
<ide> '@test calling it twice on the same object asserts'() { | 1 |
Javascript | Javascript | remove unintentional change to greatcircle | aa2ee0197b085ef6b927367293c42be457dd0573 | <ide><path>d3.geo.js
<ide> d3.geo.greatCircle = function() {
<ide> radius = 6371; // Mean radius of Earth, in km.
<ide> // TODO: breakAtDateLine?
<ide>
<del> function greatCircle(d, i, dist) {
<add> function greatCircle(d, i) {
<ide> var from = source.call(this, d, i),
<ide> to = target.call(this, d, i),
<ide> x0 = from[0] * d3_radians,
<ide> d3.geo.greatCircle = function() {
<ide> cy0 = Math.cos(y0), sy0 = Math.sin(y0),
<ide> cx1 = Math.cos(x1), sx1 = Math.sin(x1),
<ide> cy1 = Math.cos(y1), sy1 = Math.sin(y1),
<del> d = dist || Math.acos(sy0 * sy1 + cy0 * cy1 * Math.cos(x1 - x0)),
<add> d = Math.acos(sy0 * sy1 + cy0 * cy1 * Math.cos(x1 - x0)),
<ide> sd = Math.sin(d),
<ide> f = d / (n - 1),
<ide> e = -f,
<ide> path = [],
<ide> i = -1;
<ide>
<del> if (d === 0) return [from];
<del>
<ide> while (++i < n) {
<ide> e += f;
<ide> var A = Math.sin(d - e) / sd,
<ide><path>d3.geo.min.js
<del>(function(){function q(a,b,c){var d=-1,e=a.length,f=0,g=Infinity;while(++d<e){b.target=a[d];var h=Math.abs(p.distance(b)-c);h<g&&(g=h,f=d)}b.target=a[f];return f}function o(a){return a.target}function n(a){return a.source}function m(a,b){for(var c=a.coordinates[0],d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function l(a,b){b.apply(null,a.coordinates)}function k(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d][0],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function j(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function i(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function h(a,b){for(var c=a.features,d=0,f=c.length;d<f;d++)e(c[d].geometry,b)}function g(a,b){e(a.geometry,b)}function e(a,b){a.type in f&&f[a.type](a,b)}function d(a,b){return b&&b.type in a?a[b.type](b):""}function c(){return 0}function b(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}d3.geo={};var a=Math.PI/180;d3.geo.azimuthal=function(){function j(c){var g=c[0]*a-f,j=c[1]*a,k=Math.cos(g),l=Math.sin(g),m=Math.cos(j),n=Math.sin(j),o=b!=="orthographic"?i*n+h*m*k:null,p,q=b==="stereographic"?1/(1+o):b==="gnomonic"?1/o:b==="equidistant"?(p=Math.acos(o),p/Math.sin(p)):b==="equalarea"?Math.sqrt(2/(1+o)):1,r=q*m*l,s=q*(i*m*k-h*n);return[d*r+e[0],d*s+e[1]]}var b="orthographic",c,d=200,e=[480,250],f,g,h,i;j.invert=function(c){var g=(c[0]-e[0])/d,j=(c[1]-e[1])/d,k=Math.sqrt(g*g+j*j),l=b==="stereographic"?2*Math.atan(k):b==="gnomonic"?Math.atan(k):b==="equidistant"?k:b==="equalarea"?2*Math.asin(.5*k):Math.asin(k),m=Math.sin(l),n=Math.cos(l);return[(f+Math.atan2(g*m,k*h*n+j*i*m))/a,Math.asin(n*i-j*m*h/k)/a]},j.mode=function(a){if(!arguments.length)return b;b=a+"";return j},j.origin=function(b){if(!arguments.length)return c;c=b,f=c[0]*a,g=c[1]*a,h=Math.cos(g),i=Math.sin(g);return j},j.scale=function(a){if(!arguments.length)return d;d=+a;return j},j.translate=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return j};return j.origin([0,0])},d3.geo.albers=function(){function k(){var d=a*c[0],e=a*c[1],k=a*b[1],l=Math.sin(d),m=Math.cos(d);f=a*b[0],g=.5*(l+Math.sin(e)),h=m*m+2*g*l,i=Math.sqrt(h-2*g*Math.sin(k))/g;return j}function j(b){var c=g*(a*b[0]-f),j=Math.sqrt(h-2*g*Math.sin(a*b[1]))/g;return[d*j*Math.sin(c)+e[0],d*(j*Math.cos(c)-i)+e[1]]}var b=[-98,38],c=[29.5,45.5],d=1e3,e=[480,250],f,g,h,i;j.invert=function(b){var c=(b[0]-e[0])/d,j=(b[1]-e[1])/d,k=i+j,l=Math.atan2(c,k),m=Math.sqrt(c*c+k*k);return[(f+l/g)/a,Math.asin((h-m*m*g*g)/(2*g))/a]},j.origin=function(a){if(!arguments.length)return b;b=[+a[0],+a[1]];return k()},j.parallels=function(a){if(!arguments.length)return c;c=[+a[0],+a[1]];return k()},j.scale=function(a){if(!arguments.length)return d;d=+a;return j},j.translate=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return j};return k()},d3.geo.albersUsa=function(){function e(e){var f=e[0],g=e[1];return(g>50?b:f<-140?c:g<21?d:a)(e)}var a=d3.geo.albers(),b=d3.geo.albers().origin([-160,60]).parallels([55,65]),c=d3.geo.albers().origin([-160,20]).parallels([8,18]),d=d3.geo.albers().origin([-60,10]).parallels([8,18]);e.scale=function(f){if(!arguments.length)return a.scale();a.scale(f),b.scale(f*.6),c.scale(f),d.scale(f*1.5);return e.translate(a.translate())},e.translate=function(f){if(!arguments.length)return a.translate();var g=a.scale()/1e3,h=f[0],i=f[1];a.translate(f),b.translate([h-400*g,i+170*g]),c.translate([h-190*g,i+200*g]),d.translate([h+580*g,i+430*g]);return e};return e.scale(a.scale())},d3.geo.mercator=function(){function d(d){var e=d[0]/360,f=-(Math.log(Math.tan(Math.PI/4+d[1]*a/2))/a)/360;return[b*e+c[0],b*Math.max(-0.5,Math.min(.5,f))+c[1]]}var b=500,c=[480,250];d.invert=function(d){var e=(d[0]-c[0])/b,f=(d[1]-c[1])/b;return[360*e,2*Math.atan(Math.exp(-360*f*a))/a-90]},d.scale=function(a){if(!arguments.length)return b;b=+a;return d},d.translate=function(a){if(!arguments.length)return c;c=[+a[0],+a[1]];return d};return d},d3.geo.path=function(){function o(a){return Math.abs(d3.geom.polygon(a.map(f)).area())}function m(a){var b=d3.geom.polygon(a[0].map(f)),c=b.centroid(1),d=c[0],e=c[1],g=Math.abs(b.area()),h=0,i=a.length;while(++h<i)b=d3.geom.polygon(a[h].map(f)),c=b.centroid(1),d-=c[0],e-=c[1],g-=Math.abs(b.area());return[d,e,6*g]}function l(a){var b=o(a[0]),c=0,d=a.length;while(++c<d)b-=o(a[c]);return b}function i(a){return f(a).join(",")}function h(c,f){typeof a=="function"&&(e=b(a.apply(this,arguments)));return d(j,c)}var a=4.5,e=b(a),f=d3.geo.albersUsa(),g=Object,j={FeatureCollection:function(a){var b=[],c=a.features,e=-1,f=c.length;while(++e<f)b.push(d(j,c[e].geometry));return b.join("")},Feature:function(a){return d(j,a.geometry)},Point:function(a){var b=g.call(this,[a.coordinates]);return b.length?"M"+i(b[0])+e:""},MultiPoint:function(a){var b=[],c=g.call(this,a.coordinates),d=-1,f=c.length;while(++d<f)b.push("M",i(c[d]),e);return b.join("")},LineString:function(a){var b=["M"],c=g.call(this,a.coordinates),d=-1,e=c.length;while(++d<e)b.push(i(c[d]),"L");b.pop();return b.join("")},MultiLineString:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,h,j;while(++d<e){f=g.call(this,c[d]),h=-1,j=f.length,b.push("M");while(++h<j)b.push(i(f[h]),"L");b.pop()}return b.join("")},Polygon:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,h,j;while(++d<e){f=g.call(this,c[d]),h=-1,j=f.length-1;if(j<1)continue;b.push("M");while(++h<j)b.push(i(f[h]),"L");b[b.length-1]="Z"}return b.join("")},MultiPolygon:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,h,j,k,l,m;while(++d<e){f=c[d],h=-1,j=f.length;while(++h<j){k=g.call(this,f[h]),l=-1,m=k.length-1;if(m<1)continue;b.push("M");while(++l<m)b.push(i(k[l]),"L");b[b.length-1]="Z"}}return b.join("")},GeometryCollection:function(a){var b=[],c=a.geometries,e=-1,f=c.length;while(++e<f)b.push(d(j,c[e]));return b.join("")}},k={FeatureCollection:function(a){var b=0,c=a.features,e=-1,f=c.length;while(++e<f)b+=d(k,c[e]);return b},Feature:function(a){return d(k,a.geometry)},Point:c,MultiPoint:c,LineString:c,MultiLineString:c,Polygon:function(a){return l(a.coordinates)},MultiPolygon:function(a){var b=0,c=a.coordinates,d=-1,e=c.length;while(++d<e)b+=l(c[d]);return b},GeometryCollection:function(a){var b=0,c=a.geometries,e=-1,f=c.length;while(++e<f)b+=d(k,c[e]);return b}},n={Feature:function(a){return d(n,a.geometry)},Polygon:function(a){var b=m(a.coordinates);return[b[0]/b[2],b[1]/b[2]]},MultiPolygon:function(a){var b=0,c=a.coordinates,d,e=0,f=0,g=0,h=-1,i=c.length;while(++h<i)d=m(c[h]),e+=d[0],f+=d[1],g+=d[2];return[e/g,f/g]}};h.projection=function(a){f=a;return h},h.clip=function(a){if(!arguments.length)return g;g=a;return h},h.area=function(a){return d(k,a)},h.centroid=function(a){return d(n,a)},h.pointRadius=function(c){typeof c=="function"?a=c:(a=+c,e=b(a));return h};return h},d3.geo.bounds=function(a){var b=Infinity,c=Infinity,d=-Infinity,f=-Infinity;e(a,function(a,e){a<b&&(b=a),a>d&&(d=a),e<c&&(c=e),e>f&&(f=e)});return[[b,c],[d,f]]};var f={Feature:g,FeatureCollection:h,LineString:i,MultiLineString:j,MultiPoint:i,MultiPolygon:k,Point:l,Polygon:m};d3.geo.greatCircle=function(){function f(e,f,g){var h=b.call(this,e,f),i=c.call(this,e,f),j=h[0]*a,k=h[1]*a,l=i[0]*a,m=i[1]*a,n=Math.cos(j),o=Math.sin(j),p=Math.cos(k),q=Math.sin(k),r=Math.cos(l),s=Math.sin(l),t=Math.cos(m),u=Math.sin(m),e=g||Math.acos(q*u+p*t*Math.cos(l-j)),v=Math.sin(e),w=e/(d-1),x=-w,y=[],f=-1;if(e===0)return[h];while(++f<d){x+=w;var z=Math.sin(e-x)/v,A=Math.sin(x)/v,B=z*p*n+A*t*r,C=z*p*o+A*t*s,D=z*q+A*u;y[f]=[Math.atan2(C,B)/a,Math.atan2(D,Math.sqrt(B*B+C*C))/a]}return y}var b=n,c=o,d=100,e=6371;f.source=function(a){if(!arguments.length)return b;b=a;return f},f.target=function(a){if(!arguments.length)return c;c=a;return f},f.n=function(a){if(!arguments.length)return d;d=+a;return f},f.radius=function(a){if(!arguments.length)return e;e=+a;return f},f.distance=function(d,f){var g=b.call(this,d,f),h=c.call(this,d,f),i=g[0]*a,j=g[1]*a,k=h[0]*a,l=h[1]*a,m=Math.sin((l-j)/2),n=Math.sin((k-i)/2),o=m*m+Math.cos(j)*Math.cos(l)*n*n;return e*2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))};return f},d3.geo.clip=function(){function d(b){var d={source:a,target:null},e=b.length,f=-1,g,h,i=[],j=null,k=null;while(++f<e)d.target=b[f],distance=p.distance(d),distance<c?k?(h=p({source:k,target:d.target}),g=q(h,d,c),j&&i.push.apply(i,p({source:j,target:d.target})),i.push.apply(i,h.slice(g)),j=k=null):i.push(d.target):(k=d.target,!j&&i.length&&(h=p({source:i[i.length-1],target:d.target}),g=q(h,d,c),i.push.apply(i,h.slice(0,g)),j=d.target));k&&i.length&&(d.target=i[0],h=p({source:k,target:d.target}),g=q(h,d,c),j&&i.push.apply(i,p({source:j,target:d.target})),i.push.apply(i,h.slice(g)));return i}var a=[0,0],b=90,c=6371*b/180*Math.PI;d.origin=function(b){if(!arguments.length)return a;a=b;return d},d.angle=function(a){if(!arguments.length)return b;b=+a,c=6371*b/180*Math.PI;return d};return d};var p=d3.geo.greatCircle().n(100)})()
<ide>\ No newline at end of file
<add>(function(){function q(a,b,c){var d=-1,e=a.length,f=0,g=Infinity;while(++d<e){b.target=a[d];var h=Math.abs(p.distance(b)-c);h<g&&(g=h,f=d)}b.target=a[f];return f}function o(a){return a.target}function n(a){return a.source}function m(a,b){for(var c=a.coordinates[0],d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function l(a,b){b.apply(null,a.coordinates)}function k(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d][0],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function j(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function i(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function h(a,b){for(var c=a.features,d=0,f=c.length;d<f;d++)e(c[d].geometry,b)}function g(a,b){e(a.geometry,b)}function e(a,b){a.type in f&&f[a.type](a,b)}function d(a,b){return b&&b.type in a?a[b.type](b):""}function c(){return 0}function b(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}d3.geo={};var a=Math.PI/180;d3.geo.azimuthal=function(){function j(c){var g=c[0]*a-f,j=c[1]*a,k=Math.cos(g),l=Math.sin(g),m=Math.cos(j),n=Math.sin(j),o=b!=="orthographic"?i*n+h*m*k:null,p,q=b==="stereographic"?1/(1+o):b==="gnomonic"?1/o:b==="equidistant"?(p=Math.acos(o),p/Math.sin(p)):b==="equalarea"?Math.sqrt(2/(1+o)):1,r=q*m*l,s=q*(i*m*k-h*n);return[d*r+e[0],d*s+e[1]]}var b="orthographic",c,d=200,e=[480,250],f,g,h,i;j.invert=function(c){var g=(c[0]-e[0])/d,j=(c[1]-e[1])/d,k=Math.sqrt(g*g+j*j),l=b==="stereographic"?2*Math.atan(k):b==="gnomonic"?Math.atan(k):b==="equidistant"?k:b==="equalarea"?2*Math.asin(.5*k):Math.asin(k),m=Math.sin(l),n=Math.cos(l);return[(f+Math.atan2(g*m,k*h*n+j*i*m))/a,Math.asin(n*i-j*m*h/k)/a]},j.mode=function(a){if(!arguments.length)return b;b=a+"";return j},j.origin=function(b){if(!arguments.length)return c;c=b,f=c[0]*a,g=c[1]*a,h=Math.cos(g),i=Math.sin(g);return j},j.scale=function(a){if(!arguments.length)return d;d=+a;return j},j.translate=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return j};return j.origin([0,0])},d3.geo.albers=function(){function k(){var d=a*c[0],e=a*c[1],k=a*b[1],l=Math.sin(d),m=Math.cos(d);f=a*b[0],g=.5*(l+Math.sin(e)),h=m*m+2*g*l,i=Math.sqrt(h-2*g*Math.sin(k))/g;return j}function j(b){var c=g*(a*b[0]-f),j=Math.sqrt(h-2*g*Math.sin(a*b[1]))/g;return[d*j*Math.sin(c)+e[0],d*(j*Math.cos(c)-i)+e[1]]}var b=[-98,38],c=[29.5,45.5],d=1e3,e=[480,250],f,g,h,i;j.invert=function(b){var c=(b[0]-e[0])/d,j=(b[1]-e[1])/d,k=i+j,l=Math.atan2(c,k),m=Math.sqrt(c*c+k*k);return[(f+l/g)/a,Math.asin((h-m*m*g*g)/(2*g))/a]},j.origin=function(a){if(!arguments.length)return b;b=[+a[0],+a[1]];return k()},j.parallels=function(a){if(!arguments.length)return c;c=[+a[0],+a[1]];return k()},j.scale=function(a){if(!arguments.length)return d;d=+a;return j},j.translate=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return j};return k()},d3.geo.albersUsa=function(){function e(e){var f=e[0],g=e[1];return(g>50?b:f<-140?c:g<21?d:a)(e)}var a=d3.geo.albers(),b=d3.geo.albers().origin([-160,60]).parallels([55,65]),c=d3.geo.albers().origin([-160,20]).parallels([8,18]),d=d3.geo.albers().origin([-60,10]).parallels([8,18]);e.scale=function(f){if(!arguments.length)return a.scale();a.scale(f),b.scale(f*.6),c.scale(f),d.scale(f*1.5);return e.translate(a.translate())},e.translate=function(f){if(!arguments.length)return a.translate();var g=a.scale()/1e3,h=f[0],i=f[1];a.translate(f),b.translate([h-400*g,i+170*g]),c.translate([h-190*g,i+200*g]),d.translate([h+580*g,i+430*g]);return e};return e.scale(a.scale())},d3.geo.mercator=function(){function d(d){var e=d[0]/360,f=-(Math.log(Math.tan(Math.PI/4+d[1]*a/2))/a)/360;return[b*e+c[0],b*Math.max(-0.5,Math.min(.5,f))+c[1]]}var b=500,c=[480,250];d.invert=function(d){var e=(d[0]-c[0])/b,f=(d[1]-c[1])/b;return[360*e,2*Math.atan(Math.exp(-360*f*a))/a-90]},d.scale=function(a){if(!arguments.length)return b;b=+a;return d},d.translate=function(a){if(!arguments.length)return c;c=[+a[0],+a[1]];return d};return d},d3.geo.path=function(){function o(a){return Math.abs(d3.geom.polygon(a.map(f)).area())}function m(a){var b=d3.geom.polygon(a[0].map(f)),c=b.centroid(1),d=c[0],e=c[1],g=Math.abs(b.area()),h=0,i=a.length;while(++h<i)b=d3.geom.polygon(a[h].map(f)),c=b.centroid(1),d-=c[0],e-=c[1],g-=Math.abs(b.area());return[d,e,6*g]}function l(a){var b=o(a[0]),c=0,d=a.length;while(++c<d)b-=o(a[c]);return b}function i(a){return f(a).join(",")}function h(c,f){typeof a=="function"&&(e=b(a.apply(this,arguments)));return d(j,c)}var a=4.5,e=b(a),f=d3.geo.albersUsa(),g=Object,j={FeatureCollection:function(a){var b=[],c=a.features,e=-1,f=c.length;while(++e<f)b.push(d(j,c[e].geometry));return b.join("")},Feature:function(a){return d(j,a.geometry)},Point:function(a){var b=g.call(this,[a.coordinates]);return b.length?"M"+i(b[0])+e:""},MultiPoint:function(a){var b=[],c=g.call(this,a.coordinates),d=-1,f=c.length;while(++d<f)b.push("M",i(c[d]),e);return b.join("")},LineString:function(a){var b=["M"],c=g.call(this,a.coordinates),d=-1,e=c.length;while(++d<e)b.push(i(c[d]),"L");b.pop();return b.join("")},MultiLineString:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,h,j;while(++d<e){f=g.call(this,c[d]),h=-1,j=f.length,b.push("M");while(++h<j)b.push(i(f[h]),"L");b.pop()}return b.join("")},Polygon:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,h,j;while(++d<e){f=g.call(this,c[d]),h=-1,j=f.length-1;if(j<1)continue;b.push("M");while(++h<j)b.push(i(f[h]),"L");b[b.length-1]="Z"}return b.join("")},MultiPolygon:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,h,j,k,l,m;while(++d<e){f=c[d],h=-1,j=f.length;while(++h<j){k=g.call(this,f[h]),l=-1,m=k.length-1;if(m<1)continue;b.push("M");while(++l<m)b.push(i(k[l]),"L");b[b.length-1]="Z"}}return b.join("")},GeometryCollection:function(a){var b=[],c=a.geometries,e=-1,f=c.length;while(++e<f)b.push(d(j,c[e]));return b.join("")}},k={FeatureCollection:function(a){var b=0,c=a.features,e=-1,f=c.length;while(++e<f)b+=d(k,c[e]);return b},Feature:function(a){return d(k,a.geometry)},Point:c,MultiPoint:c,LineString:c,MultiLineString:c,Polygon:function(a){return l(a.coordinates)},MultiPolygon:function(a){var b=0,c=a.coordinates,d=-1,e=c.length;while(++d<e)b+=l(c[d]);return b},GeometryCollection:function(a){var b=0,c=a.geometries,e=-1,f=c.length;while(++e<f)b+=d(k,c[e]);return b}},n={Feature:function(a){return d(n,a.geometry)},Polygon:function(a){var b=m(a.coordinates);return[b[0]/b[2],b[1]/b[2]]},MultiPolygon:function(a){var b=0,c=a.coordinates,d,e=0,f=0,g=0,h=-1,i=c.length;while(++h<i)d=m(c[h]),e+=d[0],f+=d[1],g+=d[2];return[e/g,f/g]}};h.projection=function(a){f=a;return h},h.clip=function(a){if(!arguments.length)return g;g=a;return h},h.area=function(a){return d(k,a)},h.centroid=function(a){return d(n,a)},h.pointRadius=function(c){typeof c=="function"?a=c:(a=+c,e=b(a));return h};return h},d3.geo.bounds=function(a){var b=Infinity,c=Infinity,d=-Infinity,f=-Infinity;e(a,function(a,e){a<b&&(b=a),a>d&&(d=a),e<c&&(c=e),e>f&&(f=e)});return[[b,c],[d,f]]};var f={Feature:g,FeatureCollection:h,LineString:i,MultiLineString:j,MultiPoint:i,MultiPolygon:k,Point:l,Polygon:m};d3.geo.greatCircle=function(){function f(e,f){var g=b.call(this,e,f),h=c.call(this,e,f),i=g[0]*a,j=g[1]*a,k=h[0]*a,l=h[1]*a,m=Math.cos(i),n=Math.sin(i),o=Math.cos(j),p=Math.sin(j),q=Math.cos(k),r=Math.sin(k),s=Math.cos(l),t=Math.sin(l),e=Math.acos(p*t+o*s*Math.cos(k-i)),u=Math.sin(e),v=e/(d-1),w=-v,x=[],f=-1;while(++f<d){w+=v;var y=Math.sin(e-w)/u,z=Math.sin(w)/u,A=y*o*m+z*s*q,B=y*o*n+z*s*r,C=y*p+z*t;x[f]=[Math.atan2(B,A)/a,Math.atan2(C,Math.sqrt(A*A+B*B))/a]}return x}var b=n,c=o,d=100,e=6371;f.source=function(a){if(!arguments.length)return b;b=a;return f},f.target=function(a){if(!arguments.length)return c;c=a;return f},f.n=function(a){if(!arguments.length)return d;d=+a;return f},f.radius=function(a){if(!arguments.length)return e;e=+a;return f},f.distance=function(d,f){var g=b.call(this,d,f),h=c.call(this,d,f),i=g[0]*a,j=g[1]*a,k=h[0]*a,l=h[1]*a,m=Math.sin((l-j)/2),n=Math.sin((k-i)/2),o=m*m+Math.cos(j)*Math.cos(l)*n*n;return e*2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))};return f},d3.geo.clip=function(){function d(b){var d={source:a,target:null},e=b.length,f=-1,g,h,i=[],j=null,k=null;while(++f<e)d.target=b[f],distance=p.distance(d),distance<c?k?(h=p({source:k,target:d.target}),g=q(h,d,c),j&&i.push.apply(i,p({source:j,target:d.target})),i.push.apply(i,h.slice(g)),j=k=null):i.push(d.target):(k=d.target,!j&&i.length&&(h=p({source:i[i.length-1],target:d.target}),g=q(h,d,c),i.push.apply(i,h.slice(0,g)),j=d.target));k&&i.length&&(d.target=i[0],h=p({source:k,target:d.target}),g=q(h,d,c),j&&i.push.apply(i,p({source:j,target:d.target})),i.push.apply(i,h.slice(g)));return i}var a=[0,0],b=90,c=6371*b/180*Math.PI;d.origin=function(b){if(!arguments.length)return a;a=b;return d},d.angle=function(a){if(!arguments.length)return b;b=+a,c=6371*b/180*Math.PI;return d};return d};var p=d3.geo.greatCircle().n(100)})()
<ide>\ No newline at end of file
<ide><path>src/geo/greatCircle.js
<ide> d3.geo.greatCircle = function() {
<ide> radius = 6371; // Mean radius of Earth, in km.
<ide> // TODO: breakAtDateLine?
<ide>
<del> function greatCircle(d, i, dist) {
<add> function greatCircle(d, i) {
<ide> var from = source.call(this, d, i),
<ide> to = target.call(this, d, i),
<ide> x0 = from[0] * d3_radians,
<ide> d3.geo.greatCircle = function() {
<ide> cy0 = Math.cos(y0), sy0 = Math.sin(y0),
<ide> cx1 = Math.cos(x1), sx1 = Math.sin(x1),
<ide> cy1 = Math.cos(y1), sy1 = Math.sin(y1),
<del> d = dist || Math.acos(sy0 * sy1 + cy0 * cy1 * Math.cos(x1 - x0)),
<add> d = Math.acos(sy0 * sy1 + cy0 * cy1 * Math.cos(x1 - x0)),
<ide> sd = Math.sin(d),
<ide> f = d / (n - 1),
<ide> e = -f,
<ide> path = [],
<ide> i = -1;
<ide>
<del> if (d === 0) return [from];
<del>
<ide> while (++i < n) {
<ide> e += f;
<ide> var A = Math.sin(d - e) / sd, | 3 |
Text | Text | remove chris dickinson from ctc | a33f601267ad2284947e74284e296818fc171d37 | <ide><path>README.md
<ide> more information about the governance of the Node.js project, see
<ide> **Ben Noordhuis** <[email protected]>
<ide> * [ChALkeR](https://github.com/ChALkeR) -
<ide> **ะกะบะพะฒะพัะพะดะฐ ะะธะบะธัะฐ ะะฝะดัะตะตะฒะธั** <[email protected]> (he/him)
<del>* [chrisdickinson](https://github.com/chrisdickinson) -
<del>**Chris Dickinson** <[email protected]>
<ide> * [cjihrig](https://github.com/cjihrig) -
<ide> **Colin Ihrig** <[email protected]>
<ide> * [evanlucas](https://github.com/evanlucas) -
<ide> more information about the governance of the Node.js project, see
<ide> **Bartosz Sosnowski** <[email protected]>
<ide> * [calvinmetcalf](https://github.com/calvinmetcalf) -
<ide> **Calvin Metcalf** <[email protected]>
<add>* [chrisdickinson](https://github.com/chrisdickinson) -
<add>**Chris Dickinson** <[email protected]>
<ide> * [claudiorodriguez](https://github.com/claudiorodriguez) -
<ide> **Claudio Rodriguez** <[email protected]>
<ide> * [danbev](https://github.com/danbev) - | 1 |
Go | Go | fix spec file support for windows plugin discovery | 52c0daad82b424afc661c23c1d80784d014e1a58 | <ide><path>pkg/plugins/discovery_unix.go
<add>// +build !windows
<add>
<ide> package plugins
<ide>
<ide> var specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"}
<ide><path>pkg/plugins/discovery_windows.go
<ide> import (
<ide> "path/filepath"
<ide> )
<ide>
<del>var specPaths = []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")}
<add>var specsPaths = []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")} | 2 |
Javascript | Javascript | add regression tests | 8181c607e5cd96afc041636ceb37ff6758e8d470 | <ide><path>test/parallel/test-util.js
<ide> assert.strictEqual(false, util.isArray(Object.create(Array.prototype)));
<ide>
<ide> // isRegExp
<ide> assert.strictEqual(true, util.isRegExp(/regexp/));
<del>assert.strictEqual(true, util.isRegExp(RegExp()));
<add>assert.strictEqual(true, util.isRegExp(RegExp(), 'foo'));
<ide> assert.strictEqual(true, util.isRegExp(new RegExp()));
<ide> assert.strictEqual(true, util.isRegExp(context('RegExp')()));
<ide> assert.strictEqual(false, util.isRegExp({}));
<ide> assert.strictEqual(false, util.isRegExp(Object.create(RegExp.prototype)));
<ide>
<ide> // isDate
<ide> assert.strictEqual(true, util.isDate(new Date()));
<del>assert.strictEqual(true, util.isDate(new Date(0)));
<add>assert.strictEqual(true, util.isDate(new Date(0), 'foo'));
<ide> assert.strictEqual(true, util.isDate(new (context('Date'))()));
<ide> assert.strictEqual(false, util.isDate(Date()));
<ide> assert.strictEqual(false, util.isDate({})); | 1 |
Javascript | Javascript | fix pushtransition for transition tracing | 55a21ef7e78a4e35302cbc7ffb19934a23cc6957 | <ide><path>packages/react-reconciler/src/ReactFiberBeginWork.new.js
<ide> function updateOffscreenComponent(
<ide>
<ide> subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes);
<ide>
<add> let prevCachePool = null;
<ide> if (enableCache) {
<ide> // If the render that spawned this one accessed the cache pool, resume
<ide> // using the same cache. Unless the parent changed, since that means
<ide> // there was a refresh.
<del> const prevCachePool = prevState.cachePool;
<del> pushTransition(workInProgress, prevCachePool, null);
<add> prevCachePool = prevState.cachePool;
<ide> }
<ide>
<add> pushTransition(workInProgress, prevCachePool, null);
<add>
<ide> // Since we're not hidden anymore, reset the state
<ide> workInProgress.memoizedState = null;
<ide> } else {
<ide><path>packages/react-reconciler/src/ReactFiberBeginWork.old.js
<ide> function updateOffscreenComponent(
<ide>
<ide> subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes);
<ide>
<add> let prevCachePool = null;
<ide> if (enableCache) {
<ide> // If the render that spawned this one accessed the cache pool, resume
<ide> // using the same cache. Unless the parent changed, since that means
<ide> // there was a refresh.
<del> const prevCachePool = prevState.cachePool;
<del> pushTransition(workInProgress, prevCachePool, null);
<add> prevCachePool = prevState.cachePool;
<ide> }
<ide>
<add> pushTransition(workInProgress, prevCachePool, null);
<add>
<ide> // Since we're not hidden anymore, reset the state
<ide> workInProgress.memoizedState = null;
<ide> } else { | 2 |
Ruby | Ruby | link kegs without formulae | 1f971ba2a0575523300df2f4e63c03769ed3ad2a | <ide><path>Library/Homebrew/cmd/link.rb
<ide> def link
<ide> next
<ide> end
<ide>
<del> formula = keg.to_formula
<add> formula = begin
<add> keg.to_formula
<add> rescue FormulaUnavailableError
<add> # Not all kegs may belong to formulae e.g. with `brew diy`
<add> nil
<add> end
<ide>
<ide> if keg_only
<del> if Homebrew.default_prefix? && formula.keg_only_reason.by_macos?
<add> if Homebrew.default_prefix? && formula.present? && formula.keg_only_reason.by_macos?
<ide> caveats = Caveats.new(formula)
<ide> opoo <<~EOS
<ide> Refusing to link macOS provided/shadowed software: #{keg.name}
<ide> def link
<ide> next
<ide> end
<ide>
<del> if !formula.keg_only_reason.versioned_formula? && !args.force?
<add> if !args.force? && (formula.blank? || !formula.keg_only_reason.versioned_formula?)
<ide> opoo "#{keg.name} is keg-only and must be linked with --force"
<ide> puts_keg_only_path_message(keg)
<ide> next
<ide> end
<ide> end
<ide>
<del> Unlink.unlink_versioned_formulae(formula, verbose: args.verbose?)
<add> Unlink.unlink_versioned_formulae(formula, verbose: args.verbose?) if formula
<ide>
<ide> keg.lock do
<ide> print "Linking #{keg}... " | 1 |
Text | Text | add missing props | 3a86b4fcb61794378b4a4d9db454541b5f253880 | <ide><path>docs/NativeComponentsIOS.md
<ide> You can see we're adding an event handler property to the view by subclassing `M
<ide> // MapView.js
<ide>
<ide> class MapView extends React.Component {
<del> constructor() {
<add> constructor(props) {
<ide> super(props)
<ide> this._onChange = this._onChange.bind(this);
<ide> } | 1 |
Text | Text | update security docs | 92861b91cfa393cbbd628cce8d013148d9e0d18c | <ide><path>SECURITY.md
<ide> This document outlines our security policy for the codebase, and how to report v
<ide> | Version | Branch | Supported | Website active |
<ide> | ----------- | ------------------------ | ------------------ | ---------------- |
<ide> | production | `production-legacy-2018` | :white_check_mark: | freecodecamp.org |
<del>| beta | `master` | | |
<add>| beta | `production-staging` | :white_check_mark: | freecodecamp.dev |
<ide> | development | `master` | | |
<ide>
<ide> ## Reporting a Vulnerability | 1 |
Go | Go | update findcgroupmountpoint to be more forgiving | e413340723871ad2d7a03822ca06993ee3c0a4bc | <ide><path>utils.go
<ide> func FindCgroupMountpoint(cgroupType string) (string, error) {
<ide> return "", err
<ide> }
<ide>
<del> reg := regexp.MustCompile(`^cgroup on (.*) type cgroup \(.*` + cgroupType + `[,\)]`)
<add> reg := regexp.MustCompile(`^.* on (.*) type cgroup \(.*` + cgroupType + `[,\)]`)
<ide> for _, line := range strings.Split(string(output), "\n") {
<ide> r := reg.FindStringSubmatch(line)
<ide> if len(r) == 2 { | 1 |
Ruby | Ruby | allow revisions on svn checkouts | eafba2261fdfe140b4cba0703f4bab61152dcaa8 | <ide><path>Library/Homebrew/download_strategy.rb
<ide> def fetch
<ide> ohai "Checking out #{@url}"
<ide> @co=HOMEBREW_CACHE+@unique_token
<ide> unless @co.exist?
<del> safe_system '/usr/bin/svn', 'checkout', @url, @co
<add> checkout_args = ['/usr/bin/svn', 'checkout', @url]
<add>
<add> if (@spec == :revision) and @ref
<add> checkout_args << '-r'
<add> checkout_args << @ref
<add> end
<add>
<add> checkout_args << @co
<add>
<add> safe_system *checkout_args
<ide> else
<ide> # TODO svn up?
<ide> puts "Repository already checked out" | 1 |
PHP | PHP | add missing methods to invalidpropertyinterface | 081beae8ac69c4151858a3706b6bf58f78ca5357 | <ide><path>src/Datasource/InvalidPropertyInterface.php
<ide> /**
<ide> * Describes the methods that any class representing a data storage should
<ide> * comply with.
<del> *
<del> * @method array getInvalid()
<del> * @method mixed getInvalidField($field)
<del> * @method $this setInvalid($field, $value = null, $overwrite = false)
<del> * @method $this setInvalidField($field, $value = null, $overwrite = false)
<ide> */
<ide> interface InvalidPropertyInterface
<ide> {
<add>
<add> /**
<add> * Get a list of invalid fields and their data for errors upon validation/patching
<add> *
<add> * @return array
<add> */
<add> public function getInvalid();
<add>
<add> /**
<add> * Set fields as invalid and not patchable into the entity.
<add> *
<add> * This is useful for batch operations when one needs to get the original value for an error message after patching.
<add> * This value could not be patched into the entity and is simply copied into the _invalid property for debugging purposes
<add> * or to be able to log it away.
<add> *
<add> * @param array $fields The values to set.
<add> * @param bool $overwrite Whether or not to overwrite pre-existing values for $field.
<add> * @return $this
<add> */
<add> public function setInvalid(array $fields, $overwrite = false);
<add>
<add> /**
<add> * Get a single value of an invalid field. Returns null if not set.
<add> *
<add> * @param string $field The name of the field.
<add> * @return mixed
<add> */
<add> public function getInvalidField($field);
<add>
<add> /**
<add> * Sets a field as invalid and not patchable into the entity.
<add> *
<add> * @param string $field The value to set.
<add> * @param mixed $value The invalid value to be set for $field.
<add> * @return $this
<add> */
<add> public function setInvalidField($field, $value);
<ide> } | 1 |
Javascript | Javascript | remove redundant additional url tests | 84ee95780073e06459fd5fcb0682517e7be6e263 | <ide><path>test/fixtures/url-tests-additional.js
<add>'use strict';
<add>
<add>// This file contains test cases not part of the WPT
<add>
<ide> module.exports = [
<del> {
<del> 'url': 'tftp://foobar.com/someconfig;mode=netascii',
<del> 'protocol': 'tftp:',
<del> 'hostname': 'foobar.com',
<del> 'pathname': '/someconfig;mode=netascii'
<del> },
<del> {
<del> 'url': 'telnet://user:[email protected]:23/',
<del> 'protocol': 'telnet:',
<del> 'username': 'user',
<del> 'password': 'pass',
<del> 'hostname': 'foobar.com',
<del> 'port': '23',
<del> 'pathname': '/'
<del> },
<del> {
<del> 'url': 'ut2004://10.10.10.10:7777/Index.ut2',
<del> 'protocol': 'ut2004:',
<del> 'hostname': '10.10.10.10',
<del> 'port': '7777',
<del> 'pathname': '/Index.ut2'
<del> },
<del> {
<del> 'url': 'redis://foo:bar@somehost:6379/0?baz=bam&qux=baz',
<del> 'protocol': 'redis:',
<del> 'username': 'foo',
<del> 'password': 'bar',
<del> 'hostname': 'somehost',
<del> 'port': '6379',
<del> 'pathname': '/0',
<del> 'search': '?baz=bam&qux=baz'
<del> },
<del> {
<del> 'url': 'rsync://foo@host:911/sup',
<del> 'protocol': 'rsync:',
<del> 'username': 'foo',
<del> 'hostname': 'host',
<del> 'port': '911',
<del> 'pathname': '/sup'
<del> },
<del> {
<del> 'url': 'git://github.com/foo/bar.git',
<del> 'protocol': 'git:',
<del> 'hostname': 'github.com',
<del> 'pathname': '/foo/bar.git'
<del> },
<del> {
<del> 'url': 'irc://myserver.com:6999/channel?passwd',
<del> 'protocol': 'irc:',
<del> 'hostname': 'myserver.com',
<del> 'port': '6999',
<del> 'pathname': '/channel',
<del> 'search': '?passwd'
<del> },
<del> {
<del> 'url': 'dns://fw.example.org:9999/foo.bar.org?type=TXT',
<del> 'protocol': 'dns:',
<del> 'hostname': 'fw.example.org',
<del> 'port': '9999',
<del> 'pathname': '/foo.bar.org',
<del> 'search': '?type=TXT'
<del> },
<del> {
<del> 'url': 'ldap://localhost:389/ou=People,o=JNDITutorial',
<del> 'protocol': 'ldap:',
<del> 'hostname': 'localhost',
<del> 'port': '389',
<del> 'pathname': '/ou=People,o=JNDITutorial'
<del> },
<del> {
<del> 'url': 'git+https://github.com/foo/bar',
<del> 'protocol': 'git+https:',
<del> 'hostname': 'github.com',
<del> 'pathname': '/foo/bar'
<del> },
<del> {
<del> 'url': 'urn:ietf:rfc:2648',
<del> 'protocol': 'urn:',
<del> 'pathname': 'ietf:rfc:2648'
<del> },
<del> {
<del> 'url': 'tag:[email protected],2001:foo/bar',
<del> 'protocol': 'tag:',
<del> 'pathname': '[email protected],2001:foo/bar'
<del> }
<ide> ]; | 1 |
Go | Go | use file_share_delete for log files on windows | a5f237c2b54177ffe45cf371461db1892e092452 | <ide><path>daemon/logger/loggerutils/file_unix.go
<add>// +build !windows
<add>
<add>package loggerutils
<add>
<add>import "os"
<add>
<add>func openFile(name string, flag int, perm os.FileMode) (*os.File, error) {
<add> return os.OpenFile(name, flag, perm)
<add>}
<ide><path>daemon/logger/loggerutils/file_windows.go
<add>package loggerutils
<add>
<add>import (
<add> "os"
<add> "syscall"
<add> "unsafe"
<add>
<add> "github.com/pkg/errors"
<add>)
<add>
<add>func openFile(name string, flag int, perm os.FileMode) (*os.File, error) {
<add> if name == "" {
<add> return nil, &os.PathError{Op: "open", Path: name, Err: syscall.ENOENT}
<add> }
<add> h, err := syscallOpen(fixLongPath(name), flag|syscall.O_CLOEXEC, syscallMode(perm))
<add> if err != nil {
<add> return nil, errors.Wrap(err, "error opening file")
<add> }
<add> return os.NewFile(uintptr(h), name), nil
<add>}
<add>
<add>// syscallOpen is copied from syscall.Open but is modified to
<add>// always open a file with FILE_SHARE_DELETE
<add>func syscallOpen(path string, mode int, perm uint32) (fd syscall.Handle, err error) {
<add> if len(path) == 0 {
<add> return syscall.InvalidHandle, syscall.ERROR_FILE_NOT_FOUND
<add> }
<add>
<add> pathp, err := syscall.UTF16PtrFromString(path)
<add> if err != nil {
<add> return syscall.InvalidHandle, err
<add> }
<add> var access uint32
<add> switch mode & (syscall.O_RDONLY | syscall.O_WRONLY | syscall.O_RDWR) {
<add> case syscall.O_RDONLY:
<add> access = syscall.GENERIC_READ
<add> case syscall.O_WRONLY:
<add> access = syscall.GENERIC_WRITE
<add> case syscall.O_RDWR:
<add> access = syscall.GENERIC_READ | syscall.GENERIC_WRITE
<add> }
<add> if mode&syscall.O_CREAT != 0 {
<add> access |= syscall.GENERIC_WRITE
<add> }
<add> if mode&syscall.O_APPEND != 0 {
<add> access &^= syscall.GENERIC_WRITE
<add> access |= syscall.FILE_APPEND_DATA
<add> }
<add> sharemode := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE | syscall.FILE_SHARE_DELETE)
<add> var sa *syscall.SecurityAttributes
<add> if mode&syscall.O_CLOEXEC == 0 {
<add> sa = makeInheritSa()
<add> }
<add> var createmode uint32
<add> switch {
<add> case mode&(syscall.O_CREAT|syscall.O_EXCL) == (syscall.O_CREAT | syscall.O_EXCL):
<add> createmode = syscall.CREATE_NEW
<add> case mode&(syscall.O_CREAT|syscall.O_TRUNC) == (syscall.O_CREAT | syscall.O_TRUNC):
<add> createmode = syscall.CREATE_ALWAYS
<add> case mode&syscall.O_CREAT == syscall.O_CREAT:
<add> createmode = syscall.OPEN_ALWAYS
<add> case mode&syscall.O_TRUNC == syscall.O_TRUNC:
<add> createmode = syscall.TRUNCATE_EXISTING
<add> default:
<add> createmode = syscall.OPEN_EXISTING
<add> }
<add> h, e := syscall.CreateFile(pathp, access, sharemode, sa, createmode, syscall.FILE_ATTRIBUTE_NORMAL, 0)
<add> return h, e
<add>}
<add>
<add>func makeInheritSa() *syscall.SecurityAttributes {
<add> var sa syscall.SecurityAttributes
<add> sa.Length = uint32(unsafe.Sizeof(sa))
<add> sa.InheritHandle = 1
<add> return &sa
<add>}
<add>
<add>// fixLongPath returns the extended-length (\\?\-prefixed) form of
<add>// path when needed, in order to avoid the default 260 character file
<add>// path limit imposed by Windows. If path is not easily converted to
<add>// the extended-length form (for example, if path is a relative path
<add>// or contains .. elements), or is short enough, fixLongPath returns
<add>// path unmodified.
<add>//
<add>// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
<add>//
<add>// Copied from os.OpenFile
<add>func fixLongPath(path string) string {
<add> // Do nothing (and don't allocate) if the path is "short".
<add> // Empirically (at least on the Windows Server 2013 builder),
<add> // the kernel is arbitrarily okay with < 248 bytes. That
<add> // matches what the docs above say:
<add> // "When using an API to create a directory, the specified
<add> // path cannot be so long that you cannot append an 8.3 file
<add> // name (that is, the directory name cannot exceed MAX_PATH
<add> // minus 12)." Since MAX_PATH is 260, 260 - 12 = 248.
<add> //
<add> // The MSDN docs appear to say that a normal path that is 248 bytes long
<add> // will work; empirically the path must be less then 248 bytes long.
<add> if len(path) < 248 {
<add> // Don't fix. (This is how Go 1.7 and earlier worked,
<add> // not automatically generating the \\?\ form)
<add> return path
<add> }
<add>
<add> // The extended form begins with \\?\, as in
<add> // \\?\c:\windows\foo.txt or \\?\UNC\server\share\foo.txt.
<add> // The extended form disables evaluation of . and .. path
<add> // elements and disables the interpretation of / as equivalent
<add> // to \. The conversion here rewrites / to \ and elides
<add> // . elements as well as trailing or duplicate separators. For
<add> // simplicity it avoids the conversion entirely for relative
<add> // paths or paths containing .. elements. For now,
<add> // \\server\share paths are not converted to
<add> // \\?\UNC\server\share paths because the rules for doing so
<add> // are less well-specified.
<add> if len(path) >= 2 && path[:2] == `\\` {
<add> // Don't canonicalize UNC paths.
<add> return path
<add> }
<add> if !isAbs(path) {
<add> // Relative path
<add> return path
<add> }
<add>
<add> const prefix = `\\?`
<add>
<add> pathbuf := make([]byte, len(prefix)+len(path)+len(`\`))
<add> copy(pathbuf, prefix)
<add> n := len(path)
<add> r, w := 0, len(prefix)
<add> for r < n {
<add> switch {
<add> case os.IsPathSeparator(path[r]):
<add> // empty block
<add> r++
<add> case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])):
<add> // /./
<add> r++
<add> case r+1 < n && path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])):
<add> // /../ is currently unhandled
<add> return path
<add> default:
<add> pathbuf[w] = '\\'
<add> w++
<add> for ; r < n && !os.IsPathSeparator(path[r]); r++ {
<add> pathbuf[w] = path[r]
<add> w++
<add> }
<add> }
<add> }
<add> // A drive's root directory needs a trailing \
<add> if w == len(`\\?\c:`) {
<add> pathbuf[w] = '\\'
<add> w++
<add> }
<add> return string(pathbuf[:w])
<add>}
<add>
<add>// copied from os package for os.OpenFile
<add>func syscallMode(i os.FileMode) (o uint32) {
<add> o |= uint32(i.Perm())
<add> if i&os.ModeSetuid != 0 {
<add> o |= syscall.S_ISUID
<add> }
<add> if i&os.ModeSetgid != 0 {
<add> o |= syscall.S_ISGID
<add> }
<add> if i&os.ModeSticky != 0 {
<add> o |= syscall.S_ISVTX
<add> }
<add> // No mapping for Go's ModeTemporary (plan9 only).
<add> return
<add>}
<add>
<add>func isAbs(path string) (b bool) {
<add> v := volumeName(path)
<add> if v == "" {
<add> return false
<add> }
<add> path = path[len(v):]
<add> if path == "" {
<add> return false
<add> }
<add> return os.IsPathSeparator(path[0])
<add>}
<add>
<add>func volumeName(path string) (v string) {
<add> if len(path) < 2 {
<add> return ""
<add> }
<add> // with drive letter
<add> c := path[0]
<add> if path[1] == ':' &&
<add> ('0' <= c && c <= '9' || 'a' <= c && c <= 'z' ||
<add> 'A' <= c && c <= 'Z') {
<add> return path[:2]
<add> }
<add> // is it UNC
<add> if l := len(path); l >= 5 && os.IsPathSeparator(path[0]) && os.IsPathSeparator(path[1]) &&
<add> !os.IsPathSeparator(path[2]) && path[2] != '.' {
<add> // first, leading `\\` and next shouldn't be `\`. its server name.
<add> for n := 3; n < l-1; n++ {
<add> // second, next '\' shouldn't be repeated.
<add> if os.IsPathSeparator(path[n]) {
<add> n++
<add> // third, following something characters. its share name.
<add> if !os.IsPathSeparator(path[n]) {
<add> if path[n] == '.' {
<add> break
<add> }
<add> for ; n < l; n++ {
<add> if os.IsPathSeparator(path[n]) {
<add> break
<add> }
<add> }
<add> return path[:n]
<add> }
<add> break
<add> }
<add> }
<add> }
<add> return ""
<add>}
<ide><path>daemon/logger/loggerutils/file_windows_test.go
<add>package loggerutils
<add>
<add>import (
<add> "io/ioutil"
<add> "os"
<add> "path/filepath"
<add> "testing"
<add>
<add> "gotest.tools/assert"
<add>)
<add>
<add>func TestOpenFileDelete(t *testing.T) {
<add> tmpDir, err := ioutil.TempDir("", t.Name())
<add> assert.NilError(t, err)
<add> defer os.RemoveAll(tmpDir)
<add>
<add> f, err := openFile(filepath.Join(tmpDir, "test.txt"), os.O_CREATE|os.O_RDWR, 644)
<add> assert.NilError(t, err)
<add> defer f.Close()
<add>
<add> assert.NilError(t, os.RemoveAll(f.Name()))
<add>}
<add>
<add>func TestOpenFileRename(t *testing.T) {
<add> tmpDir, err := ioutil.TempDir("", t.Name())
<add> assert.NilError(t, err)
<add> defer os.RemoveAll(tmpDir)
<add>
<add> f, err := openFile(filepath.Join(tmpDir, "test.txt"), os.O_CREATE|os.O_RDWR, 0644)
<add> assert.NilError(t, err)
<add> defer f.Close()
<add>
<add> assert.NilError(t, os.Rename(f.Name(), f.Name()+"renamed"))
<add>}
<ide><path>daemon/logger/loggerutils/logfile.go
<ide> type GetTailReaderFunc func(ctx context.Context, f SizeReaderAt, nLogLines int)
<ide>
<ide> // NewLogFile creates new LogFile
<ide> func NewLogFile(logPath string, capacity int64, maxFiles int, compress bool, marshaller logger.MarshalFunc, decodeFunc makeDecoderFunc, perms os.FileMode, getTailReader GetTailReaderFunc) (*LogFile, error) {
<del> log, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, perms)
<add> log, err := openFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, perms)
<ide> if err != nil {
<ide> return nil, err
<ide> }
<ide> func (w *LogFile) checkCapacityAndRotate() error {
<ide> w.rotateMu.Unlock()
<ide> return err
<ide> }
<del> file, err := os.OpenFile(fname, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, w.perms)
<add> file, err := openFile(fname, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, w.perms)
<ide> if err != nil {
<ide> w.rotateMu.Unlock()
<ide> return err
<ide> func compressFile(fileName string, lastTimestamp time.Time) {
<ide> }
<ide> }()
<ide>
<del> outFile, err := os.OpenFile(fileName+".gz", os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0640)
<add> outFile, err := openFile(fileName+".gz", os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0640)
<ide> if err != nil {
<ide> logrus.Errorf("Failed to open or create gzip log file: %v", err)
<ide> return
<ide> func decompressfile(fileName, destFileName string, since time.Time) (*os.File, e
<ide> return nil, nil
<ide> }
<ide>
<del> rs, err := os.OpenFile(destFileName, os.O_CREATE|os.O_RDWR, 0640)
<add> rs, err := openFile(destFileName, os.O_CREATE|os.O_RDWR, 0640)
<ide> if err != nil {
<ide> return nil, errors.Wrap(err, "error creating file for copying decompressed log stream")
<ide> } | 4 |
Python | Python | add segformerfeatureextractor to auto api | ee5de663493dc1745199dded9a8e9d1777aa9657 | <ide><path>src/transformers/models/auto/feature_extraction_auto.py
<ide> ("perceiver", "PerceiverFeatureExtractor"),
<ide> ("swin", "ViTFeatureExtractor"),
<ide> ("vit_mae", "ViTFeatureExtractor"),
<add> ("segformer", "SegformerFeatureExtractor"),
<ide> ]
<ide> )
<ide> | 1 |
Ruby | Ruby | do a stricter version check | 04088ba96dfcc91eb74a3903e9ca1c951fa11511 | <ide><path>Library/Homebrew/formula.rb
<ide> def initialize name='__UNKNOWN__', path=nil
<ide> set_instance_variable 'bottle_sha1'
<ide> set_instance_variable 'head'
<ide> set_instance_variable 'specs'
<del>
<ide> set_instance_variable 'standard'
<ide> set_instance_variable 'unstable'
<ide>
<ide> def initialize name='__UNKNOWN__', path=nil
<ide> end
<ide>
<ide> raise "No url provided for formula #{name}" if @url.nil?
<del> @name=name
<add> @name = name
<ide> validate_variable :name
<ide>
<ide> # If we got an explicit path, use that, else determine from the name
<ide> @path = path.nil? ? self.class.path(name) : Pathname.new(path)
<ide>
<add> # Use a provided version, if any
<ide> set_instance_variable 'version'
<add> # Otherwise detect the version from the URL
<ide> @version ||= @spec_to_use.detect_version
<del> validate_variable :version if @version
<add> validate_variable :version
<ide>
<ide> CHECKSUM_TYPES.each { |type| set_instance_variable type }
<ide>
<del> @downloader=download_strategy.new @spec_to_use.url, name, version, @spec_to_use.specs
<add> @downloader = download_strategy.new @spec_to_use.url, name, version, @spec_to_use.specs
<ide> end
<ide>
<ide> # if the dir is there, but it's empty we consider it not installed | 1 |
Python | Python | revert previous commit | 888c25f4dd7b8dfc15701885633329320cfad415 | <ide><path>airflow/models.py
<ide> def command(
<ide> installed. This command is part of the message sent to executors by
<ide> the orchestrator.
<ide> """
<del> dag = self.task.dag
<ide> iso = self.execution_date.isoformat()
<ide> mark_success = "--mark_success" if mark_success else ""
<ide> pickle = "--pickle {0}".format(pickle_id) if pickle_id else ""
<ide> def command(
<ide> "-s " + task_start_date.isoformat() if task_start_date else ""
<ide> raw = "--raw" if raw else ""
<ide> subdir = ""
<del> if not pickle and dag and dag.full_filepath:
<del> if dag.full_filepath.startswith('/'):
<del> subdir = "-sd {0}"
<del> else:
<del> subdir = "-sd DAGS_FOLDER/{0}"
<del> subdir = subdir.format(dag.filepath)
<add> if not pickle and self.task.dag and self.task.dag.full_filepath:
<add> subdir = "-sd DAGS_FOLDER/{0}".format(self.task.dag.filepath)
<ide> return (
<ide> "airflow run "
<ide> "{self.dag_id} {self.task_id} {iso} " | 1 |
Javascript | Javascript | use rendertostaticmarkup for tests | f61138e0681f729c43cf755f48f060e6262a09eb | <ide><path>packages/react-dom/src/__tests__/ReactServerRendering-test.js
<ide> describe('ReactDOMServer', () => {
<ide> return <div>{this.state.text}</div>;
<ide> }
<ide> }
<del> const markup = ReactDOMServer.renderToString(<Component />);
<add> const markup = ReactDOMServer.renderToStaticMarkup(<Component />);
<ide> expect(markup).toContain('hello, world');
<ide> });
<ide>
<ide> describe('ReactDOMServer', () => {
<ide> return <div>{this.state.text}</div>;
<ide> }
<ide> }
<del> const markup = ReactDOMServer.renderToString(<Component />);
<add> const markup = ReactDOMServer.renderToStaticMarkup(<Component />);
<ide> expect(markup).toContain('hello, world');
<ide> });
<ide>
<ide> describe('ReactDOMServer', () => {
<ide> }
<ide> }
<ide>
<del> const markup = ReactDOMServer.renderToString(
<add> const markup = ReactDOMServer.renderToStaticMarkup(
<ide> <Component text="hello, world" />,
<ide> );
<ide> expect(markup).toContain('hello, world');
<ide> describe('ReactDOMServer', () => {
<ide> text: PropTypes.string,
<ide> };
<ide>
<del> const markup = ReactDOMServer.renderToString(
<add> const markup = ReactDOMServer.renderToStaticMarkup(
<ide> <ContextProvider>
<ide> <Component />
<ide> </ContextProvider>,
<ide> describe('ReactDOMServer', () => {
<ide> );
<ide> }
<ide>
<del> const markup = ReactDOMServer.renderToString(<App value={1} />);
<add> const markup = ReactDOMServer.renderToStaticMarkup(<App value={1} />);
<ide> // Extract the numbers rendered by the consumers
<ide> const results = markup.match(/\d+/g).map(Number);
<ide> expect(results).toEqual([2, 1, 3, 1]);
<ide> describe('ReactDOMServer', () => {
<ide> );
<ide> }
<ide>
<del> const markup = ReactDOMServer.renderToString(<App value={1} />);
<add> const markup = ReactDOMServer.renderToStaticMarkup(<App value={1} />);
<ide> // Extract the numbers rendered by the consumers
<ide> const results = markup.match(/\d+/g).map(Number);
<ide> expect(results).toEqual([2, 1, 3, 1]);
<ide> describe('ReactDOMServer', () => {
<ide>
<ide> let reentrantMarkup;
<ide> function Reentrant() {
<del> reentrantMarkup = ReactDOMServer.renderToString(
<add> reentrantMarkup = ReactDOMServer.renderToStaticMarkup(
<ide> <App value={1} reentrant={false} />,
<ide> );
<ide> return null;
<ide> describe('ReactDOMServer', () => {
<ide> );
<ide> }
<ide>
<del> const markup = ReactDOMServer.renderToString(
<add> const markup = ReactDOMServer.renderToStaticMarkup(
<ide> <App value={1} reentrant={true} />,
<ide> );
<ide> // Extract the numbers rendered by the consumers
<ide> describe('ReactDOMServer', () => {
<ide> },
<ide> }));
<ide>
<del> expect(ReactDOMServer.renderToString(<LazyFoo id="foo" />)).toEqual(
<add> expect(ReactDOMServer.renderToStaticMarkup(<LazyFoo id="foo" />)).toEqual(
<ide> '<div id="foo">lazy</div>',
<ide> );
<ide> });
<ide> describe('ReactDOMServer', () => {
<ide> },
<ide> }));
<ide>
<del> expect(() => ReactDOMServer.renderToString(<LazyFoo />)).toThrow(
<add> expect(() => ReactDOMServer.renderToStaticMarkup(<LazyFoo />)).toThrow(
<ide> 'Bad lazy',
<ide> );
<ide> }); | 1 |
Python | Python | fix serialization error in taskcallbackrequest | d7e14ba0d612d8315238f9d0cba4ef8c44b6867c | <ide><path>airflow/callbacks/callback_requests.py
<ide> def __init__(
<ide>
<ide> def to_json(self) -> str:
<ide> dict_obj = self.__dict__.copy()
<del> dict_obj["simple_task_instance"] = dict_obj["simple_task_instance"].__dict__
<add> dict_obj["simple_task_instance"] = self.simple_task_instance.as_dict()
<ide> return json.dumps(dict_obj)
<ide>
<ide> @classmethod
<ide><path>airflow/models/taskinstance.py
<ide> def __eq__(self, other):
<ide> return self.__dict__ == other.__dict__
<ide> return NotImplemented
<ide>
<add> def as_dict(self):
<add> new_dict = dict(self.__dict__)
<add> for key in new_dict:
<add> if key in ['start_date', 'end_date']:
<add> val = new_dict[key]
<add> if not val or isinstance(val, str):
<add> continue
<add> new_dict.update({key: val.isoformat()})
<add> return new_dict
<add>
<ide> @classmethod
<ide> def from_ti(cls, ti: TaskInstance) -> "SimpleTaskInstance":
<ide> return cls(
<ide><path>tests/callbacks/test_callback_requests.py
<ide> # specific language governing permissions and limitations
<ide> # under the License.
<ide>
<del>import unittest
<ide> from datetime import datetime
<ide>
<ide> from parameterized import parameterized
<ide> from airflow.models.dag import DAG
<ide> from airflow.models.taskinstance import SimpleTaskInstance, TaskInstance
<ide> from airflow.operators.bash import BashOperator
<add>from airflow.utils import timezone
<ide> from airflow.utils.state import State
<ide>
<ide> TI = TaskInstance(
<ide> )
<ide>
<ide>
<del>class TestCallbackRequest(unittest.TestCase):
<add>class TestCallbackRequest:
<ide> @parameterized.expand(
<ide> [
<ide> (CallbackRequest(full_filepath="filepath", msg="task_failure"), CallbackRequest),
<ide> class TestCallbackRequest(unittest.TestCase):
<ide> )
<ide> def test_from_json(self, input, request_class):
<ide> json_str = input.to_json()
<del>
<ide> result = request_class.from_json(json_str=json_str)
<add> assert result == input
<ide>
<del> self.assertEqual(result, input)
<add> def test_taskcallback_to_json_with_start_date_and_end_date(self, session, create_task_instance):
<add> ti = create_task_instance()
<add> ti.start_date = timezone.utcnow()
<add> ti.end_date = timezone.utcnow()
<add> session.merge(ti)
<add> session.flush()
<add> input = TaskCallbackRequest(
<add> full_filepath="filepath",
<add> simple_task_instance=SimpleTaskInstance.from_ti(ti),
<add> is_failure_callback=True,
<add> )
<add> json_str = input.to_json()
<add> result = TaskCallbackRequest.from_json(json_str)
<add> assert input == result | 3 |
Python | Python | set version to v3.0.0a2 | 19d42f42de30ba57e17427798ea2562cdab2c9f8 | <ide><path>spacy/about.py
<ide> # fmt: off
<ide> __title__ = "spacy-nightly"
<del>__version__ = "3.0.0a1"
<add>__version__ = "3.0.0a2"
<ide> __release__ = True
<ide> __download_url__ = "https://github.com/explosion/spacy-models/releases/download"
<ide> __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" | 1 |
PHP | PHP | fix more type issues | c9b218665132078917b436dd6d7490c1e3c3822d | <ide><path>src/Database/Schema/PostgresSchema.php
<ide> public function convertColumnDescription(TableSchema $schema, array $row): void
<ide> * Postgres includes sequence data and casting information in default values.
<ide> * We need to remove those.
<ide> *
<del> * @param string|null $default The default value.
<del> * @return string|null
<add> * @param string|int|null $default The default value.
<add> * @return string|int|null
<ide> */
<del> protected function _defaultValue(?string $default): ?string
<add> protected function _defaultValue($default)
<ide> {
<ide> if (is_numeric($default) || $default === null) {
<ide> return $default;
<ide><path>src/Database/Schema/TableSchema.php
<ide> public function defaultValues(): array
<ide> * {@inheritDoc}
<ide> * @throws \Cake\Database\Exception
<ide> */
<del> public function addIndex($name, $attrs): TableSchemaInterface
<add> public function addIndex(string $name, array $attrs): TableSchemaInterface
<ide> {
<ide> if (is_string($attrs)) {
<ide> $attrs = ['type' => $attrs]; | 2 |
Text | Text | fix typos in setup article | 941f0233db0d0dc42ddc0c5900abadbaa247769d | <ide><path>threejs/lessons/threejs-setup.md
<ide> If you haven't read that yet you might want to start there.
<ide>
<ide> Before we go any further we need to talk about setting up your
<ide> computer to do developement. In particular, for security reasons,
<del>WebGL can not use images from your hard drive directly. That means
<add>WebGL cannot use images from your hard drive directly. That means
<ide> in order to do development you need to use a web server. Fortunately
<del>development webservers are super easy to setup and use.
<add>development web servers are super easy to setup and use.
<ide>
<ide> First off if you'd like you can download this entire site from [this link](https://github.com/greggman/threejsfundamentals/archive/gh-pages.zip).
<ide> Once downloaded double click the zip file to unpack the files.
<ide>
<del>Next download one of these simple web servers
<add>Next download one of these simple web servers.
<ide>
<del>If you'd prefer a web server with a user interface there's
<add>If you'd prefer a web server with a user interface there's
<ide> [Servez](https://greggman.github.io/servez)
<ide>
<ide> {{{image url="resources/servez.gif" className="border" }}}
<ide> Then in your browser go to [`http://localhost:8080/`](http://localhost:8080/).
<ide>
<ide> If you don't specify a path then http-server will serve the current folder.
<ide>
<del>If either of those options are not to your liking
<add>If either of those options are not to your liking
<ide> [there are many other simple servers to choose from](https://stackoverflow.com/questions/12905426/what-is-a-faster-alternative-to-pythons-http-server-or-simplehttpserver).
<ide>
<ide> Now that you have a server setup we can move on to [textures](threejs-textures.html). | 1 |
Ruby | Ruby | move cleanup into teardown, delete obsolete code | c0850784421ec451afe460014c988274db2c12fd | <ide><path>actionview/test/template/compiled_templates_test.rb
<ide> require 'abstract_unit'
<ide>
<ide> class CompiledTemplatesTest < ActiveSupport::TestCase
<del> def setup
<del> # Clean up any details key cached to expose failures
<del> # that otherwise would appear just on isolated tests
<add> teardown do
<ide> ActionView::LookupContext::DetailsKey.clear
<del>
<del> @compiled_templates = ActionView::CompiledTemplates
<del> @compiled_templates.instance_methods.each do |m|
<del> @compiled_templates.send(:remove_method, m) if m =~ /^_render_template_/
<del> end
<ide> end
<ide>
<ide> def test_template_gets_recompiled_when_using_different_keys_in_local_assigns | 1 |
PHP | PHP | add controller method | 1f8e0081a384e82098605826b4d4c3d5c7c184d7 | <ide><path>src/Illuminate/Support/Facades/Route.php
<ide> * @method static \Illuminate\Routing\Route substituteBindings(\Illuminate\Support\Facades\Route $route)
<ide> * @method static \Illuminate\Routing\Route view(string $uri, string $view, array $data = [], int|array $status = 200, array $headers = [])
<ide> * @method static \Illuminate\Routing\RouteRegistrar as(string $value)
<add> * @method static \Illuminate\Routing\RouteRegistrar controller(string $controller)
<ide> * @method static \Illuminate\Routing\RouteRegistrar domain(string $value)
<ide> * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware)
<ide> * @method static \Illuminate\Routing\RouteRegistrar name(string $value) | 1 |
Javascript | Javascript | add an exception test to http-write-head | 49e5f61ef6b0d2800db19b0ca758ec04e457bf45 | <ide><path>test/parallel/test-http-write-head.js
<ide> 'use strict';
<del>require('../common');
<add>const common = require('../common');
<ide> const assert = require('assert');
<ide> const http = require('http');
<ide>
<ide> // Verify that ServerResponse.writeHead() works as setHeader.
<ide> // Issue 5036 on github.
<ide>
<del>const s = http.createServer(function(req, res) {
<add>const s = http.createServer(common.mustCall((req, res) => {
<ide> res.setHeader('test', '1');
<ide>
<ide> // toLowerCase() is used on the name argument, so it must be a string.
<ide> const s = http.createServer(function(req, res) {
<ide> assert.ok(threw, 'Undefined value should throw');
<ide>
<ide> res.writeHead(200, { Test: '2' });
<add>
<add> assert.throws(() => {
<add> res.writeHead(100, {});
<add> }, /^Error: Can't render headers after they are sent to the client$/);
<add>
<ide> res.end();
<del>});
<add>}));
<ide>
<del>s.listen(0, runTest);
<add>s.listen(0, common.mustCall(runTest));
<ide>
<ide> function runTest() {
<del> http.get({ port: this.address().port }, function(response) {
<del> response.on('end', function() {
<add> http.get({ port: this.address().port }, common.mustCall((response) => {
<add> response.on('end', common.mustCall(() => {
<ide> assert.strictEqual(response.headers['test'], '2');
<ide> assert.notStrictEqual(response.rawHeaders.indexOf('Test'), -1);
<ide> s.close();
<del> });
<add> }));
<ide> response.resume();
<del> });
<add> }));
<ide> } | 1 |
Go | Go | clean some redundant else clauses | d91ae65280c789307ec67fff7e2d268afe3aeba7 | <ide><path>api/client/help.go
<ide> func (cli *DockerCli) CmdHelp(args ...string) error {
<ide> method, exists := cli.getMethod(args[0])
<ide> if !exists {
<ide> return fmt.Errorf("docker: '%s' is not a docker command. See 'docker --help'.", args[0])
<del> } else {
<del> method("--help")
<del> return nil
<ide> }
<add> method("--help")
<add> return nil
<ide> }
<ide>
<ide> flag.Usage()
<ide><path>daemon/networkdriver/bridge/driver.go
<ide> func InitDriver(config *Config) error {
<ide> }
<ide> }
<ide>
<del> if gateway, err := requestDefaultGateway(config.DefaultGatewayIPv4, bridgeIPv4Network); err != nil {
<add> gateway, err := requestDefaultGateway(config.DefaultGatewayIPv4, bridgeIPv4Network)
<add> if err != nil {
<ide> return err
<del> } else {
<del> gatewayIPv4 = gateway
<ide> }
<add> gatewayIPv4 = gateway
<ide>
<ide> if config.FixedCIDRv6 != "" {
<ide> _, subnet, err := net.ParseCIDR(config.FixedCIDRv6)
<ide> func InitDriver(config *Config) error {
<ide> }
<ide> globalIPv6Network = subnet
<ide>
<del> if gateway, err := requestDefaultGateway(config.DefaultGatewayIPv6, globalIPv6Network); err != nil {
<add> gateway, err := requestDefaultGateway(config.DefaultGatewayIPv6, globalIPv6Network)
<add> if err != nil {
<ide> return err
<del> } else {
<del> gatewayIPv6 = gateway
<ide> }
<add> gatewayIPv6 = gateway
<ide> }
<ide>
<ide> // Block BridgeIP in IP allocator
<ide><path>pkg/units/duration.go
<ide> func HumanDuration(d time.Duration) string {
<ide> return fmt.Sprintf("%d weeks", hours/24/7)
<ide> } else if hours < 24*365*2 {
<ide> return fmt.Sprintf("%d months", hours/24/30)
<del> } else {
<del> return fmt.Sprintf("%d years", hours/24/365)
<ide> }
<add> return fmt.Sprintf("%d years", int(d.Hours())/24/365)
<ide> } | 3 |
Text | Text | use serial comma in buffer docs | 8e0f3ff7f725aa710bd0b3698de2ffdc47105041 | <ide><path>doc/api/buffer.md
<ide> console.log(Buffer.from('fhqwhgads', 'utf16le'));
<ide> ```
<ide>
<ide> Node.js buffers accept all case variations of encoding strings that they
<del>receive. For example, UTF-8 can be specified as `'utf8'`, `'UTF8'` or `'uTf8'`.
<add>receive. For example, UTF-8 can be specified as `'utf8'`, `'UTF8'`, or `'uTf8'`.
<ide>
<ide> The character encodings currently supported by Node.js are the following:
<ide> | 1 |
Javascript | Javascript | increase abort logic coverage | 67b9ba9afebf7477ce8706b29b3c35351d8113bd | <ide><path>test/parallel/test-fs-promises-readfile.js
<ide> function validateReadFileAbortLogicDuring() {
<ide> });
<ide> }
<ide>
<add>async function validateWrongSignalParam() {
<add> // Verify that if something different than Abortcontroller.signal
<add> // is passed, ERR_INVALID_ARG_TYPE is thrown
<add>
<add> await assert.rejects(async () => {
<add> const callback = common.mustNotCall(() => {});
<add> await readFile(fn, { signal: 'hello' }, callback);
<add> }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
<add>
<add>}
<add>
<ide> (async () => {
<ide> await createLargeFile();
<ide> await validateReadFile();
<ide> await validateReadFileProc();
<ide> await validateReadFileAbortLogicBefore();
<ide> await validateReadFileAbortLogicDuring();
<add> await validateWrongSignalParam();
<ide> })().then(common.mustCall()); | 1 |
PHP | PHP | parse database url when creating connection | c91d6a515f68d7860d313627416a7158078830e3 | <ide><path>src/Illuminate/Database/DatabaseManager.php
<ide> protected function configuration($name)
<ide> throw new InvalidArgumentException("Database [{$name}] not configured.");
<ide> }
<ide>
<del> return $config;
<add> return $this->app->make(UrlParser::class)->parseDatabaseConfigWithUrl($config);
<ide> }
<ide>
<ide> /**
<ide><path>tests/Database/DatabaseConnectionFactoryTest.php
<ide> protected function setUp(): void
<ide> 'database' => ':memory:',
<ide> ]);
<ide>
<add> $this->db->addConnection([
<add> 'url' => 'sqlite:///:memory:',
<add> ], 'url');
<add>
<ide> $this->db->addConnection([
<ide> 'driver' => 'sqlite',
<ide> 'read' => [
<ide> public function testConnectionCanBeCreated()
<ide> $this->assertInstanceOf(PDO::class, $this->db->connection()->getReadPdo());
<ide> $this->assertInstanceOf(PDO::class, $this->db->connection('read_write')->getPdo());
<ide> $this->assertInstanceOf(PDO::class, $this->db->connection('read_write')->getReadPdo());
<add> $this->assertInstanceOf(PDO::class, $this->db->connection('url')->getPdo());
<add> $this->assertInstanceOf(PDO::class, $this->db->connection('url')->getReadPdo());
<ide> }
<ide>
<ide> public function testSingleConnectionNotCreatedUntilNeeded()
<ide> public function testCustomConnectorsCanBeResolvedViaContainer()
<ide> public function testSqliteForeignKeyConstraints()
<ide> {
<ide> $this->db->addConnection([
<del> 'driver' => 'sqlite',
<del> 'database' => ':memory:',
<del> 'foreign_key_constraints' => true,
<add> 'url' => 'sqlite:///:memory:?foreign_key_constraints=true',
<ide> ], 'constraints_set');
<ide>
<ide> $this->assertEquals(0, $this->db->connection()->select('PRAGMA foreign_keys')[0]->foreign_keys); | 2 |
Javascript | Javascript | increase qunit timeout | ff18d8e2060ae7c15c7694dc6bcbbeb9cbfbdaa4 | <ide><path>test/data/testrunner.js
<ide> var oldCacheLength = 0,
<ide>
<ide> // Max time for stop() and asyncTest() until it aborts test
<ide> // and start()'s the next test.
<del>QUnit.config.testTimeout = 2e4; // 20 seconds
<add>QUnit.config.testTimeout = 12e4; // 2 minutes
<ide>
<ide> // Enforce an "expect" argument or expect() call in all test bodies.
<ide> QUnit.config.requireExpects = true; | 1 |
Ruby | Ruby | remove whitespaces and add missing test | c63600576a7ca63d1a7243308ca8cc7f0e3cde75 | <ide><path>railties/test/generators/app_generator_test.rb
<ide> def test_application_name_is_detected_if_it_exists_and_app_folder_renamed
<ide> assert_file "myapp_moved/config/environment.rb", /Myapp::Application\.initialize!/
<ide> assert_file "myapp_moved/config/initializers/session_store.rb", /_myapp_session/
<ide> end
<del>
<add>
<ide> def test_rails_update_generates_correct_session_key
<ide> app_root = File.join(destination_root, 'myapp')
<ide> run_generator [app_root]
<del>
<add>
<ide> Rails.application.config.root = app_root
<ide> Rails.application.class.stubs(:name).returns("Myapp")
<ide> Rails.application.stubs(:is_a?).returns(Rails::Application)
<ide> def test_prototype_and_test_unit_are_added_by_default
<ide> assert_file "public/javascripts/rails.js"
<ide> assert_file "test"
<ide> end
<del>
<add>
<ide> def test_javascript_is_skipped_if_required
<ide> run_generator [destination_root, "--skip-javascript"]
<ide> assert_file "config/application.rb", /^\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(\)/
<ide> assert_file "public/javascripts/application.js"
<ide> assert_no_file "public/javascripts/prototype.js"
<ide> assert_no_file "public/javascripts/rails.js"
<ide> end
<del>
<add>
<ide> def test_config_prototype_javascript_library
<ide> run_generator [destination_root, "-j", "prototype"]
<ide> assert_file "config/application.rb", /#\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(jquery rails\)/
<ide> assert_file "public/javascripts/application.js"
<ide> assert_file "public/javascripts/prototype.js"
<ide> assert_file "public/javascripts/rails.js", /prototype/
<ide> end
<del>
<add>
<ide> def test_config_jquery_javascript_library
<ide> run_generator [destination_root, "-j", "jquery"]
<ide> assert_file "config/application.rb", /^\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(jquery rails\)/
<ide> def test_file_is_added_for_backwards_compatibility
<ide> assert_file 'lib/test_file.rb', 'heres test data'
<ide> end
<ide>
<add> def test_test_unit_is_removed_from_frameworks_if_skip_test_unit_is_given
<add> run_generator [destination_root, "--skip-test-unit"]
<add> assert_file "config/application.rb" do |file|
<add> assert_match /config.generators.test_framework = false/, file
<add> end
<add> end
<add>
<ide> protected
<ide>
<ide> def action(*args, &block)
<ide><path>railties/test/generators/plugin_new_generator_test.rb
<ide> test/dummy
<ide> )
<ide>
<del>
<ide> class PluginNewGeneratorTest < Rails::Generators::TestCase
<ide> include GeneratorsTestHelper
<ide> destination File.join(Rails.root, "tmp/bukkits") | 2 |
Python | Python | link element optional in feeds | 965c5d7cced0d2e09f5b0c3165c192ab4334331b | <ide><path>django/utils/feedgenerator.py
<ide> def add_root_elements(self, handler):
<ide> handler.addQuickElement(u"title", self.feed['title'])
<ide> handler.addQuickElement(u"link", self.feed['link'])
<ide> handler.addQuickElement(u"description", self.feed['description'])
<del> handler.addQuickElement(u"atom:link", None, {u"rel": u"self", u"href": self.feed['feed_url']})
<add> if self.feed['feed_url'] is not None:
<add> handler.addQuickElement(u"atom:link", None,
<add> {u"rel": u"self", u"href": self.feed['feed_url']})
<ide> if self.feed['language'] is not None:
<ide> handler.addQuickElement(u"language", self.feed['language'])
<ide> for cat in self.feed['categories']:
<ide><path>tests/regressiontests/utils/feedgenerator.py
<ide> def test_atom1_mime_type(self):
<ide> atom_feed.mime_type, "application/atom+xml; charset=utf-8"
<ide> )
<ide>
<add> # Two regression tests for #14202
<add>
<add> def test_feed_without_feed_url_gets_rendered_without_atom_link(self):
<add> feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr')
<add> self.assertEquals(feed.feed['feed_url'], None)
<add> feed_content = feed.writeString('utf-8')
<add> self.assertNotIn('<atom:link href=', feed_content)
<add>
<add> def test_feed_with_feed_url_gets_rendered_with_atom_link(self):
<add> feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr', feed_url='/feed/')
<add> self.assertEquals(feed.feed['feed_url'], '/feed/')
<add> feed_content = feed.writeString('utf-8')
<add> self.assertIn('<atom:link href="/feed/" rel="self"></atom:link>', feed_content) | 2 |
Java | Java | prune dead code from jmstransactionmanager#dobegin | 58e270f7da55256e1eedeccab4c10424cfff4d51 | <ide><path>org.springframework.jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java
<ide> * @see TransactionAwareConnectionFactoryProxy
<ide> * @see org.springframework.jms.core.JmsTemplate
<ide> */
<add>@SuppressWarnings("serial")
<ide> public class JmsTransactionManager extends AbstractPlatformTransactionManager
<ide> implements ResourceTransactionManager, InitializingBean {
<ide>
<ide> protected void doBegin(Object transaction, TransactionDefinition definition) {
<ide> getConnectionFactory(), txObject.getResourceHolder());
<ide> }
<ide> catch (JMSException ex) {
<del> if (session != null) {
<del> try {
<del> session.close();
<del> }
<del> catch (Throwable ex2) {
<del> // ignore
<del> }
<del> }
<ide> if (con != null) {
<ide> try {
<ide> con.close(); | 1 |
Text | Text | remove password anecdotes from guides [ci skip] | 013fd84373ca5dd49d42170a82648ada5a2025bb | <ide><path>guides/source/security.md
<ide> config.filter_parameters << :password
<ide>
<ide> NOTE: Provided parameters will be filtered out by partial matching regular expression. Rails adds default `:password` in the appropriate initializer (`initializers/filter_parameter_logging.rb`) and cares about typical application parameters `password` and `password_confirmation`.
<ide>
<del>### Good Passwords
<del>
<del>INFO: _Do you find it hard to remember all your passwords? Don't write them down, but use the initial letters of each word in an easy to remember sentence._
<del>
<del>Bruce Schneier, a security technologist, [has analyzed](http://www.schneier.com/blog/archives/2006/12/realworld_passw.html) 34,000 real-world user names and passwords from the MySpace phishing attack mentioned [below](#examples-from-the-underground). It turns out that most of the passwords are quite easy to crack. The 20 most common passwords are:
<del>
<del>password1, abc123, myspace1, password, blink182, qwerty1, ****you, 123abc, baseball1, football1, 123456, soccer, monkey1, liverpool1, princess1, jordan23, slipknot1, superman1, iloveyou1, and monkey.
<del>
<del>It is interesting that only 4% of these passwords were dictionary words and the great majority is actually alphanumeric. However, password cracker dictionaries contain a large number of today's passwords, and they try out all kinds of (alphanumerical) combinations. If an attacker knows your user name and you use a weak password, your account will be easily cracked.
<del>
<del>A good password is a long alphanumeric combination of mixed cases. As this is quite hard to remember, it is advisable to enter only the _first letters of a sentence that you can easily remember_. For example "The quick brown fox jumps over the lazy dog" will be "Tqbfjotld". Note that this is just an example, you should not use well known phrases like these, as they might appear in cracker dictionaries, too.
<del>
<ide> ### Regular Expressions
<ide>
<ide> INFO: _A common pitfall in Ruby's regular expressions is to match the string's beginning and end by ^ and $, instead of \A and \z._ | 1 |
Text | Text | remove extraargument from code example | 81c8002c9fdeed5fb1f2bfc0e4d4a6ce592d8e36 | <ide><path>docs/tutorials/essentials/part-2-app-structure.md
<ide> const thunkMiddleware =
<ide> next =>
<ide> action => {
<ide> if (typeof action === 'function') {
<del> return action(dispatch, getState, extraArgument)
<add> return action(dispatch, getState)
<ide> }
<ide>
<ide> return next(action) | 1 |
Python | Python | use buffersize=20 in openblas | af0bfeb433e79586b1aa1be4d2bc2216da93a498 | <ide><path>tools/openblas_support.py
<ide>
<ide> OPENBLAS_V = '0.3.12'
<ide> # Temporary build of OpenBLAS to test a fix for dynamic detection of CPU
<del>OPENBLAS_LONG = 'v0.3.12'
<add>OPENBLAS_LONG = 'v0.3.12-buffersize20'
<ide> BASE_LOC = 'https://anaconda.org/multibuild-wheels-staging/openblas-libs'
<ide> BASEURL = f'{BASE_LOC}/{OPENBLAS_LONG}/download'
<ide> ARCHITECTURES = ['', 'windows', 'darwin', 'aarch64', 'x86_64', | 1 |
Javascript | Javascript | add support for vertex colors | 5256f4c5eebbbb261dad0c963766d57ecd59c4f1 | <ide><path>src/renderers/shaders/ShaderLib/meshmatcap_frag.glsl.js
<ide> varying vec3 vViewPosition;
<ide> #endif
<ide>
<ide> #include <common>
<add>#include <color_pars_fragment>
<ide> #include <uv_pars_fragment>
<ide> #include <map_pars_fragment>
<ide> #include <alphamap_pars_fragment>
<ide> void main() {
<ide>
<ide> #include <logdepthbuf_fragment>
<ide> #include <map_fragment>
<add> #include <color_fragment>
<ide> #include <alphamap_fragment>
<ide> #include <alphatest_fragment>
<ide> #include <normal_fragment_begin>
<ide><path>src/renderers/shaders/ShaderLib/meshmatcap_vert.glsl.js
<ide> varying vec3 vViewPosition;
<ide>
<ide> #include <common>
<ide> #include <uv_pars_vertex>
<add>#include <color_pars_vertex>
<ide> #include <displacementmap_pars_vertex>
<ide> #include <fog_pars_vertex>
<ide> #include <morphtarget_pars_vertex>
<ide> varying vec3 vViewPosition;
<ide> void main() {
<ide>
<ide> #include <uv_vertex>
<del>
<add> #include <color_vertex>
<ide> #include <beginnormal_vertex>
<ide> #include <morphnormal_vertex>
<ide> #include <skinbase_vertex> | 2 |
Ruby | Ruby | update the version.rb files to include a pre part | ccd2f3ede585fb2f2d830e661dbb8b8538de2dc5 | <ide><path>actionmailer/lib/action_mailer/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>actionpack/lib/action_pack/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>activemodel/lib/active_model/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>activerecord/lib/active_record/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>activeresource/lib/active_resource/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>activesupport/lib/active_support/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>railties/lib/rails/version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end
<ide><path>version.rb
<ide> module VERSION #:nodoc:
<ide> MAJOR = 3
<ide> MINOR = 1
<ide> TINY = 0
<del> BUILD = "beta"
<add> PRE = "beta"
<ide>
<del> STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
<add> STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
<ide> end
<ide> end | 8 |
Text | Text | fix closing parenthesis | 7f6243efd576f8a7f59c5508dda7738c415bac77 | <ide><path>doc/api/fs.md
<ide> unlink('/tmp/hello', (err) => {
<ide>
<ide> The callback-based versions of the `fs` module APIs are preferable over
<ide> the use of the promise APIs when maximal performance (both in terms of
<del>execution time and memory allocation are required).
<add>execution time and memory allocation) is required.
<ide>
<ide> ## Synchronous example
<ide> | 1 |
PHP | PHP | follow loadmorph syntax | 5f1dc4e48a621418b76850b24895f3ad254dd771 | <ide><path>src/Illuminate/Database/Eloquent/Relations/MorphTo.php
<ide> public function getDictionary()
<ide> *
<ide> * @return \Illuminate\Database\Eloquent\Relations\MorphTo
<ide> */
<del> public function withMorph(string $modelClass, array $with)
<add> public function withMorph(array $with)
<ide> {
<del> $this->typedEagerLoads[$modelClass] = array_merge(
<del> $this->typedEagerLoads[$modelClass] ?? [],
<add> $this->typedEagerLoads = array_merge(
<add> $this->typedEagerLoads,
<ide> $with
<ide> );
<ide>
<ide><path>tests/Integration/Database/EloquentMorphEagerLoadingTest.php
<ide> public function test_with_morph_loading()
<ide> {
<ide> $comments = Comment::query()
<ide> ->with(['commentable' => function (MorphTo $morphTo) {
<del> $morphTo->withMorph(Post::class, ['user']);
<add> $morphTo->withMorph([Post::class =>['user']]);
<ide> }])
<ide> ->get();
<ide> | 2 |
Python | Python | improve exception testing in test_training | 18c11a30d6d73405af61206ef3443d9b091e3af8 | <ide><path>tests/keras/engine/test_training.py
<ide> def test_training_and_eval_methods_on_symbolic_tensors_multi_io():
<ide> epochs=1,
<ide> steps_per_epoch=2,
<ide> verbose=0)
<del> with pytest.raises(ValueError) as excinfo:
<add> with pytest.raises(ValueError,
<add> match='should specify the `steps_per_epoch`'):
<ide> model.fit(
<ide> [input_a_tf, input_b_tf], [output_d_tf, output_e_tf],
<ide> epochs=1,
<ide> batch_size=5,
<ide> verbose=0)
<del> assert 'should specify the `steps_per_epoch`' in str(excinfo.value)
<add>
<ide> model.train_on_batch([input_a_tf, input_b_tf], [output_d_tf, output_e_tf])
<ide>
<ide> # Test with dictionary inputs
<ide> def test_training_and_eval_methods_on_symbolic_tensors_multi_io():
<ide> validation_steps=2,
<ide> verbose=0)
<ide> # Test with validation split
<del> with pytest.raises(ValueError) as excinfo:
<add> with pytest.raises(ValueError,
<add> match='you cannot use `validation_split`'):
<ide> model.fit(
<ide> [input_a_tf, input_b_tf], [output_d_tf, output_e_tf],
<ide> epochs=2,
<ide> steps_per_epoch=2,
<ide> verbose=0,
<ide> validation_split=0.2,
<ide> validation_steps=2)
<del> assert 'you cannot use `validation_split`' in str(excinfo.value)
<ide>
<ide> # Test evaluation / prediction methods
<ide> model.evaluate([input_a_tf, input_b_tf], [output_d_tf, output_e_tf], | 1 |
Javascript | Javascript | fix double slash in model release web page | 2e71944e1e0e25301922a0078a76e05aaa4bae07 | <ide><path>website/src/templates/models.js
<ide> const Model = ({
<ide> }
<ide> }, [initialized, version, baseUrl, name])
<ide>
<del> const releaseTag = meta.fullName ? `/tag/${meta.fullName}` : ''
<add> const releaseTag = meta.fullName ? `tag/${meta.fullName}` : ''
<ide> const releaseUrl = `https://github.com/${repo}/releases/${releaseTag}`
<ide> const pipeline = linkComponents(meta.pipeline)
<ide> const components = linkComponents(meta.components) | 1 |
Javascript | Javascript | use module.require for nodejs | a8ed716c55cdf7ca77a0e960249e9e0291fa8299 | <ide><path>src/lib/locale/locales.js
<ide> function loadLocale(name) {
<ide> var oldLocale = null;
<ide> // TODO: Find a better way to register and load all the locales in Node
<ide> if (!locales[name] && (typeof module !== 'undefined') &&
<del> module && module.exports) {
<add> module && module.require) {
<ide> try {
<ide> oldLocale = globalLocale._abbr;
<del> require('./locale/' + name);
<add> module.require('./locale/' + name);
<ide> // because defineLocale currently also sets the global locale, we
<ide> // want to undo that for lazy loaded locales
<ide> getSetGlobalLocale(oldLocale); | 1 |
Java | Java | remove javadoc link to private method | 3215880d08f70f621aff1d27a0a5881134221068 | <ide><path>spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronizationUtils.java
<ide> public static boolean sameResourceFactory(ResourceTransactionManager tm, Object
<ide> * the given handle as-is.
<ide> * @since 5.3.4
<ide> * @see InfrastructureProxy#getWrappedObject()
<del> * @see ScopedProxyUnwrapper#unwrapIfNecessary(Object)
<ide> */
<ide> public static Object unwrapResourceIfNecessary(Object resource) {
<ide> Assert.notNull(resource, "Resource must not be null"); | 1 |
Python | Python | relax the signature of the `__array__` protocol | 335b6cb399ecaa869cf78c49984eb1dcc412b8bc | <ide><path>numpy/typing/_array_like.py
<ide>
<ide> if TYPE_CHECKING or HAVE_PROTOCOL:
<ide> # The `_SupportsArray` protocol only cares about the default dtype
<del> # (i.e. `dtype=None`) of the to-be returned array.
<add> # (i.e. `dtype=None` or no `dtype` parameter at all) of the to-be returned
<add> # array.
<ide> # Concrete implementations of the protocol are responsible for adding
<ide> # any and all remaining overloads
<ide> class _SupportsArray(Protocol[_DType_co]):
<del> def __array__(self, dtype: None = ...) -> ndarray[Any, _DType_co]: ...
<add> def __array__(self) -> ndarray[Any, _DType_co]: ...
<ide> else:
<ide> _SupportsArray = Any
<ide> | 1 |
Text | Text | standardize versions in stream module doc | afb4914bf2b656722fada1cef259155440a22180 | <ide><path>doc/api/stream.md
<ide> added: v0.9.4
<ide> * `stream` {Stream} An "old style" readable stream
<ide> * Returns: {this}
<ide>
<del>Versions of Node.js prior to v0.10 had streams that did not implement the
<del>entire `stream` module API as it is currently defined. (See [Compatibility][]
<del>for more information.)
<add>Prior to Node.js 0.10, streams did not implement the entire `stream` module API
<add>as it is currently defined. (See [Compatibility][] for more information.)
<ide>
<ide> When using an older Node.js library that emits [`'data'`][] events and has a
<ide> [`stream.pause()`][stream-pause] method that is advisory only, the
<ide> primarily for examples and testing, but there are some use cases where
<ide>
<ide> <!--type=misc-->
<ide>
<del>In versions of Node.js prior to v0.10, the `Readable` stream interface was
<del>simpler, but also less powerful and less useful.
<add>Prior to Node.js 0.10, the `Readable` stream interface was simpler, but also
<add>less powerful and less useful.
<ide>
<ide> * Rather than waiting for calls the [`stream.read()`][stream-read] method,
<ide> [`'data'`][] events would begin emitting immediately. Applications that
<ide> simpler, but also less powerful and less useful.
<ide> guaranteed. This meant that it was still necessary to be prepared to receive
<ide> [`'data'`][] events *even when the stream was in a paused state*.
<ide>
<del>In Node.js v0.10, the [`Readable`][] class was added. For backwards
<add>In Node.js 0.10, the [`Readable`][] class was added. For backwards
<ide> compatibility with older Node.js programs, `Readable` streams switch into
<ide> "flowing mode" when a [`'data'`][] event handler is added, or when the
<ide> [`stream.resume()`][stream-resume] method is called. The effect is that, even
<ide> net.createServer((socket) => {
<ide> }).listen(1337);
<ide> ```
<ide>
<del>In versions of Node.js prior to v0.10, the incoming message data would be
<del>simply discarded. However, in Node.js v0.10 and beyond, the socket remains
<del>paused forever.
<add>Prior to Node.js 0.10, the incoming message data would be simply discarded.
<add>However, in Node.js 0.10 and beyond, the socket remains paused forever.
<ide>
<ide> The workaround in this situation is to call the
<ide> [`stream.resume()`][stream-resume] method to begin the flow of data:
<ide> net.createServer((socket) => {
<ide> ```
<ide>
<ide> In addition to new `Readable` streams switching into flowing mode,
<del>pre-v0.10 style streams can be wrapped in a `Readable` class using the
<add>pre-0.10 style streams can be wrapped in a `Readable` class using the
<ide> [`readable.wrap()`][`stream.wrap()`] method.
<ide>
<ide> ### `readable.read(0)` | 1 |
Javascript | Javascript | fix classed operator for svg elements. fixes #78 | 1578595a18f6c7b3a46d98e5f68de18aebc4dd19 | <ide><path>d3.js
<ide> function d3_selection(groups) {
<ide>
<ide> /** @this {Element} */
<ide> function classedRemove() {
<del> var classes = d3_collapse(this.className.replace(re, " "));
<add> var classes = d3_collapse(this.className.toString().replace(re, " "));
<ide> this.className = classes.length ? classes : null;
<ide> }
<ide>
<ide><path>d3.min.js
<del>(function(){function bS(){return"circle"}function bR(){return 64}function bP(a){return[a.x,a.y]}function bO(a){return a.endAngle}function bN(a){return a.startAngle}function bM(a){return a.radius}function bL(a){return a.target}function bK(a){return a.source}function bJ(){return 0}function bI(a,b,c){a.push("C",bE(bF,b),",",bE(bF,c),",",bE(bG,b),",",bE(bG,c),",",bE(bH,b),",",bE(bH,c))}function bE(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bD(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=[bE(bH,g),",",bE(bH,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bI(b,g,h);return b.join("")}function bC(a){if(a.length<3)return bv(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bI(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);return b.join("")}function bB(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 bA(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bv(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 bz(a,b,c){return a.length<3?bv(a):a[0]+bA(a,bB(a,b))}function by(a,b){return a.length<3?bv(a):a[0]+bA((a.push(a[0]),a),bB([a[a.length-2]].concat(a,[a[1]]),b))}function bx(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bw(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bv(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bt(a){return a[1]}function bs(a){return a[0]}function br(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 bq(a){return a.endAngle}function bp(a){return a.startAngle}function bo(a){return a.outerRadius}function bn(a){return a.innerRadius}function bg(a){return function(b){return-Math.pow(-b,a)}}function bf(a){return function(b){return Math.pow(b,a)}}function be(a){return-Math.log(-a)/Math.LN10}function bd(a){return Math.log(a)/Math.LN10}function bb(){var a=null,b=Y,c=Infinity;while(b)b.flush?b=a?a.next=b.next:Y=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function ba(){var a,b=Date.now(),c=null,d=Y;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;var e=bb()-b;e>24?(isFinite(e)&&(clearTimeout($),$=setTimeout(ba,e)),Z=0):(Z=1,bc(ba))}function _(a,b){var c=Date.now(),d=!1,e,f=Y;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(Y={callback:a,then:c,delay:b,next:Y}),Z||($=clearTimeout($),Z=1,bc(ba))}}function X(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function W(a){function n(b){var g=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){g=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,h.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),V=c,h.end.dispatch.apply(this,arguments),V=0,n.owner=r}}}});return g}var b={},c=V||++U,d={},e=[],f=!1,h=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),_(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,X(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,X(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=W(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=W(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){h[a].add(c);return b},b.call=g;return b.delay(0).duration(250)}function T(a){return{__data__:a}}function S(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function R(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return Q(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function Q(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return Q(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return Q(c)}a.select=function(a){return b(function(b){return N(a,b)})},a.selectAll=function(a){return c(function(b){return O(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return Q(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=T(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=Q(e);k.enter=function(){return R(d)},k.exit=function(){return Q(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?g:h).call(this)}function h(){var a=f(this.className.replace(e," "));this.className=a.length?a:null}function g(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=f(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?g:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=S.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e==-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function e(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=e,d)})},a.transition=function(){return W(a)},a.call=g;return a}function M(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return C(g(a+120),g(a),g(a-120))}function L(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function K(a,b,c){return{h:a,s:b,l:c,toString:L}}function H(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function G(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return K(g,h,i)}function F(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(H(h[0]),H(h[1]),H(h[2]))}}if(i=I[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function E(a){return a<16?"0"+a.toString(16):a.toString(16)}function D(){return"#"+E(this.r)+E(this.g)+E(this.b)}function C(a,b,c){return{r:a,g:b,b:c,toString:D}}function B(a){return a in A||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function y(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 x(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function w(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function v(a){return 1-Math.sqrt(1-a*a)}function u(a){return a?Math.pow(2,10*(a-1))-.001:0}function t(a){return 1-Math.cos(a*Math.PI/2)}function s(a){return function(b){return Math.pow(b,a)}}function r(a){return a}function q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function p(a){return function(b){return 1-a(1-b)}}function k(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 i(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function g(a){a.apply(this,(arguments[0]=this,arguments));return this}function f(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function e(a){return a==null}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.14.2"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],f,g=-1,h=a.length;arguments.length<2&&(b=e);while(++g<h)b.call(d,f=a[g],g)?d=[]:(d.length||c.push(d),d.push(f));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);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(h,"\\$&")};var h=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=i(c);return b},d3.format=function(a){var b=j.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"โ":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var l=a.length+j.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=k(a)),a=j+a}else{g&&(a=k(a)),a=j+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}return a}};var j=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l=s(2),m=s(3),n={linear:function(){return r},poly:s,quad:function(){return l},cubic:function(){return m},sin:function(){return t},exp:function(){return u},circle:function(){return v},elastic:w,back:x,bounce:function(){return y}},o={"in":function(a){return a},out:p,"in-out":q,"out-in":function(a){return q(p(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 o[d](n[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in I||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;z.lastIndex=0;for(d=0;c=z.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=z.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=z.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--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return M(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]=B(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 z=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,A={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?F(""+a,C,M):C(~~a,~~b,~~c)};var I={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var J in I)I[J]=F(I[J],C,M);d3.hsl=function(a,b,c){return arguments.length==1?F(""+a,G,K):K(+a,+b,+c)};var N=function(a,b){return b.querySelector(a)},O=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(N=function(a,b){return Sizzle(a,b)[0]},O=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var P=Q([[document]]);P[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?P.select(a):Q([[a]])},d3.selectAll=function(b){return typeof b=="string"?P.selectAll(b):Q([a(b)])},d3.transition=P.transition;var U=0,V=0,Y=null,Z,$;d3.timer=function(a){_(a,0)};var bc=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function k(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function j(b){b=(b-a)*e;return h(i?Math.max(0,Math.min(1,b)):b)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d),i=!1;j.invert=function(b){return(b-c)*f+a},j.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return j},j.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return j},j.rangeRound=function(a){return j.range(a).interpolate(d3.interpolateRound)},j.clamp=function(a){if(!arguments.length)return i;i=a;return j},j.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return j},j.ticks=function(a){var b=k(a);return d3.range(b.start,b.stop,b.step)},j.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(k(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return j},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bd,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?be:bd,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.ticks=function(){var d=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===be){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bd.pow=function(a){return Math.pow(10,a)},be.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bg:bf;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bh)},d3.scale.category20=function(){return d3.scale.ordinal().range(bi)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bj)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bk)};var bh=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bi=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bj=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bk=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bl,h=d.apply(this,arguments)+bl,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>=bm?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bn,b=bo,c=bp,d=bq;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bl;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bl=-Math.PI/2,bm=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(br(this,c,a,b),e)}var a=bs,b=bt,c="linear",d=bu[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bu[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bu={linear:bv,"step-before":bw,"step-after":bx,basis:bC,"basis-closed"
<add>(function(){function bS(){return"circle"}function bR(){return 64}function bP(a){return[a.x,a.y]}function bO(a){return a.endAngle}function bN(a){return a.startAngle}function bM(a){return a.radius}function bL(a){return a.target}function bK(a){return a.source}function bJ(){return 0}function bI(a,b,c){a.push("C",bE(bF,b),",",bE(bF,c),",",bE(bG,b),",",bE(bG,c),",",bE(bH,b),",",bE(bH,c))}function bE(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bD(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=[bE(bH,g),",",bE(bH,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bI(b,g,h);return b.join("")}function bC(a){if(a.length<3)return bv(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bI(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);return b.join("")}function bB(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 bA(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bv(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 bz(a,b,c){return a.length<3?bv(a):a[0]+bA(a,bB(a,b))}function by(a,b){return a.length<3?bv(a):a[0]+bA((a.push(a[0]),a),bB([a[a.length-2]].concat(a,[a[1]]),b))}function bx(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bw(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bv(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bt(a){return a[1]}function bs(a){return a[0]}function br(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 bq(a){return a.endAngle}function bp(a){return a.startAngle}function bo(a){return a.outerRadius}function bn(a){return a.innerRadius}function bg(a){return function(b){return-Math.pow(-b,a)}}function bf(a){return function(b){return Math.pow(b,a)}}function be(a){return-Math.log(-a)/Math.LN10}function bd(a){return Math.log(a)/Math.LN10}function bb(){var a=null,b=Y,c=Infinity;while(b)b.flush?b=a?a.next=b.next:Y=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function ba(){var a,b=Date.now(),c=null,d=Y;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;var e=bb()-b;e>24?(isFinite(e)&&(clearTimeout($),$=setTimeout(ba,e)),Z=0):(Z=1,bc(ba))}function _(a,b){var c=Date.now(),d=!1,e,f=Y;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(Y={callback:a,then:c,delay:b,next:Y}),Z||($=clearTimeout($),Z=1,bc(ba))}}function X(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function W(a){function n(b){var g=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){g=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,h.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),V=c,h.end.dispatch.apply(this,arguments),V=0,n.owner=r}}}});return g}var b={},c=V||++U,d={},e=[],f=!1,h=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),_(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,X(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,X(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=W(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=W(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){h[a].add(c);return b},b.call=g;return b.delay(0).duration(250)}function T(a){return{__data__:a}}function S(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function R(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return Q(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function Q(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return Q(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return Q(c)}a.select=function(a){return b(function(b){return N(a,b)})},a.selectAll=function(a){return c(function(b){return O(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return Q(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=T(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=Q(e);k.enter=function(){return R(d)},k.exit=function(){return Q(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?g:h).call(this)}function h(){var a=f(this.className.toString().replace(e," "));this.className=a.length?a:null}function g(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=f(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?g:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=S.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e==-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function e(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=e,d)})},a.transition=function(){return W(a)},a.call=g;return a}function M(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return C(g(a+120),g(a),g(a-120))}function L(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function K(a,b,c){return{h:a,s:b,l:c,toString:L}}function H(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function G(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return K(g,h,i)}function F(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(H(h[0]),H(h[1]),H(h[2]))}}if(i=I[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function E(a){return a<16?"0"+a.toString(16):a.toString(16)}function D(){return"#"+E(this.r)+E(this.g)+E(this.b)}function C(a,b,c){return{r:a,g:b,b:c,toString:D}}function B(a){return a in A||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function y(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 x(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function w(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function v(a){return 1-Math.sqrt(1-a*a)}function u(a){return a?Math.pow(2,10*(a-1))-.001:0}function t(a){return 1-Math.cos(a*Math.PI/2)}function s(a){return function(b){return Math.pow(b,a)}}function r(a){return a}function q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function p(a){return function(b){return 1-a(1-b)}}function k(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 i(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function g(a){a.apply(this,(arguments[0]=this,arguments));return this}function f(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function e(a){return a==null}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.14.2"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],f,g=-1,h=a.length;arguments.length<2&&(b=e);while(++g<h)b.call(d,f=a[g],g)?d=[]:(d.length||c.push(d),d.push(f));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);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(h,"\\$&")};var h=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=i(c);return b},d3.format=function(a){var b=j.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"โ":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var l=a.length+j.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=k(a)),a=j+a}else{g&&(a=k(a)),a=j+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}return a}};var j=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l=s(2),m=s(3),n={linear:function(){return r},poly:s,quad:function(){return l},cubic:function(){return m},sin:function(){return t},exp:function(){return u},circle:function(){return v},elastic:w,back:x,bounce:function(){return y}},o={"in":function(a){return a},out:p,"in-out":q,"out-in":function(a){return q(p(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 o[d](n[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in I||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;z.lastIndex=0;for(d=0;c=z.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=z.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=z.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--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return M(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]=B(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 z=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,A={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?F(""+a,C,M):C(~~a,~~b,~~c)};var I={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var J in I)I[J]=F(I[J],C,M);d3.hsl=function(a,b,c){return arguments.length==1?F(""+a,G,K):K(+a,+b,+c)};var N=function(a,b){return b.querySelector(a)},O=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(N=function(a,b){return Sizzle(a,b)[0]},O=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var P=Q([[document]]);P[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?P.select(a):Q([[a]])},d3.selectAll=function(b){return typeof b=="string"?P.selectAll(b):Q([a(b)])},d3.transition=P.transition;var U=0,V=0,Y=null,Z,$;d3.timer=function(a){_(a,0)};var bc=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function k(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function j(b){b=(b-a)*e;return h(i?Math.max(0,Math.min(1,b)):b)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d),i=!1;j.invert=function(b){return(b-c)*f+a},j.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return j},j.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return j},j.rangeRound=function(a){return j.range(a).interpolate(d3.interpolateRound)},j.clamp=function(a){if(!arguments.length)return i;i=a;return j},j.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return j},j.ticks=function(a){var b=k(a);return d3.range(b.start,b.stop,b.step)},j.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(k(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return j},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bd,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?be:bd,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.ticks=function(){var d=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===be){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bd.pow=function(a){return Math.pow(10,a)},be.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bg:bf;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bh)},d3.scale.category20=function(){return d3.scale.ordinal().range(bi)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bj)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bk)};var bh=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bi=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bj=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bk=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bl,h=d.apply(this,arguments)+bl,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>=bm?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bn,b=bo,c=bp,d=bq;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bl;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bl=-Math.PI/2,bm=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(br(this,c,a,b),e)}var a=bs,b=bt,c="linear",d=bu[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bu[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bu={linear:bv,"step-before":bw,"step-after":bx,basis:bC,"basis-closed"
<ide> :bD,cardinal:bz,"cardinal-closed":by},bF=[0,2/3,1/3,0],bG=[0,1/3,2/3,0],bH=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(br(this,d,a,c),f)+"L"+e(br(this,d,a,b).reverse(),f)+"Z"}var a=bs,b=bJ,c=bt,d="linear",e=bu[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bu[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bl,k=e.call(a,h,g)+bl;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=bK,b=bL,c=bM,d=bp,e=bq;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=bK,b=bL,c=bP;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(bQ<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),d=c[0][0].getScreenCTM();bQ=!d.f&&!d.e,c.remove()}bQ?(b.x=d3.event.pageX,b.y=d3.event.pageY):(b.x=d3.event.clientX,b.y=d3.event.clientY),b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var bQ=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function c(c,d){return(bT[a.call(this,c,d)]||bT.circle)(b.call(this,c,d))}var a=bS,b=bR;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c},d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var bT={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*bV)),c=b*bV;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/bU),c=b*bU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/bU),c=b*bU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}},bU=Math.sqrt(3),bV=Math.tan(30*Math.PI/180)})()
<ide>\ No newline at end of file
<ide><path>src/core/selection.js
<ide> function d3_selection(groups) {
<ide>
<ide> /** @this {Element} */
<ide> function classedRemove() {
<del> var classes = d3_collapse(this.className.replace(re, " "));
<add> var classes = d3_collapse(this.className.toString().replace(re, " "));
<ide> this.className = classes.length ? classes : null;
<ide> }
<ide> | 3 |
Javascript | Javascript | remove ws and replace comma with semicolon | 7f444a205e87bff66c924040a102e5442bbc61c6 | <ide><path>src/ng/interval.js
<ide> function $IntervalProvider() {
<ide> * In tests you can use {@link ngMock.$interval#methods_flush `$interval.flush(millis)`} to
<ide> * move forward by `millis` milliseconds and trigger any functions scheduled to run in that
<ide> * time.
<del> *
<add> *
<ide> * <div class="alert alert-warning">
<ide> * **Note**: Intervals created by this service must be explicitly destroyed when you are finished
<ide> * with them. In particular they are not automatically destroyed when a controller's scope or a
<ide> function $IntervalProvider() {
<ide> promise = deferred.promise,
<ide> iteration = 0,
<ide> skipApply = (isDefined(invokeApply) && !invokeApply);
<del>
<del> count = isDefined(count) ? count : 0,
<add>
<add> count = isDefined(count) ? count : 0;
<ide>
<ide> promise.then(null, null, fn);
<ide> | 1 |
Javascript | Javascript | wrap all assignments in if statements | 9d808239b3120b0120f164834ce3012f779c8939 | <ide><path>src/Compiler.js
<ide> Compiler.prototype = {
<ide> template = new Template();
<ide> eachAttribute(element, function(value, name){
<ide> if (!widget) {
<del> if (widget = self.widgets('@' + name)) {
<add> if ((widget = self.widgets('@' + name))) {
<ide> element.addClass('ng-attr-widget');
<ide> widget = bind(selfApi, widget, value, element);
<ide> }
<ide> }
<ide> });
<ide> if (!widget) {
<del> if (widget = self.widgets(elementName)) {
<add> if ((widget = self.widgets(elementName))) {
<ide> if (elementNamespace)
<ide> element.addClass('ng-widget');
<ide> widget = bind(selfApi, widget, element);
<ide><path>src/Scope.js
<ide> Scope.prototype = {
<ide> scope.$service('$exceptionHandler')(e);
<ide> }
<ide> }
<del> if (watchers = scope.$$watchers) {
<add> if ((watchers = scope.$$watchers)) {
<ide> // process our watches
<ide> length = watchers.length;
<ide> while (length--) {
<ide> Scope.prototype = {
<ide> }
<ide> } while (scope !== this);
<ide> }
<del> } while (scope = next);
<add> } while ((scope = next));
<ide>
<ide> if(!(ttl--)) {
<ide> throw Error('100 $digest() iterations reached. Aborting!');
<ide><path>src/directives.js
<ide> angularDirective("ng:bind", function(expression, element){
<ide> // If we are HTML than save the raw HTML data so that we don't
<ide> // recompute sanitization since it is expensive.
<ide> // TODO: turn this into a more generic way to compute this
<del> if (isHtml = (value instanceof HTML))
<add> if ((isHtml = (value instanceof HTML)))
<ide> value = (html = value).html;
<ide> if (lastValue === value && lastError == error) return;
<ide> isDomElement = isElement(value);
<ide><path>src/filters.js
<ide> angularFilter.linky = function(text) {
<ide> var writer = htmlSanitizeWriter(html);
<ide> var url;
<ide> var i;
<del> while (match = raw.match(LINKY_URL_REGEXP)) {
<add> while ((match = raw.match(LINKY_URL_REGEXP))) {
<ide> // We can not end in these as they are sometimes found at the end of the sentence
<ide> url = match[0];
<ide> // if we did not match ftp/http/mailto then assume mailto
<ide><path>src/parser.js
<ide> function parser(text, json){
<ide> var left = logicalOR();
<ide> var right;
<ide> var token;
<del> if (token = expect('=')) {
<add> if ((token = expect('='))) {
<ide> if (!left.assign) {
<ide> throwError("implies assignment but [" +
<ide> text.substring(0, token.index) + "] can not be assigned to", token);
<ide> function parser(text, json){
<ide> function relational(){
<ide> var left = additive();
<ide> var token;
<del> if (token = expect('<', '>', '<=', '>=')) {
<add> if ((token = expect('<', '>', '<=', '>='))) {
<ide> left = binaryFn(left, token.fn, relational());
<ide> }
<ide> return left;
<ide> function parser(text, json){
<ide> function additive(){
<ide> var left = multiplicative();
<ide> var token;
<del> while(token = expect('+','-')) {
<add> while ((token = expect('+','-'))) {
<ide> left = binaryFn(left, token.fn, multiplicative());
<ide> }
<ide> return left;
<ide> function parser(text, json){
<ide> function multiplicative(){
<ide> var left = unary();
<ide> var token;
<del> while(token = expect('*','/','%')) {
<add> while ((token = expect('*','/','%'))) {
<ide> left = binaryFn(left, token.fn, unary());
<ide> }
<ide> return left;
<ide> function parser(text, json){
<ide> var token;
<ide> if (expect('+')) {
<ide> return primary();
<del> } else if (token = expect('-')) {
<add> } else if ((token = expect('-'))) {
<ide> return binaryFn(ZERO, token.fn, unary());
<del> } else if (token = expect('!')) {
<add> } else if ((token = expect('!'))) {
<ide> return unaryFn(token.fn, unary());
<ide> } else {
<ide> return primary();
<ide> function parser(text, json){
<ide> }
<ide> }
<ide> var next;
<del> while (next = expect('(', '[', '.')) {
<add> while ((next = expect('(', '[', '.'))) {
<ide> if (next.text === '(') {
<ide> primary = functionCall(primary);
<ide> } else if (next.text === '[') {
<ide><path>src/service/route.js
<ide> angularServiceInject('$route', function($location) {
<ide> // Match a route
<ide> forEach(routes, function(rParams, rPath) {
<ide> if (!pathParams) {
<del> if (pathParams = matcher($location.hashPath, rPath)) {
<add> if ((pathParams = matcher($location.hashPath, rPath))) {
<ide> selectedRoute = rParams;
<ide> }
<ide> }
<ide><path>src/service/xhr.cache.js
<ide> angularServiceInject('$xhr.cache', function($xhr, $defer, $error, $log) {
<ide>
<ide> if (method == 'GET') {
<ide> var data, dataCached;
<del> if (dataCached = cache.data[url]) {
<add> if ((dataCached = cache.data[url])) {
<ide>
<ide> if (sync) {
<ide> success(200, copy(dataCached.value));
<ide> angularServiceInject('$xhr.cache', function($xhr, $defer, $error, $log) {
<ide> return;
<ide> }
<ide>
<del> if (data = inflight[url]) {
<add> if ((data = inflight[url])) {
<ide> data.successes.push(success);
<ide> data.errors.push(error);
<ide> } else {
<ide><path>src/widgets.js
<ide> angularWidget('select', function(element){
<ide> lastElement = null; // start at the begining
<ide> for(index = 0, length = optionGroup.length; index < length; index++) {
<ide> option = optionGroup[index];
<del> if (existingOption = existingOptions[index+1]) {
<add> if ((existingOption = existingOptions[index+1])) {
<ide> // reuse elements
<ide> lastElement = existingOption.element;
<ide> if (existingOption.label !== option.label) {
<ide> angularWidget('ng:switch', function (element) {
<ide>
<ide> this.$watch(watchExpr, function(scope, value) {
<ide> element.html('');
<del> if (selectedTemplate = casesTemplate[value] || defaultCaseTemplate) {
<add> if ((selectedTemplate = casesTemplate[value] || defaultCaseTemplate)) {
<ide> changeCounter++;
<ide> if (childScope) childScope.$destroy();
<ide> childScope = scope.$new(); | 8 |
Text | Text | fix markdown formatting | 1fad3f6546bef86f5d46cbf095603423263140a5 | <ide><path>docs/focus/2018-03-19.md
<ide> ## Highlights from the past week
<ide>
<ide> - Atom IDE
<del> - Shipping Console Logging
<del> - Fixed bugs including multi-symbol autocomplete trigger, java detection etc.
<del> - Started learning Rust
<add> - Shipping Console Logging
<add> - Fixed bugs including multi-symbol autocomplete trigger, java detection etc.
<add> - Started learning Rust
<ide> - GitHub Package
<ide> - Commit together with co-authors - [atom/github#1355](https://github.com/atom/github/pull/1355)
<ide> - Automated the production of `gpg` and `gpg-agent` binaries for Windows, MacOS, and Linux with [squeegpg-native](https://github.com/atom/squeegpg-native). | 1 |
Ruby | Ruby | build the root folder before specific files | 1bee2fb600c07625b830afd33b43ead3364c9715 | <ide><path>railties/lib/rails/generators/rails/app/app_generator.rb
<ide> def create_public_files
<ide> build(:public_directory)
<ide> end
<ide>
<add> def create_tmp_files
<add> build(:tmp)
<add> end
<add>
<add> def create_vendor_files
<add> build(:vendor)
<add> end
<add>
<ide> def create_test_files
<ide> build(:test) unless options[:skip_test]
<ide> end
<ide> def create_storage_files
<ide> build(:storage) unless skip_active_storage?
<ide> end
<ide>
<del> def create_tmp_files
<del> build(:tmp)
<del> end
<del>
<del> def create_vendor_files
<del> build(:vendor)
<del> end
<del>
<ide> def delete_app_assets_if_api_option
<ide> if options[:api]
<ide> remove_dir "app/assets" | 1 |
Javascript | Javascript | fix regression in test-require-resolver.js | 91a465c460a1525103611a03ca277b061f320228 | <ide><path>test/parallel/test-require-resolve.js
<ide> const assert = require('assert');
<ide>
<ide> assert.strictEqual(
<ide> fixtures.path('a.js').toLowerCase(),
<del> require.resolve(fixtures.path('a').toLowerCase()));
<add> require.resolve(fixtures.path('a')).toLowerCase());
<ide> assert.strictEqual(
<ide> fixtures.path('a.js').toLowerCase(),
<ide> require.resolve(fixtures.path('a')).toLowerCase()); | 1 |
PHP | PHP | remove dead code | 948491ef3be2c107151f5b2d6df5cb4d18401978 | <ide><path>lib/Cake/Console/TaskCollection.php
<ide>
<ide> use Cake\Core\App;
<ide> use Cake\Error;
<del>use Cake\Utility\ObjectCollection;
<ide>
<ide> /**
<ide> * Collection object for Tasks. Provides features
<ide> class TaskCollection {
<ide> */
<ide> protected $_Shell;
<ide>
<del>/**
<del> * The directory inside each shell path that contains tasks.
<del> *
<del> * @var string
<del> */
<del> public $taskPathPrefix = 'tasks/';
<del>
<ide> /**
<ide> * Constructor
<ide> * | 1 |
Python | Python | fix the rackspace tests for namespacing | 6226efb9fcc5d16492192e487cb0bd1e32f3be0c | <ide><path>test/test_rackspace.py
<ide> from libcloud.types import InvalidCredsError
<ide> from libcloud.drivers.rackspace import (
<ide> RackspaceNodeDriver as Rackspace,
<del> SharedIpGroup,
<del> NodeIpAddresses)
<add> RackspaceSharedIpGroup,
<add> RackspaceNodeIpAddresses)
<ide> from libcloud.base import Node, NodeImage, NodeSize
<ide>
<ide> from test import MockHttp, TestCaseMixin | 1 |
Javascript | Javascript | add legacyhidden to server renderer | 0fb747f368635933f27d296be96c8edcf99cbdbc | <ide><path>packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js
<ide> describe('ReactDOMServerPartialHydration', () => {
<ide> // Now we're hydrated.
<ide> expect(ref.current).not.toBe(null);
<ide> });
<add>
<add> // @gate experimental
<add> // @gate new
<add> it('renders a hidden LegacyHidden component', async () => {
<add> const LegacyHidden = React.unstable_LegacyHidden;
<add>
<add> const ref = React.createRef();
<add>
<add> function App() {
<add> return (
<add> <LegacyHidden mode="hidden">
<add> <span ref={ref}>Hidden child</span>
<add> </LegacyHidden>
<add> );
<add> }
<add>
<add> const finalHTML = ReactDOMServer.renderToString(<App />);
<add>
<add> const container = document.createElement('div');
<add> container.innerHTML = finalHTML;
<add>
<add> const span = container.getElementsByTagName('span')[0];
<add> expect(span).toBe(undefined);
<add>
<add> const root = ReactDOM.createRoot(container, {hydrate: true});
<add> root.render(<App />);
<add> Scheduler.unstable_flushAll();
<add> expect(ref.current.innerHTML).toBe('Hidden child');
<add> });
<add>
<add> // @gate experimental
<add> // @gate new
<add> it('renders a hidden LegacyHidden component inside a Suspense boundary', async () => {
<add> const LegacyHidden = React.unstable_LegacyHidden;
<add>
<add> const ref = React.createRef();
<add>
<add> function App() {
<add> return (
<add> <Suspense fallback="Loading...">
<add> <LegacyHidden mode="hidden">
<add> <span ref={ref}>Hidden child</span>
<add> </LegacyHidden>
<add> </Suspense>
<add> );
<add> }
<add>
<add> const finalHTML = ReactDOMServer.renderToString(<App />);
<add>
<add> const container = document.createElement('div');
<add> container.innerHTML = finalHTML;
<add>
<add> const span = container.getElementsByTagName('span')[0];
<add> expect(span).toBe(undefined);
<add>
<add> const root = ReactDOM.createRoot(container, {hydrate: true});
<add> root.render(<App />);
<add> Scheduler.unstable_flushAll();
<add> expect(ref.current.innerHTML).toBe('Hidden child');
<add> });
<add>
<add> // @gate experimental
<add> // @gate new
<add> it('renders a visible LegacyHidden component', async () => {
<add> const LegacyHidden = React.unstable_LegacyHidden;
<add>
<add> const ref = React.createRef();
<add>
<add> function App() {
<add> return (
<add> <LegacyHidden mode="visible">
<add> <span ref={ref}>Hidden child</span>
<add> </LegacyHidden>
<add> );
<add> }
<add>
<add> const finalHTML = ReactDOMServer.renderToString(<App />);
<add>
<add> const container = document.createElement('div');
<add> container.innerHTML = finalHTML;
<add>
<add> const span = container.getElementsByTagName('span')[0];
<add>
<add> const root = ReactDOM.createRoot(container, {hydrate: true});
<add> root.render(<App />);
<add> Scheduler.unstable_flushAll();
<add> expect(ref.current).toBe(span);
<add> expect(ref.current.innerHTML).toBe('Hidden child');
<add> });
<ide> });
<ide><path>packages/react-dom/src/server/ReactPartialRenderer.js
<ide> import {
<ide> REACT_MEMO_TYPE,
<ide> REACT_FUNDAMENTAL_TYPE,
<ide> REACT_SCOPE_TYPE,
<add> REACT_LEGACY_HIDDEN_TYPE,
<ide> } from 'shared/ReactSymbols';
<ide>
<ide> import {
<ide> class ReactDOMServerRenderer {
<ide> }
<ide>
<ide> switch (elementType) {
<add> case REACT_LEGACY_HIDDEN_TYPE: {
<add> if (!enableSuspenseServerRenderer) {
<add> break;
<add> }
<add> if (((nextChild: any): ReactElement).props.mode === 'hidden') {
<add> // In hidden mode, render nothing.
<add> return '';
<add> }
<add> // Otherwise the tree is visible, so act like a fragment.
<add> }
<add> // Intentional fall through
<add> // eslint-disable-next-line no-fallthrough
<ide> case REACT_DEBUG_TRACING_MODE_TYPE:
<ide> case REACT_STRICT_MODE_TYPE:
<ide> case REACT_PROFILER_TYPE:
<ide><path>packages/react-reconciler/src/ReactFiberBeginWork.new.js
<ide> import {
<ide> reenterHydrationStateFromDehydratedSuspenseInstance,
<ide> resetHydrationState,
<ide> tryToClaimNextHydratableInstance,
<add> getIsHydrating,
<ide> warnIfHydrating,
<ide> } from './ReactFiberHydrationContext.new';
<ide> import {
<ide> function updateOffscreenComponent(
<ide> };
<ide> workInProgress.memoizedState = nextState;
<ide> pushRenderLanes(workInProgress, renderLanes);
<del> } else if (!includesSomeLane(renderLanes, (OffscreenLane: Lane))) {
<add> } else if (
<add> !includesSomeLane(renderLanes, (OffscreenLane: Lane)) ||
<add> // Server renderer does not render hidden subtrees, so if we're hydrating
<add> // we should always bail out and schedule a subsequent render pass, to
<add> // force a client render. Even if we're already at Offscreen priority.
<add> (current === null && getIsHydrating())
<add> ) {
<ide> let nextBaseLanes;
<ide> if (prevState !== null) {
<ide> const prevBaseLanes = prevState.baseLanes; | 3 |
PHP | PHP | step one for moving implementedmethods logic | 412832526d70a46d494d63dcd79b86be936e1c1f | <ide><path>Cake/ORM/Behavior.php
<ide> */
<ide> class Behavior implements EventListener {
<ide>
<add>/**
<add> * _reflectionMethods
<add> *
<add> * @var array
<add> */
<add> protected $_reflectionMethods;
<add>
<ide> /**
<ide> * Contains configuration settings.
<ide> *
<ide> public function implementedEvents() {
<ide> return $events;
<ide> }
<ide>
<add>/**
<add> * implementedFinders
<add> *
<add> * @return array
<add> */
<add> public function implementedFinders() {
<add> $reflectionMethods = $this->_reflectionMethods();
<add> return $reflectionMethods['finders'];
<add> }
<add>
<add>/**
<add> * implementedMethods
<add> *
<add> * @return array
<add> */
<add> public function implementedMethods() {
<add> $reflectionMethods = $this->_reflectionMethods();
<add> return $reflectionMethods['methods'];
<add> }
<add>
<add>/**
<add> * _reflectionmethods
<add> *
<add> * @return array
<add> */
<add> protected function _reflectionMethods() {
<add> if (isset($this->_reflectionMethods)) {
<add> return $this->_reflectionMethods;
<add> }
<add>
<add> $events = $this->implementedEvents();
<add> $eventMethods = [];
<add> foreach ($events as $e => $binding) {
<add> if (is_array($binding) && isset($binding['callable']) && isset($binding['callable'])) {
<add> $binding = $binding['callable'];
<add> }
<add> $eventMethods[$binding] = true;
<add> }
<add>
<add> $return = [
<add> 'finders' => [],
<add> 'methods' => []
<add> ];
<add>
<add> $reflection = new \ReflectionClass(get_class($this));
<add>
<add> foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
<add> if ($method->getDeclaringClass()->getName() === 'Cake\ORM\Behavior') {
<add> continue;
<add> }
<add>
<add> $methodName = $method->getName();
<add> if (strpos($methodName, '_') === 0 || isset($eventMethods[$methodName])) {
<add> continue;
<add> }
<add> $methodName = strtolower($methodName);
<add>
<add> $isFinder = substr($methodName, 0, 4) === 'find';
<add> if ($isFinder) {
<add> $return['finders'][] = $methodName;
<add> } else {
<add> $return['methods'][] = $methodName;
<add> }
<add> }
<add>
<add> return $this->_reflectionMethods = $return;
<add> }
<add>
<ide> }
<ide><path>Cake/ORM/BehaviorRegistry.php
<ide> protected function _create($class, $alias, $settings) {
<ide> * Get the behavior methods and ensure there are no duplicates.
<ide> *
<ide> * Use the implementedEvents() method to exclude callback methods.
<del> * Methods starting with `_` will be ignored, as will methods
<add> * Methods starting with `_` will be ignored, as will methods
<ide> * declared on Cake\ORM\Behavior
<ide> *
<ide> * @param Cake\ORM\Behavior $instance
<ide> protected function _getMethods(Behavior $instance, $class, $alias) {
<ide> if (isset(static::$_methodCache[$class])) {
<ide> return static::$_methodCache[$class];
<ide> }
<del> $events = $instance->implementedEvents();
<del> $reflection = new \ReflectionClass($class);
<ide>
<del> $eventMethods = $methodMap = $finderMap = [];
<del> foreach ($events as $e => $binding) {
<del> if (is_array($binding) && isset($binding['callable']) && isset($binding['callable'])) {
<del> $binding = $binding['callable'];
<del> }
<del> $eventMethods[$binding] = true;
<del> }
<del>
<del> foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
<del> if ($method->getDeclaringClass()->getName() === 'Cake\ORM\Behavior') {
<del> continue;
<del> }
<add> $methodMap = $finderMap = [];
<add> $finders = $instance->implementedFinders();
<add> $methods = $instance->implementedMethods();
<ide>
<del> $methodName = $method->getName();
<del> if (strpos($methodName, '_') === 0 || isset($eventMethods[$methodName])) {
<del> continue;
<del> }
<add> foreach($finders as $methodName) {
<ide> $methodName = strtolower($methodName);
<ide>
<del> if (isset($this->_finderMap[$methodName]) || isset($this->_methodMap[$methodName])) {
<del> if (isset($this->_finderMap[$methodName])) {
<del> $duplicate = $this->_finderMap[$methodName];
<del> } else {
<del> $duplicate = $this->_methodMap[$methodName];
<del> }
<add> if (isset($this->_finderMap[$methodName])) {
<add> $duplicate = $this->_finderMap[$methodName];
<ide> $error = __d(
<ide> 'cake_dev',
<ide> '%s contains duplicate method "%s" which is already provided by "%s"',
<ide> $class,
<del> $method->getName(),
<add> $methodName,
<ide> $duplicate
<ide> );
<ide> throw new Error\Exception($error);
<ide> }
<add> $finderMap[$methodName] = $alias;
<add> }
<add>
<add> foreach($methods as $methodName) {
<add> $methodName = strtolower($methodName);
<ide>
<del> $isFinder = substr($methodName, 0, 4) === 'find';
<del> if ($isFinder) {
<del> $finderMap[$methodName] = $alias;
<del> } else {
<del> $methodMap[$methodName] = $alias;
<add> if (isset($this->_methodMap[$methodName])) {
<add> $duplicate = $this->_methodMap[$methodName];
<add> $error = __d(
<add> 'cake_dev',
<add> '%s contains duplicate method "%s" which is already provided by "%s"',
<add> $class,
<add> $methodName,
<add> $duplicate
<add> );
<add> throw new Error\Exception($error);
<ide> }
<add> $methodMap[$methodName] = $alias;
<ide> }
<add>
<ide> static::$_methodCache[$class] = ['methods' => $methodMap, 'finders' => $finderMap];
<ide> return static::$_methodCache[$class];
<ide> }
<ide>
<ide> /**
<ide> * Check if any loaded behavior implements a method.
<ide> *
<del> * Will return true if any behavior provides a public non-finder method
<add> * Will return true if any behavior provides a public non-finder method
<ide> * with the chosen name.
<ide> *
<ide> * @param string $method The method to check for. | 2 |
Python | Python | make tests to import | fab2b47311a315942ae12fa56a7fef43f84d3c21 | <ide><path>numpy/polynomial/tests/test_chebyshev.py
<ide> import numpy as np
<ide> import numpy.polynomial.chebyshev as ch
<ide> from numpy.testing import *
<del>from exceptions import TypeError, ValueError
<ide>
<ide> def trim(x) :
<ide> return ch.chebtrim(x, tol=1e-6)
<ide><path>numpy/polynomial/tests/test_polynomial.py
<ide> import numpy as np
<ide> import numpy.polynomial.polynomial as poly
<ide> from numpy.testing import *
<del>from exceptions import TypeError, ValueError
<ide>
<ide> def trim(x) :
<ide> return poly.polytrim(x, tol=1e-6)
<ide><path>numpy/polynomial/tests/test_polyutils.py
<ide> import numpy as np
<ide> import numpy.polynomial.polyutils as pu
<ide> from numpy.testing import *
<del>from exceptions import TypeError, ValueError
<ide>
<ide> class TestMisc(TestCase) :
<ide> | 3 |
Go | Go | add missing fprintf instead of printf | 6127d757a7495df83b3d4cec53dc56b48c764023 | <ide><path>commands.go
<ide> func (cli *DockerCli) CmdPort(args ...string) error {
<ide> }
<ide>
<ide> if frontend, exists := out.NetworkSettings.PortMapping[cmd.Arg(1)]; exists {
<del> fmt.Println(frontend)
<add> fmt.Fprintf(cli.out, "%s\n", frontend)
<ide> } else {
<ide> return fmt.Errorf("Error: No private port '%s' allocated on %s", cmd.Arg(1), cmd.Arg(0))
<ide> }
<ide> func (cli *DockerCli) CmdRmi(args ...string) error {
<ide> }
<ide> for _, out := range outs {
<ide> if out.Deleted != "" {
<del> fmt.Println("Deleted:", out.Deleted)
<add> fmt.Fprintf(cli.out, "Deleted: %s\n", out.Deleted)
<ide> } else {
<del> fmt.Println("Untagged:", out.Untagged)
<add> fmt.Fprintf(cli.out, "Untagged: %s\n", out.Untagged)
<ide> }
<ide> }
<ide> }
<ide> func (cli *DockerCli) CmdRm(args ...string) error {
<ide> for _, name := range cmd.Args() {
<ide> _, _, err := cli.call("DELETE", "/containers/"+name+"?"+val.Encode(), nil)
<ide> if err != nil {
<del> fmt.Printf("%s", err)
<add> fmt.Fprintf(cli.err, "%s\n", err)
<ide> } else {
<del> fmt.Println(name)
<add> fmt.Fprintf(cli.out, "%s\n", name)
<ide> }
<ide> }
<ide> return nil
<ide> func (cli *DockerCli) CmdKill(args ...string) error {
<ide> for _, name := range args {
<ide> _, _, err := cli.call("POST", "/containers/"+name+"/kill", nil)
<ide> if err != nil {
<del> fmt.Printf("%s", err)
<add> fmt.Fprintf(cli.err, "%s\n", err)
<ide> } else {
<del> fmt.Println(name)
<add> fmt.Fprintf(cli.out, "%s\n", name)
<ide> }
<ide> }
<ide> return nil
<ide> func (cli *DockerCli) CmdImages(args ...string) error {
<ide> if err != nil {
<ide> return err
<ide> }
<del> fmt.Printf("%s", body)
<add> fmt.Fprintf(cli.out, "%s", body)
<ide> } else {
<ide> v := url.Values{}
<ide> if cmd.NArg() == 1 {
<ide> func (cli *DockerCli) CmdCommit(args ...string) error {
<ide> return err
<ide> }
<ide>
<del> fmt.Println(apiID.ID)
<add> fmt.Fprintf(cli.out, "%s\n", apiID.ID)
<ide> return nil
<ide> }
<ide>
<ide> func (cli *DockerCli) CmdDiff(args ...string) error {
<ide> return err
<ide> }
<ide> for _, change := range changes {
<del> fmt.Println(change.String())
<add> fmt.Fprintf(cli.out, "%s\n", change.String())
<ide> }
<ide> return nil
<ide> } | 1 |
Python | Python | add test for upload_object throwing an exception | 2f32d40819f1c80e3fc8dc4d547c6c6648c643d4 | <ide><path>test/storage/test_cloudfiles.py
<ide> def no_content_type(name):
<ide> finally:
<ide> libcloud.utils.guess_file_mime_type = old_func
<ide>
<del> # TODO: Add test for upload_object throwing a LibcloudError
<add> def test_upload_object_error(self):
<add> def dummy_content_type(name):
<add> return 'application/zip', None
<add>
<add> def send(instance):
<add> raise Exception('')
<add>
<add> old_func1 = libcloud.utils.guess_file_mime_type
<add> libcloud.utils.guess_file_mime_type = dummy_content_type
<add> old_func2 = CloudFilesMockHttp.send
<add> CloudFilesMockHttp.send = send
<add>
<add> file_path = os.path.abspath(__file__)
<add> container = Container(name='foo_bar_container', extra={}, driver=self)
<add> object_name = 'foo_test_upload'
<add> try:
<add> obj = self.driver.upload_object(file_path=file_path, container=container,
<add> object_name=object_name)
<add> except LibcloudError:
<add> pass
<add> else:
<add> self.fail('Timeout while uploading but an exception was not thrown')
<add> finally:
<add> libcloud.utils.guess_file_mime_type = old_func1
<add> CloudFilesMockHttp.send = old_func2
<ide>
<ide> def test_upload_object_inexistent_file(self):
<ide> def dummy_content_type(name):
<ide> def dummy_content_type(name):
<ide> except OSError:
<ide> pass
<ide> else:
<del> self.fail('Timeout while uploading but an exception was not thrown')
<add> self.fail('Inesitent but an exception was not thrown')
<ide> finally:
<ide> libcloud.utils.guess_file_mime_type = old_func
<ide> | 1 |
Text | Text | update information security with helmetjs text | 1baad2357c00810fd6bcb2d7cd0702a1c6282d33 | <ide><path>curriculum/challenges/english/09-information-security/information-security-with-helmetjs/install-and-require-helmet.md
<ide> Helmet helps you secure your Express apps by setting various HTTP headers.
<ide>
<ide> All your code for these lessons goes in the `myApp.js` file between the lines of code we have started you off with. Do not change or delete the code we have added for you.
<ide>
<del>Install Helmet version `3.21.3`, then require it. You can install a specific version of a package with `npm install --save-exact package@version`, or by adding it to your `package.json` directly.
<add>Helmet version `3.21.3` has already been installed, so require it as `helmet` in `myApp.js`.
<ide>
<ide> # --hints--
<ide>
<ide><path>curriculum/challenges/english/09-information-security/information-security-with-helmetjs/understand-bcrypt-hashes.md
<ide> BCrypt hashes will always looks like `$2a$13$ZyprE5MRw2Q3WpNOGZWGbeG7ADUre1Q8QO.
<ide>
<ide> # --instructions--
<ide>
<del>To begin using BCrypt, add it as a dependency in your project and require it as 'bcrypt' in your server.
<del>
<ide> Add all your code for these lessons in the `server.js` file between the code we have started you off with. Do not change or delete the code we have added for you.
<ide>
<add>BCrypt has already been added as a dependency, so require it ad `bcrypt` in your server.
<add>
<ide> Submit your page when you think you've got it right.
<ide>
<ide> # --hints-- | 2 |
Javascript | Javascript | add reacttransitiongroup to the build | f7ea031dac8dedddd9525c42a5c27b34c01f616a | <ide><path>grunt/config/jsx/jsx.js
<ide> 'use strict';
<ide>
<ide> var rootIDs = [
<del> "React"
<add> "React",
<add> "ReactTransitionGroup"
<ide> ];
<ide>
<ide> var debug = { | 1 |
Python | Python | define the package pattern for keras-nlp | 1eb0ec0e8756b9949024bb8829793c621be828df | <ide><path>official/nlp/keras_nlp/__init__.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-NLP package definition."""
<add># pylint: disable=wildcard-import
<add>from official.nlp.keras_nlp.layers import *
<ide><path>official/nlp/keras_nlp/layers/__init__.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-NLP layers package definition."""
<add>from official.nlp.keras_nlp.layers.transformer_encoder_block import TransformerEncoderBlock
<ide><path>official/nlp/keras_nlp/layers/transformer_encoder_block_test.py
<ide> def test_get_config(self):
<ide> self.assertEqual(encoder_block_config, new_encoder_block.get_config())
<ide>
<ide>
<del>def _create_cache(batch_size, init_decode_length, num_heads, head_size):
<del> return {
<del> 'key':
<del> tf.zeros([batch_size, init_decode_length, num_heads, head_size],
<del> dtype=tf.float32),
<del> 'value':
<del> tf.zeros([batch_size, init_decode_length, num_heads, head_size],
<del> dtype=tf.float32)
<del> }
<del>
<del>
<ide> if __name__ == '__main__':
<ide> tf.test.main()
<ide><path>official/nlp/modeling/layers/transformer.py
<ide> import gin
<ide> import tensorflow as tf
<ide>
<del>from official.nlp.keras_nlp.layers import transformer_encoder_block
<add>from official.nlp import keras_nlp
<ide> from official.nlp.modeling.layers import attention
<ide> from official.nlp.modeling.layers import multi_channel_attention
<ide> from official.nlp.modeling.layers.util import tf_function_if_eager
<ide>
<ide>
<ide> @tf.keras.utils.register_keras_serializable(package="Text")
<del>class Transformer(transformer_encoder_block.TransformerEncoderBlock):
<add>class Transformer(keras_nlp.TransformerEncoderBlock):
<ide> """Transformer layer.
<ide>
<ide> This layer implements the Transformer from "Attention Is All You Need".
<ide><path>official/nlp/modeling/models/seq2seq_transformer.py
<ide>
<ide> import tensorflow as tf
<ide> from official.modeling import tf_utils
<del>from official.nlp.keras_nlp.layers import transformer_encoder_block
<add>from official.nlp import keras_nlp
<ide> from official.nlp.modeling import layers
<ide> from official.nlp.modeling.ops import beam_search
<ide> from official.nlp.transformer import metrics
<ide> def build(self, input_shape):
<ide> self.encoder_layers = []
<ide> for i in range(self.num_layers):
<ide> self.encoder_layers.append(
<del> transformer_encoder_block.TransformerEncoderBlock(
<add> keras_nlp.TransformerEncoderBlock(
<ide> num_attention_heads=self.num_attention_heads,
<ide> inner_dim=self._intermediate_size,
<ide> inner_activation=self._activation, | 5 |
PHP | PHP | add wherepivot tests | 2d40c94d4db099df09fec943ef3bbced03b97b78 | <ide><path>tests/Integration/Database/EloquentBelongsToManyTest.php
<ide> public function test_can_touch_related_models()
<ide> $this->assertNotEquals('2017-10-10 10:10:10', Tag::find(300)->updated_at);
<ide> }
<ide>
<add> public function test_where_pivot_on_string()
<add> {
<add> $tag = Tag::create(['name' => Str::random()]);
<add> $post = Post::create(['title' => Str::random()]);
<add>
<add> DB::table('posts_tags')->insert([
<add> ['post_id' => $post->id, 'tag_id' => $tag->id, 'flag' => 'empty'],
<add> ]);
<add>
<add> $relationTag = $post->tags()->wherePivot('flag', 'empty')->first();
<add> $this->assertEquals($relationTag->getAttributes(), $tag->getAttributes());
<add>
<add> $relationTag = $post->tags()->wherePivot('flag', '=', 'empty')->first();
<add> $this->assertEquals($relationTag->getAttributes(), $tag->getAttributes());
<add> }
<add>
<add> public function test_where_pivot_on_boolean()
<add> {
<add> $tag = Tag::create(['name' => Str::random()]);
<add> $post = Post::create(['title' => Str::random()]);
<add>
<add> DB::table('posts_tags')->insert([
<add> ['post_id' => $post->id, 'tag_id' => $tag->id, 'flag' => true],
<add> ]);
<add>
<add> $relationTag = $post->tags()->wherePivot('flag', true)->first();
<add> $this->assertEquals($relationTag->getAttributes(), $tag->getAttributes());
<add>
<add> $relationTag = $post->tags()->wherePivot('flag', '=', true)->first();
<add> $this->assertEquals($relationTag->getAttributes(), $tag->getAttributes());
<add> }
<add>
<ide> public function test_can_update_existing_pivot()
<ide> {
<ide> $tag = Tag::create(['name' => Str::random()]); | 1 |
Javascript | Javascript | remove string literal message from assertion | 8eb1130854c1e9cbf077f859b0f442d1e6852ba1 | <ide><path>test/parallel/test-http-information-processing.js
<ide> server.listen(0, function() {
<ide> });
<ide>
<ide> req.on('response', function(res) {
<del> assert.strictEqual(countdown.remaining, 1,
<del> 'Full response received before all 102 Processing');
<add> // Check that all 102 Processing received before full response received.
<add> assert.strictEqual(countdown.remaining, 1);
<ide> assert.strictEqual(200, res.statusCode,
<ide> `Final status code was ${res.statusCode}, not 200.`);
<ide> res.setEncoding('utf8'); | 1 |
Javascript | Javascript | fix module cycle in @ember/engine package | ae39947c7f5deba08c69a6aea4c548ae087612d3 | <ide><path>packages/@ember/engine/index.js
<ide> /**
<ide> @module @ember/engine
<ide> */
<add>
<add>export { getEngineParent, setEngineParent } from './lib/engine-parent';
<add>
<ide> import { canInvoke } from 'ember-utils';
<ide> import Controller from '@ember/controller';
<ide> import { Namespace, RegistryProxyMixin } from 'ember-runtime';
<ide> import { RoutingService } from 'ember-routing';
<ide> import { ContainerDebugAdapter } from 'ember-extension-support';
<ide> import { ComponentLookup } from 'ember-views';
<ide> import { setupEngineRegistry } from 'ember-glimmer';
<del>import { symbol } from 'ember-utils';
<del>
<del>const ENGINE_PARENT = symbol('ENGINE_PARENT');
<del>
<del>/**
<del> `getEngineParent` retrieves an engine instance's parent instance.
<del>
<del> @method getEngineParent
<del> @param {EngineInstance} engine An engine instance.
<del> @return {EngineInstance} The parent engine instance.
<del> @for @ember/engine
<del> @static
<del> @private
<del>*/
<del>export function getEngineParent(engine) {
<del> return engine[ENGINE_PARENT];
<del>}
<del>
<del>/**
<del> `setEngineParent` sets an engine instance's parent instance.
<ide>
<del> @method setEngineParent
<del> @param {EngineInstance} engine An engine instance.
<del> @param {EngineInstance} parent The parent engine instance.
<del> @private
<del>*/
<del>export function setEngineParent(engine, parent) {
<del> engine[ENGINE_PARENT] = parent;
<del>}
<ide> function props(obj) {
<ide> let properties = [];
<ide>
<ide><path>packages/@ember/engine/instance.js
<ide> import {
<ide> import { assert } from '@ember/debug';
<ide> import EmberError from '@ember/error';
<ide> import { Registry, privatize as P } from 'container';
<del>import { getEngineParent, setEngineParent } from '@ember/engine';
<add>import { getEngineParent, setEngineParent } from './lib/engine-parent';
<ide>
<ide> /**
<ide> The `EngineInstance` encapsulates all of the stateful aspects of a
<ide><path>packages/@ember/engine/lib/engine-parent.js
<add>/**
<add>@module @ember/engine
<add>*/
<add>import { symbol } from 'ember-utils';
<add>
<add>const ENGINE_PARENT = symbol('ENGINE_PARENT');
<add>
<add>/**
<add> `getEngineParent` retrieves an engine instance's parent instance.
<add>
<add> @method getEngineParent
<add> @param {EngineInstance} engine An engine instance.
<add> @return {EngineInstance} The parent engine instance.
<add> @for @ember/engine
<add> @static
<add> @private
<add>*/
<add>export function getEngineParent(engine) {
<add> return engine[ENGINE_PARENT];
<add>}
<add>
<add>/**
<add> `setEngineParent` sets an engine instance's parent instance.
<add>
<add> @method setEngineParent
<add> @param {EngineInstance} engine An engine instance.
<add> @param {EngineInstance} parent The parent engine instance.
<add> @private
<add>*/
<add>export function setEngineParent(engine, parent) {
<add> engine[ENGINE_PARENT] = parent;
<add>} | 3 |
Javascript | Javascript | remove some unused scale code | b0bddce017c1e8fa0094e69213a096a98377907d | <ide><path>src/core/core.scale.js
<ide> return scaleInstance.options.position == "bottom";
<ide> });
<ide>
<del> var visibleLeftScales = helpers.where(chartInstance.scales, function(scaleInstance) {
<del> return scaleInstance.options.position == "left";
<del> });
<del> var visibleRightScales = helpers.where(chartInstance.scales, function(scaleInstance) {
<del> return scaleInstance.options.position == "right";
<del> });
<del> var visibleTopScales = helpers.where(chartInstance.scales, function(scaleInstance) {
<del> return scaleInstance.options.position == "top";
<del> });
<del> var visibleBottomScales = helpers.where(chartInstance.scales, function(scaleInstance) {
<del> return scaleInstance.options.position == "bottom";
<del> });
<del>
<del> // // Adjust the padding to take into account displaying labels
<del> // if (topScales.length === 0 || bottomScales.length === 0) {
<del> // var maxFontHeight = 0;
<del>
<del> // var maxFontHeightFunction = function(scaleInstance) {
<del> // if (scaleInstance.options.labels.show) {
<del> // // Only consider font sizes for axes that actually show labels
<del> // maxFontHeight = Math.max(maxFontHeight, scaleInstance.options.labels.fontSize);
<del> // }
<del> // };
<del>
<del> // helpers.each(leftScales, maxFontHeightFunction);
<del> // helpers.each(rightScales, maxFontHeightFunction);
<del>
<del> // if (topScales.length === 0) {
<del> // // Add padding so that we can handle drawing the top nicely
<del> // yPadding += 0.75 * maxFontHeight; // 0.75 since padding added on both sides
<del> // }
<del>
<del> // if (bottomScales.length === 0) {
<del> // // Add padding so that we can handle drawing the bottom nicely
<del> // yPadding += 1.5 * maxFontHeight;
<del> // }
<del> // }
<del>
<ide> // Essentially we now have any number of scales on each of the 4 sides.
<ide> // Our canvas looks like the following.
<ide> // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and | 1 |
PHP | PHP | fix failing scaffold tests | 93b80042f8fc24fcc550a9db9600a5bc42d30a80 | <ide><path>cake/tests/cases/libs/controller/scaffold.test.php
<ide> function testScaffoldChangingViewProperty() {
<ide> $this->Controller->theme = 'test_theme';
<ide> $this->Controller->view = 'Theme';
<ide> $this->Controller->constructClasses();
<del> $Scaffold =& new TestScaffoldMock($this->Controller, array());
<add> $Scaffold =& new TestScaffoldMock($this->Controller, new CakeRequest());
<ide>
<ide> $this->assertEqual($this->Controller->view, 'Scaffold');
<ide> } | 1 |
PHP | PHP | apply suggestions from code review | 4bccfb80b6c90787a3aa04c4c413cab6c2a3efec | <ide><path>src/TestSuite/TestCase.php
<ide> public static function setAppNamespace(string $appNamespace = 'TestApp'): void
<ide> /**
<ide> * Gets fixtures.
<ide> *
<del> * @return array
<add> * @return string[]
<ide> */
<del> public function getFixtures()
<add> public function getFixtures(): array
<ide> {
<ide> return $this->fixtures;
<ide> } | 1 |
Ruby | Ruby | track only the major version instead | 231b10beea223bd62ccbbd6783ec4d1fc45115d9 | <ide><path>Library/Homebrew/os/mac.rb
<ide> def full_version=(version)
<ide> sig { returns(::Version) }
<ide> def latest_sdk_version
<ide> # TODO: bump version when new Xcode macOS SDK is released
<del> ::Version.new("11.3")
<add> # NOTE: We only track the major version of the SDK.
<add> ::Version.new("11")
<ide> end
<ide> private :latest_sdk_version
<ide> | 1 |
Python | Python | drop unused import | 5c6adb1ccaa6f40f4afeb503cb9c8944c9ce9f75 | <ide><path>djangorestframework/tests/renderers.py
<ide> from djangorestframework.compat import View as DjangoView
<ide> from djangorestframework.renderers import BaseRenderer, JSONRenderer, YAMLRenderer,\
<ide> XMLRenderer
<del>from djangorestframework.parsers import JSONParser, YAMLParser, XMLParser
<add>from djangorestframework.parsers import JSONParser, YAMLParser
<ide> from djangorestframework.mixins import ResponseMixin
<ide> from djangorestframework.response import Response
<ide> from djangorestframework.utils.mediatypes import add_media_type_param | 1 |
Javascript | Javascript | move beforerender/afterrender into the legacy bin | 1e54081264e72affc0f22ac685b0ad21c771b552 | <ide><path>packages/ember-views/lib/mixins/legacy_view_support.js
<ide> import { Mixin } from "ember-metal/mixin";
<ide> import { get } from "ember-metal/property_get";
<ide>
<ide> var LegacyViewSupport = Mixin.create({
<add> beforeRender: function(buffer) {},
<add>
<add> afterRender: function(buffer) {},
<add>
<ide> mutateChildViews: function(callback) {
<ide> var childViews = this._childViews;
<ide> var idx = childViews.length;
<ide><path>packages/ember-views/lib/views/view.js
<ide> var View = CoreView.extend(
<ide> */
<ide> parentViewDidChange: K,
<ide>
<del> beforeRender: function(buffer) {},
<del>
<del> afterRender: function(buffer) {},
<del>
<ide> applyAttributesToBuffer: function(buffer) {
<ide> // Creates observers for all registered class name and attribute bindings,
<ide> // then adds them to the element. | 2 |
Text | Text | add changelog entry for | e6278348b7a4b2df0b10336f0287f064e068fa3f | <ide><path>actionpack/CHANGELOG.md
<ide> ## Rails 4.0.0 (unreleased) ##
<ide>
<add>* Remove old asset_path configuration (no longer needed now that we have the asset pipeline).
<add>
<add> *Josh Peek*
<add>
<ide> * `assert_template` can be used to assert on the same template with different locals
<ide> Fix #3675
<ide>
<ide> *Yves Senn*
<ide>
<del>* Remove old asset tag concatenation (no longer needed now that we have the asset pipeline). *Josh Peek*
<add>* Remove old asset tag concatenation (no longer needed now that we have the asset pipeline).
<add>
<add> *Josh Peek*
<ide>
<ide> * Accept :remote as symbolic option for `link_to` helper. *Riley Lynch*
<ide>
<ide><path>guides/source/configuring.md
<ide> These configuration methods are to be called on a `Rails::Railtie` object, such
<ide>
<ide> * `config.asset_host` sets the host for the assets. Useful when CDNs are used for hosting assets, or when you want to work around the concurrency constraints builtin in browsers using different domain aliases. Shorter version of `config.action_controller.asset_host`.
<ide>
<del>* `config.asset_path` lets you decorate asset paths. This can be a callable, a string, or be `nil` which is the default. For example, the normal path for `blog.js` would be `/javascripts/blog.js`, let that absolute path be `path`. If `config.asset_path` is a callable, Rails calls it when generating asset paths passing `path` as argument. If `config.asset_path` is a string, it is expected to be a `sprintf` format string with a `%s` where `path` will get inserted. In either case, Rails outputs the decorated path. Shorter version of `config.action_controller.asset_path`.
<del>
<del> ```ruby
<del> config.asset_path = proc { |path| "/blog/public#{path}" }
<del> ```
<del>
<del>NOTE. The `config.asset_path` configuration is ignored if the asset pipeline is enabled, which is the default.
<del>
<ide> * `config.autoload_once_paths` accepts an array of paths from which Rails will autoload constants that won't be wiped per request. Relevant if `config.cache_classes` is false, which is the case in development mode by default. Otherwise, all autoloading happens only once. All elements of this array must also be in `autoload_paths`. Default is an empty array.
<ide>
<ide> * `config.autoload_paths` accepts an array of paths from which Rails will autoload constants. Default is all directories under `app`.
<ide> The schema dumper adds one additional configuration option:
<ide>
<ide> * `config.action_controller.asset_host` sets the host for the assets. Useful when CDNs are used for hosting assets rather than the application server itself.
<ide>
<del>* `config.action_controller.asset_path` takes a block which configures where assets can be found. Shorter version of `config.action_controller.asset_path`.
<del>
<ide> * `config.action_controller.perform_caching` configures whether the application should perform caching or not. Set to false in development mode, true in production.
<ide>
<ide> * `config.action_controller.default_static_extension` configures the extension used for cached pages. Defaults to `.html`.
<ide><path>guides/source/upgrading_ruby_on_rails.md
<ide> in the `config/initializers/wrap_parameters.rb` file:
<ide>
<ide> ### Action Pack
<ide>
<add>Rails 4.0 removed the `ActionController::Base.asset_path` option. Use the assets pipeline feature.
<add>
<ide> Rails 4.0 has deprecated `ActionController::Base.page_cache_extension` option. Use
<ide> `ActionController::Base.default_static_extension` instead.
<ide> | 3 |
Ruby | Ruby | move colormake to headonly | dae221bdb84cdc73170ed1395130595d9706b8fc | <ide><path>Library/Homebrew/tap_migrations.rb
<ide> 'jsl' => 'homebrew/binary',
<ide> 'nlopt' => 'homebrew/science',
<ide> 'comparepdf' => 'homebrew/boneyard',
<add> 'colormake' => 'homebrew/headonly',
<ide> } | 1 |
Javascript | Javascript | pass the bytes sent to the send callback | a4436bab7b83e311f8a4207b9c6d97acde4735ff | <ide><path>lib/dgram.js
<ide> Socket.prototype.send = function(buffer,
<ide>
<ide>
<ide> function afterSend(err) {
<del> this.callback(err ? errnoException(err, 'send') : null);
<add> this.callback(err ? errnoException(err, 'send') : null, this.buffer.length);
<ide> }
<ide>
<ide>
<ide><path>test/simple/test-dgram-bytes-length.js
<add>// Copyright Joyent, Inc. and other Node contributors.
<add>//
<add>// Permission is hereby granted, free of charge, to any person obtaining a
<add>// copy of this software and associated documentation files (the
<add>// "Software"), to deal in the Software without restriction, including
<add>// without limitation the rights to use, copy, modify, merge, publish,
<add>// distribute, sublicense, and/or sell copies of the Software, and to permit
<add>// persons to whom the Software is furnished to do so, subject to the
<add>// following conditions:
<add>//
<add>// The above copyright notice and this permission notice shall be included
<add>// in all copies or substantial portions of the Software.
<add>//
<add>// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
<add>// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
<add>// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
<add>// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
<add>// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
<add>// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
<add>// USE OR OTHER DEALINGS IN THE SOFTWARE.
<add>
<add>var common = require('../common');
<add>var assert = require('assert');
<add>var dgram = require('dgram');
<add>
<add>var message = new Buffer('Some bytes');
<add>var client = dgram.createSocket('udp4');
<add>client.send(message, 0, message.length, 41234, "localhost", function(err, bytes) {
<add> assert.strictEqual(bytes, message.length);
<add> client.close();
<add>}); | 2 |
Ruby | Ruby | use new rotation signature in cookies | 9d79d77813c3aca010a5b40cacbd6e68f42ce618 | <ide><path>actionpack/lib/action_dispatch/middleware/cookies.rb
<ide> def upgrade_legacy_signed_cookies?
<ide> end
<ide>
<ide> def upgrade_legacy_hmac_aes_cbc_cookies?
<del> request.secret_key_base.present? &&
<del> request.encrypted_signed_cookie_salt.present? &&
<del> request.encrypted_cookie_salt.present? &&
<add> request.secret_key_base.present? &&
<add> request.encrypted_signed_cookie_salt.present? &&
<add> request.encrypted_cookie_salt.present? &&
<ide> request.use_authenticated_cookie_encryption
<ide> end
<ide>
<ide> def initialize(parent_jar)
<ide> secret = request.key_generator.generate_key(request.signed_cookie_salt)
<ide> @verifier = ActiveSupport::MessageVerifier.new(secret, digest: signed_cookie_digest, serializer: SERIALIZER)
<ide>
<del> request.cookies_rotations.signed.each do |rotation_options|
<del> @verifier.rotate serializer: SERIALIZER, **rotation_options
<add> request.cookies_rotations.signed.each do |*secrets, **options|
<add> @verifier.rotate *secrets, serializer: SERIALIZER, **options
<ide> end
<ide>
<ide> if upgrade_legacy_signed_cookies?
<del> @verifier.rotate raw_key: request.secret_token, serializer: SERIALIZER
<add> @verifier.rotate request.secret_token, serializer: SERIALIZER
<ide> end
<ide> end
<ide>
<ide> def initialize(parent_jar)
<ide> secret = request.key_generator.generate_key(request.authenticated_encrypted_cookie_salt, key_len)
<ide> @encryptor = ActiveSupport::MessageEncryptor.new(secret, cipher: encrypted_cookie_cipher, serializer: SERIALIZER)
<ide>
<del> request.cookies_rotations.encrypted.each do |rotation_options|
<del> @encryptor.rotate serializer: SERIALIZER, **rotation_options
<add> request.cookies_rotations.encrypted.each do |*secrets, **options|
<add> @encryptor.rotate *secrets, serializer: SERIALIZER, **options
<ide> end
<ide>
<ide> if upgrade_legacy_hmac_aes_cbc_cookies?
<del> @encryptor.rotate \
<del> key_generator: request.key_generator, salt: request.encrypted_cookie_salt, signed_salt: request.encrypted_signed_cookie_salt,
<del> cipher: "aes-256-cbc", digest: digest, serializer: SERIALIZER
<add> secret = request.key_generator.generate_key(request.encrypted_cookie_salt)
<add> sign_secret = request.key_generator.generate_key(request.encrypted_signed_cookie_salt)
<add>
<add> @encryptor.rotate secret, sign_secret, cipher: "aes-256-cbc", digest: digest, serializer: SERIALIZER
<ide> end
<ide>
<ide> if upgrade_legacy_signed_cookies?
<ide><path>actionpack/test/dispatch/cookies_test.rb
<ide> def test_signed_cookie_using_custom_digest
<ide> assert_equal verifier.generate(45), cookies[:user_id]
<ide> end
<ide>
<del> def test_signed_cookie_rotations_with_secret_key_base_and_digest
<del> rotated_secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"
<del> rotated_salt = "signed cookie"
<add> def test_signed_cookie_rotating_secret_and_digest
<add> secret = "b3c631c314c0bbca50c1b2843150fe33"
<ide>
<ide> @request.env["action_dispatch.signed_cookie_digest"] = "SHA256"
<del> @request.env["action_dispatch.cookies_rotations"].rotate :signed,
<del> secret: rotated_secret_key_base, salt: rotated_salt, digest: "SHA1"
<del>
<del> old_secret = ActiveSupport::KeyGenerator.new(rotated_secret_key_base, iterations: 1000).generate_key(rotated_salt)
<del> old_message = ActiveSupport::MessageVerifier.new(old_secret, digest: "SHA1", serializer: Marshal).generate(45)
<del>
<del> @request.headers["Cookie"] = "user_id=#{old_message}"
<del>
<del> get :get_signed_cookie
<del> assert_equal 45, @controller.send(:cookies).signed[:user_id]
<del>
<del> key_generator = @request.env["action_dispatch.key_generator"]
<del> secret = key_generator.generate_key(@request.env["action_dispatch.signed_cookie_salt"])
<del> verifier = ActiveSupport::MessageVerifier.new(secret, digest: "SHA256", serializer: Marshal)
<del> assert_equal 45, verifier.verify(@response.cookies["user_id"])
<del> end
<del>
<del> def test_signed_cookie_rotations_with_raw_key_and_digest
<del> rotated_raw_key = "b3c631c314c0bbca50c1b2843150fe33"
<del>
<del> @request.env["action_dispatch.signed_cookie_digest"] = "SHA256"
<del> @request.env["action_dispatch.cookies_rotations"].rotate :signed,
<del> raw_key: rotated_raw_key, digest: "SHA1"
<del>
<del> old_message = ActiveSupport::MessageVerifier.new(rotated_raw_key, digest: "SHA1", serializer: Marshal).generate(45)
<add> @request.env["action_dispatch.cookies_rotations"].rotate :signed, secret, digest: "SHA1"
<ide>
<add> old_message = ActiveSupport::MessageVerifier.new(secret, digest: "SHA1", serializer: Marshal).generate(45)
<ide> @request.headers["Cookie"] = "user_id=#{old_message}"
<ide>
<ide> get :get_signed_cookie
<ide> def test_legacy_hmac_aes_cbc_encrypted_cookie_using_64_byte_key_is_upgraded_to_a
<ide> assert_equal "bar", encryptor.decrypt_and_verify(@response.cookies["foo"])
<ide> end
<ide>
<del> def test_encrypted_cookie_rotations_with_secret_and_salt
<del> rotated_secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"
<del> rotated_salt = "authenticated encrypted cookie"
<del>
<del> @request.env["action_dispatch.encrypted_cookie_cipher"] = "aes-256-gcm"
<del> @request.env["action_dispatch.cookies_rotations"].rotate :encrypted,
<del> secret: rotated_secret_key_base, salt: rotated_salt, cipher: "aes-256-gcm"
<del>
<del> key_len = ActiveSupport::MessageEncryptor.key_len("aes-256-gcm")
<del>
<del> old_secret = ActiveSupport::KeyGenerator.new(rotated_secret_key_base, iterations: 1000).generate_key(rotated_salt, key_len)
<del> old_message = ActiveSupport::MessageEncryptor.new(old_secret, cipher: "aes-256-gcm", serializer: Marshal).encrypt_and_sign("bar")
<del>
<del> @request.headers["Cookie"] = "foo=#{::Rack::Utils.escape old_message}"
<del>
<del> get :get_encrypted_cookie
<del> assert_equal "bar", @controller.send(:cookies).encrypted[:foo]
<del>
<del> key_generator = @request.env["action_dispatch.key_generator"]
<del> secret = key_generator.generate_key(@request.env["action_dispatch.authenticated_encrypted_cookie_salt"], key_len)
<del> encryptor = ActiveSupport::MessageEncryptor.new(secret, cipher: "aes-256-gcm", serializer: Marshal)
<del> assert_equal "bar", encryptor.decrypt_and_verify(@response.cookies["foo"])
<del> end
<del>
<del> def test_encrypted_cookie_rotations_with_raw_key
<del> raw_key = "b3c631c314c0bbca50c1b2843150fe33"
<add> def test_encrypted_cookie_rotating_secret
<add> secret = "b3c631c314c0bbca50c1b2843150fe33"
<ide>
<ide> @request.env["action_dispatch.encrypted_cookie_cipher"] = "aes-256-gcm"
<del> @request.env["action_dispatch.cookies_rotations"].rotate :encrypted,
<del> raw_key: raw_key, cipher: "aes-256-gcm"
<add> @request.env["action_dispatch.cookies_rotations"].rotate :encrypted, secret
<ide>
<ide> key_len = ActiveSupport::MessageEncryptor.key_len("aes-256-gcm")
<ide>
<del> old_message = ActiveSupport::MessageEncryptor.new(raw_key, cipher: "aes-256-gcm", serializer: Marshal).encrypt_and_sign(45)
<add> old_message = ActiveSupport::MessageEncryptor.new(secret, cipher: "aes-256-gcm", serializer: Marshal).encrypt_and_sign(45)
<ide>
<ide> @request.headers["Cookie"] = "foo=#{::Rack::Utils.escape old_message}"
<ide>
<ide><path>activesupport/lib/active_support/messages/rotation_configuration.rb
<ide> def initialize
<ide> @signed, @encrypted = [], []
<ide> end
<ide>
<del> def rotate(kind = nil, **options)
<add> def rotate(kind = nil, *args)
<ide> case kind
<ide> when :signed
<del> @signed << options
<add> @signed << args
<ide> when :encrypted
<del> @encrypted << options
<add> @encrypted << args
<ide> else
<del> rotate :signed, options
<del> rotate :encrypted, options
<add> rotate :signed, args
<add> rotate :encrypted, args
<ide> end
<ide> end
<ide> end | 3 |
Python | Python | fix bug in wav2vec2 pretrain example | 48c22691e3512eaf0bbab761cda67ce09b6348ea | <ide><path>examples/research_projects/wav2vec2/run_pretrain.py
<ide> def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) ->
<ide> (batch_size, mask_indices_seq_length),
<ide> self.model.config.mask_time_prob,
<ide> self.model.config.mask_time_length,
<del> device=batch["input_values"].device,
<ide> attention_mask=attention_mask,
<ide> min_masks=2,
<ide> ) | 1 |
PHP | PHP | add cursor to connectioninterface | 2115cf6274f4da1681311700b12416d637517340 | <ide><path>src/Illuminate/Database/ConnectionInterface.php
<ide> public function raw($value);
<ide> *
<ide> * @param string $query
<ide> * @param array $bindings
<add> * @param bool $useReadPdo
<ide> * @return mixed
<ide> */
<del> public function selectOne($query, $bindings = []);
<add> public function selectOne($query, $bindings = [], $useReadPdo = true);
<ide>
<ide> /**
<ide> * Run a select statement against the database.
<ide> *
<ide> * @param string $query
<ide> * @param array $bindings
<add> * @param bool $useReadPdo
<ide> * @return array
<ide> */
<del> public function select($query, $bindings = []);
<add> public function select($query, $bindings = [], $useReadPdo = true);
<add>
<add> /**
<add> * Run a select statement against the database and returns a generator.
<add> *
<add> * @param string $query
<add> * @param array $bindings
<add> * @param bool $useReadPdo
<add> * @return \Generator
<add> */
<add> public function cursor($query, $bindings = [], $useReadPdo = true);
<ide>
<ide> /**
<ide> * Run an insert statement against the database. | 1 |
Go | Go | add missing bounds in continueonerror | 1ebfa299545e5c2273ce449d72b10745b9e38087 | <ide><path>registry/registry.go
<ide> func (e ErrNoSupport) Error() string {
<ide> func ContinueOnError(err error) bool {
<ide> switch v := err.(type) {
<ide> case errcode.Errors:
<add> if len(v) == 0 {
<add> return true
<add> }
<ide> return ContinueOnError(v[0])
<ide> case ErrNoSupport:
<ide> return ContinueOnError(v.Err) | 1 |
Javascript | Javascript | optimize arrayclone by copying forward | f2f997ad1e416fd5ba295e84139848f77b37c40f | <ide><path>lib/events.js
<ide> function spliceOne(list, index) {
<ide> list.pop();
<ide> }
<ide>
<del>function arrayClone(arr, i) {
<del> var copy = new Array(i);
<del> while (i--)
<add>function arrayClone(arr, n) {
<add> var copy = new Array(n);
<add> for (var i = 0; i < n; ++i)
<ide> copy[i] = arr[i];
<ide> return copy;
<ide> } | 1 |
Python | Python | set version to v2.0.18 | bbaca991baee5d2c21cd48a9da535b7d2144ecda | <ide><path>spacy/about.py
<ide> # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
<ide>
<ide> __title__ = 'spacy'
<del>__version__ = '2.0.18.dev1'
<add>__version__ = '2.0.18'
<ide> __summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython'
<ide> __uri__ = 'https://spacy.io'
<ide> __author__ = 'Explosion AI'
<ide> __email__ = '[email protected]'
<ide> __license__ = 'MIT'
<del>__release__ = False
<add>__release__ = True
<ide>
<ide> __download_url__ = 'https://github.com/explosion/spacy-models/releases/download'
<ide> __compatibility__ = 'https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json' | 1 |
Javascript | Javascript | use tmpdir in test-fs-utimes | da7b4a9d161d7b55b6c3b3adf56e32219e580412 | <ide><path>test/parallel/test-fs-utimes.js
<ide> const assert = require('assert');
<ide> const util = require('util');
<ide> const fs = require('fs');
<ide>
<add>common.refreshTmpDir();
<add>
<ide> let tests_ok = 0;
<ide> let tests_run = 0;
<ide>
<ide> function expect_ok(syscall, resource, err, atime, mtime) {
<ide> }
<ide> }
<ide>
<del>// the tests assume that __filename belongs to the user running the tests
<del>// this should be a fairly safe assumption; testing against a temp file
<del>// would be even better though (node doesn't have such functionality yet)
<ide> function testIt(atime, mtime, callback) {
<ide>
<ide> let fd;
<ide> //
<ide> // test synchronized code paths, these functions throw on failure
<ide> //
<ide> function syncTests() {
<del> fs.utimesSync(__filename, atime, mtime);
<del> expect_ok('utimesSync', __filename, undefined, atime, mtime);
<add> fs.utimesSync(common.tmpDir, atime, mtime);
<add> expect_ok('utimesSync', common.tmpDir, undefined, atime, mtime);
<ide> tests_run++;
<ide>
<ide> // some systems don't have futimes
<ide> function testIt(atime, mtime, callback) {
<ide> //
<ide> // test async code paths
<ide> //
<del> fs.utimes(__filename, atime, mtime, common.mustCall(function(err) {
<del> expect_ok('utimes', __filename, err, atime, mtime);
<add> fs.utimes(common.tmpDir, atime, mtime, common.mustCall(function(err) {
<add> expect_ok('utimes', common.tmpDir, err, atime, mtime);
<ide>
<ide> fs.utimes('foobarbaz', atime, mtime, common.mustCall(function(err) {
<ide> expect_errno('utimes', 'foobarbaz', err, 'ENOENT');
<ide>
<ide> // don't close this fd
<ide> if (common.isWindows) {
<del> fd = fs.openSync(__filename, 'r+');
<add> fd = fs.openSync(common.tmpDir, 'r+');
<ide> } else {
<del> fd = fs.openSync(__filename, 'r');
<add> fd = fs.openSync(common.tmpDir, 'r');
<ide> }
<ide>
<ide> fs.futimes(fd, atime, mtime, common.mustCall(function(err) {
<ide> function testIt(atime, mtime, callback) {
<ide> tests_run++;
<ide> }
<ide>
<del>const stats = fs.statSync(__filename);
<add>const stats = fs.statSync(common.tmpDir);
<ide>
<ide> // run tests
<ide> const runTest = common.mustCall(testIt, 6);
<ide> process.on('exit', function() {
<ide>
<ide>
<ide> // Ref: https://github.com/nodejs/node/issues/13255
<del>common.refreshTmpDir();
<ide> const path = `${common.tmpDir}/test-utimes-precision`;
<ide> fs.writeFileSync(path, '');
<ide> | 1 |
PHP | PHP | add the ability to set a callable response body | c37930b0b0b3da802a48b2f2435320d2a2ad5b37 | <ide><path>src/Network/Response.php
<ide> class Response
<ide> protected $_headers = [];
<ide>
<ide> /**
<del> * Buffer string for response message
<add> * Buffer string or callable for response message
<ide> *
<ide> * @var string
<ide> */
<ide> protected function _sendHeader($name, $value = null)
<ide>
<ide> /**
<ide> * Sends a content string to the client.
<add> * If the content is a callable, it is invoked.
<ide> *
<ide> * @param string $content string to send as response body
<ide> * @return void
<ide> */
<ide> protected function _sendContent($content)
<ide> {
<del> echo $content;
<add> if (!is_string($content) && is_callable($content)) {
<add> call_user_func($content);
<add> } else {
<add> echo $content;
<add> }
<ide> }
<ide>
<ide> /**
<ide> public function location($url = null)
<ide> * Buffers the response message to be sent
<ide> * if $content is null the current buffer is returned
<ide> *
<del> * @param string|null $content the string message to be sent
<add> * @param string|callable|null $content the string or callable message to be sent
<ide> * @return string Current message buffer if $content param is passed as null
<ide> */
<ide> public function body($content = null)
<ide> public function checkNotModified(Request $request)
<ide> /**
<ide> * String conversion. Fetches the response body as a string.
<ide> * Does *not* send headers.
<add> * If body is a callable, a blank string is returned.
<ide> *
<ide> * @return string
<ide> */
<ide> public function __toString()
<ide> {
<add> if (!is_string($this->_body) && is_callable($this->_body)) {
<add> return '';
<add> }
<ide> return (string)$this->_body;
<ide> }
<ide>
<ide><path>tests/TestCase/Network/ResponseTest.php
<ide> public function testSendWithLocation()
<ide> $response->send();
<ide> }
<ide>
<add> /**
<add> * Tests the send method and changing the content type
<add> *
<add> * @return void
<add> */
<add> public function testSendWithCallableBody()
<add> {
<add> $response = $this->getMock('Cake\Network\Response', ['_sendHeader']);
<add> $response->body(function () {
<add> echo 'the response body';
<add> });
<add>
<add> ob_start();
<add> $response->send();
<add> $this->assertEquals('the response body', ob_get_clean());
<add> }
<add>
<ide> /**
<ide> * Tests the disableCache method
<ide> * | 2 |
Javascript | Javascript | add --no-show-signature to "git show" commands | 9a7e6bf0d0cf08114b74c9fe45c06e60a5e496e4 | <ide><path>packages/react-devtools-extensions/utils.js
<ide> const GITHUB_URL = 'https://github.com/facebook/react';
<ide>
<ide> function getGitCommit() {
<ide> try {
<del> return execSync('git show -s --format=%h')
<add> return execSync('git show -s --no-show-signature --format=%h')
<ide> .toString()
<ide> .trim();
<ide> } catch (error) {
<ide><path>scripts/release/utils.js
<ide> const getBuildInfo = async () => {
<ide> const branch = await execRead('git branch | grep \\* | cut -d " " -f2', {
<ide> cwd,
<ide> });
<del> const commit = await execRead('git show -s --format=%h', {cwd});
<add> const commit = await execRead('git show -s --no-show-signature --format=%h', {
<add> cwd,
<add> });
<ide> const checksum = await getChecksumForCurrentRevision(cwd);
<ide> const dateString = await getDateStringForCommit(commit);
<ide> const version = isExperimental
<ide> const getChecksumForCurrentRevision = async cwd => {
<ide>
<ide> const getDateStringForCommit = async commit => {
<ide> let dateString = await execRead(
<del> `git show -s --format=%cd --date=format:%Y%m%d ${commit}`
<add> `git show -s --no-show-signature --format=%cd --date=format:%Y%m%d ${commit}`
<ide> );
<ide>
<ide> // On CI environment, this string is wrapped with quotes '...'s
<ide><path>scripts/rollup/build-all-release-channels.js
<ide> const {
<ide> // by configuring an environment variable.
<ide>
<ide> const sha = String(
<del> spawnSync('git', ['show', '-s', '--format=%h']).stdout
<add> spawnSync('git', ['show', '-s', '--no-show-signature', '--format=%h']).stdout
<ide> ).trim();
<ide>
<ide> let dateString = String(
<del> spawnSync('git', ['show', '-s', '--format=%cd', '--date=format:%Y%m%d', sha])
<del> .stdout
<add> spawnSync('git', [
<add> 'show',
<add> '-s',
<add> '--no-show-signature',
<add> '--format=%cd',
<add> '--date=format:%Y%m%d',
<add> sha,
<add> ]).stdout
<ide> ).trim();
<ide>
<ide> // On CI environment, this string is wrapped with quotes '...'s | 3 |
Ruby | Ruby | ignore files already deleted on gcs file deletions | 390840eb4e219a26278b88df71ab18b6f8f0fe7a | <ide><path>activestorage/lib/active_storage/service/gcs_service.rb
<ide> def download(key)
<ide>
<ide> def delete(key)
<ide> instrument :delete, key do
<del> file_for(key).try(:delete)
<add> begin
<add> file_for(key).try(:delete)
<add> rescue Google::Cloud::NotFoundError
<add> # Ignore files already deleted
<add> end
<ide> end
<ide> end
<ide> | 1 |
PHP | PHP | add support for closures in apc cache driver | ac38876e347be83f3114c69677f1ff795da10304 | <ide><path>system/cache/driver/apc.php
<ide> public function get($key, $default = null)
<ide>
<ide> if ($cache === false)
<ide> {
<del> return $default;
<add> return is_callable($default) ? call_user_func($default) : $default;
<ide> }
<ide>
<ide> return $this->items[$key] = $cache; | 1 |
Javascript | Javascript | remove unused code in `jqlitebuildfragment()` | 2e0e77ee80236a841085a599c800bd2c9695475e | <ide><path>src/jqLite.js
<ide> function jqLiteBuildFragment(html, context) {
<ide> nodes.push(context.createTextNode(html));
<ide> } else {
<ide> // Convert html into DOM nodes
<del> tmp = tmp || fragment.appendChild(context.createElement("div"));
<add> tmp = fragment.appendChild(context.createElement("div"));
<ide> tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
<ide> wrap = wrapMap[tag] || wrapMap._default;
<ide> tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1></$2>") + wrap[2]; | 1 |
Text | Text | add a pre-trained resnet-50 checkpoint | dfc77845e79b476c0af00e9cf61bbac8a8c271af | <ide><path>official/resnet/README.md
<ide> python imagenet_main.py --data_dir=/path/to/imagenet
<ide> The model will begin training and will automatically evaluate itself on the validation data roughly once per epoch.
<ide>
<ide> Note that there are a number of other options you can specify, including `--model_dir` to choose where to store the model and `--resnet_size` to choose the model size (options include ResNet-18 through ResNet-200). See [`imagenet_main.py`](imagenet_main.py) for the full list of options.
<add>
<add>### Pre-trained model
<add>You can download a 190 MB pre-trained version of ResNet-50 achieving 75.3% top-1 single-crop accuracy here: [resnet50_2017_11_30.tar.gz](http://download.tensorflow.org/models/official/resnet50_2017_11_30.tar.gz). Simply download and uncompress the file, and point the model to the extracted directory using the `--model_dir` flag. | 1 |
Text | Text | translate 10.3 to korean | c24e5926b9aeddec0860b577b515e51e466949c8 | <ide><path>docs/docs/10.3-class-name-manipulation.ko-KR.md
<add>---
<add>id: class-name-manipulation-ko-KR
<add>title: ํด๋์ค ์ด๋ฆ ์กฐ์
<add>permalink: class-name-manipulation-ko-KR.html
<add>prev: two-way-binding-helpers-ko-KR.html
<add>next: test-utils-ko-KR.html
<add>---
<add>
<add>> ์ฃผ์:
<add>>
<add>> ์ด ๋ชจ๋์ ์ด์ [JedWatson/classnames](https://github.com/JedWatson/classnames)์ ๋
๋ฆฝ์ ์ผ๋ก ์๊ณ React์ ๊ด๋ จ์์ต๋๋ค. ๊ทธ๋ฌ๋ฏ๋ก ์ด ์๋์จ์ ์ ๊ฑฐ๋ ์์ ์
๋๋ค.
<add>
<add>`classSet()`์ ๊ฐ๋จํ DOM `class` ๋ฌธ์์ด์ ์กฐ์ํ๋ ํธ๋ฆฌํ ๋๊ตฌ์
๋๋ค.
<add>
<add>์ผ๋ฐ์ ์ผ๋ก ์์๋ฒํ ๊ฒฝ์ฐ์ `classSet()`์ ์ฌ์ฉํ์ง ์์์ ๋์ ์ฒ๋ฆฌ๋ฒ์ ๋ณด์์ฃ .
<add>
<add>```javascript
<add>// ์ด๋ค `<Message />` React ์ปดํฌ๋ํธ์ ์์ชฝ
<add>render: function() {
<add> var classString = 'message';
<add> if (this.props.isImportant) {
<add> classString += ' message-important';
<add> }
<add> if (this.props.isRead) {
<add> classString += ' message-read';
<add> }
<add> // 'message message-important message-read'
<add> return <div className={classString}>Great, I'll be there.</div>;
<add>}
<add>```
<add>
<add>์ด๊ฒ์ ์์๊ฐ์ ์ฅํฉํด์ง ์ ์์ต๋๋ค. ํด๋์ค ์ด๋ฆ ๋ฌธ์์ด์ ์ฝ๊ธฐ ์ด๋ ต๊ณ ์๋ฌ๊ฐ ๋ฐ์ํ๊ธฐ ์ฝ๊ธฐ๋ ํ์ฃ . `classSet()`๊ฐ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค.
<add>
<add>```javascript
<add>render: function() {
<add> var cx = React.addons.classSet;
<add> var classes = cx({
<add> 'message': true,
<add> 'message-important': this.props.isImportant,
<add> 'message-read': this.props.isRead
<add> });
<add> // ์ต์ข
๋ฌธ์์ด์ ๋์ผํ์ง๋ง, ํจ์ฌ ๊น๋ํจ
<add> return <div className={classes}>Great, I'll be there.</div>;
<add>}
<add>```
<add>
<add>`classSet()`์ ์ฌ์ฉํ ๋ ์ฌ์ฉํ ์ง ์ํ ์ง ์๋ชจ๋ฅด๋ CSS ํด๋์ค ์ด๋ฆ ํค์ ํจ๊ป ๊ฐ์ฒด๋ฅผ ์ ๋ฌํฉ๋๋ค. true๋ก ๊ฐ์ฃผ๋๋(Truthy) ๊ฐ์ ํค๋ฅผ ๊ฒฐ๊ณผ ๋ฌธ์์ด์ ์ผ๋ถ๋ก ๋ง๋ญ๋๋ค.
<add>
<add>`classSet()`์ ํด๋์ค ์ด๋ฆ์ ์ธ์๋ก ๋๊ฒจ ์ฐ๊ฒฐ๋๊ฒ ํ ์๋ ์์ต๋๋ค.
<add>
<add>```javascript
<add>render: function() {
<add> var cx = React.addons.classSet;
<add> var importantModifier = 'message-important';
<add> var readModifier = 'message-read';
<add> var classes = cx('message', importantModifier, readModifier);
<add> // ์ต์ข
๋ฌธ์์ด์ 'message message-important message-read'
<add> return <div className={classes}>Great, I'll be there.</div>;
<add>}
<add>```
<add>
<add>๋ณต์กํ ๋ฌธ์์ด ์ฐ๊ฒฐ์ ์ด์ ์ํ์
๋ ๋ฉ๋๋ค! | 1 |
Javascript | Javascript | remove useless guard for `a`. close gh-918 | c79a533ffd3e063a498fde6bdb1b934c7b4b47ab | <ide><path>src/support.js
<ide> jQuery.support = (function() {
<ide> a.style.cssText = "top:1px;float:left;opacity:.5";
<ide>
<ide> // Can't get basic test support
<del> if ( !all || !all.length || !a ) {
<add> if ( !all || !all.length ) {
<ide> return {};
<ide> }
<ide> | 1 |
Javascript | Javascript | update timeout for plugin-mdx test | d9c462bf379709db8070ff19217b12149f97b63f | <ide><path>test/integration/plugin-mdx/test/index.test.js
<ide> /* eslint-env jest */
<add>/* global jasmine */
<ide> import { join } from 'path'
<ide> import {
<ide> renderViaHTTP,
<ide> import {
<ide> } from 'next-test-utils'
<ide>
<ide> const context = {}
<add>jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5
<ide>
<ide> describe('Configuration', () => {
<ide> beforeAll(async () => { | 1 |
Text | Text | discuss benefits of putting logic in reducers | ab5c9593bc304880c3089fc0bfcc2c3a28fd21d3 | <ide><path>docs/faq/CodeStructure.md
<ide> While it ultimately doesn't matter how you lay out your code on disk, it's impor
<ide>
<ide> There's no single clear answer to exactly what pieces of logic should go in a reducer or an action creator. Some developers prefer to have โfatโ action creators, with โthinโ reducers that simply take the data in an action and blindly merge it into the corresponding state. Others try to emphasize keeping actions as small as possible, and minimize the usage of `getState()` in an action creator. (For purposes of this question, other async approaches such as sagas and observables fall in the "action creator" category.)
<ide>
<add>There are some potential benefits from putting more logic into your reducers. It's likely that the action types would be more semantic and more meaningful (such as `"USER_UPDATED"` instead of `"SET_STATE"`). In addition, having more logic in reducers means that more functionality will be affected by time travel debugging.
<add>
<ide> This comment sums up the dichotomy nicely:
<ide>
<ide> > Now, the problem is what to put in the action creator and what in the reducer, the choice between fat and thin action objects. If you put all the logic in the action creator, you end up with fat action objects that basically declare the updates to the state. Reducers become pure, dumb, add-this, remove that, update these functions. They will be easy to compose. But not much of your business logic will be there.
<ide> Find the balance between these two extremes, and you will master Redux.
<ide>
<ide> **Discussions**
<ide> - [How putting too much logic in action creators could affect debugging](https://github.com/reactjs/redux/issues/384#issuecomment-127393209)
<add>- [#384: The more that's in a reducer, the more you can replay via time travel](https://github.com/reactjs/redux/issues/384#issuecomment-127393209)
<ide> - [#1165: Where to put business logic / validation?](https://github.com/reactjs/redux/issues/1165)
<ide> - [#1171: Recommendations for best practices regarding action-creators, reducers, and selectors](https://github.com/reactjs/redux/issues/1171)
<ide> - [Stack Overflow: Accessing Redux state in an action creator?](http://stackoverflow.com/questions/35667249/accessing-redux-state-in-an-action-creator/35674575) | 1 |
Go | Go | fix regression with add of tar files | cad7f7ee5002206511daee4a29f399e6665f5fab | <ide><path>buildfile.go
<ide> func (b *buildFile) addContext(container *Container, orig, dest string) error {
<ide> }
<ide> return err
<ide> }
<add>
<ide> if fi.IsDir() {
<ide> if err := archive.CopyWithTar(origPath, destPath); err != nil {
<ide> return err
<ide> }
<del> // First try to unpack the source as an archive
<del> } else if err := archive.UntarPath(origPath, destPath); err != nil {
<del> utils.Debugf("Couldn't untar %s to %s: %s", origPath, destPath, err)
<del> // If that fails, just copy it as a regular file
<del> if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil {
<del> return err
<del> }
<del> if err := archive.CopyWithTar(origPath, destPath); err != nil {
<del> return err
<del> }
<add> return nil
<add> }
<add>
<add> // First try to unpack the source as an archive
<add> // to support the untar feature we need to clean up the path a little bit
<add> // because tar is very forgiving. First we need to strip off the archive's
<add> // filename from the path but this is only added if it does not end in / .
<add> tarDest := destPath
<add> if strings.HasSuffix(tarDest, "/") {
<add> tarDest = filepath.Dir(destPath)
<add> }
<add>
<add> // try to successfully untar the orig
<add> if err := archive.UntarPath(origPath, tarDest); err == nil {
<add> return nil
<add> }
<add> utils.Debugf("Couldn't untar %s to %s: %s", origPath, destPath, err)
<add>
<add> // If that fails, just copy it as a regular file
<add> // but do not use all the magic path handling for the tar path
<add> if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil {
<add> return err
<add> }
<add> if err := archive.CopyWithTar(origPath, destPath); err != nil {
<add> return err
<ide> }
<ide> return nil
<ide> } | 1 |
Javascript | Javascript | remove params from createtexture | 131212ae616a5664870d2e7a8a787683e1cbf197 | <ide><path>examples/js/GPUComputationRenderer.js
<ide> function GPUComputationRenderer( sizeX, sizeY, renderer ) {
<ide>
<ide> };
<ide>
<del> this.createTexture = function( sizeXTexture, sizeYTexture ) {
<add> this.createTexture = function() {
<ide>
<del> sizeXTexture = sizeXTexture || sizeX;
<del> sizeYTexture = sizeYTexture || sizeY;
<del>
<del> var a = new Float32Array( sizeXTexture * sizeYTexture * 4 );
<del> var texture = new THREE.DataTexture( a, sizeXTexture, sizeYTexture, THREE.RGBAFormat, THREE.FloatType );
<add> var a = new Float32Array( sizeX * sizeY * 4 );
<add> var texture = new THREE.DataTexture( a, sizeX, sizeY, THREE.RGBAFormat, THREE.FloatType );
<ide> texture.needsUpdate = true;
<ide>
<ide> return texture; | 1 |
PHP | PHP | return new exception | 1e4f5b8af243fb95230b39f49a6cf5341d975df9 | <ide><path>src/Illuminate/Database/Eloquent/RelationNotFoundException.php
<ide> public static function make($model, $relation)
<ide> {
<ide> $class = get_class($model);
<ide>
<del> throw new static("Call to undefined relationship [{$relation}] on model [{$class}].");
<add> return new static("Call to undefined relationship [{$relation}] on model [{$class}].");
<ide> }
<ide> } | 1 |
PHP | PHP | improve columndefinition | b4ddc72e9b48e460222277bde5afda2b73830fcc | <ide><path>src/Illuminate/Database/Schema/ColumnDefinition.php
<ide> * @method ColumnDefinition collation(string $collation) Specify a collation for the column (MySQL/SQL Server)
<ide> * @method ColumnDefinition comment(string $comment) Add a comment to the column (MySQL)
<ide> * @method ColumnDefinition default(mixed $value) Specify a "default" value for the column
<del> * @method ColumnDefinition first(string $column) Place the column "first" in the table (MySQL)
<add> * @method ColumnDefinition first() Place the column "first" in the table (MySQL)
<ide> * @method ColumnDefinition nullable($value = true) Allow NULL values to be inserted into the column
<ide> * @method ColumnDefinition storedAs($expression) Create a stored generated column (MySQL)
<ide> * @method ColumnDefinition unique() Add a unique index
<ide> * @method ColumnDefinition generatedAs($expression) Create a SQL compliant identity column (PostgreSQL)
<ide> * @method ColumnDefinition always() Used as a modifier for generatedAs() (PostgreSQL)
<ide> * @method ColumnDefinition index() Add an index
<add> * @method ColumnDefinition change() Change the column
<ide> */
<ide> class ColumnDefinition extends Fluent
<ide> { | 1 |
Javascript | Javascript | remove old license information | 504239050c74a50afa4710c58aa8cc072cb6327b | <ide><path>server/boot/challenge.js
<del>/**
<del> * Created by nathanleniz on 5/15/15.
<del> * Copyright (c) 2015, Free Code Camp
<del> All rights reserved.
<del>
<del> Redistribution and use in source and binary forms, with or without
<del> modification, are permitted provided that the following conditions are met:
<del>
<del> 1. Redistributions of source code must retain the above copyright notice,
<del> this list of conditions and the following disclaimer.
<del>
<del> 2. Redistributions in binary form must reproduce the above copyright notice,
<del> this list of conditions and the following disclaimer in the documentation
<del> and/or other materials provided with the distribution.
<del>
<del> 3. Neither the name of the copyright holder nor the names of its contributors
<del> may be used to endorse or promote products derived from this software
<del> without specific prior written permission.
<del>
<del> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<del> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<del> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
<del> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
<del> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
<del> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
<del> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
<del> BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
<del> WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
<del> OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
<del> EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<del> */
<del>
<ide> var R = require('ramda'),
<ide> Rx = require('rx'),
<ide> assign = require('object.assign'), | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.