content_type stringclasses 8 values | main_lang stringclasses 7 values | message stringlengths 1 50 | sha stringlengths 40 40 | patch stringlengths 52 962k | file_count int64 1 300 |
|---|---|---|---|---|---|
Go | Go | fix -link parsing | 0d078b65817fc91eba916652b3f087a6c2eef851 | <ide><path>commands.go
<ide> func (opts AttachOpts) Set(val string) error {
<ide> // LinkOpts stores arguments to `docker run -link`
<ide> type LinkOpts []string
<ide>
<del>func (link LinkOpts) String() string { return fmt.Sprintf("%v", []string(link)) }
<del>func (link LinkOpts) Set(val string) error {
<add>func (link *LinkOpts) String() string { return fmt.Sprintf("%v", []string(*link)) }
<add>func (link *LinkOpts) Set(val string) error {
<ide> if _, err := parseLink(val); err != nil {
<ide> return err
<ide> }
<add> *link = append(*link, val)
<ide> return nil
<ide> }
<ide>
<ide> func parseRun(cmd *flag.FlagSet, args []string, capabilities *Capabilities) (*Co
<ide>
<ide> cmd.Var(flAttach, "a", "Attach to stdin, stdout or stderr.")
<ide> cmd.Var(flVolumes, "v", "Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)")
<del> cmd.Var(flLinks, "link", "Add link to another container (name:alias)")
<add> cmd.Var(&flLinks, "link", "Add link to another container (name:alias)")
<ide>
<ide> cmd.Var(&flPublish, "p", fmt.Sprintf("Publish a container's port to the host (format: %s) (use 'docker port' to see the actual mapping)", PortSpecTemplateFormat))
<ide> cmd.Var(&flExpose, "expose", "Expose a port from the container without publishing it to your host") | 1 |
Java | Java | fix refreshcontrol race condition | bb5aede6e320084b1aee04f8b61089e5578fd4da | <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java
<ide>
<ide> import com.facebook.react.bridge.ReactContext;
<ide> import com.facebook.react.uimanager.events.NativeGestureUtil;
<add>import com.facebook.react.uimanager.PixelUtil;
<ide>
<ide> /**
<ide> * Basic extension of {@link SwipeRefreshLayout} with ReactNative-specific functionality.
<ide> */
<ide> public class ReactSwipeRefreshLayout extends SwipeRefreshLayout {
<ide>
<add> private static final float DEFAULT_CIRCLE_TARGET = 64;
<add>
<add> private boolean mDidLayout = false;
<add>
<add> private boolean mRefreshing = false;
<add> private float mProgressViewOffset = 0;
<add>
<add>
<ide> public ReactSwipeRefreshLayout(ReactContext reactContext) {
<ide> super(reactContext);
<ide> }
<ide>
<add> @Override
<add> public void setRefreshing(boolean refreshing) {
<add> mRefreshing = refreshing;
<add>
<add> // `setRefreshing` must be called after the initial layout otherwise it
<add> // doesn't work when mounting the component with `refreshing = true`.
<add> // Known Android issue: https://code.google.com/p/android/issues/detail?id=77712
<add> if (mDidLayout) {
<add> super.setRefreshing(refreshing);
<add> }
<add> }
<add>
<add> public void setProgressViewOffset(float offset) {
<add> mProgressViewOffset = offset;
<add>
<add> // The view must be measured before calling `getProgressCircleDiameter` so
<add> // don't do it before the initial layout.
<add> if (mDidLayout) {
<add> int diameter = getProgressCircleDiameter();
<add> int start = Math.round(PixelUtil.toPixelFromDIP(offset)) - diameter;
<add> int end = Math.round(PixelUtil.toPixelFromDIP(offset + DEFAULT_CIRCLE_TARGET) - diameter);
<add> setProgressViewOffset(false, start, end);
<add> }
<add> }
<add>
<add> @Override
<add> public void onLayout(boolean changed, int left, int top, int right, int bottom) {
<add> super.onLayout(changed, left, top, right, bottom);
<add>
<add> if (!mDidLayout) {
<add> mDidLayout = true;
<add>
<add> // Update values that must be set after initial layout.
<add> setProgressViewOffset(mProgressViewOffset);
<add> setRefreshing(mRefreshing);
<add> }
<add> }
<add>
<ide> @Override
<ide> public boolean onInterceptTouchEvent(MotionEvent ev) {
<ide> if (super.onInterceptTouchEvent(ev)) {
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java
<ide> import com.facebook.react.bridge.ReadableArray;
<ide> import com.facebook.react.common.MapBuilder;
<ide> import com.facebook.react.common.SystemClock;
<del>import com.facebook.react.uimanager.PixelUtil;
<ide> import com.facebook.react.uimanager.ThemedReactContext;
<ide> import com.facebook.react.uimanager.UIManagerModule;
<ide> import com.facebook.react.uimanager.ViewGroupManager;
<ide> */
<ide> public class SwipeRefreshLayoutManager extends ViewGroupManager<ReactSwipeRefreshLayout> {
<ide>
<del> public static final float REFRESH_TRIGGER_DISTANCE = 48;
<del>
<ide> @Override
<ide> protected ReactSwipeRefreshLayout createViewInstance(ThemedReactContext reactContext) {
<ide> return new ReactSwipeRefreshLayout(reactContext);
<ide> public void setSize(ReactSwipeRefreshLayout view, int size) {
<ide> }
<ide>
<ide> @ReactProp(name = "refreshing")
<del> public void setRefreshing(final ReactSwipeRefreshLayout view, final boolean refreshing) {
<del> // Use `post` otherwise the control won't start refreshing if refreshing is true when
<del> // the component gets mounted.
<del> view.post(new Runnable() {
<del> @Override
<del> public void run() {
<del> view.setRefreshing(refreshing);
<del> }
<del> });
<add> public void setRefreshing(ReactSwipeRefreshLayout view, boolean refreshing) {
<add> view.setRefreshing(refreshing);
<ide> }
<ide>
<ide> @ReactProp(name = "progressViewOffset", defaultFloat = 0)
<ide> public void setProgressViewOffset(final ReactSwipeRefreshLayout view, final float offset) {
<del> // Use `post` to get progress circle diameter properly
<del> // Otherwise returns 0
<del> view.post(new Runnable() {
<del> @Override
<del> public void run() {
<del> int diameter = view.getProgressCircleDiameter();
<del> int start = Math.round(PixelUtil.toPixelFromDIP(offset)) - diameter;
<del> int end = Math.round(PixelUtil.toPixelFromDIP(offset + REFRESH_TRIGGER_DISTANCE));
<del> view.setProgressViewOffset(false, start, end);
<del> }
<del> });
<add> view.setProgressViewOffset(offset);
<ide> }
<ide>
<ide> @Override | 2 |
Text | Text | update the api reference | 2d5a1eeafd2f2f25f16df970b30f6d751061ef77 | <ide><path>API.md
<ide> D3 4.0 is a [collection of modules](https://github.com/d3) that are designed to
<ide> * [Easings](#easings-d3-ease)
<ide> * [Forces](#forces-d3-force)
<ide> * [Number Formats](#number-formats-d3-format)
<del>* [Geographies](#geographies-d3-geo)
<add>* [Geographies](#geographies-d3-geo) ([Paths](#paths), [Projections](#projections), [Spherical Math](#spherical-math), [Spherical Shapes](#spherical-shapes), [Streams](#streams), [Transforms](#transforms))
<ide> * [Hierarchies](#hierarchies-d3-hierarchy)
<ide> * [Interpolators](#interpolators-d3-interpolate)
<ide> * [Paths](#paths-d3-path)
<ide> Format numbers for human consumption.
<ide>
<ide> Geographic projections, shapes and math.
<ide>
<del>### [Spherical Math](https://github.com/d3/d3-geo/blob/master/README.md#spherical-math)
<del>
<del>* [d3.geoArea](https://github.com/d3/d3-geo/blob/master/README.md#geoArea) - compute the spherical area of a given feature.
<del>* [d3.geoBounds](https://github.com/d3/d3-geo/blob/master/README.md#geoBounds) - compute the latitude-longitude bounding box for a given feature.
<del>* [d3.geoCentroid](https://github.com/d3/d3-geo/blob/master/README.md#geoCentroid) - compute the spherical centroid of a given feature.
<del>* [d3.geoDistance](https://github.com/d3/d3-geo/blob/master/README.md#geoDistance) - compute the great-arc distance between two points.
<del>* [d3.geoLength](https://github.com/d3/d3-geo/blob/master/README.md#geoLength) - compute the length of a line string or the perimeter of a polygon.
<del>* [d3.geoInterpolate](https://github.com/d3/d3-geo/blob/master/README.md#geoInterpolate) - interpolate between two points along a great arc.
<del>* [d3.geoRotation](https://github.com/d3/d3-geo/blob/master/README.md#geoRotation) - create a rotation function for the specified angles.
<del>* [*rotation*](https://github.com/d3/d3-geo/blob/master/README.md#_rotation) - rotate the given point around the sphere.
<del>* [*rotation*.invert](https://github.com/d3/d3-geo/blob/master/README.md#rotation_invert) - unrotate the given point around the sphere.
<del>
<del>### [Spherical Shapes](https://github.com/d3/d3-geo/blob/master/README.md#spherical-shapes)
<del>
<del>* [d3.geoCircle](https://github.com/d3/d3-geo/blob/master/README.md#geoCircle) - create a circle generator.
<del>* [*circle*](https://github.com/d3/d3-geo/blob/master/README.md#_circle) - generate a piecewise circle as a Polygon.
<del>* [*circle*.center](https://github.com/d3/d3-geo/blob/master/README.md#circle_center) - specify the circle center in latitude and longitude.
<del>* [*circle*.radius](https://github.com/d3/d3-geo/blob/master/README.md#circle_radius) - specify the angular radius in degrees.
<del>* [*circle*.precision](https://github.com/d3/d3-geo/blob/master/README.md#circle_precision) - specify the precision of the piecewise circle.
<del>* [d3.geoGraticule](https://github.com/d3/d3-geo/blob/master/README.md#geoGraticule) - create a graticule generator.
<del>* [*graticule*](https://github.com/d3/d3-geo/blob/master/README.md#_graticule) - generate a MultiLineString of meridians and parallels.
<del>* [*graticule*.lines](https://github.com/d3/d3-geo/blob/master/README.md#graticule_lines) - generate an array of LineStrings of meridians and parallels.
<del>* [*graticule*.outline](https://github.com/d3/d3-geo/blob/master/README.md#graticule_outline) - generate a Polygon of the graticule’s extent.
<del>* [*graticule*.extent](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extent) - get or set the major & minor extents.
<del>* [*graticule*.extentMajor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extentMajor) - get or set the major extent.
<del>* [*graticule*.extentMinor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extentMinor) - get or set the minor extent.
<del>* [*graticule*.step](https://github.com/d3/d3-geo/blob/master/README.md#graticule_step) - get or set the major & minor step intervals.
<del>* [*graticule*.stepMajor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_stepMajor) - get or set the major step intervals.
<del>* [*graticule*.stepMinor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_stepMinor) - get or set the minor step intervals.
<del>* [*graticule*.precision](https://github.com/d3/d3-geo/blob/master/README.md#graticule_precision) - get or set the latitudinal precision.
<del>
<del>### [Projections](https://github.com/d3/d3-geo/blob/master/README.md#projections)
<add>### [Paths](https://github.com/d3/d3-geo/blob/master/README.md#paths)
<ide>
<ide> * [d3.geoPath](https://github.com/d3/d3-geo/blob/master/README.md#geoPath) - create a new geographic path generator.
<ide> * [*path*](https://github.com/d3/d3-geo/blob/master/README.md#_path) - project and render the specified feature.
<ide> Geographic projections, shapes and math.
<ide> * [*path*.projection](https://github.com/d3/d3-geo/blob/master/README.md#path_projection) - set the geographic projection.
<ide> * [*path*.context](https://github.com/d3/d3-geo/blob/master/README.md#path_context) - set the render context.
<ide> * [*path*.pointRadius](https://github.com/d3/d3-geo/blob/master/README.md#path_pointRadius) - set the radius to display point features.
<del>* [d3.geoProjection](https://github.com/d3/d3-geo/blob/master/README.md#geoProjection) - create a custom projection.
<del>* [d3.geoProjectionMutator](https://github.com/d3/d3-geo/blob/master/README.md#geoProjectionMutator) - create a custom configurable projection.
<add>
<add>### [Projections](https://github.com/d3/d3-geo/blob/master/README.md#projections)
<add>
<ide> * [*projection*](https://github.com/d3/d3-geo/blob/master/README.md#_projection) - project the specified point from the sphere to the plane.
<ide> * [*projection*.invert](https://github.com/d3/d3-geo/blob/master/README.md#projection_invert) - unproject the specified point from the plane to the sphere.
<ide> * [*projection*.stream](https://github.com/d3/d3-geo/blob/master/README.md#projection_stream) - wrap the specified stream to project geometry.
<ide> Geographic projections, shapes and math.
<ide> * [d3.geoConicConformal](https://github.com/d3/d3-geo/blob/master/README.md#geoConicConformal) - the conic conformal projection.
<ide> * [d3.geoConicEqualArea](https://github.com/d3/d3-geo/blob/master/README.md#geoConicEqualArea) - the conic equal-area (Albers) projection.
<ide> * [d3.geoConicEquidistant](https://github.com/d3/d3-geo/blob/master/README.md#geoConicEquidistant) - the conic equidistant projection.
<add>* [*conic*.parallels](https://github.com/d3/d3-geo/blob/master/README.md#conic_parallels) - set the two standard parallels.
<ide> * [d3.geoEquirectangular](https://github.com/d3/d3-geo/blob/master/README.md#geoEquirectangular) - the equirectangular (plate carreé) projection.
<ide> * [d3.geoGnomonic](https://github.com/d3/d3-geo/blob/master/README.md#geoGnomonic) - the gnomonic projection.
<ide> * [d3.geoMercator](https://github.com/d3/d3-geo/blob/master/README.md#geoMercator) - the spherical Mercator projection.
<ide> * [d3.geoOrthographic](https://github.com/d3/d3-geo/blob/master/README.md#geoOrthographic) - the azimuthal orthographic projection.
<ide> * [d3.geoStereographic](https://github.com/d3/d3-geo/blob/master/README.md#geoStereographic) - the azimuthal stereographic projection.
<ide> * [d3.geoTransverseMercator](https://github.com/d3/d3-geo/blob/master/README.md#geoTransverseMercator) - the transverse spherical Mercator projection.
<del>* [*conic*.parallels](https://github.com/d3/d3-geo/blob/master/README.md#conic_parallels) - set the two standard parallels.
<del>* [d3.geoClipExtent](https://github.com/d3/d3-geo/blob/master/README.md#geoClipExtent) - clips geometries to a given rectangular bounding box.
<del>* [*extent*.extent](https://github.com/d3/d3-geo/blob/master/README.md#extent_extent) - set the clip extent.
<del>* [*extent*.stream](https://github.com/d3/d3-geo/blob/master/README.md#extent_stream) - wrap the specified stream to project geometry.
<del>* [d3.geoTransform](https://github.com/d3/d3-geo/blob/master/README.md#geoTransform) - define a custom geometry transform.
<del>* [d3.geoStream](https://github.com/d3/d3-geo/blob/master/README.md#geoStream) - convert a GeoJSON object to a geometry stream.
<del>
<del>#### Raw Projections
<del>
<add>* [*project*](https://github.com/d3/d3-geo/blob/master/README.md#_project) - project the specified point from the sphere to the plane.
<add>* [*project*.invert](https://github.com/d3/d3-geo/blob/master/README.md#project_invert) - unproject the specified point from the plane to the sphere.
<add>* [d3.geoProjection](https://github.com/d3/d3-geo/blob/master/README.md#geoProjection) - create a custom projection.
<add>* [d3.geoProjectionMutator](https://github.com/d3/d3-geo/blob/master/README.md#geoProjectionMutator) - create a custom configurable projection.
<ide> * [d3.geoAzimuthalEqualAreaRaw](https://github.com/d3/d3-geo/blob/master/README.md#geoAzimuthalEqualAreaRaw) -
<ide> * [d3.geoAzimuthalEquidistantRaw](https://github.com/d3/d3-geo/blob/master/README.md#geoAzimuthalEquidistantRaw) -
<ide> * [d3.geoConicConformalRaw](https://github.com/d3/d3-geo/blob/master/README.md#geoConicConformalRaw) -
<ide> Geographic projections, shapes and math.
<ide> * [d3.geoStereographicRaw](https://github.com/d3/d3-geo/blob/master/README.md#geoStereographicRaw) -
<ide> * [d3.geoTransverseMercatorRaw](https://github.com/d3/d3-geo/blob/master/README.md#geoTransverseMercatorRaw) -
<ide>
<add>### [Spherical Math](https://github.com/d3/d3-geo/blob/master/README.md#spherical-math)
<add>
<add>* [d3.geoArea](https://github.com/d3/d3-geo/blob/master/README.md#geoArea) - compute the spherical area of a given feature.
<add>* [d3.geoBounds](https://github.com/d3/d3-geo/blob/master/README.md#geoBounds) - compute the latitude-longitude bounding box for a given feature.
<add>* [d3.geoCentroid](https://github.com/d3/d3-geo/blob/master/README.md#geoCentroid) - compute the spherical centroid of a given feature.
<add>* [d3.geoDistance](https://github.com/d3/d3-geo/blob/master/README.md#geoDistance) - compute the great-arc distance between two points.
<add>* [d3.geoLength](https://github.com/d3/d3-geo/blob/master/README.md#geoLength) - compute the length of a line string or the perimeter of a polygon.
<add>* [d3.geoInterpolate](https://github.com/d3/d3-geo/blob/master/README.md#geoInterpolate) - interpolate between two points along a great arc.
<add>* [d3.geoRotation](https://github.com/d3/d3-geo/blob/master/README.md#geoRotation) - create a rotation function for the specified angles.
<add>* [*rotation*](https://github.com/d3/d3-geo/blob/master/README.md#_rotation) - rotate the given point around the sphere.
<add>* [*rotation*.invert](https://github.com/d3/d3-geo/blob/master/README.md#rotation_invert) - unrotate the given point around the sphere.
<add>
<add>### [Spherical Shapes](https://github.com/d3/d3-geo/blob/master/README.md#spherical-shapes)
<add>
<add>* [d3.geoCircle](https://github.com/d3/d3-geo/blob/master/README.md#geoCircle) - create a circle generator.
<add>* [*circle*](https://github.com/d3/d3-geo/blob/master/README.md#_circle) - generate a piecewise circle as a Polygon.
<add>* [*circle*.center](https://github.com/d3/d3-geo/blob/master/README.md#circle_center) - specify the circle center in latitude and longitude.
<add>* [*circle*.radius](https://github.com/d3/d3-geo/blob/master/README.md#circle_radius) - specify the angular radius in degrees.
<add>* [*circle*.precision](https://github.com/d3/d3-geo/blob/master/README.md#circle_precision) - specify the precision of the piecewise circle.
<add>* [d3.geoGraticule](https://github.com/d3/d3-geo/blob/master/README.md#geoGraticule) - create a graticule generator.
<add>* [*graticule*](https://github.com/d3/d3-geo/blob/master/README.md#_graticule) - generate a MultiLineString of meridians and parallels.
<add>* [*graticule*.lines](https://github.com/d3/d3-geo/blob/master/README.md#graticule_lines) - generate an array of LineStrings of meridians and parallels.
<add>* [*graticule*.outline](https://github.com/d3/d3-geo/blob/master/README.md#graticule_outline) - generate a Polygon of the graticule’s extent.
<add>* [*graticule*.extent](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extent) - get or set the major & minor extents.
<add>* [*graticule*.extentMajor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extentMajor) - get or set the major extent.
<add>* [*graticule*.extentMinor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extentMinor) - get or set the minor extent.
<add>* [*graticule*.step](https://github.com/d3/d3-geo/blob/master/README.md#graticule_step) - get or set the major & minor step intervals.
<add>* [*graticule*.stepMajor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_stepMajor) - get or set the major step intervals.
<add>* [*graticule*.stepMinor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_stepMinor) - get or set the minor step intervals.
<add>* [*graticule*.precision](https://github.com/d3/d3-geo/blob/master/README.md#graticule_precision) - get or set the latitudinal precision.
<add>* [d3.geoGraticule10](https://github.com/d3/d3-geo/blob/master/README.md#geoGraticule10) - generate the default 10° global graticule.
<add>
<add>#### [Streams](https://github.com/d3/d3-geo/blob/master/README.md#streams)
<add>
<add>* [d3.geoStream](https://github.com/d3/d3-geo/blob/master/README.md#geoStream) - convert a GeoJSON object to a geometry stream.
<add>* [*stream*.point](https://github.com/d3/d3-geo/blob/master/README.md#stream_point) -
<add>* [*stream*.lineStart](https://github.com/d3/d3-geo/blob/master/README.md#stream_lineStart) -
<add>* [*stream*.lineEnd](https://github.com/d3/d3-geo/blob/master/README.md#stream_lineEnd) -
<add>* [*stream*.polygonStart](https://github.com/d3/d3-geo/blob/master/README.md#stream_polygonStart) -
<add>* [*stream*.polygonEnd](https://github.com/d3/d3-geo/blob/master/README.md#stream_polygonEnd) -
<add>* [*stream*.sphere](https://github.com/d3/d3-geo/blob/master/README.md#stream_sphere) -
<add>
<add>#### [Transforms](https://github.com/d3/d3-geo/blob/master/README.md#transforms)
<add>
<add>* [d3.geoIdentity](https://github.com/d3/d3-geo/blob/master/README.md#geoIdentity) - scale, translate or clip planar geometry.
<add>* [d3.geoTransform](https://github.com/d3/d3-geo/blob/master/README.md#geoTransform) - define a custom geometry transform.
<add>
<ide> ## [Hierarchies (d3-hierarchy)](https://github.com/d3/d3-hierarchy)
<ide>
<ide> Layout algorithms for visualizing hierarchical data.
<ide> Compute the Voronoi diagram of a given set of points.
<ide> * [*voronoi*.y](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_y) - set the *y* accessor.
<ide> * [*voronoi*.extent](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_extent) - set the observed extent of points.
<ide> * [*voronoi*.size](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_size) - set the observed extent of points.
<add>* [*diagram*.polygons](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_polygons) - compute the polygons for this Voronoi diagram.
<add>* [*diagram*.triangles](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_triangles) - compute the triangles for this Voronoi diagram.
<add>* [*diagram*.links](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_links) - compute the links for this Voronoi diagram.
<add>* [*diagram*.find](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_find) - find the closest point in this Voronoi diagram.
<ide>
<ide> ## [Zooming (d3-zoom)](https://github.com/d3/d3-zoom)
<ide> | 1 |
Text | Text | clarify subheadline of maintenance policy | 8ea354304fa0ae160545eadcd761a3433f447d5a | <ide><path>guides/source/maintenance_policy.md
<ide> Maintenance Policy for Ruby on Rails
<ide>
<ide> Support of the Rails framework is divided into four groups: New features, bug
<ide> fixes, security issues, and severe security issues. They are handled as
<del>follows, all versions in `X.Y.Z` format.
<add>follows, all versions, except for security releases, in `X.Y.Z`, format.
<ide>
<ide> --------------------------------------------------------------------------------
<ide> | 1 |
Ruby | Ruby | add set_acitve_spec method | 21eecbf1d6cfa162b50bf0fc2dd4aed259c5d3c2 | <ide><path>Library/Homebrew/formula.rb
<ide> def initialize(name, path, spec)
<ide> @pin = FormulaPin.new(self)
<ide> end
<ide>
<add> # @private
<add> def set_active_spec(spec_sym)
<add> spec = send(spec_sym)
<add> raise FormulaSpecificationError, "#{spec_sym} spec is not available for #{full_name}" unless spec
<add> @active_spec = spec
<add> @active_spec_sym = spec_sym
<add> validate_attributes!
<add> @build = active_spec.build
<add> end
<add>
<ide> private
<ide>
<ide> def set_spec(name) | 1 |
Javascript | Javascript | fix export issue in with-fauna example | 47cb2364d2a4e83c5464f2134714b90bdb37546e | <ide><path>examples/with-fauna/lib/constants.js
<add>const resolveDbDomain = () => {
<add> return process.env.FAUNA_DB_DOMAIN ?? 'db.fauna.com'
<add>}
<add>
<add>module.exports = {
<add> resolveDbDomain,
<add>}
<ide><path>examples/with-fauna/lib/fauna.js
<ide> import { GraphQLClient, gql } from 'graphql-request'
<del>import { resolveDbDomain } from '../scripts/setup'
<add>import { resolveDbDomain } from './constants'
<ide>
<ide> const CLIENT_SECRET =
<ide> process.env.FAUNA_ADMIN_KEY || process.env.FAUNA_CLIENT_SECRET
<ide><path>examples/with-fauna/scripts/setup.js
<ide> const readline = require('readline')
<ide> const request = require('request')
<ide> const { Client, query: Q } = require('faunadb')
<ide> const streamToPromise = require('stream-to-promise')
<add>const { resolveDbDomain } = require('../lib/constants')
<ide>
<ide> const MakeLatestEntriesIndex = () =>
<ide> Q.CreateIndex({
<ide> const resolveAdminKey = () => {
<ide> })
<ide> }
<ide>
<del>const resolveDbDomain = () => {
<del> return process.env.FAUNA_DB_DOMAIN ?? 'db.fauna.com'
<del>}
<del>
<ide> const importSchema = (adminKey) => {
<ide> let domain = resolveDbDomain().replace('db', 'graphql')
<ide> return streamToPromise( | 3 |
Text | Text | add commands for non dns (rhel/centos) hosts | 8cb492946595c17c6c4d695eadf8ff63c6ddf527 | <ide><path>docs/build-instructions/linux.md
<ide> To also install the newly built application, use `--create-debian-package` or `-
<ide> sudo update-alternatives --config gcc # choose gcc-5 from the list
<ide> ```
<ide>
<del>### Fedora / CentOS / RHEL
<add>### Fedora 22+
<ide>
<ide> * `sudo dnf --assumeyes install make gcc gcc-c++ glibc-devel git-core libgnome-keyring-devel rpmdevtools`
<ide>
<add>### Fedora 21 / CentOS / RHEL
<add>
<add>* `sudo yum install -y make gcc gcc-c++ glibc-devel git-core libgnome-keyring-devel rpmdevtools`
<add>
<ide> ### Arch
<ide>
<ide> * `sudo pacman -S --needed gconf base-devel git nodejs npm libgnome-keyring python2` | 1 |
Javascript | Javascript | remove unreachable code | 097b6d46b3c1d893e2d34780d91260e1a4ad08fb | <ide><path>src/lib/units/offset.js
<ide> export function cloneWithOffset(input, model) {
<ide> } else {
<ide> return createLocal(input).local();
<ide> }
<del> return model._isUTC ? createLocal(input).zone(model._offset || 0) : createLocal(input).local();
<ide> }
<ide>
<ide> function getDateOffset (m) { | 1 |
Ruby | Ruby | remove array#wrap usage in amo serialization | 3d04d726fde4352795204f819ff4821f8991f42e | <ide><path>activemodel/lib/active_model/serialization.rb
<ide> require 'active_support/core_ext/hash/except'
<ide> require 'active_support/core_ext/hash/slice'
<del>require 'active_support/core_ext/array/wrap'
<ide>
<ide> module ActiveModel
<ide> # == Active Model Serialization
<ide> def serializable_add_includes(options = {}) #:nodoc:
<ide> return unless include = options[:include]
<ide>
<ide> unless include.is_a?(Hash)
<del> include = Hash[Array.wrap(include).map { |n| n.is_a?(Hash) ? n.to_a.first : [n, {}] }]
<add> include = Hash[Array(include).map { |n| n.is_a?(Hash) ? n.to_a.first : [n, {}] }]
<ide> end
<ide>
<ide> include.each do |association, opts| | 1 |
PHP | PHP | add `getvisible` annotation to `entityinterface` | e79a2e4f1ebd086c18c7726515dfc7152b6bba74 | <ide><path>src/Datasource/EntityInterface.php
<ide> * @method string getSource()
<ide> * @method array extractOriginal(array $properties)
<ide> * @method array extractOriginalChanged(array $properties)
<add> * @method array getVisible()
<ide> *
<ide> * @property mixed $id Alias for commonly used primary key.
<ide> */ | 1 |
Text | Text | fix broken link | 369901759ddd9eaf3ef9e94ed7a096151b03bb36 | <ide><path>CONTRIBUTING.md
<ide> Changes to `.py` files will be effective immediately.
<ide> If you've made a contribution to spaCy, you should fill in the
<ide> [spaCy contributor agreement](.github/CONTRIBUTOR_AGREEMENT.md) to ensure that
<ide> your contribution can be used across the project. If you agree to be bound by
<del>the terms of the agreement, fill in the [template]((.github/CONTRIBUTOR_AGREEMENT.md))
<add>the terms of the agreement, fill in the [template](.github/CONTRIBUTOR_AGREEMENT.md)
<ide> and include it with your pull request, or sumit it separately to
<ide> [`.github/contributors/`](/.github/contributors). The name of the file should be
<ide> your GitHub username, with the extension `.md`. For example, the user | 1 |
Ruby | Ruby | combine x11 path conditionals | b1f8358fa8940806f489b0d571f5d83b20ddec57 | <ide><path>Library/Homebrew/extend/ENV/super.rb
<ide> def determine_cmake_frameworks_path
<ide> def determine_cmake_include_path
<ide> sdk = MacOS.sdk_path if MacOS::Xcode.without_clt?
<ide> paths = []
<del> paths << "#{MacOS::X11.include}/freetype2" if x11?
<ide> paths << "#{sdk}/usr/include/libxml2" unless deps.include? 'libxml2'
<ide> paths << "#{sdk}/usr/include/apache2" if MacOS::Xcode.without_clt?
<ide> paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" unless x11?
<del> paths << MacOS::X11.include if x11?
<add> paths << MacOS::X11.include << "#{MacOS::X11.include}/freetype2" if x11?
<ide> paths.to_path_s
<ide> end
<ide> | 1 |
Python | Python | add donate link | 4137aecca9c4add694146502cd3e6e5fc945f6dd | <ide><path>docs/conf.py
<ide> html_theme = 'flask'
<ide> html_context = {
<ide> 'project_links': [
<add> ProjectLink('Donate to Pallets', 'https://psfmember.org/civicrm/contribute/transact?id=20'),
<ide> ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),
<ide> ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),
<ide> ProjectLink('Source Code', 'https://github.com/pallets/flask/'), | 1 |
Javascript | Javascript | move textinput proptypes to deprecated proptypes | 427b54eef61b585f42643dcd70f8b656eeeb21c4 | <ide><path>Libraries/Components/TextInput/TextInput.js
<ide> */
<ide> 'use strict';
<ide>
<del>const DeprecatedColorPropType = require('../../DeprecatedPropTypes/DeprecatedColorPropType');
<del>const DeprecatedViewPropTypes = require('../../DeprecatedPropTypes/DeprecatedViewPropTypes');
<add>const DeprecatedTextInputPropTypes = require('../../DeprecatedPropTypes/DeprecatedTextInputPropTypes');
<ide> const DocumentSelectionState = require('../../vendor/document/selection/DocumentSelectionState');
<ide> const NativeMethodsMixin = require('../../Renderer/shims/NativeMethodsMixin');
<ide> const Platform = require('../../Utilities/Platform');
<del>const PropTypes = require('prop-types');
<ide> const React = require('react');
<ide> const ReactNative = require('../../Renderer/shims/ReactNative');
<ide> const StyleSheet = require('../../StyleSheet/StyleSheet');
<ide> export type EditingEvent = SyntheticEvent<
<ide> |}>,
<ide> >;
<ide>
<del>const DataDetectorTypes = [
<del> 'phoneNumber',
<del> 'link',
<del> 'address',
<del> 'calendarEvent',
<del> 'none',
<del> 'all',
<del>];
<del>
<ide> type DataDetectorTypesType =
<ide> | 'phoneNumber'
<ide> | 'link'
<ide> const TextInput = createReactClass({
<ide> blurTextInput: TextInputState.blurTextInput,
<ide> },
<ide> },
<del> propTypes: {
<del> ...DeprecatedViewPropTypes,
<del> /**
<del> * Can tell `TextInput` to automatically capitalize certain characters.
<del> *
<del> * - `characters`: all characters.
<del> * - `words`: first letter of each word.
<del> * - `sentences`: first letter of each sentence (*default*).
<del> * - `none`: don't auto capitalize anything.
<del> */
<del> autoCapitalize: PropTypes.oneOf([
<del> 'none',
<del> 'sentences',
<del> 'words',
<del> 'characters',
<del> ]),
<del> /**
<del> * Determines which content to suggest on auto complete, e.g.`username`.
<del> * To disable auto complete, use `off`.
<del> *
<del> * *Android Only*
<del> *
<del> * The following values work on Android only:
<del> *
<del> * - `username`
<del> * - `password`
<del> * - `email`
<del> * - `name`
<del> * - `tel`
<del> * - `street-address`
<del> * - `postal-code`
<del> * - `cc-number`
<del> * - `cc-csc`
<del> * - `cc-exp`
<del> * - `cc-exp-month`
<del> * - `cc-exp-year`
<del> * - `off`
<del> *
<del> * @platform android
<del> */
<del> autoCompleteType: PropTypes.oneOf([
<del> 'cc-csc',
<del> 'cc-exp',
<del> 'cc-exp-month',
<del> 'cc-exp-year',
<del> 'cc-number',
<del> 'email',
<del> 'name',
<del> 'password',
<del> 'postal-code',
<del> 'street-address',
<del> 'tel',
<del> 'username',
<del> 'off',
<del> ]),
<del> /**
<del> * If `false`, disables auto-correct. The default value is `true`.
<del> */
<del> autoCorrect: PropTypes.bool,
<del> /**
<del> * If `false`, disables spell-check style (i.e. red underlines).
<del> * The default value is inherited from `autoCorrect`.
<del> * @platform ios
<del> */
<del> spellCheck: PropTypes.bool,
<del> /**
<del> * If `true`, focuses the input on `componentDidMount`.
<del> * The default value is `false`.
<del> */
<del> autoFocus: PropTypes.bool,
<del> /**
<del> * Specifies whether fonts should scale to respect Text Size accessibility settings. The
<del> * default is `true`.
<del> */
<del> allowFontScaling: PropTypes.bool,
<del> /**
<del> * Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
<del> * Possible values:
<del> * `null/undefined` (default): inherit from the parent node or the global default (0)
<del> * `0`: no max, ignore parent/global default
<del> * `>= 1`: sets the maxFontSizeMultiplier of this node to this value
<del> */
<del> maxFontSizeMultiplier: PropTypes.number,
<del> /**
<del> * If `false`, text is not editable. The default value is `true`.
<del> */
<del> editable: PropTypes.bool,
<del> /**
<del> * Determines which keyboard to open, e.g.`numeric`.
<del> *
<del> * The following values work across platforms:
<del> *
<del> * - `default`
<del> * - `numeric`
<del> * - `number-pad`
<del> * - `decimal-pad`
<del> * - `email-address`
<del> * - `phone-pad`
<del> *
<del> * *iOS Only*
<del> *
<del> * The following values work on iOS only:
<del> *
<del> * - `ascii-capable`
<del> * - `numbers-and-punctuation`
<del> * - `url`
<del> * - `name-phone-pad`
<del> * - `twitter`
<del> * - `web-search`
<del> *
<del> * *Android Only*
<del> *
<del> * The following values work on Android only:
<del> *
<del> * - `visible-password`
<del> */
<del> keyboardType: PropTypes.oneOf([
<del> // Cross-platform
<del> 'default',
<del> 'email-address',
<del> 'numeric',
<del> 'phone-pad',
<del> 'number-pad',
<del> // iOS-only
<del> 'ascii-capable',
<del> 'numbers-and-punctuation',
<del> 'url',
<del> 'name-phone-pad',
<del> 'decimal-pad',
<del> 'twitter',
<del> 'web-search',
<del> // Android-only
<del> 'visible-password',
<del> ]),
<del> /**
<del> * Determines the color of the keyboard.
<del> * @platform ios
<del> */
<del> keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']),
<del> /**
<del> * Determines how the return key should look. On Android you can also use
<del> * `returnKeyLabel`.
<del> *
<del> * *Cross platform*
<del> *
<del> * The following values work across platforms:
<del> *
<del> * - `done`
<del> * - `go`
<del> * - `next`
<del> * - `search`
<del> * - `send`
<del> *
<del> * *Android Only*
<del> *
<del> * The following values work on Android only:
<del> *
<del> * - `none`
<del> * - `previous`
<del> *
<del> * *iOS Only*
<del> *
<del> * The following values work on iOS only:
<del> *
<del> * - `default`
<del> * - `emergency-call`
<del> * - `google`
<del> * - `join`
<del> * - `route`
<del> * - `yahoo`
<del> */
<del> returnKeyType: PropTypes.oneOf([
<del> // Cross-platform
<del> 'done',
<del> 'go',
<del> 'next',
<del> 'search',
<del> 'send',
<del> // Android-only
<del> 'none',
<del> 'previous',
<del> // iOS-only
<del> 'default',
<del> 'emergency-call',
<del> 'google',
<del> 'join',
<del> 'route',
<del> 'yahoo',
<del> ]),
<del> /**
<del> * Sets the return key to the label. Use it instead of `returnKeyType`.
<del> * @platform android
<del> */
<del> returnKeyLabel: PropTypes.string,
<del> /**
<del> * Limits the maximum number of characters that can be entered. Use this
<del> * instead of implementing the logic in JS to avoid flicker.
<del> */
<del> maxLength: PropTypes.number,
<del> /**
<del> * Sets the number of lines for a `TextInput`. Use it with multiline set to
<del> * `true` to be able to fill the lines.
<del> * @platform android
<del> */
<del> numberOfLines: PropTypes.number,
<del> /**
<del> * When `false`, if there is a small amount of space available around a text input
<del> * (e.g. landscape orientation on a phone), the OS may choose to have the user edit
<del> * the text inside of a full screen text input mode. When `true`, this feature is
<del> * disabled and users will always edit the text directly inside of the text input.
<del> * Defaults to `false`.
<del> * @platform android
<del> */
<del> disableFullscreenUI: PropTypes.bool,
<del> /**
<del> * If `true`, the keyboard disables the return key when there is no text and
<del> * automatically enables it when there is text. The default value is `false`.
<del> * @platform ios
<del> */
<del> enablesReturnKeyAutomatically: PropTypes.bool,
<del> /**
<del> * If `true`, the text input can be multiple lines.
<del> * The default value is `false`.
<del> */
<del> multiline: PropTypes.bool,
<del> /**
<del> * Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced`
<del> * The default value is `simple`.
<del> * @platform android
<del> */
<del> textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']),
<del> /**
<del> * Callback that is called when the text input is blurred.
<del> */
<del> onBlur: PropTypes.func,
<del> /**
<del> * Callback that is called when the text input is focused.
<del> */
<del> onFocus: PropTypes.func,
<del> /**
<del> * Callback that is called when the text input's text changes.
<del> */
<del> onChange: PropTypes.func,
<del> /**
<del> * Callback that is called when the text input's text changes.
<del> * Changed text is passed as an argument to the callback handler.
<del> */
<del> onChangeText: PropTypes.func,
<del> /**
<del> * Callback that is called when the text input's content size changes.
<del> * This will be called with
<del> * `{ nativeEvent: { contentSize: { width, height } } }`.
<del> *
<del> * Only called for multiline text inputs.
<del> */
<del> onContentSizeChange: PropTypes.func,
<del> onTextInput: PropTypes.func,
<del> /**
<del> * Callback that is called when text input ends.
<del> */
<del> onEndEditing: PropTypes.func,
<del> /**
<del> * Callback that is called when the text input selection is changed.
<del> * This will be called with
<del> * `{ nativeEvent: { selection: { start, end } } }`.
<del> */
<del> onSelectionChange: PropTypes.func,
<del> /**
<del> * Callback that is called when the text input's submit button is pressed.
<del> * Invalid if `multiline={true}` is specified.
<del> */
<del> onSubmitEditing: PropTypes.func,
<del> /**
<del> * Callback that is called when a key is pressed.
<del> * This will be called with `{ nativeEvent: { key: keyValue } }`
<del> * where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and
<del> * the typed-in character otherwise including `' '` for space.
<del> * Fires before `onChange` callbacks.
<del> */
<del> onKeyPress: PropTypes.func,
<del> /**
<del> * Invoked on mount and layout changes with `{x, y, width, height}`.
<del> */
<del> onLayout: PropTypes.func,
<del> /**
<del> * Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.
<del> * May also contain other properties from ScrollEvent but on Android contentSize
<del> * is not provided for performance reasons.
<del> */
<del> onScroll: PropTypes.func,
<del> /**
<del> * The string that will be rendered before text input has been entered.
<del> */
<del> placeholder: PropTypes.string,
<del> /**
<del> * The text color of the placeholder string.
<del> */
<del> placeholderTextColor: DeprecatedColorPropType,
<del> /**
<del> * If `false`, scrolling of the text view will be disabled.
<del> * The default value is `true`. Does only work with 'multiline={true}'.
<del> * @platform ios
<del> */
<del> scrollEnabled: PropTypes.bool,
<del> /**
<del> * If `true`, the text input obscures the text entered so that sensitive text
<del> * like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.
<del> */
<del> secureTextEntry: PropTypes.bool,
<del> /**
<del> * The highlight and cursor color of the text input.
<del> */
<del> selectionColor: DeprecatedColorPropType,
<del> /**
<del> * An instance of `DocumentSelectionState`, this is some state that is responsible for
<del> * maintaining selection information for a document.
<del> *
<del> * Some functionality that can be performed with this instance is:
<del> *
<del> * - `blur()`
<del> * - `focus()`
<del> * - `update()`
<del> *
<del> * > You can reference `DocumentSelectionState` in
<del> * > [`vendor/document/selection/DocumentSelectionState.js`](https://github.com/facebook/react-native/blob/master/Libraries/vendor/document/selection/DocumentSelectionState.js)
<del> *
<del> * @platform ios
<del> */
<del> selectionState: PropTypes.instanceOf(DocumentSelectionState),
<del> /**
<del> * The start and end of the text input's selection. Set start and end to
<del> * the same value to position the cursor.
<del> */
<del> selection: PropTypes.shape({
<del> start: PropTypes.number.isRequired,
<del> end: PropTypes.number,
<del> }),
<del> /**
<del> * The value to show for the text input. `TextInput` is a controlled
<del> * component, which means the native value will be forced to match this
<del> * value prop if provided. For most uses, this works great, but in some
<del> * cases this may cause flickering - one common cause is preventing edits
<del> * by keeping value the same. In addition to simply setting the same value,
<del> * either set `editable={false}`, or set/update `maxLength` to prevent
<del> * unwanted edits without flicker.
<del> */
<del> value: PropTypes.string,
<del> /**
<del> * Provides an initial value that will change when the user starts typing.
<del> * Useful for simple use-cases where you do not want to deal with listening
<del> * to events and updating the value prop to keep the controlled state in sync.
<del> */
<del> defaultValue: PropTypes.string,
<del> /**
<del> * When the clear button should appear on the right side of the text view.
<del> * This property is supported only for single-line TextInput component.
<del> * @platform ios
<del> */
<del> clearButtonMode: PropTypes.oneOf([
<del> 'never',
<del> 'while-editing',
<del> 'unless-editing',
<del> 'always',
<del> ]),
<del> /**
<del> * If `true`, clears the text field automatically when editing begins.
<del> * @platform ios
<del> */
<del> clearTextOnFocus: PropTypes.bool,
<del> /**
<del> * If `true`, all text will automatically be selected on focus.
<del> */
<del> selectTextOnFocus: PropTypes.bool,
<del> /**
<del> * If `true`, the text field will blur when submitted.
<del> * The default value is true for single-line fields and false for
<del> * multiline fields. Note that for multiline fields, setting `blurOnSubmit`
<del> * to `true` means that pressing return will blur the field and trigger the
<del> * `onSubmitEditing` event instead of inserting a newline into the field.
<del> */
<del> blurOnSubmit: PropTypes.bool,
<del> /**
<del> * Note that not all Text styles are supported, an incomplete list of what is not supported includes:
<del> *
<del> * - `borderLeftWidth`
<del> * - `borderTopWidth`
<del> * - `borderRightWidth`
<del> * - `borderBottomWidth`
<del> * - `borderTopLeftRadius`
<del> * - `borderTopRightRadius`
<del> * - `borderBottomRightRadius`
<del> * - `borderBottomLeftRadius`
<del> *
<del> * see [Issue#7070](https://github.com/facebook/react-native/issues/7070)
<del> * for more detail.
<del> *
<del> * [Styles](docs/style.html)
<del> */
<del> style: Text.propTypes.style,
<del> /**
<del> * The color of the `TextInput` underline.
<del> * @platform android
<del> */
<del> underlineColorAndroid: DeprecatedColorPropType,
<del>
<del> /**
<del> * If defined, the provided image resource will be rendered on the left.
<del> * The image resource must be inside `/android/app/src/main/res/drawable` and referenced
<del> * like
<del> * ```
<del> * <TextInput
<del> * inlineImageLeft='search_icon'
<del> * />
<del> * ```
<del> * @platform android
<del> */
<del> inlineImageLeft: PropTypes.string,
<del>
<del> /**
<del> * Padding between the inline image, if any, and the text input itself.
<del> * @platform android
<del> */
<del> inlineImagePadding: PropTypes.number,
<del>
<del> /**
<del> * If `true`, allows TextInput to pass touch events to the parent component.
<del> * This allows components such as SwipeableListView to be swipeable from the TextInput on iOS,
<del> * as is the case on Android by default.
<del> * If `false`, TextInput always asks to handle the input (except when disabled).
<del> * @platform ios
<del> */
<del> rejectResponderTermination: PropTypes.bool,
<del>
<del> /**
<del> * Determines the types of data converted to clickable URLs in the text input.
<del> * Only valid if `multiline={true}` and `editable={false}`.
<del> * By default no data types are detected.
<del> *
<del> * You can provide one type or an array of many types.
<del> *
<del> * Possible values for `dataDetectorTypes` are:
<del> *
<del> * - `'phoneNumber'`
<del> * - `'link'`
<del> * - `'address'`
<del> * - `'calendarEvent'`
<del> * - `'none'`
<del> * - `'all'`
<del> *
<del> * @platform ios
<del> */
<del> dataDetectorTypes: PropTypes.oneOfType([
<del> PropTypes.oneOf(DataDetectorTypes),
<del> PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),
<del> ]),
<del> /**
<del> * If `true`, caret is hidden. The default value is `false`.
<del> * This property is supported only for single-line TextInput component on iOS.
<del> */
<del> caretHidden: PropTypes.bool,
<del> /*
<del> * If `true`, contextMenuHidden is hidden. The default value is `false`.
<del> */
<del> contextMenuHidden: PropTypes.bool,
<del> /**
<del> * An optional identifier which links a custom InputAccessoryView to
<del> * this text input. The InputAccessoryView is rendered above the
<del> * keyboard when this text input is focused.
<del> * @platform ios
<del> */
<del> inputAccessoryViewID: PropTypes.string,
<del> /**
<del> * Give the keyboard and the system information about the
<del> * expected semantic meaning for the content that users enter.
<del> * @platform ios
<del> */
<del> textContentType: PropTypes.oneOf([
<del> 'none',
<del> 'URL',
<del> 'addressCity',
<del> 'addressCityAndState',
<del> 'addressState',
<del> 'countryName',
<del> 'creditCardNumber',
<del> 'emailAddress',
<del> 'familyName',
<del> 'fullStreetAddress',
<del> 'givenName',
<del> 'jobTitle',
<del> 'location',
<del> 'middleName',
<del> 'name',
<del> 'namePrefix',
<del> 'nameSuffix',
<del> 'nickname',
<del> 'organizationName',
<del> 'postalCode',
<del> 'streetAddressLine1',
<del> 'streetAddressLine2',
<del> 'sublocality',
<del> 'telephoneNumber',
<del> 'username',
<del> 'password',
<del> 'newPassword',
<del> 'oneTimeCode',
<del> ]),
<del> /**
<del> * When `false`, it will prevent the soft keyboard from showing when the field is focused.
<del> * Defaults to `true`.
<del> * @platform android
<del> */
<del> showSoftInputOnFocus: PropTypes.bool,
<del> },
<add> propTypes: DeprecatedTextInputPropTypes,
<ide> getDefaultProps() {
<ide> return {
<ide> allowFontScaling: true,
<ide><path>Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js
<add>/**
<add> * Copyright (c) Facebook, Inc. and its affiliates.
<add> *
<add> * This source code is licensed under the MIT license found in the
<add> * LICENSE file in the root directory of this source tree.
<add> *
<add> * @flow
<add> * @format
<add> */
<add>
<add>'use strict';
<add>
<add>const PropTypes = require('prop-types');
<add>const DeprecatedColorPropType = require('./DeprecatedColorPropType');
<add>const DeprecatedViewPropTypes = require('./DeprecatedViewPropTypes');
<add>const DocumentSelectionState = require('../vendor/document/selection/DocumentSelectionState');
<add>const Text = require('../Text/Text');
<add>
<add>const DataDetectorTypes = [
<add> 'phoneNumber',
<add> 'link',
<add> 'address',
<add> 'calendarEvent',
<add> 'none',
<add> 'all',
<add>];
<add>
<add>module.exports = {
<add> ...DeprecatedViewPropTypes,
<add> /**
<add> * Can tell `TextInput` to automatically capitalize certain characters.
<add> *
<add> * - `characters`: all characters.
<add> * - `words`: first letter of each word.
<add> * - `sentences`: first letter of each sentence (*default*).
<add> * - `none`: don't auto capitalize anything.
<add> */
<add> autoCapitalize: PropTypes.oneOf(['none', 'sentences', 'words', 'characters']),
<add> /**
<add> * Determines which content to suggest on auto complete, e.g.`username`.
<add> * To disable auto complete, use `off`.
<add> *
<add> * *Android Only*
<add> *
<add> * The following values work on Android only:
<add> *
<add> * - `username`
<add> * - `password`
<add> * - `email`
<add> * - `name`
<add> * - `tel`
<add> * - `street-address`
<add> * - `postal-code`
<add> * - `cc-number`
<add> * - `cc-csc`
<add> * - `cc-exp`
<add> * - `cc-exp-month`
<add> * - `cc-exp-year`
<add> * - `off`
<add> *
<add> * @platform android
<add> */
<add> autoCompleteType: PropTypes.oneOf([
<add> 'cc-csc',
<add> 'cc-exp',
<add> 'cc-exp-month',
<add> 'cc-exp-year',
<add> 'cc-number',
<add> 'email',
<add> 'name',
<add> 'password',
<add> 'postal-code',
<add> 'street-address',
<add> 'tel',
<add> 'username',
<add> 'off',
<add> ]),
<add> /**
<add> * If `false`, disables auto-correct. The default value is `true`.
<add> */
<add> autoCorrect: PropTypes.bool,
<add> /**
<add> * If `false`, disables spell-check style (i.e. red underlines).
<add> * The default value is inherited from `autoCorrect`.
<add> * @platform ios
<add> */
<add> spellCheck: PropTypes.bool,
<add> /**
<add> * If `true`, focuses the input on `componentDidMount`.
<add> * The default value is `false`.
<add> */
<add> autoFocus: PropTypes.bool,
<add> /**
<add> * Specifies whether fonts should scale to respect Text Size accessibility settings. The
<add> * default is `true`.
<add> */
<add> allowFontScaling: PropTypes.bool,
<add> /**
<add> * Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
<add> * Possible values:
<add> * `null/undefined` (default): inherit from the parent node or the global default (0)
<add> * `0`: no max, ignore parent/global default
<add> * `>= 1`: sets the maxFontSizeMultiplier of this node to this value
<add> */
<add> maxFontSizeMultiplier: PropTypes.number,
<add> /**
<add> * If `false`, text is not editable. The default value is `true`.
<add> */
<add> editable: PropTypes.bool,
<add> /**
<add> * Determines which keyboard to open, e.g.`numeric`.
<add> *
<add> * The following values work across platforms:
<add> *
<add> * - `default`
<add> * - `numeric`
<add> * - `number-pad`
<add> * - `decimal-pad`
<add> * - `email-address`
<add> * - `phone-pad`
<add> *
<add> * *iOS Only*
<add> *
<add> * The following values work on iOS only:
<add> *
<add> * - `ascii-capable`
<add> * - `numbers-and-punctuation`
<add> * - `url`
<add> * - `name-phone-pad`
<add> * - `twitter`
<add> * - `web-search`
<add> *
<add> * *Android Only*
<add> *
<add> * The following values work on Android only:
<add> *
<add> * - `visible-password`
<add> */
<add> keyboardType: PropTypes.oneOf([
<add> // Cross-platform
<add> 'default',
<add> 'email-address',
<add> 'numeric',
<add> 'phone-pad',
<add> 'number-pad',
<add> // iOS-only
<add> 'ascii-capable',
<add> 'numbers-and-punctuation',
<add> 'url',
<add> 'name-phone-pad',
<add> 'decimal-pad',
<add> 'twitter',
<add> 'web-search',
<add> // Android-only
<add> 'visible-password',
<add> ]),
<add> /**
<add> * Determines the color of the keyboard.
<add> * @platform ios
<add> */
<add> keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']),
<add> /**
<add> * Determines how the return key should look. On Android you can also use
<add> * `returnKeyLabel`.
<add> *
<add> * *Cross platform*
<add> *
<add> * The following values work across platforms:
<add> *
<add> * - `done`
<add> * - `go`
<add> * - `next`
<add> * - `search`
<add> * - `send`
<add> *
<add> * *Android Only*
<add> *
<add> * The following values work on Android only:
<add> *
<add> * - `none`
<add> * - `previous`
<add> *
<add> * *iOS Only*
<add> *
<add> * The following values work on iOS only:
<add> *
<add> * - `default`
<add> * - `emergency-call`
<add> * - `google`
<add> * - `join`
<add> * - `route`
<add> * - `yahoo`
<add> */
<add> returnKeyType: PropTypes.oneOf([
<add> // Cross-platform
<add> 'done',
<add> 'go',
<add> 'next',
<add> 'search',
<add> 'send',
<add> // Android-only
<add> 'none',
<add> 'previous',
<add> // iOS-only
<add> 'default',
<add> 'emergency-call',
<add> 'google',
<add> 'join',
<add> 'route',
<add> 'yahoo',
<add> ]),
<add> /**
<add> * Sets the return key to the label. Use it instead of `returnKeyType`.
<add> * @platform android
<add> */
<add> returnKeyLabel: PropTypes.string,
<add> /**
<add> * Limits the maximum number of characters that can be entered. Use this
<add> * instead of implementing the logic in JS to avoid flicker.
<add> */
<add> maxLength: PropTypes.number,
<add> /**
<add> * Sets the number of lines for a `TextInput`. Use it with multiline set to
<add> * `true` to be able to fill the lines.
<add> * @platform android
<add> */
<add> numberOfLines: PropTypes.number,
<add> /**
<add> * When `false`, if there is a small amount of space available around a text input
<add> * (e.g. landscape orientation on a phone), the OS may choose to have the user edit
<add> * the text inside of a full screen text input mode. When `true`, this feature is
<add> * disabled and users will always edit the text directly inside of the text input.
<add> * Defaults to `false`.
<add> * @platform android
<add> */
<add> disableFullscreenUI: PropTypes.bool,
<add> /**
<add> * If `true`, the keyboard disables the return key when there is no text and
<add> * automatically enables it when there is text. The default value is `false`.
<add> * @platform ios
<add> */
<add> enablesReturnKeyAutomatically: PropTypes.bool,
<add> /**
<add> * If `true`, the text input can be multiple lines.
<add> * The default value is `false`.
<add> */
<add> multiline: PropTypes.bool,
<add> /**
<add> * Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced`
<add> * The default value is `simple`.
<add> * @platform android
<add> */
<add> textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']),
<add> /**
<add> * Callback that is called when the text input is blurred.
<add> */
<add> onBlur: PropTypes.func,
<add> /**
<add> * Callback that is called when the text input is focused.
<add> */
<add> onFocus: PropTypes.func,
<add> /**
<add> * Callback that is called when the text input's text changes.
<add> */
<add> onChange: PropTypes.func,
<add> /**
<add> * Callback that is called when the text input's text changes.
<add> * Changed text is passed as an argument to the callback handler.
<add> */
<add> onChangeText: PropTypes.func,
<add> /**
<add> * Callback that is called when the text input's content size changes.
<add> * This will be called with
<add> * `{ nativeEvent: { contentSize: { width, height } } }`.
<add> *
<add> * Only called for multiline text inputs.
<add> */
<add> onContentSizeChange: PropTypes.func,
<add> onTextInput: PropTypes.func,
<add> /**
<add> * Callback that is called when text input ends.
<add> */
<add> onEndEditing: PropTypes.func,
<add> /**
<add> * Callback that is called when the text input selection is changed.
<add> * This will be called with
<add> * `{ nativeEvent: { selection: { start, end } } }`.
<add> */
<add> onSelectionChange: PropTypes.func,
<add> /**
<add> * Callback that is called when the text input's submit button is pressed.
<add> * Invalid if `multiline={true}` is specified.
<add> */
<add> onSubmitEditing: PropTypes.func,
<add> /**
<add> * Callback that is called when a key is pressed.
<add> * This will be called with `{ nativeEvent: { key: keyValue } }`
<add> * where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and
<add> * the typed-in character otherwise including `' '` for space.
<add> * Fires before `onChange` callbacks.
<add> */
<add> onKeyPress: PropTypes.func,
<add> /**
<add> * Invoked on mount and layout changes with `{x, y, width, height}`.
<add> */
<add> onLayout: PropTypes.func,
<add> /**
<add> * Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.
<add> * May also contain other properties from ScrollEvent but on Android contentSize
<add> * is not provided for performance reasons.
<add> */
<add> onScroll: PropTypes.func,
<add> /**
<add> * The string that will be rendered before text input has been entered.
<add> */
<add> placeholder: PropTypes.string,
<add> /**
<add> * The text color of the placeholder string.
<add> */
<add> placeholderTextColor: DeprecatedColorPropType,
<add> /**
<add> * If `false`, scrolling of the text view will be disabled.
<add> * The default value is `true`. Does only work with 'multiline={true}'.
<add> * @platform ios
<add> */
<add> scrollEnabled: PropTypes.bool,
<add> /**
<add> * If `true`, the text input obscures the text entered so that sensitive text
<add> * like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.
<add> */
<add> secureTextEntry: PropTypes.bool,
<add> /**
<add> * The highlight and cursor color of the text input.
<add> */
<add> selectionColor: DeprecatedColorPropType,
<add> /**
<add> * An instance of `DocumentSelectionState`, this is some state that is responsible for
<add> * maintaining selection information for a document.
<add> *
<add> * Some functionality that can be performed with this instance is:
<add> *
<add> * - `blur()`
<add> * - `focus()`
<add> * - `update()`
<add> *
<add> * > You can reference `DocumentSelectionState` in
<add> * > [`vendor/document/selection/DocumentSelectionState.js`](https://github.com/facebook/react-native/blob/master/Libraries/vendor/document/selection/DocumentSelectionState.js)
<add> *
<add> * @platform ios
<add> */
<add> selectionState: PropTypes.instanceOf(DocumentSelectionState),
<add> /**
<add> * The start and end of the text input's selection. Set start and end to
<add> * the same value to position the cursor.
<add> */
<add> selection: PropTypes.shape({
<add> start: PropTypes.number.isRequired,
<add> end: PropTypes.number,
<add> }),
<add> /**
<add> * The value to show for the text input. `TextInput` is a controlled
<add> * component, which means the native value will be forced to match this
<add> * value prop if provided. For most uses, this works great, but in some
<add> * cases this may cause flickering - one common cause is preventing edits
<add> * by keeping value the same. In addition to simply setting the same value,
<add> * either set `editable={false}`, or set/update `maxLength` to prevent
<add> * unwanted edits without flicker.
<add> */
<add> value: PropTypes.string,
<add> /**
<add> * Provides an initial value that will change when the user starts typing.
<add> * Useful for simple use-cases where you do not want to deal with listening
<add> * to events and updating the value prop to keep the controlled state in sync.
<add> */
<add> defaultValue: PropTypes.string,
<add> /**
<add> * When the clear button should appear on the right side of the text view.
<add> * This property is supported only for single-line TextInput component.
<add> * @platform ios
<add> */
<add> clearButtonMode: PropTypes.oneOf([
<add> 'never',
<add> 'while-editing',
<add> 'unless-editing',
<add> 'always',
<add> ]),
<add> /**
<add> * If `true`, clears the text field automatically when editing begins.
<add> * @platform ios
<add> */
<add> clearTextOnFocus: PropTypes.bool,
<add> /**
<add> * If `true`, all text will automatically be selected on focus.
<add> */
<add> selectTextOnFocus: PropTypes.bool,
<add> /**
<add> * If `true`, the text field will blur when submitted.
<add> * The default value is true for single-line fields and false for
<add> * multiline fields. Note that for multiline fields, setting `blurOnSubmit`
<add> * to `true` means that pressing return will blur the field and trigger the
<add> * `onSubmitEditing` event instead of inserting a newline into the field.
<add> */
<add> blurOnSubmit: PropTypes.bool,
<add> /**
<add> * Note that not all Text styles are supported, an incomplete list of what is not supported includes:
<add> *
<add> * - `borderLeftWidth`
<add> * - `borderTopWidth`
<add> * - `borderRightWidth`
<add> * - `borderBottomWidth`
<add> * - `borderTopLeftRadius`
<add> * - `borderTopRightRadius`
<add> * - `borderBottomRightRadius`
<add> * - `borderBottomLeftRadius`
<add> *
<add> * see [Issue#7070](https://github.com/facebook/react-native/issues/7070)
<add> * for more detail.
<add> *
<add> * [Styles](docs/style.html)
<add> */
<add> style: Text.propTypes.style,
<add> /**
<add> * The color of the `TextInput` underline.
<add> * @platform android
<add> */
<add> underlineColorAndroid: DeprecatedColorPropType,
<add>
<add> /**
<add> * If defined, the provided image resource will be rendered on the left.
<add> * The image resource must be inside `/android/app/src/main/res/drawable` and referenced
<add> * like
<add> * ```
<add> * <TextInput
<add> * inlineImageLeft='search_icon'
<add> * />
<add> * ```
<add> * @platform android
<add> */
<add> inlineImageLeft: PropTypes.string,
<add>
<add> /**
<add> * Padding between the inline image, if any, and the text input itself.
<add> * @platform android
<add> */
<add> inlineImagePadding: PropTypes.number,
<add>
<add> /**
<add> * If `true`, allows TextInput to pass touch events to the parent component.
<add> * This allows components such as SwipeableListView to be swipeable from the TextInput on iOS,
<add> * as is the case on Android by default.
<add> * If `false`, TextInput always asks to handle the input (except when disabled).
<add> * @platform ios
<add> */
<add> rejectResponderTermination: PropTypes.bool,
<add>
<add> /**
<add> * Determines the types of data converted to clickable URLs in the text input.
<add> * Only valid if `multiline={true}` and `editable={false}`.
<add> * By default no data types are detected.
<add> *
<add> * You can provide one type or an array of many types.
<add> *
<add> * Possible values for `dataDetectorTypes` are:
<add> *
<add> * - `'phoneNumber'`
<add> * - `'link'`
<add> * - `'address'`
<add> * - `'calendarEvent'`
<add> * - `'none'`
<add> * - `'all'`
<add> *
<add> * @platform ios
<add> */
<add> dataDetectorTypes: PropTypes.oneOfType([
<add> PropTypes.oneOf(DataDetectorTypes),
<add> PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),
<add> ]),
<add> /**
<add> * If `true`, caret is hidden. The default value is `false`.
<add> * This property is supported only for single-line TextInput component on iOS.
<add> */
<add> caretHidden: PropTypes.bool,
<add> /*
<add> * If `true`, contextMenuHidden is hidden. The default value is `false`.
<add> */
<add> contextMenuHidden: PropTypes.bool,
<add> /**
<add> * An optional identifier which links a custom InputAccessoryView to
<add> * this text input. The InputAccessoryView is rendered above the
<add> * keyboard when this text input is focused.
<add> * @platform ios
<add> */
<add> inputAccessoryViewID: PropTypes.string,
<add> /**
<add> * Give the keyboard and the system information about the
<add> * expected semantic meaning for the content that users enter.
<add> * @platform ios
<add> */
<add> textContentType: PropTypes.oneOf([
<add> 'none',
<add> 'URL',
<add> 'addressCity',
<add> 'addressCityAndState',
<add> 'addressState',
<add> 'countryName',
<add> 'creditCardNumber',
<add> 'emailAddress',
<add> 'familyName',
<add> 'fullStreetAddress',
<add> 'givenName',
<add> 'jobTitle',
<add> 'location',
<add> 'middleName',
<add> 'name',
<add> 'namePrefix',
<add> 'nameSuffix',
<add> 'nickname',
<add> 'organizationName',
<add> 'postalCode',
<add> 'streetAddressLine1',
<add> 'streetAddressLine2',
<add> 'sublocality',
<add> 'telephoneNumber',
<add> 'username',
<add> 'password',
<add> 'newPassword',
<add> 'oneTimeCode',
<add> ]),
<add> /**
<add> * When `false`, it will prevent the soft keyboard from showing when the field is focused.
<add> * Defaults to `true`.
<add> * @platform android
<add> */
<add> showSoftInputOnFocus: PropTypes.bool,
<add>}; | 2 |
Ruby | Ruby | handle $editor with spaces | 9f07e5d9fd226f9333b9a1241a4576d9e894f1b2 | <ide><path>Library/Homebrew/utils.rb
<ide> def exec_editor *args
<ide> editor='vim'
<ide> end
<ide> end
<del> exec editor, *args
<add> # we split the editor because especially on mac "mate -w" is common
<add> # but we still want to use the comma-delimited version of exec because then
<add> # we don't have to escape args, and escaping 100% is tricky
<add> exec *(editor.split+args)
<ide> end | 1 |
PHP | PHP | remove unused refrence | d18451f841dc95cf919602c473e88103cfe69994 | <ide><path>src/Illuminate/Foundation/Console/RouteListCommand.php
<ide>
<ide> use Illuminate\Support\Arr;
<ide> use Illuminate\Support\Str;
<del>use Illuminate\Http\Request;
<ide> use Illuminate\Routing\Route;
<ide> use Illuminate\Routing\Router;
<ide> use Illuminate\Console\Command; | 1 |
Python | Python | improve handling of ner in conll-u misc | 4b229bfc220f1c8ab63ac2fa9b17365689d4c5a2 | <ide><path>spacy/cli/converters/conllu2json.py
<ide> def conllu2json(
<ide> Extract NER tags if available and convert them so that they follow
<ide> BILUO and the Wikipedia scheme
<ide> """
<del> MISC_NER_PATTERN = "\|?(?:name=)?(([A-Z_]+)-([A-Z_]+)|O)\|?"
<add> MISC_NER_PATTERN = "^((?:name|NE)=)?([BILU])-([A-Z_]+)|O$"
<ide> msg = Printer(no_print=no_print)
<ide> n_sents_info(msg, n_sents)
<ide> docs = []
<ide> def conllu2json(
<ide> ner_map=ner_map,
<ide> merge_subtokens=merge_subtokens,
<ide> )
<del> has_ner_tags = has_ner(input_data, ner_tag_pattern=MISC_NER_PATTERN)
<add> has_ner_tags = has_ner(input_data, MISC_NER_PATTERN)
<ide> for i, example in enumerate(conll_data):
<ide> raw += example.text
<ide> sentences.append(
<ide> def conllu2json(
<ide>
<ide> def has_ner(input_data, ner_tag_pattern):
<ide> """
<del> Check the 10th column of the first token to determine if the file contains
<del> NER tags
<add> Check the MISC column for NER tags.
<ide> """
<ide> for sent in input_data.strip().split("\n\n"):
<ide> lines = sent.strip().split("\n")
<ide> if lines:
<ide> while lines[0].startswith("#"):
<ide> lines.pop(0)
<del> if lines:
<del> parts = lines[0].split("\t")
<add> for line in lines:
<add> parts = line.split("\t")
<ide> id_, word, lemma, pos, tag, morph, head, dep, _1, misc = parts
<del> if re.search(ner_tag_pattern, misc):
<del> return True
<del> else:
<del> return False
<add> for misc_part in misc.split("|"):
<add> if re.match(ner_tag_pattern, misc_part):
<add> return True
<add> return False
<ide>
<ide>
<ide> def read_conllx(
<ide> def get_entities(lines, tag_pattern, ner_map=None):
<ide>
<ide> iob = []
<ide> for misc in miscs:
<del> tag_match = re.search(tag_pattern, misc)
<ide> iob_tag = "O"
<del> if tag_match:
<del> prefix = tag_match.group(2)
<del> suffix = tag_match.group(3)
<del> if prefix and suffix:
<del> iob_tag = prefix + "-" + suffix
<del> if ner_map:
<del> suffix = ner_map.get(suffix, suffix)
<del> if suffix == "":
<del> iob_tag = "O"
<del> else:
<del> iob_tag = prefix + "-" + suffix
<add> for misc_part in misc.split("|"):
<add> tag_match = re.match(tag_pattern, misc_part)
<add> if tag_match:
<add> prefix = tag_match.group(2)
<add> suffix = tag_match.group(3)
<add> if prefix and suffix:
<add> iob_tag = prefix + "-" + suffix
<add> if ner_map:
<add> suffix = ner_map.get(suffix, suffix)
<add> if suffix == "":
<add> iob_tag = "O"
<add> else:
<add> iob_tag = prefix + "-" + suffix
<add> break
<ide> iob.append(iob_tag)
<ide> return iob_to_biluo(iob)
<ide>
<ide><path>spacy/tests/test_cli.py
<ide> def test_cli_converters_conllu2json():
<ide> assert [t["ner"] for t in tokens] == ["O", "B-PER", "L-PER", "O"]
<ide>
<ide>
<del>def test_cli_converters_conllu2json_name_ner_map():
<del> lines = [
<del> "1\tDommer\tdommer\tNOUN\t_\tDefinite=Ind|Gender=Masc|Number=Sing\t2\tappos\t_\tname=O",
<del> "2\tFinn\tFinn\tPROPN\t_\tGender=Masc\t4\tnsubj\t_\tSpaceAfter=No|name=B-PER",
<del> "3\tEilertsen\tEilertsen\tPROPN\t_\t_\t2\tname\t_\tname=I-PER",
<del> "4\tavstår\tavstå\tVERB\t_\tMood=Ind|Tense=Pres|VerbForm=Fin\t0\troot\t_\tSpaceAfter=No|name=O",
<del> "5\t.\t$.\tPUNCT\t_\t_\t4\tpunct\t_\tname=B-BAD",
<del> ]
<add>@pytest.mark.parametrize(
<add> "lines",
<add> [
<add> (
<add> "1\tDommer\tdommer\tNOUN\t_\tDefinite=Ind|Gender=Masc|Number=Sing\t2\tappos\t_\tname=O",
<add> "2\tFinn\tFinn\tPROPN\t_\tGender=Masc\t4\tnsubj\t_\tSpaceAfter=No|name=B-PER",
<add> "3\tEilertsen\tEilertsen\tPROPN\t_\t_\t2\tname\t_\tname=I-PER",
<add> "4\tavstår\tavstå\tVERB\t_\tMood=Ind|Tense=Pres|VerbForm=Fin\t0\troot\t_\tSpaceAfter=No|name=O",
<add> "5\t.\t$.\tPUNCT\t_\t_\t4\tpunct\t_\tname=B-BAD",
<add> ),
<add> (
<add> "1\tDommer\tdommer\tNOUN\t_\tDefinite=Ind|Gender=Masc|Number=Sing\t2\tappos\t_\t_",
<add> "2\tFinn\tFinn\tPROPN\t_\tGender=Masc\t4\tnsubj\t_\tSpaceAfter=No|NE=B-PER",
<add> "3\tEilertsen\tEilertsen\tPROPN\t_\t_\t2\tname\t_\tNE=L-PER",
<add> "4\tavstår\tavstå\tVERB\t_\tMood=Ind|Tense=Pres|VerbForm=Fin\t0\troot\t_\tSpaceAfter=No",
<add> "5\t.\t$.\tPUNCT\t_\t_\t4\tpunct\t_\tNE=B-BAD",
<add> ),
<add> ],
<add>)
<add>def test_cli_converters_conllu2json_name_ner_map(lines):
<ide> input_data = "\n".join(lines)
<ide> converted = conllu2json(input_data, n_sents=1, ner_map={"PER": "PERSON", "BAD": ""})
<ide> assert len(converted) == 1 | 2 |
Javascript | Javascript | fix relative module aliases for windows | e3bf20cbcf43ff3a062afc1c70e983e75e041895 | <ide><path>server/build/root-module-relative-path.js
<ide> // This function returns paths relative to the top-level 'node_modules'
<ide> // directory found in the path. If none is found, returns the complete path.
<ide>
<del>const RELATIVE_START = 'node_modules/'
<add>import { sep } from 'path'
<add>
<add>const RELATIVE_START = `node_modules${sep}`
<ide>
<ide> // Pass in the module's `require` object since it's module-specific.
<ide> export default (moduleRequire) => (path) => { | 1 |
Javascript | Javascript | improve assertions in child-process-execsync | ede279cbdf4db5c53dcd0fe59cc47a7e5c74f842 | <ide><path>test/sequential/test-child-process-execsync.js
<ide> let caught = false;
<ide> // Verify that stderr is not accessed when a bad shell is used
<ide> assert.throws(
<ide> function() { execSync('exit -1', { shell: 'bad_shell' }); },
<del> /spawnSync bad_shell ENOENT/,
<del> 'execSync did not throw the expected exception!'
<add> /spawnSync bad_shell ENOENT/
<ide> );
<ide> assert.throws(
<ide> function() { execFileSync('exit -1', { shell: 'bad_shell' }); },
<del> /spawnSync bad_shell ENOENT/,
<del> 'execFileSync did not throw the expected exception!'
<add> /spawnSync bad_shell ENOENT/
<ide> );
<ide>
<ide> let cmd, ret;
<ide> try {
<ide> } finally {
<ide> assert.strictEqual(ret, undefined,
<ide> `should not have a return value, received ${ret}`);
<del> assert.strictEqual(caught, true, 'execSync should throw');
<add> assert.ok(caught, 'execSync should throw');
<ide> const end = Date.now() - start;
<ide> assert(end < SLEEP);
<ide> assert(err.status > 128 || err.signal); | 1 |
Text | Text | fix typo in custom build id docs | 7df38bc56b54706f3658445cd65800689dc60786 | <ide><path>docs/api-reference/next.config.js/configuring-the-build-id.md
<ide> description: Configure the build id, which is used to identify the current build
<ide>
<ide> # Configuring the Build ID
<ide>
<del>Next.js uses a constant id generated at build time to identify which version of your application is being served. This can cause problems in multi-server deployments when `next build` is ran on every server. In order to keep a static build id between builds you can provide your own build id.
<add>Next.js uses a constant id generated at build time to identify which version of your application is being served. This can cause problems in multi-server deployments when `next build` is run on every server. In order to keep a consistent build id between builds you can provide your own build id.
<ide>
<ide> Open `next.config.js` and add the `generateBuildId` function:
<ide> | 1 |
Text | Text | fix broken queryset in example | 51f80c3604d9257a3f3c3aa9e3e9b02b6cebb98a | <ide><path>docs/api-guide/viewsets.md
<ide> Let's define a simple viewset that can be used to listing or retrieving all the
<ide> """
<ide> A simple ViewSet that for listing or retrieving users.
<ide> """
<del> queryset = User.objects.all()
<del>
<ide> def list(self, request):
<del> serializer = UserSerializer(self.queryset, many=True)
<add> queryset = User.objects.all()
<add> serializer = UserSerializer(queryset, many=True)
<ide> return Response(serializer.data)
<ide>
<ide> def retrieve(self, request, pk=None):
<del> user = get_object_or_404(self.queryset, pk=pk)
<add> queryset = User.objects.all()
<add> user = get_object_or_404(queryset, pk=pk)
<ide> serializer = UserSerializer(user)
<ide> return Response(serializer.data)
<ide> | 1 |
Go | Go | evaluate symlinks before relabeling mount source | e0b22c0b9e013527ef121250b51ae780d2d2912d | <ide><path>volume/volume.go
<ide> package volume
<ide> import (
<ide> "fmt"
<ide> "os"
<add> "path/filepath"
<ide> "syscall"
<ide> "time"
<ide>
<ide> func (m *MountPoint) Setup(mountLabel string, rootIDs idtools.IDPair, checkFun f
<ide> return
<ide> }
<ide>
<del> err = label.Relabel(m.Source, mountLabel, label.IsShared(m.Mode))
<add> var sourcePath string
<add> sourcePath, err = filepath.EvalSymlinks(m.Source)
<add> if err != nil {
<add> path = ""
<add> err = errors.Wrapf(err, "error evaluating symlinks from mount source %q", m.Source)
<add> return
<add> }
<add> err = label.Relabel(sourcePath, mountLabel, label.IsShared(m.Mode))
<ide> if err == syscall.ENOTSUP {
<ide> err = nil
<ide> }
<ide> if err != nil {
<ide> path = ""
<del> err = errors.Wrapf(err, "error setting label on mount source '%s'", m.Source)
<add> err = errors.Wrapf(err, "error setting label on mount source '%s'", sourcePath)
<ide> }
<ide> }()
<ide> | 1 |
Python | Python | add description to hint if conn_type is missing | d65cf7755235c06bdbf63edfab31ddd348565bd9 | <ide><path>airflow/www/views.py
<ide> def _get_connection_types() -> List[Tuple[str, str]]:
<ide> choices=sorted(_get_connection_types(), key=itemgetter(1)),
<ide> widget=Select2Widget(),
<ide> validators=[InputRequired()],
<add> description="""
<add> Conn Type missing?
<add> Make sure you've installed the corresponding Airflow Provider Package.
<add> """,
<ide> )
<ide> for key, value in ProvidersManager().connection_form_widgets.items():
<ide> setattr(ConnectionForm, key, value.field) | 1 |
Javascript | Javascript | use lanes to check if a render is a suspense retry | 970fa122d8188bafa600e9b5214833487fbf1092 | <ide><path>packages/react-reconciler/src/ReactFiberLane.js
<ide> export function getLanesToRetrySynchronouslyOnError(root: FiberRoot): Lanes {
<ide> export function returnNextLanesPriority() {
<ide> return return_highestLanePriority;
<ide> }
<del>export function hasUpdatePriority(lanes: Lanes) {
<add>export function includesNonIdleWork(lanes: Lanes) {
<ide> return (lanes & NonIdleLanes) !== NoLanes;
<ide> }
<add>export function includesOnlyRetries(lanes: Lanes) {
<add> return (lanes & RetryLanes) === lanes;
<add>}
<ide>
<ide> // To ensure consistency across multiple updates in the same event, this should
<ide> // be a pure function, so that it always returns the same lane for given inputs.
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.new.js
<ide> import {
<ide> removeLanes,
<ide> pickArbitraryLane,
<ide> hasDiscreteLanes,
<del> hasUpdatePriority,
<add> includesNonIdleWork,
<add> includesOnlyRetries,
<ide> getNextLanes,
<ide> returnNextLanesPriority,
<ide> setCurrentUpdateLanePriority,
<ide> function finishConcurrentRender(root, finishedWork, exitStatus, lanes) {
<ide> // We have an acceptable loading state. We need to figure out if we
<ide> // should immediately commit it or wait a bit.
<ide>
<del> // If we have processed new updates during this render, we may now
<del> // have a new loading state ready. We want to ensure that we commit
<del> // that as soon as possible.
<del> const hasNotProcessedNewUpdates =
<del> workInProgressRootLatestProcessedEventTime === NoTimestamp;
<ide> if (
<del> hasNotProcessedNewUpdates &&
<add> includesOnlyRetries(lanes) &&
<ide> // do not delay if we're inside an act() scope
<ide> !shouldForceFlushFallbacksInDEV()
<ide> ) {
<del> // If we have not processed any new updates during this pass, then
<del> // this is either a retry of an existing fallback state or a
<del> // hidden tree. Hidden trees shouldn't be batched with other work
<del> // and after that's fixed it can only be a retry. We're going to
<del> // throttle committing retries so that we don't show too many
<del> // loading states too quickly.
<add> // This render only included retries, no updates. Throttle committing
<add> // retries so that we don't show too many loading states too quickly.
<ide> const msUntilTimeout =
<ide> globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
<ide> // Don't bother with a very short suspense time.
<ide> export function renderDidSuspendDelayIfPossible(): void {
<ide> // this render.
<ide> if (
<ide> workInProgressRoot !== null &&
<del> (hasUpdatePriority(workInProgressRootSkippedLanes) ||
<del> hasUpdatePriority(workInProgressRootUpdatedLanes))
<add> (includesNonIdleWork(workInProgressRootSkippedLanes) ||
<add> includesNonIdleWork(workInProgressRootUpdatedLanes))
<ide> ) {
<ide> // Mark the current render as suspended so that we switch to working on
<ide> // the updates that were skipped. Usually we only suspend at the end of
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.old.js
<ide> import {
<ide> removeLanes,
<ide> pickArbitraryLane,
<ide> hasDiscreteLanes,
<del> hasUpdatePriority,
<add> includesNonIdleWork,
<add> includesOnlyRetries,
<ide> getNextLanes,
<ide> returnNextLanesPriority,
<ide> setCurrentUpdateLanePriority,
<ide> function finishConcurrentRender(root, finishedWork, exitStatus, lanes) {
<ide> // We have an acceptable loading state. We need to figure out if we
<ide> // should immediately commit it or wait a bit.
<ide>
<del> // If we have processed new updates during this render, we may now
<del> // have a new loading state ready. We want to ensure that we commit
<del> // that as soon as possible.
<del> const hasNotProcessedNewUpdates =
<del> workInProgressRootLatestProcessedEventTime === NoTimestamp;
<ide> if (
<del> hasNotProcessedNewUpdates &&
<add> includesOnlyRetries(lanes) &&
<ide> // do not delay if we're inside an act() scope
<ide> !shouldForceFlushFallbacksInDEV()
<ide> ) {
<del> // If we have not processed any new updates during this pass, then
<del> // this is either a retry of an existing fallback state or a
<del> // hidden tree. Hidden trees shouldn't be batched with other work
<del> // and after that's fixed it can only be a retry. We're going to
<del> // throttle committing retries so that we don't show too many
<del> // loading states too quickly.
<add> // This render only included retries, no updates. Throttle committing
<add> // retries so that we don't show too many loading states too quickly.
<ide> const msUntilTimeout =
<ide> globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
<ide> // Don't bother with a very short suspense time.
<ide> export function renderDidSuspendDelayIfPossible(): void {
<ide> // this render.
<ide> if (
<ide> workInProgressRoot !== null &&
<del> (hasUpdatePriority(workInProgressRootSkippedLanes) ||
<del> hasUpdatePriority(workInProgressRootUpdatedLanes))
<add> (includesNonIdleWork(workInProgressRootSkippedLanes) ||
<add> includesNonIdleWork(workInProgressRootUpdatedLanes))
<ide> ) {
<ide> // Mark the current render as suspended so that we switch to working on
<ide> // the updates that were skipped. Usually we only suspend at the end of | 3 |
Java | Java | fix typo in stringutils class | 14a32d13d0e4cc58c0a2446236fa343ce9f0a130 | <ide><path>spring-core/src/main/java/org/springframework/util/StringUtils.java
<ide> public abstract class StringUtils {
<ide>
<ide> /**
<ide> * Check whether the given object (possibly a {@code String}) is empty.
<del> * This is effectly a shortcut for {@code !hasLength(String)}.
<add> * This is effectively a shortcut for {@code !hasLength(String)}.
<ide> * <p>This method accepts any Object as an argument, comparing it to
<ide> * {@code null} and the empty String. As a consequence, this method
<ide> * will never return {@code true} for a non-null non-String object. | 1 |
Java | Java | implement fabricviewstatemanager for modal | 2f6bda19ce95ad22443896975df590408e1dee95 | <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java
<ide> protected void onAfterUpdateTransaction(ReactModalHostView view) {
<ide> @Override
<ide> public Object updateState(
<ide> ReactModalHostView view, ReactStylesDiffMap props, @Nullable StateWrapper stateWrapper) {
<add> view.getFabricViewStateManager().setStateWrapper(stateWrapper);
<ide> Point modalSize = ModalHostHelper.getModalHostSize(view.getContext());
<del> view.updateState(stateWrapper, modalSize.x, modalSize.y);
<add> view.updateState(modalSize.x, modalSize.y);
<ide> return null;
<ide> }
<ide>
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java
<ide> import com.facebook.react.bridge.WritableMap;
<ide> import com.facebook.react.bridge.WritableNativeMap;
<ide> import com.facebook.react.common.annotations.VisibleForTesting;
<add>import com.facebook.react.uimanager.FabricViewStateManager;
<ide> import com.facebook.react.uimanager.JSTouchDispatcher;
<ide> import com.facebook.react.uimanager.PixelUtil;
<ide> import com.facebook.react.uimanager.RootView;
<del>import com.facebook.react.uimanager.StateWrapper;
<ide> import com.facebook.react.uimanager.UIManagerModule;
<ide> import com.facebook.react.uimanager.events.EventDispatcher;
<ide> import com.facebook.react.views.common.ContextUtils;
<ide> * around addition and removal of views to the DialogRootViewGroup.
<ide> * </ol>
<ide> */
<del>public class ReactModalHostView extends ViewGroup implements LifecycleEventListener {
<add>public class ReactModalHostView extends ViewGroup
<add> implements LifecycleEventListener, FabricViewStateManager.HasFabricViewStateManager {
<ide>
<ide> // This listener is called when the user presses KeyEvent.KEYCODE_BACK
<ide> // An event is then passed to JS which can either close or not close the Modal by setting the
<ide> public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
<ide> }
<ide> }
<ide>
<del> @UiThread
<del> public void updateState(StateWrapper stateWrapper, int width, int height) {
<del> mHostView.updateState(stateWrapper, width, height);
<del> }
<del>
<ide> /**
<ide> * Returns the view that will be the root view of the dialog. We are wrapping this in a
<ide> * FrameLayout because this is the system's way of notifying us that the dialog size has changed.
<ide> private void updateProperties() {
<ide> }
<ide> }
<ide>
<add> @Override
<add> public FabricViewStateManager getFabricViewStateManager() {
<add> return mHostView.getFabricViewStateManager();
<add> }
<add>
<add> public void updateState(final int width, final int height) {
<add> mHostView.updateState(width, height);
<add> }
<add>
<ide> /**
<ide> * DialogRootViewGroup is the ViewGroup which contains all the children of a Modal. It gets all
<ide> * child information forwarded from ReactModalHostView and uses that to create children. It is
<ide> private void updateProperties() {
<ide> * styleHeight on the LayoutShadowNode to be the window size. This is done through the
<ide> * UIManagerModule, and will then cause the children to layout as if they can fill the window.
<ide> */
<del> static class DialogRootViewGroup extends ReactViewGroup implements RootView {
<add> static class DialogRootViewGroup extends ReactViewGroup
<add> implements RootView, FabricViewStateManager.HasFabricViewStateManager {
<ide> private boolean hasAdjustedSize = false;
<ide> private int viewWidth;
<ide> private int viewHeight;
<ide>
<del> private @Nullable StateWrapper mStateWrapper;
<add> private final FabricViewStateManager mFabricViewStateManager = new FabricViewStateManager();
<ide>
<ide> private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this);
<ide>
<ide> private void updateFirstChildView() {
<ide> if (getChildCount() > 0) {
<ide> hasAdjustedSize = false;
<ide> final int viewTag = getChildAt(0).getId();
<del> if (mStateWrapper != null) {
<add> if (mFabricViewStateManager.hasStateWrapper()) {
<ide> // This will only be called under Fabric
<del> updateState(mStateWrapper, viewWidth, viewHeight);
<add> updateState(viewWidth, viewHeight);
<ide> } else {
<ide> // TODO: T44725185 remove after full migration to Fabric
<ide> ReactContext reactContext = getReactContext();
<ide> public void runGuarded() {
<ide> }
<ide>
<ide> @UiThread
<del> public void updateState(StateWrapper stateWrapper, int width, int height) {
<del> mStateWrapper = stateWrapper;
<del> WritableMap map = new WritableNativeMap();
<del> map.putDouble("screenWidth", PixelUtil.toDIPFromPixel(width));
<del> map.putDouble("screenHeight", PixelUtil.toDIPFromPixel(height));
<del> stateWrapper.updateState(map);
<add> public void updateState(final int width, final int height) {
<add> mFabricViewStateManager.setState(
<add> new FabricViewStateManager.StateUpdateCallback() {
<add> @Override
<add> public WritableMap getStateUpdate() {
<add> WritableMap map = new WritableNativeMap();
<add> map.putDouble("screenWidth", PixelUtil.toDIPFromPixel(width));
<add> map.putDouble("screenHeight", PixelUtil.toDIPFromPixel(height));
<add> return map;
<add> }
<add> });
<ide> }
<ide>
<ide> @Override
<ide> private EventDispatcher getEventDispatcher() {
<ide> ReactContext reactContext = getReactContext();
<ide> return reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
<ide> }
<add>
<add> @Override
<add> public FabricViewStateManager getFabricViewStateManager() {
<add> return mFabricViewStateManager;
<add> }
<ide> }
<ide> } | 2 |
Ruby | Ruby | use content_tag instead strings | 2bc879a43d1b7b97de871d993d1bd63414e83677 | <ide><path>actionpack/lib/action_view/helpers/tags/base.rb
<ide> def select_content_tag(option_tags, options, html_options)
<ide>
<ide> def add_options(option_tags, options, value = nil)
<ide> if options[:include_blank]
<del> option_tags = "<option value=\"\">#{ERB::Util.html_escape(options[:include_blank]) if options[:include_blank].kind_of?(String)}</option>\n" + option_tags
<add> include_blank = options[:include_blank] if options[:include_blank].kind_of?(String)
<add> option_tags = content_tag(:option, include_blank, :value => '').safe_concat("\n").safe_concat(option_tags)
<ide> end
<ide> if value.blank? && options[:prompt]
<ide> prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('helpers.select.prompt', :default => 'Please select')
<del> option_tags = "<option value=\"\">#{ERB::Util.html_escape(prompt)}</option>\n" + option_tags
<add> option_tags = content_tag(:option, prompt, :value => '').safe_concat("\n").safe_concat(option_tags)
<ide> end
<del> option_tags.html_safe
<add> option_tags
<ide> end
<ide> end
<ide> end | 1 |
Ruby | Ruby | return exit code from internal commands | bd334c55a00d006168c767ea0442df7d6a1954ea | <ide><path>Library/brew.rb
<ide> def require? path
<ide>
<ide> if internal_cmd
<ide> Homebrew.send cmd.to_s.gsub('-', '_').downcase
<add> exit 1 if Homebrew.failed?
<ide> elsif which "brew-#{cmd}"
<ide> %w[CACHE CELLAR LIBRARY_PATH PREFIX REPOSITORY].each do |e|
<ide> ENV["HOMEBREW_#{e}"] = Object.const_get("HOMEBREW_#{e}").to_s | 1 |
PHP | PHP | change exceptions to ignore | 68738b50150ed2268b2c8110fa3317be5c97d113 | <ide><path>app/Exceptions/Handler.php
<ide> namespace App\Exceptions;
<ide>
<ide> use Exception;
<del>use Illuminate\Auth\Access\UnauthorizedException;
<add>use Illuminate\Auth\Access\AuthorizationException;
<ide> use Illuminate\Database\Eloquent\ModelNotFoundException;
<ide> use Symfony\Component\HttpKernel\Exception\HttpException;
<ide> use Illuminate\Foundation\Validation\ValidationException;
<ide> class Handler extends ExceptionHandler
<ide> */
<ide> protected $dontReport = [
<ide> HttpException::class,
<add> AuthorizationException::class,
<ide> ModelNotFoundException::class,
<del> UnauthorizedException::class,
<ide> ValidationException::class,
<ide> ];
<ide> | 1 |
Text | Text | add section about composed commands | 9aee7d4b381664cb4876f620a97049738410f728 | <ide><path>docs/advanced/keymaps.md
<ide> given focus context. Commands are "humanized" following a simple algorithm, so a
<ide> command like `editor:fold-current-row` would appear as "Editor: Fold Current
<ide> Row".
<ide>
<add>### "Composed" Commands
<add>
<add>A common question is, "How do I make a single keybinding execute two or more
<add>commands?" There isn't any direct support for this in Atom, but it can be
<add>achieved by creating a custom command that performs the multiple actions
<add>you desire and then creating a keybinding for that command. For example, let's
<add>say I want to create a "composed" command that performs a Select Line followed
<add>by Cut. You could add the following to your `init.coffee`:
<add>
<add>```coffee
<add>atom.commands.add 'atom-text-editor', 'custom:cut-line', ->
<add> editor = atom.workspace.getActiveTextEditor()
<add> editor.selectLinesContainingCursors()
<add> editor.cutSelectedText()
<add>```
<add>
<add>Then let's say we want to map this custom command to `alt-ctrl-z`, you could
<add>add the following to your keymap:
<add>
<add>```coffee
<add>'atom-text-editor':
<add> 'alt-ctrl-z': 'custom:cut-line'
<add>```
<add>
<ide> ### Specificity and Cascade Order
<ide>
<ide> As is the case with CSS applying styles, when multiple bindings match for a | 1 |
Javascript | Javascript | assert empty maps when there are no roots | b6a55989f50d21bd916049888c81a311589c6168 | <ide><path>src/__tests__/storeSerializer.js
<ide> export function printStore(store, includeWeight = false) {
<ide> );
<ide> }
<ide>
<add> if (store.roots.length === 0) {
<add> store.assertEmptyMaps();
<add> }
<add>
<ide> return snapshotLines.join('\n');
<ide> }
<ide><path>src/devtools/store.js
<ide> export default class Store extends EventEmitter {
<ide> this._profilingCache = new ProfilingCache(bridge, this);
<ide> }
<ide>
<add> assertEmptyMaps() {
<add> // This is only used in tests to avoid memory leaks.
<add> if (this._idToElement.size !== 0) {
<add> throw new Error('Expected _idToElement to be empty.');
<add> }
<add> if (this._ownersMap.size !== 0) {
<add> throw new Error('Expected _ownersMap to be empty.');
<add> }
<add> if (this._profilingOperations.size !== 0) {
<add> throw new Error('Expected _profilingOperations to be empty.');
<add> }
<add> if (this._profilingScreenshots.size !== 0) {
<add> throw new Error('Expected _profilingScreenshots to be empty.');
<add> }
<add> if (this._profilingSnapshot.size !== 0) {
<add> throw new Error('Expected _profilingSnapshot to be empty.');
<add> }
<add> if (this._rootIDToCapabilities.size !== 0) {
<add> throw new Error('Expected _rootIDToCapabilities to be empty.');
<add> }
<add> if (this._rootIDToRendererID.size !== 0) {
<add> throw new Error('Expected _rootIDToRendererID to be empty.');
<add> }
<add> }
<add>
<ide> get captureScreenshots(): boolean {
<ide> return this._captureScreenshots;
<ide> } | 2 |
Javascript | Javascript | fix minor bug in exponent notation interpolation | e60bc4d525267bd9ba0619263cba2a5b69d9db48 | <ide><path>d3.js
<ide> d3.interpolateObject = function(a, b) {
<ide> };
<ide> }
<ide>
<del>var d3_interpolate_number = /[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,
<add>var d3_interpolate_number = /[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-+]?\d+)?/g,
<ide> d3_interpolate_rgb = {background: 1, fill: 1, stroke: 1};
<ide>
<ide> function d3_interpolateByName(n) {
<ide><path>d3.min.js
<del>(function(){function e(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function f(a){return Array.prototype.slice.call(a)}function i(){return this}function j(a){return a!=null&&!isNaN(a)}function k(a){return a.length}function l(a){return a==null}function m(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function o(a){var b={},c=[];return b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;return c.push({listener:a,on:!0}),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)}},b}function r(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function s(a){return a+""}function t(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 v(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function A(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function B(a){return function(b){return 1-a(1-b)}}function C(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function D(a){return a}function E(a){return function(b){return Math.pow(b,a)}}function F(a){return 1-Math.cos(a*Math.PI/2)}function G(a){return Math.pow(2,10*(a-1))}function H(a){return 1-Math.sqrt(1-a*a)}function I(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function J(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function K(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 N(a){return a in M||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function O(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function P(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function Q(a,b,c){return new R(a,b,c)}function R(a,b,c){this.r=a,this.g=b,this.b=c}function S(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function T(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(V(h[0]),V(h[1]),V(h[2]))}}return(i=W[a])?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function U(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,Y(g,h,i)}function V(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function Y(a,b,c){return new Z(a,b,c)}function Z(a,b,c){this.h=a,this.s=b,this.l=c}function $(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,Q(g(a+120),g(a),g(a-120))}function _(a){return h(a,bc),a}function bd(a){return function(){return ba(a,this)}}function be(a){return function(){return bb(a,this)}}function bg(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=m(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=m(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bh(a){return{__data__:a}}function bi(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bk(a){return h(a,bl),a}function bm(a,b,c){h(a,bq);var d={},e=d3.dispatch("start","end"),f=bt;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d[b]:(c==null?delete d[b]:d[b]=c,a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bu.call(a,b):(e[b].add(c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){if(o.active>b)return r();o.active=b;for(var f in d)(f=d[f].call(l,h,i))&&k.push(f);return e.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,c),1}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bs=b,e.end.dispatch.call(l,h,i),bs=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bo(a,b,c){return c!=""&&bn}function bp(a){function b(b,c,d){var e=a.call(this,b,c);return e==null?d!=""&&bn:d!=e&&d3.interpolate(d,e)}function c(b,c,d){return d!=a&&d3.interpolate(d,a)}return typeof a=="function"?b:a==null?bo:(a+="",c)}function bu(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function by(){var a,b=Date.now(),c=bv;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bz()-b;d>24?(isFinite(d)&&(clearTimeout(bx),bx=setTimeout(by,d)),bw=0):(bw=1,bA(by))}function bz(){var a=null,b=bv,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bv=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bB(){}function bC(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bD(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bE(){return Math}function bF(a,b,c,d){function g(){var g=a.length==2?bL:bM,i=d?P:O;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return bJ(a,b)},h.tickFormat=function(b){return bK(a,b)},h.nice=function(){return bD(a,bH),g()},h.copy=function(){return bF(a,b,c,d)},g()}function bG(a,b){return a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp),a}function bH(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bI(a,b){var c=bC(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function bJ(a,b){return d3.range.apply(d3,bI(a,b))}function bK(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bI(a,b)[2])/Math.LN10+.01))+"f")}function bL(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bM(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bN(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=function(e){return arguments.length?(b=e[0]<0?bQ:bP,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(bD(a.domain(),bE)),d},d.ticks=function(){var d=bC(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=Math.round(c(d[0])),i=Math.round(c(d[1]));if(b===bQ){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=bO);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===bQ?(h=-1e-15,Math.floor):(h=1e-15,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return bN(a.copy(),b)},bG(d,a)}function bP(a){return Math.log(a)/Math.LN10}function bQ(a){return-Math.log(-a)/Math.LN10}function bR(a,b){function e(b){return a(c(b))}var c=bS(b),d=bS(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return bJ(e.domain(),a)},e.tickFormat=function(a){return bK(e.domain(),a)},e.nice=function(){return e.domain(bD(e.domain(),bH))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=bS(b=a),d=bS(1/b),e.domain(f)},e.copy=function(){return bR(a.copy(),b)},bG(e,a)}function bS(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function bT(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length-1+g);return d=a.length<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,b={t:"rangePoints",x:c,p:g},f},f.rangeBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length+g);return d=d3.range(h+j*g,i,j),e=j*(1-g),b={t:"rangeBands",x:c,p:g},f},f.rangeRoundBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=Math.floor((i-h)/(a.length+g)),k=i-h-(a.length-g)*j;return d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),b={t:"rangeRoundBands",x:c,p:g},f},f.rangeBand=function(){return e},f.copy=function(){return bT(a,b)},f.domain(a)}function bY(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return bY(a,b)},d()}function bZ(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return bZ(a,b,c)},g()}function ca(a){return a.innerRadius}function cb(a){return a.outerRadius}function cc(a){return a.startAngle}function cd(a){return a.endAngle}function ce(a){function g(d){return d.length<1?null:"M"+e(a(cf(this,d,b,c)),f)}var b=cg,c=ch,d="linear",e=ci[d],f=.7;return g.x=function(a){return arguments.length?(b=a,g):b},g.y=function(a){return arguments.length?(c=a,g):c},g.interpolate=function(a){return arguments.length?(e=ci[d=a],g):d},g.tension=function(a){return arguments.length?(f=a,g):f},g}function cf(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 cg(a){return a[0]}function ch(a){return a[1]}function cj(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function ck(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cl(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function cm(a,b){return a.length<4?cj(a):a[1]+cp(a.slice(1,a.length-1),cq(a,b))}function cn(a,b){return a.length<3?cj(a):a[0]+cp((a.push(a[0]),a),cq([a[a.length-2]].concat(a,[a[1]]),b))}function co(a,b,c){return a.length<3?cj(a):a[0]+cp(a,cq(a,b))}function cp(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cj(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 cq(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 cr(a){if(a.length<3)return cj(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];cz(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cz(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cz(i,g,h);return i.join("")}function cs(a){if(a.length<4)return cj(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cv(cy,f)+","+cv(cy,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cz(b,f,g);return b.join("")}function ct(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=[cv(cy,g),",",cv(cy,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cz(b,g,h);return b.join("")}function cu(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cr(a)}function cv(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cz(a,b,c){a.push("C",cv(cw,b),",",cv(cw,c),",",cv(cx,b),",",cv(cx,c),",",cv(cy,b),",",cv(cy,c))}function cA(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cB(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cA(e,f);while(++b<c)d[b]=g+(g=cA(e=f,f=a[b+1]));return d[b]=g,d}function cC(a){var b=[],c,d,e,f,g=cB(a),h=-1,i=a.length-1;while(++h<i)c=cA(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cD(a){return a.length<3?cj(a):a[0]+cp(a,cC(a))}function cE(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+b$,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cF(a){function j(f){if(f.length<1)return null;var j=cf(this,f,b,d),k=cf(this,f,b===c?cG(j):c,d===e?cH(j):e);return"M"+g(a(k),i)+"L"+h(a(j.reverse()),i)+"Z"}var b=cg,c=cg,d=0,e=ch,f,g,h,i=.7;return j.x=function(a){return arguments.length?(b=c=a,j):c},j.x0=function(a){return arguments.length?(b=a,j):b},j.x1=function(a){return arguments.length?(c=a,j):c},j.y=function(a){return arguments.length?(d=e=a,j):e},j.y0=function(a){return arguments.length?(d=a,j):d},j.y1=function(a){return arguments.length?(e=a,j):e},j.interpolate=function(a){return arguments.length?(g=ci[f=a],h=g.reverse||g,j):f},j.tension=function(a){return arguments.length?(i=a,j):i},j.interpolate("linear")}function cG(a){return function(b,c){return a[c][0]}}function cH(a){return function(b,c){return a[c][1]}}function cI(a){return a.source}function cJ(a){return a.target}function cK(a){return a.radius}function cL(a){return a.startAngle}function cM(a){return a.endAngle}function cN(a){return[a.x,a.y]}function cO(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+b$;return[c*Math.cos(d),c*Math.sin(d)]}}function cQ(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(cP<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();cP=!e.f&&!e.e,d.remove()}return cP?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse()),[c.x,c.y]}function cR(){return 64}function cS(){return"circle"}function cW(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function cX(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function cY(a,b,c){e=[];if(c&&b.length>1){var d=bC(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function de(a){var b=d3.event,c=c_.parentNode,d=0,e=0;c&&(c=df(c),d=c[0]-db[0],e=c[1]-db[1],db=c,dc|=d|e);try{d3.event={dx:d,dy:e},cZ[a].dispatch.apply(c_,da)}finally{d3.event=b}b.preventDefault()}function df(a){return d3.event.touches?d3.svg.touches(a)[0]:d3.svg.mouse(a)}function dg(){if(!c_)return;var a=c_.parentNode;if(!a)return dh();de("drag"),dj()}function dh(){if(!c_)return;de("dragend"),c_=null,dc&&c$===d3.event.target&&(dd=!0,dj())}function di(){dd&&c$===d3.event.target&&(dj(),dd=!1,c$=null)}function dj(){d3.event.stopPropagation(),d3.event.preventDefault()}function dx(a){return[a[0]-dq[0],a[1]-dq[1],dq[2]]}function dy(){dk||(dk=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dk.scrollTop=1e3,dk.dispatchEvent(a),b=1e3-dk.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function dz(){var a=d3.svg.touches(dt),b=-1,c=a.length,d;while(++b<c)dn[(d=a[b]).identifier]=dx(d);return a}function dA(){var a=d3.svg.touches(dt);switch(a.length){case 1:var b=a[0];dE(dq[2],b,dn[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=dn[c.identifier],g=dn[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];dE(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function dB(){dm=null,dl&&(dv=!0,dE(dq[2],d3.svg.mouse(dt),dl))}function dC(){dl&&(dv&&ds===d3.event.target&&(dw=!0),dB(),dl=null)}function dD(){dw&&ds===d3.event.target&&(d3.event.stopPropagation(),d3.event.preventDefault(),dw=!1,ds=null)}function dE(a,b,c){function i(a,b){var c=a.__domain||(a.__domain=a.domain()),d=a.range().map(function(a){return(a-b)/h});a.domain(c).domain(d.map(a.invert))}var d=Math.pow(2,(dq[2]=a)-c[2]),e=dq[0]=b[0]-d*c[0],f=dq[1]=b[1]-d*c[1],g=d3.event,h=Math.pow(2,a);d3.event={scale:h,translate:[e,f],transform:function(a,b){a&&i(a,e),b&&i(b,f)}};try{dr.apply(dt,du)}finally{d3.event=g}g.preventDefault()}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.4.6"};var d=f;try{d(document.documentElement.childNodes)[0].nodeType}catch(g){d=e}var h=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)j(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)j(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(j),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,k),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=l);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(n,"\\$&")};var n=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=o(c);return b},d3.format=function(a){var b=p.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=q[i]||s,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=t(a)),a=b+a}else{g&&(a=t(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var p=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,q={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=r(a,b)).toFixed(Math.max(0,Math.min(20,b)))}},u=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(v);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,r(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),u[8+c/3]};var w=E(2),x=E(3),y={linear:function(){return D},poly:E,quad:function(){return w},cubic:function(){return x},sin:function(){return F},exp:function(){return G},circle:function(){return H},elastic:I,back:J,bounce:function(){return K}},z={"in":function(a){return a},out:B,"in-out":C,"out-in":function(a){return C(B(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 A(z[d](y[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;L.lastIndex=0;for(d=0;c=L.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=L.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=L.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+S(Math.round(c+f*a))+S(Math.round(d+g*a))+S(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 $(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]=N(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 L=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,M={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in W||/^(#|rgb\(|hsl\()/.test(b):b instanceof R||b instanceof Z)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof R?Q(a.r,a.g,a.b):T(""+a,Q,$):Q(~~a,~~b,~~c)},R.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?Q(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),Q(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},R.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Q(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},R.prototype.hsl=function(){return U(this.r,this.g,this.b)},R.prototype.toString=function(){return"#"+S(this.r)+S(this.g)+S(this.b)};var W={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 X in W)W[X]=T(W[X],Q,$);d3.hsl=function(a,b,c){return arguments.length===1?a instanceof Z?Y(a.h,a.s,a.l):T(""+a,U,Y):Y(+a,+b,+c)},Z.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),Y(this.h,this.s,this.l/a)},Z.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Y(this.h,this.s,a*this.l)},Z.prototype.rgb=function(){return $(this.h,this.s,this.l)},Z.prototype.toString=function(){return this.rgb().toString()};var ba=function(a,b){return b.querySelector(a)},bb=function(a,b){return b.querySelectorAll
<add>(function(){function e(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function f(a){return Array.prototype.slice.call(a)}function i(){return this}function j(a){return a!=null&&!isNaN(a)}function k(a){return a.length}function l(a){return a==null}function m(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function o(a){var b={},c=[];return b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;return c.push({listener:a,on:!0}),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)}},b}function r(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function s(a){return a+""}function t(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 v(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function A(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function B(a){return function(b){return 1-a(1-b)}}function C(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function D(a){return a}function E(a){return function(b){return Math.pow(b,a)}}function F(a){return 1-Math.cos(a*Math.PI/2)}function G(a){return Math.pow(2,10*(a-1))}function H(a){return 1-Math.sqrt(1-a*a)}function I(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function J(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function K(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 N(a){return a in M||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function O(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function P(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function Q(a,b,c){return new R(a,b,c)}function R(a,b,c){this.r=a,this.g=b,this.b=c}function S(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function T(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(V(h[0]),V(h[1]),V(h[2]))}}return(i=W[a])?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function U(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,Y(g,h,i)}function V(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function Y(a,b,c){return new Z(a,b,c)}function Z(a,b,c){this.h=a,this.s=b,this.l=c}function $(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,Q(g(a+120),g(a),g(a-120))}function _(a){return h(a,bc),a}function bd(a){return function(){return ba(a,this)}}function be(a){return function(){return bb(a,this)}}function bg(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=m(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=m(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bh(a){return{__data__:a}}function bi(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bk(a){return h(a,bl),a}function bm(a,b,c){h(a,bq);var d={},e=d3.dispatch("start","end"),f=bt;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d[b]:(c==null?delete d[b]:d[b]=c,a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bu.call(a,b):(e[b].add(c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){if(o.active>b)return r();o.active=b;for(var f in d)(f=d[f].call(l,h,i))&&k.push(f);return e.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,c),1}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bs=b,e.end.dispatch.call(l,h,i),bs=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bo(a,b,c){return c!=""&&bn}function bp(a){function b(b,c,d){var e=a.call(this,b,c);return e==null?d!=""&&bn:d!=e&&d3.interpolate(d,e)}function c(b,c,d){return d!=a&&d3.interpolate(d,a)}return typeof a=="function"?b:a==null?bo:(a+="",c)}function bu(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function by(){var a,b=Date.now(),c=bv;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bz()-b;d>24?(isFinite(d)&&(clearTimeout(bx),bx=setTimeout(by,d)),bw=0):(bw=1,bA(by))}function bz(){var a=null,b=bv,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bv=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bB(){}function bC(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bD(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bE(){return Math}function bF(a,b,c,d){function g(){var g=a.length==2?bL:bM,i=d?P:O;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return bJ(a,b)},h.tickFormat=function(b){return bK(a,b)},h.nice=function(){return bD(a,bH),g()},h.copy=function(){return bF(a,b,c,d)},g()}function bG(a,b){return a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp),a}function bH(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bI(a,b){var c=bC(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function bJ(a,b){return d3.range.apply(d3,bI(a,b))}function bK(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bI(a,b)[2])/Math.LN10+.01))+"f")}function bL(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bM(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bN(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=function(e){return arguments.length?(b=e[0]<0?bQ:bP,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(bD(a.domain(),bE)),d},d.ticks=function(){var d=bC(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=Math.round(c(d[0])),i=Math.round(c(d[1]));if(b===bQ){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=bO);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===bQ?(h=-1e-15,Math.floor):(h=1e-15,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return bN(a.copy(),b)},bG(d,a)}function bP(a){return Math.log(a)/Math.LN10}function bQ(a){return-Math.log(-a)/Math.LN10}function bR(a,b){function e(b){return a(c(b))}var c=bS(b),d=bS(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return bJ(e.domain(),a)},e.tickFormat=function(a){return bK(e.domain(),a)},e.nice=function(){return e.domain(bD(e.domain(),bH))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=bS(b=a),d=bS(1/b),e.domain(f)},e.copy=function(){return bR(a.copy(),b)},bG(e,a)}function bS(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function bT(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length-1+g);return d=a.length<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,b={t:"rangePoints",x:c,p:g},f},f.rangeBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length+g);return d=d3.range(h+j*g,i,j),e=j*(1-g),b={t:"rangeBands",x:c,p:g},f},f.rangeRoundBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=Math.floor((i-h)/(a.length+g)),k=i-h-(a.length-g)*j;return d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),b={t:"rangeRoundBands",x:c,p:g},f},f.rangeBand=function(){return e},f.copy=function(){return bT(a,b)},f.domain(a)}function bY(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return bY(a,b)},d()}function bZ(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return bZ(a,b,c)},g()}function ca(a){return a.innerRadius}function cb(a){return a.outerRadius}function cc(a){return a.startAngle}function cd(a){return a.endAngle}function ce(a){function g(d){return d.length<1?null:"M"+e(a(cf(this,d,b,c)),f)}var b=cg,c=ch,d="linear",e=ci[d],f=.7;return g.x=function(a){return arguments.length?(b=a,g):b},g.y=function(a){return arguments.length?(c=a,g):c},g.interpolate=function(a){return arguments.length?(e=ci[d=a],g):d},g.tension=function(a){return arguments.length?(f=a,g):f},g}function cf(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 cg(a){return a[0]}function ch(a){return a[1]}function cj(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function ck(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cl(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function cm(a,b){return a.length<4?cj(a):a[1]+cp(a.slice(1,a.length-1),cq(a,b))}function cn(a,b){return a.length<3?cj(a):a[0]+cp((a.push(a[0]),a),cq([a[a.length-2]].concat(a,[a[1]]),b))}function co(a,b,c){return a.length<3?cj(a):a[0]+cp(a,cq(a,b))}function cp(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cj(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 cq(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 cr(a){if(a.length<3)return cj(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];cz(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cz(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cz(i,g,h);return i.join("")}function cs(a){if(a.length<4)return cj(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cv(cy,f)+","+cv(cy,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cz(b,f,g);return b.join("")}function ct(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=[cv(cy,g),",",cv(cy,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cz(b,g,h);return b.join("")}function cu(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cr(a)}function cv(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cz(a,b,c){a.push("C",cv(cw,b),",",cv(cw,c),",",cv(cx,b),",",cv(cx,c),",",cv(cy,b),",",cv(cy,c))}function cA(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cB(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cA(e,f);while(++b<c)d[b]=g+(g=cA(e=f,f=a[b+1]));return d[b]=g,d}function cC(a){var b=[],c,d,e,f,g=cB(a),h=-1,i=a.length-1;while(++h<i)c=cA(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cD(a){return a.length<3?cj(a):a[0]+cp(a,cC(a))}function cE(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+b$,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cF(a){function j(f){if(f.length<1)return null;var j=cf(this,f,b,d),k=cf(this,f,b===c?cG(j):c,d===e?cH(j):e);return"M"+g(a(k),i)+"L"+h(a(j.reverse()),i)+"Z"}var b=cg,c=cg,d=0,e=ch,f,g,h,i=.7;return j.x=function(a){return arguments.length?(b=c=a,j):c},j.x0=function(a){return arguments.length?(b=a,j):b},j.x1=function(a){return arguments.length?(c=a,j):c},j.y=function(a){return arguments.length?(d=e=a,j):e},j.y0=function(a){return arguments.length?(d=a,j):d},j.y1=function(a){return arguments.length?(e=a,j):e},j.interpolate=function(a){return arguments.length?(g=ci[f=a],h=g.reverse||g,j):f},j.tension=function(a){return arguments.length?(i=a,j):i},j.interpolate("linear")}function cG(a){return function(b,c){return a[c][0]}}function cH(a){return function(b,c){return a[c][1]}}function cI(a){return a.source}function cJ(a){return a.target}function cK(a){return a.radius}function cL(a){return a.startAngle}function cM(a){return a.endAngle}function cN(a){return[a.x,a.y]}function cO(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+b$;return[c*Math.cos(d),c*Math.sin(d)]}}function cQ(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(cP<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();cP=!e.f&&!e.e,d.remove()}return cP?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse()),[c.x,c.y]}function cR(){return 64}function cS(){return"circle"}function cW(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function cX(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function cY(a,b,c){e=[];if(c&&b.length>1){var d=bC(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function de(a){var b=d3.event,c=c_.parentNode,d=0,e=0;c&&(c=df(c),d=c[0]-db[0],e=c[1]-db[1],db=c,dc|=d|e);try{d3.event={dx:d,dy:e},cZ[a].dispatch.apply(c_,da)}finally{d3.event=b}b.preventDefault()}function df(a){return d3.event.touches?d3.svg.touches(a)[0]:d3.svg.mouse(a)}function dg(){if(!c_)return;var a=c_.parentNode;if(!a)return dh();de("drag"),dj()}function dh(){if(!c_)return;de("dragend"),c_=null,dc&&c$===d3.event.target&&(dd=!0,dj())}function di(){dd&&c$===d3.event.target&&(dj(),dd=!1,c$=null)}function dj(){d3.event.stopPropagation(),d3.event.preventDefault()}function dx(a){return[a[0]-dq[0],a[1]-dq[1],dq[2]]}function dy(){dk||(dk=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dk.scrollTop=1e3,dk.dispatchEvent(a),b=1e3-dk.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function dz(){var a=d3.svg.touches(dt),b=-1,c=a.length,d;while(++b<c)dn[(d=a[b]).identifier]=dx(d);return a}function dA(){var a=d3.svg.touches(dt);switch(a.length){case 1:var b=a[0];dE(dq[2],b,dn[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=dn[c.identifier],g=dn[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];dE(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function dB(){dm=null,dl&&(dv=!0,dE(dq[2],d3.svg.mouse(dt),dl))}function dC(){dl&&(dv&&ds===d3.event.target&&(dw=!0),dB(),dl=null)}function dD(){dw&&ds===d3.event.target&&(d3.event.stopPropagation(),d3.event.preventDefault(),dw=!1,ds=null)}function dE(a,b,c){function i(a,b){var c=a.__domain||(a.__domain=a.domain()),d=a.range().map(function(a){return(a-b)/h});a.domain(c).domain(d.map(a.invert))}var d=Math.pow(2,(dq[2]=a)-c[2]),e=dq[0]=b[0]-d*c[0],f=dq[1]=b[1]-d*c[1],g=d3.event,h=Math.pow(2,a);d3.event={scale:h,translate:[e,f],transform:function(a,b){a&&i(a,e),b&&i(b,f)}};try{dr.apply(dt,du)}finally{d3.event=g}g.preventDefault()}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.4.6"};var d=f;try{d(document.documentElement.childNodes)[0].nodeType}catch(g){d=e}var h=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)j(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)j(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(j),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,k),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=l);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(n,"\\$&")};var n=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=o(c);return b},d3.format=function(a){var b=p.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=q[i]||s,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=t(a)),a=b+a}else{g&&(a=t(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var p=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,q={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=r(a,b)).toFixed(Math.max(0,Math.min(20,b)))}},u=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(v);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,r(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),u[8+c/3]};var w=E(2),x=E(3),y={linear:function(){return D},poly:E,quad:function(){return w},cubic:function(){return x},sin:function(){return F},exp:function(){return G},circle:function(){return H},elastic:I,back:J,bounce:function(){return K}},z={"in":function(a){return a},out:B,"in-out":C,"out-in":function(a){return C(B(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 A(z[d](y[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;L.lastIndex=0;for(d=0;c=L.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=L.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=L.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+S(Math.round(c+f*a))+S(Math.round(d+g*a))+S(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 $(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]=N(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 L=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-+]?\d+)?/g,M={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in W||/^(#|rgb\(|hsl\()/.test(b):b instanceof R||b instanceof Z)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof R?Q(a.r,a.g,a.b):T(""+a,Q,$):Q(~~a,~~b,~~c)},R.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?Q(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),Q(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},R.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Q(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},R.prototype.hsl=function(){return U(this.r,this.g,this.b)},R.prototype.toString=function(){return"#"+S(this.r)+S(this.g)+S(this.b)};var W={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 X in W)W[X]=T(W[X],Q,$);d3.hsl=function(a,b,c){return arguments.length===1?a instanceof Z?Y(a.h,a.s,a.l):T(""+a,U,Y):Y(+a,+b,+c)},Z.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),Y(this.h,this.s,this.l/a)},Z.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Y(this.h,this.s,a*this.l)},Z.prototype.rgb=function(){return $(this.h,this.s,this.l)},Z.prototype.toString=function(){return this.rgb().toString()};var ba=function(a,b){return b.querySelector(a)},bb=function(a,b){return b.querySelectorAll
<ide> (a)};typeof Sizzle=="function"&&(ba=function(a,b){return Sizzle(a,b)[0]},bb=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var bc=[];d3.selection=function(){return bj},d3.selection.prototype=bc,bc.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bd(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return _(b)},bc.selectAll=function(a){var b=[],c,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i])b.push(c=d(a.call(e,e.__data__,i))),c.parentNode=e;return _(b)},bc.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},bc.classed=function(a,b){var c=a.split(bf),d=c.length,e=-1;if(arguments.length>1){while(++e<d)bg.call(this,c[e],b);return this}while(++e<d)if(!bg.call(this,c[e]))return!1;return!0};var bf=/\s+/g;bc.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bc.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bc.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})},bc.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})},bc.append=function(a){function b(){return this.appendChild(document.createElement(a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bc.insert=function(a,b){function c(){return this.insertBefore(document.createElement(a),ba(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),ba(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bc.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bc.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bh(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bh(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bh(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=_(d);return j.enter=function(){return bk(c)},j.exit=function(){return _(e)},j},bc.filter=function(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return _(b)},bc.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},bc.sort=function(a){a=bi.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this},bc.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bc.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bc.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bc.empty=function(){return!this.node()},bc.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bc.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bm(a,bs||++br,Date.now())};var bj=_([[document]]);bj[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?bj.select(a):_([[a]])},d3.selectAll=function(a){return typeof a=="string"?bj.selectAll(a):_([d(a)])};var bl=[];bl.append=bc.append,bl.insert=bc.insert,bl.empty=bc.empty,bl.node=bc.node,bl.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return _(b)};var bn={},bq=[],br=0,bs=0,bt=d3.ease("cubic-in-out");bq.call=bc.call,d3.transition=function(){return bj.transition()},d3.transition.prototype=bq,bq.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bd(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bm(b,this.id,this.time).ease(this.ease())},bq.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return bm(b,this.id,this.time).ease(this.ease())},bq.attr=function(a,b){return this.attrTween(a,bp(b))},bq.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bn?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bn?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bq.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bp(b),c)},bq.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bn?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bq.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bq.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bq.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},bq.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},bq.transition=function(){return this.select(i)};var bv=null,bw,bx;d3.timer=function(a,b,c){var d=!1,e,f=bv;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bv={callback:a,then:c,delay:b,next:bv}),bw||(bx=clearTimeout(bx),bw=1,bA(by))},d3.timer.flush=function(){var a,b=Date.now(),c=bv;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bz()};var bA=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bF([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return bN(d3.scale.linear(),bP)};var bO=d3.format("e");bP.pow=function(a){return Math.pow(10,a)},bQ.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return bR(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return bT([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(bU)},d3.scale.category20=function(){return d3.scale.ordinal().range(bV)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bW)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bX)};var bU=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bV=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bW=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bX=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return bY([],[])},d3.scale.quantize=function(){return bZ(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+b$,h=d.apply(this,arguments)+b$,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=b_?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ca,b=cb,c=cc,d=cd;return e.innerRadius=function(b){return arguments.length?(a=d3.functor(b),e):a},e.outerRadius=function(a){return arguments.length?(b=d3.functor(a),e):b},e.startAngle=function(a){return arguments.length?(c=d3.functor(a),e):c},e.endAngle=function(a){return arguments.length?(d=d3.functor(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+b$;return[Math.cos(f)*e,Math.sin(f)*e]},e};var b$=-Math.PI/2,b_=2*Math.PI-1e-6;d3.svg.line=function(){return ce(Object)};var ci={linear:cj,"step-before":ck,"step-after":cl,basis:cr,"basis-open":cs,"basis-closed":ct,bundle:cu,cardinal:co,"cardinal-open":cm,"cardinal-closed":cn,monotone:cD},cw=[0,2/3,1/3,0],cx=[0,1/3,2/3,0],cy=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=ce(cE);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},ck.reverse=cl,cl.reverse=ck,d3.svg.area=function(){return cF(Object)},d3.svg.area.radial=function(){var a=cF(cE);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(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"}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)+b$,k=e.call(a,h,g)+b$;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=cI,b=cJ,c=cK,d=cc,e=cd;return f.radius=function(a){return arguments.length?(c=d3.functor(a),f):c},f.source=function(b){return arguments.length?(a=d3.functor(b),f):a},f.target=function(a){return arguments.length?(b=d3.functor(a),f):b},f.startAngle=function(a){return arguments.length?(d=d3.functor(a),f):d},f.endAngle=function(a){return arguments.length?(e=d3.functor(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cI,b=cJ,c=cN;return d.source=function(b){return arguments.length?(a=d3.functor(b),d):a},d.target=function(a){return arguments.length?(b=d3.functor(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cN,c=a.projection;return a.projection=function(a){return arguments.length?c(cO(b=a)):b},a},d3.svg.mouse=function(a){return cQ(a,d3.event)};var cP=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.touches;return b?d(b).map(function(b){var c=cQ(a,b);return c.identifier=b.identifier,c}):[]},d3.svg.symbol=function(){function c(c,d){return(cT[a.call(this,c,d)]||cT.circle)(b.call(this,c,d))}var a=cS,b=cR;return c.type=function(b){return arguments.length?(a=d3.functor(b),c):a},c.size=function(a){return arguments.length?(b=d3.functor(a),c):b},c};var cT={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*cV)),c=b*cV;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/cU),c=b*cU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cT);var cU=Math.sqrt(3),cV=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bs;try{return bs=j.id,a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bs=b}}:Object,p=a.ticks.apply(a,g),q=h==null?a.tickFormat.apply(a,g):h,r=cY(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("svg:g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bC(a.range()),C=n.selectAll(".domain").data([0]),D=C.enter().append("svg:path").attr("class","domain"),E=o(C),F=this.__chart__||a;this.__chart__=a.copy(),x.append("svg:line").attr("class","tick"),x.append("svg:text"),z.select("text").text(q);switch(b){case"bottom":A=cW,v.attr("x2",0).attr("y2",d),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=cW,v.attr("x2",0).attr("y2",-d),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=cX,v.attr("x2",-d).attr("y2",0),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=cX,v.attr("x2",d).attr("y2",0),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}x.call(A,F),z.call(A,a),y.call(A,a),t.call(A,F),v.call(A,a),u.call(A,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;return j.scale=function(b){return arguments.length?(a=b,j):a},j.orient=function(a){return arguments.length?(b=a,j):b},j.ticks=function(){return arguments.length?(g=arguments,j):g},j.tickFormat=function(a){return arguments.length?(h=a,j):h},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,j},j.tickPadding=function(a){return arguments.length?(f=+a,j):f},j.tickSubdivide=function(a){return arguments.length?(i=+a,j):i},j},d3.behavior={},d3.behavior.drag=function(){function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",dg).on("touchmove.drag",dg).on("mouseup.drag",dh,!0).on("touchend.drag",dh,!0).on("click.drag",di,!0)}function c(){cZ=a,c$=d3.event.target,db=df((c_=this).parentNode),dc=0,da=arguments}function d(){c.apply(this,arguments),de("dragstart")}var a=d3.dispatch("drag","dragstart","dragend");return b.on=function(c,d){return a[c].add(d),b},b};var cZ,c$,c_,da,db,dc,dd;d3.behavior.zoom=function(){function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dB).on("mouseup.zoom",dC).on("touchmove.zoom",dA).on("touchend.zoom",dz).on("click.zoom",dD,!0)}function d(){dq=a,dr=b.zoom.dispatch,ds=d3.event.target,dt=this,du=arguments}function e(){d.apply(this,arguments),dl=dx(d3.svg.mouse(dt)),dv=!1,d3.event.preventDefault(),window.focus()}function f(){d.apply(this,arguments),dm||(dm=dx(d3.svg.mouse(dt))),dE(dy()+a[2],d3.svg.mouse(dt),dm)}function g(){d.apply(this,arguments);var b=d3.svg.mouse(dt);dE(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dx(b))}function h(){d.apply(this,arguments);var b=dz(),c,e=Date.now();b.length===1&&e-dp<300&&dE(1+Math.floor(a[2]),c=b[0],dn[c.identifier]),dp=e}var a=[0,0,0],b=d3.dispatch("zoom");return c.on=function(a,d){return b[a].add(d),c},c};var dk,dl,dm,dn={},dp=0,dq,dr,ds,dt,du,dv,dw})();
<ide>\ No newline at end of file
<ide><path>src/core/interpolate.js
<ide> d3.interpolateObject = function(a, b) {
<ide> };
<ide> }
<ide>
<del>var d3_interpolate_number = /[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,
<add>var d3_interpolate_number = /[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-+]?\d+)?/g,
<ide> d3_interpolate_rgb = {background: 1, fill: 1, stroke: 1};
<ide>
<ide> function d3_interpolateByName(n) {
<ide><path>test/core/interpolate-test.js
<ide> suite.addBatch({
<ide> "preserves equal-value numbers in both strings": function(interpolate) {
<ide> assert.equal(interpolate(" 10/20 100 20", "50/10 100, 20 ")(.2), "18/18 100, 20 ");
<ide> assert.equal(interpolate(" 10/20 100 20", "50/10 100, 20 ")(.4), "26/16 100, 20 ");
<add> },
<add> "interpolates exponent notation correctly": function(interpolate) {
<add> assert.equal(interpolate("1e+3", "1e+4")(.5), "5500");
<add> assert.equal(interpolate("1e-3", "1e-4")(.5), "0.00055");
<ide> }
<ide> }
<ide> }); | 4 |
Python | Python | remove python 2 marker | d51db72e461261ddc74e70abd7e2f745610a4408 | <ide><path>spacy/tests/regression/test_issue3001-3500.py
<ide> def test_issue3248_1():
<ide> assert len(matcher) == 2
<ide>
<ide>
<del>@pytest.mark.skipif(is_python2, reason="Can't pickle instancemethod for is_base_form")
<ide> def test_issue3248_2():
<ide> """Test that the PhraseMatcher can be pickled correctly."""
<ide> nlp = English() | 1 |
Text | Text | clarify documentation for system test arguments | 46adb59b3474351e95ddc2357e67d169d6ffec51 | <ide><path>guides/source/testing.md
<ide> end
<ide>
<ide> The driver name is a required argument for `driven_by`. The optional arguments
<ide> that can be passed to `driven_by` are `:using` for the browser (this will only
<del>be used for non-headless drivers like Selenium), and `:screen_size` to change
<del>the size of the screen for screenshots.
<add>be used by Selenium), and `:screen_size` to change the size of the screen for
<add>screenshots.
<ide>
<ide> ```ruby
<ide> require "test_helper" | 1 |
Go | Go | fix version numbering | e975687b9a877dc46b465b6ce8b811ce6fa02cda | <ide><path>builtins/builtins.go
<ide> func daemon(eng *engine.Engine) error {
<ide> // builtins jobs independent of any subsystem
<ide> func dockerVersion(job *engine.Job) engine.Status {
<ide> v := &engine.Env{}
<del> v.Set("Version", dockerversion.VERSION)
<add> v.SetJson("Version", dockerversion.VERSION)
<ide> v.SetJson("ApiVersion", api.APIVERSION)
<ide> v.Set("GitCommit", dockerversion.GITCOMMIT)
<ide> v.Set("GoVersion", runtime.Version()) | 1 |
Mixed | Javascript | initialize date adapter with chart options | f2b099b835bf5d6dfe3a7d3097997ec11983c3ed | <ide><path>docs/axes/cartesian/time.md
<ide> The following options are provided by the time scale. You may also set options p
<ide>
<ide> | Name | Type | Default | Description
<ide> | ---- | ---- | ------- | -----------
<add>| `adapters.date` | `object` | `{}` | Options for adapter for external date library if that adapter needs or supports options
<ide> | `distribution` | `string` | `'linear'` | How data is plotted. [more...](#scale-distribution)
<ide> | `bounds` | `string` | `'data'` | Determines the scale bounds. [more...](#scale-bounds)
<ide> | `ticks.source` | `string` | `'auto'` | How ticks are generated. [more...](#ticks-source)
<ide><path>docs/getting-started/integration.md
<ide> import Chart from 'chart.js';
<ide> var myChart = new Chart(ctx, {...});
<ide> ```
<ide>
<del>**Note:** Moment.js is installed along Chart.js as dependency. If you don't want to use Momemt.js (either because you use a different date adapter or simply because don't need time functionalities), you will have to configure your bundler to exclude this dependency (e.g. using [`externals` for Webpack](https://webpack.js.org/configuration/externals/) or [`external` for Rollup](https://rollupjs.org/guide/en#peer-dependencies)).
<add>**Note:** Moment.js is installed along Chart.js as dependency. If you don't want to use Moment.js (either because you use a different date adapter or simply because don't need time functionalities), you will have to configure your bundler to exclude this dependency (e.g. using [`externals` for Webpack](https://webpack.js.org/configuration/externals/) or [`external` for Rollup](https://rollupjs.org/guide/en#peer-dependencies)).
<ide>
<ide> ```javascript
<ide> // Webpack
<ide><path>src/adapters/adapter.moment.js
<ide> 'use strict';
<ide>
<ide> var moment = require('moment');
<del>var adapter = require('../core/core.adapters')._date;
<del>var helpers = require('../helpers/helpers.core');
<add>var adapters = require('../core/core.adapters');
<ide>
<ide> var FORMATS = {
<ide> datetime: 'MMM D, YYYY, h:mm:ss a',
<ide> var FORMATS = {
<ide> year: 'YYYY'
<ide> };
<ide>
<del>helpers.merge(adapter, moment ? {
<add>adapters._date.override(moment ? {
<ide> _id: 'moment', // DEBUG ONLY
<ide>
<ide> formats: function() {
<ide><path>src/core/core.adapters.js
<ide>
<ide> 'use strict';
<ide>
<add>var helpers = require('../helpers/index');
<add>
<ide> function abstract() {
<ide> throw new Error(
<ide> 'This method is not implemented: either no adapter can ' +
<ide> function abstract() {
<ide> * @name Unit
<ide> */
<ide>
<del>/** @lends Chart._adapters._date */
<del>module.exports._date = {
<add>/**
<add> * @class
<add> */
<add>function DateAdapter(options) {
<add> this.options = options || {};
<add>}
<add>
<add>helpers.extend(DateAdapter.prototype, /** @lends DateAdapter */ {
<ide> /**
<ide> * Returns a map of time formats for the supported formatting units defined
<ide> * in Unit as well as 'datetime' representing a detailed date/time string.
<ide> module.exports._date = {
<ide> _create: function(value) {
<ide> return value;
<ide> }
<add>});
<add>
<add>DateAdapter.override = function(members) {
<add> helpers.extend(DateAdapter.prototype, members);
<ide> };
<add>
<add>module.exports._date = DateAdapter;
<ide><path>src/scales/scale.time.js
<ide> 'use strict';
<ide>
<del>var adapter = require('../core/core.adapters')._date;
<add>var adapters = require('../core/core.adapters');
<ide> var defaults = require('../core/core.defaults');
<ide> var helpers = require('../helpers/index');
<ide> var Scale = require('../core/core.scale');
<ide> function interpolate(table, skey, sval, tkey) {
<ide> return prev[tkey] + offset;
<ide> }
<ide>
<del>function toTimestamp(input, options) {
<add>function toTimestamp(scale, input) {
<add> var adapter = scale._adapter;
<add> var options = scale.options.time;
<ide> var parser = options.parser;
<ide> var format = parser || options.format;
<ide> var value = input;
<ide> function toTimestamp(input, options) {
<ide> return value;
<ide> }
<ide>
<del>function parse(input, scale) {
<add>function parse(scale, input) {
<ide> if (helpers.isNullOrUndef(input)) {
<ide> return null;
<ide> }
<ide>
<ide> var options = scale.options.time;
<del> var value = toTimestamp(scale.getRightValue(input), options);
<add> var value = toTimestamp(scale, scale.getRightValue(input));
<ide> if (value === null) {
<ide> return value;
<ide> }
<ide>
<ide> if (options.round) {
<del> value = +adapter.startOf(value, options.round);
<add> value = +scale._adapter.startOf(value, options.round);
<ide> }
<ide>
<ide> return value;
<ide> function determineUnitForAutoTicks(minUnit, min, max, capacity) {
<ide> /**
<ide> * Figures out what unit to format a set of ticks with
<ide> */
<del>function determineUnitForFormatting(ticks, minUnit, min, max) {
<add>function determineUnitForFormatting(scale, ticks, minUnit, min, max) {
<ide> var ilen = UNITS.length;
<ide> var i, unit;
<ide>
<ide> for (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {
<ide> unit = UNITS[i];
<del> if (INTERVALS[unit].common && adapter.diff(max, min, unit) >= ticks.length) {
<add> if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {
<ide> return unit;
<ide> }
<ide> }
<ide> function determineMajorUnit(unit) {
<ide> * Important: this method can return ticks outside the min and max range, it's the
<ide> * responsibility of the calling code to clamp values if needed.
<ide> */
<del>function generate(min, max, capacity, options) {
<add>function generate(scale, min, max, capacity) {
<add> var adapter = scale._adapter;
<add> var options = scale.options;
<ide> var timeOpts = options.time;
<ide> var minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);
<ide> var major = determineMajorUnit(minor);
<ide> function computeOffsets(table, ticks, min, max, options) {
<ide> return {start: start, end: end};
<ide> }
<ide>
<del>function ticksFromTimestamps(values, majorUnit) {
<add>function ticksFromTimestamps(scale, values, majorUnit) {
<ide> var ticks = [];
<ide> var i, ilen, value, major;
<ide>
<ide> for (i = 0, ilen = values.length; i < ilen; ++i) {
<ide> value = values[i];
<del> major = majorUnit ? value === +adapter.startOf(value, majorUnit) : false;
<add> major = majorUnit ? value === +scale._adapter.startOf(value, majorUnit) : false;
<ide>
<ide> ticks.push({
<ide> value: value,
<ide> var defaultConfig = {
<ide> */
<ide> bounds: 'data',
<ide>
<add> adapters: {},
<ide> time: {
<ide> parser: false, // false == a pattern string from https://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment
<ide> format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from https://momentjs.com/docs/#/parsing/string-format/
<ide> module.exports = Scale.extend({
<ide> var me = this;
<ide> var options = me.options;
<ide> var time = options.time || (options.time = {});
<add> var adapter = me._adapter = new adapters._date(options.adapters.date);
<ide>
<ide> // DEPRECATIONS: output a message only one time per update
<ide> if (time.format) {
<ide> module.exports = Scale.extend({
<ide> determineDataLimits: function() {
<ide> var me = this;
<ide> var chart = me.chart;
<add> var adapter = me._adapter;
<ide> var timeOpts = me.options.time;
<ide> var unit = timeOpts.unit || 'day';
<ide> var min = MAX_INTEGER;
<ide> module.exports = Scale.extend({
<ide>
<ide> // Convert labels to timestamps
<ide> for (i = 0, ilen = dataLabels.length; i < ilen; ++i) {
<del> labels.push(parse(dataLabels[i], me));
<add> labels.push(parse(me, dataLabels[i]));
<ide> }
<ide>
<ide> // Convert data to timestamps
<ide> module.exports = Scale.extend({
<ide> datasets[i] = [];
<ide>
<ide> for (j = 0, jlen = data.length; j < jlen; ++j) {
<del> timestamp = parse(data[j], me);
<add> timestamp = parse(me, data[j]);
<ide> timestamps.push(timestamp);
<ide> datasets[i][j] = timestamp;
<ide> }
<ide> module.exports = Scale.extend({
<ide> max = Math.max(max, timestamps[timestamps.length - 1]);
<ide> }
<ide>
<del> min = parse(timeOpts.min, me) || min;
<del> max = parse(timeOpts.max, me) || max;
<add> min = parse(me, timeOpts.min) || min;
<add> max = parse(me, timeOpts.max) || max;
<ide>
<ide> // In case there is no valid min/max, set limits based on unit time option
<ide> min = min === MAX_INTEGER ? +adapter.startOf(Date.now(), unit) : min;
<ide> module.exports = Scale.extend({
<ide> break;
<ide> case 'auto':
<ide> default:
<del> timestamps = generate(min, max, me.getLabelCapacity(min), options);
<add> timestamps = generate(me, min, max, me.getLabelCapacity(min), options);
<ide> }
<ide>
<ide> if (options.bounds === 'ticks' && timestamps.length) {
<ide> module.exports = Scale.extend({
<ide> }
<ide>
<ide> // Enforce limits with user min/max options
<del> min = parse(timeOpts.min, me) || min;
<del> max = parse(timeOpts.max, me) || max;
<add> min = parse(me, timeOpts.min) || min;
<add> max = parse(me, timeOpts.max) || max;
<ide>
<ide> // Remove ticks outside the min/max range
<ide> for (i = 0, ilen = timestamps.length; i < ilen; ++i) {
<ide> module.exports = Scale.extend({
<ide> me.max = max;
<ide>
<ide> // PRIVATE
<del> me._unit = timeOpts.unit || determineUnitForFormatting(ticks, timeOpts.minUnit, me.min, me.max);
<add> me._unit = timeOpts.unit || determineUnitForFormatting(me, ticks, timeOpts.minUnit, me.min, me.max);
<ide> me._majorUnit = determineMajorUnit(me._unit);
<ide> me._table = buildLookupTable(me._timestamps.data, min, max, options.distribution);
<ide> me._offsets = computeOffsets(me._table, ticks, min, max, options);
<ide> module.exports = Scale.extend({
<ide> ticks.reverse();
<ide> }
<ide>
<del> return ticksFromTimestamps(ticks, me._majorUnit);
<add> return ticksFromTimestamps(me, ticks, me._majorUnit);
<ide> },
<ide>
<ide> getLabelForIndex: function(index, datasetIndex) {
<ide> var me = this;
<add> var adapter = me._adapter;
<ide> var data = me.chart.data;
<ide> var timeOpts = me.options.time;
<ide> var label = data.labels && index < data.labels.length ? data.labels[index] : '';
<ide> module.exports = Scale.extend({
<ide> label = me.getRightValue(value);
<ide> }
<ide> if (timeOpts.tooltipFormat) {
<del> return adapter.format(toTimestamp(label, timeOpts), timeOpts.tooltipFormat);
<add> return adapter.format(toTimestamp(me, label), timeOpts.tooltipFormat);
<ide> }
<ide> if (typeof label === 'string') {
<ide> return label;
<ide> }
<del> return adapter.format(toTimestamp(label, timeOpts), timeOpts.displayFormats.datetime);
<add> return adapter.format(toTimestamp(me, label), timeOpts.displayFormats.datetime);
<ide> },
<ide>
<ide> /**
<ide> module.exports = Scale.extend({
<ide> */
<ide> tickFormatFunction: function(time, index, ticks, format) {
<ide> var me = this;
<add> var adapter = me._adapter;
<ide> var options = me.options;
<ide> var formats = options.time.displayFormats;
<ide> var minorFormat = formats[me._unit];
<ide> module.exports = Scale.extend({
<ide> }
<ide>
<ide> if (time === null) {
<del> time = parse(value, me);
<add> time = parse(me, value);
<ide> }
<ide>
<ide> if (time !== null) {
<ide> module.exports = Scale.extend({
<ide> var time = interpolate(me._table, 'pos', pos, 'time');
<ide>
<ide> // DEPRECATION, we should return time directly
<del> return adapter._create(time);
<add> return me._adapter._create(time);
<ide> },
<ide>
<ide> /**
<ide><path>test/specs/scale.time.tests.js
<ide> describe('Time scale tests', function() {
<ide> scaleLabel: Chart.defaults.scale.scaleLabel,
<ide> bounds: 'data',
<ide> distribution: 'linear',
<add> adapters: {},
<ide> ticks: {
<ide> beginAtZero: false,
<ide> minRotation: 0, | 6 |
Text | Text | update the 'prs plz!' label name | 8a0be355a9685d9fbdb4989513c4374c2b5470d7 | <ide><path>TRIAGING.md
<ide> The following is done automatically and should not be done manually:
<ide> * small - trivial change
<ide> * medium - non-trivial but straightforward change
<ide> * large - changes to many components in angular or any changes to $compile, ngRepeat or other "fun" components
<del>1. Label "PRs welcome" for "GH: issue"
<add>1. Label "PRs plz!" for "GH: issue"
<ide> * if complexity is small or medium and the problem as well as solution are well captured in the issue
<ide> 1. Label "origin: google" for issues from Google
<ide> 1. Label "high priority" for security issues, major performance regressions or memory leaks | 1 |
Javascript | Javascript | fix merge issue | 089fe568844f522e5dbe88d0d67d4c4b353bc116 | <ide><path>test/configCases/code-generation/use-strict/index.js
<ide> it("should include only one use strict per module", function() {
<ide>
<ide> expect(matches).toEqual([
<ide> "/* unused harmony default export */ var _unused_webpack_default_export = (\"a\");",
<del> "/* webpack/runtime/make namespace object */",
<add> "/******/ ",
<ide> "/******/ \t// The module cache",
<ide> "__webpack_require__.r(__webpack_exports__);",
<ide> "__webpack_require__.r(__webpack_exports__);", | 1 |
Ruby | Ruby | move response allocation to the class level | d1b9a134cfc6ca543dab594f87e6b7c1ea0050f5 | <ide><path>actionpack/lib/action_controller/metal/live.rb
<ide> module ActionController
<ide> # the main thread. Make sure your actions are thread safe, and this shouldn't
<ide> # be a problem (don't share state across threads, etc).
<ide> module Live
<add> extend ActiveSupport::Concern
<add>
<add> module ClassMethods
<add> def make_response!(request)
<add> if request.env["HTTP_VERSION"] == "HTTP/1.0"
<add> super
<add> else
<add> Live::Response.new.tap do |res|
<add> res.request = request
<add> end
<add> end
<add> end
<add> end
<add>
<ide> # This class provides the ability to write an SSE (Server Sent Event)
<ide> # to an IO stream. The class is initialized with a stream and can be used
<ide> # to either write a JSON string or an object which can be converted to JSON.
<ide> def response_body=(body)
<ide> end
<ide>
<ide> def set_response!(request)
<del> if request.env["HTTP_VERSION"] == "HTTP/1.0"
<del> super
<del> else
<del> @_response = Live::Response.new
<del> @_response.request = request
<del> end
<add> @_response = self.class.make_response! request
<ide> end
<ide> end
<ide> end
<ide><path>actionpack/lib/action_controller/metal/rack_delegation.rb
<ide> module ClassMethods
<ide> def build_with_env(env = {}) #:nodoc:
<ide> new.tap { |c| c.set_request! ActionDispatch::Request.new(env) }
<ide> end
<add>
<add> def make_response!(request)
<add> ActionDispatch::Response.new.tap do |res|
<add> res.request = request
<add> end
<add> end
<ide> end
<ide>
<ide> def set_request!(request) #:nodoc:
<ide> def reset_session
<ide> private
<ide>
<ide> def set_response!(request)
<del> @_response = ActionDispatch::Response.new
<del> @_response.request = request
<add> @_response = self.class.make_response! request
<ide> end
<ide> end
<ide> end | 2 |
Python | Python | remove check for tuple in test_security | 60a2bdd2404955d33b6f42702556a7196915ff52 | <ide><path>tests/www/test_security.py
<ide> def test_get_all_permissions(security_manager):
<ide>
<ide> assert isinstance(perms, set)
<ide> for perm in perms:
<del> assert isinstance(perm, tuple)
<ide> assert len(perm) == 2
<del>
<ide> assert ('can_read', 'Connections') in perms
<ide>
<ide> | 1 |
PHP | PHP | fix path to config/routes.php and update tests | 0254eb38b86eb5310de37813034f974ebd61d480 | <ide><path>src/Console/Command/Task/PluginTask.php
<ide> protected function _generateRoutes($plugin, $path) {
<ide> ]);
<ide> $this->out( __d('cake_console', 'Generating routes.php file...'));
<ide> $out = $this->Template->generate('config', 'routes');
<del> $file = $path . $plugin . DS . 'Config' . DS . 'routes.php';
<add> $file = $path . $plugin . DS . 'src' . DS . 'Config' . DS . 'routes.php';
<ide> $this->createFile($file, $out);
<ide> }
<ide>
<ide><path>tests/TestCase/Console/Command/Task/PluginTaskTest.php
<ide> public function testBakeFoldersAndFiles() {
<ide> $this->assertTrue(is_dir($path), 'No plugin dir');
<ide>
<ide> $directories = array(
<del> 'src/Config/Schema',
<add> 'src/Config',
<ide> 'src/Model/Behavior',
<ide> 'src/Model/Table',
<ide> 'src/Model/Entity',
<ide> 'src/Console/Command/Task',
<ide> 'src/Controller/Component',
<del> 'src/Lib',
<ide> 'src/View/Helper',
<ide> 'tests/TestCase/Controller/Component',
<ide> 'tests/TestCase/View/Helper',
<ide> public function testExecuteWithOneArg() {
<ide> $this->Task->expects($this->at(1))->method('createFile')
<ide> ->with($file, $this->stringContains('class AppController extends BaseController {'));
<ide>
<del> $file = $path . DS . 'Config' . DS . 'routes.php';
<add> $file = $path . DS . 'src' . DS . 'Config' . DS . 'routes.php';
<ide> $this->Task->expects($this->at(2))->method('createFile')
<ide> ->with($file, $this->stringContains("Router::plugin('BakeTestPlugin', function(\$routes)"));
<ide> | 2 |
Go | Go | add ulimit support to libcontainerd addprocess | 8891afd8385aeb490f8b7d9db8c3828bc7d24dc1 | <ide><path>integration-cli/docker_cli_exec_test.go
<ide> func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
<ide> dockerCmd(c, "exec", "parent", "true")
<ide> }
<ide>
<add>func (s *DockerSuite) TestExecUlimits(c *check.C) {
<add> testRequires(c, DaemonIsLinux)
<add> name := "testexeculimits"
<add> runSleepingContainer(c, "-d", "--ulimit", "nproc=21", "--name", name)
<add> c.Assert(waitRun(name), checker.IsNil)
<add>
<add> out, _, err := dockerCmdWithError("exec", name, "sh", "-c", "ulimit -p")
<add> c.Assert(err, checker.IsNil)
<add> c.Assert(strings.TrimSpace(out), checker.Equals, "21")
<add>}
<add>
<ide> // #15750
<ide> func (s *DockerSuite) TestExecStartFails(c *check.C) {
<ide> // TODO Windows CI. This test should be portable. Figure out why it fails
<ide><path>libcontainerd/client_linux.go
<ide> func (clnt *client) AddProcess(containerID, processFriendlyName string, specp Pr
<ide> ApparmorProfile: sp.ApparmorProfile,
<ide> SelinuxLabel: sp.SelinuxLabel,
<ide> NoNewPrivileges: sp.NoNewPrivileges,
<add> Rlimits: convertRlimits(sp.Rlimits),
<ide> }
<ide>
<ide> iopipe, err := p.openFifos(sp.Terminal)
<ide><path>libcontainerd/utils_linux.go
<ide> func systemPid(ctr *containerd.Container) uint32 {
<ide> }
<ide> return pid
<ide> }
<add>
<add>func convertRlimits(sr []specs.Rlimit) (cr []*containerd.Rlimit) {
<add> for _, r := range sr {
<add> cr = append(cr, &containerd.Rlimit{
<add> Type: r.Type,
<add> Hard: r.Hard,
<add> Soft: r.Soft,
<add> })
<add> }
<add> return
<add>} | 3 |
PHP | PHP | correct docblock @return types | d3e81bdb525c3c1dc8f9683eb537ad85f0f6cc21 | <ide><path>src/Illuminate/Foundation/Application.php
<ide> public function environmentFile()
<ide> * Get or check the current application environment.
<ide> *
<ide> * @param mixed
<del> * @return string
<add> * @return string|bool
<ide> */
<ide> public function environment()
<ide> {
<ide><path>src/Illuminate/Queue/Queue.php
<ide> protected function prepareQueueableEntity($value)
<ide> *
<ide> * @param \Closure $job
<ide> * @param mixed $data
<del> * @return string
<add> * @return array
<ide> */
<ide> protected function createClosurePayload($job, $data)
<ide> { | 2 |
Python | Python | add os extra assignment | 91a7531ae69fa66f6c8c212bc004f790cf16798f | <ide><path>libcloud/container/drivers/kubernetes.py
<ide> def _to_node(self, data):
<ide> extra=extra_size,
<ide> )
<ide> extra = {"memory": memory, "cpu": cpu}
<add> labels = data["metadata"]["labels"]
<add> os = labels.get("beta.kubernetes.io/os") or labels.get("kubernetes.io/os")
<add> if os:
<add> extra["os"] = os
<ide> # TODO: Find state
<ide> state = NodeState.UNKNOWN
<ide> public_ips, private_ips = [], [] | 1 |
Ruby | Ruby | remove broken require | 985ee85f598b5a43543a566ef87738b96efab117 | <ide><path>railties/lib/test_help.rb
<ide> require 'test/unit'
<ide> require 'active_support/test_case'
<ide> require 'active_record/fixtures'
<del>require 'active_record/test_case'
<ide> require 'action_controller/test_case'
<ide> require 'action_controller/test_process'
<ide> require 'action_controller/integration' | 1 |
Python | Python | update ut 7th | a3e794a8f786faf81071bffdc7d558f72d493f96 | <ide><path>keras/utils/conv_utils.py
<ide> def normalize_tuple(value, n, name, allow_zero=False):
<ide> raise ValueError(error_msg)
<ide>
<ide> if allow_zero:
<del> unqualified_values = [v for v in value_tuple if v < 0]
<add> unqualified_values = {v for v in value_tuple if v < 0}
<ide> req_msg = '>= 0'
<ide> else:
<del> unqualified_values = [v for v in value_tuple if v <= 0]
<add> unqualified_values = {v for v in value_tuple if v <= 0}
<ide> req_msg = '> 0'
<ide>
<ide> if len(unqualified_values) > 0:
<del> error_msg += (f' including {set(unqualified_values)}'
<add> error_msg += (f' including {unqualified_values}'
<ide> f' that does not satisfy the requirement `{req_msg}`.')
<ide> raise ValueError(error_msg)
<ide> | 1 |
Ruby | Ruby | put tempfile into binmode before writing | 03fca453c444cc8c37caf50f9ae380b7f85509c8 | <ide><path>Library/Homebrew/extend/pathname.rb
<ide> def write content
<ide> def atomic_write content
<ide> require "tempfile"
<ide> tf = Tempfile.new(basename.to_s)
<add> tf.binmode
<ide> tf.write(content)
<ide> tf.close
<ide> | 1 |
PHP | PHP | sync it up with master branch | 8a19d18ff80338f64bf01a32d0297b9bd97344a8 | <ide><path>src/Illuminate/Foundation/Console/KeyGenerateCommand.php
<ide> public function fire()
<ide> return $this->line('<comment>'.$key.'</comment>');
<ide> }
<ide>
<del> foreach ([base_path('.env'), base_path('.env.example')] as $path)
<add> $path = base_path('.env');
<add>
<add> if (file_exists($path))
<ide> {
<del> if (file_exists($path))
<del> {
<del> file_put_contents($path, str_replace(
<del> $this->laravel['config']['app.key'], $key, file_get_contents($path)
<del> ));
<del> }
<add> file_put_contents($path, str_replace(
<add> $this->laravel['config']['app.key'], $key, file_get_contents($path)
<add> ));
<ide> }
<ide>
<ide> $this->laravel['config']['app.key'] = $key; | 1 |
Python | Python | remove a failing doctest for poly1d | f4d9da1e86d1031e99549073681831270e450fb4 | <ide><path>numpy/lib/tests/test_polynomial.py
<ide> >>> print(poly1d([1.89999+2j, -3j, -5.12345678, 2+1j]))
<ide> 3 2
<ide> (1.9 + 2j) x - 3j x - 5.123 x + (2 + 1j)
<del>>>> print(poly1d([100e-90, 1.234567e-9j+3, -1234.999e8]))
<del> 2
<del>1e-88 x + (3 + 1.235e-09j) x - 1.235e+11
<ide> >>> print(poly1d([-3, -2, -1]))
<ide> 2
<ide> -3 x - 2 x - 1 | 1 |
Ruby | Ruby | fix undefined method error | ea72daf7bbd0bc73280ff8140a1af5aaf370d782 | <ide><path>Library/Homebrew/upgrade.rb
<ide> def check_installed_dependents(
<ide>
<ide> # Ensure we never attempt a source build for outdated dependents of upgraded formulae.
<ide> outdated_dependents, skipped_dependents = outdated_dependents.partition do |dependent|
<del> dependent.bottled? && dependent.deps.all?(&:bottled?)
<add> dependent.bottled? && dependent.deps.map(&:to_formula).all?(&:bottled?)
<ide> end
<ide>
<ide> if skipped_dependents.present? | 1 |
Javascript | Javascript | use eventpriority to track update priority | 03ede83d2ea1878e5cb82c3c17844621989caf66 | <ide><path>packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js
<ide> let ReactFeatureFlags;
<ide> let Suspense;
<ide> let SuspenseList;
<ide> let act;
<del>
<del>// Copied from ReactFiberLanes. Don't do this!
<del>// This is hard coded directly to avoid needing to import, and
<del>// we'll remove this as we replace runWithPriority with React APIs.
<del>export const IdleLanePriority = 2;
<add>let IdleEventPriority;
<ide>
<ide> function dispatchMouseEvent(to, from) {
<ide> if (!to) {
<ide> describe('ReactDOMServerPartialHydration', () => {
<ide> Scheduler = require('scheduler');
<ide> Suspense = React.Suspense;
<ide> SuspenseList = React.SuspenseList;
<add>
<add> IdleEventPriority = require('react-reconciler/constants').IdleEventPriority;
<ide> });
<ide>
<ide> // Note: This is based on a similar component we use in www. We can delete
<ide> describe('ReactDOMServerPartialHydration', () => {
<ide> expect(span.textContent).toBe('Hello');
<ide>
<ide> // Schedule an update at idle priority
<del> ReactDOM.unstable_runWithPriority(IdleLanePriority, () => {
<add> ReactDOM.unstable_runWithPriority(IdleEventPriority, () => {
<ide> root.render(<App text="Hi" className="hi" />);
<ide> });
<ide>
<ide><path>packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js
<ide> let Scheduler;
<ide> let Suspense;
<ide> let act;
<ide>
<del>// Copied from ReactFiberLanes. Don't do this!
<del>// This is hard coded directly to avoid needing to import, and
<del>// we'll remove this as we replace runWithPriority with React APIs.
<del>export const IdleLanePriority = 2;
<add>let IdleEventPriority;
<ide>
<ide> function dispatchMouseHoverEvent(to, from) {
<ide> if (!to) {
<ide> function dispatchClickEvent(target) {
<ide> // and there's no native DOM event that maps to idle priority, so this is a
<ide> // temporary workaround. Need something like ReactDOM.unstable_IdleUpdates.
<ide> function TODO_scheduleIdleDOMSchedulerTask(fn) {
<del> ReactDOM.unstable_runWithPriority(IdleLanePriority, () => {
<add> ReactDOM.unstable_runWithPriority(IdleEventPriority, () => {
<ide> const prevEvent = window.event;
<ide> window.event = {type: 'message'};
<ide> try {
<ide> describe('ReactDOMServerSelectiveHydration', () => {
<ide> act = ReactTestUtils.unstable_concurrentAct;
<ide> Scheduler = require('scheduler');
<ide> Suspense = React.Suspense;
<add>
<add> IdleEventPriority = require('react-reconciler/constants').IdleEventPriority;
<ide> });
<ide>
<ide> // @gate experimental
<ide><path>packages/react-dom/src/client/ReactDOM.js
<ide> import {
<ide> attemptDiscreteHydration,
<ide> attemptContinuousHydration,
<ide> attemptHydrationAtCurrentPriority,
<del> runWithPriority,
<del> getCurrentUpdateLanePriority,
<ide> } from 'react-reconciler/src/ReactFiberReconciler';
<add>import {
<add> runWithPriority,
<add> getCurrentUpdatePriority,
<add>} from 'react-reconciler/src/ReactEventPriorities';
<ide> import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
<ide> import {canUseDOM} from 'shared/ExecutionEnvironment';
<ide> import ReactVersion from 'shared/ReactVersion';
<ide> setAttemptSynchronousHydration(attemptSynchronousHydration);
<ide> setAttemptDiscreteHydration(attemptDiscreteHydration);
<ide> setAttemptContinuousHydration(attemptContinuousHydration);
<ide> setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority);
<del>setGetCurrentUpdatePriority(getCurrentUpdateLanePriority);
<add>setGetCurrentUpdatePriority(getCurrentUpdatePriority);
<ide> setAttemptHydrationAtPriority(runWithPriority);
<ide>
<ide> let didWarnAboutUnstableCreatePortal = false;
<ide><path>packages/react-dom/src/events/ReactDOMEventListener.js
<ide> import {
<ide> discreteUpdates,
<ide> } from './ReactDOMUpdateBatching';
<ide>
<del>import {
<del> InputContinuousLanePriority as InputContinuousLanePriority_old,
<del> getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_old,
<del> setCurrentUpdateLanePriority as setCurrentUpdateLanePriority_old,
<del>} from 'react-reconciler/src/ReactFiberLane.old';
<del>import {
<del> InputContinuousLanePriority as InputContinuousLanePriority_new,
<del> getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_new,
<del> setCurrentUpdateLanePriority as setCurrentUpdateLanePriority_new,
<del>} from 'react-reconciler/src/ReactFiberLane.new';
<ide> import {getCurrentPriorityLevel as getCurrentPriorityLevel_old} from 'react-reconciler/src/SchedulerWithReactIntegration.old';
<ide> import {
<ide> getCurrentPriorityLevel as getCurrentPriorityLevel_new,
<ide> import {
<ide> ContinuousEventPriority,
<ide> DefaultEventPriority,
<ide> IdleEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<ide> } from 'react-reconciler/src/ReactEventPriorities';
<ide>
<del>// TODO: These should use the opaque EventPriority type instead of LanePriority.
<del>// Then internally we can use a Lane.
<del>const InputContinuousLanePriority = enableNewReconciler
<del> ? InputContinuousLanePriority_new
<del> : InputContinuousLanePriority_old;
<del>const getCurrentUpdateLanePriority = enableNewReconciler
<del> ? getCurrentUpdateLanePriority_new
<del> : getCurrentUpdateLanePriority_old;
<del>const setCurrentUpdateLanePriority = enableNewReconciler
<del> ? setCurrentUpdateLanePriority_new
<del> : setCurrentUpdateLanePriority_old;
<ide> const getCurrentPriorityLevel = enableNewReconciler
<ide> ? getCurrentPriorityLevel_new
<ide> : getCurrentPriorityLevel_old;
<ide> function dispatchContinuousEvent(
<ide> container,
<ide> nativeEvent,
<ide> ) {
<del> const previousPriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(InputContinuousLanePriority);
<add> setCurrentUpdatePriority(ContinuousEventPriority);
<ide> dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousPriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> }
<ide> }
<ide>
<ide><path>packages/react-dom/src/events/ReactDOMEventReplaying.js
<ide> import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
<ide> import type {DOMEventName} from '../events/DOMEventNames';
<ide> import type {EventSystemFlags} from './EventSystemFlags';
<ide> import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
<del>import type {LanePriority} from 'react-reconciler/src/ReactFiberLane.old';
<add>import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities';
<ide>
<ide> import {enableSelectiveHydration} from 'shared/ReactFeatureFlags';
<ide> import {
<ide> import {
<ide> getClosestInstanceFromNode,
<ide> } from '../client/ReactDOMComponentTree';
<ide> import {HostRoot, SuspenseComponent} from 'react-reconciler/src/ReactWorkTags';
<add>import {isHigherEventPriority} from 'react-reconciler/src/ReactEventPriorities';
<ide>
<ide> let attemptSynchronousHydration: (fiber: Object) => void;
<ide>
<ide> export function setAttemptHydrationAtCurrentPriority(
<ide> attemptHydrationAtCurrentPriority = fn;
<ide> }
<ide>
<del>let getCurrentUpdatePriority: () => LanePriority;
<add>let getCurrentUpdatePriority: () => EventPriority;
<ide>
<del>export function setGetCurrentUpdatePriority(fn: () => LanePriority) {
<add>export function setGetCurrentUpdatePriority(fn: () => EventPriority) {
<ide> getCurrentUpdatePriority = fn;
<ide> }
<ide>
<del>let attemptHydrationAtPriority: <T>(priority: LanePriority, fn: () => T) => T;
<add>let attemptHydrationAtPriority: <T>(priority: EventPriority, fn: () => T) => T;
<ide>
<ide> export function setAttemptHydrationAtPriority(
<del> fn: <T>(priority: LanePriority, fn: () => T) => T,
<add> fn: <T>(priority: EventPriority, fn: () => T) => T,
<ide> ) {
<ide> attemptHydrationAtPriority = fn;
<ide> }
<ide> const queuedPointerCaptures: Map<number, QueuedReplayableEvent> = new Map();
<ide> type QueuedHydrationTarget = {|
<ide> blockedOn: null | Container | SuspenseInstance,
<ide> target: Node,
<del> lanePriority: LanePriority,
<add> priority: EventPriority,
<ide> |};
<ide> const queuedExplicitHydrationTargets: Array<QueuedHydrationTarget> = [];
<ide>
<ide> function attemptExplicitHydrationTarget(
<ide> // We're blocked on hydrating this boundary.
<ide> // Increase its priority.
<ide> queuedTarget.blockedOn = instance;
<del> attemptHydrationAtPriority(queuedTarget.lanePriority, () => {
<add> attemptHydrationAtPriority(queuedTarget.priority, () => {
<ide> attemptHydrationAtCurrentPriority(nearestMounted);
<ide> });
<ide>
<ide> function attemptExplicitHydrationTarget(
<ide>
<ide> export function queueExplicitHydrationTarget(target: Node): void {
<ide> if (enableSelectiveHydration) {
<del> const updateLanePriority = getCurrentUpdatePriority();
<add> // TODO: This will read the priority if it's dispatched by the React
<add> // event system but not native events. Should read window.event.type, like
<add> // we do for updates (getCurrentEventPriority).
<add> const updatePriority = getCurrentUpdatePriority();
<ide> const queuedTarget: QueuedHydrationTarget = {
<ide> blockedOn: null,
<ide> target: target,
<del> lanePriority: updateLanePriority,
<add> priority: updatePriority,
<ide> };
<ide> let i = 0;
<ide> for (; i < queuedExplicitHydrationTargets.length; i++) {
<add> // Stop once we hit the first target with lower priority than
<ide> if (
<del> updateLanePriority <= queuedExplicitHydrationTargets[i].lanePriority
<add> !isHigherEventPriority(
<add> updatePriority,
<add> queuedExplicitHydrationTargets[i].priority,
<add> )
<ide> ) {
<ide> break;
<ide> }
<ide><path>packages/react-reconciler/src/ReactEventPriorities.js
<ide> import {
<ide> ContinuousEventPriority as ContinuousEventPriority_old,
<ide> DefaultEventPriority as DefaultEventPriority_old,
<ide> IdleEventPriority as IdleEventPriority_old,
<add> getCurrentUpdatePriority as getCurrentUpdatePriority_old,
<add> setCurrentUpdatePriority as setCurrentUpdatePriority_old,
<add> runWithPriority as runWithPriority_old,
<add> isHigherEventPriority as isHigherEventPriority_old,
<ide> } from './ReactEventPriorities.old';
<ide>
<ide> import {
<ide> DiscreteEventPriority as DiscreteEventPriority_new,
<ide> ContinuousEventPriority as ContinuousEventPriority_new,
<ide> DefaultEventPriority as DefaultEventPriority_new,
<ide> IdleEventPriority as IdleEventPriority_new,
<add> getCurrentUpdatePriority as getCurrentUpdatePriority_new,
<add> setCurrentUpdatePriority as setCurrentUpdatePriority_new,
<add> runWithPriority as runWithPriority_new,
<add> isHigherEventPriority as isHigherEventPriority_new,
<ide> } from './ReactEventPriorities.new';
<ide>
<del>export const DiscreteEventPriority = enableNewReconciler
<del> ? DiscreteEventPriority_new
<del> : DiscreteEventPriority_old;
<del>export const ContinuousEventPriority = enableNewReconciler
<del> ? ContinuousEventPriority_new
<del> : ContinuousEventPriority_old;
<del>export const DefaultEventPriority = enableNewReconciler
<del> ? DefaultEventPriority_new
<del> : DefaultEventPriority_old;
<del>export const IdleEventPriority = enableNewReconciler
<del> ? IdleEventPriority_new
<del> : IdleEventPriority_old;
<add>export opaque type EventPriority = number;
<add>
<add>export const DiscreteEventPriority: EventPriority = enableNewReconciler
<add> ? (DiscreteEventPriority_new: any)
<add> : (DiscreteEventPriority_old: any);
<add>export const ContinuousEventPriority: EventPriority = enableNewReconciler
<add> ? (ContinuousEventPriority_new: any)
<add> : (ContinuousEventPriority_old: any);
<add>export const DefaultEventPriority: EventPriority = enableNewReconciler
<add> ? (DefaultEventPriority_new: any)
<add> : (DefaultEventPriority_old: any);
<add>export const IdleEventPriority: EventPriority = enableNewReconciler
<add> ? (IdleEventPriority_new: any)
<add> : (IdleEventPriority_old: any);
<add>
<add>export function runWithPriority<T>(priority: EventPriority, fn: () => T): T {
<add> return enableNewReconciler
<add> ? runWithPriority_new((priority: any), fn)
<add> : runWithPriority_old((priority: any), fn);
<add>}
<add>
<add>export function getCurrentUpdatePriority(): EventPriority {
<add> return enableNewReconciler
<add> ? (getCurrentUpdatePriority_new(): any)
<add> : (getCurrentUpdatePriority_old(): any);
<add>}
<add>
<add>export function setCurrentUpdatePriority(priority: EventPriority) {
<add> return enableNewReconciler
<add> ? setCurrentUpdatePriority_new((priority: any))
<add> : setCurrentUpdatePriority_old((priority: any));
<add>}
<add>
<add>export function isHigherEventPriority(
<add> a: EventPriority,
<add> b: EventPriority,
<add>): boolean {
<add> return enableNewReconciler
<add> ? isHigherEventPriority_new((a: any), (b: any))
<add> : isHigherEventPriority_old((a: any), (b: any));
<add>}
<ide><path>packages/react-reconciler/src/ReactEventPriorities.new.js
<ide> * @flow
<ide> */
<ide>
<del>export {
<del> SyncLane as DiscreteEventPriority,
<del> InputContinuousLane as ContinuousEventPriority,
<del> DefaultLane as DefaultEventPriority,
<del> IdleLane as IdleEventPriority,
<add>import type {Lane, Lanes} from './ReactFiberLane.new';
<add>
<add>import {
<add> NoLane,
<add> SyncLane,
<add> InputContinuousLane,
<add> DefaultLane,
<add> IdleLane,
<add> getHighestPriorityLane,
<add> includesNonIdleWork,
<ide> } from './ReactFiberLane.new';
<add>
<add>export opaque type EventPriority = Lane;
<add>
<add>export const DiscreteEventPriority: EventPriority = SyncLane;
<add>export const ContinuousEventPriority: EventPriority = InputContinuousLane;
<add>export const DefaultEventPriority: EventPriority = DefaultLane;
<add>export const IdleEventPriority: EventPriority = IdleLane;
<add>
<add>let currentUpdatePriority: EventPriority = NoLane;
<add>
<add>export function getCurrentUpdatePriority(): EventPriority {
<add> return currentUpdatePriority;
<add>}
<add>
<add>export function setCurrentUpdatePriority(newPriority: EventPriority) {
<add> currentUpdatePriority = newPriority;
<add>}
<add>
<add>export function runWithPriority<T>(priority: EventPriority, fn: () => T): T {
<add> const previousPriority = currentUpdatePriority;
<add> try {
<add> currentUpdatePriority = priority;
<add> return fn();
<add> } finally {
<add> currentUpdatePriority = previousPriority;
<add> }
<add>}
<add>
<add>export function higherEventPriority(
<add> a: EventPriority,
<add> b: EventPriority,
<add>): EventPriority {
<add> return a !== 0 && a < b ? a : b;
<add>}
<add>
<add>export function isHigherEventPriority(
<add> a: EventPriority,
<add> b: EventPriority,
<add>): boolean {
<add> return a !== 0 && a < b;
<add>}
<add>
<add>export function lanesToEventPriority(lanes: Lanes): EventPriority {
<add> const lane = getHighestPriorityLane(lanes);
<add> if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
<add> return DiscreteEventPriority;
<add> }
<add> if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
<add> return ContinuousEventPriority;
<add> }
<add> if (includesNonIdleWork(lane)) {
<add> return DefaultEventPriority;
<add> }
<add> return IdleEventPriority;
<add>}
<ide><path>packages/react-reconciler/src/ReactEventPriorities.old.js
<ide> * @flow
<ide> */
<ide>
<del>export {
<del> SyncLane as DiscreteEventPriority,
<del> InputContinuousLane as ContinuousEventPriority,
<del> DefaultLane as DefaultEventPriority,
<del> IdleLane as IdleEventPriority,
<add>import type {Lane, Lanes} from './ReactFiberLane.old';
<add>
<add>import {
<add> NoLane,
<add> SyncLane,
<add> InputContinuousLane,
<add> DefaultLane,
<add> IdleLane,
<add> getHighestPriorityLane,
<add> includesNonIdleWork,
<ide> } from './ReactFiberLane.old';
<add>
<add>export opaque type EventPriority = Lane;
<add>
<add>export const DiscreteEventPriority: EventPriority = SyncLane;
<add>export const ContinuousEventPriority: EventPriority = InputContinuousLane;
<add>export const DefaultEventPriority: EventPriority = DefaultLane;
<add>export const IdleEventPriority: EventPriority = IdleLane;
<add>
<add>let currentUpdatePriority: EventPriority = NoLane;
<add>
<add>export function getCurrentUpdatePriority(): EventPriority {
<add> return currentUpdatePriority;
<add>}
<add>
<add>export function setCurrentUpdatePriority(newPriority: EventPriority) {
<add> currentUpdatePriority = newPriority;
<add>}
<add>
<add>export function runWithPriority<T>(priority: EventPriority, fn: () => T): T {
<add> const previousPriority = currentUpdatePriority;
<add> try {
<add> currentUpdatePriority = priority;
<add> return fn();
<add> } finally {
<add> currentUpdatePriority = previousPriority;
<add> }
<add>}
<add>
<add>export function higherEventPriority(
<add> a: EventPriority,
<add> b: EventPriority,
<add>): EventPriority {
<add> return a !== 0 && a < b ? a : b;
<add>}
<add>
<add>export function isHigherEventPriority(
<add> a: EventPriority,
<add> b: EventPriority,
<add>): boolean {
<add> return a !== 0 && a < b;
<add>}
<add>
<add>export function lanesToEventPriority(lanes: Lanes): EventPriority {
<add> const lane = getHighestPriorityLane(lanes);
<add> if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
<add> return DiscreteEventPriority;
<add> }
<add> if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
<add> return ContinuousEventPriority;
<add> }
<add> if (includesNonIdleWork(lane)) {
<add> return DefaultEventPriority;
<add> }
<add> return IdleEventPriority;
<add>}
<ide><path>packages/react-reconciler/src/ReactFiberCommitWork.new.js
<ide> import type {
<ide> } from './ReactFiberHostConfig';
<ide> import type {Fiber} from './ReactInternalTypes';
<ide> import type {FiberRoot} from './ReactInternalTypes';
<del>import type {LanePriority, Lanes} from './ReactFiberLane.new';
<add>import type {Lanes} from './ReactFiberLane.new';
<ide> import type {SuspenseState} from './ReactFiberSuspenseComponent.new';
<ide> import type {UpdateQueue} from './ReactUpdateQueue.new';
<ide> import type {FunctionComponentUpdateQueue} from './ReactFiberHooks.new';
<ide> function commitUnmount(
<ide> finishedRoot: FiberRoot,
<ide> current: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> onCommitUnmount(current);
<ide>
<ide> function commitUnmount(
<ide> // We are also not using this parent because
<ide> // the portal will get pushed immediately.
<ide> if (supportsMutation) {
<del> unmountHostComponents(
<del> finishedRoot,
<del> current,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> unmountHostComponents(finishedRoot, current, nearestMountedAncestor);
<ide> } else if (supportsPersistence) {
<ide> emptyPortalContainer(current);
<ide> }
<ide> function commitNestedUnmounts(
<ide> finishedRoot: FiberRoot,
<ide> root: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> // While we're inside a removed host node we don't want to call
<ide> // removeChild on the inner nodes because they're removed by the top
<ide> function commitNestedUnmounts(
<ide> // we do an inner loop while we're still inside the host node.
<ide> let node: Fiber = root;
<ide> while (true) {
<del> commitUnmount(
<del> finishedRoot,
<del> node,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitUnmount(finishedRoot, node, nearestMountedAncestor);
<ide> // Visit children because they may contain more composite or host nodes.
<ide> // Skip portals because commitUnmount() currently visits them recursively.
<ide> if (
<ide> function unmountHostComponents(
<ide> finishedRoot: FiberRoot,
<ide> current: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> // We only have the top Fiber that was deleted but we need to recurse down its
<ide> // children to find all the terminal nodes.
<ide> function unmountHostComponents(
<ide> }
<ide>
<ide> if (node.tag === HostComponent || node.tag === HostText) {
<del> commitNestedUnmounts(
<del> finishedRoot,
<del> node,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitNestedUnmounts(finishedRoot, node, nearestMountedAncestor);
<ide> // After all the children have unmounted, it is now safe to remove the
<ide> // node from the tree.
<ide> if (currentParentIsContainer) {
<ide> function unmountHostComponents(
<ide> continue;
<ide> }
<ide> } else {
<del> commitUnmount(
<del> finishedRoot,
<del> node,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitUnmount(finishedRoot, node, nearestMountedAncestor);
<ide> // Visit children because we may find more host components below.
<ide> if (node.child !== null) {
<ide> node.child.return = node;
<ide> function commitDeletion(
<ide> finishedRoot: FiberRoot,
<ide> current: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> if (supportsMutation) {
<ide> // Recursively delete all host nodes from the parent.
<ide> // Detach refs and call componentWillUnmount() on the whole subtree.
<del> unmountHostComponents(
<del> finishedRoot,
<del> current,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> unmountHostComponents(finishedRoot, current, nearestMountedAncestor);
<ide> } else {
<ide> // Detach refs and call componentWillUnmount() on the whole subtree.
<del> commitNestedUnmounts(
<del> finishedRoot,
<del> current,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitNestedUnmounts(finishedRoot, current, nearestMountedAncestor);
<ide> }
<ide>
<ide> detachFiberMutation(current);
<ide> function commitResetTextContent(current: Fiber) {
<ide> resetTextContent(current.stateNode);
<ide> }
<ide>
<del>export function commitMutationEffects(
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del> firstChild: Fiber,
<del>) {
<add>export function commitMutationEffects(root: FiberRoot, firstChild: Fiber) {
<ide> nextEffect = firstChild;
<del> commitMutationEffects_begin(root, renderPriorityLevel);
<add> commitMutationEffects_begin(root);
<ide> }
<ide>
<del>function commitMutationEffects_begin(
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del>) {
<add>function commitMutationEffects_begin(root: FiberRoot) {
<ide> while (nextEffect !== null) {
<ide> const fiber = nextEffect;
<ide>
<ide> function commitMutationEffects_begin(
<ide> root,
<ide> childToDelete,
<ide> fiber,
<del> renderPriorityLevel,
<ide> );
<ide> if (hasCaughtError()) {
<ide> const error = clearCaughtError();
<ide> captureCommitPhaseError(childToDelete, fiber, error);
<ide> }
<ide> } else {
<ide> try {
<del> commitDeletion(root, childToDelete, fiber, renderPriorityLevel);
<add> commitDeletion(root, childToDelete, fiber);
<ide> } catch (error) {
<ide> captureCommitPhaseError(childToDelete, fiber, error);
<ide> }
<ide> function commitMutationEffects_begin(
<ide> ensureCorrectReturnPointer(child, fiber);
<ide> nextEffect = child;
<ide> } else {
<del> commitMutationEffects_complete(root, renderPriorityLevel);
<add> commitMutationEffects_complete(root);
<ide> }
<ide> }
<ide> }
<ide>
<del>function commitMutationEffects_complete(
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del>) {
<add>function commitMutationEffects_complete(root: FiberRoot) {
<ide> while (nextEffect !== null) {
<ide> const fiber = nextEffect;
<ide> if (__DEV__) {
<ide> function commitMutationEffects_complete(
<ide> null,
<ide> fiber,
<ide> root,
<del> renderPriorityLevel,
<ide> );
<ide> if (hasCaughtError()) {
<ide> const error = clearCaughtError();
<ide> function commitMutationEffects_complete(
<ide> resetCurrentDebugFiberInDEV();
<ide> } else {
<ide> try {
<del> commitMutationEffectsOnFiber(fiber, root, renderPriorityLevel);
<add> commitMutationEffectsOnFiber(fiber, root);
<ide> } catch (error) {
<ide> captureCommitPhaseError(fiber, fiber.return, error);
<ide> }
<ide> function commitMutationEffects_complete(
<ide> }
<ide> }
<ide>
<del>function commitMutationEffectsOnFiber(
<del> finishedWork: Fiber,
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del>) {
<add>function commitMutationEffectsOnFiber(finishedWork: Fiber, root: FiberRoot) {
<ide> const flags = finishedWork.flags;
<ide>
<ide> if (flags & ContentReset) {
<ide><path>packages/react-reconciler/src/ReactFiberCommitWork.old.js
<ide> import type {
<ide> } from './ReactFiberHostConfig';
<ide> import type {Fiber} from './ReactInternalTypes';
<ide> import type {FiberRoot} from './ReactInternalTypes';
<del>import type {LanePriority, Lanes} from './ReactFiberLane.old';
<add>import type {Lanes} from './ReactFiberLane.old';
<ide> import type {SuspenseState} from './ReactFiberSuspenseComponent.old';
<ide> import type {UpdateQueue} from './ReactUpdateQueue.old';
<ide> import type {FunctionComponentUpdateQueue} from './ReactFiberHooks.old';
<ide> function commitUnmount(
<ide> finishedRoot: FiberRoot,
<ide> current: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> onCommitUnmount(current);
<ide>
<ide> function commitUnmount(
<ide> // We are also not using this parent because
<ide> // the portal will get pushed immediately.
<ide> if (supportsMutation) {
<del> unmountHostComponents(
<del> finishedRoot,
<del> current,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> unmountHostComponents(finishedRoot, current, nearestMountedAncestor);
<ide> } else if (supportsPersistence) {
<ide> emptyPortalContainer(current);
<ide> }
<ide> function commitNestedUnmounts(
<ide> finishedRoot: FiberRoot,
<ide> root: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> // While we're inside a removed host node we don't want to call
<ide> // removeChild on the inner nodes because they're removed by the top
<ide> function commitNestedUnmounts(
<ide> // we do an inner loop while we're still inside the host node.
<ide> let node: Fiber = root;
<ide> while (true) {
<del> commitUnmount(
<del> finishedRoot,
<del> node,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitUnmount(finishedRoot, node, nearestMountedAncestor);
<ide> // Visit children because they may contain more composite or host nodes.
<ide> // Skip portals because commitUnmount() currently visits them recursively.
<ide> if (
<ide> function unmountHostComponents(
<ide> finishedRoot: FiberRoot,
<ide> current: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> // We only have the top Fiber that was deleted but we need to recurse down its
<ide> // children to find all the terminal nodes.
<ide> function unmountHostComponents(
<ide> }
<ide>
<ide> if (node.tag === HostComponent || node.tag === HostText) {
<del> commitNestedUnmounts(
<del> finishedRoot,
<del> node,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitNestedUnmounts(finishedRoot, node, nearestMountedAncestor);
<ide> // After all the children have unmounted, it is now safe to remove the
<ide> // node from the tree.
<ide> if (currentParentIsContainer) {
<ide> function unmountHostComponents(
<ide> continue;
<ide> }
<ide> } else {
<del> commitUnmount(
<del> finishedRoot,
<del> node,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitUnmount(finishedRoot, node, nearestMountedAncestor);
<ide> // Visit children because we may find more host components below.
<ide> if (node.child !== null) {
<ide> node.child.return = node;
<ide> function commitDeletion(
<ide> finishedRoot: FiberRoot,
<ide> current: Fiber,
<ide> nearestMountedAncestor: Fiber,
<del> renderPriorityLevel: LanePriority,
<ide> ): void {
<ide> if (supportsMutation) {
<ide> // Recursively delete all host nodes from the parent.
<ide> // Detach refs and call componentWillUnmount() on the whole subtree.
<del> unmountHostComponents(
<del> finishedRoot,
<del> current,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> unmountHostComponents(finishedRoot, current, nearestMountedAncestor);
<ide> } else {
<ide> // Detach refs and call componentWillUnmount() on the whole subtree.
<del> commitNestedUnmounts(
<del> finishedRoot,
<del> current,
<del> nearestMountedAncestor,
<del> renderPriorityLevel,
<del> );
<add> commitNestedUnmounts(finishedRoot, current, nearestMountedAncestor);
<ide> }
<ide>
<ide> detachFiberMutation(current);
<ide> function commitResetTextContent(current: Fiber) {
<ide> resetTextContent(current.stateNode);
<ide> }
<ide>
<del>export function commitMutationEffects(
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del> firstChild: Fiber,
<del>) {
<add>export function commitMutationEffects(root: FiberRoot, firstChild: Fiber) {
<ide> nextEffect = firstChild;
<del> commitMutationEffects_begin(root, renderPriorityLevel);
<add> commitMutationEffects_begin(root);
<ide> }
<ide>
<del>function commitMutationEffects_begin(
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del>) {
<add>function commitMutationEffects_begin(root: FiberRoot) {
<ide> while (nextEffect !== null) {
<ide> const fiber = nextEffect;
<ide>
<ide> function commitMutationEffects_begin(
<ide> root,
<ide> childToDelete,
<ide> fiber,
<del> renderPriorityLevel,
<ide> );
<ide> if (hasCaughtError()) {
<ide> const error = clearCaughtError();
<ide> captureCommitPhaseError(childToDelete, fiber, error);
<ide> }
<ide> } else {
<ide> try {
<del> commitDeletion(root, childToDelete, fiber, renderPriorityLevel);
<add> commitDeletion(root, childToDelete, fiber);
<ide> } catch (error) {
<ide> captureCommitPhaseError(childToDelete, fiber, error);
<ide> }
<ide> function commitMutationEffects_begin(
<ide> ensureCorrectReturnPointer(child, fiber);
<ide> nextEffect = child;
<ide> } else {
<del> commitMutationEffects_complete(root, renderPriorityLevel);
<add> commitMutationEffects_complete(root);
<ide> }
<ide> }
<ide> }
<ide>
<del>function commitMutationEffects_complete(
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del>) {
<add>function commitMutationEffects_complete(root: FiberRoot) {
<ide> while (nextEffect !== null) {
<ide> const fiber = nextEffect;
<ide> if (__DEV__) {
<ide> function commitMutationEffects_complete(
<ide> null,
<ide> fiber,
<ide> root,
<del> renderPriorityLevel,
<ide> );
<ide> if (hasCaughtError()) {
<ide> const error = clearCaughtError();
<ide> function commitMutationEffects_complete(
<ide> resetCurrentDebugFiberInDEV();
<ide> } else {
<ide> try {
<del> commitMutationEffectsOnFiber(fiber, root, renderPriorityLevel);
<add> commitMutationEffectsOnFiber(fiber, root);
<ide> } catch (error) {
<ide> captureCommitPhaseError(fiber, fiber.return, error);
<ide> }
<ide> function commitMutationEffects_complete(
<ide> }
<ide> }
<ide>
<del>function commitMutationEffectsOnFiber(
<del> finishedWork: Fiber,
<del> root: FiberRoot,
<del> renderPriorityLevel: LanePriority,
<del>) {
<add>function commitMutationEffectsOnFiber(finishedWork: Fiber, root: FiberRoot) {
<ide> const flags = finishedWork.flags;
<ide>
<ide> if (flags & ContentReset) {
<ide><path>packages/react-reconciler/src/ReactFiberDevToolsHook.new.js
<ide> import {enableProfilerTimer} from 'shared/ReactFeatureFlags';
<ide>
<ide> import type {Fiber, FiberRoot} from './ReactInternalTypes';
<ide> import type {ReactNodeList} from 'shared/ReactTypes';
<del>import type {LanePriority} from './ReactFiberLane.new';
<add>import type {EventPriority} from './ReactEventPriorities.new';
<ide>
<ide> import {DidCapture} from './ReactFiberFlags';
<ide> import {
<del> lanePriorityToSchedulerPriority,
<del> NoLanePriority,
<del>} from './ReactFiberLane.new';
<del>import {NormalPriority} from './SchedulerWithReactIntegration.new';
<add> DiscreteEventPriority,
<add> ContinuousEventPriority,
<add> DefaultEventPriority,
<add> IdleEventPriority,
<add>} from './ReactEventPriorities.new';
<add>import {
<add> ImmediatePriority as ImmediateSchedulerPriority,
<add> UserBlockingPriority as UserBlockingSchedulerPriority,
<add> NormalPriority as NormalSchedulerPriority,
<add> IdlePriority as IdleSchedulerPriority,
<add>} from './SchedulerWithReactIntegration.new';
<ide>
<ide> declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: Object | void;
<ide>
<ide> export function onScheduleRoot(root: FiberRoot, children: ReactNodeList) {
<ide> }
<ide> }
<ide>
<del>export function onCommitRoot(root: FiberRoot, priorityLevel: LanePriority) {
<add>export function onCommitRoot(root: FiberRoot, eventPriority: EventPriority) {
<ide> if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {
<ide> try {
<ide> const didError = (root.current.flags & DidCapture) === DidCapture;
<ide> if (enableProfilerTimer) {
<del> const schedulerPriority =
<del> priorityLevel === NoLanePriority
<del> ? NormalPriority
<del> : lanePriorityToSchedulerPriority(priorityLevel);
<add> let schedulerPriority;
<add> switch (eventPriority) {
<add> case DiscreteEventPriority:
<add> schedulerPriority = ImmediateSchedulerPriority;
<add> break;
<add> case ContinuousEventPriority:
<add> schedulerPriority = UserBlockingSchedulerPriority;
<add> break;
<add> case DefaultEventPriority:
<add> schedulerPriority = NormalSchedulerPriority;
<add> break;
<add> case IdleEventPriority:
<add> schedulerPriority = IdleSchedulerPriority;
<add> break;
<add> default:
<add> schedulerPriority = NormalSchedulerPriority;
<add> break;
<add> }
<ide> injectedHook.onCommitFiberRoot(
<ide> rendererID,
<ide> root,
<ide><path>packages/react-reconciler/src/ReactFiberDevToolsHook.old.js
<ide> import {enableProfilerTimer} from 'shared/ReactFeatureFlags';
<ide>
<ide> import type {Fiber, FiberRoot} from './ReactInternalTypes';
<ide> import type {ReactNodeList} from 'shared/ReactTypes';
<del>import type {LanePriority} from './ReactFiberLane.old';
<add>import type {EventPriority} from './ReactEventPriorities.old';
<ide>
<ide> import {DidCapture} from './ReactFiberFlags';
<ide> import {
<del> lanePriorityToSchedulerPriority,
<del> NoLanePriority,
<del>} from './ReactFiberLane.old';
<del>import {NormalPriority} from './SchedulerWithReactIntegration.old';
<add> DiscreteEventPriority,
<add> ContinuousEventPriority,
<add> DefaultEventPriority,
<add> IdleEventPriority,
<add>} from './ReactEventPriorities.old';
<add>import {
<add> ImmediatePriority as ImmediateSchedulerPriority,
<add> UserBlockingPriority as UserBlockingSchedulerPriority,
<add> NormalPriority as NormalSchedulerPriority,
<add> IdlePriority as IdleSchedulerPriority,
<add>} from './SchedulerWithReactIntegration.old';
<ide>
<ide> declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: Object | void;
<ide>
<ide> export function onScheduleRoot(root: FiberRoot, children: ReactNodeList) {
<ide> }
<ide> }
<ide>
<del>export function onCommitRoot(root: FiberRoot, priorityLevel: LanePriority) {
<add>export function onCommitRoot(root: FiberRoot, eventPriority: EventPriority) {
<ide> if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {
<ide> try {
<ide> const didError = (root.current.flags & DidCapture) === DidCapture;
<ide> if (enableProfilerTimer) {
<del> const schedulerPriority =
<del> priorityLevel === NoLanePriority
<del> ? NormalPriority
<del> : lanePriorityToSchedulerPriority(priorityLevel);
<add> let schedulerPriority;
<add> switch (eventPriority) {
<add> case DiscreteEventPriority:
<add> schedulerPriority = ImmediateSchedulerPriority;
<add> break;
<add> case ContinuousEventPriority:
<add> schedulerPriority = UserBlockingSchedulerPriority;
<add> break;
<add> case DefaultEventPriority:
<add> schedulerPriority = NormalSchedulerPriority;
<add> break;
<add> case IdleEventPriority:
<add> schedulerPriority = IdleSchedulerPriority;
<add> break;
<add> default:
<add> schedulerPriority = NormalSchedulerPriority;
<add> break;
<add> }
<ide> injectedHook.onCommitFiberRoot(
<ide> rendererID,
<ide> root,
<ide><path>packages/react-reconciler/src/ReactFiberHooks.new.js
<ide> import {
<ide> import {
<ide> NoLane,
<ide> NoLanes,
<del> InputContinuousLanePriority,
<ide> isSubsetOfLanes,
<ide> mergeLanes,
<ide> removeLanes,
<ide> intersectLanes,
<ide> isTransitionLane,
<ide> markRootEntangled,
<ide> markRootMutableRead,
<del> getCurrentUpdateLanePriority,
<del> setCurrentUpdateLanePriority,
<del> higherLanePriority,
<del> DefaultLanePriority,
<ide> } from './ReactFiberLane.new';
<add>import {
<add> DefaultEventPriority,
<add> ContinuousEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<add> higherEventPriority,
<add>} from './ReactEventPriorities.new';
<ide> import {readContext, checkIfContextChanged} from './ReactFiberNewContext.new';
<ide> import {HostRoot, CacheComponent} from './ReactWorkTags';
<ide> import {
<ide> function rerenderDeferredValue<T>(value: T): T {
<ide> }
<ide>
<ide> function startTransition(setPending, callback) {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<del> setCurrentUpdateLanePriority(
<del> higherLanePriority(previousLanePriority, InputContinuousLanePriority),
<add> const previousPriority = getCurrentUpdatePriority();
<add> setCurrentUpdatePriority(
<add> higherEventPriority(previousPriority, ContinuousEventPriority),
<ide> );
<ide>
<ide> setPending(true);
<ide>
<ide> // TODO: Can remove this. Was only necessary because we used to give
<ide> // different behavior to transitions without a config object. Now they are
<ide> // all treated the same.
<del> setCurrentUpdateLanePriority(DefaultLanePriority);
<add> setCurrentUpdatePriority(DefaultEventPriority);
<ide>
<ide> const prevTransition = ReactCurrentBatchConfig.transition;
<ide> ReactCurrentBatchConfig.transition = 1;
<ide> try {
<ide> setPending(false);
<ide> callback();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> ReactCurrentBatchConfig.transition = prevTransition;
<ide> }
<ide> }
<ide><path>packages/react-reconciler/src/ReactFiberHooks.old.js
<ide> import {
<ide> import {
<ide> NoLane,
<ide> NoLanes,
<del> InputContinuousLanePriority,
<ide> isSubsetOfLanes,
<ide> mergeLanes,
<ide> removeLanes,
<ide> intersectLanes,
<ide> isTransitionLane,
<ide> markRootEntangled,
<ide> markRootMutableRead,
<del> getCurrentUpdateLanePriority,
<del> setCurrentUpdateLanePriority,
<del> higherLanePriority,
<del> DefaultLanePriority,
<ide> } from './ReactFiberLane.old';
<add>import {
<add> DefaultEventPriority,
<add> ContinuousEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<add> higherEventPriority,
<add>} from './ReactEventPriorities.old';
<ide> import {readContext, checkIfContextChanged} from './ReactFiberNewContext.old';
<ide> import {HostRoot, CacheComponent} from './ReactWorkTags';
<ide> import {
<ide> function rerenderDeferredValue<T>(value: T): T {
<ide> }
<ide>
<ide> function startTransition(setPending, callback) {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<del> setCurrentUpdateLanePriority(
<del> higherLanePriority(previousLanePriority, InputContinuousLanePriority),
<add> const previousPriority = getCurrentUpdatePriority();
<add> setCurrentUpdatePriority(
<add> higherEventPriority(previousPriority, ContinuousEventPriority),
<ide> );
<ide>
<ide> setPending(true);
<ide>
<ide> // TODO: Can remove this. Was only necessary because we used to give
<ide> // different behavior to transitions without a config object. Now they are
<ide> // all treated the same.
<del> setCurrentUpdateLanePriority(DefaultLanePriority);
<add> setCurrentUpdatePriority(DefaultEventPriority);
<ide>
<ide> const prevTransition = ReactCurrentBatchConfig.transition;
<ide> ReactCurrentBatchConfig.transition = 1;
<ide> try {
<ide> setPending(false);
<ide> callback();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> ReactCurrentBatchConfig.transition = prevTransition;
<ide> }
<ide> }
<ide><path>packages/react-reconciler/src/ReactFiberLane.new.js
<ide> export const NoLanePriority: LanePriority = 0;
<ide>
<ide> export const TotalLanes = 31;
<ide>
<del>export const NoLanes: Lanes = /* */ 0b000000000000000000000000000000;
<del>export const NoLane: Lane = /* */ 0b000000000000000000000000000000;
<add>export const NoLanes: Lanes = /* */ 0b0000000000000000000000000000000;
<add>export const NoLane: Lane = /* */ 0b0000000000000000000000000000000;
<ide>
<ide> export const SyncLane: Lane = /* */ 0b0000000000000000000000000000001;
<ide>
<ide> export function getLabelsForLanes(lanes: Lanes): Array<string> | void {
<ide>
<ide> export const NoTimestamp = -1;
<ide>
<del>let currentUpdateLanePriority: LanePriority = NoLanePriority;
<del>
<ide> let nextTransitionLane: Lane = TransitionLane1;
<ide> let nextRetryLane: Lane = RetryLane1;
<ide>
<del>export function getCurrentUpdateLanePriority(): LanePriority {
<del> return currentUpdateLanePriority;
<del>}
<del>
<del>export function setCurrentUpdateLanePriority(newLanePriority: LanePriority) {
<del> currentUpdateLanePriority = newLanePriority;
<del>}
<del>
<ide> // "Registers" used to "return" multiple values
<ide> // Used by getHighestPriorityLanes and getNextLanes:
<ide> let return_highestLanePriority: LanePriority = DefaultLanePriority;
<ide> export function isTransitionLane(lane: Lane) {
<ide> return (lane & TransitionLanes) !== 0;
<ide> }
<ide>
<del>// To ensure consistency across multiple updates in the same event, this should
<del>// be a pure function, so that it always returns the same lane for given inputs.
<del>export function findUpdateLane(lanePriority: LanePriority): Lane {
<del> switch (lanePriority) {
<del> case NoLanePriority:
<del> break;
<del> case SyncLanePriority:
<del> return SyncLane;
<del> case InputContinuousLanePriority:
<del> return InputContinuousLane;
<del> case DefaultLanePriority:
<del> return DefaultLane;
<del> case TransitionPriority: // Should be handled by findTransitionLane instead
<del> case RetryLanePriority: // Should be handled by findRetryLane instead
<del> break;
<del> case IdleLanePriority:
<del> return IdleLane;
<del> default:
<del> // The remaining priorities are not valid for updates
<del> break;
<del> }
<del>
<del> invariant(
<del> false,
<del> 'Invalid update priority: %s. This is a bug in React.',
<del> lanePriority,
<del> );
<del>}
<del>
<ide> export function claimNextTransitionLane(): Lane {
<ide> // Cycle through the lanes, assigning each new transition to the next lane.
<ide> // In most cases, this means every transition gets its own lane, until we
<ide> export function claimNextRetryLane(): Lane {
<ide> return lane;
<ide> }
<ide>
<del>function getHighestPriorityLane(lanes: Lanes) {
<add>export function getHighestPriorityLane(lanes: Lanes): Lane {
<ide> return lanes & -lanes;
<ide> }
<ide>
<ide><path>packages/react-reconciler/src/ReactFiberLane.old.js
<ide> export const NoLanePriority: LanePriority = 0;
<ide>
<ide> export const TotalLanes = 31;
<ide>
<del>export const NoLanes: Lanes = /* */ 0b000000000000000000000000000000;
<del>export const NoLane: Lane = /* */ 0b000000000000000000000000000000;
<add>export const NoLanes: Lanes = /* */ 0b0000000000000000000000000000000;
<add>export const NoLane: Lane = /* */ 0b0000000000000000000000000000000;
<ide>
<ide> export const SyncLane: Lane = /* */ 0b0000000000000000000000000000001;
<ide>
<ide> export function getLabelsForLanes(lanes: Lanes): Array<string> | void {
<ide>
<ide> export const NoTimestamp = -1;
<ide>
<del>let currentUpdateLanePriority: LanePriority = NoLanePriority;
<del>
<ide> let nextTransitionLane: Lane = TransitionLane1;
<ide> let nextRetryLane: Lane = RetryLane1;
<ide>
<del>export function getCurrentUpdateLanePriority(): LanePriority {
<del> return currentUpdateLanePriority;
<del>}
<del>
<del>export function setCurrentUpdateLanePriority(newLanePriority: LanePriority) {
<del> currentUpdateLanePriority = newLanePriority;
<del>}
<del>
<ide> // "Registers" used to "return" multiple values
<ide> // Used by getHighestPriorityLanes and getNextLanes:
<ide> let return_highestLanePriority: LanePriority = DefaultLanePriority;
<ide> export function isTransitionLane(lane: Lane) {
<ide> return (lane & TransitionLanes) !== 0;
<ide> }
<ide>
<del>// To ensure consistency across multiple updates in the same event, this should
<del>// be a pure function, so that it always returns the same lane for given inputs.
<del>export function findUpdateLane(lanePriority: LanePriority): Lane {
<del> switch (lanePriority) {
<del> case NoLanePriority:
<del> break;
<del> case SyncLanePriority:
<del> return SyncLane;
<del> case InputContinuousLanePriority:
<del> return InputContinuousLane;
<del> case DefaultLanePriority:
<del> return DefaultLane;
<del> case TransitionPriority: // Should be handled by findTransitionLane instead
<del> case RetryLanePriority: // Should be handled by findRetryLane instead
<del> break;
<del> case IdleLanePriority:
<del> return IdleLane;
<del> default:
<del> // The remaining priorities are not valid for updates
<del> break;
<del> }
<del>
<del> invariant(
<del> false,
<del> 'Invalid update priority: %s. This is a bug in React.',
<del> lanePriority,
<del> );
<del>}
<del>
<ide> export function claimNextTransitionLane(): Lane {
<ide> // Cycle through the lanes, assigning each new transition to the next lane.
<ide> // In most cases, this means every transition gets its own lane, until we
<ide> export function claimNextRetryLane(): Lane {
<ide> return lane;
<ide> }
<ide>
<del>function getHighestPriorityLane(lanes: Lanes) {
<add>export function getHighestPriorityLane(lanes: Lanes): Lane {
<ide> return lanes & -lanes;
<ide> }
<ide>
<ide><path>packages/react-reconciler/src/ReactFiberReconciler.js
<ide> import {
<ide> observeVisibleRects as observeVisibleRects_old,
<ide> registerMutableSourceForHydration as registerMutableSourceForHydration_old,
<ide> runWithPriority as runWithPriority_old,
<del> getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_old,
<add> getCurrentUpdatePriority as getCurrentUpdatePriority_old,
<ide> } from './ReactFiberReconciler.old';
<ide>
<ide> import {
<ide> import {
<ide> observeVisibleRects as observeVisibleRects_new,
<ide> registerMutableSourceForHydration as registerMutableSourceForHydration_new,
<ide> runWithPriority as runWithPriority_new,
<del> getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_new,
<add> getCurrentUpdatePriority as getCurrentUpdatePriority_new,
<ide> } from './ReactFiberReconciler.new';
<ide>
<ide> export const createContainer = enableNewReconciler
<ide> export const attemptContinuousHydration = enableNewReconciler
<ide> export const attemptHydrationAtCurrentPriority = enableNewReconciler
<ide> ? attemptHydrationAtCurrentPriority_new
<ide> : attemptHydrationAtCurrentPriority_old;
<del>export const getCurrentUpdateLanePriority = enableNewReconciler
<del> ? getCurrentUpdateLanePriority_new
<del> : getCurrentUpdateLanePriority_old;
<add>export const getCurrentUpdatePriority = enableNewReconciler
<add> ? getCurrentUpdatePriority_new
<add> : getCurrentUpdatePriority_old;
<ide> export const findHostInstance = enableNewReconciler
<ide> ? findHostInstance_new
<ide> : findHostInstance_old;
<ide><path>packages/react-reconciler/src/ReactFiberReconciler.new.js
<ide> import type {
<ide> } from './ReactFiberHostConfig';
<ide> import type {RendererInspectionConfig} from './ReactFiberHostConfig';
<ide> import type {ReactNodeList} from 'shared/ReactTypes';
<del>import type {Lane, LanePriority} from './ReactFiberLane.new';
<add>import type {Lane} from './ReactFiberLane.new';
<ide> import type {SuspenseState} from './ReactFiberSuspenseComponent.new';
<ide>
<ide> import {
<ide> import {
<ide> NoTimestamp,
<ide> getHighestPriorityPendingLanes,
<ide> higherPriorityLane,
<del> getCurrentUpdateLanePriority,
<del> setCurrentUpdateLanePriority,
<ide> } from './ReactFiberLane.new';
<add>import {
<add> getCurrentUpdatePriority,
<add> runWithPriority,
<add>} from './ReactEventPriorities.new';
<ide> import {
<ide> scheduleRefresh,
<ide> scheduleRoot,
<ide> export function attemptHydrationAtCurrentPriority(fiber: Fiber): void {
<ide> markRetryLaneIfNotHydrated(fiber, lane);
<ide> }
<ide>
<del>export function runWithPriority<T>(priority: LanePriority, fn: () => T) {
<del> const previousPriority = getCurrentUpdateLanePriority();
<del> try {
<del> setCurrentUpdateLanePriority(priority);
<del> return fn();
<del> } finally {
<del> setCurrentUpdateLanePriority(previousPriority);
<del> }
<del>}
<del>
<del>export {getCurrentUpdateLanePriority};
<add>export {getCurrentUpdatePriority, runWithPriority};
<ide>
<ide> export {findHostInstance};
<ide>
<ide><path>packages/react-reconciler/src/ReactFiberReconciler.old.js
<ide> import type {
<ide> } from './ReactFiberHostConfig';
<ide> import type {RendererInspectionConfig} from './ReactFiberHostConfig';
<ide> import type {ReactNodeList} from 'shared/ReactTypes';
<del>import type {Lane, LanePriority} from './ReactFiberLane.old';
<add>import type {Lane} from './ReactFiberLane.old';
<ide> import type {SuspenseState} from './ReactFiberSuspenseComponent.old';
<ide>
<ide> import {
<ide> import {
<ide> NoTimestamp,
<ide> getHighestPriorityPendingLanes,
<ide> higherPriorityLane,
<del> getCurrentUpdateLanePriority,
<del> setCurrentUpdateLanePriority,
<ide> } from './ReactFiberLane.old';
<add>import {
<add> getCurrentUpdatePriority,
<add> runWithPriority,
<add>} from './ReactEventPriorities.old';
<ide> import {
<ide> scheduleRefresh,
<ide> scheduleRoot,
<ide> export function attemptHydrationAtCurrentPriority(fiber: Fiber): void {
<ide> markRetryLaneIfNotHydrated(fiber, lane);
<ide> }
<ide>
<del>export function runWithPriority<T>(priority: LanePriority, fn: () => T) {
<del> const previousPriority = getCurrentUpdateLanePriority();
<del> try {
<del> setCurrentUpdateLanePriority(priority);
<del> return fn();
<del> } finally {
<del> setCurrentUpdateLanePriority(previousPriority);
<del> }
<del>}
<del>
<del>export {getCurrentUpdateLanePriority};
<add>export {getCurrentUpdatePriority, runWithPriority};
<ide>
<ide> export {findHostInstance};
<ide>
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.new.js
<ide>
<ide> import type {Thenable, Wakeable} from 'shared/ReactTypes';
<ide> import type {Fiber, FiberRoot} from './ReactInternalTypes';
<del>import type {Lanes, Lane, LanePriority} from './ReactFiberLane.new';
<add>import type {Lanes, Lane} from './ReactFiberLane.new';
<ide> import type {Interaction} from 'scheduler/src/Tracing';
<ide> import type {SuspenseState} from './ReactFiberSuspenseComponent.new';
<ide> import type {StackCursor} from './ReactFiberStack.new';
<ide> import {
<ide> import {
<ide> NoLanePriority,
<ide> SyncLanePriority,
<del> DefaultLanePriority,
<ide> NoLanes,
<ide> NoLane,
<ide> SyncLane,
<ide> NoTimestamp,
<del> findUpdateLane,
<ide> claimNextTransitionLane,
<ide> claimNextRetryLane,
<ide> includesSomeLane,
<ide> import {
<ide> includesOnlyTransitions,
<ide> getNextLanes,
<ide> returnNextLanesPriority,
<del> setCurrentUpdateLanePriority,
<del> getCurrentUpdateLanePriority,
<ide> markStarvedLanesAsExpired,
<ide> getLanesToRetrySynchronouslyOnError,
<ide> getMostRecentEventTime,
<ide> import {
<ide> markRootFinished,
<ide> lanePriorityToSchedulerPriority,
<ide> } from './ReactFiberLane.new';
<add>import {
<add> DiscreteEventPriority,
<add> DefaultEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<add> higherEventPriority,
<add> lanesToEventPriority,
<add>} from './ReactEventPriorities.new';
<ide> import {requestCurrentTransition, NoTransition} from './ReactFiberTransition';
<ide> import {beginWork as originalBeginWork} from './ReactFiberBeginWork.new';
<ide> import {completeWork} from './ReactFiberCompleteWork.new';
<ide> let rootCommittingMutationOrLayoutEffects: FiberRoot | null = null;
<ide>
<ide> let rootDoesHavePassiveEffects: boolean = false;
<ide> let rootWithPendingPassiveEffects: FiberRoot | null = null;
<del>let pendingPassiveEffectsRenderPriority: LanePriority = NoLanePriority;
<ide> let pendingPassiveEffectsLanes: Lanes = NoLanes;
<ide> let pendingPassiveProfilerEffects: Array<Fiber> = [];
<ide>
<ide> export function requestUpdateLane(fiber: Fiber): Lane {
<ide>
<ide> // Updates originating inside certain React methods, like flushSync, have
<ide> // their priority set by tracking it with a context variable.
<del> const updateLanePriority = getCurrentUpdateLanePriority();
<del> if (updateLanePriority !== NoLanePriority) {
<del> return findUpdateLane(updateLanePriority);
<add> //
<add> // The opaque type returned by the host config is internally a lane, so we can
<add> // use that directly.
<add> // TODO: Move this type conversion to the event priority module.
<add> const updateLane: Lane = (getCurrentUpdatePriority(): any);
<add> if (updateLane !== NoLane) {
<add> return updateLane;
<ide> }
<ide>
<ide> // This update originated outside React. Ask the host environement for an
<ide> // appropriate priority, based on the type of event.
<ide> //
<ide> // The opaque type returned by the host config is internally a lane, so we can
<ide> // use that directly.
<del> const eventLane = getCurrentEventPriority();
<add> // TODO: Move this type conversion to the event priority module.
<add> const eventLane: Lane = (getCurrentEventPriority(): any);
<ide> return eventLane;
<ide> }
<ide>
<ide> export function flushDiscreteUpdates() {
<ide> }
<ide>
<ide> export function deferredUpdates<A>(fn: () => A): A {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(DefaultLanePriority);
<add> setCurrentUpdatePriority(DefaultEventPriority);
<ide> return fn();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> }
<ide> }
<ide>
<ide> export function discreteUpdates<A, B, C, D, R>(
<ide> c: C,
<ide> d: D,
<ide> ): R {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> return fn(a, b, c, d);
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> if (executionContext === NoContext) {
<ide> // Flush the immediate callbacks that were scheduled during this batch
<ide> resetRenderTimer();
<ide> export function flushSync<A, R>(fn: A => R, a: A): R {
<ide> }
<ide> executionContext |= BatchedContext;
<ide>
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> if (fn) {
<ide> return fn(a);
<ide> } else {
<ide> return (undefined: $FlowFixMe);
<ide> }
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> executionContext = prevExecutionContext;
<ide> // Flush the immediate callbacks that were scheduled during this batch.
<ide> // Note that this will happen even if batchedUpdates is higher up
<ide> export function flushSync<A, R>(fn: A => R, a: A): R {
<ide> export function flushControlled(fn: () => mixed): void {
<ide> const prevExecutionContext = executionContext;
<ide> executionContext |= BatchedContext;
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> fn();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide>
<ide> executionContext = prevExecutionContext;
<ide> if (executionContext === NoContext) {
<ide> function completeUnitOfWork(unitOfWork: Fiber): void {
<ide> }
<ide>
<ide> function commitRoot(root) {
<del> const previousUpdateLanePriority = getCurrentUpdateLanePriority();
<add> // TODO: This no longer makes any sense. We already wrap the mutation and
<add> // layout phases. Should be able to remove.
<add> const previousUpdateLanePriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> commitRootImpl(root, previousUpdateLanePriority);
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousUpdateLanePriority);
<add> setCurrentUpdatePriority(previousUpdateLanePriority);
<ide> }
<ide>
<ide> return null;
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> NoFlags;
<ide>
<ide> if (subtreeHasEffects || rootHasEffect) {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> const previousPriority = getCurrentUpdatePriority();
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide>
<ide> const prevExecutionContext = executionContext;
<ide> executionContext |= CommitContext;
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> }
<ide>
<ide> // The next phase is the mutation phase, where we mutate the host tree.
<del> commitMutationEffects(root, renderPriorityLevel, finishedWork);
<add> commitMutationEffects(root, finishedWork);
<ide>
<ide> if (shouldFireAfterActiveInstanceBlur) {
<ide> afterActiveInstanceBlur();
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> }
<ide> executionContext = prevExecutionContext;
<ide>
<del> if (previousLanePriority != null) {
<del> // Reset the priority to the previous non-sync value.
<del> setCurrentUpdateLanePriority(previousLanePriority);
<del> }
<add> // Reset the priority to the previous non-sync value.
<add> setCurrentUpdatePriority(previousPriority);
<ide> } else {
<ide> // No effects.
<ide> root.current = finishedWork;
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> rootDoesHavePassiveEffects = false;
<ide> rootWithPendingPassiveEffects = root;
<ide> pendingPassiveEffectsLanes = lanes;
<del> pendingPassiveEffectsRenderPriority =
<del> renderPriorityLevel === NoLanePriority
<del> ? DefaultLanePriority
<del> : renderPriorityLevel;
<ide> }
<ide>
<ide> // Read this again, since an effect might have updated it
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide>
<ide> export function flushPassiveEffects(): boolean {
<ide> // Returns whether passive effects were flushed.
<del> if (pendingPassiveEffectsRenderPriority !== NoLanePriority) {
<del> const priorityLevel =
<del> pendingPassiveEffectsRenderPriority > DefaultLanePriority
<del> ? DefaultLanePriority
<del> : pendingPassiveEffectsRenderPriority;
<del> pendingPassiveEffectsRenderPriority = NoLanePriority;
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> if (pendingPassiveEffectsLanes !== NoLanes) {
<add> const priority = higherEventPriority(
<add> DefaultEventPriority,
<add> lanesToEventPriority(pendingPassiveEffectsLanes),
<add> );
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(priorityLevel);
<add> setCurrentUpdatePriority(priority);
<ide> return flushPassiveEffectsImpl();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> }
<ide> }
<ide> return false;
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.old.js
<ide>
<ide> import type {Thenable, Wakeable} from 'shared/ReactTypes';
<ide> import type {Fiber, FiberRoot} from './ReactInternalTypes';
<del>import type {Lanes, Lane, LanePriority} from './ReactFiberLane.old';
<add>import type {Lanes, Lane} from './ReactFiberLane.old';
<ide> import type {Interaction} from 'scheduler/src/Tracing';
<ide> import type {SuspenseState} from './ReactFiberSuspenseComponent.old';
<ide> import type {StackCursor} from './ReactFiberStack.old';
<ide> import {
<ide> import {
<ide> NoLanePriority,
<ide> SyncLanePriority,
<del> DefaultLanePriority,
<ide> NoLanes,
<ide> NoLane,
<ide> SyncLane,
<ide> NoTimestamp,
<del> findUpdateLane,
<ide> claimNextTransitionLane,
<ide> claimNextRetryLane,
<ide> includesSomeLane,
<ide> import {
<ide> includesOnlyTransitions,
<ide> getNextLanes,
<ide> returnNextLanesPriority,
<del> setCurrentUpdateLanePriority,
<del> getCurrentUpdateLanePriority,
<ide> markStarvedLanesAsExpired,
<ide> getLanesToRetrySynchronouslyOnError,
<ide> getMostRecentEventTime,
<ide> import {
<ide> markRootFinished,
<ide> lanePriorityToSchedulerPriority,
<ide> } from './ReactFiberLane.old';
<add>import {
<add> DiscreteEventPriority,
<add> DefaultEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<add> higherEventPriority,
<add> lanesToEventPriority,
<add>} from './ReactEventPriorities.old';
<ide> import {requestCurrentTransition, NoTransition} from './ReactFiberTransition';
<ide> import {beginWork as originalBeginWork} from './ReactFiberBeginWork.old';
<ide> import {completeWork} from './ReactFiberCompleteWork.old';
<ide> let rootCommittingMutationOrLayoutEffects: FiberRoot | null = null;
<ide>
<ide> let rootDoesHavePassiveEffects: boolean = false;
<ide> let rootWithPendingPassiveEffects: FiberRoot | null = null;
<del>let pendingPassiveEffectsRenderPriority: LanePriority = NoLanePriority;
<ide> let pendingPassiveEffectsLanes: Lanes = NoLanes;
<ide> let pendingPassiveProfilerEffects: Array<Fiber> = [];
<ide>
<ide> export function requestUpdateLane(fiber: Fiber): Lane {
<ide>
<ide> // Updates originating inside certain React methods, like flushSync, have
<ide> // their priority set by tracking it with a context variable.
<del> const updateLanePriority = getCurrentUpdateLanePriority();
<del> if (updateLanePriority !== NoLanePriority) {
<del> return findUpdateLane(updateLanePriority);
<add> //
<add> // The opaque type returned by the host config is internally a lane, so we can
<add> // use that directly.
<add> // TODO: Move this type conversion to the event priority module.
<add> const updateLane: Lane = (getCurrentUpdatePriority(): any);
<add> if (updateLane !== NoLane) {
<add> return updateLane;
<ide> }
<ide>
<ide> // This update originated outside React. Ask the host environement for an
<ide> // appropriate priority, based on the type of event.
<ide> //
<ide> // The opaque type returned by the host config is internally a lane, so we can
<ide> // use that directly.
<del> const eventLane = getCurrentEventPriority();
<add> // TODO: Move this type conversion to the event priority module.
<add> const eventLane: Lane = (getCurrentEventPriority(): any);
<ide> return eventLane;
<ide> }
<ide>
<ide> export function flushDiscreteUpdates() {
<ide> }
<ide>
<ide> export function deferredUpdates<A>(fn: () => A): A {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(DefaultLanePriority);
<add> setCurrentUpdatePriority(DefaultEventPriority);
<ide> return fn();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> }
<ide> }
<ide>
<ide> export function discreteUpdates<A, B, C, D, R>(
<ide> c: C,
<ide> d: D,
<ide> ): R {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> return fn(a, b, c, d);
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> if (executionContext === NoContext) {
<ide> // Flush the immediate callbacks that were scheduled during this batch
<ide> resetRenderTimer();
<ide> export function flushSync<A, R>(fn: A => R, a: A): R {
<ide> }
<ide> executionContext |= BatchedContext;
<ide>
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> if (fn) {
<ide> return fn(a);
<ide> } else {
<ide> return (undefined: $FlowFixMe);
<ide> }
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> executionContext = prevExecutionContext;
<ide> // Flush the immediate callbacks that were scheduled during this batch.
<ide> // Note that this will happen even if batchedUpdates is higher up
<ide> export function flushSync<A, R>(fn: A => R, a: A): R {
<ide> export function flushControlled(fn: () => mixed): void {
<ide> const prevExecutionContext = executionContext;
<ide> executionContext |= BatchedContext;
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> fn();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide>
<ide> executionContext = prevExecutionContext;
<ide> if (executionContext === NoContext) {
<ide> function completeUnitOfWork(unitOfWork: Fiber): void {
<ide> }
<ide>
<ide> function commitRoot(root) {
<del> const previousUpdateLanePriority = getCurrentUpdateLanePriority();
<add> // TODO: This no longer makes any sense. We already wrap the mutation and
<add> // layout phases. Should be able to remove.
<add> const previousUpdateLanePriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> commitRootImpl(root, previousUpdateLanePriority);
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousUpdateLanePriority);
<add> setCurrentUpdatePriority(previousUpdateLanePriority);
<ide> }
<ide>
<ide> return null;
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> NoFlags;
<ide>
<ide> if (subtreeHasEffects || rootHasEffect) {
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> const previousPriority = getCurrentUpdatePriority();
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide>
<ide> const prevExecutionContext = executionContext;
<ide> executionContext |= CommitContext;
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> }
<ide>
<ide> // The next phase is the mutation phase, where we mutate the host tree.
<del> commitMutationEffects(root, renderPriorityLevel, finishedWork);
<add> commitMutationEffects(root, finishedWork);
<ide>
<ide> if (shouldFireAfterActiveInstanceBlur) {
<ide> afterActiveInstanceBlur();
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> }
<ide> executionContext = prevExecutionContext;
<ide>
<del> if (previousLanePriority != null) {
<del> // Reset the priority to the previous non-sync value.
<del> setCurrentUpdateLanePriority(previousLanePriority);
<del> }
<add> // Reset the priority to the previous non-sync value.
<add> setCurrentUpdatePriority(previousPriority);
<ide> } else {
<ide> // No effects.
<ide> root.current = finishedWork;
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide> rootDoesHavePassiveEffects = false;
<ide> rootWithPendingPassiveEffects = root;
<ide> pendingPassiveEffectsLanes = lanes;
<del> pendingPassiveEffectsRenderPriority =
<del> renderPriorityLevel === NoLanePriority
<del> ? DefaultLanePriority
<del> : renderPriorityLevel;
<ide> }
<ide>
<ide> // Read this again, since an effect might have updated it
<ide> function commitRootImpl(root, renderPriorityLevel) {
<ide>
<ide> export function flushPassiveEffects(): boolean {
<ide> // Returns whether passive effects were flushed.
<del> if (pendingPassiveEffectsRenderPriority !== NoLanePriority) {
<del> const priorityLevel =
<del> pendingPassiveEffectsRenderPriority > DefaultLanePriority
<del> ? DefaultLanePriority
<del> : pendingPassiveEffectsRenderPriority;
<del> pendingPassiveEffectsRenderPriority = NoLanePriority;
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> if (pendingPassiveEffectsLanes !== NoLanes) {
<add> const priority = higherEventPriority(
<add> DefaultEventPriority,
<add> lanesToEventPriority(pendingPassiveEffectsLanes),
<add> );
<add> const previousPriority = getCurrentUpdatePriority();
<ide> try {
<del> setCurrentUpdateLanePriority(priorityLevel);
<add> setCurrentUpdatePriority(priority);
<ide> return flushPassiveEffectsImpl();
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousPriority);
<ide> }
<ide> }
<ide> return false;
<ide><path>packages/react-reconciler/src/SchedulerWithReactIntegration.new.js
<ide> import {__interactionsRef} from 'scheduler/tracing';
<ide> import {enableSchedulerTracing} from 'shared/ReactFeatureFlags';
<ide> import invariant from 'shared/invariant';
<ide> import {
<del> SyncLanePriority,
<del> getCurrentUpdateLanePriority,
<del> setCurrentUpdateLanePriority,
<del>} from './ReactFiberLane.new';
<add> DiscreteEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<add>} from './ReactEventPriorities.new';
<ide>
<ide> const {
<ide> unstable_scheduleCallback: Scheduler_scheduleCallback,
<ide> export function flushSyncCallbackQueue() {
<ide> // Prevent re-entrancy.
<ide> isFlushingSyncQueue = true;
<ide> let i = 0;
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousUpdatePriority = getCurrentUpdatePriority();
<ide> try {
<ide> const isSync = true;
<ide> const queue = syncQueue;
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> // TODO: Is this necessary anymore? The only user code that runs in this
<add> // queue is in the render or commit phases.
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> for (; i < queue.length; i++) {
<ide> let callback = queue[i];
<ide> do {
<ide> export function flushSyncCallbackQueue() {
<ide> );
<ide> throw error;
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousUpdatePriority);
<ide> isFlushingSyncQueue = false;
<ide> }
<ide> }
<ide><path>packages/react-reconciler/src/SchedulerWithReactIntegration.old.js
<ide> import {__interactionsRef} from 'scheduler/tracing';
<ide> import {enableSchedulerTracing} from 'shared/ReactFeatureFlags';
<ide> import invariant from 'shared/invariant';
<ide> import {
<del> SyncLanePriority,
<del> getCurrentUpdateLanePriority,
<del> setCurrentUpdateLanePriority,
<del>} from './ReactFiberLane.old';
<add> DiscreteEventPriority,
<add> getCurrentUpdatePriority,
<add> setCurrentUpdatePriority,
<add>} from './ReactEventPriorities.old';
<ide>
<ide> const {
<ide> unstable_scheduleCallback: Scheduler_scheduleCallback,
<ide> export function flushSyncCallbackQueue() {
<ide> // Prevent re-entrancy.
<ide> isFlushingSyncQueue = true;
<ide> let i = 0;
<del> const previousLanePriority = getCurrentUpdateLanePriority();
<add> const previousUpdatePriority = getCurrentUpdatePriority();
<ide> try {
<ide> const isSync = true;
<ide> const queue = syncQueue;
<del> setCurrentUpdateLanePriority(SyncLanePriority);
<add> // TODO: Is this necessary anymore? The only user code that runs in this
<add> // queue is in the render or commit phases.
<add> setCurrentUpdatePriority(DiscreteEventPriority);
<ide> for (; i < queue.length; i++) {
<ide> let callback = queue[i];
<ide> do {
<ide> export function flushSyncCallbackQueue() {
<ide> );
<ide> throw error;
<ide> } finally {
<del> setCurrentUpdateLanePriority(previousLanePriority);
<add> setCurrentUpdatePriority(previousUpdatePriority);
<ide> isFlushingSyncQueue = false;
<ide> }
<ide> }
<ide><path>packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js
<ide> let React;
<ide> let ReactNoop;
<ide> let Scheduler;
<del>
<del>// Copied from ReactFiberLanes. Don't do this!
<del>// This is hard coded directly to avoid needing to import, and
<del>// we'll remove this as we replace runWithPriority with React APIs.
<del>const InputContinuousLanePriority = 10;
<add>let ContinuousEventPriority;
<ide>
<ide> describe('ReactIncrementalUpdates', () => {
<ide> beforeEach(() => {
<ide> describe('ReactIncrementalUpdates', () => {
<ide> React = require('react');
<ide> ReactNoop = require('react-noop-renderer');
<ide> Scheduler = require('scheduler');
<add> ContinuousEventPriority = require('react-reconciler/constants')
<add> .ContinuousEventPriority;
<ide> });
<ide>
<ide> function span(prop) {
<ide> describe('ReactIncrementalUpdates', () => {
<ide> Scheduler.unstable_yieldValue('Committed: ' + log);
<ide> if (log === 'B') {
<ide> // Right after B commits, schedule additional updates.
<del> ReactNoop.unstable_runWithPriority(InputContinuousLanePriority, () =>
<add> ReactNoop.unstable_runWithPriority(ContinuousEventPriority, () =>
<ide> pushToLog('C'),
<ide> );
<ide> setLog(prevLog => prevLog + 'D');
<ide> describe('ReactIncrementalUpdates', () => {
<ide> await ReactNoop.act(async () => {
<ide> pushToLog('A');
<ide>
<del> ReactNoop.unstable_runWithPriority(InputContinuousLanePriority, () =>
<add> ReactNoop.unstable_runWithPriority(ContinuousEventPriority, () =>
<ide> pushToLog('B'),
<ide> );
<ide> });
<ide> describe('ReactIncrementalUpdates', () => {
<ide> Scheduler.unstable_yieldValue('Committed: ' + this.state.log);
<ide> if (this.state.log === 'B') {
<ide> // Right after B commits, schedule additional updates.
<del> ReactNoop.unstable_runWithPriority(InputContinuousLanePriority, () =>
<add> ReactNoop.unstable_runWithPriority(ContinuousEventPriority, () =>
<ide> this.pushToLog('C'),
<ide> );
<ide> this.pushToLog('D');
<ide> describe('ReactIncrementalUpdates', () => {
<ide>
<ide> await ReactNoop.act(async () => {
<ide> pushToLog('A');
<del> ReactNoop.unstable_runWithPriority(InputContinuousLanePriority, () =>
<add> ReactNoop.unstable_runWithPriority(ContinuousEventPriority, () =>
<ide> pushToLog('B'),
<ide> );
<ide> });
<ide><path>packages/react/src/__tests__/ReactDOMTracing-test.internal.js
<ide> let onWorkCanceled;
<ide> let onWorkScheduled;
<ide> let onWorkStarted;
<ide> let onWorkStopped;
<del>
<del>// Copied from ReactFiberLanes. Don't do this!
<del>// This is hard coded directly to avoid needing to import, and
<del>// we'll remove this as we replace runWithPriority with React APIs.
<del>const IdleLanePriority = 2;
<del>const InputContinuousPriority = 10;
<add>let IdleEventPriority;
<add>let ContinuousEventPriority;
<ide>
<ide> function loadModules() {
<ide> ReactFeatureFlags = require('shared/ReactFeatureFlags');
<ide> function loadModules() {
<ide> SchedulerTracing = require('scheduler/tracing');
<ide> TestUtils = require('react-dom/test-utils');
<ide>
<add> IdleEventPriority = require('react-reconciler/constants').IdleEventPriority;
<add> ContinuousEventPriority = require('react-reconciler/constants')
<add> .ContinuousEventPriority;
<add>
<ide> act = TestUtils.unstable_concurrentAct;
<ide>
<ide> onInteractionScheduledWorkCompleted = jest.fn();
<ide> describe('ReactDOMTracing', () => {
<ide> Scheduler.unstable_yieldValue('Child:update');
<ide> } else {
<ide> Scheduler.unstable_yieldValue('Child:mount');
<del> ReactDOM.unstable_runWithPriority(IdleLanePriority, () =>
<add> ReactDOM.unstable_runWithPriority(IdleEventPriority, () =>
<ide> setDidMount(true),
<ide> );
<ide> }
<ide> describe('ReactDOMTracing', () => {
<ide> let interaction = null;
<ide> SchedulerTracing.unstable_trace('update', 0, () => {
<ide> interaction = Array.from(SchedulerTracing.unstable_getCurrent())[0];
<del> ReactDOM.unstable_runWithPriority(InputContinuousPriority, () =>
<add> ReactDOM.unstable_runWithPriority(ContinuousEventPriority, () =>
<ide> scheduleUpdateWithHidden(),
<ide> );
<ide> });
<ide> describe('ReactDOMTracing', () => {
<ide> // Schedule an unrelated low priority update that shouldn't be included
<ide> // in the previous interaction. This is meant to ensure that we don't
<ide> // rely on the whole tree completing to cover up bugs.
<del> ReactDOM.unstable_runWithPriority(IdleLanePriority, () => {
<add> ReactDOM.unstable_runWithPriority(IdleEventPriority, () => {
<ide> root.render(<App />);
<ide> });
<ide> | 25 |
PHP | PHP | enforce specific ordering to fix failing tests | 94f18be055d7c2a87167829ffe5b6951e65799ca | <ide><path>tests/TestCase/ORM/QueryTest.php
<ide> public function testFormatDeepAssocationRecords() {
<ide> });
<ide> };
<ide> $query = $table->find()
<del> ->contain(['Articles' => $builder, 'Articles.Authors' => $builder]);
<add> ->contain(['Articles' => $builder, 'Articles.Authors' => $builder])
<add> ->order(['Articles.id' => 'ASC']);
<add>
<ide> $query->formatResults(function($results) {
<ide> return $results->map(function($row) {
<ide> return sprintf(
<ide> public function testContainInAssociationQuery() {
<ide> $table->belongsTo('Articles');
<ide> $table->association('Articles')->target()->belongsTo('Authors');
<ide>
<del> $query = $table->find()->contain(['Articles' => function($q) {
<del> return $q->contain('Authors');
<del> }]);
<add> $query = $table->find()
<add> ->order(['Articles.id' => 'ASC'])
<add> ->contain(['Articles' => function($q) {
<add> return $q->contain('Authors');
<add> }]);
<ide> $results = $query->extract('article.author.name')->toArray();
<ide> $expected = ['mariano', 'mariano', 'larry', 'larry'];
<ide> $this->assertEquals($expected, $results); | 1 |
Text | Text | fix typo in root readme | 68e19f1c228c92d5d800533f558faff24b57127a | <ide><path>README.md
<ide> At some point in the future, you'll be able to seamlessly move from pre-training
<ide> 22. **[Other community models](https://huggingface.co/models)**, contributed by the [community](https://huggingface.co/users).
<ide> 23. Want to contribute a new model? We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them in the [`templates`](./templates) folder of the repository. Be sure to check the [contributing guidelines](./CONTRIBUTING.md) and contact the maintainers or open an issue to collect feedbacks before starting your PR.
<ide>
<del>These implementations have been tested on several datasets (see the example scripts) and should match the performances of the original implementations (e.g. ~93 F1 on SQuAD for BERT Whole-Word-Masking, ~88 F1 on RocStories for OpenAI GPT, ~18.3 perplexity on WikiText 103 for Transformer-XL, ~0.916 Peason R coefficient on STS-B for XLNet). You can find more details on the performances in the Examples section of the [documentation](https://huggingface.co/transformers/examples.html).
<add>These implementations have been tested on several datasets (see the example scripts) and should match the performances of the original implementations (e.g. ~93 F1 on SQuAD for BERT Whole-Word-Masking, ~88 F1 on RocStories for OpenAI GPT, ~18.3 perplexity on WikiText 103 for Transformer-XL, ~0.916 Pearson R coefficient on STS-B for XLNet). You can find more details on the performances in the Examples section of the [documentation](https://huggingface.co/transformers/examples.html).
<ide>
<ide> ## Online demo
<ide> | 1 |
PHP | PHP | remove new checks | edde524bc9b5c17c1a13096260e043f4140430a4 | <ide><path>Cake/Model/Behavior/TimestampBehavior.php
<ide> public function touch(Entity $entity, $eventName = 'Model.beforeSave') {
<ide> return false;
<ide> }
<ide>
<del> $new = $entity->isNew() !== false;
<ide> $return = false;
<ide>
<ide> foreach ($config['events'][$eventName] as $field => $when) {
<del> if (
<del> $when === 'always' ||
<del> ($when === 'existing' && !$new)
<del> ) {
<add> if (in_array($when, ['always', 'existing'])) {
<ide> $return = true;
<ide> $entity->dirty($field, false);
<ide> $this->_updateField($entity, $field, $config['refreshTimestamp']); | 1 |
Javascript | Javascript | move createstrictshapetypechecker to deprecated | 62e0d508d6ccc4af71f0bf03645f2bad6f6cd240 | <ide><path>Libraries/CameraRoll/CameraRoll.js
<ide> const PropTypes = require('prop-types');
<ide> const {checkPropTypes} = PropTypes;
<ide> const RCTCameraRollManager = require('NativeModules').CameraRollManager;
<ide>
<del>const createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
<add>const deprecatedCreateStrictShapeTypeChecker = require('deprecatedCreateStrictShapeTypeChecker');
<ide> const invariant = require('fbjs/lib/invariant');
<ide>
<ide> const GROUP_TYPES_OPTIONS = {
<ide> type GetPhotosParams = {
<ide> /**
<ide> * Shape of the param arg for the `getPhotos` function.
<ide> */
<del>const getPhotosParamChecker = createStrictShapeTypeChecker({
<add>const getPhotosParamChecker = deprecatedCreateStrictShapeTypeChecker({
<ide> /**
<ide> * The number of photos wanted in reverse order of the photo application
<ide> * (i.e. most recent first for SavedPhotos).
<ide> type GetPhotosReturn = Promise<{
<ide> /**
<ide> * Shape of the return value of the `getPhotos` function.
<ide> */
<del>const getPhotosReturnChecker = createStrictShapeTypeChecker({
<add>const getPhotosReturnChecker = deprecatedCreateStrictShapeTypeChecker({
<ide> edges: PropTypes.arrayOf(
<ide> /* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an
<ide> * error found when Flow v0.66 was deployed. To see the error delete this
<ide> * comment and run Flow. */
<del> createStrictShapeTypeChecker({
<del> node: createStrictShapeTypeChecker({
<add> deprecatedCreateStrictShapeTypeChecker({
<add> node: deprecatedCreateStrictShapeTypeChecker({
<ide> type: PropTypes.string.isRequired,
<ide> group_name: PropTypes.string.isRequired,
<del> image: createStrictShapeTypeChecker({
<add> image: deprecatedCreateStrictShapeTypeChecker({
<ide> uri: PropTypes.string.isRequired,
<ide> height: PropTypes.number.isRequired,
<ide> width: PropTypes.number.isRequired,
<ide> isStored: PropTypes.bool,
<ide> playableDuration: PropTypes.number.isRequired,
<ide> }).isRequired,
<ide> timestamp: PropTypes.number.isRequired,
<del> location: createStrictShapeTypeChecker({
<add> location: deprecatedCreateStrictShapeTypeChecker({
<ide> latitude: PropTypes.number,
<ide> longitude: PropTypes.number,
<ide> altitude: PropTypes.number,
<ide> const getPhotosReturnChecker = createStrictShapeTypeChecker({
<ide> }).isRequired,
<ide> }),
<ide> ).isRequired,
<del> page_info: createStrictShapeTypeChecker({
<add> page_info: deprecatedCreateStrictShapeTypeChecker({
<ide> has_next_page: PropTypes.bool.isRequired,
<ide> start_cursor: PropTypes.string,
<ide> end_cursor: PropTypes.string,
<ide><path>Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js
<ide>
<ide> 'use strict';
<ide>
<del>const createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
<add>const deprecatedCreateStrictShapeTypeChecker = require('deprecatedCreateStrictShapeTypeChecker');
<ide> const flattenStyle = require('flattenStyle');
<ide>
<ide> function DeprecatedStyleSheetPropType(shape: {
<ide> [key: string]: ReactPropsCheckType,
<ide> }): ReactPropsCheckType {
<del> const shapePropType = createStrictShapeTypeChecker(shape);
<add> const shapePropType = deprecatedCreateStrictShapeTypeChecker(shape);
<ide> return function(props, propName, componentName, location?, ...rest) {
<ide> let newProps = props;
<ide> if (props[propName]) {
<add><path>Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js
<del><path>Libraries/Utilities/createStrictShapeTypeChecker.js
<ide> const invariant = require('fbjs/lib/invariant');
<ide> const merge = require('merge');
<ide>
<del>function createStrictShapeTypeChecker(shapeTypes: {
<add>function deprecatedCreateStrictShapeTypeChecker(shapeTypes: {
<ide> [key: string]: ReactPropsCheckType,
<ide> }): ReactPropsChainableTypeChecker {
<ide> function checkType(
<ide> function createStrictShapeTypeChecker(shapeTypes: {
<ide> return chainedCheckType;
<ide> }
<ide>
<del>module.exports = createStrictShapeTypeChecker;
<add>module.exports = deprecatedCreateStrictShapeTypeChecker; | 3 |
Javascript | Javascript | add siswati (ss) locale | 7c5855e760f73487d3c8de9273561ef38069b01a | <ide><path>src/locale/ss.js
<add>//! moment.js locale configuration
<add>//! locale : siSwati (ss)
<add>//! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
<add>
<add>
<add>import moment from '../moment';
<add>
<add>export default moment.defineLocale('ss', {
<add> months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
<add> monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
<add> weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
<add> weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
<add> weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
<add> longDateFormat : {
<add> LT : 'h:mm A',
<add> LTS : 'h:mm:ss A',
<add> L : 'DD/MM/YYYY',
<add> LL : 'D MMMM YYYY',
<add> LLL : 'D MMMM YYYY h:mm A',
<add> LLLL : 'dddd, D MMMM YYYY h:mm A'
<add> },
<add> calendar : {
<add> sameDay : '[Namuhla nga] LT',
<add> nextDay : '[Kusasa nga] LT',
<add> nextWeek : 'dddd [nga] LT',
<add> lastDay : '[Itolo nga] LT',
<add> lastWeek : 'dddd [leliphelile] [nga] LT',
<add> sameElse : 'L'
<add> },
<add> relativeTime : {
<add> future : 'nga %s',
<add> past : 'wenteka nga %s',
<add> s : 'emizuzwana lomcane',
<add> m : 'umzuzu',
<add> mm : '%d emizuzu',
<add> h : 'lihora',
<add> hh : '%d emahora',
<add> d : 'lilanga',
<add> dd : '%d emalanga',
<add> M : 'inyanga',
<add> MM : '%d tinyanga',
<add> y : 'umnyaka',
<add> yy : '%d iminyaka'
<add> },
<add> meridiemParse: /ekuseni|emini|emtsambama|ebusuku/,
<add> meridiem : function (hours, minutes, isLower) {
<add> if (hours < 11) {
<add> return 'ekuseni';
<add> } else if (hours < 15) {
<add> return 'emini';
<add> } else if (hours < 19) {
<add> return 'emtsambama';
<add> } else {
<add> return 'ebusuku';
<add> }
<add> },
<add> meridiemHour : function (hour, meridiem) {
<add> if (hour === 12) {
<add> hour = 0;
<add> }
<add> if (meridiem === 'ekuseni') {
<add> return hour;
<add> } else if (meridiem === 'emini') {
<add> return hour >= 11 ? hour : hour + 12;
<add> } else if (meridiem === 'emtsambama' || meridiem === 'ebusuku') {
<add> if (hour === 0) {
<add> return 0;
<add> }
<add> return hour + 12;
<add> }
<add> },
<add> ordinalParse: /\d{1,2}/,
<add> ordinal : '%d',
<add> week : {
<add> dow : 1, // Monday is the first day of the week.
<add> doy : 4 // The week that contains Jan 4th is the first week of the year.
<add> }
<add>});
<add>
<ide><path>src/test/locale/ss.js
<add>import {localeModule, test} from '../qunit';
<add>import moment from '../../moment';
<add>localeModule('ss');
<add>
<add>test('parse', function (assert) {
<add> var tests = "Bhimbidvwane Bhi_Indlovana Ina_Indlov'lenkhulu Inu_Mabasa Mab_Inkhwekhweti Ink_Inhlaba Inh_Kholwane Kho_Ingci Igc_Inyoni Iny_Imphala Imp_Lweti lwe_Ingongoni Igo".split('_'), i;
<add> function equalTest(input, mmm, i) {
<add> assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
<add> }
<add> for (i = 0; i < 12; i++) {
<add> tests[i] = tests[i].split(' ');
<add> equalTest(tests[i][0], 'MMM', i);
<add> equalTest(tests[i][1], 'MMM', i);
<add> equalTest(tests[i][0], 'MMMM', i);
<add> equalTest(tests[i][1], 'MMMM', i);
<add> equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
<add> equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
<add> equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
<add> equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
<add> }
<add>});
<add>
<add>test('parse meridiem', function (assert) {
<add> var i,
<add> b = moment(),
<add> meridiemTests = [
<add> // h a patterns, expected hours, isValid
<add> ['10 ekuseni', 10, true],
<add> ['11 emini', 11, true],
<add> // ['12 ekuseni', 11, true],
<add> ['3 emtsambama', 15, true],
<add> ['4 emtsambama', 16, true],
<add> ['6 emtsambama', 18, true],
<add> ['7 ebusuku', 19, true],
<add> ['12 ebusuku', 0, true],
<add> ['10 am', 10, false],
<add> ['10 pm', 10, false]
<add> ],
<add> parsed;
<add>
<add> // test that a formatted moment including meridiem string can be parsed back to the same moment
<add> assert.ok(b.isSame(moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'ss', true), 'seconds'), b.format('h:mm:ss a') + ' should be equal to ' + moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'ss', true).format('h:mm:ss a'));
<add>
<add> // test that a formatted moment having a meridiem string can be parsed with strict flag
<add> assert.ok(moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'ss', true).isValid(), b.format('h:mm:ss a') + ' should be parsed as valid');
<add>
<add> for (i = 0; i < meridiemTests.length; i++) {
<add> parsed = moment(meridiemTests[i][0], 'h a', 'ss', true);
<add> assert.equal(parsed.isValid(), meridiemTests[i][2], 'validity for ' + meridiemTests[i][0]);
<add> if (parsed.isValid()) {
<add> assert.equal(parsed.hours(), meridiemTests[i][1], 'hours for ' + meridiemTests[i][0]);
<add> }
<add> }
<add>});
<add>
<add>test('format', function (assert) {
<add> var a = [
<add> ['dddd, MMMM Do YYYY, h:mm:ss a', 'Lisontfo, Indlovana 14 2010, 3:25:50 emtsambama'],
<add> ['ddd, h A', 'Lis, 3 emtsambama'],
<add> ['M Mo MM MMMM MMM', '2 2 02 Indlovana Ina'],
<add> ['YYYY YY', '2010 10'],
<add> ['D Do DD', '14 14 14'],
<add> ['d do dddd ddd dd', '0 0 Lisontfo Lis Li'],
<add> ['DDD DDDo DDDD', '45 45 045'],
<add> ['w wo ww', '6 6 06'],
<add> ['h hh', '3 03'],
<add> ['H HH', '15 15'],
<add> ['m mm', '25 25'],
<add> ['s ss', '50 50'],
<add> ['a A', 'emtsambama emtsambama'],
<add> ['[Lilanga] DDDo [lilanga lelinyaka]', 'Lilanga 45 lilanga lelinyaka'],
<add> ['LTS', '3:25:50 emtsambama'],
<add> ['L', '14/02/2010'],
<add> ['LL', '14 Indlovana 2010'],
<add> ['LLL', '14 Indlovana 2010 3:25 emtsambama'],
<add> ['LLLL', 'Lisontfo, 14 Indlovana 2010 3:25 emtsambama'],
<add> ['l', '14/2/2010'],
<add> ['ll', '14 Ina 2010'],
<add> ['lll', '14 Ina 2010 3:25 emtsambama'],
<add> ['llll', 'Lis, 14 Ina 2010 3:25 emtsambama']
<add> ],
<add> b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
<add> i;
<add> for (i = 0; i < a.length; i++) {
<add> assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
<add> }
<add>});
<add>
<add>test('format ordinal', function (assert) {
<add> assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');
<add> assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');
<add> assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');
<add> assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');
<add> assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');
<add> assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');
<add> assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');
<add> assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');
<add> assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');
<add> assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');
<add>
<add> assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');
<add> assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');
<add> assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');
<add> assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');
<add> assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');
<add> assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');
<add> assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');
<add> assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');
<add> assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');
<add> assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');
<add>
<add> assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');
<add> assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');
<add> assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');
<add> assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');
<add> assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');
<add> assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');
<add> assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');
<add> assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');
<add> assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');
<add> assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');
<add>
<add> assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');
<add>});
<add>
<add>test('format month', function (assert) {
<add> var expected = "Bhimbidvwane Bhi_Indlovana Ina_Indlov'lenkhulu Inu_Mabasa Mab_Inkhwekhweti Ink_Inhlaba Inh_Kholwane Kho_Ingci Igc_Inyoni Iny_Imphala Imp_Lweti Lwe_Ingongoni Igo".split('_'), i;
<add> for (i = 0; i < expected.length; i++) {
<add> assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
<add> }
<add>});
<add>
<add>test('format week', function (assert) {
<add> var expected = 'Lisontfo Lis Li_Umsombuluko Umb Us_Lesibili Lsb Lb_Lesitsatfu Les Lt_Lesine Lsi Ls_Lesihlanu Lsh Lh_Umgcibelo Umg Ug'.split('_'), i;
<add> for (i = 0; i < expected.length; i++) {
<add> assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);
<add> }
<add>});
<add>
<add>test('from', function (assert) {
<add> var start = moment([2007, 1, 28]);
<add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'emizuzwana lomcane', '44 seconds = a few seconds');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'umzuzu', '45 seconds = a minute');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'umzuzu', '89 seconds = a minute');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 emizuzu', '90 seconds = 2 minutes');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 emizuzu', '44 minutes = 44 minutes');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'lihora', '45 minutes = an hour');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'lihora', '89 minutes = an hour');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 emahora', '90 minutes = 2 hours');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 emahora', '5 hours = 5 hours');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 emahora', '21 hours = 21 hours');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'lilanga', '22 hours = a day');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'lilanga', '35 hours = a day');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 emalanga', '36 hours = 2 days');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'lilanga', '1 day = a day');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 emalanga', '5 days = 5 days');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 emalanga', '25 days = 25 days');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'inyanga', '26 days = a month');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'inyanga', '30 days = a month');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'inyanga', '43 days = a month');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 tinyanga', '46 days = 2 months');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 tinyanga', '75 days = 2 months');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 tinyanga', '76 days = 3 months');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'inyanga', '1 month = a month');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 tinyanga', '5 months = 5 months');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'umnyaka', '345 days = a year');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 iminyaka', '548 days = 2 years');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'umnyaka', '1 year = a year');
<add> assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 iminyaka', '5 years = 5 years');
<add>});
<add>
<add>test('suffix', function (assert) {
<add> assert.equal(moment(30000).from(0), 'nga emizuzwana lomcane', 'prefix');
<add> assert.equal(moment(0).from(30000), 'wenteka nga emizuzwana lomcane', 'suffix');
<add>});
<add>
<add>test('now from now', function (assert) {
<add> assert.equal(moment().fromNow(), 'wenteka nga emizuzwana lomcane', 'now from now should display as in the past');
<add>});
<add>
<add>test('fromNow', function (assert) {
<add> assert.equal(moment().add({s: 30}).fromNow(), 'nga emizuzwana lomcane', 'in a few seconds');
<add> assert.equal(moment().add({d: 5}).fromNow(), 'nga 5 emalanga', 'in 5 days');
<add>});
<add>
<add>test('calendar day', function (assert) {
<add> var a = moment().hours(12).minutes(0).seconds(0);
<add>
<add> assert.equal(moment(a).calendar(), 'Namuhla nga 12:00 emini', 'Today at the same time');
<add> assert.equal(moment(a).add({m: 25}).calendar(), 'Namuhla nga 12:25 emini', 'Now plus 25 min');
<add> assert.equal(moment(a).add({h: 1}).calendar(), 'Namuhla nga 1:00 emini', 'Now plus 1 hour');
<add> assert.equal(moment(a).add({d: 1}).calendar(), 'Kusasa nga 12:00 emini', 'tomorrow at the same time');
<add> assert.equal(moment(a).subtract({h: 1}).calendar(), 'Namuhla nga 11:00 emini', 'Now minus 1 hour');
<add> assert.equal(moment(a).subtract({d: 1}).calendar(), 'Itolo nga 12:00 emini', 'yesterday at the same time');
<add>});
<add>
<add>test('calendar next week', function (assert) {
<add> var i, m;
<add> for (i = 2; i < 7; i++) {
<add> m = moment().add({d: i});
<add> assert.equal(m.calendar(), m.format('dddd [nga] LT'), 'Today + ' + i + ' days current time');
<add> m.hours(0).minutes(0).seconds(0).milliseconds(0);
<add> assert.equal(m.calendar(), m.format('dddd [nga] LT'), 'Today + ' + i + ' days beginning of day');
<add> m.hours(23).minutes(59).seconds(59).milliseconds(999);
<add> assert.equal(m.calendar(), m.format('dddd [nga] LT'), 'Today + ' + i + ' days end of day');
<add> }
<add>});
<add>
<add>test('calendar last week', function (assert) {
<add> var i, m;
<add>
<add> for (i = 2; i < 7; i++) {
<add> m = moment().subtract({d: i});
<add> assert.equal(m.calendar(), m.format('dddd [leliphelile] [nga] LT'), 'Today - ' + i + ' days current time');
<add> m.hours(0).minutes(0).seconds(0).milliseconds(0);
<add> assert.equal(m.calendar(), m.format('dddd [leliphelile] [nga] LT'), 'Today - ' + i + ' days beginning of day');
<add> m.hours(23).minutes(59).seconds(59).milliseconds(999);
<add> assert.equal(m.calendar(), m.format('dddd [leliphelile] [nga] LT'), 'Today - ' + i + ' days end of day');
<add> }
<add>});
<add>
<add>test('calendar all else', function (assert) {
<add> var weeksAgo = moment().subtract({w: 1}),
<add> weeksFromNow = moment().add({w: 1});
<add>
<add> assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago');
<add> assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week');
<add>
<add> weeksAgo = moment().subtract({w: 2});
<add> weeksFromNow = moment().add({w: 2});
<add>
<add> assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago');
<add> assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks');
<add>});
<add>
<add>test('weeks year starting sunday formatted', function (assert) {
<add> assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52');
<add> assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 4 2012 should be week 1');
<add> assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan 8 2012 should be week 1');
<add> assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2');
<add> assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2');
<add>});
<add> | 2 |
Text | Text | remove python 3.6 from `main` in readme.md | cfb2d084315cc6177267946df08c4cf5e0608542 | <ide><path>README.md
<ide> Airflow is not a streaming solution, but it is often used to process real-time d
<ide>
<ide> Apache Airflow is tested with:
<ide>
<del>| | Main version (dev) | Stable version (2.2.3) |
<del>| -------------------- | -------------------- | ------------------------ |
<del>| Python | 3.6, 3.7, 3.8, 3.9 | 3.6, 3.7, 3.8, 3.9 |
<del>| Kubernetes | 1.20, 1.21 | 1.18, 1.19, 1.20 |
<del>| PostgreSQL | 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 |
<del>| MySQL | 5.7, 8 | 5.7, 8 |
<del>| SQLite | 3.15.0+ | 3.15.0+ |
<del>| MSSQL(Experimental) | 2017, 2019 | |
<add>| | Main version (dev) | Stable version (2.2.3) |
<add>|---------------------|---------------------|--------------------------|
<add>| Python | 3.7, 3.8, 3.9 | 3.6, 3.7, 3.8, 3.9 |
<add>| Kubernetes | 1.20, 1.21 | 1.18, 1.19, 1.20 |
<add>| PostgreSQL | 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 |
<add>| MySQL | 5.7, 8 | 5.7, 8 |
<add>| SQLite | 3.15.0+ | 3.15.0+ |
<add>| MSSQL(Experimental) | 2017, 2019 | |
<ide>
<ide> **Note**: MySQL 5.x versions are unable to or have limitations with
<ide> running multiple schedulers -- please see the [Scheduler docs](https://airflow.apache.org/docs/apache-airflow/stable/scheduler.html). | 1 |
PHP | PHP | remove collate nocase on sqlite orders | a8af94c567113976c24d7361443d1b0d81f55ec3 | <ide><path>src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php
<ide> protected function compileOrders(Builder $query, $orders)
<ide>
<ide> return 'order by '.implode(', ', array_map(function($order) use ($me)
<ide> {
<del> return $me->wrap($order['column']).' collate nocase '.$order['direction'];
<add> return $me->wrap($order['column']).' '.$order['direction'];
<ide> }
<ide> , $orders));
<ide> }
<ide><path>tests/Database/DatabaseQueryBuilderTest.php
<ide> public function testSQLiteOrderBy()
<ide> {
<ide> $builder = $this->getSQLiteBuilder();
<ide> $builder->select('*')->from('users')->orderBy('email', 'desc');
<del> $this->assertEquals('select * from "users" order by "email" collate nocase desc', $builder->toSql());
<add> $this->assertEquals('select * from "users" order by "email" desc', $builder->toSql());
<ide> }
<ide>
<ide> | 2 |
Text | Text | add documentation links to readme | f9ddf897bee41783f715daa9c4fdda65871c883d | <ide><path>README.md
<ide> workflows.
<ide> When workflows are defined as code, they become more maintainable,
<ide> versionable, testable, and collaborative.
<ide>
<del>Use airflow to author workflows as directed acyclic graphs (DAGs) of tasks.
<del>The airflow scheduler executes your tasks on an array of workers while
<add>Use Airflow to author workflows as directed acyclic graphs (DAGs) of tasks.
<add>The Airflow scheduler executes your tasks on an array of workers while
<ide> following the specified dependencies. Rich command line utilities make
<ide> performing complex surgeries on DAGs a snap. The rich user interface
<ide> makes it easy to visualize pipelines running in production,
<ide> monitor progress, and troubleshoot issues when needed.
<ide>
<del>For more information and documentation, please visit the [Airflow Wiki](https://github.com/airbnb/airflow/wiki).
<add>## Getting started
<add>Please visit the Airflow Platform documentation for help with [installing Airflow](http://pythonhosted.org/airflow/installation.html), getting a [quick start](http://pythonhosted.org/airflow/start.html), or a more complete [tutorial](http://pythonhosted.org/airflow/tutorial.html).
<add>
<add>For further information, please visit the [Airflow Wiki](https://github.com/airbnb/airflow/wiki).
<ide>
<ide> ## Beyond the Horizon
<ide> | 1 |
Ruby | Ruby | remove duplicated entires | d6a50f1e7617b40be12b7878bbcbade634c8ef86 | <ide><path>Library/Homebrew/cmd/deps.rb
<ide> def deps
<ide> else
<ide> all_deps = deps_for_formulae(ARGV.formulae, !ARGV.one?, &(mode.union? ? :| : :&))
<ide> all_deps = all_deps.select(&:installed?) if mode.installed?
<del> all_deps = all_deps.sort_by(&:name) unless mode.topo_order?
<add> all_deps = all_deps.map(&:name).uniq
<add> all_deps.sort! unless mode.topo_order?
<ide> puts all_deps
<ide> end
<ide> end | 1 |
Python | Python | avoid broad exceptions when json.loads is used | 65d3901d771ee21207a64023ebf59072dabcef49 | <ide><path>airflow/cli/commands/pool_command.py
<ide> """
<ide> import json
<ide> import os
<add>from json import JSONDecodeError
<ide>
<ide> from tabulate import tabulate
<ide>
<ide> def pool_import_helper(filepath):
<ide> data = poolfile.read()
<ide> try: # pylint: disable=too-many-nested-blocks
<ide> pools_json = json.loads(data)
<del> except Exception as e: # pylint: disable=broad-except
<add> except JSONDecodeError as e:
<ide> print("Please check the validity of the json file: " + str(e))
<ide> else:
<ide> try:
<ide><path>airflow/cli/commands/variable_command.py
<ide> import json
<ide> import os
<ide> import sys
<add>from json import JSONDecodeError
<ide>
<ide> from airflow.models import Variable
<ide> from airflow.utils import cli as cli_utils
<ide> def _import_helper(filepath):
<ide>
<ide> try:
<ide> var_json = json.loads(data)
<del> except Exception: # pylint: disable=broad-except
<add> except JSONDecodeError:
<ide> print("Invalid variables file.")
<ide> else:
<ide> suc_count = fail_count = 0
<ide><path>airflow/models/connection.py
<ide> # under the License.
<ide>
<ide> import json
<add>from json import JSONDecodeError
<ide> from urllib.parse import parse_qsl, quote, unquote, urlencode, urlparse
<ide>
<ide> from sqlalchemy import Boolean, Column, Integer, String
<ide> def extra_dejson(self):
<ide> if self.extra:
<ide> try:
<ide> obj = json.loads(self.extra)
<del> except Exception as e:
<add> except JSONDecodeError as e:
<ide> self.log.exception(e)
<ide> self.log.error("Failed parsing the json for conn_id %s", self.conn_id)
<ide>
<ide><path>airflow/models/xcom.py
<ide> import json
<ide> import logging
<ide> import pickle
<add>from json import JSONDecodeError
<ide> from typing import Any, Iterable, Optional, Union
<ide>
<ide> import pendulum
<ide> def deserialize_value(result) -> Any:
<ide>
<ide> try:
<ide> return json.loads(result.value.decode('UTF-8'))
<del> except ValueError:
<add> except JSONDecodeError:
<ide> log.error("Could not deserialize the XCOM value from JSON. "
<ide> "If you are using pickles instead of JSON "
<ide> "for XCOM, then you need to enable pickle "
<ide><path>airflow/www/validators.py
<ide> # under the License.
<ide>
<ide> import json
<add>from json import JSONDecodeError
<ide>
<ide> from wtforms.validators import EqualTo, ValidationError
<ide>
<ide> def __call__(self, form, field):
<ide> if field.data:
<ide> try:
<ide> json.loads(field.data)
<del> except Exception as ex:
<add> except JSONDecodeError as ex:
<ide> message = self.message or 'JSON Validation Error: {}'.format(ex)
<ide> raise ValidationError(
<ide> message=field.gettext(message.format(field.data))
<ide><path>airflow/www/views.py
<ide> import traceback
<ide> from collections import defaultdict
<ide> from datetime import datetime, timedelta
<add>from json import JSONDecodeError
<ide> from typing import Dict, List, Optional, Tuple
<ide> from urllib.parse import quote, unquote
<ide>
<ide> def process_form(self, form, is_created):
<ide> def prefill_form(self, form, pk):
<ide> try:
<ide> d = json.loads(form.data.get('extra', '{}'))
<del> except Exception:
<add> except JSONDecodeError:
<ide> d = {}
<ide>
<ide> if not hasattr(d, 'get'): | 6 |
Ruby | Ruby | run tests with `homebrew_developer` unset | 7a991985a47cf523e95fce32a49e195b964841a8 | <ide><path>Library/Homebrew/brew.rb
<ide> internal_dev_cmd = require? HOMEBREW_LIBRARY_PATH/"dev-cmd"/cmd
<ide> internal_cmd = internal_dev_cmd
<ide> if internal_dev_cmd && !ARGV.homebrew_developer?
<del> system "git", "config", "--file=#{HOMEBREW_REPOSITORY}/.git/config",
<del> "--replace-all", "homebrew.devcmdrun", "true"
<add> if (HOMEBREW_REPOSITORY/".git/config").exist?
<add> system "git", "config", "--file=#{HOMEBREW_REPOSITORY}/.git/config",
<add> "--replace-all", "homebrew.devcmdrun", "true"
<add> end
<ide> ENV["HOMEBREW_DEV_CMD_RUN"] = "1"
<ide> end
<ide> end
<ide><path>Library/Homebrew/dev-cmd/tests.rb
<ide> def tests
<ide> ENV.delete("HOMEBREW_TEMP")
<ide> ENV.delete("HOMEBREW_NO_GITHUB_API")
<ide> ENV.delete("HOMEBREW_NO_EMOJI")
<add> ENV.delete("HOMEBREW_DEVELOPER")
<ide> ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
<del> ENV["HOMEBREW_DEVELOPER"] = "1"
<ide> ENV["HOMEBREW_NO_COMPAT"] = "1" if args.no_compat?
<ide> ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic?
<ide> ENV["HOMEBREW_TEST_ONLINE"] = "1" if args.online?
<ide><path>Library/Homebrew/test/cmd/uninstall_spec.rb
<ide>
<ide> describe "::handle_unsatisfied_dependents" do
<ide> specify "when developer" do
<add> ENV["HOMEBREW_DEVELOPER"] = "1"
<add>
<ide> expect {
<ide> described_class.handle_unsatisfied_dependents(opts)
<ide> }.to output(/Warning/).to_stderr
<ide> end
<ide>
<ide> specify "when not developer" do
<del> run_as_not_developer do
<del> expect {
<del> described_class.handle_unsatisfied_dependents(opts)
<del> }.to output(/Error/).to_stderr
<add> expect {
<add> described_class.handle_unsatisfied_dependents(opts)
<add> }.to output(/Error/).to_stderr
<ide>
<del> expect(described_class).to have_failed
<del> end
<add> expect(described_class).to have_failed
<ide> end
<ide>
<ide> specify "when not developer and --ignore-dependencies is specified" do
<ide> ARGV << "--ignore-dependencies"
<ide>
<del> run_as_not_developer do
<del> expect {
<del> described_class.handle_unsatisfied_dependents(opts)
<del> }.not_to output.to_stderr
<add> expect {
<add> described_class.handle_unsatisfied_dependents(opts)
<add> }.not_to output.to_stderr
<ide>
<del> expect(described_class).not_to have_failed
<del> end
<add> expect(described_class).not_to have_failed
<ide> end
<ide> end
<ide> end
<ide><path>Library/Homebrew/test/utils_spec.rb
<ide> def esc(code)
<ide> end
<ide> end
<ide>
<del> describe "#run_as_not_developer" do
<del> it "temporarily unsets HOMEBREW_DEVELOPER" do
<del> ENV["HOMEBREW_DEVELOPER"] = "foo"
<del>
<del> run_as_not_developer do
<del> expect(ENV["HOMEBREW_DEVELOPER"]).to be nil
<del> end
<del>
<del> expect(ENV["HOMEBREW_DEVELOPER"]).to eq("foo")
<del> end
<del> end
<del>
<ide> describe "#which" do
<ide> let(:cmd) { dir/"foo" }
<ide>
<ide><path>Library/Homebrew/utils.rb
<ide> def with_custom_locale(locale)
<ide> end
<ide> end
<ide>
<del>def run_as_not_developer
<del> with_env(HOMEBREW_DEVELOPER: nil) do
<del> yield
<del> end
<del>end
<del>
<ide> # Kernel.system but with exceptions
<ide> def safe_system(cmd, *args, **options)
<ide> return if Homebrew.system(cmd, *args, **options) | 5 |
Javascript | Javascript | improve assertion in test-inspector.js | bb898ca39de0c4f1c2ff62ce59c5315078c0856a | <ide><path>test/sequential/test-inspector.js
<ide> function checkBadPath(err) {
<ide> }
<ide>
<ide> function checkException(message) {
<del> assert.strictEqual(message.exceptionDetails, undefined,
<del> 'An exception occurred during execution');
<add> assert.strictEqual(message.exceptionDetails, undefined);
<ide> }
<ide>
<ide> function assertScopeValues({ result }, expected) { | 1 |
Python | Python | pass table_id as str type | fe13eae3bf0542025e622e51a487f8d6a8b6d2c5 | <ide><path>airflow/providers/google/cloud/hooks/bigquery.py
<ide> def delete_table(
<ide> :param project_id: the project used to perform the request
<ide> """
<ide> self.get_client(project_id=project_id).delete_table(
<del> table=Table.from_string(table_id),
<add> table=table_id,
<ide> not_found_ok=not_found_ok,
<ide> )
<ide> self.log.info('Deleted table %s', table_id)
<ide><path>tests/providers/google/cloud/hooks/test_bigquery.py
<ide> def test_list_rows_with_empty_selected_fields(self, mock_client, mock_table):
<ide> start_index=5,
<ide> )
<ide>
<del> @mock.patch("airflow.providers.google.cloud.hooks.bigquery.Table")
<ide> @mock.patch("airflow.providers.google.cloud.hooks.bigquery.Client")
<del> def test_run_table_delete(self, mock_client, mock_table):
<del> source_project_dataset_table = f"{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}"
<del> self.hook.run_table_delete(source_project_dataset_table, ignore_if_missing=False)
<del> mock_table.from_string.assert_called_once_with(source_project_dataset_table)
<add> def test_run_table_delete(self, mock_client):
<add> source_dataset_table = f"{DATASET_ID}.{TABLE_ID}"
<add> self.hook.run_table_delete(source_dataset_table, ignore_if_missing=False)
<ide> mock_client.return_value.delete_table.assert_called_once_with(
<del> table=mock_table.from_string.return_value, not_found_ok=False
<add> table=source_dataset_table, not_found_ok=False
<ide> )
<ide>
<ide> @mock.patch("airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.create_empty_table") | 2 |
PHP | PHP | add support for ignoring deprecations by path | ab26a0393798662acc50ad9ed72751aa279c68a0 | <ide><path>src/Core/functions.php
<ide> function deprecationWarning(string $message, int $stackFrame = 1): void
<ide> $frame = $trace[$stackFrame];
<ide> $frame += ['file' => '[internal]', 'line' => '??'];
<ide>
<add> $patterns = (array)Configure::read('Error.disableDeprecations');
<add> $relative = substr($frame['file'], strlen(ROOT) + 1);
<add> debug($relative);
<add> foreach ($patterns as $pattern) {
<add> $pattern = str_replace('/', DIRECTORY_SEPARATOR, $pattern);
<add> if (fnmatch($pattern, $relative)) {
<add> return;
<add> }
<add> }
<add>
<ide> $message = sprintf(
<ide> '%s - %s, line: %s' . "\n" .
<ide> ' You can disable deprecation warnings by setting `Error.errorLevel` to' .
<ide><path>tests/TestCase/Core/FunctionsTest.php
<ide> */
<ide> namespace Cake\Test\TestCase\Core;
<ide>
<add>use Cake\Core\Configure;
<ide> use Cake\Http\Response;
<ide> use Cake\TestSuite\TestCase;
<ide>
<ide> public function testDeprecationWarningEnabledDefaultFrame()
<ide> });
<ide> }
<ide>
<add> /**
<add> * Test no error when deprecation matches ignore paths.
<add> *
<add> * @return void
<add> */
<add> public function testDeprecationWarningPathDisabled()
<add> {
<add> $this->expectNotToPerformAssertions();
<add>
<add> Configure::write('Error.disableDeprecations', ['src/TestSuite/*']);
<add> $this->withErrorReporting(E_ALL, function () {
<add> deprecationWarning('This is going away');
<add> });
<add> }
<add>
<ide> /**
<ide> * Test no error when deprecated level is off.
<ide> * | 2 |
Python | Python | fix existing tests | 3aee5697859b7ff47c5bbb5609842efdf43cd80b | <ide><path>official/transformer/v2/transformer_main.py
<ide> def predict(self):
<ide>
<ide> with tf.name_scope("model"):
<ide> model = transformer.create_model(params, is_train)
<del> self._load_weights_if_possible(model, flags_obj.init_weight_path)
<add> self._load_weights_if_possible(
<add> model, tf.train.latest_checkpoint(self.flags_obj.model_dir))
<ide> model.summary()
<ide> subtokenizer = tokenizer.Subtokenizer(flags_obj.vocab_file)
<ide>
<ide><path>official/transformer/v2/transformer_main_test.py
<ide> class TransformerTaskTest(tf.test.TestCase):
<ide>
<ide> def setUp(self):
<ide> temp_dir = self.get_temp_dir()
<del> FLAGS.model_dir = temp_dir
<del> FLAGS.init_logdir_timestamp = FIXED_TIMESTAMP
<add> FLAGS.model_dir = os.path.join(temp_dir, FIXED_TIMESTAMP)
<ide> FLAGS.param_set = param_set = "tiny"
<ide> FLAGS.use_synthetic_data = True
<del> FLAGS.steps_per_epoch = 1
<add> FLAGS.steps_between_evals = 1
<add> FLAGS.train_steps = 2
<ide> FLAGS.validation_steps = 1
<del> FLAGS.train_epochs = 1
<ide> FLAGS.batch_size = 8
<del> FLAGS.init_weight_path = None
<del> self.cur_log_dir = os.path.join(temp_dir, FIXED_TIMESTAMP)
<del> self.vocab_file = os.path.join(self.cur_log_dir, "vocab")
<add> self.model_dir = FLAGS.model_dir
<add> self.temp_dir = temp_dir
<add> self.vocab_file = os.path.join(temp_dir, "vocab")
<ide> self.vocab_size = misc.get_model_params(param_set, 0)["vocab_size"]
<del> self.bleu_source = os.path.join(self.cur_log_dir, "bleu_source")
<del> self.bleu_ref = os.path.join(self.cur_log_dir, "bleu_ref")
<del> self.flags_file = os.path.join(self.cur_log_dir, "flags")
<add> self.bleu_source = os.path.join(temp_dir, "bleu_source")
<add> self.bleu_ref = os.path.join(temp_dir, "bleu_ref")
<ide>
<ide> def _assert_exists(self, filepath):
<ide> self.assertTrue(os.path.exists(filepath))
<ide>
<ide> def test_train(self):
<ide> t = tm.TransformerTask(FLAGS)
<ide> t.train()
<del> # Test model dir.
<del> self._assert_exists(self.cur_log_dir)
<del> # Test saving models.
<del> self._assert_exists(
<del> os.path.join(self.cur_log_dir, "saves-model-weights.hdf5"))
<del> self._assert_exists(os.path.join(self.cur_log_dir, "saves-model.hdf5"))
<del>
<del> # Test callbacks:
<del> # TensorBoard file.
<del> self._assert_exists(os.path.join(self.cur_log_dir, "logs"))
<del> # CSVLogger file.
<del> self._assert_exists(os.path.join(self.cur_log_dir, "result.csv"))
<del> # Checkpoint file.
<del> filenames = os.listdir(self.cur_log_dir)
<del> matched_weight_file = any([WEIGHT_PATTERN.match(f) for f in filenames])
<del> self.assertTrue(matched_weight_file)
<del>
<add>
<ide> def _prepare_files_and_flags(self, *extra_flags):
<ide> # Make log dir.
<del> if not os.path.exists(self.cur_log_dir):
<del> os.makedirs(self.cur_log_dir)
<add> if not os.path.exists(self.temp_dir):
<add> os.makedirs(self.temp_dir)
<ide>
<ide> # Fake vocab, bleu_source and bleu_ref.
<ide> tokens = [ | 2 |
Ruby | Ruby | define homebrew_library for tests | 09b77a7785708ad7c1d72ea4b5169118aaa79268 | <ide><path>Library/Homebrew/test/testing_env.rb
<ide> # homebrew tree, and we do want to test everything :)
<ide> HOMEBREW_PREFIX=Pathname.new '/private/tmp/testbrew/prefix'
<ide> HOMEBREW_REPOSITORY=HOMEBREW_PREFIX
<add>HOMEBREW_LIBRARY=HOMEBREW_REPOSITORY+"Library"
<ide> HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache"
<ide> HOMEBREW_CACHE_FORMULA=HOMEBREW_PREFIX.parent+"formula_cache"
<ide> HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar" | 1 |
Text | Text | fix translation errors | 98858c19b5a3e73c551886d3fe4476b4a1e664d8 | <ide><path>curriculum/challenges/russian/01-responsive-web-design/applied-visual-design/adjust-the-background-color-property-of-text.russian.md
<ide> localeTitle: Отрегулируйте фоновый цвет Свойство
<ide> ---
<ide>
<ide> ## Description
<del><section id="description"> Вместо того, чтобы корректировать общий фон или цвет текста, чтобы сделать передний план легко читаемым, вы можете добавить <code>background-color</code> к элементу, содержащему текст, который вы хотите подчеркнуть. Эта проблема использует <code>rgba()</code> вместо <code>hex</code> кодов или нормальный <code>rgb()</code> . <blockquote> rgba акроним расшифровывается как: <br> r = красный <br> g = зеленый <br> b = синий <br> a = альфа / уровень непрозрачности </blockquote> Значения RGB могут находиться в диапазоне от 0 до 255. Значение альфа может варьироваться от 1, полностью непрозрачного или сплошного цвета, до 0, что является полностью прозрачным или прозрачным. <code>rgba()</code> отлично подходит для использования в этом случае, так как он позволяет вам регулировать непрозрачность. Это означает, что вам не нужно полностью блокировать фон. Для этой задачи вы будете использовать <code>background-color: rgba(45, 45, 45, 0.1)</code> . Он производит темно-серый цвет, который почти прозрачен, учитывая низкое значение непрозрачности 0,1. </section>
<add><section id="description"> Вместо исправления общего фона или цвета текста, для читаемости переднего плана вы можете добавить <code>background-color</code> к элементу, содержащему текст, который вы хотите подчеркнуть. Эта проблема использует <code>rgba()</code> вместо <code>hex</code> кодов или нормальный <code>rgb()</code> . <blockquote> rgba акроним расшифровывается как: <br> r = красный <br> g = зеленый <br> b = синий <br> a = альфа / уровень непрозрачности </blockquote> Значения RGB могут находиться в диапазоне от 0 до 255. Значение альфа может варьироваться от 1, полностью непрозрачного или сплошного цвета, до 0, что является полностью прозрачным или невидимым. <code>rgba()</code> отлично подходит для использования в этом случае, так как он позволяет вам регулировать непрозрачность. Это означает, что вам не нужно полностью блокировать фон. Для этой задачи вы будете использовать <code>background-color: rgba(45, 45, 45, 0.1)</code> . Он производит темно-серый цвет, который почти прозрачен, учитывая низкое значение непрозрачности 0,1. </section>
<ide>
<ide> ## Instructions
<del><section id="instructions"> Чтобы текст выделялся больше, отрегулируйте <code>background-color</code> элемента <code>h4</code> на заданное значение <code>rgba()</code> . Также для <code>h4</code> удалите свойство <code>height</code> и добавьте <code>padding</code> 10px. </section>
<add><section id="instructions"> Чтобы текст сильнее выделялся, отрегулируйте <code>background-color</code> элемента <code>h4</code> на заданное значение <code>rgba()</code> . Также для <code>h4</code> удалите свойство <code>height</code> и добавьте <code>padding</code> 10px. </section>
<ide>
<ide> ## Tests
<ide> <section id='tests'>
<ide> tests:
<ide> testString: 'assert(code.match(/background-color:\s*?rgba\(\s*?45\s*?,\s*?45\s*?,\s*?45\s*?,\s*?0?\.1\s*?\)/gi), "Your code should add a <code>background-color</code> property to the <code>h4</code> element set to <code>rgba(45, 45, 45, 0.1)</code>.");'
<ide> - text: Ваш код должен добавить свойство <code>padding</code> к элементу <code>h4</code> и установить его на 10 пикселей.
<ide> testString: 'assert($("h4").css("padding-top") == "10px" && $("h4").css("padding-right") == "10px" && $("h4").css("padding-bottom") == "10px" && $("h4").css("padding-left") == "10px", "Your code should add a <code>padding</code> property to the <code>h4</code> element and set it to 10 pixels.");'
<del> - text: Свойство <code>height</code> на элементе <code>h4</code> должно быть удалено.
<add> - text: Свойство <code>height</code> в элементе <code>h4</code> должно быть удалено.
<ide> testString: 'assert(!($("h4").css("height") == "25px"), "The <code>height</code> property on the <code>h4</code> element should be removed.");'
<ide>
<ide> ``` | 1 |
Python | Python | add assert_array_equal test for big integer arrays | a1bfe6e3c9cfd81a0ca235cd806ab7098dd93a5c | <ide><path>numpy/testing/tests/test_utils.py
<ide> def foo(t):
<ide> for t in ['S1', 'U1']:
<ide> foo(t)
<ide>
<add> def test_0_ndim_array(self):
<add> x = np.array(473963742225900817127911193656584771)
<add> y = np.array(18535119325151578301457182298393896)
<add> assert_raises(AssertionError, self._assert_func, x, y)
<add>
<add> y = x
<add> self._assert_func(x, y)
<add>
<add> x = np.array(43)
<add> y = np.array(10)
<add> assert_raises(AssertionError, self._assert_func, x, y)
<add>
<add> y = x
<add> self._assert_func(x, y)
<add>
<ide> def test_generic_rank3(self):
<ide> """Test rank 3 array for all dtypes."""
<ide> def foo(t): | 1 |
Javascript | Javascript | add a simple test for ray-segment intersection | e9a07c9e38a998b0061cff53371b125bb0135e14 | <ide><path>test/unit/math/Ray.js
<ide> test( "applyMatrix4", function() {
<ide> });
<ide>
<ide>
<add>test( "distanceSqAndPointToSegment4", function() {
<add> var a = new THREE.Ray( one3.clone(), new THREE.Vector3( 0, 0, 1 ) );
<add> var v0 = new THREE.Vector3( 3, 5, 50 );
<add> var v1 = new THREE.Vector3( 50, 50, 50 ); // just a far away point
<add> var ptOnLine = new THREE.Vector3();
<add> var ptOnSegment = new THREE.Vector3();
<add> var distSqr = a.distanceSqAndPointToSegment( v0, v1, ptOnLine, ptOnSegment );
<add> var m = new THREE.Matrix4();
<add>
<add> ok( ptOnSegment.distanceTo( v0 ) < 0.0001, "Passed!" );
<add> ok( ptOnLine.distanceTo( new THREE.Vector3(1, 1, 50) ) < 0.0001, "Passed!" );
<add> // ((3-1) * (3-1) + (5-1) * (5-1) = 4 + 16 = 20
<add> ok( distSqr === 20, "Passed!" );
<add>});
<add>
<ide> | 1 |
Java | Java | remove compiler warning | 1aad4da6b64e26557d98b8ddde58037a2db32303 | <ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java
<ide> public void handle() {
<ide>
<ide>
<ide> @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "exception.user.exists")
<add> @SuppressWarnings("serial")
<ide> public static class UserAlreadyExistsException extends RuntimeException {
<ide> }
<ide> | 1 |
Ruby | Ruby | save a subshell here | c75a7decb7a3a89a28c12c3f2277e1496d3c6775 | <ide><path>Library/Homebrew/build.rb
<ide> def main
<ide> # Force any future invocations of sudo to require the user's password to be
<ide> # re-entered. This is in-case any build script call sudo. Certainly this is
<ide> # can be inconvenient for the user. But we need to be safe.
<del> system "/usr/bin/sudo -k"
<add> system "/usr/bin/sudo", "-k"
<ide>
<ide> install(Formula.factory($0))
<ide> rescue Exception => e | 1 |
Go | Go | add ability to exclude files from tar | 2c7f50a77dc281289387008b4a08656e7e5328be | <ide><path>archive/archive.go
<ide> import (
<ide>
<ide> type Archive io.Reader
<ide>
<del>type Compression uint32
<add>type Compression int
<add>
<add>type TarOptions struct {
<add> Includes []string
<add> Excludes []string
<add> Recursive bool
<add> Compression Compression
<add> CreateFiles []string
<add>}
<ide>
<ide> const (
<ide> Uncompressed Compression = iota
<ide> func (compression *Compression) Extension() string {
<ide> // Tar creates an archive from the directory at `path`, and returns it as a
<ide> // stream of bytes.
<ide> func Tar(path string, compression Compression) (io.Reader, error) {
<del> return TarFilter(path, compression, nil, true, nil)
<add> return TarFilter(path, &TarOptions{Recursive: true, Compression: compression})
<ide> }
<ide>
<ide> func escapeName(name string) string {
<ide> func escapeName(name string) string {
<ide>
<ide> // Tar creates an archive from the directory at `path`, only including files whose relative
<ide> // paths are included in `filter`. If `filter` is nil, then all files are included.
<del>func TarFilter(path string, compression Compression, filter []string, recursive bool, createFiles []string) (io.Reader, error) {
<add>func TarFilter(path string, options *TarOptions) (io.Reader, error) {
<ide> args := []string{"tar", "--numeric-owner", "-f", "-", "-C", path, "-T", "-"}
<del> if filter == nil {
<del> filter = []string{"."}
<add> if options.Includes == nil {
<add> options.Includes = []string{"."}
<add> }
<add> args = append(args, "-c"+options.Compression.Flag())
<add>
<add> for _, exclude := range options.Excludes {
<add> args = append(args, fmt.Sprintf("--exclude=%s", exclude))
<ide> }
<del> args = append(args, "-c"+compression.Flag())
<ide>
<del> if !recursive {
<add> if !options.Recursive {
<ide> args = append(args, "--no-recursion")
<ide> }
<ide>
<ide> files := ""
<del> for _, f := range filter {
<add> for _, f := range options.Includes {
<ide> files = files + escapeName(f) + "\n"
<ide> }
<ide>
<ide> tmpDir := ""
<ide>
<del> if createFiles != nil {
<add> if options.CreateFiles != nil {
<ide> var err error // Can't use := here or we override the outer tmpDir
<ide> tmpDir, err = ioutil.TempDir("", "docker-tar")
<ide> if err != nil {
<ide> return nil, err
<ide> }
<ide>
<ide> files = files + "-C" + tmpDir + "\n"
<del> for _, f := range createFiles {
<add> for _, f := range options.CreateFiles {
<ide> path := filepath.Join(tmpDir, f)
<ide> err := os.MkdirAll(filepath.Dir(path), 0600)
<ide> if err != nil {
<ide> func Untar(archive io.Reader, path string) error {
<ide> // TarUntar aborts and returns the error.
<ide> func TarUntar(src string, filter []string, dst string) error {
<ide> utils.Debugf("TarUntar(%s %s %s)", src, filter, dst)
<del> archive, err := TarFilter(src, Uncompressed, filter, true, nil)
<add> archive, err := TarFilter(src, &TarOptions{Compression: Uncompressed, Includes: filter, Recursive: true})
<ide> if err != nil {
<ide> return err
<ide> }
<ide><path>archive/changes.go
<ide> func ChangesDirs(newDir, oldDir string) ([]Change, error) {
<ide> return changes, nil
<ide> }
<ide>
<del>
<ide> func ExportChanges(root, rw string) (Archive, error) {
<del> changes, err := ChangesDirs(root, rw)
<del> if err != nil {
<del> return nil, err
<del> }
<del> files := make([]string, 0)
<del> deletions := make([]string, 0)
<del> for _, change := range changes {
<del> if change.Kind == ChangeModify || change.Kind == ChangeAdd {
<del> files = append(files, change.Path)
<del> }
<del> if change.Kind == ChangeDelete {
<del> base := filepath.Base(change.Path)
<del> dir := filepath.Dir(change.Path)
<del> deletions = append(deletions, filepath.Join(dir, ".wh."+base))
<del> }
<del> }
<del> return TarFilter(root, Uncompressed, files, false, deletions)
<add> changes, err := ChangesDirs(root, rw)
<add> if err != nil {
<add> return nil, err
<add> }
<add> files := make([]string, 0)
<add> deletions := make([]string, 0)
<add> for _, change := range changes {
<add> if change.Kind == ChangeModify || change.Kind == ChangeAdd {
<add> files = append(files, change.Path)
<add> }
<add> if change.Kind == ChangeDelete {
<add> base := filepath.Base(change.Path)
<add> dir := filepath.Dir(change.Path)
<add> deletions = append(deletions, filepath.Join(dir, ".wh."+base))
<add> }
<add> }
<add> return TarFilter(root, &TarOptions{Compression: Uncompressed, Recursive: false, Includes: files, CreateFiles: deletions})
<ide> }
<del>
<ide><path>aufs/aufs.go
<ide> func (a *AufsDriver) createDirsFor(id string) error {
<ide> }
<ide>
<ide> for _, p := range paths {
<del> dir := path.Join(a.rootPath(), p, id)
<del> if err := os.MkdirAll(dir, 0755); err != nil {
<add> if err := os.MkdirAll(path.Join(a.rootPath(), p, id), 0755); err != nil {
<ide> return err
<ide> }
<ide> }
<ide> func (a *AufsDriver) Get(id string) (string, error) {
<ide>
<ide> // Returns an archive of the contents for the id
<ide> func (a *AufsDriver) Diff(id string) (archive.Archive, error) {
<del> p, err := a.Get(id)
<del> if err != nil {
<del> return nil, err
<del> }
<del> return archive.Tar(p, archive.Uncompressed)
<add> // Exclude top level aufs metadata from the diff
<add> return archive.TarFilter(
<add> path.Join(a.rootPath(), "diff", id),
<add> &archive.TarOptions{
<add> Excludes: []string{".wh*"},
<add> Recursive: true,
<add> Compression: archive.Uncompressed,
<add> })
<ide> }
<ide>
<ide> // Returns the size of the contents for the id
<ide><path>container.go
<ide> func (container *Container) Copy(resource string) (archive.Archive, error) {
<ide> filter = []string{path.Base(basePath)}
<ide> basePath = path.Dir(basePath)
<ide> }
<del> return archive.TarFilter(basePath, archive.Uncompressed, filter, true, nil)
<add> return archive.TarFilter(basePath, &archive.TarOptions{
<add> Compression: archive.Uncompressed,
<add> Includes: filter,
<add> Recursive: true,
<add> })
<ide> }
<ide>
<ide> // Returns true if the container exposes a certain port | 4 |
Javascript | Javascript | improve trim performance | c2e45c769ef7a45f2bd14870236fd8e8bed38246 | <ide><path>src/Angular.js
<ide> var trim = (function() {
<ide> // TODO: we should move this into IE/ES5 polyfill
<ide> if (!String.prototype.trim) {
<ide> return function(value) {
<del> return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
<add> return isString(value) ? value.replace(/^\s\s*/, '').replace(/\s\s*$/, '') : value;
<ide> };
<ide> }
<ide> return function(value) { | 1 |
Mixed | Javascript | add delay props to press module | 81a61b1d1ac4c3fa974a822382b2343a96f7cc31 | <ide><path>packages/react-events/README.md
<ide> *This package is experimental. It is intended for use with the experimental React
<ide> events API that is not available in open source builds.*
<ide>
<add>Event components do not render a host node. They listen to native browser events
<add>dispatched on the host node of their child and transform those events into
<add>high-level events for applications.
<add>
<ide>
<ide> ## Focus
<ide>
<ide> The `Focus` module responds to focus and blur events on the element it wraps.
<ide> Focus events are dispatched for `mouse`, `pen`, `touch`, and `keyboard`
<ide> pointer types.
<ide>
<add>```js
<add>// Example
<add>const TextField = (props) => (
<add> <Focus
<add> onBlur={props.onBlur}
<add> onFocus={props.onFocus}
<add> >
<add> <textarea></textarea>
<add> </Focus>
<add>);
<ide> ```
<add>
<add>```js
<add>// Types
<ide> type FocusEvent = {}
<ide> ```
<ide>
<ide> The `Hover` module responds to hover events on the element it wraps. Hover
<ide> events are only dispatched for `mouse` pointer types. Hover begins when the
<ide> pointer enters the element's bounds and ends when the pointer leaves.
<ide>
<add>```js
<add>// Example
<add>const Link = (props) => (
<add> const [ hovered, setHovered ] = useState(false);
<add> return (
<add> <Hover onHoverChange={setHovered}>
<add> <a
<add> {...props}
<add> href={props.href}
<add> style={{
<add> ...props.style,
<add> textDecoration: hovered ? 'underline': 'none'
<add> }}
<add> />
<add> </Hover>
<add> );
<add>);
<ide> ```
<add>
<add>```js
<add>// Types
<ide> type HoverEvent = {}
<ide> ```
<ide>
<del>### disabled: boolean
<add>### delayHoverEnd: number
<ide>
<del>Disables all `Hover` events.
<add>The duration of the delay between when hover ends and when `onHoverEnd` is
<add>called.
<ide>
<del>### onHoverStart: (e: HoverEvent) => void
<add>### delayHoverStart: number
<ide>
<del>Called once the element is hovered. It will not be called if the pointer leaves
<del>the element before the `delayHoverStart` threshold is exceeded. And it will not
<del>be called more than once before `onHoverEnd` is called.
<add>The duration of the delay between when hover starts and when `onHoverStart` is
<add>called.
<ide>
<del>### onHoverEnd: (e: HoverEvent) => void
<add>### disabled: boolean
<ide>
<del>Called once the element is no longer hovered. It will be cancelled if the
<del>pointer leaves the element before the `delayHoverStart` threshold is exceeded.
<add>Disables all `Hover` events.
<ide>
<ide> ### onHoverChange: boolean => void
<ide>
<ide> Called when the element changes hover state (i.e., after `onHoverStart` and
<ide> `onHoverEnd`).
<ide>
<del>### delayHoverStart: number
<add>### onHoverEnd: (e: HoverEvent) => void
<ide>
<del>The duration of the delay between when hover starts and when `onHoverStart` is
<del>called.
<add>Called once the element is no longer hovered. It will be cancelled if the
<add>pointer leaves the element before the `delayHoverStart` threshold is exceeded.
<ide>
<del>### delayHoverEnd: number
<add>### onHoverStart: (e: HoverEvent) => void
<ide>
<del>The duration of the delay between when hover ends and when `onHoverEnd` is
<del>called.
<add>Called once the element is hovered. It will not be called if the pointer leaves
<add>the element before the `delayHoverStart` threshold is exceeded. And it will not
<add>be called more than once before `onHoverEnd` is called.
<ide>
<ide>
<ide> ## Press
<ide>
<ide> The `Press` module responds to press events on the element it wraps. Press
<ide> events are dispatched for `mouse`, `pen`, `touch`, and `keyboard` pointer types.
<del>
<add>Press events are only dispatched for keyboards when pressing the Enter or
<add>Spacebar keys. If neither `onPress` nor `onLongPress` are called, this signifies
<add>that the press ended outside of the element hit bounds (i.e., the user aborted
<add>the press).
<add>
<add>```js
<add>// Example
<add>const Button = (props) => (
<add> const [ pressed, setPressed ] = useState(false);
<add> return (
<add> <Press
<add> onPress={props.onPress}
<add> onPressChange={setPressed}
<add> onLongPress={props.onLongPress}
<add> >
<add> <div
<add> {...props}
<add> role="button"
<add> tabIndex={0}
<add> style={
<add> ...buttonStyles,
<add> ...(pressed && pressedStyles)
<add> }}
<add> />
<add> </Press>
<add> );
<add>);
<ide> ```
<add>
<add>```js
<add>// Types
<ide> type PressEvent = {}
<add>
<add>type PressOffset = {
<add> top: number,
<add> right: number,
<add> bottom: number,
<add> right: number
<add>};
<ide> ```
<ide>
<del>### disabled: boolean
<add>### delayLongPress: number = 500ms
<ide>
<del>Disables all `Press` events.
<add>The duration of a press before `onLongPress` and `onLongPressChange` are called.
<ide>
<del>### onPressStart: (e: PressEvent) => void
<add>### delayPressEnd: number
<ide>
<del>Called once the element is pressed down. If the press is released before the
<del>`delayPressStart` threshold is exceeded then the delay is cut short and
<del>`onPressStart` is called immediately.
<add>The duration of the delay between when the press ends and when `onPressEnd` is
<add>called.
<ide>
<del>### onPressEnd: (e: PressEvent) => void
<add>### delayPressStart: number
<ide>
<del>Called once the element is no longer pressed. It will be cancelled if the press
<del>starts again before the `delayPressEnd` threshold is exceeded.
<add>The duration of a delay between when the press starts and when `onPressStart` is
<add>called. This delay is cut short (and `onPressStart` is called) if the press is
<add>released before the threshold is exceeded.
<ide>
<del>### onPressChange: boolean => void
<add>### disabled: boolean
<ide>
<del>Called when the element changes press state (i.e., after `onPressStart` and
<del>`onPressEnd`).
<add>Disables all `Press` events.
<ide>
<ide> ### onLongPress: (e: PressEvent) => void
<ide>
<ide> Determines whether calling `onPress` should be cancelled if `onLongPress` or
<ide>
<ide> ### onPress: (e: PressEvent) => void
<ide>
<del>Called after `onPressEnd` only if `onLongPressShouldCancelPress` returns
<del>`false`.
<add>Called immediately after a press is released, unless either 1) the press is
<add>released outside the hit bounds of the element (accounting for
<add>`pressRetentionOffset` and `TouchHitTarget`), or 2) the press was a long press,
<add>and `onLongPress` or `onLongPressChange` props are provided, and
<add>`onLongPressCancelsPress()` is `true`.
<ide>
<del>### delayPressStart: number
<add>### onPressChange: boolean => void
<ide>
<del>The duration of a delay between when the press starts and when `onPressStart` is
<del>called. This delay is cut short if the press ends released before the threshold
<del>is exceeded.
<add>Called when the element changes press state (i.e., after `onPressStart` and
<add>`onPressEnd`).
<ide>
<del>### delayPressEnd: number
<add>### onPressEnd: (e: PressEvent) => void
<ide>
<del>The duration of the delay between when the press ends and when `onPressEnd` is
<del>called.
<add>Called once the element is no longer pressed. If the press starts again before
<add>the `delayPressEnd` threshold is exceeded then the delay is reset to prevent
<add>`onPressEnd` being called during a press.
<ide>
<del>### delayLongPress: number = 500ms
<add>### onPressStart: (e: PressEvent) => void
<ide>
<del>The duration of a press before `onLongPress` and `onLongPressChange` are called.
<add>Called once the element is pressed down. If the press is released before the
<add>`delayPressStart` threshold is exceeded then the delay is cut short and
<add>`onPressStart` is called immediately.
<ide>
<del>### pressRententionOffset: { top: number, right: number, bottom: number, right: number }
<add>### pressRententionOffset: PressOffset
<ide>
<ide> Defines how far the pointer (while held down) may move outside the bounds of the
<ide> element before it is deactivated. Once deactivated, the pointer (still held
<ide><path>packages/react-events/src/Hover.js
<ide> type HoverEvent = {|
<ide> type: HoverEventType,
<ide> |};
<ide>
<del>// const DEFAULT_HOVER_END_DELAY_MS = 0;
<del>// const DEFAULT_HOVER_START_DELAY_MS = 0;
<add>const DEFAULT_HOVER_END_DELAY_MS = 0;
<add>const DEFAULT_HOVER_START_DELAY_MS = 0;
<ide>
<ide> const targetEventTypes = [
<ide> 'pointerover',
<ide> function dispatchHoverStartEvents(
<ide> state.hoverEndTimeout = null;
<ide> }
<ide>
<del> const dispatch = () => {
<add> const activate = () => {
<ide> state.isActiveHovered = true;
<ide>
<ide> if (props.onHoverStart) {
<ide> function dispatchHoverStartEvents(
<ide> };
<ide>
<ide> if (!state.isActiveHovered) {
<del> const delay = calculateDelayMS(props.delayHoverStart, 0, 0);
<del> if (delay > 0) {
<add> const delayHoverStart = calculateDelayMS(
<add> props.delayHoverStart,
<add> 0,
<add> DEFAULT_HOVER_START_DELAY_MS,
<add> );
<add> if (delayHoverStart > 0) {
<ide> state.hoverStartTimeout = context.setTimeout(() => {
<ide> state.hoverStartTimeout = null;
<del> dispatch();
<del> }, delay);
<add> activate();
<add> }, delayHoverStart);
<ide> } else {
<del> dispatch();
<add> activate();
<ide> }
<ide> }
<ide> }
<ide> function dispatchHoverEndEvents(
<ide> state.hoverStartTimeout = null;
<ide> }
<ide>
<del> const dispatch = () => {
<add> const deactivate = () => {
<ide> state.isActiveHovered = false;
<ide>
<ide> if (props.onHoverEnd) {
<ide> function dispatchHoverEndEvents(
<ide> };
<ide>
<ide> if (state.isActiveHovered) {
<del> const delay = calculateDelayMS(props.delayHoverEnd, 0, 0);
<del> if (delay > 0) {
<add> const delayHoverEnd = calculateDelayMS(
<add> props.delayHoverEnd,
<add> 0,
<add> DEFAULT_HOVER_END_DELAY_MS,
<add> );
<add> if (delayHoverEnd > 0) {
<ide> state.hoverEndTimeout = context.setTimeout(() => {
<del> dispatch();
<del> }, delay);
<add> deactivate();
<add> }, delayHoverEnd);
<ide> } else {
<del> dispatch();
<add> deactivate();
<ide> }
<ide> }
<ide> }
<ide><path>packages/react-events/src/Press.js
<ide> type PressProps = {
<ide>
<ide> type PressState = {
<ide> defaultPrevented: boolean,
<add> isActivePressed: boolean,
<add> isActivePressStart: boolean,
<ide> isAnchorTouched: boolean,
<ide> isLongPressed: boolean,
<ide> isPressed: boolean,
<ide> longPressTimeout: null | TimeoutID,
<ide> pressTarget: null | Element | Document,
<add> pressEndTimeout: null | TimeoutID,
<add> pressStartTimeout: null | TimeoutID,
<ide> shouldSkipMouseAfterTouch: boolean,
<ide> };
<ide>
<ide> type PressEvent = {|
<ide> type: PressEventType,
<ide> |};
<ide>
<del>// const DEFAULT_PRESS_DELAY_MS = 0;
<del>// const DEFAULT_PRESS_END_DELAY_MS = 0;
<del>// const DEFAULT_PRESS_START_DELAY_MS = 0;
<add>const DEFAULT_PRESS_END_DELAY_MS = 0;
<add>const DEFAULT_PRESS_START_DELAY_MS = 0;
<ide> const DEFAULT_LONG_PRESS_DELAY_MS = 500;
<ide>
<ide> const targetEventTypes = [
<ide> function dispatchPressChangeEvent(
<ide> state: PressState,
<ide> ): void {
<ide> const listener = () => {
<del> props.onPressChange(state.isPressed);
<add> props.onPressChange(state.isActivePressed);
<ide> };
<ide> dispatchEvent(context, state, 'presschange', listener);
<ide> }
<ide> function dispatchLongPressChangeEvent(
<ide> dispatchEvent(context, state, 'longpresschange', listener);
<ide> }
<ide>
<add>function activate(context, props, state) {
<add> const wasActivePressed = state.isActivePressed;
<add> state.isActivePressed = true;
<add>
<add> if (props.onPressStart) {
<add> dispatchEvent(context, state, 'pressstart', props.onPressStart);
<add> }
<add> if (!wasActivePressed && props.onPressChange) {
<add> dispatchPressChangeEvent(context, props, state);
<add> }
<add>}
<add>
<add>function deactivate(context, props, state) {
<add> const wasLongPressed = state.isLongPressed;
<add> state.isActivePressed = false;
<add> state.isLongPressed = false;
<add>
<add> if (props.onPressEnd) {
<add> dispatchEvent(context, state, 'pressend', props.onPressEnd);
<add> }
<add> if (props.onPressChange) {
<add> dispatchPressChangeEvent(context, props, state);
<add> }
<add> if (wasLongPressed && props.onLongPressChange) {
<add> dispatchLongPressChangeEvent(context, props, state);
<add> }
<add>}
<add>
<ide> function dispatchPressStartEvents(
<ide> context: ResponderContext,
<ide> props: PressProps,
<ide> state: PressState,
<ide> ): void {
<ide> state.isPressed = true;
<ide>
<del> if (props.onPressStart) {
<del> dispatchEvent(context, state, 'pressstart', props.onPressStart);
<add> if (state.pressEndTimeout !== null) {
<add> clearTimeout(state.pressEndTimeout);
<add> state.pressEndTimeout = null;
<ide> }
<del> if (props.onPressChange) {
<del> dispatchPressChangeEvent(context, props, state);
<del> }
<del> if ((props.onLongPress || props.onLongPressChange) && !state.isLongPressed) {
<del> const delayLongPress = calculateDelayMS(
<del> props.delayLongPress,
<del> 10,
<del> DEFAULT_LONG_PRESS_DELAY_MS,
<del> );
<ide>
<del> state.longPressTimeout = context.setTimeout(() => {
<del> state.isLongPressed = true;
<del> state.longPressTimeout = null;
<del>
<del> if (props.onLongPress) {
<del> const listener = e => {
<del> props.onLongPress(e);
<del> // TODO address this again at some point
<del> // if (e.nativeEvent.defaultPrevented) {
<del> // state.defaultPrevented = true;
<del> // }
<del> };
<del> dispatchEvent(context, state, 'longpress', listener);
<del> }
<add> const dispatch = () => {
<add> state.isActivePressStart = true;
<add> activate(context, props, state);
<add>
<add> if (
<add> (props.onLongPress || props.onLongPressChange) &&
<add> !state.isLongPressed
<add> ) {
<add> const delayLongPress = calculateDelayMS(
<add> props.delayLongPress,
<add> 10,
<add> DEFAULT_LONG_PRESS_DELAY_MS,
<add> );
<add> state.longPressTimeout = context.setTimeout(() => {
<add> state.isLongPressed = true;
<add> state.longPressTimeout = null;
<add> if (props.onLongPress) {
<add> const listener = e => {
<add> props.onLongPress(e);
<add> // TODO address this again at some point
<add> // if (e.nativeEvent.defaultPrevented) {
<add> // state.defaultPrevented = true;
<add> // }
<add> };
<add> dispatchEvent(context, state, 'longpress', listener);
<add> }
<add> if (props.onLongPressChange) {
<add> dispatchLongPressChangeEvent(context, props, state);
<add> }
<add> }, delayLongPress);
<add> }
<add> };
<ide>
<del> if (props.onLongPressChange) {
<del> dispatchLongPressChangeEvent(context, props, state);
<del> }
<del> }, delayLongPress);
<add> if (!state.isActivePressStart) {
<add> const delayPressStart = calculateDelayMS(
<add> props.delayPressStart,
<add> 0,
<add> DEFAULT_PRESS_START_DELAY_MS,
<add> );
<add> if (delayPressStart > 0) {
<add> state.pressStartTimeout = context.setTimeout(() => {
<add> state.pressStartTimeout = null;
<add> dispatch();
<add> }, delayPressStart);
<add> } else {
<add> dispatch();
<add> }
<ide> }
<ide> }
<ide>
<ide> function dispatchPressEndEvents(
<ide> props: PressProps,
<ide> state: PressState,
<ide> ): void {
<add> const wasActivePressStart = state.isActivePressStart;
<add>
<add> state.isActivePressStart = false;
<add> state.isPressed = false;
<add>
<ide> if (state.longPressTimeout !== null) {
<ide> clearTimeout(state.longPressTimeout);
<ide> state.longPressTimeout = null;
<ide> }
<del> if (props.onPressEnd) {
<del> dispatchEvent(context, state, 'pressend', props.onPressEnd);
<del> }
<ide>
<del> if (state.isPressed) {
<del> state.isPressed = false;
<del> if (props.onPressChange) {
<del> dispatchPressChangeEvent(context, props, state);
<del> }
<add> if (!wasActivePressStart && state.pressStartTimeout !== null) {
<add> clearTimeout(state.pressStartTimeout);
<add> state.pressStartTimeout = null;
<add> // if we haven't yet activated (due to delays), activate now
<add> activate(context, props, state);
<ide> }
<ide>
<del> if (state.isLongPressed) {
<del> state.isLongPressed = false;
<del> if (props.onLongPressChange) {
<del> dispatchLongPressChangeEvent(context, props, state);
<add> if (state.isActivePressed) {
<add> const delayPressEnd = calculateDelayMS(
<add> props.delayPressEnd,
<add> 0,
<add> DEFAULT_PRESS_END_DELAY_MS,
<add> );
<add> if (delayPressEnd > 0) {
<add> state.pressEndTimeout = context.setTimeout(() => {
<add> state.pressEndTimeout = null;
<add> deactivate(context, props, state);
<add> }, delayPressEnd);
<add> } else {
<add> deactivate(context, props, state);
<ide> }
<ide> }
<ide> }
<ide> function unmountResponder(
<ide> state: PressState,
<ide> ): void {
<ide> if (state.isPressed) {
<del> state.isPressed = false;
<del> context.removeRootEventTypes(rootEventTypes);
<ide> dispatchPressEndEvents(context, props, state);
<del> if (state.longPressTimeout !== null) {
<del> clearTimeout(state.longPressTimeout);
<del> state.longPressTimeout = null;
<del> }
<add> context.removeRootEventTypes(rootEventTypes);
<ide> }
<ide> }
<ide>
<ide> const PressResponder = {
<ide> createInitialState(): PressState {
<ide> return {
<ide> defaultPrevented: false,
<add> isActivePressed: false,
<add> isActivePressStart: false,
<ide> isAnchorTouched: false,
<ide> isLongPressed: false,
<ide> isPressed: false,
<ide> longPressTimeout: null,
<add> pressEndTimeout: null,
<add> pressStartTimeout: null,
<ide> pressTarget: null,
<ide> shouldSkipMouseAfterTouch: false,
<ide> };
<ide><path>packages/react-events/src/__tests__/Hover-test.internal.js
<ide> describe('Hover event responder', () => {
<ide> expect(onHoverStart).toHaveBeenCalledTimes(1);
<ide> });
<ide>
<add> it('is reset if "pointerout" is dispatched during a delay', () => {
<add> const element = (
<add> <Hover delayHoverStart={500} onHoverStart={onHoverStart}>
<add> <div ref={ref} />
<add> </Hover>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerover'));
<add> jest.advanceTimersByTime(499);
<add> ref.current.dispatchEvent(createPointerEvent('pointerout'));
<add> jest.advanceTimersByTime(1);
<add> expect(onHoverStart).not.toBeCalled();
<add> ref.current.dispatchEvent(createPointerEvent('pointerover'));
<add> jest.runAllTimers();
<add> expect(onHoverStart).toHaveBeenCalledTimes(1);
<add> });
<add>
<ide> it('onHoverStart is called synchronously if delay is 0ms', () => {
<ide> const element = (
<ide> <Hover delayHoverStart={0} onHoverStart={onHoverStart}>
<ide> describe('Hover event responder', () => {
<ide> jest.runAllTimers();
<ide> expect(onHoverStart).toHaveBeenCalledTimes(1);
<ide> });
<del>
<del> it('onHoverStart is not called if "pointerout" is dispatched during a delay', () => {
<del> const element = (
<del> <Hover delayHoverStart={500} onHoverStart={onHoverStart}>
<del> <div ref={ref} />
<del> </Hover>
<del> );
<del> ReactDOM.render(element, container);
<del>
<del> ref.current.dispatchEvent(createPointerEvent('pointerover'));
<del> jest.advanceTimersByTime(499);
<del> ref.current.dispatchEvent(createPointerEvent('pointerout'));
<del> jest.advanceTimersByTime(1);
<del> expect(onHoverStart).not.toBeCalled();
<del> });
<ide> });
<ide> });
<ide>
<ide><path>packages/react-events/src/__tests__/Press-test.internal.js
<ide> describe('Event responder: Press', () => {
<ide> expect(onPressStart).toHaveBeenCalledTimes(1);
<ide> });
<ide>
<del> // TODO: complete delayPressStart tests
<del> // describe('delayPressStart', () => {});
<add> describe('delayPressStart', () => {
<add> it('can be configured', () => {
<add> const element = (
<add> <Press delayPressStart={2000} onPressStart={onPressStart}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(1999);
<add> expect(onPressStart).not.toBeCalled();
<add> jest.advanceTimersByTime(1);
<add> expect(onPressStart).toHaveBeenCalledTimes(1);
<add> });
<add>
<add> it('is cut short if the press is released during a delay', () => {
<add> const element = (
<add> <Press delayPressStart={2000} onPressStart={onPressStart}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(499);
<add> expect(onPressStart).toHaveBeenCalledTimes(0);
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> expect(onPressStart).toHaveBeenCalledTimes(1);
<add> jest.runAllTimers();
<add> expect(onPressStart).toHaveBeenCalledTimes(1);
<add> });
<add>
<add> it('onPressStart is called synchronously if delay is 0ms', () => {
<add> const element = (
<add> <Press delayPressStart={0} onPressStart={onPressStart}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> expect(onPressStart).toHaveBeenCalledTimes(1);
<add> });
<add> });
<add>
<add> describe('delayPressEnd', () => {
<add> it('onPressStart called each time a press is initiated', () => {
<add> // This test makes sure that onPressStart is called each time a press
<add> // starts, even if a delayPressEnd is delaying the deactivation of the
<add> // previous press.
<add> const element = (
<add> <Press delayPressEnd={2000} onPressStart={onPressStart}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> expect(onPressStart).toHaveBeenCalledTimes(2);
<add> });
<add> });
<ide> });
<ide>
<ide> describe('onPressEnd', () => {
<ide> describe('Event responder: Press', () => {
<ide> expect(onPressEnd).toHaveBeenCalledTimes(1);
<ide> });
<ide>
<del> // TODO: complete delayPressStart tests
<del> // describe('delayPressStart', () => {});
<add> describe('delayPressEnd', () => {
<add> it('can be configured', () => {
<add> const element = (
<add> <Press delayPressEnd={2000} onPressEnd={onPressEnd}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.advanceTimersByTime(1999);
<add> expect(onPressEnd).not.toBeCalled();
<add> jest.advanceTimersByTime(1);
<add> expect(onPressEnd).toHaveBeenCalledTimes(1);
<add> });
<add>
<add> it('is reset if "pointerdown" is dispatched during a delay', () => {
<add> const element = (
<add> <Press delayPressEnd={500} onPressEnd={onPressEnd}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.advanceTimersByTime(499);
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(1);
<add> expect(onPressEnd).not.toBeCalled();
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.runAllTimers();
<add> expect(onPressEnd).toHaveBeenCalledTimes(1);
<add> });
<add> });
<add>
<add> it('onPressEnd is called synchronously if delay is 0ms', () => {
<add> const element = (
<add> <Press delayPressEnd={0} onPressEnd={onPressEnd}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> expect(onPressEnd).toHaveBeenCalledTimes(1);
<add> });
<ide> });
<ide>
<ide> describe('onPressChange', () => {
<ide> describe('Event responder: Press', () => {
<ide> expect(onPressChange).toHaveBeenCalledWith(false);
<ide> });
<ide>
<add> it('is called after delayed onPressStart', () => {
<add> const element = (
<add> <Press delayPressStart={500} onPressChange={onPressChange}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(499);
<add> expect(onPressChange).not.toBeCalled();
<add> jest.advanceTimersByTime(1);
<add> expect(onPressChange).toHaveBeenCalledTimes(1);
<add> expect(onPressChange).toHaveBeenCalledWith(true);
<add> });
<add>
<add> it('is called after delayPressStart is cut short', () => {
<add> const element = (
<add> <Press delayPressStart={500} onPressChange={onPressChange}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(100);
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> expect(onPressChange).toHaveBeenCalledTimes(2);
<add> });
<add>
<add> it('is called after delayed onPressEnd', () => {
<add> const element = (
<add> <Press delayPressEnd={500} onPressChange={onPressChange}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> expect(onPressChange).toHaveBeenCalledTimes(1);
<add> expect(onPressChange).toHaveBeenCalledWith(true);
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.advanceTimersByTime(499);
<add> expect(onPressChange).toHaveBeenCalledTimes(1);
<add> jest.advanceTimersByTime(1);
<add> expect(onPressChange).toHaveBeenCalledTimes(2);
<add> expect(onPressChange).toHaveBeenCalledWith(false);
<add> });
<add>
<ide> // No PointerEvent fallbacks
<ide> it('is called after "mousedown" and "mouseup" events', () => {
<ide> ref.current.dispatchEvent(createPointerEvent('mousedown'));
<ide> describe('Event responder: Press', () => {
<ide> expect(onPress).toHaveBeenCalledTimes(1);
<ide> });
<ide>
<add> it('is always called immediately after press is released', () => {
<add> const element = (
<add> <Press delayPressEnd={500} onPress={onPress}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> expect(onPress).toHaveBeenCalledTimes(1);
<add> });
<add>
<ide> // No PointerEvent fallbacks
<ide> // TODO: jsdom missing APIs
<del> //it('is called after "touchend" event', () => {
<del> //ref.current.dispatchEvent(createPointerEvent('touchstart'));
<del> //ref.current.dispatchEvent(createPointerEvent('touchend'));
<del> //expect(onPress).toHaveBeenCalledTimes(1);
<del> //});
<add> // it('is called after "touchend" event', () => {
<add> // ref.current.dispatchEvent(createPointerEvent('touchstart'));
<add> // ref.current.dispatchEvent(createPointerEvent('touchend'));
<add> // expect(onPress).toHaveBeenCalledTimes(1);
<add> // });
<ide> });
<ide>
<ide> describe('onLongPress', () => {
<ide> describe('Event responder: Press', () => {
<ide> expect(onLongPress).toHaveBeenCalledTimes(1);
<ide> });
<ide>
<del> /*
<ide> it('compounds with "delayPressStart"', () => {
<ide> const delayPressStart = 100;
<ide> const element = (
<ide> describe('Event responder: Press', () => {
<ide> ReactDOM.render(element, container);
<ide>
<ide> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<del> jest.advanceTimersByTime(delayPressStart + DEFAULT_LONG_PRESS_DELAY - 1);
<add> jest.advanceTimersByTime(
<add> delayPressStart + DEFAULT_LONG_PRESS_DELAY - 1,
<add> );
<ide> expect(onLongPress).not.toBeCalled();
<ide> jest.advanceTimersByTime(1);
<ide> expect(onLongPress).toHaveBeenCalledTimes(1);
<ide> });
<del> */
<ide> });
<ide> });
<ide>
<ide> describe('Event responder: Press', () => {
<ide> expect(onLongPressChange).toHaveBeenCalledTimes(2);
<ide> expect(onLongPressChange).toHaveBeenCalledWith(false);
<ide> });
<add>
<add> it('is called after delayed onPressEnd', () => {
<add> const onLongPressChange = jest.fn();
<add> const ref = React.createRef();
<add> const element = (
<add> <Press delayPressEnd={500} onLongPressChange={onLongPressChange}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add> ReactDOM.render(element, container);
<add>
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(DEFAULT_LONG_PRESS_DELAY);
<add> expect(onLongPressChange).toHaveBeenCalledTimes(1);
<add> expect(onLongPressChange).toHaveBeenCalledWith(true);
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.advanceTimersByTime(499);
<add> expect(onLongPressChange).toHaveBeenCalledTimes(1);
<add> jest.advanceTimersByTime(1);
<add> expect(onLongPressChange).toHaveBeenCalledTimes(2);
<add> expect(onLongPressChange).toHaveBeenCalledWith(false);
<add> });
<ide> });
<ide>
<ide> describe('onLongPressShouldCancelPress', () => {
<ide> describe('Event responder: Press', () => {
<ide> //});
<ide> //});
<ide>
<add> describe('delayed and multiple events', () => {
<add> it('dispatches in the correct order', () => {
<add> let events;
<add> const ref = React.createRef();
<add> const createEventHandler = msg => () => {
<add> events.push(msg);
<add> };
<add>
<add> const element = (
<add> <Press
<add> delayPressStart={250}
<add> delayPressEnd={250}
<add> onLongPress={createEventHandler('onLongPress')}
<add> onLongPressChange={createEventHandler('onLongPressChange')}
<add> onPress={createEventHandler('onPress')}
<add> onPressChange={createEventHandler('onPressChange')}
<add> onPressStart={createEventHandler('onPressStart')}
<add> onPressEnd={createEventHandler('onPressEnd')}>
<add> <div ref={ref} />
<add> </Press>
<add> );
<add>
<add> ReactDOM.render(element, container);
<add>
<add> // 1
<add> events = [];
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.runAllTimers();
<add>
<add> expect(events).toEqual([
<add> 'onPressStart',
<add> 'onPressChange',
<add> 'onPress',
<add> 'onPressStart',
<add> 'onPress',
<add> 'onPressEnd',
<add> 'onPressChange',
<add> ]);
<add>
<add> // 2
<add> events = [];
<add> ref.current.dispatchEvent(createPointerEvent('pointerdown'));
<add> jest.advanceTimersByTime(250);
<add> jest.advanceTimersByTime(500);
<add> ref.current.dispatchEvent(createPointerEvent('pointerup'));
<add> jest.runAllTimers();
<add>
<add> expect(events).toEqual([
<add> 'onPressStart',
<add> 'onPressChange',
<add> 'onLongPress',
<add> 'onLongPressChange',
<add> 'onPress',
<add> 'onPressEnd',
<add> 'onPressChange',
<add> 'onLongPressChange',
<add> ]);
<add> });
<add> });
<add>
<ide> describe('nested responders', () => {
<ide> it('dispatch events in the correct order', () => {
<ide> const events = []; | 5 |
Javascript | Javascript | remove redundant methods from nullformctrl | 0563a0a636b1b586e3f31e2741cb27f9c4959b5b | <ide><path>src/ng/directive/form.js
<ide> var nullFormCtrl = {
<ide> $$renameControl: nullFormRenameControl,
<ide> $removeControl: noop,
<ide> $setValidity: noop,
<del> $$setPending: noop,
<ide> $setDirty: noop,
<ide> $setPristine: noop,
<del> $setSubmitted: noop,
<del> $$clearControlValidity: noop
<add> $setSubmitted: noop
<ide> },
<ide> SUBMITTED_CLASS = 'ng-submitted';
<ide> | 1 |
PHP | PHP | add enumerable skip() method | 67d6b72b68b4f02665ddba079fb9edd3ddb90d8f | <ide><path>src/Illuminate/Support/Collection.php
<ide> public function shuffle($seed = null)
<ide> return new static(Arr::shuffle($this->items, $seed));
<ide> }
<ide>
<add> /**
<add> * Skip the first {$count} items.
<add> *
<add> * @param int $count
<add> * @return static
<add> */
<add> public function skip($count)
<add> {
<add> return $this->slice($count);
<add> }
<add>
<ide> /**
<ide> * Slice the underlying collection array.
<ide> *
<ide><path>src/Illuminate/Support/Enumerable.php
<ide> public function shift();
<ide> */
<ide> public function shuffle($seed = null);
<ide>
<add> /**
<add> * Skip the first {$count} items.
<add> *
<add> * @param int $count
<add> * @return static
<add> */
<add> public function skip($count);
<add>
<ide> /**
<ide> * Get a slice of items from the enumerable.
<ide> *
<ide><path>tests/Support/SupportCollectionTest.php
<ide> public function testCollectionShuffleWithSeed($collection)
<ide> $this->assertEquals($firstRandom, $secondRandom);
<ide> }
<ide>
<add> /**
<add> * @dataProvider collectionClassProvider
<add> */
<add> public function testSkipMethod($collection)
<add> {
<add> $data = new $collection([1, 2, 3, 4, 5, 6]);
<add>
<add> $data = $data->skip(4)->values();
<add>
<add> $this->assertSame([5, 6], $data->all());
<add> }
<add>
<ide> /**
<ide> * @dataProvider collectionClassProvider
<ide> */ | 3 |
Javascript | Javascript | use textlegend example in android as well | 335927db44fe47e20db4503a1ab5fcf8d62144a8 | <ide><path>RNTester/js/Shared/TextLegend.js
<add>/**
<add> * Copyright (c) 2015-present, Facebook, Inc.
<add> *
<add> * This source code is licensed under the MIT license found in the
<add> * LICENSE file in the root directory of this source tree.
<add> *
<add> * @format
<add> * @flow
<add> */
<add>
<add>'use strict';
<add>
<add>const React = require('React');
<add>const {Picker, Text, View} = require('react-native');
<add>
<add>class TextLegend extends React.Component<*, *> {
<add> state = {
<add> textMetrics: [],
<add> language: 'english',
<add> };
<add>
<add> render() {
<add> const PANGRAMS = {
<add> arabic:
<add> 'صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ',
<add> chinese: 'Innovation in China 中国智造,慧及全球 0123456789',
<add> english: 'The quick brown fox jumps over the lazy dog.',
<add> emoji: '🙏🏾🚗💩😍🤯👩🏽🔧🇨🇦💯',
<add> german: 'Falsches Üben von Xylophonmusik quält jeden größeren Zwerg',
<add> greek: 'Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός',
<add> hebrew: 'דג סקרן שט בים מאוכזב ולפתע מצא חברה',
<add> hindi:
<add> 'ऋषियों को सताने वाले दुष्ट राक्षसों के राजा रावण का सर्वनाश करने वाले विष्णुवतार भगवान श्रीराम, अयोध्या के महाराज दशरथ के बड़े सपुत्र थे।',
<add> igbo:
<add> 'Nne, nna, wepụ he’l’ụjọ dum n’ime ọzụzụ ụmụ, vufesi obi nye Chukwu, ṅụrịanụ, gbakọọnụ kpaa, kwee ya ka o guzoshie ike; ọ ghaghị ito, nwapụta ezi agwa',
<add> irish:
<add> 'D’fhuascail Íosa Úrmhac na hÓighe Beannaithe pór Éava agus Ádhaimh',
<add> japanese:
<add> '色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず',
<add> korean:
<add> '키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다',
<add> norwegian:
<add> 'Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi.',
<add> polish: 'Jeżu klątw, spłódź Finom część gry hańb!',
<add> romanian: 'Muzicologă în bej vând whisky și tequila, preț fix.',
<add> russian: 'Эх, чужак, общий съём цен шляп (юфть) – вдрызг!',
<add> swedish: 'Yxskaftbud, ge vår WC-zonmö IQ-hjälp.',
<add> thai:
<add> 'เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอยฯ',
<add> };
<add> return (
<add> <View>
<add> <Picker
<add> selectedValue={this.state.language}
<add> onValueChange={itemValue => this.setState({language: itemValue})}>
<add> {Object.keys(PANGRAMS).map(x => (
<add> <Picker.Item
<add> label={x[0].toUpperCase() + x.substring(1)}
<add> key={x}
<add> value={x}
<add> />
<add> ))}
<add> </Picker>
<add> <View>
<add> {this.state.textMetrics.map(
<add> ({
<add> x,
<add> y,
<add> width,
<add> height,
<add> capHeight,
<add> ascender,
<add> descender,
<add> xHeight,
<add> }) => {
<add> return [
<add> <View
<add> key="baseline view"
<add> style={{
<add> top: y + ascender,
<add> height: 1,
<add> left: 0,
<add> right: 0,
<add> position: 'absolute',
<add> backgroundColor: 'red',
<add> }}
<add> />,
<add> <Text
<add> key="baseline text"
<add> style={{
<add> top: y + ascender,
<add> right: 0,
<add> position: 'absolute',
<add> color: 'red',
<add> }}>
<add> Baseline
<add> </Text>,
<add> <View
<add> key="capheight view"
<add> style={{
<add> top: y + ascender - capHeight,
<add> height: 1,
<add> left: 0,
<add> right: 0,
<add> position: 'absolute',
<add> backgroundColor: 'green',
<add> }}
<add> />,
<add> <Text
<add> key="capheight text"
<add> style={{
<add> top: y + ascender - capHeight,
<add> right: 0,
<add> position: 'absolute',
<add> color: 'green',
<add> }}>
<add> Capheight
<add> </Text>,
<add> <View
<add> key="xheight view"
<add> style={{
<add> top: y + ascender - xHeight,
<add> height: 1,
<add> left: 0,
<add> right: 0,
<add> position: 'absolute',
<add> backgroundColor: 'blue',
<add> }}
<add> />,
<add> <Text
<add> key="xheight text"
<add> style={{
<add> top: y + ascender - xHeight,
<add> right: 0,
<add> position: 'absolute',
<add> color: 'blue',
<add> }}>
<add> X-height
<add> </Text>,
<add> <View
<add> key="descender view"
<add> style={{
<add> top: y + ascender + descender,
<add> height: 1,
<add> left: 0,
<add> right: 0,
<add> position: 'absolute',
<add> backgroundColor: 'orange',
<add> }}
<add> />,
<add> <Text
<add> key="descender text"
<add> style={{
<add> top: y + ascender + descender,
<add> right: 0,
<add> position: 'absolute',
<add> color: 'orange',
<add> }}>
<add> Descender
<add> </Text>,
<add> <View
<add> key="end of text view"
<add> style={{
<add> top: y,
<add> height: height,
<add> width: 1,
<add> left: x + width,
<add> position: 'absolute',
<add> backgroundColor: 'brown',
<add> }}
<add> />,
<add> <Text
<add> key="end of text text"
<add> style={{
<add> top: y,
<add> left: x + width + 5,
<add> position: 'absolute',
<add> color: 'brown',
<add> }}>
<add> End of text
<add> </Text>,
<add> ];
<add> },
<add> )}
<add> <Text
<add> onTextLayout={event =>
<add> this.setState({textMetrics: event.nativeEvent.lines})
<add> }
<add> style={{fontSize: 50}}>
<add> {PANGRAMS[this.state.language]}
<add> </Text>
<add> </View>
<add> </View>
<add> );
<add> }
<add>}
<add>module.exports = TextLegend;
<ide><path>RNTester/js/TextExample.android.js
<ide> var ReactNative = require('react-native');
<ide> var {Image, StyleSheet, Text, View} = ReactNative;
<ide> var RNTesterBlock = require('./RNTesterBlock');
<ide> var RNTesterPage = require('./RNTesterPage');
<add>const TextLegend = require('./Shared/TextLegend');
<ide>
<ide> class Entity extends React.Component<$FlowFixMeProps> {
<ide> render() {
<ide> class TextExample extends React.Component<{}> {
<ide> This text is indented by 10px padding on all sides.
<ide> </Text>
<ide> </RNTesterBlock>
<add> <RNTesterBlock title="Text metrics legend">
<add> <TextLegend />
<add> </RNTesterBlock>
<ide> <RNTesterBlock title="Font Family">
<ide> <Text style={{fontFamily: 'sans-serif'}}>Sans-Serif</Text>
<ide> <Text style={{fontFamily: 'sans-serif', fontWeight: 'bold'}}>
<ide><path>RNTester/js/TextExample.ios.js
<ide> const Platform = require('Platform');
<ide> var React = require('react');
<ide> var createReactClass = require('create-react-class');
<ide> var ReactNative = require('react-native');
<del>var {
<del> Image,
<del> Text,
<del> TextInput,
<del> View,
<del> LayoutAnimation,
<del> Button,
<del> Picker,
<del>} = ReactNative;
<add>var {Text, TextInput, View, LayoutAnimation, Button} = ReactNative;
<add>const TextLegend = require('./Shared/TextLegend');
<ide>
<ide> type TextAlignExampleRTLState = {|
<ide> isRTL: boolean,
<ide> class TextWithCapBaseBox extends React.Component<*, *> {
<ide> }
<ide> }
<ide>
<del>class TextLegend extends React.Component<*, *> {
<del> state = {
<del> textMetrics: [],
<del> language: 'english',
<del> };
<del>
<del> render() {
<del> const PANGRAMS = {
<del> arabic:
<del> 'صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ',
<del> chinese: 'Innovation in China 中国智造,慧及全球 0123456789',
<del> english: 'The quick brown fox jumps over the lazy dog.',
<del> emoji: '🙏🏾🚗💩😍🤯👩🏽🔧🇨🇦💯',
<del> german: 'Falsches Üben von Xylophonmusik quält jeden größeren Zwerg',
<del> greek: 'Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός',
<del> hebrew: 'דג סקרן שט בים מאוכזב ולפתע מצא חברה',
<del> hindi:
<del> 'ऋषियों को सताने वाले दुष्ट राक्षसों के राजा रावण का सर्वनाश करने वाले विष्णुवतार भगवान श्रीराम, अयोध्या के महाराज दशरथ के बड़े सपुत्र थे।',
<del> igbo:
<del> 'Nne, nna, wepụ he’l’ụjọ dum n’ime ọzụzụ ụmụ, vufesi obi nye Chukwu, ṅụrịanụ, gbakọọnụ kpaa, kwee ya ka o guzoshie ike; ọ ghaghị ito, nwapụta ezi agwa',
<del> irish:
<del> 'D’fhuascail Íosa Úrmhac na hÓighe Beannaithe pór Éava agus Ádhaimh',
<del> japanese:
<del> '色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず',
<del> korean:
<del> '키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다',
<del> norwegian:
<del> 'Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi.',
<del> polish: 'Jeżu klątw, spłódź Finom część gry hańb!',
<del> romanian: 'Muzicologă în bej vând whisky și tequila, preț fix.',
<del> russian: 'Эх, чужак, общий съём цен шляп (юфть) – вдрызг!',
<del> swedish: 'Yxskaftbud, ge vår WC-zonmö IQ-hjälp.',
<del> thai:
<del> 'เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอยฯ',
<del> };
<del> return (
<del> <View>
<del> <Picker
<del> selectedValue={this.state.language}
<del> onValueChange={itemValue => this.setState({language: itemValue})}>
<del> {Object.keys(PANGRAMS).map(x => (
<del> <Picker.Item
<del> label={x[0].toUpperCase() + x.substring(1)}
<del> key={x}
<del> value={x}
<del> />
<del> ))}
<del> </Picker>
<del> <View>
<del> {this.state.textMetrics.map(
<del> ({
<del> x,
<del> y,
<del> width,
<del> height,
<del> capHeight,
<del> ascender,
<del> descender,
<del> xHeight,
<del> }) => {
<del> return [
<del> <View
<del> key="baseline view"
<del> style={{
<del> top: y + ascender,
<del> height: 1,
<del> left: 0,
<del> right: 0,
<del> position: 'absolute',
<del> backgroundColor: 'red',
<del> }}
<del> />,
<del> <Text
<del> key="baseline text"
<del> style={{
<del> top: y + ascender,
<del> right: 0,
<del> position: 'absolute',
<del> color: 'red',
<del> }}>
<del> Baseline
<del> </Text>,
<del> <View
<del> key="capheight view"
<del> style={{
<del> top: y + ascender - capHeight,
<del> height: 1,
<del> left: 0,
<del> right: 0,
<del> position: 'absolute',
<del> backgroundColor: 'green',
<del> }}
<del> />,
<del> <Text
<del> key="capheight text"
<del> style={{
<del> top: y + ascender - capHeight,
<del> right: 0,
<del> position: 'absolute',
<del> color: 'green',
<del> }}>
<del> Capheight
<del> </Text>,
<del> <View
<del> key="xheight view"
<del> style={{
<del> top: y + ascender - xHeight,
<del> height: 1,
<del> left: 0,
<del> right: 0,
<del> position: 'absolute',
<del> backgroundColor: 'blue',
<del> }}
<del> />,
<del> <Text
<del> key="xheight text"
<del> style={{
<del> top: y + ascender - xHeight,
<del> right: 0,
<del> position: 'absolute',
<del> color: 'blue',
<del> }}>
<del> X-height
<del> </Text>,
<del> <View
<del> key="descender view"
<del> style={{
<del> top: y + ascender + descender,
<del> height: 1,
<del> left: 0,
<del> right: 0,
<del> position: 'absolute',
<del> backgroundColor: 'orange',
<del> }}
<del> />,
<del> <Text
<del> key="descender text"
<del> style={{
<del> top: y + ascender + descender,
<del> right: 0,
<del> position: 'absolute',
<del> color: 'orange',
<del> }}>
<del> Descender
<del> </Text>,
<del> <View
<del> key="end of text view"
<del> style={{
<del> top: y,
<del> height: height,
<del> width: 1,
<del> left: x + width,
<del> position: 'absolute',
<del> backgroundColor: 'brown',
<del> }}
<del> />,
<del> <Text
<del> key="end of text text"
<del> style={{
<del> top: y,
<del> left: x + width + 5,
<del> position: 'absolute',
<del> color: 'brown',
<del> }}>
<del> End of text
<del> </Text>,
<del> ];
<del> },
<del> )}
<del> <Text
<del> onTextLayout={event =>
<del> this.setState({textMetrics: event.nativeEvent.lines})
<del> }
<del> style={{fontSize: 50}}>
<del> {PANGRAMS[this.state.language]}
<del> </Text>
<del> </View>
<del> </View>
<del> );
<del> }
<del>}
<ide> exports.title = '<Text>';
<ide> exports.description = 'Base component for rendering styled text.';
<ide> exports.displayName = 'TextExample'; | 3 |
Javascript | Javascript | add test filter | f98a603d2340290236ad856966619ba2237c8c98 | <ide><path>test/cases/inner-graph/class-dynamic-props/test.filter.js
<add>var supportsClassFields = require("../../../helpers/supportsClassFields");
<add>
<add>module.exports = function (config) {
<add> return supportsClassFields();
<add>}; | 1 |
PHP | PHP | make range() inclusive | cf1ea172df2d594a56244c9e0d73febc808bae32 | <ide><path>src/Validation/Validation.php
<ide> public static function range($check, $lower = null, $upper = null) {
<ide> return false;
<ide> }
<ide> if (isset($lower) && isset($upper)) {
<del> return ($check > $lower && $check < $upper);
<add> return ($check >= $lower && $check <= $upper);
<ide> }
<ide> return is_finite($check);
<ide> }
<ide><path>tests/TestCase/Validation/ValidationTest.php
<ide> public function testRange() {
<ide> $this->assertTrue(Validation::range(5));
<ide> $this->assertTrue(Validation::range(-5, -10, 1));
<ide> $this->assertFalse(Validation::range('word'));
<add> $this->assertTrue(Validation::range(5.1));
<add> $this->assertTrue(Validation::range(2.1, 2.1, 3.2));
<add> $this->assertTrue(Validation::range(3.2, 2.1, 3.2));
<add> $this->assertFalse(Validation::range(2.099, 2.1, 3.2));
<ide> }
<ide>
<ide> /** | 2 |
PHP | PHP | refactor the session class | 6590b54f44c26be6ba76b59d25f6e30cffa54698 | <ide><path>system/session.php
<ide> public static function load($id)
<ide> static::$session = array('id' => Str::random(40), 'data' => array());
<ide> }
<ide>
<del> if ( ! static::has('csrf_token')) static::put('csrf_token', Str::random(16));
<add> if ( ! static::has('csrf_token'))
<add> {
<add> static::put('csrf_token', Str::random(16));
<add> }
<ide>
<ide> static::$session['last_activity'] = time();
<ide> } | 1 |
Javascript | Javascript | add hey neighbor to showcase | 16b2016493fdee154853f363f96a4a6858335681 | <ide><path>website/src/react-native/showcase.js
<ide> var apps = [
<ide> link: 'https://itunes.apple.com/us/app/hashtag-by-hashley-ironic/id1022724462?mt=8',
<ide> author: 'Elephant, LLC',
<ide> },
<add> {
<add> name: 'Hey, Neighbor!',
<add> icon: 'https://raw.githubusercontent.com/scrollback/io.scrollback.neighborhoods/master/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png',
<add> link: 'https://play.google.com/store/apps/details?id=io.scrollback.neighborhoods',
<add> author: 'Scrollback',
<add> },
<ide> {
<ide> name: 'HSK Level 1 Chinese Flashcards',
<ide> icon: 'http://is2.mzstatic.com/image/pf/us/r30/Purple1/v4/b2/4f/3a/b24f3ae3-2597-cc70-1040-731b425a5904/mzl.amxdcktl.jpg', | 1 |
Python | Python | use list to be safe | 3f4e206fcb5ba2319f64f6bb32e324177c680b60 | <ide><path>airflow/plugins_manager.py
<ide> def validate(cls):
<ide> if file_ext != '.py':
<ide> continue
<ide> m = imp.load_source(mod_name, filepath)
<del> for obj in m.__dict__.values():
<add> for obj in list(m.__dict__.values()):
<ide> if (
<ide> inspect.isclass(obj) and
<ide> issubclass(obj, AirflowPlugin) and | 1 |
Go | Go | add test case for `docker ps -f health=starting` | f509a54bdd29b8f65c17097fde3664c6fad36c21 | <ide><path>container/state.go
<ide> func (s *State) String() string {
<ide> return fmt.Sprintf("Exited (%d) %s ago", s.ExitCodeValue, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt)))
<ide> }
<ide>
<del>// HealthString returns a single string to describe health status.
<del>func (s *State) HealthString() string {
<del> if s.Health == nil {
<del> return types.NoHealthcheck
<del> }
<del>
<del> return s.Health.String()
<del>}
<del>
<ide> // IsValidHealthString checks if the provided string is a valid container health status or not.
<ide> func IsValidHealthString(s string) bool {
<ide> return s == types.Starting ||
<ide><path>container/view_test.go
<ide> import (
<ide> "path/filepath"
<ide> "testing"
<ide>
<add> "github.com/docker/docker/api/types"
<ide> containertypes "github.com/docker/docker/api/types/container"
<ide> "github.com/pborman/uuid"
<ide> "github.com/stretchr/testify/assert"
<ide> func TestNames(t *testing.T) {
<ide> view = db.Snapshot()
<ide> assert.Equal(t, map[string][]string{"containerid4": {"name1", "name2"}}, view.GetAllNames())
<ide> }
<add>
<add>// Test case for GitHub issue 35920
<add>func TestViewWithHealthCheck(t *testing.T) {
<add> var (
<add> db, _ = NewViewDB()
<add> one = newContainer(t)
<add> )
<add> one.Health = &Health{
<add> Health: types.Health{
<add> Status: "starting",
<add> },
<add> }
<add> if err := one.CheckpointTo(db); err != nil {
<add> t.Fatal(err)
<add> }
<add> s, err := db.Snapshot().Get(one.ID)
<add> if err != nil {
<add> t.Fatal(err)
<add> }
<add> if s == nil || s.Health != "starting" {
<add> t.Fatalf("expected Health=starting. Got: %+v", s)
<add> }
<add>} | 2 |
Python | Python | add meta validation to check for required settings | e3de035814fa5b5bd2561bbbadc037deb8c15298 | <ide><path>spacy/cli/package.py
<ide> def package(input_dir, output_dir, meta_path, force):
<ide> else:
<ide> meta = generate_meta()
<ide>
<add> validate_meta(meta, ['lang', 'name', 'version'])
<ide> model_name = meta['lang'] + '_' + meta['name']
<ide> model_name_v = model_name + '-' + meta['version']
<ide> main_path = output_path / model_name_v
<ide> def generate_meta():
<ide> return meta
<ide>
<ide>
<add>def validate_meta(meta, keys):
<add> for key in keys:
<add> if key not in meta or meta[key] == '':
<add> util.sys_exit(
<add> "This setting is required to build your package.",
<add> title='No "{k}" setting found in meta.json'.format(k=key))
<add>
<add>
<ide> def get_template(filepath):
<ide> url = 'https://raw.githubusercontent.com/explosion/spacy-dev-resources/master/templates/model/'
<ide> r = requests.get(url + filepath) | 1 |
Text | Text | correct logic warning about initializers | 3033f92de192cb705a5a623fd47ff0abed3a1000 | <ide><path>guides/source/configuring.md
<ide> The `initializer` method takes three arguments with the first being the name for
<ide>
<ide> Initializers defined using the `initializer` method will be run in the order they are defined in, with the exception of ones that use the `:before` or `:after` methods.
<ide>
<del>WARNING: You may put your initializer before or after any other initializer in the chain, as long as it is logical. Say you have 4 initializers called "one" through "four" (defined in that order) and you define "four" to go _before_ "four" but _after_ "three", that just isn't logical and Rails will not be able to determine your initializer order.
<add>WARNING: You may put your initializer before or after any other initializer in the chain, as long as it is logical. Say you have 4 initializers called "one" through "four" (defined in that order) and you define "four" to go _before_ "two" but _after_ "three", that just isn't logical and Rails will not be able to determine your initializer order.
<ide>
<ide> The block argument of the `initializer` method is the instance of the application itself, and so we can access the configuration on it by using the `config` method as done in the example.
<ide> | 1 |
Python | Python | change bootle routing to new syntax | d6ada6b20f41ce92dc1efba13056a920fee6e634 | <ide><path>glances/outputs/glances_bottle.py
<ide> def _route(self):
<ide>
<ide> # REST API
<ide> self._app.route('/api/2/args', method="GET", callback=self._api_args)
<del> self._app.route('/api/2/args/:item', method="GET", callback=self._api_args_item)
<add> self._app.route('/api/2/args/<item>', method="GET", callback=self._api_args_item)
<ide> self._app.route('/api/2/help', method="GET", callback=self._api_help)
<ide> self._app.route('/api/2/pluginslist', method="GET", callback=self._api_plugins)
<ide> self._app.route('/api/2/all', method="GET", callback=self._api_all)
<ide> self._app.route('/api/2/all/limits', method="GET", callback=self._api_all_limits)
<ide> self._app.route('/api/2/all/views', method="GET", callback=self._api_all_views)
<del> self._app.route('/api/2/:plugin', method="GET", callback=self._api)
<del> self._app.route('/api/2/:plugin/history', method="GET", callback=self._api_history)
<del> self._app.route('/api/2/:plugin/history/:nb', method="GET", callback=self._api_history)
<del> self._app.route('/api/2/:plugin/limits', method="GET", callback=self._api_limits)
<del> self._app.route('/api/2/:plugin/views', method="GET", callback=self._api_views)
<del> self._app.route('/api/2/:plugin/:item', method="GET", callback=self._api_item)
<del> self._app.route('/api/2/:plugin/:item/history', method="GET", callback=self._api_item_history)
<del> self._app.route('/api/2/:plugin/:item/history/:nb', method="GET", callback=self._api_item_history)
<del> self._app.route('/api/2/:plugin/:item/:value', method="GET", callback=self._api_value)
<add> self._app.route('/api/2/<plugin>', method="GET", callback=self._api)
<add> self._app.route('/api/2/<plugin>/history', method="GET", callback=self._api_history)
<add> self._app.route('/api/2/<plugin>/history/<nb:int>', method="GET", callback=self._api_history)
<add> self._app.route('/api/2/<plugin>/limits', method="GET", callback=self._api_limits)
<add> self._app.route('/api/2/<plugin>/views', method="GET", callback=self._api_views)
<add> self._app.route('/api/2/<plugin>/<item>', method="GET", callback=self._api_item)
<add> self._app.route('/api/2/<plugin>/<item>/history', method="GET", callback=self._api_item_history)
<add> self._app.route('/api/2/<plugin>/<item>/history/<nb:int>', method="GET", callback=self._api_item_history)
<add> self._app.route('/api/2/<plugin>/<item>/<value>', method="GET", callback=self._api_value)
<ide>
<ide> self._app.route('/<filepath:path>', method="GET", callback=self._resource)
<ide> | 1 |
Python | Python | update lex_attrs.py for spanish with ordinals | 2abd380f2d17010fe22fe52e8aab529d70cbeec6 | <ide><path>spacy/lang/es/lex_attrs.py
<ide> ]
<ide>
<ide>
<add>_ordinal_words = [
<add> "primero",
<add> "segundo",
<add> "tercero",
<add> "cuarto",
<add> "quinto",
<add> "sexto",
<add> "séptimo",
<add> "octavo",
<add> "noveno",
<add> "décimo",
<add> "undécimo",
<add> "duodécimo",
<add> "decimotercero",
<add> "decimocuarto",
<add> "decimoquinto",
<add> "decimosexto",
<add> "decimoséptimo",
<add> "decimoctavo",
<add> "decimonoveno",
<add> "vigésimo",
<add> "trigésimo",
<add> "cuadragésimo",
<add> "quincuagésimo",
<add> "sexagésimo",
<add> "septuagésimo",
<add> "octogésima",
<add> "nonagésima",
<add> "centésima",
<add> "milésima",
<add> "millonésima",
<add> "billonésima",
<add>]
<add>
<add>
<ide> def like_num(text):
<ide> if text.startswith(("+", "-", "±", "~")):
<ide> text = text[1:]
<ide> def like_num(text):
<ide> num, denom = text.split("/")
<ide> if num.isdigit() and denom.isdigit():
<ide> return True
<del> if text.lower() in _num_words:
<add> text_lower = text.lower()
<add> if text_lower in _num_words:
<add> return True
<add> # Check ordinal number
<add> if text_lower in _ordinal_words:
<ide> return True
<ide> return False
<ide> | 1 |
PHP | PHP | use a clearer variable name | e30dde25c37d2aa62209660540aac5d09459ae56 | <ide><path>src/Log/Engine/BaseLog.php
<ide> protected function _format($data, array $context = [])
<ide> return $data;
<ide> }
<ide>
<del> $object = is_object($data);
<add> $isObject = is_object($data);
<ide>
<del> if ($object && $data instanceof EntityInterface) {
<add> if ($isObject && $data instanceof EntityInterface) {
<ide> return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
<ide> }
<ide>
<del> if ($object && method_exists($data, '__toString')) {
<add> if ($isObject && method_exists($data, '__toString')) {
<ide> return (string)$data;
<ide> }
<ide>
<del> if ($object && $data instanceof JsonSerializable) {
<add> if ($isObject && $data instanceof JsonSerializable) {
<ide> return json_encode($data, JSON_UNESCAPED_UNICODE);
<ide> }
<ide> | 1 |
Go | Go | release memorystore locks before filter/apply | bd2b3d363ff7c46e01cce4e6a41d41f24a0047da | <ide><path>container/history.go
<ide> func (history *History) Swap(i, j int) {
<ide> containers[i], containers[j] = containers[j], containers[i]
<ide> }
<ide>
<del>// Add the given container to history.
<del>func (history *History) Add(container *Container) {
<del> *history = append(*history, container)
<del>}
<del>
<ide> // sort orders the history by creation date in descendant order.
<ide> func (history *History) sort() {
<ide> sort.Sort(history)
<ide><path>container/memory_store.go
<ide> func (c *memoryStore) Delete(id string) {
<ide> // List returns a sorted list of containers from the store.
<ide> // The containers are ordered by creation date.
<ide> func (c *memoryStore) List() []*Container {
<del> containers := new(History)
<del> c.RLock()
<del> for _, cont := range c.s {
<del> containers.Add(cont)
<del> }
<del> c.RUnlock()
<add> containers := History(c.all())
<ide> containers.sort()
<del> return *containers
<add> return containers
<ide> }
<ide>
<ide> // Size returns the number of containers in the store.
<ide> func (c *memoryStore) Size() int {
<ide>
<ide> // First returns the first container found in the store by a given filter.
<ide> func (c *memoryStore) First(filter StoreFilter) *Container {
<del> c.RLock()
<del> defer c.RUnlock()
<del> for _, cont := range c.s {
<add> for _, cont := range c.all() {
<ide> if filter(cont) {
<ide> return cont
<ide> }
<ide> func (c *memoryStore) First(filter StoreFilter) *Container {
<ide> // This operation is asyncronous in the memory store.
<ide> // NOTE: Modifications to the store MUST NOT be done by the StoreReducer.
<ide> func (c *memoryStore) ApplyAll(apply StoreReducer) {
<del> c.RLock()
<del> defer c.RUnlock()
<del>
<ide> wg := new(sync.WaitGroup)
<del> for _, cont := range c.s {
<add> for _, cont := range c.all() {
<ide> wg.Add(1)
<ide> go func(container *Container) {
<ide> apply(container)
<ide> func (c *memoryStore) ApplyAll(apply StoreReducer) {
<ide> wg.Wait()
<ide> }
<ide>
<add>func (c *memoryStore) all() []*Container {
<add> c.RLock()
<add> containers := make([]*Container, 0, len(c.s))
<add> for _, cont := range c.s {
<add> containers = append(containers, cont)
<add> }
<add> c.RUnlock()
<add> return containers
<add>}
<add>
<ide> var _ Store = &memoryStore{} | 2 |
Javascript | Javascript | move utils out of react that aren't being used | d9511d817a3cb10127d7eb88f3b5d42e1c3d4ae8 | <ide><path>src/utils/__tests__/objFilter-test.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @emails react-core
<del> */
<del>
<del>"use strict";
<del>
<del>var objFilter = require('objFilter');
<del>
<del>describe('objFilter', function() {
<del>
<del> var obj = {
<del> A: 'apple',
<del> B: 'banana',
<del> C: 'coconut',
<del> D: 'durian',
<del> E: 'elderberry',
<del> F: 'fig',
<del> G: 'guava',
<del> H: 'hackberry'
<del> };
<del>
<del> it('should accept null', function() {
<del> var filtered = objFilter(null, function() {});
<del> expect(filtered).toBe(null);
<del> });
<del>
<del> it('should return true to create copy', function() {
<del> var filtered = objFilter(obj, function() {
<del> return true;
<del> });
<del> expect(filtered).not.toBe(obj);
<del> expect(filtered).toEqual(obj);
<del> });
<del>
<del> it('should return empty object for a falsey func', function() {
<del> var filtered = objFilter(obj, function() {
<del> return false;
<del> });
<del> expect(filtered).toEqual({});
<del> });
<del>
<del> it('should filter based on value', function() {
<del> var filtered = objFilter(obj, function(value) {
<del> return value.indexOf('berry') !== -1;
<del> });
<del> expect(filtered).toEqual({
<del> E: 'elderberry',
<del> H: 'hackberry'
<del> });
<del> });
<del>
<del> it('should filter based on key', function() {
<del> var filtered = objFilter(obj, function(value, key) {
<del> return (/[AEIOU]/).test(key);
<del> });
<del> expect(filtered).toEqual({
<del> A: 'apple',
<del> E: 'elderberry'
<del> });
<del> });
<del>
<del> it('should filter based on iteration', function() {
<del> var filtered = objFilter(obj, function(value, key, iteration) {
<del> return iteration % 2;
<del> });
<del> expect(filtered).toEqual({
<del> B: 'banana',
<del> D: 'durian',
<del> F: 'fig',
<del> H: 'hackberry'
<del> });
<del> });
<del>
<del>});
<ide><path>src/utils/__tests__/objMap-test.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @emails react-core
<del> */
<del>
<del>"use strict";
<del>
<del>var objMap = require('objMap');
<del>
<del>describe('objMap', function() {
<del>
<del> var obj = {
<del> A: 'apple',
<del> B: 'banana',
<del> C: 'coconut',
<del> D: 'durian',
<del> E: 'elderberry',
<del> F: 'fig',
<del> G: 'guava',
<del> H: 'hackberry'
<del> };
<del>
<del> it('should accept null', function() {
<del> var mapped = objMap(null, function() {});
<del> expect(mapped).toBe(null);
<del> });
<del>
<del> it('should return value to create copy', function() {
<del> var mapped = objMap(obj, function(value) {
<del> return value;
<del> });
<del> expect(mapped).not.toBe(obj);
<del> expect(mapped).toEqual(obj);
<del> });
<del>
<del> it('should always retain keys', function() {
<del> var mapped = objMap(obj, function() {
<del> return null;
<del> });
<del> expect(mapped).toEqual({
<del> A: null,
<del> B: null,
<del> C: null,
<del> D: null,
<del> E: null,
<del> F: null,
<del> G: null,
<del> H: null
<del> });
<del> });
<del>
<del> it('should map values', function() {
<del> var mapped = objMap(obj, function (value) {
<del> return value.toUpperCase();
<del> });
<del> expect(mapped).toEqual({
<del> A: 'APPLE',
<del> B: 'BANANA',
<del> C: 'COCONUT',
<del> D: 'DURIAN',
<del> E: 'ELDERBERRY',
<del> F: 'FIG',
<del> G: 'GUAVA',
<del> H: 'HACKBERRY'
<del> });
<del> });
<del>
<del> it('should map keys', function() {
<del> var mapped = objMap(obj, function (value, key) {
<del> return key;
<del> });
<del> expect(mapped).toEqual({
<del> A: 'A',
<del> B: 'B',
<del> C: 'C',
<del> D: 'D',
<del> E: 'E',
<del> F: 'F',
<del> G: 'G',
<del> H: 'H'
<del> });
<del> });
<del>
<del> it('should map iterations', function() {
<del> var mapped = objMap(obj, function (value, key, iteration) {
<del> return iteration;
<del> });
<del> expect(mapped).toEqual({
<del> A: 0,
<del> B: 1,
<del> C: 2,
<del> D: 3,
<del> E: 4,
<del> F: 5,
<del> G: 6,
<del> H: 7
<del> });
<del> });
<del>
<del>});
<ide><path>src/utils/bindNoArgs.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @providesModule bindNoArgs
<del> */
<del>
<del>"use strict";
<del>
<del>var bindNoArgs = function (func, context) {
<del> if (!func) {
<del> return null;
<del> }
<del> return function () {
<del> return func.call(context);
<del> };
<del>};
<del>
<del>module.exports = bindNoArgs;
<ide><path>src/utils/curryOnly.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @providesModule curryOnly
<del> */
<del>
<del>"use strict";
<del>
<del>/**
<del> * When the function who's first parameter you are currying accepts only a
<del> * single argument, and you want to curry it, use this function for performance
<del> * reasons, as it will never access 'arguments'. It would be an interesting
<del> * project to detect at static analysis time, calls to F.curry that could be
<del> * transformed to one of the two optimized versions seen here.
<del> */
<del>var curryOnly = function(func, val, context) {
<del> if (!func) {
<del> return null;
<del> }
<del> return function() {
<del> return func.call(context, val);
<del> };
<del>};
<del>
<del>module.exports = curryOnly;
<ide><path>src/utils/eachKeyVal.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @providesModule eachKeyVal
<del> */
<del>
<del>"use strict";
<del>
<del>/**
<del> * Invokes fun for each own property in obj. Invokes `fun(key, val, obj, i)`.
<del> * @param {?Object} obj The object to iterate over.
<del> * @param {?Function} fun The function to invoke.
<del> * @param {?context=} context The context to call from.
<del> */
<del>function eachKeyVal(obj, fun, context) {
<del> if (!obj || !fun) {
<del> return;
<del> }
<del> // Object.keys only returns the "own" properties.
<del> var objKeys = Object.keys(obj);
<del> var i;
<del> for (i=0; i < objKeys.length; i++) {
<del> fun.call(context, objKeys[i], obj[objKeys[i]], obj, i);
<del> }
<del>}
<del>
<del>module.exports = eachKeyVal;
<ide><path>src/utils/objFilter.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @providesModule objFilter
<del> */
<del>
<del>"use strict";
<del>
<del>/**
<del> * For each key/value pair, invokes callback func and constructs a resulting
<del> * object which contains each key/value pair which produces a truthy result
<del> * from invoking the function:
<del> *
<del> * func(value, key, iteration)
<del> *
<del> * @param {?object} obj Object to map keys over
<del> * @param {function} func Invoked for each key/val pair.
<del> * @param {?*} context
<del> * @return {?object} Result of filtering or null if obj is falsey
<del> */
<del>function objFilter(obj, func, context) {
<del> if (!obj) {
<del> return null;
<del> }
<del> var i = 0;
<del> var ret = {};
<del> for (var key in obj) {
<del> if (obj.hasOwnProperty(key) &&
<del> func.call(context, obj[key], key, i++)) {
<del> ret[key] = obj[key];
<del> }
<del> }
<del> return ret;
<del>}
<del>
<del>module.exports = objFilter;
<ide><path>src/utils/objMap.js
<del>/**
<del> * Copyright 2013 Facebook, Inc.
<del> *
<del> * Licensed under the Apache License, Version 2.0 (the "License");
<del> * you may not use this file except in compliance with the License.
<del> * You may obtain a copy of the License at
<del> *
<del> * http://www.apache.org/licenses/LICENSE-2.0
<del> *
<del> * Unless required by applicable law or agreed to in writing, software
<del> * distributed under the License is distributed on an "AS IS" BASIS,
<del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<del> * See the License for the specific language governing permissions and
<del> * limitations under the License.
<del> *
<del> * @providesModule objMap
<del> */
<del>
<del>"use strict";
<del>
<del>/**
<del> * For each key/value pair, invokes callback func and constructs a resulting
<del> * object which contains, for every key in obj, values that are the result of
<del> * of invoking the function:
<del> *
<del> * func(value, key, iteration)
<del> *
<del> * @param {?object} obj Object to map keys over
<del> * @param {function} func Invoked for each key/val pair.
<del> * @param {?*} context
<del> * @return {?object} Result of mapping or null if obj is falsey
<del> */
<del>function objMap(obj, func, context) {
<del> if (!obj) {
<del> return null;
<del> }
<del> var i = 0;
<del> var ret = {};
<del> for (var key in obj) {
<del> if (obj.hasOwnProperty(key)) {
<del> ret[key] = func.call(context, obj[key], key, i++);
<del> }
<del> }
<del> return ret;
<del>}
<del>
<del>module.exports = objMap; | 7 |
Javascript | Javascript | add zbnf app to showcase | 0b22d09366b6278b64a639a8ad8647ecc7d4b748 | <ide><path>website/src/react-native/showcase.js
<ide> var apps = [
<ide> link: 'https://itunes.apple.com/us/app/yazboz-batak-esli-batak-okey/id1048620855?ls=1&mt=8',
<ide> author: 'Melih Mucuk',
<ide> },
<add> {
<add> name: 'ZBNF - Zero Budget Natural Farming',
<add> icon: 'https://lh3.googleusercontent.com/gnEBtkUTy89wgbRlEmbETJN9qzHgAAkcvCknWhZbomDRexFAjkU8W-DQFtFygTGeLtA=w300-rw',
<add> link: 'https://play.google.com/store/apps/details?id=com.zbnf',
<add> author: 'Chandra Sekhar Kode',
<add> },
<ide> {
<ide> name: '天才段子手',
<ide> icon: 'http://pp.myapp.com/ma_icon/0/icon_12236104_1451810987/96', | 1 |
Javascript | Javascript | fix missing reuturn in collectionview docs | 47ff6316a2a00e8ddd375f7c9a009797b051be43 | <ide><path>packages/ember-views/lib/views/collection_view.js
<ide> var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
<ide> } else {
<ide> viewClass = App.SongView;
<ide> }
<del> this._super(viewClass, attrs);
<add> return this._super(viewClass, attrs);
<ide> }
<ide> });
<ide> ``` | 1 |
PHP | PHP | remove specific php5.5 code | 83add78952e6ab790477310b60cf9f36dfd0dfcb | <ide><path>src/Network/Socket.php
<ide> protected function _setSslContext($host)
<ide> if (!isset($this->_config['context']['ssl']['SNI_enabled'])) {
<ide> $this->_config['context']['ssl']['SNI_enabled'] = true;
<ide> }
<del> if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
<del> if (empty($this->_config['context']['ssl']['peer_name'])) {
<del> $this->_config['context']['ssl']['peer_name'] = $host;
<del> }
<del> } else {
<del> if (empty($this->_config['context']['ssl']['SNI_server_name'])) {
<del> $this->_config['context']['ssl']['SNI_server_name'] = $host;
<del> }
<add> if (empty($this->_config['context']['ssl']['peer_name'])) {
<add> $this->_config['context']['ssl']['peer_name'] = $host;
<ide> }
<ide> if (empty($this->_config['context']['ssl']['cafile'])) {
<ide> $dir = dirname(dirname(__DIR__));
<ide><path>tests/TestCase/Database/Driver/SqliteTest.php
<ide> public static function schemaValueProvider()
<ide> public function testSchemaValue($input, $expected)
<ide> {
<ide> $driver = new Sqlite();
<del> $pdo = PDO::class;
<del> if (version_compare(PHP_VERSION, '5.6', '<')) {
<del> $pdo = 'FakePdo';
<del> }
<del> $mock = $this->getMockBuilder($pdo)
<add> $mock = $this->getMockBuilder(PDO::class)
<ide> ->setMethods(['quote', 'quoteIdentifier'])
<ide> ->disableOriginalConstructor()
<ide> ->getMock();
<ide><path>tests/TestCase/Database/Schema/MysqlSchemaTest.php
<ide> public function testDescribeJson()
<ide> protected function _getMockedDriver()
<ide> {
<ide> $driver = new Mysql();
<del> $pdo = PDO::class;
<del> if (version_compare(PHP_VERSION, '5.6', '<')) {
<del> $pdo = 'FakePdo';
<del> }
<del> $mock = $this->getMockBuilder($pdo)
<add> $mock = $this->getMockBuilder(PDO::class)
<ide> ->setMethods(['quote', 'quoteIdentifier', 'getAttribute'])
<ide> ->disableOriginalConstructor()
<ide> ->getMock();
<ide><path>tests/TestCase/Database/Schema/PostgresSchemaTest.php
<ide> public function testTruncateSql()
<ide> protected function _getMockedDriver()
<ide> {
<ide> $driver = new Postgres();
<del> $pdo = PDO::class;
<del> if (version_compare(PHP_VERSION, '5.6', '<')) {
<del> $pdo = 'FakePdo';
<del> }
<del> $mock = $this->getMockBuilder($pdo)
<add> $mock = $this->getMockBuilder(PDO::class)
<ide> ->setMethods(['quote'])
<ide> ->disableOriginalConstructor()
<ide> ->getMock();
<ide><path>tests/TestCase/Database/Schema/SqliteSchemaTest.php
<ide> public function testTruncateSqlNoSequences()
<ide> protected function _getMockedDriver()
<ide> {
<ide> $driver = new Sqlite();
<del> $pdo = PDO::class;
<del> if (version_compare(PHP_VERSION, '5.6', '<')) {
<del> $pdo = 'FakePdo';
<del> }
<del> $mock = $this->getMockBuilder($pdo)
<add> $mock = $this->getMockBuilder(PDO::class)
<ide> ->setMethods(['quote', 'prepare'])
<ide> ->disableOriginalConstructor()
<ide> ->getMock();
<ide><path>tests/TestCase/Database/Schema/SqlserverSchemaTest.php
<ide> public function testTruncateSql()
<ide> protected function _getMockedDriver()
<ide> {
<ide> $driver = new Sqlserver();
<del> $pdo = PDO::class;
<del> if (version_compare(PHP_VERSION, '5.6', '<')) {
<del> $pdo = 'FakePdo';
<del> }
<del> $mock = $this->getMockBuilder($pdo)
<add> $mock = $this->getMockBuilder(PDO::class)
<ide> ->setMethods(['quote'])
<ide> ->disableOriginalConstructor()
<ide> ->getMock();
<ide><path>tests/TestCase/Event/EventManagerTest.php
<ide> public function testDispatchWithKeyName()
<ide> */
<ide> public function testDispatchReturnValue()
<ide> {
<del> $this->skipIf(
<del> version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<'),
<del> 'These tests fail in PHPUnit 3.6'
<del> );
<ide> $manager = new EventManager;
<ide> $listener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener')
<ide> ->getMock();
<ide> public function testDispatchReturnValue()
<ide> */
<ide> public function testDispatchFalseStopsEvent()
<ide> {
<del> $this->skipIf(
<del> version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<'),
<del> 'These tests fail in PHPUnit 3.6'
<del> );
<del>
<ide> $manager = new EventManager();
<ide> $listener = $this->getMockBuilder(__NAMESPACE__ . '\EventTestListener')
<ide> ->getMock(); | 7 |
PHP | PHP | allow whitespaces between tags in asserttags() | b7ec7dbbad6c73f5a6e19b0da9e85f0992a0257c | <ide><path>cake/tests/lib/cake_test_case.php
<ide> function loadFixtures() {
<ide> * )
<ide> *
<ide> * Important: This function is very forgiving about whitespace and also accepts any permutation of attribute order.
<add> * It will also allow whitespaces between specified tags.
<ide> *
<ide> * @param string $string An HTML/XHTML/XML string
<ide> * @param string $expected An array, see above
<ide> function assertTags($string, $expected, $message = '%s') {
<ide> $regex[] = '[\s]*\/?[\s]*>[^<>]*';
<ide> }
<ide> }
<del> $regex = '/^'.join('', $regex).'/Us';
<add> $regex = '/^'.join('\s*', $regex).'/Us';
<ide> return $this->assertPattern($regex, $string, $message);
<ide> }
<ide> /** | 1 |
Text | Text | add syscalls we purposely block to docs | 52f32818df8bad647e4c331878fa44317e724939 | <ide><path>docs/security/seccomp.md
<ide> containers with seccomp. It is moderately protective while
<ide> providing wide application compatibility.
<ide>
<ide>
<del>Overriding the default profile for a container
<del>----------------------------------------------
<add>### Overriding the default profile for a container
<ide>
<ide> You can pass `unconfined` to run a container without the default seccomp
<ide> profile.
<ide> profile.
<ide> $ docker run --rm -it --security-opt seccomp:unconfined debian:jessie \
<ide> unshare --map-root-user --user sh -c whoami
<ide> ```
<add>
<add>### Syscalls blocked by the default profile
<add>
<add>Docker's default seccomp profile is a whitelist which specifies the calls that
<add>are allowed. The table below lists the significant (but not all) syscalls that
<add>are effectively blocked because they are not on the whitelist. The table includes
<add>the reason each syscall is blocked rather than white-listed.
<add>
<add>| Syscall | Description |
<add>|---------------------|---------------------------------------------------------------------------------------------------------------------------------------|
<add>| `acct` | Accounting syscall which could let containers disable their own resource limits or process accounting. Also gated by `CAP_SYS_PACCT`. |
<add>| `add_key` | Prevent containers from using the kernel keyring, which is not namespaced. |
<add>| `adjtimex` | Similar to `clock_settime` and `settimeofday`, time/date is not namespaced. |
<add>| `bpf` | Deny loading potentially persistent bpf programs into kernel, already gated by `CAP_SYS_ADMIN`. |
<add>| `clock_adjtime` | Time/date is not namespaced. |
<add>| `clock_settime` | Time/date is not namespaced. |
<add>| `clone` | Deny cloning new namespaces. Also gated by `CAP_SYS_ADMIN` for CLONE_* flags, except `CLONE_USERNS`. |
<add>| `create_module` | Deny manipulation and functions on kernel modules. |
<add>| `delete_module` | Deny manipulation and functions on kernel modules. Also gated by `CAP_SYS_MODULE`. |
<add>| `finit_module` | Deny manipulation and functions on kernel modules. Also gated by `CAP_SYS_MODULE`. |
<add>| `get_kernel_syms` | Deny retrieval of exported kernel and module symbols. |
<add>| `get_mempolicy` | Syscall that modifies kernel memory and NUMA settings. Already gated by `CAP_SYS_NICE`. |
<add>| `init_module` | Deny manipulation and functions on kernel modules. Also gated by `CAP_SYS_MODULE`. |
<add>| `ioperm` | Prevent containers from modifying kernel I/O privilege levels. Already gated by `CAP_SYS_RAWIO`. |
<add>| `iopl` | Prevent containers from modifying kernel I/O privilege levels. Already gated by `CAP_SYS_RAWIO`. |
<add>| `kcmp` | Restrict process inspection capabilities, already blocked by dropping `CAP_PTRACE`. |
<add>| `kexec_file_load` | Sister syscall of `kexec_load` that does the same thing, slightly different arguments. |
<add>| `kexec_load` | Deny loading a new kernel for later execution. |
<add>| `keyctl` | Prevent containers from using the kernel keyring, which is not namespaced. |
<add>| `lookup_dcookie` | Tracing/profiling syscall, which could leak a lot of information on the host. |
<add>| `mbind` | Syscall that modifies kernel memory and NUMA settings. Already gated by `CAP_SYS_NICE`. |
<add>| `modify_ldt` | Old syscall only used in 16-bit code and a potential information leak. |
<add>| `mount` | Deny mounting, already gated by `CAP_SYS_ADMIN`. |
<add>| `move_pages` | Syscall that modifies kernel memory and NUMA settings. |
<add>| `name_to_handle_at` | Sister syscall to `open_by_handle_at`. Already gated by `CAP_SYS_NICE`. |
<add>| `nfsservctl` | Deny interaction with the kernel nfs daemon. |
<add>| `open_by_handle_at` | Cause of an old container breakout. Also gated by `CAP_DAC_READ_SEARCH`. |
<add>| `perf_event_open` | Tracing/profiling syscall, which could leak a lot of information on the host. |
<add>| `personality` | Prevent container from enabling BSD emulation. Not inherently dangerous, but poorly tested, potential for a lot of kernel vulns. |
<add>| `pivot_root` | Deny `pivot_root`, should be privileged operation. |
<add>| `process_vm_readv` | Restrict process inspection capabilities, already blocked by dropping `CAP_PTRACE`. |
<add>| `process_vm_writev` | Restrict process inspection capabilities, already blocked by dropping `CAP_PTRACE`. |
<add>| `ptrace` | Tracing/profiling syscall, which could leak a lot of information on the host. Already blocked by dropping `CAP_PTRACE`. |
<add>| `query_module` | Deny manipulation and functions on kernel modules. |
<add>| `quotactl` | Quota syscall which could let containers disable their own resource limits or process accounting. Also gated by `CAP_SYS_ADMIN`. |
<add>| `reboot` | Don't let containers reboot the host. Also gated by `CAP_SYS_BOOT`. |
<add>| `restart_syscall` | Don't allow containers to restart a syscall. Possible seccomp bypass see: https://code.google.com/p/chromium/issues/detail?id=408827. |
<add>| `request_key` | Prevent containers from using the kernel keyring, which is not namespaced. |
<add>| `set_mempolicy` | Syscall that modifies kernel memory and NUMA settings. Already gated by `CAP_SYS_NICE`. |
<add>| `setns` | Deny associating a thread with a namespace. Also gated by `CAP_SYS_ADMIN`. |
<add>| `settimeofday` | Time/date is not namespaced. Also gated by `CAP_SYS_TIME`. |
<add>| `stime` | Time/date is not namespaced. Also gated by `CAP_SYS_TIME`. |
<add>| `swapon` | Deny start/stop swapping to file/device. Also gated by `CAP_SYS_ADMIN`. |
<add>| `swapoff` | Deny start/stop swapping to file/device. Also gated by `CAP_SYS_ADMIN`. |
<add>| `sysfs` | Obsolete syscall. |
<add>| `_sysctl` | Obsolete, replaced by /proc/sys. |
<add>| `umount` | Should be a privileged operation. Also gated by `CAP_SYS_ADMIN`. |
<add>| `umount2` | Should be a privileged operation. |
<add>| `unshare` | Deny cloning new namespaces for processes. Also gated by `CAP_SYS_ADMIN`, with the exception of `unshare --user`. |
<add>| `uselib` | Older syscall related to shared libraries, unused for a long time. |
<add>| `ustat` | Obsolete syscall. |
<add>| `vm86` | In kernel x86 real mode virtual machine. Also gated by `CAP_SYS_ADMIN`. |
<add>| `vm86old` | In kernel x86 real mode virtual machine. Also gated by `CAP_SYS_ADMIN`. | | 1 |
Go | Go | remove unused 'transfered' variable | 34175eb47ef5de023b68cef5af529b74c68b3ab3 | <ide><path>pkg/proxy/tcp_proxy.go
<ide> package proxy
<ide> import (
<ide> "io"
<ide> "net"
<add> "sync"
<ide> "syscall"
<ide>
<ide> "github.com/Sirupsen/logrus"
<ide> func (proxy *TCPProxy) clientLoop(client *net.TCPConn, quit chan bool) {
<ide> return
<ide> }
<ide>
<del> event := make(chan int64)
<add> var wg sync.WaitGroup
<ide> var broker = func(to, from *net.TCPConn) {
<del> written, err := io.Copy(to, from)
<del> if err != nil {
<add> if _, err := io.Copy(to, from); err != nil {
<ide> // If the socket we are writing to is shutdown with
<ide> // SHUT_WR, forward it to the other end of the pipe:
<ide> if err, ok := err.(*net.OpError); ok && err.Err == syscall.EPIPE {
<ide> from.CloseWrite()
<ide> }
<ide> }
<ide> to.CloseRead()
<del> event <- written
<add> wg.Done()
<ide> }
<ide>
<add> wg.Add(2)
<ide> go broker(client, backend)
<ide> go broker(backend, client)
<ide>
<del> var transferred int64
<del> for i := 0; i < 2; i++ {
<del> select {
<del> case written := <-event:
<del> transferred += written
<del> case <-quit:
<del> // Interrupt the two brokers and "join" them.
<del> client.Close()
<del> backend.Close()
<del> for ; i < 2; i++ {
<del> transferred += <-event
<del> }
<del> return
<del> }
<add> finish := make(chan struct{})
<add> go func() {
<add> wg.Wait()
<add> close(finish)
<add> }()
<add>
<add> select {
<add> case <-quit:
<add> case <-finish:
<ide> }
<ide> client.Close()
<ide> backend.Close()
<add> <-finish
<ide> }
<ide>
<ide> // Run starts forwarding the traffic using TCP. | 1 |
PHP | PHP | pass connection name to query event. closes | 6f690e84b35891c97d21d264fa5c308885007652 | <ide><path>src/Illuminate/Database/Connection.php
<ide> public function logQuery($query, $bindings, $time = null)
<ide> {
<ide> if (isset($this->events))
<ide> {
<del> $this->events->fire('illuminate.query', array($query, $bindings, $time));
<add> $this->events->fire('illuminate.query', array($query, $bindings, $time, $this->getName()));
<ide> }
<ide>
<ide> if ( ! $this->loggingQueries) return;
<ide><path>tests/Database/DatabaseConnectionTest.php
<ide> public function testLogQueryFiresEventsIfSet()
<ide> $connection = $this->getMockConnection();
<ide> $connection->logQuery('foo', array(), time());
<ide> $connection->setEventDispatcher($events = m::mock('Illuminate\Events\Dispatcher'));
<del> $events->shouldReceive('fire')->once()->with('illuminate.query', array('foo', array(), null));
<add> $events->shouldReceive('fire')->once()->with('illuminate.query', array('foo', array(), null, null));
<ide> $connection->logQuery('foo', array(), null);
<ide> }
<ide> | 2 |
Javascript | Javascript | add spec for androidtoast | 08efb1d73b73073cb8509bd5fe0189189d31392c | <ide><path>Libraries/Components/ToastAndroid/NativeToastAndroid.js
<add>/**
<add> * Copyright (c) Facebook, Inc. and its affiliates.
<add> *
<add> * This source code is licensed under the MIT license found in the
<add> * LICENSE file in the root directory of this source tree.
<add> *
<add> * @flow
<add> * @format
<add> */
<add>
<add>'use strict';
<add>
<add>import type {TurboModule} from 'RCTExport';
<add>import * as TurboModuleRegistry from 'TurboModuleRegistry';
<add>
<add>export interface Spec extends TurboModule {
<add> +getConstants: () => {|
<add> SHORT: number,
<add> LONG: number,
<add> TOP: number,
<add> BOTTOM: number,
<add> CENTER: number,
<add> |};
<add> +show: (message: string, duration: number) => void;
<add> +showWithGravity: (
<add> message: string,
<add> duration: number,
<add> gravity: number,
<add> ) => void;
<add> +showWithGravityAndOffset: (
<add> message: string,
<add> duration: number,
<add> gravity: number,
<add> xOffset: number,
<add> yOffset: number,
<add> ) => void;
<add>}
<add>
<add>export default TurboModuleRegistry.getEnforcing<Spec>('ToastAndroid');
<ide><path>Libraries/Components/ToastAndroid/ToastAndroid.android.js
<ide> */
<ide>
<ide> 'use strict';
<del>
<del>const RCTToastAndroid = require('../../BatchedBridge/NativeModules')
<del> .ToastAndroid;
<add>import NativeToastAndroid from './NativeToastAndroid';
<ide>
<ide> /**
<ide> * This exposes the native ToastAndroid module as a JS module. This has a function 'show'
<ide> const RCTToastAndroid = require('../../BatchedBridge/NativeModules')
<ide>
<ide> const ToastAndroid = {
<ide> // Toast duration constants
<del> SHORT: RCTToastAndroid.SHORT,
<del> LONG: RCTToastAndroid.LONG,
<del>
<add> SHORT: NativeToastAndroid.getConstants().SHORT,
<add> LONG: NativeToastAndroid.getConstants().LONG,
<ide> // Toast gravity constants
<del> TOP: RCTToastAndroid.TOP,
<del> BOTTOM: RCTToastAndroid.BOTTOM,
<del> CENTER: RCTToastAndroid.CENTER,
<add> TOP: NativeToastAndroid.getConstants().TOP,
<add> BOTTOM: NativeToastAndroid.getConstants().BOTTOM,
<add> CENTER: NativeToastAndroid.getConstants().CENTER,
<ide>
<ide> show: function(message: string, duration: number): void {
<del> RCTToastAndroid.show(message, duration);
<add> NativeToastAndroid.show(message, duration);
<ide> },
<ide>
<ide> showWithGravity: function(
<ide> message: string,
<ide> duration: number,
<ide> gravity: number,
<ide> ): void {
<del> RCTToastAndroid.showWithGravity(message, duration, gravity);
<add> NativeToastAndroid.showWithGravity(message, duration, gravity);
<ide> },
<ide>
<ide> showWithGravityAndOffset: function(
<ide> const ToastAndroid = {
<ide> xOffset: number,
<ide> yOffset: number,
<ide> ): void {
<del> RCTToastAndroid.showWithGravityAndOffset(
<add> NativeToastAndroid.showWithGravityAndOffset(
<ide> message,
<ide> duration,
<ide> gravity,
<ide><path>Libraries/Components/ToastAndroid/ToastAndroid.ios.js
<ide> const ToastAndroid = {
<ide> show: function(message: string, duration: number): void {
<ide> warning(false, 'ToastAndroid is not supported on this platform.');
<ide> },
<add>
<add> showWithGravity: function(
<add> message: string,
<add> duration: number,
<add> gravity: number,
<add> ): void {
<add> warning(false, 'ToastAndroid is not supported on this platform.');
<add> },
<add>
<add> showWithGravityAndOffset: function(
<add> message: string,
<add> duration: number,
<add> gravity: number,
<add> xOffset: number,
<add> yOffset: number,
<add> ): void {
<add> warning(false, 'ToastAndroid is not supported on this platform.');
<add> },
<ide> };
<ide>
<ide> module.exports = ToastAndroid; | 3 |
Text | Text | improve the changelog entry [ci skip] | d150387a38b3dc4ef091956352c654c3941a985a | <ide><path>activerecord/CHANGELOG.md
<del>* db:test:clone and db:test:prepare must load Rails environment
<add>* `db:test:clone` and `db:test:prepare` must load Rails environment.
<ide>
<del> db:test:clone and db:test:prepare use ActiveRecord::Base. configurations,
<del> so we need to load the rails environment, otherwise the config wont be in place.
<add> `db:test:clone` and `db:test:prepare` use `ActiveRecord::Base`. configurations,
<add> so we need to load the Rails environment, otherwise the config wont be in place.
<ide>
<ide> *arthurnn*
<ide> | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.