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
Text
Text
fix missing newline
942a0f994f1c6da840086cbcd2933e23521a2953
<ide><path>docs/installation/ubuntulinux.md <ide> your kernel version: <ide> >run Docker, see the prerequisites on this page that apply to your Ubuntu <ide> >version. <ide> <add> <ide> ### For Trusty 14.04 <ide> <ide> There are no prerequisites for this version.
1
Mixed
Go
fix docker exec command help messages
d8b17d785a03246cb3a081223a0242469af7d410
<ide><path>api/client/commands.go <ide> func (cli *DockerCli) CmdLoad(args ...string) error { <ide> } <ide> <ide> func (cli *DockerCli) CmdExec(args ...string) error { <del> cmd := cli.Subcmd("exec", "CONTAINER COMMAND [ARG...]", "Run a command in an existing container") <add> cmd := cli.Subcmd("exec", "CONTAINER COMMAND [ARG...]", "Run a command in a running container") <ide> <ide> execConfig, err := runconfig.ParseExec(cmd, args) <ide> if err != nil { <ide><path>daemon/execdriver/driver.go <ide> type TtyTerminal interface { <ide> <ide> type Driver interface { <ide> Run(c *Command, pipes *Pipes, startCallback StartCallback) (int, error) // Run executes the process and blocks until the process exits and returns the exit code <del> // Exec executes the process in an existing container, blocks until the process exits and returns the exit code <add> // Exec executes the process in a running container, blocks until the process exits and returns the exit code <ide> Exec(c *Command, processConfig *ProcessConfig, pipes *Pipes, startCallback StartCallback) (int, error) <ide> Kill(c *Command, sig int) error <ide> Pause(c *Command) error <ide><path>docker/flags.go <ide> func init() { <ide> {"create", "Create a new container"}, <ide> {"diff", "Inspect changes on a container's filesystem"}, <ide> {"events", "Get real time events from the server"}, <del> {"exec", "Run a command in an existing container"}, <add> {"exec", "Run a command in a running container"}, <ide> {"export", "Stream the contents of a container as a tar archive"}, <ide> {"history", "Show the history of an image"}, <ide> {"images", "List images"}, <ide><path>docs/sources/reference/commandline/cli.md <ide> You'll need two shells for this example. <ide> <ide> Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] <ide> <del> Run a command in an existing container <add> Run a command in a running container <ide> <ide> -d, --detach=false Detached mode: run command in the background <ide> -i, --interactive=false Keep STDIN open even if not attached
4
Text
Text
fix user doc
e89cb9a5e0105afbb0c1ba1176bda07d110295bc
<ide><path>docs/sources/reference/builder.md <ide> instructions via the Docker client, refer to [*Share Directories via Volumes*]( <ide> <ide> USER daemon <ide> <del>The `USER` instruction sets the username or UID to use when running the image. <add>The `USER` instruction sets the username or UID to use when running the image <add>and for any following `RUN` directives. <ide> <ide> ## WORKDIR <ide>
1
Javascript
Javascript
avoid conditions where control flow is sufficient
dbe9e732af1f12757a55adb12a8279d7db898b60
<ide><path>packages/react-reconciler/src/ReactFiberCommitWork.new.js <ide> function commitPlacement(finishedWork: Fiber): void { <ide> const parentFiber = getHostParentFiber(finishedWork); <ide> <ide> // Note: these two variables *must* always be updated together. <del> let parent; <del> let isContainer; <del> const parentStateNode = parentFiber.stateNode; <ide> switch (parentFiber.tag) { <del> case HostComponent: <del> parent = parentStateNode; <del> isContainer = false; <add> case HostComponent: { <add> const parent: Instance = parentFiber.stateNode; <add> if (parentFiber.flags & ContentReset) { <add> // Reset the text content of the parent before doing any insertions <add> resetTextContent(parent); <add> // Clear ContentReset from the effect tag <add> parentFiber.flags &= ~ContentReset; <add> } <add> <add> const before = getHostSibling(finishedWork); <add> // We only have the top Fiber that was inserted but we need to recurse down its <add> // children to find all the terminal nodes. <add> insertOrAppendPlacementNode(finishedWork, before, parent); <ide> break; <add> } <ide> case HostRoot: <del> parent = parentStateNode.containerInfo; <del> isContainer = true; <del> break; <del> case HostPortal: <del> parent = parentStateNode.containerInfo; <del> isContainer = true; <add> case HostPortal: { <add> const parent: Container = parentFiber.stateNode.containerInfo; <add> const before = getHostSibling(finishedWork); <add> insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent); <ide> break; <add> } <ide> // eslint-disable-next-line-no-fallthrough <ide> default: <ide> throw new Error( <ide> 'Invalid host parent fiber. This error is likely caused by a bug ' + <ide> 'in React. Please file an issue.', <ide> ); <ide> } <del> if (parentFiber.flags & ContentReset) { <del> // Reset the text content of the parent before doing any insertions <del> resetTextContent(parent); <del> // Clear ContentReset from the effect tag <del> parentFiber.flags &= ~ContentReset; <del> } <del> <del> const before = getHostSibling(finishedWork); <del> // We only have the top Fiber that was inserted but we need to recurse down its <del> // children to find all the terminal nodes. <del> if (isContainer) { <del> insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent); <del> } else { <del> insertOrAppendPlacementNode(finishedWork, before, parent); <del> } <ide> } <ide> <ide> function insertOrAppendPlacementNodeIntoContainer( <ide><path>packages/react-reconciler/src/ReactFiberCommitWork.old.js <ide> function commitPlacement(finishedWork: Fiber): void { <ide> const parentFiber = getHostParentFiber(finishedWork); <ide> <ide> // Note: these two variables *must* always be updated together. <del> let parent; <del> let isContainer; <del> const parentStateNode = parentFiber.stateNode; <ide> switch (parentFiber.tag) { <del> case HostComponent: <del> parent = parentStateNode; <del> isContainer = false; <add> case HostComponent: { <add> const parent: Instance = parentFiber.stateNode; <add> if (parentFiber.flags & ContentReset) { <add> // Reset the text content of the parent before doing any insertions <add> resetTextContent(parent); <add> // Clear ContentReset from the effect tag <add> parentFiber.flags &= ~ContentReset; <add> } <add> <add> const before = getHostSibling(finishedWork); <add> // We only have the top Fiber that was inserted but we need to recurse down its <add> // children to find all the terminal nodes. <add> insertOrAppendPlacementNode(finishedWork, before, parent); <ide> break; <add> } <ide> case HostRoot: <del> parent = parentStateNode.containerInfo; <del> isContainer = true; <del> break; <del> case HostPortal: <del> parent = parentStateNode.containerInfo; <del> isContainer = true; <add> case HostPortal: { <add> const parent: Container = parentFiber.stateNode.containerInfo; <add> const before = getHostSibling(finishedWork); <add> insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent); <ide> break; <add> } <ide> // eslint-disable-next-line-no-fallthrough <ide> default: <ide> throw new Error( <ide> 'Invalid host parent fiber. This error is likely caused by a bug ' + <ide> 'in React. Please file an issue.', <ide> ); <ide> } <del> if (parentFiber.flags & ContentReset) { <del> // Reset the text content of the parent before doing any insertions <del> resetTextContent(parent); <del> // Clear ContentReset from the effect tag <del> parentFiber.flags &= ~ContentReset; <del> } <del> <del> const before = getHostSibling(finishedWork); <del> // We only have the top Fiber that was inserted but we need to recurse down its <del> // children to find all the terminal nodes. <del> if (isContainer) { <del> insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent); <del> } else { <del> insertOrAppendPlacementNode(finishedWork, before, parent); <del> } <ide> } <ide> <ide> function insertOrAppendPlacementNodeIntoContainer(
2
Ruby
Ruby
reduce duplication for mime type regexps
c5fce2c2247aef465beae0069b4cfdacb6e7fb02
<ide><path>actionpack/lib/action_dispatch/http/mime_type.rb <ide> def unregister(symbol) <ide> attr_reader :hash <ide> <ide> MIME_NAME = "[a-zA-Z0-9][a-zA-Z0-9#{Regexp.escape('!#$&-^_.+')}]{0,126}" <del> MIME_PARAMETER_KEY = "[a-zA-Z0-9][a-zA-Z0-9#{Regexp.escape('!#$&-^_.+')}]{0,126}" <del> MIME_PARAMETER_VALUE = "#{Regexp.escape('"')}?[a-zA-Z0-9][a-zA-Z0-9#{Regexp.escape('!#$&-^_.+')}]{0,126}#{Regexp.escape('"')}?" <del> MIME_PARAMETER = "\s*\;\s*#{MIME_PARAMETER_KEY}(?:\=#{MIME_PARAMETER_VALUE})?" <add> MIME_PARAMETER_VALUE = "#{Regexp.escape('"')}?#{MIME_NAME}#{Regexp.escape('"')}?" <add> MIME_PARAMETER = "\s*\;\s*#{MIME_NAME}(?:\=#{MIME_PARAMETER_VALUE})?" <ide> MIME_REGEXP = /\A(?:\*\/\*|#{MIME_NAME}\/(?:\*|#{MIME_NAME})(?>\s*#{MIME_PARAMETER}\s*)*)\z/ <ide> <ide> class InvalidMimeType < StandardError; end
1
Python
Python
add a data_format flag to the models + other fixes
487d18e233ad7ddf225f05298ba5c150bb4c886b
<ide><path>official/mnist/mnist.py <ide> parser.add_argument('--model_dir', type=str, default='/tmp/mnist_model', <ide> help='The directory where the model will be stored.') <ide> <del>parser.add_argument('--steps', type=int, default=20000, <del> help='Number of steps to train.') <add>parser.add_argument('--train_epochs', type=int, default=40, <add> help='Number of epochs to train.') <add> <add>parser.add_argument( <add> '--data_format', type=str, default=None, <add> choices=['channels_first', 'channels_last'], <add> help='A flag to override the data format used in the model. channels_first ' <add> 'provides a performance boost on GPU but is not always compatible ' <add> 'with CPU. If left unspecified, the data format will be chosen ' <add> 'automatically based on whether TensorFlow was built for CPU or GPU.') <add> <add>_NUM_IMAGES = { <add> 'train': 50000, <add> 'validation': 10000, <add>} <ide> <ide> <ide> def input_fn(mode, batch_size=1): <ide> def mnist_model(inputs, mode): <ide> # Reshape X to 4-D tensor: [batch_size, width, height, channels] <ide> # MNIST images are 28x28 pixels, and have one color channel <ide> inputs = tf.reshape(inputs, [-1, 28, 28, 1]) <del> data_format = 'channels_last' <add> data_format = FLAGS.data_format <ide> <del> if tf.test.is_built_with_cuda(): <add> if data_format is None: <ide> # When running on GPU, transpose the data from channels_last (NHWC) to <ide> # channels_first (NCHW) to improve performance. <ide> # See https://www.tensorflow.org/performance/performance_guide#data_formats <del> data_format = 'channels_first' <add> data_format = ('channels_first' if tf.test.is_built_with_cuda() else <add> 'channels_last') <add> <add> if data_format == 'channels_first': <ide> inputs = tf.transpose(inputs, [0, 3, 1, 2]) <ide> <ide> # Convolutional Layer #1 <ide> def main(unused_argv): <ide> logging_hook = tf.train.LoggingTensorHook( <ide> tensors=tensors_to_log, every_n_iter=100) <ide> <add> batches_per_epoch = _NUM_IMAGES['train'] / FLAGS.batch_size <add> <ide> mnist_classifier.train( <ide> input_fn=lambda: input_fn(tf.estimator.ModeKeys.TRAIN, FLAGS.batch_size), <del> steps=FLAGS.steps, <add> steps=FLAGS.train_epochs * batches_per_epoch, <ide> hooks=[logging_hook]) <ide> <ide> # Evaluate the model and print results <ide><path>official/mnist/mnist_test.py <ide> def test_mnist_model_fn_predict_mode(self): <ide> <ide> <ide> if __name__ == '__main__': <add> mnist.FLAGS = mnist.parser.parse_args() <ide> tf.test.main() <ide><path>official/resnet/cifar10_main.py <ide> help='The number of epochs to train.') <ide> <ide> parser.add_argument('--epochs_per_eval', type=int, default=10, <del> help='The number of batches to run in between evaluations.') <add> help='The number of epochs to run in between evaluations.') <ide> <ide> parser.add_argument('--batch_size', type=int, default=128, <ide> help='The number of images per batch.') <ide> <add>parser.add_argument( <add> '--data_format', type=str, default=None, <add> choices=['channels_first', 'channels_last'], <add> help='A flag to override the data format used in the model. channels_first ' <add> 'provides a performance boost on GPU but is not always compatible ' <add> 'with CPU. If left unspecified, the data format will be chosen ' <add> 'automatically based on whether TensorFlow was built for CPU or GPU.') <add> <ide> _HEIGHT = 32 <ide> _WIDTH = 32 <ide> _DEPTH = 3 <ide> def cifar10_model_fn(features, labels, mode): <ide> tf.summary.image('images', features, max_outputs=6) <ide> <ide> network = resnet_model.cifar10_resnet_v2_generator( <del> FLAGS.resnet_size, _NUM_CLASSES) <add> FLAGS.resnet_size, _NUM_CLASSES, FLAGS.data_format) <ide> <ide> inputs = tf.reshape(features, [-1, _HEIGHT, _WIDTH, _DEPTH]) <ide> logits = network(inputs, mode == tf.estimator.ModeKeys.TRAIN) <ide><path>official/resnet/imagenet_main.py <ide> '--batch_size', type=int, default=32, <ide> help='Batch size for training and evaluation.') <ide> <add>parser.add_argument( <add> '--data_format', type=str, default=None, <add> choices=['channels_first', 'channels_last'], <add> help='A flag to override the data format used in the model. channels_first ' <add> 'provides a performance boost on GPU but is not always compatible ' <add> 'with CPU. If left unspecified, the data format will be chosen ' <add> 'automatically based on whether TensorFlow was built for CPU or GPU.') <add> <ide> _DEFAULT_IMAGE_SIZE = 224 <ide> _NUM_CHANNELS = 3 <ide> _LABEL_CLASSES = 1001 <ide> def resnet_model_fn(features, labels, mode): <ide> """Our model_fn for ResNet to be used with our Estimator.""" <ide> tf.summary.image('images', features, max_outputs=6) <ide> <del> network = resnet_model.resnet_v2( <del> resnet_size=FLAGS.resnet_size, num_classes=_LABEL_CLASSES) <add> network = resnet_model.imagenet_resnet_v2( <add> FLAGS.resnet_size, _LABEL_CLASSES, FLAGS.data_format) <ide> logits = network( <ide> inputs=features, is_training=(mode == tf.estimator.ModeKeys.TRAIN)) <ide> <ide><path>official/resnet/imagenet_test.py <ide> def reshape(shape): <ide> <ide> with graph.as_default(), self.test_session( <ide> use_gpu=with_gpu, force_gpu=with_gpu): <del> model = resnet_model.resnet_v2( <add> model = resnet_model.imagenet_resnet_v2( <ide> resnet_size, 456, <ide> data_format='channels_first' if with_gpu else 'channels_last') <ide> inputs = tf.random_uniform([1, 224, 224, 3]) <ide><path>official/resnet/resnet_model.py <ide> def model(inputs, is_training): <ide> return model <ide> <ide> <del>def resnet_v2(resnet_size, num_classes, data_format=None): <add>def imagenet_resnet_v2(resnet_size, num_classes, data_format=None): <ide> """Returns the ResNet model for a given size and number of output classes.""" <ide> model_params = { <ide> 18: {'block': building_block, 'layers': [2, 2, 2, 2]},
6
PHP
PHP
add `shared` method to the view facade
93ff6458081256c807913ca63278e6e9abd8dd02
<ide><path>src/Illuminate/Support/Facades/View.php <ide> * @method static array creator(array|string $views, \Closure|string $callback) <ide> * @method static bool exists(string $view) <ide> * @method static mixed share(array|string $key, $value = null) <add> * @method static mixed shared(string $key, $default = null) <ide> * <ide> * @see \Illuminate\View\Factory <ide> */
1
Javascript
Javascript
pass bufferrow and screenrow as numbers
2a1719f337616d192ffa1b2ad06119b0256e6bc4
<ide><path>src/text-editor-component.js <ide> class LineNumberGutterComponent { <ide> if (this.props.onMouseDown == null) { <ide> this.props.rootComponent.didMouseDownOnLineNumberGutter(event) <ide> } else { <del> const {bufferRow, screenRow} = event.target.dataset <del> this.props.onMouseDown({bufferRow, screenRow}) <add> const {bufferRowStr, screenRowStr} = event.target.dataset <add> this.props.onMouseDown({ <add> bufferRow: parseInt(bufferRowStr, 10), <add> screenRow: parseInt(screenRowStr, 10), <add> domEvent: event <add> }) <ide> } <ide> } <ide> <ide> didMouseMove (event) { <ide> if (this.props.onMouseMove != null) { <del> const {bufferRow, screenRow} = event.target.dataset <del> this.props.onMouseMove({bufferRow, screenRow}) <add> const {bufferRowStr, screenRowStr} = event.target.dataset <add> this.props.onMouseDown({ <add> bufferRow: parseInt(bufferRowStr, 10), <add> screenRow: parseInt(screenRowStr, 10), <add> domEvent: event <add> }) <ide> } <ide> } <ide> }
1
Javascript
Javascript
fix calculations in test-worker-resource-limits
51fd5db4c18da2685b3825fb5617f7f968859299
<ide><path>test/parallel/test-worker-resource-limits.js <ide> if (!process.env.HAS_STARTED_WORKER) { <ide> assert.deepStrictEqual(resourceLimits, testResourceLimits); <ide> const array = []; <ide> while (true) { <del> // Leave 10% wiggle room here, and 20% on debug builds. <del> const wiggleRoom = common.buildType === 'Release' ? 1.1 : 1.2; <ide> const usedMB = v8.getHeapStatistics().used_heap_size / 1024 / 1024; <del> assert(usedMB < resourceLimits.maxOldGenerationSizeMb * wiggleRoom); <add> const maxReservedSize = resourceLimits.maxOldGenerationSizeMb + <add> resourceLimits.maxYoungGenerationSizeMb; <add> assert(usedMB < maxReservedSize); <ide> <ide> let seenSpaces = 0; <ide> for (const { space_name, space_size } of v8.getHeapSpaceStatistics()) {
1
Javascript
Javascript
add first api change, not working yet
353a43cb46e34ee82b3458df1138952282973aec
<ide><path>src/api.js <ide> * e.g. No cross domain requests without CORS. <ide> * <ide> * @param {string|TypedAray} source Either a url to a PDF is located or a <del> * typed array already populated with data. <add> * typed array (Uint8Array) already populated with data. <ide> * @return {Promise} A promise that is resolved with {PDFDocumentProxy} object. <ide> */ <del>PDFJS.getDocument = function getDocument(source) { <add>PDFJS.getDocument = function getDocument(source, headers) { <ide> var promise = new PDFJS.Promise(); <ide> var transport = new WorkerTransport(promise); <ide> if (typeof source === 'string') { <ide> PDFJS.getDocument = function getDocument(source) { <ide> error: function getPDFError(e) { <ide> promise.reject('Unexpected server response of ' + <ide> e.target.status + '.'); <del> } <add> }, <add> headers: headers <ide> }, <ide> function getPDFLoad(data) { <ide> transport.sendData(data);
1
PHP
PHP
use correct string
803f00ef4596ba21ff9f5ad284761f75df6659d8
<ide><path>src/Error/Middleware/ErrorHandlerMiddleware.php <ide> public function handleException($exception, $request, $response) <ide> protected function getRenderer($exception) <ide> { <ide> if (!$this->exceptionRenderer) { <del> $this->exceptionRenderer = $this->config('exceptionRender') ?: ExceptionRenderer::class; <add> $this->exceptionRenderer = $this->config('exceptionRenderer') ?: ExceptionRenderer::class; <ide> } <ide> <ide> if (is_string($this->exceptionRenderer)) {
1
Javascript
Javascript
remove hardcoded address from ws example.
c66cafd3625fe469cc2743ff33711f28ac92617e
<ide><path>examples/with-socket.io/pages/index.js <ide> class HomePage extends Component { <ide> <ide> // connect to WS server and listen event <ide> componentDidMount () { <del> this.socket = io('http://localhost:3000/') <add> this.socket = io() <ide> this.socket.on('message', this.handleMessage) <ide> } <ide>
1
PHP
PHP
remove parsedown import
76350b6666b31716e240b08b8cb5fb0158f32d65
<ide><path>src/Illuminate/Notifications/DatabaseNotification.php <ide> <ide> namespace Illuminate\Notifications; <ide> <del>use Parsedown; <ide> use Illuminate\Database\Eloquent\Model; <ide> <ide> class DatabaseNotification extends Model
1
Javascript
Javascript
fix timezone display for logs on ui
e57c7aeda8c5cd9d0f10e2ce46a155ea01181140
<ide><path>airflow/www/static/js/datetime_utils.js <ide> export function updateAllDateTimes() { <ide> const dt = moment($el.attr('datetime')); <ide> // eslint-disable-next-line no-underscore-dangle <ide> if (dt._isValid) { <del> $el.text(dt.format(defaultFormat)); <add> $el.text(dt.format($el.data('with-tz') ? defaultFormatWithTZ : defaultFormat)); <ide> } <ide> if ($el.attr('title') !== undefined) { <ide> // If displayed date is not UTC, have the UTC date in a title attribute <ide><path>airflow/www/static/js/ti_log.js <ide> * under the License. <ide> */ <ide> <del>/* global document, window, $, moment, Airflow */ <add>/* global document, window, $ */ <ide> import { escapeHtml } from './main'; <ide> import { getMetaValue } from './utils'; <ide> import { formatDateTime } from './datetime_utils'; <ide> function autoTailingLog(tryNumber, metadata = null, autoTailing = false) { <ide> <ide> // The message may contain HTML, so either have to escape it or write it as text. <ide> const escapedMessage = escapeHtml(item[1]); <del> const tzOffset = moment().tz(Airflow.serverTimezone).format('Z'); <ide> const linkifiedMessage = escapedMessage <ide> .replace(urlRegex, (url) => `<a href="${url}" target="_blank">${url}</a>`) <del> .replaceAll(dateRegex, (date) => `<time datetime="${date}${tzOffset}">${formatDateTime(`${date}${tzOffset}`)}</time>`); <add> .replaceAll(dateRegex, (date) => `<time datetime="${date}+00:00" data-with-tz="true">${formatDateTime(`${date}+00:00`)}</time>`); <ide> logBlock.innerHTML += `${linkifiedMessage}\n`; <ide> }); <ide>
2
Javascript
Javascript
add dom fixture for autofilled form state
2078aa9a401aa91e97b42cdd36a6310888128ab2
<ide><path>fixtures/dom/src/components/Header.js <ide> class Header extends React.Component { <ide> <option value="/mouse-events">Mouse Events</option> <ide> <option value="/selection-events">Selection Events</option> <ide> <option value="/suspense">Suspense</option> <add> <option value="/form-state">Form State</option> <ide> </select> <ide> </label> <ide> <label htmlFor="global_version"> <ide><path>fixtures/dom/src/components/fixtures/form-state/ControlledFormFixture.js <add>import Fixture from '../../Fixture'; <add>const React = window.React; <add> <add>class ControlledFormFixture extends React.Component { <add> constructor(props) { <add> super(props); <add> this.state = {name: '', email: ''}; <add> <add> this.handleEmailChange = this.handleEmailChange.bind(this); <add> this.handleNameChange = this.handleNameChange.bind(this); <add> } <add> <add> handleEmailChange(event) { <add> this.setState({email: event.target.value}); <add> } <add> <add> handleNameChange(event) { <add> this.setState({name: event.target.value}); <add> } <add> <add> render() { <add> return ( <add> <Fixture> <add> <form> <add> <label> <add> Name: <add> <input <add> type="text" <add> value={this.state.name} <add> onChange={this.handleNameChange} <add> name="name" <add> x-autocompletetype="name" <add> /> <add> </label> <add> <br /> <add> <label> <add> Email: <add> <input <add> type="text" <add> value={this.state.email} <add> onChange={this.handleEmailChange} <add> name="email" <add> x-autocompletetype="email" <add> /> <add> </label> <add> </form> <add> <br /> <add> <div> <add> <span>States</span> <add> <br /> <add> <span>Name: {this.state.name}</span> <add> <br /> <add> <span>Email: {this.state.email}</span> <add> </div> <add> </Fixture> <add> ); <add> } <add>} <add> <add>export default ControlledFormFixture; <ide><path>fixtures/dom/src/components/fixtures/form-state/index.js <add>import FixtureSet from '../../FixtureSet'; <add>import TestCase from '../../TestCase'; <add>import ControlledFormFixture from './ControlledFormFixture'; <add>const React = window.React; <add> <add>export default class FormStateCases extends React.Component { <add> render() { <add> return ( <add> <FixtureSet title="Form State"> <add> <TestCase <add> title="Form state autofills from browser" <add> description="Form start should autofill/autocomplete if user has autocomplete/autofill information saved. The user may need to set-up autofill or autocomplete with their specific browser."> <add> <TestCase.Steps> <add> <li> <add> Set up autofill/autocomplete for your browser. <add> <br /> <add> Instructions: <add> <ul> <add> <li> <add> <SafeLink <add> href="https://support.google.com/chrome/answer/142893?co=GENIE.Platform%3DDesktop&hl=en" <add> text="Google Chrome" <add> /> <add> </li> <add> <li> <add> <SafeLink <add> href="https://support.mozilla.org/en-US/kb/autofill-logins-firefox" <add> text="Mozilla FireFox" <add> /> <add> </li> <add> <li> <add> <SafeLink <add> href="https://support.microsoft.com/en-us/help/4027718/microsoft-edge-automatically-fill-info" <add> text="Microsoft Edge" <add> /> <add> </li> <add> </ul> <add> </li> <add> <li>Click into any input.</li> <add> <li>Select any autofill option.</li> <add> </TestCase.Steps> <add> <TestCase.ExpectedResult> <add> Autofill options should appear when clicking into fields. Selected <add> autofill options should change state (shown underneath, under <add> "States"). <add> </TestCase.ExpectedResult> <add> <ControlledFormFixture /> <add> </TestCase> <add> </FixtureSet> <add> ); <add> } <add>} <add> <add>const SafeLink = ({text, href}) => { <add> return ( <add> <a target="_blank" rel="noreferrer" href={href}> <add> {text} <add> </a> <add> ); <add>};
3
PHP
PHP
fix types in console classes
735781170381b8a3d07e89961ab83b8394dc444f
<ide><path>src/Illuminate/Console/Application.php <ide> class Application extends SymfonyApplication implements ApplicationContract { <ide> /** <ide> * The Laravel application instance. <ide> * <del> * @var \Illuminate\Foundation\Application <add> * @var \Illuminate\Contracts\Foundation\Application <ide> */ <ide> protected $laravel; <ide> <ide><path>src/Illuminate/Console/Command.php <ide> use Symfony\Component\Console\Output\OutputInterface; <ide> use Symfony\Component\Console\Question\ChoiceQuestion; <ide> use Symfony\Component\Console\Question\ConfirmationQuestion; <add>use Illuminate\Contracts\Foundation\Application as LaravelApplication; <ide> <ide> class Command extends \Symfony\Component\Console\Command\Command { <ide> <ide> /** <ide> * The Laravel application instance. <ide> * <del> * @var \Illuminate\Foundation\Application <add> * @var \Illuminate\Contracts\Foundation\Application <ide> */ <ide> protected $laravel; <ide> <ide> public function getOutput() <ide> /** <ide> * Get the Laravel application instance. <ide> * <del> * @return \Illuminate\Foundation\Application <add> * @return \Illuminate\Contracts\Foundation\Application <ide> */ <ide> public function getLaravel() <ide> { <ide> public function getLaravel() <ide> /** <ide> * Set the Laravel application instance. <ide> * <del> * @param \Illuminate\Foundation\Application $laravel <add> * @param \Illuminate\Contracts\Foundation\Application $laravel <ide> * @return void <ide> */ <del> public function setLaravel($laravel) <add> public function setLaravel(LaravelApplication $laravel) <ide> { <ide> $this->laravel = $laravel; <ide> }
2
Javascript
Javascript
fix dangling links warning in $http api
dde613f18ef1e3f10e6678b957423afd3512ca04
<ide><path>src/ng/http.js <ide> function $HttpProvider() { <ide> * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – <ide> * transform function or an array of such functions. The transform function takes the http <ide> * request body and headers and returns its transformed (typically serialized) version. <del> * See {@link #overriding-the-default-transformations-per-request Overriding the Default Transformations} <add> * See {@link ng.$http#overriding-the-default-transformations-per-request <add> * Overriding the Default Transformations} <ide> * - **transformResponse** – <ide> * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – <ide> * transform function or an array of such functions. The transform function takes the http <ide> * response body and headers and returns its transformed (typically deserialized) version. <del> * See {@link #overriding-the-default-transformations-per-request Overriding the Default Transformations} <add> * See {@link ng.$http#overriding-the-default-transformations-per-request <add> * Overriding the Default Transformations} <ide> * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the <ide> * GET request, otherwise if a cache instance built with <ide> * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
1
Javascript
Javascript
add video link for symmetric difference
e640c71b3183133055488db73a78ed2acb9427d3
<ide><path>bonfireMDNlinks.js <ide> var links = <ide> "Smallest Common Multiple": "https://www.mathsisfun.com/least-common-multiple.html", <ide> "Permutations": "https://www.mathsisfun.com/combinatorics/combinations-permutations.html", <ide> "HTML Entities": "http://dev.w3.org/html5/html-author/charref", <add> "Symmetric Difference": "https://www.youtube.com/watch?v=PxffSUQRkG4", <ide> <ide> // ========= GLOBAL OBJECTS <ide> "Global Array Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
1
PHP
PHP
clarify array types in doc blocks
1d12f3b4ad407ca4ab8b80754889aa9ddb3a2402
<ide><path>src/Database/Type.php <ide> class Type implements TypeInterface <ide> * identifier is used as key and a complete namespaced class name as value <ide> * representing the class that will do actual type conversions. <ide> * <del> * @var array <add> * @var string[]|\Cake\Database\Type[] <ide> */ <ide> protected static $_types = [ <ide> 'tinyinteger' => 'Cake\Database\Type\IntegerType', <ide> class Type implements TypeInterface <ide> /** <ide> * Contains a map of type object instances to be reused if needed. <ide> * <del> * @var array <add> * @var \Cake\Database\Type[] <ide> */ <ide> protected static $_builtTypes = []; <ide>
1
Text
Text
remove semi-colon from reducers.md example
473ff39b0b35e8dfe0cbe29017abb6d5d1ab7685
<ide><path>docs/basics/Reducers.md <ide> function todoApp(state = initialState, action) { <ide> return { <ide> ...state, <ide> todos: todos(state.todos, action) <del> }; <add> } <ide> default: <ide> return state <ide> }
1
Ruby
Ruby
remove unnecessary code from urlhelper#link_to
9a6e3ae76322e0a8108f9bcf0a8440769328b9d7
<ide><path>actionpack/lib/action_view/helpers/url_helper.rb <ide> def link_to(*args, &block) <ide> html_options = convert_options_to_data_attributes(options, html_options) <ide> url = url_for(options) <ide> <del> if html_options <del> html_options = html_options.stringify_keys <del> href = html_options['href'] <del> tag_options = tag_options(html_options) <del> else <del> tag_options = nil <del> end <add> href = html_options['href'] <add> tag_options = tag_options(html_options) <ide> <ide> href_attr = "href=\"#{html_escape(url)}\"" unless href <ide> "<a #{href_attr}#{tag_options}>#{html_escape(name || url)}</a>".html_safe
1
Javascript
Javascript
fix question motion on correct answer
a39746d381bfe629b3e44a7de9fd90011018c36d
<ide><path>common/app/routes/Hikes/flux/Actions.js <ide> export default Actions({ <ide> // index 0 <ide> if (tests[currentQuestion]) { <ide> <del> return { <add> return Observable.just({ <ide> transform(state) { <del> <ide> const hikesApp = { <ide> ...state.hikesApp, <del> currentQuestion: currentQuestion + 1 <add> mouse: [0, 0] <ide> }; <del> <ide> return { ...state, hikesApp }; <ide> } <del> }; <add> }) <add> .delay(300) <add> .startWith({ <add> transform(state) { <add> <add> const hikesApp = { <add> ...state.hikesApp, <add> currentQuestion: currentQuestion + 1, <add> mouse: [ userAnswer ? 1000 : -1000, 0] <add> }; <add> <add> return { ...state, hikesApp }; <add> } <add> }); <ide> } <ide> <ide> // challenge completed <ide> export default Actions({ <ide> }, <ide> optimistic: optimisticSave <ide> }) <del> .delay(500) <add> .delay(300) <ide> .startWith(correctAnswer) <ide> .catch(err => { <ide> console.error(err);
1
Javascript
Javascript
add modal example
8dddaa85f04316c7b0419e6abcd11f8e11678956
<ide><path>packages/rn-tester/js/examples/Modal/ModalExample.js <ide> const { <ide> Text, <ide> TouchableHighlight, <ide> View, <add> ScrollView, <ide> } = require('react-native'); <ide> <ide> const Item = Picker.Item; <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> animationType: 'none', <ide> modalVisible: false, <ide> transparent: false, <add> hardwareAccelerated: false, <add> statusBarTranslucent: false, <ide> presentationStyle: 'fullScreen', <ide> selectedSupportedOrientation: '0', <ide> currentOrientation: 'unknown', <add> action: '', <ide> }; <ide> <ide> _setModalVisible = visible => { <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> this.setState({transparent: !this.state.transparent}); <ide> }; <ide> <add> _toggleHardwareAccelerated = () => { <add> this.setState({hardwareAccelerated: !this.state.hardwareAccelerated}); <add> }; <add> <add> _toggleStatusBarTranslucent = () => { <add> this.setState({statusBarTranslucent: !this.state.statusBarTranslucent}); <add> }; <add> <ide> renderSwitch() { <ide> if (Platform.isTV) { <ide> return null; <ide> } <add> if (Platform.OS === 'android') { <add> return ( <add> <> <add> <Text style={styles.rowTitle}>Hardware Accelerated</Text> <add> <Switch <add> value={this.state.hardwareAccelerated} <add> onValueChange={this._toggleHardwareAccelerated} <add> /> <add> <Text style={styles.rowTitle}>Status Bar Translucent</Text> <add> <Switch <add> value={this.state.statusBarTranslucent} <add> onValueChange={this._toggleStatusBarTranslucent} <add> /> <add> <Text style={styles.rowTitle}>Transparent</Text> <add> <Switch <add> value={this.state.transparent} <add> onValueChange={this._toggleTransparent} <add> /> <add> </> <add> ); <add> } <ide> return ( <ide> <Switch <ide> value={this.state.transparent} <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> }; <ide> <ide> return ( <del> <View> <add> <ScrollView contentContainerStyle={styles.ScrollView}> <ide> <Modal <ide> animationType={this.state.animationType} <ide> presentationStyle={this.state.presentationStyle} <ide> transparent={this.state.transparent} <add> hardwareAccelerated={this.state.hardwareAccelerated} <add> statusBarTranslucent={this.state.statusBarTranslucent} <ide> visible={this.state.modalVisible} <ide> onRequestClose={() => this._setModalVisible(false)} <ide> supportedOrientations={ <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> } <ide> onOrientationChange={evt => <ide> this.setState({currentOrientation: evt.nativeEvent.orientation}) <del> }> <add> } <add> onDismiss={() => { <add> if (this.state.action === 'onDismiss') alert(this.state.action); <add> }} <add> onShow={() => { <add> if (this.state.action === 'onShow') alert(this.state.action); <add> }}> <ide> <View style={[styles.container, modalBackgroundStyle]}> <ide> <View <ide> style={[styles.innerContainer, innerContainerTransparentStyle]}> <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> </Button> <ide> </View> <ide> <del> <View style={styles.row}> <del> <Text style={styles.rowTitle}>Transparent</Text> <del> {this.renderSwitch()} <del> </View> <add> <View style={styles.row}>{this.renderSwitch()}</View> <ide> {this.renderPickers()} <ide> <Button onPress={this._setModalVisible.bind(this, true)}> <ide> Present <ide> </Button> <del> </View> <add> </ScrollView> <ide> ); <ide> } <ide> renderPickers() { <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> <Picker <ide> selectedValue={this.state.selectedSupportedOrientation} <ide> onValueChange={(_, i) => <del> this.setState({selectedSupportedOrientation: i}) <add> this.setState({selectedSupportedOrientation: i.toString()}) <ide> } <ide> itemStyle={styles.pickerItem}> <ide> <Item label="Portrait" value={'0'} /> <ide> class ModalExample extends React.Component<{...}, $FlowFixMeState> { <ide> <Item label="Default supportedOrientations" value={'5'} /> <ide> </Picker> <ide> </View> <add> <add> <View> <add> <Text style={styles.rowTitle}>Actions</Text> <add> {Platform.OS === 'ios' ? ( <add> <Picker <add> selectedValue={this.state.action} <add> onValueChange={action => this.setState({action})} <add> itemStyle={styles.pickerItem}> <add> <Item label="None" value="" /> <add> <Item label="On Dismiss" value="onDismiss" /> <add> <Item label="On Show" value="onShow" /> <add> </Picker> <add> ) : ( <add> <Picker <add> selectedValue={this.state.action} <add> onValueChange={action => this.setState({action})} <add> itemStyle={styles.pickerItem}> <add> <Item label="None" value="" /> <add> <Item label="On Show" value="onShow" /> <add> </Picker> <add> )} <add> </View> <ide> </View> <ide> ); <ide> } <ide> const styles = StyleSheet.create({ <ide> pickerItem: { <ide> fontSize: 16, <ide> }, <add> ScrollView: { <add> paddingTop: 10, <add> paddingBottom: 100, <add> }, <ide> });
1
PHP
PHP
fix the test case
36882454843fb7fc91157832257f66ca6d2c4d9e
<ide><path>tests/TestCase/Collection/Iterator/SortIteratorTest.php <ide> public function testSortDateTime() <ide> ]; <ide> $this->assertEquals($expected, $sorted->toList()); <ide> <add> $items = new ArrayObject([ <add> new Time('2014-07-21'), <add> new Time('2015-06-30'), <add> new Time('2013-08-12') <add> ]); <add> <ide> $sorted = new SortIterator($items, $callback, SORT_ASC); <ide> $expected = [ <ide> new Time('2014-08-12'), <ide> new Time('2015-07-21'), <del> new Time('2016-06-30') <add> new Time('2016-06-30'), <ide> ]; <ide> $this->assertEquals($expected, $sorted->toList()); <ide> }
1
Javascript
Javascript
add accessibilityhint to touchablenativefeedback
72285d808dfce748287a19e2620d58517a5f76e7
<ide><path>Libraries/Components/Touchable/TouchableNativeFeedback.js <ide> class TouchableNativeFeedback extends React.Component<Props, State> { <ide> this.props.useForeground === true, <ide> ), <ide> accessible: this.props.accessible !== false, <add> accessibilityHint: this.props.accessibilityHint, <ide> accessibilityLabel: this.props.accessibilityLabel, <ide> accessibilityRole: this.props.accessibilityRole, <ide> accessibilityState: this.props.accessibilityState,
1
Go
Go
extract healthcheck-validation to a function
6a7da0b31b505d499aa7785195dc43df7b257b5c
<ide><path>daemon/container.go <ide> func (daemon *Daemon) verifyContainerSettings(platform string, hostConfig *conta <ide> } <ide> } <ide> <del> // Validate the healthcheck params of Config <del> if config.Healthcheck != nil { <del> if config.Healthcheck.Interval != 0 && config.Healthcheck.Interval < containertypes.MinimumDuration { <del> return nil, errors.Errorf("Interval in Healthcheck cannot be less than %s", containertypes.MinimumDuration) <del> } <del> <del> if config.Healthcheck.Timeout != 0 && config.Healthcheck.Timeout < containertypes.MinimumDuration { <del> return nil, errors.Errorf("Timeout in Healthcheck cannot be less than %s", containertypes.MinimumDuration) <del> } <del> <del> if config.Healthcheck.Retries < 0 { <del> return nil, errors.Errorf("Retries in Healthcheck cannot be negative") <del> } <del> <del> if config.Healthcheck.StartPeriod != 0 && config.Healthcheck.StartPeriod < containertypes.MinimumDuration { <del> return nil, errors.Errorf("StartPeriod in Healthcheck cannot be less than %s", containertypes.MinimumDuration) <del> } <add> if err := validateHealthCheck(config.Healthcheck); err != nil { <add> return nil, err <ide> } <ide> } <ide> <ide> func (daemon *Daemon) verifyContainerSettings(platform string, hostConfig *conta <ide> } <ide> return warnings, err <ide> } <add> <add>// validateHealthCheck validates the healthcheck params of Config <add>func validateHealthCheck(healthConfig *containertypes.HealthConfig) error { <add> if healthConfig == nil { <add> return nil <add> } <add> if healthConfig.Interval != 0 && healthConfig.Interval < containertypes.MinimumDuration { <add> return errors.Errorf("Interval in Healthcheck cannot be less than %s", containertypes.MinimumDuration) <add> } <add> if healthConfig.Timeout != 0 && healthConfig.Timeout < containertypes.MinimumDuration { <add> return errors.Errorf("Timeout in Healthcheck cannot be less than %s", containertypes.MinimumDuration) <add> } <add> if healthConfig.Retries < 0 { <add> return errors.Errorf("Retries in Healthcheck cannot be negative") <add> } <add> if healthConfig.StartPeriod != 0 && healthConfig.StartPeriod < containertypes.MinimumDuration { <add> return errors.Errorf("StartPeriod in Healthcheck cannot be less than %s", containertypes.MinimumDuration) <add> } <add> return nil <add>}
1
PHP
PHP
change equal operators to identity operators
e38892ff06c0066c572f8251953a091041246814
<ide><path>lib/Cake/View/Helper/FormHelper.php <ide> public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $a <ide> $current->setDate($year, $month, $day); <ide> } <ide> if ($hour !== null) { <del> if ($timeFormat == '12') { <add> if ($timeFormat === '12') { <ide> $hour = date('H', strtotime("$hour:$min $meridian")); <ide> } <ide> $current->setTime($hour, $min); <ide> } <ide> $change = (round($min * (1 / $interval)) * $interval) - $min; <ide> $current->modify($change > 0 ? "+$change minutes" : "$change minutes"); <del> $format = ($timeFormat == '12') ? 'Y m d h i a' : 'Y m d H i a'; <add> $format = ($timeFormat === '12') ? 'Y m d h i a' : 'Y m d H i a'; <ide> $newTime = explode(' ', $current->format($format)); <ide> list($year, $month, $day, $hour, $min, $meridian) = $newTime; <ide> }
1
Javascript
Javascript
build single scales in core
ef1acfa0e85f5b2d5aca473eb5027b91f89d6fb1
<ide><path>src/core/core.controller.js <ide> this.scales[scale.id] = scale; <ide> }, this); <ide> } <add> <add> if (this.options.scale) { <add> // Build radial axes <add> var ScaleClass = Chart.scaleService.getScaleConstructor(axisOptions.type); <add> var scale = new ScaleClass({ <add> ctx: this.chart.ctx, <add> options: axisOptions, <add> data: this.data, <add> id: axisOptions.id, <add> chart: this.chart, <add> }); <add> <add> this.scale = scale; <add> } <ide> } <ide> <ide> Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
1
Text
Text
add missing word to improve clarity
9fc6606c83d9de53ce8adc894c78f2d90303ef86
<ide><path>docs/faq/CodeStructure.md <ide> However, there may be times when other parts of the codebase need to interact wi <ide> Some possible solutions are: <ide> <ide> - Write your store-dependent logic as a thunk, and then dispatch that thunk from a component <del>- Pass along references to `dispatch` from components as arguments the relevant functions <add>- Pass along references to `dispatch` from components as arguments to the relevant functions <ide> - Write the logic as middleware and add them to the store at setup time <ide> - Inject the store instance into the relevant files as the app is being created. <ide>
1
PHP
PHP
simplify methods and harden their signature
f90a28cc5a68708b55587e9ed926e0e2b7068337
<ide><path>src/Console/Command/Task/ControllerTask.php <ide> public function bake($controllerName) { <ide> * @param array $data The data to turn into code. <ide> * @return string The generated controller file. <ide> */ <del> public function bakeController($controllerName, $data) { <add> public function bakeController($controllerName, array $data) { <ide> $data += [ <ide> 'name' => null, <ide> 'namespace' => null, <ide><path>src/Console/Command/Task/FixtureTask.php <ide> public function importOptions($modelName) { <ide> * @return string Baked fixture content <ide> * @throws \RuntimeException <ide> */ <del> public function bake($model, $useTable = false, $importOptions = []) { <add> public function bake($model, $useTable = false, array $importOptions = []) { <ide> $table = $schema = $records = $import = $modelImport = null; <ide> $importBits = []; <ide> <ide> public function bake($model, $useTable = false, $importOptions = []) { <ide> * Generate the fixture file, and write to disk <ide> * <ide> * @param string $model name of the model being generated <del> * @param string $otherVars Contents of the fixture file. <add> * @param array $otherVars Contents of the fixture file. <ide> * @return string Content saved into fixture file. <ide> */ <del> public function generateFixtureFile($model, $otherVars) { <add> public function generateFixtureFile($model, array $otherVars) { <ide> $defaults = [ <ide> 'name' => Inflector::singularize($model), <ide> 'table' => null, <ide> public function generateFixtureFile($model, $otherVars) { <ide> if ($this->plugin) { <ide> $defaults['namespace'] = $this->plugin; <ide> } <del> $vars = array_merge($defaults, $otherVars); <add> $vars = $otherVars + $defaults; <ide> <ide> $path = $this->getPath(); <ide> $filename = $vars['name'] . 'Fixture.php'; <ide><path>src/Console/Command/Task/ModelTask.php <ide> public function getAssociations(Table $table) { <ide> * @param array $associations Array of in progress associations <ide> * @return array Associations with belongsTo added in. <ide> */ <del> public function findBelongsTo($model, $associations) { <add> public function findBelongsTo($model, array $associations) { <ide> $schema = $model->schema(); <ide> $primary = (array)$schema->primaryKey(); <ide> foreach ($schema->columns() as $fieldName) { <ide> public function findBelongsTo($model, $associations) { <ide> * @param array $associations Array of in progress associations <ide> * @return array Associations with hasMany added in. <ide> */ <del> public function findHasMany($model, $associations) { <add> public function findHasMany($model, array $associations) { <ide> $schema = $model->schema(); <ide> $primaryKey = (array)$schema->primaryKey(); <ide> $tableName = $schema->name(); <ide> public function findHasMany($model, $associations) { <ide> * @param array $associations Array of in-progress associations <ide> * @return array Associations with belongsToMany added in. <ide> */ <del> public function findBelongsToMany($model, $associations) { <add> public function findBelongsToMany($model, array $associations) { <ide> $schema = $model->schema(); <ide> $primaryKey = (array)$schema->primaryKey(); <ide> $tableName = $schema->name(); <ide> public function getValidation($model) { <ide> * @param string $primaryKey <ide> * @return array Array of validation for the field. <ide> */ <del> public function fieldValidation($fieldName, $metaData, $primaryKey) { <add> public function fieldValidation($fieldName, array $metaData, $primaryKey) { <ide> $ignoreFields = array_merge($primaryKey, ['created', 'modified', 'updated']); <del> if ($metaData['null'] == true && in_array($fieldName, $ignoreFields)) { <add> if ($metaData['null'] === true && in_array($fieldName, $ignoreFields)) { <ide> return false; <ide> } <ide> <ide> public function getBehaviors($model) { <ide> * @param array $data An array to use to generate the Table <ide> * @return string <ide> */ <del> public function bakeEntity($model, $data = []) { <add> public function bakeEntity($model, array $data = []) { <ide> if (!empty($this->params['no-entity'])) { <ide> return; <ide> } <ide> public function bakeEntity($model, $data = []) { <ide> * @param array $data An array to use to generate the Table <ide> * @return string <ide> */ <del> public function bakeTable($model, $data = []) { <add> public function bakeTable($model, array $data = []) { <ide> if (!empty($this->params['no-table'])) { <ide> return; <ide> } <ide><path>src/Console/Command/Task/PluginTask.php <ide> protected function _generateTestBootstrap($plugin, $path) { <ide> * @param array $pathOptions <ide> * @return void <ide> */ <del> public function findPath($pathOptions) { <add> public function findPath(array $pathOptions) { <ide> $valid = false; <ide> foreach ($pathOptions as $i => $path) { <ide> if (!is_dir($path)) { <ide><path>src/Console/Command/Task/ViewTask.php <ide> protected function _loadController() { <ide> * @param array $vars <ide> * @return void <ide> */ <del> public function bakeActions($actions, $vars) { <add> public function bakeActions(array $actions, $vars) { <ide> foreach ($actions as $action) { <ide> $content = $this->getContent($action, $vars); <ide> $this->bake($action, $content); <ide><path>src/Console/Shell.php <ide> protected function _getInput($prompt, $options, $default) { <ide> * - `indent` Indent the text with the string provided. Defaults to null. <ide> * <ide> * @param string $text Text the text to format. <del> * @param string|integer|array $options Array of options to use, or an integer to wrap the text to. <add> * @param integer|array $options Array of options to use, or an integer to wrap the text to. <ide> * @return string Wrapped / indented text <ide> * @see String::wrap() <ide> * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText <ide><path>src/Database/Query.php <ide> protected function _stringifyExpressions(array $expressions, ValueBinder $genera <ide> * @return Query <ide> * @throws \RuntimeException When there are 0 columns. <ide> */ <del> public function insert($columns, $types = []) { <add> public function insert(array $columns, array $types = []) { <ide> if (empty($columns)) { <ide> throw new \RuntimeException('At least 1 column is required to perform an insert.'); <ide> } <ide><path>src/Datasource/RepositoryInterface.php <ide> interface RepositoryInterface { <ide> * listeners. Any listener can set a valid result set using $query <ide> * <ide> * @param string $type the type of query to perform <del> * @param array $options An array that will be passed to Query::applyOptions() <add> * @param array|\ArrayAccess $options An array that will be passed to Query::applyOptions() <ide> * @return \Cake\ORM\Query <ide> */ <ide> public function find($type = 'all', $options = []); <ide> public function find($type = 'all', $options = []); <ide> * }}} <ide> * <ide> * @param mixed $primaryKey primary key value to find <del> * @param array $options options accepted by `Table::find()` <add> * @param array|\ArrayAccess $options options accepted by `Table::find()` <ide> * @throws \Cake\ORM\Error\RecordNotFoundException if the record with such id <ide> * could not be found <ide> * @return \Cake\Datasource\EntityInterface <ide> public function deleteAll($conditions); <ide> * Returns true if there is any record in this repository matching the specified <ide> * conditions. <ide> * <del> * @param array $conditions list of conditions to pass to the query <add> * @param array|\ArrayAccess $conditions list of conditions to pass to the query <ide> * @return boolean <ide> */ <del> public function exists(array $conditions); <add> public function exists($conditions); <ide> <ide> /** <ide> * Persists an entity based on the fields that are marked as dirty and <ide> * returns the same entity after a successful save or false in case <ide> * of any error. <ide> * <ide> * @param \Cake\Datasource\EntityInterface the entity to be saved <del> * @param array $options <add> * @param array|\ArrayAccess $options <ide> * @return \Cake\Datasource\EntityInterface|boolean <ide> */ <del> public function save(EntityInterface $entity, array $options = []); <add> public function save(EntityInterface $entity, $options = []); <ide> <ide> /** <ide> * Delete a single entity. <ide> public function save(EntityInterface $entity, array $options = []); <ide> * based on the 'dependent' option used when defining the association. <ide> * <ide> * @param \Cake\Datasource\EntityInterface $entity The entity to remove. <del> * @param array $options The options fo the delete. <add> * @param array|\ArrayAccess $options The options fo the delete. <ide> * @return boolean success <ide> */ <del> public function delete(EntityInterface $entity, array $options = []); <add> public function delete(EntityInterface $entity, $options = []); <ide> <ide> /** <ide> * Create a new entity + associated entities from an array. <ide><path>src/Model/Behavior/TranslateBehavior.php <ide> use Cake\Event\Event; <ide> use Cake\ORM\Behavior; <ide> use Cake\ORM\Entity; <add>use Cake\ORM\Query; <ide> use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> <ide> public function locale($locale = null) { <ide> * @param array $options <ide> * @return \Cake\ORM\Query <ide> */ <del> public function findTranslations($query, $options) { <add> public function findTranslations(Query $query, array $options) { <ide> $locales = isset($options['locales']) ? $options['locales'] : []; <ide> $table = $this->_config['translationTable']; <ide> return $query <ide><path>src/Model/Behavior/TreeBehavior.php <ide> protected function _unmarkInternalTree() { <ide> * @return \Cake\ORM\Query <ide> * @throws \InvalidArgumentException If the 'for' key is missing in options <ide> */ <del> public function findPath($query, $options) { <add> public function findPath($query, array $options) { <ide> if (empty($options['for'])) { <ide> throw new \InvalidArgumentException("The 'for' key is required for find('path')"); <ide> } <ide> public function childCount(Entity $node, $direct = false) { <ide> * @return \Cake\ORM\Query <ide> * @throws \InvalidArgumentException When the 'for' key is not passed in $options <ide> */ <del> public function findChildren($query, $options) { <add> public function findChildren($query, array $options) { <ide> $config = $this->config(); <ide> $options += ['for' => null, 'direct' => false]; <ide> list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']]; <ide> public function findChildren($query, $options) { <ide> <ide> /** <ide> * Gets a representation of the elements in the tree as a flat list where the keys are <del> * the primary key for the table and the values are the display field for the table. <add> * the primary key for the table and the values are the display field for the table. <ide> * Values are prefixed to visually indicate relative depth in the tree. <ide> * <ide> * Avaliable options are: <ide> public function findChildren($query, $options) { <ide> * @param array $options Array of options as described above <ide> * @return \Cake\ORM\Query <ide> */ <del> public function findTreeList($query, $options) { <add> public function findTreeList($query, array $options) { <ide> return $this->_scope($query) <ide> ->find('threaded', ['parentField' => $this->config()['parent']]) <ide> ->formatResults(function($results) use ($options) { <ide><path>src/Network/Http/Adapter/Stream.php <ide> class Stream { <ide> * @param array $options Array of options for the stream. <ide> * @return array Array of populated Response objects <ide> */ <del> public function send(Request $request, $options) { <add> public function send(Request $request, array $options) { <ide> $this->_stream = null; <ide> $this->_context = []; <ide> $this->_connectionErrors = []; <ide><path>src/Network/Http/Auth/Basic.php <ide> class Basic { <ide> * @return void <ide> * @see http://www.ietf.org/rfc/rfc2617.txt <ide> */ <del> public function authentication(Request $request, $credentials) { <add> public function authentication(Request $request, array $credentials) { <ide> if (isset($credentials['username'], $credentials['password'])) { <ide> $value = $this->_generateHeader($credentials['username'], $credentials['password']); <ide> $request->header('Authorization', $value); <ide> public function authentication(Request $request, $credentials) { <ide> * @return void <ide> * @see http://www.ietf.org/rfc/rfc2617.txt <ide> */ <del> public function proxyAuthentication(Request $request, $credentials) { <add> public function proxyAuthentication(Request $request, array $credentials) { <ide> if (isset($credentials['username'], $credentials['password'])) { <ide> $value = $this->_generateHeader($credentials['username'], $credentials['password']); <ide> $request->header('Proxy-Authorization', $value); <ide><path>src/Network/Http/Auth/Digest.php <ide> public function __construct(Client $client, $options = null) { <ide> * @return void <ide> * @see http://www.ietf.org/rfc/rfc2617.txt <ide> */ <del> public function authentication(Request $request, $credentials) { <add> public function authentication(Request $request, array $credentials) { <ide> if (!isset($credentials['username'], $credentials['password'])) { <ide> return; <ide> } <ide><path>src/Network/Http/Auth/Oauth.php <ide> class Oauth { <ide> * @return void <ide> * @throws \Cake\Error\Exception On invalid signature types. <ide> */ <del> public function authentication(Request $request, $credentials) { <add> public function authentication(Request $request, array $credentials) { <ide> $hasKeys = isset( <ide> $credentials['consumerSecret'], <ide> $credentials['consumerKey'], <ide><path>src/Network/Http/Client.php <ide> public function cookies() { <ide> * @param array $options Additional options for the request. <ide> * @return \Cake\Network\Http\Response <ide> */ <del> public function get($url, $data = [], $options = []) { <add> public function get($url, array $data = [], array $options = []) { <ide> $options = $this->_mergeOptions($options); <ide> $body = []; <ide> if (isset($data['_content'])) { <ide> public function get($url, $data = [], $options = []) { <ide> * Do a POST request. <ide> * <ide> * @param string $url The url or path you want to request. <del> * @param array $data The post data you want to send. <add> * @param mixed $data The post data you want to send. <ide> * @param array $options Additional options for the request. <ide> * @return \Cake\Network\Http\Response <ide> */ <del> public function post($url, $data = [], $options = []) { <add> public function post($url, $data = [], array $options = []) { <ide> $options = $this->_mergeOptions($options); <ide> $url = $this->buildUrl($url, [], $options); <ide> return $this->_doRequest(Request::METHOD_POST, $url, $data, $options); <ide> public function post($url, $data = [], $options = []) { <ide> * Do a PUT request. <ide> * <ide> * @param string $url The url or path you want to request. <del> * @param array $data The request data you want to send. <add> * @param mixed $data The request data you want to send. <ide> * @param array $options Additional options for the request. <ide> * @return \Cake\Network\Http\Response <ide> */ <del> public function put($url, $data = [], $options = []) { <add> public function put($url, $data = [], array $options = []) { <ide> $options = $this->_mergeOptions($options); <ide> $url = $this->buildUrl($url, [], $options); <ide> return $this->_doRequest(Request::METHOD_PUT, $url, $data, $options); <ide> public function put($url, $data = [], $options = []) { <ide> * Do a PATCH request. <ide> * <ide> * @param string $url The url or path you want to request. <del> * @param array $data The request data you want to send. <add> * @param mixed $data The request data you want to send. <ide> * @param array $options Additional options for the request. <ide> * @return \Cake\Network\Http\Response <ide> */ <del> public function patch($url, $data = [], $options = []) { <add> public function patch($url, $data = [], array $options = []) { <ide> $options = $this->_mergeOptions($options); <ide> $url = $this->buildUrl($url, [], $options); <ide> return $this->_doRequest(Request::METHOD_PATCH, $url, $data, $options); <ide> public function patch($url, $data = [], $options = []) { <ide> * Do a DELETE request. <ide> * <ide> * @param string $url The url or path you want to request. <del> * @param array $data The request data you want to send. <add> * @param mixed $data The request data you want to send. <ide> * @param array $options Additional options for the request. <ide> * @return \Cake\Network\Http\Response <ide> */ <del> public function delete($url, $data = [], $options = []) { <add> public function delete($url, $data = [], array $options = []) { <ide> $options = $this->_mergeOptions($options); <ide> $url = $this->buildUrl($url, [], $options); <ide> return $this->_doRequest(Request::METHOD_DELETE, $url, $data, $options); <ide> public function delete($url, $data = [], $options = []) { <ide> * @param array $options Additional options for the request. <ide> * @return \Cake\Network\Http\Response <ide> */ <del> public function head($url, $data = [], $options = []) { <add> public function head($url, array $data = [], array $options = []) { <ide> $options = $this->_mergeOptions($options); <ide> $url = $this->buildUrl($url, $data, $options); <ide> return $this->_doRequest(Request::METHOD_HEAD, $url, '', $options); <ide><path>src/ORM/Association.php <ide> public function dependent($dependent = null) { <ide> * @param array $options custom options key that could alter the return value <ide> * @return boolean <ide> */ <del> public function canBeJoined($options = []) { <add> public function canBeJoined(array $options = []) { <ide> $strategy = isset($options['strategy']) ? $options['strategy'] : $this->strategy(); <ide> return $strategy == $this::STRATEGY_JOIN; <ide> } <ide> public function defaultRowValue($row, $joined) { <ide> * @see \Cake\ORM\Table::find() <ide> * @return \Cake\ORM\Query <ide> */ <del> public function find($type = 'all', $options = []) { <add> public function find($type = 'all', array $options = []) { <ide> return $this->target() <ide> ->find($type, $options) <ide> ->where($this->conditions()); <ide> protected function _bindNewAssociations($query, $surrogate, $options) { <ide> * @throws \RuntimeException if the number of columns in the foreignKey do not <ide> * match the number of columns in the source table primaryKey <ide> */ <del> protected function _joinCondition(array $options) { <add> protected function _joinCondition($options) { <ide> $conditions = []; <ide> $tAlias = $this->target()->alias(); <ide> $sAlias = $this->source()->alias(); <ide> public abstract function eagerLoader(array $options); <ide> * @param array $options The options for the original delete. <ide> * @return boolean Success <ide> */ <del> public abstract function cascadeDelete(Entity $entity, $options = []); <add> public abstract function cascadeDelete(Entity $entity, array $options = []); <ide> <ide> /** <ide> * Returns whether or not the passed table is the owning side for this <ide> public abstract function isOwningSide(Table $side); <ide> * the saved entity <ide> * @see Table::save() <ide> */ <del> public abstract function save(Entity $entity, $options = []); <add> public abstract function save(Entity $entity, array $options = []); <ide> <ide> } <ide><path>src/ORM/Association/BelongsTo.php <ide> public function foreignKey($key = null) { <ide> * @param array $options The options for the original delete. <ide> * @return boolean Success. <ide> */ <del> public function cascadeDelete(Entity $entity, $options = []) { <add> public function cascadeDelete(Entity $entity, array $options = []) { <ide> return true; <ide> } <ide> <ide> public function type() { <ide> * the saved entity <ide> * @see Table::save() <ide> */ <del> public function save(Entity $entity, $options = []) { <add> public function save(Entity $entity, array $options = []) { <ide> $targetEntity = $entity->get($this->property()); <ide> if (empty($targetEntity) || !($targetEntity instanceof Entity)) { <ide> return $entity; <ide> public function save(Entity $entity, $options = []) { <ide> * @throws \RuntimeException if the number of columns in the foreignKey do not <ide> * match the number of columns in the target table primaryKey <ide> */ <del> protected function _joinCondition(array $options) { <add> protected function _joinCondition($options) { <ide> $conditions = []; <ide> $tAlias = $this->target()->alias(); <ide> $sAlias = $this->_sourceTable->alias(); <ide><path>src/ORM/Association/BelongsToMany.php <ide> public function type() { <ide> * @param array $options list of options passed to attachTo method <ide> * @return boolean false <ide> */ <del> protected function _joinCondition(array $options) { <add> protected function _joinCondition($options) { <ide> return false; <ide> } <ide> <ide> protected function _buildResultMap($fetchQuery, $options) { <ide> * @param array $options The options for the original delete. <ide> * @return boolean Success. <ide> */ <del> public function cascadeDelete(Entity $entity, $options = []) { <add> public function cascadeDelete(Entity $entity, array $options = []) { <ide> $foreignKey = (array)$this->foreignKey(); <ide> $primaryKey = (array)$this->source()->primaryKey(); <ide> $conditions = []; <ide> public function saveStrategy($strategy = null) { <ide> * @see Table::save() <ide> * @see BelongsToMany::replaceLinks() <ide> */ <del> public function save(Entity $entity, $options = []) { <add> public function save(Entity $entity, array $options = []) { <ide> $targetEntity = $entity->get($this->property()); <ide> $strategy = $this->saveStrategy(); <ide> <ide><path>src/ORM/Association/DependentDeleteTrait.php <ide> trait DependentDeleteTrait { <ide> * @param array $options The options for the original delete. <ide> * @return boolean Success. <ide> */ <del> public function cascadeDelete(Entity $entity, $options = []) { <add> public function cascadeDelete(Entity $entity, array $options = []) { <ide> if (!$this->dependent()) { <ide> return true; <ide> } <ide><path>src/ORM/Association/ExternalAssociationTrait.php <ide> trait ExternalAssociationTrait { <ide> * @return boolean if the 'matching' key in $option is true then this function <ide> * will return true, false otherwise <ide> */ <del> public function canBeJoined($options = []) { <add> public function canBeJoined(array $options = []) { <ide> return !empty($options['matching']); <ide> } <ide> <ide><path>src/ORM/Association/HasMany.php <ide> public function isOwningSide(Table $side) { <ide> * @see Table::save() <ide> * @throws \InvalidArgumentException when the association data cannot be traversed. <ide> */ <del> public function save(Entity $entity, $options = []) { <add> public function save(Entity $entity, array $options = []) { <ide> $targetEntities = $entity->get($this->property()); <ide> if (empty($targetEntities)) { <ide> return $entity; <ide><path>src/ORM/Association/HasOne.php <ide> public function type() { <ide> * the saved entity <ide> * @see Table::save() <ide> */ <del> public function save(Entity $entity, $options = []) { <add> public function save(Entity $entity, array $options = []) { <ide> $targetEntity = $entity->get($this->property()); <ide> if (empty($targetEntity) || !($targetEntity instanceof Entity)) { <ide> return $entity; <ide><path>src/ORM/Association/SelectableAssociationTrait.php <ide> trait SelectableAssociationTrait { <ide> * @param array $options <ide> * @return boolean true if a list of keys will be required <ide> */ <del> public function requiresKeys($options = []) { <add> public function requiresKeys(array $options = []) { <ide> $strategy = isset($options['strategy']) ? $options['strategy'] : $this->strategy(); <ide> return $strategy === $this::STRATEGY_SELECT; <ide> } <ide><path>src/ORM/Associations.php <ide> public function remove($alias) { <ide> * @param array $options The options for the save operation. <ide> * @return boolean Success <ide> */ <del> public function saveParents(Table $table, Entity $entity, $associations, $options = []) { <add> public function saveParents(Table $table, Entity $entity, $associations, array $options = []) { <ide> if (empty($associations)) { <ide> return true; <ide> } <ide> public function saveParents(Table $table, Entity $entity, $associations, $option <ide> * @param array $options The options for the save operation. <ide> * @return boolean Success <ide> */ <del> public function saveChildren(Table $table, Entity $entity, $associations, $options) { <add> public function saveChildren(Table $table, Entity $entity, array $associations, array $options) { <ide> if (empty($associations)) { <ide> return true; <ide> } <ide> protected function _save($association, $entity, $nested, $options) { <ide> * @param array $options The options used in the delete operation. <ide> * @return void <ide> */ <del> public function cascadeDelete(Entity $entity, $options) { <add> public function cascadeDelete(Entity $entity, array $options) { <ide> foreach ($this->_items as $assoc) { <ide> $assoc->cascadeDelete($entity, $options); <ide> } <ide><path>src/ORM/EntityValidator.php <ide> protected function _buildPropertyMap($include) { <ide> * as well. <ide> * <ide> * @param \Cake\ORM\Entity $entity The entity to be validated <del> * @param array $options options for validation, including an optional key of <add> * @param array|\ArrayObject $options options for validation, including an optional key of <ide> * associations to also be validated. <ide> * @return boolean true if all validations passed, false otherwise <ide> */ <ide> public function one(Entity $entity, $options = []) { <ide> * table and traverses associations passed in $include to validate them as well. <ide> * <ide> * @param array $entities List of entities to be validated <del> * @param array $options options for validation, including an optional key of <add> * @param array|\ArrayObject $options options for validation, including an optional key of <ide> * associations to also be validated. <ide> * @return boolean true if all validations passed, false otherwise <ide> */ <ide><path>src/ORM/Marshaller.php <ide> protected function _buildPropertyMap($include) { <ide> * @return \Cake\ORM\Entity <ide> * @see \Cake\ORM\Table::newEntity() <ide> */ <del> public function one(array $data, $include = []) { <add> public function one(array $data, array $include = []) { <ide> $propertyMap = $this->_buildPropertyMap($include); <ide> <ide> $schema = $this->_table->schema(); <ide> protected function _marshalAssociation($assoc, $value, $include) { <ide> * @return array An array of hydrated records. <ide> * @see \Cake\ORM\Table::newEntities() <ide> */ <del> public function many(array $data, $include = []) { <add> public function many(array $data, array $include = []) { <ide> $output = []; <ide> foreach ($data as $record) { <ide> $output[] = $this->one($record, $include); <ide> protected function _loadBelongsToMany($assoc, $ids) { <ide> * @param array $include The list of associations to be merged <ide> * @return \Cake\Datasource\EntityInterface <ide> */ <del> public function merge(EntityInterface $entity, array $data, $include = []) { <add> public function merge(EntityInterface $entity, array $data, array $include = []) { <ide> $propertyMap = $this->_buildPropertyMap($include); <ide> $tableName = $this->_table->alias(); <ide> <ide> public function merge(EntityInterface $entity, array $data, $include = []) { <ide> * @param array $include The list of associations to be merged <ide> * @return array <ide> */ <del> public function mergeMany($entities, array $data, $include = []) { <add> public function mergeMany($entities, array $data, array $include = []) { <ide> $primary = (array)$this->_table->primaryKey(); <ide> $indexed = (new Collection($data))->groupBy($primary[0])->toArray(); <ide> $new = isset($indexed[null]) ? [$indexed[null]] : []; <ide><path>src/ORM/Query.php <ide> protected function _addDefaultFields() { <ide> * @return \Cake\ORM\Query Returns a modified query. <ide> * @see \Cake\ORM\Table::find() <ide> */ <del> public function find($finder, $options = []) { <add> public function find($finder, array $options = []) { <ide> return $this->repository()->callFinder($finder, $this, $options); <ide> } <ide> <ide> public function delete($table = null) { <ide> * @param array $types A map between columns & their datatypes. <ide> * @return Query <ide> */ <del> public function insert($columns, $types = []) { <add> public function insert(array $columns, array $types = []) { <ide> $table = $this->repository()->table(); <ide> $this->into($table); <ide> return parent::insert($columns, $types); <ide><path>src/ORM/Table.php <ide> public function entityClass($name = null) { <ide> * @return void <ide> * @see \Cake\ORM\Behavior <ide> */ <del> public function addBehavior($name, $options = []) { <add> public function addBehavior($name, array $options = []) { <ide> $this->_behaviors->load($name, $options); <ide> } <ide> <ide> public function deleteAll($conditions) { <ide> * {@inheritdoc} <ide> * <ide> */ <del> public function exists(array $conditions) { <add> public function exists($conditions) { <ide> return (bool)count($this->find('all') <ide> ->select(['existing' => 1]) <ide> ->where($conditions) <ide> public function exists(array $conditions) { <ide> * }}} <ide> * <ide> */ <del> public function save(EntityInterface $entity, array $options = []) { <add> public function save(EntityInterface $entity, $options = []) { <ide> $options = new \ArrayObject($options + [ <ide> 'atomic' => true, <ide> 'validate' => true, <ide> protected function _update($entity, $data) { <ide> * the options used in the delete operation. <ide> * <ide> */ <del> public function delete(EntityInterface $entity, array $options = []) { <add> public function delete(EntityInterface $entity, $options = []) { <ide> $options = new \ArrayObject($options + ['atomic' => true]); <ide> <ide> $process = function() use ($entity, $options) { <ide> protected function _processDelete($entity, $options) { <ide> * @return \Cake\ORM\Query <ide> * @throws \BadMethodCallException <ide> */ <del> public function callFinder($type, Query $query, $options = []) { <add> public function callFinder($type, Query $query, array $options = []) { <ide> $query->applyOptions($options); <ide> $options = $query->getOptions(); <ide> $finder = 'find' . ucfirst($type); <ide> public function patchEntities($entities, array $data, $associations = null) { <ide> * }}} <ide> * <ide> * @param \Cake\Datasource\EntityInterface $entity The entity to be validated <del> * @param array $options A list of options to use while validating, the following <add> * @param array|\ArrayObject $options A list of options to use while validating, the following <ide> * keys are accepted: <ide> * - validate: The name of the validation set to use <ide> * - associated: map of association names to validate as well <ide> public function validate($entity, $options = []) { <ide> * ]); <ide> * }}} <ide> * <del> * @param array $entities The entities to be validated <add> * @param array|\ArrayAccess $entities The entities to be validated <ide> * @param array $options A list of options to use while validating, the following <ide> * keys are accepted: <ide> * - validate: The name of the validation set to use <ide> * - associated: map of association names to validate as well <ide> * @return boolean true if the passed entities and their associations are valid <ide> */ <del> public function validateMany($entities, $options = []) { <add> public function validateMany($entities, array $options = []) { <ide> if (!isset($options['associated'])) { <ide> $options['associated'] = $this->_associations->keys(); <ide> } <ide><path>src/Utility/String.php <ide> public static function cleanInsert($str, array $options) { <ide> * @param array|integer $options Array of options to use, or an integer to wrap the text to. <ide> * @return string Formatted text. <ide> */ <del> public static function wrap($text, $options = array()) { <add> public static function wrap($text, $options = []) { <ide> if (is_numeric($options)) { <ide> $options = array('width' => $options); <ide> } <ide><path>src/Utility/Xml.php <ide> class Xml { <ide> * @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument <ide> * @throws \Cake\Error\XmlException <ide> */ <del> public static function build($input, $options = array()) { <del> if (!is_array($options)) { <del> $options = array('return' => (string)$options); <del> } <add> public static function build($input, array $options = []) { <ide> $defaults = array( <ide> 'return' => 'simplexml', <ide> 'loadEntities' => false, <ide> protected static function _loadXml($input, $options) { <ide> * @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument <ide> * @throws \Cake\Error\XmlException <ide> */ <del> public static function fromArray($input, $options = array()) { <del> if (!is_array($input) || count($input) !== 1) { <add> public static function fromArray(array $input, $options = array()) { <add> if (count($input) !== 1) { <ide> throw new Error\XmlException('Invalid input.'); <ide> } <ide> $key = key($input); <ide><path>src/View/Helper/FormHelper.php <ide> public function error($field, $text = null, array $options = []) { <ide> * @param string $text Text that will appear in the label field. If <ide> * $text is left undefined the text will be inflected from the <ide> * fieldName. <del> * @param array|string $options An array of HTML attributes, or a string, to be used as a class name. <add> * @param array $options An array of HTML attributes. <ide> * @return string The formatted LABEL element <ide> * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::label <ide> */ <del> public function label($fieldName, $text = null, $options = array()) { <add> public function label($fieldName, $text = null, array $options = []) { <ide> if ($text === null) { <ide> $text = $fieldName; <ide> if (substr($text, -5) === '._ids') { <ide> public function label($fieldName, $text = null, $options = array()) { <ide> $text = __(Inflector::humanize(Inflector::underscore($text))); <ide> } <ide> <del> if (is_string($options)) { <del> $options = array('class' => $options); <del> } <del> <ide> if (isset($options['for'])) { <ide> $labelFor = $options['for']; <ide> unset($options['for']); <ide> protected function _inputLabel($fieldName, $label, $options) { <ide> $labelText = $label; <ide> } <ide> <del> $labelAttributes = array_merge($labelAttributes, [ <add> $labelAttributes = [ <ide> 'for' => isset($options['id']) ? $options['id'] : null, <ide> 'input' => isset($options['input']) ? $options['input'] : null <del> ]); <add> ] + $labelAttributes; <ide> return $this->label($fieldName, $labelText, $labelAttributes); <ide> } <ide> <ide><path>src/View/Helper/IdGeneratorTrait.php <ide> protected function _clearIds() { <ide> * Ensures that id's for a given set of fields are unique. <ide> * <ide> * @param string $name The ID attribute name. <del> * @param mixed $val The ID attribute value. <add> * @param string $val The ID attribute value. <ide> * @return string Generated id. <ide> */ <ide> protected function _id($name, $val) { <ide><path>tests/TestCase/Console/ShellTest.php <ide> public function testRunCommandHittingTask() { <ide> */ <ide> public function testWrapText() { <ide> $text = 'This is the song that never ends. This is the song that never ends. This is the song that never ends.'; <del> $result = $this->Shell->wrapText($text, 33); <add> $result = $this->Shell->wrapText($text, array('width' => 33)); <ide> $expected = <<<TEXT <ide> This is the song that never ends. <ide> This is the song that never ends. <ide><path>tests/TestCase/Utility/StringTest.php <ide> public function testWrap() { <ide> This is the song th <ide> at never ends. This <ide> is the song that n <del>ever ends. This is <add>ever ends. This is <ide> the song that never <ide> ends. <ide> TEXT; <ide><path>tests/TestCase/Utility/XmlTest.php <ide> public function testBuild() { <ide> Xml::build($xml, array('return' => 'domdocument')), <ide> Xml::build(file_get_contents($xml), array('return' => 'domdocument')) <ide> ); <del> $this->assertEquals( <del> Xml::build($xml, array('return' => 'simplexml')), <del> Xml::build($xml, 'simplexml') <del> ); <ide> <ide> $xml = array('tag' => 'value'); <ide> $obj = Xml::build($xml);
35
Ruby
Ruby
add missing at_end_of_* aliases
681697813be40395ef79e1aa0d295d01d99ae596
<ide><path>activesupport/lib/active_support/core_ext/date/calculations.rb <ide> def beginning_of_day <ide> def end_of_day <ide> to_time_in_current_zone.end_of_day <ide> end <add> alias :at_end_of_day :end_of_day <ide> <ide> def plus_with_duration(other) #:nodoc: <ide> if ActiveSupport::Duration === other <ide><path>activesupport/lib/active_support/core_ext/date_time/calculations.rb <ide> def beginning_of_day <ide> def end_of_day <ide> change(:hour => 23, :min => 59, :sec => 59) <ide> end <add> alias :at_end_of_day :end_of_day <ide> <ide> # Returns a new DateTime representing the start of the hour (hh:00:00). <ide> def beginning_of_hour <ide> def beginning_of_hour <ide> def end_of_hour <ide> change(:min => 59, :sec => 59) <ide> end <add> alias :at_end_of_hour :end_of_hour <ide> <ide> # Adjusts DateTime to UTC by adding its offset value; offset is set to 0. <ide> # <ide><path>activesupport/lib/active_support/core_ext/time/calculations.rb <ide> def end_of_day <ide> :usec => Rational(999999999, 1000) <ide> ) <ide> end <add> alias :at_end_of_day :end_of_day <ide> <ide> # Returns a new Time representing the start of the hour (x:00) <ide> def beginning_of_hour <ide> def end_of_hour <ide> :usec => Rational(999999999, 1000) <ide> ) <ide> end <add> alias :at_end_of_hour :end_of_hour <ide> <ide> # Returns a Range representing the whole day of the current time. <ide> def all_day
3
Python
Python
rewrite strings to be easier to read
7b3e6fa5c8eb92eeab20bfbb6f4298d97396e103
<ide><path>numpy/f2py/tests/test_callback.py <ide> from numpy import array <ide> import math <ide> import util <add>import textwrap <ide> <ide> class TestF77Callback(util.F2PyTest): <ide> code = """ <ide> def test_all(self): <ide> <ide> @dec.slow <ide> def test_docstring(self): <del> assert_equal(self.module.t.__doc__, <del> "a = t(fun,[fun_extra_args])\n" <del> "\n" <del> "Wrapper for ``t``.\n" <del> "\n" <del> "Parameters\n" <del> "----------\n" <del> "fun : call-back function\n" <del> "\n" <del> "Other Parameters\n" <del> "----------------\n" <del> "fun_extra_args : input tuple, optional\n" <del> " Default: ()\n" <del> "\n" <del> "Returns\n-------\n" <del> "a : int\n" <del> "\n" <del> "Notes\n" <del> "-----\n" <del> "Call-back functions::\n" <del> "\n" <del> " def fun(): return a\n" <del> " Return objects:\n" <del> " a : int\n") <add> expected = """ <add> a = t(fun,[fun_extra_args]) <add> <add> Wrapper for ``t``. <add> <add> Parameters <add> ---------- <add> fun : call-back function <add> <add> Other Parameters <add> ---------------- <add> fun_extra_args : input tuple, optional <add> Default: () <add> <add> Returns <add> ------- <add> a : int <add> <add> Notes <add> ----- <add> Call-back functions:: <add> <add> def fun(): return a <add> Return objects: <add> a : int <add> """ <add> assert_equal(self.module.t.__doc__, textwrap.dedent(expected).lstrip()) <ide> <ide> def check_function(self, name): <ide> t = getattr(self.module, name) <ide><path>numpy/f2py/tests/test_mixed.py <ide> from numpy import array <ide> <ide> import util <add>import textwrap <ide> <ide> def _path(*a): <ide> return os.path.join(*((os.path.dirname(__file__),) + a)) <ide> def test_all(self): <ide> <ide> @dec.slow <ide> def test_docstring(self): <del> assert_equal(self.module.bar11.__doc__, <del> "a = bar11()\n\nWrapper for ``bar11``.\n\nReturns\n-------\na : int\n") <add> expected = """ <add> a = bar11() <add> <add> Wrapper for ``bar11``. <add> <add> Returns <add> ------- <add> a : int <add> """ <add> assert_equal(self.module.bar11.__doc__, textwrap.dedent(expected).lstrip()) <ide> <ide> if __name__ == "__main__": <ide> import nose
2
Ruby
Ruby
fix typo in generate_message documentation
f320c994dbf0c1b0c03cd2ddc64aa52a4f5859b8
<ide><path>activemodel/lib/active_model/errors.rb <ide> def full_messages(options = {}) <ide> full_messages <ide> end <ide> <del> # Translates an error message in it's default scope (<tt>activemodel.errrors.messages</tt>). <add> # Translates an error message in it's default scope (<tt>activemodel.errors.messages</tt>). <ide> # Error messages are first looked up in <tt>models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>, if it's not there, <ide> # it's looked up in <tt>models.MODEL.MESSAGE</tt> and if that is not there it returns the translation of the <ide> # default message (e.g. <tt>activemodel.errors.messages.MESSAGE</tt>). The translated model name,
1
Go
Go
simplify thin pool device id allocation
f26203cf544db07ae64dffaa495e4217976c0786
<ide><path>daemon/graphdriver/devmapper/deviceset.go <ide> type DeviceSet struct { <ide> devicePrefix string <ide> TransactionId uint64 <ide> NewTransactionId uint64 <del> nextFreeDevice int <add> nextDeviceId int <ide> } <ide> <ide> type DiskUsage struct { <ide> func (devices *DeviceSet) ensureImage(name string, size int64) (string, error) { <ide> return filename, nil <ide> } <ide> <del>func (devices *DeviceSet) allocateDeviceId() int { <del> // TODO: Add smarter reuse of deleted devices <del> id := devices.nextFreeDevice <del> devices.nextFreeDevice = devices.nextFreeDevice + 1 <del> return id <del>} <del> <ide> func (devices *DeviceSet) allocateTransactionId() uint64 { <ide> devices.NewTransactionId = devices.NewTransactionId + 1 <ide> return devices.NewTransactionId <ide> func (devices *DeviceSet) loadMetaData() error { <ide> d.Hash = hash <ide> d.devices = devices <ide> <del> if d.DeviceId >= devices.nextFreeDevice { <del> devices.nextFreeDevice = d.DeviceId + 1 <del> } <del> <ide> // If the transaction id is larger than the actual one we lost the device due to some crash <ide> if d.TransactionId > devices.TransactionId { <ide> utils.Debugf("Removing lost device %s with id %d", hash, d.TransactionId) <ide> func (devices *DeviceSet) setupBaseImage() error { <ide> <ide> utils.Debugf("Initializing base device-manager snapshot") <ide> <del> id := devices.allocateDeviceId() <add> id := devices.nextDeviceId <ide> <ide> // Create initial device <del> if err := createDevice(devices.getPoolDevName(), id); err != nil { <add> if err := createDevice(devices.getPoolDevName(), &id); err != nil { <ide> utils.Debugf("\n--->Err: %s\n", err) <ide> return err <ide> } <ide> <add> // Ids are 24bit, so wrap around <add> devices.nextDeviceId = (id + 1) & 0xffffff <add> <ide> utils.Debugf("Registering base device (id %v) with FS size %v", id, DefaultBaseFsSize) <ide> info, err := devices.registerDevice(id, "", DefaultBaseFsSize) <ide> if err != nil { <ide> func (devices *DeviceSet) AddDevice(hash, baseHash string) error { <ide> return fmt.Errorf("device %s already exists", hash) <ide> } <ide> <del> deviceId := devices.allocateDeviceId() <add> deviceId := devices.nextDeviceId <ide> <del> if err := createSnapDevice(devices.getPoolDevName(), deviceId, baseInfo.Name(), baseInfo.DeviceId); err != nil { <add> if err := createSnapDevice(devices.getPoolDevName(), &deviceId, baseInfo.Name(), baseInfo.DeviceId); err != nil { <ide> utils.Debugf("Error creating snap device: %s\n", err) <ide> return err <ide> } <ide> <add> // Ids are 24bit, so wrap around <add> devices.nextDeviceId = (deviceId + 1) & 0xffffff <add> <ide> if _, err := devices.registerDevice(deviceId, hash, baseInfo.Size); err != nil { <ide> deleteDevice(devices.getPoolDevName(), deviceId) <ide> utils.Debugf("Error registering device: %s\n", err) <ide><path>daemon/graphdriver/devmapper/devmapper.go <ide> var ( <ide> ErrLoopbackSetCapacity = errors.New("Unable set loopback capacity") <ide> ErrBusy = errors.New("Device is Busy") <ide> <del> dmSawBusy bool <add> dmSawBusy bool <add> dmSawExist bool <ide> ) <ide> <ide> type ( <ide> func resumeDevice(name string) error { <ide> return nil <ide> } <ide> <del>func createDevice(poolName string, deviceId int) error { <del> utils.Debugf("[devmapper] createDevice(poolName=%v, deviceId=%v)", poolName, deviceId) <del> task, err := createTask(DeviceTargetMsg, poolName) <del> if task == nil { <del> return err <del> } <add>func createDevice(poolName string, deviceId *int) error { <add> utils.Debugf("[devmapper] createDevice(poolName=%v, deviceId=%v)", poolName, *deviceId) <ide> <del> if err := task.SetSector(0); err != nil { <del> return fmt.Errorf("Can't set sector") <del> } <add> for { <add> task, err := createTask(DeviceTargetMsg, poolName) <add> if task == nil { <add> return err <add> } <ide> <del> if err := task.SetMessage(fmt.Sprintf("create_thin %d", deviceId)); err != nil { <del> return fmt.Errorf("Can't set message") <del> } <add> if err := task.SetSector(0); err != nil { <add> return fmt.Errorf("Can't set sector") <add> } <ide> <del> if err := task.Run(); err != nil { <del> return fmt.Errorf("Error running createDevice") <add> if err := task.SetMessage(fmt.Sprintf("create_thin %d", *deviceId)); err != nil { <add> return fmt.Errorf("Can't set message") <add> } <add> <add> dmSawExist = false <add> if err := task.Run(); err != nil { <add> if dmSawExist { <add> // Already exists, try next id <add> *deviceId++ <add> continue <add> } <add> return fmt.Errorf("Error running createDevice") <add> } <add> break <ide> } <ide> return nil <ide> } <ide> func activateDevice(poolName string, name string, deviceId int, size uint64) err <ide> return nil <ide> } <ide> <del>func createSnapDevice(poolName string, deviceId int, baseName string, baseDeviceId int) error { <add>func createSnapDevice(poolName string, deviceId *int, baseName string, baseDeviceId int) error { <ide> devinfo, _ := getInfo(baseName) <ide> doSuspend := devinfo != nil && devinfo.Exists != 0 <ide> <ide> func createSnapDevice(poolName string, deviceId int, baseName string, baseDevice <ide> } <ide> } <ide> <del> task, err := createTask(DeviceTargetMsg, poolName) <del> if task == nil { <del> if doSuspend { <del> resumeDevice(baseName) <add> for { <add> task, err := createTask(DeviceTargetMsg, poolName) <add> if task == nil { <add> if doSuspend { <add> resumeDevice(baseName) <add> } <add> return err <ide> } <del> return err <del> } <ide> <del> if err := task.SetSector(0); err != nil { <del> if doSuspend { <del> resumeDevice(baseName) <add> if err := task.SetSector(0); err != nil { <add> if doSuspend { <add> resumeDevice(baseName) <add> } <add> return fmt.Errorf("Can't set sector") <ide> } <del> return fmt.Errorf("Can't set sector") <del> } <ide> <del> if err := task.SetMessage(fmt.Sprintf("create_snap %d %d", deviceId, baseDeviceId)); err != nil { <del> if doSuspend { <del> resumeDevice(baseName) <add> if err := task.SetMessage(fmt.Sprintf("create_snap %d %d", *deviceId, baseDeviceId)); err != nil { <add> if doSuspend { <add> resumeDevice(baseName) <add> } <add> return fmt.Errorf("Can't set message") <ide> } <del> return fmt.Errorf("Can't set message") <del> } <ide> <del> if err := task.Run(); err != nil { <del> if doSuspend { <del> resumeDevice(baseName) <add> dmSawExist = false <add> if err := task.Run(); err != nil { <add> if dmSawExist { <add> // Already exists, try next id <add> *deviceId++ <add> continue <add> } <add> <add> if doSuspend { <add> resumeDevice(baseName) <add> } <add> return fmt.Errorf("Error running DeviceCreate (createSnapDevice)") <ide> } <del> return fmt.Errorf("Error running DeviceCreate (createSnapDevice)") <add> <add> break <ide> } <ide> <ide> if doSuspend { <ide><path>daemon/graphdriver/devmapper/devmapper_log.go <ide> func DevmapperLogCallback(level C.int, file *C.char, line C.int, dm_errno_or_cla <ide> if strings.Contains(msg, "busy") { <ide> dmSawBusy = true <ide> } <add> <add> if strings.Contains(msg, "File exists") { <add> dmSawExist = true <add> } <ide> } <ide> <ide> if dmLogger != nil {
3
PHP
PHP
fix failing test
3184535ac7944fb5eea96f5888f94986f802aca1
<ide><path>lib/Cake/Test/TestCase/TestSuite/TestFixtureTest.php <ide> public function testInitImport() { <ide> 'title', <ide> 'body', <ide> 'published', <del> 'created', <del> 'updated', <ide> ]; <ide> $this->assertEquals($expected, $fixture->schema()->columns()); <ide> }
1
Ruby
Ruby
reset template assertions without warnings
e275479ce5ea6126aa1dc2f964b6d06d07098e00
<ide><path>actionpack/lib/action_controller/test_case.rb <ide> def process(*args) <ide> <ide> def reset_template_assertion <ide> RENDER_TEMPLATE_INSTANCE_VARIABLES.each do |instance_variable| <del> ivar = instance_variable_get("@_#{instance_variable}") <del> ivar.clear if ivar <add> ivar_name = "@_#{instance_variable}" <add> if instance_variable_defined?(ivar_name) <add> instance_variable_get(ivar_name).clear <add> end <ide> end <ide> end <ide>
1
Javascript
Javascript
fix issue 89, parsing responses to head requests
15ec99ec5945c07616cd9299e126e9919bc9c8cc
<ide><path>lib/http.js <ide> var parsers = new FreeList('parsers', 1000, function () { <ide> <ide> parser.incoming.upgrade = info.upgrade; <ide> <add> var isHeadResponse = false; <add> <ide> if (!info.upgrade) { <ide> // For upgraded connections, we'll emit this after parser.execute <ide> // so that we can capture the first part of the new protocol <del> parser.onIncoming(parser.incoming, info.shouldKeepAlive); <add> isHeadResponse = parser.onIncoming(parser.incoming, info.shouldKeepAlive); <ide> } <ide> <del> return false; // Is response to HEAD request? <add> return isHeadResponse; <ide> }; <ide> <ide> parser.onBody = function (b, start, len) { <ide> ServerResponse.prototype.writeHeader = function () { <ide> function ClientRequest (socket, method, url, headers) { <ide> OutgoingMessage.call(this, socket); <ide> <add> this.method = method; <ide> this.shouldKeepAlive = false; <ide> if (method === "GET" || method === "HEAD") { <ide> this.useChunkedEncodingByDefault = false; <ide> function connectionListener (socket) { <ide> responses.push(res); <ide> <ide> self.emit('request', req, res); <add> return false; // Not a HEAD response. (Not even a response!) <ide> }; <ide> } <ide> <ide> function Client ( ) { <ide> if (!parser) parser = parsers.alloc(); <ide> parser.reinitialize('response'); <ide> parser.socket = self; <add> parser.reqs = []; // list of request methods <ide> parser.onIncoming = function (res) { <ide> debug("incoming response!"); <ide> <add> var isHeadResponse = currentRequest.method == "HEAD"; <add> debug('isHeadResponse ' + isHeadResponse); <add> <ide> res.addListener('end', function ( ) { <ide> debug("request complete disconnecting. readyState = " + self.readyState); <ide> self.end(); <ide> }); <ide> <ide> currentRequest.emit("response", res); <add> <add> return isHeadResponse; <ide> }; <ide> }; <ide> <ide><path>test/simple/test-http-head-request.js <add>require('../common'); <add> <add>assert = require("assert"); <add>http = require("http"); <add>sys = require("sys"); <add> <add> <add>body = "hello world\n"; <add> <add>server = http.createServer(function (req, res) { <add> error('req: ' + req.method); <add> res.writeHead(200, {"Content-Length": body.length}); <add> res.end(); <add> server.close(); <add>}); <add>server.listen(PORT); <add> <add>var gotEnd = false; <add> <add>server.addListener('listening', function () { <add> var client = http.createClient(PORT); <add> var request = client.request("HEAD", "/"); <add> request.addListener('response', function (response) { <add> error('response start'); <add> response.addListener("end", function () { <add> error('response end'); <add> gotEnd = true; <add> }); <add> }); <add> request.end(); <add>}); <add> <add>process.addListener('exit', function () { <add> assert.ok(gotEnd); <add>});
2
Ruby
Ruby
remove redundant calls to stringify_keys
759815547bf85167e97b3cdbff2f1e8d33e218e4
<ide><path>actionpack/lib/action_view/helpers/form_tag_helper.rb <ide> def submit_tag(value = "Save changes", options = {}) <ide> options["data-confirm"] = confirm <ide> end <ide> <del> tag :input, { "type" => "submit", "name" => "commit", "value" => value }.update(options.stringify_keys) <add> tag :input, { "type" => "submit", "name" => "commit", "value" => value }.update(options) <ide> end <ide> <ide> # Creates a button element that defines a <tt>submit</tt> button, <ide> def image_submit_tag(source, options = {}) <ide> options["data-confirm"] = confirm <ide> end <ide> <del> tag :input, { "type" => "image", "src" => path_to_image(source) }.update(options.stringify_keys) <add> tag :input, { "type" => "image", "src" => path_to_image(source) }.update(options) <ide> end <ide> <ide> # Creates a field set for grouping HTML form elements.
1
Mixed
Ruby
remove redundant suffixes on generated helpers
886ac1c3087f8ac06bee371af54758fb02760e63
<ide><path>railties/CHANGELOG.md <add>* Remove redundant suffixes on generated helpers. <add> <add> *Gannon McGibbon* <add> <ide> * Fix boolean interaction in scaffold system tests. <ide> <ide> *Gannon McGibbon* <ide><path>railties/lib/rails/generators/rails/helper/helper_generator.rb <ide> def create_helper_files <ide> end <ide> <ide> hook_for :test_framework <add> <add> private <add> def file_name <add> @_file_name ||= super.sub(/_helper\z/i, "") <add> end <ide> end <ide> end <ide> end <ide><path>railties/test/generators/helper_generator_test.rb <ide> def test_namespaced_and_not_namespaced_helpers <ide> end <ide> end <ide> end <add> <add> def test_helper_suffix_is_not_duplicated <add> run_generator %w(products_helper) <add> <add> assert_no_file "app/helpers/products_helper_helper.rb" <add> assert_file "app/helpers/products_helper.rb" <add> end <ide> end
3
Ruby
Ruby
remove unnecessary tap_args
2c25303949a9fa091868cbdd42fd4ff4877869fc
<ide><path>Library/Homebrew/cmd/readall.rb <ide> def readall <ide> if ARGV.named.empty? <ide> formulae = Formula.files <ide> else <del> tap = Tap.fetch(*tap_args) <add> tap = Tap.fetch(ARGV.named.first) <ide> raise TapUnavailableError, tap.name unless tap.installed? <ide> formulae = tap.formula_files <ide> end <ide><path>Library/Homebrew/cmd/tap-info.rb <del>require "cmd/tap" <add>require "tap" <ide> <ide> module Homebrew <ide> def tap_info <ide> if ARGV.include? "--installed" <ide> taps = Tap <ide> else <ide> taps = ARGV.named.map do |name| <del> Tap.fetch(*tap_args(name)) <add> Tap.fetch(name) <ide> end <ide> end <ide> <add> raise "Homebrew/homebrew is not allowed" if taps.any?(&:core_formula_repository?) <add> <ide> if ARGV.json == "v1" <ide> print_tap_json(taps) <ide> else <ide><path>Library/Homebrew/cmd/tap-pin.rb <del>require "cmd/tap" <add>require "tap" <ide> <ide> module Homebrew <ide> def tap_pin <ide> ARGV.named.each do |name| <del> tap = Tap.fetch(*tap_args(name)) <add> tap = Tap.fetch(name) <add> raise "Homebrew/homebrew is not allowed" if tap.core_formula_repository? <ide> tap.pin <ide> ohai "Pinned #{tap.name}" <ide> end <ide><path>Library/Homebrew/cmd/tap-unpin.rb <del>require "cmd/tap" <add>require "tap" <ide> <ide> module Homebrew <ide> def tap_unpin <ide> ARGV.named.each do |name| <del> tap = Tap.fetch(*tap_args(name)) <add> tap = Tap.fetch(name) <add> raise "Homebrew/homebrew is not allowed" if tap.core_formula_repository? <ide> tap.unpin <ide> ohai "Unpinned #{tap.name}" <ide> end <ide><path>Library/Homebrew/cmd/tap.rb <ide> def tap <ide> elsif ARGV.first == "--list-pinned" <ide> puts Tap.select(&:pinned?).map(&:name) <ide> else <del> user, repo = tap_args <del> tap = Tap.fetch(user, repo) <add> tap = Tap.fetch(ARGV.named[0]) <ide> begin <ide> tap.install(:clone_target => ARGV.named[1], <ide> :full_clone => ARGV.include?("--full")) <ide> def migrate_taps(options = {}) <ide> (HOMEBREW_LIBRARY/"Formula").children.each { |c| c.unlink if c.symlink? } <ide> ignore.unlink if ignore.exist? <ide> end <del> <del> private <del> <del> def tap_args(tap_name = ARGV.named.first) <del> tap_name =~ HOMEBREW_TAP_ARGS_REGEX <del> raise "Invalid tap name" unless $1 && $3 <del> [$1, $3] <del> end <ide> end <ide><path>Library/Homebrew/cmd/test-bot.rb <ide> module Homebrew <ide> <ide> def resolve_test_tap <ide> tap = ARGV.value("tap") <del> return Tap.fetch(*tap_args(tap)) if tap <add> if tap <add> tap = Tap.fetch(tap) <add> return tap unless tap.core_formula_repository? <add> end <ide> <ide> if ENV["UPSTREAM_BOT_PARAMS"] <ide> bot_argv = ENV["UPSTREAM_BOT_PARAMS"].split " " <ide> bot_argv.extend HomebrewArgvExtension <ide> tap = bot_argv.value("tap") <del> return Tap.fetch(*tap_args(tap)) if tap <add> if tap <add> tap = Tap.fetch(tap) <add> return tap unless tap.core_formula_repository? <add> end <ide> end <ide> <ide> if git_url = ENV["UPSTREAM_GIT_URL"] || ENV["GIT_URL"] <ide> # Also can get tap from Jenkins GIT_URL. <ide> url_path = git_url.sub(%r{^https?://github\.com/}, "").chomp("/") <del> HOMEBREW_TAP_ARGS_REGEX =~ url_path <del> return Tap.fetch($1, $3) if $1 && $3 && $3 != "homebrew" <add> begin <add> tap = Tap.fetch(tap) <add> return tap unless tap.core_formula_repository? <add> rescue <add> end <ide> end <ide> <ide> # return nil means we are testing core repo. <ide><path>Library/Homebrew/cmd/untap.rb <del>require "cmd/tap" # for tap_args <add>require "tap" <ide> <ide> module Homebrew <ide> def untap <ide> raise "Usage is `brew untap <tap-name>`" if ARGV.empty? <ide> <ide> ARGV.named.each do |tapname| <del> tap = Tap.fetch(*tap_args(tapname)) <add> tap = Tap.fetch(tapname) <add> raise "Homebrew/homebrew is not allowed" if tap.core_formula_repository? <ide> tap.uninstall <ide> end <ide> end <ide><path>Library/Homebrew/tap_constants.rb <del># match expressions when taps are given as ARGS, e.g. someuser/sometap <del>HOMEBREW_TAP_ARGS_REGEX = %r{^([\w-]+)/(homebrew-)?([\w-]+)$} <ide> # match taps' formulae, e.g. someuser/sometap/someformula <ide> HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.]+)$} <ide> # match core's formulae, e.g. homebrew/homebrew/someformula
8
PHP
PHP
fix incorrect namespace
0a24ca3c4e12c7cfe2d2bb46f84075bf63c5fdf9
<ide><path>src/TestSuite/ControllerTestCase.php <ide> abstract class ControllerTestCase extends TestCase { <ide> * @param string $name The name of the function <ide> * @param array $arguments Array of arguments <ide> * @return the return of _testAction <del> * @throws \Cake\Error\BadMethodCallException when you call methods that don't exist. <add> * @throws \BadMethodCallException when you call methods that don't exist. <ide> */ <ide> public function __call($name, $arguments) { <ide> if ($name === 'testAction') { <ide> return call_user_func_array(array($this, '_testAction'), $arguments); <ide> } <del> throw new Error\BadMethodCallException("Method '{$name}' does not exist."); <add> throw new \BadMethodCallException("Method '{$name}' does not exist."); <ide> } <ide> <ide> /**
1
Ruby
Ruby
simplify link_to using content_tag
e2f5f01675f3c575e820532ab7cce6fe068ecb28
<ide><path>actionpack/lib/action_view/helpers/url_helper.rb <ide> def url_for(options = nil) <ide> # link_to("Destroy", "http://www.example.com", :method => :delete, :confirm => "Are you sure?") <ide> # # => <a href='http://www.example.com' rel="nofollow" data-method="delete" data-confirm="Are you sure?">Destroy</a> <ide> def link_to(name = nil, options = nil, html_options = nil, &block) <del> if block_given? <del> html_options, options = options, name <del> link_to(capture(&block), options, html_options) <del> else <del> options ||= {} <del> html_options = convert_options_to_data_attributes(options, html_options) <add> html_options, options = options, name if block_given? <add> options ||= {} <add> url = url_for(options) <ide> <del> url = url_for(options) <del> href = html_options['href'] <del> tag_options = tag_options(html_options) <add> html_options = convert_options_to_data_attributes(options, html_options) <add> html_options['href'] ||= url <ide> <del> href_attr = "href=\"#{ERB::Util.html_escape(url)}\"" unless href <del> "<a #{href_attr}#{tag_options}>#{ERB::Util.html_escape(name || url)}</a>".html_safe <del> end <add> content_tag(:a, name || url, html_options, &block) <ide> end <ide> <ide> # Generates a form containing a single button that submits to the URL created <ide><path>actionpack/test/template/url_helper_test.rb <ide> def test_link_tag_using_delete_javascript_and_href_and_confirm <ide> ) <ide> end <ide> <add> def test_link_tag_with_block <add> assert_dom_equal '<a href="/"><span>Example site</span></a>', <add> link_to('/') { content_tag(:span, 'Example site') } <add> end <add> <add> def test_link_tag_with_block_and_html_options <add> assert_dom_equal '<a class="special" href="/"><span>Example site</span></a>', <add> link_to('/', :class => "special") { content_tag(:span, 'Example site') } <add> end <add> <ide> def test_link_tag_using_block_in_erb <ide> out = render_erb %{<%= link_to('/') do %>Example site<% end %>} <ide> assert_equal '<a href="/">Example site</a>', out <ide> def test_link_tag_with_html_safe_string <ide> ) <ide> end <ide> <add> def test_link_tag_escapes_content <add> assert_dom_equal '<a href="/">Malicious &lt;script&gt;content&lt;/script&gt;</a>', <add> link_to("Malicious <script>content</script>", "/") <add> end <add> <add> def test_link_tag_does_not_escape_html_safe_content <add> assert_dom_equal '<a href="/">Malicious <script>content</script></a>', <add> link_to("Malicious <script>content</script>".html_safe, "/") <add> end <add> <ide> def test_link_to_unless <ide> assert_equal "Showing", link_to_unless(true, "Showing", url_hash) <ide>
2
Python
Python
fix train cli
50c0e49741437c3475bc6527d4f1fed739bd3474
<ide><path>spacy/cli/train.py <ide> def train( <ide> max_steps=T_cfg["max_steps"], <ide> eval_frequency=T_cfg["eval_frequency"], <ide> raw_text=None, <add> exclude=frozen_components <ide> ) <ide> msg.info(f"Training. Initial learn rate: {optimizer.learn_rate}") <ide> print_row = setup_printer(T_cfg, nlp)
1
Javascript
Javascript
define mix as const
deef01d5a204447625bb899fa640defd53b1f9d7
<ide><path>webpack.mix.js <del>let mix = require('laravel-mix'); <add>const mix = require('laravel-mix'); <ide> <ide> /* <ide> |--------------------------------------------------------------------------
1
Javascript
Javascript
remove errant console.log
1ec3ef743358171b8f64e589d96c23ba8bcd3369
<ide><path>controllers/resources.js <ide> module.exports = { <ide> <ide> unsubscribe: function unsubscribe(req, res) { <ide> User.findOne({email: req.params.email}, function(err, user) { <del> console.log('---------'); <del> console.log(req.params); <del> console.log('---------'); <del> console.log(user); <ide> if (user) { <ide> if (err) { <ide> return next(err);
1
PHP
PHP
add container support to commandfactory
2ed167222eb070109d81ece4fb68415c290c4b32
<ide><path>src/Console/CommandFactory.php <ide> */ <ide> namespace Cake\Console; <ide> <add>use Cake\Core\ContainerInterface; <ide> use InvalidArgumentException; <ide> <ide> /** <ide> */ <ide> class CommandFactory implements CommandFactoryInterface <ide> { <add> /** <add> * @var \Cake\Core\ContainerInterface|null <add> */ <add> protected $container; <add> <add> /** <add> * Constructor <add> * <add> * @param \Cake\Core\ContainerInterface $container The container to use if available. <add> */ <add> public function __construct(?ContainerInterface $container = null) <add> { <add> $this->container = $container; <add> } <add> <ide> /** <ide> * @inheritDoc <ide> */ <ide> public function create(string $className) <ide> { <del> $command = new $className(); <add> if ($this->container && $this->container->has($className)) { <add> $command = $this->container->get($className); <add> } else { <add> $command = new $className(); <add> } <add> <ide> if (!($command instanceof CommandInterface) && !($command instanceof Shell)) { <ide> /** @psalm-suppress DeprecatedClass */ <ide> $valid = implode('` or `', [Shell::class, CommandInterface::class]); <ide><path>src/Console/CommandRunner.php <ide> use Cake\Console\Exception\MissingOptionException; <ide> use Cake\Console\Exception\StopException; <ide> use Cake\Core\ConsoleApplicationInterface; <add>use Cake\Core\ContainerApplicationInterface; <ide> use Cake\Core\PluginApplicationInterface; <ide> use Cake\Event\EventDispatcherInterface; <ide> use Cake\Event\EventDispatcherTrait; <ide> public function __construct( <ide> ) { <ide> $this->app = $app; <ide> $this->root = $root; <del> $this->factory = $factory ?: new CommandFactory(); <add> $this->factory = $factory; <ide> $this->aliases = [ <ide> '--version' => 'version', <ide> '--help' => 'help', <ide> protected function runShell(Shell $shell, array $argv) <ide> */ <ide> protected function createCommand(string $className, ConsoleIo $io) <ide> { <add> if (!$this->factory) { <add> $container = null; <add> if ($this->app instanceof ContainerApplicationInterface) { <add> $container = $this->app->getContainer(); <add> } <add> $this->factory = new CommandFactory($container); <add> } <add> <ide> $shell = $this->factory->create($className); <ide> if ($shell instanceof Shell) { <ide> $shell->setIo($io); <ide><path>tests/TestCase/Console/CommandFactoryTest.php <ide> <ide> use Cake\Console\CommandFactory; <ide> use Cake\Console\CommandInterface; <add>use Cake\Core\Container; <ide> use Cake\TestSuite\TestCase; <ide> use InvalidArgumentException; <add>use stdClass; <ide> use TestApp\Command\DemoCommand; <add>use TestApp\Command\DependencyCommand; <ide> use TestApp\Shell\SampleShell; <ide> <ide> class CommandFactoryTest extends TestCase <ide> public function testCreateCommand() <ide> $this->assertInstanceOf(CommandInterface::class, $command); <ide> } <ide> <add> public function testCreateCommandDependencies() <add> { <add> $container = new Container(); <add> $container->add(stdClass::class, json_decode('{"key":"value"}')); <add> $container->add(DependencyCommand::class) <add> ->addArgument(stdClass::class); <add> $factory = new CommandFactory($container); <add> <add> $command = $factory->create(DependencyCommand::class); <add> $this->assertInstanceOf(DependencyCommand::class, $command); <add> $this->assertInstanceOf(stdClass::class, $command->inject); <add> } <add> <ide> public function testCreateShell() <ide> { <ide> $factory = new CommandFactory(); <ide><path>tests/TestCase/Console/CommandRunnerTest.php <ide> use InvalidArgumentException; <ide> use TestApp\Command\AbortCommand; <ide> use TestApp\Command\DemoCommand; <add>use TestApp\Command\DependencyCommand; <ide> use TestApp\Shell\SampleShell; <ide> <ide> /** <ide> public function testRunWithCustomFactory() <ide> $this->assertStringContainsString('Demo Command!', $messages); <ide> } <ide> <add> public function testRunWithContainerDependencies() <add> { <add> $app = $this->makeAppWithCommands([ <add> 'dependency' => DependencyCommand::class, <add> ]); <add> $container = $app->getContainer(); <add> $container->add(stdClass::class, json_decode('{"key":"value"}')); <add> $container->add(DependencyCommand::class) <add> ->addArgument(stdClass::class); <add> <add> $output = new ConsoleOutput(); <add> <add> $runner = new CommandRunner($app, 'cake'); <add> $result = $runner->run(['cake', 'dependency'], $this->getMockIo($output)); <add> $this->assertSame(Shell::CODE_SUCCESS, $result); <add> <add> $messages = implode("\n", $output->messages()); <add> $this->assertStringContainsString('Dependency Command', $messages); <add> $this->assertStringContainsString('constructor inject: stdClass', $messages); <add> } <add> <ide> /** <ide> * Test running a command class' help <ide> * <ide><path>tests/test_app/TestApp/Command/DependencyCommand.php <add><?php <add>declare(strict_types=1); <add> <add>namespace TestApp\Command; <add> <add>use Cake\Command\Command; <add>use Cake\Console\Arguments; <add>use Cake\Console\ConsoleIo; <add>use stdClass; <add> <add>class DependencyCommand extends Command <add>{ <add> public $inject; <add> <add> public function __construct(stdClass $inject) <add> { <add> parent::__construct(); <add> $this->inject = $inject; <add> } <add> <add> public function execute(Arguments $args, ConsoleIo $io): ?int <add> { <add> $io->out('Dependency Command'); <add> $io->out('constructor inject: ' . get_class($this->inject)); <add> <add> return static::CODE_SUCCESS; <add> } <add>}
5
Javascript
Javascript
use `packagename` instead of hardcoding it
723495850ba64236f9259d8b3cd3d5e61afbe0cd
<ide><path>bin/transpile-packages.js <ide> ES6Package.prototype = { <ide> <ide> <ide> ['container'].forEach(function(packageName) { <del> pkg = new ES6Package('container'); <add> pkg = new ES6Package(packageName); <ide> pkg.process(); <ide> });
1
Javascript
Javascript
simplify some regular expressions
c42887221a268a6e84f41ab8c046d0f7ae93effe
<ide><path>src/core/core_utils.js <ide> function isWhiteSpace(ch) { <ide> * each part of the path. <ide> */ <ide> function parseXFAPath(path) { <del> const positionPattern = /(.+)\[([0-9]+)\]$/; <add> const positionPattern = /(.+)\[(\d+)\]$/; <ide> return path.split(".").map(component => { <ide> const m = component.match(positionPattern); <ide> if (m) { <ide> function validateCSSFont(cssFontInfo) { <ide> } else { <ide> // See https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident. <ide> for (const ident of fontFamily.split(/[ \t]+/)) { <del> if ( <del> /^([0-9]|(-([0-9]|-)))/.test(ident) || <del> !/^[a-zA-Z0-9\-_\\]+$/.test(ident) <del> ) { <add> if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) { <ide> warn( <ide> `XFA - FontFamily contains some invalid <custom-ident>: ${fontFamily}.` <ide> ); <ide><path>src/core/document.js <ide> const FINGERPRINT_FIRST_BYTES = 1024; <ide> const EMPTY_FINGERPRINT = <ide> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; <ide> <del>const PDF_HEADER_VERSION_REGEXP = /^[1-9]\.[0-9]$/; <add>const PDF_HEADER_VERSION_REGEXP = /^[1-9]\.\d$/; <ide> <ide> function find(stream, signature, limit = 1024, backwards = false) { <ide> if ( <ide> class PDFDocument { <ide> } <ide> let fontFamily = descriptor.get("FontFamily"); <ide> // For example, "Wingdings 3" is not a valid font name in the css specs. <del> fontFamily = fontFamily.replace(/[ ]+([0-9])/g, "$1"); <add> fontFamily = fontFamily.replace(/[ ]+(\d)/g, "$1"); <ide> const fontWeight = descriptor.get("FontWeight"); <ide> <ide> // Angle is expressed in degrees counterclockwise in PDF <ide><path>src/core/xfa/formcalc_lexer.js <ide> const TOKEN = { <ide> }; <ide> <ide> const hexPattern = /^[uU]([0-9a-fA-F]{4,8})/; <del>const numberPattern = /^[0-9]*(?:\.[0-9]*)?(?:[Ee][+-]?[0-9]+)?/; <del>const dotNumberPattern = /^[0-9]*(?:[Ee][+-]?[0-9]+)?/; <add>const numberPattern = /^\d*(?:\.\d*)?(?:[Ee][+-]?\d+)?/; <add>const dotNumberPattern = /^\d*(?:[Ee][+-]?\d+)?/; <ide> const eolPattern = /[\r\n]+/; <ide> const identifierPattern = new RegExp("^[\\p{L}_$!][\\p{L}\\p{N}_$]*", "u"); <ide> <ide><path>src/core/xfa/template.js <ide> class Barcode extends XFAObject { <ide> "shift-jis", <ide> "ucs-2", <ide> "utf-16", <del> ].includes(k) || k.match(/iso-8859-[0-9]{2}/), <add> ].includes(k) || k.match(/iso-8859-\d{2}/), <ide> }); <ide> this.checksum = getStringOption(attributes.checksum, [ <ide> "none", <ide> class Submit extends XFAObject { <ide> "shift-jis", <ide> "ucs-2", <ide> "utf-16", <del> ].includes(k) || k.match(/iso-8859-[0-9]{2}/), <add> ].includes(k) || k.match(/iso-8859-\d{2}/), <ide> }); <ide> this.use = attributes.use || ""; <ide> this.usehref = attributes.usehref || ""; <ide><path>src/core/xfa/utils.js <ide> const dimConverters = { <ide> in: x => x * 72, <ide> px: x => x, <ide> }; <del>const measurementPattern = /([+-]?[0-9]+\.?[0-9]*)(.*)/; <add>const measurementPattern = /([+-]?\d+\.?\d*)(.*)/; <ide> <ide> function stripQuotes(str) { <ide> if (str.startsWith("'") || str.startsWith('"')) { <ide><path>src/scripting_api/aform.js <ide> class AForm { <ide> str = `0${str}`; <ide> } <ide> <del> const numbers = str.match(/([0-9]+)/g); <add> const numbers = str.match(/(\d+)/g); <ide> if (numbers.length === 0) { <ide> return null; <ide> } <ide> class AForm { <ide> if (sepStyle > 1) { <ide> // comma sep <ide> pattern = event.willCommit <del> ? /^[+-]?([0-9]+(,[0-9]*)?|,[0-9]+)$/ <del> : /^[+-]?[0-9]*,?[0-9]*$/; <add> ? /^[+-]?(\d+(,\d*)?|,\d+)$/ <add> : /^[+-]?\d*,?\d*$/; <ide> } else { <ide> // dot sep <ide> pattern = event.willCommit <del> ? /^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)$/ <del> : /^[+-]?[0-9]*\.?[0-9]*$/; <add> ? /^[+-]?(\d+(\.\d*)?|\.\d+)$/ <add> : /^[+-]?\d*\.?\d*$/; <ide> } <ide> <ide> if (!pattern.test(value)) { <ide><path>src/scripting_api/util.js <ide> class Util extends PDFObject { <ide> throw new TypeError("First argument of printf must be a string"); <ide> } <ide> <del> const pattern = /%(,[0-4])?([+ 0#]+)?([0-9]+)?(\.[0-9]+)?(.)/g; <add> const pattern = /%(,[0-4])?([+ 0#]+)?(\d+)?(\.\d+)?(.)/g; <ide> const PLUS = 1; <ide> const SPACE = 2; <ide> const ZERO = 4; <ide> class Util extends PDFObject { <ide> }, <ide> }, <ide> mm: { <del> pattern: `([0-9]{2})`, <add> pattern: `(\\d{2})`, <ide> action: (value, data) => { <ide> data.month = parseInt(value) - 1; <ide> }, <ide> }, <ide> m: { <del> pattern: `([0-9]{1,2})`, <add> pattern: `(\\d{1,2})`, <ide> action: (value, data) => { <ide> data.month = parseInt(value) - 1; <ide> }, <ide> class Util extends PDFObject { <ide> }, <ide> }, <ide> dd: { <del> pattern: "([0-9]{2})", <add> pattern: "(\\d{2})", <ide> action: (value, data) => { <ide> data.day = parseInt(value); <ide> }, <ide> }, <ide> d: { <del> pattern: "([0-9]{1,2})", <add> pattern: "(\\d{1,2})", <ide> action: (value, data) => { <ide> data.day = parseInt(value); <ide> }, <ide> }, <ide> yyyy: { <del> pattern: "([0-9]{4})", <add> pattern: "(\\d{4})", <ide> action: (value, data) => { <ide> data.year = parseInt(value); <ide> }, <ide> }, <ide> yy: { <del> pattern: "([0-9]{2})", <add> pattern: "(\\d{2})", <ide> action: (value, data) => { <ide> data.year = 2000 + parseInt(value); <ide> }, <ide> }, <ide> HH: { <del> pattern: "([0-9]{2})", <add> pattern: "(\\d{2})", <ide> action: (value, data) => { <ide> data.hours = parseInt(value); <ide> }, <ide> }, <ide> H: { <del> pattern: "([0-9]{1,2})", <add> pattern: "(\\d{1,2})", <ide> action: (value, data) => { <ide> data.hours = parseInt(value); <ide> }, <ide> }, <ide> hh: { <del> pattern: "([0-9]{2})", <add> pattern: "(\\d{2})", <ide> action: (value, data) => { <ide> data.hours = parseInt(value); <ide> }, <ide> }, <ide> h: { <del> pattern: "([0-9]{1,2})", <add> pattern: "(\\d{1,2})", <ide> action: (value, data) => { <ide> data.hours = parseInt(value); <ide> }, <ide> }, <ide> MM: { <del> pattern: "([0-9]{2})", <add> pattern: "(\\d{2})", <ide> action: (value, data) => { <ide> data.minutes = parseInt(value); <ide> }, <ide> }, <ide> M: { <del> pattern: "([0-9]{1,2})", <add> pattern: "(\\d{1,2})", <ide> action: (value, data) => { <ide> data.minutes = parseInt(value); <ide> }, <ide> }, <ide> ss: { <del> pattern: "([0-9]{2})", <add> pattern: "(\\d{2})", <ide> action: (value, data) => { <ide> data.seconds = parseInt(value); <ide> }, <ide> }, <ide> s: { <del> pattern: "([0-9]{1,2})", <add> pattern: "(\\d{1,2})", <ide> action: (value, data) => { <ide> data.seconds = parseInt(value); <ide> }, <ide><path>test/unit/annotation_spec.js <ide> describe("annotation", function () { <ide> expect(oldData.ref).toEqual(Ref.get(123, 0)); <ide> expect(newData.ref).toEqual(Ref.get(2, 0)); <ide> <del> oldData.data = oldData.data.replace(/\(D:[0-9]+\)/, "(date)"); <add> oldData.data = oldData.data.replace(/\(D:\d+\)/, "(date)"); <ide> expect(oldData.data).toEqual( <ide> "123 0 obj\n" + <ide> "<< /Type /Annot /Subtype /Widget /FT /Tx /DA (/Helv 5 Tf) /DR " + <ide> describe("annotation", function () { <ide> expect(oldData.ref).toEqual(Ref.get(123, 0)); <ide> expect(newData.ref).toEqual(Ref.get(2, 0)); <ide> <del> oldData.data = oldData.data.replace(/\(D:[0-9]+\)/, "(date)"); <add> oldData.data = oldData.data.replace(/\(D:\d+\)/, "(date)"); <ide> expect(oldData.data).toEqual( <ide> "123 0 obj\n" + <ide> "<< /Type /Annot /Subtype /Widget /FT /Tx /DA (/Goth 5 Tf) /DR " + <ide> describe("annotation", function () { <ide> task, <ide> annotationStorage <ide> ); <del> oldData.data = oldData.data.replace(/\(D:[0-9]+\)/, "(date)"); <add> oldData.data = oldData.data.replace(/\(D:\d+\)/, "(date)"); <ide> expect(oldData.ref).toEqual(Ref.get(123, 0)); <ide> expect(oldData.data).toEqual( <ide> "123 0 obj\n" + <ide> describe("annotation", function () { <ide> ); <ide> expect(data.length).toEqual(2); <ide> const [radioData, parentData] = data; <del> radioData.data = radioData.data.replace(/\(D:[0-9]+\)/, "(date)"); <add> radioData.data = radioData.data.replace(/\(D:\d+\)/, "(date)"); <ide> expect(radioData.ref).toEqual(Ref.get(123, 0)); <ide> expect(radioData.data).toEqual( <ide> "123 0 obj\n" + <ide> describe("annotation", function () { <ide> ); <ide> expect(data.length).toEqual(2); <ide> const [radioData, parentData] = data; <del> radioData.data = radioData.data.replace(/\(D:[0-9]+\)/, "(date)"); <add> radioData.data = radioData.data.replace(/\(D:\d+\)/, "(date)"); <ide> expect(radioData.ref).toEqual(Ref.get(123, 0)); <ide> expect(radioData.data).toEqual( <ide> "123 0 obj\n" + <ide> describe("annotation", function () { <ide> expect(oldData.ref).toEqual(Ref.get(123, 0)); <ide> expect(newData.ref).toEqual(Ref.get(1, 0)); <ide> <del> oldData.data = oldData.data.replace(/\(D:[0-9]+\)/, "(date)"); <add> oldData.data = oldData.data.replace(/\(D:\d+\)/, "(date)"); <ide> expect(oldData.data).toEqual( <ide> "123 0 obj\n" + <ide> "<< /Type /Annot /Subtype /Widget /FT /Ch /DA (/Helv 5 Tf) /DR " +
8
Java
Java
update javadoc for cookievalue
821ecb4cfd0b3a782092fdda4dc05e1b161a7aa7
<ide><path>spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2021 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.core.annotation.AliasFor; <ide> <ide> /** <del> * Annotation which indicates that a method parameter should be bound to an HTTP cookie. <add> * Annotation to indicate that a method parameter is bound to an HTTP cookie. <ide> * <ide> * <p>The method parameter may be declared as type {@link javax.servlet.http.Cookie} <ide> * or as cookie value type (String, int, etc.). <ide> * <add> * <p>Note that with spring-webmvc 5.3.x and earlier, the cookie value is URL <add> * decoded. This will be changed in 6.0 but in the mean, applications can also <add> * declare {@link javax.servlet.http.Cookie} to access the raw value. <add> * <ide> * @author Juergen Hoeller <ide> * @author Sam Brannen <ide> * @since 3.0
1
Go
Go
use persistent connection for links database
7c08aeeba4ab94f77e221bfc01741cce0866d224
<ide><path>docker/docker.go <ide> func daemon(config *docker.DaemonConfig) error { <ide> } <ide> defer removePidFile(config.Pidfile) <ide> <add> server, err := docker.NewServer(config) <add> if err != nil { <add> return err <add> } <add> defer server.Close() <add> <ide> c := make(chan os.Signal, 1) <ide> signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM)) <ide> go func() { <ide> sig := <-c <ide> log.Printf("Received signal '%v', exiting\n", sig) <add> server.Close() <ide> removePidFile(config.Pidfile) <ide> os.Exit(0) <ide> }() <del> server, err := docker.NewServer(config) <del> if err != nil { <del> return err <del> } <add> <ide> chErrors := make(chan error, len(config.ProtoAddresses)) <ide> for _, protoAddr := range config.ProtoAddresses { <ide> protoAddrParts := strings.SplitN(protoAddr, "://", 2) <ide> func daemon(config *docker.DaemonConfig) error { <ide> log.Println("/!\\ DON'T BIND ON ANOTHER IP ADDRESS THAN 127.0.0.1 IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\") <ide> } <ide> } else { <add> server.Close() <add> removePidFile(config.Pidfile) <ide> log.Fatal("Invalid protocol format.") <ide> } <ide> go func() { <ide><path>gograph/gograph.go <ide> package gograph <ide> <ide> import ( <del> _ "code.google.com/p/gosqlite/sqlite3" <ide> "database/sql" <ide> "fmt" <del> "os" <ide> "path" <ide> ) <ide> <ide> const ( <ide> ` <ide> <ide> createEdgeIndices = ` <del> CREATE UNIQUE INDEX "name_parent_ix" ON "edge" (parent_id, name); <add> CREATE UNIQUE INDEX IF NOT EXISTS "name_parent_ix" ON "edge" (parent_id, name); <ide> ` <ide> ) <ide> <ide> type WalkFunc func(fullPath string, entity *Entity) error <ide> <ide> // Graph database for storing entities and their relationships <ide> type Database struct { <del> dbPath string <add> conn *sql.DB <ide> } <ide> <ide> // Create a new graph database initialized with a root entity <del>func NewDatabase(dbPath string) (*Database, error) { <del> db := &Database{dbPath} <del> if _, err := os.Stat(dbPath); err == nil { <del> return db, nil <add>func NewDatabase(conn *sql.DB, init bool) (*Database, error) { <add> if conn == nil { <add> return nil, fmt.Errorf("Database connection cannot be nil") <ide> } <del> conn, err := db.openConn() <del> if err != nil { <del> return nil, err <del> } <del> defer conn.Close() <add> db := &Database{conn} <ide> <del> if _, err := conn.Exec(createEntityTable); err != nil { <del> return nil, err <del> } <del> if _, err := conn.Exec(createEdgeTable); err != nil { <del> return nil, err <del> } <del> if _, err := conn.Exec(createEdgeIndices); err != nil { <del> return nil, err <del> } <add> if init { <add> if _, err := conn.Exec(createEntityTable); err != nil { <add> return nil, err <add> } <add> if _, err := conn.Exec(createEdgeTable); err != nil { <add> return nil, err <add> } <add> if _, err := conn.Exec(createEdgeIndices); err != nil { <add> return nil, err <add> } <ide> <del> rollback := func() { <del> conn.Exec("ROLLBACK") <del> } <add> rollback := func() { <add> conn.Exec("ROLLBACK") <add> } <ide> <del> // Create root entities <del> if _, err := conn.Exec("BEGIN"); err != nil { <del> return nil, err <del> } <del> if _, err := conn.Exec("INSERT INTO entity (id) VALUES (?);", "0"); err != nil { <del> rollback() <del> return nil, err <del> } <add> // Create root entities <add> if _, err := conn.Exec("BEGIN"); err != nil { <add> return nil, err <add> } <add> if _, err := conn.Exec("INSERT INTO entity (id) VALUES (?);", "0"); err != nil { <add> rollback() <add> return nil, err <add> } <ide> <del> if _, err := conn.Exec("INSERT INTO edge (entity_id, name) VALUES(?,?);", "0", "/"); err != nil { <del> rollback() <del> return nil, err <del> } <add> if _, err := conn.Exec("INSERT INTO edge (entity_id, name) VALUES(?,?);", "0", "/"); err != nil { <add> rollback() <add> return nil, err <add> } <ide> <del> if _, err := conn.Exec("COMMIT"); err != nil { <del> return nil, err <add> if _, err := conn.Exec("COMMIT"); err != nil { <add> return nil, err <add> } <ide> } <ide> return db, nil <ide> } <ide> <add>// Close the underlying connection to the database <add>func (db *Database) Close() error { <add> return db.conn.Close() <add>} <add> <ide> // Set the entity id for a given path <ide> func (db *Database) Set(fullPath, id string) (*Entity, error) { <del> conn, err := db.openConn() <del> if err != nil { <del> return nil, err <del> } <del> defer conn.Close() <ide> // FIXME: is rollback implicit when closing the connection? <ide> rollback := func() { <del> conn.Exec("ROLLBACK") <add> db.conn.Exec("ROLLBACK") <ide> } <ide> // FIXME: use exclusive transactions to avoid race conditions <del> if _, err := conn.Exec("BEGIN"); err != nil { <add> if _, err := db.conn.Exec("BEGIN"); err != nil { <ide> return nil, err <ide> } <ide> var entityId string <del> if err := conn.QueryRow("SELECT id FROM entity WHERE id = ?;", id).Scan(&entityId); err != nil { <add> if err := db.conn.QueryRow("SELECT id FROM entity WHERE id = ?;", id).Scan(&entityId); err != nil { <ide> if err == sql.ErrNoRows { <del> if _, err := conn.Exec("INSERT INTO entity (id) VALUES(?);", id); err != nil { <add> if _, err := db.conn.Exec("INSERT INTO entity (id) VALUES(?);", id); err != nil { <ide> rollback() <ide> return nil, err <ide> } <ide> func (db *Database) Set(fullPath, id string) (*Entity, error) { <ide> e := &Entity{id} <ide> <ide> parentPath, name := splitPath(fullPath) <del> if err := db.setEdge(conn, parentPath, name, e); err != nil { <add> if err := db.setEdge(parentPath, name, e); err != nil { <ide> rollback() <ide> return nil, err <ide> } <ide> <del> if _, err := conn.Exec("COMMIT"); err != nil { <add> if _, err := db.conn.Exec("COMMIT"); err != nil { <ide> return nil, err <ide> } <ide> return e, nil <ide> } <ide> <del>func (db *Database) setEdge(conn *sql.DB, parentPath, name string, e *Entity) error { <del> parent, err := db.get(conn, parentPath) <add>func (db *Database) setEdge(parentPath, name string, e *Entity) error { <add> parent, err := db.get(parentPath) <ide> if err != nil { <ide> return err <ide> } <ide> if parent.id == e.id { <ide> return fmt.Errorf("Cannot set self as child") <ide> } <ide> <del> if _, err := conn.Exec("INSERT INTO edge (parent_id, name, entity_id) VALUES (?,?,?);", parent.id, name, e.id); err != nil { <add> if _, err := db.conn.Exec("INSERT INTO edge (parent_id, name, entity_id) VALUES (?,?,?);", parent.id, name, e.id); err != nil { <ide> return err <ide> } <ide> return nil <ide> func (db *Database) RootEntity() *Entity { <ide> <ide> // Return the entity for a given path <ide> func (db *Database) Get(name string) *Entity { <del> conn, err := db.openConn() <del> if err != nil { <del> return nil <del> } <del> defer conn.Close() <del> <del> e, err := db.get(conn, name) <add> e, err := db.get(name) <ide> if err != nil { <ide> return nil <ide> } <ide> return e <ide> } <ide> <del>func (db *Database) get(conn *sql.DB, name string) (*Entity, error) { <add>func (db *Database) get(name string) (*Entity, error) { <ide> e := db.RootEntity() <ide> // We always know the root name so return it if <ide> // it is requested <ide> func (db *Database) get(conn *sql.DB, name string) (*Entity, error) { <ide> for i := 1; i < len(parts); i++ { <ide> p := parts[i] <ide> <del> next := db.child(conn, e, p) <add> next := db.child(e, p) <ide> if next == nil { <ide> return nil, fmt.Errorf("Cannot find child") <ide> } <ide> func (db *Database) get(conn *sql.DB, name string) (*Entity, error) { <ide> // The key will be the full path of the entity <ide> func (db *Database) List(name string, depth int) Entities { <ide> out := Entities{} <del> conn, err := db.openConn() <del> if err != nil { <del> return out <del> } <del> defer conn.Close() <del> <del> for c := range db.children(conn, name, depth) { <add> for c := range db.children(name, depth) { <ide> out[c.FullPath] = c.Entity <ide> } <ide> return out <ide> } <ide> <ide> func (db *Database) Walk(name string, walkFunc WalkFunc, depth int) error { <del> conn, err := db.openConn() <del> if err != nil { <del> return err <del> } <del> defer conn.Close() <del> <del> for c := range db.children(conn, name, depth) { <add> for c := range db.children(name, depth) { <ide> if err := walkFunc(c.FullPath, c.Entity); err != nil { <ide> return err <ide> } <ide> func (db *Database) Walk(name string, walkFunc WalkFunc, depth int) error { <ide> <ide> // Return the refrence count for a specified id <ide> func (db *Database) Refs(id string) int { <del> conn, err := db.openConn() <del> if err != nil { <del> return -1 <del> } <del> defer conn.Close() <del> <ide> var count int <del> if err := conn.QueryRow("SELECT COUNT(*) FROM edge WHERE entity_id = ?;", id).Scan(&count); err != nil { <add> if err := db.conn.QueryRow("SELECT COUNT(*) FROM edge WHERE entity_id = ?;", id).Scan(&count); err != nil { <ide> return 0 <ide> } <ide> return count <ide> func (db *Database) Refs(id string) int { <ide> // Return all the id's path references <ide> func (db *Database) RefPaths(id string) Edges { <ide> refs := Edges{} <del> conn, err := db.openConn() <del> if err != nil { <del> return refs <del> } <del> defer conn.Close() <ide> <del> rows, err := conn.Query("SELECT name, parent_id FROM edge WHERE entity_id = ?;", id) <add> rows, err := db.conn.Query("SELECT name, parent_id FROM edge WHERE entity_id = ?;", id) <ide> if err != nil { <ide> return refs <ide> } <ide> func (db *Database) Delete(name string) error { <ide> if name == "/" { <ide> return fmt.Errorf("Cannot delete root entity") <ide> } <del> conn, err := db.openConn() <del> if err != nil { <del> return err <del> } <del> defer conn.Close() <ide> <ide> parentPath, n := splitPath(name) <del> parent, err := db.get(conn, parentPath) <add> parent, err := db.get(parentPath) <ide> if err != nil { <ide> return err <ide> } <ide> <del> if _, err := conn.Exec("DELETE FROM edge WHERE parent_id = ? AND name LIKE ?;", parent.id, n+"%"); err != nil { <add> if _, err := db.conn.Exec("DELETE FROM edge WHERE parent_id = ? AND name LIKE ?;", parent.id, n+"%"); err != nil { <ide> return err <ide> } <ide> return nil <ide> func (db *Database) Delete(name string) error { <ide> // Walk the graph to make sure all references to the entity <ide> // are removed and return the number of references removed <ide> func (db *Database) Purge(id string) (int, error) { <del> conn, err := db.openConn() <del> if err != nil { <del> return -1, err <del> } <del> defer conn.Close() <del> <ide> rollback := func() { <del> conn.Exec("ROLLBACK") <add> db.conn.Exec("ROLLBACK") <ide> } <ide> <del> if _, err := conn.Exec("BEGIN"); err != nil { <add> if _, err := db.conn.Exec("BEGIN"); err != nil { <ide> return -1, err <ide> } <ide> <ide> // Delete all edges <del> rows, err := conn.Exec("DELETE FROM edge WHERE entity_id = ?;", id) <add> rows, err := db.conn.Exec("DELETE FROM edge WHERE entity_id = ?;", id) <ide> if err != nil { <ide> rollback() <ide> return -1, err <ide> func (db *Database) Purge(id string) (int, error) { <ide> } <ide> <ide> // Delete entity <del> if _, err := conn.Exec("DELETE FROM entity where id = ?;", id); err != nil { <add> if _, err := db.conn.Exec("DELETE FROM entity where id = ?;", id); err != nil { <ide> rollback() <ide> return -1, err <ide> } <ide> <del> if _, err := conn.Exec("COMMIT"); err != nil { <add> if _, err := db.conn.Exec("COMMIT"); err != nil { <ide> return -1, err <ide> } <ide> return int(changes), nil <ide> func (db *Database) Rename(currentName, newName string) error { <ide> return fmt.Errorf("Cannot rename when root paths do not match %s != %s", parentPath, newParentPath) <ide> } <ide> <del> conn, err := db.openConn() <add> parent, err := db.get(parentPath) <ide> if err != nil { <ide> return err <ide> } <del> defer conn.Close() <ide> <del> parent, err := db.get(conn, parentPath) <del> if err != nil { <del> return err <del> } <del> <del> rows, err := conn.Exec("UPDATE edge SET name = ? WHERE parent_id = ? AND name LIKE ?;", newEdgeName, parent.id, name+"%") <add> rows, err := db.conn.Exec("UPDATE edge SET name = ? WHERE parent_id = ? AND name LIKE ?;", newEdgeName, parent.id, name+"%") <ide> if err != nil { <ide> return err <ide> } <ide> type WalkMeta struct { <ide> Edge *Edge <ide> } <ide> <del>func (db *Database) children(conn *sql.DB, name string, depth int) <-chan WalkMeta { <add>func (db *Database) children(name string, depth int) <-chan WalkMeta { <ide> out := make(chan WalkMeta) <del> e, err := db.get(conn, name) <add> e, err := db.get(name) <ide> if err != nil { <ide> close(out) <ide> return out <ide> } <ide> <ide> go func() { <del> rows, err := conn.Query("SELECT entity_id, name FROM edge where parent_id = ?;", e.id) <add> rows, err := db.conn.Query("SELECT entity_id, name FROM edge where parent_id = ?;", e.id) <ide> if err != nil { <ide> close(out) <ide> } <ide> func (db *Database) children(conn *sql.DB, name string, depth int) <-chan WalkMe <ide> if depth != -1 { <ide> nDepth -= 1 <ide> } <del> sc := db.children(conn, meta.FullPath, nDepth) <add> sc := db.children(meta.FullPath, nDepth) <ide> for c := range sc { <ide> out <- c <ide> } <ide> func (db *Database) children(conn *sql.DB, name string, depth int) <-chan WalkMe <ide> } <ide> <ide> // Return the entity based on the parent path and name <del>func (db *Database) child(conn *sql.DB, parent *Entity, name string) *Entity { <add>func (db *Database) child(parent *Entity, name string) *Entity { <ide> var id string <del> if err := conn.QueryRow("SELECT entity_id FROM edge WHERE parent_id = ? AND name LIKE ?;", parent.id, name+"%").Scan(&id); err != nil { <add> if err := db.conn.QueryRow("SELECT entity_id FROM edge WHERE parent_id = ? AND name LIKE ?;", parent.id, name+"%").Scan(&id); err != nil { <ide> return nil <ide> } <ide> return &Entity{id} <ide> } <ide> <del>func (db *Database) openConn() (*sql.DB, error) { <del> return sql.Open("sqlite3", db.dbPath) <del>} <del> <ide> // Return the id used to reference this entity <ide> func (e *Entity) ID() string { <ide> return e.id <ide><path>gograph/gograph_test.go <ide> package gograph <ide> <ide> import ( <add> _ "code.google.com/p/gosqlite/sqlite3" <add> "database/sql" <ide> "os" <ide> "path" <ide> "strconv" <ide> "testing" <ide> ) <ide> <del>func newTestDb(t *testing.T) *Database { <del> db, err := NewDatabase(path.Join(os.TempDir(), "sqlite.db")) <add>func newTestDb(t *testing.T) (*Database, string) { <add> p := path.Join(os.TempDir(), "sqlite.db") <add> conn, err := sql.Open("sqlite3", p) <add> db, err := NewDatabase(conn, true) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <del> return db <add> return db, p <ide> } <ide> <del>func destroyTestDb(db *Database) { <del> os.Remove(db.dbPath) <add>func destroyTestDb(dbPath string) { <add> os.Remove(dbPath) <ide> } <ide> <ide> func TestNewDatabase(t *testing.T) { <del> db := newTestDb(t) <add> db, dbpath := newTestDb(t) <ide> if db == nil { <ide> t.Fatal("Database should not be nil") <ide> } <del> defer destroyTestDb(db) <add> defer destroyTestDb(dbpath) <ide> } <ide> <ide> func TestCreateRootEnity(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> root := db.RootEntity() <ide> if root == nil { <ide> t.Fatal("Root entity should not be nil") <ide> } <ide> } <ide> <ide> func TestGetRootEntity(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> e := db.Get("/") <ide> if e == nil { <ide> func TestGetRootEntity(t *testing.T) { <ide> } <ide> <ide> func TestSetEntityWithDifferentName(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> db.Set("/test", "1") <ide> if _, err := db.Set("/other", "1"); err != nil { <ide> func TestSetEntityWithDifferentName(t *testing.T) { <ide> } <ide> <ide> func TestSetDuplicateEntity(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> if _, err := db.Set("/foo", "42"); err != nil { <ide> t.Fatal(err) <ide> func TestSetDuplicateEntity(t *testing.T) { <ide> } <ide> <ide> func TestCreateChild(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> child, err := db.Set("/db", "1") <ide> if err != nil { <ide> func TestCreateChild(t *testing.T) { <ide> } <ide> <ide> func TestListAllRootChildren(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> for i := 1; i < 6; i++ { <ide> a := strconv.Itoa(i) <ide> func TestListAllRootChildren(t *testing.T) { <ide> } <ide> <ide> func TestListAllSubChildren(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> _, err := db.Set("/webapp", "1") <ide> if err != nil { <ide> func TestListAllSubChildren(t *testing.T) { <ide> } <ide> <ide> func TestAddSelfAsChild(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> child, err := db.Set("/test", "1") <ide> if err != nil { <ide> func TestAddSelfAsChild(t *testing.T) { <ide> } <ide> <ide> func TestAddChildToNonExistantRoot(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> if _, err := db.Set("/myapp", "1"); err != nil { <ide> t.Fatal(err) <ide> func TestAddChildToNonExistantRoot(t *testing.T) { <ide> } <ide> <ide> func TestWalkAll(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> _, err := db.Set("/webapp", "1") <ide> if err != nil { <ide> t.Fatal(err) <ide> func TestWalkAll(t *testing.T) { <ide> } <ide> <ide> func TestGetEntityByPath(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> _, err := db.Set("/webapp", "1") <ide> if err != nil { <ide> t.Fatal(err) <ide> func TestGetEntityByPath(t *testing.T) { <ide> } <ide> <ide> func TestEnitiesPaths(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> _, err := db.Set("/webapp", "1") <ide> if err != nil { <ide> t.Fatal(err) <ide> func TestEnitiesPaths(t *testing.T) { <ide> } <ide> <ide> func TestDeleteRootEntity(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> if err := db.Delete("/"); err == nil { <ide> t.Fatal("Error should not be nil") <ide> } <ide> } <ide> <ide> func TestDeleteEntity(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> _, err := db.Set("/webapp", "1") <ide> if err != nil { <ide> t.Fatal(err) <ide> func TestDeleteEntity(t *testing.T) { <ide> } <ide> <ide> func TestCountRefs(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> db.Set("/webapp", "1") <ide> <ide> func TestCountRefs(t *testing.T) { <ide> } <ide> <ide> func TestPurgeId(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> db.Set("/webapp", "1") <ide> <ide> func TestPurgeId(t *testing.T) { <ide> } <ide> <ide> func TestRename(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> db.Set("/webapp", "1") <ide> <ide> func TestRename(t *testing.T) { <ide> } <ide> <ide> func TestCreateMultipleNames(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> db.Set("/db", "1") <ide> if _, err := db.Set("/myapp", "1"); err != nil { <ide> func TestCreateMultipleNames(t *testing.T) { <ide> } <ide> <ide> func TestRefPaths(t *testing.T) { <del> db := newTestDb(t) <del> defer destroyTestDb(db) <add> db, dbpath := newTestDb(t) <add> defer destroyTestDb(dbpath) <ide> <ide> db.Set("/webapp", "1") <ide> <ide> func TestRefPaths(t *testing.T) { <ide> if len(refs) != 2 { <ide> t.Fatalf("Expected reference count to be 2, got %d", len(refs)) <ide> } <del> <ide> } <ide><path>runtime.go <ide> package docker <ide> <ide> import ( <add> _ "code.google.com/p/gosqlite/sqlite3" <ide> "container/list" <add> "database/sql" <ide> "fmt" <ide> "github.com/dotcloud/docker/gograph" <ide> "github.com/dotcloud/docker/utils" <ide> func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error) { <ide> return nil, err <ide> } <ide> <del> graph, err := gograph.NewDatabase(path.Join(config.GraphPath, "linkgraph.db")) <add> gographPath := path.Join(config.GraphPath, "linkgraph.db") <add> initDatabase := false <add> if _, err := os.Stat(gographPath); err != nil { <add> if os.IsNotExist(err) { <add> initDatabase = true <add> } <add> return nil, err <add> } <add> conn, err := sql.Open("sqlite3", gographPath) <add> if err != nil { <add> return nil, err <add> } <add> graph, err := gograph.NewDatabase(conn, initDatabase) <ide> if err != nil { <ide> return nil, err <ide> } <ide> func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error) { <ide> return runtime, nil <ide> } <ide> <add>func (runtime *Runtime) Close() error { <add> runtime.networkManager.Close() <add> return runtime.containerGraph.Close() <add>} <add> <ide> // History is a convenience type for storing a list of containers, <ide> // ordered by creation date. <ide> type History []*Container <ide><path>runtime_test.go <ide> func nuke(runtime *Runtime) error { <ide> }(container) <ide> } <ide> wg.Wait() <del> runtime.networkManager.Close() <add> runtime.Close() <add> <add> os.Remove(filepath.Join(runtime.config.GraphPath, "linkgraph.db")) <ide> return os.RemoveAll(runtime.config.GraphPath) <ide> } <ide> <ide><path>server.go <ide> import ( <ide> "time" <ide> ) <ide> <add>func (srv *Server) Close() error { <add> return srv.runtime.Close() <add>} <add> <ide> func (srv *Server) DockerVersion() APIVersion { <ide> return APIVersion{ <ide> Version: VERSION,
6
Go
Go
put each arg in a separate string
30ea0bebce340dfc257b5b45835234cb921f3a48
<ide><path>integration/server_test.go <ide> func TestCreateRmVolumes(t *testing.T) { <ide> srv := mkServerFromEngine(eng, t) <ide> defer mkRuntimeFromEngine(eng, t).Nuke() <ide> <del> config, hostConfig, _, err := docker.ParseRun([]string{"-v", "/srv", unitTestImageID, "echo test"}, nil) <add> config, hostConfig, _, err := docker.ParseRun([]string{"-v", "/srv", unitTestImageID, "echo", "test"}, nil) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestRmi(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> <del> config, hostConfig, _, err := docker.ParseRun([]string{unitTestImageID, "echo test"}, nil) <add> config, hostConfig, _, err := docker.ParseRun([]string{unitTestImageID, "echo", "test"}, nil) <ide> if err != nil { <ide> t.Fatal(err) <ide> }
1
Python
Python
fix misleading attributeerrors
d13c807616030b285589cec2fddf4e34a8e22b4a
<ide><path>rest_framework/request.py <ide> from rest_framework import HTTP_HEADER_ENCODING <ide> from rest_framework import exceptions <ide> from rest_framework.settings import api_settings <add>import sys <ide> import warnings <ide> <ide> <ide> def _not_authenticated(self): <ide> else: <ide> self.auth = None <ide> <del> def __getattr__(self, attr): <add> def __getattribute__(self, attr): <ide> """ <del> Proxy other attributes to the underlying HttpRequest object. <add> If an attribute does not exist on this instance, then we also attempt <add> to proxy it to the underlying HttpRequest object. <ide> """ <del> return getattr(self._request, attr) <add> try: <add> return super(Request, self).__getattribute__(attr) <add> except AttributeError: <add> info = sys.exc_info() <add> try: <add> return getattr(self._request, attr) <add> except AttributeError: <add> raise info[0], info[1], info[2].tb_next
1
Text
Text
add whitespace after if according code style
22d86fe70f91bc996904671029c2549d696ca89a
<ide><path>docs/Troubleshooting.md <ide> function todos(state = [], action) { <ide> case 'COMPLETE_TODO': <ide> // Return a new array <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> // Copy the object before mutating <ide> return Object.assign({}, todo, { <ide> completed: true <ide> It’s more code, but it’s exactly what makes Redux predictable and efficient. <ide> ```js <ide> // Before: <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> }) <ide> You can also enable the [object spread operator proposal](recipes/UsingObjectSpr <ide> ```js <ide> // Before: <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> }) <ide> return state.map((todo, index) => { <ide> <ide> // After: <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return { ...todo, completed: true } <ide> } <ide> return todo <ide><path>docs/basics/Reducers.md <ide> Finally, the implementation of the `COMPLETE_TODO` handler shouldn’t come as a <ide> case COMPLETE_TODO: <ide> return Object.assign({}, state, { <ide> todos: state.todos.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> }) <ide> function todos(state = [], action) { <ide> ] <ide> case COMPLETE_TODO: <ide> return state.map(todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> }) <ide> function todos(state = [], action) { <ide> ] <ide> case COMPLETE_TODO: <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> }) <ide> function todos(state = [], action) { <ide> ] <ide> case COMPLETE_TODO: <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> }) <ide><path>docs/introduction/ThreePrinciples.md <ide> function todos(state = [], action) { <ide> ] <ide> case 'COMPLETE_TODO': <ide> return state.map((todo, index) => { <del> if(index === action.index) { <add> if (index === action.index) { <ide> return Object.assign({}, todo, { <ide> completed: true <ide> })
3
Text
Text
update snippet to rails 5 syntax
4c15ed775304abd9e3e41afef4e7fec4077f699b
<ide><path>guides/source/action_controller_overview.md <ide> NOTE: Support for parsing XML parameters has been extracted into a gem named `ac <ide> The `params` hash will always contain the `:controller` and `:action` keys, but you should use the methods `controller_name` and `action_name` instead to access these values. Any other parameters defined by the routing, such as `:id`, will also be available. As an example, consider a listing of clients where the list can show either active or inactive clients. We can add a route which captures the `:status` parameter in a "pretty" URL: <ide> <ide> ```ruby <del>get '/clients/:status' => 'clients#index', foo: 'bar' <add>get '/clients/:status', to: 'clients#index', foo: 'bar' <ide> ``` <ide> <ide> In this case, when a user opens the URL `/clients/active`, `params[:status]` will be set to "active". When this route is used, `params[:foo]` will also be set to "bar", as if it were passed in the query string. Your controller will also receive `params[:action]` as "index" and `params[:controller]` as "clients".
1
Ruby
Ruby
fix plain option in the rails_guides generator
d34a2747cb43cc7f23d134e2853879ef4888e372
<ide><path>guides/rails_guides/markdown.rb <ide> def render_page <ide> @view.content_for(:header_section) { @header } <ide> @view.content_for(:page_title) { @title } <ide> @view.content_for(:index_section) { @index } <del> @view.render(layout: @layout, text: @body) <add> @view.render(layout: @layout, plain: @body) <ide> end <ide> end <ide> end
1
Python
Python
remove dummy variable from function calls
10dab8eef817d3e149ca0002ccdc32e91ab4ac82
<ide><path>spacy/__init__.py <ide> def blank(name, **kwargs): <ide> <ide> <ide> def info(model=None, markdown=False): <del> return cli_info(None, model, markdown) <add> return cli_info(model, markdown) <ide><path>spacy/cli/download.py <ide> def download(model, direct=False): <ide> # package, which fails if model was just installed via <ide> # subprocess <ide> package_path = get_package_path(model_name) <del> link(None, model_name, model, force=True, <del> model_path=package_path) <add> link(model_name, model, force=True, model_path=package_path) <ide> except: <ide> # Dirty, but since spacy.download and the auto-linking is <ide> # mostly a convenience wrapper, it's best to show a success <ide><path>spacy/tests/regression/test_issue1622.py <ide> def test_cli_trained_model_can_be_saved(tmpdir): <ide> <ide> # spacy train -n 1 -g -1 nl output_nl training_corpus.json training \ <ide> # corpus.json <del> train(cmd, lang, output_dir, train_data, dev_data, n_iter=1) <add> train(lang, output_dir, train_data, dev_data, n_iter=1) <ide> <ide> assert True
3
Javascript
Javascript
fix $asyncvalidators example
f211419be6ff2181f01a66a12fbb1e55664ea898
<ide><path>src/ng/directive/input.js <ide> var VALID_CLASS = 'ng-valid', <ide> * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided <ide> * is expected to return a promise when it is run during the model validation process. Once the promise <ide> * is delivered then the validation status will be set to true when fulfilled and false when rejected. <del> * When the asynchronous validators are trigged, each of the validators will run in parallel and the model <add> * When the asynchronous validators are triggered, each of the validators will run in parallel and the model <ide> * value will only be updated once all validators have been fulfilled. Also, keep in mind that all <ide> * asynchronous validators will only run once all synchronous validators have passed. <ide> * <ide> var VALID_CLASS = 'ng-valid', <ide> * ```js <ide> * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) { <ide> * var value = modelValue || viewValue; <add> * <add> * // Lookup user by username <ide> * return $http.get('/api/users/' + value). <del> * then(function() { <del> * //username exists, this means the validator fails <del> * return false; <del> * }, function() { <del> * //username does not exist, therefore this validation is true <add> * then(function resolved() { <add> * //username exists, this means validation fails <add> * return $q.reject('exists'); <add> * }, function rejected() { <add> * //username does not exist, therefore this validation passes <ide> * return true; <ide> * }); <ide> * };
1
Javascript
Javascript
move props equality check into each branch
21dccad47f26eed4709f59aaf9a897c358f957aa
<ide><path>src/renderers/shared/fiber/ReactFiberBeginWork.js <ide> module.exports = function<T, P, I, TI, C, CX>( <ide> <ide> function updateFragment(current, workInProgress) { <ide> var nextChildren = workInProgress.pendingProps; <add> if (hasContextChanged()) { <add> // Normally we can bail out on props equality but if context has changed <add> // we don't do the bailout and we have to reuse existing props instead. <add> if (nextChildren === null) { <add> nextChildren = current && current.memoizedProps; <add> } <add> } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) { <add> return bailoutOnAlreadyFinishedWork(current, workInProgress); <add> } <ide> reconcileChildren(current, workInProgress, nextChildren); <ide> return workInProgress.child; <ide> } <ide> module.exports = function<T, P, I, TI, C, CX>( <ide> } <ide> <ide> function updateHostComponent(current, workInProgress) { <del> const nextProps = workInProgress.pendingProps; <add> let nextProps = workInProgress.pendingProps; <ide> const prevProps = current ? current.memoizedProps : null; <add> const memoizedProps = workInProgress.memoizedProps; <add> if (hasContextChanged()) { <add> // Normally we can bail out on props equality but if context has changed <add> // we don't do the bailout and we have to reuse existing props instead. <add> if (nextProps === null) { <add> nextProps = prevProps; <add> if (!nextProps) { <add> throw new Error('We should always have pending or current props.'); <add> } <add> } <add> } else if (nextProps === null || memoizedProps === nextProps) { <add> return bailoutOnAlreadyFinishedWork(current, workInProgress); <add> } <add> <ide> let nextChildren = nextProps.children; <ide> const isDirectTextChild = shouldSetTextContent(nextProps); <ide> <ide> module.exports = function<T, P, I, TI, C, CX>( <ide> } <ide> <ide> function updateCoroutineComponent(current, workInProgress) { <del> var coroutine = (workInProgress.pendingProps : ?ReactCoroutine); <del> if (!coroutine) { <del> throw new Error('Should be resolved by now'); <add> var nextCoroutine = (workInProgress.pendingProps : null | ReactCoroutine); <add> if (hasContextChanged()) { <add> // Normally we can bail out on props equality but if context has changed <add> // we don't do the bailout and we have to reuse existing props instead. <add> if (nextCoroutine === null) { <add> nextCoroutine = current && current.memoizedProps; <add> if (!nextCoroutine) { <add> throw new Error('We should always have pending or current props.'); <add> } <add> } <add> } else if (nextCoroutine === null || workInProgress.memoizedProps === nextCoroutine) { <add> return bailoutOnAlreadyFinishedWork(current, workInProgress); <ide> } <del> reconcileChildren(current, workInProgress, coroutine.children); <add> reconcileChildren(current, workInProgress, nextCoroutine.children); <ide> // This doesn't take arbitrary time so we could synchronously just begin <ide> // eagerly do the work of workInProgress.child as an optimization. <ide> return workInProgress.child; <ide> module.exports = function<T, P, I, TI, C, CX>( <ide> function updatePortalComponent(current, workInProgress) { <ide> pushHostContainer(workInProgress.stateNode.containerInfo); <ide> const priorityLevel = workInProgress.pendingWorkPriority; <del> const nextChildren = workInProgress.pendingProps; <add> let nextChildren = workInProgress.pendingProps; <add> if (hasContextChanged()) { <add> // Normally we can bail out on props equality but if context has changed <add> // we don't do the bailout and we have to reuse existing props instead. <add> if (nextChildren === null) { <add> nextChildren = current && current.memoizedProps; <add> if (!nextChildren) { <add> throw new Error('We should always have pending or current props.'); <add> } <add> } <add> } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) { <add> return bailoutOnAlreadyFinishedWork(current, workInProgress); <add> } <add> <ide> if (!current) { <ide> // Portals are special because we don't append the children during mount <ide> // but at commit. Therefore we need to track insertions which the normal <ide> module.exports = function<T, P, I, TI, C, CX>( <ide> workInProgress.child = workInProgress.progressedChild; <ide> } <ide> <del> const pendingProps = workInProgress.pendingProps; <del> const memoizedProps = workInProgress.memoizedProps; <del> const updateQueue = workInProgress.updateQueue; <del> <del> // This is kept as a single expression to take advantage of short-circuiting. <del> const hasNewProps = ( <del> pendingProps !== null && ( // hasPendingProps && ( <del> memoizedProps === null || // hasNoMemoizedProps || <del> pendingProps !== memoizedProps // memoizedPropsDontMatch <del> ) // ) <del> ); <del> if (!hasNewProps) { <del> const hasUpdate = updateQueue && hasPendingUpdate(updateQueue, priorityLevel); <del> if (!hasUpdate && !hasContextChanged()) { <del> return bailoutOnAlreadyFinishedWork(current, workInProgress); <del> } <del> } <del> <ide> switch (workInProgress.tag) { <ide> case IndeterminateComponent: <ide> return mountIndeterminateComponent(current, workInProgress, priorityLevel);
1
Text
Text
remove rails versions from traco link
62b43839098bbbbfc4be789128d33dc0612f1ab3
<ide><path>guides/source/i18n.md <ide> Several gems can help with this: <ide> <ide> * [Globalize](https://github.com/globalize/globalize): Store translations on separate translation tables, one for each translated model <ide> * [Mobility](https://github.com/shioyama/mobility): Provides support for storing translations in many formats, including translation tables, json columns (PostgreSQL), etc. <del>* [Traco](https://github.com/barsoom/traco): Translatable columns for Rails 3 and 4, stored in the model table itself <add>* [Traco](https://github.com/barsoom/traco): Translatable columns stored in the model table itself <ide> <ide> Conclusion <ide> ----------
1
Python
Python
remove debug prints
7609e0b42e0014a6ad0adf9dafc7018cb268070e
<ide><path>django/db/migrations/executor.py <ide> def apply_migration(self, migration): <ide> """ <ide> Runs a migration forwards. <ide> """ <del> print "Applying %s" % migration <ide> with self.connection.schema_editor() as schema_editor: <ide> project_state = self.loader.graph.project_state((migration.app_label, migration.name), at_end=False) <ide> migration.apply(project_state, schema_editor) <ide> self.recorder.record_applied(migration.app_label, migration.name) <del> print "Finished %s" % migration <ide> <ide> def unapply_migration(self, migration): <ide> """ <ide> Runs a migration backwards. <ide> """ <del> print "Unapplying %s" % migration <ide> with self.connection.schema_editor() as schema_editor: <ide> project_state = self.loader.graph.project_state((migration.app_label, migration.name), at_end=False) <ide> migration.unapply(project_state, schema_editor) <ide> self.recorder.record_unapplied(migration.app_label, migration.name) <del> print "Finished %s" % migration
1
PHP
PHP
update gate facade(inspect)
139726e392ecb4fc7114fb63f968815c1426d3f9
<ide><path>src/Illuminate/Support/Facades/Gate.php <ide> * @method static mixed getPolicyFor(object|string $class) <ide> * @method static \Illuminate\Contracts\Auth\Access\Gate forUser(\Illuminate\Contracts\Auth\Authenticatable|mixed $user) <ide> * @method static array abilities() <add> * @method static \Illuminate\Auth\Access\Response inspect(string $ability, array|mixed $arguments = []) <ide> * <ide> * @see \Illuminate\Contracts\Auth\Access\Gate <ide> */
1
PHP
PHP
add missing test for password reset
9236336c554fb88f6a5372814e4e993e64c2ecca
<ide><path>tests/Integration/Auth/ForgotPasswordTest.php <ide> <ide> class ForgotPasswordTest extends TestCase <ide> { <add> protected function tearDown(): void <add> { <add> ResetPassword::$createUrlCallback = null; <add> ResetPassword::$toMailCallback = null; <add> <add> parent::tearDown(); <add> } <add> <ide> protected function defineEnvironment($app) <ide> { <ide> $app['config']->set('auth.providers.users.model', AuthenticationTestUser::class); <ide><path>tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php <add><?php <add> <add>namespace Illuminate\Tests\Integration\Auth; <add> <add>use Illuminate\Auth\Notifications\ResetPassword; <add>use Illuminate\Notifications\Messages\MailMessage; <add>use Illuminate\Support\Facades\Notification; <add>use Illuminate\Support\Facades\Password; <add>use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser; <add>use Orchestra\Testbench\Factories\UserFactory; <add>use Orchestra\Testbench\TestCase; <add> <add>class ForgotPasswordWithoutDefaultRoutesTest extends TestCase <add>{ <add> protected function tearDown(): void <add> { <add> ResetPassword::$createUrlCallback = null; <add> ResetPassword::$toMailCallback = null; <add> <add> parent::tearDown(); <add> } <add> <add> protected function defineEnvironment($app) <add> { <add> $app['config']->set('auth.providers.users.model', AuthenticationTestUser::class); <add> } <add> <add> protected function defineDatabaseMigrations() <add> { <add> $this->loadLaravelMigrations(); <add> } <add> <add> protected function defineRoutes($router) <add> { <add> $router->get('custom/password/reset/{token}', function ($token) { <add> return 'Custom reset password!'; <add> })->name('custom.password.reset'); <add> } <add> <add> /** @test */ <add> public function it_cannot_send_forgot_password_email() <add> { <add> $this->expectException('Symfony\Component\Routing\Exception\RouteNotFoundException'); <add> $this->expectExceptionMessage('Route [password.reset] not defined.'); <add> <add> Notification::fake(); <add> <add> UserFactory::new()->create(); <add> <add> $user = AuthenticationTestUser::first(); <add> <add> Password::broker()->sendResetLink([ <add> 'email' => $user->email, <add> ]); <add> <add> Notification::assertSentTo( <add> $user, <add> function (ResetPassword $notification, $channels) use ($user) { <add> $message = $notification->toMail($user); <add> <add> return ! is_null($notification->token) <add> && $message->actionUrl === route('custom.password.reset', ['token' => $notification->token, 'email' => $user->email]); <add> } <add> ); <add> } <add> <add> /** @test */ <add> public function it_can_send_forgot_password_email_via_create_url_using() <add> { <add> Notification::fake(); <add> <add> ResetPassword::createUrlUsing(function ($user, string $token) { <add> return route('custom.password.reset', $token); <add> }); <add> <add> UserFactory::new()->create(); <add> <add> $user = AuthenticationTestUser::first(); <add> <add> Password::broker()->sendResetLink([ <add> 'email' => $user->email, <add> ]); <add> <add> Notification::assertSentTo( <add> $user, <add> function (ResetPassword $notification, $channels) use ($user) { <add> $message = $notification->toMail($user); <add> <add> return ! is_null($notification->token) <add> && $message->actionUrl === route('custom.password.reset', ['token' => $notification->token]); <add> } <add> ); <add> } <add> <add> /** @test */ <add> public function it_can_send_forgot_password_email_via_to_mail_using() <add> { <add> Notification::fake(); <add> <add> ResetPassword::toMailUsing(function ($notifiable, $token) { <add> return (new MailMessage) <add> ->subject(__('Reset Password Notification')) <add> ->line(__('You are receiving this email because we received a password reset request for your account.')) <add> ->action(__('Reset Password'), route('custom.password.reset', $token)) <add> ->line(__('If you did not request a password reset, no further action is required.')); <add> }); <add> <add> UserFactory::new()->create(); <add> <add> $user = AuthenticationTestUser::first(); <add> <add> Password::broker()->sendResetLink([ <add> 'email' => $user->email, <add> ]); <add> <add> Notification::assertSentTo( <add> $user, <add> function (ResetPassword $notification, $channels) use ($user) { <add> $message = $notification->toMail($user); <add> <add> return ! is_null($notification->token) <add> && $message->actionUrl === route('custom.password.reset', ['token' => $notification->token]); <add> } <add> ); <add> } <add>}
2
PHP
PHP
remove cursorpaginationexception
7bfc3154dce4576aca44054e8c7359ee2346d6f6
<ide><path>src/Illuminate/Pagination/CursorPaginationException.php <del><?php <del> <del>namespace Illuminate\Pagination; <del> <del>use RuntimeException; <del> <del>/** <del> * @deprecated Will be removed in a future Laravel version. <del> */ <del>class CursorPaginationException extends RuntimeException <del>{ <del> // <del>}
1
PHP
PHP
apply fixes from styleci
39c154c6ebcd1c28321d18b431ca703e3c8460a7
<ide><path>tests/Console/ConsoleApplicationTest.php <ide> <ide> use Mockery as m; <ide> use PHPUnit\Framework\TestCase; <del>use Illuminate\Contracts\Events\Dispatcher; <ide> use Symfony\Component\Console\Command\Command; <ide> use Illuminate\Contracts\Foundation\Application; <ide>
1
Go
Go
add wait, stop, start, restart, rm, rmi
e2ac0e6b806c094fd8a3b706653623c0c2aee861
<ide><path>commands.go <ide> func (cli *DockerCli) CmdWait(args ...string) error { <ide> cmd.Usage() <ide> return nil <ide> } <add> var encounteredError error <ide> for _, name := range cmd.Args() { <ide> status, err := waitForExit(cli, name) <ide> if err != nil { <del> fmt.Fprintf(cli.err, "%s", err) <add> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to wait one or more containers") <ide> } else { <ide> fmt.Fprintf(cli.out, "%d\n", status) <ide> } <ide> } <del> return nil <add> return encounteredError <ide> } <ide> <ide> // 'docker version': show version information <ide> func (cli *DockerCli) CmdStop(args ...string) error { <ide> v := url.Values{} <ide> v.Set("t", strconv.Itoa(*nSeconds)) <ide> <add> var encounteredError error <ide> for _, name := range cmd.Args() { <ide> _, _, err := cli.call("POST", "/containers/"+name+"/stop?"+v.Encode(), nil) <ide> if err != nil { <ide> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to stop one or more containers") <ide> } else { <ide> fmt.Fprintf(cli.out, "%s\n", name) <ide> } <ide> } <del> return nil <add> return encounteredError <ide> } <ide> <ide> func (cli *DockerCli) CmdRestart(args ...string) error { <ide> func (cli *DockerCli) CmdRestart(args ...string) error { <ide> v := url.Values{} <ide> v.Set("t", strconv.Itoa(*nSeconds)) <ide> <add> var encounteredError error <ide> for _, name := range cmd.Args() { <ide> _, _, err := cli.call("POST", "/containers/"+name+"/restart?"+v.Encode(), nil) <ide> if err != nil { <ide> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to restart one or more containers") <ide> } else { <ide> fmt.Fprintf(cli.out, "%s\n", name) <ide> } <ide> } <del> return nil <add> return encounteredError <ide> } <ide> <ide> func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal { <ide> func (cli *DockerCli) CmdRmi(args ...string) error { <ide> return nil <ide> } <ide> <add> var encounteredError error <ide> for _, name := range cmd.Args() { <ide> body, _, err := cli.call("DELETE", "/images/"+name, nil) <ide> if err != nil { <del> fmt.Fprintf(cli.err, "%s", err) <add> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to remove one or more images") <ide> } else { <ide> var outs []APIRmi <ide> err = json.Unmarshal(body, &outs) <ide> if err != nil { <del> return err <add> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to remove one or more images") <add> continue <ide> } <ide> for _, out := range outs { <ide> if out.Deleted != "" { <ide> func (cli *DockerCli) CmdRmi(args ...string) error { <ide> } <ide> } <ide> } <del> return nil <add> return encounteredError <ide> } <ide> <ide> func (cli *DockerCli) CmdHistory(args ...string) error { <ide> func (cli *DockerCli) CmdRm(args ...string) error { <ide> if *link { <ide> val.Set("link", "1") <ide> } <add> <add> var encounteredError error <ide> for _, name := range cmd.Args() { <ide> _, _, err := cli.call("DELETE", "/containers/"+name+"?"+val.Encode(), nil) <ide> if err != nil { <ide> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to remove one or more containers") <ide> } else { <ide> fmt.Fprintf(cli.out, "%s\n", name) <ide> } <ide> } <del> return nil <add> return encounteredError <ide> } <ide> <ide> // 'docker kill NAME' kills a running container <ide> func (cli *DockerCli) CmdKill(args ...string) error { <ide> return nil <ide> } <ide> <del> failure := []error{} <add> var encounteredError error <ide> for _, name := range args { <ide> if _, _, err := cli.call("POST", "/containers/"+name+"/kill", nil); err != nil { <del> failure = append(failure, err) <add> fmt.Fprintf(cli.err, "%s\n", err) <add> encounteredError = fmt.Errorf("Error: failed to kill one or more containers") <ide> } else { <ide> fmt.Fprintf(cli.out, "%s\n", name) <ide> } <ide> } <del> if len(failure) != 0 { <del> return fmt.Errorf("Some container failed to get killed: %v\n", failure) <del> } <del> return nil <add> return encounteredError <ide> } <ide> <ide> func (cli *DockerCli) CmdImport(args ...string) error { <ide> func (cli *DockerCli) call(method, path string, data interface{}) ([]byte, int, <ide> if len(body) == 0 { <ide> return nil, resp.StatusCode, fmt.Errorf("Error: %s", http.StatusText(resp.StatusCode)) <ide> } <del> return nil, resp.StatusCode, fmt.Errorf("Error: %s", body) <add> return nil, resp.StatusCode, fmt.Errorf("Error: %s", bytes.TrimSpace(body)) <ide> } <ide> return body, resp.StatusCode, nil <ide> } <ide> func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer, h <ide> if len(body) == 0 { <ide> return fmt.Errorf("Error :%s", http.StatusText(resp.StatusCode)) <ide> } <del> return fmt.Errorf("Error: %s", body) <add> return fmt.Errorf("Error: %s", bytes.TrimSpace(body)) <ide> } <ide> <ide> if matchesContentType(resp.Header.Get("Content-Type"), "application/json") {
1
Python
Python
remove info log about closing parent pipe
3310618d4a8f1119fb734ea040311db731a54c26
<ide><path>airflow/dag_processing/processor.py <ide> def _run_file_processor( <ide> <ide> # Since we share all open FDs from the parent, we need to close the parent side of the pipe here in <ide> # the child, else it won't get closed properly until we exit. <del> log.info("Closing parent pipe") <del> <ide> parent_channel.close() <ide> del parent_channel <ide>
1
Text
Text
add sections for server.close()
c60c93cba27626680061109766cbc2e102dd38a8
<ide><path>doc/api/http2.md <ide> added: v8.4.0 <ide> The `'timeout'` event is emitted when there is no activity on the Server for <ide> a given number of milliseconds set using `http2server.setTimeout()`. <ide> <add>#### server.close([callback]) <add><!-- YAML <add>added: v8.4.0 <add>--> <add>- `callback` {Function} <add> <add>Stops the server from accepting new connections. See [`net.Server.close()`][]. <add> <add>Note that this is not analogous to restricting new requests since HTTP/2 <add>connections are persistent. To achieve a similar graceful shutdown behavior, <add>consider also using [`http2session.close()`] on active sessions. <add> <ide> ### Class: Http2SecureServer <ide> <!-- YAML <ide> added: v8.4.0 <ide> negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler <ide> receives the socket for handling. If no listener is registered for this event, <ide> the connection is terminated. See the [Compatibility API][]. <ide> <add>#### server.close([callback]) <add><!-- YAML <add>added: v8.4.0 <add>--> <add>- `callback` {Function} <add> <add>Stops the server from accepting new connections. See [`tls.Server.close()`][]. <add> <add>Note that this is not analogous to restricting new requests since HTTP/2 <add>connections are persistent. To achieve a similar graceful shutdown behavior, <add>consider also using [`http2session.close()`] on active sessions. <add> <ide> ### http2.createServer(options[, onRequestHandler]) <ide> <!-- YAML <ide> added: v8.4.0 <ide> following additional properties: <ide> [`http2.createSecureServer()`]: #http2_http2_createsecureserver_options_onrequesthandler <ide> [`http2.Server`]: #http2_class_http2server <ide> [`http2.createServer()`]: #http2_http2_createserver_options_onrequesthandler <add>[`http2session.close()`]: #http2_http2session_close_callback <ide> [`http2stream.pushStream()`]: #http2_http2stream_pushstream_headers_options_callback <add>[`net.Server.close()`]: net.html#net_server_close_callback <ide> [`net.Socket`]: net.html#net_class_net_socket <ide> [`net.Socket.prototype.ref`]: net.html#net_socket_ref <ide> [`net.Socket.prototype.unref`]: net.html#net_socket_unref <ide> following additional properties: <ide> [`response.write(data, encoding)`]: http.html#http_response_write_chunk_encoding_callback <ide> [`response.writeContinue()`]: #http2_response_writecontinue <ide> [`response.writeHead()`]: #http2_response_writehead_statuscode_statusmessage_headers <add>[`tls.Server.close()`]: tls.html#tls_server_close_callback <ide> [`tls.TLSSocket`]: tls.html#tls_class_tls_tlssocket <ide> [`tls.connect()`]: tls.html#tls_tls_connect_options_callback <ide> [`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener
1
Javascript
Javascript
improve code coverage for readline promises
92b85e7cf49fe799e7004448a5470b379f81a600
<ide><path>test/parallel/test-readline-promises-interface.js <ide> for (let i = 0; i < 12; i++) { <ide> fi.emit('data', 'asdf\n'); <ide> } <ide> <add> // Ensure that options.signal.removeEventListener was called <add> { <add> const ac = new AbortController(); <add> const signal = ac.signal; <add> const [rli] = getInterface({ terminal }); <add> signal.removeEventListener = common.mustCall( <add> (event, onAbortFn) => { <add> assert.strictEqual(event, 'abort'); <add> assert.strictEqual(onAbortFn.name, 'onAbort'); <add> }); <add> <add> rli.question('hello?', { signal }).then(common.mustCall()); <add> <add> rli.write('bar\n'); <add> ac.abort(); <add> rli.close(); <add> } <add> <ide> // Sending a blank line <ide> { <ide> const [rli, fi] = getInterface({ terminal });
1
Text
Text
improve asynclocalstorage introduction
63d978c5c14a54bb8546c5aa7a8fd8c94a8744c2
<ide><path>doc/api/async_hooks.md <ide> chains. It allows storing data throughout the lifetime of a web request <ide> or any other asynchronous duration. It is similar to thread-local storage <ide> in other languages. <ide> <add>While you can create your own implementation on top of the `async_hooks` module, <add>`AsyncLocalStorage` should be preferred as it is a performant and memory safe <add>implementation that involves significant optimizations that are non-obvious to <add>implement. <add> <ide> The following example uses `AsyncLocalStorage` to build a simple logger <ide> that assigns IDs to incoming HTTP requests and includes them in messages <ide> logged within each request.
1
Java
Java
restore compatibility with wildfly
5ac57e8ea6044d07435542e932335764bbce97bb
<ide><path>spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java <ide> import javax.websocket.Extension; <ide> import javax.websocket.server.ServerEndpointConfig; <ide> <add>import io.undertow.server.HttpServerExchange; <ide> import io.undertow.server.HttpUpgradeListener; <ide> import io.undertow.servlet.api.InstanceFactory; <ide> import io.undertow.servlet.api.InstanceHandle; <ide> import io.undertow.websockets.jsr.handshake.JsrHybi08Handshake; <ide> import io.undertow.websockets.jsr.handshake.JsrHybi13Handshake; <ide> import io.undertow.websockets.spi.WebSocketHttpExchange; <add>import org.xnio.StreamConnection; <ide> <ide> import org.springframework.http.server.ServerHttpRequest; <ide> import org.springframework.http.server.ServerHttpResponse; <ide> protected void upgradeInternal(ServerHttpRequest request, ServerHttpResponse res <ide> <ide> HttpServletRequest servletRequest = getHttpServletRequest(request); <ide> HttpServletResponse servletResponse = getHttpServletResponse(response); <add> <ide> final ServletWebSocketHttpExchange exchange = createHttpExchange(servletRequest, servletResponse); <ide> exchange.putAttachment(HandshakeUtil.PATH_PARAMS, Collections.<String, String>emptyMap()); <ide> <ide> ServerWebSocketContainer wsContainer = (ServerWebSocketContainer) getContainer(servletRequest); <ide> final EndpointSessionHandler endpointSessionHandler = new EndpointSessionHandler(wsContainer); <add> <ide> final ConfiguredServerEndpoint configuredServerEndpoint = createConfiguredServerEndpoint( <ide> selectedProtocol, selectedExtensions, endpoint, servletRequest); <add> <ide> final Handshake handshake = getHandshakeToUse(exchange, configuredServerEndpoint); <ide> <del> HttpUpgradeListener upgradeListener = (HttpUpgradeListener) Proxy.newProxyInstance( <del> getClass().getClassLoader(), new Class<?>[] {HttpUpgradeListener.class}, <del> new InvocationHandler() { <del> @Override <del> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { <del> if ("handleUpgrade".equals(method.getName())) { <del> Object connection = args[0]; // currently an XNIO StreamConnection <del> Object bufferPool = ReflectionUtils.invokeMethod(getBufferPoolMethod, exchange); <del> WebSocketChannel channel = (WebSocketChannel) ReflectionUtils.invokeMethod( <del> createChannelMethod, handshake, exchange, connection, bufferPool); <del> if (peerConnections != null) { <del> peerConnections.add(channel); <del> } <del> endpointSessionHandler.onConnect(exchange, channel); <del> return null; <del> } <del> else { <del> // any java.lang.Object method: equals, hashCode, toString... <del> return ReflectionUtils.invokeMethod(method, this, args); <del> } <del> } <del> }); <del> <del> exchange.upgradeChannel(upgradeListener); <add> exchange.upgradeChannel(new HttpUpgradeListener() { <add> @Override <add> public void handleUpgrade(StreamConnection connection, HttpServerExchange serverExchange) { <add> Object bufferPool = ReflectionUtils.invokeMethod(getBufferPoolMethod, exchange); <add> WebSocketChannel channel = (WebSocketChannel) ReflectionUtils.invokeMethod( <add> createChannelMethod, handshake, exchange, connection, bufferPool); <add> if (peerConnections != null) { <add> peerConnections.add(channel); <add> } <add> endpointSessionHandler.onConnect(exchange, channel); <add> } <add> }); <add> <ide> handshake.handshake(exchange); <ide> } <ide>
1
Python
Python
generate random token directly
f8cda8adbd7db4cd60b1dbdcd4bb5debc64ba572
<ide><path>rest_framework/authtoken/models.py <del>import uuid <del>import hmac <add>import binascii <add>import os <ide> from hashlib import sha1 <ide> from django.conf import settings <ide> from django.db import models <ide> def save(self, *args, **kwargs): <ide> return super(Token, self).save(*args, **kwargs) <ide> <ide> def generate_key(self): <del> unique = uuid.uuid4() <del> return hmac.new(unique.bytes, digestmod=sha1).hexdigest() <add> return binascii.hexlify(os.urandom(20)) <ide> <ide> def __unicode__(self): <ide> return self.key
1
Text
Text
fix a windows doc issue
3c61ede074000933f2290f8765bc4cface18c0ea
<ide><path>docs/installation/windows.md <ide> uses. You can do this with <ide> [puttygen](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html): <ide> <ide> 1. Open `puttygen.exe` and load ("File"->"Load" menu) the private key from <del> `%USERPROFILE%\.ssh\id_boot2docker` <add> <add> %USERPROFILE%\.docker\machine\machines\<name_of_your_machine> <ide> <ide> 2. Click "Save Private Key". <ide>
1
Javascript
Javascript
avoid regexp bug in ff 3.6
df2e3c2a816caf0d9762628eae47e664935cea25
<ide><path>d3.csv.js <ide> d3.csv.parseRows = function(text, f) { <ide> t, // the current token <ide> eol; // is the current token followed by EOL? <ide> <add> re.lastIndex = 0; // work-around bug in FF 3.6 <add> <ide> /** @private Returns the next token. */ <ide> function token() { <ide> if (re.lastIndex == text.length) return EOF; // special case: end of file <ide><path>d3.csv.min.js <del>(function(){function b(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function a(a){return a.map(b).join(",")}d3.csv=function(a,b){d3.text(a,"text/csv",function(a){b(a&&d3.csv.parse(a))})},d3.csv.parse=function(a){var b;return d3.csv.parseRows(a,function(a,c){if(c){var d={},e=-1,f=b.length;while(++e<f)d[b[e]]=a[e];return d}b=a;return null})},d3.csv.parseRows=function(a,b){function j(){if(f.lastIndex==a.length)return d;if(i){i=!1;return c}var b=f.lastIndex;if(a.charCodeAt(b)==34){var e=b;while(e++<a.length)if(a.charCodeAt(e)==34){if(a.charCodeAt(e+1)!=34)break;e++}f.lastIndex=e+2;var g=a.charCodeAt(e+1);g==13?(i=!0,a.charCodeAt(e+2)==10&&f.lastIndex++):g==10&&(i=!0);return a.substring(b+1,e).replace(/""/g,'"')}var h=f.exec(a);if(h){i=h[0].charCodeAt(0)!=44;return a.substring(b,h.index)}f.lastIndex=a.length;return a.substring(b)}var c={},d={},e=[],f=/\r\n|[,\r\n]/g,g=0,h,i;while((h=j())!==d){var k=[];while(h!==c&&h!==d)k.push(h),h=j();if(b&&!(k=b(k,g++)))continue;e.push(k)}return e},d3.csv.format=function(b){return b.map(a).join("\n")}})() <ide>\ No newline at end of file <add>(function(){function b(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function a(a){return a.map(b).join(",")}d3.csv=function(a,b){d3.text(a,"text/csv",function(a){b(a&&d3.csv.parse(a))})},d3.csv.parse=function(a){var b;return d3.csv.parseRows(a,function(a,c){if(c){var d={},e=-1,f=b.length;while(++e<f)d[b[e]]=a[e];return d}b=a;return null})},d3.csv.parseRows=function(a,b){function j(){if(f.lastIndex==a.length)return d;if(i){i=!1;return c}var b=f.lastIndex;if(a.charCodeAt(b)==34){var e=b;while(e++<a.length)if(a.charCodeAt(e)==34){if(a.charCodeAt(e+1)!=34)break;e++}f.lastIndex=e+2;var g=a.charCodeAt(e+1);g==13?(i=!0,a.charCodeAt(e+2)==10&&f.lastIndex++):g==10&&(i=!0);return a.substring(b+1,e).replace(/""/g,'"')}var h=f.exec(a);if(h){i=h[0].charCodeAt(0)!=44;return a.substring(b,h.index)}f.lastIndex=a.length;return a.substring(b)}var c={},d={},e=[],f=/\r\n|[,\r\n]/g,g=0,h,i;f.lastIndex=0;while((h=j())!==d){var k=[];while(h!==c&&h!==d)k.push(h),h=j();if(b&&!(k=b(k,g++)))continue;e.push(k)}return e},d3.csv.format=function(b){return b.map(a).join("\n")}})() <ide>\ No newline at end of file <ide><path>d3.js <del>(function(){d3 = {version: "1.14.1"}; // semver <add>(function(){d3 = {version: "1.14.2"}; // semver <ide> if (!Date.now) Date.now = function() { <ide> return +new Date(); <ide> }; <ide><path>d3.min.js <del>(function(){function bS(){return"circle"}function bR(){return 64}function bP(a){return[a.x,a.y]}function bO(a){return a.endAngle}function bN(a){return a.startAngle}function bM(a){return a.radius}function bL(a){return a.target}function bK(a){return a.source}function bJ(){return 0}function bI(a,b,c){a.push("C",bE(bF,b),",",bE(bF,c),",",bE(bG,b),",",bE(bG,c),",",bE(bH,b),",",bE(bH,c))}function bE(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bD(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bE(bH,g),",",bE(bH,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bI(b,g,h);return b.join("")}function bC(a){if(a.length<3)return bv(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bI(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);return b.join("")}function bB(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bA(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bv(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bz(a,b,c){return a.length<3?bv(a):a[0]+bA(a,bB(a,b))}function by(a,b){return a.length<3?bv(a):a[0]+bA((a.push(a[0]),a),bB([a[a.length-2]].concat(a,[a[1]]),b))}function bx(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bw(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bv(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bt(a){return a[1]}function bs(a){return a[0]}function br(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bq(a){return a.endAngle}function bp(a){return a.startAngle}function bo(a){return a.outerRadius}function bn(a){return a.innerRadius}function bg(a){return function(b){return-Math.pow(-b,a)}}function bf(a){return function(b){return Math.pow(b,a)}}function be(a){return-Math.log(-a)/Math.LN10}function bd(a){return Math.log(a)/Math.LN10}function bb(){var a=null,b=Y,c=Infinity;while(b)b.flush?b=a?a.next=b.next:Y=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function ba(){var a,b=Date.now(),c=null,d=Y;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;var e=bb()-b;e>24?(isFinite(e)&&(clearTimeout($),$=setTimeout(ba,e)),Z=0):(Z=1,bc(ba))}function _(a,b){var c=Date.now(),d=!1,e,f=Y;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(Y={callback:a,then:c,delay:b,next:Y}),Z||($=clearTimeout($),Z=1,bc(ba))}}function X(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function W(a){function n(b){var g=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){g=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,h.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),V=c,h.end.dispatch.apply(this,arguments),V=0,n.owner=r}}}});return g}var b={},c=V||++U,d={},e=[],f=!1,h=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),_(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,X(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,X(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=W(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=W(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){h[a].add(c);return b},b.call=g;return b.delay(0).duration(250)}function T(a){return{__data__:a}}function S(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function R(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return Q(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function Q(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return Q(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return Q(c)}a.select=function(a){return b(function(b){return N(a,b)})},a.selectAll=function(a){return c(function(b){return O(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return Q(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=T(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=Q(e);k.enter=function(){return R(d)},k.exit=function(){return Q(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?g:h).call(this)}function h(){var a=f(this.className.replace(e," "));this.className=a.length?a:null}function g(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=f(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?g:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=S.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e==-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function e(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=e,d)})},a.transition=function(){return W(a)},a.call=g;return a}function M(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return C(g(a+120),g(a),g(a-120))}function L(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function K(a,b,c){return{h:a,s:b,l:c,toString:L}}function H(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function G(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return K(g,h,i)}function F(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(H(h[0]),H(h[1]),H(h[2]))}}if(i=I[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function E(a){return a<16?"0"+a.toString(16):a.toString(16)}function D(){return"#"+E(this.r)+E(this.g)+E(this.b)}function C(a,b,c){return{r:a,g:b,b:c,toString:D}}function B(a){return a in A||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function y(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function x(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function w(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function v(a){return 1-Math.sqrt(1-a*a)}function u(a){return a?Math.pow(2,10*(a-1))-.001:0}function t(a){return 1-Math.cos(a*Math.PI/2)}function s(a){return function(b){return Math.pow(b,a)}}function r(a){return a}function q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function p(a){return function(b){return 1-a(1-b)}}function k(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function i(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function g(a){a.apply(this,(arguments[0]=this,arguments));return this}function f(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function e(a){return a==null}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.14.1"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],f,g=-1,h=a.length;arguments.length<2&&(b=e);while(++g<h)b.call(d,f=a[g],g)?d=[]:(d.length||c.push(d),d.push(f));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(h,"\\$&")};var h=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=i(c);return b},d3.format=function(a){var b=j.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"−":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var l=a.length+j.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=k(a)),a=j+a}else{g&&(a=k(a)),a=j+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}return a}};var j=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l=s(2),m=s(3),n={linear:function(){return r},poly:s,quad:function(){return l},cubic:function(){return m},sin:function(){return t},exp:function(){return u},circle:function(){return v},elastic:w,back:x,bounce:function(){return y}},o={"in":function(a){return a},out:p,"in-out":q,"out-in":function(a){return q(p(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return o[d](n[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in I||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;z.lastIndex=0;for(d=0;c=z.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=z.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=z.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return M(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=B(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var z=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,A={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?F(""+a,C,M):C(~~a,~~b,~~c)};var I={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var J in I)I[J]=F(I[J],C,M);d3.hsl=function(a,b,c){return arguments.length==1?F(""+a,G,K):K(+a,+b,+c)};var N=function(a,b){return b.querySelector(a)},O=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(N=function(a,b){return Sizzle(a,b)[0]},O=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var P=Q([[document]]);P[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?P.select(a):Q([[a]])},d3.selectAll=function(b){return typeof b=="string"?P.selectAll(b):Q([a(b)])},d3.transition=P.transition;var U=0,V=0,Y=null,Z,$;d3.timer=function(a){_(a,0)};var bc=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function k(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function j(b){b=(b-a)*e;return h(i?Math.max(0,Math.min(1,b)):b)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d),i=!1;j.invert=function(b){return(b-c)*f+a},j.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return j},j.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return j},j.rangeRound=function(a){return j.range(a).interpolate(d3.interpolateRound)},j.clamp=function(a){if(!arguments.length)return i;i=a;return j},j.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return j},j.ticks=function(a){var b=k(a);return d3.range(b.start,b.stop,b.step)},j.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(k(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return j},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bd,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?be:bd,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===be){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bd.pow=function(a){return Math.pow(10,a)},be.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bg:bf;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bh)},d3.scale.category20=function(){return d3.scale.ordinal().range(bi)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bj)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bk)};var bh=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bi=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bj=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bk=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bl,h=d.apply(this,arguments)+bl,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bm?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bn,b=bo,c=bp,d=bq;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bl;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bl=-Math.PI/2,bm=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(br(this,c,a,b),e)}var a=bs,b=bt,c="linear",d=bu[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bu[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bu={linear:bv,"step-before":bw,"step-after":bx,basis:bC,"basis-closed" <add>(function(){function bS(){return"circle"}function bR(){return 64}function bP(a){return[a.x,a.y]}function bO(a){return a.endAngle}function bN(a){return a.startAngle}function bM(a){return a.radius}function bL(a){return a.target}function bK(a){return a.source}function bJ(){return 0}function bI(a,b,c){a.push("C",bE(bF,b),",",bE(bF,c),",",bE(bG,b),",",bE(bG,c),",",bE(bH,b),",",bE(bH,c))}function bE(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bD(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bE(bH,g),",",bE(bH,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bI(b,g,h);return b.join("")}function bC(a){if(a.length<3)return bv(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bI(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bI(b,h,i);return b.join("")}function bB(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bA(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bv(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bz(a,b,c){return a.length<3?bv(a):a[0]+bA(a,bB(a,b))}function by(a,b){return a.length<3?bv(a):a[0]+bA((a.push(a[0]),a),bB([a[a.length-2]].concat(a,[a[1]]),b))}function bx(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bw(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bv(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bt(a){return a[1]}function bs(a){return a[0]}function br(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bq(a){return a.endAngle}function bp(a){return a.startAngle}function bo(a){return a.outerRadius}function bn(a){return a.innerRadius}function bg(a){return function(b){return-Math.pow(-b,a)}}function bf(a){return function(b){return Math.pow(b,a)}}function be(a){return-Math.log(-a)/Math.LN10}function bd(a){return Math.log(a)/Math.LN10}function bb(){var a=null,b=Y,c=Infinity;while(b)b.flush?b=a?a.next=b.next:Y=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function ba(){var a,b=Date.now(),c=null,d=Y;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;var e=bb()-b;e>24?(isFinite(e)&&(clearTimeout($),$=setTimeout(ba,e)),Z=0):(Z=1,bc(ba))}function _(a,b){var c=Date.now(),d=!1,e,f=Y;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(Y={callback:a,then:c,delay:b,next:Y}),Z||($=clearTimeout($),Z=1,bc(ba))}}function X(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function W(a){function n(b){var g=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){g=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,h.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),V=c,h.end.dispatch.apply(this,arguments),V=0,n.owner=r}}}});return g}var b={},c=V||++U,d={},e=[],f=!1,h=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),_(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,X(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,X(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=W(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=W(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){h[a].add(c);return b},b.call=g;return b.delay(0).duration(250)}function T(a){return{__data__:a}}function S(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function R(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return Q(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function Q(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return Q(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return Q(c)}a.select=function(a){return b(function(b){return N(a,b)})},a.selectAll=function(a){return c(function(b){return O(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return Q(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=T(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=T(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=Q(e);k.enter=function(){return R(d)},k.exit=function(){return Q(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?g:h).call(this)}function h(){var a=f(this.className.replace(e," "));this.className=a.length?a:null}function g(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=f(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?g:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),N(c,b))}function d(b){return b.insertBefore(document.createElement(a),N(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=S.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e==-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function e(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=e,d)})},a.transition=function(){return W(a)},a.call=g;return a}function M(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return C(g(a+120),g(a),g(a-120))}function L(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function K(a,b,c){return{h:a,s:b,l:c,toString:L}}function H(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function G(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return K(g,h,i)}function F(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(H(h[0]),H(h[1]),H(h[2]))}}if(i=I[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function E(a){return a<16?"0"+a.toString(16):a.toString(16)}function D(){return"#"+E(this.r)+E(this.g)+E(this.b)}function C(a,b,c){return{r:a,g:b,b:c,toString:D}}function B(a){return a in A||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function y(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function x(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function w(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function v(a){return 1-Math.sqrt(1-a*a)}function u(a){return a?Math.pow(2,10*(a-1))-.001:0}function t(a){return 1-Math.cos(a*Math.PI/2)}function s(a){return function(b){return Math.pow(b,a)}}function r(a){return a}function q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function p(a){return function(b){return 1-a(1-b)}}function k(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function i(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function g(a){a.apply(this,(arguments[0]=this,arguments));return this}function f(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function e(a){return a==null}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.14.2"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],f,g=-1,h=a.length;arguments.length<2&&(b=e);while(++g<h)b.call(d,f=a[g],g)?d=[]:(d.length||c.push(d),d.push(f));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(h,"\\$&")};var h=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=i(c);return b},d3.format=function(a){var b=j.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"−":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var l=a.length+j.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=k(a)),a=j+a}else{g&&(a=k(a)),a=j+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}return a}};var j=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l=s(2),m=s(3),n={linear:function(){return r},poly:s,quad:function(){return l},cubic:function(){return m},sin:function(){return t},exp:function(){return u},circle:function(){return v},elastic:w,back:x,bounce:function(){return y}},o={"in":function(a){return a},out:p,"in-out":q,"out-in":function(a){return q(p(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return o[d](n[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in I||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;z.lastIndex=0;for(d=0;c=z.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=z.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=z.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return M(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=B(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var z=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,A={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?F(""+a,C,M):C(~~a,~~b,~~c)};var I={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var J in I)I[J]=F(I[J],C,M);d3.hsl=function(a,b,c){return arguments.length==1?F(""+a,G,K):K(+a,+b,+c)};var N=function(a,b){return b.querySelector(a)},O=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(N=function(a,b){return Sizzle(a,b)[0]},O=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var P=Q([[document]]);P[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?P.select(a):Q([[a]])},d3.selectAll=function(b){return typeof b=="string"?P.selectAll(b):Q([a(b)])},d3.transition=P.transition;var U=0,V=0,Y=null,Z,$;d3.timer=function(a){_(a,0)};var bc=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function k(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function j(b){b=(b-a)*e;return h(i?Math.max(0,Math.min(1,b)):b)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d),i=!1;j.invert=function(b){return(b-c)*f+a},j.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return j},j.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return j},j.rangeRound=function(a){return j.range(a).interpolate(d3.interpolateRound)},j.clamp=function(a){if(!arguments.length)return i;i=a;return j},j.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return j},j.ticks=function(a){var b=k(a);return d3.range(b.start,b.stop,b.step)},j.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(k(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return j},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bd,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?be:bd,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===be){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bd.pow=function(a){return Math.pow(10,a)},be.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bg:bf;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bh)},d3.scale.category20=function(){return d3.scale.ordinal().range(bi)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bj)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bk)};var bh=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bi=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bj=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bk=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bl,h=d.apply(this,arguments)+bl,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bm?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bn,b=bo,c=bp,d=bq;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bl;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bl=-Math.PI/2,bm=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(br(this,c,a,b),e)}var a=bs,b=bt,c="linear",d=bu[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bu[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bu={linear:bv,"step-before":bw,"step-after":bx,basis:bC,"basis-closed" <ide> :bD,cardinal:bz,"cardinal-closed":by},bF=[0,2/3,1/3,0],bG=[0,1/3,2/3,0],bH=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(br(this,d,a,c),f)+"L"+e(br(this,d,a,b).reverse(),f)+"Z"}var a=bs,b=bJ,c=bt,d="linear",e=bu[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bu[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bl,k=e.call(a,h,g)+bl;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=bK,b=bL,c=bM,d=bp,e=bq;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=bK,b=bL,c=bP;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(bQ<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),d=c[0][0].getScreenCTM();bQ=!d.f&&!d.e,c.remove()}bQ?(b.x=d3.event.pageX,b.y=d3.event.pageY):(b.x=d3.event.clientX,b.y=d3.event.clientY),b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var bQ=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function c(c,d){return(bT[a.call(this,c,d)]||bT.circle)(b.call(this,c,d))}var a=bS,b=bR;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c},d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var bT={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*bV)),c=b*bV;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/bU),c=b*bU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/bU),c=b*bU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}},bU=Math.sqrt(3),bV=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <ide><path>src/core/core.js <del>d3 = {version: "1.14.1"}; // semver <add>d3 = {version: "1.14.2"}; // semver <ide><path>src/csv/parse.js <ide> d3.csv.parseRows = function(text, f) { <ide> t, // the current token <ide> eol; // is the current token followed by EOL? <ide> <add> re.lastIndex = 0; // work-around bug in FF 3.6 <add> <ide> /** @private Returns the next token. */ <ide> function token() { <ide> if (re.lastIndex == text.length) return EOF; // special case: end of file
6
Ruby
Ruby
fix rubocop warnings
e89de3351f69a99bdc5d528c7abe3f771ae47b56
<ide><path>Library/Homebrew/test/test_integration_cmds.rb <ide> def cmd_output(*args) <ide> def cmd(*args) <ide> output = cmd_output(*args) <ide> status = $?.exitstatus <del> puts "\n#{output}" if status != 0 <add> puts "\n#{output}" if status.nonzero? <ide> assert_equal 0, status <ide> output <ide> end <ide> <ide> def cmd_fail(*args) <ide> output = cmd_output(*args) <ide> status = $?.exitstatus <del> $stderr.puts "\n#{output}" if status == 0 <add> $stderr.puts "\n#{output}" if status.zero? <ide> refute_equal 0, status <ide> output <ide> end <ide> def test_env <ide> end <ide> <ide> def test_env_bash <del> assert_match %r{export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"}, <del> cmd("--env", "--shell=bash") <add> assert_match(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/, <add> cmd("--env", "--shell=bash")) <ide> end <ide> <ide> def test_env_fish <del> assert_match %r{set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"}, <del> cmd("--env", "--shell=fish") <add> assert_match(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/, <add> cmd("--env", "--shell=fish")) <ide> end <ide> <ide> def test_env_csh <del> assert_match %r{setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};}, <del> cmd("--env", "--shell=tcsh") <add> assert_match(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};/, <add> cmd("--env", "--shell=tcsh")) <ide> end <ide> <ide> def test_env_plain <del> assert_match %r{CMAKE_PREFIX_PATH: #{Regexp.quote(HOMEBREW_PREFIX)}}, <del> cmd("--env", "--plain") <add> assert_match(/CMAKE_PREFIX_PATH: #{Regexp.quote(HOMEBREW_PREFIX)}/, <add> cmd("--env", "--plain")) <ide> end <ide> <ide> def test_prefix_formula
1
PHP
PHP
change some wording
fc063229a87ae38ea858067a5054895ac865874c
<ide><path>src/Illuminate/Console/Scheduling/Event.php <ide> class Event <ide> * @var string <ide> */ <ide> public $output = '/dev/null'; <del> <add> <ide> /** <ide> * The array of callbacks to be run before the event is started. <ide> * <ide> protected function runCommandInBackground() <ide> protected function runCommandInForeground(Container $container) <ide> { <ide> $this->callBeforeCallbacks($container); <del> <add> <ide> (new Process( <ide> trim($this->buildCommand(), '& '), base_path(), null, null, null <ide> ))->run(); <ide> <ide> $this->callAfterCallbacks($container); <ide> } <del> <add> <ide> /** <ide> * Call all of the "before" callbacks for the event. <ide> * <ide> protected function getEmailSubject() <ide> <ide> return 'Scheduled Job Output'; <ide> } <del> <add> <ide> /** <ide> * Register a callback to ping a given URL before the job runs. <ide> * <ide> * @param string $url <ide> * @return $this <ide> */ <del> public function firstPing($url) <add> public function pingBefore($url) <ide> { <del> return $this->first(function () use ($url) { (new HttpClient)->get($url); }); <add> return $this->before(function () use ($url) { (new HttpClient)->get($url); }); <ide> } <ide> <ide> /** <ide> public function firstPing($url) <ide> * @param \Closure $callback <ide> * @return $this <ide> */ <del> public function first(Closure $callback) <add> public function before(Closure $callback) <ide> { <ide> $this->beforeCallbacks[] = $callback; <ide> <ide> public function thenPing($url) <ide> return $this->then(function () use ($url) { (new HttpClient)->get($url); }); <ide> } <ide> <add> /** <add> * Register a callback to be called after the operation. <add> * <add> * @param \Closure $callback <add> * @return $this <add> */ <add> public function after(Closure $callback) <add> { <add> return $this->then($callback); <add> } <add> <ide> /** <ide> * Register a callback to be called after the operation. <ide> *
1
Ruby
Ruby
remove special case for xquartz
91d6009891e84ec1a19bc3b9edabf4db4f96b184
<ide><path>Library/Homebrew/test/bundle_version_spec.rb <ide> describe Homebrew::BundleVersion do <ide> describe "#nice_version" do <ide> expected_mappings = { <del> ["1.2", nil] => "1.2", <del> [nil, "1.2.3"] => "1.2.3", <del> ["1.2", "1.2.3"] => "1.2.3", <del> ["1.2.3", "1.2"] => "1.2.3", <del> ["1.2.3", "8312"] => "1.2.3,8312", <del> ["2021", "2006"] => "2021,2006", <del> ["1.0", "1"] => "1.0", <del> ["1.0", "0"] => "1.0", <del> ["1.2.3.4000", "4000"] => "1.2.3.4000", <del> ["5", "5.0.45"] => "5.0.45", <del> ["XQuartz-2.7.11", "2.7.112"] => "2.7.11", <del> ["2.5.2(3329)", "3329"] => "2.5.2,3329", <add> ["1.2", nil] => "1.2", <add> [nil, "1.2.3"] => "1.2.3", <add> ["1.2", "1.2.3"] => "1.2.3", <add> ["1.2.3", "1.2"] => "1.2.3", <add> ["1.2.3", "8312"] => "1.2.3,8312", <add> ["2021", "2006"] => "2021,2006", <add> ["1.0", "1"] => "1.0", <add> ["1.0", "0"] => "1.0", <add> ["1.2.3.4000", "4000"] => "1.2.3.4000", <add> ["5", "5.0.45"] => "5.0.45", <add> ["2.5.2(3329)", "3329"] => "2.5.2,3329", <ide> } <ide> <ide> expected_mappings.each do |(short_version, version), expected_version|
1
Javascript
Javascript
remember previous item locations
5c7bd668967291958b65bf9186d7b5f5c009081c
<ide><path>src/workspace.js <ide> const {Directory} = require('pathwatcher') <ide> const DefaultDirectorySearcher = require('./default-directory-searcher') <ide> const Dock = require('./dock') <ide> const Model = require('./model') <add>const StateStore = require('./state-store') <ide> const TextEditor = require('./text-editor') <ide> const PaneContainer = require('./pane-container') <ide> const Panel = require('./panel') <ide> module.exports = class Workspace extends Model { <ide> this.textEditorRegistry = params.textEditorRegistry <ide> this.hoveredDock = null <ide> this.draggingItem = false <add> this.previousLocations = new StateStore('AtomPreviousItemLocations', 1) <ide> <ide> this.emitter = new Emitter() <ide> this.openers = [] <ide> module.exports = class Workspace extends Model { <ide> this.subscribeToActiveItem() <ide> this.subscribeToFontSize() <ide> this.subscribeToAddedItems() <add> this.subscribeToMovedItems() <ide> } <ide> <ide> consumeServices ({serviceHub}) { <ide> module.exports = class Workspace extends Model { <ide> }) <ide> } <ide> <add> subscribeToMovedItems () { <add> if (this.movedItemSubscription != null) { <add> this.movedItemSubscription.dispose() <add> } <add> const paneLocations = Object.assign({center: this}, this.docks) <add> this.movedItemSubscription = new CompositeDisposable( <add> ..._.map(paneLocations, (host, location) => ( <add> host.observePanes(pane => { <add> pane.onDidAddItem(({item}) => { <add> if (typeof item.getURI === 'function') { <add> const uri = item.getURI() <add> if (uri != null) { <add> this.previousLocations.save(item.getURI(), location) <add> } <add> } <add> }) <add> }) <add> )) <add> ) <add> } <add> <ide> // Updates the application's title and proxy icon based on whichever file is <ide> // open. <ide> updateWindowTitle () { <ide> module.exports = class Workspace extends Model { <ide> openItem (item, options = {}) { <ide> let {pane, split} = options <ide> <del> if (item == null) return undefined <del> if (pane != null && pane.isDestroyed()) return item <add> if (item == null) return Promise.resolve() <add> if (pane != null && pane.isDestroyed()) return Promise.resolve(item) <ide> <del> if (pane == null) { <del> // If this is a new item, we want to determine where to put it in the following way: <del> // - If you provided a split, you want to put it in that split of the center location <del> // (legacy behavior) <del> // - If the item specifies a default location, use that. <del> let locationInfo, location <del> if (split == null) { <del> if (locationInfo == null && typeof item.getDefaultLocation === 'function') { <del> locationInfo = item.getDefaultLocation() <del> } <del> if (locationInfo != null) { <del> if (typeof locationInfo === 'string') { <del> location = locationInfo <del> } else { <del> location = locationInfo.location <del> split = locationInfo.split <del> } <del> } <del> } <add> const uri = options.uri == null && typeof item.getURI === 'function' ? item.getURI() : options.uri <ide> <del> pane = this.docks[location] == null ? this.getActivePane() : this.docks[location].getActivePane() <del> switch (split) { <del> case 'left': <del> pane = pane.findLeftmostSibling() <del> break <del> case 'right': <del> pane = pane.findOrCreateRightmostSibling() <del> break <del> case 'up': <del> pane = pane.findTopmostSibling() <del> break <del> case 'down': <del> pane = pane.findOrCreateBottommostSibling() <del> break <add> let location <add> // If a split was provided, make sure it goes in the center location (legacy behavior) <add> if (pane == null && split == null) { <add> if (uri != null) { <add> location = this.previousLocations.load(uri) <add> } <add> if (location == null && typeof item.getDefaultLocation === 'function') { <add> location = item.getDefaultLocation() <ide> } <ide> } <ide> <del> if (!options.pending && (pane.getPendingItem() === item)) { <del> pane.clearPendingItem() <del> } <add> return Promise.resolve(location) <add> .then(location => { <add> if (pane != null) return pane <add> <add> pane = this.docks[location] == null ? this.getActivePane() : this.docks[location].getActivePane() <add> switch (split) { <add> case 'left': return pane.findLeftmostSibling() <add> case 'right': return pane.findOrCreateRightmostSibling() <add> case 'up': return pane.findTopmostSibling() <add> case 'down': return pane.findOrCreateBottommostSibling() <add> default: return pane <add> } <add> }) <add> .then(pane => { <add> if (!options.pending && (pane.getPendingItem() === item)) { <add> pane.clearPendingItem() <add> } <ide> <del> const activatePane = options.activatePane != null ? options.activatePane : true <del> const activateItem = options.activateItem != null ? options.activateItem : true <del> this.itemOpened(item) <del> if (activateItem) { <del> pane.activateItem(item, {pending: options.pending}) <del> } <del> if (activatePane) { <del> pane.activate() <del> } <add> const activatePane = options.activatePane != null ? options.activatePane : true <add> const activateItem = options.activateItem != null ? options.activateItem : true <add> this.itemOpened(item) <add> if (activateItem) { <add> pane.activateItem(item, {pending: options.pending}) <add> } <add> if (activatePane) { <add> pane.activate() <add> } <ide> <del> let initialColumn = 0 <del> let initialLine = 0 <del> if (!Number.isNaN(options.initialLine)) { <del> initialLine = options.initialLine <del> } <del> if (!Number.isNaN(options.initialColumn)) { <del> initialColumn = options.initialColumn <del> } <del> if ((initialLine >= 0) || (initialColumn >= 0)) { <del> if (typeof item.setCursorBufferPosition === 'function') { <del> item.setCursorBufferPosition([initialLine, initialColumn]) <del> } <del> } <add> let initialColumn = 0 <add> let initialLine = 0 <add> if (!Number.isNaN(options.initialLine)) { <add> initialLine = options.initialLine <add> } <add> if (!Number.isNaN(options.initialColumn)) { <add> initialColumn = options.initialColumn <add> } <add> if ((initialLine >= 0) || (initialColumn >= 0)) { <add> if (typeof item.setCursorBufferPosition === 'function') { <add> item.setCursorBufferPosition([initialLine, initialColumn]) <add> } <add> } <ide> <del> const index = pane.getActiveItemIndex() <del> const uri = options.uri == null && typeof item.getURI === 'function' ? item.getURI() : options.uri <del> this.emitter.emit('did-open', {uri, pane, item, index}) <del> return item <add> const index = pane.getActiveItemIndex() <add> this.emitter.emit('did-open', {uri, pane, item, index}) <add> return item <add> }) <ide> } <ide> <ide> openTextFile (uri, options) { <ide> module.exports = class Workspace extends Model { <ide> if (this.activeItemSubscriptions != null) { <ide> this.activeItemSubscriptions.dispose() <ide> } <add> if (this.movedItemSubscription != null) { <add> this.movedItemSubscription.dispose() <add> } <ide> } <ide> <ide> /*
1
Text
Text
serverless bullet point
bfbc23d71076c17fe083f8820cdc150afe2f241b
<ide><path>packages/next/README.md <ide> - [Starting the server on alternative hostname](#starting-the-server-on-alternative-hostname) <ide> - [CDN support with Asset Prefix](#cdn-support-with-asset-prefix) <ide> - [Production deployment](#production-deployment) <add> - [Serverless deployment](#serverless-deployment) <ide> - [Static HTML export](#static-html-export) <ide> - [Usage](#usage) <ide> - [Limitation](#limitation)
1
PHP
PHP
fix mailmessage markdown
3f7429c2f687013871e0fbf53bcfe4309007779d
<ide><path>src/Illuminate/Notifications/Messages/MailMessage.php <ide> class MailMessage extends SimpleMessage <ide> /** <ide> * The Markdown template to render (if applicable). <ide> * <del> * @var string <add> * @var string|null <ide> */ <ide> public $markdown = 'notifications::email'; <ide>
1
PHP
PHP
fix few errors reported on phpstan level 3
1b378f1b726107adc7b4fb5c794b405f96d13928
<ide><path>src/Auth/Storage/SessionStorage.php <ide> public function __construct(ServerRequest $request, Response $response, array $c <ide> /** <ide> * Read user record from session. <ide> * <del> * @return array|null User record if available else null. <add> * @return \ArrayAccess|array|null User record if available else null. <ide> */ <ide> public function read() <ide> { <ide><path>src/Database/Query.php <ide> public function removeJoin($name) <ide> */ <ide> public function leftJoin($table, $conditions = [], $types = []) <ide> { <del> return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_LEFT), $types); <add> $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_LEFT), $types); <add> <add> return $this; <ide> } <ide> <ide> /** <ide> public function leftJoin($table, $conditions = [], $types = []) <ide> */ <ide> public function rightJoin($table, $conditions = [], $types = []) <ide> { <del> return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_RIGHT), $types); <add> $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_RIGHT), $types); <add> <add> return $this; <ide> } <ide> <ide> /** <ide> public function rightJoin($table, $conditions = [], $types = []) <ide> */ <ide> public function innerJoin($table, $conditions = [], $types = []) <ide> { <del> return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_INNER), $types); <add> $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_INNER), $types); <add> <add> return $this; <ide> } <ide> <ide> /** <ide> public function getValueBinder() <ide> * associate values to those placeholders so that they can be passed correctly <ide> * to the statement object. <ide> * <del> * @param \Cake\Database\ValueBinder|bool $binder The binder or false to disable binding. <add> * @param \Cake\Database\ValueBinder|null $binder The binder or null to disable binding. <ide> * @return $this <ide> */ <ide> public function setValueBinder($binder) <ide> public function setValueBinder($binder) <ide> return $this; <ide> } <ide> <del> /** <del> * Returns the currently used ValueBinder instance. If a value is passed, <del> * it will be set as the new instance to be used. <del> * <del> * A ValueBinder is responsible for generating query placeholders and temporarily <del> * associate values to those placeholders so that they can be passed correctly <del> * to the statement object. <del> * <del> * @deprecated 3.5.0 Use setValueBinder()/getValueBinder() instead. <del> * @param \Cake\Database\ValueBinder|false|null $binder new instance to be set. If no value is passed the <del> * default one will be returned <del> * @return $this|\Cake\Database\ValueBinder <del> */ <del> public function valueBinder($binder = null) <del> { <del> deprecationWarning('Query::valueBinder() is deprecated. Use Query::getValueBinder()/setValueBinder() instead.'); <del> if ($binder === null) { <del> if ($this->_valueBinder === null) { <del> $this->_valueBinder = new ValueBinder(); <del> } <del> <del> return $this->_valueBinder; <del> } <del> $this->_valueBinder = $binder; <del> <del> return $this; <del> } <del> <ide> /** <ide> * Enables/Disables buffered results. <ide> * <ide> public function selectTypeMap(TypeMap $typeMap = null) <ide> * any registered callbacks. <ide> * <ide> * @param \Cake\Database\StatementInterface $statement to be decorated <del> * @return \Cake\Database\Statement\CallbackStatement <add> * @return \Cake\Database\Statement\CallbackStatement|Cake\Database\StatementInterface <ide> */ <ide> protected function _decorateStatement($statement) <ide> { <ide><path>src/Database/Statement/PDOStatement.php <ide> public function fetch($type = parent::FETCH_TYPE_NUM) <ide> * ``` <ide> * <ide> * @param string $type num for fetching columns as positional keys or assoc for column names as keys <del> * @return array list of all results from database for this statement <add> * @return array|false list of all results from database for this statement, false on failure <ide> */ <ide> public function fetchAll($type = parent::FETCH_TYPE_NUM) <ide> { <ide><path>src/Event/EventManager.php <ide> protected function _extractCallable($function, $object) <ide> $method = [$object, $method]; <ide> } <ide> <del> return [$method, $options]; <add> /** @var callable $callable */ <add> $callable = [$method, $options]; <add> <add> return $callable; <ide> } <ide> <ide> /** <ide><path>src/Http/ServerRequestFactory.php <ide> abstract class ServerRequestFactory extends BaseFactory <ide> { <ide> /** <del> * {@inheritDoc} <add> * Create a request from the supplied superglobal values. <add> * <add> * If any argument is not supplied, the corresponding superglobal value will <add> * be used. <add> * <add> * The ServerRequest created is then passed to the fromServer() method in <add> * order to marshal the request URI and headers. <add> * <add> * @see fromServer() <add> * @param array $server $_SERVER superglobal <add> * @param array $query $_GET superglobal <add> * @param array $body $_POST superglobal <add> * @param array $cookies $_COOKIE superglobal <add> * @param array $files $_FILES superglobal <add> * @return \Cake\Http\ServerRequest <add> * @throws \InvalidArgumentException for invalid file values <ide> */ <ide> public static function fromGlobals( <ide> array $server = null, <ide><path>src/ORM/Association/Loader/SelectLoader.php <ide> protected function _addFilteringJoin($query, $key, $subquery) <ide> $filter = current($filter); <ide> } <ide> <del> $conditions = $conditions ?: $query->newExpr([$key => $filter]); <add> $conditions = $conditions ?: $query->newExpr([(string)$key => $filter]); <ide> <ide> return $query->innerJoin( <ide> [$aliasedTable => $subquery], <ide><path>src/Utility/CookieCryptTrait.php <ide> trait CookieCryptTrait <ide> * <ide> * @var array <ide> */ <del> protected $_validCiphers = ['aes', 'rijndael']; <add> protected $_validCiphers = ['aes']; <ide> <ide> /** <ide> * Returns the encryption key to be used. <ide> protected function _decode($value, $encrypt, $key) <ide> if ($key === null) { <ide> $key = $this->_getCookieEncryptionKey(); <ide> } <del> if ($encrypt === 'rijndael') { <del> $value = Security::rijndael($value, $key, 'decrypt'); <del> } <ide> if ($encrypt === 'aes') { <ide> $value = Security::decrypt($value, $key); <ide> } <ide><path>src/Utility/Inflector.php <ide> class Inflector <ide> * <ide> * @param string $type Inflection type <ide> * @param string $key Original value <del> * @param string|bool $value Inflected value <add> * @param string|false $value Inflected value <ide> * @return string|false Inflected value on cache hit or false on cache miss. <ide> */ <ide> protected static function _cache($type, $key, $value = false) <ide><path>src/View/Helper/NumberHelper.php <ide> public function format($number, array $options = []) <ide> $formatted = $this->_engine->format($number, $options); <ide> $options += ['escape' => true]; <ide> <del> return $options['escape'] ? h($formatted) : $formatted; <add> return $options['escape'] ? (string)h($formatted) : $formatted; <ide> } <ide> <ide> /** <ide> public function currency($number, $currency = null, array $options = []) <ide> $formatted = $this->_engine->currency($number, $currency, $options); <ide> $options += ['escape' => true]; <ide> <del> return $options['escape'] ? h($formatted) : $formatted; <add> return $options['escape'] ? (string)h($formatted) : $formatted; <ide> } <ide> <ide> /** <ide> public function formatDelta($value, array $options = []) <ide> $formatted = $this->_engine->formatDelta($value, $options); <ide> $options += ['escape' => true]; <ide> <del> return $options['escape'] ? h($formatted) : $formatted; <add> return $options['escape'] ? (string)h($formatted) : $formatted; <ide> } <ide> <ide> /** <ide><path>src/View/Helper/TimeHelper.php <ide> public function gmt($string = null) <ide> * <ide> * @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string) <ide> * @param int|string|null $format date format string (or a UNIX timestamp, strtotime() valid string or DateTime object) <del> * @param bool|string $invalid Default value to display on invalid dates <add> * @param false|string $invalid Default value to display on invalid dates <ide> * @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object <del> * @return string Formatted and translated date string <add> * @return string|false Formatted and translated date string <ide> * @see \Cake\I18n\Time::i18nFormat() <ide> */ <ide> public function format($date, $format = null, $invalid = false, $timezone = null) <ide> public function format($date, $format = null, $invalid = false, $timezone = null <ide> * <ide> * @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object <ide> * @param string|null $format Intl compatible format string. <del> * @param bool|string $invalid Default value to display on invalid dates <add> * @param false|string $invalid Default value to display on invalid dates <ide> * @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object <ide> * @return string|false Formatted and translated date string or value for `$invalid` on failure. <ide> * @throws \Exception When the date cannot be parsed <ide><path>src/View/View.php <ide> public function template($name = null) <ide> * The name specified is the filename of the layout in /src/Template/Layout <ide> * without the .ctp extension. <ide> * <del> * @return string <add> * @return string|false <ide> */ <ide> public function getLayout() <ide> { <ide> public function setLayout($name) <ide> * <ide> * @deprecated 3.5.0 Use getLayout()/setLayout() instead. <ide> * @param string|null $name Layout file name to set. If null returns current name. <del> * @return string|null <add> * @return string|false <ide> */ <ide> public function layout($name = null) <ide> {
11
Ruby
Ruby
remove the side-effects of validates_presence_of
18cc7123abffcbcbd255d02473da84c94a4c8c64
<ide><path>activerecord/test/cases/validations/presence_validation_test.rb <ide> def test_validates_presence_of_has_many_marked_for_destruction <ide> end <ide> <ide> def test_validates_presence_doesnt_convert_to_array <del> Speedometer.validates_presence_of :dashboard <add> speedometer = Class.new(Speedometer) <add> speedometer.validates_presence_of :dashboard <ide> <ide> dash = Dashboard.new <ide> <ide> # dashboard has to_a method <ide> def dash.to_a; ['(/)', '(\)']; end <ide> <del> s = Speedometer.new <add> s = speedometer.new <ide> s.dashboard = dash <ide> <ide> assert_nothing_raised { s.valid? }
1
Javascript
Javascript
use ember.logger.info instead of console.log
c40e9be34943c48f4bf796509472324ece5cdf84
<ide><path>packages/ember-handlebars/lib/helpers/debug.js <ide> function debuggerHelper(options) { <ide> // These are helpful values you can inspect while debugging. <ide> var templateContext = this; <ide> var typeOfTemplateContext = inspect(templateContext); <del> console.log('Use `this` to access the context of the calling template'); <add> Ember.Logger.info('Use `this` to access the context of the calling template.'); <ide> <ide> debugger; <ide> }
1
Java
Java
fix calls to reactinstancemanager.onresume()
f8b8fa40fd9fc80fb5054cde28650237fb849e14
<ide><path>Examples/Movies/android/app/src/main/java/com/facebook/react/movies/MoviesActivity.java <ide> protected void onResume() { <ide> super.onResume(); <ide> <ide> if (mReactInstanceManager != null) { <del> mReactInstanceManager.onResume(this); <add> mReactInstanceManager.onResume(this, this); <ide> } <ide> } <ide> <ide><path>Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java <ide> protected void onResume() { <ide> super.onResume(); <ide> <ide> if (mReactInstanceManager != null) { <del> mReactInstanceManager.onResume(this); <add> mReactInstanceManager.onResume(this, this); <ide> } <ide> } <ide>
2
PHP
PHP
use constant instead of integer
7e90881c454d4ae48f67f01f911e58850569c20d
<ide><path>src/Http/Client/Adapter/Curl.php <ide> public function send(Request $request, array $options) <ide> curl_close($ch); <ide> <ide> $status = 500; <del> if ($errorCode === 28) { <add> if ($errorCode === CURLE_OPERATION_TIMEOUTED) { <ide> $status = 504; <ide> } <ide> throw new HttpException("cURL Error ({$errorCode}) {$error}", $status);
1
PHP
PHP
apply changes done in to paginator
abeab1fa9128306997e9bfe21156c6aa253f4e6d
<ide><path>src/Datasource/Paginator.php <ide> public function paginate($object, array $params = [], array $settings = []) <ide> $query->applyOptions($options); <ide> } <ide> <add> $cleanQuery = clone $query; <ide> $results = $query->all(); <ide> $numResults = count($results); <del> $count = $numResults ? $query->count() : 0; <add> $count = $numResults ? $cleanQuery->count() : 0; <ide> <ide> $page = $options['page']; <ide> $limit = $options['limit']; <ide><path>tests/TestCase/Datasource/PaginatorTest.php <ide> <ide> use Cake\Core\Configure; <ide> use Cake\Datasource\ConnectionManager; <add>use Cake\Datasource\EntityInterface; <ide> use Cake\Datasource\Exception\PageOutOfBoundsException; <ide> use Cake\Datasource\Paginator; <ide> use Cake\ORM\Entity; <ide> class PaginatorTest extends TestCase <ide> * <ide> * @var array <ide> */ <del> public $fixtures = ['core.posts']; <add> public $fixtures = [ <add> 'core.posts', 'core.articles', 'core.articles_tags', <add> 'core.authors', 'core.authors_tags', 'core.tags' <add> ]; <ide> <ide> /** <ide> * Don't load data for fixtures for all tests <ide> public function testPaginateCustomFinder() <ide> $this->assertEquals('popular', $pagingParams['PaginatorPosts']['finder']); <ide> } <ide> <add> /** <add> * Test that nested eager loaders don't trigger invalid SQL errors. <add> * <add> * @return void <add> */ <add> public function testPaginateNestedEagerLoader() <add> { <add> $this->loadFixtures('Articles', 'Tags', 'Authors', 'ArticlesTags', 'AuthorsTags'); <add> $articles = TableRegistry::get('Articles'); <add> $articles->belongsToMany('Tags'); <add> $tags = TableRegistry::get('Tags'); <add> $tags->belongsToMany('Authors'); <add> $articles->eventManager()->on('Model.beforeFind', function ($event, $query) { <add> $query ->matching('Tags', function ($q) { <add> return $q->matching('Authors', function ($q) { <add> return $q->where(['Authors.name' => 'larry']); <add> }); <add> }); <add> }); <add> $results = $this->Paginator->paginate($articles); <add> $result = $results->first(); <add> $this->assertInstanceOf(EntityInterface::class, $result); <add> $this->assertInstanceOf(EntityInterface::class, $result->_matchingData['Tags']); <add> $this->assertInstanceOf(EntityInterface::class, $result->_matchingData['Authors']); <add> } <add> <ide> /** <ide> * test that flat default pagination parameters work. <ide> *
2
Ruby
Ruby
use helper method here
e8041042006eb7cb3253f1bdb38d6e2fe9a785d7
<ide><path>actionpack/test/template/template_test.rb <ide> def test_no_magic_comment_word_with_utf_8 <ide> # is set to something other than UTF-8, we don't <ide> # get any errors and get back a UTF-8 String. <ide> def test_default_external_works <del> Encoding.default_external = "ISO-8859-1" <del> @template = new_template("hello \xFCmlat") <del> assert_equal Encoding::UTF_8, render.encoding <del> assert_equal "hello \u{fc}mlat", render <del> ensure <del> Encoding.default_external = "UTF-8" <add> with_external_encoding "ISO-8859-1" do <add> @template = new_template("hello \xFCmlat") <add> assert_equal Encoding::UTF_8, render.encoding <add> assert_equal "hello \u{fc}mlat", render <add> end <ide> end <ide> <ide> def test_encoding_can_be_specified_with_magic_comment
1
Ruby
Ruby
remove the nil check from set_inverse_instance
c76549d6de3716782d227c370a2169450274ed97
<ide><path>activerecord/lib/active_record/associations/association.rb <ide> def reset_scope <ide> <ide> # Set the inverse association, if possible <ide> def set_inverse_instance(record) <del> if record && invertible_for?(record) <add> if invertible_for?(record) <ide> inverse = record.association(inverse_reflection_for(record).name) <ide> inverse.target = owner <ide> inverse.inversed = true <ide> end <add> record <ide> end <ide> <ide> # Returns the class of the target. belongs_to polymorphic overrides this to look at the <ide><path>activerecord/lib/active_record/associations/belongs_to_association.rb <ide> def replace(record) <ide> <ide> update_counters(record) <ide> replace_keys(record) <del> set_inverse_instance(record) <add> set_inverse_instance(record) if record <ide> <ide> @updated = true if record <ide> <ide><path>activerecord/lib/active_record/associations/preloader/singular_association.rb <ide> def preload(preloader) <ide> <ide> association = owner.association(reflection.name) <ide> association.target = record <del> association.set_inverse_instance(record) <add> association.set_inverse_instance(record) if record <ide> end <ide> end <ide> <ide><path>activerecord/lib/active_record/associations/singular_association.rb <ide> def create_scope <ide> end <ide> <ide> def find_target <del> scope.first.tap { |record| set_inverse_instance(record) } <add> if record = scope.first <add> set_inverse_instance record <add> end <ide> end <ide> <ide> def replace(record)
4
Ruby
Ruby
fix version detection with unknown clang
7f2cebd4dfd444adc8e19ffbdc16485d8725042e
<ide><path>Library/Homebrew/os/mac/xcode.rb <ide> def detect_version <ide> end <ide> <ide> def detect_version_from_clang_version <add> return "dunno" if DevelopmentTools.clang_version.null? <ide> # This logic provides a fake Xcode version based on the <ide> # installed CLT version. This is useful as they are packaged <ide> # simultaneously so workarounds need to apply to both based on their
1
Python
Python
fix broken test and invalid variable declarations
3eaa60bc232b05b01ce34c9a541374dbceb34942
<ide><path>libcloud/test/test_connection.py <ide> from libcloud.common.base import LoggingConnection <ide> from libcloud.httplib_ssl import LibcloudBaseConnection <ide> from libcloud.httplib_ssl import LibcloudHTTPConnection <add>from libcloud.utils.py3 import PY26 <ide> <ide> <ide> class BaseConnectionClassTestCase(unittest.TestCase): <ide> def test_parse_proxy_url(self): <add> if PY26: <add> return <add> <ide> conn = LibcloudBaseConnection() <ide> <ide> proxy_url = 'http://127.0.0.1:3128' <ide> def test_parse_proxy_url(self): <ide> proxy_url=proxy_url) <ide> <ide> def test_constructor(self): <add> if PY26: <add> return <add> <ide> conn = LibcloudHTTPConnection(host='localhost', port=80) <ide> self.assertEqual(conn.proxy_scheme, None) <ide> self.assertEqual(conn.proxy_host, None) <ide><path>libcloud/utils/py3.py <ide> <ide> PY2 = False <ide> PY25 = False <add>PY26 = False <ide> PY27 = False <ide> PY3 = False <ide> PY32 = False <ide> <ide> if sys.version_info >= (2, 0) and sys.version_info < (3, 0): <ide> PY2 = True <ide> <del>if sys.version_info >= (2, 5) and sys.version_info <= (2, 6): <add>if sys.version_info >= (2, 5) and sys.version_info < (2, 6): <ide> PY25 = True <ide> <del>if sys.version_info >= (2, 7) and sys.version_info <= (2, 8): <add>if sys.version_info >= (2, 6) and sys.version_info < (2, 7): <add> PY26 = True <add> <add>if sys.version_info >= (2, 7) and sys.version_info < (2, 8): <ide> PY27 = True <ide> <ide> if sys.version_info >= (3, 0):
2
Python
Python
fix typo in docstring demonstrating usage
8d3e218ea62d90bbb376502d6e2598819163dd01
<ide><path>src/transformers/modeling_encoder_decoder.py <ide> def from_pretrained( <ide> Examples:: <ide> <ide> # For example purposes. Not runnable. <del> model = PreTrainedEncoderDecoder.from_pretained('bert-base-uncased', 'bert-base-uncased') # initialize Bert2Bert <add> model = PreTrainedEncoderDecoder.from_pretrained('bert-base-uncased', 'bert-base-uncased') # initialize Bert2Bert <ide> """ <ide> <ide> # keyword arguments come in 3 flavors: encoder-specific (prefixed by
1
Python
Python
remove a log message
cd600f6f486f1812778f53668da86c203c12646b
<ide><path>glances/plugins/glances_diskio.py <ide> def update(self): <ide> continue <ide> <ide> # Shall we display the stats ? <del> logger.info("diskio: %s => %s", disk, self.is_display(disk)) <ide> if not self.is_display(disk): <ide> continue <ide>
1
PHP
PHP
remove unneeded phpcs ignores
74640f4fa806d12a173ead347bc748c06114b4e2
<ide><path>src/Database/Type/DateTimeType.php <ide> protected function _setClassName(string $class, string $fallback): void <ide> $class = $fallback; <ide> } <ide> $this->_className = $class; <del> // @codingStandardsIgnoreLine <ide> $this->_datetimeInstance = new $this->_className(); <ide> } <ide> <ide><path>src/Form/Form.php <ide> public function implementedEvents(): array <ide> public function schema(?Schema $schema = null): Schema <ide> { <ide> if ($schema === null && empty($this->_schema)) { <del> // @codingStandardsIgnoreLine <ide> $schema = $this->_buildSchema(new $this->_schemaClass()); <ide> } <ide> if ($schema) { <ide><path>src/Validation/ValidatorAwareTrait.php <ide> protected function createValidator(string $name): Validator <ide> throw new RuntimeException($message); <ide> } <ide> <del> // @codingStandardsIgnoreLine <ide> $validator = new $this->_validatorClass(); <ide> $validator = $this->$method($validator); <ide> if ($this instanceof EventDispatcherInterface) {
3
PHP
PHP
remove return type
544891bba4bb97a68f752fcde675bdb2c21c4cfc
<ide><path>src/Illuminate/Database/Eloquent/Relations/MorphTo.php <ide> public function getDictionary() <ide> * <ide> * @return \Illuminate\Database\Eloquent\Relations\MorphTo <ide> */ <del> public function withMorph(string $modelClass, array $with): self <add> public function withMorph(string $modelClass, array $with) <ide> { <ide> $this->typedEagerLoads[$modelClass] = array_merge( <ide> $this->typedEagerLoads[$modelClass] ?? [],
1
PHP
PHP
use new method
9be879a841cb65a3e192d2cf73b48bee69890ec7
<ide><path>src/Core/App.php <ide> public static function path(string $type, ?string $plugin = null): array <ide> } <ide> if (!empty($plugin)) { <ide> if ($type === 'Template') { <del> return [Plugin::path($plugin) . 'templates' . DIRECTORY_SEPARATOR]; <add> return [Plugin::templatePath($plugin)]; <ide> } <ide> <ide> return [Plugin::classPath($plugin) . $type . DIRECTORY_SEPARATOR]; <ide><path>src/Shell/Task/ExtractTask.php <ide> public function main(): void <ide> if (!Plugin::isLoaded($plugin)) { <ide> throw new MissingPluginException(['plugin' => $plugin]); <ide> } <del> $this->_paths = [Plugin::classPath($plugin), Plugin::path($plugin) . 'templates']; <add> $this->_paths = [Plugin::classPath($plugin), Plugin::templatePath($plugin)]; <ide> $this->params['plugin'] = $plugin; <ide> } else { <ide> $this->_getPaths();
2
Python
Python
fix failing test on mssql
7bff44fba83933de1b420fbb4fc3655f28769bd0
<ide><path>tests/jobs/test_local_task_job.py <ide> def test_mark_success_no_kill(self): <ide> ti = TaskInstance(task=task, execution_date=DEFAULT_DATE) <ide> ti.refresh_from_db() <ide> job1 = LocalTaskJob(task_instance=ti, ignore_ti_state=True) <add> settings.engine.dispose() <ide> process = multiprocessing.Process(target=job1.run) <ide> process.start() <ide> for _ in range(0, 50): <ide> def test_mark_success_no_kill(self): <ide> session.merge(ti) <ide> session.commit() <ide> <del> process.join(timeout=10) <add> process.join() <ide> assert not process.is_alive() <ide> ti.refresh_from_db() <ide> assert State.SUCCESS == ti.state <ide> def test_mark_success_on_success_callback(self, dag_maker): <ide> def success_callback(context): <ide> with shared_mem_lock: <ide> success_callback_called.value += 1 <add> <ide> assert context['dag_run'].dag_id == 'test_mark_success' <ide> <ide> def task_function(ti): <del> <ide> time.sleep(60) <add> <ide> # This should not happen -- the state change should be noticed and the task should get killed <ide> with shared_mem_lock: <ide> task_terminated_externally.value = 0 <ide> def task_function(ti): <ide> ti.state = State.SUCCESS <ide> session.merge(ti) <ide> session.commit() <del> <del> process.join(timeout=10) <add> ti.refresh_from_db() <add> process.join() <ide> assert success_callback_called.value == 1 <ide> assert task_terminated_externally.value == 1 <ide> assert not process.is_alive() <ide> def task_function(ti): <ide> process = multiprocessing.Process(target=job1.run) <ide> process.start() <ide> time.sleep(0.3) <del> process.join(timeout=10) <add> process.join() <ide> assert failure_callback_called.value == 1 <ide> assert task_terminated_externally.value == 1 <ide> assert not process.is_alive() <ide> def task_function(ti): <ide> time.sleep(0.2) <ide> os.kill(process.pid, signal.SIGTERM) <ide> ti.refresh_from_db() <del> process.join(timeout=10) <add> process.join() <ide> assert failure_callback_called.value == 1 <ide> assert task_terminated_externally.value == 1 <ide> assert not process.is_alive()
1
Text
Text
add a note about verbose output for rn packager
ee0b19a528e50c6e3ff42626b91bea1cd9546129
<ide><path>packager/README.md <ide> Given an entry point module. Recursively collect all the dependent <ide> modules and return it as an array. `options` is the same options that <ide> is passed to `ReactPackager.middleware` <ide> <add>## Debugging <add> <add>To get verbose output when running the packager, define an environment variable: <add> <add> export DEBUG=ReactNativePackager <add> <add>The `/debug` endpoint discussed above is also useful. <add> <ide> ## FAQ <ide> <ide> ### Can I use this in my own non-React Native project?
1
PHP
PHP
remove unnecessary alias
ca3c8c3e564f6e99162eab8a9bac054ffc416267
<ide><path>app/Http/Controllers/HomeController.php <ide> <?php namespace App\Http\Controllers; <ide> <add>use Illuminate\Routing\Controller; <add> <ide> class HomeController extends Controller { <ide> <ide> /* <ide><path>config/app.php <ide> 'Blade' => 'Illuminate\Support\Facades\Blade', <ide> 'Cache' => 'Illuminate\Support\Facades\Cache', <ide> 'Config' => 'Illuminate\Support\Facades\Config', <del> 'App\Http\Controllers\Controller' => 'Illuminate\Routing\Controller', <ide> 'Cookie' => 'Illuminate\Support\Facades\Cookie', <ide> 'Crypt' => 'Illuminate\Support\Facades\Crypt', <ide> 'DB' => 'Illuminate\Support\Facades\DB',
2
Javascript
Javascript
remove debugging cruft
aba456d48fb58d1ece980a542abb5e38476930ac
<ide><path>packages/sproutcore-touch/tests/gesture_recognizers/pan_test.js <ide> test("If the touches move, the translation should reflect the change", function( <ide> }] <ide> }; <ide> <del> window.foo=true; <ide> view.$().trigger(touchEvent); <del> window.foo=false; <ide> <ide> equals(get(get(get(view, 'eventManager'), 'gestures')[0], 'state'),SC.Gesture.BEGAN, "gesture should be BEGAN"); <ide>
1
Go
Go
fix default tmpfs size to prevent breakage
982c5f199fe548ecafd53ab72e7984a6ce07ba8f
<ide><path>daemon/oci_linux.go <ide> func setMounts(daemon *Daemon, s *specs.Spec, c *container.Container, mounts []c <ide> } <ide> <ide> if m.Source == "tmpfs" { <del> options := []string{"noexec", "nosuid", "nodev", volume.DefaultPropagationMode, "size=65536k"} <add> options := []string{"noexec", "nosuid", "nodev", volume.DefaultPropagationMode} <ide> if m.Data != "" { <ide> options = append(options, strings.Split(m.Data, ",")...) <ide> } <ide><path>integration-cli/docker_cli_run_unix_test.go <ide> func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) { <ide> func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *check.C) { <ide> testRequires(c, DaemonIsLinux) <ide> <del> expectedOptions := []string{"rw", "nosuid", "nodev", "noexec", "relatime", "size=65536k"} <add> expectedOptions := []string{"rw", "nosuid", "nodev", "noexec", "relatime"} <ide> out, _ := dockerCmd(c, "run", "--tmpfs", "/tmp", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'") <ide> for _, option := range expectedOptions { <ide> c.Assert(out, checker.Contains, option) <ide> } <add> c.Assert(out, checker.Not(checker.Contains), "size=") <ide> <del> expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime", "size=65536k"} <add> expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime"} <ide> out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'") <ide> for _, option := range expectedOptions { <ide> c.Assert(out, checker.Contains, option) <ide> } <add> c.Assert(out, checker.Not(checker.Contains), "size=") <ide> <ide> expectedOptions = []string{"rw", "nosuid", "nodev", "relatime", "size=8192k"} <ide> out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,exec,size=8192k", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
2
Python
Python
add test for ticket #339
1c36f49e3964e894f03a7b97b75096f4634ae3b3
<ide><path>numpy/core/tests/test_regression.py <ide> def check_dtype_posttuple(self, level=rlevel): <ide> """Ticket #335""" <ide> N.dtype([('col1', '()i4')]) <ide> <add> def check_mgrid_single_element(self, level=rlevel): <add> """Ticket #339""" <add> assert_array_equal(N.mgrid[0:0:1j],[0]) <add> assert_array_equal(N.mgrid[0:0],[]) <add> <ide> def check_numeric_carray_compare(self, level=rlevel): <ide> """Ticket #341""" <ide> assert_equal(N.array([ 'X' ], 'c'),'X')
1